@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.
- package/comlink-B2Kj_5Ge.mjs +206 -0
- package/comlink-B5lV2OWp.mjs +226 -0
- package/docs/md/web/embedding/CHANGELOG.md +43 -34
- package/{drag-ghost-DqF-SGUQ.mjs → drag-ghost-BxqPJdhq.mjs} +1 -1
- package/{drag-ghost-Rbgko27K.mjs → drag-ghost-CDFtC1pd.mjs} +1 -1
- package/{drag-in-DDGopCLr.mjs → drag-in-CV1E-DO6.mjs} +15 -9
- package/{drag-in-BCnrHxxt.mjs → drag-in-ClPpCYyi.mjs} +20 -14
- package/embedding-plugins.js +1 -1
- package/embedding-plugins.min.js +1 -1
- package/{from-custom-view-BxJkoaTB.mjs → from-custom-view-Q9A-J7qV.mjs} +31 -31
- package/{from-custom-view-CbO74qvE.mjs → from-custom-view-Sx6P6iDI.mjs} +30 -30
- package/{from-website-W-UZ3lee.mjs → from-website-BmCO2xli.mjs} +23 -23
- package/{from-website-D07qrmeq.mjs → from-website-DZJy_l42.mjs} +23 -23
- package/hi.js +3 -3
- package/hi.min.js +3 -3
- package/package.json +1 -1
- package/packages/embedding-lib/src/roomle-embedding-lib.d.ts +0 -3
- package/roomle-embedding-lib.js +84 -94
- package/roomle-embedding-lib.min.js +76 -86
- package/comlink-BipJ8Ikr.mjs +0 -237
- package/comlink-Dds_bpug.mjs +0 -220
- package/rolldown-runtime-C-QNzSnW.mjs +0 -11
- package/rolldown-runtime-C017PlDO.mjs +0 -9
- /package/{browser-DRgK3Fk8.mjs → browser-BxG7yIaK.mjs} +0 -0
- /package/{browser-C_Dfiou7.mjs → browser-CW9o-dtT.mjs} +0 -0
- /package/{utils-i2eOrtnv.mjs → utils-DxJ3PcKe.mjs} +0 -0
- /package/{utils-Co3lE-Ji.mjs → utils-wJ80awOA.mjs} +0 -0
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
},
|
|
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 =
|
|
21
|
-
.${
|
|
22
|
-
.${
|
|
23
|
-
.${
|
|
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("." +
|
|
31
|
-
t || (t = document.createElement("div"), t.classList.add(
|
|
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-
|
|
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-
|
|
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 {
|
|
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 };
|
package/embedding-plugins.js
CHANGED
|
@@ -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-
|
|
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 };
|
package/embedding-plugins.min.js
CHANGED
|
@@ -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-
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import { t as i } from "./drag-ghost-
|
|
4
|
-
var a = (e,
|
|
5
|
-
clientX: e.touches[
|
|
6
|
-
clientY: e.touches[
|
|
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 &&
|
|
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,
|
|
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,
|
|
74
|
-
let r =
|
|
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 (!
|
|
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
|
|
88
|
-
}, h = (
|
|
89
|
-
let
|
|
90
|
-
if (!
|
|
91
|
-
url:
|
|
92
|
-
width:
|
|
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 =
|
|
95
|
+
let a = t;
|
|
96
96
|
if (a instanceof HTMLElement) {
|
|
97
|
-
let
|
|
98
|
-
o ?
|
|
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:
|
|
102
|
-
width:
|
|
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(
|
|
160
|
-
document.body.focus(), this._currentCustomDrag && this._currentCustomDrag.onMove(
|
|
161
|
-
let { clientX:
|
|
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(
|
|
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 +
|
|
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,
|
|
194
|
-
this._instance.disableEvents(), this._startTarget =
|
|
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(
|
|
197
|
+
...m(t, this._options),
|
|
198
198
|
delay: 0
|
|
199
|
-
}) : new d({ onCustomDragStart: (t) => this._dragStart(e, t, r) }, m(
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import { t as i } from "./drag-ghost-
|
|
4
|
-
var a = (e,
|
|
5
|
-
clientX: e.touches[
|
|
6
|
-
clientY: e.touches[
|
|
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 || !
|
|
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,
|
|
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,
|
|
74
|
-
let r =
|
|
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 (!
|
|
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
|
|
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(
|
|
143
|
-
document.body.focus(), this._currentCustomDrag && this._currentCustomDrag.onMove(
|
|
144
|
-
let { clientX: i, clientY: a } = n
|
|
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 =
|
|
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 } = ((
|
|
158
|
-
let
|
|
159
|
-
if (!
|
|
160
|
-
url:
|
|
161
|
-
width:
|
|
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 =
|
|
164
|
+
let a = t;
|
|
165
165
|
if (a instanceof HTMLElement) {
|
|
166
|
-
let
|
|
167
|
-
o ?
|
|
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:
|
|
171
|
-
width:
|
|
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,
|
|
194
|
-
this._instance.disableEvents(), this._startTarget =
|
|
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(
|
|
197
|
+
...d(t, this._options),
|
|
198
198
|
delay: 0
|
|
199
|
-
}) : new l({ onCustomDragStart: (t) => this._dragStart(e, t, r) }, d(
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import { t as l } from "./drag-ghost-
|
|
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(
|
|
37
|
+
async dragStart(r, o, c = "rml_id") {
|
|
38
38
|
let u = ++this._dragGeneration, d = this._mainDomElement.parentNode;
|
|
39
|
-
if (
|
|
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("." +
|
|
48
|
-
f || (f = document.createElement("div"), f.classList.add(
|
|
49
|
-
let p = d.querySelector("." +
|
|
50
|
-
this._currentDrag.event =
|
|
51
|
-
let m =
|
|
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 } =
|
|
57
|
-
this._currentDrag.offset.x = _ - g.left, this._currentDrag.offset.y = v - g.top,
|
|
58
|
-
id:
|
|
59
|
-
type:
|
|
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(
|
|
71
|
-
let
|
|
72
|
-
if (
|
|
73
|
-
let l = Math.max(1,
|
|
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 } =
|
|
76
|
-
if (e
|
|
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 =
|
|
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
|
|
102
|
-
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import { t as l } from "./drag-ghost-
|
|
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(
|
|
38
|
+
async dragStart(r, o, c = "rml_id") {
|
|
39
39
|
let u = ++this._dragGeneration, d = this._mainDomElement.parentNode;
|
|
40
|
-
if (
|
|
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("." +
|
|
50
|
-
f || (f = document.createElement("div"), f.classList.add(
|
|
51
|
-
let p = d.querySelector("." +
|
|
52
|
-
this._currentDrag.event =
|
|
53
|
-
let m =
|
|
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 } =
|
|
59
|
-
this._currentDrag.offset.x = _ - g.left, this._currentDrag.offset.y = v - g.top,
|
|
60
|
-
id:
|
|
61
|
-
type:
|
|
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(
|
|
75
|
-
let
|
|
76
|
-
if (
|
|
77
|
-
let l = Math.max(1,
|
|
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 } =
|
|
80
|
-
if (e
|
|
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 =
|
|
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
|
|
106
|
-
|
|
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-
|
|
2
|
-
import { t } from "./utils-
|
|
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-
|
|
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-
|
|
2
|
-
import { t } from "./utils-
|
|
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-
|
|
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": "
|
|
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;
|