@virtualdisplay.io/client 4.0.0-alpha.21 → 4.0.0-alpha.23

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.
@@ -50,11 +50,11 @@ function Nt(n) {
50
50
  const t = C(n);
51
51
  return t !== null && t.type === c.CAMERA && Array.isArray(t.transforms);
52
52
  }
53
- function Lt(n) {
53
+ function Mt(n) {
54
54
  const t = C(n);
55
55
  return t !== null && t.type === c.MAPPING && Array.isArray(t.attributes);
56
56
  }
57
- function Mt(n) {
57
+ function Lt(n) {
58
58
  const t = C(n);
59
59
  return t !== null && t.type === c.LOADING_INDICATOR && typeof t.progress == "number";
60
60
  }
@@ -1300,13 +1300,13 @@ const ve = (
1300
1300
  /** @type {LocalizedString} */
1301
1301
  "Dein Telefon öffnet das 3D-Modell im AR-Modus."
1302
1302
  )
1303
- ), Le = (
1303
+ ), Me = (
1304
1304
  /** @type {((inputs?: Controls_Qr_Modalinstructions1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Qr_Modalinstructions1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
1305
1305
  ((n = {}, t = {}) => {
1306
1306
  const e = t.locale ?? h();
1307
1307
  return e === "en" ? Ie() : e === "nl" ? Oe() : Ne();
1308
1308
  })
1309
- ), Me = (
1309
+ ), Le = (
1310
1310
  /** @type {(inputs: Controls_Qr_Closebutton1Inputs) => LocalizedString} */
1311
1311
  () => (
1312
1312
  /** @type {LocalizedString} */
@@ -1328,7 +1328,7 @@ const ve = (
1328
1328
  /** @type {((inputs?: Controls_Qr_Closebutton1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Qr_Closebutton1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
1329
1329
  ((n = {}, t = {}) => {
1330
1330
  const e = t.locale ?? h();
1331
- return e === "en" ? Me() : e === "nl" ? ze() : Pe();
1331
+ return e === "en" ? Le() : e === "nl" ? ze() : Pe();
1332
1332
  })
1333
1333
  ), $e = (
1334
1334
  /** @type {(inputs: Controls_Fullscreen_Buttonlabel1Inputs) => LocalizedString} */
@@ -1624,13 +1624,13 @@ const ve = (
1624
1624
  /** @type {LocalizedString} */
1625
1625
  "Tilt down"
1626
1626
  )
1627
- ), Ln = (
1627
+ ), Mn = (
1628
1628
  /** @type {(inputs: Controls_Camera_Tiltdown1Inputs) => LocalizedString} */
1629
1629
  () => (
1630
1630
  /** @type {LocalizedString} */
1631
1631
  "Omlaag kantelen"
1632
1632
  )
1633
- ), Mn = (
1633
+ ), Ln = (
1634
1634
  /** @type {(inputs: Controls_Camera_Tiltdown1Inputs) => LocalizedString} */
1635
1635
  () => (
1636
1636
  /** @type {LocalizedString} */
@@ -1640,7 +1640,7 @@ const ve = (
1640
1640
  /** @type {((inputs?: Controls_Camera_Tiltdown1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Camera_Tiltdown1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
1641
1641
  ((n = {}, t = {}) => {
1642
1642
  const e = t.locale ?? h();
1643
- return e === "en" ? Nn() : e === "nl" ? Ln() : Mn();
1643
+ return e === "en" ? Nn() : e === "nl" ? Mn() : Ln();
1644
1644
  })
1645
1645
  ), Pn = (
1646
1646
  /** @type {(inputs: Commerce_Submit_BusyInputs) => LocalizedString} */
@@ -2297,7 +2297,7 @@ class pi {
2297
2297
  })), this.dialog.card.element.appendChild(this.createText(Re(), {
2298
2298
  fontSize: w.fontSize.sm,
2299
2299
  color: m.neutral[600]
2300
- })), this.qrSlot = this.createQrSlot(), this.dialog.card.element.appendChild(this.qrSlot), this.dialog.card.element.appendChild(this.createText(Le(), {
2300
+ })), this.qrSlot = this.createQrSlot(), this.dialog.card.element.appendChild(this.qrSlot), this.dialog.card.element.appendChild(this.createText(Me(), {
2301
2301
  fontSize: w.fontSize.xs,
2302
2302
  color: m.neutral[500]
2303
2303
  }));
@@ -2346,8 +2346,8 @@ function ot(n) {
2346
2346
  return t * t * (3 - 2 * t);
2347
2347
  }
2348
2348
  function fi(n, t, e, i, o, s) {
2349
- const [r, l, d] = n, u = Math.cos(t), p = Math.sin(t), v = u * r + p * d, E = -p * r + u * d, k = Math.cos(e), S = Math.sin(e), R = k * l - S * E, M = S * l + k * E, W = 0.55;
2350
- return [i + v * s * W, o - R * s * W, M];
2349
+ const [r, l, d] = n, u = Math.cos(t), p = Math.sin(t), v = u * r + p * d, E = -p * r + u * d, k = Math.cos(e), S = Math.sin(e), R = k * l - S * E, L = S * l + k * E, W = 0.55;
2350
+ return [i + v * s * W, o - R * s * W, L];
2351
2351
  }
2352
2352
  function gi(n, t, e) {
2353
2353
  n.beginPath(), n.moveTo(t[0], t[1]), n.lineTo(e[0], e[1]), n.strokeStyle = "#000", n.lineWidth = 2, n.stroke();
@@ -2502,8 +2502,8 @@ class wi {
2502
2502
  const R = st[S];
2503
2503
  if (R === void 0)
2504
2504
  continue;
2505
- const M = Math.min(1, k - S);
2506
- bi(this.ctx, u, R[0], R[1], M);
2505
+ const L = Math.min(1, k - S);
2506
+ bi(this.ctx, u, R[0], R[1], L);
2507
2507
  }
2508
2508
  this.ctx.shadowBlur = 0;
2509
2509
  }
@@ -2553,7 +2553,7 @@ class _i {
2553
2553
  }
2554
2554
  }
2555
2555
  const T = 0.5;
2556
- class L {
2556
+ class M {
2557
2557
  element;
2558
2558
  constructor(t, e) {
2559
2559
  this.element = Object.assign(document.createElement("div"), { className: "vd-camera-controls" });
@@ -2565,7 +2565,7 @@ class L {
2565
2565
  }, o = Ci(t, e, i);
2566
2566
  e.onChange((s) => {
2567
2567
  i.targetRotation = s.rotation - i.thetaOffset, i.targetTilt = s.tilt, i.targetZoom = s.zoom, Si(o, e, s);
2568
- }), this.element.appendChild(L.buildZoom(o.zoomOut, o.zoomIn)), this.element.appendChild(L.buildDpad(o.tiltUp, o.rotateLeft, o.reset, o.rotateRight, o.tiltDown));
2568
+ }), this.element.appendChild(M.buildZoom(o.zoomOut, o.zoomIn)), this.element.appendChild(M.buildDpad(o.tiltUp, o.rotateLeft, o.reset, o.rotateRight, o.tiltDown));
2569
2569
  }
2570
2570
  static buildZoom(t, e) {
2571
2571
  const i = document.createElement("div");
@@ -2744,6 +2744,12 @@ class St {
2744
2744
  }
2745
2745
  const Oi = 572;
2746
2746
  class Ni {
2747
+ /** @param actionBarSlot The shared corner slot the AR/fullscreen buttons live in — the
2748
+ * "open configurator" toggle joins them there instead of floating as its own overlay. */
2749
+ constructor(t) {
2750
+ this.actionBarSlot = t;
2751
+ }
2752
+ actionBarSlot;
2747
2753
  element = null;
2748
2754
  body = null;
2749
2755
  openButton = null;
@@ -2766,19 +2772,19 @@ class Ni {
2766
2772
  const i = document.createElement("div");
2767
2773
  i.className = "vd-sidebar-header", i.appendChild(this.closeButton.element), this.body = document.createElement("div"), this.body.className = "vd-sidebar-body", this.body.appendChild(e), this.element = document.createElement("div"), this.element.className = "vd-sidebar vd-hidden", this.element.append(i, this.body), t.appendChild(this.element), this.openButton = new b({
2768
2774
  variant: "outline",
2769
- size: "default",
2775
+ size: "icon",
2770
2776
  label: nn(),
2771
2777
  icon: g.configurator({ size: 18 }),
2772
2778
  onClick: () => {
2773
2779
  this.expanded = !0, this.render();
2774
2780
  }
2775
- }), this.openButton.element.classList.add("vd-configurator-toggle", "vd-hidden"), t.appendChild(this.openButton.element), this.observe();
2781
+ }), this.openButton.element.classList.add("vd-configurator-toggle", "vd-hidden"), this.actionBarSlot.appendChild(this.openButton.element), this.observe();
2776
2782
  }
2777
2783
  setVisible(t) {
2778
2784
  this.visible = t, this.render();
2779
2785
  }
2780
2786
  destroy() {
2781
- this.observer?.disconnect(), this.observer = null, this.openButton?.element.remove(), this.element?.remove(), this.container?.classList.remove("vd-layout-sidebar-right", "vd-layout-sidebar-collapsed"), this.container = null;
2787
+ this.observer?.disconnect(), this.observer = null, this.openButton?.element.remove(), this.element?.remove(), this.container?.classList.remove("vd-layout-sidebar-right", "vd-layout-sidebar-permanent"), this.container = null;
2782
2788
  }
2783
2789
  observe() {
2784
2790
  typeof ResizeObserver > "u" || this.container === null || (this.observer = new ResizeObserver((t) => {
@@ -2793,10 +2799,10 @@ class Ni {
2793
2799
  if (this.element === null || this.openButton === null || this.closeButton === null || this.container === null)
2794
2800
  return;
2795
2801
  const t = this.visible && this.expanded, e = this.visible && !this.expanded;
2796
- this.element.classList.toggle("vd-hidden", !this.visible), this.element.classList.toggle("vd-sidebar-collapsed", e), this.openButton.element.classList.toggle("vd-hidden", !e), this.closeButton.element.style.display = this.collapsible ? "" : "none", this.container.classList.toggle("vd-layout-sidebar-right", t), this.container.classList.toggle("vd-layout-sidebar-collapsed", e);
2802
+ this.element.classList.toggle("vd-hidden", !this.visible), this.element.classList.toggle("vd-sidebar-collapsed", e), this.openButton.element.classList.toggle("vd-hidden", !e), this.closeButton.element.style.display = this.collapsible ? "" : "none", this.container.classList.toggle("vd-layout-sidebar-right", t), this.container.classList.toggle("vd-layout-sidebar-permanent", t && !this.collapsible);
2797
2803
  }
2798
2804
  }
2799
- class Li {
2805
+ class Mi {
2800
2806
  attach(t, e) {
2801
2807
  }
2802
2808
  setVisible(t) {
@@ -2804,13 +2810,13 @@ class Li {
2804
2810
  destroy() {
2805
2811
  }
2806
2812
  }
2807
- const Mi = {
2813
+ const Li = {
2808
2814
  "inframe-bottom-left": () => new St(),
2809
- "sidebar-right": () => new Ni(),
2810
- hidden: () => new Li()
2815
+ "sidebar-right": (n) => new Ni(n),
2816
+ hidden: () => new Mi()
2811
2817
  };
2812
- function zi(n) {
2813
- return (Mi[n ?? ""] ?? (() => new St()))();
2818
+ function zi(n, t) {
2819
+ return (Li[n ?? ""] ?? (() => new St()))(t);
2814
2820
  }
2815
2821
  const H = w.fontFamily.sans.join(", "), q = `
2816
2822
  position: absolute;
@@ -2911,8 +2917,28 @@ const H = w.fontFamily.sans.join(", "), q = `
2911
2917
  /* sidebar-right layout — a docked, full-height right panel */
2912
2918
  .vd-container { --vd-sidebar-width: 300px; }
2913
2919
 
2920
+ .vd-container > iframe {
2921
+ width: 100%;
2922
+ height: 100%;
2923
+ border: none;
2924
+ display: block;
2925
+ }
2926
+
2927
+ /* Permanently docked panel (wide embeds, not collapsible): the viewer fills the
2928
+ remaining width instead of the panel floating over it. On narrow embeds the
2929
+ panel is a temporary tap-to-reveal overlay instead (vd-layout-sidebar-right
2930
+ without -permanent), where covering part of the model briefly is expected. */
2931
+ .vd-container.vd-layout-sidebar-permanent > iframe {
2932
+ width: calc(100% - var(--vd-sidebar-width));
2933
+ }
2934
+
2914
2935
  .vd-hidden { display: none !important; }
2915
2936
 
2937
+ /* the "open configurator" toggle joins the shared bottom-right slot as a flex child;
2938
+ order pins it after AR/fullscreen regardless of DOM insertion order (MAPPING data,
2939
+ which mounts this button, always arrives before the toolbar mounts on ready). */
2940
+ .vd-configurator-toggle { order: 1; }
2941
+
2916
2942
  .vd-sidebar {
2917
2943
  position: absolute;
2918
2944
  inset-block: 0;
@@ -2956,25 +2982,10 @@ const H = w.fontFamily.sans.join(", "), q = `
2956
2982
  gap: ${a[5]};
2957
2983
  }
2958
2984
 
2959
- /* floating toggle, shown when the sidebar is collapsed on narrow embeds */
2960
- .vd-configurator-toggle {
2961
- position: absolute;
2962
- inset-block-end: ${a[3]};
2963
- inset-inline-end: ${a[3]};
2964
- z-index: 12;
2965
- }
2966
-
2967
2985
  /* while the panel is open, keep the corner controls clear of it */
2968
2986
  .vd-layout-sidebar-right .vd-slot-top-right { inset-inline-end: calc(var(--vd-sidebar-width) + ${a[3]}); }
2969
2987
  .vd-layout-sidebar-right .vd-slot-bottom-right { inset-inline-end: calc(var(--vd-sidebar-width) + ${a[3]}); }
2970
2988
 
2971
- /* while collapsed on a narrow embed, lift the bottom-right controls above the
2972
- floating toggle so the AR/fullscreen buttons aren't hidden behind the
2973
- "open configurator" button (spacing[9] = the default toggle button height) */
2974
- .vd-layout-sidebar-collapsed .vd-slot-bottom-right {
2975
- inset-block-end: calc(${a[3]} + ${a[9]} + ${a[1.5]});
2976
- }
2977
-
2978
2989
  /* Price + CTA — sit under the attribute controls, separated by a hairline */
2979
2990
  .vd-commerce {
2980
2991
  display: flex;
@@ -3070,7 +3081,7 @@ class Di {
3070
3081
  this.settings = t, t.language !== void 0 && ft(t.language, { reload: !1 }), this.syncScreenshotButton(), this.actionBar?.applySettings(t), this.cameraControls !== null && (this.cameraControls.element.style.display = t.cameraControls === !0 ? "flex" : "none"), this.placeScreenshotButton();
3071
3082
  }
3072
3083
  renderAttributeControls(t, e) {
3073
- if (!(this.container === null || this.slots.topRight === null) && (this.cameraControls?.element.remove(), this.cameraControls = null, this.teardownConfigurator(), this.settings.cameraControls === !0 && (this.cameraControls = new L(this.options.cameraApi, this.options.cameraPositionApi), this.cameraControls.element.style.display = "none", this.slots.topRight.appendChild(this.cameraControls.element)), this.placeScreenshotButton(), e.length !== 0)) {
3084
+ if (!(this.container === null || this.slots.topRight === null || this.slots.bottomRight === null) && (this.cameraControls?.element.remove(), this.cameraControls = null, this.teardownConfigurator(), this.settings.cameraControls === !0 && (this.cameraControls = new M(this.options.cameraApi, this.options.cameraPositionApi), this.cameraControls.element.style.display = "none", this.slots.topRight.appendChild(this.cameraControls.element)), this.placeScreenshotButton(), e.length !== 0)) {
3074
3085
  this.attributes = document.createElement("div"), this.attributes.className = "vd-attributes";
3075
3086
  for (const i of e)
3076
3087
  this.attributes.appendChild(Ei(
@@ -3080,7 +3091,7 @@ class Di {
3080
3091
  this.options.onSelect,
3081
3092
  this.options.onSubscribe
3082
3093
  ));
3083
- this.commerce = new Ri(this.options.configuration), this.attributes.appendChild(this.commerce.element), this.layout = zi(this.settings.configuratorLayout), this.layout.attach(this.container, this.attributes);
3094
+ this.commerce = new Ri(this.options.configuration), this.attributes.appendChild(this.commerce.element), this.layout = zi(this.settings.configuratorLayout, this.slots.bottomRight), this.layout.attach(this.container, this.attributes);
3084
3095
  }
3085
3096
  }
3086
3097
  get viewerSettings() {
@@ -3144,12 +3155,7 @@ class Ui {
3144
3155
  }
3145
3156
  createIframe() {
3146
3157
  const t = document.createElement("iframe");
3147
- return t.src = this.buildUrl(), Object.assign(t.style, {
3148
- width: "100%",
3149
- height: "100%",
3150
- border: "none",
3151
- display: "block"
3152
- }), t.setAttribute("allow", "xr-spatial-tracking; fullscreen"), t;
3158
+ return t.src = this.buildUrl(), t.setAttribute("allow", "xr-spatial-tracking; fullscreen"), t;
3153
3159
  }
3154
3160
  attachToParent(t) {
3155
3161
  this.getParentElement().appendChild(t);
@@ -3186,11 +3192,11 @@ function Vi(n) {
3186
3192
  }), t.on(c.CAMERA, (e) => {
3187
3193
  Nt(e) && n.cameraPosition.handlePositionUpdate(e);
3188
3194
  }), t.on(c.LOADING_INDICATOR, (e) => {
3189
- Mt(e) && (e.error !== void 0 ? n.ui.showError(e.error) : n.ui.updateProgress(e.progress, e.phase));
3195
+ Lt(e) && (e.error !== void 0 ? n.ui.showError(e.error) : n.ui.updateProgress(e.progress, e.phase));
3190
3196
  }), t.on(c.CONFIG, (e) => {
3191
3197
  Pt(e) && n.applyConfig(e);
3192
3198
  }), t.on(c.MAPPING, (e) => {
3193
- Lt(e) && (n.attributes.handleMappingReceived(e), n.configuration.handleSelectionChanged(n.attributes.getSelection()), n.ui.renderAttributeControls(n.attributes, e.attributes), n.readyStateTracker.handleMappingReceived());
3199
+ Mt(e) && (n.attributes.handleMappingReceived(e), n.configuration.handleSelectionChanged(n.attributes.getSelection()), n.ui.renderAttributeControls(n.attributes, e.attributes), n.readyStateTracker.handleMappingReceived());
3194
3200
  }), ji(n);
3195
3201
  }
3196
3202
  function ji(n) {