js-cloudimage-hotspot 1.1.9 → 1.1.11

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.
@@ -15,7 +15,8 @@ const et = {
15
15
  markerTheme: "default",
16
16
  brandColor: "#00aaff",
17
17
  fullscreenButton: !0,
18
- zoomControlsPosition: "bottom-right"
18
+ zoomControlsPosition: "bottom-right",
19
+ popoverTextAlign: "left"
19
20
  }, ot = {
20
21
  "data-ci-hotspot-src": { key: "src", type: "string" },
21
22
  "data-ci-hotspot-alt": { key: "alt", type: "string" },
@@ -43,7 +44,8 @@ const et = {
43
44
  "data-ci-hotspot-marker-theme": { key: "markerTheme", type: "string" },
44
45
  "data-ci-hotspot-brand-color": { key: "brandColor", type: "string" },
45
46
  "data-ci-hotspot-fullscreen-button": { key: "fullscreenButton", type: "boolean" },
46
- "data-ci-hotspot-zoom-controls-position": { key: "zoomControlsPosition", type: "string" }
47
+ "data-ci-hotspot-zoom-controls-position": { key: "zoomControlsPosition", type: "string" },
48
+ "data-ci-hotspot-popover-text-align": { key: "popoverTextAlign", type: "string" }
47
49
  };
48
50
  function it(s) {
49
51
  const t = {}, e = {};
@@ -908,7 +910,7 @@ const Wt = '.ci-hotspot-container{--ci-hotspot-marker-size: 24px;--ci-hotspot-ma
908
910
  applyTheme() {
909
911
  this.config.theme === "dark" ? u(this.containerEl, "ci-hotspot-theme-dark") : v(this.containerEl, "ci-hotspot-theme-dark");
910
912
  const t = this.config.markerTheme && this.config.markerTheme !== "default" ? this.config.markerTheme : this.config.invertMarkerTheme ? "inverted" : "default";
911
- v(this.containerEl, "ci-hotspot-marker-inverted"), v(this.containerEl, "ci-hotspot-marker-brand"), this.containerEl.style.removeProperty("--ci-hotspot-brand-color"), t === "inverted" ? u(this.containerEl, "ci-hotspot-marker-inverted") : t === "brand" && u(this.containerEl, "ci-hotspot-marker-brand"), this.config.brandColor && this.containerEl.style.setProperty("--ci-hotspot-brand-color", this.config.brandColor);
913
+ v(this.containerEl, "ci-hotspot-marker-inverted"), v(this.containerEl, "ci-hotspot-marker-brand"), this.containerEl.style.removeProperty("--ci-hotspot-brand-color"), t === "inverted" ? u(this.containerEl, "ci-hotspot-marker-inverted") : t === "brand" && u(this.containerEl, "ci-hotspot-marker-brand"), this.config.brandColor && this.containerEl.style.setProperty("--ci-hotspot-brand-color", this.config.brandColor), this.config.popoverTextAlign ? this.containerEl.style.setProperty("--ci-hotspot-popover-text-align", this.config.popoverTextAlign) : this.containerEl.style.removeProperty("--ci-hotspot-popover-text-align");
912
914
  }
913
915
  setupImage() {
914
916
  const t = () => {
@@ -1001,13 +1003,13 @@ const Wt = '.ci-hotspot-container{--ci-hotspot-marker-size: 24px;--ci-hotspot-ma
1001
1003
  });
1002
1004
  this.popovers.set(t.id, l), l.mount(this.containerEl, n), this.bindTrigger(t, n, l, r), r === "load" && this.imageLoaded && (this.closeAll(), l.show(), m(n, !0), this.ensureFocusTrap(t.id, l.element, n), (d = this.focusTraps.get(t.id)) == null || d.activate());
1003
1005
  }
1004
- /** For navigateTo hotspots without explicit data/content, generate popover content from the destination scene */
1006
+ /** For navigateTo hotspots without explicit data/content, generate popover content from the destination scene or label */
1005
1007
  enrichNavigateHotspot(t) {
1006
1008
  if (t.data || t.content) return t;
1007
- const e = this.scenesMap.get(t.navigateTo);
1008
- return e ? {
1009
+ const e = this.scenesMap.get(t.navigateTo), o = t.label || (e == null ? void 0 : e.alt) || (e == null ? void 0 : e.id);
1010
+ return o ? {
1009
1011
  ...t,
1010
- data: { title: t.label || e.alt || e.id }
1012
+ data: { title: o }
1011
1013
  } : t;
1012
1014
  }
1013
1015
  bindNavigateTrigger(t, e, o) {