@roomle/embedding-lib 4.33.0 → 4.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/docs/api/classes/exposed_analytics_callbacks.ExposedAnalyticsCallbacks.md +1 -1
  2. package/docs/api/classes/exposed_api.ExposedApi.md +11 -11
  3. package/docs/api/classes/exposed_callbacks.ExposedCallbacks.md +7 -7
  4. package/docs/api/classes/roomle_configurator_api.default.md +9 -9
  5. package/docs/api/enums/types.UI_BUTTON.md +51 -18
  6. package/docs/api/interfaces/exposed_callbacks.Labels.md +2 -2
  7. package/docs/api/interfaces/exposed_callbacks.Price.md +2 -2
  8. package/docs/api/interfaces/roomle_configurator_api.RoomleEmbeddingApiKeys.md +4 -4
  9. package/docs/api/interfaces/types.ConfiguratorSettings.md +5 -5
  10. package/docs/api/interfaces/types.EmbeddingSkin.md +5 -5
  11. package/docs/api/interfaces/types.UiInitData.md +36 -71
  12. package/docs/api/modules/roomle_configurator_api.md +3 -3
  13. package/docs/md/web/ui/EMBEDDING-CHANGELOG.md +31 -24
  14. package/package.json +2 -2
  15. package/roomle-configurator-api.cjs.js +33 -76
  16. package/roomle-configurator-api.cjs.min.js +1 -1
  17. package/roomle-configurator-api.es.js +33 -76
  18. package/roomle-configurator-api.es.min.js +1 -1
  19. package/roomle-configurator-api.js +33 -76
  20. package/types/index.d.ts +305 -245
  21. package/types/src/common/store/index.d.ts +11 -4
  22. package/types/src/common/utils/helper.d.ts +0 -20
  23. package/types/src/common/utils/merge.d.ts +16 -0
  24. package/types/src/common/utils/share.d.ts +1 -0
  25. package/types/src/common/utils/variants.d.ts +3 -0
  26. package/types/src/configurator/components/collection-view/-utils/types.d.ts +3 -3
  27. package/types/src/configurator/components/grid-view/-utils/GridViewHelper.d.ts +3 -3
  28. package/types/src/configurator/embedding/roomle-configurator-api.d.ts +6 -6
  29. package/types/src/configurator/embedding/types.d.ts +6 -1
  30. package/types/src/configurator/store/ui-state.d.ts +14 -6
  31. package/types/src/planner/business-logic/pre-defined-rooms.d.ts +2 -0
  32. package/types/src/planner/business-logic/rooms.d.ts +12 -0
  33. package/types/src/planner/store/planner-core-data.d.ts +21 -0
  34. package/types/src/planner/store/planner-ui-state.d.ts +11 -4
  35. package/types/src/planner/utils/product-list.d.ts +10 -0
  36. package/types/tests/integration/common/components/IconButton.spec.d.ts +1 -0
  37. package/types/tests/integration/common/components/ProductButtons.spec.d.ts +1 -0
  38. package/types/tests/integration/planner/components/CatalogTrigger.spec.d.ts +1 -0
  39. package/types/tests/integration/planner/components/ProductListButton.spec.d.ts +1 -0
  40. package/types/tests/integration/planner/components/SampleRooms.spec.d.ts +1 -0
  41. package/types/tests/integration/planner/components/overlays/product-list/ProductListEntry.spec.d.ts +1 -0
package/types/index.d.ts CHANGED
@@ -66,7 +66,10 @@ declare module "configurator/embedding/types" {
66
66
  ROTATE = "rotate",
67
67
  SNAPPING = "snapping",
68
68
  UNDO = "undo",
69
- REDO = "redo"
69
+ REDO = "redo",
70
+ PARTLIST_PLANNER = "partlist_planner",
71
+ PRODUCTLIST = "productlist",
72
+ TWO_D_VIEW = "2dview"
70
73
  }
71
74
  interface FeatureFlags {
72
75
  realPartList?: boolean;
@@ -93,6 +96,8 @@ declare module "configurator/embedding/types" {
93
96
  [UI_BUTTON.SNAPPING]?: boolean;
94
97
  [UI_BUTTON.UNDO]?: boolean;
95
98
  [UI_BUTTON.REDO]?: boolean;
99
+ [UI_BUTTON.TWO_D_VIEW]?: boolean;
100
+ [UI_BUTTON.PARTLIST_PLANNER]?: boolean;
96
101
  };
97
102
  skin?: EmbeddingSkin;
98
103
  zIndex?: number;
@@ -261,209 +266,9 @@ declare module "common/utils/iframe" {
261
266
  export const useEmbeddingApi: () => boolean;
262
267
  export const sameOrigin: () => boolean;
263
268
  }
264
- declare module "configurator/embedding/utils" {
265
- import { RoomleEmbeddingApiKeys } from "configurator/embedding/roomle-configurator-api";
266
- import { ConfiguratorSettings, UiInitData } from "configurator/embedding/types";
267
- export const NAMESPACE: {
268
- [key: string]: keyof RoomleEmbeddingApiKeys | 'callbacks';
269
- };
270
- export const NAMESPACE_SEPARATOR = ".";
271
- export const SDK_CALLBACK: string;
272
- export const HANDSHAKE_MESSAGES: {
273
- REQUEST_BOOT: string;
274
- SETUP: string;
275
- WEBSITE_READY: string;
276
- };
277
- export const isExposable: (name: string) => boolean;
278
- export const getMethodNames: (proto: any, namespace: string, isCallback?: boolean) => string[];
279
- export const getConfiguratorSettings: (configuratorId: string, initData: UiInitData) => Promise<ConfiguratorSettings>;
280
- }
281
- declare module "common/utils/browser" {
282
- import { Nullable } from "common/utils/types";
283
- export const BROWSER_LANGUAGE_PROPERTY_KEYS_KNOWN: string[];
284
- export const getLanguage: (lang?: Nullable<string>) => any;
285
- }
286
- declare module "configurator/business-logic/roomle-sdk-wrapper" {
287
- import RapiAccess from '@roomle/web-sdk/lib/definitions/common-core/src/rapi-access';
288
- import { GlbViewer } from '@roomle/web-sdk/lib/definitions/glb-viewer-core/src/glb-viewer';
289
- import { Configurator } from '@roomle/web-sdk/lib/definitions/configurator-core/src/configurator';
290
- import { Nullable } from "common/utils/types";
291
- import { UiInitData } from "configurator/embedding/types";
292
- import { GlobalInitDataDefinition } from '@roomle/web-sdk/lib/definitions/common-core/src/utils/shims';
293
- import { Planner } from '@roomle/web-sdk/lib/definitions/planner-core/src/planner';
294
- import { GlobalCallback } from '@roomle/web-sdk/lib/definitions/common-core/src/services/global-callback';
295
- /**
296
- * We use this class in a plugin so we
297
- * can rely on DI to change it during testing
298
- */
299
- export class RoomleSdkWrapper {
300
- private _configuratorInstance;
301
- private _viewerInstance;
302
- private _plannerInstance;
303
- private _currentInstance;
304
- get hasPlanner(): boolean;
305
- getConfigurator(element: HTMLElement, initData?: UiInitData): Promise<Configurator>;
306
- getGlbViewer(element: HTMLElement, initData?: UiInitData): Promise<GlbViewer>;
307
- getPlanner(element: HTMLElement, initData?: UiInitData): Promise<Planner>;
308
- getRapiAccess(): Promise<RapiAccess>;
309
- getGlobalCallback(): Promise<GlobalCallback>;
310
- setGlobalInitData(initData: Nullable<GlobalInitDataDefinition>): void;
311
- }
312
- }
313
- declare module "common/utils/init-data" {
314
- import { ConfiguratorSettings, UiInitData } from "configurator/embedding/types";
315
- import RapiAccess from '@roomle/web-sdk/lib/definitions/common-core/src/rapi-access';
316
- import { Nullable } from "common/utils/types";
317
- import type { MessageHandler } from "configurator/embedding/message-handler";
318
- import { RoomleSdkWrapper } from "configurator/business-logic/roomle-sdk-wrapper";
319
- export const CONFIGURATOR_IDLE = "(idle)";
320
- export const getInitData: (useFallbackId?: boolean) => UiInitData;
321
- export const castAndFixInitData: (initData: UiInitData) => UiInitData;
322
- export const castInitData: (obj: {
323
- [key: string]: any;
324
- }) => void;
325
- export const mergeInitData: (configuratorSettings: ConfiguratorSettings | {
326
- id: string;
327
- settings: UiInitData;
328
- }, currentInitData: UiInitData) => UiInitData;
329
- export const getEmbeddingInitData: (messageHandler: MessageHandler) => Promise<UiInitData>;
330
- export const getRemoteInitData: (rapiAccess: RapiAccess, configuratorId: string) => Promise<UiInitData>;
331
- export const getFallbackInitData: () => UiInitData;
332
- export const LEGACY_SHARE_PLACEHOLDER = "<CONF_ID>";
333
- export const SHARE_PLACEHOLDER = "#CONFIGURATIONID#";
334
- /**
335
- * combines init data in this order: query params > embedding > remote > fallback
336
- *
337
- * some exceptions to consider:
338
- * - tenant: when do we need the tenant and where do we get it from?
339
- *
340
- * @param messageHandler
341
- * @param sdkWrapper
342
- * @param fallbackInitData
343
- */
344
- export const combineInitData: (messageHandler: Nullable<MessageHandler>, sdkWrapper: RoomleSdkWrapper, queryParamsInitData: UiInitData) => Promise<UiInitData>;
345
- export const setProperty: (o: {
346
- [key: string]: any;
347
- }, path: string, value: any) => void;
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
- }
462
269
  declare module "common/utils/helper" {
463
270
  import { Nullable } from "common/utils/types";
464
271
  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";
467
272
  export const throttle: <T extends (...args: any[]) => any>(func: T, delay?: number) => (...funcArgs: Parameters<T>) => void;
468
273
  export const round: (float: number, precision: number) => number;
469
274
  export const isIdAnItem: (id: string) => boolean;
@@ -492,22 +297,6 @@ declare module "common/utils/helper" {
492
297
  export const deepCopy: <T>(o: T) => T;
493
298
  export const toBoolean: (value: boolean | undefined, defaultValue?: boolean) => boolean;
494
299
  export const wait: (delayInMs: number) => Promise<void>;
495
- /**
496
- * Recursively merge properties of two objects.
497
- * If a property exists in both it, property of obj2 is used.
498
- * Returns a new object (copy)
499
- * @param obj1
500
- * @param obj2
501
- */
502
- export const deepMergeCopy: (obj1: any, obj2: any) => any;
503
- /**
504
- * Recursively merge properties of two objects.
505
- * If a property exists in both it, property of obj2 is used.
506
- * Warning: This returns obj1 and not a copy!
507
- * @param obj1
508
- * @param obj2
509
- */
510
- export const deepMerge: (obj1: any, obj2: any) => any;
511
300
  export const NAMES_FOR_LOCALHOST: string[];
512
301
  export const getHostname: () => string | null;
513
302
  export const isDemoHostname: (hostname: string) => boolean;
@@ -520,9 +309,7 @@ declare module "common/utils/helper" {
520
309
  export const checkForActivePackage: (tenant: RapiTenant) => boolean;
521
310
  export const oneTimeInterval: (callback: () => void, delay: number) => number;
522
311
  export const runOnIdle: any;
523
- export const createShareLinkFromUrl: (url: string) => string;
524
312
  export const isLocationJestTest: () => boolean;
525
- export const loadVariant: (id: string, applyCurrentGlobalParameters: boolean, sdkConnector: SdkConnector, analytics?: Analytics) => Promise<void>;
526
313
  }
527
314
  declare module "configurator/store/core-data" {
528
315
  import { Module } from 'vuex';
@@ -564,11 +351,11 @@ declare module "configurator/components/collection-view/-utils/types" {
564
351
  import { Nullable } from "common/utils/types";
565
352
  import { UiPossibleChildTag, UiKernelParameter } from '@roomle/web-sdk/lib/definitions/typings/kernel';
566
353
  import { RapiTagForUi } from '@roomle/web-sdk/lib/definitions/typings/rapi-types';
567
- export type CollectionViewElementType = 'addon' | 'parameter' | 'variant' | 'object';
568
- export interface CollectionViewElement {
354
+ export type CollectionViewElementType = 'addon' | 'parameter' | 'variant' | 'object' | 'room';
355
+ export interface CollectionViewElement<T = (UiPossibleChildTag | UiKernelParameter | RapiTagForUi)> {
569
356
  label: Nullable<string>;
570
357
  key: string;
571
- payload: UiPossibleChildTag | UiKernelParameter | RapiTagForUi;
358
+ payload: T;
572
359
  type: CollectionViewElementType;
573
360
  }
574
361
  }
@@ -694,9 +481,9 @@ declare module "configurator/components/grid-view/-utils/GridViewHelper" {
694
481
  import { RapiItem, RapiMaterial } from '@roomle/web-sdk/lib/definitions/typings/rapi-types';
695
482
  import { KernelValue, UiPossibleChild } from '@roomle/web-sdk/lib/definitions/typings/kernel';
696
483
  import { Nullable } from "common/utils/types";
697
- export interface GridViewElement {
484
+ export interface GridViewElement<T = (RapiMaterial | KernelValue | UiPossibleChild | RapiItem)> {
698
485
  key: string;
699
- payload: RapiMaterial | KernelValue | UiPossibleChild | RapiItem;
486
+ payload: T;
700
487
  }
701
488
  export interface GridViewVariantElement extends GridViewElement {
702
489
  hash: string;
@@ -706,7 +493,7 @@ declare module "configurator/components/grid-view/-utils/GridViewHelper" {
706
493
  label: Nullable<string>;
707
494
  elements: GridViewElement[];
708
495
  }
709
- export const toGridViewElements: (elements: Array<RapiMaterial | KernelValue | UiPossibleChild | RapiItem>, key: string) => GridViewElement[];
496
+ export const toGridViewElements: <T = RapiItem | RapiMaterial | UiPossibleChild | KernelValue>(elements: T[], key: string) => GridViewElement<T>[];
710
497
  }
711
498
  declare module "configurator/store/ui-state" {
712
499
  import { Module } from 'vuex';
@@ -729,7 +516,11 @@ declare module "configurator/store/ui-state" {
729
516
  ROTATE = 7,
730
517
  SNAPPING = 8,
731
518
  UNDO = 9,
732
- REDO = 10
519
+ REDO = 10,
520
+ PARTLIST_PLANNER = 11,
521
+ PRODUCTLIST = 12,
522
+ TWO_D_VIEW = 13,
523
+ ADD_ROOM = 14
733
524
  }
734
525
  export interface SceneSelection {
735
526
  selectionMode: string;
@@ -762,8 +553,6 @@ declare module "configurator/store/ui-state" {
762
553
  export enum UI_STATE_MUTATIONS {
763
554
  SET_SELECTED_GROUP = "setSelectedGroup",
764
555
  SET_IS_DESKTOP = "setIsDesktop",
765
- SET_ACTION_SELECTED = "setActionSelected",
766
- SET_ACTION_DESELECTED = "setActionDeselected",
767
556
  SET_INTERACTIONS_EXPANDED = "setInteractionsExpanded",
768
557
  SET_IS_LANDSCAPE = "setIsLandscape",
769
558
  SET_IS_PART_LIST_SHOWN = "SET_IS_PART_LIST_SHOWN",
@@ -786,7 +575,9 @@ declare module "configurator/store/ui-state" {
786
575
  SET_UNDO = "SET_UNDO",
787
576
  SET_REDO = "SET_REDO",
788
577
  SET_UNDO_PLANNER = "SET_UNDO_PLANNER",
789
- SET_REDO_PLANNER = "SET_REDO_PLANNER"
578
+ SET_REDO_PLANNER = "SET_REDO_PLANNER",
579
+ SET_TOPBAR_ACTION_SELECTED = "SET_TOPBAR_ACTION_SELECTED",
580
+ SET_TOPBAR_ACTION_DESELECTED = "SET_TOPBAR_ACTION_DESELECTED"
790
581
  }
791
582
  export enum UI_STATE_ACTIONS {
792
583
  SELECT_GROUP = "SELECT_GROUP",
@@ -799,7 +590,8 @@ declare module "configurator/store/ui-state" {
799
590
  USE_VIEWER = "USE_VIEWER",
800
591
  USE_PLANNER = "USE_PLANNER",
801
592
  USE_CONFIGURATOR = "USE_CONFIGURATOR",
802
- SHOW_PARAMS = "SHOW_PARAMS"
593
+ SHOW_PARAMS = "SHOW_PARAMS",
594
+ SHOW_ROOMS = "SHOW_ROOMS"
803
595
  }
804
596
  export enum UI_STATE_GETTERS {
805
597
  USE_REGULAR_LAYOUT = "USE_REGULAR_LAYOUT",
@@ -807,7 +599,10 @@ declare module "configurator/store/ui-state" {
807
599
  COLLECTION_VIEW_ELEMENTS = "COLLECTION_VIEW_ELEMENTS",
808
600
  COLLECTION_VIEW_ADDON_ELEMENTS = "COLLECTION_VIEW_ADDON_ELEMENTS",
809
601
  COLLECTION_VIEW_VARIANTS = "COLLECTION_VIEW_VARIANTS",
810
- SHOW_BACK_TO_WEBSITE = "SHOW_BACK_TO_WEBSITE"
602
+ SHOW_BACK_TO_WEBSITE = "SHOW_BACK_TO_WEBSITE",
603
+ PART_LIST_PLANNER_SHOWN = "PART_LIST_PLANNER_SHOWN",
604
+ PRODUCT_LIST_SHOWN = "PRODUCT_LIST_SHOWN",
605
+ SAMPLE_ROOMS_SHOWN = "SAMPLE_ROOMS_SHOWN"
811
606
  }
812
607
  export const initialState: UiState;
813
608
  export const uiState: Module<UiState, StoreState>;
@@ -817,6 +612,7 @@ declare module "planner/store/planner-ui-state" {
817
612
  import { SharedUiState, StoreState } from "common/store/index";
818
613
  import { Nullable } from "common/utils/types";
819
614
  import { SelectionPayload } from '@roomle/web-sdk/lib/definitions/planner-core/src/roomle-planner-ui-callback';
615
+ import { BUTTON_ACTIONS } from "configurator/store/ui-state";
820
616
  import { RapiTagForUi } from '@roomle/web-sdk/lib/definitions/typings/rapi-types';
821
617
  type SelectionType = 'static' | 'configuration';
822
618
  export interface PlannerUiState extends SharedUiState {
@@ -826,6 +622,7 @@ declare module "planner/store/planner-ui-state" {
826
622
  isDrag: boolean;
827
623
  catalogTags: Nullable<RapiTagForUi[]>;
828
624
  actionMenuExpanded: boolean;
625
+ selectedActions: BUTTON_ACTIONS[];
829
626
  }
830
627
  export enum PLANNER_UI_STATE_MUTATIONS {
831
628
  SET_SELECTION_PAYLOAD = "PLANNER_UI_STATE_setSelectionPayload",
@@ -838,27 +635,68 @@ declare module "planner/store/planner-ui-state" {
838
635
  SET_SHOW_CATALOG = "PLANNER_UI_STATE_SET_SHOW_CATALOG",
839
636
  SET_CATALOG_ROOT_TAG = "PLANNER_UI_STATE_SET_CATALOG_ROOT_TAG",
840
637
  SET_IS_DRAG = "SET_IS_DRAG",
841
- SET_ACTION_SELECTED = "setActionSelected",
842
- SET_ACTION_DESELECTED = "setActionDeselected",
843
- SET_ACTION_MENU_EXPANDED = "setSelectionMenuExpanded"
638
+ SET_ACTION_SELECTED = "SET_ACTION_SELECTED",
639
+ SET_ACTION_DESELECTED = "SET_ACTION_DESELECTED",
640
+ SET_ACTION_MENU_EXPANDED = "SET_ACTION_MENU_EXPANDED",
641
+ SET_TOPBAR_ACTION_SELECTED = "SET_TOPBAR_ACTION_SELECTED",
642
+ SET_TOPBAR_ACTION_DESELECTED = "SET_TOPBAR_ACTION_DESELECTED"
844
643
  }
845
644
  export enum PLANNER_UI_STATE_ACTIONS {
846
645
  SELECT_VIEW_MODE = "PLANNER_UI_STATE_SELECT_VIEW_MODE",
847
646
  SET_INTERACTIONS_EXPANDED = "PLANNER_UI_STATE_SET_INTERACTIONS_EXPANDED"
848
647
  }
849
648
  export enum PLANNER_UI_STATE_GETTERS {
850
- CATALOG_ROOT_TAG = "PLANNER_UI_STATE_CATALOG_ROOT_TAG"
649
+ CATALOG_ROOT_TAG = "PLANNER_UI_STATE_CATALOG_ROOT_TAG",
650
+ SELECTED_ITEM_PAYLOAD = "PLANNER_UI_STATE_SELECTED_ITEM_PAYLOAD",
651
+ PART_LIST_PLANNER_SHOWN = "PART_LIST_PLANNER_SHOWN",
652
+ PRODUCT_LIST_SHOWN = "PRODUCT_LIST_SHOWN"
851
653
  }
852
654
  export const plannerUiState: Module<PlannerUiState, StoreState>;
853
655
  }
656
+ declare module "planner/utils/product-list" {
657
+ import { KernelPartList, UiPlanObject } from '@roomle/web-sdk/lib/definitions/typings/kernel';
658
+ import { Store } from 'vuex';
659
+ import { StoreState } from "common/store/index";
660
+ import { SdkConnector } from "configurator/business-logic/sdk-connector";
661
+ import { RapiConfiguration, RapiItem } from '@roomle/web-sdk/lib/definitions/typings/rapi-types';
662
+ export interface ProductListItem extends UiPlanObject {
663
+ quantity: number;
664
+ }
665
+ export const matchProductListAndQuantity: (productList: UiPlanObject[]) => ProductListItem[];
666
+ export const fillPartList: (data: RapiItem | RapiConfiguration, partList: KernelPartList, hash: string, sdkConnector: SdkConnector, store: Store<StoreState>) => Promise<void>;
667
+ }
668
+ declare module "planner/store/planner-core-data" {
669
+ import { StoreState } from "common/store/index";
670
+ import { Nullable } from "common/utils/types";
671
+ import { Module } from 'vuex';
672
+ import { ProductListItem } from "planner/utils/product-list";
673
+ export interface PlannerCoreData {
674
+ productList: ProductListItem[];
675
+ currencySymbol: string;
676
+ price: Nullable<number>;
677
+ }
678
+ export enum PLANNER_CORE_DATA_MUTATIONS {
679
+ UPDATE_PRODUCT_LIST = "UPDATE_PRODUCT_LIST",
680
+ UPDATE_PRICE_VALUE = "UPDATE_PRICE_VALUE",
681
+ UPDATE_CURRENCY_SYMBOL = "UPDATE_CURRENCY_SYMBOL"
682
+ }
683
+ export enum PLANNER_CORE_DATA_ACTIONS {
684
+ UPDATE_PRICE = "UPDATE_PRICE"
685
+ }
686
+ export enum PLANNER_CORE_DATA_GETTERS {
687
+ CURRENT_PRICE = "CURRENT_PRICE"
688
+ }
689
+ export const plannerCoreData: Module<PlannerCoreData, StoreState>;
690
+ }
854
691
  declare module "common/store/index" {
855
692
  import { CORE_STATE_ACTIONS, CORE_STATE_MUTATIONS, CoreState } from "configurator/store/core-state";
856
- import { CORE_DATA_ACTIONS, CORE_DATA_MUTATIONS, CoreData } from "configurator/store/core-data";
693
+ import { CORE_DATA_MUTATIONS, CoreData } from "configurator/store/core-data";
857
694
  import { BUTTON_ACTIONS, UI_STATE_ACTIONS, UI_STATE_MUTATIONS, UiState } from "configurator/store/ui-state";
858
695
  import { PLANNER_UI_STATE_MUTATIONS, PlannerUiState } from "planner/store/planner-ui-state";
859
696
  import { COMMON_UI_STATE_MUTATIONS, CommonUiState } from "common/store/common-ui-state";
860
697
  import { COLLECTION_VIEW_STATE_MUTATIONS, CollectionViewUiState } from "common/store/collection-view-state";
861
698
  import { Nullable } from "common/utils/types";
699
+ import { PLANNER_CORE_DATA_ACTIONS, PLANNER_CORE_DATA_MUTATIONS, PlannerCoreData } from "planner/store/planner-core-data";
862
700
  export interface SharedUiState {
863
701
  interactionsExpanded: boolean;
864
702
  isFullscreen: boolean;
@@ -867,9 +705,12 @@ declare module "common/store/index" {
867
705
  lastRegularViewMode: Nullable<boolean>;
868
706
  wasDesktopBefore: boolean;
869
707
  sidebar: CollectionViewUiState;
870
- selectedActions: BUTTON_ACTIONS[];
708
+ topBarSelectedActions: BUTTON_ACTIONS[];
871
709
  }
872
710
  export const MUTATIONS: {
711
+ UPDATE_PRODUCT_LIST: PLANNER_CORE_DATA_MUTATIONS.UPDATE_PRODUCT_LIST;
712
+ UPDATE_PRICE_VALUE: PLANNER_CORE_DATA_MUTATIONS.UPDATE_PRICE_VALUE;
713
+ UPDATE_CURRENCY_SYMBOL: PLANNER_CORE_DATA_MUTATIONS.UPDATE_CURRENCY_SYMBOL;
873
714
  ELEMENT_EXPANDED: COLLECTION_VIEW_STATE_MUTATIONS.ELEMENT_EXPANDED;
874
715
  SET_SELECTED_ELEMENT: COLLECTION_VIEW_STATE_MUTATIONS.SET_SELECTED_ELEMENT;
875
716
  SET_IS_IN_IFRAME: COMMON_UI_STATE_MUTATIONS.SET_IS_IN_IFRAME;
@@ -888,6 +729,8 @@ declare module "common/store/index" {
888
729
  SET_ACTION_SELECTED: PLANNER_UI_STATE_MUTATIONS.SET_ACTION_SELECTED;
889
730
  SET_ACTION_DESELECTED: PLANNER_UI_STATE_MUTATIONS.SET_ACTION_DESELECTED;
890
731
  SET_ACTION_MENU_EXPANDED: PLANNER_UI_STATE_MUTATIONS.SET_ACTION_MENU_EXPANDED;
732
+ SET_TOPBAR_ACTION_SELECTED: PLANNER_UI_STATE_MUTATIONS.SET_TOPBAR_ACTION_SELECTED;
733
+ SET_TOPBAR_ACTION_DESELECTED: PLANNER_UI_STATE_MUTATIONS.SET_TOPBAR_ACTION_DESELECTED;
891
734
  SET_SELECTED_GROUP: UI_STATE_MUTATIONS.SET_SELECTED_GROUP;
892
735
  SET_IS_PART_LIST_SHOWN: UI_STATE_MUTATIONS.SET_IS_PART_LIST_SHOWN;
893
736
  SHOW_ONLY_ADDONS: UI_STATE_MUTATIONS.SHOW_ONLY_ADDONS;
@@ -914,7 +757,6 @@ declare module "common/store/index" {
914
757
  UPDATE_PART_LIST: CORE_DATA_MUTATIONS.UPDATE_PART_LIST;
915
758
  UPDATE_BOUNDS: CORE_DATA_MUTATIONS.UPDATE_BOUNDS;
916
759
  UPDATE_CURRENCY: CORE_DATA_MUTATIONS.UPDATE_CURRENCY;
917
- UPDATE_PRICE_VALUE: CORE_DATA_MUTATIONS.UPDATE_PRICE_VALUE;
918
760
  SET_LABEL: CORE_STATE_MUTATIONS.SET_LABEL;
919
761
  SET_COMPONENT_HAS_CHILDREN: CORE_STATE_MUTATIONS.SET_COMPONENT_HAS_CHILDREN;
920
762
  SET_CATALOG_LABEL: CORE_STATE_MUTATIONS.SET_CATALOG_LABEL;
@@ -922,6 +764,7 @@ declare module "common/store/index" {
922
764
  SET_CURRENT_HASH: CORE_STATE_MUTATIONS.SET_CURRENT_HASH;
923
765
  };
924
766
  export const ACTIONS: {
767
+ UPDATE_PRICE: PLANNER_CORE_DATA_ACTIONS.UPDATE_PRICE;
925
768
  SELECT_GROUP: UI_STATE_ACTIONS.SELECT_GROUP;
926
769
  SELECT_VIEW_MODE: UI_STATE_ACTIONS.SELECT_VIEW_MODE;
927
770
  SET_INTERACTIONS_EXPANDED: UI_STATE_ACTIONS.SET_INTERACTIONS_EXPANDED;
@@ -933,7 +776,7 @@ declare module "common/store/index" {
933
776
  USE_PLANNER: UI_STATE_ACTIONS.USE_PLANNER;
934
777
  USE_CONFIGURATOR: UI_STATE_ACTIONS.USE_CONFIGURATOR;
935
778
  SHOW_PARAMS: UI_STATE_ACTIONS.SHOW_PARAMS;
936
- UPDATE_PRICE: CORE_DATA_ACTIONS.UPDATE_PRICE;
779
+ SHOW_ROOMS: UI_STATE_ACTIONS.SHOW_ROOMS;
937
780
  SET_LABEL: CORE_STATE_ACTIONS.SET_LABEL;
938
781
  SET_COMPONENT_HAS_CHILDREN: CORE_STATE_ACTIONS.SET_COMPONENT_HAS_CHILDREN;
939
782
  UPDATE_HASH: CORE_STATE_ACTIONS.UPDATE_HASH;
@@ -943,15 +786,173 @@ declare module "common/store/index" {
943
786
  coreData: CoreData;
944
787
  uiState: UiState;
945
788
  plannerUiState: PlannerUiState;
789
+ plannerCoreData: PlannerCoreData;
946
790
  commonUiState: CommonUiState;
947
791
  }
948
792
  const _default: import("vuex").Store<StoreState>;
949
793
  export default _default;
950
794
  }
795
+ declare module "common/utils/user-agent" {
796
+ import { Nullable } from "common/utils/types";
797
+ export const isIOs: () => boolean;
798
+ export const hasARQuicklook: () => Nullable<boolean>;
799
+ export const isInAppBrowser: () => Nullable<boolean>;
800
+ export const isAndroid: () => boolean;
801
+ export const deviceSupportsAR: () => boolean;
802
+ }
803
+ declare module "common/utils/dom" {
804
+ import { Nullable } from "common/utils/types";
805
+ export const isScrolledToRightEnd: (element: Nullable<HTMLElement>, threshold?: number) => boolean;
806
+ export const hasVerticalOverflow: (element: HTMLElement) => boolean;
807
+ export const hasHorizontalOverflow: (element: HTMLElement) => boolean;
808
+ export const lastVisibleElement: (container: HTMLElement, threshold?: number) => Element;
809
+ export const cssVariableToNumber: (cssVariable: string) => number;
810
+ export const remToPixel: (remValue: string, remBase: number) => number;
811
+ export const percentInStringToFloat: (percentInString: string) => number;
812
+ export const animationDurationInMsToFloat: (animationDuration: string) => number;
813
+ export const calcIsDesktop: () => boolean;
814
+ export const removeLoadingScreen: () => Promise<void>;
815
+ export const showLoadingScreen: () => Promise<void>;
816
+ export const copyToClipboard: (text: string) => void;
817
+ export const setLoadingProgress: (percent: number) => void;
818
+ export const hideLoadingCircle: () => void;
819
+ }
820
+ declare module "common/utils/script-loader" {
821
+ export default class ScriptLoader {
822
+ static fetch(url: string, options: {
823
+ id: string;
824
+ }): Promise<void>;
825
+ }
826
+ }
827
+ declare module "common/utils/google-analytics" {
828
+ import { Nullable } from "common/utils/types";
829
+ export const GA_DIMENSIONS: {
830
+ [key: string]: string;
831
+ };
832
+ export const GA_METRICS: {
833
+ RESPONSE_END_TIME: string;
834
+ DOM_LOAD_TIME: string;
835
+ WINDOW_LOAD_TIME: string;
836
+ TIME_TO_FIRST_BTYE: string;
837
+ KERNEL_IS_READY: string;
838
+ INIT_LOADING_SCREEN_CLOSE: string;
839
+ };
840
+ enum GA_ACTION_TYPE {
841
+ EXCEPTION = "exception",
842
+ TIMING = "timing_complete"
843
+ }
844
+ enum CUSTOM_ACTION_TYPE {
845
+ TRACK_TIMING = "track_timing"
846
+ }
847
+ export const GA_NULL_VALUE = "(not set)";
848
+ export enum GA_CATEGORY {
849
+ ERROR = "Error",
850
+ NAVIGATION_TIMING = "Navigation Timing",
851
+ TIMING = "Timing",
852
+ INTERACTION = "Interaction",
853
+ TRACKING = "Tracking",
854
+ DEPRECATION = "Deprecation"
855
+ }
856
+ export type GoogleAnalyticsCallback = (...args: any[]) => void;
857
+ export const MAX_QUEUE_LENGTH = 1500;
858
+ export default class GoogleAnalytics {
859
+ history: IArguments[];
860
+ private _settings;
861
+ private _queue;
862
+ private _trackingId;
863
+ private _useTracking;
864
+ private _callbacks;
865
+ private _gaReady;
866
+ private get _gtag();
867
+ constructor(configuratorId: string, useTracking?: boolean);
868
+ giveConsent(): void;
869
+ trackEvent(action: CUSTOM_ACTION_TYPE | GA_ACTION_TYPE | string, category: GA_CATEGORY, label: string, value?: Nullable<number>, fieldsObject?: object): void;
870
+ trackTiming(category: GA_CATEGORY, label: any, value: number, fieldsObject?: object): void;
871
+ setDimension(dimension: string, value: any): void;
872
+ setDimensions(dimensions: {
873
+ [key: string]: any;
874
+ }): void;
875
+ trackError(message: string, specialErrorName?: Nullable<string>): void;
876
+ trackContentError(message: string): void;
877
+ addCallback(listener: GoogleAnalyticsCallback): void;
878
+ removeUiCallback(listener: GoogleAnalyticsCallback): void;
879
+ cleanUpHistory(): void;
880
+ trackWrongDomain(): void;
881
+ trackNoActivePackage(): void;
882
+ private _execCommand;
883
+ private _loadLibScript;
884
+ private _send;
885
+ private _flushQueue;
886
+ private _setObjectProperties;
887
+ private _trackException;
888
+ private _trackErrors;
889
+ private _trackErrorEvent;
890
+ private _setSettings;
891
+ private _findDimension;
892
+ private _sendNavigationTimingMetrics;
893
+ }
894
+ }
895
+ declare module "common/plugins/analytics" {
896
+ import GoogleAnalytics from "common/utils/google-analytics";
897
+ export interface Analytics {
898
+ ga: GoogleAnalytics;
899
+ }
900
+ const AnalyticsPlugin: {
901
+ install(Vue: any, { configuratorId, useTracking }: {
902
+ configuratorId: string;
903
+ useTracking: boolean;
904
+ }): void;
905
+ };
906
+ export default AnalyticsPlugin;
907
+ }
908
+ declare module "configurator/business-logic/roomle-sdk-wrapper" {
909
+ import RapiAccess from '@roomle/web-sdk/lib/definitions/common-core/src/rapi-access';
910
+ import { GlbViewer } from '@roomle/web-sdk/lib/definitions/glb-viewer-core/src/glb-viewer';
911
+ import { Configurator } from '@roomle/web-sdk/lib/definitions/configurator-core/src/configurator';
912
+ import { Nullable } from "common/utils/types";
913
+ import { UiInitData } from "configurator/embedding/types";
914
+ import { GlobalInitDataDefinition } from '@roomle/web-sdk/lib/definitions/common-core/src/utils/shims';
915
+ import { Planner } from '@roomle/web-sdk/lib/definitions/planner-core/src/planner';
916
+ import { GlobalCallback } from '@roomle/web-sdk/lib/definitions/common-core/src/services/global-callback';
917
+ /**
918
+ * We use this class in a plugin so we
919
+ * can rely on DI to change it during testing
920
+ */
921
+ export class RoomleSdkWrapper {
922
+ private _configuratorInstance;
923
+ private _viewerInstance;
924
+ private _plannerInstance;
925
+ private _currentInstance;
926
+ get hasPlanner(): boolean;
927
+ getConfigurator(element: HTMLElement, initData?: UiInitData): Promise<Configurator>;
928
+ getGlbViewer(element: HTMLElement, initData?: UiInitData): Promise<GlbViewer>;
929
+ getPlanner(element: HTMLElement, initData?: UiInitData): Promise<Planner>;
930
+ getRapiAccess(): Promise<RapiAccess>;
931
+ getGlobalCallback(): Promise<GlobalCallback>;
932
+ setGlobalInitData(initData: Nullable<GlobalInitDataDefinition>): void;
933
+ }
934
+ }
951
935
  declare module "common/utils/performance" {
952
936
  export const addLoadMark: () => void;
953
937
  export const calcTiming: () => void;
954
938
  }
939
+ declare module "configurator/embedding/utils" {
940
+ import { RoomleEmbeddingApiKeys } from "configurator/embedding/roomle-configurator-api";
941
+ import { ConfiguratorSettings, UiInitData } from "configurator/embedding/types";
942
+ export const NAMESPACE: {
943
+ [key: string]: keyof RoomleEmbeddingApiKeys | 'callbacks';
944
+ };
945
+ export const NAMESPACE_SEPARATOR = ".";
946
+ export const SDK_CALLBACK: string;
947
+ export const HANDSHAKE_MESSAGES: {
948
+ REQUEST_BOOT: string;
949
+ SETUP: string;
950
+ WEBSITE_READY: string;
951
+ };
952
+ export const isExposable: (name: string) => boolean;
953
+ export const getMethodNames: (proto: any, namespace: string, isCallback?: boolean) => string[];
954
+ export const getConfiguratorSettings: (configuratorId: string, initData: UiInitData) => Promise<ConfiguratorSettings>;
955
+ }
955
956
  declare module "configurator/business-logic/ui-callback" {
956
957
  import { KernelComponent } from '@roomle/web-sdk/lib/definitions/typings/kernel';
957
958
  export class UiCallbacks {
@@ -1287,15 +1288,74 @@ declare module "configurator/embedding/exposed-api" {
1287
1288
  private _forwardSdkCallbacks;
1288
1289
  }
1289
1290
  }
1291
+ declare module "common/utils/merge" {
1292
+ /**
1293
+ * Recursively merge properties of two objects.
1294
+ * If a property exists in both it, property of obj2 is used.
1295
+ * Returns a new object (copy)
1296
+ * @param obj1
1297
+ * @param obj2
1298
+ */
1299
+ export const deepMergeCopy: (obj1: any, obj2: any) => any;
1300
+ /**
1301
+ * Recursively merge properties of two objects.
1302
+ * If a property exists in both it, property of obj2 is used.
1303
+ * Warning: This returns obj1 and not a copy!
1304
+ * @param obj1
1305
+ * @param obj2
1306
+ */
1307
+ export const deepMerge: (obj1: any, obj2: any) => any;
1308
+ }
1309
+ declare module "common/utils/browser" {
1310
+ import { Nullable } from "common/utils/types";
1311
+ export const BROWSER_LANGUAGE_PROPERTY_KEYS_KNOWN: string[];
1312
+ export const getLanguage: (lang?: Nullable<string>) => any;
1313
+ }
1314
+ declare module "common/utils/init-data" {
1315
+ import { ConfiguratorSettings, UiInitData } from "configurator/embedding/types";
1316
+ import RapiAccess from '@roomle/web-sdk/lib/definitions/common-core/src/rapi-access';
1317
+ import { Nullable } from "common/utils/types";
1318
+ import type { MessageHandler } from "configurator/embedding/message-handler";
1319
+ import { RoomleSdkWrapper } from "configurator/business-logic/roomle-sdk-wrapper";
1320
+ export const CONFIGURATOR_IDLE = "(idle)";
1321
+ export const getInitData: (useFallbackId?: boolean) => UiInitData;
1322
+ export const castAndFixInitData: (initData: UiInitData) => UiInitData;
1323
+ export const castInitData: (obj: {
1324
+ [key: string]: any;
1325
+ }) => void;
1326
+ export const mergeInitData: (configuratorSettings: ConfiguratorSettings | {
1327
+ id: string;
1328
+ settings: UiInitData;
1329
+ }, currentInitData: UiInitData) => UiInitData;
1330
+ export const getEmbeddingInitData: (messageHandler: MessageHandler) => Promise<UiInitData>;
1331
+ export const getRemoteInitData: (rapiAccess: RapiAccess, configuratorId: string) => Promise<UiInitData>;
1332
+ export const getFallbackInitData: () => UiInitData;
1333
+ export const LEGACY_SHARE_PLACEHOLDER = "<CONF_ID>";
1334
+ export const SHARE_PLACEHOLDER = "#CONFIGURATIONID#";
1335
+ /**
1336
+ * combines init data in this order: query params > embedding > remote > fallback
1337
+ *
1338
+ * some exceptions to consider:
1339
+ * - tenant: when do we need the tenant and where do we get it from?
1340
+ *
1341
+ * @param messageHandler
1342
+ * @param sdkWrapper
1343
+ * @param fallbackInitData
1344
+ */
1345
+ export const combineInitData: (messageHandler: Nullable<MessageHandler>, sdkWrapper: RoomleSdkWrapper, queryParamsInitData: UiInitData) => Promise<UiInitData>;
1346
+ export const setProperty: (o: {
1347
+ [key: string]: any;
1348
+ }, path: string, value: any) => void;
1349
+ }
1290
1350
  declare module "configurator/embedding/roomle-configurator-api" {
1291
1351
  import type { ExposedApi } from "configurator/embedding/exposed-api";
1292
1352
  import type { UiInitData } from "configurator/embedding/types";
1293
- import ConfiguratorUiCallbacks from '@roomle/web-sdk/lib/definitions/configurator-core/src/services/configurator-ui-callback';
1294
- import RoomleConfigurator from '@roomle/web-sdk/lib/definitions/configurator-core/src/roomle-configurator';
1295
- import { ExposedAnalyticsCallbacks } from "configurator/embedding/exposed-analytics-callbacks";
1296
- import RoomleGLBViewer from '@roomle/web-sdk/lib/definitions/glb-viewer-core/src/roomle-glb-viewer';
1297
- import RoomlePlanner from '@roomle/web-sdk/lib/definitions/planner-core/src/roomle-planner';
1298
- import { GlobalCallback } from '@roomle/web-sdk/lib/definitions/common-core/src/services/global-callback';
1353
+ import type ConfiguratorUiCallbacks from '@roomle/web-sdk/lib/definitions/configurator-core/src/services/configurator-ui-callback';
1354
+ import type RoomleConfigurator from '@roomle/web-sdk/lib/definitions/configurator-core/src/roomle-configurator';
1355
+ import type { ExposedAnalyticsCallbacks } from "configurator/embedding/exposed-analytics-callbacks";
1356
+ import type RoomleGLBViewer from '@roomle/web-sdk/lib/definitions/glb-viewer-core/src/roomle-glb-viewer';
1357
+ import type RoomlePlanner from '@roomle/web-sdk/lib/definitions/planner-core/src/roomle-planner';
1358
+ import type { GlobalCallback } from '@roomle/web-sdk/lib/definitions/common-core/src/services/global-callback';
1299
1359
  export interface RoomleEmbeddingApiKeys {
1300
1360
  extended: any;
1301
1361
  ui: any;