@roomle/embedding-lib 5.1.0 → 5.2.0-alpha.1
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 +13 -37
- package/{drag-in-gOPgOymI.mjs → drag-in-BKrnFtmJ.mjs} +1 -1
- package/{drag-in-CXLxdfa-.mjs → drag-in-DC-05b4s.mjs} +6 -6
- package/package.json +2 -2
- package/roomle-embedding-lib.es.js +1 -1
- package/roomle-embedding-lib.es.min.js +1 -1
- package/roomle-embedding-lib.umd.js +1 -1
- package/roomle-embedding-lib.umd.min.js +1 -1
|
@@ -1,45 +1,21 @@
|
|
|
1
|
-
## [5.
|
|
1
|
+
## [5.2.0-alpha.1](https://github.com/roomle-dev/roomle-ui/compare/embedding-lib-v5.1.0...embedding-lib-v5.2.0-alpha.1) (2024-09-02)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Features
|
|
5
5
|
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* onClickOutside composable ([4b2ddd8](https://github.com/roomle-dev/roomle-ui/commit/4b2ddd8346efd3f9fc2e84cbf71cbfb221eea22c))
|
|
10
|
-
* release from cd/embedding-pre-release ([4e547d5](https://github.com/roomle-dev/roomle-ui/commit/4e547d5b29d33578ab9eca1221a469d4c5a100b6))
|
|
11
|
-
* run embedding tests agains multiple versions ([1391e37](https://github.com/roomle-dev/roomle-ui/commit/1391e378e2c5f4cefca306db9826b1b20f93ad9d))
|
|
12
|
-
* **SDK:** upgrade to version 2.83.0-alpha.3 ([#1188](https://github.com/roomle-dev/roomle-ui/issues/1188)) ([8328c4a](https://github.com/roomle-dev/roomle-ui/commit/8328c4a32d425a36e11af914582430812a7204c6))
|
|
13
|
-
* **SDK:** upgrade to version 2.83.0-alpha.4 ([#1189](https://github.com/roomle-dev/roomle-ui/issues/1189)) ([87dcc27](https://github.com/roomle-dev/roomle-ui/commit/87dcc271f473782cdc819c193940861084ea28ba))
|
|
14
|
-
* **SDK:** upgrade to version 2.83.0-alpha.5 ([003c215](https://github.com/roomle-dev/roomle-ui/commit/003c215768881f30eb3f51fadc8efe38eadae87c))
|
|
6
|
+
* enable possibility to update cloudinary mocks ([6dd8d3e](https://github.com/roomle-dev/roomle-ui/commit/6dd8d3e79968d9cd832d5dcaf05e19caa5d3a519))
|
|
7
|
+
* **SDK:** upgrade to version 2.83.0 ([#1215](https://github.com/roomle-dev/roomle-ui/issues/1215)) ([7d10cf1](https://github.com/roomle-dev/roomle-ui/commit/7d10cf1aef745f6797217411b7f31b31d922162c))
|
|
8
|
+
* **SDK:** upgrade to version 2.84.0-alpha.1 ([21721d2](https://github.com/roomle-dev/roomle-ui/commit/21721d2cfc0143fc3a47716f659665115c0ab302))
|
|
15
9
|
|
|
16
10
|
|
|
17
11
|
### Bug Fixes
|
|
18
12
|
|
|
19
|
-
* add
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* pointing vitest to the correct config file ([6fe8dc8](https://github.com/roomle-dev/roomle-ui/commit/6fe8dc8b5ce5783ed67ca2364d0a40b4630419b7))
|
|
29
|
-
* prevent blurring the dropdown ([fa7f55c](https://github.com/roomle-dev/roomle-ui/commit/fa7f55ca318249668924633d364a77403e15b4c2))
|
|
30
|
-
* prevent key events on slider to enable shifting the scene ([ebed576](https://github.com/roomle-dev/roomle-ui/commit/ebed576d0903cda0963ef0e1aca8e29a314c8ac7))
|
|
31
|
-
* remove leftover from old tries ([b4341d1](https://github.com/roomle-dev/roomle-ui/commit/b4341d17f4cf7ad130c72e15df6d6389dddff76c))
|
|
32
|
-
* remove syntax error ([34a7cda](https://github.com/roomle-dev/roomle-ui/commit/34a7cda3a4be80d2260ff6e4990f2b42be4fd2ad))
|
|
33
|
-
* remove typescript errors ([e186ab6](https://github.com/roomle-dev/roomle-ui/commit/e186ab6f8a983d10c45cefa3894e890a350e8e03))
|
|
34
|
-
* revert to npm install ([4d8f8d9](https://github.com/roomle-dev/roomle-ui/commit/4d8f8d935c837adea28bb0c288da78239fc18eb6))
|
|
35
|
-
* run pre release of embedding ([6d8849e](https://github.com/roomle-dev/roomle-ui/commit/6d8849e6bc8a6a081c7be104f1910e23396a655d))
|
|
36
|
-
* set configurator callbacks and types ([8a56c2e](https://github.com/roomle-dev/roomle-ui/commit/8a56c2ec13b48a10ff86798d605c134a067e2e55))
|
|
37
|
-
* show pwd ([4f4deda](https://github.com/roomle-dev/roomle-ui/commit/4f4deda3e7614bf4c94f838a6e14c17f599ab03c))
|
|
38
|
-
* some stuff ([7d99f8e](https://github.com/roomle-dev/roomle-ui/commit/7d99f8e59f61dfd07c201f2f1f229232211fc6e9))
|
|
39
|
-
* some stuff ([b4c0152](https://github.com/roomle-dev/roomle-ui/commit/b4c015270ebdf61971a8108dc5637c7b54847c88))
|
|
40
|
-
* submit onBlur for measurements in 2D ([164e71b](https://github.com/roomle-dev/roomle-ui/commit/164e71bc78fa92dcc75939533f345448679ab506))
|
|
41
|
-
* trigger onSaveDraft callback when emails is false and by default ([87cd4f2](https://github.com/roomle-dev/roomle-ui/commit/87cd4f2d00caf297d4e98059f1e6d71be75dda0b))
|
|
42
|
-
* try npm ci ([ec81bb3](https://github.com/roomle-dev/roomle-ui/commit/ec81bb306d53c92b8aad327b89ecea8084247d58))
|
|
43
|
-
* use correct credentials ([6898e84](https://github.com/roomle-dev/roomle-ui/commit/6898e845733d6086562a78a3c5619ea8954011ed))
|
|
44
|
-
* use correct types of husky/pre-push ([bf95c6e](https://github.com/roomle-dev/roomle-ui/commit/bf95c6e73a89b4d97f3e3653fb4ef2584cb0b931))
|
|
45
|
-
* Vector draw mode broken on test/alpha ([667a044](https://github.com/roomle-dev/roomle-ui/commit/667a04478388bf0af010d7d192526fecf0a13f5f))
|
|
13
|
+
* add correct mocks ([3e00240](https://github.com/roomle-dev/roomle-ui/commit/3e00240a7bd00cc9184119d8e6c9657d817e09d3))
|
|
14
|
+
* adopt paths and so on for plugins of embedding lib ([2992746](https://github.com/roomle-dev/roomle-ui/commit/299274627764f62e6686b0b145c5d6009d12d847))
|
|
15
|
+
* make ensure work with promises ([02d4a1f](https://github.com/roomle-dev/roomle-ui/commit/02d4a1f7440e15f4551089dd6ac0fc161268df98))
|
|
16
|
+
* make it possible that delay is also 0 otherwise the smallest value would be 1 ([dc2086a](https://github.com/roomle-dev/roomle-ui/commit/dc2086a516708d0f258291f5010a5b1886acc17d))
|
|
17
|
+
* onSaveDraft trigger ([e24a18e](https://github.com/roomle-dev/roomle-ui/commit/e24a18e361fd11f4627374c2c7f3f876748d732e))
|
|
18
|
+
* playwright test by Install Playwright Browsers before run test with --with-deps flag ([8ea40c8](https://github.com/roomle-dev/roomle-ui/commit/8ea40c8b09a1be0f3a19d6764b065a037184f043))
|
|
19
|
+
* save draft button changes color when buttons.requestproduct is hidden ([20a5b70](https://github.com/roomle-dev/roomle-ui/commit/20a5b708920d8071f2e44dcecf1685c28eaebe67))
|
|
20
|
+
* selection of items on mobile ([8d11a90](https://github.com/roomle-dev/roomle-ui/commit/8d11a90079bab8a82b0ac5d16582f8b51877bb42))
|
|
21
|
+
* unselect element after dragEnd ([5b45cd8](https://github.com/roomle-dev/roomle-ui/commit/5b45cd811a723c8bb52dd61f697a36894ddd7c83))
|
|
@@ -4,4 +4,4 @@ var O=Object.defineProperty,P=(i,t,e)=>t in i?O(i,t,{enumerable:!0,configurable:
|
|
|
4
4
|
.${m}{position:absolute;top:0;left:0;width:1px;height:1px;z-index:999;pointer-events:none;background-color:transparent;}
|
|
5
5
|
@keyframes ${x} {from{opacity: 0;}to {opacity: ${M};}}
|
|
6
6
|
@keyframes ${Y} {from{opacity: ${M};}to {opacity: 0;}}
|
|
7
|
-
`,document.head.appendChild(t)}}_initializeDragGhost(){const t=this._iframe.parentNode;let e=t.querySelector("."+m);e||(e=document.createElement("div"),e.classList.add(m),e.innerText=" ",t.appendChild(e))}setInstance(t){this._instance=t}dragStart(t,e,n="rml_id"){const o=this._iframe.parentNode;if(f(o).position!=="relative"){console.warn("Parent of iframe should have position relative, otherwise drag-in can not detect the x/y coordinates correctly");return}this._iframe.style.pointerEvents="none";let s=o.querySelector("."+g);s||(s=document.createElement("div"),s.classList.add(g),o.appendChild(s)),s.classList.remove(T.DISPLAY_NONE),e.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 a=o.querySelector("."+m);this._currentDrag.event=e;const r=e.target.cloneNode();r.style.position="fixed",r.style.pointerEvents="none",r.style.opacity="0",r.style.animation=`${x} ${w} ${S}`,r.id=F,r.style.zIndex="9999",document.body.appendChild(r),this._currentDrag.element=r;const l=e.target.getBoundingClientRect();this._currentDrag.offset||(this._currentDrag.offset={x:0,y:0});const{clientX:h,clientY:u}=v(e,this._firefoxDragPosition);this._currentDrag.offset.x=h-l.left,this._currentDrag.offset.y=u-l.top,r.style.top=u+"px",r.style.left=h+"px",e instanceof DragEvent&&e.dataTransfer&&e.dataTransfer.setDragImage&&e.dataTransfer.setDragImage(a,0,0);const{x:_,y:d}=I(o,this._currentDrag.event||e,this._firefoxDragPosition),p=Math.max(1,_),y=Math.max(1,d);b(this._instance)&&this._instance.dragInObject(t,p,y,n)}dragUpdate(t){var e,n;const o=this._iframe.parentNode,{x:s,y:a}=I(o,t,this._firefoxDragPosition);if(s===0&&a===0)return;const r=Math.max(1,s),l=Math.max(1,a);if(this._currentDrag.element){const{clientX:h,clientY:u}=v(t,this._firefoxDragPosition),_=((e=this._currentDrag.offset)==null?void 0:e.x)||0,d=((n=this._currentDrag.offset)==null?void 0:n.y)||0;this._currentDrag.element.style.left=`${h-_}px`,this._currentDrag.element.style.top=`${u-d}px`;const p=(this.options.dragInOverlapX||0)+1,y=(this.options.dragInOverlapY||0)+1;r>p&&l>y?this._currentDrag.element.style.animation=`${Y} ${w} ${S}`:this._currentDrag.element.style.animation=`${x} ${w} ${S}`}if(!(r===1&&l===1)&&b(this._instance)){let h=r,u=l;if(E(t)){const _=this.options.fingerSize||0;h=Math.max(2,r+_),u=Math.max(2,l-_)}this._instance.updateDrag(h,u)}}dragEnd(){this._iframe.style.pointerEvents="all";const t=this._iframe.parentNode;b(this._instance)&&this._instance.dragInObjectEnd(),this._currentDrag.element&&document.body.removeChild(this._currentDrag.element),this._currentDrag={},this._firefoxDragPosition={x:0,y:0};const e=t.querySelector("."+g);e&&e.classList.add(T.DISPLAY_NONE)}touchStart(t,e,n="rml_id"){var o,s;e.preventDefault();const a=(l,h)=>{this.dragStart(t,h,n)},r={};(o=this.options)
|
|
7
|
+
`,document.head.appendChild(t)}}_initializeDragGhost(){const t=this._iframe.parentNode;let e=t.querySelector("."+m);e||(e=document.createElement("div"),e.classList.add(m),e.innerText=" ",t.appendChild(e))}setInstance(t){this._instance=t}dragStart(t,e,n="rml_id"){const o=this._iframe.parentNode;if(f(o).position!=="relative"){console.warn("Parent of iframe should have position relative, otherwise drag-in can not detect the x/y coordinates correctly");return}this._iframe.style.pointerEvents="none";let s=o.querySelector("."+g);s||(s=document.createElement("div"),s.classList.add(g),o.appendChild(s)),s.classList.remove(T.DISPLAY_NONE),e.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 a=o.querySelector("."+m);this._currentDrag.event=e;const r=e.target.cloneNode();r.style.position="fixed",r.style.pointerEvents="none",r.style.opacity="0",r.style.animation=`${x} ${w} ${S}`,r.id=F,r.style.zIndex="9999",document.body.appendChild(r),this._currentDrag.element=r;const l=e.target.getBoundingClientRect();this._currentDrag.offset||(this._currentDrag.offset={x:0,y:0});const{clientX:h,clientY:u}=v(e,this._firefoxDragPosition);this._currentDrag.offset.x=h-l.left,this._currentDrag.offset.y=u-l.top,r.style.top=u+"px",r.style.left=h+"px",e instanceof DragEvent&&e.dataTransfer&&e.dataTransfer.setDragImage&&e.dataTransfer.setDragImage(a,0,0);const{x:_,y:d}=I(o,this._currentDrag.event||e,this._firefoxDragPosition),p=Math.max(1,_),y=Math.max(1,d);b(this._instance)&&this._instance.dragInObject(t,p,y,n)}dragUpdate(t){var e,n;const o=this._iframe.parentNode,{x:s,y:a}=I(o,t,this._firefoxDragPosition);if(s===0&&a===0)return;const r=Math.max(1,s),l=Math.max(1,a);if(this._currentDrag.element){const{clientX:h,clientY:u}=v(t,this._firefoxDragPosition),_=((e=this._currentDrag.offset)==null?void 0:e.x)||0,d=((n=this._currentDrag.offset)==null?void 0:n.y)||0;this._currentDrag.element.style.left=`${h-_}px`,this._currentDrag.element.style.top=`${u-d}px`;const p=(this.options.dragInOverlapX||0)+1,y=(this.options.dragInOverlapY||0)+1;r>p&&l>y?this._currentDrag.element.style.animation=`${Y} ${w} ${S}`:this._currentDrag.element.style.animation=`${x} ${w} ${S}`}if(!(r===1&&l===1)&&b(this._instance)){let h=r,u=l;if(E(t)){const _=this.options.fingerSize||0;h=Math.max(2,r+_),u=Math.max(2,l-_)}this._instance.updateDrag(h,u)}}dragEnd(){this._iframe.style.pointerEvents="all";const t=this._iframe.parentNode;b(this._instance)&&this._instance.dragInObjectEnd(),this._currentDrag.element&&document.body.removeChild(this._currentDrag.element),this._currentDrag={},this._firefoxDragPosition={x:0,y:0};const e=t.querySelector("."+g);e&&e.classList.add(T.DISPLAY_NONE)}touchStart(t,e,n="rml_id"){var o,s;e.preventDefault();const a=(l,h)=>{this.dragStart(t,h,n)},r={};typeof((o=this.options)==null?void 0:o.touchDragDelay)=="number"&&(r.delay=this.options.touchDragDelay),(s=this.options)!=null&&s.touchDragEpsilon&&(r.epsilon=this.options.touchDragEpsilon),this._currentTouch=new z(void 0,{onTouchDragStart:a},r),this._currentTouch.onTouchStart(e)}touchMove(t){this._currentTouch&&this._currentTouch.onTouchMove(t),this._currentDrag.event&&this.dragUpdate(t)}touchEnd(){this._currentTouch&&this._currentTouch.onTouchEnd(),this._currentTouch=null,this.dragEnd()}dispose(){document.removeEventListener("dragover",this._firefoxFallback)}}export{A as DragIn};
|
|
@@ -127,9 +127,9 @@ class z {
|
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
const O = "rml-drag-in-styles", F = "rml-drag-in-drag-element", g = "rml-drag-in-overlay", m = "rml-drag-in-drag-ghost", T = "rml-drag-in-fade-in",
|
|
130
|
+
const O = "rml-drag-in-styles", F = "rml-drag-in-drag-element", g = "rml-drag-in-overlay", m = "rml-drag-in-drag-ghost", T = "rml-drag-in-fade-in", b = "rml-drag-in-fade-out", x = {
|
|
131
131
|
DISPLAY_NONE: "rml-display-none"
|
|
132
|
-
},
|
|
132
|
+
}, Y = 0.5, S = "250ms", I = "forwards", E = (n) => n ? !0 : (console.warn("No instance set, cancel drag-in"), !1);
|
|
133
133
|
class U {
|
|
134
134
|
constructor(t) {
|
|
135
135
|
c(this, "_iframe");
|
|
@@ -153,8 +153,8 @@ class U {
|
|
|
153
153
|
.${x.DISPLAY_NONE}{display:none}
|
|
154
154
|
.${g}{position:absolute;top:0;left:0;width:100%;height:100%;z-index:999;}
|
|
155
155
|
.${m}{position:absolute;top:0;left:0;width:1px;height:1px;z-index:999;pointer-events:none;background-color:transparent;}
|
|
156
|
-
@keyframes ${T} {from{opacity: 0;}to {opacity: ${
|
|
157
|
-
@keyframes ${
|
|
156
|
+
@keyframes ${T} {from{opacity: 0;}to {opacity: ${Y};}}
|
|
157
|
+
@keyframes ${b} {from{opacity: ${Y};}to {opacity: 0;}}
|
|
158
158
|
`, document.head.appendChild(e);
|
|
159
159
|
}
|
|
160
160
|
}
|
|
@@ -216,7 +216,7 @@ class U {
|
|
|
216
216
|
), u = ((l = this._currentDrag.offset) == null ? void 0 : l.x) || 0, f = ((_ = this._currentDrag.offset) == null ? void 0 : _.y) || 0;
|
|
217
217
|
this._currentDrag.element.style.left = `${a - u}px`, this._currentDrag.element.style.top = `${h - f}px`;
|
|
218
218
|
const d = (this.options.dragInOverlapX || 0) + 1, y = (this.options.dragInOverlapY || 0) + 1;
|
|
219
|
-
r > d && o > y ? this._currentDrag.element.style.animation = `${
|
|
219
|
+
r > d && o > y ? this._currentDrag.element.style.animation = `${b} ${S} ${I}` : this._currentDrag.element.style.animation = `${T} ${S} ${I}`;
|
|
220
220
|
}
|
|
221
221
|
if (!(r === 1 && o === 1) && E(this._instance)) {
|
|
222
222
|
let a = r, h = o;
|
|
@@ -242,7 +242,7 @@ class U {
|
|
|
242
242
|
const s = (_, a) => {
|
|
243
243
|
this.dragStart(t, a, i);
|
|
244
244
|
}, r = {};
|
|
245
|
-
(o = this.options)
|
|
245
|
+
typeof ((o = this.options) == null ? void 0 : o.touchDragDelay) == "number" && (r.delay = this.options.touchDragDelay), (l = this.options) != null && l.touchDragEpsilon && (r.epsilon = this.options.touchDragEpsilon), this._currentTouch = new z(
|
|
246
246
|
void 0,
|
|
247
247
|
{
|
|
248
248
|
onTouchDragStart: s
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roomle/embedding-lib",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0-alpha.1",
|
|
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.84.0-alpha.1"
|
|
33
33
|
},
|
|
34
34
|
"repository": {
|
|
35
35
|
"type": "git",
|
|
@@ -306,7 +306,7 @@ class Q {
|
|
|
306
306
|
typeof c == "string" && c === "dragIn" ? this.pluginsLoaded.push(
|
|
307
307
|
new Promise((a, f) => {
|
|
308
308
|
try {
|
|
309
|
-
import("./drag-in-
|
|
309
|
+
import("./drag-in-DC-05b4s.mjs").then(
|
|
310
310
|
({ DragIn: u }) => {
|
|
311
311
|
const h = new u(this._iframe);
|
|
312
312
|
h.setInstance(this.ui), this.plugins.dragIn = h, a();
|
|
@@ -5,4 +5,4 @@ var R=Object.defineProperty,S=(s,e,t)=>e in s?R(s,e,{enumerable:!0,configurable:
|
|
|
5
5
|
.${h.FILL}{width:100%;height:100%;opacity:1}
|
|
6
6
|
.${h.ANDROID_HEIGHT}{height:calc(var(${I},1vh)*100)}
|
|
7
7
|
.${h.OVERFLOW_HIDDEN}{overflow:hidden}
|
|
8
|
-
`,document.head.appendChild(a)}this._onResize=this._onResize.bind(this),v()&&window.addEventListener("resize",this._onResize),this._container=t,this._initData=r,this._configuratorSettings=e;const u=this._createIframe();this._onUseFullPage=this._onUseFullPage.bind(this),this._executeMessage=this._executeMessage.bind(this),this._onBackToWebsite=this._onBackToWebsite.bind(this),this._messageHandler=new A("website",window,null,this._executeMessage),this._waitForIframe=o,this._container.appendChild(u),this._iframe=u;for(const n of i)typeof n=="string"&&n==="dragIn"?this.pluginsLoaded.push(new Promise((a,l)=>{try{import("./drag-in-
|
|
8
|
+
`,document.head.appendChild(a)}this._onResize=this._onResize.bind(this),v()&&window.addEventListener("resize",this._onResize),this._container=t,this._initData=r,this._configuratorSettings=e;const u=this._createIframe();this._onUseFullPage=this._onUseFullPage.bind(this),this._executeMessage=this._executeMessage.bind(this),this._onBackToWebsite=this._onBackToWebsite.bind(this),this._messageHandler=new A("website",window,null,this._executeMessage),this._waitForIframe=o,this._container.appendChild(u),this._iframe=u;for(const n of i)typeof n=="string"&&n==="dragIn"?this.pluginsLoaded.push(new Promise((a,l)=>{try{import("./drag-in-BKrnFtmJ.mjs").then(({DragIn:g})=>{const d=new g(this._iframe);d.setInstance(this.ui),this.plugins.dragIn=d,a()})}catch(g){l(g)}})):n.name&&n.loader&&this.pluginsLoaded.push(new Promise((a,l)=>{try{n.loader().then(g=>{const d=new g(this._iframe);d.setInstance(this.ui),this.plugins[n.name]=d,a()})}catch(g){l(g)}}));O.set(t,!0)}static createPlanner(e,t,r,i=[]){return this._create(e,t,r,i)}static createConfigurator(e,t,r,i=[]){return this._create(e,t,r,i)}static create(e,t,r,i){return this._create(e,t,r,i)}static createViewer(e,t,r,i=[]){return this._create(e,t,r,i)}static async _create(e,t,r,i){return new Promise(async(o,u)=>{try{const n=y(z(),$(r));n.featureFlags||(n.featureFlags={}),typeof n.featureFlags.realPartList!="boolean"&&(n.featureFlags.realPartList=!0),typeof n.featureFlags.globalCallbacks!="boolean"&&(n.featureFlags.globalCallbacks=!0),typeof n.featureFlags.mocAr!="boolean"&&(n.featureFlags.mocAr=!1);const a=await P(e,n);r=V(a,n);const l=new this(a,t,r,i,o);return await Promise.allSettled(l.pluginsLoaded),l}catch(n){return u(n)}})}teardown(){this._container&&O.delete(this._container);const e=this._container.querySelector("iframe");e&&this._container.removeChild(e),window.removeEventListener("resize",this._onResize)}_createIframe(){var e;const t=document.createElement("iframe");let r=((e=this._configuratorSettings)==null?void 0:e.url)||"https://www.roomle.com/t/cp/";return this._initData.useLocalRoomle&&(r=location.href.replace("embedding.html","")),location.href.includes("roomle.gitlab.io")&&(r=location.href.replace("embedding.html","index.html")),this._initData.overrideServerUrl&&(r=this._initData.overrideServerUrl),t.src=r,t.classList.add(h.CONTAINER),t.classList.add(h.FILL),t}_onResize(){M(this._iframe)}_onUseFullPage(){this._iframe.classList.add(h.POSITION),document.documentElement.classList.add(h.OVERFLOW_HIDDEN),window.document.body.classList.add(h.OVERFLOW_HIDDEN),v()&&(M(this._iframe),this._iframe.classList.add(h.ANDROID_HEIGHT))}_onBackToWebsite(){this._iframe.classList.remove(h.POSITION),this._iframe.classList.remove(h.ANDROID_HEIGHT),document.documentElement.classList.remove(h.OVERFLOW_HIDDEN),window.document.body.classList.remove(h.OVERFLOW_HIDDEN)}_executeMessage({message:e,args:t},r){var i;if(!r.source||r.source!==((i=this._iframe)==null?void 0:i.contentWindow))return;if(e===w.REQUEST_BOOT)return this._messageHandler.setOutgoingMessageBus(r.source),Promise.resolve({result:this._initData});if(e===w.SETUP){const{methods:l,callbacks:g}=t[0];return l.forEach(d=>{const f=d.split(p),m=f[0],_=f[1];this[m]||(this[m]={}),this[m][_]=function(){return this._messageHandler.sendMessage(d,[...arguments])}.bind(this)}),g.forEach(d=>{const f=d.split(p),m=f[0],_=f[1],D=f[2];this[m]||(this[m]={}),this[m][_]||(this[m][_]={}),this[m][_][D]=()=>{}}),T(this.ui.callbacks,"onUseFullPage",this._onUseFullPage),T(this.ui.callbacks,"onBackToWebsite",this._onBackToWebsite),this._waitForIframe(this),setTimeout(()=>this._messageHandler.sendMessage(w.WEBSITE_READY),0),Promise.resolve({result:null})}const o=e.split(p),u=o[0],n=o[1],a=o.length===3?o[2]:null;if(a&&this[u][n][a]){const l=this[u][n][a](...t);return l instanceof Promise?l.then(g=>({result:g})):l!==void 0?Promise.resolve({result:l}):Promise.resolve({result:null})}return Promise.reject('Message "'+e+'" is unkown')}}export{Y as default};
|
|
@@ -11,4 +11,4 @@
|
|
|
11
11
|
.${D}{position:absolute;top:0;left:0;width:1px;height:1px;z-index:999;pointer-events:none;background-color:transparent;}
|
|
12
12
|
@keyframes ${N} {from{opacity: 0;}to {opacity: ${J};}}
|
|
13
13
|
@keyframes ${V} {from{opacity: ${J};}to {opacity: 0;}}
|
|
14
|
-
`,document.head.appendChild(t)}}_initializeDragGhost(){const e=this._iframe.parentNode;let t=e.querySelector("."+D);t||(t=document.createElement("div"),t.classList.add(D),t.innerText=" ",e.appendChild(t))}setInstance(e){this._instance=e}dragStart(e,t,r="rml_id"){const n=this._iframe.parentNode;if(E(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._iframe.style.pointerEvents="none";let a=n.querySelector("."+I);a||(a=document.createElement("div"),a.classList.add(I),n.appendChild(a)),a.classList.remove(R.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 u=n.querySelector("."+D);this._currentDrag.event=t;const i=t.target.cloneNode();i.style.position="fixed",i.style.pointerEvents="none",i.style.opacity="0",i.style.animation=`${N} ${x} ${M}`,i.id=_e,i.style.zIndex="9999",document.body.appendChild(i),this._currentDrag.element=i;const d=t.target.getBoundingClientRect();this._currentDrag.offset||(this._currentDrag.offset={x:0,y:0});const{clientX:h,clientY:f}=L(t,this._firefoxDragPosition);this._currentDrag.offset.x=h-d.left,this._currentDrag.offset.y=f-d.top,i.style.top=f+"px",i.style.left=h+"px",t instanceof DragEvent&&t.dataTransfer&&t.dataTransfer.setDragImage&&t.dataTransfer.setDragImage(u,0,0);const{x:g,y}=G(n,this._currentDrag.event||t,this._firefoxDragPosition),v=Math.max(1,g),ye=Math.max(1,y);C(this._instance)&&this._instance.dragInObject(e,v,ye,r)}dragUpdate(e){var c,u;const t=this._iframe.parentNode,{x:r,y:n}=G(t,e,this._firefoxDragPosition);if(r===0&&n===0)return;const o=Math.max(1,r),a=Math.max(1,n);if(this._currentDrag.element){const{clientX:i,clientY:d}=L(e,this._firefoxDragPosition),h=((c=this._currentDrag.offset)==null?void 0:c.x)||0,f=((u=this._currentDrag.offset)==null?void 0:u.y)||0;this._currentDrag.element.style.left=`${i-h}px`,this._currentDrag.element.style.top=`${d-f}px`;const g=(this.options.dragInOverlapX||0)+1,y=(this.options.dragInOverlapY||0)+1;o>g&&a>y?this._currentDrag.element.style.animation=`${V} ${x} ${M}`:this._currentDrag.element.style.animation=`${N} ${x} ${M}`}if(!(o===1&&a===1)&&C(this._instance)){let i=o,d=a;if(B(e)){const h=this.options.fingerSize||0;i=Math.max(2,o+h),d=Math.max(2,a-h)}this._instance.updateDrag(i,d)}}dragEnd(){this._iframe.style.pointerEvents="all";const e=this._iframe.parentNode;C(this._instance)&&this._instance.dragInObjectEnd(),this._currentDrag.element&&document.body.removeChild(this._currentDrag.element),this._currentDrag={},this._firefoxDragPosition={x:0,y:0};const t=e.querySelector("."+I);t&&t.classList.add(R.DISPLAY_NONE)}touchStart(e,t,r="rml_id"){var a,c;t.preventDefault();const n=(u,i)=>{this.dragStart(e,i,r)},o={};(a=this.options)
|
|
14
|
+
`,document.head.appendChild(t)}}_initializeDragGhost(){const e=this._iframe.parentNode;let t=e.querySelector("."+D);t||(t=document.createElement("div"),t.classList.add(D),t.innerText=" ",e.appendChild(t))}setInstance(e){this._instance=e}dragStart(e,t,r="rml_id"){const n=this._iframe.parentNode;if(E(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._iframe.style.pointerEvents="none";let a=n.querySelector("."+I);a||(a=document.createElement("div"),a.classList.add(I),n.appendChild(a)),a.classList.remove(R.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 u=n.querySelector("."+D);this._currentDrag.event=t;const i=t.target.cloneNode();i.style.position="fixed",i.style.pointerEvents="none",i.style.opacity="0",i.style.animation=`${N} ${x} ${M}`,i.id=_e,i.style.zIndex="9999",document.body.appendChild(i),this._currentDrag.element=i;const d=t.target.getBoundingClientRect();this._currentDrag.offset||(this._currentDrag.offset={x:0,y:0});const{clientX:h,clientY:f}=L(t,this._firefoxDragPosition);this._currentDrag.offset.x=h-d.left,this._currentDrag.offset.y=f-d.top,i.style.top=f+"px",i.style.left=h+"px",t instanceof DragEvent&&t.dataTransfer&&t.dataTransfer.setDragImage&&t.dataTransfer.setDragImage(u,0,0);const{x:g,y}=G(n,this._currentDrag.event||t,this._firefoxDragPosition),v=Math.max(1,g),ye=Math.max(1,y);C(this._instance)&&this._instance.dragInObject(e,v,ye,r)}dragUpdate(e){var c,u;const t=this._iframe.parentNode,{x:r,y:n}=G(t,e,this._firefoxDragPosition);if(r===0&&n===0)return;const o=Math.max(1,r),a=Math.max(1,n);if(this._currentDrag.element){const{clientX:i,clientY:d}=L(e,this._firefoxDragPosition),h=((c=this._currentDrag.offset)==null?void 0:c.x)||0,f=((u=this._currentDrag.offset)==null?void 0:u.y)||0;this._currentDrag.element.style.left=`${i-h}px`,this._currentDrag.element.style.top=`${d-f}px`;const g=(this.options.dragInOverlapX||0)+1,y=(this.options.dragInOverlapY||0)+1;o>g&&a>y?this._currentDrag.element.style.animation=`${V} ${x} ${M}`:this._currentDrag.element.style.animation=`${N} ${x} ${M}`}if(!(o===1&&a===1)&&C(this._instance)){let i=o,d=a;if(B(e)){const h=this.options.fingerSize||0;i=Math.max(2,o+h),d=Math.max(2,a-h)}this._instance.updateDrag(i,d)}}dragEnd(){this._iframe.style.pointerEvents="all";const e=this._iframe.parentNode;C(this._instance)&&this._instance.dragInObjectEnd(),this._currentDrag.element&&document.body.removeChild(this._currentDrag.element),this._currentDrag={},this._firefoxDragPosition={x:0,y:0};const t=e.querySelector("."+I);t&&t.classList.add(R.DISPLAY_NONE)}touchStart(e,t,r="rml_id"){var a,c;t.preventDefault();const n=(u,i)=>{this.dragStart(e,i,r)},o={};typeof((a=this.options)==null?void 0:a.touchDragDelay)=="number"&&(o.delay=this.options.touchDragDelay),(c=this.options)!=null&&c.touchDragEpsilon&&(o.epsilon=this.options.touchDragEpsilon),this._currentTouch=new ge(void 0,{onTouchDragStart:n},o),this._currentTouch.onTouchStart(t)}touchMove(e){this._currentTouch&&this._currentTouch.onTouchMove(e),this._currentDrag.event&&this.dragUpdate(e)}touchEnd(){this._currentTouch&&this._currentTouch.onTouchEnd(),this._currentTouch=null,this.dragEnd()}dispose(){document.removeEventListener("dragover",this._firefoxFallback)}}const pe=Object.freeze(Object.defineProperty({__proto__:null,DragIn:me},Symbol.toStringTag,{value:"Module"}));return he});
|
|
@@ -11,4 +11,4 @@
|
|
|
11
11
|
.${b}{position:absolute;top:0;left:0;width:1px;height:1px;z-index:999;pointer-events:none;background-color:transparent;}
|
|
12
12
|
@keyframes ${M} {from{opacity: 0;}to {opacity: ${V};}}
|
|
13
13
|
@keyframes ${J} {from{opacity: ${V};}to {opacity: 0;}}
|
|
14
|
-
`,document.head.appendChild(e)}}_initializeDragGhost(){const e=this._iframe.parentNode;let t=e.querySelector("."+b);t||(t=document.createElement("div"),t.classList.add(b),t.innerText=" ",e.appendChild(t))}setInstance(e){this._instance=e}dragStart(e,t,s="rml_id"){const r=this._iframe.parentNode;if(v(r).position!=="relative"){console.warn("Parent of iframe should have position relative, otherwise drag-in can not detect the x/y coordinates correctly");return}this._iframe.style.pointerEvents="none";let o=r.querySelector("."+w);o||(o=document.createElement("div"),o.classList.add(w),r.appendChild(o)),o.classList.remove(N.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 a=r.querySelector("."+b);this._currentDrag.event=t;const n=t.target.cloneNode();n.style.position="fixed",n.style.pointerEvents="none",n.style.opacity="0",n.style.animation=`${M} ${P} ${R}`,n.id=_e,n.style.zIndex="9999",document.body.appendChild(n),this._currentDrag.element=n;const c=t.target.getBoundingClientRect();this._currentDrag.offset||(this._currentDrag.offset={x:0,y:0});const{clientX:h,clientY:u}=L(t,this._firefoxDragPosition);this._currentDrag.offset.x=h-c.left,this._currentDrag.offset.y=u-c.top,n.style.top=u+"px",n.style.left=h+"px",t instanceof DragEvent&&t.dataTransfer&&t.dataTransfer.setDragImage&&t.dataTransfer.setDragImage(a,0,0);const{x:d,y:g}=z(r,this._currentDrag.event||t,this._firefoxDragPosition),f=Math.max(1,d),p=Math.max(1,g);C(this._instance)&&this._instance.dragInObject(e,f,p,s)}dragUpdate(e){var t,s;const r=this._iframe.parentNode,{x:o,y:a}=z(r,e,this._firefoxDragPosition);if(o===0&&a===0)return;const n=Math.max(1,o),c=Math.max(1,a);if(this._currentDrag.element){const{clientX:h,clientY:u}=L(e,this._firefoxDragPosition),d=((t=this._currentDrag.offset)==null?void 0:t.x)||0,g=((s=this._currentDrag.offset)==null?void 0:s.y)||0;this._currentDrag.element.style.left=`${h-d}px`,this._currentDrag.element.style.top=`${u-g}px`;const f=(this.options.dragInOverlapX||0)+1,p=(this.options.dragInOverlapY||0)+1;n>f&&c>p?this._currentDrag.element.style.animation=`${J} ${P} ${R}`:this._currentDrag.element.style.animation=`${M} ${P} ${R}`}if(!(n===1&&c===1)&&C(this._instance)){let h=n,u=c;if(B(e)){const d=this.options.fingerSize||0;h=Math.max(2,n+d),u=Math.max(2,c-d)}this._instance.updateDrag(h,u)}}dragEnd(){this._iframe.style.pointerEvents="all";const e=this._iframe.parentNode;C(this._instance)&&this._instance.dragInObjectEnd(),this._currentDrag.element&&document.body.removeChild(this._currentDrag.element),this._currentDrag={},this._firefoxDragPosition={x:0,y:0};const t=e.querySelector("."+w);t&&t.classList.add(N.DISPLAY_NONE)}touchStart(e,t,s="rml_id"){var r,o;t.preventDefault();const a=(c,h)=>{this.dragStart(e,h,s)},n={};(r=this.options)
|
|
14
|
+
`,document.head.appendChild(e)}}_initializeDragGhost(){const e=this._iframe.parentNode;let t=e.querySelector("."+b);t||(t=document.createElement("div"),t.classList.add(b),t.innerText=" ",e.appendChild(t))}setInstance(e){this._instance=e}dragStart(e,t,s="rml_id"){const r=this._iframe.parentNode;if(v(r).position!=="relative"){console.warn("Parent of iframe should have position relative, otherwise drag-in can not detect the x/y coordinates correctly");return}this._iframe.style.pointerEvents="none";let o=r.querySelector("."+w);o||(o=document.createElement("div"),o.classList.add(w),r.appendChild(o)),o.classList.remove(N.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 a=r.querySelector("."+b);this._currentDrag.event=t;const n=t.target.cloneNode();n.style.position="fixed",n.style.pointerEvents="none",n.style.opacity="0",n.style.animation=`${M} ${P} ${R}`,n.id=_e,n.style.zIndex="9999",document.body.appendChild(n),this._currentDrag.element=n;const c=t.target.getBoundingClientRect();this._currentDrag.offset||(this._currentDrag.offset={x:0,y:0});const{clientX:h,clientY:u}=L(t,this._firefoxDragPosition);this._currentDrag.offset.x=h-c.left,this._currentDrag.offset.y=u-c.top,n.style.top=u+"px",n.style.left=h+"px",t instanceof DragEvent&&t.dataTransfer&&t.dataTransfer.setDragImage&&t.dataTransfer.setDragImage(a,0,0);const{x:d,y:g}=z(r,this._currentDrag.event||t,this._firefoxDragPosition),f=Math.max(1,d),p=Math.max(1,g);C(this._instance)&&this._instance.dragInObject(e,f,p,s)}dragUpdate(e){var t,s;const r=this._iframe.parentNode,{x:o,y:a}=z(r,e,this._firefoxDragPosition);if(o===0&&a===0)return;const n=Math.max(1,o),c=Math.max(1,a);if(this._currentDrag.element){const{clientX:h,clientY:u}=L(e,this._firefoxDragPosition),d=((t=this._currentDrag.offset)==null?void 0:t.x)||0,g=((s=this._currentDrag.offset)==null?void 0:s.y)||0;this._currentDrag.element.style.left=`${h-d}px`,this._currentDrag.element.style.top=`${u-g}px`;const f=(this.options.dragInOverlapX||0)+1,p=(this.options.dragInOverlapY||0)+1;n>f&&c>p?this._currentDrag.element.style.animation=`${J} ${P} ${R}`:this._currentDrag.element.style.animation=`${M} ${P} ${R}`}if(!(n===1&&c===1)&&C(this._instance)){let h=n,u=c;if(B(e)){const d=this.options.fingerSize||0;h=Math.max(2,n+d),u=Math.max(2,c-d)}this._instance.updateDrag(h,u)}}dragEnd(){this._iframe.style.pointerEvents="all";const e=this._iframe.parentNode;C(this._instance)&&this._instance.dragInObjectEnd(),this._currentDrag.element&&document.body.removeChild(this._currentDrag.element),this._currentDrag={},this._firefoxDragPosition={x:0,y:0};const t=e.querySelector("."+w);t&&t.classList.add(N.DISPLAY_NONE)}touchStart(e,t,s="rml_id"){var r,o;t.preventDefault();const a=(c,h)=>{this.dragStart(e,h,s)},n={};typeof((r=this.options)==null?void 0:r.touchDragDelay)=="number"&&(n.delay=this.options.touchDragDelay),(o=this.options)!=null&&o.touchDragEpsilon&&(n.epsilon=this.options.touchDragEpsilon),this._currentTouch=new fe(void 0,{onTouchDragStart:a},n),this._currentTouch.onTouchStart(t)}touchMove(e){this._currentTouch&&this._currentTouch.onTouchMove(e),this._currentDrag.event&&this.dragUpdate(e)}touchEnd(){this._currentTouch&&this._currentTouch.onTouchEnd(),this._currentTouch=null,this.dragEnd()}dispose(){document.removeEventListener("dragover",this._firefoxFallback)}}const ye=Object.freeze(Object.defineProperty({__proto__:null,DragIn:pe},Symbol.toStringTag,{value:"Module"}));return de});
|