@cocoar/vue-map 3.4.0-beta.8 → 4.0.0-beta.44

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.
@@ -36,6 +36,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {
36
36
  index: number;
37
37
  }) => any) | undefined;
38
38
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
39
+ rootEl: HTMLDivElement;
39
40
  mapEl: HTMLDivElement;
40
41
  }, HTMLDivElement>;
41
42
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"CoarMap.vue.d.ts","sourceRoot":"","sources":["../src/CoarMap.vue"],"names":[],"mappings":"AA4UA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAU5D,OAAO,yBAAyB,CAAC;AAIjC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,4EAA4E;IAC5E,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,yFAAyF;IACzF,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAiLF;;;GAGG;AACH,iBAAS,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAMvC;AAED,mEAAmE;AACnE,iBAAS,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAIlD;;;;;;;eA7L0B,QAAQ;eAAS,MAAM;;;;;eAAvB,QAAQ;eAAS,MAAM;;;;;AA8TlD,wBAUG"}
1
+ {"version":3,"file":"CoarMap.vue.d.ts","sourceRoot":"","sources":["../src/CoarMap.vue"],"names":[],"mappings":"AAkVA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAW5D,OAAO,yBAAyB,CAAC;AAEjC,OAAO,4BAA4B,CAAC;AAIpC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,4EAA4E;IAC5E,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,yFAAyF;IACzF,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAoLF;;;GAGG;AACH,iBAAS,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAMvC;AAED,mEAAmE;AACnE,iBAAS,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAIlD;;;;;;;eAhM0B,QAAQ;eAAS,MAAM;;;;;eAAvB,QAAQ;eAAS,MAAM;;;;;;AAuUlD,wBAUG"}
@@ -21,6 +21,7 @@ declare function __VLS_template(): {
21
21
  }): any;
22
22
  };
23
23
  refs: {
24
+ rootEl: HTMLDivElement;
24
25
  mapEl: HTMLDivElement;
25
26
  };
26
27
  rootEl: HTMLDivElement;
@@ -49,6 +50,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
49
50
  }) => any) | undefined;
50
51
  "onUpdate:data"?: ((args_0: MapData) => any) | undefined;
51
52
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
53
+ rootEl: HTMLDivElement;
52
54
  mapEl: HTMLDivElement;
53
55
  }, HTMLDivElement>;
54
56
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
@@ -1 +1 @@
1
- {"version":3,"file":"CoarMapEditor.vue.d.ts","sourceRoot":"","sources":["../src/CoarMapEditor.vue"],"names":[],"mappings":"AAmOA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAI5D,OAAO,yBAAyB,CAAC;AAEjC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,4EAA4E;IAC5E,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,iFAAiF;IACjF,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AA+DF,iBAAS,cAAc;WAmIT,OAAO,IAA6B;;;;;;;;;YAXhB,GAAG;;;;;;EAgBpC;AAsBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;eAxNM,QAAQ;eAAS,MAAM;;;;;;eAAvB,QAAQ;eAAS,MAAM;;;;;kBAkOhD,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"CoarMapEditor.vue.d.ts","sourceRoot":"","sources":["../src/CoarMapEditor.vue"],"names":[],"mappings":"AAyOA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAK5D,OAAO,yBAAyB,CAAC;AAEjC,OAAO,4BAA4B,CAAC;AAEpC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,4EAA4E;IAC5E,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,iFAAiF;IACjF,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAkEF,iBAAS,cAAc;WAuIT,OAAO,IAA6B;;;;;;;;;YAZhB,GAAG;;;;;;;EAiBpC;AAwBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;eAjOM,QAAQ;eAAS,MAAM;;;;;;eAAvB,QAAQ;eAAS,MAAM;;;;;;kBA2OhD,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CoarMapPointList.vue.d.ts","sourceRoot":"","sources":["../src/CoarMapPointList.vue"],"names":[],"mappings":"AA8RA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAI5D,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,yEAAyE;IACzE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,sDAAsD;IACtD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wDAAwD;IACxD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAyFF,iBAAS,cAAc;WA8JT,OAAO,IAA6B;;;;;;YAVzB,GAAG;;;;EAe3B;AAuBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;+FAQnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"CoarMapPointList.vue.d.ts","sourceRoot":"","sources":["../src/CoarMapPointList.vue"],"names":[],"mappings":"AAmSA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAI5D,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,yEAAyE;IACzE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,sDAAsD;IACtD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wDAAwD;IACxD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAyFF,iBAAS,cAAc;WA8JT,OAAO,IAA6B;;;;;;YAVzB,GAAG;;;;EAe3B;AAuBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;+FAQnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
package/dist/index.css CHANGED
@@ -1,2 +1,2 @@
1
- .coar-map{flex-direction:column;gap:8px;display:flex}.coar-map__canvas{width:100%;height:var(--coar-map-height,360px);border-radius:var(--coar-map-radius,10px);background:var(--coar-map-surface,#e8eef3);overflow:hidden}.coar-map-pin{background:var(--coar-map-pin-color,#3b82f6);border:2px solid #fff;border-radius:50%;justify-content:center;align-items:center;width:26px;height:26px;transition:transform .12s,box-shadow .12s;display:flex;box-shadow:0 1px 4px #00000059}.coar-map-pin__emoji{font-size:14px;line-height:1}.coar-map-marker--highlight .coar-map-pin{transform:scale(1.22)}.coar-map-marker--selected .coar-map-pin{box-shadow:0 0 0 3px #3b82f680,0 1px 4px #00000059}path.coar-map-marker--highlight,path.coar-map-marker--selected{stroke-width:4px}.coar-map-popup__note{color:#555;margin-top:2px}.coar-map__caption{color:var(--coar-map-caption-color,#666);margin:0;font-size:13px}.coar-map__nocfg{color:#b91c1c;margin:0;font-size:13px}.coar-map__fallback{color:var(--coar-map-fallback-color,#444);margin:0;padding-left:20px;font-size:13px}.coar-map__fallback-item{margin:2px 0}.coar-map__fallback-emoji{margin-right:6px}.coar-map__fallback-coords{color:#888;font-variant-numeric:tabular-nums;margin-left:6px}.coar-map__legend{flex-wrap:wrap;gap:12px;margin:0;padding:0;font-size:13px;list-style:none;display:flex}.coar-map__legend-item{align-items:center;gap:5px;display:inline-flex}.coar-map__legend-swatch{border-radius:3px;flex-shrink:0;width:12px;height:12px}.coar-map-form{flex-direction:column;gap:8px;min-width:210px;display:flex}.coar-map-form__field{flex-direction:column;gap:3px;display:flex}.coar-map-form__label{color:var(--coar-text-neutral-secondary,#64748b);font-size:11px;font-weight:600}.coar-map-form__actions{flex-wrap:wrap;align-items:center;gap:6px;margin-top:2px;display:flex}.coar-map-form__delete{margin-left:auto}.coar-map-editor__stage{position:relative}.coar-map-editor .coar-map__canvas{cursor:crosshair}.coar-map-editor .coar-map-pin-wrap,.coar-map-editor .coar-map-edit-vertex-wrap{cursor:grab}.coar-map-edit-vertex{box-sizing:border-box;background:#fff;border:2px solid #475569;border-radius:50%;width:14px;height:14px;display:block;box-shadow:0 1px 3px #0000004d}.coar-map-marker--highlight .coar-map-edit-vertex,.coar-map-marker--selected .coar-map-edit-vertex{border-color:#3b82f6;box-shadow:0 0 0 3px #3b82f666}.coar-map-edit-popup{z-index:1000;background:var(--coar-background-neutral-primary,#fff);border:1px solid var(--coar-border-neutral,#e2e8f0);border-radius:10px;padding:12px 12px 10px;position:absolute;transform:translate(-50%,calc(-100% - 20px));box-shadow:0 6px 24px #0f172a2e}.coar-map-edit-popup--below{transform:translate(-50%,20px)}.coar-map-edit-popup__close{z-index:1;position:absolute;top:4px;right:4px}.coar-map-edit-popup:after{content:"";background:var(--coar-background-neutral-primary,#fff);border-right:1px solid var(--coar-border-neutral,#e2e8f0);border-bottom:1px solid var(--coar-border-neutral,#e2e8f0);width:12px;height:12px;position:absolute;bottom:-7px;left:50%;transform:translate(-50%)rotate(45deg)}.coar-map-edit-popup--below:after{border:0;border-left:1px solid var(--coar-border-neutral,#e2e8f0);border-top:1px solid var(--coar-border-neutral,#e2e8f0);top:-7px;bottom:auto}.coar-map-point-list{flex-direction:column;gap:2px;margin:0;padding:4px;list-style:none;display:flex}.coar-map-point-list__row{border-radius:6px;align-items:center;gap:4px;display:flex;position:relative}.coar-map-point-list__row--selected{background:var(--coar-background-accent-secondary,#eef2ff);box-shadow:inset 2px 0 0 var(--coar-background-accent-primary,#6366f1)}.coar-map-point-list__row--drop-before:before,.coar-map-point-list__row--drop-after:after{content:"";background:var(--coar-background-accent-primary,#6366f1);border-radius:2px;height:2px;position:absolute;left:4px;right:4px}.coar-map-point-list__row--drop-before:before{top:-2px}.coar-map-point-list__row--drop-after:after{bottom:-2px}.coar-map-point-list__handle{color:var(--coar-text-neutral-tertiary,#94a3b8);cursor:grab;fill:currentColor;background:0 0;border:0;flex-shrink:0;align-items:center;padding:4px 2px;display:inline-flex}.coar-map-point-list__handle:active{cursor:grabbing}.coar-map-point-list__main{min-width:0;color:inherit;font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:6px;flex:1;grid-template-columns:auto 1fr;align-items:baseline;column-gap:8px;padding:6px 8px;display:grid}.coar-map-point-list__main:hover{background:var(--coar-background-neutral-secondary,#f3f4f6)}.coar-map-point-list__row--selected .coar-map-point-list__main:hover{background:0 0}.coar-map-point-list__emoji{grid-row:span 2}.coar-map-point-list__label{text-overflow:ellipsis;white-space:nowrap;font-weight:600;overflow:hidden}.coar-map-point-list__coords{color:var(--coar-text-neutral-tertiary,#94a3b8);font-variant-numeric:tabular-nums;grid-column:2;font-size:11px}.coar-map-point-list__delete{flex-shrink:0;margin-right:2px}.coar-map-point-list__empty{color:var(--coar-text-neutral-tertiary,#94a3b8);padding:10px 8px;font-size:13px}
1
+ .coar-map{gap:var(--coar-content-gap,8px);flex-direction:column;display:flex}.coar-map__canvas{width:100%;height:var(--coar-map-height,360px);border-radius:var(--coar-map-radius,var(--coar-panel-radius,10px));background:var(--coar-map-surface,#e8eef3);overflow:hidden}.coar-map-pin{background:var(--coar-map-pin-color,#3b82f6);border:2px solid #fff;border-radius:50%;justify-content:center;align-items:center;width:26px;height:26px;transition:transform .12s,box-shadow .12s;display:flex;box-shadow:0 1px 4px #00000059}.coar-map-pin__emoji{font-size:14px;line-height:1}.coar-map-marker--highlight .coar-map-pin{transform:scale(1.22)}.coar-map-marker--selected .coar-map-pin{box-shadow:0 0 0 3px var(--coar-map-selection-ring,#3b82f680), 0 1px 4px #00000059}path.coar-map-marker--highlight,path.coar-map-marker--selected{stroke-width:4px}.coar-map-popup__note{color:var(--coar-map-popup-note-color,var(--coar-map-chrome-text-secondary,#555));margin-top:2px}.coar-map__caption{font-size:var(--coar-map-caption-font-size,var(--coar-caption-font-size,13px));color:var(--coar-map-caption-color,var(--coar-map-text-muted,#666));margin:0}.coar-map__nocfg{font-size:var(--coar-map-font-size,var(--coar-ui-font-size,13px));color:var(--coar-map-error-color,#b91c1c);margin:0}:where(.coar-map,.coar-map-point-list,.coar-map-form){--coar-d-map-text:var(--coar-role-derivation) var(--coar-theme-map-text,var(--coar-text-neutral-secondary,#444));--coar-map-text:var(--coar-d-map-text,inherit);--coar-d-map-text-muted:var(--coar-role-derivation) var(--coar-theme-map-text-muted,var(--coar-text-neutral-tertiary,#666));--coar-map-text-muted:var(--coar-d-map-text-muted,inherit);--coar-d-map-error-color:var(--coar-role-derivation) var(--coar-theme-map-error-color,var(--coar-text-semantic-error-bold,#b91c1c));--coar-map-error-color:var(--coar-d-map-error-color,inherit);--coar-d-map-selection-color:var(--coar-role-derivation) var(--coar-theme-map-selection-color,var(--coar-border-accent-primary,#3b82f6));--coar-map-selection-color:var(--coar-d-map-selection-color,inherit);--coar-d-map-selection-ring:var(--coar-role-derivation) var(--coar-theme-map-selection-ring,color-mix(in srgb, var(--coar-border-accent-primary,#3b82f6) 45%, transparent));--coar-map-selection-ring:var(--coar-d-map-selection-ring,inherit);--coar-d-map-popup-shadow:var(--coar-role-derivation) var(--coar-theme-map-popup-shadow,var(--coar-elevation-high,0 6px 24px #0f172a2e));--coar-map-popup-shadow:var(--coar-d-map-popup-shadow,inherit);--coar-d-map-chrome-font-family:var(--coar-role-derivation) var(--coar-theme-map-chrome-font-family,var(--coar-font-family-body));--coar-map-chrome-font-family:var(--coar-d-map-chrome-font-family,inherit);--coar-d-map-chrome-bg:var(--coar-role-derivation) var(--coar-theme-map-chrome-bg,var(--coar-background-neutral-primary));--coar-map-chrome-bg:var(--coar-d-map-chrome-bg,inherit);--coar-d-map-chrome-bg-muted:var(--coar-role-derivation) var(--coar-theme-map-chrome-bg-muted,var(--coar-background-neutral-secondary));--coar-map-chrome-bg-muted:var(--coar-d-map-chrome-bg-muted,inherit);--coar-d-map-chrome-border:var(--coar-role-derivation) var(--coar-theme-map-chrome-border,var(--coar-border-neutral-tertiary));--coar-map-chrome-border:var(--coar-d-map-chrome-border,inherit);--coar-d-map-chrome-text:var(--coar-role-derivation) var(--coar-theme-map-chrome-text,var(--coar-text-neutral-primary));--coar-map-chrome-text:var(--coar-d-map-chrome-text,inherit);--coar-d-map-chrome-text-secondary:var(--coar-role-derivation) var(--coar-theme-map-chrome-text-secondary,var(--coar-text-neutral-secondary));--coar-map-chrome-text-secondary:var(--coar-d-map-chrome-text-secondary,inherit);--coar-d-map-chrome-text-muted:var(--coar-role-derivation) var(--coar-theme-map-chrome-text-muted,var(--coar-text-neutral-tertiary));--coar-map-chrome-text-muted:var(--coar-d-map-chrome-text-muted,inherit);--coar-d-map-chrome-text-disabled:var(--coar-role-derivation) var(--coar-theme-map-chrome-text-disabled,var(--coar-text-neutral-disabled));--coar-map-chrome-text-disabled:var(--coar-d-map-chrome-text-disabled,inherit);--coar-d-map-chrome-link:var(--coar-role-derivation) var(--coar-theme-map-chrome-link,var(--coar-text-accent-primary));--coar-map-chrome-link:var(--coar-d-map-chrome-link,inherit);--coar-d-map-chrome-shadow:var(--coar-role-derivation) var(--coar-theme-map-chrome-shadow,var(--coar-elevation-low));--coar-map-chrome-shadow:var(--coar-d-map-chrome-shadow,inherit);--coar-d-map-attribution-bg:var(--coar-role-derivation) var(--coar-theme-map-attribution-bg,color-mix(in srgb, var(--coar-background-neutral-primary) 80%, transparent));--coar-map-attribution-bg:var(--coar-d-map-attribution-bg,inherit);--coar-d-map-font-size:var(--coar-role-derivation) var(--coar-theme-map-font-size);--coar-d-map-caption-font-size:var(--coar-role-derivation) var(--coar-theme-map-caption-font-size);--coar-d-map-small-caption-font-size:var(--coar-role-derivation) var(--coar-theme-map-small-caption-font-size);--coar-d-map-label-font-weight:var(--coar-role-derivation) var(--coar-theme-map-label-font-weight);--coar-d-map-coordinate-color:var(--coar-role-derivation) var(--coar-theme-map-coordinate-color);--coar-d-map-editor-selection-ring:var(--coar-role-derivation) var(--coar-theme-map-editor-selection-ring);--coar-d-map-chrome-font-size:var(--coar-role-derivation) var(--coar-theme-map-chrome-font-size);--coar-d-map-chrome-line-height:var(--coar-role-derivation) var(--coar-theme-map-chrome-line-height);--coar-d-map-zoom-font-family:var(--coar-role-derivation) var(--coar-theme-map-zoom-font-family);--coar-d-map-zoom-font-weight:var(--coar-role-derivation) var(--coar-theme-map-zoom-font-weight);--coar-d-map-touch-border:var(--coar-role-derivation) var(--coar-theme-map-touch-border);--coar-d-map-touch-shadow:var(--coar-role-derivation) var(--coar-theme-map-touch-shadow);--coar-d-map-attribution-font-size:var(--coar-role-derivation) var(--coar-theme-map-attribution-font-size);--coar-d-map-leaflet-popup-text:var(--coar-role-derivation) var(--coar-theme-map-leaflet-popup-text);--coar-d-map-leaflet-popup-shadow:var(--coar-role-derivation) var(--coar-theme-map-leaflet-popup-shadow);--coar-d-map-popup-font-size:var(--coar-role-derivation) var(--coar-theme-map-popup-font-size);--coar-d-map-popup-line-height:var(--coar-role-derivation) var(--coar-theme-map-popup-line-height);--coar-d-map-close-hover:var(--coar-role-derivation) var(--coar-theme-map-close-hover);--coar-d-map-tooltip-border:var(--coar-role-derivation) var(--coar-theme-map-tooltip-border);--coar-d-map-tooltip-text:var(--coar-role-derivation) var(--coar-theme-map-tooltip-text);--coar-d-map-tooltip-shadow:var(--coar-role-derivation) var(--coar-theme-map-tooltip-shadow);--coar-d-map-popup-note-color:var(--coar-role-derivation) var(--coar-theme-map-popup-note-color);--coar-map-font-size:var(--coar-d-map-font-size,inherit);--coar-map-caption-font-size:var(--coar-d-map-caption-font-size,inherit);--coar-map-small-caption-font-size:var(--coar-d-map-small-caption-font-size,inherit);--coar-map-label-font-weight:var(--coar-d-map-label-font-weight,inherit);--coar-map-coordinate-color:var(--coar-d-map-coordinate-color,inherit);--coar-map-editor-selection-ring:var(--coar-d-map-editor-selection-ring,inherit);--coar-map-chrome-font-size:var(--coar-d-map-chrome-font-size,inherit);--coar-map-chrome-line-height:var(--coar-d-map-chrome-line-height,inherit);--coar-map-zoom-font-family:var(--coar-d-map-zoom-font-family,inherit);--coar-map-zoom-font-weight:var(--coar-d-map-zoom-font-weight,inherit);--coar-map-touch-border:var(--coar-d-map-touch-border,inherit);--coar-map-touch-shadow:var(--coar-d-map-touch-shadow,inherit);--coar-map-attribution-font-size:var(--coar-d-map-attribution-font-size,inherit);--coar-map-leaflet-popup-text:var(--coar-d-map-leaflet-popup-text,inherit);--coar-map-leaflet-popup-shadow:var(--coar-d-map-leaflet-popup-shadow,inherit);--coar-map-popup-font-size:var(--coar-d-map-popup-font-size,inherit);--coar-map-popup-line-height:var(--coar-d-map-popup-line-height,inherit);--coar-map-close-hover:var(--coar-d-map-close-hover,inherit);--coar-map-tooltip-border:var(--coar-d-map-tooltip-border,inherit);--coar-map-tooltip-text:var(--coar-d-map-tooltip-text,inherit);--coar-map-tooltip-shadow:var(--coar-d-map-tooltip-shadow,inherit);--coar-map-popup-note-color:var(--coar-d-map-popup-note-color,inherit)}.coar-map--role-theme .coar-map__canvas.leaflet-container{font-family:var(--coar-map-chrome-font-family,"Helvetica Neue", Arial, Helvetica, sans-serif);font-size:var(--coar-map-chrome-font-size,var(--coar-ui-font-size,.75rem));line-height:var(--coar-map-chrome-line-height,var(--coar-ui-line-height,1.5))}.coar-map--role-theme .coar-map__canvas .leaflet-bar{border-radius:var(--coar-control-radius,4px);box-shadow:var(--coar-map-chrome-shadow,0 1px 5px #000000a6)}.coar-map--role-theme .coar-map__canvas.leaflet-touch .leaflet-bar{border-color:var(--coar-map-touch-border,var(--coar-map-chrome-border,#0003));box-shadow:var(--coar-map-touch-shadow,var(--coar-map-chrome-shadow,none))}.coar-map--role-theme .coar-map__canvas .leaflet-bar a{background-color:var(--coar-map-chrome-bg,#fff);border-bottom-color:var(--coar-map-chrome-border,#ccc);color:var(--coar-map-chrome-text,black);width:var(--coar-map-target-size,26px);height:var(--coar-map-target-size,26px);line-height:var(--coar-map-target-size,26px)}.coar-map--role-theme .coar-map__canvas.leaflet-touch .leaflet-bar a{width:var(--coar-map-target-size,30px);height:var(--coar-map-target-size,30px);line-height:var(--coar-map-target-size,30px)}.coar-map--role-theme .coar-map__canvas .leaflet-bar a:hover,.coar-map--role-theme .coar-map__canvas .leaflet-bar a:focus{background-color:var(--coar-map-chrome-bg-muted,#f4f4f4)}.coar-map--role-theme .coar-map__canvas .leaflet-bar a.leaflet-disabled{background-color:var(--coar-map-chrome-bg-muted,#f4f4f4);color:var(--coar-map-chrome-text-disabled,#bbb)}.coar-map--role-theme .coar-map__canvas .leaflet-bar a:first-child{border-top-left-radius:var(--coar-control-radius,4px);border-top-right-radius:var(--coar-control-radius,4px)}.coar-map--role-theme .coar-map__canvas .leaflet-bar a:last-child{border-bottom-left-radius:var(--coar-control-radius,4px);border-bottom-right-radius:var(--coar-control-radius,4px)}.coar-map--role-theme .coar-map__canvas.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:var(--coar-control-radius,2px);border-top-right-radius:var(--coar-control-radius,2px)}.coar-map--role-theme .coar-map__canvas.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:var(--coar-control-radius,2px);border-bottom-right-radius:var(--coar-control-radius,2px)}.coar-map--role-theme .coar-map__canvas .leaflet-control-zoom-in,.coar-map--role-theme .coar-map__canvas .leaflet-control-zoom-out{font-family:var(--coar-map-zoom-font-family,var(--coar-map-chrome-font-family,"Lucida Console", Monaco, monospace));font-weight:var(--coar-map-zoom-font-weight,var(--coar-ui-font-weight,bold))}.coar-map--role-theme .coar-map__canvas.leaflet-container .leaflet-control-attribution{background:var(--coar-map-attribution-bg,#fffc);color:var(--coar-map-chrome-text-secondary,#333);font-size:var(--coar-map-attribution-font-size,var(--coar-caption-font-size,inherit))}.coar-map--role-theme .coar-map__canvas .leaflet-control-attribution a{color:var(--coar-map-chrome-link,#0078a8)}.coar-map--role-theme .coar-map__canvas .leaflet-popup-content-wrapper,.coar-map--role-theme .coar-map__canvas .leaflet-popup-tip{background:var(--coar-map-chrome-bg,white);color:var(--coar-map-leaflet-popup-text,var(--coar-map-chrome-text,#333));box-shadow:var(--coar-map-leaflet-popup-shadow,var(--coar-map-popup-shadow,0 3px 14px #0006))}.coar-map--role-theme .coar-map__canvas .leaflet-popup-content-wrapper{border-radius:var(--coar-panel-radius,12px)}.coar-map--role-theme .coar-map__canvas .leaflet-popup-content{font-size:var(--coar-map-popup-font-size,var(--coar-ui-font-size,1.08333em));line-height:var(--coar-map-popup-line-height,var(--coar-ui-line-height,1.3))}.coar-map--role-theme .coar-map__canvas.leaflet-container a.leaflet-popup-close-button{color:var(--coar-map-chrome-text-muted,#757575)}.coar-map--role-theme .coar-map__canvas.leaflet-container a.leaflet-popup-close-button:hover,.coar-map--role-theme .coar-map__canvas.leaflet-container a.leaflet-popup-close-button:focus{color:var(--coar-map-close-hover,var(--coar-map-chrome-text,#585858))}.coar-map--role-theme .coar-map__canvas .leaflet-tooltip{background-color:var(--coar-map-chrome-bg,#fff);border-color:var(--coar-map-tooltip-border,var(--coar-map-chrome-border,#fff));border-radius:var(--coar-control-radius,3px);color:var(--coar-map-tooltip-text,var(--coar-map-chrome-text,#222));box-shadow:var(--coar-map-tooltip-shadow,var(--coar-map-chrome-shadow,0 1px 3px #0006))}.coar-map--role-theme .coar-map__canvas .leaflet-tooltip-top:before{border-top-color:var(--coar-map-chrome-bg,#fff)}.coar-map--role-theme .coar-map__canvas .leaflet-tooltip-bottom:before{border-bottom-color:var(--coar-map-chrome-bg,#fff)}.coar-map--role-theme .coar-map__canvas .leaflet-tooltip-left:before{border-left-color:var(--coar-map-chrome-bg,#fff)}.coar-map--role-theme .coar-map__canvas .leaflet-tooltip-right:before{border-right-color:var(--coar-map-chrome-bg,#fff)}.coar-map__fallback{font-size:var(--coar-map-font-size,var(--coar-ui-font-size,13px));color:var(--coar-map-fallback-color,var(--coar-map-text,#444));margin:0;padding-left:20px}.coar-map__fallback-item{margin:2px 0}.coar-map__fallback-emoji{margin-right:6px}.coar-map__fallback-coords{color:var(--coar-map-coordinate-color,var(--coar-map-text-muted,#888));font-variant-numeric:tabular-nums;margin-left:6px}.coar-map__legend{font-size:var(--coar-map-font-size,var(--coar-ui-font-size,13px));flex-wrap:wrap;gap:12px;margin:0;padding:0;list-style:none;display:flex}.coar-map__legend-item{align-items:center;gap:5px;display:inline-flex}.coar-map__legend-swatch{border-radius:3px;flex-shrink:0;width:12px;height:12px}.coar-map-form{flex-direction:column;gap:8px;min-width:210px;display:flex}.coar-map-form__field{flex-direction:column;gap:3px;display:flex}.coar-map-form__label{font-size:var(--coar-map-small-caption-font-size,var(--coar-caption-font-size,11px));font-weight:var(--coar-map-label-font-weight,var(--coar-label-font-weight,600));color:var(--coar-text-neutral-secondary,#64748b)}.coar-map-form__actions{flex-wrap:wrap;align-items:center;gap:6px;margin-top:2px;display:flex}.coar-map-form__delete{margin-left:auto}.coar-map-editor__stage{position:relative}.coar-map-editor .coar-map__canvas{cursor:crosshair}.coar-map-editor .coar-map-pin-wrap,.coar-map-editor .coar-map-edit-vertex-wrap{cursor:grab}.coar-map-edit-vertex{box-sizing:border-box;background:#fff;border:2px solid #475569;border-radius:50%;width:14px;height:14px;display:block;box-shadow:0 1px 3px #0000004d}.coar-map-marker--highlight .coar-map-edit-vertex,.coar-map-marker--selected .coar-map-edit-vertex{border-color:var(--coar-map-selection-color,#3b82f6);box-shadow:0 0 0 3px var(--coar-map-editor-selection-ring,var(--coar-map-selection-ring,#3b82f666))}.coar-map-edit-popup{z-index:1000;background:var(--coar-background-neutral-primary,#fff);border:1px solid var(--coar-border-neutral,#e2e8f0);border-radius:var(--coar-panel-radius,10px);box-shadow:var(--coar-map-popup-shadow,0 6px 24px #0f172a2e);padding:12px 12px 10px;position:absolute;transform:translate(-50%,calc(-100% - 20px))}.coar-map-edit-popup--below{transform:translate(-50%,20px)}.coar-map-edit-popup__close{z-index:1;position:absolute;top:4px;right:4px}.coar-map-edit-popup:after{content:"";background:var(--coar-background-neutral-primary,#fff);border-right:1px solid var(--coar-border-neutral,#e2e8f0);border-bottom:1px solid var(--coar-border-neutral,#e2e8f0);width:12px;height:12px;position:absolute;bottom:-7px;left:50%;transform:translate(-50%)rotate(45deg)}.coar-map-edit-popup--below:after{border:0;border-left:1px solid var(--coar-border-neutral,#e2e8f0);border-top:1px solid var(--coar-border-neutral,#e2e8f0);top:-7px;bottom:auto}.coar-map-point-list{flex-direction:column;gap:2px;margin:0;padding:4px;list-style:none;display:flex}.coar-map-point-list__row{border-radius:var(--coar-control-radius,6px);align-items:center;gap:4px;display:flex;position:relative}.coar-map-point-list__row--selected{background:var(--coar-background-accent-secondary,#eef2ff);box-shadow:inset 2px 0 0 var(--coar-background-accent-primary,#6366f1)}.coar-map-point-list__row--drop-before:before,.coar-map-point-list__row--drop-after:after{content:"";background:var(--coar-background-accent-primary,#6366f1);border-radius:2px;height:2px;position:absolute;left:4px;right:4px}.coar-map-point-list__row--drop-before:before{top:-2px}.coar-map-point-list__row--drop-after:after{bottom:-2px}.coar-map-point-list__handle{min-width:var(--coar-map-target-size,auto);min-height:var(--coar-map-target-size,auto);color:var(--coar-text-neutral-tertiary,#94a3b8);cursor:grab;fill:currentColor;background:0 0;border:0;flex-shrink:0;justify-content:center;align-items:center;padding:4px 2px;display:inline-flex}.coar-map-point-list__handle:active{cursor:grabbing}.coar-map-point-list__main{min-width:0;min-height:var(--coar-interactive-row-height,auto);border-radius:var(--coar-control-radius,6px);color:inherit;font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;flex:1;grid-template-columns:auto 1fr;align-content:center;align-items:baseline;column-gap:8px;padding:6px 8px;display:grid}.coar-map-point-list__main:hover{background:var(--coar-background-neutral-secondary,#f3f4f6)}.coar-map-point-list__row--selected .coar-map-point-list__main:hover{background:0 0}.coar-map-point-list__emoji{grid-row:span 2}.coar-map-point-list__label{font-weight:var(--coar-map-label-font-weight,var(--coar-label-font-weight,600));text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.coar-map-point-list__coords{font-size:var(--coar-map-small-caption-font-size,var(--coar-caption-font-size,11px));color:var(--coar-text-neutral-tertiary,#94a3b8);font-variant-numeric:tabular-nums;grid-column:2}.coar-map-point-list__delete{flex-shrink:0;margin-right:2px}.coar-map-point-list__empty{font-size:var(--coar-map-font-size,var(--coar-ui-font-size,13px));color:var(--coar-text-neutral-tertiary,#94a3b8);padding:10px 8px}
2
2
  /*$vite$:1*/
package/dist/index.js CHANGED
@@ -58,11 +58,40 @@ function I(e) {
58
58
  return [[t, n], [r, i]];
59
59
  }
60
60
  //#endregion
61
+ //#region src/internal/role-theme.ts
62
+ var L = "--coar-d-role-derivation";
63
+ function ee(e) {
64
+ let t = g(!1), n, r = S(e, (e) => {
65
+ n?.disconnect();
66
+ let r = () => {
67
+ t.value = !!e && getComputedStyle(e).getPropertyValue(L).trim() === "on";
68
+ };
69
+ if (r(), !(!e || typeof MutationObserver > "u")) {
70
+ n = new MutationObserver(r);
71
+ for (let t = e.parentElement; t; t = t.parentElement) n.observe(t, {
72
+ attributes: !0,
73
+ attributeFilter: [
74
+ "class",
75
+ "style",
76
+ "data-theme",
77
+ "data-coar-theme-mode"
78
+ ]
79
+ });
80
+ }
81
+ }, {
82
+ immediate: !0,
83
+ flush: "post"
84
+ });
85
+ return p(() => {
86
+ r(), n?.disconnect();
87
+ }), t;
88
+ }
89
+ //#endregion
61
90
  //#region src/CoarMap.vue?vue&type=script&setup=true&lang.ts
62
- var L = {
91
+ var R = {
63
92
  key: 0,
64
93
  class: "coar-map__fallback"
65
- }, ee = { class: "coar-map__fallback-emoji" }, R = { class: "coar-map__fallback-label" }, z = { class: "coar-map__fallback-coords" }, te = {
94
+ }, z = { class: "coar-map__fallback-emoji" }, B = { class: "coar-map__fallback-label" }, V = { class: "coar-map__fallback-coords" }, te = {
66
95
  key: 1,
67
96
  class: "coar-map__legend"
68
97
  }, ne = {
@@ -74,7 +103,7 @@ var L = {
74
103
  }, ae = {
75
104
  key: 3,
76
105
  class: "coar-map__nocfg"
77
- }, B = /* @__PURE__ */ l({
106
+ }, H = /* @__PURE__ */ l({
78
107
  __name: "CoarMap",
79
108
  props: {
80
109
  data: {},
@@ -84,17 +113,17 @@ var L = {
84
113
  },
85
114
  emits: ["update:selected", "point-click"],
86
115
  setup(n, { expose: o, emit: c }) {
87
- let l = n, v = c, x = u(k, void 0), C = t(() => l.config ?? x ?? null), w = {
116
+ let l = n, v = c, C = u(k, void 0), w = t(() => l.config ?? C ?? null), T = {
88
117
  defaultBasemap: "",
89
118
  basemaps: []
90
- }, T = g(null), E = y(null), D = g(!1), O = /* @__PURE__ */ new Map(), A = t(() => N(l.data, C.value ?? w)), B = t(() => C.value ? P(l.data, C.value) : []), V = t(() => !!l.showLegend && B.value.length > 1);
91
- function H(e) {
119
+ }, E = g(null), D = g(null), O = ee(D), A = y(null), L = g(!1), H = /* @__PURE__ */ new Map(), U = t(() => N(l.data, w.value ?? T)), W = t(() => w.value ? P(l.data, w.value) : []), G = t(() => !!l.showLegend && W.value.length > 1);
120
+ function K(e) {
92
121
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
93
122
  }
94
- function U(e) {
123
+ function q(e) {
95
124
  return /[;"'<>]/.test(e) ? "#3b82f6" : e;
96
125
  }
97
- function W(e) {
126
+ function J(e) {
98
127
  let t = document.createElement("div");
99
128
  if (t.className = "coar-map-popup", e.label) {
100
129
  let n = document.createElement("strong");
@@ -106,23 +135,23 @@ var L = {
106
135
  }
107
136
  return t;
108
137
  }
109
- function G(e, t) {
138
+ function Y(e, t) {
110
139
  v("update:selected", e), v("point-click", {
111
140
  point: t,
112
141
  index: e
113
142
  });
114
143
  }
115
- function K(e, t, n, r, i) {
116
- let a = U(j(n, i)), o = M(n, i), s = e.divIcon({
144
+ function X(e, t, n, r, i) {
145
+ let a = q(j(n, i)), o = M(n, i), s = e.divIcon({
117
146
  className: "coar-map-pin-wrap",
118
- html: `<span class="coar-map-pin" style="--coar-map-pin-color:${a}"><span class="coar-map-pin__emoji">${H(o)}</span></span>`,
147
+ html: `<span class="coar-map-pin" style="--coar-map-pin-color:${a}"><span class="coar-map-pin__emoji">${K(o)}</span></span>`,
119
148
  iconSize: [26, 26],
120
149
  iconAnchor: [13, 13],
121
150
  popupAnchor: [0, -13]
122
151
  }), c = e.marker([n.lat, n.lng], { icon: s });
123
- n.label && c.bindTooltip(H(n.label)), (n.label || n.note) && c.bindPopup(W(n)), c.on("click", () => G(r, n)), c.addTo(t), O.set(r, c);
152
+ n.label && c.bindTooltip(K(n.label)), (n.label || n.note) && c.bindPopup(J(n)), c.on("click", () => Y(r, n)), c.addTo(t), H.set(r, c);
124
153
  }
125
- function q(e, t, n, r) {
154
+ function Z(e, t, n, r) {
126
155
  let i = e.circleMarker([n.lat, n.lng], {
127
156
  radius: 4,
128
157
  color: "#475569",
@@ -130,26 +159,26 @@ var L = {
130
159
  fillColor: "#ffffff",
131
160
  fillOpacity: 1
132
161
  });
133
- n.label && i.bindTooltip(H(n.label)), n.note && i.bindPopup(W(n)), i.on("click", () => G(r, n)), i.addTo(t), O.set(r, i);
162
+ n.label && i.bindTooltip(K(n.label)), n.note && i.bindPopup(J(n)), i.on("click", () => Y(r, n)), i.addTo(t), H.set(r, i);
134
163
  }
135
- function J() {
136
- E.value &&= (E.value.remove(), null), O.clear(), D.value = !1;
164
+ function oe() {
165
+ A.value &&= (A.value.remove(), null), H.clear(), L.value = !1;
137
166
  }
138
- function Y(e) {
139
- return O.get(e)?.getElement?.() ?? null;
167
+ function se(e) {
168
+ return H.get(e)?.getElement?.() ?? null;
140
169
  }
141
- function X() {
170
+ function Q() {
142
171
  let e = l.selected ?? null;
143
- for (let t of O.keys()) Y(t)?.classList.toggle("coar-map-marker--selected", t === e);
172
+ for (let t of H.keys()) se(t)?.classList.toggle("coar-map-marker--selected", t === e);
144
173
  }
145
- async function Z() {
146
- let e = T.value, t = C.value;
174
+ async function $() {
175
+ let e = E.value, t = w.value;
147
176
  if (!e || !t) return;
148
- J();
177
+ oe();
149
178
  let n = await import("leaflet"), r = n.default ?? n;
150
- if (await import("leaflet/dist/leaflet.css"), T.value !== e) return;
179
+ if (await import("leaflet/dist/leaflet.css"), E.value !== e) return;
151
180
  let i = r.map(e);
152
- E.value = i;
181
+ A.value = i;
153
182
  let a = F(l.data, t);
154
183
  a && r.tileLayer(a.url, {
155
184
  subdomains: a.subdomains ?? "abc",
@@ -162,7 +191,7 @@ var L = {
162
191
  weight: 4,
163
192
  opacity: .85
164
193
  }).addTo(i), o.forEach((e, n) => {
165
- e.kind === "stop" ? K(r, i, e, n, t) : e.label && q(r, i, e, n);
194
+ e.kind === "stop" ? X(r, i, e, n, t) : e.label && Z(r, i, e, n);
166
195
  });
167
196
  let s = l.data.viewport;
168
197
  if (s) i.setView([s.centerLat, s.centerLng], s.zoom);
@@ -170,33 +199,40 @@ var L = {
170
199
  let e = I(o);
171
200
  e ? i.fitBounds(e, { padding: [28, 28] }) : i.setView([0, 0], 2);
172
201
  }
173
- requestAnimationFrame(() => E.value?.invalidateSize()), D.value = !0, X();
202
+ requestAnimationFrame(() => A.value?.invalidateSize()), L.value = !0, Q();
174
203
  }
175
- function Q(e) {
204
+ function ce(e) {
176
205
  let t = l.data.points[e];
177
- !t || !E.value || (E.value.panTo([t.lat, t.lng]), O.get(e)?.openPopup(), (l.selected ?? null) !== e && v("update:selected", e));
206
+ !t || !A.value || (A.value.panTo([t.lat, t.lng]), H.get(e)?.openPopup(), (l.selected ?? null) !== e && v("update:selected", e));
178
207
  }
179
- function $(e) {
180
- for (let t of O.keys()) Y(t)?.classList.toggle("coar-map-marker--highlight", t === e);
208
+ function le(e) {
209
+ for (let t of H.keys()) se(t)?.classList.toggle("coar-map-marker--highlight", t === e);
181
210
  }
182
211
  return o({
183
- focusPoint: Q,
184
- highlightPoint: $
185
- }), m(Z), p(J), S([() => l.data, C], () => void Z(), { deep: !0 }), S(() => l.selected, X), (t, o) => (h(), i("div", { class: d(["coar-map", { "coar-map--ready": D.value }]) }, [
212
+ focusPoint: ce,
213
+ highlightPoint: le
214
+ }), m($), p(oe), S([() => l.data, w], () => void $(), { deep: !0 }), S(() => l.selected, Q), (t, o) => (h(), i("div", {
215
+ ref_key: "rootEl",
216
+ ref: D,
217
+ class: d(["coar-map", {
218
+ "coar-map--ready": L.value,
219
+ "coar-map--role-theme": x(O)
220
+ }])
221
+ }, [
186
222
  a("div", {
187
223
  ref_key: "mapEl",
188
- ref: T,
224
+ ref: E,
189
225
  class: "coar-map__canvas"
190
226
  }, null, 512),
191
- D.value ? r("", !0) : (h(), i("ol", L, [(h(!0), i(e, null, _(A.value, (e, t) => (h(), i("li", {
227
+ L.value ? r("", !0) : (h(), i("ol", R, [(h(!0), i(e, null, _(U.value, (e, t) => (h(), i("li", {
192
228
  key: t,
193
229
  class: "coar-map__fallback-item"
194
230
  }, [
195
- a("span", ee, b(e.emoji), 1),
196
- a("span", R, b(e.label), 1),
197
- a("span", z, b(e.lat.toFixed(4)) + ", " + b(e.lng.toFixed(4)), 1)
231
+ a("span", z, b(e.emoji), 1),
232
+ a("span", B, b(e.label), 1),
233
+ a("span", V, b(e.lat.toFixed(4)) + ", " + b(e.lng.toFixed(4)), 1)
198
234
  ]))), 128))])),
199
- V.value ? (h(), i("ul", te, [(h(!0), i(e, null, _(B.value, (e) => (h(), i("li", {
235
+ G.value ? (h(), i("ul", te, [(h(!0), i(e, null, _(W.value, (e) => (h(), i("li", {
200
236
  key: e.id,
201
237
  class: "coar-map__legend-item"
202
238
  }, [
@@ -208,7 +244,7 @@ var L = {
208
244
  a("span", re, b(e.label), 1)
209
245
  ]))), 128))])) : r("", !0),
210
246
  n.data.caption ? (h(), i("p", ie, b(n.data.caption), 1)) : r("", !0),
211
- C.value ? r("", !0) : (h(), i("p", ae, [...o[0] ||= [
247
+ w.value ? r("", !0) : (h(), i("p", ae, [...o[0] ||= [
212
248
  s("No map config provided (pass ", -1),
213
249
  a("code", null, "config", -1),
214
250
  s(" or provide one).", -1)
@@ -218,15 +254,15 @@ var L = {
218
254
  });
219
255
  //#endregion
220
256
  //#region src/internal/map-edit.ts
221
- function V(e, t) {
257
+ function U(e, t) {
222
258
  let n = Math.max(-90, Math.min(90, e)), r = ((t + 180) % 360 + 360) % 360 - 180;
223
259
  return r === -180 && (r = 180), {
224
260
  lat: n,
225
261
  lng: r
226
262
  };
227
263
  }
228
- function H(e, t, n, r) {
229
- let { lat: i, lng: a } = V(e, t);
264
+ function W(e, t, n, r) {
265
+ let { lat: i, lng: a } = U(e, t);
230
266
  return {
231
267
  kind: r,
232
268
  ...n,
@@ -234,57 +270,57 @@ function H(e, t, n, r) {
234
270
  lng: a
235
271
  };
236
272
  }
237
- function U(e, t) {
273
+ function G(e, t) {
238
274
  return Number.isInteger(e) && e >= 0 && e < t;
239
275
  }
240
- function W(e, t) {
276
+ function K(e, t) {
241
277
  return {
242
278
  ...e,
243
279
  points: t
244
280
  };
245
281
  }
246
- function G(e, t, n, r = {}) {
247
- if (e.type === "single" && e.points.length >= 1) return K(e, 0, t, n);
248
- let i = H(t, n, r, "stop");
249
- return W(e, [...e.points, i]);
282
+ function q(e, t, n, r = {}) {
283
+ if (e.type === "single" && e.points.length >= 1) return J(e, 0, t, n);
284
+ let i = W(t, n, r, "stop");
285
+ return K(e, [...e.points, i]);
250
286
  }
251
- function K(e, t, n, r) {
252
- if (!U(t, e.points.length)) return e;
253
- let { lat: i, lng: a } = V(n, r);
254
- return W(e, e.points.map((e, n) => n === t ? {
287
+ function J(e, t, n, r) {
288
+ if (!G(t, e.points.length)) return e;
289
+ let { lat: i, lng: a } = U(n, r);
290
+ return K(e, e.points.map((e, n) => n === t ? {
255
291
  ...e,
256
292
  lat: i,
257
293
  lng: a
258
294
  } : e));
259
295
  }
260
- function q(e, t, n) {
261
- if (!U(t, e.points.length)) return e;
296
+ function Y(e, t, n) {
297
+ if (!G(t, e.points.length)) return e;
262
298
  let r = {};
263
299
  for (let [e, t] of Object.entries(n)) t !== void 0 && (r[e] = t);
264
300
  if ("lat" in r || "lng" in r) {
265
- let n = e.points[t], { lat: i, lng: a } = V(r.lat ?? n.lat, r.lng ?? n.lng);
301
+ let n = e.points[t], { lat: i, lng: a } = U(r.lat ?? n.lat, r.lng ?? n.lng);
266
302
  r.lat = i, r.lng = a;
267
303
  }
268
- return W(e, e.points.map((e, n) => n === t ? {
304
+ return K(e, e.points.map((e, n) => n === t ? {
269
305
  ...e,
270
306
  ...r
271
307
  } : e));
272
308
  }
273
- function J(e, t) {
274
- return U(t, e.points.length) ? W(e, e.points.filter((e, n) => n !== t)) : e;
309
+ function X(e, t) {
310
+ return G(t, e.points.length) ? K(e, e.points.filter((e, n) => n !== t)) : e;
275
311
  }
276
- function Y(e, t, n) {
312
+ function Z(e, t, n) {
277
313
  let r = e.points.length;
278
- if (!U(t, r) || !U(n, r) || t === n) return e;
314
+ if (!G(t, r) || !G(n, r) || t === n) return e;
279
315
  let i = [...e.points], [a] = i.splice(t, 1);
280
- return i.splice(n, 0, a), W(e, i);
316
+ return i.splice(n, 0, a), K(e, i);
281
317
  }
282
- function X(e, t, n, r, i = {}) {
283
- if (!U(t, Math.max(0, e.points.length - 1))) return e;
284
- let a = H(n, r, i, "stop"), o = [...e.points];
285
- return o.splice(t + 1, 0, a), W(e, o);
318
+ function oe(e, t, n, r, i = {}) {
319
+ if (!G(t, Math.max(0, e.points.length - 1))) return e;
320
+ let a = W(n, r, i, "stop"), o = [...e.points];
321
+ return o.splice(t + 1, 0, a), K(e, o);
286
322
  }
287
- function Z(e, t) {
323
+ function se(e, t) {
288
324
  if (t === null) {
289
325
  let t = { ...e };
290
326
  return delete t.viewport, t;
@@ -300,14 +336,14 @@ function Q(e, t, n) {
300
336
  function $(e, t) {
301
337
  return e === null || e === t ? null : e > t ? e - 1 : e;
302
338
  }
303
- function oe(e, t, n, r, i, a) {
339
+ function ce(e, t, n, r, i, a) {
304
340
  let o = i - n, s = a - r, c = o * o + s * s, l = c === 0 ? 0 : Math.max(0, Math.min(1, ((e - n) * o + (t - r) * s) / c)), u = n + l * o, d = r + l * s, f = e - u, p = t - d;
305
341
  return {
306
342
  distSq: f * f + p * p,
307
343
  t: l
308
344
  };
309
345
  }
310
- function se(e, t, n) {
346
+ function le(e, t, n) {
311
347
  if (e.length < 2) return null;
312
348
  let r = {
313
349
  segmentIndex: 0,
@@ -315,7 +351,7 @@ function se(e, t, n) {
315
351
  t: 0
316
352
  };
317
353
  for (let i = 0; i < e.length - 1; i++) {
318
- let a = e[i], o = e[i + 1], { distSq: s, t: c } = oe(n, t, a.lng, a.lat, o.lng, o.lat);
354
+ let a = e[i], o = e[i + 1], { distSq: s, t: c } = ce(n, t, a.lng, a.lat, o.lng, o.lat);
319
355
  s < r.distSq && (r = {
320
356
  segmentIndex: i,
321
357
  distSq: s,
@@ -331,13 +367,13 @@ function se(e, t, n) {
331
367
  }
332
368
  //#endregion
333
369
  //#region src/internal/use-map-editor.ts
334
- function ce(e) {
370
+ function ue(e) {
335
371
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
336
372
  }
337
- function le(e) {
373
+ function de(e) {
338
374
  return /[;"'<>]/.test(e) ? "#3b82f6" : e;
339
375
  }
340
- function ue(e, n) {
376
+ function fe(e, n) {
341
377
  let r = y(null), i = g(!1), a = null, o = /* @__PURE__ */ new Map(), s = null, c = !1, l = g(null), u = g(!1), d = t(() => {
342
378
  let e = n.selected();
343
379
  return e === null ? null : n.data().points[e] ?? null;
@@ -353,10 +389,10 @@ function ue(e, n) {
353
389
  }));
354
390
  }
355
391
  function v(e, t) {
356
- let n = le(j(e, t)), r = M(e, t);
392
+ let n = de(j(e, t)), r = M(e, t);
357
393
  return a.divIcon({
358
394
  className: "coar-map-pin-wrap",
359
- html: `<span class="coar-map-pin" style="--coar-map-pin-color:${n}"><span class="coar-map-pin__emoji">${ce(r)}</span></span>`,
395
+ html: `<span class="coar-map-pin" style="--coar-map-pin-color:${n}"><span class="coar-map-pin__emoji">${ue(r)}</span></span>`,
360
396
  iconSize: [26, 26],
361
397
  iconAnchor: [13, 13]
362
398
  });
@@ -385,12 +421,12 @@ function ue(e, n) {
385
421
  icon: u,
386
422
  draggable: !l
387
423
  });
388
- e.label && d.bindTooltip(ce(e.label)), d.on("click", () => _(t)), l || (d.on("dragstart", () => {
424
+ e.label && d.bindTooltip(ue(e.label)), d.on("click", () => _(t)), l || (d.on("dragstart", () => {
389
425
  c = !0;
390
426
  }), d.on("drag", C), d.on("dragend", () => {
391
427
  c = !1;
392
428
  let e = d.getLatLng();
393
- h(K(n.data(), t, e.lat, e.lng));
429
+ h(J(n.data(), t, e.lat, e.lng));
394
430
  })), d.addTo(s), o.set(t, d);
395
431
  }
396
432
  function T() {
@@ -424,13 +460,13 @@ function ue(e, n) {
424
460
  n.emitSelected(null);
425
461
  return;
426
462
  }
427
- h(G(n.data(), e.latlng.lat, e.latlng.lng));
463
+ h(q(n.data(), e.latlng.lat, e.latlng.lng));
428
464
  }
429
465
  }
430
466
  function A(e) {
431
467
  if (n.readonly()) return;
432
- let t = se(n.data().points, e.latlng.lat, e.latlng.lng);
433
- t && (h(X(n.data(), t.segmentIndex, t.lat, t.lng)), n.emitSelected(null));
468
+ let t = le(n.data().points, e.latlng.lat, e.latlng.lng);
469
+ t && (h(oe(n.data(), t.segmentIndex, t.lat, t.lng)), n.emitSelected(null));
434
470
  }
435
471
  function N() {
436
472
  let e = r.value, t = d.value;
@@ -446,11 +482,11 @@ function ue(e, n) {
446
482
  }
447
483
  function P(e) {
448
484
  let t = n.selected();
449
- t !== null && h(q(n.data(), t, e));
485
+ t !== null && h(Y(n.data(), t, e));
450
486
  }
451
487
  function L() {
452
488
  let e = n.selected();
453
- e !== null && V(e);
489
+ e !== null && ae(e);
454
490
  }
455
491
  function ee(e) {
456
492
  let t = n.selected();
@@ -462,13 +498,13 @@ function ue(e, n) {
462
498
  function z(e) {
463
499
  e.key === "Escape" && !n.readonly() && n.selected() !== null && (e.stopPropagation(), R());
464
500
  }
465
- function te() {
501
+ function B() {
466
502
  T(), r.value &&= (r.value.remove(), null), i.value = !1;
467
503
  }
468
- async function ne() {
504
+ async function V() {
469
505
  let t = e.value, o = n.config();
470
506
  if (!t || !o) return;
471
- te();
507
+ B();
472
508
  let s = await import("leaflet");
473
509
  if (a = s.default ?? s, await import("leaflet/dist/leaflet.css"), e.value !== t) return;
474
510
  let c = a.map(t);
@@ -487,42 +523,42 @@ function ue(e, n) {
487
523
  }
488
524
  requestAnimationFrame(() => r.value?.invalidateSize()), i.value = !0, N();
489
525
  }
490
- function re(e) {
526
+ function te(e) {
491
527
  let t = n.data().points[e];
492
528
  !t || !r.value || (r.value.panTo([t.lat, t.lng]), n.selected() !== e && n.emitSelected(e));
493
529
  }
494
- function ie(e) {
530
+ function ne(e) {
495
531
  for (let t of o.keys()) D(t)?.classList.toggle("coar-map-marker--highlight", t === e);
496
532
  }
497
- function ae(e, t, r) {
498
- h(G(n.data(), e, t, r));
533
+ function re(e, t, r) {
534
+ h(q(n.data(), e, t, r));
499
535
  }
500
- function B(e, t) {
501
- h(q(n.data(), e, t));
536
+ function ie(e, t) {
537
+ h(Y(n.data(), e, t));
502
538
  }
503
- function V(e) {
539
+ function ae(e) {
504
540
  let t = n.selected();
505
- h(J(n.data(), e)), n.emitSelected($(t, e));
541
+ h(X(n.data(), e)), n.emitSelected($(t, e));
506
542
  }
507
543
  function H(e, t) {
508
- let r = Y(n.data(), e, t);
544
+ let r = Z(n.data(), e, t);
509
545
  r !== n.data() && (h(r), n.emitSelected(Q(n.selected(), e, t)));
510
546
  }
511
547
  function U() {
512
548
  let e = r.value;
513
549
  if (!e) return;
514
550
  let t = e.getCenter();
515
- h(Z(n.data(), {
551
+ h(se(n.data(), {
516
552
  centerLat: t.lat,
517
553
  centerLng: t.lng,
518
554
  zoom: e.getZoom()
519
555
  }));
520
556
  }
521
557
  return m(() => {
522
- window.addEventListener("keydown", z), ne();
558
+ window.addEventListener("keydown", z), V();
523
559
  }), p(() => {
524
- window.removeEventListener("keydown", z), te();
525
- }), S(n.config, () => void ne()), S(n.data, () => {
560
+ window.removeEventListener("keydown", z), B();
561
+ }), S(n.config, () => void V()), S(n.data, () => {
526
562
  c || E(), N();
527
563
  }, { deep: !0 }), S([n.selected, n.readonly], () => {
528
564
  O(), N();
@@ -536,21 +572,21 @@ function ue(e, n) {
536
572
  removeSelected: L,
537
573
  moveSelected: ee,
538
574
  deselect: R,
539
- focusPoint: re,
540
- highlightPoint: ie,
541
- addPoint: ae,
542
- updatePoint: B,
543
- removePoint: V,
575
+ focusPoint: te,
576
+ highlightPoint: ne,
577
+ addPoint: re,
578
+ updatePoint: ie,
579
+ removePoint: ae,
544
580
  reorder: H,
545
581
  captureViewport: U
546
582
  };
547
583
  }
548
584
  //#endregion
549
585
  //#region src/internal/MapPointForm.vue?vue&type=script&setup=true&lang.ts
550
- var de = { class: "coar-map-form" }, fe = { class: "coar-map-form__field" }, pe = { class: "coar-map-form__field" }, me = {
586
+ var pe = { class: "coar-map-form" }, me = { class: "coar-map-form__field" }, he = { class: "coar-map-form__field" }, ge = {
551
587
  key: 0,
552
588
  class: "coar-map-form__field"
553
- }, he = { class: "coar-map-form__field" }, ge = { class: "coar-map-form__actions" }, _e = /* @__PURE__ */ l({
589
+ }, _e = { class: "coar-map-form__field" }, ve = { class: "coar-map-form__actions" }, ye = /* @__PURE__ */ l({
554
590
  __name: "MapPointForm",
555
591
  props: {
556
592
  point: {},
@@ -576,32 +612,32 @@ var de = { class: "coar-map-form" }, fe = { class: "coar-map-form__field" }, pe
576
612
  function g(e) {
577
613
  u("update", { category: e || void 0 });
578
614
  }
579
- return (t, o) => (h(), i("div", de, [
580
- a("label", fe, [o[8] ||= a("span", { class: "coar-map-form__label" }, "Label", -1), c(x(E), {
615
+ return (t, o) => (h(), i("div", pe, [
616
+ a("label", me, [o[8] ||= a("span", { class: "coar-map-form__label" }, "Label", -1), c(x(E), {
581
617
  "model-value": n.point.label ?? "",
582
618
  size: "s",
583
619
  "onUpdate:modelValue": o[0] ||= (e) => m("label", e)
584
620
  }, null, 8, ["model-value"])]),
585
- a("label", pe, [o[9] ||= a("span", { class: "coar-map-form__label" }, "Note", -1), c(x(E), {
621
+ a("label", he, [o[9] ||= a("span", { class: "coar-map-form__label" }, "Note", -1), c(x(E), {
586
622
  "model-value": n.point.note ?? "",
587
623
  rows: 2,
588
624
  size: "s",
589
625
  "onUpdate:modelValue": o[1] ||= (e) => m("note", e)
590
626
  }, null, 8, ["model-value"])]),
591
- d.value ? (h(), i(e, { key: 0 }, [p.value.length ? (h(), i("label", me, [o[10] ||= a("span", { class: "coar-map-form__label" }, "Category", -1), c(x(T), {
627
+ d.value ? (h(), i(e, { key: 0 }, [p.value.length ? (h(), i("label", ge, [o[10] ||= a("span", { class: "coar-map-form__label" }, "Category", -1), c(x(T), {
592
628
  "model-value": n.point.category ?? null,
593
629
  options: p.value,
594
630
  size: "s",
595
631
  clearable: "",
596
632
  placeholder: "None",
597
633
  "onUpdate:modelValue": o[2] ||= (e) => g(e)
598
- }, null, 8, ["model-value", "options"])])) : r("", !0), a("label", he, [o[11] ||= a("span", { class: "coar-map-form__label" }, "Icon", -1), c(x(E), {
634
+ }, null, 8, ["model-value", "options"])])) : r("", !0), a("label", _e, [o[11] ||= a("span", { class: "coar-map-form__label" }, "Icon", -1), c(x(E), {
599
635
  "model-value": n.point.icon ?? "",
600
636
  size: "s",
601
637
  placeholder: "emoji",
602
638
  "onUpdate:modelValue": o[3] ||= (e) => m("icon", e)
603
639
  }, null, 8, ["model-value"])])], 64)) : r("", !0),
604
- a("div", ge, [
640
+ a("div", ve, [
605
641
  c(x(w), {
606
642
  variant: "secondary",
607
643
  size: "s",
@@ -641,13 +677,13 @@ var de = { class: "coar-map-form" }, fe = { class: "coar-map-form__field" }, pe
641
677
  ])
642
678
  ]));
643
679
  }
644
- }), ve = { class: "coar-map-editor__stage" }, ye = { class: "coar-map-edit-popup__close" }, be = {
680
+ }), be = { class: "coar-map-editor__stage" }, xe = { class: "coar-map-edit-popup__close" }, Se = {
645
681
  key: 0,
646
682
  class: "coar-map__caption"
647
- }, xe = {
683
+ }, Ce = {
648
684
  key: 1,
649
685
  class: "coar-map__nocfg"
650
- }, Se = /* @__PURE__ */ l({
686
+ }, we = /* @__PURE__ */ l({
651
687
  __name: "CoarMapEditor",
652
688
  props: {
653
689
  data: {},
@@ -661,7 +697,7 @@ var de = { class: "coar-map-form" }, fe = { class: "coar-map-form__field" }, pe
661
697
  "point-click"
662
698
  ],
663
699
  setup(e, { expose: n, emit: o }) {
664
- let l = e, p = o, m = u(k, void 0), _ = t(() => l.config ?? m ?? null), y = g(null), { ready: S, editPos: T, editBelow: E, selectedPoint: D, editing: O, updateSelected: A, removeSelected: j, moveSelected: M, deselect: N, focusPoint: P, highlightPoint: F, addPoint: I, updatePoint: L, removePoint: ee, reorder: R, captureViewport: z } = ue(y, {
700
+ let l = e, p = o, m = u(k, void 0), _ = t(() => l.config ?? m ?? null), y = g(null), S = g(null), T = ee(S), { ready: E, editPos: D, editBelow: O, selectedPoint: A, editing: j, updateSelected: M, removeSelected: N, moveSelected: P, deselect: F, focusPoint: I, highlightPoint: L, addPoint: R, updatePoint: z, removePoint: B, reorder: V, captureViewport: te } = fe(y, {
665
701
  data: () => l.data,
666
702
  config: () => _.value,
667
703
  selected: () => l.selected ?? null,
@@ -671,50 +707,57 @@ var de = { class: "coar-map-form" }, fe = { class: "coar-map-form__field" }, pe
671
707
  emitPointClick: (e) => p("point-click", e)
672
708
  });
673
709
  return n({
674
- focusPoint: P,
675
- highlightPoint: F,
676
- addPoint: I,
677
- updatePoint: L,
678
- removePoint: ee,
679
- reorder: R,
680
- captureViewport: z
681
- }), (t, n) => (h(), i("div", { class: d(["coar-map coar-map-editor", { "coar-map--ready": x(S) }]) }, [
682
- a("div", ve, [a("div", {
710
+ focusPoint: I,
711
+ highlightPoint: L,
712
+ addPoint: R,
713
+ updatePoint: z,
714
+ removePoint: B,
715
+ reorder: V,
716
+ captureViewport: te
717
+ }), (t, n) => (h(), i("div", {
718
+ ref_key: "rootEl",
719
+ ref: S,
720
+ class: d(["coar-map coar-map-editor", {
721
+ "coar-map--ready": x(E),
722
+ "coar-map--role-theme": x(T)
723
+ }])
724
+ }, [
725
+ a("div", be, [a("div", {
683
726
  ref_key: "mapEl",
684
727
  ref: y,
685
728
  class: "coar-map__canvas"
686
- }, null, 512), x(O) && x(T) && x(D) && e.selected != null ? (h(), i("div", {
729
+ }, null, 512), x(j) && x(D) && x(A) && e.selected != null ? (h(), i("div", {
687
730
  key: 0,
688
- class: d(["coar-map-edit-popup", { "coar-map-edit-popup--below": x(E) }]),
731
+ class: d(["coar-map-edit-popup", { "coar-map-edit-popup--below": x(O) }]),
689
732
  style: f({
690
- left: `${x(T).x}px`,
691
- top: `${x(T).y}px`
733
+ left: `${x(D).x}px`,
734
+ top: `${x(D).y}px`
692
735
  })
693
- }, [a("div", ye, [c(x(w), {
736
+ }, [a("div", xe, [c(x(w), {
694
737
  variant: "ghost",
695
738
  size: "xs",
696
739
  "aria-label": "Close",
697
- onClick: x(N)
740
+ onClick: x(F)
698
741
  }, {
699
742
  default: C(() => [...n[2] ||= [s("×", -1)]]),
700
743
  _: 1
701
744
  }, 8, ["onClick"])]), v(t.$slots, "point-form", {
702
- point: x(D),
745
+ point: x(A),
703
746
  index: e.selected,
704
- update: x(A),
705
- remove: x(j),
706
- moveUp: () => x(M)(-1),
707
- moveDown: () => x(M)(1)
708
- }, () => [c(_e, {
709
- point: x(D),
747
+ update: x(M),
748
+ remove: x(N),
749
+ moveUp: () => x(P)(-1),
750
+ moveDown: () => x(P)(1)
751
+ }, () => [c(ye, {
752
+ point: x(A),
710
753
  config: _.value,
711
754
  type: e.data.type,
712
755
  index: e.selected,
713
756
  count: e.data.points.length,
714
- onUpdate: x(A),
715
- onRemove: x(j),
716
- onMoveUp: n[0] ||= (e) => x(M)(-1),
717
- onMoveDown: n[1] ||= (e) => x(M)(1)
757
+ onUpdate: x(M),
758
+ onRemove: x(N),
759
+ onMoveUp: n[0] ||= (e) => x(P)(-1),
760
+ onMoveDown: n[1] ||= (e) => x(P)(1)
718
761
  }, null, 8, [
719
762
  "point",
720
763
  "config",
@@ -724,18 +767,18 @@ var de = { class: "coar-map-form" }, fe = { class: "coar-map-form__field" }, pe
724
767
  "onUpdate",
725
768
  "onRemove"
726
769
  ])])], 6)) : r("", !0)]),
727
- e.data.caption ? (h(), i("p", be, b(e.data.caption), 1)) : r("", !0),
728
- _.value ? r("", !0) : (h(), i("p", xe, [...n[3] ||= [
770
+ e.data.caption ? (h(), i("p", Se, b(e.data.caption), 1)) : r("", !0),
771
+ _.value ? r("", !0) : (h(), i("p", Ce, [...n[3] ||= [
729
772
  s("No map config provided (pass ", -1),
730
773
  a("code", null, "config", -1),
731
774
  s(" or provide one).", -1)
732
775
  ]]))
733
776
  ], 2));
734
777
  }
735
- }), Ce = ["onDragover", "onDrop"], we = ["onDragstart"], Te = ["onClick", "onMouseenter"], Ee = { class: "coar-map-point-list__emoji" }, De = { class: "coar-map-point-list__label" }, Oe = { class: "coar-map-point-list__coords" }, ke = {
778
+ }), Te = ["onDragover", "onDrop"], Ee = ["onDragstart"], De = ["onClick", "onMouseenter"], Oe = { class: "coar-map-point-list__emoji" }, ke = { class: "coar-map-point-list__label" }, Ae = { class: "coar-map-point-list__coords" }, je = {
736
779
  key: 0,
737
780
  class: "coar-map-point-list__empty"
738
- }, Ae = /* @__PURE__ */ l({
781
+ }, Me = /* @__PURE__ */ l({
739
782
  __name: "CoarMapPointList",
740
783
  props: {
741
784
  data: {},
@@ -766,10 +809,10 @@ var de = { class: "coar-map-form" }, fe = { class: "coar-map-form__field" }, pe
766
809
  }
767
810
  function k(e, t) {
768
811
  let n = t > e ? t - 1 : t;
769
- n = Math.max(0, Math.min(y.value.length - 1, n)), n !== e && (f("update:data", Y(u.data, e, n)), f("update:selected", Q(u.selected ?? null, e, n)));
812
+ n = Math.max(0, Math.min(y.value.length - 1, n)), n !== e && (f("update:data", Z(u.data, e, n)), f("update:selected", Q(u.selected ?? null, e, n)));
770
813
  }
771
814
  function A(e) {
772
- f("update:data", J(u.data, e)), f("update:selected", $(u.selected ?? null, e));
815
+ f("update:data", X(u.data, e)), f("update:selected", $(u.selected ?? null, e));
773
816
  }
774
817
  function j(e, t) {
775
818
  let n = e.currentTarget?.closest(".coar-map-point-list__row");
@@ -817,7 +860,7 @@ var de = { class: "coar-map-form" }, fe = { class: "coar-map-form__field" }, pe
817
860
  draggable: "true",
818
861
  onDragstart: (e) => j(e, u),
819
862
  onDragend: F
820
- }, [...l[2] ||= [o("<svg viewBox=\"0 0 10 16\" width=\"10\" height=\"16\" aria-hidden=\"true\"><circle cx=\"2.5\" cy=\"3\" r=\"1.2\"></circle><circle cx=\"7.5\" cy=\"3\" r=\"1.2\"></circle><circle cx=\"2.5\" cy=\"8\" r=\"1.2\"></circle><circle cx=\"7.5\" cy=\"8\" r=\"1.2\"></circle><circle cx=\"2.5\" cy=\"13\" r=\"1.2\"></circle><circle cx=\"7.5\" cy=\"13\" r=\"1.2\"></circle></svg>", 1)]], 40, we)) : r("", !0),
863
+ }, [...l[2] ||= [o("<svg viewBox=\"0 0 10 16\" width=\"10\" height=\"16\" aria-hidden=\"true\"><circle cx=\"2.5\" cy=\"3\" r=\"1.2\"></circle><circle cx=\"7.5\" cy=\"3\" r=\"1.2\"></circle><circle cx=\"2.5\" cy=\"8\" r=\"1.2\"></circle><circle cx=\"7.5\" cy=\"8\" r=\"1.2\"></circle><circle cx=\"2.5\" cy=\"13\" r=\"1.2\"></circle><circle cx=\"7.5\" cy=\"13\" r=\"1.2\"></circle></svg>", 1)]], 40, Ee)) : r("", !0),
821
864
  a("button", {
822
865
  type: "button",
823
866
  class: "coar-map-point-list__main",
@@ -829,10 +872,10 @@ var de = { class: "coar-map-form" }, fe = { class: "coar-map-form__field" }, pe
829
872
  index: u,
830
873
  selected: c.selected === u
831
874
  }, () => [
832
- a("span", Ee, b(S(e)), 1),
833
- a("span", De, b(T(e)), 1),
834
- a("span", Oe, b(e.lat.toFixed(3)) + ", " + b(e.lng.toFixed(3)), 1)
835
- ])], 40, Te),
875
+ a("span", Oe, b(S(e)), 1),
876
+ a("span", ke, b(T(e)), 1),
877
+ a("span", Ae, b(e.lat.toFixed(3)) + ", " + b(e.lng.toFixed(3)), 1)
878
+ ])], 40, De),
836
879
  c.removable ? (h(), n(x(w), {
837
880
  key: 1,
838
881
  class: "coar-map-point-list__delete",
@@ -844,8 +887,8 @@ var de = { class: "coar-map-form" }, fe = { class: "coar-map-form__field" }, pe
844
887
  default: C(() => [...l[3] ||= [s("✕", -1)]]),
845
888
  _: 1
846
889
  }, 8, ["onClick"])) : r("", !0)
847
- ], 42, Ce))), 128)), y.value.length ? r("", !0) : (h(), i("li", ke, "No points yet."))], 32));
890
+ ], 42, Te))), 128)), y.value.length ? r("", !0) : (h(), i("li", je, "No points yet."))], 32));
848
891
  }
849
892
  });
850
893
  //#endregion
851
- export { k as COAR_MAP_CONFIG_KEY, B as CoarMap, Se as CoarMapEditor, Ae as CoarMapPointList, G as addPointForType, I as boundsOf, A as categoryMap, N as fallbackEntries, X as insertOnSegment, P as legendCategories, K as movePoint, se as nearestSegment, V as normalizeLatLng, J as removePoint, Y as reorderPoint, F as resolveBasemap, $ as selectionAfterRemove, Q as selectionAfterReorder, Z as setViewport, j as stopColor, M as stopEmoji, q as updatePoint };
894
+ export { k as COAR_MAP_CONFIG_KEY, H as CoarMap, we as CoarMapEditor, Me as CoarMapPointList, q as addPointForType, I as boundsOf, A as categoryMap, N as fallbackEntries, oe as insertOnSegment, P as legendCategories, J as movePoint, le as nearestSegment, U as normalizeLatLng, X as removePoint, Z as reorderPoint, F as resolveBasemap, $ as selectionAfterRemove, Q as selectionAfterReorder, se as setViewport, j as stopColor, M as stopEmoji, Y as updatePoint };
@@ -0,0 +1,12 @@
1
+ import { Ref } from 'vue';
2
+ /**
3
+ * Whether a role theme (Preview) is in effect at the element: decided by the values,
4
+ * not by a class, and kept current while the theme of an ancestor changes.
5
+ *
6
+ * Leaflet's stylesheet is unlayered and loads after ours, so restyling its chrome
7
+ * needs rules that outrank it. Such rules must not exist for a map without a theme
8
+ * (they would also outrank an application's own Leaflet styles), which no selector
9
+ * can express on a value: the map marks its root instead.
10
+ */
11
+ export declare function useRoleTheme(element: Ref<HTMLElement | null>): Ref<boolean>;
12
+ //# sourceMappingURL=role-theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"role-theme.d.ts","sourceRoot":"","sources":["../../src/internal/role-theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAQ5D;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,CA6B3E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocoar/vue-map",
3
- "version": "3.4.0-beta.8",
3
+ "version": "4.0.0-beta.44",
4
4
  "description": "Interactive Leaflet map component for Vue 3. Data-driven and standalone — it knows nothing about markdown or any embedding layer; a consumer feeds it resolved map data.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -39,7 +39,7 @@
39
39
  "leaflet": "^1.9.4"
40
40
  },
41
41
  "peerDependencies": {
42
- "@cocoar/vue-ui": "3.4.0-beta.8",
42
+ "@cocoar/vue-ui": "4.0.0-beta.44",
43
43
  "vue": "^3.5.0"
44
44
  },
45
45
  "peerDependenciesMeta": {
@@ -50,9 +50,9 @@
50
50
  "devDependencies": {
51
51
  "@types/leaflet": "^1.9.12",
52
52
  "vue": "^3.5.32",
53
- "@cocoar/vue-ui": "3.4.0-beta.8"
53
+ "@cocoar/vue-ui": "4.0.0-beta.44"
54
54
  },
55
- "gitHead": "c64c8033c839441a2c1543da3694eabfc2220be2",
55
+ "gitHead": "37e83b70b9cca55981246bfc20f9df73cb47e4e1",
56
56
  "scripts": {
57
57
  "build": "vite build",
58
58
  "test": "vitest run",