@roomle/embedding-lib 0.0.0-dev-ee91b33 → 0.0.0-dev-5f60635
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/THIRD-PARTY-NOTICES.txt +554 -2
- package/coerce-CqJod_GZ.mjs +8 -0
- package/coerce-CsI42_k0.mjs +6 -0
- package/configurator.d.ts +2 -0
- package/configurator.js +29 -0
- package/configurator.min.js +27 -0
- package/dist-5jYYtT4q.mjs +8216 -0
- package/dist-B9yy8ym8.mjs +5512 -0
- package/dist-BV-32IEX.mjs +8128 -0
- package/dist-Bb2L1Zel.mjs +6045 -0
- package/dist-Bo3WzRdf.mjs +6223 -0
- package/dist-Bt1FopV4.mjs +7594 -0
- package/dist-C5fKJXpB.mjs +5598 -0
- package/dist-COgAdYY1.mjs +7554 -0
- package/dist-CXemOs84.mjs +849 -0
- package/dist-CqP0aX0A.mjs +866 -0
- package/dist-CqpDM10w.mjs +1179 -0
- package/dist-D0kh4WfT.mjs +7721 -0
- package/dist-D5HdKuwj.mjs +1221 -0
- package/dist-DJtonrDM.mjs +16906 -0
- package/dist-GTk8ppiK.mjs +8380 -0
- package/dist-XEy6Tk_Y.mjs +17341 -0
- package/{drag-ghost-DRJqglR4.mjs → drag-ghost-D7FnWbO4.mjs} +1 -1
- package/{drag-ghost-DvNl926o.mjs → drag-ghost-yXe7c8jA.mjs} +1 -1
- package/{drag-in-O6toxxkY.mjs → drag-in-BiEe2Lgv.mjs} +14 -20
- package/{drag-in-D_heMFxk.mjs → drag-in-t7T6Pqwc.mjs} +9 -15
- package/embedding-plugins.js +1 -1
- package/embedding-plugins.min.js +1 -1
- package/experimental-evaluation-BgWFolud.mjs +1074 -0
- package/experimental-evaluation-D56MbtjO.mjs +970 -0
- package/{from-custom-view-CnUFpf6f.mjs → from-custom-view-CTBapIc6.mjs} +30 -30
- package/{from-custom-view-DsDwSZTY.mjs → from-custom-view-xbjgsLll.mjs} +31 -31
- package/{from-website-bTi4qNXt.mjs → from-website-DUPMQPl6.mjs} +23 -23
- package/{from-website-Csj57D58.mjs → from-website-JwG7Ic_U.mjs} +23 -23
- package/hi.js +128 -295
- package/hi.min.js +118 -261
- package/mcp-tools-CJ7j_FI2.mjs +151 -0
- package/mcp-tools-D__M74CZ.mjs +153 -0
- package/package.json +12 -1
- package/packages/embedding-lib/src/configurator-agent/configurator-mcp-tools.d.ts +4 -0
- package/packages/embedding-lib/src/configurator-agent/configurator-planning-assistant.d.ts +13 -0
- package/packages/embedding-lib/src/configurator.d.ts +3 -0
- package/packages/embedding-lib/src/homag-intelligence/hi-mcp-tools.d.ts +4 -61
- package/packages/embedding-lib/src/homag-intelligence/hi-planning-assistant.d.ts +2 -48
- package/packages/embedding-lib/src/planning-assistant/chat-model.d.ts +1 -0
- package/packages/embedding-lib/src/planning-assistant/mcp-tools.d.ts +2 -0
- package/packages/web-sdk/packages/assistant.d.ts +3 -0
- package/packages/web-sdk/packages/common-core/src/agent-tools/mcp-tool-types.d.ts +30 -0
- package/packages/web-sdk/packages/common-core/src/planning-assistant/chat-model.d.ts +8 -0
- package/packages/web-sdk/packages/common-core/src/planning-assistant/mcp-tools.d.ts +52 -0
- package/packages/web-sdk/packages/common-core/src/planning-assistant/types.d.ts +35 -0
- package/roomle-embedding-lib.js +2 -2
- package/roomle-embedding-lib.min.js +2 -2
- package/sbom.cdx.json +363 -5
- /package/{browser-BjtSrqbu.mjs → browser-D6As4Zxr.mjs} +0 -0
- /package/{browser-D6M-d6y5.mjs → browser-zrjtYpL8.mjs} +0 -0
- /package/{comlink-CR7SvKHo.mjs → comlink-Cmiqa2s0.mjs} +0 -0
- /package/{comlink-BwWPcVOp.mjs → comlink-Dc3LZUoi.mjs} +0 -0
- /package/{utils-BoELtcEK.mjs → utils-CAAGdgk8.mjs} +0 -0
- /package/{utils-BwWn6Fw4.mjs → utils-WeolMfC5.mjs} +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as i } from "./drag-ghost-
|
|
5
|
-
var a = (e,
|
|
6
|
-
clientX: e.touches[
|
|
7
|
-
clientY: e.touches[
|
|
2
|
+
import { a as e, c as t, n } from "./utils-CAAGdgk8.mjs";
|
|
3
|
+
import { d as r } from "./drag-in-t7T6Pqwc.mjs";
|
|
4
|
+
import { t as i } from "./drag-ghost-D7FnWbO4.mjs";
|
|
5
|
+
var a = (e, n = 0) => t(e) ? {
|
|
6
|
+
clientX: e.touches[n].clientX,
|
|
7
|
+
clientY: e.touches[n].clientY
|
|
8
8
|
} : {
|
|
9
9
|
clientX: e.clientX,
|
|
10
10
|
clientY: e.clientY
|
|
11
|
-
}, o = (e) => !e || !
|
|
11
|
+
}, o = (e) => !e || !t(e) || e.touches.length > 0, s = class {
|
|
12
12
|
_touchDragTimeOut;
|
|
13
13
|
_onTouchDragStart;
|
|
14
14
|
_payload = null;
|
|
@@ -20,7 +20,7 @@ var a = (e, t = 0) => n(e) ? {
|
|
|
20
20
|
this._payload = e, this._onTouchDragStart = t, this._delay = typeof n.delay == "number" ? n.delay : 500, this._epsilon = typeof n.epsilon == "number" ? n.epsilon : 10;
|
|
21
21
|
}
|
|
22
22
|
onStart(e) {
|
|
23
|
-
o(e) && (this._touchDragTimeOut ||= (this._firstTouch = a(e,
|
|
23
|
+
o(e) && (this._touchDragTimeOut ||= (this._firstTouch = a(e, t(e) ? e.touches.length - 1 : 0), setTimeout(() => {
|
|
24
24
|
this._clearTimeout(), this._lastTouch ||= a(e), this._checkXDistance(e)();
|
|
25
25
|
}, this._delay)));
|
|
26
26
|
}
|
|
@@ -71,12 +71,12 @@ var a = (e, t = 0) => n(e) ? {
|
|
|
71
71
|
_reset() {
|
|
72
72
|
this._startX = 0, this._startY = 0, this._lastX = 0, this._lastY = 0, this._isWaiting = !1;
|
|
73
73
|
}
|
|
74
|
-
}, u = "data-rml-old-draggable", d = (e,
|
|
75
|
-
let r =
|
|
74
|
+
}, u = "data-rml-old-draggable", d = (e, n) => {
|
|
75
|
+
let r = t(e), i = {
|
|
76
76
|
delay: r ? 500 : 100,
|
|
77
77
|
epsilon: r ? 10 : 15
|
|
78
78
|
};
|
|
79
|
-
if (!
|
|
79
|
+
if (!n || !(r || e instanceof MouseEvent)) return i;
|
|
80
80
|
let { delayKey: a, epsilonKey: o } = r ? {
|
|
81
81
|
delayKey: "touchDragDelay",
|
|
82
82
|
epsilonKey: "touchDragEpsilon"
|
|
@@ -84,7 +84,7 @@ var a = (e, t = 0) => n(e) ? {
|
|
|
84
84
|
delayKey: "customDragDelay",
|
|
85
85
|
epsilonKey: "customDragEpsilon"
|
|
86
86
|
};
|
|
87
|
-
return typeof
|
|
87
|
+
return typeof n[a] == "number" && (i.delay = n.touchDragDelay), typeof n[o] == "number" && (i.epsilon = n.touchDragEpsilon), i;
|
|
88
88
|
}, f = class {
|
|
89
89
|
_options = {};
|
|
90
90
|
_instance;
|
|
@@ -140,9 +140,9 @@ var a = (e, t = 0) => n(e) ? {
|
|
|
140
140
|
}, this._hasEnteredIframe = !1, this.isDragging = !0;
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
_dragUpdate(
|
|
144
|
-
document.body.focus(), this._currentCustomDrag && this._currentCustomDrag.onMove(
|
|
145
|
-
let { clientX: i, clientY: a } =
|
|
143
|
+
_dragUpdate(t) {
|
|
144
|
+
document.body.focus(), this._currentCustomDrag && this._currentCustomDrag.onMove(t);
|
|
145
|
+
let { clientX: i, clientY: a } = n(t);
|
|
146
146
|
if (this._dragGhost) {
|
|
147
147
|
let { width: e, height: t } = this._mainDomElement.getBoundingClientRect();
|
|
148
148
|
this._dragGhost.updateDragGhost(i, a, { ghost: { visibleIn: {
|
|
@@ -153,23 +153,23 @@ var a = (e, t = 0) => n(e) ? {
|
|
|
153
153
|
} } });
|
|
154
154
|
}
|
|
155
155
|
if (this._phase.kind !== "ready") return;
|
|
156
|
-
let { view: o, canvas: s, overlay: c, interactionContainer: l } = this._phase.bounds, u = o.x + i, d = o.y + a, f =
|
|
156
|
+
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);
|
|
157
157
|
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;
|
|
158
|
-
let { url: p, width: m, height: h } = ((
|
|
159
|
-
let
|
|
160
|
-
if (!
|
|
161
|
-
url:
|
|
162
|
-
width:
|
|
158
|
+
let { url: p, width: m, height: h } = ((e) => {
|
|
159
|
+
let t = "", n = 112, i = 112;
|
|
160
|
+
if (!e) return {
|
|
161
|
+
url: r,
|
|
162
|
+
width: n,
|
|
163
163
|
height: i
|
|
164
164
|
};
|
|
165
|
-
let a =
|
|
165
|
+
let a = e;
|
|
166
166
|
if (a instanceof HTMLElement) {
|
|
167
|
-
let
|
|
168
|
-
o ?
|
|
167
|
+
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");
|
|
168
|
+
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;
|
|
169
169
|
}
|
|
170
170
|
return {
|
|
171
|
-
url:
|
|
172
|
-
width:
|
|
171
|
+
url: t || "https://res.cloudinary.com/roomle/image/upload/v1729679975/fallback_afpyqr.jpg",
|
|
172
|
+
width: n,
|
|
173
173
|
height: i
|
|
174
174
|
};
|
|
175
175
|
})(this._startTarget), g = this._options || {}, _ = {
|
|
@@ -191,13 +191,13 @@ var a = (e, t = 0) => n(e) ? {
|
|
|
191
191
|
_dragEnd() {
|
|
192
192
|
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;
|
|
193
193
|
}
|
|
194
|
-
dragStart(e,
|
|
195
|
-
this._instance.disableEvents(), this._startTarget =
|
|
194
|
+
dragStart(e, n, r) {
|
|
195
|
+
this._instance.disableEvents(), this._startTarget = n.target, this._currentCustomDrag = t(n) ? new s(void 0, { onTouchDragStart: (t, n) => {
|
|
196
196
|
this._dragStart(e, n, r);
|
|
197
197
|
} }, {
|
|
198
|
-
...d(
|
|
198
|
+
...d(n, this._options),
|
|
199
199
|
delay: 0
|
|
200
|
-
}) : new l({ onCustomDragStart: (t) => this._dragStart(e, t, r) }, d(
|
|
200
|
+
}) : new l({ onCustomDragStart: (t) => this._dragStart(e, t, r) }, d(n, this._options)), this._currentCustomDrag.onStart(n);
|
|
201
201
|
}
|
|
202
202
|
dragEnd() {
|
|
203
203
|
this._dragEnd();
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as i } from "./drag-ghost-
|
|
5
|
-
var a = (e,
|
|
6
|
-
clientX: e.touches[
|
|
7
|
-
clientY: e.touches[
|
|
2
|
+
import { a as e, c as t, n } from "./utils-WeolMfC5.mjs";
|
|
3
|
+
import { d as r } from "./drag-in-BiEe2Lgv.mjs";
|
|
4
|
+
import { t as i } from "./drag-ghost-yXe7c8jA.mjs";
|
|
5
|
+
var a = (e, n = 0) => t(e) ? {
|
|
6
|
+
clientX: e.touches[n].clientX,
|
|
7
|
+
clientY: e.touches[n].clientY
|
|
8
8
|
} : {
|
|
9
9
|
clientX: e.clientX,
|
|
10
10
|
clientY: e.clientY
|
|
11
|
-
}, o = (e) => e &&
|
|
11
|
+
}, o = (e) => e && t(e) ? e.touches.length > 0 : !0, s = class {
|
|
12
12
|
_touchDragTimeOut;
|
|
13
13
|
_onTouchDragStart;
|
|
14
14
|
_payload = null;
|
|
@@ -20,7 +20,7 @@ var a = (e, t = 0) => n(e) ? {
|
|
|
20
20
|
this._payload = e, this._onTouchDragStart = t, this._delay = typeof n.delay == "number" ? n.delay : 500, this._epsilon = typeof n.epsilon == "number" ? n.epsilon : 10;
|
|
21
21
|
}
|
|
22
22
|
onStart(e) {
|
|
23
|
-
o(e) && (this._touchDragTimeOut ||= (this._firstTouch = a(e,
|
|
23
|
+
o(e) && (this._touchDragTimeOut ||= (this._firstTouch = a(e, t(e) ? e.touches.length - 1 : 0), setTimeout(() => {
|
|
24
24
|
this._clearTimeout(), this._lastTouch ||= a(e), this._checkXDistance(e)();
|
|
25
25
|
}, this._delay)));
|
|
26
26
|
}
|
|
@@ -71,12 +71,12 @@ var a = (e, t = 0) => n(e) ? {
|
|
|
71
71
|
_reset() {
|
|
72
72
|
this._startX = 0, this._startY = 0, this._lastX = 0, this._lastY = 0, this._isWaiting = !1;
|
|
73
73
|
}
|
|
74
|
-
}, f = "data-rml-old-draggable", p = void 0, m = (e,
|
|
75
|
-
let r =
|
|
74
|
+
}, f = "data-rml-old-draggable", p = void 0, m = (e, n) => {
|
|
75
|
+
let r = t(e), i = {
|
|
76
76
|
delay: r ? 500 : 100,
|
|
77
77
|
epsilon: r ? 10 : 15
|
|
78
78
|
};
|
|
79
|
-
if (!
|
|
79
|
+
if (!n) return i;
|
|
80
80
|
if (!r && !(e instanceof MouseEvent)) return console.warn("Unsupported event! It is not TouchEvent and also not MouseEvent"), i;
|
|
81
81
|
let { delayKey: a, epsilonKey: o } = r ? {
|
|
82
82
|
delayKey: "touchDragDelay",
|
|
@@ -85,22 +85,22 @@ var a = (e, t = 0) => n(e) ? {
|
|
|
85
85
|
delayKey: "customDragDelay",
|
|
86
86
|
epsilonKey: "customDragEpsilon"
|
|
87
87
|
};
|
|
88
|
-
return typeof
|
|
89
|
-
}, h = (
|
|
90
|
-
let
|
|
91
|
-
if (!
|
|
92
|
-
url:
|
|
93
|
-
width:
|
|
88
|
+
return typeof n[a] == "number" && (i.delay = n.touchDragDelay), typeof n[o] == "number" && (i.epsilon = n.touchDragEpsilon), i;
|
|
89
|
+
}, h = (e) => {
|
|
90
|
+
let t = "", n = 112, i = 112;
|
|
91
|
+
if (!e) return {
|
|
92
|
+
url: r,
|
|
93
|
+
width: n,
|
|
94
94
|
height: i
|
|
95
95
|
};
|
|
96
|
-
let a =
|
|
96
|
+
let a = e;
|
|
97
97
|
if (a instanceof HTMLElement) {
|
|
98
|
-
let
|
|
99
|
-
o ?
|
|
98
|
+
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");
|
|
99
|
+
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;
|
|
100
100
|
}
|
|
101
101
|
return {
|
|
102
|
-
url:
|
|
103
|
-
width:
|
|
102
|
+
url: t || "https://res.cloudinary.com/roomle/image/upload/v1729679975/fallback_afpyqr.jpg",
|
|
103
|
+
width: n,
|
|
104
104
|
height: i
|
|
105
105
|
};
|
|
106
106
|
}, g = class {
|
|
@@ -157,12 +157,12 @@ var a = (e, t = 0) => n(e) ? {
|
|
|
157
157
|
}, this._hasEnteredIframe = !1, this.isDragging = !0;
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
_dragUpdate(
|
|
161
|
-
document.body.focus(), this._currentCustomDrag && this._currentCustomDrag.onMove(
|
|
162
|
-
let { clientX:
|
|
160
|
+
_dragUpdate(t) {
|
|
161
|
+
document.body.focus(), this._currentCustomDrag && this._currentCustomDrag.onMove(t);
|
|
162
|
+
let { clientX: r, clientY: i } = n(t);
|
|
163
163
|
if (this._dragGhost) {
|
|
164
164
|
let { width: e, height: t } = this._mainDomElement.getBoundingClientRect();
|
|
165
|
-
this._dragGhost.updateDragGhost(
|
|
165
|
+
this._dragGhost.updateDragGhost(r, i, { ghost: { visibleIn: {
|
|
166
166
|
x: 0,
|
|
167
167
|
y: 0,
|
|
168
168
|
width: e,
|
|
@@ -170,7 +170,7 @@ var a = (e, t = 0) => n(e) ? {
|
|
|
170
170
|
} } });
|
|
171
171
|
}
|
|
172
172
|
if (this._phase.kind !== "ready") return;
|
|
173
|
-
let { view: a, canvas: o, overlay: s, interactionContainer: c } = this._phase.bounds, l = a.x +
|
|
173
|
+
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);
|
|
174
174
|
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;
|
|
175
175
|
let { url: f, width: p, height: m } = h(this._startTarget), g = this._options || {}, _ = {
|
|
176
176
|
ghost: {
|
|
@@ -191,13 +191,13 @@ var a = (e, t = 0) => n(e) ? {
|
|
|
191
191
|
_dragEnd() {
|
|
192
192
|
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;
|
|
193
193
|
}
|
|
194
|
-
dragStart(e,
|
|
195
|
-
this._instance.disableEvents(), this._startTarget =
|
|
194
|
+
dragStart(e, n, r) {
|
|
195
|
+
this._instance.disableEvents(), this._startTarget = n.target, this._currentCustomDrag = t(n) ? new s(p, { onTouchDragStart: (t, n) => {
|
|
196
196
|
this._dragStart(e, n, r);
|
|
197
197
|
} }, {
|
|
198
|
-
...m(
|
|
198
|
+
...m(n, this._options),
|
|
199
199
|
delay: 0
|
|
200
|
-
}) : new d({ onCustomDragStart: (t) => this._dragStart(e, t, r) }, m(
|
|
200
|
+
}) : new d({ onCustomDragStart: (t) => this._dragStart(e, t, r) }, m(n, this._options)), this._currentCustomDrag.onStart(n);
|
|
201
201
|
}
|
|
202
202
|
dragEnd() {
|
|
203
203
|
this._dragEnd();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as l } from "./drag-ghost-
|
|
2
|
+
import { c as e, i as t, n, o as r, r as i, s as a } from "./utils-WeolMfC5.mjs";
|
|
3
|
+
import { l as o, p as s, r as c } from "./drag-in-BiEe2Lgv.mjs";
|
|
4
|
+
import { t as l } from "./drag-ghost-yXe7c8jA.mjs";
|
|
5
5
|
//#region packages/embedding-lib/src/plugins/strategy/from-website.ts
|
|
6
6
|
var u = class {
|
|
7
7
|
_options = {};
|
|
@@ -36,9 +36,9 @@ var u = class {
|
|
|
36
36
|
beforeUpdateGhost(e) {
|
|
37
37
|
this._onBeforeUpdateDrag = e;
|
|
38
38
|
}
|
|
39
|
-
async dragStart(
|
|
39
|
+
async dragStart(e, r, a = "rml_id") {
|
|
40
40
|
let u = ++this._dragGeneration, d = this._mainDomElement.parentNode;
|
|
41
|
-
if (
|
|
41
|
+
if (i(d).position !== "relative") {
|
|
42
42
|
let e = "parent of iframe should have position relative, otherwise drag-in can not detect the x/y coordinates correctly";
|
|
43
43
|
this._phase = {
|
|
44
44
|
kind: "failed",
|
|
@@ -47,19 +47,19 @@ var u = class {
|
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
49
|
this._mainDomElement.style.pointerEvents = "none";
|
|
50
|
-
let f = d.querySelector("." +
|
|
51
|
-
f || (f = document.createElement("div"), f.classList.add(
|
|
52
|
-
let p = d.querySelector("." +
|
|
53
|
-
this._currentDrag.event =
|
|
54
|
-
let m =
|
|
50
|
+
let f = d.querySelector("." + s);
|
|
51
|
+
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");
|
|
52
|
+
let p = d.querySelector("." + o);
|
|
53
|
+
this._currentDrag.event = r;
|
|
54
|
+
let m = r.target, h = m.cloneNode(!0), g = m.getBoundingClientRect();
|
|
55
55
|
h.style.width = `${g.width}px`, h.style.height = `${g.height}px`, this._currentDrag.ghost = new l(h), this._currentDrag.offset || (this._currentDrag.offset = {
|
|
56
56
|
x: 0,
|
|
57
57
|
y: 0
|
|
58
58
|
});
|
|
59
|
-
let { clientX: _, clientY: v } =
|
|
60
|
-
this._currentDrag.offset.x = _ - g.left, this._currentDrag.offset.y = v - g.top,
|
|
61
|
-
id:
|
|
62
|
-
type:
|
|
59
|
+
let { clientX: _, clientY: v } = n(r, this._firefoxDragPosition);
|
|
60
|
+
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 = {
|
|
61
|
+
id: e,
|
|
62
|
+
type: a
|
|
63
63
|
}, this._hasEnteredIframe = !1, this._dragInObjectCalled = !1, this.isDragging = !0, this._phase = { kind: "starting" };
|
|
64
64
|
let y = null;
|
|
65
65
|
try {
|
|
@@ -72,13 +72,13 @@ var u = class {
|
|
|
72
72
|
bounds: { interactionContainer: y }
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
|
-
dragUpdate(
|
|
76
|
-
let
|
|
77
|
-
if (
|
|
78
|
-
let l = Math.max(1,
|
|
75
|
+
dragUpdate(i) {
|
|
76
|
+
let o = this._mainDomElement.parentNode, { x: s, y: c } = t(o, i, this._firefoxDragPosition);
|
|
77
|
+
if (s === 0 && c === 0) return;
|
|
78
|
+
let l = Math.max(1, s), u = Math.max(1, c);
|
|
79
79
|
if (l === 1 && u === 1) return;
|
|
80
|
-
let d = this._mainDomElement.getBoundingClientRect(), { clientX: f, clientY: p } =
|
|
81
|
-
if (
|
|
80
|
+
let d = this._mainDomElement.getBoundingClientRect(), { clientX: f, clientY: p } = n(i, this._firefoxDragPosition), m = a(f, p, d), h = l, g = u;
|
|
81
|
+
if (e(i)) {
|
|
82
82
|
let e = this._options.settings?.fingerSize || 0;
|
|
83
83
|
h = Math.max(2, l + e), g = Math.max(2, u - e);
|
|
84
84
|
}
|
|
@@ -89,7 +89,7 @@ var u = class {
|
|
|
89
89
|
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;
|
|
90
90
|
let { interactionContainer: x } = this._phase.bounds;
|
|
91
91
|
if (m && this._pendingDragIn) {
|
|
92
|
-
let e =
|
|
92
|
+
let e = r(f, p, d, x);
|
|
93
93
|
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);
|
|
94
94
|
} else !m && this._hasEnteredIframe && (this._instance.cancelDragIn(), this._hasEnteredIframe = !1, this._dragInObjectCalled = !1);
|
|
95
95
|
if (!this._hasEnteredIframe) return;
|
|
@@ -103,8 +103,8 @@ var u = class {
|
|
|
103
103
|
x: 0,
|
|
104
104
|
y: 0
|
|
105
105
|
}, this._hasEnteredIframe = !1, this._dragInObjectCalled = !1, this._pendingDragIn = null, this._phase = { kind: "idle" };
|
|
106
|
-
let
|
|
107
|
-
|
|
106
|
+
let t = e.querySelector("." + s);
|
|
107
|
+
t && t.classList.add(c.DISPLAY_NONE);
|
|
108
108
|
}
|
|
109
109
|
touchStart(e, t, n = "rml_id") {
|
|
110
110
|
t.preventDefault(), this.dragStart(e, t, n);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as l } from "./drag-ghost-
|
|
2
|
+
import { c as e, i as t, n, o as r, r as i, s as a } from "./utils-CAAGdgk8.mjs";
|
|
3
|
+
import { l as o, p as s, r as c } from "./drag-in-t7T6Pqwc.mjs";
|
|
4
|
+
import { t as l } from "./drag-ghost-D7FnWbO4.mjs";
|
|
5
5
|
var u = class {
|
|
6
6
|
_options = {};
|
|
7
7
|
_instance;
|
|
@@ -35,9 +35,9 @@ var u = class {
|
|
|
35
35
|
beforeUpdateGhost(e) {
|
|
36
36
|
this._onBeforeUpdateDrag = e;
|
|
37
37
|
}
|
|
38
|
-
async dragStart(
|
|
38
|
+
async dragStart(e, r, a = "rml_id") {
|
|
39
39
|
let u = ++this._dragGeneration, d = this._mainDomElement.parentNode;
|
|
40
|
-
if (
|
|
40
|
+
if (i(d).position !== "relative") {
|
|
41
41
|
this._phase = {
|
|
42
42
|
kind: "failed",
|
|
43
43
|
reason: "parent of iframe should have position relative, otherwise drag-in can not detect the x/y coordinates correctly"
|
|
@@ -45,19 +45,19 @@ var u = class {
|
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
this._mainDomElement.style.pointerEvents = "none";
|
|
48
|
-
let f = d.querySelector("." +
|
|
49
|
-
f || (f = document.createElement("div"), f.classList.add(
|
|
50
|
-
let p = d.querySelector("." +
|
|
51
|
-
this._currentDrag.event =
|
|
52
|
-
let m =
|
|
48
|
+
let f = d.querySelector("." + s);
|
|
49
|
+
f || (f = document.createElement("div"), f.classList.add(s), d.appendChild(f)), f.classList.remove(c.DISPLAY_NONE), r.target.getAttribute("draggable");
|
|
50
|
+
let p = d.querySelector("." + o);
|
|
51
|
+
this._currentDrag.event = r;
|
|
52
|
+
let m = r.target, h = m.cloneNode(!0), g = m.getBoundingClientRect();
|
|
53
53
|
h.style.width = `${g.width}px`, h.style.height = `${g.height}px`, this._currentDrag.ghost = new l(h), this._currentDrag.offset || (this._currentDrag.offset = {
|
|
54
54
|
x: 0,
|
|
55
55
|
y: 0
|
|
56
56
|
});
|
|
57
|
-
let { clientX: _, clientY: v } =
|
|
58
|
-
this._currentDrag.offset.x = _ - g.left, this._currentDrag.offset.y = v - g.top,
|
|
59
|
-
id:
|
|
60
|
-
type:
|
|
57
|
+
let { clientX: _, clientY: v } = n(r, this._firefoxDragPosition);
|
|
58
|
+
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 = {
|
|
59
|
+
id: e,
|
|
60
|
+
type: a
|
|
61
61
|
}, this._hasEnteredIframe = !1, this._dragInObjectCalled = !1, this.isDragging = !0, this._phase = { kind: "starting" };
|
|
62
62
|
let y = null;
|
|
63
63
|
try {
|
|
@@ -68,13 +68,13 @@ var u = class {
|
|
|
68
68
|
bounds: { interactionContainer: y }
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
|
-
dragUpdate(
|
|
72
|
-
let
|
|
73
|
-
if (
|
|
74
|
-
let l = Math.max(1,
|
|
71
|
+
dragUpdate(i) {
|
|
72
|
+
let o = this._mainDomElement.parentNode, { x: s, y: c } = t(o, i, this._firefoxDragPosition);
|
|
73
|
+
if (s === 0 && c === 0) return;
|
|
74
|
+
let l = Math.max(1, s), u = Math.max(1, c);
|
|
75
75
|
if (l === 1 && u === 1) return;
|
|
76
|
-
let d = this._mainDomElement.getBoundingClientRect(), { clientX: f, clientY: p } =
|
|
77
|
-
if (
|
|
76
|
+
let d = this._mainDomElement.getBoundingClientRect(), { clientX: f, clientY: p } = n(i, this._firefoxDragPosition), m = a(f, p, d), h = l, g = u;
|
|
77
|
+
if (e(i)) {
|
|
78
78
|
let e = this._options.settings?.fingerSize || 0;
|
|
79
79
|
h = Math.max(2, l + e), g = Math.max(2, u - e);
|
|
80
80
|
}
|
|
@@ -85,7 +85,7 @@ var u = class {
|
|
|
85
85
|
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;
|
|
86
86
|
let { interactionContainer: x } = this._phase.bounds;
|
|
87
87
|
if (m && this._pendingDragIn) {
|
|
88
|
-
let e =
|
|
88
|
+
let e = r(f, p, d, x);
|
|
89
89
|
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);
|
|
90
90
|
} else !m && this._hasEnteredIframe && (this._instance.cancelDragIn(), this._hasEnteredIframe = !1, this._dragInObjectCalled = !1);
|
|
91
91
|
if (!this._hasEnteredIframe) return;
|
|
@@ -99,8 +99,8 @@ var u = class {
|
|
|
99
99
|
x: 0,
|
|
100
100
|
y: 0
|
|
101
101
|
}, this._hasEnteredIframe = !1, this._dragInObjectCalled = !1, this._pendingDragIn = null, this._phase = { kind: "idle" };
|
|
102
|
-
let
|
|
103
|
-
|
|
102
|
+
let t = e.querySelector("." + s);
|
|
103
|
+
t && t.classList.add(c.DISPLAY_NONE);
|
|
104
104
|
}
|
|
105
105
|
touchStart(e, t, n = "rml_id") {
|
|
106
106
|
t.preventDefault(), this.dragStart(e, t, n);
|