@roomle/embedding-lib 4.33.0 → 4.36.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 (54) 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 +62 -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 +37 -71
  12. package/docs/api/modules/roomle_configurator_api.md +3 -3
  13. package/docs/md/web/ui/EMBEDDING-CHANGELOG.md +12 -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 +368 -280
  21. package/types/src/common/business-logic/event-bus.d.ts +5 -0
  22. package/types/src/{configurator → common}/components/collection-view/-utils/types.d.ts +3 -3
  23. package/types/src/common/store/collection-view-state.d.ts +3 -2
  24. package/types/src/common/store/index.d.ts +16 -5
  25. package/types/src/common/utils/helper.d.ts +0 -20
  26. package/types/src/common/utils/merge.d.ts +16 -0
  27. package/types/src/common/utils/parameters.d.ts +2 -2
  28. package/types/src/common/utils/share.d.ts +1 -0
  29. package/types/src/common/utils/touch-drag.d.ts +8 -9
  30. package/types/src/common/utils/types.d.ts +2 -0
  31. package/types/src/common/utils/variants.d.ts +3 -0
  32. package/types/src/configurator/components/grid-view/-utils/GridViewHelper.d.ts +3 -3
  33. package/types/src/configurator/embedding/roomle-configurator-api.d.ts +6 -6
  34. package/types/src/configurator/embedding/types.d.ts +8 -1
  35. package/types/src/configurator/store/ui-state.d.ts +14 -6
  36. package/types/src/planner/business-logic/pre-defined-rooms.d.ts +2 -0
  37. package/types/src/planner/business-logic/rooms.d.ts +12 -0
  38. package/types/src/planner/store/planner-core-data.d.ts +21 -0
  39. package/types/src/planner/store/planner-ui-state.d.ts +22 -7
  40. package/types/src/planner/utils/planner-sidebar.d.ts +21 -0
  41. package/types/tests/helpers/data/items.d.ts +90 -0
  42. package/types/tests/helpers/data/plan.d.ts +224 -0
  43. package/types/tests/helpers/mocks/store.d.ts +2 -1
  44. package/types/tests/integration/{configurator/components/overlays/part-list/PartListPrint.spec.d.ts → common/components/BottomButtons.spec.d.ts} +0 -0
  45. package/types/tests/integration/{configurator/components/overlays/part-list/PartListRow.spec.d.ts → common/components/IconButton.spec.d.ts} +0 -0
  46. package/types/tests/integration/common/components/part-list/part-list/PartListPrint.spec.d.ts +1 -0
  47. package/types/tests/integration/common/components/part-list/part-list/PartListRow.spec.d.ts +1 -0
  48. package/types/tests/integration/configurator/components/overlays/PartList.spec.d.ts +1 -0
  49. package/types/tests/integration/planner/components/CatalogTrigger.spec.d.ts +1 -0
  50. package/types/tests/integration/planner/components/ProductListButton.spec.d.ts +1 -0
  51. package/types/tests/integration/planner/components/SampleRooms.spec.d.ts +1 -0
  52. package/types/tests/integration/planner/components/SelectionPreview.spec.d.ts +1 -0
  53. package/types/tests/integration/planner/components/overlays/product-list/ProductListEntry.spec.d.ts +1 -0
  54. package/types/tests/unit/common/business-logic/event-bus.spec.d.ts +1 -0
@@ -17,7 +17,6 @@
17
17
  ### Properties
18
18
 
19
19
  - [\_measureTraffic](types.UiInitData.md#_measuretraffic)
20
- - [addOnSpots](types.UiInitData.md#addonspots)
21
20
  - [alwaysUseCache](types.UiInitData.md#alwaysusecache)
22
21
  - [api](types.UiInitData.md#api)
23
22
  - [applyCurrentGlobalParameters](types.UiInitData.md#applycurrentglobalparameters)
@@ -58,7 +57,6 @@
58
57
  - [overrideRapi](types.UiInitData.md#overriderapi)
59
58
  - [overrideServerUrl](types.UiInitData.md#overrideserverurl)
60
59
  - [overrideTenant](types.UiInitData.md#overridetenant)
61
- - [plusInPreview](types.UiInitData.md#plusinpreview)
62
60
  - [precisionCm](types.UiInitData.md#precisioncm)
63
61
  - [precisionInch](types.UiInitData.md#precisioninch)
64
62
  - [preloadHint](types.UiInitData.md#preloadhint)
@@ -101,24 +99,6 @@ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:16
101
99
 
102
100
  ___
103
101
 
104
- ### addOnSpots
105
-
106
- • `Optional` **addOnSpots**: false \| true
107
-
108
- **`deprecated`**
109
- If set to true we are showing plus icon where addons can be added.
110
- This has to be scripted. For more information ask your Roomle contact.
111
-
112
- #### Inherited from
113
-
114
- InitDataDefinition.addOnSpots
115
-
116
- #### Defined in
117
-
118
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:194
119
-
120
- ___
121
-
122
102
  ### alwaysUseCache
123
103
 
124
104
  • `Optional` **alwaysUseCache**: false \| true
@@ -147,7 +127,7 @@ to view 3d content. Imagine it then as a <img> tag for 3d content
147
127
 
148
128
  #### Defined in
149
129
 
150
- [src/configurator/embedding/types.ts:86](https://gitlab.com/roomle/web/roomle-ui/-/blob/81cacdee/src/configurator/embedding/types.ts#L86)
130
+ [src/configurator/embedding/types.ts:90](https://gitlab.com/roomle/web/roomle-ui/-/blob/fdefa264/src/configurator/embedding/types.ts#L90)
151
131
 
152
132
  ___
153
133
 
@@ -164,7 +144,7 @@ InitDataDefinition.applyCurrentGlobalParameters
164
144
 
165
145
  #### Defined in
166
146
 
167
- [src/configurator/embedding/types.ts:133](https://gitlab.com/roomle/web/roomle-ui/-/blob/81cacdee/src/configurator/embedding/types.ts#L133)
147
+ [src/configurator/embedding/types.ts:137](https://gitlab.com/roomle/web/roomle-ui/-/blob/fdefa264/src/configurator/embedding/types.ts#L137)
168
148
 
169
149
  ___
170
150
 
@@ -200,7 +180,7 @@ InitDataDefinition.bananaForScale
200
180
 
201
181
  #### Defined in
202
182
 
203
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:253
183
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:242
204
184
 
205
185
  ___
206
186
 
@@ -212,6 +192,8 @@ ___
212
192
 
213
193
  | Name | Type |
214
194
  | :------ | :------ |
195
+ | `2dview?` | false \| true |
196
+ | `add_room?` | false \| true |
215
197
  | `addons?` | false \| true |
216
198
  | `ar?` | false \| true |
217
199
  | `dimensions?` | false \| true |
@@ -219,6 +201,7 @@ ___
219
201
  | `fullscreen?` | false \| true |
220
202
  | `multiselect?` | false \| true |
221
203
  | `partlist?` | false \| true |
204
+ | `partlist_planner?` | false \| true |
222
205
  | `pauseconfigure?` | false \| true |
223
206
  | `redo?` | false \| true |
224
207
  | `renderimage?` | false \| true |
@@ -231,7 +214,7 @@ ___
231
214
 
232
215
  #### Defined in
233
216
 
234
- [src/configurator/embedding/types.ts:38](https://gitlab.com/roomle/web/roomle-ui/-/blob/81cacdee/src/configurator/embedding/types.ts#L38)
217
+ [src/configurator/embedding/types.ts:39](https://gitlab.com/roomle/web/roomle-ui/-/blob/fdefa264/src/configurator/embedding/types.ts#L39)
235
218
 
236
219
  ___
237
220
 
@@ -249,7 +232,7 @@ InitDataDefinition.cameraRestriction
249
232
 
250
233
  #### Defined in
251
234
 
252
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:227
235
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:216
253
236
 
254
237
  ___
255
238
 
@@ -267,7 +250,7 @@ InitDataDefinition.cameraSpacing
267
250
 
268
251
  #### Defined in
269
252
 
270
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:279
253
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:268
271
254
 
272
255
  ___
273
256
 
@@ -362,7 +345,7 @@ usage: http://www.example.com/configurator?id=#CONFIGURATIONID#
362
345
 
363
346
  #### Defined in
364
347
 
365
- [src/configurator/embedding/types.ts:73](https://gitlab.com/roomle/web/roomle-ui/-/blob/81cacdee/src/configurator/embedding/types.ts#L73)
348
+ [src/configurator/embedding/types.ts:77](https://gitlab.com/roomle/web/roomle-ui/-/blob/fdefa264/src/configurator/embedding/types.ts#L77)
366
349
 
367
350
  ___
368
351
 
@@ -397,7 +380,7 @@ InitDataDefinition.dls
397
380
 
398
381
  #### Defined in
399
382
 
400
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:210
383
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:199
401
384
 
402
385
  ___
403
386
 
@@ -414,7 +397,7 @@ InitDataDefinition.edit
414
397
 
415
398
  #### Defined in
416
399
 
417
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:298
400
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:287
418
401
 
419
402
  ___
420
403
 
@@ -427,7 +410,7 @@ an e-mail
427
410
 
428
411
  #### Defined in
429
412
 
430
- [src/configurator/embedding/types.ts:91](https://gitlab.com/roomle/web/roomle-ui/-/blob/81cacdee/src/configurator/embedding/types.ts#L91)
413
+ [src/configurator/embedding/types.ts:95](https://gitlab.com/roomle/web/roomle-ui/-/blob/fdefa264/src/configurator/embedding/types.ts#L95)
431
414
 
432
415
  ___
433
416
 
@@ -441,7 +424,7 @@ so that we can ensure a smooth transition between different versions of our conf
441
424
 
442
425
  #### Defined in
443
426
 
444
- [src/configurator/embedding/types.ts:107](https://gitlab.com/roomle/web/roomle-ui/-/blob/81cacdee/src/configurator/embedding/types.ts#L107)
427
+ [src/configurator/embedding/types.ts:111](https://gitlab.com/roomle/web/roomle-ui/-/blob/fdefa264/src/configurator/embedding/types.ts#L111)
445
428
 
446
429
  ___
447
430
 
@@ -457,7 +440,7 @@ InitDataDefinition.floorMaterialsTag
457
440
 
458
441
  #### Defined in
459
442
 
460
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:215
443
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:204
461
444
 
462
445
  ___
463
446
 
@@ -469,7 +452,7 @@ set this flag to false if the user did not give the consent to Analytics
469
452
 
470
453
  #### Defined in
471
454
 
472
- [src/configurator/embedding/types.ts:111](https://gitlab.com/roomle/web/roomle-ui/-/blob/81cacdee/src/configurator/embedding/types.ts#L111)
455
+ [src/configurator/embedding/types.ts:115](https://gitlab.com/roomle/web/roomle-ui/-/blob/fdefa264/src/configurator/embedding/types.ts#L115)
473
456
 
474
457
  ___
475
458
 
@@ -481,7 +464,7 @@ set this flag to true if you want to group the part list by main components
481
464
 
482
465
  #### Defined in
483
466
 
484
- [src/configurator/embedding/types.ts:101](https://gitlab.com/roomle/web/roomle-ui/-/blob/81cacdee/src/configurator/embedding/types.ts#L101)
467
+ [src/configurator/embedding/types.ts:105](https://gitlab.com/roomle/web/roomle-ui/-/blob/fdefa264/src/configurator/embedding/types.ts#L105)
485
468
 
486
469
  ___
487
470
 
@@ -517,7 +500,7 @@ InitDataDefinition.initialFloorMaterial
517
500
 
518
501
  #### Defined in
519
502
 
520
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:204
503
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:193
521
504
 
522
505
  ___
523
506
 
@@ -565,7 +548,7 @@ InitDataDefinition.ls
565
548
 
566
549
  #### Defined in
567
550
 
568
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:211
551
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:200
569
552
 
570
553
  ___
571
554
 
@@ -583,7 +566,7 @@ InitDataDefinition.maxHorizontalCameraAngle
583
566
 
584
567
  #### Defined in
585
568
 
586
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:251
569
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:240
587
570
 
588
571
  ___
589
572
 
@@ -601,7 +584,7 @@ InitDataDefinition.maxVerticalCameraAngle
601
584
 
602
585
  #### Defined in
603
586
 
604
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:239
587
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:228
605
588
 
606
589
  ___
607
590
 
@@ -636,7 +619,7 @@ InitDataDefinition.minHorizontalCameraAngle
636
619
 
637
620
  #### Defined in
638
621
 
639
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:245
622
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:234
640
623
 
641
624
  ___
642
625
 
@@ -654,7 +637,7 @@ InitDataDefinition.minVerticalCameraAngle
654
637
 
655
638
  #### Defined in
656
639
 
657
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:233
640
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:222
658
641
 
659
642
  ___
660
643
 
@@ -668,7 +651,7 @@ small div
668
651
 
669
652
  #### Defined in
670
653
 
671
- [src/configurator/embedding/types.ts:97](https://gitlab.com/roomle/web/roomle-ui/-/blob/81cacdee/src/configurator/embedding/types.ts#L97)
654
+ [src/configurator/embedding/types.ts:101](https://gitlab.com/roomle/web/roomle-ui/-/blob/fdefa264/src/configurator/embedding/types.ts#L101)
672
655
 
673
656
  ___
674
657
 
@@ -688,7 +671,7 @@ InitDataDefinition.moc
688
671
 
689
672
  #### Defined in
690
673
 
691
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:306
674
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:295
692
675
 
693
676
  ___
694
677
 
@@ -707,7 +690,7 @@ InitDataDefinition.mode
707
690
 
708
691
  #### Defined in
709
692
 
710
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:293
693
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:282
711
694
 
712
695
  ___
713
696
 
@@ -789,7 +772,7 @@ ___
789
772
 
790
773
  #### Defined in
791
774
 
792
- [src/configurator/embedding/types.ts:59](https://gitlab.com/roomle/web/roomle-ui/-/blob/81cacdee/src/configurator/embedding/types.ts#L59)
775
+ [src/configurator/embedding/types.ts:63](https://gitlab.com/roomle/web/roomle-ui/-/blob/fdefa264/src/configurator/embedding/types.ts#L63)
793
776
 
794
777
  ___
795
778
 
@@ -813,23 +796,6 @@ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:23
813
796
 
814
797
  ___
815
798
 
816
- ### plusInPreview
817
-
818
- • `Optional` **plusInPreview**: false \| true
819
-
820
- **`deprecated`**
821
- If set to true we show a plus in the addon preview boxes.
822
-
823
- #### Inherited from
824
-
825
- InitDataDefinition.plusInPreview
826
-
827
- #### Defined in
828
-
829
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:199
830
-
831
- ___
832
-
833
799
  ### precisionCm
834
800
 
835
801
  • `Optional` **precisionCm**: `string`
@@ -921,7 +887,7 @@ for details see deeplink, the only change is that the placeholder is <CONF_ID> h
921
887
 
922
888
  #### Defined in
923
889
 
924
- [src/configurator/embedding/types.ts:64](https://gitlab.com/roomle/web/roomle-ui/-/blob/81cacdee/src/configurator/embedding/types.ts#L64)
890
+ [src/configurator/embedding/types.ts:68](https://gitlab.com/roomle/web/roomle-ui/-/blob/fdefa264/src/configurator/embedding/types.ts#L68)
925
891
 
926
892
  ___
927
893
 
@@ -956,7 +922,7 @@ InitDataDefinition.showInfos
956
922
 
957
923
  #### Defined in
958
924
 
959
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:264
925
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:253
960
926
 
961
927
  ___
962
928
 
@@ -973,7 +939,7 @@ InitDataDefinition.showPrice
973
939
 
974
940
  #### Defined in
975
941
 
976
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:269
942
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:258
977
943
 
978
944
  ___
979
945
 
@@ -983,7 +949,7 @@ ___
983
949
 
984
950
  #### Defined in
985
951
 
986
- [src/configurator/embedding/types.ts:56](https://gitlab.com/roomle/web/roomle-ui/-/blob/81cacdee/src/configurator/embedding/types.ts#L56)
952
+ [src/configurator/embedding/types.ts:60](https://gitlab.com/roomle/web/roomle-ui/-/blob/fdefa264/src/configurator/embedding/types.ts#L60)
987
953
 
988
954
  ___
989
955
 
@@ -1041,7 +1007,7 @@ You can find all labels here: [Base.json](../../../ui/base.json)
1041
1007
 
1042
1008
  #### Defined in
1043
1009
 
1044
- [src/configurator/embedding/types.ts:128](https://gitlab.com/roomle/web/roomle-ui/-/blob/81cacdee/src/configurator/embedding/types.ts#L128)
1010
+ [src/configurator/embedding/types.ts:132](https://gitlab.com/roomle/web/roomle-ui/-/blob/fdefa264/src/configurator/embedding/types.ts#L132)
1045
1011
 
1046
1012
  ___
1047
1013
 
@@ -1059,7 +1025,7 @@ InitDataDefinition.transparentHighlighting
1059
1025
 
1060
1026
  #### Defined in
1061
1027
 
1062
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:259
1028
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:248
1063
1029
 
1064
1030
  ___
1065
1031
 
@@ -1122,7 +1088,7 @@ ___
1122
1088
 
1123
1089
  #### Defined in
1124
1090
 
1125
- [src/configurator/embedding/types.ts:58](https://gitlab.com/roomle/web/roomle-ui/-/blob/81cacdee/src/configurator/embedding/types.ts#L58)
1091
+ [src/configurator/embedding/types.ts:62](https://gitlab.com/roomle/web/roomle-ui/-/blob/fdefa264/src/configurator/embedding/types.ts#L62)
1126
1092
 
1127
1093
  ___
1128
1094
 
@@ -1173,7 +1139,7 @@ usm:frame is loaded all the items from the tag "DB_Start_ohne_Element" are now s
1173
1139
 
1174
1140
  #### Defined in
1175
1141
 
1176
- [src/configurator/embedding/types.ts:80](https://gitlab.com/roomle/web/roomle-ui/-/blob/81cacdee/src/configurator/embedding/types.ts#L80)
1142
+ [src/configurator/embedding/types.ts:84](https://gitlab.com/roomle/web/roomle-ui/-/blob/fdefa264/src/configurator/embedding/types.ts#L84)
1177
1143
 
1178
1144
  ___
1179
1145
 
@@ -1183,7 +1149,7 @@ ___
1183
1149
 
1184
1150
  #### Defined in
1185
1151
 
1186
- [src/configurator/embedding/types.ts:57](https://gitlab.com/roomle/web/roomle-ui/-/blob/81cacdee/src/configurator/embedding/types.ts#L57)
1152
+ [src/configurator/embedding/types.ts:61](https://gitlab.com/roomle/web/roomle-ui/-/blob/fdefa264/src/configurator/embedding/types.ts#L61)
1187
1153
 
1188
1154
  ___
1189
1155
 
@@ -1201,4 +1167,4 @@ InitDataDefinition.zoomDistance
1201
1167
 
1202
1168
  #### Defined in
1203
1169
 
1204
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:221
1170
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:210
@@ -26,7 +26,7 @@
26
26
 
27
27
  #### Defined in
28
28
 
29
- [src/configurator/embedding/roomle-configurator-api.ts:69](https://gitlab.com/roomle/web/roomle-ui/-/blob/81cacdee/src/configurator/embedding/roomle-configurator-api.ts#L69)
29
+ [src/configurator/embedding/roomle-configurator-api.ts:70](https://gitlab.com/roomle/web/roomle-ui/-/blob/fdefa264/src/configurator/embedding/roomle-configurator-api.ts#L70)
30
30
 
31
31
  ___
32
32
 
@@ -36,7 +36,7 @@ ___
36
36
 
37
37
  #### Defined in
38
38
 
39
- [src/configurator/embedding/roomle-configurator-api.ts:71](https://gitlab.com/roomle/web/roomle-ui/-/blob/81cacdee/src/configurator/embedding/roomle-configurator-api.ts#L71)
39
+ [src/configurator/embedding/roomle-configurator-api.ts:72](https://gitlab.com/roomle/web/roomle-ui/-/blob/fdefa264/src/configurator/embedding/roomle-configurator-api.ts#L72)
40
40
 
41
41
  ___
42
42
 
@@ -46,4 +46,4 @@ ___
46
46
 
47
47
  #### Defined in
48
48
 
49
- [src/configurator/embedding/roomle-configurator-api.ts:70](https://gitlab.com/roomle/web/roomle-ui/-/blob/81cacdee/src/configurator/embedding/roomle-configurator-api.ts#L70)
49
+ [src/configurator/embedding/roomle-configurator-api.ts:71](https://gitlab.com/roomle/web/roomle-ui/-/blob/fdefa264/src/configurator/embedding/roomle-configurator-api.ts#L71)
@@ -1,32 +1,20 @@
1
- ## [4.33.0](https://gitlab.com/roomle/web/roomle-ui/compare/embedding-v4.32.0...embedding-v4.33.0) (2022-04-26)
1
+ ## [4.36.0](https://gitlab.com/roomle/web/roomle-ui/compare/embedding-v4.35.0...embedding-v4.36.0) (2022-06-07)
2
2
 
3
3
 
4
4
  ### Features
5
5
 
6
- * add actionButtons instead of selectionButtons in planner mode ([8e70298](https://gitlab.com/roomle/web/roomle-ui/commit/8e70298c3039b24c84a3157b8d7a7ee8085b7d8e))
7
- * add better responsivness to AddonsTrigger and MenuButton ([9f8fa5d](https://gitlab.com/roomle/web/roomle-ui/commit/9f8fa5dfbadfe4903365eb8e7442b05bfab15afd))
8
- * change t.t for translation service to intl.t for more readability ([22c5b09](https://gitlab.com/roomle/web/roomle-ui/commit/22c5b0916a5557e9a8ad7dd5f426c21eaf85b252))
9
- * implement add product button and change selection buttons styling ([7fcb65d](https://gitlab.com/roomle/web/roomle-ui/commit/7fcb65d0d3741d3c2b8cceef5321670f9388b085))
10
- * remove add product on open catalog, remove selection if catalog gets open and add product button label to loco ([36a9b77](https://gitlab.com/roomle/web/roomle-ui/commit/36a9b777bb8802428c5481b3c4665abf81788bda))
11
- * upgrade SDK to version 2.30.0-alpha.1 ([c9555dc](https://gitlab.com/roomle/web/roomle-ui/commit/c9555dcd4710c4d5ddb8b1f3ee5dd3cc265eb758))
12
- * **SDK:** upgrade to version 2.30.0 ([cd4f785](https://gitlab.com/roomle/web/roomle-ui/commit/cd4f78525ef61ad1bc3d5e5dc4c6fab1caa6fc99))
13
- * **SDK:** upgrade to version 2.30.0-alpha.2 ([d2e469f](https://gitlab.com/roomle/web/roomle-ui/commit/d2e469f063100ae43a685a9a8725929a2eb143ba))
14
- * **SDK:** upgrade to version 2.30.0-alpha.3 ([99d815a](https://gitlab.com/roomle/web/roomle-ui/commit/99d815a74b33fdf0960f40550366565da8e6e48f))
15
- * **SDK:** upgrade to version 2.30.0-alpha.4 ([b4654ff](https://gitlab.com/roomle/web/roomle-ui/commit/b4654ffdde96eb7cc580054e3dde0e0db44bf8aa))
6
+ * **SDK:** upgrade to version 2.33.0-alpha.1 ([fd60867](https://gitlab.com/roomle/web/roomle-ui/commit/fd6086715cabd6d1814f1555c07d9428d3c0e423))
7
+ * **SDK:** upgrade to version 2.33.0-alpha.2 ([6e395cd](https://gitlab.com/roomle/web/roomle-ui/commit/6e395cd0841d04065c6ce2e7b07eef65e1203427))
16
8
 
17
9
 
18
10
  ### Bug Fixes
19
11
 
20
- * add stroke width to the svg's directly ([bda68dd](https://gitlab.com/roomle/web/roomle-ui/commit/bda68dd55b89c52977b6da4a885659d70f24fe4c))
21
- * addons trigger button should be displayed right on mobile ([2631cdc](https://gitlab.com/roomle/web/roomle-ui/commit/2631cdc0d54e1218f0e3522cec9cb432def9b302))
22
- * call checkGlb to fix broken embedding lib ([419137f](https://gitlab.com/roomle/web/roomle-ui/commit/419137fd77357f6d580dac01285fed781741d492))
23
- * call clear history on back button press ([2577e79](https://gitlab.com/roomle/web/roomle-ui/commit/2577e79bd74f5cf4734bd8a34ef06070e8d2126a))
24
- * deselect all items if undo or redo is called ([758fc37](https://gitlab.com/roomle/web/roomle-ui/commit/758fc3779e572118c76d410a368b1586344b639a))
25
- * do not send images to Cloudinary which are not accessible ([8758fcf](https://gitlab.com/roomle/web/roomle-ui/commit/8758fcf70718e94311f8d67b319d53857216a122))
26
- * failing test ([9985ced](https://gitlab.com/roomle/web/roomle-ui/commit/9985ced693718b8d052116e1ee25f875c9d274d2))
27
- * finish loading after loading static item ([476a307](https://gitlab.com/roomle/web/roomle-ui/commit/476a3071b181292a5e306cf5ab784e47d1b50f66))
28
- * if not desktop fullscreen mode should be disabled but interaction menu expand on toggle ([4487fbe](https://gitlab.com/roomle/web/roomle-ui/commit/4487fbe9534bbcfd6d9de3ebfc612a2976024d10))
29
- * import package json version directly ([44c8f94](https://gitlab.com/roomle/web/roomle-ui/commit/44c8f94bcadaa0d0443b8b738602fa4c4fff7909))
30
- * responsive issues of addonsTrigger button and selectionbuttons ([5551d57](https://gitlab.com/roomle/web/roomle-ui/commit/5551d5701886fc8b73d1c7187eeefcc702db9e9c))
31
- * show correct versions of UI and SDK ([e852a52](https://gitlab.com/roomle/web/roomle-ui/commit/e852a521b1db4be029c639d0a8e71bfe665d8c86))
32
- * wrong svg stroke width ([ee93532](https://gitlab.com/roomle/web/roomle-ui/commit/ee93532ca05c18a4884c391708eedeb1dc1f1fbb))
12
+ * adding product should not close sidebar ([8cbae81](https://gitlab.com/roomle/web/roomle-ui/commit/8cbae81762d142b2180b0322fbc5be65c28930fb))
13
+ * addonTrigger button is not centred inside configurator ([06f014d](https://gitlab.com/roomle/web/roomle-ui/commit/06f014da26ef16f55f93a7f6ce71967fa8c4ef4c))
14
+ * don't add products double on mobile drag in ([c93a982](https://gitlab.com/roomle/web/roomle-ui/commit/c93a982f84d5f2813739bdcf99ea4d1ddc168654))
15
+ * es-lint warnings ([cb027c9](https://gitlab.com/roomle/web/roomle-ui/commit/cb027c9239987416ea30ddae58c10527762b5cf8))
16
+ * next action button not centered in sidebar ([bae116d](https://gitlab.com/roomle/web/roomle-ui/commit/bae116d305e73aa357927b6a5a49d3b08da2eb4f))
17
+ * preview selection always show configuration ([19cd7f3](https://gitlab.com/roomle/web/roomle-ui/commit/19cd7f38b957703bfe5036843d97e486ddd11813))
18
+ * should drag item in scene only on longTouch on mobile, activate fullscreen when drag item ([86bff9b](https://gitlab.com/roomle/web/roomle-ui/commit/86bff9bf0c227e3d379252b78192fb0ea18e016e))
19
+ * tslint error ([60bdf3f](https://gitlab.com/roomle/web/roomle-ui/commit/60bdf3f2544e63b7b6368f4735d98c215d3ebb3a))
20
+ * use correct names ([2fab753](https://gitlab.com/roomle/web/roomle-ui/commit/2fab753afe9770b0aac2f1a866746a6324b56e7b))
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@roomle/embedding-lib",
3
- "version": "4.33.0",
3
+ "version": "4.36.0",
4
4
  "main": "roomle-configurator-api.es.min.js",
5
5
  "types": "types/index.d.ts",
6
6
  "author": "Roomle Development",
7
7
  "dependencies": {
8
- "@roomle/web-sdk": "2.30.0"
8
+ "@roomle/web-sdk": "2.33.0-alpha.2"
9
9
  },
10
10
  "devDependencies": {
11
11
  "@semantic-release/changelog": "^5.0.1",
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- require('@/common/styles/Global.module.scss');
4
-
5
3
  class MessageHandler {
6
4
  constructor(side, incomingMessageBus, outgoingMessageBus, messageExecution) {
7
5
  this._outgoingMessageBus = null;
@@ -164,50 +162,36 @@ const isInIframe = () => {
164
162
  }
165
163
  };
166
164
 
167
- // see why: so#/58065241/10800831
168
- const isAndroid = () => /(android)/i.test(navigator.userAgent);
169
-
170
- /* TO DOs in Google Analytics Admin UI
171
-
172
- To track the Hit ID, Hit Time, and Hit Type and custom dimensions, first create them in Google Analytics
173
- and set their scope to "Hit"
174
-
175
- Once you've created the custom metrics in Google Analytics
176
- (and set their scope to "Hit" and their formatting type to "Integer")
177
- this setup is ready to go. You need to do this in every GA property
178
-
179
- For more details see: https://philipwalton.com/articles/the-google-analytics-setup-i-use-on-every-site-i-build/
180
-
181
- */
182
- // Probably we could add const enums here
183
- // but we need to investigate: https://roomle.atlassian.net/browse/CONF-238
184
- var GA_CUSTOM;
185
- (function (GA_CUSTOM) {
186
- GA_CUSTOM["DIMENSION"] = "dimension";
187
- GA_CUSTOM["METRIC"] = "metric";
188
- })(GA_CUSTOM || (GA_CUSTOM = {}));
189
- var GA_HIT_TYPE;
190
- (function (GA_HIT_TYPE) {
191
- GA_HIT_TYPE["EVENT"] = "event";
192
- })(GA_HIT_TYPE || (GA_HIT_TYPE = {}));
193
- var GA_ACTION_TYPE;
194
- (function (GA_ACTION_TYPE) {
195
- GA_ACTION_TYPE["EXCEPTION"] = "exception";
196
- GA_ACTION_TYPE["TIMING"] = "timing_complete";
197
- })(GA_ACTION_TYPE || (GA_ACTION_TYPE = {}));
198
- var CUSTOM_ACTION_TYPE;
199
- (function (CUSTOM_ACTION_TYPE) {
200
- CUSTOM_ACTION_TYPE["TRACK_TIMING"] = "track_timing";
201
- })(CUSTOM_ACTION_TYPE || (CUSTOM_ACTION_TYPE = {}));
202
- var GA_CATEGORY;
203
- (function (GA_CATEGORY) {
204
- GA_CATEGORY["ERROR"] = "Error";
205
- GA_CATEGORY["NAVIGATION_TIMING"] = "Navigation Timing";
206
- GA_CATEGORY["TIMING"] = "Timing";
207
- GA_CATEGORY["INTERACTION"] = "Interaction";
208
- GA_CATEGORY["TRACKING"] = "Tracking";
209
- GA_CATEGORY["DEPRECATION"] = "Deprecation";
210
- })(GA_CATEGORY || (GA_CATEGORY = {}));
165
+ const NAMES_FOR_LOCALHOST = [
166
+ '127.0.0.1',
167
+ 'localhost',
168
+ '0.0.0.0',
169
+ ];
170
+ const getHostname = () => {
171
+ const isIframe = isInIframe();
172
+ let url = window.location.href;
173
+ if (isIframe) {
174
+ if (!document.referrer) {
175
+ return null;
176
+ }
177
+ url = document.referrer;
178
+ }
179
+ const { hostname } = new URL(url);
180
+ return hostname;
181
+ };
182
+ const isDemoHostname = (hostname) => {
183
+ if (NAMES_FOR_LOCALHOST.includes(hostname)) {
184
+ return true;
185
+ }
186
+ if (hostname.endsWith('roomle.com')) {
187
+ return true;
188
+ }
189
+ // exception for CI builds
190
+ if (hostname.endsWith('gitlab.io') || hostname.endsWith('gitlab.com')) {
191
+ return true;
192
+ }
193
+ return false;
194
+ };
211
195
 
212
196
  /**
213
197
  * Recursively merge properties of two objects.
@@ -245,36 +229,6 @@ const deepMerge = (obj1, obj2) => {
245
229
  }
246
230
  }
247
231
  return obj1;
248
- };
249
- const NAMES_FOR_LOCALHOST = [
250
- '127.0.0.1',
251
- 'localhost',
252
- '0.0.0.0',
253
- ];
254
- const getHostname = () => {
255
- const isIframe = isInIframe();
256
- let url = window.location.href;
257
- if (isIframe) {
258
- if (!document.referrer) {
259
- return null;
260
- }
261
- url = document.referrer;
262
- }
263
- const { hostname } = new URL(url);
264
- return hostname;
265
- };
266
- const isDemoHostname = (hostname) => {
267
- if (NAMES_FOR_LOCALHOST.includes(hostname)) {
268
- return true;
269
- }
270
- if (hostname.endsWith('roomle.com')) {
271
- return true;
272
- }
273
- // exception for CI builds
274
- if (hostname.endsWith('gitlab.io') || hostname.endsWith('gitlab.com')) {
275
- return true;
276
- }
277
- return false;
278
232
  };
279
233
 
280
234
  const BROWSER_LANGUAGE_PROPERTY_KEYS_KNOWN = ['language', 'browserLanguage', 'userLanguage', 'systemLanguage'];
@@ -361,6 +315,9 @@ const getFallbackInitData = () => {
361
315
  const LEGACY_SHARE_PLACEHOLDER = '<CONF_ID>';
362
316
  const SHARE_PLACEHOLDER = '#CONFIGURATIONID#';
363
317
 
318
+ // see why: so#/58065241/10800831
319
+ const isAndroid = () => /(android)/i.test(navigator.userAgent);
320
+
364
321
  const setDefaultBehaviour = (object, callbackName, defaultBehaviour) => {
365
322
  let customBehaviour = null;
366
323
  Object.defineProperty(object, callbackName, {
@@ -1 +1 @@
1
- "use strict";require("@/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;module.exports=class{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')}};
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=["127.0.0.1","localhost","0.0.0.0"],r=(t,e)=>{for(const s in e)try{e[s].constructor===Object?t[s]=r(t[s],e[s]):t[s]=e[s]}catch(r){t[s]=e[s]}return t},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=r((()=>{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 r=(()=>{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 r&&(t=>!!e.includes(t)||!!t.endsWith("roomle.com")||!(!t.endsWith("gitlab.io")&&!t.endsWith("gitlab.com")))(r)&&(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,e)=>{e.configuratorId=t.id;const s=t.settings||{};return!e.overrideTenant&&t.tenant&&(e.overrideTenant=t.tenant),((t,e)=>{const s=JSON.parse(JSON.stringify(t));return r(s,e)})(s,e)})(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')}};