@roomle/embedding-lib 6.5.0-alpha.2 → 6.5.0-alpha.3

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.
@@ -1,8 +1,71 @@
1
- ## 6.5.0-alpha.2 (2026-03-13)
1
+ ## 6.5.0-alpha.3 (2026-03-18)
2
2
 
3
- * Merge branch 'master' into fix/hi-examples-use-server-proxy ([5d66de7](https://github.com/roomle-dev/roomle-ui/commit/5d66de7))
4
- * Merge pull request #2405 from roomle-dev/fix/hi-examples-use-server-proxy ([cc41244](https://github.com/roomle-dev/roomle-ui/commit/cc41244)), closes [#2405](https://github.com/roomle-dev/roomle-ui/issues/2405)
5
- * Merge pull request #2406 from roomle-dev/fix/mapping-data-on-level1 ([7d63c9d](https://github.com/roomle-dev/roomle-ui/commit/7d63c9d)), closes [#2406](https://github.com/roomle-dev/roomle-ui/issues/2406)
6
- * fix: formatting issues ([860c8da](https://github.com/roomle-dev/roomle-ui/commit/860c8da))
7
- * fix: set VITE_USE_SERVER for HI example builds on stages ([6003ec2](https://github.com/roomle-dev/roomle-ui/commit/6003ec2))
8
- * fix: skip pipe-delimited transform when enableTwoLevelCatalog is off ([cb33d55](https://github.com/roomle-dev/roomle-ui/commit/cb33d55))
3
+ * Initial plan ([82067d7](https://github.com/roomle-dev/roomle-ui/commit/82067d7))
4
+ * Merge branch 'master' into copilot/upgrade-web-sdk-to-strict-null-checks ([0a53891](https://github.com/roomle-dev/roomle-ui/commit/0a53891))
5
+ * Merge branch 'master' into copilot/upgrade-web-sdk-to-strict-null-checks ([4d5ab99](https://github.com/roomle-dev/roomle-ui/commit/4d5ab99))
6
+ * Merge branch 'master' into copilot/upgrade-web-sdk-to-strict-null-checks ([b288d9b](https://github.com/roomle-dev/roomle-ui/commit/b288d9b))
7
+ * Merge branch 'master' into copilot/upgrade-web-sdk-to-strict-null-checks ([ca2799c](https://github.com/roomle-dev/roomle-ui/commit/ca2799c))
8
+ * Merge branch 'master' into fix/set-only-selected-floor-color ([ae946c7](https://github.com/roomle-dev/roomle-ui/commit/ae946c7))
9
+ * Merge pull request #2346 from roomle-dev/fix/drag-fade ([1426d41](https://github.com/roomle-dev/roomle-ui/commit/1426d41)), closes [#2346](https://github.com/roomle-dev/roomle-ui/issues/2346)
10
+ * Merge pull request #2365 from roomle-dev/copilot/upgrade-web-sdk-to-strict-null-checks ([18e45eb](https://github.com/roomle-dev/roomle-ui/commit/18e45eb)), closes [#2365](https://github.com/roomle-dev/roomle-ui/issues/2365)
11
+ * Merge pull request #2373 from roomle-dev/refactor/typed-event-dispatcher-map ([5d50308](https://github.com/roomle-dev/roomle-ui/commit/5d50308)), closes [#2373](https://github.com/roomle-dev/roomle-ui/issues/2373)
12
+ * Merge pull request #2391 from roomle-dev/fix/set-only-selected-floor-color ([c59f3fe](https://github.com/roomle-dev/roomle-ui/commit/c59f3fe)), closes [#2391](https://github.com/roomle-dev/roomle-ui/issues/2391)
13
+ * Merge pull request #2407 from roomle-dev/upgraded-by-ci/core-2.72.0-alpha.9 ([58cd87d](https://github.com/roomle-dev/roomle-ui/commit/58cd87d)), closes [#2407](https://github.com/roomle-dev/roomle-ui/issues/2407)
14
+ * Merge pull request #2410 from roomle-dev/upgraded-by-ci/core-2.72.0-alpha.10 ([735c63a](https://github.com/roomle-dev/roomle-ui/commit/735c63a)), closes [#2410](https://github.com/roomle-dev/roomle-ui/issues/2410)
15
+ * Merge pull request #2411 from roomle-dev/upgraded-by-ci/core-2.72.0-alpha.11 ([58ea7bf](https://github.com/roomle-dev/roomle-ui/commit/58ea7bf)), closes [#2411](https://github.com/roomle-dev/roomle-ui/issues/2411)
16
+ * Merge pull request #2414 from roomle-dev/upgraded-by-ci/core-2.72.0-alpha.12 ([ef98f78](https://github.com/roomle-dev/roomle-ui/commit/ef98f78)), closes [#2414](https://github.com/roomle-dev/roomle-ui/issues/2414)
17
+ * feat: core api - childObjectLevel ([ed3cc0d](https://github.com/roomle-dev/roomle-ui/commit/ed3cc0d))
18
+ * feat(core): upgrade to version 2.72.0-alpha.10 ([f890cee](https://github.com/roomle-dev/roomle-ui/commit/f890cee))
19
+ * feat(core): upgrade to version 2.72.0-alpha.11 ([c186968](https://github.com/roomle-dev/roomle-ui/commit/c186968))
20
+ * feat(core): upgrade to version 2.72.0-alpha.12 ([75998c7](https://github.com/roomle-dev/roomle-ui/commit/75998c7))
21
+ * feat(core): upgrade to version 2.72.0-alpha.9 ([77da101](https://github.com/roomle-dev/roomle-ui/commit/77da101))
22
+ * chore: add docs ([2e7ba8b](https://github.com/roomle-dev/roomle-ui/commit/2e7ba8b))
23
+ * chore: add long press for mobile ([b9345c5](https://github.com/roomle-dev/roomle-ui/commit/b9345c5))
24
+ * chore: code review ([71c8ecd](https://github.com/roomle-dev/roomle-ui/commit/71c8ecd))
25
+ * chore: fadein out on grid view ([50bb0d6](https://github.com/roomle-dev/roomle-ui/commit/50bb0d6))
26
+ * chore: fix for mobile drag in HI ([a12120c](https://github.com/roomle-dev/roomle-ui/commit/a12120c))
27
+ * chore: fix imports ([dc14e57](https://github.com/roomle-dev/roomle-ui/commit/dc14e57))
28
+ * chore: fix native browser drag ghost flying around ([1c447d2](https://github.com/roomle-dev/roomle-ui/commit/1c447d2))
29
+ * chore: format ([9c544e9](https://github.com/roomle-dev/roomle-ui/commit/9c544e9))
30
+ * chore: lint ([a52f181](https://github.com/roomle-dev/roomle-ui/commit/a52f181))
31
+ * chore: lint ([f604576](https://github.com/roomle-dev/roomle-ui/commit/f604576))
32
+ * chore: merge master ([edf059b](https://github.com/roomle-dev/roomle-ui/commit/edf059b))
33
+ * chore: merge master into strict-null-checks branch ([f152002](https://github.com/roomle-dev/roomle-ui/commit/f152002))
34
+ * chore: start Phase 3 strict null checks migration for common-core ([aa975a0](https://github.com/roomle-dev/roomle-ui/commit/aa975a0))
35
+ * chore: strictNullChecks Phase 3a — DI, utils, services, input ([ab55f13](https://github.com/roomle-dev/roomle-ui/commit/ab55f13))
36
+ * chore: trigger CI ([3dcc2a6](https://github.com/roomle-dev/roomle-ui/commit/3dcc2a6))
37
+ * chore: working drag-in fade out ([04c0f22](https://github.com/roomle-dev/roomle-ui/commit/04c0f22))
38
+ * fix(web-sdk): address PR feedback and CI regressions ([a62e799](https://github.com/roomle-dev/roomle-ui/commit/a62e799))
39
+ * fix: address remaining review comments on PR #2365 ([279c7b6](https://github.com/roomle-dev/roomle-ui/commit/279c7b6)), closes [#2365](https://github.com/roomle-dev/roomle-ui/issues/2365)
40
+ * fix: address review comments on PR #2373 ([9a9827b](https://github.com/roomle-dev/roomle-ui/commit/9a9827b)), closes [#2373](https://github.com/roomle-dev/roomle-ui/issues/2373)
41
+ * fix: address review feedback — revert problematic fallbacks, fix null handling ([f6d7bb6](https://github.com/roomle-dev/roomle-ui/commit/f6d7bb6))
42
+ * fix: better positioning of spawned in elements ([bd7ebf9](https://github.com/roomle-dev/roomle-ui/commit/bd7ebf9))
43
+ * fix: correct cast from KeyboardEvent to MouseEvent in _onMouseDown ([2b4ca5c](https://github.com/roomle-dev/roomle-ui/commit/2b4ca5c))
44
+ * fix: do not add new undo step ([0e8d78c](https://github.com/roomle-dev/roomle-ui/commit/0e8d78c))
45
+ * fix: from custom overlay dragging working again ([7f37a35](https://github.com/roomle-dev/roomle-ui/commit/7f37a35))
46
+ * fix: harden DI lookup and light cache access ([843eee9](https://github.com/roomle-dev/roomle-ui/commit/843eee9))
47
+ * fix: mobile external catalog dragging ([4f20d23](https://github.com/roomle-dev/roomle-ui/commit/4f20d23))
48
+ * fix: only set color of the selected floor in planner ([b92ef5b](https://github.com/roomle-dev/roomle-ui/commit/b92ef5b))
49
+ * fix: resolve strictNullChecks errors in cameracontrol directory ([1038f20](https://github.com/roomle-dev/roomle-ui/commit/1038f20))
50
+ * fix: resolve strictNullChecks errors in cameracontrol directory ([a0011c1](https://github.com/roomle-dev/roomle-ui/commit/a0011c1))
51
+ * fix: resolve strictNullChecks errors in common-core ([c7991bf](https://github.com/roomle-dev/roomle-ui/commit/c7991bf))
52
+ * fix: resolve strictNullChecks errors in common-core/utils ([3e68331](https://github.com/roomle-dev/roomle-ui/commit/3e68331))
53
+ * fix: resolve strictNullChecks errors in common-utils.ts ([f8e204d](https://github.com/roomle-dev/roomle-ui/commit/f8e204d))
54
+ * fix: resolve strictNullChecks errors in init-data.ts ([dbf9164](https://github.com/roomle-dev/roomle-ui/commit/dbf9164))
55
+ * fix: resolve strictNullChecks errors in input-manager.ts ([a1ccf79](https://github.com/roomle-dev/roomle-ui/commit/a1ccf79))
56
+ * fix: resolve strictNullChecks errors in services/ files ([1e4356a](https://github.com/roomle-dev/roomle-ui/commit/1e4356a))
57
+ * fix: resolve strictNullChecks errors in single-promise-factory.ts ([b98f80f](https://github.com/roomle-dev/roomle-ui/commit/b98f80f))
58
+ * fix: resolve strictNullChecks errors in threejs-utils.ts ([e131748](https://github.com/roomle-dev/roomle-ui/commit/e131748))
59
+ * fix: revert Main.lookup to not throw on null (test regression) ([05793dc](https://github.com/roomle-dev/roomle-ui/commit/05793dc))
60
+ * style: format merge resolution ([1253cf0](https://github.com/roomle-dev/roomle-ui/commit/1253cf0))
61
+ * refactor: add typed CameraEventMap for CameraControl ([b49f7ce](https://github.com/roomle-dev/roomle-ui/commit/b49f7ce))
62
+ * refactor: extract factory functions and remove redundant type annotations ([bc09eac](https://github.com/roomle-dev/roomle-ui/commit/bc09eac))
63
+ * refactor: move ghost image creation into composable ([ffa9803](https://github.com/roomle-dev/roomle-ui/commit/ffa9803))
64
+ * refactor: remove unnecessary jsdoc and use pointerEvent factory in tests ([4e4630a](https://github.com/roomle-dev/roomle-ui/commit/4e4630a))
65
+ * refactor: simplify EventDispatcher generics and add code guidelines ([a5833a0](https://github.com/roomle-dev/roomle-ui/commit/a5833a0))
66
+ * refactor: typed EventMap for EventDispatcher and InputEvent ([eef56b3](https://github.com/roomle-dev/roomle-ui/commit/eef56b3))
67
+ * refactor: use typed inputListener helper and rename factories to createPointerEvent/createKeyboardEv ([769ccb5](https://github.com/roomle-dev/roomle-ui/commit/769ccb5))
68
+ * refactor: working from-website dragin on mobile ([92545de](https://github.com/roomle-dev/roomle-ui/commit/92545de))
69
+ * test: update playwright tests, because of HI properties ([49bb60f](https://github.com/roomle-dev/roomle-ui/commit/49bb60f))
70
+ * docs: add Symbol guideline for opaque identifiers and follow-up for refactoring ([066a0cb](https://github.com/roomle-dev/roomle-ui/commit/066a0cb))
71
+ * docs: update TypeScript guidelines — prefer union types, no enums in new code ([6fc4a54](https://github.com/roomle-dev/roomle-ui/commit/6fc4a54))
@@ -0,0 +1 @@
1
+ import{c as t,d as e,e as n,f as s,g as i,h as o,i as a,j as d,k as m}from"./embedding-plugins-DLVs7ER4.mjs";const h=(t,e,n=0,s=0)=>{const i=e.x+e.width+n,o=e.x-n,a=e.y+e.height+s,d=e.y-s,{x:m,y:h}=t;return m>=o&&m<=i&&h>=d&&h<=a},r=(t,e,n,s=0,i=0)=>{if(n&&(n.hiddenIn||n.visibleIn))return n.visibleIn?h({x:t,y:e},n.visibleIn,s,i):!!n.hiddenIn&&!h({x:t,y:e},n.hiddenIn,-s,-i)};class l{_dragGhostAnimationFrameId=null;_dragGhostRemoveAnimationFrameId=null;_dragGhostElement=null;constructor(t=null){this._dragGhostElement=t}updateDragGhost(h,l,g){this._dragGhostRemoveAnimationFrameId&&(cancelAnimationFrame(this._dragGhostRemoveAnimationFrameId),this._dragGhostRemoveAnimationFrameId=null),!g.ghost?.external&&g.ghost&&(this._dragGhostAnimationFrameId||(this._dragGhostAnimationFrameId=requestAnimationFrame(()=>{(()=>{if(!document.getElementById(e)){const t=document.createElement("style");t.type="text/css",t.id=e,t.innerHTML=`\n ${n}\n ${s}\n `,document.head.appendChild(t)}})();const c={x:h,y:l};!g.ghost&&this._dragGhostElement&&(g.ghost={}),g.ghost&&!g.ghost.element&&this._dragGhostElement&&(g.ghost.element=this._dragGhostElement),(({x:e,y:n},s)=>{let d=document.getElementById(t);if(!d){if(d=document.createElement("div"),s.ghost?.element)d.appendChild(s.ghost.element);else{const t=document.createElement("img");t.src=s.ghost?.url||i,t.width=s.ghost?.width||o,t.height=s.ghost?.height||a,d.appendChild(t)}d.id=t,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",r(e,n,s.ghost||{},s.settings?.dragInOverlapX,s.settings?.dragInOverlapY)||(d.style.display="none"),d.style.pointerEvents="none",document.body.appendChild(d)}})(c,g),(({x:e,y:n},s)=>{const i=document.getElementById(t);if(!i)return;let h=s.ghost?.width,l=s.ghost?.height;typeof h>"u"&&(h=i.getBoundingClientRect().width||o),typeof l>"u"&&(l=i.getBoundingClientRect().height||a);const g=e-h/2,c=n-l/2;i.style.transform=`translate3d(${g}px, ${c}px, 0)`,s.ghost&&(r(e,n,s.ghost,s.settings?.dragInOverlapX,s.settings?.dragInOverlapY)?i.style.animation!=d&&(i.style.animation=d):i.style.animation!=m&&(i.style.animation=m))})(c,g),this._dragGhostAnimationFrameId=null})))}removeDragGhost(){this._dragGhostAnimationFrameId&&(cancelAnimationFrame(this._dragGhostAnimationFrameId),this._dragGhostAnimationFrameId=null),this._dragGhostRemoveAnimationFrameId||(this._dragGhostRemoveAnimationFrameId=requestAnimationFrame(()=>{const e=document.getElementById(t);e&&document.body.removeChild(e),this._dragGhostRemoveAnimationFrameId=null}))}}export{l as E};
@@ -0,0 +1,81 @@
1
+ import { c as r, d as o, e as f, f as u, g as y, h as A, i as G, j as g, k as _ } from "./embedding-plugins-DqMSzAJe.mjs";
2
+ const c = (i, n, t = 0, e = 0) => {
3
+ const s = n.x + n.width + t, a = n.x - t, h = n.y + n.height + e, l = n.y - e, { x: d, y: m } = i;
4
+ return d >= a && d <= s && m >= l && m <= h;
5
+ }, I = (i, n, t, e = 0, s = 0) => {
6
+ if (!(!t || !t.hiddenIn && !t.visibleIn))
7
+ return t.visibleIn ? c(
8
+ { x: i, y: n },
9
+ t.visibleIn,
10
+ e,
11
+ s
12
+ ) : t.hiddenIn ? !c(
13
+ { x: i, y: n },
14
+ t.hiddenIn,
15
+ -e,
16
+ -s
17
+ ) : !1;
18
+ }, R = () => {
19
+ if (!!!document.getElementById(o)) {
20
+ const n = document.createElement("style");
21
+ n.type = "text/css", n.id = o, n.innerHTML = `
22
+ ${f}
23
+ ${u}
24
+ `, document.head.appendChild(n);
25
+ }
26
+ }, F = ({ x: i, y: n }, t) => {
27
+ let e = document.getElementById(r);
28
+ if (!e) {
29
+ if (e = document.createElement("div"), t.ghost?.element)
30
+ e.appendChild(t.ghost.element);
31
+ else {
32
+ const s = document.createElement("img");
33
+ s.src = t.ghost?.url || y, s.width = t.ghost?.width || A, s.height = t.ghost?.height || G, e.appendChild(s);
34
+ }
35
+ e.id = r, e.style.position = "fixed", e.style.top = "0", e.style.left = "0", e.style.willChange = "transform", e.style.transform = "translate3d(0, 0, 0)", e.style.zIndex = "9999", e.style.opacity = "0.5", I(
36
+ i,
37
+ n,
38
+ t.ghost || {},
39
+ t.settings?.dragInOverlapX,
40
+ t.settings?.dragInOverlapY
41
+ ) || (e.style.display = "none"), e.style.pointerEvents = "none", document.body.appendChild(e);
42
+ }
43
+ }, E = ({ x: i, y: n }, t) => {
44
+ const e = document.getElementById(r);
45
+ if (!e)
46
+ return;
47
+ let s = t.ghost?.width, a = t.ghost?.height;
48
+ typeof s > "u" && (s = e.getBoundingClientRect().width || A), typeof a > "u" && (a = e.getBoundingClientRect().height || G);
49
+ const h = i - s / 2, l = n - a / 2;
50
+ e.style.transform = `translate3d(${h}px, ${l}px, 0)`, t.ghost && (I(
51
+ i,
52
+ n,
53
+ t.ghost,
54
+ t.settings?.dragInOverlapX,
55
+ t.settings?.dragInOverlapY
56
+ ) ? e.style.animation != g && (e.style.animation = g) : e.style.animation != _ && (e.style.animation = _));
57
+ };
58
+ class L {
59
+ _dragGhostAnimationFrameId = null;
60
+ _dragGhostRemoveAnimationFrameId = null;
61
+ _dragGhostElement = null;
62
+ constructor(n = null) {
63
+ this._dragGhostElement = n;
64
+ }
65
+ updateDragGhost(n, t, e) {
66
+ this._dragGhostRemoveAnimationFrameId && (cancelAnimationFrame(this._dragGhostRemoveAnimationFrameId), this._dragGhostRemoveAnimationFrameId = null), !e.ghost?.external && e.ghost && (this._dragGhostAnimationFrameId || (this._dragGhostAnimationFrameId = requestAnimationFrame(() => {
67
+ R();
68
+ const s = { x: n, y: t };
69
+ !e.ghost && this._dragGhostElement && (e.ghost = {}), e.ghost && !e.ghost.element && this._dragGhostElement && (e.ghost.element = this._dragGhostElement), F(s, e), E(s, e), this._dragGhostAnimationFrameId = null;
70
+ })));
71
+ }
72
+ removeDragGhost() {
73
+ this._dragGhostAnimationFrameId && (cancelAnimationFrame(this._dragGhostAnimationFrameId), this._dragGhostAnimationFrameId = null), this._dragGhostRemoveAnimationFrameId || (this._dragGhostRemoveAnimationFrameId = requestAnimationFrame(() => {
74
+ const n = document.getElementById(r);
75
+ n && document.body.removeChild(n), this._dragGhostRemoveAnimationFrameId = null;
76
+ }));
77
+ }
78
+ }
79
+ export {
80
+ L as E
81
+ };
@@ -0,0 +1 @@
1
+ const t="rml-drag-in-styles",e="rml-drag-in-drag-element",a="rml-drag-in-overlay",s="rml-drag-in-drag-ghost",r="rml-drag-in-fade-in",i="rml-drag-in-fade-out",n={DISPLAY_NONE:"rml-display-none"},o=.5,d="250ms",g="forwards",m=`@keyframes ${r} {from{opacity: 0;}to {opacity: 0.5;}}`,l=`@keyframes ${i} {from{opacity: 0.5;}to {opacity: 0;}}`,c=`${r} ${d} ${g}`,h=`${i} ${d} ${g}`,p="https://res.cloudinary.com/roomle/image/upload/v1729679975/fallback_afpyqr.jpg",u=112,_=112;class y{_mainDomElement;_instance;_mode="website";_viewName="main";constructor(t,e,a,s){this._instance=t,this._mainDomElement=e,this._mode=a,this._viewName=s}async init(){return Promise.resolve()}}class D extends y{options={};_customDragSignal=new AbortController;_injectStyles(){if(!document.getElementById(t)){const e=document.createElement("style");e.type="text/css",e.id=t,e.innerHTML=`\n .${n.DISPLAY_NONE}{display:none}\n .${a}{position:absolute;top:0;left:0;width:100%;height:100%;z-index:999;}\n .${s}{position:absolute;top:0;left:0;width:1px;height:1px;z-index:999;pointer-events:none;background-color:transparent;}\n ${m}\n ${l}\n `,document.head.appendChild(e)}}_initializeDragGhost(){const t=this._mainDomElement.parentNode;let e=t.querySelector("."+s);e||(e=document.createElement("div"),e.classList.add(s),e.innerText=" ",t.appendChild(e))}constructor(t,e,a,s){super(t,e,a,s),this._mainDomElement=e,this._injectStyles(),this._initializeDragGhost()}async init(){if(await super.init(),"website"===this._mode)try{const{DragInFromWebsiteStrategy:t}=await import("./from-website-nKwD78_u.mjs");this._strategy=new t(this._instance,this._mainDomElement,{settings:this.options,mode:"website"})}catch(t){throw t}else{if("custom-view"!==this._mode)throw new Error("Unsupported mode");try{const{DragInFromCustomViewStrategy:t}=await import("./from-custom-view-CaDOooe4.mjs");this._strategy=new t(this._instance,this._mainDomElement,this.options,this._viewName)}catch(t){throw t}}}get isDragging(){return this._strategy.isDragging}dragStart(t,e,a="rml_id"){this._strategy.dragStart(t,e,a)}dragUpdate(t){this._strategy.dragUpdate(t)}dragEnd(){this._strategy.dragEnd()}touchStart(t,e,a="rml_id"){this._strategy.touchStart(t,e,a)}touchMove(t){this._strategy.touchMove(t)}touchEnd(){this._strategy.touchEnd()}dispose(){this._strategy.dispose()}beforeUpdateGhost(t){this._strategy.beforeUpdateGhost(t)}registerCustomDrag({customDragStart:t,customDragEnd:e,customDragUpdate:a,beforeUpdateGhost:s}){s&&this._strategy.beforeUpdateGhost(s);const r=this._customDragSignal.signal,i=t=>{this._strategy.releaseInput(t),this._strategy.isDragging&&e(t)};document.querySelectorAll('[data-rml-draggable="true"]').forEach(t=>{t.draggable=!1,t.style.touchAction="none"}),document.addEventListener("pointerdown",e=>{"true"===e.target.getAttribute("data-rml-draggable")&&(e.target.setPointerCapture&&e.target.setPointerCapture(e.pointerId),t(e))},{signal:r}),document.addEventListener("pointermove",t=>{a(t)},{signal:r}),document.addEventListener("pointerup",i,{signal:r}),document.addEventListener("pointercancel",i,{signal:r})}unregisterCustomDrag(){this._customDragSignal.abort(),this._customDragSignal=new AbortController}releaseInput(t){this._strategy.releaseInput(t)}}const w=Object.freeze(Object.defineProperty({__proto__:null,DragIn:D},Symbol.toStringTag,{value:"Module"}));export{D,a as R,o as T,n as a,s as b,e as c,t as d,m as e,l as f,p as g,u as h,_ as i,c as j,h as k,w as l};
@@ -1,13 +1,13 @@
1
- const g = "rml-drag-in-styles", N = "rml-drag-in-drag-element", D = "rml-drag-in-overlay", i = "rml-drag-in-drag-ghost", c = "rml-drag-in-fade-in", l = "rml-drag-in-fade-out", y = {
1
+ const _ = "rml-drag-in-styles", N = "rml-drag-in-drag-element", A = "rml-drag-in-overlay", n = "rml-drag-in-drag-ghost", d = "rml-drag-in-fade-in", g = "rml-drag-in-fade-out", D = {
2
2
  DISPLAY_NONE: "rml-display-none"
3
- }, m = 0.5, h = "250ms", u = "forwards", p = `@keyframes ${c} {from{opacity: 0;}to {opacity: ${m};}}`, S = `@keyframes ${l} {from{opacity: ${m};}to {opacity: 0;}}`, R = `${c} ${h} ${u}`, G = `${l} ${h} ${u}`, T = "https://res.cloudinary.com/roomle/image/upload/v1729679975/fallback_afpyqr.jpg", b = 112, f = 112;
3
+ }, c = 0.5, l = "250ms", m = "forwards", y = `@keyframes ${d} {from{opacity: 0;}to {opacity: ${c};}}`, S = `@keyframes ${g} {from{opacity: ${c};}to {opacity: 0;}}`, R = `${d} ${l} ${m}`, G = `${g} ${l} ${m}`, T = "https://res.cloudinary.com/roomle/image/upload/v1729679975/fallback_afpyqr.jpg", f = 112, b = 112;
4
4
  class I {
5
5
  _mainDomElement;
6
6
  _instance;
7
7
  _mode = "website";
8
8
  _viewName = "main";
9
- constructor(t, e, s, o) {
10
- this._instance = t, this._mainDomElement = e, this._mode = s, this._viewName = o;
9
+ constructor(t, e, r, a) {
10
+ this._instance = t, this._mainDomElement = e, this._mode = r, this._viewName = a;
11
11
  }
12
12
  async init() {
13
13
  return Promise.resolve();
@@ -17,13 +17,13 @@ class E extends I {
17
17
  options = {};
18
18
  _customDragSignal = new AbortController();
19
19
  _injectStyles() {
20
- if (!!!document.getElementById(g)) {
20
+ if (!!!document.getElementById(_)) {
21
21
  const e = document.createElement("style");
22
- e.type = "text/css", e.id = g, e.innerHTML = `
23
- .${y.DISPLAY_NONE}{display:none}
24
- .${D}{position:absolute;top:0;left:0;width:100%;height:100%;z-index:999;}
25
- .${i}{position:absolute;top:0;left:0;width:1px;height:1px;z-index:999;pointer-events:none;background-color:transparent;}
26
- ${p}
22
+ e.type = "text/css", e.id = _, e.innerHTML = `
23
+ .${D.DISPLAY_NONE}{display:none}
24
+ .${A}{position:absolute;top:0;left:0;width:100%;height:100%;z-index:999;}
25
+ .${n}{position:absolute;top:0;left:0;width:1px;height:1px;z-index:999;pointer-events:none;background-color:transparent;}
26
+ ${y}
27
27
  ${S}
28
28
  `, document.head.appendChild(e);
29
29
  }
@@ -31,17 +31,17 @@ class E extends I {
31
31
  _initializeDragGhost() {
32
32
  const t = this._mainDomElement.parentNode;
33
33
  let e = t.querySelector(
34
- "." + i
34
+ "." + n
35
35
  );
36
- e || (e = document.createElement("div"), e.classList.add(i), e.innerText = " ", t.appendChild(e));
36
+ e || (e = document.createElement("div"), e.classList.add(n), e.innerText = " ", t.appendChild(e));
37
37
  }
38
- constructor(t, e, s, o) {
39
- super(t, e, s, o), this._mainDomElement = e, this._injectStyles(), this._initializeDragGhost();
38
+ constructor(t, e, r, a) {
39
+ super(t, e, r, a), this._mainDomElement = e, this._injectStyles(), this._initializeDragGhost();
40
40
  }
41
41
  async init() {
42
42
  if (await super.init(), this._mode === "website")
43
43
  try {
44
- const { DragInFromWebsiteStrategy: t } = await import("./from-website-CFTjWbqp.mjs");
44
+ const { DragInFromWebsiteStrategy: t } = await import("./from-website-Bvd5Pi0i.mjs");
45
45
  this._strategy = new t(
46
46
  this._instance,
47
47
  this._mainDomElement,
@@ -52,7 +52,7 @@ class E extends I {
52
52
  }
53
53
  else if (this._mode === "custom-view")
54
54
  try {
55
- const { DragInFromCustomViewStrategy: t } = await import("./from-custom-view-5SS9UqAH.mjs");
55
+ const { DragInFromCustomViewStrategy: t } = await import("./from-custom-view-T67aFIDR.mjs");
56
56
  this._strategy = new t(
57
57
  this._instance,
58
58
  this._mainDomElement,
@@ -68,8 +68,8 @@ class E extends I {
68
68
  get isDragging() {
69
69
  return this._strategy.isDragging;
70
70
  }
71
- dragStart(t, e, s = "rml_id") {
72
- this._strategy.dragStart(t, e, s);
71
+ dragStart(t, e, r = "rml_id") {
72
+ this._strategy.dragStart(t, e, r);
73
73
  }
74
74
  dragUpdate(t) {
75
75
  this._strategy.dragUpdate(t);
@@ -77,8 +77,8 @@ class E extends I {
77
77
  dragEnd() {
78
78
  this._strategy.dragEnd();
79
79
  }
80
- touchStart(t, e, s = "rml_id") {
81
- this._strategy.touchStart(t, e, s);
80
+ touchStart(t, e, r = "rml_id") {
81
+ this._strategy.touchStart(t, e, r);
82
82
  }
83
83
  touchMove(t) {
84
84
  this._strategy.touchMove(t);
@@ -95,20 +95,20 @@ class E extends I {
95
95
  registerCustomDrag({
96
96
  customDragStart: t,
97
97
  customDragEnd: e,
98
- customDragUpdate: s,
99
- beforeUpdateGhost: o
98
+ customDragUpdate: r,
99
+ beforeUpdateGhost: a
100
100
  }) {
101
- o && this._strategy.beforeUpdateGhost(o);
102
- const r = this._customDragSignal.signal, _ = (a) => {
103
- a.target.getAttribute("data-rml-draggable") === "true" && t(a);
104
- }, n = (a) => {
105
- this._strategy.releaseInput(a), this._strategy.isDragging && e(a);
106
- }, d = (a) => {
107
- s(a);
101
+ a && this._strategy.beforeUpdateGhost(a);
102
+ const o = this._customDragSignal.signal, p = (s) => {
103
+ s.target.getAttribute("data-rml-draggable") === "true" && (s.target.setPointerCapture && s.target.setPointerCapture(s.pointerId), t(s));
104
+ }, i = (s) => {
105
+ this._strategy.releaseInput(s), this._strategy.isDragging && e(s);
106
+ }, u = (s) => {
107
+ r(s);
108
108
  };
109
- document.querySelectorAll('[data-rml-draggable="true"]').forEach((a) => {
110
- a.draggable = !1;
111
- }), document.addEventListener("mousedown", _, { signal: r }), document.addEventListener("mouseup", n, { signal: r }), document.addEventListener("mousemove", d, { signal: r }), document.addEventListener("mouseleave", n, { signal: r }), document.addEventListener("touchstart", _, { signal: r }), document.addEventListener("touchend", n, { signal: r }), document.addEventListener("touchmove", d, { signal: r });
109
+ document.querySelectorAll('[data-rml-draggable="true"]').forEach((s) => {
110
+ s.draggable = !1, s.style.touchAction = "none";
111
+ }), document.addEventListener("pointerdown", p, { signal: o }), document.addEventListener("pointermove", u, { signal: o }), document.addEventListener("pointerup", i, { signal: o }), document.addEventListener("pointercancel", i, { signal: o });
112
112
  }
113
113
  unregisterCustomDrag() {
114
114
  this._customDragSignal.abort(), this._customDragSignal = new AbortController();
@@ -117,23 +117,24 @@ class E extends I {
117
117
  this._strategy.releaseInput(t);
118
118
  }
119
119
  }
120
- const M = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
120
+ const C = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
121
121
  __proto__: null,
122
122
  DragIn: E
123
123
  }, Symbol.toStringTag, { value: "Module" }));
124
124
  export {
125
125
  E as D,
126
- N as R,
127
- g as a,
128
- p as b,
129
- S as c,
130
- T as d,
131
- b as e,
132
- f,
133
- R as g,
134
- G as h,
135
- D as i,
136
- y as j,
137
- i as k,
138
- M as l
126
+ A as R,
127
+ c as T,
128
+ D as a,
129
+ n as b,
130
+ N as c,
131
+ _ as d,
132
+ y as e,
133
+ S as f,
134
+ T as g,
135
+ f as h,
136
+ b as i,
137
+ R as j,
138
+ G as k,
139
+ C as l
139
140
  };
@@ -1,13 +1,14 @@
1
- import { D as R, g as D, b as G, h as L, c as I, R as T, f as S, d as a, e as M, a as N } from "./embedding-plugins-Cm7O1pKC.mjs";
1
+ import { D as R, j as D, e as G, k as T, f as L, c as I, i as S, g as a, h as M, d as N, T as O } from "./embedding-plugins-DqMSzAJe.mjs";
2
2
  export {
3
3
  R as DragIn,
4
4
  D as RML_DRAG_GHOST_FADE_IN,
5
5
  G as RML_DRAG_GHOST_FADE_IN_ANIMATION_CSS,
6
- L as RML_DRAG_GHOST_FADE_OUT,
7
- I as RML_DRAG_GHOST_FADE_OUT_ANIMATION_CSS,
8
- T as RML_DRAG_IN_DRAG_ELEMENT_ID,
6
+ T as RML_DRAG_GHOST_FADE_OUT,
7
+ L as RML_DRAG_GHOST_FADE_OUT_ANIMATION_CSS,
8
+ I as RML_DRAG_IN_DRAG_ELEMENT_ID,
9
9
  S as RML_DRAG_IN_FALLBACK_GHOST_HEIGHT,
10
10
  a as RML_DRAG_IN_FALLBACK_GHOST_URL,
11
11
  M as RML_DRAG_IN_FALLBACK_GHOST_WIDTH,
12
- N as RML_DRAG_IN_STYLES_ID
12
+ N as RML_DRAG_IN_STYLES_ID,
13
+ O as TARGET_OPACITY
13
14
  };
@@ -1 +1 @@
1
- import{D as _,g as A,b as a,h as s,c as R,R as D,f as G,d as L,e as I,a as T}from"./embedding-plugins-Dzhuj1By.mjs";export{_ as DragIn,A as RML_DRAG_GHOST_FADE_IN,a as RML_DRAG_GHOST_FADE_IN_ANIMATION_CSS,s as RML_DRAG_GHOST_FADE_OUT,R as RML_DRAG_GHOST_FADE_OUT_ANIMATION_CSS,D as RML_DRAG_IN_DRAG_ELEMENT_ID,G as RML_DRAG_IN_FALLBACK_GHOST_HEIGHT,L as RML_DRAG_IN_FALLBACK_GHOST_URL,I as RML_DRAG_IN_FALLBACK_GHOST_WIDTH,T as RML_DRAG_IN_STYLES_ID};
1
+ import{D as _,j as A,e as s,k as a,f as R,c as D,i as G,g as T,h as L,d as I,T as S}from"./embedding-plugins-DLVs7ER4.mjs";export{_ as DragIn,A as RML_DRAG_GHOST_FADE_IN,s as RML_DRAG_GHOST_FADE_IN_ANIMATION_CSS,a as RML_DRAG_GHOST_FADE_OUT,R as RML_DRAG_GHOST_FADE_OUT_ANIMATION_CSS,D as RML_DRAG_IN_DRAG_ELEMENT_ID,G as RML_DRAG_IN_FALLBACK_GHOST_HEIGHT,T as RML_DRAG_IN_FALLBACK_GHOST_URL,L as RML_DRAG_IN_FALLBACK_GHOST_WIDTH,I as RML_DRAG_IN_STYLES_ID,S as TARGET_OPACITY};
@@ -0,0 +1 @@
1
+ import{i as t,e,b as s}from"./utils-BqTPLNLs.mjs";import{i,h as a,g as r}from"./embedding-plugins-DLVs7ER4.mjs";import{E as n}from"./drag-ghost-B7UAYefM.mjs";const h=(e,s=0)=>t(e)?{clientX:e.touches[s].clientX,clientY:e.touches[s].clientY}:{clientX:e.clientX,clientY:e.clientY},o=e=>!e||!t(e)||e.touches.length>0;class _{_touchDragTimeOut;_onTouchDragStart;_payload=null;_delay=500;_firstTouch=null;_lastTouch=null;_epsilon=10;constructor(t,{onTouchDragStart:e},s={}){this._payload=t,this._onTouchDragStart=e,this._delay="number"==typeof s.delay?s.delay:500,this._epsilon="number"==typeof s.epsilon?s.epsilon:10}onStart(e){o(e)&&(this._touchDragTimeOut||(this._firstTouch=h(e,t(e)?e.touches.length-1:0),this._touchDragTimeOut=setTimeout(()=>{this._clearTimeout(),this._lastTouch||(this._lastTouch=h(e)),this._checkXDistance(e)()},this._delay)))}onEnd(){this._resetTouches()}onMove(t){o(t)&&(this._lastTouch=h(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())}}}const l=t=>{t.preventDefault(),t.stopPropagation()};class g{_startX=0;_startY=0;_lastX=0;_lastY=0;_epsilon;_isWaiting=!1;_onCustomDragStart;constructor({onCustomDragStart:t},e={}){this._epsilon="number"==typeof e.epsilon?e.epsilon:15,this._onCustomDragStart=t}onMove(t){this._lastX=t.clientX,this._lastY=t.clientY,this._isWaiting&&((t,e)=>{const s=this._lastX-t,i=this._lastY-e;return Math.sqrt(s*s+i*i)})(this._startX,this._startY)>this._epsilon&&(this._onCustomDragStart(t),this._isWaiting=!1)}onStart(t){this._startX=t.clientX,this._startY=t.clientY,this.onMove(t),this._isWaiting=!0}onEnd(){this._reset()}_reset(){this._startX=0,this._startY=0,this._lastX=0,this._lastY=0,this._isWaiting=!1}}const c="data-rml-old-draggable",u=(e,s)=>{const i=t(e),a={delay:i?500:100,epsilon:i?10:15};if(!s)return a;if(!(i||e instanceof MouseEvent))return a;const{delayKey:r,epsilonKey:n}=i?{delayKey:"touchDragDelay",epsilonKey:"touchDragEpsilon"}:{delayKey:"customDragDelay",epsilonKey:"customDragEpsilon"};return"number"==typeof s[r]&&(a.delay=s.touchDragDelay),"number"==typeof s[n]&&(a.epsilon=s.touchDragEpsilon),a};class d{_options={};_instance;_mainDomElement;_viewName;_currentCustomDrag=null;_currentBb=null;_startTarget=null;_dragGhost=null;_onBeforeUpdateDrag=()=>({});isDragging=!1;_hasEnteredIframe=!1;_pendingDragIn=null;_canvasBb=null;_overlayBb=null;_dragGeneration=0;_interactionContainerBb=null;constructor(t,e,s,i){this._instance=t,this._options=s||{},this._viewName=i,this._mainDomElement=e,this._mainDomElement.parentElement?.addEventListener("dragleave",()=>{this._instance.cancelDragIn()})}beforeUpdateGhost(t){this._onBeforeUpdateDrag=t}async _dragStart(t,e,s="rml_id"){const i=++this._dragGeneration;if(this._startTarget&&(this._startTarget.style.pointerEvents="none",this._startTarget.style.userSelect="none",this._startTarget.setAttribute(c,this._startTarget.draggable.toString()),this._startTarget.draggable=!1,this._startTarget.removeEventListener("dragstart",l),this._startTarget.addEventListener("dragstart",l)),this._startTarget){const t=this._startTarget.getBoundingClientRect(),e=this._startTarget.cloneNode(!0);e.style.width=`${t.width}px`,e.style.height=`${t.height}px`,this._dragGhost=new n(e)}else this._dragGhost=new n;var a;this._currentBb=await this._instance.getBoundingClientRect((a=this._viewName,`[data-rml-custom-view="${a}"]`)),this._canvasBb=await this._instance.getBoundingClientRect("canvas"),this._overlayBb=(await this._instance.getDrawerBoundingClientRect()).final,this._interactionContainerBb=await this._instance.getBoundingClientRect(".interaction-container"),i===this._dragGeneration&&(this._pendingDragIn={id:t,type:s},this._hasEnteredIframe=!1,this.isDragging=!0)}_dragUpdate(t){document.body.focus(),this._currentCustomDrag&&this._currentCustomDrag.onMove(t);const{clientX:n,clientY:h}=e(t);if(this._dragGhost){const{width:t,height:e}=this._mainDomElement.getBoundingClientRect();this._dragGhost.updateDragGhost(n,h,{ghost:{visibleIn:{x:0,y:0,width:t,height:e}}})}if(!this._currentBb||!this.isDragging)return;const o=this._currentBb.x+n,_=this._currentBb.y+h,l=s(o,_,this._canvasBb,this._overlayBb,this._interactionContainerBb);if(l&&!this._hasEnteredIframe&&this._pendingDragIn&&(this._instance.dragInObject(this._pendingDragIn.id,o,_,this._pendingDragIn.type),this._hasEnteredIframe=!0),!l&&this._hasEnteredIframe&&(this._instance.cancelDragIn(),this._hasEnteredIframe=!1),!this._hasEnteredIframe)return;const{url:g,width:c,height:u}=(t=>{let e="",s=a,n=i;if(!t)return{url:r,width:s,height:n};const h=t;if(h instanceof HTMLElement){const t=h.getBoundingClientRect(),i=h.getAttribute("data-rml-ghost-url"),a=h.getAttribute("data-rml-ghost-width"),o=h.getAttribute("data-rml-ghost-height");i?e=i:!i&&h instanceof HTMLImageElement&&h.src&&(e=h.src),e?(s=t.width,n=t.height):e=r,s=a?parseInt(a,10):s,n=o?parseInt(o,10):n}return{url:e||r,width:s,height:n}})(this._startTarget),d=this._options||{},m={ghost:{visibleIn:{x:this._currentBb.x-(d.dragInOverlapX||0),y:this._currentBb.y+(d.dragInOverlapY||0),width:this._currentBb.width+(d.dragInOverlapX||0),height:this._currentBb.height+(d.dragInOverlapY||0)},url:g,width:c,height:u},mode:"custom-view"},{x:p,y:D,options:T}=this._onBeforeUpdateDrag(o,_,m),y="number"==typeof p?p:o,b="number"==typeof D?D:_,f=T||m;this._instance.updateDrag(y,b,f)}_dragEnd(){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._currentCustomDrag=null,this.isDragging=!1,this._currentBb=null,this._canvasBb=null,this._overlayBb=null,this._interactionContainerBb=null,this._resetStartTarget(),this._instance.enableEvents(),this._dragGhost&&(this._dragGhost.removeDragGhost(),this._dragGhost=null),this._hasEnteredIframe&&this._instance.dragInObjectEnd(),this._hasEnteredIframe=!1,this._pendingDragIn=null}dragStart(e,s,i){this._instance.disableEvents(),this._startTarget=s.target,this._currentCustomDrag=t(s)?new _(void 0,{onTouchDragStart:(t,s)=>{this._dragStart(e,s,i)}},{...u(s,this._options),delay:0}):new g({onCustomDragStart:t=>this._dragStart(e,t,i)},u(s,this._options)),this._currentCustomDrag.onStart(s)}dragEnd(){this._dragEnd()}dragUpdate(t){this._dragUpdate(t)}touchStart(t,e,s="rml_id"){this.dragStart(t,e,s)}touchMove(t){this.dragUpdate(t)}touchEnd(){this.dragEnd()}dispose(){}_resetStartTarget(){this._startTarget&&(this._startTarget.style.pointerEvents="",this._startTarget.style.userSelect="",this._startTarget.draggable="true"===this._startTarget.getAttribute(c),this._startTarget.removeAttribute(c),this._startTarget.removeEventListener("dragstart",l))}releaseInput(t){this._dragGeneration++,this._dragEnd()}}export{d as DragInFromCustomViewStrategy};
@@ -0,0 +1,249 @@
1
+ import { i as o, e as X, b as A } from "./utils-Dav4kGNW.mjs";
2
+ import { i as Y, h as L, g as c } from "./embedding-plugins-DqMSzAJe.mjs";
3
+ import { E } from "./drag-ghost-DHrf_Evu.mjs";
4
+ const m = 500, f = 10, R = 100, I = 15, g = (i, t = 0) => o(i) ? {
5
+ clientX: i.touches[t].clientX,
6
+ clientY: i.touches[t].clientY
7
+ } : {
8
+ clientX: i.clientX,
9
+ clientY: i.clientY
10
+ }, b = (i) => i && o(i) ? i.touches.length > 0 : !0;
11
+ class M {
12
+ _touchDragTimeOut;
13
+ _onTouchDragStart;
14
+ _payload = null;
15
+ _delay = m;
16
+ _firstTouch = null;
17
+ _lastTouch = null;
18
+ _epsilon = f;
19
+ constructor(t, { onTouchDragStart: s }, e = {}) {
20
+ this._payload = t, this._onTouchDragStart = s, this._delay = typeof e.delay == "number" ? e.delay : m, this._epsilon = typeof e.epsilon == "number" ? e.epsilon : f;
21
+ }
22
+ onStart(t) {
23
+ b(t) && (this._touchDragTimeOut || (this._firstTouch = g(
24
+ t,
25
+ o(t) ? t.touches.length - 1 : 0
26
+ ), this._touchDragTimeOut = setTimeout(() => {
27
+ this._clearTimeout(), this._lastTouch || (this._lastTouch = g(t)), this._checkXDistance(t)();
28
+ }, this._delay)));
29
+ }
30
+ onEnd() {
31
+ this._resetTouches();
32
+ }
33
+ onMove(t) {
34
+ b(t) && (this._lastTouch = g(t));
35
+ }
36
+ _clearTimeout() {
37
+ this._touchDragTimeOut && (clearTimeout(this._touchDragTimeOut), this._touchDragTimeOut = null);
38
+ }
39
+ _resetTouches() {
40
+ this._clearTimeout(), this._lastTouch = null, this._firstTouch = null, this._payload = null;
41
+ }
42
+ _checkXDistance(t) {
43
+ return () => {
44
+ if (!this._firstTouch || !this._lastTouch)
45
+ return;
46
+ let s = !1;
47
+ s = Math.abs(
48
+ this._firstTouch.clientX - this._lastTouch.clientX
49
+ ) < this._epsilon, s && (this._onTouchDragStart(this._payload, t), this._resetTouches());
50
+ };
51
+ }
52
+ }
53
+ const U = (i) => `[data-rml-custom-view="${i}"]`, u = (i) => {
54
+ i.preventDefault(), i.stopPropagation();
55
+ }, x = (i, t, s, e) => {
56
+ const a = s - i, r = e - t;
57
+ return Math.sqrt(a * a + r * r);
58
+ };
59
+ class H {
60
+ _startX = 0;
61
+ _startY = 0;
62
+ _lastX = 0;
63
+ _lastY = 0;
64
+ _epsilon;
65
+ _isWaiting = !1;
66
+ _onCustomDragStart;
67
+ constructor({ onCustomDragStart: t }, s = {}) {
68
+ this._epsilon = typeof s.epsilon == "number" ? s.epsilon : I, this._onCustomDragStart = t;
69
+ }
70
+ onMove(t) {
71
+ this._lastX = t.clientX, this._lastY = t.clientY, this._isWaiting && x(
72
+ this._startX,
73
+ this._startY,
74
+ this._lastX,
75
+ this._lastY
76
+ ) > this._epsilon && (this._onCustomDragStart(t), this._isWaiting = !1);
77
+ }
78
+ onStart(t) {
79
+ this._startX = t.clientX, this._startY = t.clientY, this.onMove(t), this._isWaiting = !0;
80
+ }
81
+ onEnd() {
82
+ this._reset();
83
+ }
84
+ _reset() {
85
+ this._startX = 0, this._startY = 0, this._lastX = 0, this._lastY = 0, this._isWaiting = !1;
86
+ }
87
+ }
88
+ const d = "data-rml-old-draggable", K = void 0, y = (i, t) => {
89
+ const s = o(i), e = {
90
+ delay: s ? m : R,
91
+ epsilon: s ? f : I
92
+ };
93
+ if (!t)
94
+ return e;
95
+ if (!s && !(i instanceof MouseEvent))
96
+ return console.warn(
97
+ "Unsupported event! It is not TouchEvent and also not MouseEvent"
98
+ ), e;
99
+ const {
100
+ delayKey: a,
101
+ epsilonKey: r
102
+ } = s ? { delayKey: "touchDragDelay", epsilonKey: "touchDragEpsilon" } : { delayKey: "customDragDelay", epsilonKey: "customDragEpsilon" };
103
+ return typeof t[a] == "number" && (e.delay = t.touchDragDelay), typeof t[r] == "number" && (e.epsilon = t.touchDragEpsilon), e;
104
+ }, N = (i) => {
105
+ let t = "", s = L, e = Y;
106
+ if (!i)
107
+ return { url: c, width: s, height: e };
108
+ const a = i;
109
+ if (a instanceof HTMLElement) {
110
+ const r = a.getBoundingClientRect(), n = a.getAttribute("data-rml-ghost-url"), h = a.getAttribute("data-rml-ghost-width"), l = a.getAttribute("data-rml-ghost-height");
111
+ n ? t = n : !n && a instanceof HTMLImageElement && a.src && (t = a.src), t ? (s = r.width, e = r.height) : t = c, s = h ? parseInt(h, 10) : s, e = l ? parseInt(l, 10) : e;
112
+ }
113
+ return { url: t || c, width: s, height: e };
114
+ };
115
+ class P {
116
+ _options = {};
117
+ _instance;
118
+ _mainDomElement;
119
+ _viewName;
120
+ _currentCustomDrag = null;
121
+ _currentBb = null;
122
+ _startTarget = null;
123
+ _dragGhost = null;
124
+ _onBeforeUpdateDrag = () => ({});
125
+ isDragging = !1;
126
+ _hasEnteredIframe = !1;
127
+ _pendingDragIn = null;
128
+ _canvasBb = null;
129
+ _overlayBb = null;
130
+ _dragGeneration = 0;
131
+ _interactionContainerBb = null;
132
+ constructor(t, s, e, a) {
133
+ this._instance = t, this._options = e || {}, this._viewName = a, this._mainDomElement = s, this._mainDomElement.parentElement?.addEventListener("dragleave", () => {
134
+ this._instance.cancelDragIn();
135
+ });
136
+ }
137
+ beforeUpdateGhost(t) {
138
+ this._onBeforeUpdateDrag = t;
139
+ }
140
+ async _dragStart(t, s, e = "rml_id") {
141
+ const a = ++this._dragGeneration;
142
+ if (this._startTarget && (this._startTarget.style.pointerEvents = "none", this._startTarget.style.userSelect = "none", this._startTarget.setAttribute(
143
+ d,
144
+ this._startTarget.draggable.toString()
145
+ ), this._startTarget.draggable = !1, this._startTarget.removeEventListener("dragstart", u), this._startTarget.addEventListener("dragstart", u)), this._startTarget) {
146
+ const r = this._startTarget.getBoundingClientRect(), n = this._startTarget.cloneNode(!0);
147
+ n.style.width = `${r.width}px`, n.style.height = `${r.height}px`, this._dragGhost = new E(n);
148
+ } else
149
+ this._dragGhost = new E();
150
+ this._currentBb = await this._instance.getBoundingClientRect(
151
+ U(this._viewName)
152
+ ), this._canvasBb = await this._instance.getBoundingClientRect("canvas"), this._overlayBb = (await this._instance.getDrawerBoundingClientRect()).final, this._interactionContainerBb = await this._instance.getBoundingClientRect(
153
+ ".interaction-container"
154
+ ), a === this._dragGeneration && (this._pendingDragIn = { id: t, type: e }, this._hasEnteredIframe = !1, this.isDragging = !0);
155
+ }
156
+ _dragUpdate(t) {
157
+ document.body.focus(), this._currentCustomDrag && this._currentCustomDrag.onMove(t);
158
+ const { clientX: s, clientY: e } = X(t);
159
+ if (this._dragGhost) {
160
+ const { width: v, height: w } = this._mainDomElement.getBoundingClientRect();
161
+ this._dragGhost.updateDragGhost(s, e, {
162
+ ghost: { visibleIn: { x: 0, y: 0, width: v, height: w } }
163
+ });
164
+ }
165
+ if (!this._currentBb || !this.isDragging)
166
+ return;
167
+ const a = this._currentBb.x + s, r = this._currentBb.y + e, n = A(
168
+ a,
169
+ r,
170
+ this._canvasBb,
171
+ this._overlayBb,
172
+ this._interactionContainerBb
173
+ );
174
+ if (n && !this._hasEnteredIframe && this._pendingDragIn && (this._instance.dragInObject(
175
+ this._pendingDragIn.id,
176
+ a,
177
+ r,
178
+ this._pendingDragIn.type
179
+ ), this._hasEnteredIframe = !0), !n && this._hasEnteredIframe && (this._instance.cancelDragIn(), this._hasEnteredIframe = !1), !this._hasEnteredIframe)
180
+ return;
181
+ const { url: h, width: l, height: C } = N(this._startTarget), _ = this._options || {}, D = {
182
+ ghost: {
183
+ visibleIn: {
184
+ x: this._currentBb.x - (_.dragInOverlapX || 0),
185
+ y: this._currentBb.y + (_.dragInOverlapY || 0),
186
+ width: this._currentBb.width + (_.dragInOverlapX || 0),
187
+ height: this._currentBb.height + (_.dragInOverlapY || 0)
188
+ },
189
+ url: h,
190
+ width: l,
191
+ height: C
192
+ },
193
+ mode: "custom-view"
194
+ }, {
195
+ x: p,
196
+ y: T,
197
+ options: B
198
+ } = this._onBeforeUpdateDrag(a, r, D), G = typeof p == "number" ? p : a, S = typeof T == "number" ? T : r, O = B || D;
199
+ this._instance.updateDrag(G, S, O);
200
+ }
201
+ _dragEnd() {
202
+ this._currentCustomDrag && this._currentCustomDrag.onEnd(), this._currentCustomDrag = null, this.isDragging = !1, this._currentBb = null, this._canvasBb = null, this._overlayBb = null, this._interactionContainerBb = null, this._resetStartTarget(), this._instance.enableEvents(), this._dragGhost && (this._dragGhost.removeDragGhost(), this._dragGhost = null), this._hasEnteredIframe && this._instance.dragInObjectEnd(), this._hasEnteredIframe = !1, this._pendingDragIn = null;
203
+ }
204
+ dragStart(t, s, e) {
205
+ this._instance.disableEvents(), this._startTarget = s.target;
206
+ const a = (r, n) => {
207
+ this._dragStart(t, n, e);
208
+ };
209
+ this._currentCustomDrag = o(s) ? new M(
210
+ K,
211
+ {
212
+ onTouchDragStart: a
213
+ },
214
+ // No long-press delay for custom-view — drag should start immediately on touch
215
+ { ...y(s, this._options), delay: 0 }
216
+ ) : new H(
217
+ {
218
+ onCustomDragStart: (r) => this._dragStart(t, r, e)
219
+ },
220
+ y(s, this._options)
221
+ ), this._currentCustomDrag.onStart(s);
222
+ }
223
+ dragEnd() {
224
+ this._dragEnd();
225
+ }
226
+ dragUpdate(t) {
227
+ this._dragUpdate(t);
228
+ }
229
+ touchStart(t, s, e = "rml_id") {
230
+ this.dragStart(t, s, e);
231
+ }
232
+ touchMove(t) {
233
+ this.dragUpdate(t);
234
+ }
235
+ touchEnd() {
236
+ this.dragEnd();
237
+ }
238
+ dispose() {
239
+ }
240
+ _resetStartTarget() {
241
+ this._startTarget && (this._startTarget.style.pointerEvents = "", this._startTarget.style.userSelect = "", this._startTarget.draggable = this._startTarget.getAttribute(d) === "true", this._startTarget.removeAttribute(d), this._startTarget.removeEventListener("dragstart", u));
242
+ }
243
+ releaseInput(t) {
244
+ this._dragGeneration++, this._dragEnd();
245
+ }
246
+ }
247
+ export {
248
+ P as DragInFromCustomViewStrategy
249
+ };