@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
package/.releaserc.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tagFormat": "embedding-lib-v${version}",
|
|
3
|
+
"repositoryUrl": "git@github.com:roomle-dev/roomle-ui.git",
|
|
4
|
+
"branches": [
|
|
5
|
+
{
|
|
6
|
+
"name": "cd/embedding-pre-release",
|
|
7
|
+
"channel": "debug",
|
|
8
|
+
"prerelease": "debug"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "release/live",
|
|
12
|
+
"channel": "latest",
|
|
13
|
+
"prerelease": false
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "release/test",
|
|
17
|
+
"channel": "alpha",
|
|
18
|
+
"prerelease": "alpha"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"plugins": [
|
|
22
|
+
[
|
|
23
|
+
"@semantic-release/commit-analyzer",
|
|
24
|
+
{
|
|
25
|
+
"preset": "conventionalcommits",
|
|
26
|
+
"releaseRules": [
|
|
27
|
+
{
|
|
28
|
+
"type": "docs",
|
|
29
|
+
"release": "patch"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"type": "refactor",
|
|
33
|
+
"release": "patch"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
[
|
|
39
|
+
"@semantic-release/release-notes-generator",
|
|
40
|
+
{
|
|
41
|
+
"preset": "conventionalcommits",
|
|
42
|
+
"writerOpts": {
|
|
43
|
+
"commitsSort": ["subject", "scope"]
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
"@semantic-release/changelog",
|
|
49
|
+
{
|
|
50
|
+
"changelogFile": "docs/md/web/embedding/CHANGELOG.md"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
[
|
|
54
|
+
"@semantic-release/npm",
|
|
55
|
+
{
|
|
56
|
+
"npmPublish": true
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
]
|
|
60
|
+
}
|
package/README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Roomle Rubens Embedding Lib
|
|
2
|
+
|
|
3
|
+
The official npm package to embed [Roomle](https://www.roomle.com/en) Rubens in your website.
|
|
4
|
+
|
|
5
|
+
For release notes, see the [CHANGELOG](https://docs.roomle.com/rubens/changelogs/changelog).
|
|
6
|
+
|
|
7
|
+
## Getting started
|
|
8
|
+
|
|
9
|
+
You can find an extensive guide on how to get started on [docs.roomle.com](https://docs.roomle.com/rubens/rubens-products/rubens-3d-viewer-and-ar/getting-started).
|
|
10
|
+
|
|
11
|
+
## Bugs & Issues
|
|
12
|
+
|
|
13
|
+
If you encounter issues please report them using our [Servicedesk](https://roomle.atlassian.net/servicedesk/customer/portals).
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var e = [
|
|
2
|
+
"language",
|
|
3
|
+
"browserLanguage",
|
|
4
|
+
"userLanguage",
|
|
5
|
+
"systemLanguage"
|
|
6
|
+
], t = (e, t = !0) => e ? e.length < 2 ? "en" : t ? e.substring(0, 2) : e : "en", n = (n = null, r = !1) => {
|
|
7
|
+
let i = window.navigator;
|
|
8
|
+
if (n) return t(n, !r);
|
|
9
|
+
if (Array.isArray(i.languages) && i.languages.length > 0) return t(i.languages[0], !r);
|
|
10
|
+
for (let n = 0, a = e.length; n < a; n++) {
|
|
11
|
+
let a = i[e[n]];
|
|
12
|
+
if (a) return t(a, !r);
|
|
13
|
+
}
|
|
14
|
+
return "en";
|
|
15
|
+
};
|
|
16
|
+
export { n as t };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region packages/common/src/utils/browser.ts
|
|
2
|
+
var e = [
|
|
3
|
+
"language",
|
|
4
|
+
"browserLanguage",
|
|
5
|
+
"userLanguage",
|
|
6
|
+
"systemLanguage"
|
|
7
|
+
], t = (e, t = !0) => !e || e.length < 2 ? "en" : t ? e.substring(0, 2) : e, n = (n = null, r = !1) => {
|
|
8
|
+
let i = window.navigator;
|
|
9
|
+
if (n) return t(n, !r);
|
|
10
|
+
if (Array.isArray(i.languages) && i.languages.length > 0) return t(i.languages[0], !r);
|
|
11
|
+
for (let n = 0, a = e.length; n < a; n++) {
|
|
12
|
+
let a = i[e[n]];
|
|
13
|
+
if (a) return t(a, !r);
|
|
14
|
+
}
|
|
15
|
+
return "en";
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { n as t };
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
var e = Symbol("Comlink.proxy"), t = Symbol("Comlink.endpoint"), n = Symbol("Comlink.releaseProxy"), r = Symbol("Comlink.finalizer"), i = Symbol("Comlink.thrown"), a = (e) => typeof e == "object" && !!e || typeof e == "function", o = new Map([["proxy", {
|
|
2
|
+
canHandle: (t) => a(t) && t[e],
|
|
3
|
+
serialize(e) {
|
|
4
|
+
let { port1: t, port2: n } = new MessageChannel();
|
|
5
|
+
return s(e, t), [n, [n]];
|
|
6
|
+
},
|
|
7
|
+
deserialize: (e) => (e.start(), function(e) {
|
|
8
|
+
let t = /* @__PURE__ */ new Map();
|
|
9
|
+
return e.addEventListener("message", function(e) {
|
|
10
|
+
let { data: n } = e;
|
|
11
|
+
if (!n || !n.id) return;
|
|
12
|
+
let r = t.get(n.id);
|
|
13
|
+
if (r) try {
|
|
14
|
+
r(n);
|
|
15
|
+
} finally {
|
|
16
|
+
t.delete(n.id);
|
|
17
|
+
}
|
|
18
|
+
}), p(e, t, [], void 0);
|
|
19
|
+
}(e))
|
|
20
|
+
}], ["throw", {
|
|
21
|
+
canHandle: (e) => a(e) && i in e,
|
|
22
|
+
serialize({ value: e }) {
|
|
23
|
+
let t;
|
|
24
|
+
return t = e instanceof Error ? {
|
|
25
|
+
isError: !0,
|
|
26
|
+
value: {
|
|
27
|
+
message: e.message,
|
|
28
|
+
name: e.name,
|
|
29
|
+
stack: e.stack
|
|
30
|
+
}
|
|
31
|
+
} : {
|
|
32
|
+
isError: !1,
|
|
33
|
+
value: e
|
|
34
|
+
}, [t, []];
|
|
35
|
+
},
|
|
36
|
+
deserialize(e) {
|
|
37
|
+
throw e.isError ? Object.assign(Error(e.value.message), e.value) : e.value;
|
|
38
|
+
}
|
|
39
|
+
}]]);
|
|
40
|
+
function s(t, n = globalThis, a = ["*"]) {
|
|
41
|
+
n.addEventListener("message", function o(l) {
|
|
42
|
+
if (!l || !l.data || !function(e, t) {
|
|
43
|
+
for (let n of e) if (t === n || n === "*" || n instanceof RegExp && n.test(t)) return !0;
|
|
44
|
+
return !1;
|
|
45
|
+
}(a, l.origin)) return;
|
|
46
|
+
let { id: u, type: d, path: f } = Object.assign({ path: [] }, l.data), p = (l.data.argumentList || []).map(_), m;
|
|
47
|
+
try {
|
|
48
|
+
let n = f.slice(0, -1).reduce((e, t) => e[t], t), r = f.reduce((e, t) => e[t], t);
|
|
49
|
+
switch (d) {
|
|
50
|
+
case "GET":
|
|
51
|
+
m = r;
|
|
52
|
+
break;
|
|
53
|
+
case "SET":
|
|
54
|
+
n[f.slice(-1)[0]] = _(l.data.value), m = !0;
|
|
55
|
+
break;
|
|
56
|
+
case "APPLY":
|
|
57
|
+
m = r.apply(n, p);
|
|
58
|
+
break;
|
|
59
|
+
case "CONSTRUCT":
|
|
60
|
+
m = function(t) {
|
|
61
|
+
return Object.assign(t, { [e]: !0 });
|
|
62
|
+
}(new r(...p));
|
|
63
|
+
break;
|
|
64
|
+
case "ENDPOINT":
|
|
65
|
+
{
|
|
66
|
+
let { port1: e, port2: n } = new MessageChannel();
|
|
67
|
+
s(t, n), m = function(e, t) {
|
|
68
|
+
return h.set(e, t), e;
|
|
69
|
+
}(e, [e]);
|
|
70
|
+
}
|
|
71
|
+
break;
|
|
72
|
+
case "RELEASE":
|
|
73
|
+
m = void 0;
|
|
74
|
+
break;
|
|
75
|
+
default: return;
|
|
76
|
+
}
|
|
77
|
+
} catch (e) {
|
|
78
|
+
m = {
|
|
79
|
+
value: e,
|
|
80
|
+
[i]: 0
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
Promise.resolve(m).catch((e) => ({
|
|
84
|
+
value: e,
|
|
85
|
+
[i]: 0
|
|
86
|
+
})).then((e) => {
|
|
87
|
+
let [i, a] = g(e);
|
|
88
|
+
n.postMessage(Object.assign(Object.assign({}, i), { id: u }), a), d === "RELEASE" && (n.removeEventListener("message", o), c(n), r in t && typeof t[r] == "function" && t[r]());
|
|
89
|
+
}).catch((e) => {
|
|
90
|
+
let [t, r] = g({
|
|
91
|
+
value: /* @__PURE__ */ TypeError("Unserializable return value"),
|
|
92
|
+
[i]: 0
|
|
93
|
+
});
|
|
94
|
+
n.postMessage(Object.assign(Object.assign({}, t), { id: u }), r);
|
|
95
|
+
});
|
|
96
|
+
}), n.start && n.start();
|
|
97
|
+
}
|
|
98
|
+
function c(e) {
|
|
99
|
+
(function(e) {
|
|
100
|
+
return e.constructor.name === "MessagePort";
|
|
101
|
+
})(e) && e.close();
|
|
102
|
+
}
|
|
103
|
+
function l(e) {
|
|
104
|
+
if (e) throw Error("Proxy has been released and is not useable");
|
|
105
|
+
}
|
|
106
|
+
function u(e) {
|
|
107
|
+
return v(e, /* @__PURE__ */ new Map(), { type: "RELEASE" }).then(() => {
|
|
108
|
+
c(e);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
var d = /* @__PURE__ */ new WeakMap(), f = "FinalizationRegistry" in globalThis && new FinalizationRegistry((e) => {
|
|
112
|
+
let t = (d.get(e) || 0) - 1;
|
|
113
|
+
d.set(e, t), t === 0 && u(e);
|
|
114
|
+
});
|
|
115
|
+
function p(e, r, i = [], a = function() {}) {
|
|
116
|
+
let o = !1, s = new Proxy(a, {
|
|
117
|
+
get(t, a) {
|
|
118
|
+
if (l(o), a === n) return () => {
|
|
119
|
+
(function(e) {
|
|
120
|
+
f && f.unregister(e);
|
|
121
|
+
})(s), u(e), r.clear(), o = !0;
|
|
122
|
+
};
|
|
123
|
+
if (a === "then") {
|
|
124
|
+
if (i.length === 0) return { then: () => s };
|
|
125
|
+
let t = v(e, r, {
|
|
126
|
+
type: "GET",
|
|
127
|
+
path: i.map((e) => e.toString())
|
|
128
|
+
}).then(_);
|
|
129
|
+
return t.then.bind(t);
|
|
130
|
+
}
|
|
131
|
+
return p(e, r, [...i, a]);
|
|
132
|
+
},
|
|
133
|
+
set(t, n, a) {
|
|
134
|
+
l(o);
|
|
135
|
+
let [s, c] = g(a);
|
|
136
|
+
return v(e, r, {
|
|
137
|
+
type: "SET",
|
|
138
|
+
path: [...i, n].map((e) => e.toString()),
|
|
139
|
+
value: s
|
|
140
|
+
}, c).then(_);
|
|
141
|
+
},
|
|
142
|
+
apply(n, a, s) {
|
|
143
|
+
l(o);
|
|
144
|
+
let c = i[i.length - 1];
|
|
145
|
+
if (c === t) return v(e, r, { type: "ENDPOINT" }).then(_);
|
|
146
|
+
if (c === "bind") return p(e, r, i.slice(0, -1));
|
|
147
|
+
let [u, d] = m(s);
|
|
148
|
+
return v(e, r, {
|
|
149
|
+
type: "APPLY",
|
|
150
|
+
path: i.map((e) => e.toString()),
|
|
151
|
+
argumentList: u
|
|
152
|
+
}, d).then(_);
|
|
153
|
+
},
|
|
154
|
+
construct(t, n) {
|
|
155
|
+
l(o);
|
|
156
|
+
let [a, s] = m(n);
|
|
157
|
+
return v(e, r, {
|
|
158
|
+
type: "CONSTRUCT",
|
|
159
|
+
path: i.map((e) => e.toString()),
|
|
160
|
+
argumentList: a
|
|
161
|
+
}, s).then(_);
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
return function(e, t) {
|
|
165
|
+
let n = (d.get(t) || 0) + 1;
|
|
166
|
+
d.set(t, n), f && f.register(e, t, e);
|
|
167
|
+
}(s, e), s;
|
|
168
|
+
}
|
|
169
|
+
function m(e) {
|
|
170
|
+
let t = e.map(g);
|
|
171
|
+
return [t.map((e) => e[0]), (n = t.map((e) => e[1]), Array.prototype.concat.apply([], n))];
|
|
172
|
+
var n;
|
|
173
|
+
}
|
|
174
|
+
var h = /* @__PURE__ */ new WeakMap();
|
|
175
|
+
function g(e) {
|
|
176
|
+
for (let [t, n] of o) if (n.canHandle(e)) {
|
|
177
|
+
let [r, i] = n.serialize(e);
|
|
178
|
+
return [{
|
|
179
|
+
type: "HANDLER",
|
|
180
|
+
name: t,
|
|
181
|
+
value: r
|
|
182
|
+
}, i];
|
|
183
|
+
}
|
|
184
|
+
return [{
|
|
185
|
+
type: "RAW",
|
|
186
|
+
value: e
|
|
187
|
+
}, h.get(e) || []];
|
|
188
|
+
}
|
|
189
|
+
function _(e) {
|
|
190
|
+
switch (e.type) {
|
|
191
|
+
case "HANDLER": return o.get(e.name).deserialize(e.value);
|
|
192
|
+
case "RAW": return e.value;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
function v(e, t, n, r) {
|
|
196
|
+
return new Promise((i) => {
|
|
197
|
+
let a = [
|
|
198
|
+
,
|
|
199
|
+
,
|
|
200
|
+
,
|
|
201
|
+
,
|
|
202
|
+
].fill(0).map(() => Math.floor(Math.random() * (2 ** 53 - 1)).toString(16)).join("-");
|
|
203
|
+
t.set(a, i), e.start && e.start(), e.postMessage(Object.assign({ id: a }, n), r);
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
export { s as expose };
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
//#region node_modules/comlink/dist/esm/comlink.mjs
|
|
2
|
+
var e = Symbol("Comlink.proxy"), t = Symbol("Comlink.endpoint"), n = Symbol("Comlink.releaseProxy"), r = Symbol("Comlink.finalizer"), i = Symbol("Comlink.thrown"), a = (e) => typeof e == "object" && !!e || typeof e == "function", o = new Map([["proxy", {
|
|
3
|
+
canHandle: (t) => a(t) && t[e],
|
|
4
|
+
serialize(e) {
|
|
5
|
+
let { port1: t, port2: n } = new MessageChannel();
|
|
6
|
+
return c(e, t), [n, [n]];
|
|
7
|
+
},
|
|
8
|
+
deserialize(e) {
|
|
9
|
+
return e.start(), d(e);
|
|
10
|
+
}
|
|
11
|
+
}], ["throw", {
|
|
12
|
+
canHandle: (e) => a(e) && i in e,
|
|
13
|
+
serialize({ value: e }) {
|
|
14
|
+
let t;
|
|
15
|
+
return t = e instanceof Error ? {
|
|
16
|
+
isError: !0,
|
|
17
|
+
value: {
|
|
18
|
+
message: e.message,
|
|
19
|
+
name: e.name,
|
|
20
|
+
stack: e.stack
|
|
21
|
+
}
|
|
22
|
+
} : {
|
|
23
|
+
isError: !1,
|
|
24
|
+
value: e
|
|
25
|
+
}, [t, []];
|
|
26
|
+
},
|
|
27
|
+
deserialize(e) {
|
|
28
|
+
throw e.isError ? Object.assign(Error(e.value.message), e.value) : e.value;
|
|
29
|
+
}
|
|
30
|
+
}]]);
|
|
31
|
+
function s(e, t) {
|
|
32
|
+
for (let n of e) if (t === n || n === "*" || n instanceof RegExp && n.test(t)) return !0;
|
|
33
|
+
return !1;
|
|
34
|
+
}
|
|
35
|
+
function c(e, t = globalThis, n = ["*"]) {
|
|
36
|
+
t.addEventListener("message", function a(o) {
|
|
37
|
+
if (!o || !o.data) return;
|
|
38
|
+
if (!s(n, o.origin)) {
|
|
39
|
+
console.warn(`Invalid origin '${o.origin}' for comlink proxy`);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
let { id: l, type: d, path: f } = Object.assign({ path: [] }, o.data), p = (o.data.argumentList || []).map(T), m;
|
|
43
|
+
try {
|
|
44
|
+
let t = f.slice(0, -1).reduce((e, t) => e[t], e), n = f.reduce((e, t) => e[t], e);
|
|
45
|
+
switch (d) {
|
|
46
|
+
case "GET":
|
|
47
|
+
m = n;
|
|
48
|
+
break;
|
|
49
|
+
case "SET":
|
|
50
|
+
t[f.slice(-1)[0]] = T(o.data.value), m = !0;
|
|
51
|
+
break;
|
|
52
|
+
case "APPLY":
|
|
53
|
+
m = n.apply(t, p);
|
|
54
|
+
break;
|
|
55
|
+
case "CONSTRUCT":
|
|
56
|
+
m = C(new n(...p));
|
|
57
|
+
break;
|
|
58
|
+
case "ENDPOINT":
|
|
59
|
+
{
|
|
60
|
+
let { port1: t, port2: n } = new MessageChannel();
|
|
61
|
+
c(e, n), m = S(t, [t]);
|
|
62
|
+
}
|
|
63
|
+
break;
|
|
64
|
+
case "RELEASE":
|
|
65
|
+
m = void 0;
|
|
66
|
+
break;
|
|
67
|
+
default: return;
|
|
68
|
+
}
|
|
69
|
+
} catch (e) {
|
|
70
|
+
m = {
|
|
71
|
+
value: e,
|
|
72
|
+
[i]: 0
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
Promise.resolve(m).catch((e) => ({
|
|
76
|
+
value: e,
|
|
77
|
+
[i]: 0
|
|
78
|
+
})).then((n) => {
|
|
79
|
+
let [i, o] = w(n);
|
|
80
|
+
t.postMessage(Object.assign(Object.assign({}, i), { id: l }), o), d === "RELEASE" && (t.removeEventListener("message", a), u(t), r in e && typeof e[r] == "function" && e[r]());
|
|
81
|
+
}).catch((e) => {
|
|
82
|
+
let [n, r] = w({
|
|
83
|
+
value: /* @__PURE__ */ TypeError("Unserializable return value"),
|
|
84
|
+
[i]: 0
|
|
85
|
+
});
|
|
86
|
+
t.postMessage(Object.assign(Object.assign({}, n), { id: l }), r);
|
|
87
|
+
});
|
|
88
|
+
}), t.start && t.start();
|
|
89
|
+
}
|
|
90
|
+
function l(e) {
|
|
91
|
+
return e.constructor.name === "MessagePort";
|
|
92
|
+
}
|
|
93
|
+
function u(e) {
|
|
94
|
+
l(e) && e.close();
|
|
95
|
+
}
|
|
96
|
+
function d(e, t) {
|
|
97
|
+
let n = /* @__PURE__ */ new Map();
|
|
98
|
+
return e.addEventListener("message", function(e) {
|
|
99
|
+
let { data: t } = e;
|
|
100
|
+
if (!t || !t.id) return;
|
|
101
|
+
let r = n.get(t.id);
|
|
102
|
+
if (r) try {
|
|
103
|
+
r(t);
|
|
104
|
+
} finally {
|
|
105
|
+
n.delete(t.id);
|
|
106
|
+
}
|
|
107
|
+
}), v(e, n, [], t);
|
|
108
|
+
}
|
|
109
|
+
function f(e) {
|
|
110
|
+
if (e) throw Error("Proxy has been released and is not useable");
|
|
111
|
+
}
|
|
112
|
+
function p(e) {
|
|
113
|
+
return E(e, /* @__PURE__ */ new Map(), { type: "RELEASE" }).then(() => {
|
|
114
|
+
u(e);
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
var m = /* @__PURE__ */ new WeakMap(), h = "FinalizationRegistry" in globalThis && new FinalizationRegistry((e) => {
|
|
118
|
+
let t = (m.get(e) || 0) - 1;
|
|
119
|
+
m.set(e, t), t === 0 && p(e);
|
|
120
|
+
});
|
|
121
|
+
function g(e, t) {
|
|
122
|
+
let n = (m.get(t) || 0) + 1;
|
|
123
|
+
m.set(t, n), h && h.register(e, t, e);
|
|
124
|
+
}
|
|
125
|
+
function _(e) {
|
|
126
|
+
h && h.unregister(e);
|
|
127
|
+
}
|
|
128
|
+
function v(e, r, i = [], a = function() {}) {
|
|
129
|
+
let o = !1, s = new Proxy(a, {
|
|
130
|
+
get(t, a) {
|
|
131
|
+
if (f(o), a === n) return () => {
|
|
132
|
+
_(s), p(e), r.clear(), o = !0;
|
|
133
|
+
};
|
|
134
|
+
if (a === "then") {
|
|
135
|
+
if (i.length === 0) return { then: () => s };
|
|
136
|
+
let t = E(e, r, {
|
|
137
|
+
type: "GET",
|
|
138
|
+
path: i.map((e) => e.toString())
|
|
139
|
+
}).then(T);
|
|
140
|
+
return t.then.bind(t);
|
|
141
|
+
}
|
|
142
|
+
return v(e, r, [...i, a]);
|
|
143
|
+
},
|
|
144
|
+
set(t, n, a) {
|
|
145
|
+
f(o);
|
|
146
|
+
let [s, c] = w(a);
|
|
147
|
+
return E(e, r, {
|
|
148
|
+
type: "SET",
|
|
149
|
+
path: [...i, n].map((e) => e.toString()),
|
|
150
|
+
value: s
|
|
151
|
+
}, c).then(T);
|
|
152
|
+
},
|
|
153
|
+
apply(n, a, s) {
|
|
154
|
+
f(o);
|
|
155
|
+
let c = i[i.length - 1];
|
|
156
|
+
if (c === t) return E(e, r, { type: "ENDPOINT" }).then(T);
|
|
157
|
+
if (c === "bind") return v(e, r, i.slice(0, -1));
|
|
158
|
+
let [l, u] = b(s);
|
|
159
|
+
return E(e, r, {
|
|
160
|
+
type: "APPLY",
|
|
161
|
+
path: i.map((e) => e.toString()),
|
|
162
|
+
argumentList: l
|
|
163
|
+
}, u).then(T);
|
|
164
|
+
},
|
|
165
|
+
construct(t, n) {
|
|
166
|
+
f(o);
|
|
167
|
+
let [a, s] = b(n);
|
|
168
|
+
return E(e, r, {
|
|
169
|
+
type: "CONSTRUCT",
|
|
170
|
+
path: i.map((e) => e.toString()),
|
|
171
|
+
argumentList: a
|
|
172
|
+
}, s).then(T);
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
return g(s, e), s;
|
|
176
|
+
}
|
|
177
|
+
function y(e) {
|
|
178
|
+
return Array.prototype.concat.apply([], e);
|
|
179
|
+
}
|
|
180
|
+
function b(e) {
|
|
181
|
+
let t = e.map(w);
|
|
182
|
+
return [t.map((e) => e[0]), y(t.map((e) => e[1]))];
|
|
183
|
+
}
|
|
184
|
+
var x = /* @__PURE__ */ new WeakMap();
|
|
185
|
+
function S(e, t) {
|
|
186
|
+
return x.set(e, t), e;
|
|
187
|
+
}
|
|
188
|
+
function C(t) {
|
|
189
|
+
return Object.assign(t, { [e]: !0 });
|
|
190
|
+
}
|
|
191
|
+
function w(e) {
|
|
192
|
+
for (let [t, n] of o) if (n.canHandle(e)) {
|
|
193
|
+
let [r, i] = n.serialize(e);
|
|
194
|
+
return [{
|
|
195
|
+
type: "HANDLER",
|
|
196
|
+
name: t,
|
|
197
|
+
value: r
|
|
198
|
+
}, i];
|
|
199
|
+
}
|
|
200
|
+
return [{
|
|
201
|
+
type: "RAW",
|
|
202
|
+
value: e
|
|
203
|
+
}, x.get(e) || []];
|
|
204
|
+
}
|
|
205
|
+
function T(e) {
|
|
206
|
+
switch (e.type) {
|
|
207
|
+
case "HANDLER": return o.get(e.name).deserialize(e.value);
|
|
208
|
+
case "RAW": return e.value;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
function E(e, t, n, r) {
|
|
212
|
+
return new Promise((i) => {
|
|
213
|
+
let a = D();
|
|
214
|
+
t.set(a, i), e.start && e.start(), e.postMessage(Object.assign({ id: a }, n), r);
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
function D() {
|
|
218
|
+
return [
|
|
219
|
+
,
|
|
220
|
+
,
|
|
221
|
+
,
|
|
222
|
+
,
|
|
223
|
+
].fill(0).map(() => Math.floor(Math.random() * (2 ** 53 - 1)).toString(16)).join("-");
|
|
224
|
+
}
|
|
225
|
+
//#endregion
|
|
226
|
+
export { c as expose };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { a as e, c as t, i as n, m as r, o as i, s as a } from "./drag-in-QhL3zGC0.mjs";
|
|
2
|
+
import "./embedding-plugins.js";
|
|
3
|
+
//#region packages/common/src/utils/drag.ts
|
|
4
|
+
var o = (e, t, n = 0, r = 0) => {
|
|
5
|
+
let i = t.x + t.width + n, a = t.x - n, o = t.y + t.height + r, s = t.y - r, { x: c, y: l } = e;
|
|
6
|
+
return c >= a && c <= i && l >= s && l <= o;
|
|
7
|
+
}, s = (e, t, n, r = 0, i = 0) => {
|
|
8
|
+
if (!(!n || !n.hiddenIn && !n.visibleIn)) return n.visibleIn ? o({
|
|
9
|
+
x: e,
|
|
10
|
+
y: t
|
|
11
|
+
}, n.visibleIn, r, i) : n.hiddenIn ? !o({
|
|
12
|
+
x: e,
|
|
13
|
+
y: t
|
|
14
|
+
}, n.hiddenIn, -r, -i) : !1;
|
|
15
|
+
}, c = () => {
|
|
16
|
+
if (!document.getElementById("rml-drag-in-styles")) {
|
|
17
|
+
let t = document.createElement("style");
|
|
18
|
+
t.type = "text/css", t.id = r, t.innerHTML = `
|
|
19
|
+
${e}
|
|
20
|
+
${a}
|
|
21
|
+
`, document.head.appendChild(t);
|
|
22
|
+
}
|
|
23
|
+
}, l = ({ x: e, y: n }, r) => {
|
|
24
|
+
let i = document.getElementById(t);
|
|
25
|
+
if (!i) {
|
|
26
|
+
if (i = document.createElement("div"), r.ghost?.element) i.appendChild(r.ghost.element);
|
|
27
|
+
else {
|
|
28
|
+
let e = document.createElement("img");
|
|
29
|
+
e.src = r.ghost?.url || "https://res.cloudinary.com/roomle/image/upload/v1729679975/fallback_afpyqr.jpg", e.width = r.ghost?.width || 112, e.height = r.ghost?.height || 112, i.appendChild(e);
|
|
30
|
+
}
|
|
31
|
+
i.id = t, i.style.position = "fixed", i.style.top = "0", i.style.left = "0", i.style.willChange = "transform", i.style.transform = "translate3d(0, 0, 0)", i.style.zIndex = "9999", i.style.opacity = "0.5", s(e, n, r.ghost || {}, r.settings?.dragInOverlapX, r.settings?.dragInOverlapY) || (i.style.display = "none"), i.style.pointerEvents = "none", document.body.appendChild(i);
|
|
32
|
+
}
|
|
33
|
+
}, u = ({ x: e, y: r }, a) => {
|
|
34
|
+
let o = document.getElementById(t);
|
|
35
|
+
if (!o) return;
|
|
36
|
+
let c = a.ghost?.width, l = a.ghost?.height;
|
|
37
|
+
c === void 0 && (c = o.getBoundingClientRect().width || 112), l === void 0 && (l = o.getBoundingClientRect().height || 112);
|
|
38
|
+
let u = e - c / 2, d = r - l / 2;
|
|
39
|
+
o.style.transform = `translate3d(${u}px, ${d}px, 0)`, a.ghost && (s(e, r, a.ghost, a.settings?.dragInOverlapX, a.settings?.dragInOverlapY) ? o.style.animation != n && (o.style.animation = n) : o.style.animation != i && (o.style.animation = i));
|
|
40
|
+
}, d = class {
|
|
41
|
+
_dragGhostAnimationFrameId = null;
|
|
42
|
+
_dragGhostRemoveAnimationFrameId = null;
|
|
43
|
+
_dragGhostElement = null;
|
|
44
|
+
constructor(e = null) {
|
|
45
|
+
this._dragGhostElement = e;
|
|
46
|
+
}
|
|
47
|
+
updateDragGhost(e, t, n) {
|
|
48
|
+
this._dragGhostRemoveAnimationFrameId &&= (cancelAnimationFrame(this._dragGhostRemoveAnimationFrameId), null), !n.ghost?.external && n.ghost && (this._dragGhostAnimationFrameId ||= requestAnimationFrame(() => {
|
|
49
|
+
c();
|
|
50
|
+
let r = {
|
|
51
|
+
x: e,
|
|
52
|
+
y: t
|
|
53
|
+
};
|
|
54
|
+
!n.ghost && this._dragGhostElement && (n.ghost = {}), n.ghost && !n.ghost.element && this._dragGhostElement && (n.ghost.element = this._dragGhostElement), l(r, n), u(r, n), this._dragGhostAnimationFrameId = null;
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
removeDragGhost() {
|
|
58
|
+
this._dragGhostAnimationFrameId &&= (cancelAnimationFrame(this._dragGhostAnimationFrameId), null), this._dragGhostRemoveAnimationFrameId ||= requestAnimationFrame(() => {
|
|
59
|
+
let e = document.getElementById(t);
|
|
60
|
+
e && document.body.removeChild(e), this._dragGhostRemoveAnimationFrameId = null;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
//#endregion
|
|
65
|
+
export { d as t };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { a as e, c as t, i as n, m as r, o as i, s as a } from "./drag-in-BP_E53zb.mjs";
|
|
2
|
+
import "./embedding-plugins.min.js";
|
|
3
|
+
var o = (e, t, n = 0, r = 0) => {
|
|
4
|
+
let i = t.x + t.width + n, a = t.x - n, o = t.y + t.height + r, s = t.y - r, { x: c, y: l } = e;
|
|
5
|
+
return c >= a && c <= i && l >= s && l <= o;
|
|
6
|
+
}, s = (e, t, n, r = 0, i = 0) => {
|
|
7
|
+
if (n && (n.hiddenIn || n.visibleIn)) return n.visibleIn ? o({
|
|
8
|
+
x: e,
|
|
9
|
+
y: t
|
|
10
|
+
}, n.visibleIn, r, i) : !!n.hiddenIn && !o({
|
|
11
|
+
x: e,
|
|
12
|
+
y: t
|
|
13
|
+
}, n.hiddenIn, -r, -i);
|
|
14
|
+
}, c = class {
|
|
15
|
+
_dragGhostAnimationFrameId = null;
|
|
16
|
+
_dragGhostRemoveAnimationFrameId = null;
|
|
17
|
+
_dragGhostElement = null;
|
|
18
|
+
constructor(e = null) {
|
|
19
|
+
this._dragGhostElement = e;
|
|
20
|
+
}
|
|
21
|
+
updateDragGhost(o, c, l) {
|
|
22
|
+
this._dragGhostRemoveAnimationFrameId &&= (cancelAnimationFrame(this._dragGhostRemoveAnimationFrameId), null), l.ghost?.external || l.ghost && (this._dragGhostAnimationFrameId ||= requestAnimationFrame(() => {
|
|
23
|
+
(() => {
|
|
24
|
+
if (!document.getElementById("rml-drag-in-styles")) {
|
|
25
|
+
let t = document.createElement("style");
|
|
26
|
+
t.type = "text/css", t.id = r, t.innerHTML = `\n ${e}\n ${a}\n `, document.head.appendChild(t);
|
|
27
|
+
}
|
|
28
|
+
})();
|
|
29
|
+
let u = {
|
|
30
|
+
x: o,
|
|
31
|
+
y: c
|
|
32
|
+
};
|
|
33
|
+
!l.ghost && this._dragGhostElement && (l.ghost = {}), l.ghost && !l.ghost.element && this._dragGhostElement && (l.ghost.element = this._dragGhostElement), (({ x: e, y: n }, r) => {
|
|
34
|
+
let i = document.getElementById(t);
|
|
35
|
+
if (!i) {
|
|
36
|
+
if (i = document.createElement("div"), r.ghost?.element) i.appendChild(r.ghost.element);
|
|
37
|
+
else {
|
|
38
|
+
let e = document.createElement("img");
|
|
39
|
+
e.src = r.ghost?.url || "https://res.cloudinary.com/roomle/image/upload/v1729679975/fallback_afpyqr.jpg", e.width = r.ghost?.width || 112, e.height = r.ghost?.height || 112, i.appendChild(e);
|
|
40
|
+
}
|
|
41
|
+
i.id = t, i.style.position = "fixed", i.style.top = "0", i.style.left = "0", i.style.willChange = "transform", i.style.transform = "translate3d(0, 0, 0)", i.style.zIndex = "9999", i.style.opacity = "0.5", s(e, n, r.ghost || {}, r.settings?.dragInOverlapX, r.settings?.dragInOverlapY) || (i.style.display = "none"), i.style.pointerEvents = "none", document.body.appendChild(i);
|
|
42
|
+
}
|
|
43
|
+
})(u, l), (({ x: e, y: r }, a) => {
|
|
44
|
+
let o = document.getElementById(t);
|
|
45
|
+
if (!o) return;
|
|
46
|
+
let c = a.ghost?.width, l = a.ghost?.height;
|
|
47
|
+
c === void 0 && (c = o.getBoundingClientRect().width || 112), l === void 0 && (l = o.getBoundingClientRect().height || 112);
|
|
48
|
+
let u = e - c / 2, d = r - l / 2;
|
|
49
|
+
o.style.transform = `translate3d(${u}px, ${d}px, 0)`, a.ghost && (s(e, r, a.ghost, a.settings?.dragInOverlapX, a.settings?.dragInOverlapY) ? o.style.animation != n && (o.style.animation = n) : o.style.animation != i && (o.style.animation = i));
|
|
50
|
+
})(u, l), this._dragGhostAnimationFrameId = null;
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
removeDragGhost() {
|
|
54
|
+
this._dragGhostAnimationFrameId &&= (cancelAnimationFrame(this._dragGhostAnimationFrameId), null), this._dragGhostRemoveAnimationFrameId ||= requestAnimationFrame(() => {
|
|
55
|
+
let e = document.getElementById(t);
|
|
56
|
+
e && document.body.removeChild(e), this._dragGhostRemoveAnimationFrameId = null;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
export { c as t };
|