@roomle/embedding-lib 4.23.0 → 4.24.0-alpha.4

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.
Files changed (35) hide show
  1. package/docs/api/.nojekyll +1 -0
  2. package/docs/api/classes/{exposed_analytics_callbacks.exposedanalyticscallbacks.md → exposed_analytics_callbacks.ExposedAnalyticsCallbacks.md} +11 -9
  3. package/docs/api/classes/exposed_api.ExposedApi.md +227 -0
  4. package/docs/api/classes/exposed_callbacks.ExposedCallbacks.md +171 -0
  5. package/docs/api/classes/roomle_configurator_api.default.md +78 -42
  6. package/docs/api/enums/types.UI_BUTTON.md +175 -0
  7. package/docs/api/interfaces/exposed_callbacks.Labels.md +32 -0
  8. package/docs/api/interfaces/exposed_callbacks.Price.md +32 -0
  9. package/docs/api/interfaces/roomle_configurator_api.RoomleEmbeddingApiKeys.md +58 -0
  10. package/docs/api/interfaces/types.ConfiguratorSettings.md +150 -0
  11. package/docs/api/interfaces/types.EmbeddingSkin.md +65 -0
  12. package/docs/api/interfaces/types.UiInitData.md +1183 -0
  13. package/docs/api/interfaces/{types.variantsmap.md → types.VariantsMap.md} +1 -1
  14. package/docs/api/modules/exposed_analytics_callbacks.md +1 -1
  15. package/docs/api/modules/exposed_api.md +1 -1
  16. package/docs/api/modules/exposed_callbacks.md +3 -3
  17. package/docs/api/modules/roomle_configurator_api.md +13 -7
  18. package/docs/api/modules/types.md +5 -5
  19. package/docs/index.md +1 -1
  20. package/docs/md/web/ui/EMBEDDING-CHANGELOG.md +2 -12
  21. package/package.json +1 -1
  22. package/roomle-configurator-api.cjs.js +1 -1
  23. package/roomle-configurator-api.cjs.min.js +1 -1
  24. package/roomle-configurator-api.es.js +2 -2
  25. package/roomle-configurator-api.es.min.js +1 -1
  26. package/roomle-configurator-api.js +2 -2
  27. package/docs/api/classes/exposed_api.exposedapi.md +0 -191
  28. package/docs/api/classes/exposed_callbacks.exposedcallbacks.md +0 -141
  29. package/docs/api/enums/types.ui_button.md +0 -154
  30. package/docs/api/interfaces/exposed_callbacks.labels.md +0 -28
  31. package/docs/api/interfaces/exposed_callbacks.price.md +0 -28
  32. package/docs/api/interfaces/roomle_configurator_api.roomleembeddingapikeys.md +0 -50
  33. package/docs/api/interfaces/types.configuratorsettings.md +0 -118
  34. package/docs/api/interfaces/types.embeddingskin.md +0 -55
  35. package/docs/api/interfaces/types.uiinitdata.md +0 -957
@@ -6,4 +6,4 @@
6
6
 
7
7
  ## Indexable
8
8
 
9
- ▪ [key: *string*]: RapiId
9
+ ▪ [key: `string`]: `RapiId`
@@ -6,4 +6,4 @@
6
6
 
7
7
  ### Classes
8
8
 
9
- - [ExposedAnalyticsCallbacks](../classes/exposed_analytics_callbacks.exposedanalyticscallbacks.md)
9
+ - [ExposedAnalyticsCallbacks](../classes/exposed_analytics_callbacks.ExposedAnalyticsCallbacks.md)
@@ -6,4 +6,4 @@
6
6
 
7
7
  ### Classes
8
8
 
9
- - [ExposedApi](../classes/exposed_api.exposedapi.md)
9
+ - [ExposedApi](../classes/exposed_api.ExposedApi.md)
@@ -6,9 +6,9 @@
6
6
 
7
7
  ### Classes
8
8
 
9
- - [ExposedCallbacks](../classes/exposed_callbacks.exposedcallbacks.md)
9
+ - [ExposedCallbacks](../classes/exposed_callbacks.ExposedCallbacks.md)
10
10
 
11
11
  ### Interfaces
12
12
 
13
- - [Labels](../interfaces/exposed_callbacks.labels.md)
14
- - [Price](../interfaces/exposed_callbacks.price.md)
13
+ - [Labels](../interfaces/exposed_callbacks.Labels.md)
14
+ - [Price](../interfaces/exposed_callbacks.Price.md)
@@ -10,7 +10,7 @@
10
10
 
11
11
  ### Interfaces
12
12
 
13
- - [RoomleEmbeddingApiKeys](../interfaces/roomle_configurator_api.roomleembeddingapikeys.md)
13
+ - [RoomleEmbeddingApiKeys](../interfaces/roomle_configurator_api.RoomleEmbeddingApiKeys.md)
14
14
 
15
15
  ### Type aliases
16
16
 
@@ -22,22 +22,28 @@
22
22
 
23
23
  ### RoomleConfiguratorApi
24
24
 
25
- Ƭ **RoomleConfiguratorApi**: [*default*](../classes/roomle_configurator_api.default.md)<RoomleConfigurator, ConfiguratorUiCallbacks\>
25
+ Ƭ **RoomleConfiguratorApi**: [`default`](../classes/roomle_configurator_api.default.md)<`RoomleConfigurator`, `ConfiguratorUiCallbacks`\>
26
26
 
27
- Defined in: src/configurator/embedding/roomle-configurator-api.ts:69
27
+ #### Defined in
28
+
29
+ [src/configurator/embedding/roomle-configurator-api.ts:69](https://gitlab.com/roomle/web/roomle-ui/-/blob/f8c34043/src/configurator/embedding/roomle-configurator-api.ts#L69)
28
30
 
29
31
  ___
30
32
 
31
33
  ### RoomlePlannerApi
32
34
 
33
- Ƭ **RoomlePlannerApi**: [*default*](../classes/roomle_configurator_api.default.md)<RoomlePlanner, ConfiguratorUiCallbacks\>
35
+ Ƭ **RoomlePlannerApi**: [`default`](../classes/roomle_configurator_api.default.md)<`RoomlePlanner`, `ConfiguratorUiCallbacks`\>
36
+
37
+ #### Defined in
34
38
 
35
- Defined in: src/configurator/embedding/roomle-configurator-api.ts:71
39
+ [src/configurator/embedding/roomle-configurator-api.ts:71](https://gitlab.com/roomle/web/roomle-ui/-/blob/f8c34043/src/configurator/embedding/roomle-configurator-api.ts#L71)
36
40
 
37
41
  ___
38
42
 
39
43
  ### RoomleViewerApi
40
44
 
41
- Ƭ **RoomleViewerApi**: [*default*](../classes/roomle_configurator_api.default.md)<RoomleGLBViewer, ConfiguratorUiCallbacks\>
45
+ Ƭ **RoomleViewerApi**: [`default`](../classes/roomle_configurator_api.default.md)<`RoomleGLBViewer`, `ConfiguratorUiCallbacks`\>
46
+
47
+ #### Defined in
42
48
 
43
- Defined in: src/configurator/embedding/roomle-configurator-api.ts:70
49
+ [src/configurator/embedding/roomle-configurator-api.ts:70](https://gitlab.com/roomle/web/roomle-ui/-/blob/f8c34043/src/configurator/embedding/roomle-configurator-api.ts#L70)
@@ -6,11 +6,11 @@
6
6
 
7
7
  ### Enumerations
8
8
 
9
- - [UI\_BUTTON](../enums/types.ui_button.md)
9
+ - [UI\_BUTTON](../enums/types.UI_BUTTON.md)
10
10
 
11
11
  ### Interfaces
12
12
 
13
- - [ConfiguratorSettings](../interfaces/types.configuratorsettings.md)
14
- - [EmbeddingSkin](../interfaces/types.embeddingskin.md)
15
- - [UiInitData](../interfaces/types.uiinitdata.md)
16
- - [VariantsMap](../interfaces/types.variantsmap.md)
13
+ - [ConfiguratorSettings](../interfaces/types.ConfiguratorSettings.md)
14
+ - [EmbeddingSkin](../interfaces/types.EmbeddingSkin.md)
15
+ - [UiInitData](../interfaces/types.UiInitData.md)
16
+ - [VariantsMap](../interfaces/types.VariantsMap.md)
package/docs/index.md CHANGED
@@ -778,7 +778,7 @@ const options = {
778
778
  };
779
779
  ```
780
780
 
781
- To see which labels exist you can take a look at the [API documentation](./api/interfaces/types.uiinitdata.html#translations)
781
+ To see which labels exist you can take a look at the [API documentation](./api/interfaces/types.UiInitData.html#translations).
782
782
 
783
783
  You can test and play around with those settings in this CodeSandbox:
784
784
  [![Edit intelligent-merkle-s589m](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/intelligent-merkle-s589m?fontsize=14&hidenavigation=1&theme=dark)
@@ -1,16 +1,6 @@
1
- ## [4.23.0](https://gitlab.com/roomle/web/roomle-ui/compare/embedding-v4.22.0...embedding-v4.23.0) (2021-10-27)
1
+ ## [4.24.0-alpha.4](https://gitlab.com/roomle/web/roomle-ui/compare/embedding-v4.24.0-alpha.3...embedding-v4.24.0-alpha.4) (2021-11-23)
2
2
 
3
3
 
4
4
  ### Features
5
5
 
6
- * ability to override default button behaviour ([a790eac](https://gitlab.com/roomle/web/roomle-ui/commit/a790eacc7b614f531a58cfc85b661a2cfb1d936f))
7
- * add possibility to override default button behaviour ([c0b750b](https://gitlab.com/roomle/web/roomle-ui/commit/c0b750b92b20df44fa19a6e549d2ce5026e7d4b2))
8
- * improved translations for japanese and french ([a29e9c4](https://gitlab.com/roomle/web/roomle-ui/commit/a29e9c420f279bb50279de2fb2559263fe9010f2))
9
-
10
-
11
- ### Bug Fixes
12
-
13
- * enable save button when email is valid ([0b11012](https://gitlab.com/roomle/web/roomle-ui/commit/0b110122c40cbe1b8e2435b25a42c610ff8d10fd))
14
- * keep plan id until we detect changes ([6e7d332](https://gitlab.com/roomle/web/roomle-ui/commit/6e7d33295662ddca364dfbf49927d9c67ea17777))
15
- * not save plan when nothing changed ([dab0aa6](https://gitlab.com/roomle/web/roomle-ui/commit/dab0aa6f5511d83634faa23f7658d45c847fadf8))
16
- * show delete button on top of addon button on mobile ([578e184](https://gitlab.com/roomle/web/roomle-ui/commit/578e184c5022150cb0f804eacd2c9b95a51057e2))
6
+ * upgrade SDK to version 2.19.0-alpha.5 ([f8732a7](https://gitlab.com/roomle/web/roomle-ui/commit/f8732a7d9cb4a0e39d593bfea7a04d14fc9b52c2))
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@roomle/embedding-lib","version":"4.23.0","main":"roomle-configurator-api.es.min.js","types":"types/index.d.ts","author":"Roomle Development","dependencies":{"@roomle/web-sdk":"2.18.0"},"devDependencies":{"@semantic-release/changelog":"^5.0.1","@semantic-release/exec":"^5.0.0","conventional-changelog-conventionalcommits":"^4.2.3","semantic-release":"^17.0.7"},"scripts":{"release":"semantic-release"},"description":"This is a small library which can be used to communicate with the Roomle Configurator","repository":{"type":"git","url":"git+https://github.com/roomle-build/npm-packages.git"},"publishConfig":{"access":"public"},"license":"MIT"}
1
+ {"name":"@roomle/embedding-lib","version":"4.24.0-alpha.4","main":"roomle-configurator-api.es.min.js","types":"types/index.d.ts","author":"Roomle Development","dependencies":{"@roomle/web-sdk":"2.19.0-alpha.5"},"devDependencies":{"@semantic-release/changelog":"^5.0.1","@semantic-release/exec":"^5.0.0","conventional-changelog-conventionalcommits":"^4.2.3","semantic-release":"^17.0.7"},"scripts":{"release":"semantic-release"},"description":"This is a small library which can be used to communicate with the Roomle Configurator","repository":{"type":"git","url":"git+https://github.com/roomle-build/npm-packages.git"},"publishConfig":{"access":"public"},"license":"MIT"}
@@ -307,7 +307,7 @@ const getFallbackInitData = () => {
307
307
  if (hostname && isDemoHostname(hostname)) {
308
308
  fallbackInitData.configuratorId = 'demoConfigurator';
309
309
  }
310
- fallbackInitData.customApiUrl = 'https://www.roomle.com/api/v2';
310
+ fallbackInitData.customApiUrl = 'https://alpha.roomle.com/api/v2';
311
311
  fallbackInitData.emails = false;
312
312
  return fallbackInitData;
313
313
  };
@@ -1 +1 @@
1
- "use strict";class t{constructor(t,e,r,s){this.t=null,this.s=null,this.i=t,this.o=e,this.t=r,this.s=s,this.o.addEventListener("message",this.l.bind(this))}setOutgoingMessageBus(t){this.t=t}setMessageExecution(t){this.s=t}sendMessage(t,e=[]){return new Promise((r,s)=>{const i=new MessageChannel;i.port1.onmessage=t=>{if(!t||!t.data)return i.port1.close(),i.port2.close(),s(new Error(this.i+" received message but response can not be interpreted"));let e;try{e=JSON.parse(t.data)}catch(t){return i.port1.close(),i.port2.close(),this.h(t),s(t)}e.error?s(e.error):void 0!==e.result?r(e.result):r(),i.port1.close(),i.port2.close()};let o="";try{o=JSON.stringify({message:t,args:e})}catch(t){return s(new Error(this.i+": can not create command because it is not JSON.stringify able"))}if(!this.t)return s(new Error(this.i+": outgoing bus not set yet"));this.t.postMessage(o,"*",[i.port2])})}l(t){const e=t.ports&&Array.isArray(t.ports)&&t.ports.length>0?t.ports[0]:null;if(t.data&&e)try{const r=JSON.parse(t.data);if(!this.s)return e.postMessage(JSON.stringify({error:this.i+" is not ready to handle messages"}));Array.isArray(r.args)||(r.args=[r.args]);const s=this.s(r,t);if(void 0===s)return;s.then((t={})=>{let r=void 0,s=void 0;"object"==typeof t&&null!==t&&(r=t.error,s=t.result),r?e.postMessage(JSON.stringify({error:r})):void 0!==s?e.postMessage(JSON.stringify({result:s})):e.postMessage(JSON.stringify({result:t}))},t=>{e.postMessage(JSON.stringify({error:this.h(t)}))})}catch(t){e.postMessage(JSON.stringify({error:this.h(t)}))}}h(t){if("string"==typeof t){const e=this.i+": "+t;return console.error(e),e}return t.message=this.i+": "+t.message,console.error(t),t.message}}const e=(t,r)=>{for(const s in r)try{r[s].constructor===Object?t[s]=e(t[s],r[s]):t[s]=r[s]}catch(e){t[s]=r[s]}return t},r=["127.0.0.1","localhost","0.0.0.0"],s=["language","browserLanguage","userLanguage","systemLanguage"],i=t=>{if(!t)return;const e=Object.keys(t);for(const r of e){const e=t[r];if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return i(e);if(Array.isArray(e)){for(const t of e)i(t);return}"true"!==e&&"false"!==e||(t[r]="true"===e)}},o=()=>/(android)/i.test(navigator.userAgent),n=(t,e,r)=>{let s=null;Object.defineProperty(t,e,{get:()=>s||r,set(t){(null==t?void 0:t.mute)?s=t.value:(console.warn("You override Roomle defined behaviour. To disalbe this warning pass in an object with the following properties"),console.warn("{ mute: true, value: () => void }"),s=t)}})},l=()=>.01*window.innerHeight+"px",a=t=>{t&&setTimeout(()=>t.style.setProperty(h,l()),0)},h="--rml-full-height",c=new Map;module.exports=class{constructor(e,r,s,i){if(this.ui={callbacks:null},this.extended={callbacks:null},this.analytics={callbacks:{}},this.global={callbacks:{}},this.u={},!e||"string"!=typeof e.id)throw new Error("Please provide a correct configuratorId, you get the correct ID from your Roomle Contact Person");if(c.has(r))throw new Error("There is already an instance on this DOM element");if(!document.getElementById("rml-styles")){const t=s.zIndex||9999999,e=document.createElement("style");e.type="text/css",e.id="rml-styles";const r="transition:all ease-in-out 450ms;",i=["-webkit-","-o-"].reduce((t,e)=>t+(e+r),"")+r,o=l();e.innerHTML=`\n .rml-container{${h}:${o};}\n .rml-pos{position:fixed;top:0;left:0;z-index:${t};opacity:0}\n .rml-transition{${i}}\n .rml-fill{width:100%;height:100%;opacity:1}\n .rml-android-height{height:calc(var(${h},1vh)*100)}\n .rml-overflow-hidden{overflow:hidden}\n `,document.head.appendChild(e)}this.m=this.m.bind(this),o()&&window.addEventListener("resize",this.m),this.g=r,this.u=s,this.p=e;const n=this.v();this.O=this.O.bind(this),this.N=this.N.bind(this),this.P=this.P.bind(this),this._=new t("website",window,null,this.N),this.J=i,this.g.appendChild(n),this.S=n,c.set(r,!0)}static createPlanner(t,e,r){return this.k(t,e,r)}static createConfigurator(t,e,r){return this.k(t,e,r)}static create(t,e,r){return this.k(t,e,r)}static createViewer(t,e,r){return this.k(t,e,r)}static k(t,o,n){return new Promise(async(l,a)=>{try{const a=e((()=>{const t={};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,r=s.length;t<r;t++){const r=e[s[t]];if(r)return r.substr(0,2)}return"en"})()),"(idle)"===t.id&&delete t.id;const e=(()=>{const t=(()=>{try{return window.self!==window.top}catch(t){return!0}})();let e=window.location.href;if(t){if(!document.referrer)return null;e=document.referrer}const{hostname:r}=new URL(e);return r})();return e&&(t=>!!r.includes(t)||!!t.endsWith("roomle.com")||!(!t.endsWith("gitlab.io")&&!t.endsWith("gitlab.com")))(e)&&(t.configuratorId="demoConfigurator"),t.customApiUrl="https://www.roomle.com/api/v2",t.emails=!1,t})(),(t=>(i(t),(null==t?void 0:t.customApiUrl)&&(t.customApiUrl=decodeURIComponent(t.customApiUrl)),t.shareUrl&&(t.deeplink=t.shareUrl.replace("<CONF_ID>","#CONFIGURATIONID#")),t))(n));a.featureFlags||(a.featureFlags={}),"boolean"!=typeof a.featureFlags.realPartList&&(a.featureFlags.realPartList=!0),"boolean"!=typeof a.featureFlags.globalCallbacks&&(a.featureFlags.globalCallbacks=!0);const h=await(async(t,e)=>{if("string"!=typeof t)throw new Error('Configurator ID is not a string type: "'+typeof t+'"');const r=e.customApiUrl?e.customApiUrl:"https://api.roomle.com/v2",s=e.overrideTenant||9,i=r+"/configurators/"+t,o="03-"+window.btoa((new Date).toISOString()+";anonymous;roomle_portal_v2"),n=new Request(i,{method:"GET",headers:new Headers({apiKey:"roomle_portal_v2",currentTenant:s,locale:"en",language:"en",device:1,token:o,platform:"web"}),mode:"cors",cache:"default"}),l=await fetch(n),{configurator:a}=await l.json();return a})(t,a);return n=((t,r)=>{r.configuratorId=t.id;const s=t.settings||{};return!r.overrideTenant&&t.tenant&&(r.overrideTenant=t.tenant),((t,r)=>{const s=JSON.parse(JSON.stringify(t));return e(s,r)})(s,r)})(h,a),new this(h,o,n,l)}catch(t){return a(t)}})}teardown(){this.g&&c.delete(this.g);const t=this.g.querySelector("iframe");t&&this.g.removeChild(t),window.removeEventListener("resize",this.m)}v(){var t;const e=document.createElement("iframe");let r=(null===(t=this.p)||void 0===t?void 0:t.url)||"https://www.roomle.com/t/cp/";return this.u.useLocalRoomle&&(r=location.href.replace("embedding.html","")),location.href.includes("roomle.gitlab.io")&&(r=location.href.replace("embedding.html","index.html")),this.u.overrideServerUrl&&(r=this.u.overrideServerUrl),e.src=r,e.classList.add("rml-container"),e.classList.add("rml-fill"),e}m(){a(this.S)}O(){this.S.classList.add("rml-pos"),document.documentElement.classList.add("rml-overflow-hidden"),window.document.body.classList.add("rml-overflow-hidden"),o()&&(a(this.S),this.S.classList.add("rml-android-height"))}P(){this.S.classList.remove("rml-pos"),this.S.classList.remove("rml-android-height"),document.documentElement.classList.remove("rml-overflow-hidden"),window.document.body.classList.remove("rml-overflow-hidden")}N({message:t,args:e},r){var s;if(!r.source)return;if(r.source!==(null===(s=this.S)||void 0===s?void 0:s.contentWindow))return;if("requestBoot"===t)return this._.setOutgoingMessageBus(r.source),Promise.resolve({result:this.u});if("setup"===t){const{methods:t,callbacks:r}=e[0];return t.forEach(t=>{const e=t.split("."),r=e[0],s=e[1];this[r]||(this[r]={}),this[r][s]=function(){return this._.sendMessage(t,[...arguments])}.bind(this)}),r.forEach(t=>{const e=t.split("."),r=e[0],s=e[1],i=e[2];this[r]||(this[r]={}),this[r][s]||(this[r][s]={}),this[r][s][i]=()=>{}}),n(this.ui.callbacks,"onUseFullPage",this.O),n(this.ui.callbacks,"onBackToWebsite",this.P),this.J(this),setTimeout(()=>this._.sendMessage("websiteReady"),0),Promise.resolve({result:null})}const i=t.split("."),o=i[0],l=i[1],a=3===i.length?i[2]:null;if(a&&this[o][l][a]){const t=this[o][l][a](...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')}};
1
+ "use strict";class t{constructor(t,e,r,s){this.t=null,this.s=null,this.i=t,this.o=e,this.t=r,this.s=s,this.o.addEventListener("message",this.l.bind(this))}setOutgoingMessageBus(t){this.t=t}setMessageExecution(t){this.s=t}sendMessage(t,e=[]){return new Promise((r,s)=>{const i=new MessageChannel;i.port1.onmessage=t=>{if(!t||!t.data)return i.port1.close(),i.port2.close(),s(new Error(this.i+" received message but response can not be interpreted"));let e;try{e=JSON.parse(t.data)}catch(t){return i.port1.close(),i.port2.close(),this.h(t),s(t)}e.error?s(e.error):void 0!==e.result?r(e.result):r(),i.port1.close(),i.port2.close()};let o="";try{o=JSON.stringify({message:t,args:e})}catch(t){return s(new Error(this.i+": can not create command because it is not JSON.stringify able"))}if(!this.t)return s(new Error(this.i+": outgoing bus not set yet"));this.t.postMessage(o,"*",[i.port2])})}l(t){const e=t.ports&&Array.isArray(t.ports)&&t.ports.length>0?t.ports[0]:null;if(t.data&&e)try{const r=JSON.parse(t.data);if(!this.s)return e.postMessage(JSON.stringify({error:this.i+" is not ready to handle messages"}));Array.isArray(r.args)||(r.args=[r.args]);const s=this.s(r,t);if(void 0===s)return;s.then((t={})=>{let r=void 0,s=void 0;"object"==typeof t&&null!==t&&(r=t.error,s=t.result),r?e.postMessage(JSON.stringify({error:r})):void 0!==s?e.postMessage(JSON.stringify({result:s})):e.postMessage(JSON.stringify({result:t}))},t=>{e.postMessage(JSON.stringify({error:this.h(t)}))})}catch(t){e.postMessage(JSON.stringify({error:this.h(t)}))}}h(t){if("string"==typeof t){const e=this.i+": "+t;return console.error(e),e}return t.message=this.i+": "+t.message,console.error(t),t.message}}const e=(t,r)=>{for(const s in r)try{r[s].constructor===Object?t[s]=e(t[s],r[s]):t[s]=r[s]}catch(e){t[s]=r[s]}return t},r=["127.0.0.1","localhost","0.0.0.0"],s=["language","browserLanguage","userLanguage","systemLanguage"],i=t=>{if(!t)return;const e=Object.keys(t);for(const r of e){const e=t[r];if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return i(e);if(Array.isArray(e)){for(const t of e)i(t);return}"true"!==e&&"false"!==e||(t[r]="true"===e)}},o=()=>/(android)/i.test(navigator.userAgent),n=(t,e,r)=>{let s=null;Object.defineProperty(t,e,{get:()=>s||r,set(t){(null==t?void 0:t.mute)?s=t.value:(console.warn("You override Roomle defined behaviour. To disalbe this warning pass in an object with the following properties"),console.warn("{ mute: true, value: () => void }"),s=t)}})},l=()=>.01*window.innerHeight+"px",a=t=>{t&&setTimeout(()=>t.style.setProperty(h,l()),0)},h="--rml-full-height",c=new Map;module.exports=class{constructor(e,r,s,i){if(this.ui={callbacks:null},this.extended={callbacks:null},this.analytics={callbacks:{}},this.global={callbacks:{}},this.u={},!e||"string"!=typeof e.id)throw new Error("Please provide a correct configuratorId, you get the correct ID from your Roomle Contact Person");if(c.has(r))throw new Error("There is already an instance on this DOM element");if(!document.getElementById("rml-styles")){const t=s.zIndex||9999999,e=document.createElement("style");e.type="text/css",e.id="rml-styles";const r="transition:all ease-in-out 450ms;",i=["-webkit-","-o-"].reduce((t,e)=>t+(e+r),"")+r,o=l();e.innerHTML=`\n .rml-container{${h}:${o};}\n .rml-pos{position:fixed;top:0;left:0;z-index:${t};opacity:0}\n .rml-transition{${i}}\n .rml-fill{width:100%;height:100%;opacity:1}\n .rml-android-height{height:calc(var(${h},1vh)*100)}\n .rml-overflow-hidden{overflow:hidden}\n `,document.head.appendChild(e)}this.m=this.m.bind(this),o()&&window.addEventListener("resize",this.m),this.g=r,this.u=s,this.p=e;const n=this.v();this.O=this.O.bind(this),this.N=this.N.bind(this),this.P=this.P.bind(this),this._=new t("website",window,null,this.N),this.J=i,this.g.appendChild(n),this.S=n,c.set(r,!0)}static createPlanner(t,e,r){return this.k(t,e,r)}static createConfigurator(t,e,r){return this.k(t,e,r)}static create(t,e,r){return this.k(t,e,r)}static createViewer(t,e,r){return this.k(t,e,r)}static k(t,o,n){return new Promise(async(l,a)=>{try{const a=e((()=>{const t={};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,r=s.length;t<r;t++){const r=e[s[t]];if(r)return r.substr(0,2)}return"en"})()),"(idle)"===t.id&&delete t.id;const e=(()=>{const t=(()=>{try{return window.self!==window.top}catch(t){return!0}})();let e=window.location.href;if(t){if(!document.referrer)return null;e=document.referrer}const{hostname:r}=new URL(e);return r})();return e&&(t=>!!r.includes(t)||!!t.endsWith("roomle.com")||!(!t.endsWith("gitlab.io")&&!t.endsWith("gitlab.com")))(e)&&(t.configuratorId="demoConfigurator"),t.customApiUrl="https://alpha.roomle.com/api/v2",t.emails=!1,t})(),(t=>(i(t),(null==t?void 0:t.customApiUrl)&&(t.customApiUrl=decodeURIComponent(t.customApiUrl)),t.shareUrl&&(t.deeplink=t.shareUrl.replace("<CONF_ID>","#CONFIGURATIONID#")),t))(n));a.featureFlags||(a.featureFlags={}),"boolean"!=typeof a.featureFlags.realPartList&&(a.featureFlags.realPartList=!0),"boolean"!=typeof a.featureFlags.globalCallbacks&&(a.featureFlags.globalCallbacks=!0);const h=await(async(t,e)=>{if("string"!=typeof t)throw new Error('Configurator ID is not a string type: "'+typeof t+'"');const r=e.customApiUrl?e.customApiUrl:"https://api.roomle.com/v2",s=e.overrideTenant||9,i=r+"/configurators/"+t,o="03-"+window.btoa((new Date).toISOString()+";anonymous;roomle_portal_v2"),n=new Request(i,{method:"GET",headers:new Headers({apiKey:"roomle_portal_v2",currentTenant:s,locale:"en",language:"en",device:1,token:o,platform:"web"}),mode:"cors",cache:"default"}),l=await fetch(n),{configurator:a}=await l.json();return a})(t,a);return n=((t,r)=>{r.configuratorId=t.id;const s=t.settings||{};return!r.overrideTenant&&t.tenant&&(r.overrideTenant=t.tenant),((t,r)=>{const s=JSON.parse(JSON.stringify(t));return e(s,r)})(s,r)})(h,a),new this(h,o,n,l)}catch(t){return a(t)}})}teardown(){this.g&&c.delete(this.g);const t=this.g.querySelector("iframe");t&&this.g.removeChild(t),window.removeEventListener("resize",this.m)}v(){var t;const e=document.createElement("iframe");let r=(null===(t=this.p)||void 0===t?void 0:t.url)||"https://www.roomle.com/t/cp/";return this.u.useLocalRoomle&&(r=location.href.replace("embedding.html","")),location.href.includes("roomle.gitlab.io")&&(r=location.href.replace("embedding.html","index.html")),this.u.overrideServerUrl&&(r=this.u.overrideServerUrl),e.src=r,e.classList.add("rml-container"),e.classList.add("rml-fill"),e}m(){a(this.S)}O(){this.S.classList.add("rml-pos"),document.documentElement.classList.add("rml-overflow-hidden"),window.document.body.classList.add("rml-overflow-hidden"),o()&&(a(this.S),this.S.classList.add("rml-android-height"))}P(){this.S.classList.remove("rml-pos"),this.S.classList.remove("rml-android-height"),document.documentElement.classList.remove("rml-overflow-hidden"),window.document.body.classList.remove("rml-overflow-hidden")}N({message:t,args:e},r){var s;if(!r.source)return;if(r.source!==(null===(s=this.S)||void 0===s?void 0:s.contentWindow))return;if("requestBoot"===t)return this._.setOutgoingMessageBus(r.source),Promise.resolve({result:this.u});if("setup"===t){const{methods:t,callbacks:r}=e[0];return t.forEach(t=>{const e=t.split("."),r=e[0],s=e[1];this[r]||(this[r]={}),this[r][s]=function(){return this._.sendMessage(t,[...arguments])}.bind(this)}),r.forEach(t=>{const e=t.split("."),r=e[0],s=e[1],i=e[2];this[r]||(this[r]={}),this[r][s]||(this[r][s]={}),this[r][s][i]=()=>{}}),n(this.ui.callbacks,"onUseFullPage",this.O),n(this.ui.callbacks,"onBackToWebsite",this.P),this.J(this),setTimeout(()=>this._.sendMessage("websiteReady"),0),Promise.resolve({result:null})}const i=t.split("."),o=i[0],l=i[1],a=3===i.length?i[2]:null;if(a&&this[o][l][a]){const t=this[o][l][a](...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')}};
@@ -305,7 +305,7 @@ const getFallbackInitData = () => {
305
305
  if (hostname && isDemoHostname(hostname)) {
306
306
  fallbackInitData.configuratorId = 'demoConfigurator';
307
307
  }
308
- fallbackInitData.customApiUrl = 'https://www.roomle.com/api/v2';
308
+ fallbackInitData.customApiUrl = 'https://alpha.roomle.com/api/v2';
309
309
  fallbackInitData.emails = false;
310
310
  return fallbackInitData;
311
311
  };
@@ -579,4 +579,4 @@ class RoomleEmbeddingApi {
579
579
  }
580
580
  }
581
581
 
582
- export default RoomleEmbeddingApi;
582
+ export { RoomleEmbeddingApi as default };
@@ -1 +1 @@
1
- class t{constructor(t,e,r,s){this.t=null,this.s=null,this.i=t,this.o=e,this.t=r,this.s=s,this.o.addEventListener("message",this.l.bind(this))}setOutgoingMessageBus(t){this.t=t}setMessageExecution(t){this.s=t}sendMessage(t,e=[]){return new Promise((r,s)=>{const i=new MessageChannel;i.port1.onmessage=t=>{if(!t||!t.data)return i.port1.close(),i.port2.close(),s(new Error(this.i+" received message but response can not be interpreted"));let e;try{e=JSON.parse(t.data)}catch(t){return i.port1.close(),i.port2.close(),this.h(t),s(t)}e.error?s(e.error):void 0!==e.result?r(e.result):r(),i.port1.close(),i.port2.close()};let o="";try{o=JSON.stringify({message:t,args:e})}catch(t){return s(new Error(this.i+": can not create command because it is not JSON.stringify able"))}if(!this.t)return s(new Error(this.i+": outgoing bus not set yet"));this.t.postMessage(o,"*",[i.port2])})}l(t){const e=t.ports&&Array.isArray(t.ports)&&t.ports.length>0?t.ports[0]:null;if(t.data&&e)try{const r=JSON.parse(t.data);if(!this.s)return e.postMessage(JSON.stringify({error:this.i+" is not ready to handle messages"}));Array.isArray(r.args)||(r.args=[r.args]);const s=this.s(r,t);if(void 0===s)return;s.then((t={})=>{let r=void 0,s=void 0;"object"==typeof t&&null!==t&&(r=t.error,s=t.result),r?e.postMessage(JSON.stringify({error:r})):void 0!==s?e.postMessage(JSON.stringify({result:s})):e.postMessage(JSON.stringify({result:t}))},t=>{e.postMessage(JSON.stringify({error:this.h(t)}))})}catch(t){e.postMessage(JSON.stringify({error:this.h(t)}))}}h(t){if("string"==typeof t){const e=this.i+": "+t;return console.error(e),e}return t.message=this.i+": "+t.message,console.error(t),t.message}}const e=(t,r)=>{for(const s in r)try{r[s].constructor===Object?t[s]=e(t[s],r[s]):t[s]=r[s]}catch(e){t[s]=r[s]}return t},r=["127.0.0.1","localhost","0.0.0.0"],s=["language","browserLanguage","userLanguage","systemLanguage"],i=t=>{if(!t)return;const e=Object.keys(t);for(const r of e){const e=t[r];if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return i(e);if(Array.isArray(e)){for(const t of e)i(t);return}"true"!==e&&"false"!==e||(t[r]="true"===e)}},o=()=>/(android)/i.test(navigator.userAgent),n=(t,e,r)=>{let s=null;Object.defineProperty(t,e,{get:()=>s||r,set(t){(null==t?void 0:t.mute)?s=t.value:(console.warn("You override Roomle defined behaviour. To disalbe this warning pass in an object with the following properties"),console.warn("{ mute: true, value: () => void }"),s=t)}})},l=()=>.01*window.innerHeight+"px",a=t=>{t&&setTimeout(()=>t.style.setProperty(h,l()),0)},h="--rml-full-height",c=new Map;export default class{constructor(e,r,s,i){if(this.ui={callbacks:null},this.extended={callbacks:null},this.analytics={callbacks:{}},this.global={callbacks:{}},this.u={},!e||"string"!=typeof e.id)throw new Error("Please provide a correct configuratorId, you get the correct ID from your Roomle Contact Person");if(c.has(r))throw new Error("There is already an instance on this DOM element");if(!document.getElementById("rml-styles")){const t=s.zIndex||9999999,e=document.createElement("style");e.type="text/css",e.id="rml-styles";const r="transition:all ease-in-out 450ms;",i=["-webkit-","-o-"].reduce((t,e)=>t+(e+r),"")+r,o=l();e.innerHTML=`\n .rml-container{${h}:${o};}\n .rml-pos{position:fixed;top:0;left:0;z-index:${t};opacity:0}\n .rml-transition{${i}}\n .rml-fill{width:100%;height:100%;opacity:1}\n .rml-android-height{height:calc(var(${h},1vh)*100)}\n .rml-overflow-hidden{overflow:hidden}\n `,document.head.appendChild(e)}this.m=this.m.bind(this),o()&&window.addEventListener("resize",this.m),this.g=r,this.u=s,this.p=e;const n=this.v();this.O=this.O.bind(this),this.N=this.N.bind(this),this.P=this.P.bind(this),this._=new t("website",window,null,this.N),this.J=i,this.g.appendChild(n),this.S=n,c.set(r,!0)}static createPlanner(t,e,r){return this.k(t,e,r)}static createConfigurator(t,e,r){return this.k(t,e,r)}static create(t,e,r){return this.k(t,e,r)}static createViewer(t,e,r){return this.k(t,e,r)}static k(t,o,n){return new Promise(async(l,a)=>{try{const a=e((()=>{const t={};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,r=s.length;t<r;t++){const r=e[s[t]];if(r)return r.substr(0,2)}return"en"})()),"(idle)"===t.id&&delete t.id;const e=(()=>{const t=(()=>{try{return window.self!==window.top}catch(t){return!0}})();let e=window.location.href;if(t){if(!document.referrer)return null;e=document.referrer}const{hostname:r}=new URL(e);return r})();return e&&(t=>!!r.includes(t)||!!t.endsWith("roomle.com")||!(!t.endsWith("gitlab.io")&&!t.endsWith("gitlab.com")))(e)&&(t.configuratorId="demoConfigurator"),t.customApiUrl="https://www.roomle.com/api/v2",t.emails=!1,t})(),(t=>(i(t),(null==t?void 0:t.customApiUrl)&&(t.customApiUrl=decodeURIComponent(t.customApiUrl)),t.shareUrl&&(t.deeplink=t.shareUrl.replace("<CONF_ID>","#CONFIGURATIONID#")),t))(n));a.featureFlags||(a.featureFlags={}),"boolean"!=typeof a.featureFlags.realPartList&&(a.featureFlags.realPartList=!0),"boolean"!=typeof a.featureFlags.globalCallbacks&&(a.featureFlags.globalCallbacks=!0);const h=await(async(t,e)=>{if("string"!=typeof t)throw new Error('Configurator ID is not a string type: "'+typeof t+'"');const r=e.customApiUrl?e.customApiUrl:"https://api.roomle.com/v2",s=e.overrideTenant||9,i=r+"/configurators/"+t,o="03-"+window.btoa((new Date).toISOString()+";anonymous;roomle_portal_v2"),n=new Request(i,{method:"GET",headers:new Headers({apiKey:"roomle_portal_v2",currentTenant:s,locale:"en",language:"en",device:1,token:o,platform:"web"}),mode:"cors",cache:"default"}),l=await fetch(n),{configurator:a}=await l.json();return a})(t,a);return n=((t,r)=>{r.configuratorId=t.id;const s=t.settings||{};return!r.overrideTenant&&t.tenant&&(r.overrideTenant=t.tenant),((t,r)=>{const s=JSON.parse(JSON.stringify(t));return e(s,r)})(s,r)})(h,a),new this(h,o,n,l)}catch(t){return a(t)}})}teardown(){this.g&&c.delete(this.g);const t=this.g.querySelector("iframe");t&&this.g.removeChild(t),window.removeEventListener("resize",this.m)}v(){var t;const e=document.createElement("iframe");let r=(null===(t=this.p)||void 0===t?void 0:t.url)||"https://www.roomle.com/t/cp/";return this.u.useLocalRoomle&&(r=location.href.replace("embedding.html","")),location.href.includes("roomle.gitlab.io")&&(r=location.href.replace("embedding.html","index.html")),this.u.overrideServerUrl&&(r=this.u.overrideServerUrl),e.src=r,e.classList.add("rml-container"),e.classList.add("rml-fill"),e}m(){a(this.S)}O(){this.S.classList.add("rml-pos"),document.documentElement.classList.add("rml-overflow-hidden"),window.document.body.classList.add("rml-overflow-hidden"),o()&&(a(this.S),this.S.classList.add("rml-android-height"))}P(){this.S.classList.remove("rml-pos"),this.S.classList.remove("rml-android-height"),document.documentElement.classList.remove("rml-overflow-hidden"),window.document.body.classList.remove("rml-overflow-hidden")}N({message:t,args:e},r){var s;if(!r.source)return;if(r.source!==(null===(s=this.S)||void 0===s?void 0:s.contentWindow))return;if("requestBoot"===t)return this._.setOutgoingMessageBus(r.source),Promise.resolve({result:this.u});if("setup"===t){const{methods:t,callbacks:r}=e[0];return t.forEach(t=>{const e=t.split("."),r=e[0],s=e[1];this[r]||(this[r]={}),this[r][s]=function(){return this._.sendMessage(t,[...arguments])}.bind(this)}),r.forEach(t=>{const e=t.split("."),r=e[0],s=e[1],i=e[2];this[r]||(this[r]={}),this[r][s]||(this[r][s]={}),this[r][s][i]=()=>{}}),n(this.ui.callbacks,"onUseFullPage",this.O),n(this.ui.callbacks,"onBackToWebsite",this.P),this.J(this),setTimeout(()=>this._.sendMessage("websiteReady"),0),Promise.resolve({result:null})}const i=t.split("."),o=i[0],l=i[1],a=3===i.length?i[2]:null;if(a&&this[o][l][a]){const t=this[o][l][a](...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')}}
1
+ class t{constructor(t,e,r,s){this.t=null,this.s=null,this.i=t,this.o=e,this.t=r,this.s=s,this.o.addEventListener("message",this.l.bind(this))}setOutgoingMessageBus(t){this.t=t}setMessageExecution(t){this.s=t}sendMessage(t,e=[]){return new Promise((r,s)=>{const i=new MessageChannel;i.port1.onmessage=t=>{if(!t||!t.data)return i.port1.close(),i.port2.close(),s(new Error(this.i+" received message but response can not be interpreted"));let e;try{e=JSON.parse(t.data)}catch(t){return i.port1.close(),i.port2.close(),this.h(t),s(t)}e.error?s(e.error):void 0!==e.result?r(e.result):r(),i.port1.close(),i.port2.close()};let o="";try{o=JSON.stringify({message:t,args:e})}catch(t){return s(new Error(this.i+": can not create command because it is not JSON.stringify able"))}if(!this.t)return s(new Error(this.i+": outgoing bus not set yet"));this.t.postMessage(o,"*",[i.port2])})}l(t){const e=t.ports&&Array.isArray(t.ports)&&t.ports.length>0?t.ports[0]:null;if(t.data&&e)try{const r=JSON.parse(t.data);if(!this.s)return e.postMessage(JSON.stringify({error:this.i+" is not ready to handle messages"}));Array.isArray(r.args)||(r.args=[r.args]);const s=this.s(r,t);if(void 0===s)return;s.then((t={})=>{let r=void 0,s=void 0;"object"==typeof t&&null!==t&&(r=t.error,s=t.result),r?e.postMessage(JSON.stringify({error:r})):void 0!==s?e.postMessage(JSON.stringify({result:s})):e.postMessage(JSON.stringify({result:t}))},t=>{e.postMessage(JSON.stringify({error:this.h(t)}))})}catch(t){e.postMessage(JSON.stringify({error:this.h(t)}))}}h(t){if("string"==typeof t){const e=this.i+": "+t;return console.error(e),e}return t.message=this.i+": "+t.message,console.error(t),t.message}}const e=(t,r)=>{for(const s in r)try{r[s].constructor===Object?t[s]=e(t[s],r[s]):t[s]=r[s]}catch(e){t[s]=r[s]}return t},r=["127.0.0.1","localhost","0.0.0.0"],s=["language","browserLanguage","userLanguage","systemLanguage"],i=t=>{if(!t)return;const e=Object.keys(t);for(const r of e){const e=t[r];if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return i(e);if(Array.isArray(e)){for(const t of e)i(t);return}"true"!==e&&"false"!==e||(t[r]="true"===e)}},o=()=>/(android)/i.test(navigator.userAgent),n=(t,e,r)=>{let s=null;Object.defineProperty(t,e,{get:()=>s||r,set(t){(null==t?void 0:t.mute)?s=t.value:(console.warn("You override Roomle defined behaviour. To disalbe this warning pass in an object with the following properties"),console.warn("{ mute: true, value: () => void }"),s=t)}})},a=()=>.01*window.innerHeight+"px",l=t=>{t&&setTimeout(()=>t.style.setProperty(h,a()),0)},h="--rml-full-height",c=new Map;class u{constructor(e,r,s,i){if(this.ui={callbacks:null},this.extended={callbacks:null},this.analytics={callbacks:{}},this.global={callbacks:{}},this.u={},!e||"string"!=typeof e.id)throw new Error("Please provide a correct configuratorId, you get the correct ID from your Roomle Contact Person");if(c.has(r))throw new Error("There is already an instance on this DOM element");if(!document.getElementById("rml-styles")){const t=s.zIndex||9999999,e=document.createElement("style");e.type="text/css",e.id="rml-styles";const r="transition:all ease-in-out 450ms;",i=["-webkit-","-o-"].reduce((t,e)=>t+(e+r),"")+r,o=a();e.innerHTML=`\n .rml-container{${h}:${o};}\n .rml-pos{position:fixed;top:0;left:0;z-index:${t};opacity:0}\n .rml-transition{${i}}\n .rml-fill{width:100%;height:100%;opacity:1}\n .rml-android-height{height:calc(var(${h},1vh)*100)}\n .rml-overflow-hidden{overflow:hidden}\n `,document.head.appendChild(e)}this.m=this.m.bind(this),o()&&window.addEventListener("resize",this.m),this.g=r,this.u=s,this.p=e;const n=this.v();this.O=this.O.bind(this),this.N=this.N.bind(this),this.P=this.P.bind(this),this._=new t("website",window,null,this.N),this.J=i,this.g.appendChild(n),this.S=n,c.set(r,!0)}static createPlanner(t,e,r){return this.k(t,e,r)}static createConfigurator(t,e,r){return this.k(t,e,r)}static create(t,e,r){return this.k(t,e,r)}static createViewer(t,e,r){return this.k(t,e,r)}static k(t,o,n){return new Promise(async(a,l)=>{try{const l=e((()=>{const t={};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,r=s.length;t<r;t++){const r=e[s[t]];if(r)return r.substr(0,2)}return"en"})()),"(idle)"===t.id&&delete t.id;const e=(()=>{const t=(()=>{try{return window.self!==window.top}catch(t){return!0}})();let e=window.location.href;if(t){if(!document.referrer)return null;e=document.referrer}const{hostname:r}=new URL(e);return r})();return e&&(t=>!!r.includes(t)||!!t.endsWith("roomle.com")||!(!t.endsWith("gitlab.io")&&!t.endsWith("gitlab.com")))(e)&&(t.configuratorId="demoConfigurator"),t.customApiUrl="https://alpha.roomle.com/api/v2",t.emails=!1,t})(),(t=>(i(t),(null==t?void 0:t.customApiUrl)&&(t.customApiUrl=decodeURIComponent(t.customApiUrl)),t.shareUrl&&(t.deeplink=t.shareUrl.replace("<CONF_ID>","#CONFIGURATIONID#")),t))(n));l.featureFlags||(l.featureFlags={}),"boolean"!=typeof l.featureFlags.realPartList&&(l.featureFlags.realPartList=!0),"boolean"!=typeof l.featureFlags.globalCallbacks&&(l.featureFlags.globalCallbacks=!0);const h=await(async(t,e)=>{if("string"!=typeof t)throw new Error('Configurator ID is not a string type: "'+typeof t+'"');const r=e.customApiUrl?e.customApiUrl:"https://api.roomle.com/v2",s=e.overrideTenant||9,i=r+"/configurators/"+t,o="03-"+window.btoa((new Date).toISOString()+";anonymous;roomle_portal_v2"),n=new Request(i,{method:"GET",headers:new Headers({apiKey:"roomle_portal_v2",currentTenant:s,locale:"en",language:"en",device:1,token:o,platform:"web"}),mode:"cors",cache:"default"}),a=await fetch(n),{configurator:l}=await a.json();return l})(t,l);return n=((t,r)=>{r.configuratorId=t.id;const s=t.settings||{};return!r.overrideTenant&&t.tenant&&(r.overrideTenant=t.tenant),((t,r)=>{const s=JSON.parse(JSON.stringify(t));return e(s,r)})(s,r)})(h,l),new this(h,o,n,a)}catch(t){return l(t)}})}teardown(){this.g&&c.delete(this.g);const t=this.g.querySelector("iframe");t&&this.g.removeChild(t),window.removeEventListener("resize",this.m)}v(){var t;const e=document.createElement("iframe");let r=(null===(t=this.p)||void 0===t?void 0:t.url)||"https://www.roomle.com/t/cp/";return this.u.useLocalRoomle&&(r=location.href.replace("embedding.html","")),location.href.includes("roomle.gitlab.io")&&(r=location.href.replace("embedding.html","index.html")),this.u.overrideServerUrl&&(r=this.u.overrideServerUrl),e.src=r,e.classList.add("rml-container"),e.classList.add("rml-fill"),e}m(){l(this.S)}O(){this.S.classList.add("rml-pos"),document.documentElement.classList.add("rml-overflow-hidden"),window.document.body.classList.add("rml-overflow-hidden"),o()&&(l(this.S),this.S.classList.add("rml-android-height"))}P(){this.S.classList.remove("rml-pos"),this.S.classList.remove("rml-android-height"),document.documentElement.classList.remove("rml-overflow-hidden"),window.document.body.classList.remove("rml-overflow-hidden")}N({message:t,args:e},r){var s;if(!r.source)return;if(r.source!==(null===(s=this.S)||void 0===s?void 0:s.contentWindow))return;if("requestBoot"===t)return this._.setOutgoingMessageBus(r.source),Promise.resolve({result:this.u});if("setup"===t){const{methods:t,callbacks:r}=e[0];return t.forEach(t=>{const e=t.split("."),r=e[0],s=e[1];this[r]||(this[r]={}),this[r][s]=function(){return this._.sendMessage(t,[...arguments])}.bind(this)}),r.forEach(t=>{const e=t.split("."),r=e[0],s=e[1],i=e[2];this[r]||(this[r]={}),this[r][s]||(this[r][s]={}),this[r][s][i]=()=>{}}),n(this.ui.callbacks,"onUseFullPage",this.O),n(this.ui.callbacks,"onBackToWebsite",this.P),this.J(this),setTimeout(()=>this._.sendMessage("websiteReady"),0),Promise.resolve({result:null})}const i=t.split("."),o=i[0],a=i[1],l=3===i.length?i[2]:null;if(l&&this[o][a][l]){const t=this[o][a][l](...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')}}export{u as default};
@@ -305,7 +305,7 @@ const getFallbackInitData = () => {
305
305
  if (hostname && isDemoHostname(hostname)) {
306
306
  fallbackInitData.configuratorId = 'demoConfigurator';
307
307
  }
308
- fallbackInitData.customApiUrl = 'https://www.roomle.com/api/v2';
308
+ fallbackInitData.customApiUrl = 'https://alpha.roomle.com/api/v2';
309
309
  fallbackInitData.emails = false;
310
310
  return fallbackInitData;
311
311
  };
@@ -579,4 +579,4 @@ class RoomleEmbeddingApi {
579
579
  }
580
580
  }
581
581
 
582
- export default RoomleEmbeddingApi;
582
+ export { RoomleEmbeddingApi as default };
@@ -1,191 +0,0 @@
1
- [Embedding API Reference](../README.md) / [Modules](../modules.md) / [exposed-api](../modules/exposed_api.md) / ExposedApi
2
-
3
- # Class: ExposedApi
4
-
5
- [exposed-api](../modules/exposed_api.md).ExposedApi
6
-
7
- ## Table of contents
8
-
9
- ### Constructors
10
-
11
- - [constructor](exposed_api.exposedapi.md#constructor)
12
-
13
- ### Accessors
14
-
15
- - [callbacks](exposed_api.exposedapi.md#callbacks)
16
-
17
- ### Methods
18
-
19
- - [giveGaConsent](exposed_api.exposedapi.md#givegaconsent)
20
- - [loadConfigurationString](exposed_api.exposedapi.md#loadconfigurationstring)
21
- - [loadObject](exposed_api.exposedapi.md#loadobject)
22
- - [pauseConfiguring](exposed_api.exposedapi.md#pauseconfiguring)
23
- - [setPrice](exposed_api.exposedapi.md#setprice)
24
- - [startConfiguring](exposed_api.exposedapi.md#startconfiguring)
25
- - [triggerRequestPlan](exposed_api.exposedapi.md#triggerrequestplan)
26
- - [triggerRequestProduct](exposed_api.exposedapi.md#triggerrequestproduct)
27
-
28
- ## Constructors
29
-
30
- ### constructor
31
-
32
- \+ **new ExposedApi**(`sdkConnector`: *SdkConnector*, `messageHandler`: ``null`` \| *MessageHandler*, `sdk`: *default* \| *default* \| *default*, `exposedCallbacks`: [*ExposedCallbacks*](exposed_callbacks.exposedcallbacks.md), `store`: *Store*<StoreState\>, `analytics`: Analytics, `globalCallback`: *GlobalCallback*): [*ExposedApi*](exposed_api.exposedapi.md)
33
-
34
- #### Parameters
35
-
36
- | Name | Type |
37
- | :------ | :------ |
38
- | `sdkConnector` | *SdkConnector* |
39
- | `messageHandler` | ``null`` \| *MessageHandler* |
40
- | `sdk` | *default* \| *default* \| *default* |
41
- | `exposedCallbacks` | [*ExposedCallbacks*](exposed_callbacks.exposedcallbacks.md) |
42
- | `store` | *Store*<StoreState\> |
43
- | `analytics` | Analytics |
44
- | `globalCallback` | *GlobalCallback* |
45
-
46
- **Returns:** [*ExposedApi*](exposed_api.exposedapi.md)
47
-
48
- Defined in: src/configurator/embedding/exposed-api.ts:27
49
-
50
- ## Accessors
51
-
52
- ### callbacks
53
-
54
- • get **callbacks**(): [*ExposedCallbacks*](exposed_callbacks.exposedcallbacks.md)
55
-
56
- **Returns:** [*ExposedCallbacks*](exposed_callbacks.exposedcallbacks.md)
57
-
58
- Defined in: src/configurator/embedding/exposed-api.ts:117
59
-
60
- ## Methods
61
-
62
- ### giveGaConsent
63
-
64
- ▸ **giveGaConsent**(): *void*
65
-
66
- call this method if consent of Google Analytics is given later and not already in init-data on boot
67
-
68
- **Returns:** *void*
69
-
70
- Defined in: src/configurator/embedding/exposed-api.ts:205
71
-
72
- ___
73
-
74
- ### loadConfigurationString
75
-
76
- ▸ **loadConfigurationString**(`configurationString`: *string*): *Promise*<Nullable<LoadResponse\>\>
77
-
78
- call this method to load the configuration string you want into the 3d Scene
79
-
80
- #### Parameters
81
-
82
- | Name | Type | Description |
83
- | :------ | :------ | :------ |
84
- | `configurationString` | *string* | string of the configuration, starts with "{" and ends with "}" |
85
-
86
- **Returns:** *Promise*<Nullable<LoadResponse\>\>
87
-
88
- Defined in: src/configurator/embedding/exposed-api.ts:136
89
-
90
- ___
91
-
92
- ### loadObject
93
-
94
- ▸ **loadObject**(`id`: *string*): *Promise*<Nullable<LoadResponse\>\>
95
-
96
- call this method to load the object you want into the 3d Scene
97
-
98
- #### Parameters
99
-
100
- | Name | Type | Description |
101
- | :------ | :------ | :------ |
102
- | `id` | *string* | database ID of the object you want to load |
103
-
104
- **Returns:** *Promise*<Nullable<LoadResponse\>\>
105
-
106
- Defined in: src/configurator/embedding/exposed-api.ts:125
107
-
108
- ___
109
-
110
- ### pauseConfiguring
111
-
112
- ▸ **pauseConfiguring**(): *void*
113
-
114
- This method can be used to pause configuration
115
- If the configurator was called in view-only mode
116
- this method triggers the onBackToWebsite callback.
117
- To know when the view-only mode is activated see the
118
- description of the startConfiguring method
119
-
120
- **Returns:** *void*
121
-
122
- Defined in: src/configurator/embedding/exposed-api.ts:173
123
-
124
- ___
125
-
126
- ### setPrice
127
-
128
- ▸ **setPrice**(`currencySymbol`: *string*, `price`: *number*): *void*
129
-
130
- set the price for the UI to show
131
- most likely needed when implementing your own price service
132
-
133
- #### Parameters
134
-
135
- | Name | Type |
136
- | :------ | :------ |
137
- | `currencySymbol` | *string* |
138
- | `price` | *number* |
139
-
140
- **Returns:** *void*
141
-
142
- Defined in: src/configurator/embedding/exposed-api.ts:150
143
-
144
- ___
145
-
146
- ### startConfiguring
147
-
148
- ▸ **startConfiguring**(): *void*
149
-
150
- This method can be used to start configuration when
151
- 3d scene is only initialized as viewer first, the
152
- configurator is automatically instantiated as viewer
153
- if the container where the configurator is placed is
154
- smaller than 1024px (this breakpoint could change in future)
155
- so do not rely on this exact pixel setting
156
-
157
- **Returns:** *void*
158
-
159
- Defined in: src/configurator/embedding/exposed-api.ts:162
160
-
161
- ___
162
-
163
- ### triggerRequestPlan
164
-
165
- ▸ **triggerRequestPlan**(): *Promise*<void\>
166
-
167
- call this method to trigger the onRequestPlan event from
168
- outside of the iframe. When this method is called the same
169
- process is kicked off as if the user would have clicked on
170
- request plan. Therefore you can just use the same callback
171
- to react on the response
172
-
173
- **Returns:** *Promise*<void\>
174
-
175
- Defined in: src/configurator/embedding/exposed-api.ts:198
176
-
177
- ___
178
-
179
- ### triggerRequestProduct
180
-
181
- ▸ **triggerRequestProduct**(): *Promise*<void\>
182
-
183
- call this method to trigger the onRequestProduct event from
184
- outside of the iframe. When this method is called the same
185
- process is kicked off as if the user would have clicked on
186
- request product. Therefore you can just use the same callback
187
- to react on the response
188
-
189
- **Returns:** *Promise*<void\>
190
-
191
- Defined in: src/configurator/embedding/exposed-api.ts:187
@@ -1,141 +0,0 @@
1
- [Embedding API Reference](../README.md) / [Modules](../modules.md) / [exposed-callbacks](../modules/exposed_callbacks.md) / ExposedCallbacks
2
-
3
- # Class: ExposedCallbacks
4
-
5
- [exposed-callbacks](../modules/exposed_callbacks.md).ExposedCallbacks
6
-
7
- ## Table of contents
8
-
9
- ### Constructors
10
-
11
- - [constructor](exposed_callbacks.exposedcallbacks.md#constructor)
12
-
13
- ### Methods
14
-
15
- - [onBackToWebsite](exposed_callbacks.exposedcallbacks.md#onbacktowebsite)
16
- - [onButtonClicked](exposed_callbacks.exposedcallbacks.md#onbuttonclicked)
17
- - [onPartListUpdate](exposed_callbacks.exposedcallbacks.md#onpartlistupdate)
18
- - [onRequestPlan](exposed_callbacks.exposedcallbacks.md#onrequestplan)
19
- - [onRequestProduct](exposed_callbacks.exposedcallbacks.md#onrequestproduct)
20
- - [onResize](exposed_callbacks.exposedcallbacks.md#onresize)
21
- - [onUseFullPage](exposed_callbacks.exposedcallbacks.md#onusefullpage)
22
-
23
- ## Constructors
24
-
25
- ### constructor
26
-
27
- \+ **new ExposedCallbacks**(): [*ExposedCallbacks*](exposed_callbacks.exposedcallbacks.md)
28
-
29
- **Returns:** [*ExposedCallbacks*](exposed_callbacks.exposedcallbacks.md)
30
-
31
- ## Methods
32
-
33
- ### onBackToWebsite
34
-
35
- ▸ **onBackToWebsite**(): *void*
36
-
37
- **Returns:** *void*
38
-
39
- Defined in: src/configurator/embedding/exposed-callbacks.ts:40
40
-
41
- ___
42
-
43
- ### onButtonClicked
44
-
45
- ▸ **onButtonClicked**(`name`: [*UI\_BUTTON*](../enums/types.ui_button.md)): *void*
46
-
47
- #### Parameters
48
-
49
- | Name | Type |
50
- | :------ | :------ |
51
- | `name` | [*UI\_BUTTON*](../enums/types.ui_button.md) |
52
-
53
- **Returns:** *void*
54
-
55
- Defined in: src/configurator/embedding/exposed-callbacks.ts:42
56
-
57
- ___
58
-
59
- ### onPartListUpdate
60
-
61
- ▸ **onPartListUpdate**(`partList`: KernelPartList, `hash`: *string*): *void*
62
-
63
- fullList fullList (needed for price calculation) of the current configuration
64
-
65
- #### Parameters
66
-
67
- | Name | Type | Description |
68
- | :------ | :------ | :------ |
69
- | `partList` | KernelPartList | the part list with all details, grouped, etc |
70
- | `hash` | *string* | - |
71
-
72
- **Returns:** *void*
73
-
74
- Defined in: src/configurator/embedding/exposed-callbacks.ts:34
75
-
76
- ___
77
-
78
- ### onRequestPlan
79
-
80
- ▸ **onRequestPlan**(`planId`: *string*, `image`: Base64Image, `items`: *any*[]): *void*
81
-
82
- #### Parameters
83
-
84
- | Name | Type |
85
- | :------ | :------ |
86
- | `planId` | *string* |
87
- | `image` | Base64Image |
88
- | `items` | *any*[] |
89
-
90
- **Returns:** *void*
91
-
92
- Defined in: src/configurator/embedding/exposed-callbacks.ts:44
93
-
94
- ___
95
-
96
- ### onRequestProduct
97
-
98
- ▸ **onRequestProduct**(`configurationId`: *string*, `image`: Base64Image, `partList`: KernelPartList, `price`: [*Price*](../interfaces/exposed_callbacks.price.md), `labels`: [*Labels*](../interfaces/exposed_callbacks.labels.md), `configuration`: RapiConfigurationEnhanced): *void*
99
-
100
- Returns all necessary params when 'Request Product'/'Checkout' button has pressed
101
-
102
- #### Parameters
103
-
104
- | Name | Type | Description |
105
- | :------ | :------ | :------ |
106
- | `configurationId` | *string* | id of the current configuration |
107
- | `image` | Base64Image | image of the current configuration |
108
- | `partList` | KernelPartList | the part list with all details, grouped, etc |
109
- | `price` | [*Price*](../interfaces/exposed_callbacks.price.md) | price of the current configuration, either set via setPrice or from Roomle price service |
110
- | `labels` | [*Labels*](../interfaces/exposed_callbacks.labels.md) | the label of the catalog and the furniture system |
111
- | `configuration` | RapiConfigurationEnhanced | the data returned from the Roomle backend |
112
-
113
- **Returns:** *void*
114
-
115
- Defined in: src/configurator/embedding/exposed-callbacks.ts:28
116
-
117
- ___
118
-
119
- ### onResize
120
-
121
- ▸ **onResize**(`isDesktop`: *boolean*): *void*
122
-
123
- #### Parameters
124
-
125
- | Name | Type |
126
- | :------ | :------ |
127
- | `isDesktop` | *boolean* |
128
-
129
- **Returns:** *void*
130
-
131
- Defined in: src/configurator/embedding/exposed-callbacks.ts:36
132
-
133
- ___
134
-
135
- ### onUseFullPage
136
-
137
- ▸ **onUseFullPage**(): *void*
138
-
139
- **Returns:** *void*
140
-
141
- Defined in: src/configurator/embedding/exposed-callbacks.ts:38