@roomle/embedding-lib 0.0.0-dev-a4754cb
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/.releaserc.json +60 -0
- package/README.md +13 -0
- package/browser-BxG7yIaK.mjs +16 -0
- package/browser-CW9o-dtT.mjs +18 -0
- package/comlink-B2Kj_5Ge.mjs +206 -0
- package/comlink-B5lV2OWp.mjs +226 -0
- package/drag-ghost-BOwjMbG3.mjs +65 -0
- package/drag-ghost-BQ8r6NVo.mjs +60 -0
- package/drag-in-BP_E53zb.mjs +102 -0
- package/drag-in-QhL3zGC0.mjs +108 -0
- package/embedding-plugins.d.ts +2 -0
- package/embedding-plugins.js +2 -0
- package/embedding-plugins.min.js +2 -0
- package/from-custom-view-BM_zRJCf.mjs +227 -0
- package/from-custom-view-D2Z1YmCx.mjs +226 -0
- package/from-website-CPVeVVMI.mjs +123 -0
- package/from-website-DlklVbxU.mjs +118 -0
- package/hi-mcp-server-BtrPxgNY.mjs +5278 -0
- package/hi-mcp-server-ukmMIPNu.mjs +4866 -0
- package/hi.d.ts +2 -0
- package/hi.js +182 -0
- package/hi.min.js +167 -0
- package/package.json +50 -0
- package/packages/embedding-lib/src/connector.d.ts +44 -0
- package/packages/embedding-lib/src/embedding-plugins.d.ts +9 -0
- package/packages/embedding-lib/src/hi.d.ts +22 -0
- package/packages/embedding-lib/src/homag-intelligence/hi-callbacks.d.ts +3 -0
- package/packages/embedding-lib/src/homag-intelligence/hi-mcp/agent-facing.d.ts +35 -0
- package/packages/embedding-lib/src/homag-intelligence/hi-mcp/hi-mcp-server.d.ts +3 -0
- package/packages/embedding-lib/src/homag-intelligence/hi-mcp/mcp-tool.d.ts +69 -0
- package/packages/embedding-lib/src/homag-intelligence/hi-mcp/plan-history.d.ts +33 -0
- package/packages/embedding-lib/src/homag-intelligence/hi-mcp/planner-api.d.ts +32 -0
- package/packages/embedding-lib/src/homag-intelligence/hi-mcp/skills.d.ts +23 -0
- package/packages/embedding-lib/src/homag-intelligence/hi-mcp/tool-executors.d.ts +4 -0
- package/packages/embedding-lib/src/homag-intelligence/hi-mcp-tools.d.ts +11 -0
- package/packages/embedding-lib/src/homag-intelligence/hi-order-manager.d.ts +3 -0
- package/packages/embedding-lib/src/homag-intelligence/hi-planning-assistant.d.ts +55 -0
- package/packages/embedding-lib/src/homag-intelligence/hi-requests.d.ts +35 -0
- package/packages/embedding-lib/src/homag-intelligence/hi-setup.d.ts +6 -0
- package/packages/embedding-lib/src/homag-intelligence/hi-utils.d.ts +8 -0
- package/packages/embedding-lib/src/plugins/constants.d.ts +19 -0
- package/packages/embedding-lib/src/plugins/drag-in.d.ts +32 -0
- package/packages/embedding-lib/src/plugins/strategy/drag-phase.d.ts +25 -0
- package/packages/embedding-lib/src/plugins/strategy/from-custom-view.d.ts +39 -0
- package/packages/embedding-lib/src/plugins/strategy/from-website.d.ts +45 -0
- package/packages/embedding-lib/src/plugins/strategy/types.d.ts +14 -0
- package/packages/embedding-lib/src/plugins/types.d.ts +35 -0
- package/packages/embedding-lib/src/roomle-embedding-lib.d.ts +82 -0
- package/packages/embedding-lib/src/utils.d.ts +35 -0
- package/roomle-embedding-lib.d.ts +6 -0
- package/roomle-embedding-lib.js +396 -0
- package/roomle-embedding-lib.min.js +366 -0
- package/utils-DxJ3PcKe.mjs +131 -0
- package/utils-wJ80awOA.mjs +123 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { l as e, p as t, r as n } from "./drag-in-QhL3zGC0.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-BOwjMbG3.mjs";
|
|
4
|
+
//#region packages/embedding-lib/src/plugins/strategy/from-website.ts
|
|
5
|
+
var u = class {
|
|
6
|
+
_options = {};
|
|
7
|
+
_instance;
|
|
8
|
+
_mainDomElement;
|
|
9
|
+
_currentDrag = {};
|
|
10
|
+
_firefoxDragPosition = {
|
|
11
|
+
x: 0,
|
|
12
|
+
y: 0
|
|
13
|
+
};
|
|
14
|
+
_onBeforeUpdateDrag = () => ({});
|
|
15
|
+
isDragging = !1;
|
|
16
|
+
_hasEnteredIframe = !1;
|
|
17
|
+
_dragInObjectCalled = !1;
|
|
18
|
+
_pendingDragIn = null;
|
|
19
|
+
_phase = { kind: "idle" };
|
|
20
|
+
_dragGeneration = 0;
|
|
21
|
+
_currentTouch = null;
|
|
22
|
+
_parentWithDragLeave = null;
|
|
23
|
+
_firefoxFallback = (e) => {
|
|
24
|
+
if (!this._currentDrag.event) return;
|
|
25
|
+
e.preventDefault();
|
|
26
|
+
let t = e || window.event;
|
|
27
|
+
this._firefoxDragPosition.x = t.pageX || 0, this._firefoxDragPosition.y = t.pageY || 0;
|
|
28
|
+
};
|
|
29
|
+
_parentDragLeave = () => {
|
|
30
|
+
this._phase.kind !== "ready" || !this._hasEnteredIframe || (this._instance.cancelDragIn(), this._hasEnteredIframe = !1, this._dragInObjectCalled = !1);
|
|
31
|
+
};
|
|
32
|
+
constructor(e, t, n) {
|
|
33
|
+
this._instance = e, this._mainDomElement = t, this._options = n || {}, document.addEventListener("dragover", this._firefoxFallback), this._parentWithDragLeave = this._mainDomElement.parentElement, this._parentWithDragLeave?.addEventListener("dragleave", this._parentDragLeave);
|
|
34
|
+
}
|
|
35
|
+
beforeUpdateGhost(e) {
|
|
36
|
+
this._onBeforeUpdateDrag = e;
|
|
37
|
+
}
|
|
38
|
+
async dragStart(r, o, c = "rml_id") {
|
|
39
|
+
let u = ++this._dragGeneration, d = this._mainDomElement.parentNode;
|
|
40
|
+
if (s(d).position !== "relative") {
|
|
41
|
+
let e = "parent of iframe should have position relative, otherwise drag-in can not detect the x/y coordinates correctly";
|
|
42
|
+
this._phase = {
|
|
43
|
+
kind: "failed",
|
|
44
|
+
reason: e
|
|
45
|
+
}, console.warn(`Drag-in not started: ${e}`);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
this._mainDomElement.style.pointerEvents = "none";
|
|
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
|
+
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
|
+
x: 0,
|
|
56
|
+
y: 0
|
|
57
|
+
});
|
|
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
|
+
}, this._hasEnteredIframe = !1, this._dragInObjectCalled = !1, this.isDragging = !0, this._phase = { kind: "starting" };
|
|
63
|
+
let y = null;
|
|
64
|
+
try {
|
|
65
|
+
y = (await this._instance.getDrawerBoundingClientRect()).final;
|
|
66
|
+
} catch (e) {
|
|
67
|
+
console.warn("Could not read the interaction container rect, treating the whole iframe as canvas", e);
|
|
68
|
+
}
|
|
69
|
+
u === this._dragGeneration && (this._phase = {
|
|
70
|
+
kind: "ready",
|
|
71
|
+
bounds: { interactionContainer: y }
|
|
72
|
+
});
|
|
73
|
+
}
|
|
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
|
+
if (l === 1 && u === 1) return;
|
|
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
|
+
let e = this._options.settings?.fingerSize || 0;
|
|
82
|
+
h = Math.max(2, l + e), g = Math.max(2, u - e);
|
|
83
|
+
}
|
|
84
|
+
let { x: _, y: v, options: y } = this._onBeforeUpdateDrag(h, g, {}), b = y || {
|
|
85
|
+
settings: {},
|
|
86
|
+
ghost: {}
|
|
87
|
+
};
|
|
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
|
+
let { interactionContainer: x } = this._phase.bounds;
|
|
90
|
+
if (m && this._pendingDragIn) {
|
|
91
|
+
let e = o(f, p, d, x);
|
|
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
|
+
} else !m && this._hasEnteredIframe && (this._instance.cancelDragIn(), this._hasEnteredIframe = !1, this._dragInObjectCalled = !1);
|
|
94
|
+
if (!this._hasEnteredIframe) return;
|
|
95
|
+
let S = typeof _ == "number" ? _ : h, C = typeof v == "number" ? v : g;
|
|
96
|
+
this._instance.updateDrag(S, C, {});
|
|
97
|
+
}
|
|
98
|
+
dragEnd() {
|
|
99
|
+
this._dragGeneration++, this._mainDomElement.style.pointerEvents = "all";
|
|
100
|
+
let e = this._mainDomElement.parentNode;
|
|
101
|
+
this.isDragging = !1, this._hasEnteredIframe && this._instance.dragInObjectEnd(), this._currentDrag.ghost && (this._currentDrag.ghost.removeDragGhost(), this._currentDrag.ghost = null), this._currentDrag = {}, this._firefoxDragPosition = {
|
|
102
|
+
x: 0,
|
|
103
|
+
y: 0
|
|
104
|
+
}, this._hasEnteredIframe = !1, this._dragInObjectCalled = !1, this._pendingDragIn = null, this._phase = { kind: "idle" };
|
|
105
|
+
let r = e.querySelector("." + t);
|
|
106
|
+
r && r.classList.add(n.DISPLAY_NONE);
|
|
107
|
+
}
|
|
108
|
+
touchStart(e, t, n = "rml_id") {
|
|
109
|
+
t.preventDefault(), this.dragStart(e, t, n);
|
|
110
|
+
}
|
|
111
|
+
touchMove(e) {
|
|
112
|
+
this._currentTouch && this._currentTouch.onMove(e), this._currentDrag.event && this.dragUpdate(e);
|
|
113
|
+
}
|
|
114
|
+
touchEnd() {
|
|
115
|
+
this.dragEnd();
|
|
116
|
+
}
|
|
117
|
+
dispose() {
|
|
118
|
+
document.removeEventListener("dragover", this._firefoxFallback), this._parentWithDragLeave?.removeEventListener("dragleave", this._parentDragLeave), this._parentWithDragLeave = null;
|
|
119
|
+
}
|
|
120
|
+
releaseInput(e) {}
|
|
121
|
+
};
|
|
122
|
+
//#endregion
|
|
123
|
+
export { u as DragInFromWebsiteStrategy };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { l as e, p as t, r as n } from "./drag-in-BP_E53zb.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-BQ8r6NVo.mjs";
|
|
4
|
+
var u = class {
|
|
5
|
+
_options = {};
|
|
6
|
+
_instance;
|
|
7
|
+
_mainDomElement;
|
|
8
|
+
_currentDrag = {};
|
|
9
|
+
_firefoxDragPosition = {
|
|
10
|
+
x: 0,
|
|
11
|
+
y: 0
|
|
12
|
+
};
|
|
13
|
+
_onBeforeUpdateDrag = () => ({});
|
|
14
|
+
isDragging = !1;
|
|
15
|
+
_hasEnteredIframe = !1;
|
|
16
|
+
_dragInObjectCalled = !1;
|
|
17
|
+
_pendingDragIn = null;
|
|
18
|
+
_phase = { kind: "idle" };
|
|
19
|
+
_dragGeneration = 0;
|
|
20
|
+
_currentTouch = null;
|
|
21
|
+
_parentWithDragLeave = null;
|
|
22
|
+
_firefoxFallback = (e) => {
|
|
23
|
+
if (!this._currentDrag.event) return;
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
let t = e || window.event;
|
|
26
|
+
this._firefoxDragPosition.x = t.pageX || 0, this._firefoxDragPosition.y = t.pageY || 0;
|
|
27
|
+
};
|
|
28
|
+
_parentDragLeave = () => {
|
|
29
|
+
this._phase.kind === "ready" && this._hasEnteredIframe && (this._instance.cancelDragIn(), this._hasEnteredIframe = !1, this._dragInObjectCalled = !1);
|
|
30
|
+
};
|
|
31
|
+
constructor(e, t, n) {
|
|
32
|
+
this._instance = e, this._mainDomElement = t, this._options = n || {}, document.addEventListener("dragover", this._firefoxFallback), this._parentWithDragLeave = this._mainDomElement.parentElement, this._parentWithDragLeave?.addEventListener("dragleave", this._parentDragLeave);
|
|
33
|
+
}
|
|
34
|
+
beforeUpdateGhost(e) {
|
|
35
|
+
this._onBeforeUpdateDrag = e;
|
|
36
|
+
}
|
|
37
|
+
async dragStart(r, o, c = "rml_id") {
|
|
38
|
+
let u = ++this._dragGeneration, d = this._mainDomElement.parentNode;
|
|
39
|
+
if (s(d).position !== "relative") {
|
|
40
|
+
this._phase = {
|
|
41
|
+
kind: "failed",
|
|
42
|
+
reason: "parent of iframe should have position relative, otherwise drag-in can not detect the x/y coordinates correctly"
|
|
43
|
+
};
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
this._mainDomElement.style.pointerEvents = "none";
|
|
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
|
+
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
|
+
x: 0,
|
|
54
|
+
y: 0
|
|
55
|
+
});
|
|
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
|
+
}, this._hasEnteredIframe = !1, this._dragInObjectCalled = !1, this.isDragging = !0, this._phase = { kind: "starting" };
|
|
61
|
+
let y = null;
|
|
62
|
+
try {
|
|
63
|
+
y = (await this._instance.getDrawerBoundingClientRect()).final;
|
|
64
|
+
} catch {}
|
|
65
|
+
u === this._dragGeneration && (this._phase = {
|
|
66
|
+
kind: "ready",
|
|
67
|
+
bounds: { interactionContainer: y }
|
|
68
|
+
});
|
|
69
|
+
}
|
|
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
|
+
if (l === 1 && u === 1) return;
|
|
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
|
+
let e = this._options.settings?.fingerSize || 0;
|
|
78
|
+
h = Math.max(2, l + e), g = Math.max(2, u - e);
|
|
79
|
+
}
|
|
80
|
+
let { x: _, y: v, options: y } = this._onBeforeUpdateDrag(h, g, {}), b = y || {
|
|
81
|
+
settings: {},
|
|
82
|
+
ghost: {}
|
|
83
|
+
};
|
|
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
|
+
let { interactionContainer: x } = this._phase.bounds;
|
|
86
|
+
if (m && this._pendingDragIn) {
|
|
87
|
+
let e = o(f, p, d, x);
|
|
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
|
+
} else !m && this._hasEnteredIframe && (this._instance.cancelDragIn(), this._hasEnteredIframe = !1, this._dragInObjectCalled = !1);
|
|
90
|
+
if (!this._hasEnteredIframe) return;
|
|
91
|
+
let S = typeof _ == "number" ? _ : h, C = typeof v == "number" ? v : g;
|
|
92
|
+
this._instance.updateDrag(S, C, {});
|
|
93
|
+
}
|
|
94
|
+
dragEnd() {
|
|
95
|
+
this._dragGeneration++, this._mainDomElement.style.pointerEvents = "all";
|
|
96
|
+
let e = this._mainDomElement.parentNode;
|
|
97
|
+
this.isDragging = !1, this._hasEnteredIframe && this._instance.dragInObjectEnd(), this._currentDrag.ghost && (this._currentDrag.ghost.removeDragGhost(), this._currentDrag.ghost = null), this._currentDrag = {}, this._firefoxDragPosition = {
|
|
98
|
+
x: 0,
|
|
99
|
+
y: 0
|
|
100
|
+
}, this._hasEnteredIframe = !1, this._dragInObjectCalled = !1, this._pendingDragIn = null, this._phase = { kind: "idle" };
|
|
101
|
+
let r = e.querySelector("." + t);
|
|
102
|
+
r && r.classList.add(n.DISPLAY_NONE);
|
|
103
|
+
}
|
|
104
|
+
touchStart(e, t, n = "rml_id") {
|
|
105
|
+
t.preventDefault(), this.dragStart(e, t, n);
|
|
106
|
+
}
|
|
107
|
+
touchMove(e) {
|
|
108
|
+
this._currentTouch && this._currentTouch.onMove(e), this._currentDrag.event && this.dragUpdate(e);
|
|
109
|
+
}
|
|
110
|
+
touchEnd() {
|
|
111
|
+
this.dragEnd();
|
|
112
|
+
}
|
|
113
|
+
dispose() {
|
|
114
|
+
document.removeEventListener("dragover", this._firefoxFallback), this._parentWithDragLeave?.removeEventListener("dragleave", this._parentDragLeave), this._parentWithDragLeave = null;
|
|
115
|
+
}
|
|
116
|
+
releaseInput(e) {}
|
|
117
|
+
};
|
|
118
|
+
export { u as DragInFromWebsiteStrategy };
|