@roomle/embedding-lib 4.24.1-alpha.1 → 4.25.0-alpha.2

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 (37) hide show
  1. package/docs/api/README.md +1 -1
  2. package/docs/api/classes/exposed_analytics_callbacks.ExposedAnalyticsCallbacks.md +1 -1
  3. package/docs/api/classes/exposed_api.ExposedApi.md +38 -10
  4. package/docs/api/classes/exposed_callbacks.ExposedCallbacks.md +7 -7
  5. package/docs/api/classes/roomle_configurator_api.default.md +9 -9
  6. package/docs/api/enums/types.UI_BUTTON.md +48 -15
  7. package/docs/api/interfaces/exposed_callbacks.Labels.md +2 -2
  8. package/docs/api/interfaces/exposed_callbacks.Price.md +2 -2
  9. package/docs/api/interfaces/roomle_configurator_api.RoomleEmbeddingApiKeys.md +4 -4
  10. package/docs/api/interfaces/types.ConfiguratorSettings.md +5 -5
  11. package/docs/api/interfaces/types.EmbeddingSkin.md +5 -5
  12. package/docs/api/interfaces/types.UiInitData.md +58 -37
  13. package/docs/api/modules/roomle_configurator_api.md +3 -3
  14. package/docs/index.md +31 -0
  15. package/docs/md/web/ui/EMBEDDING-CHANGELOG.md +5 -7
  16. package/package.json +28 -1
  17. package/roomle-configurator-api.cjs.js +48 -4
  18. package/roomle-configurator-api.cjs.min.js +1 -1
  19. package/roomle-configurator-api.es.js +48 -4
  20. package/roomle-configurator-api.es.min.js +1 -1
  21. package/roomle-configurator-api.js +48 -4
  22. package/types/index.d.ts +190 -129
  23. package/types/src/common/store/collection-view-state.d.ts +2 -2
  24. package/types/src/common/store/index.d.ts +6 -0
  25. package/types/src/common/utils/helper.d.ts +3 -0
  26. package/types/src/common/utils/types.d.ts +3 -2
  27. package/types/src/configurator/business-logic/sdk-connector.d.ts +1 -0
  28. package/types/src/configurator/components/-utils/overlays.d.ts +8 -8
  29. package/types/src/configurator/components/grid-view/-utils/GridViewHelper.d.ts +3 -0
  30. package/types/src/configurator/embedding/exposed-api.d.ts +10 -0
  31. package/types/src/configurator/embedding/types.d.ts +7 -1
  32. package/types/src/configurator/store/ui-state.d.ts +19 -3
  33. package/types/tests/helpers/data/variants.d.ts +60 -0
  34. package/types/tests/helpers/mocks/sdk-connector-planner.d.ts +13 -0
  35. package/types/tests/helpers/mocks/sdk-connector.d.ts +5 -0
  36. package/types/tests/integration/configurator/components/{overlays/PartList.spec.d.ts → parameters/types/ProductVariant.spec.d.ts} +0 -0
  37. package/types/tests/integration/planner/components/BottomBar.spec.d.ts +1 -0
@@ -1,3 +1,5 @@
1
+ import '@/common/styles/Global.module.scss';
2
+
1
3
  class MessageHandler {
2
4
  constructor(side, incomingMessageBus, outgoingMessageBus, messageExecution) {
3
5
  this._outgoingMessageBus = null;
@@ -160,6 +162,51 @@ const isInIframe = () => {
160
162
  }
161
163
  };
162
164
 
165
+ // see why: so#/58065241/10800831
166
+ const isAndroid = () => /(android)/i.test(navigator.userAgent);
167
+
168
+ /* TO DOs in Google Analytics Admin UI
169
+
170
+ To track the Hit ID, Hit Time, and Hit Type and custom dimensions, first create them in Google Analytics
171
+ and set their scope to "Hit"
172
+
173
+ Once you've created the custom metrics in Google Analytics
174
+ (and set their scope to "Hit" and their formatting type to "Integer")
175
+ this setup is ready to go. You need to do this in every GA property
176
+
177
+ For more details see: https://philipwalton.com/articles/the-google-analytics-setup-i-use-on-every-site-i-build/
178
+
179
+ */
180
+ // Probably we could add const enums here
181
+ // but we need to investigate: https://roomle.atlassian.net/browse/CONF-238
182
+ var GA_CUSTOM;
183
+ (function (GA_CUSTOM) {
184
+ GA_CUSTOM["DIMENSION"] = "dimension";
185
+ GA_CUSTOM["METRIC"] = "metric";
186
+ })(GA_CUSTOM || (GA_CUSTOM = {}));
187
+ var GA_HIT_TYPE;
188
+ (function (GA_HIT_TYPE) {
189
+ GA_HIT_TYPE["EVENT"] = "event";
190
+ })(GA_HIT_TYPE || (GA_HIT_TYPE = {}));
191
+ var GA_ACTION_TYPE;
192
+ (function (GA_ACTION_TYPE) {
193
+ GA_ACTION_TYPE["EXCEPTION"] = "exception";
194
+ GA_ACTION_TYPE["TIMING"] = "timing_complete";
195
+ })(GA_ACTION_TYPE || (GA_ACTION_TYPE = {}));
196
+ var CUSTOM_ACTION_TYPE;
197
+ (function (CUSTOM_ACTION_TYPE) {
198
+ CUSTOM_ACTION_TYPE["TRACK_TIMING"] = "track_timing";
199
+ })(CUSTOM_ACTION_TYPE || (CUSTOM_ACTION_TYPE = {}));
200
+ var GA_CATEGORY;
201
+ (function (GA_CATEGORY) {
202
+ GA_CATEGORY["ERROR"] = "Error";
203
+ GA_CATEGORY["NAVIGATION_TIMING"] = "Navigation Timing";
204
+ GA_CATEGORY["TIMING"] = "Timing";
205
+ GA_CATEGORY["INTERACTION"] = "Interaction";
206
+ GA_CATEGORY["TRACKING"] = "Tracking";
207
+ GA_CATEGORY["DEPRECATION"] = "Deprecation";
208
+ })(GA_CATEGORY || (GA_CATEGORY = {}));
209
+
163
210
  /**
164
211
  * Recursively merge properties of two objects.
165
212
  * If a property exists in both it, property of obj2 is used.
@@ -305,16 +352,13 @@ const getFallbackInitData = () => {
305
352
  if (hostname && isDemoHostname(hostname)) {
306
353
  fallbackInitData.configuratorId = 'demoConfigurator';
307
354
  }
308
- fallbackInitData.customApiUrl = 'https://alpha.roomle.com/api/v2';
355
+ fallbackInitData.customApiUrl = 'https://www.roomle.com/api/v2';
309
356
  fallbackInitData.emails = false;
310
357
  return fallbackInitData;
311
358
  };
312
359
  const LEGACY_SHARE_PLACEHOLDER = '<CONF_ID>';
313
360
  const SHARE_PLACEHOLDER = '#CONFIGURATIONID#';
314
361
 
315
- // see why: so#/58065241/10800831
316
- const isAndroid = () => /(android)/i.test(navigator.userAgent);
317
-
318
362
  const setDefaultBehaviour = (object, callbackName, defaultBehaviour) => {
319
363
  let customBehaviour = null;
320
364
  Object.defineProperty(object, callbackName, {
@@ -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)}})},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};
1
+ import"@/common/styles/Global.module.scss";class t{constructor(t,e,r,i){this.t=null,this.i=null,this.o=t,this.s=e,this.t=r,this.i=i,this.s.addEventListener("message",this.l.bind(this))}setOutgoingMessageBus(t){this.t=t}setMessageExecution(t){this.i=t}sendMessage(t,e=[]){return new Promise((r,i)=>{const o=new MessageChannel;o.port1.onmessage=t=>{if(!t||!t.data)return o.port1.close(),o.port2.close(),i(new Error(this.o+" received message but response can not be interpreted"));let e;try{e=JSON.parse(t.data)}catch(t){return o.port1.close(),o.port2.close(),this.h(t),i(t)}e.error?i(e.error):void 0!==e.result?r(e.result):r(),o.port1.close(),o.port2.close()};let s="";try{s=JSON.stringify({message:t,args:e})}catch(t){return i(new Error(this.o+": can not create command because it is not JSON.stringify able"))}if(!this.t)return i(new Error(this.o+": outgoing bus not set yet"));this.t.postMessage(s,"*",[o.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.i)return e.postMessage(JSON.stringify({error:this.o+" is not ready to handle messages"}));Array.isArray(r.args)||(r.args=[r.args]);const i=this.i(r,t);if(void 0===i)return;i.then((t={})=>{let r=void 0,i=void 0;"object"==typeof t&&null!==t&&(r=t.error,i=t.result),r?e.postMessage(JSON.stringify({error:r})):void 0!==i?e.postMessage(JSON.stringify({result:i})):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.o+": "+t;return console.error(e),e}return t.message=this.o+": "+t.message,console.error(t),t.message}}const e=()=>/(android)/i.test(navigator.userAgent);var r,i,o,s,n;!function(t){t.DIMENSION="dimension",t.METRIC="metric"}(r||(r={})),function(t){t.EVENT="event"}(i||(i={})),function(t){t.EXCEPTION="exception",t.TIMING="timing_complete"}(o||(o={})),function(t){t.TRACK_TIMING="track_timing"}(s||(s={})),function(t){t.ERROR="Error",t.NAVIGATION_TIMING="Navigation Timing",t.TIMING="Timing",t.INTERACTION="Interaction",t.TRACKING="Tracking",t.DEPRECATION="Deprecation"}(n||(n={}));const a=(t,e)=>{for(const r in e)try{e[r].constructor===Object?t[r]=a(t[r],e[r]):t[r]=e[r]}catch(i){t[r]=e[r]}return t},l=["127.0.0.1","localhost","0.0.0.0"],c=["language","browserLanguage","userLanguage","systemLanguage"],h=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 h(e);if(Array.isArray(e)){for(const t of e)h(t);return}"true"!==e&&"false"!==e||(t[r]="true"===e)}},u=(t,e,r)=>{let i=null;Object.defineProperty(t,e,{get:()=>i||r,set(t){(null==t?void 0:t.mute)?i=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 }"),i=t)}})},d=()=>.01*window.innerHeight+"px",m=t=>{t&&setTimeout(()=>t.style.setProperty(f,d()),0)},f="--rml-full-height",w=new Map;class g{constructor(r,i,o,s){if(this.ui={callbacks:null},this.extended={callbacks:null},this.analytics={callbacks:{}},this.global={callbacks:{}},this.u={},!r||"string"!=typeof r.id)throw new Error("Please provide a correct configuratorId, you get the correct ID from your Roomle Contact Person");if(w.has(i))throw new Error("There is already an instance on this DOM element");if(!document.getElementById("rml-styles")){const t=o.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,s=d();e.innerHTML=`\n .rml-container{${f}:${s};}\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(${f},1vh)*100)}\n .rml-overflow-hidden{overflow:hidden}\n `,document.head.appendChild(e)}this.m=this.m.bind(this),e()&&window.addEventListener("resize",this.m),this.g=i,this.u=o,this.p=r;const n=this.v();this.O=this.O.bind(this),this.N=this.N.bind(this),this._=this._.bind(this),this.P=new t("website",window,null,this.N),this.k=s,this.g.appendChild(n),this.J=n,w.set(i,!0)}static createPlanner(t,e,r){return this.S(t,e,r)}static createConfigurator(t,e,r){return this.S(t,e,r)}static create(t,e,r){return this.S(t,e,r)}static createViewer(t,e,r){return this.S(t,e,r)}static S(t,e,r){return new Promise(async(i,o)=>{try{const o=a((()=>{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=c.length;t<r;t++){const r=e[c[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=>!!l.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=>(h(t),(null==t?void 0:t.customApiUrl)&&(t.customApiUrl=decodeURIComponent(t.customApiUrl)),t.shareUrl&&(t.deeplink=t.shareUrl.replace("<CONF_ID>","#CONFIGURATIONID#")),t))(r));o.featureFlags||(o.featureFlags={}),"boolean"!=typeof o.featureFlags.realPartList&&(o.featureFlags.realPartList=!0),"boolean"!=typeof o.featureFlags.globalCallbacks&&(o.featureFlags.globalCallbacks=!0);const s=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",i=e.overrideTenant||9,o=r+"/configurators/"+t,s="03-"+window.btoa((new Date).toISOString()+";anonymous;roomle_portal_v2"),n=new Request(o,{method:"GET",headers:new Headers({apiKey:"roomle_portal_v2",currentTenant:i,locale:"en",language:"en",device:1,token:s,platform:"web"}),mode:"cors",cache:"default"}),a=await fetch(n),{configurator:l}=await a.json();return l})(t,o);return r=((t,e)=>{e.configuratorId=t.id;const r=t.settings||{};return!e.overrideTenant&&t.tenant&&(e.overrideTenant=t.tenant),((t,e)=>{const r=JSON.parse(JSON.stringify(t));return a(r,e)})(r,e)})(s,o),new this(s,e,r,i)}catch(t){return o(t)}})}teardown(){this.g&&w.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(){m(this.J)}O(){this.J.classList.add("rml-pos"),document.documentElement.classList.add("rml-overflow-hidden"),window.document.body.classList.add("rml-overflow-hidden"),e()&&(m(this.J),this.J.classList.add("rml-android-height"))}_(){this.J.classList.remove("rml-pos"),this.J.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 i;if(!r.source)return;if(r.source!==(null===(i=this.J)||void 0===i?void 0:i.contentWindow))return;if("requestBoot"===t)return this.P.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],i=e[1];this[r]||(this[r]={}),this[r][i]=function(){return this.P.sendMessage(t,[...arguments])}.bind(this)}),r.forEach(t=>{const e=t.split("."),r=e[0],i=e[1],o=e[2];this[r]||(this[r]={}),this[r][i]||(this[r][i]={}),this[r][i][o]=()=>{}}),u(this.ui.callbacks,"onUseFullPage",this.O),u(this.ui.callbacks,"onBackToWebsite",this._),this.k(this),setTimeout(()=>this.P.sendMessage("websiteReady"),0),Promise.resolve({result:null})}const o=t.split("."),s=o[0],n=o[1],a=3===o.length?o[2]:null;if(a&&this[s][n][a]){const t=this[s][n][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')}}export{g as default};
@@ -1,3 +1,5 @@
1
+ import '@/common/styles/Global.module.scss';
2
+
1
3
  class MessageHandler {
2
4
  constructor(side, incomingMessageBus, outgoingMessageBus, messageExecution) {
3
5
  this._outgoingMessageBus = null;
@@ -160,6 +162,51 @@ const isInIframe = () => {
160
162
  }
161
163
  };
162
164
 
165
+ // see why: so#/58065241/10800831
166
+ const isAndroid = () => /(android)/i.test(navigator.userAgent);
167
+
168
+ /* TO DOs in Google Analytics Admin UI
169
+
170
+ To track the Hit ID, Hit Time, and Hit Type and custom dimensions, first create them in Google Analytics
171
+ and set their scope to "Hit"
172
+
173
+ Once you've created the custom metrics in Google Analytics
174
+ (and set their scope to "Hit" and their formatting type to "Integer")
175
+ this setup is ready to go. You need to do this in every GA property
176
+
177
+ For more details see: https://philipwalton.com/articles/the-google-analytics-setup-i-use-on-every-site-i-build/
178
+
179
+ */
180
+ // Probably we could add const enums here
181
+ // but we need to investigate: https://roomle.atlassian.net/browse/CONF-238
182
+ var GA_CUSTOM;
183
+ (function (GA_CUSTOM) {
184
+ GA_CUSTOM["DIMENSION"] = "dimension";
185
+ GA_CUSTOM["METRIC"] = "metric";
186
+ })(GA_CUSTOM || (GA_CUSTOM = {}));
187
+ var GA_HIT_TYPE;
188
+ (function (GA_HIT_TYPE) {
189
+ GA_HIT_TYPE["EVENT"] = "event";
190
+ })(GA_HIT_TYPE || (GA_HIT_TYPE = {}));
191
+ var GA_ACTION_TYPE;
192
+ (function (GA_ACTION_TYPE) {
193
+ GA_ACTION_TYPE["EXCEPTION"] = "exception";
194
+ GA_ACTION_TYPE["TIMING"] = "timing_complete";
195
+ })(GA_ACTION_TYPE || (GA_ACTION_TYPE = {}));
196
+ var CUSTOM_ACTION_TYPE;
197
+ (function (CUSTOM_ACTION_TYPE) {
198
+ CUSTOM_ACTION_TYPE["TRACK_TIMING"] = "track_timing";
199
+ })(CUSTOM_ACTION_TYPE || (CUSTOM_ACTION_TYPE = {}));
200
+ var GA_CATEGORY;
201
+ (function (GA_CATEGORY) {
202
+ GA_CATEGORY["ERROR"] = "Error";
203
+ GA_CATEGORY["NAVIGATION_TIMING"] = "Navigation Timing";
204
+ GA_CATEGORY["TIMING"] = "Timing";
205
+ GA_CATEGORY["INTERACTION"] = "Interaction";
206
+ GA_CATEGORY["TRACKING"] = "Tracking";
207
+ GA_CATEGORY["DEPRECATION"] = "Deprecation";
208
+ })(GA_CATEGORY || (GA_CATEGORY = {}));
209
+
163
210
  /**
164
211
  * Recursively merge properties of two objects.
165
212
  * If a property exists in both it, property of obj2 is used.
@@ -305,16 +352,13 @@ const getFallbackInitData = () => {
305
352
  if (hostname && isDemoHostname(hostname)) {
306
353
  fallbackInitData.configuratorId = 'demoConfigurator';
307
354
  }
308
- fallbackInitData.customApiUrl = 'https://alpha.roomle.com/api/v2';
355
+ fallbackInitData.customApiUrl = 'https://www.roomle.com/api/v2';
309
356
  fallbackInitData.emails = false;
310
357
  return fallbackInitData;
311
358
  };
312
359
  const LEGACY_SHARE_PLACEHOLDER = '<CONF_ID>';
313
360
  const SHARE_PLACEHOLDER = '#CONFIGURATIONID#';
314
361
 
315
- // see why: so#/58065241/10800831
316
- const isAndroid = () => /(android)/i.test(navigator.userAgent);
317
-
318
362
  const setDefaultBehaviour = (object, callbackName, defaultBehaviour) => {
319
363
  let customBehaviour = null;
320
364
  Object.defineProperty(object, callbackName, {
package/types/index.d.ts CHANGED
@@ -7,9 +7,10 @@ declare module "common/utils/types" {
7
7
  export const enum USER_ACTION_MODULE {
8
8
  CONFIGURATOR = 3
9
9
  }
10
- export const enum USER_ACTION {
10
+ export enum USER_ACTION {
11
11
  CONVERSION = 11,
12
- SHARE_AR = 301
12
+ SHARE_AR = 301,
13
+ SAVE_DRAFT = 302
13
14
  }
14
15
  }
15
16
  declare module "configurator/embedding/message-handler" {
@@ -62,7 +63,10 @@ declare module "configurator/embedding/types" {
62
63
  STARTCONFIGURE = "startconfigure",
63
64
  PAUSECONFIGURE = "pauseconfigure",
64
65
  EXPORT_3D = "export3d",
65
- ROTATE = "rotate"
66
+ ROTATE = "rotate",
67
+ SNAPPING = "snapping",
68
+ UNDO = "undo",
69
+ REDO = "redo"
66
70
  }
67
71
  interface FeatureFlags {
68
72
  realPartList?: boolean;
@@ -86,6 +90,9 @@ declare module "configurator/embedding/types" {
86
90
  [UI_BUTTON.STARTCONFIGURE]?: boolean;
87
91
  [UI_BUTTON.PAUSECONFIGURE]?: boolean;
88
92
  [UI_BUTTON.EXPORT_3D]?: boolean;
93
+ [UI_BUTTON.SNAPPING]?: boolean;
94
+ [UI_BUTTON.UNDO]?: boolean;
95
+ [UI_BUTTON.REDO]?: boolean;
89
96
  };
90
97
  skin?: EmbeddingSkin;
91
98
  zIndex?: number;
@@ -339,9 +346,124 @@ declare module "common/utils/init-data" {
339
346
  [key: string]: any;
340
347
  }, path: string, value: any) => void;
341
348
  }
349
+ declare module "common/utils/user-agent" {
350
+ import { Nullable } from "common/utils/types";
351
+ export const isIOs: () => boolean;
352
+ export const hasARQuicklook: () => Nullable<boolean>;
353
+ export const isInAppBrowser: () => Nullable<boolean>;
354
+ export const isAndroid: () => boolean;
355
+ export const deviceSupportsAR: () => boolean;
356
+ }
357
+ declare module "common/utils/dom" {
358
+ import { Nullable } from "common/utils/types";
359
+ export const isScrolledToRightEnd: (element: Nullable<HTMLElement>, threshold?: number) => boolean;
360
+ export const hasVerticalOverflow: (element: HTMLElement) => boolean;
361
+ export const hasHorizontalOverflow: (element: HTMLElement) => boolean;
362
+ export const lastVisibleElement: (container: HTMLElement, threshold?: number) => Element;
363
+ export const cssVariableToNumber: (cssVariable: string) => number;
364
+ export const remToPixel: (remValue: string, remBase: number) => number;
365
+ export const percentInStringToFloat: (percentInString: string) => number;
366
+ export const animationDurationInMsToFloat: (animationDuration: string) => number;
367
+ export const calcIsDesktop: () => boolean;
368
+ export const removeLoadingScreen: () => Promise<void>;
369
+ export const showLoadingScreen: () => Promise<void>;
370
+ export const copyToClipboard: (text: string) => void;
371
+ export const setLoadingProgress: (percent: number) => void;
372
+ export const hideLoadingCircle: () => void;
373
+ }
374
+ declare module "common/utils/script-loader" {
375
+ export default class ScriptLoader {
376
+ static fetch(url: string, options: {
377
+ id: string;
378
+ }): Promise<void>;
379
+ }
380
+ }
381
+ declare module "common/utils/google-analytics" {
382
+ import { Nullable } from "common/utils/types";
383
+ export const GA_DIMENSIONS: {
384
+ [key: string]: string;
385
+ };
386
+ export const GA_METRICS: {
387
+ RESPONSE_END_TIME: string;
388
+ DOM_LOAD_TIME: string;
389
+ WINDOW_LOAD_TIME: string;
390
+ TIME_TO_FIRST_BTYE: string;
391
+ KERNEL_IS_READY: string;
392
+ INIT_LOADING_SCREEN_CLOSE: string;
393
+ };
394
+ enum GA_ACTION_TYPE {
395
+ EXCEPTION = "exception",
396
+ TIMING = "timing_complete"
397
+ }
398
+ enum CUSTOM_ACTION_TYPE {
399
+ TRACK_TIMING = "track_timing"
400
+ }
401
+ export const GA_NULL_VALUE = "(not set)";
402
+ export enum GA_CATEGORY {
403
+ ERROR = "Error",
404
+ NAVIGATION_TIMING = "Navigation Timing",
405
+ TIMING = "Timing",
406
+ INTERACTION = "Interaction",
407
+ TRACKING = "Tracking",
408
+ DEPRECATION = "Deprecation"
409
+ }
410
+ export type GoogleAnalyticsCallback = (...args: any[]) => void;
411
+ export const MAX_QUEUE_LENGTH = 1500;
412
+ export default class GoogleAnalytics {
413
+ history: IArguments[];
414
+ private _settings;
415
+ private _queue;
416
+ private _trackingId;
417
+ private _useTracking;
418
+ private _callbacks;
419
+ private _gaReady;
420
+ private get _gtag();
421
+ constructor(configuratorId: string, useTracking?: boolean);
422
+ giveConsent(): void;
423
+ trackEvent(action: CUSTOM_ACTION_TYPE | GA_ACTION_TYPE | string, category: GA_CATEGORY, label: string, value?: Nullable<number>, fieldsObject?: object): void;
424
+ trackTiming(category: GA_CATEGORY, label: any, value: number, fieldsObject?: object): void;
425
+ setDimension(dimension: string, value: any): void;
426
+ setDimensions(dimensions: {
427
+ [key: string]: any;
428
+ }): void;
429
+ trackError(message: string, specialErrorName?: Nullable<string>): void;
430
+ trackContentError(message: string): void;
431
+ addCallback(listener: GoogleAnalyticsCallback): void;
432
+ removeUiCallback(listener: GoogleAnalyticsCallback): void;
433
+ cleanUpHistory(): void;
434
+ trackWrongDomain(): void;
435
+ trackNoActivePackage(): void;
436
+ private _execCommand;
437
+ private _loadLibScript;
438
+ private _send;
439
+ private _flushQueue;
440
+ private _setObjectProperties;
441
+ private _trackException;
442
+ private _trackErrors;
443
+ private _trackErrorEvent;
444
+ private _setSettings;
445
+ private _findDimension;
446
+ private _sendNavigationTimingMetrics;
447
+ }
448
+ }
449
+ declare module "common/plugins/analytics" {
450
+ import GoogleAnalytics from "common/utils/google-analytics";
451
+ export interface Analytics {
452
+ ga: GoogleAnalytics;
453
+ }
454
+ const AnalyticsPlugin: {
455
+ install(Vue: any, { configuratorId, useTracking }: {
456
+ configuratorId: string;
457
+ useTracking: boolean;
458
+ }): void;
459
+ };
460
+ export default AnalyticsPlugin;
461
+ }
342
462
  declare module "common/utils/helper" {
343
463
  import { Nullable } from "common/utils/types";
344
464
  import { RapiConfiguration, RapiItem, RapiTenant } from '@roomle/web-sdk/lib/definitions/typings/rapi-types';
465
+ import { Analytics } from "common/plugins/analytics";
466
+ import { SdkConnector } from "configurator/business-logic/sdk-connector";
345
467
  export const throttle: <T extends (...args: any[]) => any>(func: T, delay?: number) => (...funcArgs: Parameters<T>) => void;
346
468
  export const round: (float: number, precision: number) => number;
347
469
  export const isIdAnItem: (id: string) => boolean;
@@ -400,6 +522,7 @@ declare module "common/utils/helper" {
400
522
  export const runOnIdle: any;
401
523
  export const createShareLinkFromUrl: (url: string) => string;
402
524
  export const isLocationJestTest: () => boolean;
525
+ export const loadVariant: (id: string, applyCurrentGlobalParameters: boolean, sdkConnector: SdkConnector, analytics?: Analytics) => Promise<void>;
403
526
  }
404
527
  declare module "configurator/store/core-data" {
405
528
  import { Module } from 'vuex';
@@ -471,14 +594,14 @@ declare module "common/utils/parameters" {
471
594
  }
472
595
  declare module "configurator/components/-utils/overlays" {
473
596
  export enum OVERLAYS {
474
- PART_LIST = 0,
475
- NO_DOCKING = 1,
476
- SAVE_DRAFT = 2,
477
- VARIANT_WARNING = 3,
478
- OPEN_AR = 4,
479
- EXPORT_3D = 5,
480
- ELEMENT_DISABLED = 6,
481
- DELETE_WARNING = 7
597
+ NO_DOCKING = 0,
598
+ SAVE_DRAFT = 1,
599
+ VARIANT_WARNING = 2,
600
+ OPEN_AR = 3,
601
+ EXPORT_3D = 4,
602
+ ELEMENT_DISABLED = 5,
603
+ DELETE_WARNING = 6,
604
+ GENERIC_ERROR = 7
482
605
  }
483
606
  export interface OverlayState {
484
607
  open: boolean;
@@ -538,7 +661,7 @@ declare module "common/store/collection-view-state" {
538
661
  import { CollectionViewElement } from "configurator/components/collection-view/-utils/types";
539
662
  import { StoreState } from "common/store/index";
540
663
  export interface GridViewUiState {
541
- filter: Nullable<string>;
664
+ filter: string[];
542
665
  showAllAsList: boolean;
543
666
  search: Nullable<string>;
544
667
  userInitiatedSearch: boolean;
@@ -556,7 +679,7 @@ declare module "common/store/collection-view-state" {
556
679
  export enum GRID_VIEW_STATE_MUTATIONS {
557
680
  SET_SEARCH = "GV_SET_SEARCH",
558
681
  TOGGLE_LIST_DISPLAY_TYPE = "GV_TOGGLE_LIST_DISPLAY_TYPE",
559
- SET_FILTER = "GV_SET_FILTER",
682
+ TOGGLE_FILTER = "GV_TOGGLE_FILTER",
560
683
  SET_USER_INITIATED_SEARCH = "GV_SET_USER_INITIATED_SEARCH"
561
684
  }
562
685
  interface MuationPayload<T, V> {
@@ -567,6 +690,24 @@ declare module "common/store/collection-view-state" {
567
690
  export type CollectionViewMutationPayload<T> = MuationPayload<CollectionViewUiState, T>;
568
691
  export const collectionViewUiStateHelper: Module<CollectionViewUiState, StoreState>;
569
692
  }
693
+ declare module "configurator/components/grid-view/-utils/GridViewHelper" {
694
+ import { RapiItem, RapiMaterial } from '@roomle/web-sdk/lib/definitions/typings/rapi-types';
695
+ import { KernelValue, UiPossibleChild } from '@roomle/web-sdk/lib/definitions/typings/kernel';
696
+ import { Nullable } from "common/utils/types";
697
+ export interface GridViewElement {
698
+ key: string;
699
+ payload: RapiMaterial | KernelValue | UiPossibleChild | RapiItem;
700
+ }
701
+ export interface GridViewVariantElement extends GridViewElement {
702
+ hash: string;
703
+ }
704
+ export interface GridViewGroup {
705
+ id: string;
706
+ label: Nullable<string>;
707
+ elements: GridViewElement[];
708
+ }
709
+ export const toGridViewElements: (elements: Array<RapiMaterial | KernelValue | UiPossibleChild | RapiItem>, key: string) => GridViewElement[];
710
+ }
570
711
  declare module "configurator/store/ui-state" {
571
712
  import { Module } from 'vuex';
572
713
  import { SharedUiState, StoreState } from "common/store/index";
@@ -576,6 +717,7 @@ declare module "configurator/store/ui-state" {
576
717
  import { OverlaysOpenState } from "configurator/components/-utils/overlays";
577
718
  import { UiInitData } from "configurator/embedding/types";
578
719
  import { RapiTagForUi } from '@roomle/web-sdk/lib/definitions/typings/rapi-types';
720
+ import { GridViewVariantElement } from "configurator/components/grid-view/-utils/GridViewHelper";
579
721
  export enum BUTTON_ACTIONS {
580
722
  AR = 0,
581
723
  PARTLIST = 1,
@@ -584,7 +726,10 @@ declare module "configurator/store/ui-state" {
584
726
  FULLSCREEN = 4,
585
727
  RESET_CAMERA = 5,
586
728
  RENDER_IMAGE = 6,
587
- ROTATE = 7
729
+ ROTATE = 7,
730
+ SNAPPING = 8,
731
+ UNDO = 9,
732
+ REDO = 10
588
733
  }
589
734
  export interface SceneSelection {
590
735
  selectionMode: string;
@@ -608,6 +753,11 @@ declare module "configurator/store/ui-state" {
608
753
  isConfigurator: boolean;
609
754
  isPlanner: boolean;
610
755
  email: Nullable<string>;
756
+ lastSelectedVariant: Nullable<GridViewVariantElement>;
757
+ undoEnabled: boolean;
758
+ redoEnabled: boolean;
759
+ undoEnabledPlanner: boolean;
760
+ redoEnabledPlanner: boolean;
611
761
  }
612
762
  export enum UI_STATE_MUTATIONS {
613
763
  SET_SELECTED_GROUP = "setSelectedGroup",
@@ -631,7 +781,12 @@ declare module "configurator/store/ui-state" {
631
781
  SET_CURRENT_VARIANTS = "SET_CURRENT_VARIANTS",
632
782
  SET_SHOW_VARIANTS = "SET_SHOW_VARIANTS",
633
783
  SET_EMAIL = "SET_EMAIL",
634
- RESET_UI = "RESET_UI"
784
+ RESET_UI = "RESET_UI",
785
+ SET_LAST_SELECTED_VARIANT = "SET_LAST_SELECTED_VARIANT",
786
+ SET_UNDO = "SET_UNDO",
787
+ SET_REDO = "SET_REDO",
788
+ SET_UNDO_PLANNER = "SET_UNDO_PLANNER",
789
+ SET_REDO_PLANNER = "SET_REDO_PLANNER"
635
790
  }
636
791
  export enum UI_STATE_ACTIONS {
637
792
  SELECT_GROUP = "SELECT_GROUP",
@@ -643,10 +798,12 @@ declare module "configurator/store/ui-state" {
643
798
  PAUSE_CONFIGURING = "PAUSE_CONFIGURING",
644
799
  USE_VIEWER = "USE_VIEWER",
645
800
  USE_PLANNER = "USE_PLANNER",
646
- USE_CONFIGURATOR = "USE_CONFIGURATOR"
801
+ USE_CONFIGURATOR = "USE_CONFIGURATOR",
802
+ SHOW_PARAMS = "SHOW_PARAMS"
647
803
  }
648
804
  export enum UI_STATE_GETTERS {
649
805
  USE_REGULAR_LAYOUT = "USE_REGULAR_LAYOUT",
806
+ PART_LIST_SHOWN = "PART_LIST_SHOWN",
650
807
  COLLECTION_VIEW_ELEMENTS = "COLLECTION_VIEW_ELEMENTS",
651
808
  COLLECTION_VIEW_ADDON_ELEMENTS = "COLLECTION_VIEW_ADDON_ELEMENTS",
652
809
  COLLECTION_VIEW_VARIANTS = "COLLECTION_VIEW_VARIANTS",
@@ -743,6 +900,11 @@ declare module "common/store/index" {
743
900
  SET_SHOW_VARIANTS: UI_STATE_MUTATIONS.SET_SHOW_VARIANTS;
744
901
  SET_EMAIL: UI_STATE_MUTATIONS.SET_EMAIL;
745
902
  RESET_UI: UI_STATE_MUTATIONS.RESET_UI;
903
+ SET_LAST_SELECTED_VARIANT: UI_STATE_MUTATIONS.SET_LAST_SELECTED_VARIANT;
904
+ SET_UNDO: UI_STATE_MUTATIONS.SET_UNDO;
905
+ SET_REDO: UI_STATE_MUTATIONS.SET_REDO;
906
+ SET_UNDO_PLANNER: UI_STATE_MUTATIONS.SET_UNDO_PLANNER;
907
+ SET_REDO_PLANNER: UI_STATE_MUTATIONS.SET_REDO_PLANNER;
746
908
  UPDATE_GROUPS: CORE_DATA_MUTATIONS.UPDATE_GROUPS;
747
909
  UPDATE_PARAMETERS: CORE_DATA_MUTATIONS.UPDATE_PARAMETERS;
748
910
  UPDATE_ADDONS: CORE_DATA_MUTATIONS.UPDATE_ADDONS;
@@ -767,6 +929,7 @@ declare module "common/store/index" {
767
929
  USE_VIEWER: UI_STATE_ACTIONS.USE_VIEWER;
768
930
  USE_PLANNER: UI_STATE_ACTIONS.USE_PLANNER;
769
931
  USE_CONFIGURATOR: UI_STATE_ACTIONS.USE_CONFIGURATOR;
932
+ SHOW_PARAMS: UI_STATE_ACTIONS.SHOW_PARAMS;
770
933
  UPDATE_PRICE: CORE_DATA_ACTIONS.UPDATE_PRICE;
771
934
  SET_LABEL: CORE_STATE_ACTIONS.SET_LABEL;
772
935
  SET_COMPONENT_HAS_CHILDREN: CORE_STATE_ACTIONS.SET_COMPONENT_HAS_CHILDREN;
@@ -782,119 +945,6 @@ declare module "common/store/index" {
782
945
  const _default: import("vuex").Store<StoreState>;
783
946
  export default _default;
784
947
  }
785
- declare module "common/utils/user-agent" {
786
- import { Nullable } from "common/utils/types";
787
- export const isIOs: () => boolean;
788
- export const hasARQuicklook: () => Nullable<boolean>;
789
- export const isInAppBrowser: () => Nullable<boolean>;
790
- export const isAndroid: () => boolean;
791
- export const deviceSupportsAR: () => boolean;
792
- }
793
- declare module "common/utils/dom" {
794
- import { Nullable } from "common/utils/types";
795
- export const isScrolledToRightEnd: (element: Nullable<HTMLElement>, threshold?: number) => boolean;
796
- export const hasVerticalOverflow: (element: HTMLElement) => boolean;
797
- export const hasHorizontalOverflow: (element: HTMLElement) => boolean;
798
- export const lastVisibleElement: (container: HTMLElement, threshold?: number) => Element;
799
- export const cssVariableToNumber: (cssVariable: string) => number;
800
- export const remToPixel: (remValue: string, remBase: number) => number;
801
- export const percentInStringToFloat: (percentInString: string) => number;
802
- export const animationDurationInMsToFloat: (animationDuration: string) => number;
803
- export const calcIsDesktop: () => boolean;
804
- export const removeLoadingScreen: () => Promise<void>;
805
- export const showLoadingScreen: () => Promise<void>;
806
- export const copyToClipboard: (text: string) => void;
807
- export const setLoadingProgress: (percent: number) => void;
808
- export const hideLoadingCircle: () => void;
809
- }
810
- declare module "common/utils/script-loader" {
811
- export default class ScriptLoader {
812
- static fetch(url: string, options: {
813
- id: string;
814
- }): Promise<void>;
815
- }
816
- }
817
- declare module "common/utils/google-analytics" {
818
- import { Nullable } from "common/utils/types";
819
- export const GA_DIMENSIONS: {
820
- [key: string]: string;
821
- };
822
- export const GA_METRICS: {
823
- RESPONSE_END_TIME: string;
824
- DOM_LOAD_TIME: string;
825
- WINDOW_LOAD_TIME: string;
826
- TIME_TO_FIRST_BTYE: string;
827
- KERNEL_IS_READY: string;
828
- INIT_LOADING_SCREEN_CLOSE: string;
829
- };
830
- enum GA_ACTION_TYPE {
831
- EXCEPTION = "exception",
832
- TIMING = "timing_complete"
833
- }
834
- enum CUSTOM_ACTION_TYPE {
835
- TRACK_TIMING = "track_timing"
836
- }
837
- export const GA_NULL_VALUE = "(not set)";
838
- export enum GA_CATEGORY {
839
- ERROR = "Error",
840
- NAVIGATION_TIMING = "Navigation Timing",
841
- TIMING = "Timing",
842
- INTERACTION = "Interaction",
843
- TRACKING = "Tracking",
844
- DEPRECATION = "Deprecation"
845
- }
846
- export type GoogleAnalyticsCallback = (...args: any[]) => void;
847
- export const MAX_QUEUE_LENGTH = 1500;
848
- export default class GoogleAnalytics {
849
- history: IArguments[];
850
- private _settings;
851
- private _queue;
852
- private _trackingId;
853
- private _useTracking;
854
- private _callbacks;
855
- private _gaReady;
856
- private get _gtag();
857
- constructor(configuratorId: string, useTracking?: boolean);
858
- giveConsent(): void;
859
- trackEvent(action: CUSTOM_ACTION_TYPE | GA_ACTION_TYPE | string, category: GA_CATEGORY, label: string, value?: Nullable<number>, fieldsObject?: object): void;
860
- trackTiming(category: GA_CATEGORY, label: any, value: number, fieldsObject?: object): void;
861
- setDimension(dimension: string, value: any): void;
862
- setDimensions(dimensions: {
863
- [key: string]: any;
864
- }): void;
865
- trackError(message: string, specialErrorName?: Nullable<string>): void;
866
- trackContentError(message: string): void;
867
- addCallback(listener: GoogleAnalyticsCallback): void;
868
- removeUiCallback(listener: GoogleAnalyticsCallback): void;
869
- cleanUpHistory(): void;
870
- trackWrongDomain(): void;
871
- trackNoActivePackage(): void;
872
- private _execCommand;
873
- private _loadLibScript;
874
- private _send;
875
- private _flushQueue;
876
- private _setObjectProperties;
877
- private _trackException;
878
- private _trackErrors;
879
- private _trackErrorEvent;
880
- private _setSettings;
881
- private _findDimension;
882
- private _sendNavigationTimingMetrics;
883
- }
884
- }
885
- declare module "common/plugins/analytics" {
886
- import GoogleAnalytics from "common/utils/google-analytics";
887
- export interface Analytics {
888
- ga: GoogleAnalytics;
889
- }
890
- const AnalyticsPlugin: {
891
- install(Vue: any, { configuratorId, useTracking }: {
892
- configuratorId: string;
893
- useTracking: boolean;
894
- }): void;
895
- };
896
- export default AnalyticsPlugin;
897
- }
898
948
  declare module "common/utils/performance" {
899
949
  export const addLoadMark: () => void;
900
950
  export const calcTiming: () => void;
@@ -1117,6 +1167,7 @@ declare module "configurator/business-logic/sdk-connector" {
1117
1167
  private _execLoadingConfiguratorProcess;
1118
1168
  private _startLoading;
1119
1169
  private _finishLoading;
1170
+ private _showGenericError;
1120
1171
  }
1121
1172
  }
1122
1173
  declare module "configurator/embedding/helper" {
@@ -1153,6 +1204,7 @@ declare module "configurator/embedding/exposed-api" {
1153
1204
  import RoomleGLBViewer from '@roomle/web-sdk/lib/definitions/glb-viewer-core/src/roomle-glb-viewer';
1154
1205
  import RoomlePlanner from '@roomle/web-sdk/lib/definitions/planner-core/src/roomle-planner';
1155
1206
  import { GlobalCallback } from '@roomle/web-sdk/lib/definitions/common-core/src/services/global-callback';
1207
+ import { Position3 } from '@roomle/web-sdk/lib/definitions/common-core/src/common-interfaces';
1156
1208
  export class ExposedApi {
1157
1209
  private _sdk;
1158
1210
  private _exposedCallbacks;
@@ -1171,6 +1223,7 @@ declare module "configurator/embedding/exposed-api" {
1171
1223
  /**
1172
1224
  * call this method to load the configuration string you want into the 3d Scene
1173
1225
  * @param configurationString string of the configuration, starts with `{` and ends with `}`
1226
+ * @returns null if configuration can not be loaded
1174
1227
  */
1175
1228
  loadConfigurationString(configurationString: string): Promise<Nullable<LoadResponse>>;
1176
1229
  /**
@@ -1218,6 +1271,14 @@ declare module "configurator/embedding/exposed-api" {
1218
1271
  * call this method if consent of Google Analytics is given later and not already in init-data on boot
1219
1272
  */
1220
1273
  giveGaConsent(): void;
1274
+ /**
1275
+ * Insert an object into the current MOC/planner scene
1276
+ * If no position or rotation is set then it will be placed automatically (without overlapping other objects) with rotation 0
1277
+ * @param id
1278
+ * @param position as x (left/right), y (up/down) and z (front/back)
1279
+ * @param rotation in radians
1280
+ */
1281
+ insertObject(id: string, position?: Position3, rotation?: number): Promise<void>;
1221
1282
  private _websiteReady;
1222
1283
  private _handleMessage;
1223
1284
  private _forwardSdkCallbacks;