@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
@@ -31,6 +31,7 @@
31
31
  - [customApiUrl](types.UiInitData.md#customapiurl)
32
32
  - [debug](types.UiInitData.md#debug)
33
33
  - [deeplink](types.UiInitData.md#deeplink)
34
+ - [disableEnvMap](types.UiInitData.md#disableenvmap)
34
35
  - [dls](types.UiInitData.md#dls)
35
36
  - [edit](types.UiInitData.md#edit)
36
37
  - [emails](types.UiInitData.md#emails)
@@ -114,7 +115,7 @@ InitDataDefinition.addOnSpots
114
115
 
115
116
  #### Defined in
116
117
 
117
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:189
118
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:194
118
119
 
119
120
  ___
120
121
 
@@ -146,7 +147,7 @@ to view 3d content. Imagine it then as a <img> tag for 3d content
146
147
 
147
148
  #### Defined in
148
149
 
149
- [src/configurator/embedding/types.ts:80](https://gitlab.com/roomle/web/roomle-ui/-/blob/5c482b70/src/configurator/embedding/types.ts#L80)
150
+ [src/configurator/embedding/types.ts:86](https://gitlab.com/roomle/web/roomle-ui/-/blob/353723c4/src/configurator/embedding/types.ts#L86)
150
151
 
151
152
  ___
152
153
 
@@ -163,7 +164,7 @@ InitDataDefinition.applyCurrentGlobalParameters
163
164
 
164
165
  #### Defined in
165
166
 
166
- [src/configurator/embedding/types.ts:127](https://gitlab.com/roomle/web/roomle-ui/-/blob/5c482b70/src/configurator/embedding/types.ts#L127)
167
+ [src/configurator/embedding/types.ts:133](https://gitlab.com/roomle/web/roomle-ui/-/blob/353723c4/src/configurator/embedding/types.ts#L133)
167
168
 
168
169
  ___
169
170
 
@@ -199,7 +200,7 @@ InitDataDefinition.bananaForScale
199
200
 
200
201
  #### Defined in
201
202
 
202
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:248
203
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:253
203
204
 
204
205
  ___
205
206
 
@@ -219,15 +220,18 @@ ___
219
220
  | `multiselect?` | false \| true |
220
221
  | `partlist?` | false \| true |
221
222
  | `pauseconfigure?` | false \| true |
223
+ | `redo?` | false \| true |
222
224
  | `renderimage?` | false \| true |
223
225
  | `requestproduct?` | false \| true |
224
226
  | `resetcamera?` | false \| true |
225
227
  | `savedraft?` | false \| true |
228
+ | `snapping?` | false \| true |
226
229
  | `startconfigure?` | false \| true |
230
+ | `undo?` | false \| true |
227
231
 
228
232
  #### Defined in
229
233
 
230
- [src/configurator/embedding/types.ts:35](https://gitlab.com/roomle/web/roomle-ui/-/blob/5c482b70/src/configurator/embedding/types.ts#L35)
234
+ [src/configurator/embedding/types.ts:38](https://gitlab.com/roomle/web/roomle-ui/-/blob/353723c4/src/configurator/embedding/types.ts#L38)
231
235
 
232
236
  ___
233
237
 
@@ -245,7 +249,7 @@ InitDataDefinition.cameraRestriction
245
249
 
246
250
  #### Defined in
247
251
 
248
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:222
252
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:227
249
253
 
250
254
  ___
251
255
 
@@ -263,7 +267,7 @@ InitDataDefinition.cameraSpacing
263
267
 
264
268
  #### Defined in
265
269
 
266
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:274
270
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:279
267
271
 
268
272
  ___
269
273
 
@@ -358,7 +362,24 @@ usage: http://www.example.com/configurator?id=#CONFIGURATIONID#
358
362
 
359
363
  #### Defined in
360
364
 
361
- [src/configurator/embedding/types.ts:67](https://gitlab.com/roomle/web/roomle-ui/-/blob/5c482b70/src/configurator/embedding/types.ts#L67)
365
+ [src/configurator/embedding/types.ts:73](https://gitlab.com/roomle/web/roomle-ui/-/blob/353723c4/src/configurator/embedding/types.ts#L73)
366
+
367
+ ___
368
+
369
+ ### disableEnvMap
370
+
371
+ • `Optional` **disableEnvMap**: false \| true
372
+
373
+ **`internal`**
374
+ If set to true, it will disable the environment map completely
375
+
376
+ #### Inherited from
377
+
378
+ InitDataDefinition.disableEnvMap
379
+
380
+ #### Defined in
381
+
382
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:181
362
383
 
363
384
  ___
364
385
 
@@ -376,7 +397,7 @@ InitDataDefinition.dls
376
397
 
377
398
  #### Defined in
378
399
 
379
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:205
400
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:210
380
401
 
381
402
  ___
382
403
 
@@ -393,7 +414,7 @@ InitDataDefinition.edit
393
414
 
394
415
  #### Defined in
395
416
 
396
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:288
417
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:298
397
418
 
398
419
  ___
399
420
 
@@ -406,7 +427,7 @@ an e-mail
406
427
 
407
428
  #### Defined in
408
429
 
409
- [src/configurator/embedding/types.ts:85](https://gitlab.com/roomle/web/roomle-ui/-/blob/5c482b70/src/configurator/embedding/types.ts#L85)
430
+ [src/configurator/embedding/types.ts:91](https://gitlab.com/roomle/web/roomle-ui/-/blob/353723c4/src/configurator/embedding/types.ts#L91)
410
431
 
411
432
  ___
412
433
 
@@ -420,7 +441,7 @@ so that we can ensure a smooth transition between different versions of our conf
420
441
 
421
442
  #### Defined in
422
443
 
423
- [src/configurator/embedding/types.ts:101](https://gitlab.com/roomle/web/roomle-ui/-/blob/5c482b70/src/configurator/embedding/types.ts#L101)
444
+ [src/configurator/embedding/types.ts:107](https://gitlab.com/roomle/web/roomle-ui/-/blob/353723c4/src/configurator/embedding/types.ts#L107)
424
445
 
425
446
  ___
426
447
 
@@ -436,7 +457,7 @@ InitDataDefinition.floorMaterialsTag
436
457
 
437
458
  #### Defined in
438
459
 
439
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:210
460
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:215
440
461
 
441
462
  ___
442
463
 
@@ -448,7 +469,7 @@ set this flag to false if the user did not give the consent to Analytics
448
469
 
449
470
  #### Defined in
450
471
 
451
- [src/configurator/embedding/types.ts:105](https://gitlab.com/roomle/web/roomle-ui/-/blob/5c482b70/src/configurator/embedding/types.ts#L105)
472
+ [src/configurator/embedding/types.ts:111](https://gitlab.com/roomle/web/roomle-ui/-/blob/353723c4/src/configurator/embedding/types.ts#L111)
452
473
 
453
474
  ___
454
475
 
@@ -460,7 +481,7 @@ set this flag to true if you want to group the part list by main components
460
481
 
461
482
  #### Defined in
462
483
 
463
- [src/configurator/embedding/types.ts:95](https://gitlab.com/roomle/web/roomle-ui/-/blob/5c482b70/src/configurator/embedding/types.ts#L95)
484
+ [src/configurator/embedding/types.ts:101](https://gitlab.com/roomle/web/roomle-ui/-/blob/353723c4/src/configurator/embedding/types.ts#L101)
464
485
 
465
486
  ___
466
487
 
@@ -496,7 +517,7 @@ InitDataDefinition.initialFloorMaterial
496
517
 
497
518
  #### Defined in
498
519
 
499
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:199
520
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:204
500
521
 
501
522
  ___
502
523
 
@@ -544,7 +565,7 @@ InitDataDefinition.ls
544
565
 
545
566
  #### Defined in
546
567
 
547
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:206
568
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:211
548
569
 
549
570
  ___
550
571
 
@@ -562,7 +583,7 @@ InitDataDefinition.maxHorizontalCameraAngle
562
583
 
563
584
  #### Defined in
564
585
 
565
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:246
586
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:251
566
587
 
567
588
  ___
568
589
 
@@ -580,7 +601,7 @@ InitDataDefinition.maxVerticalCameraAngle
580
601
 
581
602
  #### Defined in
582
603
 
583
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:234
604
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:239
584
605
 
585
606
  ___
586
607
 
@@ -615,7 +636,7 @@ InitDataDefinition.minHorizontalCameraAngle
615
636
 
616
637
  #### Defined in
617
638
 
618
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:240
639
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:245
619
640
 
620
641
  ___
621
642
 
@@ -633,7 +654,7 @@ InitDataDefinition.minVerticalCameraAngle
633
654
 
634
655
  #### Defined in
635
656
 
636
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:228
657
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:233
637
658
 
638
659
  ___
639
660
 
@@ -647,7 +668,7 @@ small div
647
668
 
648
669
  #### Defined in
649
670
 
650
- [src/configurator/embedding/types.ts:91](https://gitlab.com/roomle/web/roomle-ui/-/blob/5c482b70/src/configurator/embedding/types.ts#L91)
671
+ [src/configurator/embedding/types.ts:97](https://gitlab.com/roomle/web/roomle-ui/-/blob/353723c4/src/configurator/embedding/types.ts#L97)
651
672
 
652
673
  ___
653
674
 
@@ -667,7 +688,7 @@ InitDataDefinition.moc
667
688
 
668
689
  #### Defined in
669
690
 
670
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:296
691
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:306
671
692
 
672
693
  ___
673
694
 
@@ -686,7 +707,7 @@ InitDataDefinition.mode
686
707
 
687
708
  #### Defined in
688
709
 
689
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:283
710
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:293
690
711
 
691
712
  ___
692
713
 
@@ -703,7 +724,7 @@ InitDataDefinition.offlineSync
703
724
 
704
725
  #### Defined in
705
726
 
706
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:183
727
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:188
707
728
 
708
729
  ___
709
730
 
@@ -768,7 +789,7 @@ ___
768
789
 
769
790
  #### Defined in
770
791
 
771
- [src/configurator/embedding/types.ts:53](https://gitlab.com/roomle/web/roomle-ui/-/blob/5c482b70/src/configurator/embedding/types.ts#L53)
792
+ [src/configurator/embedding/types.ts:59](https://gitlab.com/roomle/web/roomle-ui/-/blob/353723c4/src/configurator/embedding/types.ts#L59)
772
793
 
773
794
  ___
774
795
 
@@ -805,7 +826,7 @@ InitDataDefinition.plusInPreview
805
826
 
806
827
  #### Defined in
807
828
 
808
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:194
829
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:199
809
830
 
810
831
  ___
811
832
 
@@ -900,7 +921,7 @@ for details see deeplink, the only change is that the placeholder is <CONF_ID> h
900
921
 
901
922
  #### Defined in
902
923
 
903
- [src/configurator/embedding/types.ts:58](https://gitlab.com/roomle/web/roomle-ui/-/blob/5c482b70/src/configurator/embedding/types.ts#L58)
924
+ [src/configurator/embedding/types.ts:64](https://gitlab.com/roomle/web/roomle-ui/-/blob/353723c4/src/configurator/embedding/types.ts#L64)
904
925
 
905
926
  ___
906
927
 
@@ -935,7 +956,7 @@ InitDataDefinition.showInfos
935
956
 
936
957
  #### Defined in
937
958
 
938
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:259
959
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:264
939
960
 
940
961
  ___
941
962
 
@@ -952,7 +973,7 @@ InitDataDefinition.showPrice
952
973
 
953
974
  #### Defined in
954
975
 
955
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:264
976
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:269
956
977
 
957
978
  ___
958
979
 
@@ -962,7 +983,7 @@ ___
962
983
 
963
984
  #### Defined in
964
985
 
965
- [src/configurator/embedding/types.ts:50](https://gitlab.com/roomle/web/roomle-ui/-/blob/5c482b70/src/configurator/embedding/types.ts#L50)
986
+ [src/configurator/embedding/types.ts:56](https://gitlab.com/roomle/web/roomle-ui/-/blob/353723c4/src/configurator/embedding/types.ts#L56)
966
987
 
967
988
  ___
968
989
 
@@ -1020,7 +1041,7 @@ You can find all labels here: [Base.json](../../../ui/base.json)
1020
1041
 
1021
1042
  #### Defined in
1022
1043
 
1023
- [src/configurator/embedding/types.ts:122](https://gitlab.com/roomle/web/roomle-ui/-/blob/5c482b70/src/configurator/embedding/types.ts#L122)
1044
+ [src/configurator/embedding/types.ts:128](https://gitlab.com/roomle/web/roomle-ui/-/blob/353723c4/src/configurator/embedding/types.ts#L128)
1024
1045
 
1025
1046
  ___
1026
1047
 
@@ -1038,7 +1059,7 @@ InitDataDefinition.transparentHighlighting
1038
1059
 
1039
1060
  #### Defined in
1040
1061
 
1041
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:254
1062
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:259
1042
1063
 
1043
1064
  ___
1044
1065
 
@@ -1101,7 +1122,7 @@ ___
1101
1122
 
1102
1123
  #### Defined in
1103
1124
 
1104
- [src/configurator/embedding/types.ts:52](https://gitlab.com/roomle/web/roomle-ui/-/blob/5c482b70/src/configurator/embedding/types.ts#L52)
1125
+ [src/configurator/embedding/types.ts:58](https://gitlab.com/roomle/web/roomle-ui/-/blob/353723c4/src/configurator/embedding/types.ts#L58)
1105
1126
 
1106
1127
  ___
1107
1128
 
@@ -1152,7 +1173,7 @@ usm:frame is loaded all the items from the tag "DB_Start_ohne_Element" are now s
1152
1173
 
1153
1174
  #### Defined in
1154
1175
 
1155
- [src/configurator/embedding/types.ts:74](https://gitlab.com/roomle/web/roomle-ui/-/blob/5c482b70/src/configurator/embedding/types.ts#L74)
1176
+ [src/configurator/embedding/types.ts:80](https://gitlab.com/roomle/web/roomle-ui/-/blob/353723c4/src/configurator/embedding/types.ts#L80)
1156
1177
 
1157
1178
  ___
1158
1179
 
@@ -1162,7 +1183,7 @@ ___
1162
1183
 
1163
1184
  #### Defined in
1164
1185
 
1165
- [src/configurator/embedding/types.ts:51](https://gitlab.com/roomle/web/roomle-ui/-/blob/5c482b70/src/configurator/embedding/types.ts#L51)
1186
+ [src/configurator/embedding/types.ts:57](https://gitlab.com/roomle/web/roomle-ui/-/blob/353723c4/src/configurator/embedding/types.ts#L57)
1166
1187
 
1167
1188
  ___
1168
1189
 
@@ -1180,4 +1201,4 @@ InitDataDefinition.zoomDistance
1180
1201
 
1181
1202
  #### Defined in
1182
1203
 
1183
- node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:216
1204
+ node_modules/@roomle/web-sdk/lib/definitions/common-core/src/utils/shims.d.ts:221
@@ -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/5c482b70/src/configurator/embedding/roomle-configurator-api.ts#L69)
29
+ [src/configurator/embedding/roomle-configurator-api.ts:69](https://gitlab.com/roomle/web/roomle-ui/-/blob/353723c4/src/configurator/embedding/roomle-configurator-api.ts#L69)
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/5c482b70/src/configurator/embedding/roomle-configurator-api.ts#L71)
39
+ [src/configurator/embedding/roomle-configurator-api.ts:71](https://gitlab.com/roomle/web/roomle-ui/-/blob/353723c4/src/configurator/embedding/roomle-configurator-api.ts#L71)
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/5c482b70/src/configurator/embedding/roomle-configurator-api.ts#L70)
49
+ [src/configurator/embedding/roomle-configurator-api.ts:70](https://gitlab.com/roomle/web/roomle-ui/-/blob/353723c4/src/configurator/embedding/roomle-configurator-api.ts#L70)
package/docs/index.md CHANGED
@@ -384,6 +384,8 @@ export enum UI_BUTTON {
384
384
  PAUSECONFIGURE = 'pauseconfigure',
385
385
  EXPORT_3D = 'export3d',
386
386
  ROTATE = 'rotate',
387
+ UNDO = 'undo',
388
+ REDO = 'redo'
387
389
  }
388
390
  ```
389
391
 
@@ -783,10 +785,39 @@ To see which labels exist you can take a look at the [API documentation](./api/i
783
785
  You can test and play around with those settings in this CodeSandbox:
784
786
  [![Edit intelligent-merkle-s589m](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/intelligent-merkle-s589m?fontsize=14&hidenavigation=1&theme=dark)
785
787
 
788
+ ### Implementing a custom share pop up
789
+
790
+ If you want to fully customize the share experience of your users you can do this by implementing your own pop-up. Therefore you need to apply the knowledge you already have from the section ["React on button clicks"](#react-on-button-clicks). In that specific case you need to wait for the click on the button `savedraft`. Since you want to implement your own share logic you just need to return `true` to indicate that you want to disable the default behavior. Now the event "click savedraft" is your hook to execute your own logic. This can vary widely depending on what you want to do but a very basic idea and gist is implemented inside the following CodeSandbox:
791
+
792
+ [![Edit custom-share-functionality-gou3u](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/custom-share-functionality-gou3u?file=/index.js?fontsize=14&hidenavigation=1&theme=dark)
793
+
786
794
  ### Customize/change the UI
787
795
 
788
796
  Learn more about UI elements and how to change them in the configurator tutorial about [UI Customization](../guides/tutorial/configurator/08_UI_customization.html).
789
797
 
798
+ ### Image of current configuration/product
799
+
800
+ There are two ways to get an image/render of the current configuration shown in the Rubens configurator:
801
+
802
+ - 3D / Perspective Image
803
+ - 2D / Top Image
804
+
805
+ If you are using the SDK you can use [preparePerspectiveImage](../api/classes/roomleconfigurator.html#prepareperspectiveimage) or [prepareTopImage](../api/classes/roomleconfigurator.html#preparetopimage) directly on the `RoomleConfigurator` instance.
806
+
807
+ In case you are using the `EmbeddingLib`, you can use those calls on the `extended` object of the interface. For example:
808
+
809
+ ```JavaScript
810
+ const configurator = await RoomleConfiguratorApi.create(
811
+ 'demoConfigurator',
812
+ document.getElementById('configurator-container'),
813
+ {...options}
814
+ );
815
+ const base64Image = await configurator.extended.preparePerspectiveImage({
816
+ showDimensions: true
817
+ });
818
+ ```
819
+
820
+
790
821
  <!---
791
822
  ### Multiple objects
792
823
 
@@ -1,13 +1,11 @@
1
- ### [4.24.1-alpha.1](https://gitlab.com/roomle/web/roomle-ui/compare/embedding-v4.24.0...embedding-v4.24.1-alpha.1) (2021-11-29)
1
+ ## [4.25.0-alpha.2](https://gitlab.com/roomle/web/roomle-ui/compare/embedding-v4.25.0-alpha.1...embedding-v4.25.0-alpha.2) (2022-04-08)
2
2
 
3
3
 
4
- ### Bug Fixes
5
-
6
- * do not swallow loading errors resolves RML-2843 ([888f322](https://gitlab.com/roomle/web/roomle-ui/commit/888f3221e39d07d1c58e10bae7c26a5a5caae7bb))
4
+ ### Features
7
5
 
8
- ## [4.24.0-alpha.5](https://gitlab.com/roomle/web/roomle-ui/compare/embedding-v4.24.0-alpha.4...embedding-v4.24.0-alpha.5) (2021-11-23)
6
+ * upgrade SDK to version 2.29.0-alpha.2 ([894f169](https://gitlab.com/roomle/web/roomle-ui/commit/894f1692026104759ef28fe78db12f373222c3d4))
9
7
 
10
8
 
11
- ### Features
9
+ ### Bug Fixes
12
10
 
13
- * upgrade SDK to version 2.19.0 ([34c7760](https://gitlab.com/roomle/web/roomle-ui/commit/34c7760ec4877beef0e6645f9e12e466de185f08))
11
+ * also return on global callbacks ([e476c6b](https://gitlab.com/roomle/web/roomle-ui/commit/e476c6ba9e8c6d57dff44ab4fefebe05e84b32bb))
package/package.json CHANGED
@@ -1 +1,28 @@
1
- {"name":"@roomle/embedding-lib","version":"4.24.1-alpha.1","main":"roomle-configurator-api.es.min.js","types":"types/index.d.ts","author":"Roomle Development","dependencies":{"@roomle/web-sdk":"2.19.0"},"devDependencies":{"@semantic-release/changelog":"^5.0.1","@semantic-release/exec":"^5.0.0","conventional-changelog-conventionalcommits":"^4.2.3","semantic-release":"^17.0.7"},"scripts":{"release":"semantic-release"},"description":"This is a small library which can be used to communicate with the Roomle Configurator","repository":{"type":"git","url":"git+https://github.com/roomle-build/npm-packages.git"},"publishConfig":{"access":"public"},"license":"MIT"}
1
+ {
2
+ "name": "@roomle/embedding-lib",
3
+ "version": "4.25.0-alpha.2",
4
+ "main": "roomle-configurator-api.es.min.js",
5
+ "types": "types/index.d.ts",
6
+ "author": "Roomle Development",
7
+ "dependencies": {
8
+ "@roomle/web-sdk": "2.29.0-alpha.2"
9
+ },
10
+ "devDependencies": {
11
+ "@semantic-release/changelog": "^5.0.1",
12
+ "@semantic-release/exec": "^5.0.0",
13
+ "conventional-changelog-conventionalcommits": "^4.2.3",
14
+ "semantic-release": "^17.0.7"
15
+ },
16
+ "scripts": {
17
+ "release": "semantic-release"
18
+ },
19
+ "description": "This is a small library which can be used to communicate with the Roomle Configurator",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/roomle-build/npm-packages.git"
23
+ },
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "license": "MIT"
28
+ }
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ require('@/common/styles/Global.module.scss');
4
+
3
5
  class MessageHandler {
4
6
  constructor(side, incomingMessageBus, outgoingMessageBus, messageExecution) {
5
7
  this._outgoingMessageBus = null;
@@ -162,6 +164,51 @@ const isInIframe = () => {
162
164
  }
163
165
  };
164
166
 
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 = {}));
211
+
165
212
  /**
166
213
  * Recursively merge properties of two objects.
167
214
  * If a property exists in both it, property of obj2 is used.
@@ -307,16 +354,13 @@ const getFallbackInitData = () => {
307
354
  if (hostname && isDemoHostname(hostname)) {
308
355
  fallbackInitData.configuratorId = 'demoConfigurator';
309
356
  }
310
- fallbackInitData.customApiUrl = 'https://alpha.roomle.com/api/v2';
357
+ fallbackInitData.customApiUrl = 'https://www.roomle.com/api/v2';
311
358
  fallbackInitData.emails = false;
312
359
  return fallbackInitData;
313
360
  };
314
361
  const LEGACY_SHARE_PLACEHOLDER = '<CONF_ID>';
315
362
  const SHARE_PLACEHOLDER = '#CONFIGURATIONID#';
316
363
 
317
- // see why: so#/58065241/10800831
318
- const isAndroid = () => /(android)/i.test(navigator.userAgent);
319
-
320
364
  const setDefaultBehaviour = (object, callbackName, defaultBehaviour) => {
321
365
  let customBehaviour = null;
322
366
  Object.defineProperty(object, callbackName, {
@@ -1 +1 @@
1
- "use strict";class t{constructor(t,e,r,s){this.t=null,this.s=null,this.i=t,this.o=e,this.t=r,this.s=s,this.o.addEventListener("message",this.l.bind(this))}setOutgoingMessageBus(t){this.t=t}setMessageExecution(t){this.s=t}sendMessage(t,e=[]){return new Promise((r,s)=>{const i=new MessageChannel;i.port1.onmessage=t=>{if(!t||!t.data)return i.port1.close(),i.port2.close(),s(new Error(this.i+" received message but response can not be interpreted"));let e;try{e=JSON.parse(t.data)}catch(t){return i.port1.close(),i.port2.close(),this.h(t),s(t)}e.error?s(e.error):void 0!==e.result?r(e.result):r(),i.port1.close(),i.port2.close()};let o="";try{o=JSON.stringify({message:t,args:e})}catch(t){return s(new Error(this.i+": can not create command because it is not JSON.stringify able"))}if(!this.t)return s(new Error(this.i+": outgoing bus not set yet"));this.t.postMessage(o,"*",[i.port2])})}l(t){const e=t.ports&&Array.isArray(t.ports)&&t.ports.length>0?t.ports[0]:null;if(t.data&&e)try{const r=JSON.parse(t.data);if(!this.s)return e.postMessage(JSON.stringify({error:this.i+" is not ready to handle messages"}));Array.isArray(r.args)||(r.args=[r.args]);const s=this.s(r,t);if(void 0===s)return;s.then((t={})=>{let r=void 0,s=void 0;"object"==typeof t&&null!==t&&(r=t.error,s=t.result),r?e.postMessage(JSON.stringify({error:r})):void 0!==s?e.postMessage(JSON.stringify({result:s})):e.postMessage(JSON.stringify({result:t}))},t=>{e.postMessage(JSON.stringify({error:this.h(t)}))})}catch(t){e.postMessage(JSON.stringify({error:this.h(t)}))}}h(t){if("string"==typeof t){const e=this.i+": "+t;return console.error(e),e}return t.message=this.i+": "+t.message,console.error(t),t.message}}const e=(t,r)=>{for(const s in r)try{r[s].constructor===Object?t[s]=e(t[s],r[s]):t[s]=r[s]}catch(e){t[s]=r[s]}return t},r=["127.0.0.1","localhost","0.0.0.0"],s=["language","browserLanguage","userLanguage","systemLanguage"],i=t=>{if(!t)return;const e=Object.keys(t);for(const r of e){const e=t[r];if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return i(e);if(Array.isArray(e)){for(const t of e)i(t);return}"true"!==e&&"false"!==e||(t[r]="true"===e)}},o=()=>/(android)/i.test(navigator.userAgent),n=(t,e,r)=>{let s=null;Object.defineProperty(t,e,{get:()=>s||r,set(t){(null==t?void 0:t.mute)?s=t.value:(console.warn("You override Roomle defined behaviour. To disalbe this warning pass in an object with the following properties"),console.warn("{ mute: true, value: () => void }"),s=t)}})},l=()=>.01*window.innerHeight+"px",a=t=>{t&&setTimeout(()=>t.style.setProperty(h,l()),0)},h="--rml-full-height",c=new Map;module.exports=class{constructor(e,r,s,i){if(this.ui={callbacks:null},this.extended={callbacks:null},this.analytics={callbacks:{}},this.global={callbacks:{}},this.u={},!e||"string"!=typeof e.id)throw new Error("Please provide a correct configuratorId, you get the correct ID from your Roomle Contact Person");if(c.has(r))throw new Error("There is already an instance on this DOM element");if(!document.getElementById("rml-styles")){const t=s.zIndex||9999999,e=document.createElement("style");e.type="text/css",e.id="rml-styles";const r="transition:all ease-in-out 450ms;",i=["-webkit-","-o-"].reduce((t,e)=>t+(e+r),"")+r,o=l();e.innerHTML=`\n .rml-container{${h}:${o};}\n .rml-pos{position:fixed;top:0;left:0;z-index:${t};opacity:0}\n .rml-transition{${i}}\n .rml-fill{width:100%;height:100%;opacity:1}\n .rml-android-height{height:calc(var(${h},1vh)*100)}\n .rml-overflow-hidden{overflow:hidden}\n `,document.head.appendChild(e)}this.m=this.m.bind(this),o()&&window.addEventListener("resize",this.m),this.g=r,this.u=s,this.p=e;const n=this.v();this.O=this.O.bind(this),this.N=this.N.bind(this),this.P=this.P.bind(this),this._=new t("website",window,null,this.N),this.J=i,this.g.appendChild(n),this.S=n,c.set(r,!0)}static createPlanner(t,e,r){return this.k(t,e,r)}static createConfigurator(t,e,r){return this.k(t,e,r)}static create(t,e,r){return this.k(t,e,r)}static createViewer(t,e,r){return this.k(t,e,r)}static k(t,o,n){return new Promise(async(l,a)=>{try{const a=e((()=>{const t={};t.locale||(t.locale=((t=null)=>{const e=window.navigator;if(t)return t.substr(0,2);if(Array.isArray(e.languages)&&e.languages.length>0)return e.languages[0].substr(0,2);for(let t=0,r=s.length;t<r;t++){const r=e[s[t]];if(r)return r.substr(0,2)}return"en"})()),"(idle)"===t.id&&delete t.id;const e=(()=>{const t=(()=>{try{return window.self!==window.top}catch(t){return!0}})();let e=window.location.href;if(t){if(!document.referrer)return null;e=document.referrer}const{hostname:r}=new URL(e);return r})();return e&&(t=>!!r.includes(t)||!!t.endsWith("roomle.com")||!(!t.endsWith("gitlab.io")&&!t.endsWith("gitlab.com")))(e)&&(t.configuratorId="demoConfigurator"),t.customApiUrl="https://alpha.roomle.com/api/v2",t.emails=!1,t})(),(t=>(i(t),(null==t?void 0:t.customApiUrl)&&(t.customApiUrl=decodeURIComponent(t.customApiUrl)),t.shareUrl&&(t.deeplink=t.shareUrl.replace("<CONF_ID>","#CONFIGURATIONID#")),t))(n));a.featureFlags||(a.featureFlags={}),"boolean"!=typeof a.featureFlags.realPartList&&(a.featureFlags.realPartList=!0),"boolean"!=typeof a.featureFlags.globalCallbacks&&(a.featureFlags.globalCallbacks=!0);const h=await(async(t,e)=>{if("string"!=typeof t)throw new Error('Configurator ID is not a string type: "'+typeof t+'"');const r=e.customApiUrl?e.customApiUrl:"https://api.roomle.com/v2",s=e.overrideTenant||9,i=r+"/configurators/"+t,o="03-"+window.btoa((new Date).toISOString()+";anonymous;roomle_portal_v2"),n=new Request(i,{method:"GET",headers:new Headers({apiKey:"roomle_portal_v2",currentTenant:s,locale:"en",language:"en",device:1,token:o,platform:"web"}),mode:"cors",cache:"default"}),l=await fetch(n),{configurator:a}=await l.json();return a})(t,a);return n=((t,r)=>{r.configuratorId=t.id;const s=t.settings||{};return!r.overrideTenant&&t.tenant&&(r.overrideTenant=t.tenant),((t,r)=>{const s=JSON.parse(JSON.stringify(t));return e(s,r)})(s,r)})(h,a),new this(h,o,n,l)}catch(t){return a(t)}})}teardown(){this.g&&c.delete(this.g);const t=this.g.querySelector("iframe");t&&this.g.removeChild(t),window.removeEventListener("resize",this.m)}v(){var t;const e=document.createElement("iframe");let r=(null===(t=this.p)||void 0===t?void 0:t.url)||"https://www.roomle.com/t/cp/";return this.u.useLocalRoomle&&(r=location.href.replace("embedding.html","")),location.href.includes("roomle.gitlab.io")&&(r=location.href.replace("embedding.html","index.html")),this.u.overrideServerUrl&&(r=this.u.overrideServerUrl),e.src=r,e.classList.add("rml-container"),e.classList.add("rml-fill"),e}m(){a(this.S)}O(){this.S.classList.add("rml-pos"),document.documentElement.classList.add("rml-overflow-hidden"),window.document.body.classList.add("rml-overflow-hidden"),o()&&(a(this.S),this.S.classList.add("rml-android-height"))}P(){this.S.classList.remove("rml-pos"),this.S.classList.remove("rml-android-height"),document.documentElement.classList.remove("rml-overflow-hidden"),window.document.body.classList.remove("rml-overflow-hidden")}N({message:t,args:e},r){var s;if(!r.source)return;if(r.source!==(null===(s=this.S)||void 0===s?void 0:s.contentWindow))return;if("requestBoot"===t)return this._.setOutgoingMessageBus(r.source),Promise.resolve({result:this.u});if("setup"===t){const{methods:t,callbacks:r}=e[0];return t.forEach(t=>{const e=t.split("."),r=e[0],s=e[1];this[r]||(this[r]={}),this[r][s]=function(){return this._.sendMessage(t,[...arguments])}.bind(this)}),r.forEach(t=>{const e=t.split("."),r=e[0],s=e[1],i=e[2];this[r]||(this[r]={}),this[r][s]||(this[r][s]={}),this[r][s][i]=()=>{}}),n(this.ui.callbacks,"onUseFullPage",this.O),n(this.ui.callbacks,"onBackToWebsite",this.P),this.J(this),setTimeout(()=>this._.sendMessage("websiteReady"),0),Promise.resolve({result:null})}const i=t.split("."),o=i[0],l=i[1],a=3===i.length?i[2]:null;if(a&&this[o][l][a]){const t=this[o][l][a](...e);return t instanceof Promise?t.then(t=>({result:t})):void 0!==t?Promise.resolve({result:t}):Promise.resolve({result:null})}return Promise.reject('Message "'+t+'" is unkown')}};
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')}};