initial
This commit is contained in:
commit
9883323161
17470 files changed
+4470592
No files matched your search
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||
"apiVersion": 3,
|
||||
"name": "jetpack/map",
|
||||
"title": "Map",
|
||||
"description": "Add an interactive map showing one or more locations.",
|
||||
"keywords": [
|
||||
"maps",
|
||||
"location",
|
||||
"navigation"
|
||||
],
|
||||
"version": "12.5.0",
|
||||
"textdomain": "jetpack",
|
||||
"category": "embed",
|
||||
"icon": "<svg viewBox='0 0 24 24' width='24' height='24' xmlns='http://www.w3.org/2000/svg'><path d='M20.5 3l-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5zM10 5.47l4 1.4v11.66l-4-1.4V5.47zm-5 .99l3-1.01v11.7l-3 1.16V6.46zm14 11.08l-3 1.01V6.86l3-1.16v11.84z' /></svg>",
|
||||
"supports": {
|
||||
"defaultStylePicker": false,
|
||||
"html": false
|
||||
},
|
||||
"attributes": {
|
||||
"align": {
|
||||
"type": "string"
|
||||
},
|
||||
"points": {
|
||||
"type": "array",
|
||||
"default": []
|
||||
},
|
||||
"address": {
|
||||
"type": "string",
|
||||
"default": ""
|
||||
},
|
||||
"mapDetails": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"zoom": {
|
||||
"type": "integer",
|
||||
"default": 13
|
||||
},
|
||||
"mapCenter": {
|
||||
"type": "object",
|
||||
"default": {
|
||||
"longitude": -122.41941550000001,
|
||||
"latitude": 37.7749295
|
||||
}
|
||||
},
|
||||
"markerColor": {
|
||||
"type": "string",
|
||||
"default": "red"
|
||||
},
|
||||
"scrollToZoom": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"mapHeight": {
|
||||
"type": "integer"
|
||||
},
|
||||
"showFullscreenButton": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
}
|
||||
},
|
||||
"example": {},
|
||||
"editorScript": "jetpack-blocks-editor"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('wp-dom-ready', 'wp-polyfill'), 'version' => 'e6c6ed22d3b10da7a9e7');
|
||||
@@ -0,0 +1 @@
|
||||
.wp-block-group-is-layout-flex:not(.is-vertical)>.wp-block-jetpack-map{flex-basis:100%}.wp-block-group-is-layout-flex.is-vertical>.wp-block-jetpack-map{width:100%}.wp-block-jetpack-map .wp-block-jetpack-map__gm-container{background:#e0e0e0;min-height:400px;overflow:hidden;text-align:start;width:100%}.wp-block-jetpack-map .mapkit-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;max-width:300px;min-width:150px;padding:10px 10px 15px;pointer-events:auto}.wp-block-jetpack-map .mapkit-popup-content h3{font-size:1.3125em;font-weight:400;margin-bottom:.5rem}.wp-block-jetpack-map .mapkit-popup-content p{margin-bottom:0}.wp-block-jetpack-map .wp-block-jetpack-map__mb-container{height:400px}.wp-block-jetpack-map .mapboxgl-popup h3{font-size:1.3125em;font-weight:400;margin-bottom:.5rem}.wp-block-jetpack-map .mapboxgl-popup p{margin-bottom:0}.wp-block-jetpack-map .mapboxgl-popup{max-width:300px}.wp-block-jetpack-map .mapboxgl-ctrl-group button{background-color:#0000!important;border-radius:0}.wp-block-jetpack-map-marker{height:38px;opacity:.9;width:32px}
|
||||
@@ -0,0 +1 @@
|
||||
(()=>{var t={50221(){},64525(){},82063(t,e,i){"use strict";function o(t,e){return{default:{details:"mapbox://styles/automattic/cjolkhmez0qdd2ro82dwog1in",no_details:"mapbox://styles/automattic/cjolkci3905d82soef4zlmkdo"},black_and_white:{details:"mapbox://styles/automattic/cjolkixvv0ty42spgt2k4j434",no_details:"mapbox://styles/automattic/cjolkgc540tvj2spgzzoq37k4"},satellite:{details:"mapbox://styles/mapbox/satellite-streets-v10",no_details:"mapbox://styles/mapbox/satellite-v9"},terrain:{details:"mapbox://styles/automattic/cjolkf8p405fh2soet2rdt96b",no_details:"mapbox://styles/automattic/cjolke6fz12ys2rpbpvgl12ha"}}[t][e?"details":"no_details"]}i.d(e,{o:()=>o})},16815(t,e,i){"use strict";i.d(e,{BY:()=>r,ES:()=>s,_t:()=>n,iU:()=>a,jF:()=>o});const o=t=>Object.hasOwn(t,"lat")&&Object.hasOwn(t,"lng")?t:{lat:t.latitude||0,lng:t.longitude||0};function s(t,e){const i=new t.LngLatBounds;return e.forEach(t=>{i.extend([t.coordinates.longitude,t.coordinates.latitude])}),i}function n(t,e){t.fitBounds(e,{padding:{top:80,bottom:80,left:40,right:40}})}function a(t,e){t.innerHTML=`\n\t\t<?xml version="1.0" encoding="UTF-8"?>\n\t\t<svg version="1.1" viewBox="0 0 32 38" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n\t\t\t<g fill-rule="evenodd">\n\t\t\t\t<path id="d" d="m16 38s16-11.308 16-22-7.1634-16-16-16-16 5.3076-16 16 16 22 16 22z" fill="${e}"/>\n\t\t\t</g>\n\t\t</svg>\n\t`}function r(t){return new t.Popup({closeButton:!0,closeOnClick:!1,offset:{left:[0,0],top:[0,5],right:[0,0],bottom:[0,-40]}})}},42470(t,e,i){"use strict";i.d(e,{IR:()=>r,Yc:()=>a,c6:()=>n});var o=i(34377);function s(t){return Math.abs(6371e3*Math.cos(t*Math.PI/180)*2*Math.PI/256)}function n(t,e){return 512/Math.pow(2,t)*.5*s(e)}function a(t,e){return new Promise(i=>{if(e.mapkitScriptIsLoading)(0,o.Cu)(e,"mapkit").then(t=>{i(t)});else{e.mapkitScriptIsLoading=!0;const s=t.createElement("script");s.addEventListener("load",async()=>{const t=await(0,o.Cu)(e,"mapkit");e.mapkitScriptIsLoading=!1,i(t)},{once:!0}),s.src="https://cdn.apple-mapkit.com/mk/5.x.x/mapkit.js",s.crossOrigin="anonymous",t.head.appendChild(s)}})}function r(t,e,i){return new Promise((e,o)=>{i.mapkitIsInitialized?e():i.mapkitIsInitializing?function(t){return new Promise((e,i)=>{const o=()=>{void 0===t.mapkitIsInitializing?i():!1===t.mapkitIsInitializing?e():t.requestAnimationFrame(o)};o()})}(i).then(()=>{e()}):(i.mapkitIsInitializing=!0,i.mapkitIsInitialized=!1,t.init({authorizationCallback:async t=>{try{const s=await fetch("https://public-api.wordpress.com/wpcom/v2/mapkit");if(200===s.status){t((await s.json()).wpcom_mapkit_access_token)}else o();i.mapkitIsInitializing=!1,i.mapkitIsInitialized=!0,e()}catch{o()}}}))})}},91844(t,e,i){"use strict";i.d(e,{A:()=>o});const o=(t,e=null)=>{if(e)t.style.height=e+"px";else{const e=t.offsetWidth,i=window.location.search.indexOf("map-block-counter")>-1?window.innerHeight:.8*window.innerHeight,o=Math.min(e*(3/4),i);t.style.height=o+"px"}}},18109(t,e,i){"use strict";i.d(e,{i:()=>s.A,p:()=>o.A});var o=i(2370),s=i(56955)},2370(t,e,i){"use strict";i.d(e,{A:()=>c});var o=i(34377),s=i(71738),n=i(55740),a=i(82063),r=i(16815),l=i(91844);i(64525),i(50221);const c=class{constructor(t,e=()=>{}){this.root=t;const{currentDoc:i,currentWindow:s}=(0,o.sG)(this.root);this.document=i,this.window=s,this.onError=e;const n=this.root.getAttribute("data-map-id"),a=window.JetpackMapBlockData&&n?window.JetpackMapBlockData[n]:null;this.mapStyle=a?.mapStyle||this.root.getAttribute("data-map-style")||"default",this.mapDetails=a?.mapDetails??"true"===this.root.getAttribute("data-map-details"),this.apiKey=this.root.getAttribute("data-api-key")||null,this.scrollToZoom=a?.scrollToZoom??"true"===this.root.getAttribute("data-scroll-to-zoom"),this.showFullscreenButton=a?.showFullscreenButton??"true"===this.root.getAttribute("data-show-fullscreen-button"),this.points=a?.points||JSON.parse(this.root.getAttribute("data-points")||"[]"),this.mapCenter=a?.mapCenter||JSON.parse(this.root.getAttribute("data-map-center")||"{}"),this.mapHeight=a?.mapHeight||this.root.getAttribute("data-map-height")||null,this.markerColor=a?.markerColor||this.root.getAttribute("data-marker-color")||"red";const r=a?.zoom??this.root.getAttribute("data-zoom");this.zoom=null!=r?parseInt(r,10):13,this.activeMarker=null;const l=this.root.querySelector("ul");if(l&&(l.style.display="none"),!this.apiKey||!this.apiKey.length)throw new Error("API key missing")}initDOM(){this.root.innerHTML='<div class="wp-block-jetpack-map__gm-container"></div>',this.container=this.root.querySelector(".wp-block-jetpack-map__gm-container")}loadMapLibraries(){return new Promise(t=>{const e={"mapbox-gl-js":()=>{(0,o.Cu)(this.window,"mapboxgl").then(e=>{this.mapboxgl=e,e.accessToken=this.apiKey,t(e)})}};(0,o.a$)(n,e,this.root)})}initMap(){try{this.map=new this.mapboxgl.Map({container:this.container,style:(0,a.o)(this.mapStyle,this.mapDetails),center:(0,r.jF)(this.mapCenter),zoom:this.zoom,pitchWithRotate:!1,aLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
.wp-block-group-is-layout-flex:not(.is-vertical)>.wp-block-jetpack-map{flex-basis:100%}.wp-block-group-is-layout-flex.is-vertical>.wp-block-jetpack-map{width:100%}.wp-block-jetpack-map .wp-block-jetpack-map__gm-container{background:#e0e0e0;min-height:400px;overflow:hidden;text-align:start;width:100%}.wp-block-jetpack-map .mapkit-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;max-width:300px;min-width:150px;padding:10px 10px 15px;pointer-events:auto}.wp-block-jetpack-map .mapkit-popup-content h3{font-size:1.3125em;font-weight:400;margin-bottom:.5rem}.wp-block-jetpack-map .mapkit-popup-content p{margin-bottom:0}.wp-block-jetpack-map .wp-block-jetpack-map__mb-container{height:400px}.wp-block-jetpack-map .mapboxgl-popup h3{font-size:1.3125em;font-weight:400;margin-bottom:.5rem}.wp-block-jetpack-map .mapboxgl-popup p{margin-bottom:0}.wp-block-jetpack-map .mapboxgl-popup{max-width:300px}.wp-block-jetpack-map .mapboxgl-ctrl-group button{background-color:#0000!important;border-radius:0}.wp-block-jetpack-map-marker{height:38px;opacity:.9;width:32px}
|
||||
Reference in new issue
Block a user