@roomle/embedding-lib 4.44.0 → 5.1.0-alpha.1
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.
- package/.releaserc.json +4 -7
- package/README.md +5 -6
- package/docs/md/web/embedding/CHANGELOG.md +28 -0
- package/drag-in-CXLxdfa-.mjs +265 -0
- package/drag-in-gOPgOymI.mjs +7 -0
- package/index.d.ts +114 -0
- package/package.json +27 -13
- package/roomle-embedding-lib.es.js +472 -0
- package/roomle-embedding-lib.es.min.js +8 -0
- package/roomle-embedding-lib.umd.js +14 -0
- package/roomle-embedding-lib.umd.min.js +14 -0
- package/docs/__sidebar__.json +0 -14
- package/docs/api/.nojekyll +0 -1
- package/docs/api/README.md +0 -9
- package/docs/api/classes/exposed_analytics_callbacks.ExposedAnalyticsCallbacks.md +0 -47
- package/docs/api/classes/exposed_api.ExposedApi.md +0 -255
- package/docs/api/classes/exposed_callbacks.ExposedCallbacks.md +0 -195
- package/docs/api/classes/roomle_configurator_api.default.md +0 -211
- package/docs/api/enums/types.UI_BUTTON.md +0 -263
- package/docs/api/interfaces/exposed_callbacks.Labels.md +0 -32
- package/docs/api/interfaces/exposed_callbacks.Price.md +0 -32
- package/docs/api/interfaces/roomle_configurator_api.RoomleEmbeddingApiKeys.md +0 -58
- package/docs/api/interfaces/types.ConfiguratorSettings.md +0 -150
- package/docs/api/interfaces/types.EmbeddingSkin.md +0 -65
- package/docs/api/interfaces/types.UiInitData.md +0 -1199
- package/docs/api/interfaces/types.VariantsMap.md +0 -9
- package/docs/api/modules/exposed_analytics_callbacks.md +0 -9
- package/docs/api/modules/exposed_api.md +0 -9
- package/docs/api/modules/exposed_callbacks.md +0 -14
- package/docs/api/modules/roomle_configurator_api.md +0 -49
- package/docs/api/modules/types.md +0 -16
- package/docs/api/modules.md +0 -13
- package/docs/examples/00_init.html +0 -38
- package/docs/examples/01_small_screen.html +0 -37
- package/docs/examples/02_resize_callback.html +0 -46
- package/docs/examples/03_instant_start.html +0 -38
- package/docs/examples/04_price.html +0 -48
- package/docs/examples/05_analytics.html +0 -38
- package/docs/examples/06_skinning.html +0 -39
- package/docs/examples/07_request_product.html +0 -41
- package/docs/examples/08_variants.html +0 -36
- package/docs/examples/09_different_products.html +0 -63
- package/docs/examples/10_landing_page.html +0 -38
- package/docs/examples/11_light_settings.html +0 -126
- package/docs/examples/12_email.html +0 -36
- package/docs/examples/13_parameters.html +0 -67
- package/docs/examples/14_ga_consent.html +0 -39
- package/docs/examples/roomle-configurator-api.es.min.js +0 -586
- package/docs/hsp.md +0 -61
- package/docs/images/parts.png +0 -0
- package/docs/images/usm-frames.png +0 -0
- package/docs/integration.md +0 -1101
- package/docs/md/web/ui/EMBEDDING-CHANGELOG.md +0 -17
- package/docs/migration-guides/v2-to-v3.md +0 -135
- package/docs/moc/index.md +0 -86
- package/docs/simple.md +0 -25
- package/roomle-configurator-api.cjs.js +0 -585
- package/roomle-configurator-api.cjs.min.js +0 -1
- package/roomle-configurator-api.es.js +0 -583
- package/roomle-configurator-api.es.min.js +0 -1
- package/roomle-configurator-api.js +0 -583
- package/types/index.d.ts +0 -1504
- package/types/src/common/business-logic/connector.d.ts +0 -8
- package/types/src/common/business-logic/event-bus.d.ts +0 -5
- package/types/src/common/components/collection-view/-utils/types.d.ts +0 -10
- package/types/src/common/plugins/analytics.d.ts +0 -11
- package/types/src/common/plugins/localize.d.ts +0 -8
- package/types/src/common/store/collection-view-state.d.ts +0 -40
- package/types/src/common/store/common-ui-state.d.ts +0 -16
- package/types/src/common/store/index.d.ts +0 -111
- package/types/src/common/translations/local-translation-source.d.ts +0 -8
- package/types/src/common/utils/access-restriction.d.ts +0 -7
- package/types/src/common/utils/ar-service.d.ts +0 -14
- package/types/src/common/utils/bezier.d.ts +0 -2
- package/types/src/common/utils/browser.d.ts +0 -3
- package/types/src/common/utils/color.d.ts +0 -2
- package/types/src/common/utils/compatibility.d.ts +0 -3
- package/types/src/common/utils/dom.d.ts +0 -15
- package/types/src/common/utils/font-size-detector.d.ts +0 -1
- package/types/src/common/utils/google-analytics.d.ts +0 -67
- package/types/src/common/utils/helper.d.ts +0 -43
- package/types/src/common/utils/iframe.d.ts +0 -3
- package/types/src/common/utils/init-data.d.ts +0 -34
- package/types/src/common/utils/merge.d.ts +0 -16
- package/types/src/common/utils/parameters.d.ts +0 -18
- package/types/src/common/utils/performance.d.ts +0 -2
- package/types/src/common/utils/plan.d.ts +0 -1
- package/types/src/common/utils/script-loader.d.ts +0 -5
- package/types/src/common/utils/share.d.ts +0 -1
- package/types/src/common/utils/touch-drag.d.ts +0 -24
- package/types/src/common/utils/types.d.ts +0 -19
- package/types/src/common/utils/user-agent.d.ts +0 -6
- package/types/src/common/utils/variants.d.ts +0 -3
- package/types/src/configurator/ar/main.d.ts +0 -1
- package/types/src/configurator/business-logic/roomle-sdk-wrapper.d.ts +0 -27
- package/types/src/configurator/business-logic/sdk-connector-configurator.d.ts +0 -29
- package/types/src/configurator/business-logic/sdk-connector.d.ts +0 -119
- package/types/src/configurator/business-logic/ui-callback.d.ts +0 -5
- package/types/src/configurator/components/-utils/overlays.d.ts +0 -43
- package/types/src/configurator/components/grid-view/-utils/GridViewHelper.d.ts +0 -16
- package/types/src/configurator/components/utils/-utils/SceneOffsetResizer.d.ts +0 -23
- package/types/src/configurator/embedding/example/main.d.ts +0 -1
- package/types/src/configurator/embedding/exposed-analytics-callbacks.d.ts +0 -10
- package/types/src/configurator/embedding/exposed-api.d.ts +0 -90
- package/types/src/configurator/embedding/exposed-callbacks.d.ts +0 -46
- package/types/src/configurator/embedding/helper.d.ts +0 -8
- package/types/src/configurator/embedding/message-handler.d.ts +0 -31
- package/types/src/configurator/embedding/roomle-configurator-api.d.ts +0 -64
- package/types/src/configurator/embedding/types.d.ts +0 -159
- package/types/src/configurator/embedding/utils.d.ts +0 -15
- package/types/src/configurator/plugins/embedding-callbacks-plugin.d.ts +0 -4
- package/types/src/configurator/plugins/libs-plugin.d.ts +0 -11
- package/types/src/configurator/plugins/sdk-connector-plugin.d.ts +0 -14
- package/types/src/configurator/store/core-data.d.ts +0 -34
- package/types/src/configurator/store/core-state.d.ts +0 -26
- package/types/src/configurator/store/ui-state.d.ts +0 -118
- package/types/src/main.d.ts +0 -14
- package/types/src/planner/business-logic/general-room-parameters.d.ts +0 -17
- package/types/src/planner/business-logic/pre-defined-rooms.d.ts +0 -2
- package/types/src/planner/business-logic/rooms.d.ts +0 -37
- package/types/src/planner/business-logic/sdk-connector-planner.d.ts +0 -28
- package/types/src/planner/store/planner-core-data.d.ts +0 -21
- package/types/src/planner/store/planner-ui-state.d.ts +0 -65
- package/types/src/planner/utils/interaction.d.ts +0 -3
- package/types/src/planner/utils/planner-sidebar.d.ts +0 -19
- package/types/src/viewer/business-logic/sdk-connector-viewer.d.ts +0 -18
- package/types/tests/helpers/data/base-64-images.d.ts +0 -1
- package/types/tests/helpers/data/configurator.d.ts +0 -7
- package/types/tests/helpers/data/items.d.ts +0 -208
- package/types/tests/helpers/data/materials.d.ts +0 -32
- package/types/tests/helpers/data/parameter-groups.d.ts +0 -242
- package/types/tests/helpers/data/parameters.d.ts +0 -399
- package/types/tests/helpers/data/part-list.d.ts +0 -126
- package/types/tests/helpers/data/plan.d.ts +0 -224
- package/types/tests/helpers/data/planObject.d.ts +0 -134
- package/types/tests/helpers/data/possible-children-tags.d.ts +0 -208
- package/types/tests/helpers/data/variants.d.ts +0 -60
- package/types/tests/helpers/data/wall-dimensions.d.ts +0 -41
- package/types/tests/helpers/dom.d.ts +0 -1
- package/types/tests/helpers/mocks/analytics.d.ts +0 -7
- package/types/tests/helpers/mocks/data/biohort-parameter.d.ts +0 -32
- package/types/tests/helpers/mocks/data/koinor-formia.d.ts +0 -289
- package/types/tests/helpers/mocks/embedding-callbacks.d.ts +0 -4
- package/types/tests/helpers/mocks/icon.d.ts +0 -3
- package/types/tests/helpers/mocks/localize.d.ts +0 -8
- package/types/tests/helpers/mocks/message.d.ts +0 -11
- package/types/tests/helpers/mocks/parameters.d.ts +0 -47
- package/types/tests/helpers/mocks/possible-children.d.ts +0 -596
- package/types/tests/helpers/mocks/roomle-sdk-wrapper.d.ts +0 -177
- package/types/tests/helpers/mocks/sdk-connector-configurator.d.ts +0 -13
- package/types/tests/helpers/mocks/sdk-connector-planner.d.ts +0 -13
- package/types/tests/helpers/mocks/sdk-connector.d.ts +0 -35
- package/types/tests/helpers/mocks/store.d.ts +0 -11
- package/types/tests/helpers/mocks/tag.d.ts +0 -148
- package/types/tests/helpers/utils.d.ts +0 -13
- package/types/tests/integration/common/components/ActionButtons.spec.d.ts +0 -1
- package/types/tests/integration/common/components/BottomBar.spec.d.ts +0 -1
- package/types/tests/integration/common/components/BottomButtons.spec.d.ts +0 -1
- package/types/tests/integration/common/components/IconButton.spec.d.ts +0 -1
- package/types/tests/integration/common/components/SelectionButtons.spec.d.ts +0 -1
- package/types/tests/integration/common/components/part-list/part-list/PartListPrint.spec.d.ts +0 -1
- package/types/tests/integration/common/components/part-list/part-list/PartListRow.spec.d.ts +0 -1
- package/types/tests/integration/configurator/App.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/ARButton.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/ConfiguratorMain.spec.d.ts +0 -9
- package/types/tests/integration/configurator/components/CookieBanner.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/Overlays.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/TopBar.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/ViewerMain.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/addons/AddonsTrigger.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/addons/PossibleChildren.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/collection-view/-utils/TabbedNav.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/collection-view/CollectionView.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/grid-view/-utils/CollapsedView.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/grid-view/-utils/ExpandedView.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/grid-view/-utils/GridViewElement.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/grid-view/-utils/GridViewHelper.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/grid-view/GridView.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/overlays/Export3D.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/overlays/NoDocking.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/overlays/PartList.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/overlays/SaveDraft.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/overlays/VariantWarning.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/overlays/ar/OpenARView.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/parameters/BackParameterGroupButton.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/parameters/NextParameterGroupButton.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/parameters/ParameterGroupButton.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/parameters/ParameterGroups.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/parameters/types/MaterialParameter.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/parameters/types/OptionsParameter.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/parameters/types/OptionsParameterValue.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/parameters/types/ProductVariant.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/parameters/types/RangeParameter.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/parameters/types/ThumbnailsParameter.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/utils/BackToWebsite.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/utils/CheckBox.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/utils/FullscreenContainer.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/utils/GdprEmailInput.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/utils/HeightToggle.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/utils/ImageWithFallback.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/utils/InteractionContainer.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/utils/PopUp.spec.d.ts +0 -1
- package/types/tests/integration/configurator/components/utils/ScrollHint.spec.d.ts +0 -1
- package/types/tests/integration/helper.spec.d.ts +0 -1
- package/types/tests/integration/planner/components/CatalogTrigger.spec.d.ts +0 -1
- package/types/tests/integration/planner/components/PlannerMain.spec.d.ts +0 -1
- package/types/tests/integration/planner/components/PlannerSidebar.spec.d.ts +0 -1
- package/types/tests/integration/planner/components/ProductListButton.spec.d.ts +0 -1
- package/types/tests/integration/planner/components/SampleRooms.spec.d.ts +0 -1
- package/types/tests/integration/planner/components/ShowWallMeasurements.spec.d.ts +0 -1
- package/types/tests/integration/planner/components/overlays/product-list/ProductListEntry.spec.d.ts +0 -1
- package/types/tests/integration/planner/components/overlays/rooms/RoomGeneralSettings.spec.d.ts +0 -1
- package/types/tests/integration/planner/components/overlays/rooms/RoomRangeParameter.spec.d.ts +0 -1
- package/types/tests/integration/planner/components/utils/InteractionHeader.spec.d.ts +0 -1
- package/types/tests/integration/planner/components/utils/sidebar-nav/SidebarNav.spec.d.ts +0 -1
- package/types/tests/unit/common/business-logic/event-bus.spec.d.ts +0 -1
- package/types/tests/unit/common/helper.spec.d.ts +0 -1
- package/types/tests/unit/common/translations/local-translation-source.spec.d.ts +0 -1
- package/types/tests/unit/common/utils/ar-service.spec.d.ts +0 -1
- package/types/tests/unit/common/utils/bezier.spec.d.ts +0 -1
- package/types/tests/unit/common/utils/color.spec.d.ts +0 -1
- package/types/tests/unit/common/utils/dom.spec.d.ts +0 -1
- package/types/tests/unit/common/utils/helper.spec.d.ts +0 -1
- package/types/tests/unit/common/utils/init-data.spec.d.ts +0 -1
- package/types/tests/unit/common/utils/parameters.spec.d.ts +0 -1
- package/types/tests/unit/common/utils/touch-drag.spec.d.ts +0 -1
- package/types/tests/unit/configurator/business-logic/sdk-connector-configurator.spec.d.ts +0 -1
- package/types/tests/unit/configurator/business-logic/sdk-connector.spec.d.ts +0 -1
- package/types/tests/unit/configurator/components/utils/-utils/ConfiguratorResizer.spec.d.ts +0 -1
- package/types/tests/unit/configurator/components/utils/WordWrap.spec.d.ts +0 -1
- package/types/tests/unit/configurator/embedding/exposed-api.spec.d.ts +0 -1
- package/types/tests/unit/configurator/embedding/utils.spec.d.ts +0 -1
- package/types/tests/unit/configurator/store/index.spec.d.ts +0 -1
- package/types/tests/unit/planner/business-logic/sdk-connector-planner.spec.d.ts +0 -1
package/.releaserc.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"tagFormat": "embedding-v${version}",
|
|
2
|
+
"tagFormat": "embedding-lib-v${version}",
|
|
3
3
|
"repositoryUrl": "git@github.com:roomle-dev/roomle-ui.git",
|
|
4
4
|
"branches": [
|
|
5
5
|
{
|
|
6
|
-
"name": "
|
|
6
|
+
"name": "cd/embedding-pre-release",
|
|
7
7
|
"channel": "debug",
|
|
8
8
|
"prerelease": "debug"
|
|
9
9
|
},
|
|
@@ -40,17 +40,14 @@
|
|
|
40
40
|
{
|
|
41
41
|
"preset": "conventionalcommits",
|
|
42
42
|
"writerOpts": {
|
|
43
|
-
"commitsSort": [
|
|
44
|
-
"subject",
|
|
45
|
-
"scope"
|
|
46
|
-
]
|
|
43
|
+
"commitsSort": ["subject", "scope"]
|
|
47
44
|
}
|
|
48
45
|
}
|
|
49
46
|
],
|
|
50
47
|
[
|
|
51
48
|
"@semantic-release/changelog",
|
|
52
49
|
{
|
|
53
|
-
"changelogFile": "docs/md/web/
|
|
50
|
+
"changelogFile": "docs/md/web/embedding/CHANGELOG.md"
|
|
54
51
|
}
|
|
55
52
|
],
|
|
56
53
|
[
|
package/README.md
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
# Roomle Rubens
|
|
1
|
+
# Roomle Rubens Embedding Lib
|
|
2
2
|
|
|
3
|
-
The official npm package to embed
|
|
3
|
+
The official npm package to embed [Roomle](https://www.roomle.com/en) Rubens in your website.
|
|
4
4
|
|
|
5
|
-
For release notes, see the [CHANGELOG](https://docs.roomle.com/
|
|
5
|
+
For release notes, see the [CHANGELOG](https://docs.roomle.com/rubens/changelogs/changelog).
|
|
6
6
|
|
|
7
7
|
## Getting started
|
|
8
|
-
You can find an extensive guide on how to get started on [docs.roomle.com](https://docs.roomle.com/web/embedding/).
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
Use our [API documentation](https://docs.roomle.com/web/embedding/api/classes/roomle_configurator_api.default.html) to get further information on how to use the classes provided by the Rubens Configuratior Embedding.
|
|
9
|
+
You can find an extensive guide on how to get started on [docs.roomle.com](https://docs.roomle.com/rubens/rubens-products/rubens-3d-viewer-and-ar/getting-started).
|
|
12
10
|
|
|
13
11
|
## Bugs & Issues
|
|
12
|
+
|
|
14
13
|
If you encounter issues please report them using our [Servicedesk](https://roomle.atlassian.net/servicedesk/customer/portals).
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
## [5.1.0-alpha.1](https://github.com/roomle-dev/roomle-ui/compare/embedding-lib-v5.0.0...embedding-lib-v5.1.0-alpha.1) (2024-08-14)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* forward type correctly ([4f465d0](https://github.com/roomle-dev/roomle-ui/commit/4f465d03b00c4d057d94a1c35dbfc589f29caf12))
|
|
7
|
+
* implement feature of drag in ([151d665](https://github.com/roomle-dev/roomle-ui/commit/151d665c35da6b79cbd6b49635dfdf8e3d9c4742))
|
|
8
|
+
* release from cd/embedding-pre-release ([4e547d5](https://github.com/roomle-dev/roomle-ui/commit/4e547d5b29d33578ab9eca1221a469d4c5a100b6))
|
|
9
|
+
* **SDK:** upgrade to version 2.83.0-alpha.3 ([#1188](https://github.com/roomle-dev/roomle-ui/issues/1188)) ([8328c4a](https://github.com/roomle-dev/roomle-ui/commit/8328c4a32d425a36e11af914582430812a7204c6))
|
|
10
|
+
* **SDK:** upgrade to version 2.83.0-alpha.4 ([#1189](https://github.com/roomle-dev/roomle-ui/issues/1189)) ([87dcc27](https://github.com/roomle-dev/roomle-ui/commit/87dcc271f473782cdc819c193940861084ea28ba))
|
|
11
|
+
* **SDK:** upgrade to version 2.83.0-alpha.5 ([003c215](https://github.com/roomle-dev/roomle-ui/commit/003c215768881f30eb3f51fadc8efe38eadae87c))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* add missing UI buttons to be visible inside feature flags menu in Rubens Admin ([3837ca3](https://github.com/roomle-dev/roomle-ui/commit/3837ca3c24267bc70fa450be353a2c32f713b315))
|
|
17
|
+
* also forward type on touchstart ([4e4d17f](https://github.com/roomle-dev/roomle-ui/commit/4e4d17f27d3c82646a778ee3f44ec08854150ee4))
|
|
18
|
+
* correct sign ([fc1db6c](https://github.com/roomle-dev/roomle-ui/commit/fc1db6c91bcfe754c5d2cd39b8c2dbdb2133c48e))
|
|
19
|
+
* **embedding:** make configurator api available on planner embedding ([8bd473e](https://github.com/roomle-dev/roomle-ui/commit/8bd473e014c1a19839d150dde6051db387cf26d6))
|
|
20
|
+
* pointing vitest to the correct config file ([6fe8dc8](https://github.com/roomle-dev/roomle-ui/commit/6fe8dc8b5ce5783ed67ca2364d0a40b4630419b7))
|
|
21
|
+
* prevent key events on slider to enable shifting the scene ([ebed576](https://github.com/roomle-dev/roomle-ui/commit/ebed576d0903cda0963ef0e1aca8e29a314c8ac7))
|
|
22
|
+
* remove leftover from old tries ([b4341d1](https://github.com/roomle-dev/roomle-ui/commit/b4341d17f4cf7ad130c72e15df6d6389dddff76c))
|
|
23
|
+
* remove syntax error ([34a7cda](https://github.com/roomle-dev/roomle-ui/commit/34a7cda3a4be80d2260ff6e4990f2b42be4fd2ad))
|
|
24
|
+
* run pre release of embedding ([6d8849e](https://github.com/roomle-dev/roomle-ui/commit/6d8849e6bc8a6a081c7be104f1910e23396a655d))
|
|
25
|
+
* set configurator callbacks and types ([8a56c2e](https://github.com/roomle-dev/roomle-ui/commit/8a56c2ec13b48a10ff86798d605c134a067e2e55))
|
|
26
|
+
* some stuff ([b4c0152](https://github.com/roomle-dev/roomle-ui/commit/b4c015270ebdf61971a8108dc5637c7b54847c88))
|
|
27
|
+
* submit onBlur for measurements in 2D ([164e71b](https://github.com/roomle-dev/roomle-ui/commit/164e71bc78fa92dcc75939533f345448679ab506))
|
|
28
|
+
* use correct credentials ([6898e84](https://github.com/roomle-dev/roomle-ui/commit/6898e845733d6086562a78a3c5619ea8954011ed))
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
var v = Object.defineProperty;
|
|
2
|
+
var P = (n, t, e) => t in n ? v(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var c = (n, t, e) => P(n, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
class $ {
|
|
5
|
+
constructor(t = 16) {
|
|
6
|
+
c(this, "_computedStyleCache", /* @__PURE__ */ new Map());
|
|
7
|
+
c(this, "_maxLifetime", 16);
|
|
8
|
+
c(this, "_cacheCleanInterval", null);
|
|
9
|
+
this._maxLifetime = t;
|
|
10
|
+
}
|
|
11
|
+
get(t) {
|
|
12
|
+
const e = this._computedStyleCache.get(t), i = Date.now();
|
|
13
|
+
if (e && i - e.updated < this._maxLifetime)
|
|
14
|
+
return e.style;
|
|
15
|
+
const s = getComputedStyle(t);
|
|
16
|
+
return this._computedStyleCache.set(t, { style: s, updated: i }), this._cacheCleanInterval || (this._cacheCleanInterval = setInterval(
|
|
17
|
+
() => this._cleanUpCache,
|
|
18
|
+
Math.max(this._maxLifetime * 1e3, 5e3)
|
|
19
|
+
)), s;
|
|
20
|
+
}
|
|
21
|
+
_cleanUpCache() {
|
|
22
|
+
const t = Date.now();
|
|
23
|
+
for (const [e, { updated: i }] of this._computedStyleCache.entries())
|
|
24
|
+
t - i >= this._maxLifetime && this._computedStyleCache.delete(e);
|
|
25
|
+
this._computedStyleCache.size === 0 && this._cacheCleanInterval && (clearInterval(this._cacheCleanInterval), this._cacheCleanInterval = null);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const M = (n) => window.TouchEvent && n instanceof window.TouchEvent;
|
|
29
|
+
let D;
|
|
30
|
+
const p = (n) => (D || (D = new $()), D.get(n)), C = (n, t, e) => {
|
|
31
|
+
const i = parseFloat(n), s = window.devicePixelRatio || 1;
|
|
32
|
+
if (t === "px")
|
|
33
|
+
return i;
|
|
34
|
+
if (t === "%") {
|
|
35
|
+
const o = e === document.documentElement ? window.innerWidth : e.offsetWidth;
|
|
36
|
+
return i / 100 * o;
|
|
37
|
+
}
|
|
38
|
+
if (t === "rem") {
|
|
39
|
+
const o = parseFloat(
|
|
40
|
+
p(document.documentElement).fontSize
|
|
41
|
+
);
|
|
42
|
+
return i * o;
|
|
43
|
+
}
|
|
44
|
+
if (t === "em") {
|
|
45
|
+
const o = parseFloat(
|
|
46
|
+
p(e).fontSize
|
|
47
|
+
);
|
|
48
|
+
return i * o;
|
|
49
|
+
}
|
|
50
|
+
if (t === "vh" || t === "vw" || t === "vmin" || t === "vmax") {
|
|
51
|
+
const o = {
|
|
52
|
+
vh: window.innerHeight,
|
|
53
|
+
vw: window.innerWidth,
|
|
54
|
+
vmin: Math.min(window.innerWidth, window.innerHeight),
|
|
55
|
+
vmax: Math.max(window.innerWidth, window.innerHeight)
|
|
56
|
+
};
|
|
57
|
+
return i / 100 * o[t];
|
|
58
|
+
}
|
|
59
|
+
const r = {
|
|
60
|
+
cm: 37.7952755906,
|
|
61
|
+
mm: 3.77952755906,
|
|
62
|
+
in: 96
|
|
63
|
+
};
|
|
64
|
+
return t in r ? i * r[t] * s : (console.warn("Unable to determine coordinates for drag-in. Therefore drag-in is not possible. Check the CSS that positions the iframe of Roomle"), 0);
|
|
65
|
+
}, A = (n, t, e = { x: 0, y: 0 }) => {
|
|
66
|
+
const i = n.getBoundingClientRect(), r = p(n).transform;
|
|
67
|
+
let o = 0, l = 0;
|
|
68
|
+
if (r !== "none") {
|
|
69
|
+
const f = /translate\(\s*([-+]?\d*\.?\d+|\d+)(px|%)?,?\s*([-+]?\d*\.?\d+|\d+)?(px|%)?\s*\)/, d = r.match(f);
|
|
70
|
+
d && (o = C(d[1], d[2], n), l = C(d[3], d[4], n));
|
|
71
|
+
}
|
|
72
|
+
const { clientX: _, clientY: a } = w(t, e), h = _ - i.left - o + n.scrollLeft, u = a - i.top - l + n.scrollTop;
|
|
73
|
+
return { x: h, y: u };
|
|
74
|
+
}, w = (n, t) => {
|
|
75
|
+
const { clientX: e, clientY: i } = M(n) ? G(n) : n, s = e || t.x, r = i || t.y;
|
|
76
|
+
return { clientX: s, clientY: r };
|
|
77
|
+
}, G = (n) => {
|
|
78
|
+
if (n.touches.length) {
|
|
79
|
+
let { clientX: e, clientY: i } = n.touches[0];
|
|
80
|
+
if (n.touches.length > 1) {
|
|
81
|
+
const s = n.touches[1], r = s.clientX, o = s.clientY;
|
|
82
|
+
e = (e + r) / 2, i = (i + o) / 2;
|
|
83
|
+
}
|
|
84
|
+
return { clientX: e, clientY: i };
|
|
85
|
+
}
|
|
86
|
+
const t = n.changedTouches[0];
|
|
87
|
+
return { clientX: t.clientX, clientY: t.clientY };
|
|
88
|
+
}, N = 500, L = 10;
|
|
89
|
+
class z {
|
|
90
|
+
constructor(t, { onTouchDragStart: e }, i = {}) {
|
|
91
|
+
c(this, "_touchDragTimeOut");
|
|
92
|
+
c(this, "_onTouchDragStart");
|
|
93
|
+
c(this, "_payload", null);
|
|
94
|
+
c(this, "_delay", N);
|
|
95
|
+
c(this, "_firstTouch", null);
|
|
96
|
+
c(this, "_lastTouch", null);
|
|
97
|
+
c(this, "_epsilon", L);
|
|
98
|
+
this._payload = t, this._onTouchDragStart = e, this._delay = i.delay || N, this._epsilon = i.epsilon || L;
|
|
99
|
+
}
|
|
100
|
+
onTouchStart(t) {
|
|
101
|
+
var e;
|
|
102
|
+
!t || !((e = t == null ? void 0 : t.touches) != null && e.length) || this._touchDragTimeOut || (this._firstTouch = t.touches[t.touches.length - 1], this._touchDragTimeOut = setTimeout(() => {
|
|
103
|
+
this._clearTimeout(), this._lastTouch || (this._lastTouch = t.touches[0]), this._checkXDistance(t)();
|
|
104
|
+
}, this._delay));
|
|
105
|
+
}
|
|
106
|
+
onTouchEnd() {
|
|
107
|
+
this._resetTouches();
|
|
108
|
+
}
|
|
109
|
+
onTouchMove(t) {
|
|
110
|
+
var e;
|
|
111
|
+
!t || !((e = t == null ? void 0 : t.touches) != null && e.length) || (this._lastTouch = t.touches[0]);
|
|
112
|
+
}
|
|
113
|
+
_clearTimeout() {
|
|
114
|
+
this._touchDragTimeOut && (clearTimeout(this._touchDragTimeOut), this._touchDragTimeOut = null);
|
|
115
|
+
}
|
|
116
|
+
_resetTouches() {
|
|
117
|
+
this._clearTimeout(), this._lastTouch = null, this._firstTouch = null, this._payload = null;
|
|
118
|
+
}
|
|
119
|
+
_checkXDistance(t) {
|
|
120
|
+
return () => {
|
|
121
|
+
if (!this._firstTouch || !this._lastTouch)
|
|
122
|
+
return;
|
|
123
|
+
let e = !1;
|
|
124
|
+
e = Math.abs(
|
|
125
|
+
this._firstTouch.clientX - this._lastTouch.clientX
|
|
126
|
+
) < this._epsilon, e && (this._onTouchDragStart(this._payload, t), this._resetTouches());
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const O = "rml-drag-in-styles", F = "rml-drag-in-drag-element", g = "rml-drag-in-overlay", m = "rml-drag-in-drag-ghost", T = "rml-drag-in-fade-in", Y = "rml-drag-in-fade-out", x = {
|
|
131
|
+
DISPLAY_NONE: "rml-display-none"
|
|
132
|
+
}, b = 0.5, S = "250ms", I = "forwards", E = (n) => n ? !0 : (console.warn("No instance set, cancel drag-in"), !1);
|
|
133
|
+
class U {
|
|
134
|
+
constructor(t) {
|
|
135
|
+
c(this, "_iframe");
|
|
136
|
+
c(this, "_currentDrag", {});
|
|
137
|
+
c(this, "_currentTouch", null);
|
|
138
|
+
c(this, "_firefoxDragPosition", { x: 0, y: 0 });
|
|
139
|
+
c(this, "_instance", null);
|
|
140
|
+
c(this, "options", {});
|
|
141
|
+
c(this, "_firefoxFallback", (t) => {
|
|
142
|
+
if (!this._currentDrag.event)
|
|
143
|
+
return;
|
|
144
|
+
const e = t || window.event;
|
|
145
|
+
this._firefoxDragPosition.x = e.pageX || 0, this._firefoxDragPosition.y = e.pageY || 0;
|
|
146
|
+
});
|
|
147
|
+
this._iframe = t, this._injectStyles(), this._initializeDragGhost(), this._firefoxFallback = this._firefoxFallback.bind(this), document.addEventListener("dragover", this._firefoxFallback);
|
|
148
|
+
}
|
|
149
|
+
_injectStyles() {
|
|
150
|
+
if (!!!document.getElementById(O)) {
|
|
151
|
+
const e = document.createElement("style");
|
|
152
|
+
e.type = "text/css", e.id = O, e.innerHTML = `
|
|
153
|
+
.${x.DISPLAY_NONE}{display:none}
|
|
154
|
+
.${g}{position:absolute;top:0;left:0;width:100%;height:100%;z-index:999;}
|
|
155
|
+
.${m}{position:absolute;top:0;left:0;width:1px;height:1px;z-index:999;pointer-events:none;background-color:transparent;}
|
|
156
|
+
@keyframes ${T} {from{opacity: 0;}to {opacity: ${b};}}
|
|
157
|
+
@keyframes ${Y} {from{opacity: ${b};}to {opacity: 0;}}
|
|
158
|
+
`, document.head.appendChild(e);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
_initializeDragGhost() {
|
|
162
|
+
const t = this._iframe.parentNode;
|
|
163
|
+
let e = t.querySelector(
|
|
164
|
+
"." + m
|
|
165
|
+
);
|
|
166
|
+
e || (e = document.createElement("div"), e.classList.add(m), e.innerText = " ", t.appendChild(e));
|
|
167
|
+
}
|
|
168
|
+
setInstance(t) {
|
|
169
|
+
this._instance = t;
|
|
170
|
+
}
|
|
171
|
+
dragStart(t, e, i = "rml_id") {
|
|
172
|
+
const s = this._iframe.parentNode;
|
|
173
|
+
if (p(s).position !== "relative") {
|
|
174
|
+
console.warn(
|
|
175
|
+
"Parent of iframe should have position relative, otherwise drag-in can not detect the x/y coordinates correctly"
|
|
176
|
+
);
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
this._iframe.style.pointerEvents = "none";
|
|
180
|
+
let o = s.querySelector(
|
|
181
|
+
"." + g
|
|
182
|
+
);
|
|
183
|
+
o || (o = document.createElement("div"), o.classList.add(g), s.appendChild(o)), o.classList.remove(x.DISPLAY_NONE), e.target.getAttribute("draggable") || console.warn(
|
|
184
|
+
`Draggable not detected correctly! Did you add draggable="true" to the element? In Sarafi only 'draggable' is too less`
|
|
185
|
+
);
|
|
186
|
+
const _ = s.querySelector(
|
|
187
|
+
"." + m
|
|
188
|
+
);
|
|
189
|
+
this._currentDrag.event = e;
|
|
190
|
+
const a = e.target.cloneNode();
|
|
191
|
+
a.style.position = "fixed", a.style.pointerEvents = "none", a.style.opacity = "0", a.style.animation = `${T} ${S} ${I}`, a.id = F, a.style.zIndex = "9999", document.body.appendChild(a), this._currentDrag.element = a;
|
|
192
|
+
const h = e.target.getBoundingClientRect();
|
|
193
|
+
this._currentDrag.offset || (this._currentDrag.offset = { x: 0, y: 0 });
|
|
194
|
+
const { clientX: u, clientY: f } = w(
|
|
195
|
+
e,
|
|
196
|
+
this._firefoxDragPosition
|
|
197
|
+
);
|
|
198
|
+
this._currentDrag.offset.x = u - h.left, this._currentDrag.offset.y = f - h.top, a.style.top = f + "px", a.style.left = u + "px", e instanceof DragEvent && e.dataTransfer && e.dataTransfer.setDragImage && e.dataTransfer.setDragImage(_, 0, 0);
|
|
199
|
+
const { x: d, y } = A(
|
|
200
|
+
s,
|
|
201
|
+
this._currentDrag.event || e,
|
|
202
|
+
this._firefoxDragPosition
|
|
203
|
+
), R = Math.max(1, d), X = Math.max(1, y);
|
|
204
|
+
E(this._instance) && this._instance.dragInObject(t, R, X, i);
|
|
205
|
+
}
|
|
206
|
+
dragUpdate(t) {
|
|
207
|
+
var l, _;
|
|
208
|
+
const e = this._iframe.parentNode, { x: i, y: s } = A(e, t, this._firefoxDragPosition);
|
|
209
|
+
if (i === 0 && s === 0)
|
|
210
|
+
return;
|
|
211
|
+
const r = Math.max(1, i), o = Math.max(1, s);
|
|
212
|
+
if (this._currentDrag.element) {
|
|
213
|
+
const { clientX: a, clientY: h } = w(
|
|
214
|
+
t,
|
|
215
|
+
this._firefoxDragPosition
|
|
216
|
+
), u = ((l = this._currentDrag.offset) == null ? void 0 : l.x) || 0, f = ((_ = this._currentDrag.offset) == null ? void 0 : _.y) || 0;
|
|
217
|
+
this._currentDrag.element.style.left = `${a - u}px`, this._currentDrag.element.style.top = `${h - f}px`;
|
|
218
|
+
const d = (this.options.dragInOverlapX || 0) + 1, y = (this.options.dragInOverlapY || 0) + 1;
|
|
219
|
+
r > d && o > y ? this._currentDrag.element.style.animation = `${Y} ${S} ${I}` : this._currentDrag.element.style.animation = `${T} ${S} ${I}`;
|
|
220
|
+
}
|
|
221
|
+
if (!(r === 1 && o === 1) && E(this._instance)) {
|
|
222
|
+
let a = r, h = o;
|
|
223
|
+
if (M(t)) {
|
|
224
|
+
const u = this.options.fingerSize || 0;
|
|
225
|
+
a = Math.max(2, r + u), h = Math.max(2, o - u);
|
|
226
|
+
}
|
|
227
|
+
this._instance.updateDrag(a, h);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
dragEnd() {
|
|
231
|
+
this._iframe.style.pointerEvents = "all";
|
|
232
|
+
const t = this._iframe.parentNode;
|
|
233
|
+
E(this._instance) && this._instance.dragInObjectEnd(), this._currentDrag.element && document.body.removeChild(this._currentDrag.element), this._currentDrag = {}, this._firefoxDragPosition = { x: 0, y: 0 };
|
|
234
|
+
const e = t.querySelector(
|
|
235
|
+
"." + g
|
|
236
|
+
);
|
|
237
|
+
e && e.classList.add(x.DISPLAY_NONE);
|
|
238
|
+
}
|
|
239
|
+
touchStart(t, e, i = "rml_id") {
|
|
240
|
+
var o, l;
|
|
241
|
+
e.preventDefault();
|
|
242
|
+
const s = (_, a) => {
|
|
243
|
+
this.dragStart(t, a, i);
|
|
244
|
+
}, r = {};
|
|
245
|
+
(o = this.options) != null && o.touchDragDelay && (r.delay = this.options.touchDragDelay), (l = this.options) != null && l.touchDragEpsilon && (r.epsilon = this.options.touchDragEpsilon), this._currentTouch = new z(
|
|
246
|
+
void 0,
|
|
247
|
+
{
|
|
248
|
+
onTouchDragStart: s
|
|
249
|
+
},
|
|
250
|
+
r
|
|
251
|
+
), this._currentTouch.onTouchStart(e);
|
|
252
|
+
}
|
|
253
|
+
touchMove(t) {
|
|
254
|
+
this._currentTouch && this._currentTouch.onTouchMove(t), this._currentDrag.event && this.dragUpdate(t);
|
|
255
|
+
}
|
|
256
|
+
touchEnd() {
|
|
257
|
+
this._currentTouch && this._currentTouch.onTouchEnd(), this._currentTouch = null, this.dragEnd();
|
|
258
|
+
}
|
|
259
|
+
dispose() {
|
|
260
|
+
document.removeEventListener("dragover", this._firefoxFallback);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
export {
|
|
264
|
+
U as DragIn
|
|
265
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
var O=Object.defineProperty,P=(i,t,e)=>t in i?O(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,c=(i,t,e)=>P(i,typeof t!="symbol"?t+"":t,e);class N{constructor(t=16){c(this,"_computedStyleCache",new Map),c(this,"_maxLifetime",16),c(this,"_cacheCleanInterval",null),this._maxLifetime=t}get(t){const e=this._computedStyleCache.get(t),n=Date.now();if(e&&n-e.updated<this._maxLifetime)return e.style;const o=getComputedStyle(t);return this._computedStyleCache.set(t,{style:o,updated:n}),this._cacheCleanInterval||(this._cacheCleanInterval=setInterval(()=>this._cleanUpCache,Math.max(this._maxLifetime*1e3,5e3))),o}_cleanUpCache(){const t=Date.now();for(const[e,{updated:n}]of this._computedStyleCache.entries())t-n>=this._maxLifetime&&this._computedStyleCache.delete(e);this._computedStyleCache.size===0&&this._cacheCleanInterval&&(clearInterval(this._cacheCleanInterval),this._cacheCleanInterval=null)}}const E=i=>window.TouchEvent&&i instanceof window.TouchEvent;let D;const f=i=>(D||(D=new N),D.get(i)),C=(i,t,e)=>{const n=parseFloat(i),o=window.devicePixelRatio||1;if(t==="px")return n;if(t==="%"){const a=e===document.documentElement?window.innerWidth:e.offsetWidth;return n/100*a}if(t==="rem"){const a=parseFloat(f(document.documentElement).fontSize);return n*a}if(t==="em"){const a=parseFloat(f(e).fontSize);return n*a}if(t==="vh"||t==="vw"||t==="vmin"||t==="vmax"){const a={vh:window.innerHeight,vw:window.innerWidth,vmin:Math.min(window.innerWidth,window.innerHeight),vmax:Math.max(window.innerWidth,window.innerHeight)};return n/100*a[t]}const s={cm:37.7952755906,mm:3.77952755906,in:96};return t in s?n*s[t]*o:(console.warn("Unable to determine coordinates for drag-in. Therefore drag-in is not possible. Check the CSS that positions the iframe of Roomle"),0)},I=(i,t,e={x:0,y:0})=>{const n=i.getBoundingClientRect(),o=f(i).transform;let s=0,a=0;if(o!=="none"){const _=/translate\(\s*([-+]?\d*\.?\d+|\d+)(px|%)?,?\s*([-+]?\d*\.?\d+|\d+)?(px|%)?\s*\)/,d=o.match(_);d&&(s=C(d[1],d[2],i),a=C(d[3],d[4],i))}const{clientX:r,clientY:l}=v(t,e),h=r-n.left-s+i.scrollLeft,u=l-n.top-a+i.scrollTop;return{x:h,y:u}},v=(i,t)=>{const{clientX:e,clientY:n}=E(i)?k(i):i,o=e||t.x,s=n||t.y;return{clientX:o,clientY:s}},k=i=>{if(i.touches.length){let{clientX:e,clientY:n}=i.touches[0];if(i.touches.length>1){const o=i.touches[1],s=o.clientX,a=o.clientY;e=(e+s)/2,n=(n+a)/2}return{clientX:e,clientY:n}}const t=i.changedTouches[0];return{clientX:t.clientX,clientY:t.clientY}},$=500,L=10;class z{constructor(t,{onTouchDragStart:e},n={}){c(this,"_touchDragTimeOut"),c(this,"_onTouchDragStart"),c(this,"_payload",null),c(this,"_delay",$),c(this,"_firstTouch",null),c(this,"_lastTouch",null),c(this,"_epsilon",L),this._payload=t,this._onTouchDragStart=e,this._delay=n.delay||$,this._epsilon=n.epsilon||L}onTouchStart(t){var e;!t||!((e=t?.touches)!=null&&e.length)||this._touchDragTimeOut||(this._firstTouch=t.touches[t.touches.length-1],this._touchDragTimeOut=setTimeout(()=>{this._clearTimeout(),this._lastTouch||(this._lastTouch=t.touches[0]),this._checkXDistance(t)()},this._delay))}onTouchEnd(){this._resetTouches()}onTouchMove(t){var e;!t||!((e=t?.touches)!=null&&e.length)||(this._lastTouch=t.touches[0])}_clearTimeout(){this._touchDragTimeOut&&(clearTimeout(this._touchDragTimeOut),this._touchDragTimeOut=null)}_resetTouches(){this._clearTimeout(),this._lastTouch=null,this._firstTouch=null,this._payload=null}_checkXDistance(t){return()=>{if(!this._firstTouch||!this._lastTouch)return;let e=!1;e=Math.abs(this._firstTouch.clientX-this._lastTouch.clientX)<this._epsilon,e&&(this._onTouchDragStart(this._payload,t),this._resetTouches())}}}const X="rml-drag-in-styles",F="rml-drag-in-drag-element",g="rml-drag-in-overlay",m="rml-drag-in-drag-ghost",x="rml-drag-in-fade-in",Y="rml-drag-in-fade-out",T={DISPLAY_NONE:"rml-display-none"},M=.5,w="250ms",S="forwards",b=i=>i?!0:(console.warn("No instance set, cancel drag-in"),!1);class A{constructor(t){c(this,"_iframe"),c(this,"_currentDrag",{}),c(this,"_currentTouch",null),c(this,"_firefoxDragPosition",{x:0,y:0}),c(this,"_instance",null),c(this,"options",{}),c(this,"_firefoxFallback",e=>{if(!this._currentDrag.event)return;const n=e||window.event;this._firefoxDragPosition.x=n.pageX||0,this._firefoxDragPosition.y=n.pageY||0}),this._iframe=t,this._injectStyles(),this._initializeDragGhost(),this._firefoxFallback=this._firefoxFallback.bind(this),document.addEventListener("dragover",this._firefoxFallback)}_injectStyles(){if(!document.getElementById(X)){const t=document.createElement("style");t.type="text/css",t.id=X,t.innerHTML=`
|
|
2
|
+
.${T.DISPLAY_NONE}{display:none}
|
|
3
|
+
.${g}{position:absolute;top:0;left:0;width:100%;height:100%;z-index:999;}
|
|
4
|
+
.${m}{position:absolute;top:0;left:0;width:1px;height:1px;z-index:999;pointer-events:none;background-color:transparent;}
|
|
5
|
+
@keyframes ${x} {from{opacity: 0;}to {opacity: ${M};}}
|
|
6
|
+
@keyframes ${Y} {from{opacity: ${M};}to {opacity: 0;}}
|
|
7
|
+
`,document.head.appendChild(t)}}_initializeDragGhost(){const t=this._iframe.parentNode;let e=t.querySelector("."+m);e||(e=document.createElement("div"),e.classList.add(m),e.innerText=" ",t.appendChild(e))}setInstance(t){this._instance=t}dragStart(t,e,n="rml_id"){const o=this._iframe.parentNode;if(f(o).position!=="relative"){console.warn("Parent of iframe should have position relative, otherwise drag-in can not detect the x/y coordinates correctly");return}this._iframe.style.pointerEvents="none";let s=o.querySelector("."+g);s||(s=document.createElement("div"),s.classList.add(g),o.appendChild(s)),s.classList.remove(T.DISPLAY_NONE),e.target.getAttribute("draggable")||console.warn(`Draggable not detected correctly! Did you add draggable="true" to the element? In Sarafi only 'draggable' is too less`);const a=o.querySelector("."+m);this._currentDrag.event=e;const r=e.target.cloneNode();r.style.position="fixed",r.style.pointerEvents="none",r.style.opacity="0",r.style.animation=`${x} ${w} ${S}`,r.id=F,r.style.zIndex="9999",document.body.appendChild(r),this._currentDrag.element=r;const l=e.target.getBoundingClientRect();this._currentDrag.offset||(this._currentDrag.offset={x:0,y:0});const{clientX:h,clientY:u}=v(e,this._firefoxDragPosition);this._currentDrag.offset.x=h-l.left,this._currentDrag.offset.y=u-l.top,r.style.top=u+"px",r.style.left=h+"px",e instanceof DragEvent&&e.dataTransfer&&e.dataTransfer.setDragImage&&e.dataTransfer.setDragImage(a,0,0);const{x:_,y:d}=I(o,this._currentDrag.event||e,this._firefoxDragPosition),p=Math.max(1,_),y=Math.max(1,d);b(this._instance)&&this._instance.dragInObject(t,p,y,n)}dragUpdate(t){var e,n;const o=this._iframe.parentNode,{x:s,y:a}=I(o,t,this._firefoxDragPosition);if(s===0&&a===0)return;const r=Math.max(1,s),l=Math.max(1,a);if(this._currentDrag.element){const{clientX:h,clientY:u}=v(t,this._firefoxDragPosition),_=((e=this._currentDrag.offset)==null?void 0:e.x)||0,d=((n=this._currentDrag.offset)==null?void 0:n.y)||0;this._currentDrag.element.style.left=`${h-_}px`,this._currentDrag.element.style.top=`${u-d}px`;const p=(this.options.dragInOverlapX||0)+1,y=(this.options.dragInOverlapY||0)+1;r>p&&l>y?this._currentDrag.element.style.animation=`${Y} ${w} ${S}`:this._currentDrag.element.style.animation=`${x} ${w} ${S}`}if(!(r===1&&l===1)&&b(this._instance)){let h=r,u=l;if(E(t)){const _=this.options.fingerSize||0;h=Math.max(2,r+_),u=Math.max(2,l-_)}this._instance.updateDrag(h,u)}}dragEnd(){this._iframe.style.pointerEvents="all";const t=this._iframe.parentNode;b(this._instance)&&this._instance.dragInObjectEnd(),this._currentDrag.element&&document.body.removeChild(this._currentDrag.element),this._currentDrag={},this._firefoxDragPosition={x:0,y:0};const e=t.querySelector("."+g);e&&e.classList.add(T.DISPLAY_NONE)}touchStart(t,e,n="rml_id"){var o,s;e.preventDefault();const a=(l,h)=>{this.dragStart(t,h,n)},r={};(o=this.options)!=null&&o.touchDragDelay&&(r.delay=this.options.touchDragDelay),(s=this.options)!=null&&s.touchDragEpsilon&&(r.epsilon=this.options.touchDragEpsilon),this._currentTouch=new z(void 0,{onTouchDragStart:a},r),this._currentTouch.onTouchStart(e)}touchMove(t){this._currentTouch&&this._currentTouch.onTouchMove(t),this._currentDrag.event&&this.dragUpdate(t)}touchEnd(){this._currentTouch&&this._currentTouch.onTouchEnd(),this._currentTouch=null,this.dragEnd()}dispose(){document.removeEventListener("dragover",this._firefoxFallback)}}export{A as DragIn};
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { default as default_2 } from '@roomle/web-sdk/lib/definitions/planner-core/src/roomle-planner';
|
|
2
|
+
import { default as default_3 } from '@roomle/web-sdk/lib/definitions/configurator-core/src/services/configurator-ui-callback';
|
|
3
|
+
import { default as default_4 } from '@roomle/web-sdk/lib/definitions/configurator-core/src/roomle-configurator';
|
|
4
|
+
import { default as default_5 } from '@roomle/web-sdk/lib/definitions/glb-viewer-core/src/roomle-glb-viewer';
|
|
5
|
+
import { ExposedAnalyticsCallbacks } from '../../../src/configurator/embedding/exposed-analytics-callbacks';
|
|
6
|
+
import { ExposedApi } from '../../../../src/configurator/embedding/exposed-api';
|
|
7
|
+
import { ExposedApi as ExposedApi_2 } from '../../../src/configurator/embedding/exposed-api';
|
|
8
|
+
import { GlobalCallback } from '@roomle/web-sdk/lib/definitions/common-core/src/services/global-callback';
|
|
9
|
+
import { RapiId } from '@roomle/web-sdk/lib/definitions/typings/rapi-types';
|
|
10
|
+
import { UiInitData } from '../../../src/configurator/embedding/types';
|
|
11
|
+
|
|
12
|
+
declare interface AvailablePlugins {
|
|
13
|
+
dragIn?: DragIn;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare class DragIn {
|
|
17
|
+
private _iframe;
|
|
18
|
+
private _currentDrag;
|
|
19
|
+
private _currentTouch;
|
|
20
|
+
private _firefoxDragPosition;
|
|
21
|
+
private _instance;
|
|
22
|
+
options: {
|
|
23
|
+
dragInOverlapX?: number;
|
|
24
|
+
dragInOverlapY?: number;
|
|
25
|
+
fingerSize?: number;
|
|
26
|
+
touchDragDelay?: number;
|
|
27
|
+
touchDragEpsilon?: number;
|
|
28
|
+
};
|
|
29
|
+
private _injectStyles;
|
|
30
|
+
private _initializeDragGhost;
|
|
31
|
+
constructor(iframe: HTMLIFrameElement);
|
|
32
|
+
setInstance(instance: ExposedApi): void;
|
|
33
|
+
private _firefoxFallback;
|
|
34
|
+
dragStart(id: RapiId, event: DragEvent | TouchEvent, type?: string): void;
|
|
35
|
+
dragUpdate(event: DragEvent | TouchEvent): void;
|
|
36
|
+
dragEnd(): void;
|
|
37
|
+
touchStart(id: RapiId, event: TouchEvent, type?: string): void;
|
|
38
|
+
touchMove(event: TouchEvent): void;
|
|
39
|
+
touchEnd(): void;
|
|
40
|
+
dispose(): void;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
declare type PluginDefinitions = Array<keyof AvailablePlugins | {
|
|
44
|
+
name: keyof AvailablePlugins;
|
|
45
|
+
loader: () => Promise<any>;
|
|
46
|
+
}>;
|
|
47
|
+
|
|
48
|
+
declare type RoomleConfiguratorApi = RoomleEmbeddingApi<default_4, default_3>;
|
|
49
|
+
|
|
50
|
+
declare class RoomleEmbeddingApi<SdkType, SdkCallbacks> implements RoomleEmbeddingApiKeys {
|
|
51
|
+
static createPlanner(configuratorId: string, container: HTMLElement, initData: UiInitData, plugins?: PluginDefinitions): Promise<RoomlePlannerApi>;
|
|
52
|
+
/**
|
|
53
|
+
* Method to create a new instance of a Roomle Configurator
|
|
54
|
+
* @param configuratorId the id which identifies your configurator, you will get this ID from your Roomle Contact Person
|
|
55
|
+
* @param container DOM container in which the configurator should be placed
|
|
56
|
+
* @param initData settings with which the configurator should be started
|
|
57
|
+
*/
|
|
58
|
+
static createConfigurator(configuratorId: string, container: HTMLElement, initData: UiInitData, plugins?: PluginDefinitions): Promise<RoomleConfiguratorApi>;
|
|
59
|
+
/**
|
|
60
|
+
* Method to create a new instance of a Roomle Configurator
|
|
61
|
+
* @deprecated please use "createConfigurator"
|
|
62
|
+
* @param configuratorId the id which identifies your configurator, you will get this ID from your Roomle Contact Person
|
|
63
|
+
* @param container DOM container in which the configurator should be placed
|
|
64
|
+
* @param initData settings with which the configurator should be started
|
|
65
|
+
*/
|
|
66
|
+
static create(configuratorId: string, container: HTMLElement, initData: UiInitData, plugins: PluginDefinitions): Promise<RoomleConfiguratorApi>;
|
|
67
|
+
/**
|
|
68
|
+
* Method to create a new instance of a Roomle Viewer
|
|
69
|
+
* @param configuratorId the id which identifies your configurator, you will get this ID from your Roomle Contact Person
|
|
70
|
+
* @param container DOM container in which the configurator should be placed
|
|
71
|
+
* @param initData settings with which the configurator should be started
|
|
72
|
+
*/
|
|
73
|
+
static createViewer(configuratorId: string, container: HTMLElement, initData: UiInitData, plugins?: PluginDefinitions): Promise<RoomleViewerApi>;
|
|
74
|
+
private static _create;
|
|
75
|
+
ui: ExposedApi_2;
|
|
76
|
+
extended: SdkType;
|
|
77
|
+
configurator: default_4;
|
|
78
|
+
analytics: {
|
|
79
|
+
callbacks: ExposedAnalyticsCallbacks;
|
|
80
|
+
};
|
|
81
|
+
global: {
|
|
82
|
+
callbacks: GlobalCallback;
|
|
83
|
+
};
|
|
84
|
+
plugins: AvailablePlugins;
|
|
85
|
+
private _waitForIframe;
|
|
86
|
+
private _container;
|
|
87
|
+
private _messageHandler;
|
|
88
|
+
private _configuratorSettings;
|
|
89
|
+
private _initData;
|
|
90
|
+
private _iframe;
|
|
91
|
+
pluginsLoaded: Array<Promise<void>>;
|
|
92
|
+
private constructor();
|
|
93
|
+
teardown(): void;
|
|
94
|
+
private _createIframe;
|
|
95
|
+
private _onResize;
|
|
96
|
+
private _onUseFullPage;
|
|
97
|
+
private _onBackToWebsite;
|
|
98
|
+
private _executeMessage;
|
|
99
|
+
}
|
|
100
|
+
export default RoomleEmbeddingApi;
|
|
101
|
+
|
|
102
|
+
declare interface RoomleEmbeddingApiKeys {
|
|
103
|
+
extended: any;
|
|
104
|
+
configurator: any;
|
|
105
|
+
ui: any;
|
|
106
|
+
analytics: any;
|
|
107
|
+
global: any;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
declare type RoomlePlannerApi = RoomleEmbeddingApi<default_2, default_3>;
|
|
111
|
+
|
|
112
|
+
declare type RoomleViewerApi = RoomleEmbeddingApi<default_5, default_3>;
|
|
113
|
+
|
|
114
|
+
export { }
|
package/package.json
CHANGED
|
@@ -1,22 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roomle/embedding-lib",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
3
|
+
"version": "5.1.0-alpha.1",
|
|
4
|
+
"description": "This is a small library which can be used to communicate with the Roomle Configurator",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./roomle-embedding-lib.umd.js",
|
|
7
|
+
"module": "./roomle-embedding-lib.es.js",
|
|
8
|
+
"browser": "./roomle-embedding-lib.es.js",
|
|
9
|
+
"types": "./index.d.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"./"
|
|
12
|
+
],
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": "./roomle-embedding-lib.es.js",
|
|
16
|
+
"require": "./roomle-embedding-lib.umd.js",
|
|
17
|
+
"types": "./index.d.ts"
|
|
18
|
+
},
|
|
19
|
+
"./min": {
|
|
20
|
+
"import": "./roomle-embedding-lib.es.min.js",
|
|
21
|
+
"require": "./roomle-embedding-lib.umd.min.js"
|
|
22
|
+
}
|
|
15
23
|
},
|
|
16
24
|
"scripts": {
|
|
17
25
|
"release": "semantic-release"
|
|
18
26
|
},
|
|
19
|
-
"
|
|
27
|
+
"volta": {
|
|
28
|
+
"node": "18.18.0",
|
|
29
|
+
"npm": "8.3.1"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@roomle/web-sdk": "2.83.0-alpha.5"
|
|
33
|
+
},
|
|
20
34
|
"repository": {
|
|
21
35
|
"type": "git",
|
|
22
36
|
"url": "git+https://github.com/roomle-build/npm-packages.git"
|