@roomle/embedding-lib 5.13.0 → 5.14.0
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 +42 -2
- package/{drag-in-Do47zdKL.mjs → drag-in-C6gLvrDx.mjs} +2 -2
- package/{drag-in-CYmR1HFI.mjs → drag-in-w_TrusdP.mjs} +1 -1
- package/{from-custom-view-DYkvyOw3.mjs → from-custom-view-BEcgFlAL.mjs} +1 -1
- package/{from-custom-view-BVWf7SQ7.mjs → from-custom-view-jmf3K6AT.mjs} +1 -1
- package/from-website-Ckh5GB2h.mjs +4 -0
- package/{from-website-DDMDPp-F.mjs → from-website-VCMg3teu.mjs} +2 -1
- package/package.json +2 -2
- package/packages/common/src/utils/init-data.d.ts +1 -0
- package/packages/embedding-lib/src/connector.d.ts +1 -1
- package/packages/embedding-lib/src/embedding-lib.d.ts +1 -1
- package/roomle-embedding-lib.es.js +9 -8
- package/roomle-embedding-lib.es.min.js +1 -1
- package/roomle-embedding-lib.umd.js +2 -2
- package/roomle-embedding-lib.umd.min.js +3 -3
- package/src/common/business-logic/event-emitter.d.ts +4 -1
- package/src/common/components/collection-view/-utils/collection-view-dynamic-components.d.ts +86 -965
- package/src/common/components/overlays/PartList.vue.d.ts +3 -4
- package/src/common/components/overlays/bottom-bar/CloseView.vue.d.ts +105 -60
- package/src/common/components/overlays/part-list/partlist-setup.d.ts +3 -4
- package/src/common/composables/use-configurator-api.d.ts +2 -2
- package/src/common/composables/use-core-instances.d.ts +2 -2
- package/src/common/composables/use-event-emitter-listener.d.ts +9 -1
- package/src/common/composables/use-open-close-anim.d.ts +9 -0
- package/src/common/composables/use-static-item-parameters.d.ts +2 -2
- package/src/common/utils/helper.d.ts +6 -7
- package/src/common/utils/parameters.d.ts +2 -2
- package/src/common/utils/types.d.ts +9 -1
- package/src/common/utils/ui-actions.d.ts +2 -3
- package/src/configurator/business-logic/roomle-sdk-wrapper.d.ts +3 -4
- package/src/configurator/business-logic/sdk-connector-configurator.d.ts +3 -4
- package/src/configurator/business-logic/sdk-connector.d.ts +7 -8
- package/src/configurator/components/Overlays.vue.d.ts +614 -356
- package/src/configurator/components/grid-view/-utils/ExpandedView.vue.d.ts +2 -2
- package/src/configurator/components/grid-view/-utils/GridViewHelper.d.ts +2 -2
- package/src/configurator/components/grid-view/GridView.vue.d.ts +25 -319
- package/src/configurator/components/overlays/DeleteWarning.vue.d.ts +102 -59
- package/src/configurator/components/overlays/ElementDisabled.vue.d.ts +102 -59
- package/src/configurator/components/overlays/GenericError.vue.d.ts +102 -59
- package/src/configurator/components/overlays/NoDocking.vue.d.ts +102 -59
- package/src/configurator/components/overlays/VariantWarning.vue.d.ts +102 -59
- package/src/configurator/components/overlays/ar/OpenAR.vue.d.ts +2 -2
- package/src/configurator/components/parameters/types/MaterialParameter.vue.d.ts +27 -320
- package/src/configurator/components/parameters/types/ProductVariant.vue.d.ts +27 -320
- package/src/configurator/components/parameters/types/ThumbnailsParameter.vue.d.ts +27 -320
- package/src/configurator/components/utils/PopUp.vue.d.ts +42 -72
- package/src/configurator/embedding/exposed-api.d.ts +7 -4
- package/src/configurator/embedding/exposed-callbacks.d.ts +4 -1
- package/src/configurator/embedding/helper.d.ts +4 -3
- package/src/configurator/embedding/types.d.ts +5 -0
- package/src/planner/business-logic/sdk-connector-planner.d.ts +5 -5
- package/src/planner/components/ObjectList.vue.d.ts +4 -2
- package/src/planner/components/measurements/MeasurementDisplayComponent.vue.d.ts +4 -0
- package/src/planner/components/measurements/ShowWallAtticMeasurements.vue.d.ts +8 -0
- package/src/planner/components/measurements/utils/AtticLabel.vue.d.ts +24 -0
- package/src/planner/components/measurements/utils/AtticLine.vue.d.ts +26 -0
- package/src/planner/components/overlays/ProductList.vue.d.ts +2 -2
- package/src/planner/components/overlays/ProductSettings.vue.d.ts +3 -4
- package/src/planner/components/overlays/product-list/ProductListEntry.vue.d.ts +2 -2
- package/src/planner/components/overlays/product-list/ProductListType.vue.d.ts +2 -2
- package/src/planner/components/overlays/product-settings/ProductPositions.vue.d.ts +3 -3
- package/src/planner/components/overlays/product-settings/ProductRotation.vue.d.ts +3 -3
- package/src/planner/components/overlays/product-settings/ProductSettingsInfos.vue.d.ts +3 -3
- package/src/planner/components/overlays/product-settings/ProductSize.vue.d.ts +3 -3
- package/src/planner/components/overlays/product-settings/ProductXYZChanger.vue.d.ts +3 -3
- package/src/planner/components/overlays/rooms/ConstructionVariants.vue.d.ts +28 -321
- package/src/planner/components/overlays/rooms/DoorParametersSetting.vue.d.ts +33 -326
- package/src/planner/components/overlays/rooms/ElementLengthScaling.vue.d.ts +2 -2
- package/src/planner/components/overlays/rooms/FloorColor.vue.d.ts +2 -2
- package/src/planner/components/overlays/rooms/RoomGeneralSettings.vue.d.ts +2 -2
- package/src/planner/components/overlays/rooms/RoomsList.vue.d.ts +2 -2
- package/src/planner/components/overlays/rooms/SlopingRoof.vue.d.ts +2 -2
- package/src/planner/components/overlays/rooms/SlopingRoofDirection.vue.d.ts +2 -2
- package/src/planner/components/overlays/rooms/SlopingRoofDirectionTooltip.vue.d.ts +2 -0
- package/src/planner/components/overlays/rooms/SlopingRoofTooltip.vue.d.ts +2 -0
- package/src/planner/components/overlays/rooms/WallGeneralSettings.vue.d.ts +2 -2
- package/src/planner/components/overlays/rooms/WindowParametersSetting.vue.d.ts +3 -4
- 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 +2 -2
- package/from-website-Dx2SUftr.mjs +0 -4
|
@@ -1,6 +1,46 @@
|
|
|
1
|
-
## [5.
|
|
1
|
+
## [5.14.0](https://github.com/roomle-dev/roomle-ui/compare/embedding-lib-v5.13.0...embedding-lib-v5.14.0) (2025-03-25)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Features
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
* add attic measurements ([e170b64](https://github.com/roomle-dev/roomle-ui/commit/e170b6421867bb3babf6837e6ec71fe2ab38f5b2))
|
|
7
|
+
* add explainer icon to sloping roof section ([30a8670](https://github.com/roomle-dev/roomle-ui/commit/30a867078441bc8805735e86937e984e37981434))
|
|
8
|
+
* add open close animation toggle ([424af53](https://github.com/roomle-dev/roomle-ui/commit/424af535943158db98ef6e3469b07acd18d55d41))
|
|
9
|
+
* make catalog handle external objects ([489f0e0](https://github.com/roomle-dev/roomle-ui/commit/489f0e08553f80b7365b77f18342357fcecdc6de))
|
|
10
|
+
* **SDK:** upgrade to version 2.95.1 ([#1527](https://github.com/roomle-dev/roomle-ui/issues/1527)) ([fc5e226](https://github.com/roomle-dev/roomle-ui/commit/fc5e22685061c6b07a630a368f7f7a51a7ac351e))
|
|
11
|
+
* **SDK:** upgrade to version 2.96.0-alpha.10 ([#1542](https://github.com/roomle-dev/roomle-ui/issues/1542)) ([41076e3](https://github.com/roomle-dev/roomle-ui/commit/41076e3d378d2ccd376422f012257448a0a51ba4))
|
|
12
|
+
* **SDK:** upgrade to version 2.96.0-alpha.11 ([#1543](https://github.com/roomle-dev/roomle-ui/issues/1543)) ([dee9b2c](https://github.com/roomle-dev/roomle-ui/commit/dee9b2c212583413a9be1381bf66a1d75d4cfbb9))
|
|
13
|
+
* **SDK:** upgrade to version 2.96.0-alpha.12 ([#1544](https://github.com/roomle-dev/roomle-ui/issues/1544)) ([d98dd15](https://github.com/roomle-dev/roomle-ui/commit/d98dd15e85c1a2c9684ed084e1542d04adf10e8c))
|
|
14
|
+
* **SDK:** upgrade to version 2.96.0-alpha.13 ([#1546](https://github.com/roomle-dev/roomle-ui/issues/1546)) ([ccd3ade](https://github.com/roomle-dev/roomle-ui/commit/ccd3adeebcfe259f75cdd8b31ee769f2e2903b39))
|
|
15
|
+
* **SDK:** upgrade to version 2.96.0-alpha.14 ([#1547](https://github.com/roomle-dev/roomle-ui/issues/1547)) ([cd58fb8](https://github.com/roomle-dev/roomle-ui/commit/cd58fb8b233ffddcae31e871c09e6877f47a075c))
|
|
16
|
+
* **SDK:** upgrade to version 2.96.0-alpha.16 ([#1548](https://github.com/roomle-dev/roomle-ui/issues/1548)) ([23470be](https://github.com/roomle-dev/roomle-ui/commit/23470be520b4d323bfe28d2dd3270581476456e0))
|
|
17
|
+
* **SDK:** upgrade to version 2.96.0-alpha.17 ([#1549](https://github.com/roomle-dev/roomle-ui/issues/1549)) ([78641df](https://github.com/roomle-dev/roomle-ui/commit/78641dfe3d7e35e612c80d52d5a2ecb69b72314d))
|
|
18
|
+
* **SDK:** upgrade to version 2.96.0-alpha.18 ([#1550](https://github.com/roomle-dev/roomle-ui/issues/1550)) ([435a6fb](https://github.com/roomle-dev/roomle-ui/commit/435a6fb9e5063e25e83de0a4821de73da4dbd1b3))
|
|
19
|
+
* **SDK:** upgrade to version 2.96.0-alpha.19 ([#1552](https://github.com/roomle-dev/roomle-ui/issues/1552)) ([ecd3361](https://github.com/roomle-dev/roomle-ui/commit/ecd3361cd978f48e72c33836751f6276b5a09998))
|
|
20
|
+
* **SDK:** upgrade to version 2.96.0-alpha.2 ([#1526](https://github.com/roomle-dev/roomle-ui/issues/1526)) ([b8a5b26](https://github.com/roomle-dev/roomle-ui/commit/b8a5b26426deed868a8bc85d1dc04a861715387e))
|
|
21
|
+
* **SDK:** upgrade to version 2.96.0-alpha.3 ([#1529](https://github.com/roomle-dev/roomle-ui/issues/1529)) ([89bb09a](https://github.com/roomle-dev/roomle-ui/commit/89bb09a5c2f13e383d7f07ef12e60edc85c12fca))
|
|
22
|
+
* **SDK:** upgrade to version 2.96.0-alpha.4 ([#1531](https://github.com/roomle-dev/roomle-ui/issues/1531)) ([13ef8b3](https://github.com/roomle-dev/roomle-ui/commit/13ef8b3196755091d15c4debad03a95d950f49a4))
|
|
23
|
+
* **SDK:** upgrade to version 2.96.0-alpha.5 ([#1533](https://github.com/roomle-dev/roomle-ui/issues/1533)) ([c19e5d9](https://github.com/roomle-dev/roomle-ui/commit/c19e5d944e8fcb12a0c626752c38ec204487e9fb))
|
|
24
|
+
* **SDK:** upgrade to version 2.96.0-alpha.6 ([#1535](https://github.com/roomle-dev/roomle-ui/issues/1535)) ([eabf798](https://github.com/roomle-dev/roomle-ui/commit/eabf7981515fff4f6dad3709bc31cf435137d238))
|
|
25
|
+
* **SDK:** upgrade to version 2.96.0-alpha.7 ([#1536](https://github.com/roomle-dev/roomle-ui/issues/1536)) ([cf50e3a](https://github.com/roomle-dev/roomle-ui/commit/cf50e3abad14310547a674c579b6953697f7ca0a))
|
|
26
|
+
* **SDK:** upgrade to version 2.96.0-alpha.8 ([#1540](https://github.com/roomle-dev/roomle-ui/issues/1540)) ([98998b6](https://github.com/roomle-dev/roomle-ui/commit/98998b638400ab7af0acaf3faee4f51fbdf3b192))
|
|
27
|
+
* **SDK:** upgrade to version 2.96.0-alpha.9 ([#1541](https://github.com/roomle-dev/roomle-ui/issues/1541)) ([a03765b](https://github.com/roomle-dev/roomle-ui/commit/a03765b8760b507b20c350e0ccf4942b59b70d43))
|
|
28
|
+
* wall side icon and explainer ([9768983](https://github.com/roomle-dev/roomle-ui/commit/9768983a3d79e5d2e856b949f5743db9644f2247))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* **code-review:** apply suggestion from code review, see: ([026b7a1](https://github.com/roomle-dev/roomle-ui/commit/026b7a16f23534af7f0e49f31838cc5b937ef089)), closes [/github.com/roomle-dev/roomle-ui/pull/1518/files#r1984804936](https://github.com/roomle-dev//github.com/roomle-dev/roomle-ui/pull/1518/files/issues/r1984804936)
|
|
34
|
+
* **planner:** call startConfiguring only once ([92c6655](https://github.com/roomle-dev/roomle-ui/commit/92c6655ff4de901ddfd83bea23804034b07b071c))
|
|
35
|
+
* css for share draft email field visual glitch. ([82f285c](https://github.com/roomle-dev/roomle-ui/commit/82f285c6432ce50c8f6775232ae9eeb2b497c3a2))
|
|
36
|
+
* failing tests ([ed1649c](https://github.com/roomle-dev/roomle-ui/commit/ed1649cbb46bc1937caeb182cfd5f30b0feb4091))
|
|
37
|
+
* failing tests ([2e0ff31](https://github.com/roomle-dev/roomle-ui/commit/2e0ff31248f2a4ea32e6e62b232c00132be8acc4))
|
|
38
|
+
* Feature flag is not working for openCloseAnimation ([90c4b1f](https://github.com/roomle-dev/roomle-ui/commit/90c4b1fc3a67a47c41ecffefd3a5bcb2401c95c1))
|
|
39
|
+
* feedback changes ([9047a41](https://github.com/roomle-dev/roomle-ui/commit/9047a4189273db37e31a6c9ac87d6840b18cad89))
|
|
40
|
+
* icon css, show in planner only ([8d69fff](https://github.com/roomle-dev/roomle-ui/commit/8d69fff7732894e1572c3738a40992d9413ff8ee))
|
|
41
|
+
* positions tutorial correctly if custom view is active ([e0c249f](https://github.com/roomle-dev/roomle-ui/commit/e0c249fa5bfda6f05223c0baa056aa62bc6725d5))
|
|
42
|
+
* prevent default drag cursor (not-allowed) on windows ([3c33cef](https://github.com/roomle-dev/roomle-ui/commit/3c33cefc8e6c2c674be4e99dd7ab825e651d4992))
|
|
43
|
+
* reverse the order of collectionView icon and text ([deaec0d](https://github.com/roomle-dev/roomle-ui/commit/deaec0dbf3fd6003e0b6326719925a7f8d50db44))
|
|
44
|
+
* tests ([edd4cea](https://github.com/roomle-dev/roomle-ui/commit/edd4cea03e2cd9490223cdaed130f2e23cc66a6f))
|
|
45
|
+
* **code-review:** tried to fix the following problem that came up during code-review: ([79d0c5d](https://github.com/roomle-dev/roomle-ui/commit/79d0c5da9ad112b1894f5da8ccc3c5b0557fb994)), closes [/github.com/roomle-dev/roomle-ui/pull/1518/files#r1984799244](https://github.com/roomle-dev//github.com/roomle-dev/roomle-ui/pull/1518/files/issues/r1984799244)
|
|
46
|
+
* type errors ([da36d23](https://github.com/roomle-dev/roomle-ui/commit/da36d232745491c07da000714f2bb61e6a4e38bb))
|
|
@@ -45,7 +45,7 @@ class G extends I {
|
|
|
45
45
|
async init() {
|
|
46
46
|
if (await super.init(), this._mode === "website")
|
|
47
47
|
try {
|
|
48
|
-
const { DragInFromWebsiteStrategy: t } = await import("./from-website-
|
|
48
|
+
const { DragInFromWebsiteStrategy: t } = await import("./from-website-VCMg3teu.mjs");
|
|
49
49
|
this._strategy = new t(
|
|
50
50
|
this._instance,
|
|
51
51
|
this._mainDomElement,
|
|
@@ -56,7 +56,7 @@ class G extends I {
|
|
|
56
56
|
}
|
|
57
57
|
else if (this._mode === "custom-view")
|
|
58
58
|
try {
|
|
59
|
-
const { DragInFromCustomViewStrategy: t } = await import("./from-custom-view-
|
|
59
|
+
const { DragInFromCustomViewStrategy: t } = await import("./from-custom-view-BEcgFlAL.mjs");
|
|
60
60
|
this._strategy = new t(
|
|
61
61
|
this._instance,
|
|
62
62
|
this.options,
|
|
@@ -4,4 +4,4 @@ var w=Object.defineProperty,E=(r,t,e)=>t in r?w(r,t,{enumerable:!0,configurable:
|
|
|
4
4
|
.${d}{position:absolute;top:0;left:0;width:1px;height:1px;z-index:999;pointer-events:none;background-color:transparent;}
|
|
5
5
|
${D}
|
|
6
6
|
${f}
|
|
7
|
-
`,document.head.appendChild(t)}}_initializeDragGhost(){const t=this._mainDomElement.parentNode;let e=t.querySelector("."+d);e||(e=document.createElement("div"),e.classList.add(d),e.innerText=" ",t.appendChild(e))}async init(){if(await super.init(),this._mode==="website")try{const{DragInFromWebsiteStrategy:t}=await import("./from-website-
|
|
7
|
+
`,document.head.appendChild(t)}}_initializeDragGhost(){const t=this._mainDomElement.parentNode;let e=t.querySelector("."+d);e||(e=document.createElement("div"),e.classList.add(d),e.innerText=" ",t.appendChild(e))}async init(){if(await super.init(),this._mode==="website")try{const{DragInFromWebsiteStrategy:t}=await import("./from-website-Ckh5GB2h.mjs");this._strategy=new t(this._instance,this._mainDomElement,{settings:this.options,mode:"website"})}catch(t){throw console.error('Could not load Dragin strategy "FromWebsite"'),t}else if(this._mode==="custom-view")try{const{DragInFromCustomViewStrategy:t}=await import("./from-custom-view-jmf3K6AT.mjs");this._strategy=new t(this._instance,this.options,this._viewName)}catch(t){throw console.error('Could not load Dragin strategy "FromCustomView"'),t}else throw new Error("Unsupported mode")}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:o}){o&&this._strategy.beforeUpdateGhost(o);const i=this._customDragSignal.signal,m=s=>{s.target.getAttribute("data-rml-draggable")==="true"&&t(s)},g=s=>{this._strategy.releaseInput(s),this._strategy.isDragging&&e(s)},c=s=>{a(s)};document.querySelectorAll('[data-rml-draggable="true"]').forEach(s=>{s.draggable=!1}),document.addEventListener("mousedown",m,{signal:i}),document.addEventListener("mouseup",g,{signal:i}),document.addEventListener("mousemove",c,{signal:i}),document.addEventListener("mouseleave",g,{signal:i}),document.addEventListener("touchstart",m,{signal:i}),document.addEventListener("touchend",g,{signal:i}),document.addEventListener("touchmove",c,{signal:i})}unregisterCustomDrag(){this._customDragSignal.abort(),this._customDragSignal=new AbortController}releaseInput(t){this._strategy.releaseInput(t)}}const j=Object.freeze(Object.defineProperty({__proto__:null,DragIn:U},Symbol.toStringTag,{value:"Module"}));export{$ as R,l as a,D as b,f as c,I as d,N as e,x as f,L as g,C as h,h as i,y as j,d as k,j as l};
|
|
@@ -2,7 +2,7 @@ var A = Object.defineProperty;
|
|
|
2
2
|
var O = (e, t, s) => t in e ? A(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
3
|
var i = (e, t, s) => O(e, typeof t != "symbol" ? t + "" : t, s);
|
|
4
4
|
import { C as T, e as m, i as b, T as v, b as B, c as I, d as L } from "./touch-drag-DNDPwZ-_.mjs";
|
|
5
|
-
import { d as c, e as Y, f as X } from "./drag-in-
|
|
5
|
+
import { d as c, e as Y, f as X } from "./drag-in-C6gLvrDx.mjs";
|
|
6
6
|
const G = (e) => `[data-rml-custom-view="${e}"]`, l = (e) => {
|
|
7
7
|
e.preventDefault(), e.stopPropagation();
|
|
8
8
|
}, w = (e, t, s, r) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var w=Object.defineProperty,C=(e,t,s)=>t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,i=(e,t,s)=>C(e,typeof t!="symbol"?t+"":t,s);import{C as b,e as D,i as v,T as B,b as X,c as Y,d as I}from"./touch-drag-C1SsZtt4.mjs";import{d as u,e as M,f as U}from"./drag-in-
|
|
1
|
+
var w=Object.defineProperty,C=(e,t,s)=>t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,i=(e,t,s)=>C(e,typeof t!="symbol"?t+"":t,s);import{C as b,e as D,i as v,T as B,b as X,c as Y,d as I}from"./touch-drag-C1SsZtt4.mjs";import{d as u,e as M,f as U}from"./drag-in-w_TrusdP.mjs";const O=e=>`[data-rml-custom-view="${e}"]`,l=e=>{e.preventDefault(),e.stopPropagation()},A=(e,t,s,r)=>{const a=s-e,n=r-t;return Math.sqrt(a*a+n*n)};class x{constructor({onCustomDragStart:t},s={}){i(this,"_startX",0),i(this,"_startY",0),i(this,"_lastX",0),i(this,"_lastY",0),i(this,"_epsilon"),i(this,"_isWaiting",!1),i(this,"_onCustomDragStart"),this._epsilon=typeof s.epsilon=="number"?s.epsilon:b,this._onCustomDragStart=t}onMove(t){this._lastX=t.clientX,this._lastY=t.clientY,this._isWaiting&&A(this._startX,this._startY,this._lastX,this._lastY)>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",K=void 0,y=(e,t)=>{const s=v(e),r={delay:s?X:Y,epsilon:s?I:b};if(!t)return r;if(!s&&!(e instanceof MouseEvent))return console.warn("Unsupported event! It is not TouchEvent and also not MouseEvent"),r;const{delayKey:a,epsilonKey:n}=s?{delayKey:"touchDragDelay",epsilonKey:"touchDragEpsilon"}:{delayKey:"customDragDelay",epsilonKey:"customDragEpsilon"};return typeof t[a]=="number"&&(r.delay=t.touchDragDelay),typeof t[n]=="number"&&(r.epsilon=t.touchDragEpsilon),r},L=e=>{let t="",s=M,r=U;if(!e)return{url:u,width:s,height:r};const a=e;if(a instanceof HTMLElement){const n=a.getBoundingClientRect(),o=a.getAttribute("data-rml-ghost-url"),h=a.getAttribute("data-rml-ghost-width"),g=a.getAttribute("data-rml-ghost-height");o?t=o:!o&&a instanceof HTMLImageElement&&a.src&&(t=a.src),t?(s=n.width,r=n.height):t=u,s=h?parseInt(h,10):s,r=g?parseInt(g,10):r}return{url:t||u,width:s,height:r}};class W{constructor(t,s,r){i(this,"_options",{}),i(this,"_instance"),i(this,"_viewName"),i(this,"_currentCustomDrag",null),i(this,"_currentBb",null),i(this,"_startTarget",null),i(this,"_onBeforeUpdateDrag",()=>({})),i(this,"isDragging",!1),this._instance=t,this._options=s||{},this._viewName=r}beforeUpdateGhost(t){this._onBeforeUpdateDrag=t}async _dragStart(t,s,r="rml_id"){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._currentBb=await this._instance.getBoundingClientRect(O(this._viewName));const{clientX:a,clientY:n}=D(s),o=this._currentBb.x+a,h=this._currentBb.y+n;this.isDragging=!0,this._instance.dragInObject(t,o,h,r)}_dragUpdate(t){if(document.body.focus(),this._currentCustomDrag&&this._currentCustomDrag.onMove(t),!this._currentBb||!this.isDragging)return;const{clientX:s,clientY:r}=D(t),{url:a,width:n,height:o}=L(this._startTarget),h=this._currentBb.x+s,g=this._currentBb.y+r,_=this._options||{},d={ghost:{visibleIn:{x:this._currentBb.x-(_.dragInOverlapX||0),y:this._currentBb.y+(_.dragInOverlapY||0),width:this._currentBb.width+(_.dragInOverlapX||0),height:this._currentBb.height+(_.dragInOverlapY||0)},url:a,width:n,height:o},mode:"custom-view"},{x:p,y:m,options:T}=this._onBeforeUpdateDrag(h,g,d),f=typeof p=="number"?p:h,E=typeof m=="number"?m:g,S=T||d;this._instance.updateDrag(f,E,S)}_dragEnd(){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._currentCustomDrag=null,this.isDragging=!1,this._currentBb=null,this._resetStartTarget(),this._instance.enableEvents(),this._instance.dragInObjectEnd()}dragStart(t,s,r){this._instance.disableEvents(),this._startTarget=s.target;const a=(n,o)=>{this._dragStart(t,o,r)};this._currentCustomDrag=v(s)?new B(K,{onTouchDragStart:a},y(s,this._options)):new x({onCustomDragStart:n=>this._dragStart(t,n,r)},y(s,this._options)),this._currentCustomDrag.onStart(s)}dragEnd(){this._dragEnd()}dragUpdate(t){this._dragUpdate(t)}touchStart(t,s,r="rml_id"){this.dragStart(t,s,r)}touchMove(t){this.dragUpdate(t)}touchEnd(){this.dragEnd()}dispose(){}_resetStartTarget(){this._startTarget&&(this._startTarget.style.pointerEvents="",this._startTarget.style.userSelect="",this._startTarget.draggable=this._startTarget.getAttribute(c)==="true",this._startTarget.removeAttribute(c),this._startTarget.removeEventListener("dragstart",l))}releaseInput(t){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._resetStartTarget()}}export{W as DragInFromCustomViewStrategy};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var P=Object.defineProperty,R=(r,e,t)=>e in r?P(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,g=(r,e,t)=>R(r,typeof e!="symbol"?e+"":e,t);import{g as B,e as D,a as x,i as C,T as M}from"./touch-drag-C1SsZtt4.mjs";import{R as _,a as I,b as O,c as L,d as N,e as E,f as b,g as F,h as G,i as y,j as A,k as Y}from"./drag-in-w_TrusdP.mjs";const w=(r,e,t=0,i=0)=>{const s=e.x+e.width+t,o=e.x-t,l=e.y+e.height+i,a=e.y-i,{x:h,y:n}=r;return h>=o&&h<=s&&n>=a&&n<=l},T=(r,e,t,i=0,s=0)=>{if(!(!t||!t.hiddenIn&&!t.visibleIn))return t.visibleIn?w({x:r,y:e},t.visibleIn,i,s):t.hiddenIn?!w({x:r,y:e},t.hiddenIn,-i,-s):!1},k=()=>{if(!document.getElementById(I)){const r=document.createElement("style");r.type="text/css",r.id=I,r.innerHTML=`
|
|
2
|
+
${O}
|
|
3
|
+
${L}
|
|
4
|
+
`,document.head.appendChild(r)}},U=({x:r,y:e},t)=>{var i,s,o,l,a,h;let n=document.getElementById(_);if(!n){if(n=document.createElement("div"),(i=t.ghost)!=null&&i.element)n.appendChild(t.ghost.element);else{const d=document.createElement("img");d.src=((s=t.ghost)==null?void 0:s.url)||N,d.width=((o=t.ghost)==null?void 0:o.width)||E,d.height=((l=t.ghost)==null?void 0:l.height)||b,n.appendChild(d)}n.id=_,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",T(r,e,t.ghost||{},(a=t.settings)==null?void 0:a.dragInOverlapX,(h=t.settings)==null?void 0:h.dragInOverlapY)||(n.style.display="none"),n.style.pointerEvents="none",document.body.appendChild(n)}},X=({x:r,y:e},t)=>{var i,s,o,l;const a=document.getElementById(_);if(!a)return;let h=(i=t.ghost)==null?void 0:i.width,n=(s=t.ghost)==null?void 0:s.height;typeof h>"u"&&(h=a.getBoundingClientRect().width||E),typeof n>"u"&&(n=a.getBoundingClientRect().height||b);const d=r-h/2,c=e-n/2;a.style.transform=`translate3d(${d}px, ${c}px, 0)`,t.ghost&&(T(r,e,t.ghost,(o=t.settings)==null?void 0:o.dragInOverlapX,(l=t.settings)==null?void 0:l.dragInOverlapY)?a.style.animation!=F&&(a.style.animation=F):a.style.animation!=G&&(a.style.animation=G))};class ${constructor(e=null){g(this,"_dragGhostAnimationFrameId",null),g(this,"_dragGhostRemoveAnimationFrameId",null),g(this,"_dragGhostElement",null),this._dragGhostElement=e}updateDragGhost(e,t,i){var s;this._dragGhostRemoveAnimationFrameId&&(cancelAnimationFrame(this._dragGhostRemoveAnimationFrameId),this._dragGhostRemoveAnimationFrameId=null),!((s=i.ghost)!=null&&s.external)&&i.ghost&&(this._dragGhostAnimationFrameId||(this._dragGhostAnimationFrameId=requestAnimationFrame(()=>{k();const o={x:e,y:t};!i.ghost&&this._dragGhostElement&&(i.ghost={}),i.ghost&&!i.ghost.element&&this._dragGhostElement&&(i.ghost.element=this._dragGhostElement),U(o,i),X(o,i),this._dragGhostAnimationFrameId=null})))}removeDragGhost(){this._dragGhostAnimationFrameId&&(cancelAnimationFrame(this._dragGhostAnimationFrameId),this._dragGhostAnimationFrameId=null),this._dragGhostRemoveAnimationFrameId||(this._dragGhostRemoveAnimationFrameId=requestAnimationFrame(()=>{const e=document.getElementById(_);e&&document.body.removeChild(e),this._dragGhostRemoveAnimationFrameId=null}))}}class q{constructor(e,t,i){g(this,"_options",{}),g(this,"_instance"),g(this,"_mainDomElement"),g(this,"_currentDrag",{}),g(this,"_currentTouch",null),g(this,"_firefoxDragPosition",{x:0,y:0}),g(this,"_onBeforeUpdateDrag",()=>({})),g(this,"isDragging",!1),g(this,"_firefoxFallback",s=>{if(!this._currentDrag.event)return;s.preventDefault();const o=s||window.event;this._firefoxDragPosition.x=o.pageX||0,this._firefoxDragPosition.y=o.pageY||0}),this._instance=e,this._mainDomElement=t,this._options=i||{},this._firefoxFallback=this._firefoxFallback.bind(this),document.addEventListener("dragover",this._firefoxFallback)}beforeUpdateGhost(e){this._onBeforeUpdateDrag=e}dragStart(e,t,i="rml_id"){const s=this._mainDomElement.parentNode;if(B(s).position!=="relative"){console.warn("Parent of iframe should have position relative, otherwise drag-in can not detect the x/y coordinates correctly");return}this._mainDomElement.style.pointerEvents="none";let o=s.querySelector("."+y);o||(o=document.createElement("div"),o.classList.add(y),s.appendChild(o)),o.classList.remove(A.DISPLAY_NONE),t.target.getAttribute("draggable")||console.warn(`Draggable not detected correctly! Did you add draggable="true" to the element? In Sarafi only 'draggable' is too less`);const l=s.querySelector("."+Y);this._currentDrag.event=t;const a=t.target,h=a.cloneNode(),n=a.getBoundingClientRect();h.style.width=`${n.width}px`,h.style.height=`${n.height}px`,this._currentDrag.ghost=new $(h),this._currentDrag.offset||(this._currentDrag.offset={x:0,y:0});const{clientX:d,clientY:c}=D(t,this._firefoxDragPosition);this._currentDrag.offset.x=d-n.left,this._currentDrag.offset.y=c-n.top,t instanceof DragEvent&&t.dataTransfer&&t.dataTransfer.setDragImage&&t.dataTransfer.setDragImage(l,0,0);const{x:f,y:m}=x(s,this._currentDrag.event||t,this._firefoxDragPosition),p=Math.max(1,f),v=Math.max(1,m);this.isDragging=!0,this._instance.dragInObject(e,p,v,i)}dragUpdate(e){var t;const i=this._mainDomElement.parentNode,{x:s,y:o}=x(i,e,this._firefoxDragPosition);if(s===0&&o===0)return;const l=Math.max(1,s),a=Math.max(1,o);if(l===1&&a===1)return;let h=l,n=a;if(C(e)){const u=((t=this._options.settings)==null?void 0:t.fingerSize)||0;h=Math.max(2,l+u),n=Math.max(2,a-u)}const{x:d,y:c,options:f}=this._onBeforeUpdateDrag(h,n,{}),m=f||{settings:{},ghost:{}};m.ghost||(m.ghost={}),m.ghost.visibleIn&&m.ghost.hiddenIn||(m.ghost.hiddenIn=this._mainDomElement.getBoundingClientRect());const p=typeof d=="number"?d:h,v=typeof c=="number"?c:n;if(this._currentDrag.ghost){const{clientX:u,clientY:S}=D(e,this._firefoxDragPosition);this._currentDrag.ghost.updateDragGhost(u,S,m)}this._instance.updateDrag(p,v,{})}dragEnd(){this._mainDomElement.style.pointerEvents="all";const e=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 t=e.querySelector("."+y);t&&t.classList.add(A.DISPLAY_NONE)}touchStart(e,t,i="rml_id"){var s,o,l,a;t.preventDefault();const h=(d,c)=>{this.dragStart(e,c,i)},n={};typeof((o=(s=this._options)==null?void 0:s.settings)==null?void 0:o.touchDragDelay)=="number"&&(n.delay=this._options.settings.touchDragDelay),(a=(l=this._options)==null?void 0:l.settings)!=null&&a.touchDragEpsilon&&(n.epsilon=this._options.settings.touchDragEpsilon),this._currentTouch=new M(void 0,{onTouchDragStart:h},n),this._currentTouch.onStart(t)}touchMove(e){this._currentTouch&&this._currentTouch.onMove(e),this._currentDrag.event&&this.dragUpdate(e)}touchEnd(){this._currentTouch&&this._currentTouch.onEnd(),this._currentTouch=null,this.dragEnd()}dispose(){document.removeEventListener("dragover",this._firefoxFallback)}releaseInput(e){}}export{q as DragInFromWebsiteStrategy};
|
|
@@ -2,7 +2,7 @@ var F = Object.defineProperty;
|
|
|
2
2
|
var M = (r, e, t) => e in r ? F(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var l = (r, e, t) => M(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
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 u, 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-
|
|
5
|
+
import { R as u, 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-C6gLvrDx.mjs";
|
|
6
6
|
const T = (r, e, t = 0, n = 0) => {
|
|
7
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
8
|
return o >= i && o <= s && h >= d && h <= a;
|
|
@@ -96,6 +96,7 @@ class z {
|
|
|
96
96
|
l(this, "_firefoxFallback", (e) => {
|
|
97
97
|
if (!this._currentDrag.event)
|
|
98
98
|
return;
|
|
99
|
+
e.preventDefault();
|
|
99
100
|
const t = e || window.event;
|
|
100
101
|
this._firefoxDragPosition.x = t.pageX || 0, this._firefoxDragPosition.y = t.pageY || 0;
|
|
101
102
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roomle/embedding-lib",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.14.0",
|
|
4
4
|
"description": "This is a small library which can be used to communicate with the Roomle Configurator",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./roomle-embedding-lib.umd.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"npm": "8.3.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@roomle/web-sdk": "2.
|
|
32
|
+
"@roomle/web-sdk": "2.96.0-alpha.19"
|
|
33
33
|
},
|
|
34
34
|
"repository": {
|
|
35
35
|
"type": "git",
|
|
@@ -23,7 +23,7 @@ export declare class Connector<SdkType, SdkCallbacks> implements RoomleEmbedding
|
|
|
23
23
|
pluginsLoaded: Array<Promise<void>>;
|
|
24
24
|
ui: ExposedApi;
|
|
25
25
|
extended: SdkType;
|
|
26
|
-
configurator: RoomleConfigurator
|
|
26
|
+
configurator: RoomleConfigurator<readonly []>;
|
|
27
27
|
analytics: {
|
|
28
28
|
callbacks: ExposedAnalyticsCallbacks;
|
|
29
29
|
};
|
|
@@ -24,7 +24,7 @@ export type RoomleViewerApi = RoomleEmbeddingApi<RoomleGLBViewer, ConfiguratorUi
|
|
|
24
24
|
export type RoomlePlannerApi = RoomleEmbeddingApi<RoomlePlanner, ConfiguratorUiCallbacks>;
|
|
25
25
|
export default class RoomleEmbeddingApi<SdkType, SdkCallbacks> extends Connector<SdkType, SdkCallbacks> {
|
|
26
26
|
static createPlanner(configuratorId: string, container: HTMLElement, initData: UiInitData, plugins?: PluginDefinitions): Promise<RoomlePlannerApi>;
|
|
27
|
-
static connect(customView: PossibleCustomViews, plugins?: PluginDefinitions): Promise<Connector<RoomleConfigurator
|
|
27
|
+
static connect(customView: PossibleCustomViews, plugins?: PluginDefinitions): Promise<Connector<RoomleConfigurator<readonly []>, ConfiguratorUiCallbacks>>;
|
|
28
28
|
/**
|
|
29
29
|
* Method to create a new instance of a Roomle Configurator
|
|
30
30
|
* @param configuratorId the id which identifies your configurator, you will get this ID from your Roomle Contact Person
|
|
@@ -206,7 +206,8 @@ const z = {
|
|
|
206
206
|
saveToIdb: !0,
|
|
207
207
|
featureFlags: {
|
|
208
208
|
mocAr: !0,
|
|
209
|
-
wallAutoHeight: !1
|
|
209
|
+
wallAutoHeight: !1,
|
|
210
|
+
openCloseAnimation: !1
|
|
210
211
|
},
|
|
211
212
|
rotationSnapDegrees: 10,
|
|
212
213
|
interactionsCollapsed: !1
|
|
@@ -238,7 +239,7 @@ const z = {
|
|
|
238
239
|
}, X = "<CONF_ID>", Z = "#CONFIGURATIONID#", j = (e) => {
|
|
239
240
|
e.featureFlags || (e.featureFlags = {}), typeof e.featureFlags.realPartList != "boolean" && (e.featureFlags.realPartList = !0), typeof e.featureFlags.globalCallbacks != "boolean" && (e.featureFlags.globalCallbacks = !0), typeof e.featureFlags.mocAr != "boolean" && (e.featureFlags.mocAr = !1);
|
|
240
241
|
}, M = () => /(android)/i.test(navigator.userAgent);
|
|
241
|
-
class
|
|
242
|
+
class A {
|
|
242
243
|
constructor() {
|
|
243
244
|
c(this, "_messageHandler", null);
|
|
244
245
|
c(this, "isSetupDone", !1);
|
|
@@ -296,7 +297,7 @@ class y {
|
|
|
296
297
|
typeof r == "string" && r === "dragIn" ? this.pluginsLoaded.push(
|
|
297
298
|
new Promise((n, a) => {
|
|
298
299
|
try {
|
|
299
|
-
import("./drag-in-
|
|
300
|
+
import("./drag-in-C6gLvrDx.mjs").then((i) => i.l).then(
|
|
300
301
|
({ DragIn: i }) => {
|
|
301
302
|
const l = new i(
|
|
302
303
|
this.ui,
|
|
@@ -334,7 +335,7 @@ class y {
|
|
|
334
335
|
);
|
|
335
336
|
}
|
|
336
337
|
}
|
|
337
|
-
const
|
|
338
|
+
const y = () => {
|
|
338
339
|
let e, t;
|
|
339
340
|
return { promise: new Promise((o, r) => {
|
|
340
341
|
e = o, t = r;
|
|
@@ -364,7 +365,7 @@ const A = () => {
|
|
|
364
365
|
ANDROID_HEIGHT: "rml-android-height",
|
|
365
366
|
OVERFLOW_HIDDEN: "rml-overflow-hidden"
|
|
366
367
|
}, w = /* @__PURE__ */ new Map();
|
|
367
|
-
class te extends
|
|
368
|
+
class te extends A {
|
|
368
369
|
constructor(s, o, r, n, a) {
|
|
369
370
|
super();
|
|
370
371
|
c(this, "_waitForIframe");
|
|
@@ -382,7 +383,7 @@ class te extends y {
|
|
|
382
383
|
const g = r.zIndex || 9999999, h = document.createElement("style");
|
|
383
384
|
h.type = "text/css", h.id = b;
|
|
384
385
|
const m = "transition:all ease-in-out " + ee + "ms;", f = ["-webkit-", "-o-"].reduce(
|
|
385
|
-
(
|
|
386
|
+
(C, D) => C += D + m,
|
|
386
387
|
""
|
|
387
388
|
) + m, P = H();
|
|
388
389
|
h.innerHTML = `
|
|
@@ -414,9 +415,9 @@ class te extends y {
|
|
|
414
415
|
);
|
|
415
416
|
}
|
|
416
417
|
static async connect(s, o = []) {
|
|
417
|
-
const r = new
|
|
418
|
+
const r = new A();
|
|
418
419
|
r.viewName = s;
|
|
419
|
-
const { resolve: n, promise: a } =
|
|
420
|
+
const { resolve: n, promise: a } = y(), { resolve: i, promise: l } = y(), d = ({
|
|
420
421
|
message: m,
|
|
421
422
|
args: f
|
|
422
423
|
}) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var H=Object.defineProperty,U=(s,e,t)=>e in s?H(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,c=(s,e,t)=>U(s,typeof e!="symbol"?e+"":e,t);class I{constructor(e,t,r,i){c(this,"_side"),c(this,"_incomingMessageBus",null),c(this,"_outgoingMessageBus",null),c(this,"_execMessage",null),this._side=e,this._incomingMessageBus=t,this._outgoingMessageBus=r,this._execMessage=i,this._incomingMessageBus&&this._incomingMessageBus.addEventListener("message",this._handleMessage.bind(this))}setOutgoingMessageBus(e){this._outgoingMessageBus=e}setMessageExecution(e){this._execMessage=e}sendMessage(e,t=[]){return new Promise((r,i)=>{if(this._incomingMessageBus===this._outgoingMessageBus)return r(void 0);const o=new MessageChannel;o.port1.onmessage=n=>{if(!n||!n.data)return o.port1.close(),o.port2.close(),i(new Error(this._side+" received message but response can not be interpreted"));let l;try{l=JSON.parse(n.data)}catch(u){return o.port1.close(),o.port2.close(),this._prepareError(u),i(u)}l.error?i(l.error):l.result!==void 0?r(l.result):r(void 0),o.port1.close(),o.port2.close()};let a="";try{a=JSON.stringify({message:e,args:t})}catch{return i(new Error(this._side+": can not create command because it is not JSON.stringify able"))}if(!this._outgoingMessageBus)return i(new Error(this._side+": outgoing bus not set yet"));this._outgoingMessageBus.postMessage(a,"*",[o.port2])})}_handleMessage(e){const t=e.ports&&Array.isArray(e.ports)&&e.ports.length>0?e.ports[0]:null;if(e.data&&t)try{const r=JSON.parse(e.data);if(!this._execMessage)return t.postMessage(JSON.stringify({error:this._side+" is not ready to handle messages"}));Array.isArray(r.args)||(r.args=[r.args]);const i=this._execMessage(r,e);if(i===void 0)return;i.then((o={})=>{let a,n;typeof o=="object"&&o!==null&&(a=o.error,n=o.result),a?t.postMessage(JSON.stringify({error:a})):n!==void 0?t.postMessage(JSON.stringify({result:n})):t.postMessage(JSON.stringify({result:o}))},o=>{t.postMessage(JSON.stringify({error:this._prepareError(o)}))})}catch(r){t.postMessage(JSON.stringify({error:this._prepareError(r)}))}}_prepareError(e){if(typeof e=="string"){const t=this._side+": "+e;return console.error(t),t}return e.message=this._side+": "+e.message,console.error(e),e.message}}const p=".",f={REQUEST_BOOT:"requestBoot",SETUP:"setup",WEBSITE_READY:"websiteReady"},_={GET_METHODS:"getMethods",RETURN_METHODS:"returnMethods",REGISTER_CUSTOM_VIEW:"registerCustomView",REGISTER_CUSTOM_VIEW_DONE:"registerCustomViewDone"},B=async(s,e)=>{if(typeof s!="string")throw new Error('Configurator ID is not a string type: "'+typeof s+'"');const t=e.customApiUrl?e.customApiUrl:"https://api.roomle.com/v2",r=e.overrideTenant||9,i=t+"/configurators/"+s,o="roomle_portal_v2",a="03-"+window.btoa(new Date().toISOString()+";anonymous;"+o),n=()=>{const d={apiKey:o,currentTenant:r,locale:"en",language:"en",device:1,token:a,platform:"web"};return new Headers(d)},l=new Request(i,{method:"GET",headers:n(),mode:"cors",cache:"default"}),u=await fetch(l),{configurator:h}=await u.json();return h},F=()=>{try{return window.self!==window.top}catch{return!0}},C=["127.0.0.1","localhost","0.0.0.0"],k=()=>{const s=F();let e=window.location.href;if(s){if(!document.referrer)return null;e=document.referrer}const{hostname:t}=new URL(e);return t},x=s=>!!(C.includes(s)||s.endsWith("roomle.com")||s.endsWith("gitlab.io")||s.endsWith("gitlab.com")),y=["language","browserLanguage","userLanguage","systemLanguage"],W=(s=null)=>{const e=window.navigator;if(s)return s.substr(0,2);if(Array.isArray(e.languages)&&e.languages.length>0)return e.languages[0].substr(0,2);for(let t=0,r=y.length;t<r;t++){const i=e[y[t]];if(i)return i.substr(0,2)}return"en"},V=(s,e)=>{const t=JSON.parse(JSON.stringify(s));return w(t,e)},w=(s,e)=>{for(const t in e)try{e[t].constructor===Object?s[t]=w(s[t],e[t]):s[t]=e[t]}catch{s[t]=e[t]}return s};var T=(s=>(s.BOTTOM_BAR="bottom_bar",s.PARTLIST_BOUNDS="partlist_bounds",s.INTERACTION_NOTES="interaction_notes",s))(T||{}),G={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};const J={mobileLandscape:!0,floorMaterialRootTag:"materials_root",buttons:{renderimage:!0,requestproduct:!0,requestplan:!0,load_product:!0,partlist_print:!0},elements:{[T.INTERACTION_NOTES]:!0},helpcenter:{roomdesigner:!0,configurator:!1,disable:!1},firstPersonView:!0,saveToIdb:!0,featureFlags:{mocAr:!0,wallAutoHeight:!1},rotationSnapDegrees:10,interactionsCollapsed:!1},$="(idle)",j=s=>(E(s),s!=null&&s.customApiUrl&&(s.customApiUrl=decodeURIComponent(s.customApiUrl)),s.shareUrl&&(s.deeplink=s.shareUrl.replace(Y,Q)),s),E=s=>{if(!s)return;const e=Object.keys(s);for(const t of e){const r=s[t];if(!Array.isArray(r)&&typeof r=="object"&&r!==null&&E(r),Array.isArray(r))for(const i of r)E(i);(r==="true"||r==="false")&&(s[t]=r==="true")}},z=(s,e)=>{e.configuratorId=s.id;const t=s.settings||{};return!e.overrideTenant&&s.tenant&&(e.overrideTenant=s.tenant),V(t,e)},q=()=>{const s={...J};s.locale||(s.locale=W()),s.id===$&&delete s.id;const e=k();return e&&x(e)&&(s.configuratorId="demoConfigurator"),s.customApiUrl=G.VITE_RAPI_URL,s.emails=!1,s},Y="<CONF_ID>",Q="#CONFIGURATIONID#",K=s=>{s.featureFlags||(s.featureFlags={}),typeof s.featureFlags.realPartList!="boolean"&&(s.featureFlags.realPartList=!0),typeof s.featureFlags.globalCallbacks!="boolean"&&(s.featureFlags.globalCallbacks=!0),typeof s.featureFlags.mocAr!="boolean"&&(s.featureFlags.mocAr=!1)},M=()=>/(android)/i.test(navigator.userAgent);class v{constructor(){c(this,"_messageHandler",null),c(this,"isSetupDone",!1),c(this,"viewName","main"),c(this,"plugins",{}),c(this,"pluginsLoaded",[]),c(this,"ui",{callbacks:null}),c(this,"extended",{callbacks:null}),c(this,"configurator",{callbacks:null}),c(this,"analytics",{callbacks:{}}),c(this,"global",{callbacks:{}})}setMessageHandler(e){this._messageHandler=e}handleSetup(e){const{methods:t,callbacks:r}=e;t.forEach(i=>{const o=i.split(p),a=o[0],n=o[1];this[a]||(this[a]={}),this[a][n]=function(){if(!this._messageHandler){console.error("MessageHandler not set");return}return this._messageHandler.sendMessage(i,[...arguments])}.bind(this)}),r.forEach(i=>{const o=i.split(p),a=o[0],n=o[1],l=o[2];this[a]||(this[a]={}),this[a][n]||(this[a][n]={}),this[a][n][l]=()=>{}}),this.isSetupDone=!0}executeMessage({message:e,args:t}){const r=e.split(p),i=r[0],o=r[1],a=r.length===3?r[2]:null;if(a&&this[i][o][a]){const n=this[i][o][a](...t);return n instanceof Promise?n.then(l=>({result:l})):n!==void 0?Promise.resolve({result:n}):Promise.resolve({result:null})}return Promise.reject('Message "'+e+'" is unkown')}setupPlugins(e,t,r="website"){for(const i of e)typeof i=="string"&&i==="dragIn"?this.pluginsLoaded.push(new Promise((o,a)=>{try{import("./drag-in-
|
|
1
|
+
var H=Object.defineProperty,U=(s,e,t)=>e in s?H(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,c=(s,e,t)=>U(s,typeof e!="symbol"?e+"":e,t);class I{constructor(e,t,r,i){c(this,"_side"),c(this,"_incomingMessageBus",null),c(this,"_outgoingMessageBus",null),c(this,"_execMessage",null),this._side=e,this._incomingMessageBus=t,this._outgoingMessageBus=r,this._execMessage=i,this._incomingMessageBus&&this._incomingMessageBus.addEventListener("message",this._handleMessage.bind(this))}setOutgoingMessageBus(e){this._outgoingMessageBus=e}setMessageExecution(e){this._execMessage=e}sendMessage(e,t=[]){return new Promise((r,i)=>{if(this._incomingMessageBus===this._outgoingMessageBus)return r(void 0);const o=new MessageChannel;o.port1.onmessage=n=>{if(!n||!n.data)return o.port1.close(),o.port2.close(),i(new Error(this._side+" received message but response can not be interpreted"));let l;try{l=JSON.parse(n.data)}catch(u){return o.port1.close(),o.port2.close(),this._prepareError(u),i(u)}l.error?i(l.error):l.result!==void 0?r(l.result):r(void 0),o.port1.close(),o.port2.close()};let a="";try{a=JSON.stringify({message:e,args:t})}catch{return i(new Error(this._side+": can not create command because it is not JSON.stringify able"))}if(!this._outgoingMessageBus)return i(new Error(this._side+": outgoing bus not set yet"));this._outgoingMessageBus.postMessage(a,"*",[o.port2])})}_handleMessage(e){const t=e.ports&&Array.isArray(e.ports)&&e.ports.length>0?e.ports[0]:null;if(e.data&&t)try{const r=JSON.parse(e.data);if(!this._execMessage)return t.postMessage(JSON.stringify({error:this._side+" is not ready to handle messages"}));Array.isArray(r.args)||(r.args=[r.args]);const i=this._execMessage(r,e);if(i===void 0)return;i.then((o={})=>{let a,n;typeof o=="object"&&o!==null&&(a=o.error,n=o.result),a?t.postMessage(JSON.stringify({error:a})):n!==void 0?t.postMessage(JSON.stringify({result:n})):t.postMessage(JSON.stringify({result:o}))},o=>{t.postMessage(JSON.stringify({error:this._prepareError(o)}))})}catch(r){t.postMessage(JSON.stringify({error:this._prepareError(r)}))}}_prepareError(e){if(typeof e=="string"){const t=this._side+": "+e;return console.error(t),t}return e.message=this._side+": "+e.message,console.error(e),e.message}}const p=".",f={REQUEST_BOOT:"requestBoot",SETUP:"setup",WEBSITE_READY:"websiteReady"},_={GET_METHODS:"getMethods",RETURN_METHODS:"returnMethods",REGISTER_CUSTOM_VIEW:"registerCustomView",REGISTER_CUSTOM_VIEW_DONE:"registerCustomViewDone"},B=async(s,e)=>{if(typeof s!="string")throw new Error('Configurator ID is not a string type: "'+typeof s+'"');const t=e.customApiUrl?e.customApiUrl:"https://api.roomle.com/v2",r=e.overrideTenant||9,i=t+"/configurators/"+s,o="roomle_portal_v2",a="03-"+window.btoa(new Date().toISOString()+";anonymous;"+o),n=()=>{const d={apiKey:o,currentTenant:r,locale:"en",language:"en",device:1,token:a,platform:"web"};return new Headers(d)},l=new Request(i,{method:"GET",headers:n(),mode:"cors",cache:"default"}),u=await fetch(l),{configurator:h}=await u.json();return h},F=()=>{try{return window.self!==window.top}catch{return!0}},C=["127.0.0.1","localhost","0.0.0.0"],k=()=>{const s=F();let e=window.location.href;if(s){if(!document.referrer)return null;e=document.referrer}const{hostname:t}=new URL(e);return t},x=s=>!!(C.includes(s)||s.endsWith("roomle.com")||s.endsWith("gitlab.io")||s.endsWith("gitlab.com")),y=["language","browserLanguage","userLanguage","systemLanguage"],W=(s=null)=>{const e=window.navigator;if(s)return s.substr(0,2);if(Array.isArray(e.languages)&&e.languages.length>0)return e.languages[0].substr(0,2);for(let t=0,r=y.length;t<r;t++){const i=e[y[t]];if(i)return i.substr(0,2)}return"en"},V=(s,e)=>{const t=JSON.parse(JSON.stringify(s));return w(t,e)},w=(s,e)=>{for(const t in e)try{e[t].constructor===Object?s[t]=w(s[t],e[t]):s[t]=e[t]}catch{s[t]=e[t]}return s};var T=(s=>(s.BOTTOM_BAR="bottom_bar",s.PARTLIST_BOUNDS="partlist_bounds",s.INTERACTION_NOTES="interaction_notes",s))(T||{}),G={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};const J={mobileLandscape:!0,floorMaterialRootTag:"materials_root",buttons:{renderimage:!0,requestproduct:!0,requestplan:!0,load_product:!0,partlist_print:!0},elements:{[T.INTERACTION_NOTES]:!0},helpcenter:{roomdesigner:!0,configurator:!1,disable:!1},firstPersonView:!0,saveToIdb:!0,featureFlags:{mocAr:!0,wallAutoHeight:!1,openCloseAnimation:!1},rotationSnapDegrees:10,interactionsCollapsed:!1},$="(idle)",j=s=>(E(s),s!=null&&s.customApiUrl&&(s.customApiUrl=decodeURIComponent(s.customApiUrl)),s.shareUrl&&(s.deeplink=s.shareUrl.replace(Y,Q)),s),E=s=>{if(!s)return;const e=Object.keys(s);for(const t of e){const r=s[t];if(!Array.isArray(r)&&typeof r=="object"&&r!==null&&E(r),Array.isArray(r))for(const i of r)E(i);(r==="true"||r==="false")&&(s[t]=r==="true")}},z=(s,e)=>{e.configuratorId=s.id;const t=s.settings||{};return!e.overrideTenant&&s.tenant&&(e.overrideTenant=s.tenant),V(t,e)},q=()=>{const s={...J};s.locale||(s.locale=W()),s.id===$&&delete s.id;const e=k();return e&&x(e)&&(s.configuratorId="demoConfigurator"),s.customApiUrl=G.VITE_RAPI_URL,s.emails=!1,s},Y="<CONF_ID>",Q="#CONFIGURATIONID#",K=s=>{s.featureFlags||(s.featureFlags={}),typeof s.featureFlags.realPartList!="boolean"&&(s.featureFlags.realPartList=!0),typeof s.featureFlags.globalCallbacks!="boolean"&&(s.featureFlags.globalCallbacks=!0),typeof s.featureFlags.mocAr!="boolean"&&(s.featureFlags.mocAr=!1)},M=()=>/(android)/i.test(navigator.userAgent);class v{constructor(){c(this,"_messageHandler",null),c(this,"isSetupDone",!1),c(this,"viewName","main"),c(this,"plugins",{}),c(this,"pluginsLoaded",[]),c(this,"ui",{callbacks:null}),c(this,"extended",{callbacks:null}),c(this,"configurator",{callbacks:null}),c(this,"analytics",{callbacks:{}}),c(this,"global",{callbacks:{}})}setMessageHandler(e){this._messageHandler=e}handleSetup(e){const{methods:t,callbacks:r}=e;t.forEach(i=>{const o=i.split(p),a=o[0],n=o[1];this[a]||(this[a]={}),this[a][n]=function(){if(!this._messageHandler){console.error("MessageHandler not set");return}return this._messageHandler.sendMessage(i,[...arguments])}.bind(this)}),r.forEach(i=>{const o=i.split(p),a=o[0],n=o[1],l=o[2];this[a]||(this[a]={}),this[a][n]||(this[a][n]={}),this[a][n][l]=()=>{}}),this.isSetupDone=!0}executeMessage({message:e,args:t}){const r=e.split(p),i=r[0],o=r[1],a=r.length===3?r[2]:null;if(a&&this[i][o][a]){const n=this[i][o][a](...t);return n instanceof Promise?n.then(l=>({result:l})):n!==void 0?Promise.resolve({result:n}):Promise.resolve({result:null})}return Promise.reject('Message "'+e+'" is unkown')}setupPlugins(e,t,r="website"){for(const i of e)typeof i=="string"&&i==="dragIn"?this.pluginsLoaded.push(new Promise((o,a)=>{try{import("./drag-in-w_TrusdP.mjs").then(n=>n.l).then(({DragIn:n})=>{const l=new n(this.ui,t,r,this.viewName);l.init().then(()=>{this.plugins.dragIn=l,o()},a)})}catch(n){a(n)}})):i.name&&i.loader&&this.pluginsLoaded.push(new Promise((o,a)=>{try{i.loader().then(n=>{const l=new n(this.ui,t,r,this.viewName);l.init().then(()=>{this.plugins[i.name]=l,o()},a)})}catch(n){a(n)}}))}}const S=()=>{let s,e;return{promise:new Promise((t,r)=>{s=t,e=r}),resolve:s,reject:e}},N=(s,e,t)=>{let r=null;Object.defineProperty(s,e,{get(){return r||t},set(i){i!=null&&i.mute?r=i.value:(console.warn("You override Roomle defined behaviour. To disalbe this warning pass in an object with the following properties"),console.warn("{ mute: true, value: () => void }"),r=i)}})},R=()=>window.innerHeight*.01+"px",D=s=>{s&&setTimeout(()=>s.style.setProperty(O,R()),0)},L="rml-styles",X=450,O="--rml-full-height",g={CONTAINER:"rml-container",FILL:"rml-fill",POSITION:"rml-pos",TRANSITION:"rml-transition",ANDROID_HEIGHT:"rml-android-height",OVERFLOW_HIDDEN:"rml-overflow-hidden"},b=new Map;class Z extends v{constructor(e,t,r,i,o){if(super(),c(this,"_waitForIframe"),c(this,"_container"),c(this,"_configuratorSettings"),c(this,"_initData",{}),c(this,"_iframe"),!e||typeof e.id!="string")throw new Error("Please provide a correct configuratorId, you get the correct ID from your Roomle Contact Person");if(b.has(t))throw new Error("There is already an instance on this DOM element");if(!document.getElementById(L)){const l=r.zIndex||9999999,u=document.createElement("style");u.type="text/css",u.id=L;const h="transition:all ease-in-out "+X+"ms;",d=["-webkit-","-o-"].reduce((A,P)=>A+=P+h,"")+h,m=R();u.innerHTML=`
|
|
2
2
|
.${g.CONTAINER}{${O}:${m};}
|
|
3
3
|
.${g.POSITION}{position:fixed;top:0;left:0;z-index:${l};opacity:0}
|
|
4
4
|
.${g.TRANSITION}{${d}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(_,p){typeof exports=="object"&&typeof module<"u"?module.exports=p():typeof define=="function"&&define.amd?define(p):(_=typeof globalThis<"u"?globalThis:_||self,_["roomle-embedding-lib"]=_["roomle-embedding-lib"]||{},_["roomle-embedding-lib"].umd=_["roomle-embedding-lib"].umd||{},_["roomle-embedding-lib"].umd.js=p())})(this,function(){"use strict";var te=Object.defineProperty;var ee=(_,p,E)=>p in _?te(_,p,{enumerable:!0,configurable:!0,writable:!0,value:E}):_[p]=E;var c=(_,p,E)=>ee(_,typeof p!="symbol"?p+"":p,E);class _{constructor(e,t,s,n){c(this,"_side");c(this,"_incomingMessageBus",null);c(this,"_outgoingMessageBus",null);c(this,"_execMessage",null);this._side=e,this._incomingMessageBus=t,this._outgoingMessageBus=s,this._execMessage=n,this._incomingMessageBus&&this._incomingMessageBus.addEventListener("message",this._handleMessage.bind(this))}setOutgoingMessageBus(e){this._outgoingMessageBus=e}setMessageExecution(e){this._execMessage=e}sendMessage(e,t=[]){return new Promise((s,n)=>{if(this._incomingMessageBus===this._outgoingMessageBus)return s(void 0);const i=new MessageChannel;i.port1.onmessage=a=>{if(!a||!a.data)return i.port1.close(),i.port2.close(),n(new Error(this._side+" received message but response can not be interpreted"));let l;try{l=JSON.parse(a.data)}catch(d){return i.port1.close(),i.port2.close(),this._prepareError(d),n(d)}l.error?n(l.error):l.result!==void 0?s(l.result):s(void 0),i.port1.close(),i.port2.close()};let o="";try{o=JSON.stringify({message:e,args:t})}catch{return n(new Error(this._side+": can not create command because it is not JSON.stringify able"))}if(!this._outgoingMessageBus)return n(new Error(this._side+": outgoing bus not set yet"));this._outgoingMessageBus.postMessage(o,"*",[i.port2])})}_handleMessage(e){const t=e.ports&&Array.isArray(e.ports)&&e.ports.length>0?e.ports[0]:null;if(e.data&&t)try{const s=JSON.parse(e.data);if(!this._execMessage)return t.postMessage(JSON.stringify({error:this._side+" is not ready to handle messages"}));Array.isArray(s.args)||(s.args=[s.args]);const n=this._execMessage(s,e);if(n===void 0)return;n.then((i={})=>{let o,a;typeof i=="object"&&i!==null&&(o=i.error,a=i.result),o?t.postMessage(JSON.stringify({error:o})):a!==void 0?t.postMessage(JSON.stringify({result:a})):t.postMessage(JSON.stringify({result:i}))},i=>{t.postMessage(JSON.stringify({error:this._prepareError(i)}))})}catch(s){t.postMessage(JSON.stringify({error:this._prepareError(s)}))}}_prepareError(e){if(typeof e=="string"){const t=this._side+": "+e;return console.error(t),t}return e.message=this._side+": "+e.message,console.error(e),e.message}}const p=".",E={REQUEST_BOOT:"requestBoot",SETUP:"setup",WEBSITE_READY:"websiteReady"},w={GET_METHODS:"getMethods",RETURN_METHODS:"returnMethods",REGISTER_CUSTOM_VIEW:"registerCustomView",REGISTER_CUSTOM_VIEW_DONE:"registerCustomViewDone"},pt=async(r,e)=>{if(typeof r!="string")throw new Error('Configurator ID is not a string type: "'+typeof r+'"');const t=e.customApiUrl?e.customApiUrl:"https://api.roomle.com/v2",s=e.overrideTenant||9,n=t+"/configurators/"+r,i="roomle_portal_v2",o="03-"+window.btoa(new Date().toISOString()+";anonymous;"+i),a=()=>{const u={apiKey:i,currentTenant:s,locale:"en",language:"en",device:1,token:o,platform:"web"};return new Headers(u)},l=new Request(n,{method:"GET",headers:a(),mode:"cors",cache:"default"}),d=await fetch(l),{configurator:h}=await d.json();return h},yt=()=>{try{return window.self!==window.top}catch{return!0}},Et=["127.0.0.1","localhost","0.0.0.0"],Dt=()=>{const r=yt();let e=window.location.href;if(r){if(!document.referrer)return null;e=document.referrer}const{hostname:t}=new URL(e);return t},Tt=r=>!!(Et.includes(r)||r.endsWith("roomle.com")||r.endsWith("gitlab.io")||r.endsWith("gitlab.com")),k=["language","browserLanguage","userLanguage","systemLanguage"],St=(r=null)=>{const e=window.navigator;if(r)return r.substr(0,2);if(Array.isArray(e.languages)&&e.languages.length>0)return e.languages[0].substr(0,2);for(let t=0,s=k.length;t<s;t++){const n=e[k[t]];if(n)return n.substr(0,2)}return"en"},It=(r,e)=>{const t=JSON.parse(JSON.stringify(r));return C(t,e)},C=(r,e)=>{for(const t in e)try{e[t].constructor===Object?r[t]=C(r[t],e[t]):r[t]=e[t]}catch{r[t]=e[t]}return r};var z=(r=>(r.BOTTOM_BAR="bottom_bar",r.PARTLIST_BOUNDS="partlist_bounds",r.INTERACTION_NOTES="interaction_notes",r))(z||{}),wt={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};const At={mobileLandscape:!0,floorMaterialRootTag:"materials_root",buttons:{renderimage:!0,requestproduct:!0,requestplan:!0,load_product:!0,partlist_print:!0},elements:{[z.INTERACTION_NOTES]:!0},helpcenter:{roomdesigner:!0,configurator:!1,disable:!1},firstPersonView:!0,saveToIdb:!0,featureFlags:{mocAr:!0,wallAutoHeight:!1},rotationSnapDegrees:10,interactionsCollapsed:!1},bt="(idle)",Ot=r=>(L(r),r!=null&&r.customApiUrl&&(r.customApiUrl=decodeURIComponent(r.customApiUrl)),r.shareUrl&&(r.deeplink=r.shareUrl.replace(Mt,Ct)),r),L=r=>{if(!r)return;const e=Object.keys(r);for(const t of e){const s=r[t];if(!Array.isArray(s)&&typeof s=="object"&&s!==null&&L(s),Array.isArray(s))for(const n of s)L(n);(s==="true"||s==="false")&&(r[t]=s==="true")}},vt=(r,e)=>{e.configuratorId=r.id;const t=r.settings||{};return!e.overrideTenant&&r.tenant&&(e.overrideTenant=r.tenant),It(t,e)},Rt=()=>{const r={...At};r.locale||(r.locale=St()),r.id===bt&&delete r.id;const e=Dt();return e&&Tt(e)&&(r.configuratorId="demoConfigurator"),r.customApiUrl=wt.VITE_RAPI_URL,r.emails=!1,r},Mt="<CONF_ID>",Ct="#CONFIGURATIONID#",Lt=r=>{r.featureFlags||(r.featureFlags={}),typeof r.featureFlags.realPartList!="boolean"&&(r.featureFlags.realPartList=!0),typeof r.featureFlags.globalCallbacks!="boolean"&&(r.featureFlags.globalCallbacks=!0),typeof r.featureFlags.mocAr!="boolean"&&(r.featureFlags.mocAr=!1)},V=()=>/(android)/i.test(navigator.userAgent);class q{constructor(){c(this,"_messageHandler",null);c(this,"isSetupDone",!1);c(this,"viewName","main");c(this,"plugins",{});c(this,"pluginsLoaded",[]);c(this,"ui",{callbacks:null});c(this,"extended",{callbacks:null});c(this,"configurator",{callbacks:null});c(this,"analytics",{callbacks:{}});c(this,"global",{callbacks:{}})}setMessageHandler(e){this._messageHandler=e}handleSetup(e){const{methods:t,callbacks:s}=e;t.forEach(n=>{const i=n.split(p),o=i[0],a=i[1];this[o]||(this[o]={}),this[o][a]=(function(){if(!this._messageHandler){console.error("MessageHandler not set");return}return this._messageHandler.sendMessage(n,[...arguments])}).bind(this)}),s.forEach(n=>{const i=n.split(p),o=i[0],a=i[1],l=i[2];this[o]||(this[o]={}),this[o][a]||(this[o][a]={}),this[o][a][l]=()=>{}}),this.isSetupDone=!0}executeMessage({message:e,args:t}){const s=e.split(p),n=s[0],i=s[1],o=s.length===3?s[2]:null;if(o&&this[n][i][o]){const a=this[n][i][o](...t);return a instanceof Promise?a.then(l=>({result:l})):a!==void 0?Promise.resolve({result:a}):Promise.resolve({result:null})}return Promise.reject('Message "'+e+'" is unkown')}setupPlugins(e,t,s="website"){for(const n of e)typeof n=="string"&&n==="dragIn"?this.pluginsLoaded.push(new Promise((i,o)=>{try{Promise.resolve().then(()=>Pt).then(({DragIn:a})=>{const l=new a(this.ui,t,s,this.viewName);l.init().then(()=>{this.plugins.dragIn=l,i()},o)})}catch(a){o(a)}})):n.name&&n.loader&&this.pluginsLoaded.push(new Promise((i,o)=>{try{n.loader().then(a=>{const l=new a(this.ui,t,s,this.viewName);l.init().then(()=>{this.plugins[n.name]=l,i()},o)})}catch(a){o(a)}}))}}const K=()=>{let r,e;return{promise:new Promise((s,n)=>{r=s,e=n}),resolve:r,reject:e}},J=(r,e,t)=>{let s=null;Object.defineProperty(r,e,{get(){return s||t},set(n){n!=null&&n.mute?s=n.value:(console.warn("You override Roomle defined behaviour. To disalbe this warning pass in an object with the following properties"),console.warn("{ mute: true, value: () => void }"),s=n)}})},j=()=>window.innerHeight*.01+"px",Q=r=>{r&&setTimeout(()=>r.style.setProperty(N,j()),0)},Z="rml-styles",Nt=450,N="--rml-full-height",m={CONTAINER:"rml-container",FILL:"rml-fill",POSITION:"rml-pos",TRANSITION:"rml-transition",ANDROID_HEIGHT:"rml-android-height",OVERFLOW_HIDDEN:"rml-overflow-hidden"},x=new Map;class xt extends q{constructor(t,s,n,i,o){super();c(this,"_waitForIframe");c(this,"_container");c(this,"_configuratorSettings");c(this,"_initData",{});c(this,"_iframe");if(!t||typeof t.id!="string")throw new Error("Please provide a correct configuratorId, you get the correct ID from your Roomle Contact Person");if(x.has(s))throw new Error("There is already an instance on this DOM element");if(!!!document.getElementById(Z)){const h=n.zIndex||9999999,u=document.createElement("style");u.type="text/css",u.id=Z;const g="transition:all ease-in-out "+Nt+"ms;",f=["-webkit-","-o-"].reduce((D,y)=>D+=y+g,"")+g,S=j();u.innerHTML=`
|
|
1
|
+
(function(_,p){typeof exports=="object"&&typeof module<"u"?module.exports=p():typeof define=="function"&&define.amd?define(p):(_=typeof globalThis<"u"?globalThis:_||self,_["roomle-embedding-lib"]=_["roomle-embedding-lib"]||{},_["roomle-embedding-lib"].umd=_["roomle-embedding-lib"].umd||{},_["roomle-embedding-lib"].umd.js=p())})(this,function(){"use strict";var te=Object.defineProperty;var ee=(_,p,E)=>p in _?te(_,p,{enumerable:!0,configurable:!0,writable:!0,value:E}):_[p]=E;var c=(_,p,E)=>ee(_,typeof p!="symbol"?p+"":p,E);class _{constructor(e,t,s,n){c(this,"_side");c(this,"_incomingMessageBus",null);c(this,"_outgoingMessageBus",null);c(this,"_execMessage",null);this._side=e,this._incomingMessageBus=t,this._outgoingMessageBus=s,this._execMessage=n,this._incomingMessageBus&&this._incomingMessageBus.addEventListener("message",this._handleMessage.bind(this))}setOutgoingMessageBus(e){this._outgoingMessageBus=e}setMessageExecution(e){this._execMessage=e}sendMessage(e,t=[]){return new Promise((s,n)=>{if(this._incomingMessageBus===this._outgoingMessageBus)return s(void 0);const i=new MessageChannel;i.port1.onmessage=a=>{if(!a||!a.data)return i.port1.close(),i.port2.close(),n(new Error(this._side+" received message but response can not be interpreted"));let l;try{l=JSON.parse(a.data)}catch(d){return i.port1.close(),i.port2.close(),this._prepareError(d),n(d)}l.error?n(l.error):l.result!==void 0?s(l.result):s(void 0),i.port1.close(),i.port2.close()};let o="";try{o=JSON.stringify({message:e,args:t})}catch{return n(new Error(this._side+": can not create command because it is not JSON.stringify able"))}if(!this._outgoingMessageBus)return n(new Error(this._side+": outgoing bus not set yet"));this._outgoingMessageBus.postMessage(o,"*",[i.port2])})}_handleMessage(e){const t=e.ports&&Array.isArray(e.ports)&&e.ports.length>0?e.ports[0]:null;if(e.data&&t)try{const s=JSON.parse(e.data);if(!this._execMessage)return t.postMessage(JSON.stringify({error:this._side+" is not ready to handle messages"}));Array.isArray(s.args)||(s.args=[s.args]);const n=this._execMessage(s,e);if(n===void 0)return;n.then((i={})=>{let o,a;typeof i=="object"&&i!==null&&(o=i.error,a=i.result),o?t.postMessage(JSON.stringify({error:o})):a!==void 0?t.postMessage(JSON.stringify({result:a})):t.postMessage(JSON.stringify({result:i}))},i=>{t.postMessage(JSON.stringify({error:this._prepareError(i)}))})}catch(s){t.postMessage(JSON.stringify({error:this._prepareError(s)}))}}_prepareError(e){if(typeof e=="string"){const t=this._side+": "+e;return console.error(t),t}return e.message=this._side+": "+e.message,console.error(e),e.message}}const p=".",E={REQUEST_BOOT:"requestBoot",SETUP:"setup",WEBSITE_READY:"websiteReady"},w={GET_METHODS:"getMethods",RETURN_METHODS:"returnMethods",REGISTER_CUSTOM_VIEW:"registerCustomView",REGISTER_CUSTOM_VIEW_DONE:"registerCustomViewDone"},pt=async(r,e)=>{if(typeof r!="string")throw new Error('Configurator ID is not a string type: "'+typeof r+'"');const t=e.customApiUrl?e.customApiUrl:"https://api.roomle.com/v2",s=e.overrideTenant||9,n=t+"/configurators/"+r,i="roomle_portal_v2",o="03-"+window.btoa(new Date().toISOString()+";anonymous;"+i),a=()=>{const u={apiKey:i,currentTenant:s,locale:"en",language:"en",device:1,token:o,platform:"web"};return new Headers(u)},l=new Request(n,{method:"GET",headers:a(),mode:"cors",cache:"default"}),d=await fetch(l),{configurator:h}=await d.json();return h},yt=()=>{try{return window.self!==window.top}catch{return!0}},Et=["127.0.0.1","localhost","0.0.0.0"],Dt=()=>{const r=yt();let e=window.location.href;if(r){if(!document.referrer)return null;e=document.referrer}const{hostname:t}=new URL(e);return t},Tt=r=>!!(Et.includes(r)||r.endsWith("roomle.com")||r.endsWith("gitlab.io")||r.endsWith("gitlab.com")),k=["language","browserLanguage","userLanguage","systemLanguage"],St=(r=null)=>{const e=window.navigator;if(r)return r.substr(0,2);if(Array.isArray(e.languages)&&e.languages.length>0)return e.languages[0].substr(0,2);for(let t=0,s=k.length;t<s;t++){const n=e[k[t]];if(n)return n.substr(0,2)}return"en"},It=(r,e)=>{const t=JSON.parse(JSON.stringify(r));return C(t,e)},C=(r,e)=>{for(const t in e)try{e[t].constructor===Object?r[t]=C(r[t],e[t]):r[t]=e[t]}catch{r[t]=e[t]}return r};var z=(r=>(r.BOTTOM_BAR="bottom_bar",r.PARTLIST_BOUNDS="partlist_bounds",r.INTERACTION_NOTES="interaction_notes",r))(z||{}),wt={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};const At={mobileLandscape:!0,floorMaterialRootTag:"materials_root",buttons:{renderimage:!0,requestproduct:!0,requestplan:!0,load_product:!0,partlist_print:!0},elements:{[z.INTERACTION_NOTES]:!0},helpcenter:{roomdesigner:!0,configurator:!1,disable:!1},firstPersonView:!0,saveToIdb:!0,featureFlags:{mocAr:!0,wallAutoHeight:!1,openCloseAnimation:!1},rotationSnapDegrees:10,interactionsCollapsed:!1},bt="(idle)",Ot=r=>(L(r),r!=null&&r.customApiUrl&&(r.customApiUrl=decodeURIComponent(r.customApiUrl)),r.shareUrl&&(r.deeplink=r.shareUrl.replace(Mt,Ct)),r),L=r=>{if(!r)return;const e=Object.keys(r);for(const t of e){const s=r[t];if(!Array.isArray(s)&&typeof s=="object"&&s!==null&&L(s),Array.isArray(s))for(const n of s)L(n);(s==="true"||s==="false")&&(r[t]=s==="true")}},vt=(r,e)=>{e.configuratorId=r.id;const t=r.settings||{};return!e.overrideTenant&&r.tenant&&(e.overrideTenant=r.tenant),It(t,e)},Rt=()=>{const r={...At};r.locale||(r.locale=St()),r.id===bt&&delete r.id;const e=Dt();return e&&Tt(e)&&(r.configuratorId="demoConfigurator"),r.customApiUrl=wt.VITE_RAPI_URL,r.emails=!1,r},Mt="<CONF_ID>",Ct="#CONFIGURATIONID#",Lt=r=>{r.featureFlags||(r.featureFlags={}),typeof r.featureFlags.realPartList!="boolean"&&(r.featureFlags.realPartList=!0),typeof r.featureFlags.globalCallbacks!="boolean"&&(r.featureFlags.globalCallbacks=!0),typeof r.featureFlags.mocAr!="boolean"&&(r.featureFlags.mocAr=!1)},V=()=>/(android)/i.test(navigator.userAgent);class q{constructor(){c(this,"_messageHandler",null);c(this,"isSetupDone",!1);c(this,"viewName","main");c(this,"plugins",{});c(this,"pluginsLoaded",[]);c(this,"ui",{callbacks:null});c(this,"extended",{callbacks:null});c(this,"configurator",{callbacks:null});c(this,"analytics",{callbacks:{}});c(this,"global",{callbacks:{}})}setMessageHandler(e){this._messageHandler=e}handleSetup(e){const{methods:t,callbacks:s}=e;t.forEach(n=>{const i=n.split(p),o=i[0],a=i[1];this[o]||(this[o]={}),this[o][a]=(function(){if(!this._messageHandler){console.error("MessageHandler not set");return}return this._messageHandler.sendMessage(n,[...arguments])}).bind(this)}),s.forEach(n=>{const i=n.split(p),o=i[0],a=i[1],l=i[2];this[o]||(this[o]={}),this[o][a]||(this[o][a]={}),this[o][a][l]=()=>{}}),this.isSetupDone=!0}executeMessage({message:e,args:t}){const s=e.split(p),n=s[0],i=s[1],o=s.length===3?s[2]:null;if(o&&this[n][i][o]){const a=this[n][i][o](...t);return a instanceof Promise?a.then(l=>({result:l})):a!==void 0?Promise.resolve({result:a}):Promise.resolve({result:null})}return Promise.reject('Message "'+e+'" is unkown')}setupPlugins(e,t,s="website"){for(const n of e)typeof n=="string"&&n==="dragIn"?this.pluginsLoaded.push(new Promise((i,o)=>{try{Promise.resolve().then(()=>Pt).then(({DragIn:a})=>{const l=new a(this.ui,t,s,this.viewName);l.init().then(()=>{this.plugins.dragIn=l,i()},o)})}catch(a){o(a)}})):n.name&&n.loader&&this.pluginsLoaded.push(new Promise((i,o)=>{try{n.loader().then(a=>{const l=new a(this.ui,t,s,this.viewName);l.init().then(()=>{this.plugins[n.name]=l,i()},o)})}catch(a){o(a)}}))}}const K=()=>{let r,e;return{promise:new Promise((s,n)=>{r=s,e=n}),resolve:r,reject:e}},J=(r,e,t)=>{let s=null;Object.defineProperty(r,e,{get(){return s||t},set(n){n!=null&&n.mute?s=n.value:(console.warn("You override Roomle defined behaviour. To disalbe this warning pass in an object with the following properties"),console.warn("{ mute: true, value: () => void }"),s=n)}})},j=()=>window.innerHeight*.01+"px",Q=r=>{r&&setTimeout(()=>r.style.setProperty(N,j()),0)},Z="rml-styles",Nt=450,N="--rml-full-height",m={CONTAINER:"rml-container",FILL:"rml-fill",POSITION:"rml-pos",TRANSITION:"rml-transition",ANDROID_HEIGHT:"rml-android-height",OVERFLOW_HIDDEN:"rml-overflow-hidden"},x=new Map;class xt extends q{constructor(t,s,n,i,o){super();c(this,"_waitForIframe");c(this,"_container");c(this,"_configuratorSettings");c(this,"_initData",{});c(this,"_iframe");if(!t||typeof t.id!="string")throw new Error("Please provide a correct configuratorId, you get the correct ID from your Roomle Contact Person");if(x.has(s))throw new Error("There is already an instance on this DOM element");if(!!!document.getElementById(Z)){const h=n.zIndex||9999999,u=document.createElement("style");u.type="text/css",u.id=Z;const g="transition:all ease-in-out "+Nt+"ms;",f=["-webkit-","-o-"].reduce((D,y)=>D+=y+g,"")+g,S=j();u.innerHTML=`
|
|
2
2
|
.${m.CONTAINER}{${N}:${S};}
|
|
3
3
|
.${m.POSITION}{position:fixed;top:0;left:0;z-index:${h};opacity:0}
|
|
4
4
|
.${m.TRANSITION}{${f}}
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
`,document.head.appendChild(s)}}_initializeDragGhost(){const t=this._mainDomElement.parentNode;let s=t.querySelector("."+v);s||(s=document.createElement("div"),s.classList.add(v),s.innerText=" ",t.appendChild(s))}async init(){if(await super.init(),this._mode==="website")try{const{DragInFromWebsiteStrategy:t}=await Promise.resolve().then(()=>zt);this._strategy=new t(this._instance,this._mainDomElement,{settings:this.options,mode:"website"})}catch(t){throw console.error('Could not load Dragin strategy "FromWebsite"'),t}else if(this._mode==="custom-view")try{const{DragInFromCustomViewStrategy:t}=await Promise.resolve().then(()=>Zt);this._strategy=new t(this._instance,this.options,this._viewName)}catch(t){throw console.error('Could not load Dragin strategy "FromCustomView"'),t}else throw new Error("Unsupported mode")}get isDragging(){return this._strategy.isDragging}dragStart(t,s,n="rml_id"){this._strategy.dragStart(t,s,n)}dragUpdate(t){this._strategy.dragUpdate(t)}dragEnd(){this._strategy.dragEnd()}touchStart(t,s,n="rml_id"){this._strategy.touchStart(t,s,n)}touchMove(t){this._strategy.touchMove(t)}touchEnd(){this._strategy.touchEnd()}dispose(){this._strategy.dispose()}beforeUpdateGhost(t){this._strategy.beforeUpdateGhost(t)}registerCustomDrag({customDragStart:t,customDragEnd:s,customDragUpdate:n,beforeUpdateGhost:i}){i&&this._strategy.beforeUpdateGhost(i);const o=this._customDragSignal.signal,a=h=>{h.target.getAttribute("data-rml-draggable")==="true"&&t(h)},l=h=>{this._strategy.releaseInput(h),this._strategy.isDragging&&s(h)},d=h=>{n(h)};document.querySelectorAll('[data-rml-draggable="true"]').forEach(h=>{h.draggable=!1}),document.addEventListener("mousedown",a,{signal:o}),document.addEventListener("mouseup",l,{signal:o}),document.addEventListener("mousemove",d,{signal:o}),document.addEventListener("mouseleave",l,{signal:o}),document.addEventListener("touchstart",a,{signal:o}),document.addEventListener("touchend",l,{signal:o}),document.addEventListener("touchmove",d,{signal:o})}unregisterCustomDrag(){this._customDragSignal.abort(),this._customDragSignal=new AbortController}releaseInput(t){this._strategy.releaseInput(t)}}const Pt=Object.freeze(Object.defineProperty({__proto__:null,DragIn:Ft},Symbol.toStringTag,{value:"Module"}));class Ht{constructor(e=16){c(this,"_computedStyleCache",new Map);c(this,"_maxLifetime",16);c(this,"_cacheCleanInterval",null);this._maxLifetime=e}get(e){const t=this._computedStyleCache.get(e),s=Date.now();if(t&&s-t.updated<this._maxLifetime)return t.style;const n=getComputedStyle(e);return this._computedStyleCache.set(e,{style:n,updated:s}),this._cacheCleanInterval||(this._cacheCleanInterval=setInterval(()=>this._cleanUpCache,Math.max(this._maxLifetime*1e3,5e3))),n}_cleanUpCache(){const e=Date.now();for(const[t,{updated:s}]of this._computedStyleCache.entries())e-s>=this._maxLifetime&&this._computedStyleCache.delete(t);this._computedStyleCache.size===0&&this._cacheCleanInterval&&(clearInterval(this._cacheCleanInterval),this._cacheCleanInterval=null)}}const T=r=>window.TouchEvent&&r instanceof window.TouchEvent;let H;const M=r=>(H||(H=new Ht),H.get(r)),lt=(r,e,t)=>{const s=parseFloat(r),n=window.devicePixelRatio||1;if(e==="px")return s;if(e==="%"){const o=t===document.documentElement?window.innerWidth:t.offsetWidth;return s/100*o}if(e==="rem"){const o=parseFloat(M(document.documentElement).fontSize);return s*o}if(e==="em"){const o=parseFloat(M(t).fontSize);return s*o}if(e==="vh"||e==="vw"||e==="vmin"||e==="vmax"){const o={vh:window.innerHeight,vw:window.innerWidth,vmin:Math.min(window.innerWidth,window.innerHeight),vmax:Math.max(window.innerWidth,window.innerHeight)};return s/100*o[e]}const i={cm:37.7952755906,mm:3.77952755906,in:96};return e in i?s*i[e]*n:(console.warn("Unable to determine coordinates for drag-in. Therefore drag-in is not possible. Check the CSS that positions the iframe of Roomle"),0)},ht=(r,e,t={x:0,y:0})=>{const s=r.getBoundingClientRect(),i=M(r).transform;let o=0,a=0;if(i!=="none"){const g=/translate\(\s*([-+]?\d*\.?\d+|\d+)(px|%)?,?\s*([-+]?\d*\.?\d+|\d+)?(px|%)?\s*\)/,f=i.match(g);f&&(o=lt(f[1],f[2],r),a=lt(f[3],f[4],r))}const{clientX:l,clientY:d}=I(e,t),h=l-s.left-o+r.scrollLeft,u=d-s.top-a+r.scrollTop;return{x:h,y:u}},I=(r,e=null)=>{const{clientX:t,clientY:s}=T(r)?Ut(r):r,n=t>0?t:e?e.x:t,i=s>0?s:e?e.y:s;return{clientX:n,clientY:i}},Ut=r=>{if(r.touches.length){let{clientX:t,clientY:s}=r.touches[0];if(r.touches.length>1){const n=r.touches[1],i=n.clientX,o=n.clientY;t=(t+i)/2,s=(s+o)/2}return{clientX:t,clientY:s}}const e=r.changedTouches[0];return{clientX:e.clientX,clientY:e.clientY}},U=500,B=10,Bt=100,dt=15,Y=(r,e=0)=>T(r)?{clientX:r.touches[e].clientX,clientY:r.touches[e].clientY}:{clientX:r.clientX,clientY:r.clientY},ut=r=>r&&T(r)?r.touches.length>0:!0;class gt{constructor(e,{onTouchDragStart:t},s={}){c(this,"_touchDragTimeOut");c(this,"_onTouchDragStart");c(this,"_payload",null);c(this,"_delay",U);c(this,"_firstTouch",null);c(this,"_lastTouch",null);c(this,"_epsilon",B);this._payload=e,this._onTouchDragStart=t,this._delay=typeof s.delay=="number"?s.delay:U,this._epsilon=typeof s.epsilon=="number"?s.epsilon:B}onStart(e){ut(e)&&(this._touchDragTimeOut||(this._firstTouch=Y(e,T(e)?e.touches.length-1:0),this._touchDragTimeOut=setTimeout(()=>{this._clearTimeout(),this._lastTouch||(this._lastTouch=Y(e)),this._checkXDistance(e)()},this._delay)))}onEnd(){this._resetTouches()}onMove(e){ut(e)&&(this._lastTouch=Y(e))}_clearTimeout(){this._touchDragTimeOut&&(clearTimeout(this._touchDragTimeOut),this._touchDragTimeOut=null)}_resetTouches(){this._clearTimeout(),this._lastTouch=null,this._firstTouch=null,this._payload=null}_checkXDistance(e){return()=>{if(!this._firstTouch||!this._lastTouch)return;let t=!1;t=Math.abs(this._firstTouch.clientX-this._lastTouch.clientX)<this._epsilon,t&&(this._onTouchDragStart(this._payload,e),this._resetTouches())}}}const _t=(r,e,t=0,s=0)=>{const n=e.x+e.width+t,i=e.x-t,o=e.y+e.height+s,a=e.y-s,{x:l,y:d}=r;return l>=i&&l<=n&&d>=a&&d<=o},mt=(r,e,t,s=0,n=0)=>{if(!(!t||!t.hiddenIn&&!t.visibleIn))return t.visibleIn?_t({x:r,y:e},t.visibleIn,s,n):t.hiddenIn?!_t({x:r,y:e},t.hiddenIn,-s,-n):!1},Yt=()=>{if(!!!document.getElementById(A)){const e=document.createElement("style");e.type="text/css",e.id=A,e.innerHTML=`
|
|
15
15
|
${it}
|
|
16
16
|
${ot}
|
|
17
|
-
`,document.head.appendChild(e)}},Xt=({x:r,y:e},t)=>{var n,i,o,a,l,d;let s=document.getElementById(b);if(!s){if(s=document.createElement("div"),(n=t.ghost)!=null&&n.element)s.appendChild(t.ghost.element);else{const h=document.createElement("img");h.src=((i=t.ghost)==null?void 0:i.url)||R,h.width=((o=t.ghost)==null?void 0:o.width)||F,h.height=((a=t.ghost)==null?void 0:a.height)||P,s.appendChild(h)}s.id=b,s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.willChange="transform",s.style.transform="translate3d(0, 0, 0)",s.style.zIndex="9999",s.style.opacity="0.5",mt(r,e,t.ghost||{},(l=t.settings)==null?void 0:l.dragInOverlapX,(d=t.settings)==null?void 0:d.dragInOverlapY)||(s.style.display="none"),s.style.pointerEvents="none",document.body.appendChild(s)}},Wt=({x:r,y:e},t)=>{var l,d,h,u;const s=document.getElementById(b);if(!s)return;let n=(l=t.ghost)==null?void 0:l.width,i=(d=t.ghost)==null?void 0:d.height;typeof n>"u"&&(n=s.getBoundingClientRect().width||F),typeof i>"u"&&(i=s.getBoundingClientRect().height||P);const o=r-n/2,a=e-i/2;s.style.transform=`translate3d(${o}px, ${a}px, 0)`,t.ghost&&(mt(r,e,t.ghost,(h=t.settings)==null?void 0:h.dragInOverlapX,(u=t.settings)==null?void 0:u.dragInOverlapY)?s.style.animation!=at&&(s.style.animation=at):s.style.animation!=ct&&(s.style.animation=ct))};class $t{constructor(e=null){c(this,"_dragGhostAnimationFrameId",null);c(this,"_dragGhostRemoveAnimationFrameId",null);c(this,"_dragGhostElement",null);this._dragGhostElement=e}updateDragGhost(e,t,s){var n;this._dragGhostRemoveAnimationFrameId&&(cancelAnimationFrame(this._dragGhostRemoveAnimationFrameId),this._dragGhostRemoveAnimationFrameId=null),!((n=s.ghost)!=null&&n.external)&&s.ghost&&(this._dragGhostAnimationFrameId||(this._dragGhostAnimationFrameId=requestAnimationFrame(()=>{Yt();const i={x:e,y:t};!s.ghost&&this._dragGhostElement&&(s.ghost={}),s.ghost&&!s.ghost.element&&this._dragGhostElement&&(s.ghost.element=this._dragGhostElement),Xt(i,s),Wt(i,s),this._dragGhostAnimationFrameId=null})))}removeDragGhost(){this._dragGhostAnimationFrameId&&(cancelAnimationFrame(this._dragGhostAnimationFrameId),this._dragGhostAnimationFrameId=null),this._dragGhostRemoveAnimationFrameId||(this._dragGhostRemoveAnimationFrameId=requestAnimationFrame(()=>{const e=document.getElementById(b);e&&document.body.removeChild(e),this._dragGhostRemoveAnimationFrameId=null}))}}class kt{constructor(e,t,s){c(this,"_options",{});c(this,"_instance");c(this,"_mainDomElement");c(this,"_currentDrag",{});c(this,"_currentTouch",null);c(this,"_firefoxDragPosition",{x:0,y:0});c(this,"_onBeforeUpdateDrag",()=>({}));c(this,"isDragging",!1);c(this,"_firefoxFallback",e=>{if(!this._currentDrag.event)return;const t=e||window.event;this._firefoxDragPosition.x=t.pageX||0,this._firefoxDragPosition.y=t.pageY||0});this._instance=e,this._mainDomElement=t,this._options=s||{},this._firefoxFallback=this._firefoxFallback.bind(this),document.addEventListener("dragover",this._firefoxFallback)}beforeUpdateGhost(e){this._onBeforeUpdateDrag=e}dragStart(e,t,s="rml_id"){const n=this._mainDomElement.parentNode;if(M(n).position!=="relative"){console.warn("Parent of iframe should have position relative, otherwise drag-in can not detect the x/y coordinates correctly");return}this._mainDomElement.style.pointerEvents="none";let o=n.querySelector("."+O);o||(o=document.createElement("div"),o.classList.add(O),n.appendChild(o)),o.classList.remove(G.DISPLAY_NONE),t.target.getAttribute("draggable")||console.warn(`Draggable not detected correctly! Did you add draggable="true" to the element? In Sarafi only 'draggable' is too less`);const l=n.querySelector("."+v);this._currentDrag.event=t;const d=t.target,h=d.cloneNode(),u=d.getBoundingClientRect();h.style.width=`${u.width}px`,h.style.height=`${u.height}px`,this._currentDrag.ghost=new $t(h),this._currentDrag.offset||(this._currentDrag.offset={x:0,y:0});const{clientX:g,clientY:f}=I(t,this._firefoxDragPosition);this._currentDrag.offset.x=g-u.left,this._currentDrag.offset.y=f-u.top,t instanceof DragEvent&&t.dataTransfer&&t.dataTransfer.setDragImage&&t.dataTransfer.setDragImage(l,0,0);const{x:S,y:D}=ht(n,this._currentDrag.event||t,this._firefoxDragPosition),y=Math.max(1,S),$=Math.max(1,D);this.isDragging=!0,this._instance.dragInObject(e,y,$,s)}dragUpdate(e){var D;const t=this._mainDomElement.parentNode,{x:s,y:n}=ht(t,e,this._firefoxDragPosition);if(s===0&&n===0)return;const i=Math.max(1,s),o=Math.max(1,n);if(i===1&&o===1)return;let a=i,l=o;if(T(e)){const y=((D=this._options.settings)==null?void 0:D.fingerSize)||0;a=Math.max(2,i+y),l=Math.max(2,o-y)}const{x:d,y:h,options:u}=this._onBeforeUpdateDrag(a,l,{}),g=u||{settings:{},ghost:{}};g.ghost||(g.ghost={}),g.ghost.visibleIn&&g.ghost.hiddenIn||(g.ghost.hiddenIn=this._mainDomElement.getBoundingClientRect());const f=typeof d=="number"?d:a,S=typeof h=="number"?h:l;if(this._currentDrag.ghost){const{clientX:y,clientY:$}=I(e,this._firefoxDragPosition);this._currentDrag.ghost.updateDragGhost(y,$,g)}this._instance.updateDrag(f,S,{})}dragEnd(){this._mainDomElement.style.pointerEvents="all";const e=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 t=e.querySelector("."+O);t&&t.classList.add(G.DISPLAY_NONE)}touchStart(e,t,s="rml_id"){var o,a,l,d;t.preventDefault();const n=(h,u)=>{this.dragStart(e,u,s)},i={};typeof((a=(o=this._options)==null?void 0:o.settings)==null?void 0:a.touchDragDelay)=="number"&&(i.delay=this._options.settings.touchDragDelay),(d=(l=this._options)==null?void 0:l.settings)!=null&&d.touchDragEpsilon&&(i.epsilon=this._options.settings.touchDragEpsilon),this._currentTouch=new gt(void 0,{onTouchDragStart:n},i),this._currentTouch.onStart(t)}touchMove(e){this._currentTouch&&this._currentTouch.onMove(e),this._currentDrag.event&&this.dragUpdate(e)}touchEnd(){this._currentTouch&&this._currentTouch.onEnd(),this._currentTouch=null,this.dragEnd()}dispose(){document.removeEventListener("dragover",this._firefoxFallback)}releaseInput(e){}}const zt=Object.freeze(Object.defineProperty({__proto__:null,DragInFromWebsiteStrategy:kt},Symbol.toStringTag,{value:"Module"})),Vt=r=>`[data-rml-custom-view="${r}"]`,X=r=>{r.preventDefault(),r.stopPropagation()},qt=(r,e,t,s)=>{const n=t-r,i=s-e;return Math.sqrt(n*n+i*i)};class Kt{constructor({onCustomDragStart:e},t={}){c(this,"_startX",0);c(this,"_startY",0);c(this,"_lastX",0);c(this,"_lastY",0);c(this,"_epsilon");c(this,"_isWaiting",!1);c(this,"_onCustomDragStart");this._epsilon=typeof t.epsilon=="number"?t.epsilon:dt,this._onCustomDragStart=e}onMove(e){this._lastX=e.clientX,this._lastY=e.clientY,this._isWaiting&&qt(this._startX,this._startY,this._lastX,this._lastY)>this._epsilon&&(this._onCustomDragStart(e),this._isWaiting=!1)}onStart(e){this._startX=e.clientX,this._startY=e.clientY,this.onMove(e),this._isWaiting=!0}onEnd(){this._reset()}_reset(){this._startX=0,this._startY=0,this._lastX=0,this._lastY=0,this._isWaiting=!1}}const W="data-rml-old-draggable",Jt=void 0,ft=(r,e)=>{const t=T(r),s={delay:t?U:Bt,epsilon:t?B:dt};if(!e)return s;if(!t&&!(r instanceof MouseEvent))return console.warn("Unsupported event! It is not TouchEvent and also not MouseEvent"),s;const{delayKey:n,epsilonKey:i}=t?{delayKey:"touchDragDelay",epsilonKey:"touchDragEpsilon"}:{delayKey:"customDragDelay",epsilonKey:"customDragEpsilon"};return typeof e[n]=="number"&&(s.delay=e.touchDragDelay),typeof e[i]=="number"&&(s.epsilon=e.touchDragEpsilon),s},jt=r=>{let e="",t=F,s=P;if(!r)return{url:R,width:t,height:s};const n=r;if(n instanceof HTMLElement){const i=n.getBoundingClientRect(),o=n.getAttribute("data-rml-ghost-url"),a=n.getAttribute("data-rml-ghost-width"),l=n.getAttribute("data-rml-ghost-height");o?e=o:!o&&n instanceof HTMLImageElement&&n.src&&(e=n.src),e?(t=i.width,s=i.height):e=R,t=a?parseInt(a,10):t,s=l?parseInt(l,10):s}return{url:e||R,width:t,height:s}};class Qt{constructor(e,t,s){c(this,"_options",{});c(this,"_instance");c(this,"_viewName");c(this,"_currentCustomDrag",null);c(this,"_currentBb",null);c(this,"_startTarget",null);c(this,"_onBeforeUpdateDrag",()=>({}));c(this,"isDragging",!1);this._instance=e,this._options=t||{},this._viewName=s}beforeUpdateGhost(e){this._onBeforeUpdateDrag=e}async _dragStart(e,t,s="rml_id"){this._startTarget&&(this._startTarget.style.pointerEvents="none",this._startTarget.style.userSelect="none",this._startTarget.setAttribute(W,this._startTarget.draggable.toString()),this._startTarget.draggable=!1,this._startTarget.removeEventListener("dragstart",X),this._startTarget.addEventListener("dragstart",X)),this._currentBb=await this._instance.getBoundingClientRect(Vt(this._viewName));const{clientX:n,clientY:i}=I(t),o=this._currentBb.x+n,a=this._currentBb.y+i;this.isDragging=!0,this._instance.dragInObject(e,o,a,s)}_dragUpdate(e){if(document.body.focus(),this._currentCustomDrag&&this._currentCustomDrag.onMove(e),!this._currentBb||!this.isDragging)return;const{clientX:t,clientY:s}=I(e),{url:n,width:i,height:o}=jt(this._startTarget),a=this._currentBb.x+t,l=this._currentBb.y+s,d=this._options||{},h={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:n,width:i,height:o},mode:"custom-view"},{x:u,y:g,options:f}=this._onBeforeUpdateDrag(a,l,h),S=typeof u=="number"?u:a,D=typeof g=="number"?g:l,y=f||h;this._instance.updateDrag(S,D,y)}_dragEnd(){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._currentCustomDrag=null,this.isDragging=!1,this._currentBb=null,this._resetStartTarget(),this._instance.enableEvents(),this._instance.dragInObjectEnd()}dragStart(e,t,s){this._instance.disableEvents(),this._startTarget=t.target;const n=(i,o)=>{this._dragStart(e,o,s)};this._currentCustomDrag=T(t)?new gt(Jt,{onTouchDragStart:n},ft(t,this._options)):new Kt({onCustomDragStart:i=>this._dragStart(e,i,s)},ft(t,this._options)),this._currentCustomDrag.onStart(t)}dragEnd(){this._dragEnd()}dragUpdate(e){this._dragUpdate(e)}touchStart(e,t,s="rml_id"){this.dragStart(e,t,s)}touchMove(e){this.dragUpdate(e)}touchEnd(){this.dragEnd()}dispose(){}_resetStartTarget(){this._startTarget&&(this._startTarget.style.pointerEvents="",this._startTarget.style.userSelect="",this._startTarget.draggable=this._startTarget.getAttribute(W)==="true",this._startTarget.removeAttribute(W),this._startTarget.removeEventListener("dragstart",X))}releaseInput(e){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._resetStartTarget()}}const Zt=Object.freeze(Object.defineProperty({__proto__:null,DragInFromCustomViewStrategy:Qt},Symbol.toStringTag,{value:"Module"}));return xt});
|
|
17
|
+
`,document.head.appendChild(e)}},Xt=({x:r,y:e},t)=>{var n,i,o,a,l,d;let s=document.getElementById(b);if(!s){if(s=document.createElement("div"),(n=t.ghost)!=null&&n.element)s.appendChild(t.ghost.element);else{const h=document.createElement("img");h.src=((i=t.ghost)==null?void 0:i.url)||R,h.width=((o=t.ghost)==null?void 0:o.width)||F,h.height=((a=t.ghost)==null?void 0:a.height)||P,s.appendChild(h)}s.id=b,s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.willChange="transform",s.style.transform="translate3d(0, 0, 0)",s.style.zIndex="9999",s.style.opacity="0.5",mt(r,e,t.ghost||{},(l=t.settings)==null?void 0:l.dragInOverlapX,(d=t.settings)==null?void 0:d.dragInOverlapY)||(s.style.display="none"),s.style.pointerEvents="none",document.body.appendChild(s)}},Wt=({x:r,y:e},t)=>{var l,d,h,u;const s=document.getElementById(b);if(!s)return;let n=(l=t.ghost)==null?void 0:l.width,i=(d=t.ghost)==null?void 0:d.height;typeof n>"u"&&(n=s.getBoundingClientRect().width||F),typeof i>"u"&&(i=s.getBoundingClientRect().height||P);const o=r-n/2,a=e-i/2;s.style.transform=`translate3d(${o}px, ${a}px, 0)`,t.ghost&&(mt(r,e,t.ghost,(h=t.settings)==null?void 0:h.dragInOverlapX,(u=t.settings)==null?void 0:u.dragInOverlapY)?s.style.animation!=at&&(s.style.animation=at):s.style.animation!=ct&&(s.style.animation=ct))};class $t{constructor(e=null){c(this,"_dragGhostAnimationFrameId",null);c(this,"_dragGhostRemoveAnimationFrameId",null);c(this,"_dragGhostElement",null);this._dragGhostElement=e}updateDragGhost(e,t,s){var n;this._dragGhostRemoveAnimationFrameId&&(cancelAnimationFrame(this._dragGhostRemoveAnimationFrameId),this._dragGhostRemoveAnimationFrameId=null),!((n=s.ghost)!=null&&n.external)&&s.ghost&&(this._dragGhostAnimationFrameId||(this._dragGhostAnimationFrameId=requestAnimationFrame(()=>{Yt();const i={x:e,y:t};!s.ghost&&this._dragGhostElement&&(s.ghost={}),s.ghost&&!s.ghost.element&&this._dragGhostElement&&(s.ghost.element=this._dragGhostElement),Xt(i,s),Wt(i,s),this._dragGhostAnimationFrameId=null})))}removeDragGhost(){this._dragGhostAnimationFrameId&&(cancelAnimationFrame(this._dragGhostAnimationFrameId),this._dragGhostAnimationFrameId=null),this._dragGhostRemoveAnimationFrameId||(this._dragGhostRemoveAnimationFrameId=requestAnimationFrame(()=>{const e=document.getElementById(b);e&&document.body.removeChild(e),this._dragGhostRemoveAnimationFrameId=null}))}}class kt{constructor(e,t,s){c(this,"_options",{});c(this,"_instance");c(this,"_mainDomElement");c(this,"_currentDrag",{});c(this,"_currentTouch",null);c(this,"_firefoxDragPosition",{x:0,y:0});c(this,"_onBeforeUpdateDrag",()=>({}));c(this,"isDragging",!1);c(this,"_firefoxFallback",e=>{if(!this._currentDrag.event)return;e.preventDefault();const t=e||window.event;this._firefoxDragPosition.x=t.pageX||0,this._firefoxDragPosition.y=t.pageY||0});this._instance=e,this._mainDomElement=t,this._options=s||{},this._firefoxFallback=this._firefoxFallback.bind(this),document.addEventListener("dragover",this._firefoxFallback)}beforeUpdateGhost(e){this._onBeforeUpdateDrag=e}dragStart(e,t,s="rml_id"){const n=this._mainDomElement.parentNode;if(M(n).position!=="relative"){console.warn("Parent of iframe should have position relative, otherwise drag-in can not detect the x/y coordinates correctly");return}this._mainDomElement.style.pointerEvents="none";let o=n.querySelector("."+O);o||(o=document.createElement("div"),o.classList.add(O),n.appendChild(o)),o.classList.remove(G.DISPLAY_NONE),t.target.getAttribute("draggable")||console.warn(`Draggable not detected correctly! Did you add draggable="true" to the element? In Sarafi only 'draggable' is too less`);const l=n.querySelector("."+v);this._currentDrag.event=t;const d=t.target,h=d.cloneNode(),u=d.getBoundingClientRect();h.style.width=`${u.width}px`,h.style.height=`${u.height}px`,this._currentDrag.ghost=new $t(h),this._currentDrag.offset||(this._currentDrag.offset={x:0,y:0});const{clientX:g,clientY:f}=I(t,this._firefoxDragPosition);this._currentDrag.offset.x=g-u.left,this._currentDrag.offset.y=f-u.top,t instanceof DragEvent&&t.dataTransfer&&t.dataTransfer.setDragImage&&t.dataTransfer.setDragImage(l,0,0);const{x:S,y:D}=ht(n,this._currentDrag.event||t,this._firefoxDragPosition),y=Math.max(1,S),$=Math.max(1,D);this.isDragging=!0,this._instance.dragInObject(e,y,$,s)}dragUpdate(e){var D;const t=this._mainDomElement.parentNode,{x:s,y:n}=ht(t,e,this._firefoxDragPosition);if(s===0&&n===0)return;const i=Math.max(1,s),o=Math.max(1,n);if(i===1&&o===1)return;let a=i,l=o;if(T(e)){const y=((D=this._options.settings)==null?void 0:D.fingerSize)||0;a=Math.max(2,i+y),l=Math.max(2,o-y)}const{x:d,y:h,options:u}=this._onBeforeUpdateDrag(a,l,{}),g=u||{settings:{},ghost:{}};g.ghost||(g.ghost={}),g.ghost.visibleIn&&g.ghost.hiddenIn||(g.ghost.hiddenIn=this._mainDomElement.getBoundingClientRect());const f=typeof d=="number"?d:a,S=typeof h=="number"?h:l;if(this._currentDrag.ghost){const{clientX:y,clientY:$}=I(e,this._firefoxDragPosition);this._currentDrag.ghost.updateDragGhost(y,$,g)}this._instance.updateDrag(f,S,{})}dragEnd(){this._mainDomElement.style.pointerEvents="all";const e=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 t=e.querySelector("."+O);t&&t.classList.add(G.DISPLAY_NONE)}touchStart(e,t,s="rml_id"){var o,a,l,d;t.preventDefault();const n=(h,u)=>{this.dragStart(e,u,s)},i={};typeof((a=(o=this._options)==null?void 0:o.settings)==null?void 0:a.touchDragDelay)=="number"&&(i.delay=this._options.settings.touchDragDelay),(d=(l=this._options)==null?void 0:l.settings)!=null&&d.touchDragEpsilon&&(i.epsilon=this._options.settings.touchDragEpsilon),this._currentTouch=new gt(void 0,{onTouchDragStart:n},i),this._currentTouch.onStart(t)}touchMove(e){this._currentTouch&&this._currentTouch.onMove(e),this._currentDrag.event&&this.dragUpdate(e)}touchEnd(){this._currentTouch&&this._currentTouch.onEnd(),this._currentTouch=null,this.dragEnd()}dispose(){document.removeEventListener("dragover",this._firefoxFallback)}releaseInput(e){}}const zt=Object.freeze(Object.defineProperty({__proto__:null,DragInFromWebsiteStrategy:kt},Symbol.toStringTag,{value:"Module"})),Vt=r=>`[data-rml-custom-view="${r}"]`,X=r=>{r.preventDefault(),r.stopPropagation()},qt=(r,e,t,s)=>{const n=t-r,i=s-e;return Math.sqrt(n*n+i*i)};class Kt{constructor({onCustomDragStart:e},t={}){c(this,"_startX",0);c(this,"_startY",0);c(this,"_lastX",0);c(this,"_lastY",0);c(this,"_epsilon");c(this,"_isWaiting",!1);c(this,"_onCustomDragStart");this._epsilon=typeof t.epsilon=="number"?t.epsilon:dt,this._onCustomDragStart=e}onMove(e){this._lastX=e.clientX,this._lastY=e.clientY,this._isWaiting&&qt(this._startX,this._startY,this._lastX,this._lastY)>this._epsilon&&(this._onCustomDragStart(e),this._isWaiting=!1)}onStart(e){this._startX=e.clientX,this._startY=e.clientY,this.onMove(e),this._isWaiting=!0}onEnd(){this._reset()}_reset(){this._startX=0,this._startY=0,this._lastX=0,this._lastY=0,this._isWaiting=!1}}const W="data-rml-old-draggable",Jt=void 0,ft=(r,e)=>{const t=T(r),s={delay:t?U:Bt,epsilon:t?B:dt};if(!e)return s;if(!t&&!(r instanceof MouseEvent))return console.warn("Unsupported event! It is not TouchEvent and also not MouseEvent"),s;const{delayKey:n,epsilonKey:i}=t?{delayKey:"touchDragDelay",epsilonKey:"touchDragEpsilon"}:{delayKey:"customDragDelay",epsilonKey:"customDragEpsilon"};return typeof e[n]=="number"&&(s.delay=e.touchDragDelay),typeof e[i]=="number"&&(s.epsilon=e.touchDragEpsilon),s},jt=r=>{let e="",t=F,s=P;if(!r)return{url:R,width:t,height:s};const n=r;if(n instanceof HTMLElement){const i=n.getBoundingClientRect(),o=n.getAttribute("data-rml-ghost-url"),a=n.getAttribute("data-rml-ghost-width"),l=n.getAttribute("data-rml-ghost-height");o?e=o:!o&&n instanceof HTMLImageElement&&n.src&&(e=n.src),e?(t=i.width,s=i.height):e=R,t=a?parseInt(a,10):t,s=l?parseInt(l,10):s}return{url:e||R,width:t,height:s}};class Qt{constructor(e,t,s){c(this,"_options",{});c(this,"_instance");c(this,"_viewName");c(this,"_currentCustomDrag",null);c(this,"_currentBb",null);c(this,"_startTarget",null);c(this,"_onBeforeUpdateDrag",()=>({}));c(this,"isDragging",!1);this._instance=e,this._options=t||{},this._viewName=s}beforeUpdateGhost(e){this._onBeforeUpdateDrag=e}async _dragStart(e,t,s="rml_id"){this._startTarget&&(this._startTarget.style.pointerEvents="none",this._startTarget.style.userSelect="none",this._startTarget.setAttribute(W,this._startTarget.draggable.toString()),this._startTarget.draggable=!1,this._startTarget.removeEventListener("dragstart",X),this._startTarget.addEventListener("dragstart",X)),this._currentBb=await this._instance.getBoundingClientRect(Vt(this._viewName));const{clientX:n,clientY:i}=I(t),o=this._currentBb.x+n,a=this._currentBb.y+i;this.isDragging=!0,this._instance.dragInObject(e,o,a,s)}_dragUpdate(e){if(document.body.focus(),this._currentCustomDrag&&this._currentCustomDrag.onMove(e),!this._currentBb||!this.isDragging)return;const{clientX:t,clientY:s}=I(e),{url:n,width:i,height:o}=jt(this._startTarget),a=this._currentBb.x+t,l=this._currentBb.y+s,d=this._options||{},h={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:n,width:i,height:o},mode:"custom-view"},{x:u,y:g,options:f}=this._onBeforeUpdateDrag(a,l,h),S=typeof u=="number"?u:a,D=typeof g=="number"?g:l,y=f||h;this._instance.updateDrag(S,D,y)}_dragEnd(){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._currentCustomDrag=null,this.isDragging=!1,this._currentBb=null,this._resetStartTarget(),this._instance.enableEvents(),this._instance.dragInObjectEnd()}dragStart(e,t,s){this._instance.disableEvents(),this._startTarget=t.target;const n=(i,o)=>{this._dragStart(e,o,s)};this._currentCustomDrag=T(t)?new gt(Jt,{onTouchDragStart:n},ft(t,this._options)):new Kt({onCustomDragStart:i=>this._dragStart(e,i,s)},ft(t,this._options)),this._currentCustomDrag.onStart(t)}dragEnd(){this._dragEnd()}dragUpdate(e){this._dragUpdate(e)}touchStart(e,t,s="rml_id"){this.dragStart(e,t,s)}touchMove(e){this.dragUpdate(e)}touchEnd(){this.dragEnd()}dispose(){}_resetStartTarget(){this._startTarget&&(this._startTarget.style.pointerEvents="",this._startTarget.style.userSelect="",this._startTarget.draggable=this._startTarget.getAttribute(W)==="true",this._startTarget.removeAttribute(W),this._startTarget.removeEventListener("dragstart",X))}releaseInput(e){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._resetStartTarget()}}const Zt=Object.freeze(Object.defineProperty({__proto__:null,DragInFromCustomViewStrategy:Qt},Symbol.toStringTag,{value:"Module"}));return xt});
|