@mapvx/web-components 0.0.25 → 0.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -3
- package/dist/cjs/{base-floor-selector-C1G5K9Er.cjs → base-floor-selector-CLFTtgbp.cjs} +2 -2
- package/dist/cjs/{class-map-BQQ7MXll.cjs → class-map-BTH_74Qs.cjs} +2 -2
- package/dist/cjs/{compact-floor-selector-DsMWGOFg.cjs → compact-floor-selector-CUgAJzTC.cjs} +2 -2
- package/dist/cjs/{consume-DRj4CYCX.cjs → consume-DvEpk7ME.cjs} +2 -2
- package/dist/cjs/custom-map-BT2xrMK_.cjs +97 -0
- package/dist/cjs/{floor-selector-CDmDuSiD.cjs → floor-selector-_ZGeTisd.cjs} +2 -2
- package/dist/cjs/{lazy-load-Dn0YjnPb.cjs → lazy-load-C0UlvHkw.cjs} +2 -2
- package/dist/cjs/map-view-with-modal.cjs +6 -6
- package/dist/cjs/{qr-modal-DViSVtZI.cjs → qr-modal-dwEr6sDk.cjs} +2 -2
- package/dist/cjs/{route-options-CyEO6vv_.cjs → route-options-5hZvnUEf.cjs} +2 -2
- package/dist/cjs/route-view-totems.cjs +3 -3
- package/dist/es/assets/{compact-floor-selector-CoQYAD6z.js → compact-floor-selector-oq3Ovsm1.js} +3 -3
- package/dist/es/assets/{components-BQGHQSdV.js → components-BT9NDTry.js} +53 -14
- package/dist/es/assets/{map-view-with-modal-SkmapEWH.js → map-view-with-modal-DiR8q30Q.js} +46 -4
- package/dist/es/assets/{route-view-totems-eQTxU-id.js → route-view-totems-CdM6PRGO.js} +57 -9
- package/dist/es/assets/{utils-CWtvoL4a.js → utils-DM-AJZn2.js} +136 -28
- package/dist/es/index.js +2 -2
- package/dist/es/route-view-totems.js +2 -2
- package/dist/iife/map-view-with-modal.js +2 -2
- package/dist/iife/route-view-totems.js +4 -4
- package/dist/sw/mvx-tiles-sw.js +63 -0
- package/package.json +3 -2
- package/dist/cjs/custom-map-DDdkf9Am.cjs +0 -97
- package/dist/components/custom-map.d.ts +0 -13
- package/dist/components/custom-map.js +0 -64
- package/dist/components/floor-selector.d.ts +0 -6
- package/dist/components/floor-selector.js +0 -40
- package/dist/components/qr-modal.d.ts +0 -7
- package/dist/components/qr-modal.js +0 -69
- package/dist/components/route-options.d.ts +0 -6
- package/dist/components/route-options.js +0 -51
- package/dist/components/zoom-controls.d.ts +0 -6
- package/dist/components/zoom-controls.js +0 -40
- package/dist/route-view-totems.d.ts +0 -16
- package/dist/route-view-totems.js +0 -58
- package/dist/utils/styles.d.ts +0 -2
- package/dist/utils/styles.js +0 -5
package/README.md
CHANGED
|
@@ -26,6 +26,15 @@ npm install @mapvx/web-components
|
|
|
26
26
|
https://unpkg.com/@mapvx/web-components/dist/iife/<component>
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
+
## Service Worker (cache de tiles/assets)
|
|
30
|
+
|
|
31
|
+
Los componentes registran automáticamente un Service Worker en `/mvx-tiles-sw.js` si existe en la raíz del sitio (HTTPS).
|
|
32
|
+
|
|
33
|
+
- Última versión lista para copiar: `https://unpkg.com/@mapvx/web-components@latest/dist/sw/mvx-tiles-sw.js`
|
|
34
|
+
- Estrategia: PBF en CacheFirst (24h) y otros assets en StaleWhileRevalidate para dominios `*.mapvx.com` y `*.lazarillo.app`.
|
|
35
|
+
|
|
36
|
+
Guía completa (scripts para Drupal, ejemplos y snippet del SW) en la documentación: ver `docs/pages/es/examples.mdx` o `docs/pages/en/examples.mdx`.
|
|
37
|
+
|
|
29
38
|
## Build Structure
|
|
30
39
|
|
|
31
40
|
```
|
|
@@ -39,9 +48,11 @@ dist/
|
|
|
39
48
|
│ ├── index.cjs
|
|
40
49
|
│ ├── map-view-with-modal.cjs
|
|
41
50
|
│ └── route-view-totems.cjs
|
|
42
|
-
|
|
43
|
-
├── route-view-totems.js
|
|
44
|
-
└── map-view-with-modal.js
|
|
51
|
+
├── iife/ # Build for IIFE
|
|
52
|
+
│ ├── route-view-totems.js
|
|
53
|
+
│ └── map-view-with-modal.js
|
|
54
|
+
└── sw/
|
|
55
|
+
└── mvx-tiles-sw.js
|
|
45
56
|
```
|
|
46
57
|
|
|
47
58
|
The build directory structure is organized as follows:
|
|
@@ -52,6 +63,8 @@ The build directory structure is organized as follows:
|
|
|
52
63
|
|
|
53
64
|
- `dist/iife/`: Contains the IIFE (Immediately Invoked Function Expression) build, which encapsulates all code in a self-executing function to avoid polluting the global scope.
|
|
54
65
|
|
|
66
|
+
- `dist/sw/`: Contains the Service Worker file that you can copy to your site's root.
|
|
67
|
+
|
|
55
68
|
## Available Components
|
|
56
69
|
|
|
57
70
|
### route-view-totems
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("./consume-
|
|
2
|
-
//# sourceMappingURL=base-floor-selector-
|
|
1
|
+
"use strict";const e=require("./consume-DvEpk7ME.cjs"),t=require("./lazy-load-C0UlvHkw.cjs");var r=Object.defineProperty;class o extends t.i{getFloors(){if(!this.sdkData)return[];const{parentPlace:e,generalConfig:t}=this.sdkData;let r=e?.innerFloors||[];return t?.enabledFloors?.length>0&&(r=r.filter((e=>t.enabledFloors.includes(e.key)))),r}getCurrentFloor(){return this.sdkData?.currentFloor}getEnabledFloors(){return this.sdkData?.enabledFloors||[]}isFloorActive(e){const t=this.getCurrentFloor();return e.key===t?.key}isFloorEnabled(e){return this.getEnabledFloors().some((t=>t.key===e.key))}selectFloor(e){this.dispatchEvent(new CustomEvent("floorChange",{detail:e,bubbles:!0,composed:!0}))}getFloorDisplayName(e){return e.name||e.title||e.key}}((e,t,o)=>{for(var s,l=void 0,n=e.length-1;n>=0;n--)(s=e[n])&&(l=s(t,o,l)||l);l&&r(t,o,l)})([e.c({context:t.sdkContext,subscribe:!0})],o.prototype,"sdkData"),exports.BaseFloorSelector=o;
|
|
2
|
+
//# sourceMappingURL=base-floor-selector-CLFTtgbp.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const t=require("./lazy-load-
|
|
1
|
+
"use strict";const t=require("./lazy-load-C0UlvHkw.cjs"),s=1;
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2017 Google LLC
|
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
* Copyright 2018 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
11
|
*/const r=(t=>(...s)=>({_$litDirective$:t,values:s}))(class extends e{constructor(t){if(super(t),t.type!==s||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((s=>t[s])).join(" ")+" "}update(s,[e]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const r=s.element.classList;for(const t of this.st)t in e||(r.remove(t),this.st.delete(t));for(const t in e){const s=!!e[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)))}return t.T}});exports.e=r;
|
|
12
|
-
//# sourceMappingURL=class-map-
|
|
12
|
+
//# sourceMappingURL=class-map-BTH_74Qs.cjs.map
|
package/dist/cjs/{compact-floor-selector-DsMWGOFg.cjs → compact-floor-selector-CUgAJzTC.cjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./lazy-load-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./lazy-load-C0UlvHkw.cjs"),r=require("./class-map-BTH_74Qs.cjs"),e=require("./base-floor-selector-CLFTtgbp.cjs");var t,l=Object.defineProperty,s=Object.getOwnPropertyDescriptor,i=o=>{throw TypeError(o)},a=(o,r,e,t)=>{for(var i,a=t>1?void 0:t?s(r,e):r,n=o.length-1;n>=0;n--)(i=o[n])&&(a=(t?i(r,e,a):i(a))||a);return t&&a&&l(r,e,a),a},n=(o,r,e)=>r.has(o)||i("Cannot "+e);exports.CompactFloorSelector=class extends e.BaseFloorSelector{constructor(){var o,r,e;super(...arguments),o=this,e=!1,(r=t).has(o)?i("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(o):r.set(o,e),this.isOpen=!1,this._handleClickOutside=o=>{this.isOpen&&!this.shadowRoot?.contains(o.target)&&(this.isOpen=!1,this.requestUpdate())}}get disabled(){return n(o=this,r=t,"read from private field"),e?e.call(o):r.get(o);var o,r,e}set disabled(o){var r,e,l;l=o,n(r=this,e=t,"write to private field"),e.set(r,l)}_toggleDropdown(o){this.disabled||(o.stopPropagation(),this.isOpen=!this.isOpen,this.requestUpdate())}_selectFloor(o){this.disabled||(this.selectFloor(o),this.isOpen=!1,this.requestUpdate())}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleClickOutside)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleClickOutside)}render(){if(!this.sdkData)return o.x`<div>No data</div>`;const e=this.getFloors(),t=this.getCurrentFloor(),l=t?this.getFloorDisplayName(t):"Seleccionar piso";return o.x`
|
|
2
2
|
<div class="floor-dropdown">
|
|
3
3
|
<button
|
|
4
4
|
class=${r.e({"floor-button":!0,active:!!t,open:this.isOpen})}
|
|
@@ -173,4 +173,4 @@
|
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
`],a([o.n({type:Boolean})],exports.CompactFloorSelector.prototype,"disabled",1),exports.CompactFloorSelector=a([o.t("compact-floor-selector")],exports.CompactFloorSelector);
|
|
176
|
-
//# sourceMappingURL=compact-floor-selector-
|
|
176
|
+
//# sourceMappingURL=compact-floor-selector-CUgAJzTC.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const s=require("./lazy-load-
|
|
1
|
+
"use strict";const s=require("./lazy-load-C0UlvHkw.cjs");
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2021 Google LLC
|
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
* Copyright 2022 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
11
|
*/exports.c=function({context:s,subscribe:i}){return(c,e)=>{"object"==typeof e?e.addInitializer((function(){new t(this,{context:s,callback:s=>{c.set.call(this,s)},subscribe:i})})):c.constructor.addInitializer((c=>{new t(c,{context:s,callback:s=>{c[e]=s},subscribe:i})}))}};
|
|
12
|
-
//# sourceMappingURL=consume-
|
|
12
|
+
//# sourceMappingURL=consume-DvEpk7ME.cjs.map
|