@roomle/embedding-lib 7.3.0-alpha.4 → 8.0.0-alpha.2

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.
@@ -1,6 +1,12 @@
1
- import { t as e } from "./rolldown-runtime-C-QNzSnW.mjs";
2
- //#region packages/embedding-lib/src/plugins/constants.ts
3
- var t = "rml-drag-in-styles", n = "rml-drag-in-drag-element", r = "rml-drag-in-overlay", i = "rml-drag-in-drag-ghost", a = "rml-drag-in-fade-in", o = "rml-drag-in-fade-out", s = { DISPLAY_NONE: "rml-display-none" }, c = .5, l = "250ms", u = "forwards", d = `@keyframes ${a} {from{opacity: 0;}to {opacity: ${c};}}`, f = `@keyframes ${o} {from{opacity: ${c};}to {opacity: 0;}}`, p = `${a} ${l} ${u}`, m = `${o} ${l} ${u}`, h = "https://res.cloudinary.com/roomle/image/upload/v1729679975/fallback_afpyqr.jpg", g = 112, _ = 112, v = class {
1
+ //#region \0rolldown/runtime.js
2
+ var e = Object.defineProperty, t = (t, n) => {
3
+ let r = {};
4
+ for (var i in t) e(r, i, {
5
+ get: t[i],
6
+ enumerable: !0
7
+ });
8
+ return n || e(r, Symbol.toStringTag, { value: "Module" }), r;
9
+ }, n = "rml-drag-in-styles", r = "rml-drag-in-drag-element", i = "rml-drag-in-overlay", a = "rml-drag-in-drag-ghost", o = "rml-drag-in-fade-in", s = "rml-drag-in-fade-out", c = { DISPLAY_NONE: "rml-display-none" }, l = .5, u = "250ms", d = "forwards", f = `@keyframes ${o} {from{opacity: 0;}to {opacity: ${l};}}`, p = `@keyframes ${s} {from{opacity: ${l};}to {opacity: 0;}}`, m = `${o} ${u} ${d}`, h = `${s} ${u} ${d}`, g = "https://res.cloudinary.com/roomle/image/upload/v1729679975/fallback_afpyqr.jpg", _ = 112, v = 112, y = class {
4
10
  _mainDomElement;
5
11
  _instance;
6
12
  _mode = "website";
@@ -11,31 +17,31 @@ var t = "rml-drag-in-styles", n = "rml-drag-in-drag-element", r = "rml-drag-in-o
11
17
  async init() {
12
18
  return Promise.resolve();
13
19
  }
14
- }, y = /* @__PURE__ */ e({ DragIn: () => b }), b = class extends v {
20
+ }, b = /* @__PURE__ */ t({ DragIn: () => x }), x = class extends y {
15
21
  options = {};
16
22
  _customDragSignal = new AbortController();
17
23
  _injectStyles() {
18
24
  if (!document.getElementById("rml-drag-in-styles")) {
19
25
  let e = document.createElement("style");
20
- e.type = "text/css", e.id = t, e.innerHTML = `
21
- .${s.DISPLAY_NONE}{display:none}
22
- .${r}{position:absolute;top:0;left:0;width:100%;height:100%;z-index:999;}
23
- .${i}{position:absolute;top:0;left:0;width:1px;height:1px;z-index:999;pointer-events:none;background-color:transparent;}
24
- ${d}
26
+ e.type = "text/css", e.id = n, e.innerHTML = `
27
+ .${c.DISPLAY_NONE}{display:none}
28
+ .${i}{position:absolute;top:0;left:0;width:100%;height:100%;z-index:999;}
29
+ .${a}{position:absolute;top:0;left:0;width:1px;height:1px;z-index:999;pointer-events:none;background-color:transparent;}
25
30
  ${f}
31
+ ${p}
26
32
  `, document.head.appendChild(e);
27
33
  }
28
34
  }
29
35
  _initializeDragGhost() {
30
- let e = this._mainDomElement.parentNode, t = e.querySelector("." + i);
31
- t || (t = document.createElement("div"), t.classList.add(i), t.innerText = " ", e.appendChild(t));
36
+ let e = this._mainDomElement.parentNode, t = e.querySelector("." + a);
37
+ t || (t = document.createElement("div"), t.classList.add(a), t.innerText = " ", e.appendChild(t));
32
38
  }
33
39
  constructor(e, t, n, r) {
34
40
  super(e, t, n, r), this._mainDomElement = t, this._injectStyles(), this._initializeDragGhost();
35
41
  }
36
42
  async init() {
37
43
  if (await super.init(), this._mode === "website") try {
38
- let { DragInFromWebsiteStrategy: e } = await import("./from-website-D07qrmeq.mjs");
44
+ let { DragInFromWebsiteStrategy: e } = await import("./from-website-DZJy_l42.mjs");
39
45
  this._strategy = new e(this._instance, this._mainDomElement, {
40
46
  settings: this.options,
41
47
  mode: "website"
@@ -44,7 +50,7 @@ var t = "rml-drag-in-styles", n = "rml-drag-in-drag-element", r = "rml-drag-in-o
44
50
  throw console.error("Could not load Dragin strategy \"FromWebsite\""), e;
45
51
  }
46
52
  else if (this._mode === "custom-view") try {
47
- let { DragInFromCustomViewStrategy: e } = await import("./from-custom-view-BxJkoaTB.mjs");
53
+ let { DragInFromCustomViewStrategy: e } = await import("./from-custom-view-Q9A-J7qV.mjs");
48
54
  this._strategy = new e(this._instance, this._mainDomElement, this.options, this._viewName);
49
55
  } catch (e) {
50
56
  throw console.error("Could not load Dragin strategy \"FromCustomView\""), e;
@@ -99,4 +105,4 @@ var t = "rml-drag-in-styles", n = "rml-drag-in-drag-element", r = "rml-drag-in-o
99
105
  }
100
106
  };
101
107
  //#endregion
102
- export { d as a, n as c, h as d, g as f, c as h, p as i, i as l, t as m, y as n, m as o, r as p, s as r, f as s, b as t, _ as u };
108
+ export { f as a, r as c, g as d, _ as f, l as h, m as i, a as l, n as m, b as n, h as o, i as p, c as r, p as s, x as t, v as u };
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, d as n, f as r, h as i, i as a, m as o, o as s, s as c, t as l, u } from "./drag-in-BCnrHxxt.mjs";
1
+ import { a as e, c as t, d as n, f as r, h as i, i as a, m as o, o as s, s as c, t as l, u } from "./drag-in-ClPpCYyi.mjs";
2
2
  export { l as DragIn, a as RML_DRAG_GHOST_FADE_IN, e as RML_DRAG_GHOST_FADE_IN_ANIMATION_CSS, s as RML_DRAG_GHOST_FADE_OUT, c as RML_DRAG_GHOST_FADE_OUT_ANIMATION_CSS, t as RML_DRAG_IN_DRAG_ELEMENT_ID, u as RML_DRAG_IN_FALLBACK_GHOST_HEIGHT, n as RML_DRAG_IN_FALLBACK_GHOST_URL, r as RML_DRAG_IN_FALLBACK_GHOST_WIDTH, o as RML_DRAG_IN_STYLES_ID, i as TARGET_OPACITY };
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, d as n, f as r, h as i, i as a, m as o, o as s, s as c, t as l, u } from "./drag-in-DDGopCLr.mjs";
1
+ import { a as e, c as t, d as n, f as r, h as i, i as a, m as o, o as s, s as c, t as l, u } from "./drag-in-CV1E-DO6.mjs";
2
2
  export { l as DragIn, a as RML_DRAG_GHOST_FADE_IN, e as RML_DRAG_GHOST_FADE_IN_ANIMATION_CSS, s as RML_DRAG_GHOST_FADE_OUT, c as RML_DRAG_GHOST_FADE_OUT_ANIMATION_CSS, t as RML_DRAG_IN_DRAG_ELEMENT_ID, u as RML_DRAG_IN_FALLBACK_GHOST_HEIGHT, n as RML_DRAG_IN_FALLBACK_GHOST_URL, r as RML_DRAG_IN_FALLBACK_GHOST_WIDTH, o as RML_DRAG_IN_STYLES_ID, i as TARGET_OPACITY };
@@ -1,13 +1,13 @@
1
- import { a as e, c as t, n } from "./utils-i2eOrtnv.mjs";
2
- import { d as r } from "./drag-in-BCnrHxxt.mjs";
3
- import { t as i } from "./drag-ghost-DqF-SGUQ.mjs";
4
- var a = (e, n = 0) => t(e) ? {
5
- clientX: e.touches[n].clientX,
6
- clientY: e.touches[n].clientY
1
+ import { d as e } from "./drag-in-ClPpCYyi.mjs";
2
+ import { a as t, c as n, n as r } from "./utils-DxJ3PcKe.mjs";
3
+ import { t as i } from "./drag-ghost-BxqPJdhq.mjs";
4
+ var a = (e, t = 0) => n(e) ? {
5
+ clientX: e.touches[t].clientX,
6
+ clientY: e.touches[t].clientY
7
7
  } : {
8
8
  clientX: e.clientX,
9
9
  clientY: e.clientY
10
- }, o = (e) => e && t(e) ? e.touches.length > 0 : !0, s = class {
10
+ }, o = (e) => e && n(e) ? e.touches.length > 0 : !0, s = class {
11
11
  _touchDragTimeOut;
12
12
  _onTouchDragStart;
13
13
  _payload = null;
@@ -19,7 +19,7 @@ var a = (e, n = 0) => t(e) ? {
19
19
  this._payload = e, this._onTouchDragStart = t, this._delay = typeof n.delay == "number" ? n.delay : 500, this._epsilon = typeof n.epsilon == "number" ? n.epsilon : 10;
20
20
  }
21
21
  onStart(e) {
22
- o(e) && (this._touchDragTimeOut ||= (this._firstTouch = a(e, t(e) ? e.touches.length - 1 : 0), setTimeout(() => {
22
+ o(e) && (this._touchDragTimeOut ||= (this._firstTouch = a(e, n(e) ? e.touches.length - 1 : 0), setTimeout(() => {
23
23
  this._clearTimeout(), this._lastTouch ||= a(e), this._checkXDistance(e)();
24
24
  }, this._delay)));
25
25
  }
@@ -70,12 +70,12 @@ var a = (e, n = 0) => t(e) ? {
70
70
  _reset() {
71
71
  this._startX = 0, this._startY = 0, this._lastX = 0, this._lastY = 0, this._isWaiting = !1;
72
72
  }
73
- }, f = "data-rml-old-draggable", p = void 0, m = (e, n) => {
74
- let r = t(e), i = {
73
+ }, f = "data-rml-old-draggable", p = void 0, m = (e, t) => {
74
+ let r = n(e), i = {
75
75
  delay: r ? 500 : 100,
76
76
  epsilon: r ? 10 : 15
77
77
  };
78
- if (!n) return i;
78
+ if (!t) return i;
79
79
  if (!r && !(e instanceof MouseEvent)) return console.warn("Unsupported event! It is not TouchEvent and also not MouseEvent"), i;
80
80
  let { delayKey: a, epsilonKey: o } = r ? {
81
81
  delayKey: "touchDragDelay",
@@ -84,22 +84,22 @@ var a = (e, n = 0) => t(e) ? {
84
84
  delayKey: "customDragDelay",
85
85
  epsilonKey: "customDragEpsilon"
86
86
  };
87
- return typeof n[a] == "number" && (i.delay = n.touchDragDelay), typeof n[o] == "number" && (i.epsilon = n.touchDragEpsilon), i;
88
- }, h = (e) => {
89
- let t = "", n = 112, i = 112;
90
- if (!e) return {
91
- url: r,
92
- width: n,
87
+ return typeof t[a] == "number" && (i.delay = t.touchDragDelay), typeof t[o] == "number" && (i.epsilon = t.touchDragEpsilon), i;
88
+ }, h = (t) => {
89
+ let n = "", r = 112, i = 112;
90
+ if (!t) return {
91
+ url: e,
92
+ width: r,
93
93
  height: i
94
94
  };
95
- let a = e;
95
+ let a = t;
96
96
  if (a instanceof HTMLElement) {
97
- let e = a.getBoundingClientRect(), o = a.getAttribute("data-rml-ghost-url"), s = a.getAttribute("data-rml-ghost-width"), c = a.getAttribute("data-rml-ghost-height");
98
- o ? t = o : !o && a instanceof HTMLImageElement && a.src && (t = a.src), t ? (n = e.width, i = e.height) : t = r, n = s ? parseInt(s, 10) : n, i = c ? parseInt(c, 10) : i;
97
+ let t = a.getBoundingClientRect(), o = a.getAttribute("data-rml-ghost-url"), s = a.getAttribute("data-rml-ghost-width"), c = a.getAttribute("data-rml-ghost-height");
98
+ o ? n = o : !o && a instanceof HTMLImageElement && a.src && (n = a.src), n ? (r = t.width, i = t.height) : n = e, r = s ? parseInt(s, 10) : r, i = c ? parseInt(c, 10) : i;
99
99
  }
100
100
  return {
101
- url: t || "https://res.cloudinary.com/roomle/image/upload/v1729679975/fallback_afpyqr.jpg",
102
- width: n,
101
+ url: n || "https://res.cloudinary.com/roomle/image/upload/v1729679975/fallback_afpyqr.jpg",
102
+ width: r,
103
103
  height: i
104
104
  };
105
105
  }, g = class {
@@ -156,12 +156,12 @@ var a = (e, n = 0) => t(e) ? {
156
156
  }, this._hasEnteredIframe = !1, this.isDragging = !0;
157
157
  }
158
158
  }
159
- _dragUpdate(t) {
160
- document.body.focus(), this._currentCustomDrag && this._currentCustomDrag.onMove(t);
161
- let { clientX: r, clientY: i } = n(t);
159
+ _dragUpdate(e) {
160
+ document.body.focus(), this._currentCustomDrag && this._currentCustomDrag.onMove(e);
161
+ let { clientX: n, clientY: i } = r(e);
162
162
  if (this._dragGhost) {
163
163
  let { width: e, height: t } = this._mainDomElement.getBoundingClientRect();
164
- this._dragGhost.updateDragGhost(r, i, { ghost: { visibleIn: {
164
+ this._dragGhost.updateDragGhost(n, i, { ghost: { visibleIn: {
165
165
  x: 0,
166
166
  y: 0,
167
167
  width: e,
@@ -169,7 +169,7 @@ var a = (e, n = 0) => t(e) ? {
169
169
  } } });
170
170
  }
171
171
  if (this._phase.kind !== "ready") return;
172
- let { view: a, canvas: o, overlay: s, interactionContainer: c } = this._phase.bounds, l = a.x + r, u = a.y + i, d = e(l, u, o, s, c);
172
+ let { view: a, canvas: o, overlay: s, interactionContainer: c } = this._phase.bounds, l = a.x + n, u = a.y + i, d = t(l, u, o, s, c);
173
173
  if (d && !this._hasEnteredIframe && this._pendingDragIn && (this._instance.dragInObject(this._pendingDragIn.id, l, u, this._pendingDragIn.type), this._hasEnteredIframe = !0), !d && this._hasEnteredIframe && (this._instance.cancelDragIn(), this._hasEnteredIframe = !1), !this._hasEnteredIframe) return;
174
174
  let { url: f, width: p, height: m } = h(this._startTarget), g = this._options || {}, _ = {
175
175
  ghost: {
@@ -190,13 +190,13 @@ var a = (e, n = 0) => t(e) ? {
190
190
  _dragEnd() {
191
191
  this._dragGeneration++, this._currentCustomDrag && this._currentCustomDrag.onEnd(), this._currentCustomDrag = null, this.isDragging = !1, this._phase = { kind: "idle" }, this._resetStartTarget(), this._instance.enableEvents(), this._dragGhost &&= (this._dragGhost.removeDragGhost(), null), this._hasEnteredIframe && this._instance.dragInObjectEnd(), this._hasEnteredIframe = !1, this._pendingDragIn = null;
192
192
  }
193
- dragStart(e, n, r) {
194
- this._instance.disableEvents(), this._startTarget = n.target, this._currentCustomDrag = t(n) ? new s(p, { onTouchDragStart: (t, n) => {
193
+ dragStart(e, t, r) {
194
+ this._instance.disableEvents(), this._startTarget = t.target, this._currentCustomDrag = n(t) ? new s(p, { onTouchDragStart: (t, n) => {
195
195
  this._dragStart(e, n, r);
196
196
  } }, {
197
- ...m(n, this._options),
197
+ ...m(t, this._options),
198
198
  delay: 0
199
- }) : new d({ onCustomDragStart: (t) => this._dragStart(e, t, r) }, m(n, this._options)), this._currentCustomDrag.onStart(n);
199
+ }) : new d({ onCustomDragStart: (t) => this._dragStart(e, t, r) }, m(t, this._options)), this._currentCustomDrag.onStart(t);
200
200
  }
201
201
  dragEnd() {
202
202
  this._dragEnd();
@@ -1,13 +1,13 @@
1
- import { a as e, c as t, n } from "./utils-Co3lE-Ji.mjs";
2
- import { d as r } from "./drag-in-DDGopCLr.mjs";
3
- import { t as i } from "./drag-ghost-Rbgko27K.mjs";
4
- var a = (e, n = 0) => t(e) ? {
5
- clientX: e.touches[n].clientX,
6
- clientY: e.touches[n].clientY
1
+ import { d as e } from "./drag-in-CV1E-DO6.mjs";
2
+ import { a as t, c as n, n as r } from "./utils-wJ80awOA.mjs";
3
+ import { t as i } from "./drag-ghost-CDFtC1pd.mjs";
4
+ var a = (e, t = 0) => n(e) ? {
5
+ clientX: e.touches[t].clientX,
6
+ clientY: e.touches[t].clientY
7
7
  } : {
8
8
  clientX: e.clientX,
9
9
  clientY: e.clientY
10
- }, o = (e) => !e || !t(e) || e.touches.length > 0, s = class {
10
+ }, o = (e) => !e || !n(e) || e.touches.length > 0, s = class {
11
11
  _touchDragTimeOut;
12
12
  _onTouchDragStart;
13
13
  _payload = null;
@@ -19,7 +19,7 @@ var a = (e, n = 0) => t(e) ? {
19
19
  this._payload = e, this._onTouchDragStart = t, this._delay = typeof n.delay == "number" ? n.delay : 500, this._epsilon = typeof n.epsilon == "number" ? n.epsilon : 10;
20
20
  }
21
21
  onStart(e) {
22
- o(e) && (this._touchDragTimeOut ||= (this._firstTouch = a(e, t(e) ? e.touches.length - 1 : 0), setTimeout(() => {
22
+ o(e) && (this._touchDragTimeOut ||= (this._firstTouch = a(e, n(e) ? e.touches.length - 1 : 0), setTimeout(() => {
23
23
  this._clearTimeout(), this._lastTouch ||= a(e), this._checkXDistance(e)();
24
24
  }, this._delay)));
25
25
  }
@@ -70,12 +70,12 @@ var a = (e, n = 0) => t(e) ? {
70
70
  _reset() {
71
71
  this._startX = 0, this._startY = 0, this._lastX = 0, this._lastY = 0, this._isWaiting = !1;
72
72
  }
73
- }, u = "data-rml-old-draggable", d = (e, n) => {
74
- let r = t(e), i = {
73
+ }, u = "data-rml-old-draggable", d = (e, t) => {
74
+ let r = n(e), i = {
75
75
  delay: r ? 500 : 100,
76
76
  epsilon: r ? 10 : 15
77
77
  };
78
- if (!n || !(r || e instanceof MouseEvent)) return i;
78
+ if (!t || !(r || e instanceof MouseEvent)) return i;
79
79
  let { delayKey: a, epsilonKey: o } = r ? {
80
80
  delayKey: "touchDragDelay",
81
81
  epsilonKey: "touchDragEpsilon"
@@ -83,7 +83,7 @@ var a = (e, n = 0) => t(e) ? {
83
83
  delayKey: "customDragDelay",
84
84
  epsilonKey: "customDragEpsilon"
85
85
  };
86
- return typeof n[a] == "number" && (i.delay = n.touchDragDelay), typeof n[o] == "number" && (i.epsilon = n.touchDragEpsilon), i;
86
+ return typeof t[a] == "number" && (i.delay = t.touchDragDelay), typeof t[o] == "number" && (i.epsilon = t.touchDragEpsilon), i;
87
87
  }, f = class {
88
88
  _options = {};
89
89
  _instance;
@@ -139,9 +139,9 @@ var a = (e, n = 0) => t(e) ? {
139
139
  }, this._hasEnteredIframe = !1, this.isDragging = !0;
140
140
  }
141
141
  }
142
- _dragUpdate(t) {
143
- document.body.focus(), this._currentCustomDrag && this._currentCustomDrag.onMove(t);
144
- let { clientX: i, clientY: a } = n(t);
142
+ _dragUpdate(n) {
143
+ document.body.focus(), this._currentCustomDrag && this._currentCustomDrag.onMove(n);
144
+ let { clientX: i, clientY: a } = r(n);
145
145
  if (this._dragGhost) {
146
146
  let { width: e, height: t } = this._mainDomElement.getBoundingClientRect();
147
147
  this._dragGhost.updateDragGhost(i, a, { ghost: { visibleIn: {
@@ -152,23 +152,23 @@ var a = (e, n = 0) => t(e) ? {
152
152
  } } });
153
153
  }
154
154
  if (this._phase.kind !== "ready") return;
155
- let { view: o, canvas: s, overlay: c, interactionContainer: l } = this._phase.bounds, u = o.x + i, d = o.y + a, f = e(u, d, s, c, l);
155
+ let { view: o, canvas: s, overlay: c, interactionContainer: l } = this._phase.bounds, u = o.x + i, d = o.y + a, f = t(u, d, s, c, l);
156
156
  if (f && !this._hasEnteredIframe && this._pendingDragIn && (this._instance.dragInObject(this._pendingDragIn.id, u, d, this._pendingDragIn.type), this._hasEnteredIframe = !0), !f && this._hasEnteredIframe && (this._instance.cancelDragIn(), this._hasEnteredIframe = !1), !this._hasEnteredIframe) return;
157
- let { url: p, width: m, height: h } = ((e) => {
158
- let t = "", n = 112, i = 112;
159
- if (!e) return {
160
- url: r,
161
- width: n,
157
+ let { url: p, width: m, height: h } = ((t) => {
158
+ let n = "", r = 112, i = 112;
159
+ if (!t) return {
160
+ url: e,
161
+ width: r,
162
162
  height: i
163
163
  };
164
- let a = e;
164
+ let a = t;
165
165
  if (a instanceof HTMLElement) {
166
- let e = a.getBoundingClientRect(), o = a.getAttribute("data-rml-ghost-url"), s = a.getAttribute("data-rml-ghost-width"), c = a.getAttribute("data-rml-ghost-height");
167
- o ? t = o : !o && a instanceof HTMLImageElement && a.src && (t = a.src), t ? (n = e.width, i = e.height) : t = r, n = s ? parseInt(s, 10) : n, i = c ? parseInt(c, 10) : i;
166
+ let t = a.getBoundingClientRect(), o = a.getAttribute("data-rml-ghost-url"), s = a.getAttribute("data-rml-ghost-width"), c = a.getAttribute("data-rml-ghost-height");
167
+ o ? n = o : !o && a instanceof HTMLImageElement && a.src && (n = a.src), n ? (r = t.width, i = t.height) : n = e, r = s ? parseInt(s, 10) : r, i = c ? parseInt(c, 10) : i;
168
168
  }
169
169
  return {
170
- url: t || "https://res.cloudinary.com/roomle/image/upload/v1729679975/fallback_afpyqr.jpg",
171
- width: n,
170
+ url: n || "https://res.cloudinary.com/roomle/image/upload/v1729679975/fallback_afpyqr.jpg",
171
+ width: r,
172
172
  height: i
173
173
  };
174
174
  })(this._startTarget), g = this._options || {}, _ = {
@@ -190,13 +190,13 @@ var a = (e, n = 0) => t(e) ? {
190
190
  _dragEnd() {
191
191
  this._dragGeneration++, this._currentCustomDrag && this._currentCustomDrag.onEnd(), this._currentCustomDrag = null, this.isDragging = !1, this._phase = { kind: "idle" }, this._resetStartTarget(), this._instance.enableEvents(), this._dragGhost &&= (this._dragGhost.removeDragGhost(), null), this._hasEnteredIframe && this._instance.dragInObjectEnd(), this._hasEnteredIframe = !1, this._pendingDragIn = null;
192
192
  }
193
- dragStart(e, n, r) {
194
- this._instance.disableEvents(), this._startTarget = n.target, this._currentCustomDrag = t(n) ? new s(void 0, { onTouchDragStart: (t, n) => {
193
+ dragStart(e, t, r) {
194
+ this._instance.disableEvents(), this._startTarget = t.target, this._currentCustomDrag = n(t) ? new s(void 0, { onTouchDragStart: (t, n) => {
195
195
  this._dragStart(e, n, r);
196
196
  } }, {
197
- ...d(n, this._options),
197
+ ...d(t, this._options),
198
198
  delay: 0
199
- }) : new l({ onCustomDragStart: (t) => this._dragStart(e, t, r) }, d(n, this._options)), this._currentCustomDrag.onStart(n);
199
+ }) : new l({ onCustomDragStart: (t) => this._dragStart(e, t, r) }, d(t, this._options)), this._currentCustomDrag.onStart(t);
200
200
  }
201
201
  dragEnd() {
202
202
  this._dragEnd();
@@ -1,6 +1,6 @@
1
- import { c as e, i as t, n, o as r, r as i, s as a } from "./utils-Co3lE-Ji.mjs";
2
- import { l as o, p as s, r as c } from "./drag-in-DDGopCLr.mjs";
3
- import { t as l } from "./drag-ghost-Rbgko27K.mjs";
1
+ import { l as e, p as t, r as n } from "./drag-in-CV1E-DO6.mjs";
2
+ import { c as r, i, n as a, o, r as s, s as c } from "./utils-wJ80awOA.mjs";
3
+ import { t as l } from "./drag-ghost-CDFtC1pd.mjs";
4
4
  var u = class {
5
5
  _options = {};
6
6
  _instance;
@@ -34,9 +34,9 @@ var u = class {
34
34
  beforeUpdateGhost(e) {
35
35
  this._onBeforeUpdateDrag = e;
36
36
  }
37
- async dragStart(e, r, a = "rml_id") {
37
+ async dragStart(r, o, c = "rml_id") {
38
38
  let u = ++this._dragGeneration, d = this._mainDomElement.parentNode;
39
- if (i(d).position !== "relative") {
39
+ if (s(d).position !== "relative") {
40
40
  this._phase = {
41
41
  kind: "failed",
42
42
  reason: "parent of iframe should have position relative, otherwise drag-in can not detect the x/y coordinates correctly"
@@ -44,19 +44,19 @@ var u = class {
44
44
  return;
45
45
  }
46
46
  this._mainDomElement.style.pointerEvents = "none";
47
- let f = d.querySelector("." + s);
48
- f || (f = document.createElement("div"), f.classList.add(s), d.appendChild(f)), f.classList.remove(c.DISPLAY_NONE), r.target.getAttribute("draggable");
49
- let p = d.querySelector("." + o);
50
- this._currentDrag.event = r;
51
- let m = r.target, h = m.cloneNode(!0), g = m.getBoundingClientRect();
47
+ let f = d.querySelector("." + t);
48
+ f || (f = document.createElement("div"), f.classList.add(t), d.appendChild(f)), f.classList.remove(n.DISPLAY_NONE), o.target.getAttribute("draggable");
49
+ let p = d.querySelector("." + e);
50
+ this._currentDrag.event = o;
51
+ let m = o.target, h = m.cloneNode(!0), g = m.getBoundingClientRect();
52
52
  h.style.width = `${g.width}px`, h.style.height = `${g.height}px`, this._currentDrag.ghost = new l(h), this._currentDrag.offset || (this._currentDrag.offset = {
53
53
  x: 0,
54
54
  y: 0
55
55
  });
56
- let { clientX: _, clientY: v } = n(r, this._firefoxDragPosition);
57
- this._currentDrag.offset.x = _ - g.left, this._currentDrag.offset.y = v - g.top, r instanceof DragEvent && r.dataTransfer && r.dataTransfer.setDragImage && r.dataTransfer.setDragImage(p, 0, 0), t(d, this._currentDrag.event || r, this._firefoxDragPosition), this._pendingDragIn = {
58
- id: e,
59
- type: a
56
+ let { clientX: _, clientY: v } = a(o, this._firefoxDragPosition);
57
+ this._currentDrag.offset.x = _ - g.left, this._currentDrag.offset.y = v - g.top, o instanceof DragEvent && o.dataTransfer && o.dataTransfer.setDragImage && o.dataTransfer.setDragImage(p, 0, 0), i(d, this._currentDrag.event || o, this._firefoxDragPosition), this._pendingDragIn = {
58
+ id: r,
59
+ type: c
60
60
  }, this._hasEnteredIframe = !1, this._dragInObjectCalled = !1, this.isDragging = !0, this._phase = { kind: "starting" };
61
61
  let y = null;
62
62
  try {
@@ -67,13 +67,13 @@ var u = class {
67
67
  bounds: { interactionContainer: y }
68
68
  });
69
69
  }
70
- dragUpdate(i) {
71
- let o = this._mainDomElement.parentNode, { x: s, y: c } = t(o, i, this._firefoxDragPosition);
72
- if (s === 0 && c === 0) return;
73
- let l = Math.max(1, s), u = Math.max(1, c);
70
+ dragUpdate(e) {
71
+ let t = this._mainDomElement.parentNode, { x: n, y: s } = i(t, e, this._firefoxDragPosition);
72
+ if (n === 0 && s === 0) return;
73
+ let l = Math.max(1, n), u = Math.max(1, s);
74
74
  if (l === 1 && u === 1) return;
75
- let d = this._mainDomElement.getBoundingClientRect(), { clientX: f, clientY: p } = n(i, this._firefoxDragPosition), m = a(f, p, d), h = l, g = u;
76
- if (e(i)) {
75
+ let d = this._mainDomElement.getBoundingClientRect(), { clientX: f, clientY: p } = a(e, this._firefoxDragPosition), m = c(f, p, d), h = l, g = u;
76
+ if (r(e)) {
77
77
  let e = this._options.settings?.fingerSize || 0;
78
78
  h = Math.max(2, l + e), g = Math.max(2, u - e);
79
79
  }
@@ -84,7 +84,7 @@ var u = class {
84
84
  if (b.ghost ||= {}, b.ghost.visibleIn && b.ghost.hiddenIn || (b.ghost.hiddenIn = d), this._currentDrag.ghost && this._currentDrag.ghost.updateDragGhost(f, p, b), this._phase.kind !== "ready") return;
85
85
  let { interactionContainer: x } = this._phase.bounds;
86
86
  if (m && this._pendingDragIn) {
87
- let e = r(f, p, d, x);
87
+ let e = o(f, p, d, x);
88
88
  e && !this._hasEnteredIframe ? (this._dragInObjectCalled || (this._dragInObjectCalled = !0, this._instance.dragInObject(this._pendingDragIn.id, l, u, this._pendingDragIn.type)), this._hasEnteredIframe = !0) : !e && this._hasEnteredIframe && (this._instance.cancelDragIn(), this._hasEnteredIframe = !1, this._dragInObjectCalled = !1);
89
89
  } else !m && this._hasEnteredIframe && (this._instance.cancelDragIn(), this._hasEnteredIframe = !1, this._dragInObjectCalled = !1);
90
90
  if (!this._hasEnteredIframe) return;
@@ -98,8 +98,8 @@ var u = class {
98
98
  x: 0,
99
99
  y: 0
100
100
  }, this._hasEnteredIframe = !1, this._dragInObjectCalled = !1, this._pendingDragIn = null, this._phase = { kind: "idle" };
101
- let t = e.querySelector("." + s);
102
- t && t.classList.add(c.DISPLAY_NONE);
101
+ let r = e.querySelector("." + t);
102
+ r && r.classList.add(n.DISPLAY_NONE);
103
103
  }
104
104
  touchStart(e, t, n = "rml_id") {
105
105
  t.preventDefault(), this.dragStart(e, t, n);
@@ -1,6 +1,6 @@
1
- import { c as e, i as t, n, o as r, r as i, s as a } from "./utils-i2eOrtnv.mjs";
2
- import { l as o, p as s, r as c } from "./drag-in-BCnrHxxt.mjs";
3
- import { t as l } from "./drag-ghost-DqF-SGUQ.mjs";
1
+ import { l as e, p as t, r as n } from "./drag-in-ClPpCYyi.mjs";
2
+ import { c as r, i, n as a, o, r as s, s as c } from "./utils-DxJ3PcKe.mjs";
3
+ import { t as l } from "./drag-ghost-BxqPJdhq.mjs";
4
4
  //#region packages/embedding-lib/src/plugins/strategy/from-website.ts
5
5
  var u = class {
6
6
  _options = {};
@@ -35,9 +35,9 @@ var u = class {
35
35
  beforeUpdateGhost(e) {
36
36
  this._onBeforeUpdateDrag = e;
37
37
  }
38
- async dragStart(e, r, a = "rml_id") {
38
+ async dragStart(r, o, c = "rml_id") {
39
39
  let u = ++this._dragGeneration, d = this._mainDomElement.parentNode;
40
- if (i(d).position !== "relative") {
40
+ if (s(d).position !== "relative") {
41
41
  let e = "parent of iframe should have position relative, otherwise drag-in can not detect the x/y coordinates correctly";
42
42
  this._phase = {
43
43
  kind: "failed",
@@ -46,19 +46,19 @@ var u = class {
46
46
  return;
47
47
  }
48
48
  this._mainDomElement.style.pointerEvents = "none";
49
- let f = d.querySelector("." + s);
50
- f || (f = document.createElement("div"), f.classList.add(s), d.appendChild(f)), f.classList.remove(c.DISPLAY_NONE), r.target.getAttribute("draggable") || console.warn("Draggable not detected correctly! Did you add draggable=\"true\" to the element? In Sarafi only 'draggable' is too less");
51
- let p = d.querySelector("." + o);
52
- this._currentDrag.event = r;
53
- let m = r.target, h = m.cloneNode(!0), g = m.getBoundingClientRect();
49
+ let f = d.querySelector("." + t);
50
+ f || (f = document.createElement("div"), f.classList.add(t), d.appendChild(f)), f.classList.remove(n.DISPLAY_NONE), o.target.getAttribute("draggable") || console.warn("Draggable not detected correctly! Did you add draggable=\"true\" to the element? In Sarafi only 'draggable' is too less");
51
+ let p = d.querySelector("." + e);
52
+ this._currentDrag.event = o;
53
+ let m = o.target, h = m.cloneNode(!0), g = m.getBoundingClientRect();
54
54
  h.style.width = `${g.width}px`, h.style.height = `${g.height}px`, this._currentDrag.ghost = new l(h), this._currentDrag.offset || (this._currentDrag.offset = {
55
55
  x: 0,
56
56
  y: 0
57
57
  });
58
- let { clientX: _, clientY: v } = n(r, this._firefoxDragPosition);
59
- this._currentDrag.offset.x = _ - g.left, this._currentDrag.offset.y = v - g.top, r instanceof DragEvent && r.dataTransfer && r.dataTransfer.setDragImage && r.dataTransfer.setDragImage(p, 0, 0), t(d, this._currentDrag.event || r, this._firefoxDragPosition), this._pendingDragIn = {
60
- id: e,
61
- type: a
58
+ let { clientX: _, clientY: v } = a(o, this._firefoxDragPosition);
59
+ this._currentDrag.offset.x = _ - g.left, this._currentDrag.offset.y = v - g.top, o instanceof DragEvent && o.dataTransfer && o.dataTransfer.setDragImage && o.dataTransfer.setDragImage(p, 0, 0), i(d, this._currentDrag.event || o, this._firefoxDragPosition), this._pendingDragIn = {
60
+ id: r,
61
+ type: c
62
62
  }, this._hasEnteredIframe = !1, this._dragInObjectCalled = !1, this.isDragging = !0, this._phase = { kind: "starting" };
63
63
  let y = null;
64
64
  try {
@@ -71,13 +71,13 @@ var u = class {
71
71
  bounds: { interactionContainer: y }
72
72
  });
73
73
  }
74
- dragUpdate(i) {
75
- let o = this._mainDomElement.parentNode, { x: s, y: c } = t(o, i, this._firefoxDragPosition);
76
- if (s === 0 && c === 0) return;
77
- let l = Math.max(1, s), u = Math.max(1, c);
74
+ dragUpdate(e) {
75
+ let t = this._mainDomElement.parentNode, { x: n, y: s } = i(t, e, this._firefoxDragPosition);
76
+ if (n === 0 && s === 0) return;
77
+ let l = Math.max(1, n), u = Math.max(1, s);
78
78
  if (l === 1 && u === 1) return;
79
- let d = this._mainDomElement.getBoundingClientRect(), { clientX: f, clientY: p } = n(i, this._firefoxDragPosition), m = a(f, p, d), h = l, g = u;
80
- if (e(i)) {
79
+ let d = this._mainDomElement.getBoundingClientRect(), { clientX: f, clientY: p } = a(e, this._firefoxDragPosition), m = c(f, p, d), h = l, g = u;
80
+ if (r(e)) {
81
81
  let e = this._options.settings?.fingerSize || 0;
82
82
  h = Math.max(2, l + e), g = Math.max(2, u - e);
83
83
  }
@@ -88,7 +88,7 @@ var u = class {
88
88
  if (b.ghost ||= {}, b.ghost.visibleIn && b.ghost.hiddenIn || (b.ghost.hiddenIn = d), this._currentDrag.ghost && this._currentDrag.ghost.updateDragGhost(f, p, b), this._phase.kind !== "ready") return;
89
89
  let { interactionContainer: x } = this._phase.bounds;
90
90
  if (m && this._pendingDragIn) {
91
- let e = r(f, p, d, x);
91
+ let e = o(f, p, d, x);
92
92
  e && !this._hasEnteredIframe ? (this._dragInObjectCalled || (this._dragInObjectCalled = !0, this._instance.dragInObject(this._pendingDragIn.id, l, u, this._pendingDragIn.type)), this._hasEnteredIframe = !0) : !e && this._hasEnteredIframe && (this._instance.cancelDragIn(), this._hasEnteredIframe = !1, this._dragInObjectCalled = !1);
93
93
  } else !m && this._hasEnteredIframe && (this._instance.cancelDragIn(), this._hasEnteredIframe = !1, this._dragInObjectCalled = !1);
94
94
  if (!this._hasEnteredIframe) return;
@@ -102,8 +102,8 @@ var u = class {
102
102
  x: 0,
103
103
  y: 0
104
104
  }, this._hasEnteredIframe = !1, this._dragInObjectCalled = !1, this._pendingDragIn = null, this._phase = { kind: "idle" };
105
- let t = e.querySelector("." + s);
106
- t && t.classList.add(c.DISPLAY_NONE);
105
+ let r = e.querySelector("." + t);
106
+ r && r.classList.add(n.DISPLAY_NONE);
107
107
  }
108
108
  touchStart(e, t, n = "rml_id") {
109
109
  t.preventDefault(), this.dragStart(e, t, n);
package/hi.js CHANGED
@@ -1,5 +1,5 @@
1
- import { t as e } from "./browser-C_Dfiou7.mjs";
2
- import { t } from "./utils-i2eOrtnv.mjs";
1
+ import { t as e } from "./browser-CW9o-dtT.mjs";
2
+ import { t } from "./utils-DxJ3PcKe.mjs";
3
3
  var n = (e, t) => t === e.libraryId ? e : {
4
4
  ...e,
5
5
  libraryId: t
@@ -56,7 +56,7 @@ var n = (e, t) => t === e.libraryId ? e : {
56
56
  h && window.removeEventListener("message", h);
57
57
  let i = typeof e == "string" ? { libraryId: e } : e;
58
58
  r.onLoadJavascript === void 0 && (r.onLoadJavascript = (e) => u(n(i, e))), r.onLoadArticleCatalog === void 0 && (r.onLoadArticleCatalog = (e) => c(n(i, e))), r.onLoadMasterData === void 0 && (r.onLoadMasterData = (e) => l(n(i, e)));
59
- let { expose: a } = await import("./comlink-BipJ8Ikr.mjs").then((e) => e.t);
59
+ let { expose: a } = await import("./comlink-B5lV2OWp.mjs");
60
60
  h = (e) => {
61
61
  if (e.data.type === "connect_hi" && e.data.port) {
62
62
  let n = e.data.port;
package/hi.min.js CHANGED
@@ -1,5 +1,5 @@
1
- import { t as e } from "./browser-DRgK3Fk8.mjs";
2
- import { t } from "./utils-Co3lE-Ji.mjs";
1
+ import { t as e } from "./browser-BxG7yIaK.mjs";
2
+ import { t } from "./utils-wJ80awOA.mjs";
3
3
  var n = (e, t) => t === e.libraryId ? e : {
4
4
  ...e,
5
5
  libraryId: t
@@ -55,7 +55,7 @@ var n = (e, t) => t === e.libraryId ? e : {
55
55
  m && window.removeEventListener("message", m);
56
56
  let a = typeof r == "string" ? { libraryId: r } : r;
57
57
  i.onLoadJavascript === void 0 && (i.onLoadJavascript = (e) => u(n(a, e))), i.onLoadArticleCatalog === void 0 && (i.onLoadArticleCatalog = (e) => c(n(a, e))), i.onLoadMasterData === void 0 && (i.onLoadMasterData = (e) => l(n(a, e)));
58
- let { expose: o } = await import("./comlink-Dds_bpug.mjs").then((e) => e.t);
58
+ let { expose: o } = await import("./comlink-B2Kj_5Ge.mjs");
59
59
  m = (n) => {
60
60
  if (n.data.type === "connect_hi" && n.data.port) {
61
61
  let r = n.data.port;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roomle/embedding-lib",
3
- "version": "7.3.0-alpha.4",
3
+ "version": "8.0.0-alpha.2",
4
4
  "description": "This is a small library which can be used to communicate with the Roomle Configurator. ES modules only (browser-compatible).",
5
5
  "type": "module",
6
6
  "main": "./roomle-embedding-lib.js",
@@ -3,7 +3,6 @@ import { PossibleCustomViews } from '../../../src/configurator/embedding/custom-
3
3
  import { ConfiguratorUiCallbacks, RoomleConfigurator, RoomleGLBViewer, RoomlePlanner } from '../../web-sdk/packages';
4
4
  import { DragIn } from './plugins/drag-in';
5
5
  import { Connector, RoomleEmbeddingApiKeys } from './connector';
6
- import { HiCallbacks } from '../../common/src/hi/hi-types';
7
6
  export declare const NAMESPACE: {
8
7
  [key: string]: keyof RoomleEmbeddingApiKeys | 'callbacks';
9
8
  };
@@ -66,8 +65,6 @@ export default class RoomleEmbeddingApi<SdkType, SdkCallbacks> extends Connector
66
65
  * @param initData settings with which the configurator should be started
67
66
  */
68
67
  static createViewer(configuratorId: string, container: HTMLElement, initData: UiInitData, plugins?: PluginDefinitions): Promise<RoomleViewerApi>;
69
- private static hiMessageHandler;
70
- static setupHi(callbacks: HiCallbacks): void;
71
68
  private static _create;
72
69
  private _waitForIframe;
73
70
  private _container;