@roomle/embedding-lib 5.25.0-alpha.1 → 5.25.0-alpha.10
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/docs/md/web/embedding/CHANGELOG.md +2 -28
- package/drag-in-DTA1FCDc.mjs +1 -0
- package/drag-in-DuufO5eB.mjs +138 -0
- package/from-custom-view-BdnViEhf.mjs +163 -0
- package/from-custom-view-DIYHP31u.mjs +1 -0
- package/from-website-CcDHgCCy.mjs +1 -0
- package/from-website-CktA6Icy.mjs +201 -0
- package/package.json +1 -1
- package/packages/embedding-lib/src/examples/homag-intelligence-example.d.ts +9 -0
- package/packages/embedding-lib/src/examples/utils/homag-intelligence/create-catalog.d.ts +1 -0
- package/packages/embedding-lib/src/examples/utils/homag-intelligence/default-api-options.d.ts +43 -0
- package/packages/embedding-lib/src/examples/utils/homag-intelligence/dom-helper.d.ts +13 -0
- package/packages/embedding-lib/src/examples/utils/homag-intelligence/drag-in.d.ts +3 -0
- package/packages/embedding-lib/src/examples/utils/homag-intelligence/overlay.d.ts +2 -0
- package/packages/embedding-lib/src/examples/utils/homag-intelligence/state.d.ts +14 -0
- package/packages/embedding-lib/src/examples/utils/homag-intelligence/util.d.ts +19 -0
- package/packages/embedding-lib/src/plugins/strategy/from-custom-view.d.ts +1 -0
- package/packages/web-sdk/packages/common-core/src/input/input-manager.d.ts +1 -0
- package/packages/web-sdk/packages/common-core/src/main.d.ts +2 -2
- package/packages/web-sdk/packages/common-core/src/static-files/environment-maps.d.ts +6 -7
- package/packages/web-sdk/packages/common-core/src/static-files/libs.d.ts +3 -1
- package/packages/web-sdk/packages/common-core/src/static-files/light-settings.d.ts +8 -6
- package/packages/web-sdk/packages/common-core/src/static-files/luts.d.ts +11 -9
- package/packages/web-sdk/packages/common-core/src/static-files/roomle-core.d.ts +8 -6
- package/packages/web-sdk/packages/common-core/src/utils/common-utils.d.ts +0 -1
- package/packages/web-sdk/packages/common-core/src/utils/init-data.d.ts +2 -0
- package/packages/web-sdk/packages/common-core/src/utils/shims.d.ts +6 -0
- package/packages/web-sdk/packages/common-core/src/webgl/renderer/pass/gbuffer-render-pass.d.ts +1 -1
- package/packages/web-sdk/packages/configurator-core/src/configurator.d.ts +1 -1
- package/packages/web-sdk/packages/configurator-core/src/roomle-configurator.d.ts +13 -0
- package/packages/web-sdk/packages/configurator-core/src/static-files/fonts.d.ts +4 -2
- package/packages/web-sdk/packages/configurator-core/src/static-files/geometries.d.ts +3 -1
- package/packages/web-sdk/packages/configurator-core/src/static-files/settings.d.ts +3 -1
- package/packages/web-sdk/packages/configurator-core/src/static-files/textures.d.ts +3 -1
- package/packages/web-sdk/packages/configurator-core/src/utils/animation/animation-value-map.d.ts +1 -0
- package/packages/web-sdk/packages/configurator-core/src/utils/component-dimensioning-helper.d.ts +3 -3
- package/packages/web-sdk/packages/configurator-core/src/utils/component-raycast-helper.d.ts +1 -1
- package/packages/web-sdk/packages/configurator-core/src/utils/dimensioning-helper.d.ts +1 -0
- package/packages/web-sdk/packages/configurator-core/src/utils/test-helpers/utils.d.ts +2 -2
- package/packages/web-sdk/packages/configurator-core/src/webgl/configurator-scene-manager.d.ts +4 -0
- package/packages/web-sdk/packages/glb-viewer-core/src/glb-viewer.d.ts +1 -1
- package/packages/web-sdk/packages/homag-intelligence/src/api.d.ts +22 -0
- package/packages/web-sdk/packages/homag-intelligence/src/callbacks.d.ts +37 -0
- package/packages/web-sdk/packages/homag-intelligence/src/emulator.d.ts +101 -0
- package/packages/web-sdk/packages/homag-intelligence/src/homag-intelligence.d.ts +28 -0
- package/packages/web-sdk/packages/homag-intelligence/src/loader.d.ts +24 -0
- package/packages/web-sdk/packages/homag-intelligence/src/model/oc-scripts-domain.model.d.ts +312 -0
- package/packages/web-sdk/packages/homag-intelligence/src/orders.d.ts +39 -0
- package/packages/web-sdk/packages/homag-intelligence/src/rml-plugin.d.ts +3 -0
- package/packages/web-sdk/packages/homag-intelligence/src/util.d.ts +5 -0
- package/packages/web-sdk/packages/material-viewer/src/material-viewer.d.ts +1 -1
- package/packages/web-sdk/packages/planner-core/src/planner.d.ts +1 -1
- package/packages/web-sdk/packages/planner-core/src/roomle-planner.d.ts +13 -1
- package/packages/web-sdk/packages/planner-core/src/webgl/planner-scene-manager.d.ts +1 -0
- package/packages/web-sdk/packages/test-helpers/unit/global-setup.d.ts +1 -1
- package/packages/web-sdk/packages/tools-core/src/tools-core.d.ts +1 -1
- package/packages/web-sdk/packages/typings/external-objects.d.ts +8 -0
- package/packages/web-sdk/packages/typings/planner.d.ts +1 -1
- package/packages/web-sdk/packages/workers/src/static-files/workers.d.ts +4 -2
- package/roomle-embedding-lib.es.js +306 -316
- package/roomle-embedding-lib.es.min.js +1 -1
- package/roomle-embedding-lib.umd.js +17 -17
- package/roomle-embedding-lib.umd.min.js +1 -1
- package/src/common/components/collection-view/-utils/collection-view-dynamic-components.d.ts +1 -1
- package/src/common/composables/use-configurator-api.d.ts +1 -1
- package/src/common/composables/use-core-instances.d.ts +1 -1
- package/src/common/composables/use-static-item-parameters.d.ts +1 -1
- package/src/common/utils/helper.d.ts +1 -1
- package/src/common/utils/parameters.d.ts +0 -1
- package/src/common/utils/types.d.ts +0 -7
- package/src/configurator/business-logic/roomle-sdk-wrapper.d.ts +2 -1
- package/src/configurator/embedding/exposed-api.d.ts +7 -1
- package/src/planner/components/overlays/ProductSettings.vue.d.ts +2 -2
- package/src/planner/components/overlays/product-settings/ProductPositions.vue.d.ts +2 -2
- package/src/planner/components/overlays/product-settings/ProductRotation.vue.d.ts +2 -2
- package/src/planner/components/overlays/product-settings/ProductSettingsInfos.vue.d.ts +2 -2
- package/src/planner/components/overlays/product-settings/ProductSize.vue.d.ts +2 -2
- package/src/planner/components/overlays/product-settings/ProductXYZChanger.vue.d.ts +2 -2
- package/src/planner/components/overlays/rooms/ConstructionVariants.vue.d.ts +2 -2
- package/src/planner/components/overlays/rooms/DoorParametersSetting.vue.d.ts +7 -7
- package/src/planner/components/overlays/rooms/ElementLengthScaling.vue.d.ts +1 -1
- package/src/planner/components/overlays/rooms/WindowParametersSetting.vue.d.ts +2 -2
- package/src/planner/components/utils/AssureConfiguratorHandlers.vue.d.ts +1 -1
- package/src/planner/components/utils/AssureSdkHandlers.vue.d.ts +1 -1
- package/src/planner/utils/planner-sidebar.d.ts +1 -1
- package/touch-drag-B5zCf87J.mjs +1 -0
- package/touch-drag-DXJTOrk5.mjs +146 -0
- package/drag-in-BWioG4OL.mjs +0 -1
- package/drag-in-D5QSQ86J.mjs +0 -141
- package/from-custom-view-BcXfK7VI.mjs +0 -163
- package/from-custom-view-DRAqJ-yY.mjs +0 -1
- package/from-website-B3kPg18n.mjs +0 -207
- package/from-website-DR93OSJD.mjs +0 -1
- package/packages/web-sdk/packages/acceptance-tests/src/utils/async-acceptance-test.d.ts +0 -3
- package/packages/web-sdk/packages/configurator-core/__acceptance__/boot.d.ts +0 -1
- package/packages/web-sdk/packages/vite-plugins/vite-plugin-auto-workers.d.ts +0 -8
- package/packages/web-sdk/packages/vite-plugins/vite-plugin-bundle-sw.d.ts +0 -10
- package/touch-drag-BEct6jbW.mjs +0 -1
- package/touch-drag-DNDPwZ-_.mjs +0 -149
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
var F = Object.defineProperty;
|
|
2
|
-
var M = (r, e, t) => e in r ? F(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
-
var l = (r, e, t) => M(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { g as C, e as G, a as E, i as N, T as O } from "./touch-drag-DNDPwZ-_.mjs";
|
|
5
|
-
import { R as f, a as p, b as w, c as B, d as Y, e as L, f as b, g as x, h as S, i as A, j as R, k as H } from "./drag-in-D5QSQ86J.mjs";
|
|
6
|
-
const T = (r, e, t = 0, n = 0) => {
|
|
7
|
-
const s = e.x + e.width + t, i = e.x - t, a = e.y + e.height + n, d = e.y - n, { x: o, y: h } = r;
|
|
8
|
-
return o >= i && o <= s && h >= d && h <= a;
|
|
9
|
-
}, v = (r, e, t, n = 0, s = 0) => {
|
|
10
|
-
if (!(!t || !t.hiddenIn && !t.visibleIn))
|
|
11
|
-
return t.visibleIn ? T(
|
|
12
|
-
{ x: r, y: e },
|
|
13
|
-
t.visibleIn,
|
|
14
|
-
n,
|
|
15
|
-
s
|
|
16
|
-
) : t.hiddenIn ? !T(
|
|
17
|
-
{ x: r, y: e },
|
|
18
|
-
t.hiddenIn,
|
|
19
|
-
-n,
|
|
20
|
-
-s
|
|
21
|
-
) : !1;
|
|
22
|
-
}, U = () => {
|
|
23
|
-
if (!!!document.getElementById(p)) {
|
|
24
|
-
const e = document.createElement("style");
|
|
25
|
-
e.type = "text/css", e.id = p, e.innerHTML = `
|
|
26
|
-
${w}
|
|
27
|
-
${B}
|
|
28
|
-
`, document.head.appendChild(e);
|
|
29
|
-
}
|
|
30
|
-
}, P = ({ x: r, y: e }, t) => {
|
|
31
|
-
var s, i, a, d, o, h;
|
|
32
|
-
let n = document.getElementById(f);
|
|
33
|
-
if (!n) {
|
|
34
|
-
if (n = document.createElement("div"), (s = t.ghost) != null && s.element)
|
|
35
|
-
n.appendChild(t.ghost.element);
|
|
36
|
-
else {
|
|
37
|
-
const g = document.createElement("img");
|
|
38
|
-
g.src = ((i = t.ghost) == null ? void 0 : i.url) || Y, g.width = ((a = t.ghost) == null ? void 0 : a.width) || L, g.height = ((d = t.ghost) == null ? void 0 : d.height) || b, n.appendChild(g);
|
|
39
|
-
}
|
|
40
|
-
n.id = f, n.style.position = "fixed", n.style.top = "0", n.style.left = "0", n.style.willChange = "transform", n.style.transform = "translate3d(0, 0, 0)", n.style.zIndex = "9999", n.style.opacity = "0.5", v(
|
|
41
|
-
r,
|
|
42
|
-
e,
|
|
43
|
-
t.ghost || {},
|
|
44
|
-
(o = t.settings) == null ? void 0 : o.dragInOverlapX,
|
|
45
|
-
(h = t.settings) == null ? void 0 : h.dragInOverlapY
|
|
46
|
-
) || (n.style.display = "none"), n.style.pointerEvents = "none", document.body.appendChild(n);
|
|
47
|
-
}
|
|
48
|
-
}, X = ({ x: r, y: e }, t) => {
|
|
49
|
-
var o, h, g, c;
|
|
50
|
-
const n = document.getElementById(f);
|
|
51
|
-
if (!n)
|
|
52
|
-
return;
|
|
53
|
-
let s = (o = t.ghost) == null ? void 0 : o.width, i = (h = t.ghost) == null ? void 0 : h.height;
|
|
54
|
-
typeof s > "u" && (s = n.getBoundingClientRect().width || L), typeof i > "u" && (i = n.getBoundingClientRect().height || b);
|
|
55
|
-
const a = r - s / 2, d = e - i / 2;
|
|
56
|
-
n.style.transform = `translate3d(${a}px, ${d}px, 0)`, t.ghost && (v(
|
|
57
|
-
r,
|
|
58
|
-
e,
|
|
59
|
-
t.ghost,
|
|
60
|
-
(g = t.settings) == null ? void 0 : g.dragInOverlapX,
|
|
61
|
-
(c = t.settings) == null ? void 0 : c.dragInOverlapY
|
|
62
|
-
) ? n.style.animation != x && (n.style.animation = x) : n.style.animation != S && (n.style.animation = S));
|
|
63
|
-
};
|
|
64
|
-
class k {
|
|
65
|
-
constructor(e = null) {
|
|
66
|
-
l(this, "_dragGhostAnimationFrameId", null);
|
|
67
|
-
l(this, "_dragGhostRemoveAnimationFrameId", null);
|
|
68
|
-
l(this, "_dragGhostElement", null);
|
|
69
|
-
this._dragGhostElement = e;
|
|
70
|
-
}
|
|
71
|
-
updateDragGhost(e, t, n) {
|
|
72
|
-
var s;
|
|
73
|
-
this._dragGhostRemoveAnimationFrameId && (cancelAnimationFrame(this._dragGhostRemoveAnimationFrameId), this._dragGhostRemoveAnimationFrameId = null), !((s = n.ghost) != null && s.external) && n.ghost && (this._dragGhostAnimationFrameId || (this._dragGhostAnimationFrameId = requestAnimationFrame(() => {
|
|
74
|
-
U();
|
|
75
|
-
const i = { x: e, y: t };
|
|
76
|
-
!n.ghost && this._dragGhostElement && (n.ghost = {}), n.ghost && !n.ghost.element && this._dragGhostElement && (n.ghost.element = this._dragGhostElement), P(i, n), X(i, n), this._dragGhostAnimationFrameId = null;
|
|
77
|
-
})));
|
|
78
|
-
}
|
|
79
|
-
removeDragGhost() {
|
|
80
|
-
this._dragGhostAnimationFrameId && (cancelAnimationFrame(this._dragGhostAnimationFrameId), this._dragGhostAnimationFrameId = null), this._dragGhostRemoveAnimationFrameId || (this._dragGhostRemoveAnimationFrameId = requestAnimationFrame(() => {
|
|
81
|
-
const e = document.getElementById(f);
|
|
82
|
-
e && document.body.removeChild(e), this._dragGhostRemoveAnimationFrameId = null;
|
|
83
|
-
}));
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
class z {
|
|
87
|
-
constructor(e, t, n) {
|
|
88
|
-
l(this, "_options", {});
|
|
89
|
-
l(this, "_instance");
|
|
90
|
-
l(this, "_mainDomElement");
|
|
91
|
-
l(this, "_currentDrag", {});
|
|
92
|
-
l(this, "_currentTouch", null);
|
|
93
|
-
l(this, "_firefoxDragPosition", { x: 0, y: 0 });
|
|
94
|
-
l(this, "_onBeforeUpdateDrag", () => ({}));
|
|
95
|
-
l(this, "isDragging", !1);
|
|
96
|
-
l(this, "_firefoxFallback", (e) => {
|
|
97
|
-
if (!this._currentDrag.event)
|
|
98
|
-
return;
|
|
99
|
-
e.preventDefault();
|
|
100
|
-
const t = e || window.event;
|
|
101
|
-
this._firefoxDragPosition.x = t.pageX || 0, this._firefoxDragPosition.y = t.pageY || 0;
|
|
102
|
-
});
|
|
103
|
-
this._instance = e, this._mainDomElement = t, this._options = n || {}, this._firefoxFallback = this._firefoxFallback.bind(this), document.addEventListener("dragover", this._firefoxFallback);
|
|
104
|
-
}
|
|
105
|
-
beforeUpdateGhost(e) {
|
|
106
|
-
this._onBeforeUpdateDrag = e;
|
|
107
|
-
}
|
|
108
|
-
dragStart(e, t, n = "rml_id") {
|
|
109
|
-
const s = this._mainDomElement.parentNode;
|
|
110
|
-
if (C(s).position !== "relative") {
|
|
111
|
-
console.warn(
|
|
112
|
-
"Parent of iframe should have position relative, otherwise drag-in can not detect the x/y coordinates correctly"
|
|
113
|
-
);
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
this._mainDomElement.style.pointerEvents = "none";
|
|
117
|
-
let a = s.querySelector(
|
|
118
|
-
"." + A
|
|
119
|
-
);
|
|
120
|
-
a || (a = document.createElement("div"), a.classList.add(A), s.appendChild(a)), a.classList.remove(R.DISPLAY_NONE), t.target.getAttribute("draggable") || console.warn(
|
|
121
|
-
`Draggable not detected correctly! Did you add draggable="true" to the element? In Sarafi only 'draggable' is too less`
|
|
122
|
-
);
|
|
123
|
-
const o = s.querySelector(
|
|
124
|
-
"." + H
|
|
125
|
-
);
|
|
126
|
-
this._currentDrag.event = t;
|
|
127
|
-
const h = t.target, g = h.cloneNode(!0), c = h.getBoundingClientRect();
|
|
128
|
-
g.style.width = `${c.width}px`, g.style.height = `${c.height}px`, this._currentDrag.ghost = new k(g), this._currentDrag.offset || (this._currentDrag.offset = { x: 0, y: 0 });
|
|
129
|
-
const { clientX: _, clientY: D } = G(
|
|
130
|
-
t,
|
|
131
|
-
this._firefoxDragPosition
|
|
132
|
-
);
|
|
133
|
-
this._currentDrag.offset.x = _ - c.left, this._currentDrag.offset.y = D - c.top, t instanceof DragEvent && t.dataTransfer && t.dataTransfer.setDragImage && t.dataTransfer.setDragImage(o, 0, 0);
|
|
134
|
-
const { x: y, y: u } = E(
|
|
135
|
-
s,
|
|
136
|
-
this._currentDrag.event || t,
|
|
137
|
-
this._firefoxDragPosition
|
|
138
|
-
), m = Math.max(1, y), I = Math.max(1, u);
|
|
139
|
-
this.isDragging = !0, this._instance.dragInObject(e, m, I, n);
|
|
140
|
-
}
|
|
141
|
-
dragUpdate(e) {
|
|
142
|
-
var u;
|
|
143
|
-
const t = this._mainDomElement.parentNode, { x: n, y: s } = E(t, e, this._firefoxDragPosition);
|
|
144
|
-
if (n === 0 && s === 0)
|
|
145
|
-
return;
|
|
146
|
-
const i = Math.max(1, n), a = Math.max(1, s);
|
|
147
|
-
if (i === 1 && a === 1)
|
|
148
|
-
return;
|
|
149
|
-
let d = i, o = a;
|
|
150
|
-
if (N(e)) {
|
|
151
|
-
const m = ((u = this._options.settings) == null ? void 0 : u.fingerSize) || 0;
|
|
152
|
-
d = Math.max(2, i + m), o = Math.max(2, a - m);
|
|
153
|
-
}
|
|
154
|
-
const {
|
|
155
|
-
x: h,
|
|
156
|
-
y: g,
|
|
157
|
-
options: c
|
|
158
|
-
} = this._onBeforeUpdateDrag(d, o, {}), _ = c || { settings: {}, ghost: {} };
|
|
159
|
-
_.ghost || (_.ghost = {}), _.ghost.visibleIn && _.ghost.hiddenIn || (_.ghost.hiddenIn = this._mainDomElement.getBoundingClientRect());
|
|
160
|
-
const D = typeof h == "number" ? h : d, y = typeof g == "number" ? g : o;
|
|
161
|
-
if (this._currentDrag.ghost) {
|
|
162
|
-
const { clientX: m, clientY: I } = G(
|
|
163
|
-
e,
|
|
164
|
-
this._firefoxDragPosition
|
|
165
|
-
);
|
|
166
|
-
this._currentDrag.ghost.updateDragGhost(m, I, _);
|
|
167
|
-
}
|
|
168
|
-
this._instance.updateDrag(D, y, {});
|
|
169
|
-
}
|
|
170
|
-
dragEnd() {
|
|
171
|
-
this._mainDomElement.style.pointerEvents = "all";
|
|
172
|
-
const e = this._mainDomElement.parentNode;
|
|
173
|
-
this.isDragging = !1, this._instance.dragInObjectEnd(), this._currentDrag.ghost && (this._currentDrag.ghost.removeDragGhost(), this._currentDrag.ghost = null), this._currentDrag = {}, this._firefoxDragPosition = { x: 0, y: 0 };
|
|
174
|
-
const t = e.querySelector(
|
|
175
|
-
"." + A
|
|
176
|
-
);
|
|
177
|
-
t && t.classList.add(R.DISPLAY_NONE);
|
|
178
|
-
}
|
|
179
|
-
touchStart(e, t, n = "rml_id") {
|
|
180
|
-
var a, d, o, h;
|
|
181
|
-
t.preventDefault();
|
|
182
|
-
const s = (g, c) => {
|
|
183
|
-
this.dragStart(e, c, n);
|
|
184
|
-
}, i = {};
|
|
185
|
-
typeof ((d = (a = this._options) == null ? void 0 : a.settings) == null ? void 0 : d.touchDragDelay) == "number" && (i.delay = this._options.settings.touchDragDelay), (h = (o = this._options) == null ? void 0 : o.settings) != null && h.touchDragEpsilon && (i.epsilon = this._options.settings.touchDragEpsilon), this._currentTouch = new O(
|
|
186
|
-
void 0,
|
|
187
|
-
{
|
|
188
|
-
onTouchDragStart: s
|
|
189
|
-
},
|
|
190
|
-
i
|
|
191
|
-
), this._currentTouch.onStart(t);
|
|
192
|
-
}
|
|
193
|
-
touchMove(e) {
|
|
194
|
-
this._currentTouch && this._currentTouch.onMove(e), this._currentDrag.event && this.dragUpdate(e);
|
|
195
|
-
}
|
|
196
|
-
touchEnd() {
|
|
197
|
-
this._currentTouch && this._currentTouch.onEnd(), this._currentTouch = null, this.dragEnd();
|
|
198
|
-
}
|
|
199
|
-
dispose() {
|
|
200
|
-
document.removeEventListener("dragover", this._firefoxFallback);
|
|
201
|
-
}
|
|
202
|
-
releaseInput(e) {
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
export {
|
|
206
|
-
z as DragInFromWebsiteStrategy
|
|
207
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t=Object.defineProperty,e=(e,n,i)=>((e,n,i)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i)(e,"symbol"!=typeof n?n+"":n,i);import{g as n,e as i,a as s,i as o,T as a}from"./touch-drag-BEct6jbW.mjs";import{R as r,a as h,b as l,c as d,d as g,e as m,f as c,g as u,h as _,i as f,j as p,k as v}from"./drag-in-BWioG4OL.mjs";const y=(t,e,n=0,i=0)=>{const s=e.x+e.width+n,o=e.x-n,a=e.y+e.height+i,r=e.y-i,{x:h,y:l}=t;return h>=o&&h<=s&&l>=r&&l<=a},D=(t,e,n,i=0,s=0)=>{if(n&&(n.hiddenIn||n.visibleIn))return n.visibleIn?y({x:t,y:e},n.visibleIn,i,s):!!n.hiddenIn&&!y({x:t,y:e},n.hiddenIn,-i,-s)};class x{constructor(t=null){e(this,"_dragGhostAnimationFrameId",null),e(this,"_dragGhostRemoveAnimationFrameId",null),e(this,"_dragGhostElement",null),this._dragGhostElement=t}updateDragGhost(t,e,n){var i;this._dragGhostRemoveAnimationFrameId&&(cancelAnimationFrame(this._dragGhostRemoveAnimationFrameId),this._dragGhostRemoveAnimationFrameId=null),(null==(i=n.ghost)||!i.external)&&n.ghost&&(this._dragGhostAnimationFrameId||(this._dragGhostAnimationFrameId=requestAnimationFrame(()=>{(()=>{if(!document.getElementById(h)){const t=document.createElement("style");t.type="text/css",t.id=h,t.innerHTML=`\n ${l}\n ${d}\n `,document.head.appendChild(t)}})();const i={x:t,y:e};!n.ghost&&this._dragGhostElement&&(n.ghost={}),n.ghost&&!n.ghost.element&&this._dragGhostElement&&(n.ghost.element=this._dragGhostElement),(({x:t,y:e},n)=>{var i,s,o,a,h,l;let d=document.getElementById(r);if(!d){if(d=document.createElement("div"),null!=(i=n.ghost)&&i.element)d.appendChild(n.ghost.element);else{const t=document.createElement("img");t.src=(null==(s=n.ghost)?void 0:s.url)||g,t.width=(null==(o=n.ghost)?void 0:o.width)||m,t.height=(null==(a=n.ghost)?void 0:a.height)||c,d.appendChild(t)}d.id=r,d.style.position="fixed",d.style.top="0",d.style.left="0",d.style.willChange="transform",d.style.transform="translate3d(0, 0, 0)",d.style.zIndex="9999",d.style.opacity="0.5",D(t,e,n.ghost||{},null==(h=n.settings)?void 0:h.dragInOverlapX,null==(l=n.settings)?void 0:l.dragInOverlapY)||(d.style.display="none"),d.style.pointerEvents="none",document.body.appendChild(d)}})(i,n),(({x:t,y:e},n)=>{var i,s,o,a;const h=document.getElementById(r);if(!h)return;let l=null==(i=n.ghost)?void 0:i.width,d=null==(s=n.ghost)?void 0:s.height;typeof l>"u"&&(l=h.getBoundingClientRect().width||m),typeof d>"u"&&(d=h.getBoundingClientRect().height||c);const g=t-l/2,f=e-d/2;h.style.transform=`translate3d(${g}px, ${f}px, 0)`,n.ghost&&(D(t,e,n.ghost,null==(o=n.settings)?void 0:o.dragInOverlapX,null==(a=n.settings)?void 0:a.dragInOverlapY)?h.style.animation!=u&&(h.style.animation=u):h.style.animation!=_&&(h.style.animation=_))})(i,n),this._dragGhostAnimationFrameId=null})))}removeDragGhost(){this._dragGhostAnimationFrameId&&(cancelAnimationFrame(this._dragGhostAnimationFrameId),this._dragGhostAnimationFrameId=null),this._dragGhostRemoveAnimationFrameId||(this._dragGhostRemoveAnimationFrameId=requestAnimationFrame(()=>{const t=document.getElementById(r);t&&document.body.removeChild(t),this._dragGhostRemoveAnimationFrameId=null}))}}class I{constructor(t,n,i){e(this,"_options",{}),e(this,"_instance"),e(this,"_mainDomElement"),e(this,"_currentDrag",{}),e(this,"_currentTouch",null),e(this,"_firefoxDragPosition",{x:0,y:0}),e(this,"_onBeforeUpdateDrag",()=>({})),e(this,"isDragging",!1),e(this,"_firefoxFallback",t=>{if(!this._currentDrag.event)return;t.preventDefault();const e=t||window.event;this._firefoxDragPosition.x=e.pageX||0,this._firefoxDragPosition.y=e.pageY||0}),this._instance=t,this._mainDomElement=n,this._options=i||{},this._firefoxFallback=this._firefoxFallback.bind(this),document.addEventListener("dragover",this._firefoxFallback)}beforeUpdateGhost(t){this._onBeforeUpdateDrag=t}dragStart(t,e,o="rml_id"){const a=this._mainDomElement.parentNode;if("relative"!==n(a).position)return;this._mainDomElement.style.pointerEvents="none";let r=a.querySelector("."+f);r||(r=document.createElement("div"),r.classList.add(f),a.appendChild(r)),r.classList.remove(p.DISPLAY_NONE),e.target.getAttribute("draggable");const h=a.querySelector("."+v);this._currentDrag.event=e;const l=e.target,d=l.cloneNode(!0),g=l.getBoundingClientRect();d.style.width=`${g.width}px`,d.style.height=`${g.height}px`,this._currentDrag.ghost=new x(d),this._currentDrag.offset||(this._currentDrag.offset={x:0,y:0});const{clientX:m,clientY:c}=i(e,this._firefoxDragPosition);this._currentDrag.offset.x=m-g.left,this._currentDrag.offset.y=c-g.top,e instanceof DragEvent&&e.dataTransfer&&e.dataTransfer.setDragImage&&e.dataTransfer.setDragImage(h,0,0);const{x:u,y:_}=s(a,this._currentDrag.event||e,this._firefoxDragPosition),y=Math.max(1,u),D=Math.max(1,_);this.isDragging=!0,this._instance.dragInObject(t,y,D,o)}dragUpdate(t){var e;const n=this._mainDomElement.parentNode,{x:a,y:r}=s(n,t,this._firefoxDragPosition);if(0===a&&0===r)return;const h=Math.max(1,a),l=Math.max(1,r);if(1===h&&1===l)return;let d=h,g=l;if(o(t)){const t=(null==(e=this._options.settings)?void 0:e.fingerSize)||0;d=Math.max(2,h+t),g=Math.max(2,l-t)}const{x:m,y:c,options:u}=this._onBeforeUpdateDrag(d,g,{}),_=u||{settings:{},ghost:{}};_.ghost||(_.ghost={}),_.ghost.visibleIn&&_.ghost.hiddenIn||(_.ghost.hiddenIn=this._mainDomElement.getBoundingClientRect());const f="number"==typeof m?m:d,p="number"==typeof c?c:g;if(this._currentDrag.ghost){const{clientX:e,clientY:n}=i(t,this._firefoxDragPosition);this._currentDrag.ghost.updateDragGhost(e,n,_)}this._instance.updateDrag(f,p,{})}dragEnd(){this._mainDomElement.style.pointerEvents="all";const t=this._mainDomElement.parentNode;this.isDragging=!1,this._instance.dragInObjectEnd(),this._currentDrag.ghost&&(this._currentDrag.ghost.removeDragGhost(),this._currentDrag.ghost=null),this._currentDrag={},this._firefoxDragPosition={x:0,y:0};const e=t.querySelector("."+f);e&&e.classList.add(p.DISPLAY_NONE)}touchStart(t,e,n="rml_id"){var i,s,o,r;e.preventDefault();const h={};"number"==typeof(null==(s=null==(i=this._options)?void 0:i.settings)?void 0:s.touchDragDelay)&&(h.delay=this._options.settings.touchDragDelay),null!=(r=null==(o=this._options)?void 0:o.settings)&&r.touchDragEpsilon&&(h.epsilon=this._options.settings.touchDragEpsilon),this._currentTouch=new a(void 0,{onTouchDragStart:(e,i)=>{this.dragStart(t,i,n)}},h),this._currentTouch.onStart(e)}touchMove(t){this._currentTouch&&this._currentTouch.onMove(t),this._currentDrag.event&&this.dragUpdate(t)}touchEnd(){this._currentTouch&&this._currentTouch.onEnd(),this._currentTouch=null,this.dragEnd()}dispose(){document.removeEventListener("dragover",this._firefoxFallback)}releaseInput(t){}}export{I as DragInFromWebsiteStrategy};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
interface ServiceWorkerHmrPluginConfig {
|
|
2
|
-
inputFile: string;
|
|
3
|
-
outputFile: string;
|
|
4
|
-
}
|
|
5
|
-
declare const bundleSwPlugin: (config: ServiceWorkerHmrPluginConfig[]) => {
|
|
6
|
-
apply: string;
|
|
7
|
-
enforce: string;
|
|
8
|
-
configResolved(): void;
|
|
9
|
-
};
|
|
10
|
-
export default bundleSwPlugin;
|
package/touch-drag-BEct6jbW.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t=Object.defineProperty,e=(e,i,n)=>((e,i,n)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n)(e,"symbol"!=typeof i?i+"":i,n);class i{constructor(t=16){e(this,"_computedStyleCache",new Map),e(this,"_maxLifetime",16),e(this,"_cacheCleanInterval",null),this._maxLifetime=t}get(t){const e=this._computedStyleCache.get(t),i=Date.now();if(e&&i-e.updated<this._maxLifetime)return e.style;const n=getComputedStyle(t);return this._computedStyleCache.set(t,{style:n,updated:i}),this._cacheCleanInterval||(this._cacheCleanInterval=setInterval(()=>this._cleanUpCache,Math.max(1e3*this._maxLifetime,5e3))),n}_cleanUpCache(){const t=Date.now();for(const[e,{updated:i}]of this._computedStyleCache.entries())t-i>=this._maxLifetime&&this._computedStyleCache.delete(e);0===this._computedStyleCache.size&&this._cacheCleanInterval&&(clearInterval(this._cacheCleanInterval),this._cacheCleanInterval=null)}}const n=t=>window.TouchEvent&&t instanceof window.TouchEvent;let s;const c=t=>(s||(s=new i),s.get(t)),h=(t,e,i)=>{const n=parseFloat(t),s=window.devicePixelRatio||1;if("px"===e)return n;if("%"===e)return n/100*(i===document.documentElement?window.innerWidth:i.offsetWidth);if("rem"===e)return n*parseFloat(c(document.documentElement).fontSize);if("em"===e)return n*parseFloat(c(i).fontSize);if("vh"===e||"vw"===e||"vmin"===e||"vmax"===e)return n/100*{vh:window.innerHeight,vw:window.innerWidth,vmin:Math.min(window.innerWidth,window.innerHeight),vmax:Math.max(window.innerWidth,window.innerHeight)}[e];const h={cm:37.7952755906,mm:3.77952755906,in:96};return e in h?n*h[e]*s:0},l=(t,e,i={x:0,y:0})=>{const n=t.getBoundingClientRect(),s=c(t).transform;let l=0,a=0;if("none"!==s){const e=/translate\(\s*([-+]?\d*\.?\d+|\d+)(px|%)?,?\s*([-+]?\d*\.?\d+|\d+)?(px|%)?\s*\)/,i=s.match(e);i&&(l=h(i[1],i[2],t),a=h(i[3],i[4],t))}const{clientX:r,clientY:u}=o(e,i);return{x:r-n.left-l+t.scrollLeft,y:u-n.top-a+t.scrollTop}},o=(t,e=null)=>{const{clientX:i,clientY:s}=n(t)?a(t):t;return{clientX:i>0?i:e?e.x:i,clientY:s>0?s:e?e.y:s}},a=t=>{if(t.touches.length){let{clientX:e,clientY:i}=t.touches[0];if(t.touches.length>1){const n=t.touches[1];e=(e+n.clientX)/2,i=(i+n.clientY)/2}return{clientX:e,clientY:i}}const e=t.changedTouches[0];return{clientX:e.clientX,clientY:e.clientY}},r=500,u=10,_=100,d=15,m=(t,e=0)=>n(t)?{clientX:t.touches[e].clientX,clientY:t.touches[e].clientY}:{clientX:t.clientX,clientY:t.clientY},f=t=>!t||!n(t)||t.touches.length>0;class p{constructor(t,{onTouchDragStart:i},n={}){e(this,"_touchDragTimeOut"),e(this,"_onTouchDragStart"),e(this,"_payload",null),e(this,"_delay",500),e(this,"_firstTouch",null),e(this,"_lastTouch",null),e(this,"_epsilon",10),this._payload=t,this._onTouchDragStart=i,this._delay="number"==typeof n.delay?n.delay:500,this._epsilon="number"==typeof n.epsilon?n.epsilon:10}onStart(t){f(t)&&(this._touchDragTimeOut||(this._firstTouch=m(t,n(t)?t.touches.length-1:0),this._touchDragTimeOut=setTimeout(()=>{this._clearTimeout(),this._lastTouch||(this._lastTouch=m(t)),this._checkXDistance(t)()},this._delay)))}onEnd(){this._resetTouches()}onMove(t){f(t)&&(this._lastTouch=m(t))}_clearTimeout(){this._touchDragTimeOut&&(clearTimeout(this._touchDragTimeOut),this._touchDragTimeOut=null)}_resetTouches(){this._clearTimeout(),this._lastTouch=null,this._firstTouch=null,this._payload=null}_checkXDistance(t){return()=>{if(!this._firstTouch||!this._lastTouch)return;let e=!1;e=Math.abs(this._firstTouch.clientX-this._lastTouch.clientX)<this._epsilon,e&&(this._onTouchDragStart(this._payload,t),this._resetTouches())}}}export{d as C,p as T,l as a,r as b,_ as c,u as d,o as e,c as g,n as i};
|
package/touch-drag-DNDPwZ-_.mjs
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
var X = Object.defineProperty;
|
|
2
|
-
var x = (e, t, n) => t in e ? X(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
-
var o = (e, t, n) => x(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
class D {
|
|
5
|
-
constructor(t = 16) {
|
|
6
|
-
o(this, "_computedStyleCache", /* @__PURE__ */ new Map());
|
|
7
|
-
o(this, "_maxLifetime", 16);
|
|
8
|
-
o(this, "_cacheCleanInterval", null);
|
|
9
|
-
this._maxLifetime = t;
|
|
10
|
-
}
|
|
11
|
-
get(t) {
|
|
12
|
-
const n = this._computedStyleCache.get(t), i = Date.now();
|
|
13
|
-
if (n && i - n.updated < this._maxLifetime)
|
|
14
|
-
return n.style;
|
|
15
|
-
const s = getComputedStyle(t);
|
|
16
|
-
return this._computedStyleCache.set(t, { style: s, updated: i }), this._cacheCleanInterval || (this._cacheCleanInterval = setInterval(
|
|
17
|
-
() => this._cleanUpCache,
|
|
18
|
-
Math.max(this._maxLifetime * 1e3, 5e3)
|
|
19
|
-
)), s;
|
|
20
|
-
}
|
|
21
|
-
_cleanUpCache() {
|
|
22
|
-
const t = Date.now();
|
|
23
|
-
for (const [n, { updated: i }] of this._computedStyleCache.entries())
|
|
24
|
-
t - i >= this._maxLifetime && this._computedStyleCache.delete(n);
|
|
25
|
-
this._computedStyleCache.size === 0 && this._cacheCleanInterval && (clearInterval(this._cacheCleanInterval), this._cacheCleanInterval = null);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
const h = (e) => window.TouchEvent && e instanceof window.TouchEvent;
|
|
29
|
-
let l;
|
|
30
|
-
const d = (e) => (l || (l = new D()), l.get(e)), m = (e, t, n) => {
|
|
31
|
-
const i = parseFloat(e), s = window.devicePixelRatio || 1;
|
|
32
|
-
if (t === "px")
|
|
33
|
-
return i;
|
|
34
|
-
if (t === "%") {
|
|
35
|
-
const c = n === document.documentElement ? window.innerWidth : n.offsetWidth;
|
|
36
|
-
return i / 100 * c;
|
|
37
|
-
}
|
|
38
|
-
if (t === "rem") {
|
|
39
|
-
const c = parseFloat(
|
|
40
|
-
d(document.documentElement).fontSize
|
|
41
|
-
);
|
|
42
|
-
return i * c;
|
|
43
|
-
}
|
|
44
|
-
if (t === "em") {
|
|
45
|
-
const c = parseFloat(
|
|
46
|
-
d(n).fontSize
|
|
47
|
-
);
|
|
48
|
-
return i * c;
|
|
49
|
-
}
|
|
50
|
-
if (t === "vh" || t === "vw" || t === "vmin" || t === "vmax") {
|
|
51
|
-
const c = {
|
|
52
|
-
vh: window.innerHeight,
|
|
53
|
-
vw: window.innerWidth,
|
|
54
|
-
vmin: Math.min(window.innerWidth, window.innerHeight),
|
|
55
|
-
vmax: Math.max(window.innerWidth, window.innerHeight)
|
|
56
|
-
};
|
|
57
|
-
return i / 100 * c[t];
|
|
58
|
-
}
|
|
59
|
-
const a = {
|
|
60
|
-
cm: 37.7952755906,
|
|
61
|
-
mm: 3.77952755906,
|
|
62
|
-
in: 96
|
|
63
|
-
};
|
|
64
|
-
return t in a ? i * a[t] * s : (console.warn(
|
|
65
|
-
"Unable to determine coordinates for drag-in. Therefore drag-in is not possible. Check the CSS that positions the iframe of Roomle"
|
|
66
|
-
), 0);
|
|
67
|
-
}, L = (e, t, n = { x: 0, y: 0 }) => {
|
|
68
|
-
const i = e.getBoundingClientRect(), a = d(e).transform;
|
|
69
|
-
let c = 0, _ = 0;
|
|
70
|
-
if (a !== "none") {
|
|
71
|
-
const S = /translate\(\s*([-+]?\d*\.?\d+|\d+)(px|%)?,?\s*([-+]?\d*\.?\d+|\d+)?(px|%)?\s*\)/, r = a.match(S);
|
|
72
|
-
r && (c = m(r[1], r[2], e), _ = m(r[3], r[4], e));
|
|
73
|
-
}
|
|
74
|
-
const { clientX: g, clientY: w } = Y(t, n), C = g - i.left - c + e.scrollLeft, y = w - i.top - _ + e.scrollTop;
|
|
75
|
-
return { x: C, y };
|
|
76
|
-
}, Y = (e, t = null) => {
|
|
77
|
-
const { clientX: n, clientY: i } = h(e) ? E(e) : e, s = n > 0 ? n : t ? t.x : n, a = i > 0 ? i : t ? t.y : i;
|
|
78
|
-
return { clientX: s, clientY: a };
|
|
79
|
-
}, E = (e) => {
|
|
80
|
-
if (e.touches.length) {
|
|
81
|
-
let { clientX: n, clientY: i } = e.touches[0];
|
|
82
|
-
if (e.touches.length > 1) {
|
|
83
|
-
const s = e.touches[1], a = s.clientX, c = s.clientY;
|
|
84
|
-
n = (n + a) / 2, i = (i + c) / 2;
|
|
85
|
-
}
|
|
86
|
-
return { clientX: n, clientY: i };
|
|
87
|
-
}
|
|
88
|
-
const t = e.changedTouches[0];
|
|
89
|
-
return { clientX: t.clientX, clientY: t.clientY };
|
|
90
|
-
}, f = 500, T = 10, I = 100, M = 15, u = (e, t = 0) => h(e) ? {
|
|
91
|
-
clientX: e.touches[t].clientX,
|
|
92
|
-
clientY: e.touches[t].clientY
|
|
93
|
-
} : {
|
|
94
|
-
clientX: e.clientX,
|
|
95
|
-
clientY: e.clientY
|
|
96
|
-
}, p = (e) => e && h(e) ? e.touches.length > 0 : !0;
|
|
97
|
-
class R {
|
|
98
|
-
constructor(t, { onTouchDragStart: n }, i = {}) {
|
|
99
|
-
o(this, "_touchDragTimeOut");
|
|
100
|
-
o(this, "_onTouchDragStart");
|
|
101
|
-
o(this, "_payload", null);
|
|
102
|
-
o(this, "_delay", f);
|
|
103
|
-
o(this, "_firstTouch", null);
|
|
104
|
-
o(this, "_lastTouch", null);
|
|
105
|
-
o(this, "_epsilon", T);
|
|
106
|
-
this._payload = t, this._onTouchDragStart = n, this._delay = typeof i.delay == "number" ? i.delay : f, this._epsilon = typeof i.epsilon == "number" ? i.epsilon : T;
|
|
107
|
-
}
|
|
108
|
-
onStart(t) {
|
|
109
|
-
p(t) && (this._touchDragTimeOut || (this._firstTouch = u(
|
|
110
|
-
t,
|
|
111
|
-
h(t) ? t.touches.length - 1 : 0
|
|
112
|
-
), this._touchDragTimeOut = setTimeout(() => {
|
|
113
|
-
this._clearTimeout(), this._lastTouch || (this._lastTouch = u(t)), this._checkXDistance(t)();
|
|
114
|
-
}, this._delay)));
|
|
115
|
-
}
|
|
116
|
-
onEnd() {
|
|
117
|
-
this._resetTouches();
|
|
118
|
-
}
|
|
119
|
-
onMove(t) {
|
|
120
|
-
p(t) && (this._lastTouch = u(t));
|
|
121
|
-
}
|
|
122
|
-
_clearTimeout() {
|
|
123
|
-
this._touchDragTimeOut && (clearTimeout(this._touchDragTimeOut), this._touchDragTimeOut = null);
|
|
124
|
-
}
|
|
125
|
-
_resetTouches() {
|
|
126
|
-
this._clearTimeout(), this._lastTouch = null, this._firstTouch = null, this._payload = null;
|
|
127
|
-
}
|
|
128
|
-
_checkXDistance(t) {
|
|
129
|
-
return () => {
|
|
130
|
-
if (!this._firstTouch || !this._lastTouch)
|
|
131
|
-
return;
|
|
132
|
-
let n = !1;
|
|
133
|
-
n = Math.abs(
|
|
134
|
-
this._firstTouch.clientX - this._lastTouch.clientX
|
|
135
|
-
) < this._epsilon, n && (this._onTouchDragStart(this._payload, t), this._resetTouches());
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
export {
|
|
140
|
-
M as C,
|
|
141
|
-
R as T,
|
|
142
|
-
L as a,
|
|
143
|
-
f as b,
|
|
144
|
-
I as c,
|
|
145
|
-
T as d,
|
|
146
|
-
Y as e,
|
|
147
|
-
d as g,
|
|
148
|
-
h as i
|
|
149
|
-
};
|