@roomle/embedding-lib 5.17.1 → 5.19.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 +40 -3
- package/package.json +2 -2
- package/packages/common/src/utils/init-data.d.ts +1 -29
- package/packages/common/src/utils/json.d.ts +1 -0
- package/packages/embedding-lib/src/connector.d.ts +5 -1
- package/packages/embedding-lib/src/examples/activate-deactivate-rd.d.ts +8 -0
- package/roomle-embedding-lib.es.js +30 -28
- package/roomle-embedding-lib.es.min.js +1 -1
- package/roomle-embedding-lib.umd.js +4 -4
- package/roomle-embedding-lib.umd.min.js +1 -1
- package/src/common/components/collection-view/-utils/collection-view-dynamic-components.d.ts +6 -6
- package/src/common/components/inputs/BaseInput.vue.d.ts +108 -2
- package/src/common/components/inputs/GenericInput.vue.d.ts +39 -0
- package/src/common/components/inputs/SelectDropdown.vue.d.ts +2 -0
- package/src/common/components/utils/QRCode.vue.d.ts +2 -2
- package/src/common/composables/use-wall-dimensions-cache.d.ts +8 -0
- package/src/common/store/common-ui-state.d.ts +1 -1
- package/src/common/utils/helper.d.ts +1 -1
- package/src/common/utils/types.d.ts +1 -0
- package/src/configurator/components/grid-view/GridView.vue.d.ts +2 -2
- package/src/configurator/components/parameters/types/MaterialParameter.vue.d.ts +2 -2
- package/src/configurator/components/parameters/types/ProductVariant.vue.d.ts +2 -2
- package/src/configurator/components/parameters/types/ThumbnailsParameter.vue.d.ts +2 -2
- package/src/configurator/embedding/exposed-api.d.ts +6 -1
- package/src/configurator/embedding/exposed-callbacks.d.ts +7 -2
- package/src/configurator/embedding/types.d.ts +5 -5
- package/src/planner/business-logic/sdk-connector-planner.d.ts +3 -3
- package/src/planner/components/overlays/rooms/ConstructionVariants.vue.d.ts +2 -2
- package/src/planner/components/overlays/rooms/DoorParametersSetting.vue.d.ts +2 -2
- package/src/planner/components/overlays/rooms/RoomFloorAndWallSettings.vue.d.ts +17 -0
- package/src/planner/store/planner-ui-state.d.ts +4 -0
- package/src/viewer/components/ViewerMain.vue.d.ts +1 -0
- package/src/planner/components/overlays/rooms/FloorColor.vue.d.ts +0 -3853
|
@@ -1 +1 @@
|
|
|
1
|
-
var t,e;t=this,e=function(){"use strict";var t=Object.defineProperty,e=(e,s,i)=>((e,s,i)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[s]=i)(e,"symbol"!=typeof s?s+"":s,i);class s{constructor(t,s,i,n){e(this,"_side"),e(this,"_incomingMessageBus",null),e(this,"_outgoingMessageBus",null),e(this,"_execMessage",null),this._side=t,this._incomingMessageBus=s,this._outgoingMessageBus=i,this._execMessage=n,this._incomingMessageBus&&this._incomingMessageBus.addEventListener("message",this._handleMessage.bind(this))}setOutgoingMessageBus(t){this._outgoingMessageBus=t}setMessageExecution(t){this._execMessage=t}sendMessage(t,e=[]){return new Promise(((s,i)=>{if(this._incomingMessageBus===this._outgoingMessageBus)return s(void 0);const n=new MessageChannel;n.port1.onmessage=t=>{if(!t||!t.data)return n.port1.close(),n.port2.close(),i(new Error(this._side+" received message but response can not be interpreted"));let e;try{e=JSON.parse(t.data)}catch(t){return n.port1.close(),n.port2.close(),this._prepareError(t),i(t)}e.error?i(e.error):void 0!==e.result?s(e.result):s(void 0),n.port1.close(),n.port2.close()};let r="";try{r=JSON.stringify({message:t,args:e})}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(r,"*",[n.port2])}))}_handleMessage(t){const e=t.ports&&Array.isArray(t.ports)&&t.ports.length>0?t.ports[0]:null;if(t.data&&e)try{const s=JSON.parse(t.data);if(!this._execMessage)return e.postMessage(JSON.stringify({error:this._side+" is not ready to handle messages"}));Array.isArray(s.args)||(s.args=[s.args]);const i=this._execMessage(s,t);if(void 0===i)return;i.then(((t={})=>{let s,i;"object"==typeof t&&null!==t&&(s=t.error,i=t.result),s?e.postMessage(JSON.stringify({error:s})):void 0!==i?e.postMessage(JSON.stringify({result:i})):e.postMessage(JSON.stringify({result:t}))}),(t=>{e.postMessage(JSON.stringify({error:this._prepareError(t)}))}))}catch(t){e.postMessage(JSON.stringify({error:this._prepareError(t)}))}}_prepareError(t){return"string"==typeof t?this._side+": "+t:(t.message=this._side+": "+t.message,t.message)}}const i=["127.0.0.1","localhost","0.0.0.0"],n=["language","browserLanguage","userLanguage","systemLanguage"],r=(t,e)=>{for(const s in e)try{e[s].constructor===Object?t[s]=r(t[s],e[s]):t[s]=e[s]}catch{t[s]=e[s]}return t};var a,o=((a=o||{}).BOTTOM_BAR="bottom_bar",a.PARTLIST_BOUNDS="partlist_bounds",a.INTERACTION_NOTES="interaction_notes",a.PARAMETER_GROUPS="parameter_groups",a),l={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};const h={mobileLandscape:!0,floorMaterialRootTag:"materials_root",buttons:{renderimage:!0,requestproduct:!0,requestplan:!0,load_product:!0,partlist_print:!0},elements:{[o.INTERACTION_NOTES]:!0},helpcenter:{roomdesigner:!0,configurator:!1,disable:!1},firstPersonView:!0,saveToIdb:!0,featureFlags:{mocAr:!0,wallAutoHeight:!1,openCloseAnimation:!1,showWallVisibilityToggle:!1},rotationSnapDegrees:10,interactionsCollapsed:!1},c=t=>{if(!t)return;const e=Object.keys(t);for(const s of e){const e=t[s];if(!Array.isArray(e)&&"object"==typeof e&&null!==e&&c(e),Array.isArray(e))for(const t of e)c(t);("true"===e||"false"===e)&&(t[s]="true"===e)}},u=()=>/(android)/i.test(navigator.userAgent);class g{constructor(){e(this,"_messageHandler",null),e(this,"isSetupDone",!1),e(this,"viewName","main"),e(this,"plugins",{}),e(this,"pluginsLoaded",[]),e(this,"ui",{callbacks:null}),e(this,"extended",{callbacks:null}),e(this,"configurator",{callbacks:null}),e(this,"analytics",{callbacks:{}}),e(this,"global",{callbacks:{}})}setMessageHandler(t){this._messageHandler=t}handleSetup(t){const{methods:e,callbacks:s}=t;e.forEach((t=>{const e=t.split("."),s=e[0],i=e[1];this[s]||(this[s]={}),this[s][i]=function(){if(this._messageHandler)return this._messageHandler.sendMessage(t,[...arguments])}.bind(this)})),s.forEach((t=>{const e=t.split("."),s=e[0],i=e[1],n=e[2];this[s]||(this[s]={}),this[s][i]||(this[s][i]={}),this[s][i][n]=()=>{}})),this.isSetupDone=!0}executeMessage({message:t,args:e}){const s=t.split("."),i=s[0],n=s[1],r=3===s.length?s[2]:null;if(r&&this[i][n][r]){const t=this[i][n][r](...e);return t instanceof Promise?t.then((t=>({result:t}))):void 0!==t?Promise.resolve({result:t}):Promise.resolve({result:null})}return Promise.reject('Message "'+t+'" is unkown')}setupPlugins(t,e,s="website"){for(const i of t)"string"==typeof i&&"dragIn"===i?this.pluginsLoaded.push(new Promise(((t,i)=>{try{Promise.resolve().then((()=>G)).then((({DragIn:n})=>{const r=new n(this.ui,e,s,this.viewName);r.init().then((()=>{this.plugins.dragIn=r,t()}),i)}))}catch(t){i(t)}}))):i.name&&i.loader&&this.pluginsLoaded.push(new Promise(((t,n)=>{try{i.loader().then((r=>{const a=new r(this.ui,e,s,this.viewName);a.init().then((()=>{this.plugins[i.name]=a,t()}),n)}))}catch(t){n(t)}})))}}const d=()=>{let t,e;return{promise:new Promise(((s,i)=>{t=s,e=i})),resolve:t,reject:e}},m=(t,e,s)=>{let i=null;Object.defineProperty(t,e,{get:()=>i||s,set(t){i=null!=t&&t.mute?t.value:t}})},_=()=>.01*window.innerHeight+"px",p=t=>{t&&setTimeout((()=>t.style.setProperty(y,_())),0)},f="rml-styles",y="--rml-full-height",v="rml-container",b="rml-fill",w="rml-pos",D="rml-android-height",E="rml-overflow-hidden",T=new Map;class S{constructor(t,s,i,n){e(this,"_mainDomElement"),e(this,"_instance"),e(this,"_mode","website"),e(this,"_viewName","main"),this._instance=t,this._mainDomElement=s,this._mode=i,this._viewName=n}async init(){return Promise.resolve()}}const x="rml-drag-in-styles",I="rml-drag-in-drag-element",M="rml-drag-in-overlay",C="rml-drag-in-drag-ghost",A="rml-drag-in-fade-in",O="rml-drag-in-fade-out",L="rml-display-none",B="250ms",P="forwards",F=`@keyframes ${A} {from{opacity: 0;}to {opacity: 0.5;}}`,U=`@keyframes ${O} {from{opacity: 0.5;}to {opacity: 0;}}`,R=`${A} ${B} ${P}`,N=`${O} ${B} ${P}`,X="https://res.cloudinary.com/roomle/image/upload/v1729679975/fallback_afpyqr.jpg",G=Object.freeze(Object.defineProperty({__proto__:null,DragIn:class extends S{constructor(t,s,i,n){super(t,s,i,n),e(this,"options",{}),e(this,"_customDragSignal",new AbortController),this._mainDomElement=s,this._injectStyles(),this._initializeDragGhost()}_injectStyles(){if(!document.getElementById(x)){const t=document.createElement("style");t.type="text/css",t.id=x,t.innerHTML=`\n .${L}{display:none}\n .${M}{position:absolute;top:0;left:0;width:100%;height:100%;z-index:999;}\n .${C}{position:absolute;top:0;left:0;width:1px;height:1px;z-index:999;pointer-events:none;background-color:transparent;}\n ${F}\n ${U}\n `,document.head.appendChild(t)}}_initializeDragGhost(){const t=this._mainDomElement.parentNode;let e=t.querySelector("."+C);e||(e=document.createElement("div"),e.classList.add(C),e.innerText=" ",t.appendChild(e))}async init(){if(await super.init(),"website"===this._mode)try{const{DragInFromWebsiteStrategy:t}=await Promise.resolve().then((()=>et));this._strategy=new t(this._instance,this._mainDomElement,{settings:this.options,mode:"website"})}catch(t){throw t}else{if("custom-view"!==this._mode)throw new Error("Unsupported mode");try{const{DragInFromCustomViewStrategy:t}=await Promise.resolve().then((()=>at));this._strategy=new t(this._instance,this.options,this._viewName)}catch(t){throw t}}}get isDragging(){return this._strategy.isDragging}dragStart(t,e,s="rml_id"){this._strategy.dragStart(t,e,s)}dragUpdate(t){this._strategy.dragUpdate(t)}dragEnd(){this._strategy.dragEnd()}touchStart(t,e,s="rml_id"){this._strategy.touchStart(t,e,s)}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:s,beforeUpdateGhost:i}){i&&this._strategy.beforeUpdateGhost(i);const n=this._customDragSignal.signal,r=e=>{"true"===e.target.getAttribute("data-rml-draggable")&&t(e)},a=t=>{this._strategy.releaseInput(t),this._strategy.isDragging&&e(t)},o=t=>{s(t)};document.querySelectorAll('[data-rml-draggable="true"]').forEach((t=>{t.draggable=!1})),document.addEventListener("mousedown",r,{signal:n}),document.addEventListener("mouseup",a,{signal:n}),document.addEventListener("mousemove",o,{signal:n}),document.addEventListener("mouseleave",a,{signal:n}),document.addEventListener("touchstart",r,{signal:n}),document.addEventListener("touchend",a,{signal:n}),document.addEventListener("touchmove",o,{signal:n})}unregisterCustomDrag(){this._customDragSignal.abort(),this._customDragSignal=new AbortController}releaseInput(t){this._strategy.releaseInput(t)}}},Symbol.toStringTag,{value:"Module"}));class k{constructor(t=16){e(this,"_computedStyleCache",new Map),e(this,"_maxLifetime",16),e(this,"_cacheCleanInterval",null),this._maxLifetime=t}get(t){const e=this._computedStyleCache.get(t),s=Date.now();if(e&&s-e.updated<this._maxLifetime)return e.style;const i=getComputedStyle(t);return this._computedStyleCache.set(t,{style:i,updated:s}),this._cacheCleanInterval||(this._cacheCleanInterval=setInterval((()=>this._cleanUpCache),Math.max(1e3*this._maxLifetime,5e3))),i}_cleanUpCache(){const t=Date.now();for(const[e,{updated:s}]of this._computedStyleCache.entries())t-s>=this._maxLifetime&&this._computedStyleCache.delete(e);0===this._computedStyleCache.size&&this._cacheCleanInterval&&(clearInterval(this._cacheCleanInterval),this._cacheCleanInterval=null)}}const Y=t=>window.TouchEvent&&t instanceof window.TouchEvent;let $;const j=t=>($||($=new k),$.get(t)),H=(t,e,s)=>{const i=parseFloat(t),n=window.devicePixelRatio||1;if("px"===e)return i;if("%"===e)return i/100*(s===document.documentElement?window.innerWidth:s.offsetWidth);if("rem"===e)return i*parseFloat(j(document.documentElement).fontSize);if("em"===e)return i*parseFloat(j(s).fontSize);if("vh"===e||"vw"===e||"vmin"===e||"vmax"===e)return i/100*{vh:window.innerHeight,vw:window.innerWidth,vmin:Math.min(window.innerWidth,window.innerHeight),vmax:Math.max(window.innerWidth,window.innerHeight)}[e];const r={cm:37.7952755906,mm:3.77952755906,in:96};return e in r?i*r[e]*n:0},W=(t,e,s={x:0,y:0})=>{const i=t.getBoundingClientRect(),n=j(t).transform;let r=0,a=0;if("none"!==n){const e=/translate\(\s*([-+]?\d*\.?\d+|\d+)(px|%)?,?\s*([-+]?\d*\.?\d+|\d+)?(px|%)?\s*\)/,s=n.match(e);s&&(r=H(s[1],s[2],t),a=H(s[3],s[4],t))}const{clientX:o,clientY:l}=z(e,s);return{x:o-i.left-r+t.scrollLeft,y:l-i.top-a+t.scrollTop}},z=(t,e=null)=>{const{clientX:s,clientY:i}=Y(t)?q(t):t;return{clientX:s>0?s:e?e.x:s,clientY:i>0?i:e?e.y:i}},q=t=>{if(t.touches.length){let{clientX:e,clientY:s}=t.touches[0];if(t.touches.length>1){const i=t.touches[1];e=(e+i.clientX)/2,s=(s+i.clientY)/2}return{clientX:e,clientY:s}}const e=t.changedTouches[0];return{clientX:e.clientX,clientY:e.clientY}},J=(t,e=0)=>Y(t)?{clientX:t.touches[e].clientX,clientY:t.touches[e].clientY}:{clientX:t.clientX,clientY:t.clientY},V=t=>!t||!Y(t)||t.touches.length>0;class K{constructor(t,{onTouchDragStart:s},i={}){e(this,"_touchDragTimeOut"),e(this,"_onTouchDragStart"),e(this,"_payload",null),e(this,"_delay",500),e(this,"_firstTouch",null),e(this,"_lastTouch",null),e(this,"_epsilon",10),this._payload=t,this._onTouchDragStart=s,this._delay="number"==typeof i.delay?i.delay:500,this._epsilon="number"==typeof i.epsilon?i.epsilon:10}onStart(t){V(t)&&(this._touchDragTimeOut||(this._firstTouch=J(t,Y(t)?t.touches.length-1:0),this._touchDragTimeOut=setTimeout((()=>{this._clearTimeout(),this._lastTouch||(this._lastTouch=J(t)),this._checkXDistance(t)()}),this._delay)))}onEnd(){this._resetTouches()}onMove(t){V(t)&&(this._lastTouch=J(t))}_clearTimeout(){this._touchDragTimeOut&&(clearTimeout(this._touchDragTimeOut),this._touchDragTimeOut=null)}_resetTouches(){this._clearTimeout(),this._lastTouch=null,this._firstTouch=null,this._payload=null}_checkXDistance(t){return()=>{if(!this._firstTouch||!this._lastTouch)return;let e=!1;e=Math.abs(this._firstTouch.clientX-this._lastTouch.clientX)<this._epsilon,e&&(this._onTouchDragStart(this._payload,t),this._resetTouches())}}}const Q=(t,e,s=0,i=0)=>{const n=e.x+e.width+s,r=e.x-s,a=e.y+e.height+i,o=e.y-i,{x:l,y:h}=t;return l>=r&&l<=n&&h>=o&&h<=a},Z=(t,e,s,i=0,n=0)=>{if(s&&(s.hiddenIn||s.visibleIn))return s.visibleIn?Q({x:t,y:e},s.visibleIn,i,n):!!s.hiddenIn&&!Q({x:t,y:e},s.hiddenIn,-i,-n)};class tt{constructor(t=null){e(this,"_dragGhostAnimationFrameId",null),e(this,"_dragGhostRemoveAnimationFrameId",null),e(this,"_dragGhostElement",null),this._dragGhostElement=t}updateDragGhost(t,e,s){var i;this._dragGhostRemoveAnimationFrameId&&(cancelAnimationFrame(this._dragGhostRemoveAnimationFrameId),this._dragGhostRemoveAnimationFrameId=null),(null==(i=s.ghost)||!i.external)&&s.ghost&&(this._dragGhostAnimationFrameId||(this._dragGhostAnimationFrameId=requestAnimationFrame((()=>{(()=>{if(!document.getElementById(x)){const t=document.createElement("style");t.type="text/css",t.id=x,t.innerHTML=`\n ${F}\n ${U}\n `,document.head.appendChild(t)}})();const i={x:t,y:e};!s.ghost&&this._dragGhostElement&&(s.ghost={}),s.ghost&&!s.ghost.element&&this._dragGhostElement&&(s.ghost.element=this._dragGhostElement),(({x:t,y:e},s)=>{var i,n,r,a,o,l;let h=document.getElementById(I);if(!h){if(h=document.createElement("div"),null!=(i=s.ghost)&&i.element)h.appendChild(s.ghost.element);else{const t=document.createElement("img");t.src=(null==(n=s.ghost)?void 0:n.url)||X,t.width=(null==(r=s.ghost)?void 0:r.width)||112,t.height=(null==(a=s.ghost)?void 0:a.height)||112,h.appendChild(t)}h.id=I,h.style.position="fixed",h.style.top="0",h.style.left="0",h.style.willChange="transform",h.style.transform="translate3d(0, 0, 0)",h.style.zIndex="9999",h.style.opacity="0.5",Z(t,e,s.ghost||{},null==(o=s.settings)?void 0:o.dragInOverlapX,null==(l=s.settings)?void 0:l.dragInOverlapY)||(h.style.display="none"),h.style.pointerEvents="none",document.body.appendChild(h)}})(i,s),(({x:t,y:e},s)=>{var i,n,r,a;const o=document.getElementById(I);if(!o)return;let l=null==(i=s.ghost)?void 0:i.width,h=null==(n=s.ghost)?void 0:n.height;typeof l>"u"&&(l=o.getBoundingClientRect().width||112),typeof h>"u"&&(h=o.getBoundingClientRect().height||112);const c=t-l/2,u=e-h/2;o.style.transform=`translate3d(${c}px, ${u}px, 0)`,s.ghost&&(Z(t,e,s.ghost,null==(r=s.settings)?void 0:r.dragInOverlapX,null==(a=s.settings)?void 0:a.dragInOverlapY)?o.style.animation!=R&&(o.style.animation=R):o.style.animation!=N&&(o.style.animation=N))})(i,s),this._dragGhostAnimationFrameId=null}))))}removeDragGhost(){this._dragGhostAnimationFrameId&&(cancelAnimationFrame(this._dragGhostAnimationFrameId),this._dragGhostAnimationFrameId=null),this._dragGhostRemoveAnimationFrameId||(this._dragGhostRemoveAnimationFrameId=requestAnimationFrame((()=>{const t=document.getElementById(I);t&&document.body.removeChild(t),this._dragGhostRemoveAnimationFrameId=null})))}}const et=Object.freeze(Object.defineProperty({__proto__:null,DragInFromWebsiteStrategy:class{constructor(t,s,i){e(this,"_options",{}),e(this,"_instance"),e(this,"_mainDomElement"),e(this,"_currentDrag",{}),e(this,"_currentTouch",null),e(this,"_firefoxDragPosition",{x:0,y:0}),e(this,"_onBeforeUpdateDrag",(()=>({}))),e(this,"isDragging",!1),e(this,"_firefoxFallback",(t=>{if(!this._currentDrag.event)return;t.preventDefault();const e=t||window.event;this._firefoxDragPosition.x=e.pageX||0,this._firefoxDragPosition.y=e.pageY||0})),this._instance=t,this._mainDomElement=s,this._options=i||{},this._firefoxFallback=this._firefoxFallback.bind(this),document.addEventListener("dragover",this._firefoxFallback)}beforeUpdateGhost(t){this._onBeforeUpdateDrag=t}dragStart(t,e,s="rml_id"){const i=this._mainDomElement.parentNode;if("relative"!==j(i).position)return;this._mainDomElement.style.pointerEvents="none";let n=i.querySelector("."+M);n||(n=document.createElement("div"),n.classList.add(M),i.appendChild(n)),n.classList.remove(L),e.target.getAttribute("draggable");const r=i.querySelector("."+C);this._currentDrag.event=e;const a=e.target,o=a.cloneNode(!0),l=a.getBoundingClientRect();o.style.width=`${l.width}px`,o.style.height=`${l.height}px`,this._currentDrag.ghost=new tt(o),this._currentDrag.offset||(this._currentDrag.offset={x:0,y:0});const{clientX:h,clientY:c}=z(e,this._firefoxDragPosition);this._currentDrag.offset.x=h-l.left,this._currentDrag.offset.y=c-l.top,e instanceof DragEvent&&e.dataTransfer&&e.dataTransfer.setDragImage&&e.dataTransfer.setDragImage(r,0,0);const{x:u,y:g}=W(i,this._currentDrag.event||e,this._firefoxDragPosition),d=Math.max(1,u),m=Math.max(1,g);this.isDragging=!0,this._instance.dragInObject(t,d,m,s)}dragUpdate(t){var e;const s=this._mainDomElement.parentNode,{x:i,y:n}=W(s,t,this._firefoxDragPosition);if(0===i&&0===n)return;const r=Math.max(1,i),a=Math.max(1,n);if(1===r&&1===a)return;let o=r,l=a;if(Y(t)){const t=(null==(e=this._options.settings)?void 0:e.fingerSize)||0;o=Math.max(2,r+t),l=Math.max(2,a-t)}const{x:h,y:c,options:u}=this._onBeforeUpdateDrag(o,l,{}),g=u||{settings:{},ghost:{}};g.ghost||(g.ghost={}),g.ghost.visibleIn&&g.ghost.hiddenIn||(g.ghost.hiddenIn=this._mainDomElement.getBoundingClientRect());const d="number"==typeof h?h:o,m="number"==typeof c?c:l;if(this._currentDrag.ghost){const{clientX:e,clientY:s}=z(t,this._firefoxDragPosition);this._currentDrag.ghost.updateDragGhost(e,s,g)}this._instance.updateDrag(d,m,{})}dragEnd(){this._mainDomElement.style.pointerEvents="all";const t=this._mainDomElement.parentNode;this.isDragging=!1,this._instance.dragInObjectEnd(),this._currentDrag.ghost&&(this._currentDrag.ghost.removeDragGhost(),this._currentDrag.ghost=null),this._currentDrag={},this._firefoxDragPosition={x:0,y:0};const e=t.querySelector("."+M);e&&e.classList.add(L)}touchStart(t,e,s="rml_id"){var i,n,r,a;e.preventDefault();const o={};"number"==typeof(null==(n=null==(i=this._options)?void 0:i.settings)?void 0:n.touchDragDelay)&&(o.delay=this._options.settings.touchDragDelay),null!=(a=null==(r=this._options)?void 0:r.settings)&&a.touchDragEpsilon&&(o.epsilon=this._options.settings.touchDragEpsilon),this._currentTouch=new K(void 0,{onTouchDragStart:(e,i)=>{this.dragStart(t,i,s)}},o),this._currentTouch.onStart(e)}touchMove(t){this._currentTouch&&this._currentTouch.onMove(t),this._currentDrag.event&&this.dragUpdate(t)}touchEnd(){this._currentTouch&&this._currentTouch.onEnd(),this._currentTouch=null,this.dragEnd()}dispose(){document.removeEventListener("dragover",this._firefoxFallback)}releaseInput(t){}}},Symbol.toStringTag,{value:"Module"})),st=t=>{t.preventDefault(),t.stopPropagation()};class it{constructor({onCustomDragStart:t},s={}){e(this,"_startX",0),e(this,"_startY",0),e(this,"_lastX",0),e(this,"_lastY",0),e(this,"_epsilon"),e(this,"_isWaiting",!1),e(this,"_onCustomDragStart"),this._epsilon="number"==typeof s.epsilon?s.epsilon:15,this._onCustomDragStart=t}onMove(t){this._lastX=t.clientX,this._lastY=t.clientY,this._isWaiting&&((t,e)=>{const s=this._lastX-t,i=this._lastY-e;return Math.sqrt(s*s+i*i)})(this._startX,this._startY)>this._epsilon&&(this._onCustomDragStart(t),this._isWaiting=!1)}onStart(t){this._startX=t.clientX,this._startY=t.clientY,this.onMove(t),this._isWaiting=!0}onEnd(){this._reset()}_reset(){this._startX=0,this._startY=0,this._lastX=0,this._lastY=0,this._isWaiting=!1}}const nt="data-rml-old-draggable",rt=(t,e)=>{const s=Y(t),i={delay:s?500:100,epsilon:s?10:15};if(!e)return i;if(!(s||t instanceof MouseEvent))return i;const{delayKey:n,epsilonKey:r}=s?{delayKey:"touchDragDelay",epsilonKey:"touchDragEpsilon"}:{delayKey:"customDragDelay",epsilonKey:"customDragEpsilon"};return"number"==typeof e[n]&&(i.delay=e.touchDragDelay),"number"==typeof e[r]&&(i.epsilon=e.touchDragEpsilon),i},at=Object.freeze(Object.defineProperty({__proto__:null,DragInFromCustomViewStrategy:class{constructor(t,s,i){e(this,"_options",{}),e(this,"_instance"),e(this,"_viewName"),e(this,"_currentCustomDrag",null),e(this,"_currentBb",null),e(this,"_startTarget",null),e(this,"_onBeforeUpdateDrag",(()=>({}))),e(this,"isDragging",!1),this._instance=t,this._options=s||{},this._viewName=i}beforeUpdateGhost(t){this._onBeforeUpdateDrag=t}async _dragStart(t,e,s="rml_id"){this._startTarget&&(this._startTarget.style.pointerEvents="none",this._startTarget.style.userSelect="none",this._startTarget.setAttribute(nt,this._startTarget.draggable.toString()),this._startTarget.draggable=!1,this._startTarget.removeEventListener("dragstart",st),this._startTarget.addEventListener("dragstart",st)),this._currentBb=await this._instance.getBoundingClientRect((()=>`[data-rml-custom-view="${this._viewName}"]`)());const{clientX:i,clientY:n}=z(e),r=this._currentBb.x+i,a=this._currentBb.y+n;this.isDragging=!0,this._instance.dragInObject(t,r,a,s)}_dragUpdate(t){if(document.body.focus(),this._currentCustomDrag&&this._currentCustomDrag.onMove(t),!this._currentBb||!this.isDragging)return;const{clientX:e,clientY:s}=z(t),{url:i,width:n,height:r}=(t=>{let e="",s=112,i=112;if(!t)return{url:X,width:s,height:i};const n=t;if(n instanceof HTMLElement){const t=n.getBoundingClientRect(),r=n.getAttribute("data-rml-ghost-url"),a=n.getAttribute("data-rml-ghost-width"),o=n.getAttribute("data-rml-ghost-height");r?e=r:!r&&n instanceof HTMLImageElement&&n.src&&(e=n.src),e?(s=t.width,i=t.height):e=X,s=a?parseInt(a,10):s,i=o?parseInt(o,10):i}return{url:e||X,width:s,height:i}})(this._startTarget),a=this._currentBb.x+e,o=this._currentBb.y+s,l=this._options||{},h={ghost:{visibleIn:{x:this._currentBb.x-(l.dragInOverlapX||0),y:this._currentBb.y+(l.dragInOverlapY||0),width:this._currentBb.width+(l.dragInOverlapX||0),height:this._currentBb.height+(l.dragInOverlapY||0)},url:i,width:n,height:r},mode:"custom-view"},{x:c,y:u,options:g}=this._onBeforeUpdateDrag(a,o,h),d="number"==typeof c?c:a,m="number"==typeof u?u:o,_=g||h;this._instance.updateDrag(d,m,_)}_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,e,s){this._instance.disableEvents(),this._startTarget=e.target,this._currentCustomDrag=Y(e)?new K(void 0,{onTouchDragStart:(e,i)=>{this._dragStart(t,i,s)}},rt(e,this._options)):new it({onCustomDragStart:e=>this._dragStart(t,e,s)},rt(e,this._options)),this._currentCustomDrag.onStart(e)}dragEnd(){this._dragEnd()}dragUpdate(t){this._dragUpdate(t)}touchStart(t,e,s="rml_id"){this.dragStart(t,e,s)}touchMove(t){this.dragUpdate(t)}touchEnd(){this.dragEnd()}dispose(){}_resetStartTarget(){this._startTarget&&(this._startTarget.style.pointerEvents="",this._startTarget.style.userSelect="",this._startTarget.draggable="true"===this._startTarget.getAttribute(nt),this._startTarget.removeAttribute(nt),this._startTarget.removeEventListener("dragstart",st))}releaseInput(t){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._resetStartTarget()}}},Symbol.toStringTag,{value:"Module"}));return class extends g{constructor(t,i,n,r,a){if(super(),e(this,"_waitForIframe"),e(this,"_container"),e(this,"_configuratorSettings"),e(this,"_initData",{}),e(this,"_iframe"),!t||"string"!=typeof t.id)throw new Error("Please provide a correct configuratorId, you get the correct ID from your Roomle Contact Person");if(T.has(i))throw new Error("There is already an instance on this DOM element");if(!document.getElementById(f)){const t=n.zIndex||9999999,e=document.createElement("style");e.type="text/css",e.id=f;const s="transition:all ease-in-out 450ms;",i=["-webkit-","-o-"].reduce(((t,e)=>t+(e+s)),"")+s,r=_();e.innerHTML=`\n .${v}{${y}:${r};}\n .${w}{position:fixed;top:0;left:0;z-index:${t};opacity:0}\n .rml-transition{${i}}\n .${b}{width:100%;height:100%;opacity:1}\n .${D}{height:calc(var(${y},1vh)*100)}\n .${E}{overflow:hidden}\n `,document.head.appendChild(e)}this._executeMessage=this._executeMessage.bind(this);const o=new s("website",window,null,this._executeMessage);this.setMessageHandler(o),this._onResize=this._onResize.bind(this),u()&&window.addEventListener("resize",this._onResize),this._container=i,this._initData=n,this._configuratorSettings=t;const l=this._createIframe();this._onUseFullPage=this._onUseFullPage.bind(this),this._onBackToWebsite=this._onBackToWebsite.bind(this),this._waitForIframe=a,this._container.appendChild(l),this._iframe=l,this.setupPlugins(r,this._iframe),T.set(i,!0)}static createPlanner(t,e,s,i=[]){return this._create(t,e,s,i)}static async connect(t,e=[]){const i=new g;i.viewName=t;const{resolve:n,promise:r}=d(),{resolve:a,promise:o}=d(),l=new s("custom-view-"+t,window,window.parent,(({message:t,args:e})=>{switch(t){case"registerCustomViewDone":n();break;case"returnMethods":i.handleSetup(e[0]),a();break;default:if(i.isSetupDone)return i.executeMessage({message:t,args:e})}}));i.setMessageHandler(l);const h=[t];return l.sendMessage("registerCustomView",h),await r,l.sendMessage("getMethods",h),await o,i.setupPlugins(e,document.body,"custom-view"),await Promise.allSettled(i.pluginsLoaded),i}static createConfigurator(t,e,s,i=[]){return this._create(t,e,s,i)}static create(t,e,s,i){return this._create(t,e,s,i)}static createViewer(t,e,s,i=[]){return this._create(t,e,s,i)}static async _create(t,e,s,a){return new Promise((async(o,u)=>{try{const u=r((()=>{const t={...h};t.locale||(t.locale=((t=null)=>{const e=window.navigator;if(t)return t.substr(0,2);if(Array.isArray(e.languages)&&e.languages.length>0)return e.languages[0].substr(0,2);for(let t=0,s=n.length;t<s;t++){const s=e[n[t]];if(s)return s.substr(0,2)}return"en"})()),"(idle)"===t.id&&delete t.id;const e=(()=>{const t=(()=>{try{return window.self!==window.top}catch{return!0}})();let e=window.location.href;if(t){if(!document.referrer)return null;e=document.referrer}const{hostname:s}=new URL(e);return s})();return e&&(t=>!!(i.includes(t)||t.endsWith("roomle.com")||t.endsWith("gitlab.io")||t.endsWith("gitlab.com")))(e)&&(t.configuratorId="demoConfigurator"),t.customApiUrl=l.VITE_RAPI_URL,t.emails=!1,t})(),(t=>(c(t),null!=t&&t.customApiUrl&&(t.customApiUrl=decodeURIComponent(t.customApiUrl)),t.shareUrl&&(t.deeplink=t.shareUrl.replace("<CONF_ID>","#CONFIGURATIONID#")),t))(s));(t=>{t.featureFlags||(t.featureFlags={}),"boolean"!=typeof t.featureFlags.realPartList&&(t.featureFlags.realPartList=!0),"boolean"!=typeof t.featureFlags.globalCallbacks&&(t.featureFlags.globalCallbacks=!0),"boolean"!=typeof t.featureFlags.mocAr&&(t.featureFlags.mocAr=!1)})(u);const g=await(async(t,e)=>{if("string"!=typeof t)throw new Error('Configurator ID is not a string type: "'+typeof t+'"');const s=e.customApiUrl?e.customApiUrl:"https://api.roomle.com/v2",i=e.overrideTenant||9,n=s+"/configurators/"+t,r="roomle_portal_v2",a="03-"+window.btoa((new Date).toISOString()+";anonymous;"+r),o=new Request(n,{method:"GET",headers:new Headers({apiKey:r,currentTenant:i,locale:"en",language:"en",device:1,token:a,platform:"web"}),mode:"cors",cache:"default"}),l=await fetch(o),{configurator:h}=await l.json();return h})(t,u);s=((t,e)=>{e.configuratorId=t.id;const s=t.settings||{};return!e.overrideTenant&&t.tenant&&(e.overrideTenant=t.tenant),((t,e)=>{const s=JSON.parse(JSON.stringify(t));return r(s,e)})(s,e)})(g,u);const d=new this(g,e,s,a,o);return await Promise.allSettled(d.pluginsLoaded),d}catch(t){return u(t)}}))}teardown(){this._container&&T.delete(this._container);const t=this._container.querySelector("iframe");t&&this._container.removeChild(t),window.removeEventListener("resize",this._onResize)}_createIframe(){var t;const e=document.createElement("iframe");let s=(null==(t=this._configuratorSettings)?void 0:t.url)||"https://www.roomle.com/t/cp/";return this._initData.useLocalRoomle&&(s=location.href.replace("embedding.html","")),location.href.includes("roomle.gitlab.io")&&(s=location.href.replace("embedding.html","index.html")),this._initData.overrideServerUrl&&(s=this._initData.overrideServerUrl),e.src=s,e.classList.add(v),e.classList.add(b),e}_onResize(){p(this._iframe)}_onUseFullPage(){this._iframe.classList.add(w),document.documentElement.classList.add(E),window.document.body.classList.add(E),u()&&(p(this._iframe),this._iframe.classList.add(D))}_onBackToWebsite(){this._iframe.classList.remove(w),this._iframe.classList.remove(D),document.documentElement.classList.remove(E),window.document.body.classList.remove(E)}_executeMessage({message:t,args:e},s){var i;if(s.source&&s.source===(null==(i=this._iframe)?void 0:i.contentWindow))return"requestBoot"===t?this._messageHandler?(this._messageHandler.setOutgoingMessageBus(s.source),Promise.resolve({result:this._initData})):Promise.resolve({error:"MessageHandler not set"}):"setup"===t?(this.handleSetup(e[0]),m(this.ui.callbacks,"onUseFullPage",this._onUseFullPage),m(this.ui.callbacks,"onBackToWebsite",this._onBackToWebsite),this._waitForIframe(this),setTimeout((()=>{this._messageHandler&&this._messageHandler.sendMessage("websiteReady")}),0),Promise.resolve({result:null})):this.executeMessage({message:t,args:e})}}},"object"==typeof exports&&typeof module<"u"?module.exports=e():"function"==typeof define&&define.amd?define(e):((t=typeof globalThis<"u"?globalThis:t||self)["roomle-embedding-lib"]=t["roomle-embedding-lib"]||{},t["roomle-embedding-lib"].umd=t["roomle-embedding-lib"].umd||{},t["roomle-embedding-lib"].umd.min=t["roomle-embedding-lib"].umd.min||{},t["roomle-embedding-lib"].umd.min.js=e());
|
|
1
|
+
var t,e;t=this,e=function(){"use strict";var t=Object.defineProperty,e=(e,s,i)=>((e,s,i)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[s]=i)(e,"symbol"!=typeof s?s+"":s,i);class s{constructor(t,s,i,n){e(this,"_side"),e(this,"_incomingMessageBus",null),e(this,"_outgoingMessageBus",null),e(this,"_execMessage",null),this._side=t,this._incomingMessageBus=s,this._outgoingMessageBus=i,this._execMessage=n,this._incomingMessageBus&&this._incomingMessageBus.addEventListener("message",this._handleMessage.bind(this))}setOutgoingMessageBus(t){this._outgoingMessageBus=t}setMessageExecution(t){this._execMessage=t}sendMessage(t,e=[]){return new Promise(((s,i)=>{if(this._incomingMessageBus===this._outgoingMessageBus)return s(void 0);const n=new MessageChannel;n.port1.onmessage=t=>{if(!t||!t.data)return n.port1.close(),n.port2.close(),i(new Error(this._side+" received message but response can not be interpreted"));let e;try{e=JSON.parse(t.data)}catch(t){return n.port1.close(),n.port2.close(),this._prepareError(t),i(t)}e.error?i(e.error):void 0!==e.result?s(e.result):s(void 0),n.port1.close(),n.port2.close()};let r="";try{r=JSON.stringify({message:t,args:e})}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(r,"*",[n.port2])}))}_handleMessage(t){const e=t.ports&&Array.isArray(t.ports)&&t.ports.length>0?t.ports[0]:null;if(t.data&&e)try{const s=JSON.parse(t.data);if(!this._execMessage)return e.postMessage(JSON.stringify({error:this._side+" is not ready to handle messages"}));Array.isArray(s.args)||(s.args=[s.args]);const i=this._execMessage(s,t);if(void 0===i)return;i.then(((t={})=>{let s,i;"object"==typeof t&&null!==t&&(s=t.error,i=t.result),s?e.postMessage(JSON.stringify({error:s})):void 0!==i?e.postMessage(JSON.stringify({result:i})):e.postMessage(JSON.stringify({result:t}))}),(t=>{e.postMessage(JSON.stringify({error:this._prepareError(t)}))}))}catch(t){e.postMessage(JSON.stringify({error:this._prepareError(t)}))}}_prepareError(t){return"string"==typeof t?this._side+": "+t:(t.message=this._side+": "+t.message,t.message)}}const i=["127.0.0.1","localhost","0.0.0.0"],n=["language","browserLanguage","userLanguage","systemLanguage"],r=(t,e)=>{for(const s in e)try{e[s].constructor===Object?t[s]=r(t[s],e[s]):t[s]=e[s]}catch{t[s]=e[s]}return t};var a,o=((a=o||{}).BOTTOM_BAR="bottom_bar",a.PARTLIST_BOUNDS="partlist_bounds",a.INTERACTION_NOTES="interaction_notes",a.PARAMETER_GROUPS="parameter_groups",a),l={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};const h={mobileLandscape:!0,floorMaterialRootTag:"materials_root",buttons:{renderimage:!0,requestproduct:!0,requestplan:!0,load_product:!0,partlist_print:!0},elements:{[o.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},c=t=>{if(!t)return;const e=Object.keys(t);for(const s of e){const e=t[s];if(!Array.isArray(e)&&"object"==typeof e&&null!==e&&c(e),Array.isArray(e))for(const t of e)c(t);("true"===e||"false"===e)&&(t[s]="true"===e)}},u=()=>/(android)/i.test(navigator.userAgent);class g{constructor(){e(this,"_messageHandler",null),e(this,"isSetupDone",!1),e(this,"viewName","main"),e(this,"plugins",{}),e(this,"pluginsLoaded",[]),e(this,"ui",{callbacks:null}),e(this,"extended",{callbacks:null}),e(this,"configurator",{callbacks:null}),e(this,"analytics",{callbacks:{}}),e(this,"rapi",{callbacks:{}}),e(this,"global",{callbacks:{}})}setMessageHandler(t){this._messageHandler=t}handleSetup(t){const{methods:e,callbacks:s}=t;e.forEach((t=>{const e=t.split("."),s=e[0],i=e[1];this[s]||(this[s]={}),this[s][i]=function(){if(this._messageHandler)return this._messageHandler.sendMessage(t,[...arguments])}.bind(this)})),s.forEach((t=>{const e=t.split("."),s=e[0],i=e[1],n=e[2];this[s]||(this[s]={}),this[s][i]||(this[s][i]={}),this[s][i][n]=()=>{}})),this.isSetupDone=!0}executeMessage({message:t,args:e}){const s=t.split("."),i=s[0],n=s[1],r=3===s.length?s[2]:null;if(r&&this[i][n][r]){const t=this[i][n][r](...e);return t instanceof Promise?t.then((t=>({result:t}))):void 0!==t?Promise.resolve({result:t}):Promise.resolve({result:null})}return Promise.reject('Message "'+t+'" is unkown')}setupPlugins(t,e,s="website"){for(const i of t)"string"==typeof i&&"dragIn"===i?this.pluginsLoaded.push(new Promise(((t,i)=>{try{Promise.resolve().then((()=>k)).then((({DragIn:n})=>{const r=new n(this.ui,e,s,this.viewName);r.init().then((()=>{this.plugins.dragIn=r,t()}),i)}))}catch(t){i(t)}}))):i.name&&i.loader&&this.pluginsLoaded.push(new Promise(((t,n)=>{try{i.loader().then((r=>{const a=new r(this.ui,e,s,this.viewName);a.init().then((()=>{this.plugins[i.name]=a,t()}),n)}))}catch(t){n(t)}})))}}const d=()=>{let t,e;return{promise:new Promise(((s,i)=>{t=s,e=i})),resolve:t,reject:e}},m=(t,e,s)=>{let i=null;Object.defineProperty(t,e,{get:()=>i||s,set(t){i=null!=t&&t.mute?t.value:t}})},_=()=>.01*window.innerHeight+"px",p=t=>{t&&setTimeout((()=>t.style.setProperty(y,_())),0)},f="rml-styles",y="--rml-full-height",v="rml-container",b="rml-fill",w="rml-pos",D="rml-android-height",E="rml-overflow-hidden",T=new Map;class S{constructor(t,s,i,n){e(this,"_mainDomElement"),e(this,"_instance"),e(this,"_mode","website"),e(this,"_viewName","main"),this._instance=t,this._mainDomElement=s,this._mode=i,this._viewName=n}async init(){return Promise.resolve()}}const x="rml-drag-in-styles",I="rml-drag-in-drag-element",M="rml-drag-in-overlay",C="rml-drag-in-drag-ghost",A="rml-drag-in-fade-in",O="rml-drag-in-fade-out",L="rml-display-none",B="250ms",P="forwards",F=`@keyframes ${A} {from{opacity: 0;}to {opacity: 0.5;}}`,U=`@keyframes ${O} {from{opacity: 0.5;}to {opacity: 0;}}`,R=`${A} ${B} ${P}`,N=`${O} ${B} ${P}`,X="https://res.cloudinary.com/roomle/image/upload/v1729679975/fallback_afpyqr.jpg",k=Object.freeze(Object.defineProperty({__proto__:null,DragIn:class extends S{constructor(t,s,i,n){super(t,s,i,n),e(this,"options",{}),e(this,"_customDragSignal",new AbortController),this._mainDomElement=s,this._injectStyles(),this._initializeDragGhost()}_injectStyles(){if(!document.getElementById(x)){const t=document.createElement("style");t.type="text/css",t.id=x,t.innerHTML=`\n .${L}{display:none}\n .${M}{position:absolute;top:0;left:0;width:100%;height:100%;z-index:999;}\n .${C}{position:absolute;top:0;left:0;width:1px;height:1px;z-index:999;pointer-events:none;background-color:transparent;}\n ${F}\n ${U}\n `,document.head.appendChild(t)}}_initializeDragGhost(){const t=this._mainDomElement.parentNode;let e=t.querySelector("."+C);e||(e=document.createElement("div"),e.classList.add(C),e.innerText=" ",t.appendChild(e))}async init(){if(await super.init(),"website"===this._mode)try{const{DragInFromWebsiteStrategy:t}=await Promise.resolve().then((()=>et));this._strategy=new t(this._instance,this._mainDomElement,{settings:this.options,mode:"website"})}catch(t){throw t}else{if("custom-view"!==this._mode)throw new Error("Unsupported mode");try{const{DragInFromCustomViewStrategy:t}=await Promise.resolve().then((()=>at));this._strategy=new t(this._instance,this.options,this._viewName)}catch(t){throw t}}}get isDragging(){return this._strategy.isDragging}dragStart(t,e,s="rml_id"){this._strategy.dragStart(t,e,s)}dragUpdate(t){this._strategy.dragUpdate(t)}dragEnd(){this._strategy.dragEnd()}touchStart(t,e,s="rml_id"){this._strategy.touchStart(t,e,s)}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:s,beforeUpdateGhost:i}){i&&this._strategy.beforeUpdateGhost(i);const n=this._customDragSignal.signal,r=e=>{"true"===e.target.getAttribute("data-rml-draggable")&&t(e)},a=t=>{this._strategy.releaseInput(t),this._strategy.isDragging&&e(t)},o=t=>{s(t)};document.querySelectorAll('[data-rml-draggable="true"]').forEach((t=>{t.draggable=!1})),document.addEventListener("mousedown",r,{signal:n}),document.addEventListener("mouseup",a,{signal:n}),document.addEventListener("mousemove",o,{signal:n}),document.addEventListener("mouseleave",a,{signal:n}),document.addEventListener("touchstart",r,{signal:n}),document.addEventListener("touchend",a,{signal:n}),document.addEventListener("touchmove",o,{signal:n})}unregisterCustomDrag(){this._customDragSignal.abort(),this._customDragSignal=new AbortController}releaseInput(t){this._strategy.releaseInput(t)}}},Symbol.toStringTag,{value:"Module"}));class G{constructor(t=16){e(this,"_computedStyleCache",new Map),e(this,"_maxLifetime",16),e(this,"_cacheCleanInterval",null),this._maxLifetime=t}get(t){const e=this._computedStyleCache.get(t),s=Date.now();if(e&&s-e.updated<this._maxLifetime)return e.style;const i=getComputedStyle(t);return this._computedStyleCache.set(t,{style:i,updated:s}),this._cacheCleanInterval||(this._cacheCleanInterval=setInterval((()=>this._cleanUpCache),Math.max(1e3*this._maxLifetime,5e3))),i}_cleanUpCache(){const t=Date.now();for(const[e,{updated:s}]of this._computedStyleCache.entries())t-s>=this._maxLifetime&&this._computedStyleCache.delete(e);0===this._computedStyleCache.size&&this._cacheCleanInterval&&(clearInterval(this._cacheCleanInterval),this._cacheCleanInterval=null)}}const Y=t=>window.TouchEvent&&t instanceof window.TouchEvent;let $;const j=t=>($||($=new G),$.get(t)),H=(t,e,s)=>{const i=parseFloat(t),n=window.devicePixelRatio||1;if("px"===e)return i;if("%"===e)return i/100*(s===document.documentElement?window.innerWidth:s.offsetWidth);if("rem"===e)return i*parseFloat(j(document.documentElement).fontSize);if("em"===e)return i*parseFloat(j(s).fontSize);if("vh"===e||"vw"===e||"vmin"===e||"vmax"===e)return i/100*{vh:window.innerHeight,vw:window.innerWidth,vmin:Math.min(window.innerWidth,window.innerHeight),vmax:Math.max(window.innerWidth,window.innerHeight)}[e];const r={cm:37.7952755906,mm:3.77952755906,in:96};return e in r?i*r[e]*n:0},z=(t,e,s={x:0,y:0})=>{const i=t.getBoundingClientRect(),n=j(t).transform;let r=0,a=0;if("none"!==n){const e=/translate\(\s*([-+]?\d*\.?\d+|\d+)(px|%)?,?\s*([-+]?\d*\.?\d+|\d+)?(px|%)?\s*\)/,s=n.match(e);s&&(r=H(s[1],s[2],t),a=H(s[3],s[4],t))}const{clientX:o,clientY:l}=W(e,s);return{x:o-i.left-r+t.scrollLeft,y:l-i.top-a+t.scrollTop}},W=(t,e=null)=>{const{clientX:s,clientY:i}=Y(t)?q(t):t;return{clientX:s>0?s:e?e.x:s,clientY:i>0?i:e?e.y:i}},q=t=>{if(t.touches.length){let{clientX:e,clientY:s}=t.touches[0];if(t.touches.length>1){const i=t.touches[1];e=(e+i.clientX)/2,s=(s+i.clientY)/2}return{clientX:e,clientY:s}}const e=t.changedTouches[0];return{clientX:e.clientX,clientY:e.clientY}},J=(t,e=0)=>Y(t)?{clientX:t.touches[e].clientX,clientY:t.touches[e].clientY}:{clientX:t.clientX,clientY:t.clientY},V=t=>!t||!Y(t)||t.touches.length>0;class K{constructor(t,{onTouchDragStart:s},i={}){e(this,"_touchDragTimeOut"),e(this,"_onTouchDragStart"),e(this,"_payload",null),e(this,"_delay",500),e(this,"_firstTouch",null),e(this,"_lastTouch",null),e(this,"_epsilon",10),this._payload=t,this._onTouchDragStart=s,this._delay="number"==typeof i.delay?i.delay:500,this._epsilon="number"==typeof i.epsilon?i.epsilon:10}onStart(t){V(t)&&(this._touchDragTimeOut||(this._firstTouch=J(t,Y(t)?t.touches.length-1:0),this._touchDragTimeOut=setTimeout((()=>{this._clearTimeout(),this._lastTouch||(this._lastTouch=J(t)),this._checkXDistance(t)()}),this._delay)))}onEnd(){this._resetTouches()}onMove(t){V(t)&&(this._lastTouch=J(t))}_clearTimeout(){this._touchDragTimeOut&&(clearTimeout(this._touchDragTimeOut),this._touchDragTimeOut=null)}_resetTouches(){this._clearTimeout(),this._lastTouch=null,this._firstTouch=null,this._payload=null}_checkXDistance(t){return()=>{if(!this._firstTouch||!this._lastTouch)return;let e=!1;e=Math.abs(this._firstTouch.clientX-this._lastTouch.clientX)<this._epsilon,e&&(this._onTouchDragStart(this._payload,t),this._resetTouches())}}}const Q=(t,e,s=0,i=0)=>{const n=e.x+e.width+s,r=e.x-s,a=e.y+e.height+i,o=e.y-i,{x:l,y:h}=t;return l>=r&&l<=n&&h>=o&&h<=a},Z=(t,e,s,i=0,n=0)=>{if(s&&(s.hiddenIn||s.visibleIn))return s.visibleIn?Q({x:t,y:e},s.visibleIn,i,n):!!s.hiddenIn&&!Q({x:t,y:e},s.hiddenIn,-i,-n)};class tt{constructor(t=null){e(this,"_dragGhostAnimationFrameId",null),e(this,"_dragGhostRemoveAnimationFrameId",null),e(this,"_dragGhostElement",null),this._dragGhostElement=t}updateDragGhost(t,e,s){var i;this._dragGhostRemoveAnimationFrameId&&(cancelAnimationFrame(this._dragGhostRemoveAnimationFrameId),this._dragGhostRemoveAnimationFrameId=null),(null==(i=s.ghost)||!i.external)&&s.ghost&&(this._dragGhostAnimationFrameId||(this._dragGhostAnimationFrameId=requestAnimationFrame((()=>{(()=>{if(!document.getElementById(x)){const t=document.createElement("style");t.type="text/css",t.id=x,t.innerHTML=`\n ${F}\n ${U}\n `,document.head.appendChild(t)}})();const i={x:t,y:e};!s.ghost&&this._dragGhostElement&&(s.ghost={}),s.ghost&&!s.ghost.element&&this._dragGhostElement&&(s.ghost.element=this._dragGhostElement),(({x:t,y:e},s)=>{var i,n,r,a,o,l;let h=document.getElementById(I);if(!h){if(h=document.createElement("div"),null!=(i=s.ghost)&&i.element)h.appendChild(s.ghost.element);else{const t=document.createElement("img");t.src=(null==(n=s.ghost)?void 0:n.url)||X,t.width=(null==(r=s.ghost)?void 0:r.width)||112,t.height=(null==(a=s.ghost)?void 0:a.height)||112,h.appendChild(t)}h.id=I,h.style.position="fixed",h.style.top="0",h.style.left="0",h.style.willChange="transform",h.style.transform="translate3d(0, 0, 0)",h.style.zIndex="9999",h.style.opacity="0.5",Z(t,e,s.ghost||{},null==(o=s.settings)?void 0:o.dragInOverlapX,null==(l=s.settings)?void 0:l.dragInOverlapY)||(h.style.display="none"),h.style.pointerEvents="none",document.body.appendChild(h)}})(i,s),(({x:t,y:e},s)=>{var i,n,r,a;const o=document.getElementById(I);if(!o)return;let l=null==(i=s.ghost)?void 0:i.width,h=null==(n=s.ghost)?void 0:n.height;typeof l>"u"&&(l=o.getBoundingClientRect().width||112),typeof h>"u"&&(h=o.getBoundingClientRect().height||112);const c=t-l/2,u=e-h/2;o.style.transform=`translate3d(${c}px, ${u}px, 0)`,s.ghost&&(Z(t,e,s.ghost,null==(r=s.settings)?void 0:r.dragInOverlapX,null==(a=s.settings)?void 0:a.dragInOverlapY)?o.style.animation!=R&&(o.style.animation=R):o.style.animation!=N&&(o.style.animation=N))})(i,s),this._dragGhostAnimationFrameId=null}))))}removeDragGhost(){this._dragGhostAnimationFrameId&&(cancelAnimationFrame(this._dragGhostAnimationFrameId),this._dragGhostAnimationFrameId=null),this._dragGhostRemoveAnimationFrameId||(this._dragGhostRemoveAnimationFrameId=requestAnimationFrame((()=>{const t=document.getElementById(I);t&&document.body.removeChild(t),this._dragGhostRemoveAnimationFrameId=null})))}}const et=Object.freeze(Object.defineProperty({__proto__:null,DragInFromWebsiteStrategy:class{constructor(t,s,i){e(this,"_options",{}),e(this,"_instance"),e(this,"_mainDomElement"),e(this,"_currentDrag",{}),e(this,"_currentTouch",null),e(this,"_firefoxDragPosition",{x:0,y:0}),e(this,"_onBeforeUpdateDrag",(()=>({}))),e(this,"isDragging",!1),e(this,"_firefoxFallback",(t=>{if(!this._currentDrag.event)return;t.preventDefault();const e=t||window.event;this._firefoxDragPosition.x=e.pageX||0,this._firefoxDragPosition.y=e.pageY||0})),this._instance=t,this._mainDomElement=s,this._options=i||{},this._firefoxFallback=this._firefoxFallback.bind(this),document.addEventListener("dragover",this._firefoxFallback)}beforeUpdateGhost(t){this._onBeforeUpdateDrag=t}dragStart(t,e,s="rml_id"){const i=this._mainDomElement.parentNode;if("relative"!==j(i).position)return;this._mainDomElement.style.pointerEvents="none";let n=i.querySelector("."+M);n||(n=document.createElement("div"),n.classList.add(M),i.appendChild(n)),n.classList.remove(L),e.target.getAttribute("draggable");const r=i.querySelector("."+C);this._currentDrag.event=e;const a=e.target,o=a.cloneNode(!0),l=a.getBoundingClientRect();o.style.width=`${l.width}px`,o.style.height=`${l.height}px`,this._currentDrag.ghost=new tt(o),this._currentDrag.offset||(this._currentDrag.offset={x:0,y:0});const{clientX:h,clientY:c}=W(e,this._firefoxDragPosition);this._currentDrag.offset.x=h-l.left,this._currentDrag.offset.y=c-l.top,e instanceof DragEvent&&e.dataTransfer&&e.dataTransfer.setDragImage&&e.dataTransfer.setDragImage(r,0,0);const{x:u,y:g}=z(i,this._currentDrag.event||e,this._firefoxDragPosition),d=Math.max(1,u),m=Math.max(1,g);this.isDragging=!0,this._instance.dragInObject(t,d,m,s)}dragUpdate(t){var e;const s=this._mainDomElement.parentNode,{x:i,y:n}=z(s,t,this._firefoxDragPosition);if(0===i&&0===n)return;const r=Math.max(1,i),a=Math.max(1,n);if(1===r&&1===a)return;let o=r,l=a;if(Y(t)){const t=(null==(e=this._options.settings)?void 0:e.fingerSize)||0;o=Math.max(2,r+t),l=Math.max(2,a-t)}const{x:h,y:c,options:u}=this._onBeforeUpdateDrag(o,l,{}),g=u||{settings:{},ghost:{}};g.ghost||(g.ghost={}),g.ghost.visibleIn&&g.ghost.hiddenIn||(g.ghost.hiddenIn=this._mainDomElement.getBoundingClientRect());const d="number"==typeof h?h:o,m="number"==typeof c?c:l;if(this._currentDrag.ghost){const{clientX:e,clientY:s}=W(t,this._firefoxDragPosition);this._currentDrag.ghost.updateDragGhost(e,s,g)}this._instance.updateDrag(d,m,{})}dragEnd(){this._mainDomElement.style.pointerEvents="all";const t=this._mainDomElement.parentNode;this.isDragging=!1,this._instance.dragInObjectEnd(),this._currentDrag.ghost&&(this._currentDrag.ghost.removeDragGhost(),this._currentDrag.ghost=null),this._currentDrag={},this._firefoxDragPosition={x:0,y:0};const e=t.querySelector("."+M);e&&e.classList.add(L)}touchStart(t,e,s="rml_id"){var i,n,r,a;e.preventDefault();const o={};"number"==typeof(null==(n=null==(i=this._options)?void 0:i.settings)?void 0:n.touchDragDelay)&&(o.delay=this._options.settings.touchDragDelay),null!=(a=null==(r=this._options)?void 0:r.settings)&&a.touchDragEpsilon&&(o.epsilon=this._options.settings.touchDragEpsilon),this._currentTouch=new K(void 0,{onTouchDragStart:(e,i)=>{this.dragStart(t,i,s)}},o),this._currentTouch.onStart(e)}touchMove(t){this._currentTouch&&this._currentTouch.onMove(t),this._currentDrag.event&&this.dragUpdate(t)}touchEnd(){this._currentTouch&&this._currentTouch.onEnd(),this._currentTouch=null,this.dragEnd()}dispose(){document.removeEventListener("dragover",this._firefoxFallback)}releaseInput(t){}}},Symbol.toStringTag,{value:"Module"})),st=t=>{t.preventDefault(),t.stopPropagation()};class it{constructor({onCustomDragStart:t},s={}){e(this,"_startX",0),e(this,"_startY",0),e(this,"_lastX",0),e(this,"_lastY",0),e(this,"_epsilon"),e(this,"_isWaiting",!1),e(this,"_onCustomDragStart"),this._epsilon="number"==typeof s.epsilon?s.epsilon:15,this._onCustomDragStart=t}onMove(t){this._lastX=t.clientX,this._lastY=t.clientY,this._isWaiting&&((t,e)=>{const s=this._lastX-t,i=this._lastY-e;return Math.sqrt(s*s+i*i)})(this._startX,this._startY)>this._epsilon&&(this._onCustomDragStart(t),this._isWaiting=!1)}onStart(t){this._startX=t.clientX,this._startY=t.clientY,this.onMove(t),this._isWaiting=!0}onEnd(){this._reset()}_reset(){this._startX=0,this._startY=0,this._lastX=0,this._lastY=0,this._isWaiting=!1}}const nt="data-rml-old-draggable",rt=(t,e)=>{const s=Y(t),i={delay:s?500:100,epsilon:s?10:15};if(!e)return i;if(!(s||t instanceof MouseEvent))return i;const{delayKey:n,epsilonKey:r}=s?{delayKey:"touchDragDelay",epsilonKey:"touchDragEpsilon"}:{delayKey:"customDragDelay",epsilonKey:"customDragEpsilon"};return"number"==typeof e[n]&&(i.delay=e.touchDragDelay),"number"==typeof e[r]&&(i.epsilon=e.touchDragEpsilon),i},at=Object.freeze(Object.defineProperty({__proto__:null,DragInFromCustomViewStrategy:class{constructor(t,s,i){e(this,"_options",{}),e(this,"_instance"),e(this,"_viewName"),e(this,"_currentCustomDrag",null),e(this,"_currentBb",null),e(this,"_startTarget",null),e(this,"_onBeforeUpdateDrag",(()=>({}))),e(this,"isDragging",!1),this._instance=t,this._options=s||{},this._viewName=i}beforeUpdateGhost(t){this._onBeforeUpdateDrag=t}async _dragStart(t,e,s="rml_id"){this._startTarget&&(this._startTarget.style.pointerEvents="none",this._startTarget.style.userSelect="none",this._startTarget.setAttribute(nt,this._startTarget.draggable.toString()),this._startTarget.draggable=!1,this._startTarget.removeEventListener("dragstart",st),this._startTarget.addEventListener("dragstart",st)),this._currentBb=await this._instance.getBoundingClientRect((()=>`[data-rml-custom-view="${this._viewName}"]`)());const{clientX:i,clientY:n}=W(e),r=this._currentBb.x+i,a=this._currentBb.y+n;this.isDragging=!0,this._instance.dragInObject(t,r,a,s)}_dragUpdate(t){if(document.body.focus(),this._currentCustomDrag&&this._currentCustomDrag.onMove(t),!this._currentBb||!this.isDragging)return;const{clientX:e,clientY:s}=W(t),{url:i,width:n,height:r}=(t=>{let e="",s=112,i=112;if(!t)return{url:X,width:s,height:i};const n=t;if(n instanceof HTMLElement){const t=n.getBoundingClientRect(),r=n.getAttribute("data-rml-ghost-url"),a=n.getAttribute("data-rml-ghost-width"),o=n.getAttribute("data-rml-ghost-height");r?e=r:!r&&n instanceof HTMLImageElement&&n.src&&(e=n.src),e?(s=t.width,i=t.height):e=X,s=a?parseInt(a,10):s,i=o?parseInt(o,10):i}return{url:e||X,width:s,height:i}})(this._startTarget),a=this._currentBb.x+e,o=this._currentBb.y+s,l=this._options||{},h={ghost:{visibleIn:{x:this._currentBb.x-(l.dragInOverlapX||0),y:this._currentBb.y+(l.dragInOverlapY||0),width:this._currentBb.width+(l.dragInOverlapX||0),height:this._currentBb.height+(l.dragInOverlapY||0)},url:i,width:n,height:r},mode:"custom-view"},{x:c,y:u,options:g}=this._onBeforeUpdateDrag(a,o,h),d="number"==typeof c?c:a,m="number"==typeof u?u:o,_=g||h;this._instance.updateDrag(d,m,_)}_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,e,s){this._instance.disableEvents(),this._startTarget=e.target,this._currentCustomDrag=Y(e)?new K(void 0,{onTouchDragStart:(e,i)=>{this._dragStart(t,i,s)}},rt(e,this._options)):new it({onCustomDragStart:e=>this._dragStart(t,e,s)},rt(e,this._options)),this._currentCustomDrag.onStart(e)}dragEnd(){this._dragEnd()}dragUpdate(t){this._dragUpdate(t)}touchStart(t,e,s="rml_id"){this.dragStart(t,e,s)}touchMove(t){this.dragUpdate(t)}touchEnd(){this.dragEnd()}dispose(){}_resetStartTarget(){this._startTarget&&(this._startTarget.style.pointerEvents="",this._startTarget.style.userSelect="",this._startTarget.draggable="true"===this._startTarget.getAttribute(nt),this._startTarget.removeAttribute(nt),this._startTarget.removeEventListener("dragstart",st))}releaseInput(t){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._resetStartTarget()}}},Symbol.toStringTag,{value:"Module"}));return class extends g{constructor(t,i,n,r,a){if(super(),e(this,"_waitForIframe"),e(this,"_container"),e(this,"_configuratorSettings"),e(this,"_initData",{}),e(this,"_iframe"),!t||"string"!=typeof t.id)throw new Error("Please provide a correct configuratorId, you get the correct ID from your Roomle Contact Person");if(T.has(i))throw new Error("There is already an instance on this DOM element");if(!document.getElementById(f)){const t=n.zIndex||9999999,e=document.createElement("style");e.type="text/css",e.id=f;const s="transition:all ease-in-out 450ms;",i=["-webkit-","-o-"].reduce(((t,e)=>t+(e+s)),"")+s,r=_();e.innerHTML=`\n .${v}{${y}:${r};}\n .${w}{position:fixed;top:0;left:0;z-index:${t};opacity:0}\n .rml-transition{${i}}\n .${b}{width:100%;height:100%;opacity:1}\n .${D}{height:calc(var(${y},1vh)*100)}\n .${E}{overflow:hidden}\n `,document.head.appendChild(e)}this._executeMessage=this._executeMessage.bind(this);const o=new s("website",window,null,this._executeMessage);this.setMessageHandler(o),this._onResize=this._onResize.bind(this),u()&&window.addEventListener("resize",this._onResize),this._container=i,this._initData=n,this._configuratorSettings=t;const l=this._createIframe();this._onUseFullPage=this._onUseFullPage.bind(this),this._onBackToWebsite=this._onBackToWebsite.bind(this),this._waitForIframe=a,this._container.appendChild(l),this._iframe=l,this.setupPlugins(r,this._iframe),T.set(i,!0)}static createPlanner(t,e,s,i=[]){return this._create(t,e,s,i)}static async connect(t,e=[]){const i=new g;i.viewName=t;const{resolve:n,promise:r}=d(),{resolve:a,promise:o}=d(),l=new s("custom-view-"+t,window,window.parent,(({message:t,args:e})=>{switch(t){case"registerCustomViewDone":n();break;case"returnMethods":i.handleSetup(e[0]),a();break;default:if(i.isSetupDone)return i.executeMessage({message:t,args:e})}}));i.setMessageHandler(l);const h=[t];return l.sendMessage("registerCustomView",h),await r,l.sendMessage("getMethods",h),await o,i.setupPlugins(e,document.body,"custom-view"),await Promise.allSettled(i.pluginsLoaded),i}static createConfigurator(t,e,s,i=[]){return this._create(t,e,s,i)}static create(t,e,s,i){return this._create(t,e,s,i)}static createViewer(t,e,s,i=[]){return this._create(t,e,s,i)}static async _create(t,e,s,a){return new Promise((async(o,u)=>{try{const u=r((()=>{const t=(t=>JSON.parse(JSON.stringify(t)))(h);t.locale||(t.locale=((t=null)=>{const e=window.navigator;if(t)return t.substr(0,2);if(Array.isArray(e.languages)&&e.languages.length>0)return e.languages[0].substr(0,2);for(let t=0,s=n.length;t<s;t++){const s=e[n[t]];if(s)return s.substr(0,2)}return"en"})()),"(idle)"===t.id&&delete t.id;const e=(()=>{const t=(()=>{try{return window.self!==window.top}catch{return!0}})();let e=window.location.href;if(t){if(!document.referrer)return null;e=document.referrer}const{hostname:s}=new URL(e);return s})();return e&&(t=>!!(i.includes(t)||t.endsWith("roomle.com")||t.endsWith("gitlab.io")||t.endsWith("gitlab.com")))(e)&&(t.configuratorId="demoConfigurator"),t.customApiUrl=l.VITE_RAPI_URL,t.emails=!1,t})(),(t=>(c(t),null!=t&&t.customApiUrl&&(t.customApiUrl=decodeURIComponent(t.customApiUrl)),t.shareUrl&&(t.deeplink=t.shareUrl.replace("<CONF_ID>","#CONFIGURATIONID#")),t))(s));(t=>{t.featureFlags||(t.featureFlags={}),"boolean"!=typeof t.featureFlags.realPartList&&(t.featureFlags.realPartList=!0),"boolean"!=typeof t.featureFlags.globalCallbacks&&(t.featureFlags.globalCallbacks=!0),"boolean"!=typeof t.featureFlags.mocAr&&(t.featureFlags.mocAr=!1)})(u);const g=await(async(t,e)=>{if("string"!=typeof t)throw new Error('Configurator ID is not a string type: "'+typeof t+'"');const s=e.customApiUrl?e.customApiUrl:"https://api.roomle.com/v2",i=e.overrideTenant||9,n=s+"/configurators/"+t,r="roomle_portal_v2",a="03-"+window.btoa((new Date).toISOString()+";anonymous;"+r),o=new Request(n,{method:"GET",headers:new Headers({apiKey:r,currentTenant:i,locale:"en",language:"en",device:1,token:a,platform:"web"}),mode:"cors",cache:"default"}),l=await fetch(o),{configurator:h}=await l.json();return h})(t,u);s=((t,e)=>{e.configuratorId=t.id;const s=t.settings||{};return!e.overrideTenant&&t.tenant&&(e.overrideTenant=t.tenant),((t,e)=>{const s=JSON.parse(JSON.stringify(t));return r(s,e)})(s,e)})(g,u);const d=new this(g,e,s,a,o);return await Promise.allSettled(d.pluginsLoaded),d}catch(t){return u(t)}}))}teardown(){this._container&&T.delete(this._container);const t=this._container.querySelector("iframe");t&&this._container.removeChild(t),window.removeEventListener("resize",this._onResize)}_createIframe(){var t;const e=document.createElement("iframe");let s=(null==(t=this._configuratorSettings)?void 0:t.url)||"https://www.roomle.com/t/cp/";return this._initData.useLocalRoomle&&(s=location.href.replace("embedding.html","")),location.href.includes("roomle.gitlab.io")&&(s=location.href.replace("embedding.html","index.html")),this._initData.overrideServerUrl&&(s=this._initData.overrideServerUrl),e.src=s,e.classList.add(v),e.classList.add(b),e}_onResize(){p(this._iframe)}_onUseFullPage(){this._iframe.classList.add(w),document.documentElement.classList.add(E),window.document.body.classList.add(E),u()&&(p(this._iframe),this._iframe.classList.add(D))}_onBackToWebsite(){this._iframe.classList.remove(w),this._iframe.classList.remove(D),document.documentElement.classList.remove(E),window.document.body.classList.remove(E)}_executeMessage({message:t,args:e},s){var i;if(s.source&&s.source===(null==(i=this._iframe)?void 0:i.contentWindow))return"requestBoot"===t?this._messageHandler?(this._messageHandler.setOutgoingMessageBus(s.source),Promise.resolve({result:this._initData})):Promise.resolve({error:"MessageHandler not set"}):"setup"===t?(this.handleSetup(e[0]),m(this.ui.callbacks,"onUseFullPage",this._onUseFullPage),m(this.ui.callbacks,"onBackToWebsite",this._onBackToWebsite),this._waitForIframe(this),setTimeout((()=>{this._messageHandler&&this._messageHandler.sendMessage("websiteReady")}),0),Promise.resolve({result:null})):this.executeMessage({message:t,args:e})}}},"object"==typeof exports&&typeof module<"u"?module.exports=e():"function"==typeof define&&define.amd?define(e):((t=typeof globalThis<"u"?globalThis:t||self)["roomle-embedding-lib"]=t["roomle-embedding-lib"]||{},t["roomle-embedding-lib"].umd=t["roomle-embedding-lib"].umd||{},t["roomle-embedding-lib"].umd.min=t["roomle-embedding-lib"].umd.min||{},t["roomle-embedding-lib"].umd.min.js=e());
|
package/src/common/components/collection-view/-utils/collection-view-dynamic-components.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ declare const dynamicComponents: {
|
|
|
46
46
|
GridView: import('vue').DefineComponent<{
|
|
47
47
|
isExpanded?: boolean;
|
|
48
48
|
onExpand: (event: MouseEvent) => void;
|
|
49
|
-
onSelect: (possibleChild: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void
|
|
49
|
+
onSelect: ((...args: any[]) => any)[] | ((possibleChild: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void>);
|
|
50
50
|
onDragStart?: (gridViewElement: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => Promise<void>;
|
|
51
51
|
onDragEnd?: (gridViewElement: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => void;
|
|
52
52
|
elements: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>[];
|
|
@@ -60,7 +60,7 @@ declare const dynamicComponents: {
|
|
|
60
60
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
61
61
|
isExpanded?: boolean;
|
|
62
62
|
onExpand: (event: MouseEvent) => void;
|
|
63
|
-
onSelect: (possibleChild: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void
|
|
63
|
+
onSelect: ((...args: any[]) => any)[] | ((possibleChild: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void>);
|
|
64
64
|
onDragStart?: (gridViewElement: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => Promise<void>;
|
|
65
65
|
onDragEnd?: (gridViewElement: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => void;
|
|
66
66
|
elements: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>[];
|
|
@@ -131,7 +131,7 @@ declare const dynamicComponents: {
|
|
|
131
131
|
GridView: import('vue').DefineComponent<{
|
|
132
132
|
isExpanded?: boolean;
|
|
133
133
|
onExpand: (event: MouseEvent) => void;
|
|
134
|
-
onSelect: (possibleChild: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void
|
|
134
|
+
onSelect: ((...args: any[]) => any)[] | ((possibleChild: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void>);
|
|
135
135
|
onDragStart?: (gridViewElement: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => Promise<void>;
|
|
136
136
|
onDragEnd?: (gridViewElement: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => void;
|
|
137
137
|
elements: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>[];
|
|
@@ -145,7 +145,7 @@ declare const dynamicComponents: {
|
|
|
145
145
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
146
146
|
isExpanded?: boolean;
|
|
147
147
|
onExpand: (event: MouseEvent) => void;
|
|
148
|
-
onSelect: (possibleChild: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void
|
|
148
|
+
onSelect: ((...args: any[]) => any)[] | ((possibleChild: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void>);
|
|
149
149
|
onDragStart?: (gridViewElement: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => Promise<void>;
|
|
150
150
|
onDragEnd?: (gridViewElement: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => void;
|
|
151
151
|
elements: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>[];
|
|
@@ -243,7 +243,7 @@ declare const dynamicComponents: {
|
|
|
243
243
|
GridView: import('vue').DefineComponent<{
|
|
244
244
|
isExpanded?: boolean;
|
|
245
245
|
onExpand: (event: MouseEvent) => void;
|
|
246
|
-
onSelect: (possibleChild: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void
|
|
246
|
+
onSelect: ((...args: any[]) => any)[] | ((possibleChild: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void>);
|
|
247
247
|
onDragStart?: (gridViewElement: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => Promise<void>;
|
|
248
248
|
onDragEnd?: (gridViewElement: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => void;
|
|
249
249
|
elements: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>[];
|
|
@@ -257,7 +257,7 @@ declare const dynamicComponents: {
|
|
|
257
257
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
258
258
|
isExpanded?: boolean;
|
|
259
259
|
onExpand: (event: MouseEvent) => void;
|
|
260
|
-
onSelect: (possibleChild: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void
|
|
260
|
+
onSelect: ((...args: any[]) => any)[] | ((possibleChild: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void>);
|
|
261
261
|
onDragStart?: (gridViewElement: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => Promise<void>;
|
|
262
262
|
onDragEnd?: (gridViewElement: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => void;
|
|
263
263
|
elements: import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElement<import('../../../../configurator/components/grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>[];
|
|
@@ -5,6 +5,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
5
5
|
onEsc?: (_payload: KeyboardEvent) => void;
|
|
6
6
|
isString?: boolean;
|
|
7
7
|
centerText?: boolean;
|
|
8
|
+
pauseInputListeners?: boolean;
|
|
8
9
|
}, {
|
|
9
10
|
setValueString: (valueString: string, _unitChanged?: boolean) => void;
|
|
10
11
|
getValueString: () => string;
|
|
@@ -12,7 +13,109 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
12
13
|
focusInput: () => void;
|
|
13
14
|
blurInput: () => void;
|
|
14
15
|
selectInput: () => void;
|
|
15
|
-
getBaseInputRef: () => import('vue').Ref<
|
|
16
|
+
getBaseInputRef: () => import('vue').Ref<import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
17
|
+
pauseInputListeners: {
|
|
18
|
+
type: import('vue').PropType<boolean>;
|
|
19
|
+
default: boolean;
|
|
20
|
+
};
|
|
21
|
+
modelValue: {
|
|
22
|
+
type: import('vue').PropType<string>;
|
|
23
|
+
};
|
|
24
|
+
}>> & Readonly<{
|
|
25
|
+
"onUpdate:modelValue"?: (value: string) => any;
|
|
26
|
+
}>, {
|
|
27
|
+
inputElement: import('vue').Ref<HTMLInputElement, HTMLInputElement>;
|
|
28
|
+
focus: typeof focus;
|
|
29
|
+
blur: typeof blur;
|
|
30
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
31
|
+
"update:modelValue": (value: string) => any;
|
|
32
|
+
}, import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{
|
|
33
|
+
pauseInputListeners: {
|
|
34
|
+
type: import('vue').PropType<boolean>;
|
|
35
|
+
default: boolean;
|
|
36
|
+
};
|
|
37
|
+
modelValue: {
|
|
38
|
+
type: import('vue').PropType<string>;
|
|
39
|
+
};
|
|
40
|
+
}>> & Readonly<{
|
|
41
|
+
"onUpdate:modelValue"?: (value: string) => any;
|
|
42
|
+
}>, {
|
|
43
|
+
pauseInputListeners: boolean;
|
|
44
|
+
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
45
|
+
P: {};
|
|
46
|
+
B: {};
|
|
47
|
+
D: {};
|
|
48
|
+
C: {};
|
|
49
|
+
M: {};
|
|
50
|
+
Defaults: {};
|
|
51
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
52
|
+
pauseInputListeners: {
|
|
53
|
+
type: import('vue').PropType<boolean>;
|
|
54
|
+
default: boolean;
|
|
55
|
+
};
|
|
56
|
+
modelValue: {
|
|
57
|
+
type: import('vue').PropType<string>;
|
|
58
|
+
};
|
|
59
|
+
}>> & Readonly<{
|
|
60
|
+
"onUpdate:modelValue"?: (value: string) => any;
|
|
61
|
+
}>, {
|
|
62
|
+
inputElement: import('vue').Ref<HTMLInputElement, HTMLInputElement>;
|
|
63
|
+
focus: typeof focus;
|
|
64
|
+
blur: typeof blur;
|
|
65
|
+
}, {}, {}, {}, {
|
|
66
|
+
pauseInputListeners: boolean;
|
|
67
|
+
}>, import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
68
|
+
pauseInputListeners: {
|
|
69
|
+
type: import('vue').PropType<boolean>;
|
|
70
|
+
default: boolean;
|
|
71
|
+
};
|
|
72
|
+
modelValue: {
|
|
73
|
+
type: import('vue').PropType<string>;
|
|
74
|
+
};
|
|
75
|
+
}>> & Readonly<{
|
|
76
|
+
"onUpdate:modelValue"?: (value: string) => any;
|
|
77
|
+
}>, {
|
|
78
|
+
inputElement: import('vue').Ref<HTMLInputElement, HTMLInputElement>;
|
|
79
|
+
focus: typeof focus;
|
|
80
|
+
blur: typeof blur;
|
|
81
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
82
|
+
"update:modelValue": (value: string) => any;
|
|
83
|
+
}, import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & Readonly<import('vue').ExtractPropTypes<{
|
|
84
|
+
pauseInputListeners: {
|
|
85
|
+
type: import('vue').PropType<boolean>;
|
|
86
|
+
default: boolean;
|
|
87
|
+
};
|
|
88
|
+
modelValue: {
|
|
89
|
+
type: import('vue').PropType<string>;
|
|
90
|
+
};
|
|
91
|
+
}>> & Readonly<{
|
|
92
|
+
"onUpdate:modelValue"?: (value: string) => any;
|
|
93
|
+
}>, {
|
|
94
|
+
pauseInputListeners: boolean;
|
|
95
|
+
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
96
|
+
P: {};
|
|
97
|
+
B: {};
|
|
98
|
+
D: {};
|
|
99
|
+
C: {};
|
|
100
|
+
M: {};
|
|
101
|
+
Defaults: {};
|
|
102
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
103
|
+
pauseInputListeners: {
|
|
104
|
+
type: import('vue').PropType<boolean>;
|
|
105
|
+
default: boolean;
|
|
106
|
+
};
|
|
107
|
+
modelValue: {
|
|
108
|
+
type: import('vue').PropType<string>;
|
|
109
|
+
};
|
|
110
|
+
}>> & Readonly<{
|
|
111
|
+
"onUpdate:modelValue"?: (value: string) => any;
|
|
112
|
+
}>, {
|
|
113
|
+
inputElement: import('vue').Ref<HTMLInputElement, HTMLInputElement>;
|
|
114
|
+
focus: typeof focus;
|
|
115
|
+
blur: typeof blur;
|
|
116
|
+
}, {}, {}, {}, {
|
|
117
|
+
pauseInputListeners: boolean;
|
|
118
|
+
}>>;
|
|
16
119
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
17
120
|
valueLabel: string;
|
|
18
121
|
onTextInputChange: (_payload: Event, _valueString: string) => void;
|
|
@@ -20,5 +123,8 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
20
123
|
onEsc?: (_payload: KeyboardEvent) => void;
|
|
21
124
|
isString?: boolean;
|
|
22
125
|
centerText?: boolean;
|
|
23
|
-
|
|
126
|
+
pauseInputListeners?: boolean;
|
|
127
|
+
}> & Readonly<{}>, {
|
|
128
|
+
pauseInputListeners: boolean;
|
|
129
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
24
130
|
export default _default;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
2
|
+
pauseInputListeners?: boolean;
|
|
3
|
+
modelValue?: string;
|
|
4
|
+
}>, {
|
|
5
|
+
pauseInputListeners: boolean;
|
|
6
|
+
}>>, {
|
|
7
|
+
inputElement: import('vue').Ref<HTMLInputElement, HTMLInputElement>;
|
|
8
|
+
focus: typeof focus;
|
|
9
|
+
blur: typeof blur;
|
|
10
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
|
+
"update:modelValue": (value: string) => any;
|
|
12
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
|
|
13
|
+
pauseInputListeners?: boolean;
|
|
14
|
+
modelValue?: string;
|
|
15
|
+
}>, {
|
|
16
|
+
pauseInputListeners: boolean;
|
|
17
|
+
}>>> & Readonly<{
|
|
18
|
+
"onUpdate:modelValue"?: (value: string) => any;
|
|
19
|
+
}>, {
|
|
20
|
+
pauseInputListeners: boolean;
|
|
21
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_WithDefaults<P, D> = {
|
|
24
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
25
|
+
default: D[K];
|
|
26
|
+
}> : P[K];
|
|
27
|
+
};
|
|
28
|
+
type __VLS_Prettify<T> = {
|
|
29
|
+
[K in keyof T]: T[K];
|
|
30
|
+
} & {};
|
|
31
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
32
|
+
type __VLS_TypePropsToOption<T> = {
|
|
33
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
34
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
35
|
+
} : {
|
|
36
|
+
type: import('vue').PropType<T[K]>;
|
|
37
|
+
required: true;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
declare const _default: import('vue').DefineComponent<{
|
|
2
2
|
text: string;
|
|
3
3
|
size: number;
|
|
4
|
-
color
|
|
4
|
+
color?: string;
|
|
5
5
|
bgColor: string;
|
|
6
6
|
errorLevel: "M" | "L" | "Q" | "H";
|
|
7
7
|
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
8
8
|
text: string;
|
|
9
9
|
size: number;
|
|
10
|
-
color
|
|
10
|
+
color?: string;
|
|
11
11
|
bgColor: string;
|
|
12
12
|
errorLevel: "M" | "L" | "Q" | "H";
|
|
13
13
|
}> & Readonly<{}>, {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { KernelWall } from '@roomle/web-sdk/lib/definitions/typings/planner';
|
|
2
|
+
|
|
3
|
+
export declare function useWallDimensionsCache(): {
|
|
4
|
+
getCachedWallDimensions: (wallId: number) => any;
|
|
5
|
+
cacheWallDimensions: (wallId: number, height: number, thickness: number) => void;
|
|
6
|
+
initializeWallDimensionsCache: (walls: KernelWall[]) => void;
|
|
7
|
+
restoreOrSetDefaultDimensions: (wall: KernelWall, interactionHandler: any) => void;
|
|
8
|
+
};
|
|
@@ -16,7 +16,7 @@ export interface CommonUiState {
|
|
|
16
16
|
isInIframe: boolean;
|
|
17
17
|
isViewOnly: Nullable<boolean>;
|
|
18
18
|
lastRequestedId: Nullable<RapiId>;
|
|
19
|
-
currentViewMode: Enumify<typeof VIEW_MODES
|
|
19
|
+
currentViewMode: Nullable<Enumify<typeof VIEW_MODES>>;
|
|
20
20
|
isShadowOnStage: boolean;
|
|
21
21
|
measurementUnit: Enumify<typeof MEASUREMENT_UNIT>;
|
|
22
22
|
measurementSystem: Enumify<typeof MEASUREMENT_SYSTEM>;
|
|
@@ -30,7 +30,6 @@ export interface KernelBoundsFormatted {
|
|
|
30
30
|
height: string;
|
|
31
31
|
depth: string;
|
|
32
32
|
}
|
|
33
|
-
export declare const deepCopy: <T>(o: T) => T;
|
|
34
33
|
export declare const toBoolean: (value: boolean | undefined, defaultValue?: boolean) => boolean;
|
|
35
34
|
export declare const scriptInfo: (...args: any[]) => void;
|
|
36
35
|
export declare const getGlbAssetUrl: (obj: RapiItem | RapiConfiguration | RapiPlanSnapshotGetData | ExternalConfiguration) => Nullable<string>;
|
|
@@ -80,3 +79,4 @@ export declare const sortObjects: (a: any, b: any) => number;
|
|
|
80
79
|
export declare const parseFloatString: (value: string, fractionDigits?: number) => number;
|
|
81
80
|
export declare const noop: () => void;
|
|
82
81
|
export declare const playwrightRemoveQueryParamsFromJSON: (json: any, queryParams: string[], onlyHttpUrls?: boolean) => any;
|
|
82
|
+
export declare const findMostCommonOrLargestNumber: (numbers: number[]) => number | undefined;
|
|
@@ -6,7 +6,7 @@ import { UiPossibleChild } from '@roomle/web-sdk/lib/definitions/typings/kernel'
|
|
|
6
6
|
declare const _default: import('vue').DefineComponent<{
|
|
7
7
|
isExpanded?: boolean;
|
|
8
8
|
onExpand: (event: MouseEvent) => void;
|
|
9
|
-
onSelect: (possibleChild: GridViewElement<import('./-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void
|
|
9
|
+
onSelect: ((...args: any[]) => any)[] | ((possibleChild: GridViewElement<import('./-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void>);
|
|
10
10
|
onDragStart?: (gridViewElement: GridViewElement<import('./-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => Promise<void>;
|
|
11
11
|
onDragEnd?: (gridViewElement: GridViewElement<import('./-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => void;
|
|
12
12
|
elements: GridViewElement<import('./-utils/GridViewHelper').GridViewElementPossiblePayload>[];
|
|
@@ -20,7 +20,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
20
20
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
21
21
|
isExpanded?: boolean;
|
|
22
22
|
onExpand: (event: MouseEvent) => void;
|
|
23
|
-
onSelect: (possibleChild: GridViewElement<import('./-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void
|
|
23
|
+
onSelect: ((...args: any[]) => any)[] | ((possibleChild: GridViewElement<import('./-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void>);
|
|
24
24
|
onDragStart?: (gridViewElement: GridViewElement<import('./-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => Promise<void>;
|
|
25
25
|
onDragEnd?: (gridViewElement: GridViewElement<import('./-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => void;
|
|
26
26
|
elements: GridViewElement<import('./-utils/GridViewHelper').GridViewElementPossiblePayload>[];
|
|
@@ -51,7 +51,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
51
51
|
GridView: import('vue').DefineComponent<{
|
|
52
52
|
isExpanded?: boolean;
|
|
53
53
|
onExpand: (event: MouseEvent) => void;
|
|
54
|
-
onSelect: (possibleChild: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void
|
|
54
|
+
onSelect: ((...args: any[]) => any)[] | ((possibleChild: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void>);
|
|
55
55
|
onDragStart?: (gridViewElement: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => Promise<void>;
|
|
56
56
|
onDragEnd?: (gridViewElement: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => void;
|
|
57
57
|
elements: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>[];
|
|
@@ -65,7 +65,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
65
65
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
66
66
|
isExpanded?: boolean;
|
|
67
67
|
onExpand: (event: MouseEvent) => void;
|
|
68
|
-
onSelect: (possibleChild: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void
|
|
68
|
+
onSelect: ((...args: any[]) => any)[] | ((possibleChild: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void>);
|
|
69
69
|
onDragStart?: (gridViewElement: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => Promise<void>;
|
|
70
70
|
onDragEnd?: (gridViewElement: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => void;
|
|
71
71
|
elements: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>[];
|
|
@@ -53,7 +53,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
53
53
|
GridView: import('vue').DefineComponent<{
|
|
54
54
|
isExpanded?: boolean;
|
|
55
55
|
onExpand: (event: MouseEvent) => void;
|
|
56
|
-
onSelect: (possibleChild: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void
|
|
56
|
+
onSelect: ((...args: any[]) => any)[] | ((possibleChild: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void>);
|
|
57
57
|
onDragStart?: (gridViewElement: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => Promise<void>;
|
|
58
58
|
onDragEnd?: (gridViewElement: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => void;
|
|
59
59
|
elements: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>[];
|
|
@@ -67,7 +67,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
67
67
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
68
68
|
isExpanded?: boolean;
|
|
69
69
|
onExpand: (event: MouseEvent) => void;
|
|
70
|
-
onSelect: (possibleChild: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void
|
|
70
|
+
onSelect: ((...args: any[]) => any)[] | ((possibleChild: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void>);
|
|
71
71
|
onDragStart?: (gridViewElement: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => Promise<void>;
|
|
72
72
|
onDragEnd?: (gridViewElement: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => void;
|
|
73
73
|
elements: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>[];
|
|
@@ -48,7 +48,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
48
48
|
GridView: import('vue').DefineComponent<{
|
|
49
49
|
isExpanded?: boolean;
|
|
50
50
|
onExpand: (event: MouseEvent) => void;
|
|
51
|
-
onSelect: (possibleChild: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void
|
|
51
|
+
onSelect: ((...args: any[]) => any)[] | ((possibleChild: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void>);
|
|
52
52
|
onDragStart?: (gridViewElement: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => Promise<void>;
|
|
53
53
|
onDragEnd?: (gridViewElement: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => void;
|
|
54
54
|
elements: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>[];
|
|
@@ -62,7 +62,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
62
62
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
63
63
|
isExpanded?: boolean;
|
|
64
64
|
onExpand: (event: MouseEvent) => void;
|
|
65
|
-
onSelect: (possibleChild: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void
|
|
65
|
+
onSelect: ((...args: any[]) => any)[] | ((possibleChild: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>) => Promise<void>);
|
|
66
66
|
onDragStart?: (gridViewElement: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => Promise<void>;
|
|
67
67
|
onDragEnd?: (gridViewElement: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>, event: DragEvent | TouchEvent) => void;
|
|
68
68
|
elements: GridViewElement<import('../../grid-view/-utils/GridViewHelper').GridViewElementPossiblePayload>[];
|
|
@@ -15,6 +15,7 @@ import { ExposedOverlays } from '../../common/components/utils/-utils/overlays';
|
|
|
15
15
|
import { default as EventEmitter } from '../../common/business-logic/event-emitter';
|
|
16
16
|
import { DragInOptions } from '../../../packages/embedding-lib/src/plugins/types';
|
|
17
17
|
import { CustomViewSettingsForIframe, PossibleCustomViews } from './types';
|
|
18
|
+
import { default as RapiAccess } from '@roomle/web-sdk/lib/definitions/common-core/src/rapi-access';
|
|
18
19
|
|
|
19
20
|
export declare class ExposedApi {
|
|
20
21
|
private _sdk;
|
|
@@ -30,8 +31,9 @@ export declare class ExposedApi {
|
|
|
30
31
|
private _globalCallback;
|
|
31
32
|
private _messageHandlers;
|
|
32
33
|
private _eventEmitter;
|
|
34
|
+
private _rapi;
|
|
33
35
|
private _dragHandler;
|
|
34
|
-
constructor(sdkConnector: SdkConnector, mainMessageHandlers: Nullable<MessageHandler>, sdk: RoomleConfiguratorType | RoomleGLBViewer | RoomlePlannerWithExtObjs, exposedCallbacks: ExposedCallbacks, store: Store<StoreState>, analytics: Analytics, globalCallback: GlobalCallback, intl: Translator, libs: Libs, eventEmitter: EventEmitter);
|
|
36
|
+
constructor(sdkConnector: SdkConnector, mainMessageHandlers: Nullable<MessageHandler>, sdk: RoomleConfiguratorType | RoomleGLBViewer | RoomlePlannerWithExtObjs, exposedCallbacks: ExposedCallbacks, store: Store<StoreState>, analytics: Analytics, globalCallback: GlobalCallback, intl: Translator, libs: Libs, eventEmitter: EventEmitter, rapiAccess: RapiAccess);
|
|
35
37
|
private _getMethodsAndCallbacks;
|
|
36
38
|
get callbacks(): ExposedCallbacks;
|
|
37
39
|
/**
|
|
@@ -169,6 +171,9 @@ export declare class ExposedApi {
|
|
|
169
171
|
toggleDrawer(): void;
|
|
170
172
|
activateCustomView(viewName: PossibleCustomViews, options: CustomViewSettingsForIframe<any>): void;
|
|
171
173
|
deactivateCustomView(viewName: PossibleCustomViews, options: CustomViewSettingsForIframe<any>): void;
|
|
174
|
+
private _setRoomDesignerActive;
|
|
175
|
+
deactivateRoomDesigner(): void;
|
|
176
|
+
activateRoomDesigner(): void;
|
|
172
177
|
private _websiteReady;
|
|
173
178
|
private _handleMessage;
|
|
174
179
|
private _forwardSdkCallbacks;
|
|
@@ -63,6 +63,11 @@ export declare class ExposedCallbacks {
|
|
|
63
63
|
* @param changedObject
|
|
64
64
|
*/
|
|
65
65
|
onPlanElementChanged: (changedObject: UiPlanObject) => void;
|
|
66
|
+
/**
|
|
67
|
+
* Called when an element is moved in the plan, not called when wall or construction element is moved
|
|
68
|
+
* @param changedObject
|
|
69
|
+
*/
|
|
70
|
+
onPlanElementMoved: (changedObject: UiPlanObject) => void;
|
|
66
71
|
/**
|
|
67
72
|
* Gets triggered if a tooltip gets closed by controls button
|
|
68
73
|
* @param tooltipName
|
|
@@ -79,8 +84,8 @@ export declare class ExposedCallbacks {
|
|
|
79
84
|
onSaveDraft: (id: string, image: string, url: string, data: SaveDraftPayload) => void;
|
|
80
85
|
onShowCustomView: (...[viewName, data]: CustomViewCallbackInfo) => Promise<Nullable<boolean>> | Nullable<boolean>;
|
|
81
86
|
onHideCustomView: (...[viewName, data]: CustomViewCallbackInfo) => void;
|
|
82
|
-
onCollapseDrawer: () => void;
|
|
83
|
-
onExpandDrawer: () => void;
|
|
87
|
+
onCollapseDrawer: (_wasChangeBetweenDesktopAndMobile: boolean) => void;
|
|
88
|
+
onExpandDrawer: (_wasChangeBetweenDesktopAndMobile: boolean) => void;
|
|
84
89
|
onSidebarEvent: (...[type, params]: SidebarEventCallbackInfo) => void;
|
|
85
90
|
onShowPopUp: () => void;
|
|
86
91
|
onHidePopUp: () => void;
|