@roomle/embedding-lib 9.0.0-alpha.1 → 9.0.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD-PARTY-NOTICES.txt +764 -0
- package/{browser-BxG7yIaK.mjs → browser-D6As4Zxr.mjs} +1 -0
- package/{browser-CW9o-dtT.mjs → browser-zrjtYpL8.mjs} +1 -0
- package/coerce-CqJod_GZ.mjs +8 -0
- package/coerce-CsI42_k0.mjs +6 -0
- package/{comlink-B5lV2OWp.mjs → comlink-Cmiqa2s0.mjs} +1 -0
- package/{comlink-B2Kj_5Ge.mjs → comlink-Dc3LZUoi.mjs} +1 -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/docs/md/web/embedding/CHANGELOG.md +284 -98
- package/{drag-ghost-BQ8r6NVo.mjs → drag-ghost-D7FnWbO4.mjs} +2 -1
- package/{drag-ghost-BOwjMbG3.mjs → drag-ghost-yXe7c8jA.mjs} +2 -1
- package/{drag-in-QhL3zGC0.mjs → drag-in-BiEe2Lgv.mjs} +15 -20
- package/{drag-in-BP_E53zb.mjs → drag-in-t7T6Pqwc.mjs} +10 -15
- package/embedding-plugins.js +2 -1
- package/embedding-plugins.min.js +2 -1
- package/experimental-evaluation-BgWFolud.mjs +1074 -0
- package/experimental-evaluation-D56MbtjO.mjs +970 -0
- package/{from-custom-view-D2Z1YmCx.mjs → from-custom-view-CTBapIc6.mjs} +31 -30
- package/{from-custom-view-BM_zRJCf.mjs → from-custom-view-xbjgsLll.mjs} +32 -31
- package/{from-website-CPVeVVMI.mjs → from-website-DUPMQPl6.mjs} +24 -23
- package/{from-website-DlklVbxU.mjs → from-website-JwG7Ic_U.mjs} +24 -23
- package/hi.js +250 -111
- package/hi.min.js +212 -95
- 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/hi.d.ts +1 -3
- package/packages/embedding-lib/src/homag-intelligence/hi-mcp-tools.d.ts +11 -11
- package/packages/embedding-lib/src/homag-intelligence/hi-planning-assistant.d.ts +11 -34
- package/packages/embedding-lib/src/homag-intelligence/hi-planning-usage.d.ts +54 -0
- 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/{embedding-lib/src/homag-intelligence/hi-mcp/mcp-tool-types.d.ts → web-sdk/packages/common-core/src/planning-assistant/mcp-tools.d.ts} +15 -20
- package/packages/web-sdk/packages/common-core/src/planning-assistant/types.d.ts +35 -0
- package/roomle-embedding-lib.js +67 -57
- package/roomle-embedding-lib.min.js +13 -3
- package/sbom.cdx.json +405 -0
- package/{utils-wJ80awOA.mjs → utils-CAAGdgk8.mjs} +1 -0
- package/{utils-DxJ3PcKe.mjs → utils-WeolMfC5.mjs} +1 -0
- package/hi-mcp-server-BiZlFkBm.mjs +0 -4866
- package/hi-mcp-server-DTQnrykg.mjs +0 -5278
- package/packages/embedding-lib/src/homag-intelligence/hi-mcp/agent-facing.d.ts +0 -35
- package/packages/embedding-lib/src/homag-intelligence/hi-mcp/hi-mcp-server.d.ts +0 -3
- package/packages/embedding-lib/src/homag-intelligence/hi-mcp/mcp-tool.d.ts +0 -13
- package/packages/embedding-lib/src/homag-intelligence/hi-mcp/plan-history.d.ts +0 -33
- package/packages/embedding-lib/src/homag-intelligence/hi-mcp/planner-api.d.ts +0 -32
- package/packages/embedding-lib/src/homag-intelligence/hi-mcp/skills.d.ts +0 -23
- package/packages/embedding-lib/src/homag-intelligence/hi-mcp/tool-executors.d.ts +0 -4
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
import { a as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
|
|
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
|
|
7
8
|
} : {
|
|
8
9
|
clientX: e.clientX,
|
|
9
10
|
clientY: e.clientY
|
|
10
|
-
}, o = (e) => !e || !
|
|
11
|
+
}, o = (e) => !e || !t(e) || e.touches.length > 0, s = class {
|
|
11
12
|
_touchDragTimeOut;
|
|
12
13
|
_onTouchDragStart;
|
|
13
14
|
_payload = null;
|
|
@@ -19,7 +20,7 @@ var a = (e, t = 0) => n(e) ? {
|
|
|
19
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;
|
|
20
21
|
}
|
|
21
22
|
onStart(e) {
|
|
22
|
-
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(() => {
|
|
23
24
|
this._clearTimeout(), this._lastTouch ||= a(e), this._checkXDistance(e)();
|
|
24
25
|
}, this._delay)));
|
|
25
26
|
}
|
|
@@ -70,12 +71,12 @@ var a = (e, t = 0) => n(e) ? {
|
|
|
70
71
|
_reset() {
|
|
71
72
|
this._startX = 0, this._startY = 0, this._lastX = 0, this._lastY = 0, this._isWaiting = !1;
|
|
72
73
|
}
|
|
73
|
-
}, u = "data-rml-old-draggable", d = (e,
|
|
74
|
-
let r =
|
|
74
|
+
}, u = "data-rml-old-draggable", d = (e, n) => {
|
|
75
|
+
let r = t(e), i = {
|
|
75
76
|
delay: r ? 500 : 100,
|
|
76
77
|
epsilon: r ? 10 : 15
|
|
77
78
|
};
|
|
78
|
-
if (!
|
|
79
|
+
if (!n || !(r || e instanceof MouseEvent)) return i;
|
|
79
80
|
let { delayKey: a, epsilonKey: o } = r ? {
|
|
80
81
|
delayKey: "touchDragDelay",
|
|
81
82
|
epsilonKey: "touchDragEpsilon"
|
|
@@ -83,7 +84,7 @@ var a = (e, t = 0) => n(e) ? {
|
|
|
83
84
|
delayKey: "customDragDelay",
|
|
84
85
|
epsilonKey: "customDragEpsilon"
|
|
85
86
|
};
|
|
86
|
-
return typeof
|
|
87
|
+
return typeof n[a] == "number" && (i.delay = n.touchDragDelay), typeof n[o] == "number" && (i.epsilon = n.touchDragEpsilon), i;
|
|
87
88
|
}, f = class {
|
|
88
89
|
_options = {};
|
|
89
90
|
_instance;
|
|
@@ -139,9 +140,9 @@ var a = (e, t = 0) => n(e) ? {
|
|
|
139
140
|
}, this._hasEnteredIframe = !1, this.isDragging = !0;
|
|
140
141
|
}
|
|
141
142
|
}
|
|
142
|
-
_dragUpdate(
|
|
143
|
-
document.body.focus(), this._currentCustomDrag && this._currentCustomDrag.onMove(
|
|
144
|
-
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);
|
|
145
146
|
if (this._dragGhost) {
|
|
146
147
|
let { width: e, height: t } = this._mainDomElement.getBoundingClientRect();
|
|
147
148
|
this._dragGhost.updateDragGhost(i, a, { ghost: { visibleIn: {
|
|
@@ -152,23 +153,23 @@ var a = (e, t = 0) => n(e) ? {
|
|
|
152
153
|
} } });
|
|
153
154
|
}
|
|
154
155
|
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 =
|
|
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);
|
|
156
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;
|
|
157
|
-
let { url: p, width: m, height: h } = ((
|
|
158
|
-
let
|
|
159
|
-
if (!
|
|
160
|
-
url:
|
|
161
|
-
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,
|
|
162
163
|
height: i
|
|
163
164
|
};
|
|
164
|
-
let a =
|
|
165
|
+
let a = e;
|
|
165
166
|
if (a instanceof HTMLElement) {
|
|
166
|
-
let
|
|
167
|
-
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;
|
|
168
169
|
}
|
|
169
170
|
return {
|
|
170
|
-
url:
|
|
171
|
-
width:
|
|
171
|
+
url: t || "https://res.cloudinary.com/roomle/image/upload/v1729679975/fallback_afpyqr.jpg",
|
|
172
|
+
width: n,
|
|
172
173
|
height: i
|
|
173
174
|
};
|
|
174
175
|
})(this._startTarget), g = this._options || {}, _ = {
|
|
@@ -190,13 +191,13 @@ var a = (e, t = 0) => n(e) ? {
|
|
|
190
191
|
_dragEnd() {
|
|
191
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;
|
|
192
193
|
}
|
|
193
|
-
dragStart(e,
|
|
194
|
-
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) => {
|
|
195
196
|
this._dragStart(e, n, r);
|
|
196
197
|
} }, {
|
|
197
|
-
...d(
|
|
198
|
+
...d(n, this._options),
|
|
198
199
|
delay: 0
|
|
199
|
-
}) : 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);
|
|
200
201
|
}
|
|
201
202
|
dragEnd() {
|
|
202
203
|
this._dragEnd();
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
import { a as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
|
|
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
|
|
7
8
|
} : {
|
|
8
9
|
clientX: e.clientX,
|
|
9
10
|
clientY: e.clientY
|
|
10
|
-
}, o = (e) => e &&
|
|
11
|
+
}, o = (e) => e && t(e) ? e.touches.length > 0 : !0, s = class {
|
|
11
12
|
_touchDragTimeOut;
|
|
12
13
|
_onTouchDragStart;
|
|
13
14
|
_payload = null;
|
|
@@ -19,7 +20,7 @@ var a = (e, t = 0) => n(e) ? {
|
|
|
19
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;
|
|
20
21
|
}
|
|
21
22
|
onStart(e) {
|
|
22
|
-
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(() => {
|
|
23
24
|
this._clearTimeout(), this._lastTouch ||= a(e), this._checkXDistance(e)();
|
|
24
25
|
}, this._delay)));
|
|
25
26
|
}
|
|
@@ -70,12 +71,12 @@ var a = (e, t = 0) => n(e) ? {
|
|
|
70
71
|
_reset() {
|
|
71
72
|
this._startX = 0, this._startY = 0, this._lastX = 0, this._lastY = 0, this._isWaiting = !1;
|
|
72
73
|
}
|
|
73
|
-
}, f = "data-rml-old-draggable", p = void 0, m = (e,
|
|
74
|
-
let r =
|
|
74
|
+
}, f = "data-rml-old-draggable", p = void 0, m = (e, n) => {
|
|
75
|
+
let r = t(e), i = {
|
|
75
76
|
delay: r ? 500 : 100,
|
|
76
77
|
epsilon: r ? 10 : 15
|
|
77
78
|
};
|
|
78
|
-
if (!
|
|
79
|
+
if (!n) return i;
|
|
79
80
|
if (!r && !(e instanceof MouseEvent)) return console.warn("Unsupported event! It is not TouchEvent and also not MouseEvent"), i;
|
|
80
81
|
let { delayKey: a, epsilonKey: o } = r ? {
|
|
81
82
|
delayKey: "touchDragDelay",
|
|
@@ -84,22 +85,22 @@ var a = (e, t = 0) => n(e) ? {
|
|
|
84
85
|
delayKey: "customDragDelay",
|
|
85
86
|
epsilonKey: "customDragEpsilon"
|
|
86
87
|
};
|
|
87
|
-
return typeof
|
|
88
|
-
}, h = (
|
|
89
|
-
let
|
|
90
|
-
if (!
|
|
91
|
-
url:
|
|
92
|
-
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,
|
|
93
94
|
height: i
|
|
94
95
|
};
|
|
95
|
-
let a =
|
|
96
|
+
let a = e;
|
|
96
97
|
if (a instanceof HTMLElement) {
|
|
97
|
-
let
|
|
98
|
-
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;
|
|
99
100
|
}
|
|
100
101
|
return {
|
|
101
|
-
url:
|
|
102
|
-
width:
|
|
102
|
+
url: t || "https://res.cloudinary.com/roomle/image/upload/v1729679975/fallback_afpyqr.jpg",
|
|
103
|
+
width: n,
|
|
103
104
|
height: i
|
|
104
105
|
};
|
|
105
106
|
}, g = class {
|
|
@@ -156,12 +157,12 @@ var a = (e, t = 0) => n(e) ? {
|
|
|
156
157
|
}, this._hasEnteredIframe = !1, this.isDragging = !0;
|
|
157
158
|
}
|
|
158
159
|
}
|
|
159
|
-
_dragUpdate(
|
|
160
|
-
document.body.focus(), this._currentCustomDrag && this._currentCustomDrag.onMove(
|
|
161
|
-
let { clientX:
|
|
160
|
+
_dragUpdate(t) {
|
|
161
|
+
document.body.focus(), this._currentCustomDrag && this._currentCustomDrag.onMove(t);
|
|
162
|
+
let { clientX: r, clientY: i } = n(t);
|
|
162
163
|
if (this._dragGhost) {
|
|
163
164
|
let { width: e, height: t } = this._mainDomElement.getBoundingClientRect();
|
|
164
|
-
this._dragGhost.updateDragGhost(
|
|
165
|
+
this._dragGhost.updateDragGhost(r, i, { ghost: { visibleIn: {
|
|
165
166
|
x: 0,
|
|
166
167
|
y: 0,
|
|
167
168
|
width: e,
|
|
@@ -169,7 +170,7 @@ var a = (e, t = 0) => n(e) ? {
|
|
|
169
170
|
} } });
|
|
170
171
|
}
|
|
171
172
|
if (this._phase.kind !== "ready") return;
|
|
172
|
-
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);
|
|
173
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;
|
|
174
175
|
let { url: f, width: p, height: m } = h(this._startTarget), g = this._options || {}, _ = {
|
|
175
176
|
ghost: {
|
|
@@ -190,13 +191,13 @@ var a = (e, t = 0) => n(e) ? {
|
|
|
190
191
|
_dragEnd() {
|
|
191
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;
|
|
192
193
|
}
|
|
193
|
-
dragStart(e,
|
|
194
|
-
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) => {
|
|
195
196
|
this._dragStart(e, n, r);
|
|
196
197
|
} }, {
|
|
197
|
-
...m(
|
|
198
|
+
...m(n, this._options),
|
|
198
199
|
delay: 0
|
|
199
|
-
}) : 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);
|
|
200
201
|
}
|
|
201
202
|
dragEnd() {
|
|
202
203
|
this._dragEnd();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import { c as
|
|
3
|
-
import {
|
|
1
|
+
|
|
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";
|
|
4
5
|
//#region packages/embedding-lib/src/plugins/strategy/from-website.ts
|
|
5
6
|
var u = class {
|
|
6
7
|
_options = {};
|
|
@@ -35,9 +36,9 @@ var u = class {
|
|
|
35
36
|
beforeUpdateGhost(e) {
|
|
36
37
|
this._onBeforeUpdateDrag = e;
|
|
37
38
|
}
|
|
38
|
-
async dragStart(
|
|
39
|
+
async dragStart(e, r, a = "rml_id") {
|
|
39
40
|
let u = ++this._dragGeneration, d = this._mainDomElement.parentNode;
|
|
40
|
-
if (
|
|
41
|
+
if (i(d).position !== "relative") {
|
|
41
42
|
let e = "parent of iframe should have position relative, otherwise drag-in can not detect the x/y coordinates correctly";
|
|
42
43
|
this._phase = {
|
|
43
44
|
kind: "failed",
|
|
@@ -46,19 +47,19 @@ var u = class {
|
|
|
46
47
|
return;
|
|
47
48
|
}
|
|
48
49
|
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 =
|
|
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();
|
|
54
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 = {
|
|
55
56
|
x: 0,
|
|
56
57
|
y: 0
|
|
57
58
|
});
|
|
58
|
-
let { clientX: _, clientY: v } =
|
|
59
|
-
this._currentDrag.offset.x = _ - g.left, this._currentDrag.offset.y = v - g.top,
|
|
60
|
-
id:
|
|
61
|
-
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
|
|
62
63
|
}, this._hasEnteredIframe = !1, this._dragInObjectCalled = !1, this.isDragging = !0, this._phase = { kind: "starting" };
|
|
63
64
|
let y = null;
|
|
64
65
|
try {
|
|
@@ -71,13 +72,13 @@ var u = class {
|
|
|
71
72
|
bounds: { interactionContainer: y }
|
|
72
73
|
});
|
|
73
74
|
}
|
|
74
|
-
dragUpdate(
|
|
75
|
-
let
|
|
76
|
-
if (
|
|
77
|
-
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);
|
|
78
79
|
if (l === 1 && u === 1) return;
|
|
79
|
-
let d = this._mainDomElement.getBoundingClientRect(), { clientX: f, clientY: p } =
|
|
80
|
-
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)) {
|
|
81
82
|
let e = this._options.settings?.fingerSize || 0;
|
|
82
83
|
h = Math.max(2, l + e), g = Math.max(2, u - e);
|
|
83
84
|
}
|
|
@@ -88,7 +89,7 @@ var u = class {
|
|
|
88
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;
|
|
89
90
|
let { interactionContainer: x } = this._phase.bounds;
|
|
90
91
|
if (m && this._pendingDragIn) {
|
|
91
|
-
let e =
|
|
92
|
+
let e = r(f, p, d, x);
|
|
92
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);
|
|
93
94
|
} else !m && this._hasEnteredIframe && (this._instance.cancelDragIn(), this._hasEnteredIframe = !1, this._dragInObjectCalled = !1);
|
|
94
95
|
if (!this._hasEnteredIframe) return;
|
|
@@ -102,8 +103,8 @@ var u = class {
|
|
|
102
103
|
x: 0,
|
|
103
104
|
y: 0
|
|
104
105
|
}, this._hasEnteredIframe = !1, this._dragInObjectCalled = !1, this._pendingDragIn = null, this._phase = { kind: "idle" };
|
|
105
|
-
let
|
|
106
|
-
|
|
106
|
+
let t = e.querySelector("." + s);
|
|
107
|
+
t && t.classList.add(c.DISPLAY_NONE);
|
|
107
108
|
}
|
|
108
109
|
touchStart(e, t, n = "rml_id") {
|
|
109
110
|
t.preventDefault(), this.dragStart(e, t, n);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import { c as
|
|
3
|
-
import {
|
|
1
|
+
|
|
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";
|
|
4
5
|
var u = class {
|
|
5
6
|
_options = {};
|
|
6
7
|
_instance;
|
|
@@ -34,9 +35,9 @@ var u = class {
|
|
|
34
35
|
beforeUpdateGhost(e) {
|
|
35
36
|
this._onBeforeUpdateDrag = e;
|
|
36
37
|
}
|
|
37
|
-
async dragStart(
|
|
38
|
+
async dragStart(e, r, a = "rml_id") {
|
|
38
39
|
let u = ++this._dragGeneration, d = this._mainDomElement.parentNode;
|
|
39
|
-
if (
|
|
40
|
+
if (i(d).position !== "relative") {
|
|
40
41
|
this._phase = {
|
|
41
42
|
kind: "failed",
|
|
42
43
|
reason: "parent of iframe should have position relative, otherwise drag-in can not detect the x/y coordinates correctly"
|
|
@@ -44,19 +45,19 @@ var u = class {
|
|
|
44
45
|
return;
|
|
45
46
|
}
|
|
46
47
|
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 =
|
|
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();
|
|
52
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 = {
|
|
53
54
|
x: 0,
|
|
54
55
|
y: 0
|
|
55
56
|
});
|
|
56
|
-
let { clientX: _, clientY: v } =
|
|
57
|
-
this._currentDrag.offset.x = _ - g.left, this._currentDrag.offset.y = v - g.top,
|
|
58
|
-
id:
|
|
59
|
-
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
|
|
60
61
|
}, this._hasEnteredIframe = !1, this._dragInObjectCalled = !1, this.isDragging = !0, this._phase = { kind: "starting" };
|
|
61
62
|
let y = null;
|
|
62
63
|
try {
|
|
@@ -67,13 +68,13 @@ var u = class {
|
|
|
67
68
|
bounds: { interactionContainer: y }
|
|
68
69
|
});
|
|
69
70
|
}
|
|
70
|
-
dragUpdate(
|
|
71
|
-
let
|
|
72
|
-
if (
|
|
73
|
-
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);
|
|
74
75
|
if (l === 1 && u === 1) return;
|
|
75
|
-
let d = this._mainDomElement.getBoundingClientRect(), { clientX: f, clientY: p } =
|
|
76
|
-
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)) {
|
|
77
78
|
let e = this._options.settings?.fingerSize || 0;
|
|
78
79
|
h = Math.max(2, l + e), g = Math.max(2, u - e);
|
|
79
80
|
}
|
|
@@ -84,7 +85,7 @@ var u = class {
|
|
|
84
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;
|
|
85
86
|
let { interactionContainer: x } = this._phase.bounds;
|
|
86
87
|
if (m && this._pendingDragIn) {
|
|
87
|
-
let e =
|
|
88
|
+
let e = r(f, p, d, x);
|
|
88
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);
|
|
89
90
|
} else !m && this._hasEnteredIframe && (this._instance.cancelDragIn(), this._hasEnteredIframe = !1, this._dragInObjectCalled = !1);
|
|
90
91
|
if (!this._hasEnteredIframe) return;
|
|
@@ -98,8 +99,8 @@ var u = class {
|
|
|
98
99
|
x: 0,
|
|
99
100
|
y: 0
|
|
100
101
|
}, this._hasEnteredIframe = !1, this._dragInObjectCalled = !1, this._pendingDragIn = null, this._phase = { kind: "idle" };
|
|
101
|
-
let
|
|
102
|
-
|
|
102
|
+
let t = e.querySelector("." + s);
|
|
103
|
+
t && t.classList.add(c.DISPLAY_NONE);
|
|
103
104
|
}
|
|
104
105
|
touchStart(e, t, n = "rml_id") {
|
|
105
106
|
t.preventDefault(), this.dragStart(e, t, n);
|