@roomle/embedding-lib 4.44.0 → 5.1.0-debug.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 +6 -0
- package/drag-in-C2fEQF9W.mjs +7 -0
- package/drag-in-CAakt8yw.mjs +250 -0
- package/index.d.ts +102 -0
- package/package.json +27 -13
- package/roomle-embedding-lib.es.js +453 -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/test",
|
|
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,6 @@
|
|
|
1
|
+
## [5.1.0-debug.1](https://github.com/roomle-dev/roomle-ui/compare/embedding-lib-v5.0.1-debug.1...embedding-lib-v5.1.0-debug.1) (2024-08-07)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* implement feature of drag in ([151d665](https://github.com/roomle-dev/roomle-ui/commit/151d665c35da6b79cbd6b49635dfdf8e3d9c4742))
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
var X=Object.defineProperty,Y=(i,t,e)=>t in i?X(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,a=(i,t,e)=>Y(i,typeof t!="symbol"?t+"":t,e);class O{constructor(t=16){a(this,"_computedStyleCache",new Map),a(this,"_maxLifetime",16),a(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 r=getComputedStyle(t);return this._computedStyleCache.set(t,{style:r,updated:n}),this._cacheCleanInterval||(this._cacheCleanInterval=setInterval(()=>this._cleanUpCache,Math.max(this._maxLifetime*1e3,5e3))),r}_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)}}let y;const g=i=>(y||(y=new O),y.get(i)),b=(i,t,e)=>{const n=parseFloat(i),r=window.devicePixelRatio||1;if(t==="px")return n;if(t==="%"){const o=e===document.documentElement?window.innerWidth:e.offsetWidth;return n/100*o}if(t==="rem"){const o=parseFloat(g(document.documentElement).fontSize);return n*o}if(t==="em"){const o=parseFloat(g(e).fontSize);return n*o}if(t==="vh"||t==="vw"||t==="vmin"||t==="vmax"){const o={vh:window.innerHeight,vw:window.innerWidth,vmin:Math.min(window.innerWidth,window.innerHeight),vmax:Math.max(window.innerWidth,window.innerHeight)};return n/100*o[t]}const s={cm:37.7952755906,mm:3.77952755906,in:96};return t in s?n*s[t]*r:0},E=(i,t,e={x:0,y:0})=>{const n=i.getBoundingClientRect(),r=g(i).transform;let s=0,o=0;if(r!=="none"){const d=/translate\(\s*([-+]?\d*\.?\d+|\d+)(px|%)?,?\s*([-+]?\d*\.?\d+|\d+)?(px|%)?\s*\)/,h=r.match(d);h&&(s=b(h[1],h[2],i),o=b(h[3],h[4],i))}const{clientX:l,clientY:u}=v(t,e),_=l-n.left-s+i.scrollLeft,c=u-n.top-o+i.scrollTop;return{x:_,y:c}},v=(i,t)=>{const{clientX:e,clientY:n}=window.TouchEvent&&i instanceof TouchEvent?P(i):i,r=e||t.x,s=n||t.y;return{clientX:r,clientY:s}},P=i=>{if(i.touches.length){let{clientX:e,clientY:n}=i.touches[0];if(i.touches.length>1){const r=i.touches[1],s=r.clientX,o=r.clientY;e=(e+s)/2,n=(n+o)/2}return{clientX:e,clientY:n}}const t=i.changedTouches[0];return{clientX:t.clientX,clientY:t.clientY}},N=500,M=10;class k{constructor(t,{onTouchDragStart:e},n={}){a(this,"_touchDragTimeOut"),a(this,"_onTouchDragStart"),a(this,"_payload",null),a(this,"_delay"),a(this,"_firstTouch",null),a(this,"_lastTouch",null),this._payload=t,this._onTouchDragStart=e,this._delay=n.delay||N}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)<M,e&&(this._onTouchDragStart(this._payload,t),this._resetTouches())}}}const I="rml-drag-in-styles",F="rml-drag-in-drag-element",m="rml-drag-in-overlay",p="rml-drag-in-drag-ghost",x="rml-drag-in-fade-in",C="rml-drag-in-fade-out",D={DISPLAY_NONE:"rml-display-none"},$=.5,T="250ms",w="forwards",S=i=>i?!0:(console.warn("No instance set, cancel drag-in"),!1);class z{constructor(t){if(a(this,"_iframe"),a(this,"_currentDrag",{}),a(this,"_currentTouch",null),a(this,"_firefoxDragPosition",{x:0,y:0}),a(this,"_instance",null),a(this,"options",{}),a(this,"_firefoxFallback",r=>{if(!this._currentDrag.event)return;const s=r||window.event;this._firefoxDragPosition.x=s.pageX||0,this._firefoxDragPosition.y=s.pageY||0}),this._iframe=t,!document.getElementById(I)){const r=document.createElement("style");r.type="text/css",r.id=I,r.innerHTML=`
|
|
2
|
+
.${D.DISPLAY_NONE}{display:none}
|
|
3
|
+
.${m}{position:absolute;top:0;left:0;width:100%;height:100%;z-index:999;}
|
|
4
|
+
.${p}{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: ${$};}}
|
|
6
|
+
@keyframes ${C} {from{opacity: ${$};}to {opacity: 0;}}
|
|
7
|
+
`,document.head.appendChild(r)}const e=this._iframe.parentNode;let n=e.querySelector("."+p);n||(n=document.createElement("div"),n.classList.add(p),n.innerText=" ",e.appendChild(n)),this._firefoxFallback=this._firefoxFallback.bind(this),document.addEventListener("dragover",this._firefoxFallback)}setInstance(t){this._instance=t}dragStart(t,e){const n=this._iframe.parentNode;if(g(n).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 r=n.querySelector("."+m);if(r||(r=document.createElement("div"),r.classList.add(m),n.appendChild(r)),r.classList.remove(D.DISPLAY_NONE),e instanceof DragEvent){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 _=n.querySelector("."+p);this._currentDrag.event=e;const c=e.target.cloneNode();c.style.position="fixed",c.style.pointerEvents="none",c.style.opacity="0",c.style.animation=`${x} ${T} ${w}`,c.id=F,c.style.zIndex="9999",document.body.appendChild(c),this._currentDrag.element=c;const d=e.target.getBoundingClientRect();this._currentDrag.offset||(this._currentDrag.offset={x:0,y:0});const{clientX:h,clientY:f}=v(e,this._firefoxDragPosition);this._currentDrag.offset.x=h-d.left,this._currentDrag.offset.y=f-d.top,c.style.top=f+"px",c.style.left=h+"px",e.dataTransfer&&e.dataTransfer.setDragImage&&e.dataTransfer.setDragImage(_,0,0)}const{x:s,y:o}=E(n,this._currentDrag.event||e,this._firefoxDragPosition),l=Math.max(1,s),u=Math.max(1,o);S(this._instance)&&this._instance.dragInObject(t,l,u)}dragUpdate(t){var e,n;const r=this._iframe.parentNode,{x:s,y:o}=E(r,t,this._firefoxDragPosition);if(s===0&&o===0)return;const l=Math.max(1,s),u=Math.max(1,o);if(this._currentDrag.element){const{clientX:_,clientY:c}=v(t,this._firefoxDragPosition),d=((e=this._currentDrag.offset)==null?void 0:e.x)||0,h=((n=this._currentDrag.offset)==null?void 0:n.y)||0;this._currentDrag.element.style.left=`${_-d}px`,this._currentDrag.element.style.top=`${c-h}px`;const f=(this.options.dragInOverlapX||0)+1,L=(this.options.dragInOverlapY||0)+1;l>f&&u>L?this._currentDrag.element.style.animation=`${C} ${T} ${w}`:this._currentDrag.element.style.animation=`${x} ${T} ${w}`}l===1&&u===1||S(this._instance)&&this._instance.updateDrag(l,u)}dragEnd(){this._iframe.style.pointerEvents="all";const t=this._iframe.parentNode;S(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("."+m);e&&e.classList.add(D.DISPLAY_NONE)}touchStart(t,e){e.preventDefault();const n=(r,s)=>{this.dragStart(t,s)};this._currentTouch=new k(void 0,{onTouchDragStart:n}),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{z as DragIn};
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
var M = Object.defineProperty;
|
|
2
|
+
var X = (i, t, e) => t in i ? M(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var a = (i, t, e) => X(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
class b {
|
|
5
|
+
constructor(t = 16) {
|
|
6
|
+
a(this, "_computedStyleCache", /* @__PURE__ */ new Map());
|
|
7
|
+
a(this, "_maxLifetime", 16);
|
|
8
|
+
a(this, "_cacheCleanInterval", null);
|
|
9
|
+
this._maxLifetime = t;
|
|
10
|
+
}
|
|
11
|
+
get(t) {
|
|
12
|
+
const e = this._computedStyleCache.get(t), n = Date.now();
|
|
13
|
+
if (e && n - e.updated < this._maxLifetime)
|
|
14
|
+
return e.style;
|
|
15
|
+
const s = getComputedStyle(t);
|
|
16
|
+
return this._computedStyleCache.set(t, { style: s, updated: n }), 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: n }] of this._computedStyleCache.entries())
|
|
24
|
+
t - n >= this._maxLifetime && this._computedStyleCache.delete(e);
|
|
25
|
+
this._computedStyleCache.size === 0 && this._cacheCleanInterval && (clearInterval(this._cacheCleanInterval), this._cacheCleanInterval = null);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
let T;
|
|
29
|
+
const y = (i) => (T || (T = new b()), T.get(i)), A = (i, t, e) => {
|
|
30
|
+
const n = parseFloat(i), s = window.devicePixelRatio || 1;
|
|
31
|
+
if (t === "px")
|
|
32
|
+
return n;
|
|
33
|
+
if (t === "%") {
|
|
34
|
+
const o = e === document.documentElement ? window.innerWidth : e.offsetWidth;
|
|
35
|
+
return n / 100 * o;
|
|
36
|
+
}
|
|
37
|
+
if (t === "rem") {
|
|
38
|
+
const o = parseFloat(
|
|
39
|
+
y(document.documentElement).fontSize
|
|
40
|
+
);
|
|
41
|
+
return n * o;
|
|
42
|
+
}
|
|
43
|
+
if (t === "em") {
|
|
44
|
+
const o = parseFloat(
|
|
45
|
+
y(e).fontSize
|
|
46
|
+
);
|
|
47
|
+
return n * o;
|
|
48
|
+
}
|
|
49
|
+
if (t === "vh" || t === "vw" || t === "vmin" || t === "vmax") {
|
|
50
|
+
const o = {
|
|
51
|
+
vh: window.innerHeight,
|
|
52
|
+
vw: window.innerWidth,
|
|
53
|
+
vmin: Math.min(window.innerWidth, window.innerHeight),
|
|
54
|
+
vmax: Math.max(window.innerWidth, window.innerHeight)
|
|
55
|
+
};
|
|
56
|
+
return n / 100 * o[t];
|
|
57
|
+
}
|
|
58
|
+
const r = {
|
|
59
|
+
cm: 37.7952755906,
|
|
60
|
+
mm: 3.77952755906,
|
|
61
|
+
in: 96
|
|
62
|
+
};
|
|
63
|
+
return t in r ? n * r[t] * s : 0;
|
|
64
|
+
}, N = (i, t, e = { x: 0, y: 0 }) => {
|
|
65
|
+
const n = i.getBoundingClientRect(), r = y(i).transform;
|
|
66
|
+
let o = 0, h = 0;
|
|
67
|
+
if (r !== "none") {
|
|
68
|
+
const c = /translate\(\s*([-+]?\d*\.?\d+|\d+)(px|%)?,?\s*([-+]?\d*\.?\d+|\d+)?(px|%)?\s*\)/, l = r.match(c);
|
|
69
|
+
l && (o = A(l[1], l[2], i), h = A(l[3], l[4], i));
|
|
70
|
+
}
|
|
71
|
+
const { clientX: u, clientY: d } = E(t, e), f = u - n.left - o + i.scrollLeft, _ = d - n.top - h + i.scrollTop;
|
|
72
|
+
return { x: f, y: _ };
|
|
73
|
+
}, E = (i, t) => {
|
|
74
|
+
const { clientX: e, clientY: n } = window.TouchEvent && i instanceof TouchEvent ? R(i) : i, s = e || t.x, r = n || t.y;
|
|
75
|
+
return { clientX: s, clientY: r };
|
|
76
|
+
}, R = (i) => {
|
|
77
|
+
if (i.touches.length) {
|
|
78
|
+
let { clientX: e, clientY: n } = i.touches[0];
|
|
79
|
+
if (i.touches.length > 1) {
|
|
80
|
+
const s = i.touches[1], r = s.clientX, o = s.clientY;
|
|
81
|
+
e = (e + r) / 2, n = (n + o) / 2;
|
|
82
|
+
}
|
|
83
|
+
return { clientX: e, clientY: n };
|
|
84
|
+
}
|
|
85
|
+
const t = i.changedTouches[0];
|
|
86
|
+
return { clientX: t.clientX, clientY: t.clientY };
|
|
87
|
+
}, v = 500, P = 10;
|
|
88
|
+
class $ {
|
|
89
|
+
constructor(t, { onTouchDragStart: e }, n = {}) {
|
|
90
|
+
a(this, "_touchDragTimeOut");
|
|
91
|
+
a(this, "_onTouchDragStart");
|
|
92
|
+
a(this, "_payload", null);
|
|
93
|
+
a(this, "_delay");
|
|
94
|
+
a(this, "_firstTouch", null);
|
|
95
|
+
a(this, "_lastTouch", null);
|
|
96
|
+
this._payload = t, this._onTouchDragStart = e, this._delay = n.delay || v;
|
|
97
|
+
}
|
|
98
|
+
onTouchStart(t) {
|
|
99
|
+
var e;
|
|
100
|
+
!t || !((e = t == null ? void 0 : t.touches) != null && e.length) || this._touchDragTimeOut || (this._firstTouch = t.touches[t.touches.length - 1], this._touchDragTimeOut = setTimeout(() => {
|
|
101
|
+
this._clearTimeout(), this._lastTouch || (this._lastTouch = t.touches[0]), this._checkXDistance(t)();
|
|
102
|
+
}, this._delay));
|
|
103
|
+
}
|
|
104
|
+
onTouchEnd() {
|
|
105
|
+
this._resetTouches();
|
|
106
|
+
}
|
|
107
|
+
onTouchMove(t) {
|
|
108
|
+
var e;
|
|
109
|
+
!t || !((e = t == null ? void 0 : t.touches) != null && e.length) || (this._lastTouch = t.touches[0]);
|
|
110
|
+
}
|
|
111
|
+
_clearTimeout() {
|
|
112
|
+
this._touchDragTimeOut && (clearTimeout(this._touchDragTimeOut), this._touchDragTimeOut = null);
|
|
113
|
+
}
|
|
114
|
+
_resetTouches() {
|
|
115
|
+
this._clearTimeout(), this._lastTouch = null, this._firstTouch = null, this._payload = null;
|
|
116
|
+
}
|
|
117
|
+
_checkXDistance(t) {
|
|
118
|
+
return () => {
|
|
119
|
+
if (!this._firstTouch || !this._lastTouch)
|
|
120
|
+
return;
|
|
121
|
+
let e = !1;
|
|
122
|
+
e = Math.abs(
|
|
123
|
+
this._firstTouch.clientX - this._lastTouch.clientX
|
|
124
|
+
) < P, e && (this._onTouchDragStart(this._payload, t), this._resetTouches());
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
const L = "rml-drag-in-styles", G = "rml-drag-in-drag-element", m = "rml-drag-in-overlay", p = "rml-drag-in-drag-ghost", D = "rml-drag-in-fade-in", O = "rml-drag-in-fade-out", x = {
|
|
129
|
+
DISPLAY_NONE: "rml-display-none"
|
|
130
|
+
}, Y = 0.5, S = "250ms", I = "forwards", C = (i) => i ? !0 : (console.warn("No instance set, cancel drag-in"), !1);
|
|
131
|
+
class U {
|
|
132
|
+
constructor(t) {
|
|
133
|
+
a(this, "_iframe");
|
|
134
|
+
a(this, "_currentDrag", {});
|
|
135
|
+
a(this, "_currentTouch", null);
|
|
136
|
+
a(this, "_firefoxDragPosition", { x: 0, y: 0 });
|
|
137
|
+
a(this, "_instance", null);
|
|
138
|
+
a(this, "options", {});
|
|
139
|
+
a(this, "_firefoxFallback", (t) => {
|
|
140
|
+
if (!this._currentDrag.event)
|
|
141
|
+
return;
|
|
142
|
+
const e = t || window.event;
|
|
143
|
+
this._firefoxDragPosition.x = e.pageX || 0, this._firefoxDragPosition.y = e.pageY || 0;
|
|
144
|
+
});
|
|
145
|
+
if (this._iframe = t, !!!document.getElementById(L)) {
|
|
146
|
+
const r = document.createElement("style");
|
|
147
|
+
r.type = "text/css", r.id = L, r.innerHTML = `
|
|
148
|
+
.${x.DISPLAY_NONE}{display:none}
|
|
149
|
+
.${m}{position:absolute;top:0;left:0;width:100%;height:100%;z-index:999;}
|
|
150
|
+
.${p}{position:absolute;top:0;left:0;width:1px;height:1px;z-index:999;pointer-events:none;background-color:transparent;}
|
|
151
|
+
@keyframes ${D} {from{opacity: 0;}to {opacity: ${Y};}}
|
|
152
|
+
@keyframes ${O} {from{opacity: ${Y};}to {opacity: 0;}}
|
|
153
|
+
`, document.head.appendChild(r);
|
|
154
|
+
}
|
|
155
|
+
const n = this._iframe.parentNode;
|
|
156
|
+
let s = n.querySelector(
|
|
157
|
+
"." + p
|
|
158
|
+
);
|
|
159
|
+
s || (s = document.createElement("div"), s.classList.add(p), s.innerText = " ", n.appendChild(s)), this._firefoxFallback = this._firefoxFallback.bind(this), document.addEventListener("dragover", this._firefoxFallback);
|
|
160
|
+
}
|
|
161
|
+
setInstance(t) {
|
|
162
|
+
this._instance = t;
|
|
163
|
+
}
|
|
164
|
+
dragStart(t, e) {
|
|
165
|
+
const n = this._iframe.parentNode;
|
|
166
|
+
if (y(n).position !== "relative") {
|
|
167
|
+
console.warn(
|
|
168
|
+
"Parent of iframe should have position relative, otherwise drag-in can not detect the x/y coordinates correctly"
|
|
169
|
+
);
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
this._iframe.style.pointerEvents = "none";
|
|
173
|
+
let r = n.querySelector(
|
|
174
|
+
"." + m
|
|
175
|
+
);
|
|
176
|
+
if (r || (r = document.createElement("div"), r.classList.add(m), n.appendChild(r)), r.classList.remove(x.DISPLAY_NONE), e instanceof DragEvent) {
|
|
177
|
+
e.target.getAttribute(
|
|
178
|
+
"draggable"
|
|
179
|
+
) || console.warn(
|
|
180
|
+
`Draggable not detected correctly! Did you add draggable="true" to the element? In Sarafi only 'draggable' is too less`
|
|
181
|
+
);
|
|
182
|
+
const _ = n.querySelector(
|
|
183
|
+
"." + p
|
|
184
|
+
);
|
|
185
|
+
this._currentDrag.event = e;
|
|
186
|
+
const c = e.target.cloneNode();
|
|
187
|
+
c.style.position = "fixed", c.style.pointerEvents = "none", c.style.opacity = "0", c.style.animation = `${D} ${S} ${I}`, c.id = G, c.style.zIndex = "9999", document.body.appendChild(c), this._currentDrag.element = c;
|
|
188
|
+
const l = e.target.getBoundingClientRect();
|
|
189
|
+
this._currentDrag.offset || (this._currentDrag.offset = { x: 0, y: 0 });
|
|
190
|
+
const { clientX: g, clientY: w } = E(
|
|
191
|
+
e,
|
|
192
|
+
this._firefoxDragPosition
|
|
193
|
+
);
|
|
194
|
+
this._currentDrag.offset.x = g - l.left, this._currentDrag.offset.y = w - l.top, c.style.top = w + "px", c.style.left = g + "px", e.dataTransfer && e.dataTransfer.setDragImage && e.dataTransfer.setDragImage(_, 0, 0);
|
|
195
|
+
}
|
|
196
|
+
const { x: o, y: h } = N(
|
|
197
|
+
n,
|
|
198
|
+
this._currentDrag.event || e,
|
|
199
|
+
this._firefoxDragPosition
|
|
200
|
+
), u = Math.max(1, o), d = Math.max(1, h);
|
|
201
|
+
C(this._instance) && this._instance.dragInObject(t, u, d);
|
|
202
|
+
}
|
|
203
|
+
dragUpdate(t) {
|
|
204
|
+
var h, u;
|
|
205
|
+
const e = this._iframe.parentNode, { x: n, y: s } = N(e, t, this._firefoxDragPosition);
|
|
206
|
+
if (n === 0 && s === 0)
|
|
207
|
+
return;
|
|
208
|
+
const r = Math.max(1, n), o = Math.max(1, s);
|
|
209
|
+
if (this._currentDrag.element) {
|
|
210
|
+
const { clientX: d, clientY: f } = E(
|
|
211
|
+
t,
|
|
212
|
+
this._firefoxDragPosition
|
|
213
|
+
), _ = ((h = this._currentDrag.offset) == null ? void 0 : h.x) || 0, c = ((u = this._currentDrag.offset) == null ? void 0 : u.y) || 0;
|
|
214
|
+
this._currentDrag.element.style.left = `${d - _}px`, this._currentDrag.element.style.top = `${f - c}px`;
|
|
215
|
+
const l = (this.options.dragInOverlapX || 0) + 1, g = (this.options.dragInOverlapY || 0) + 1;
|
|
216
|
+
r > l && o > g ? this._currentDrag.element.style.animation = `${O} ${S} ${I}` : this._currentDrag.element.style.animation = `${D} ${S} ${I}`;
|
|
217
|
+
}
|
|
218
|
+
r === 1 && o === 1 || C(this._instance) && this._instance.updateDrag(r, o);
|
|
219
|
+
}
|
|
220
|
+
dragEnd() {
|
|
221
|
+
this._iframe.style.pointerEvents = "all";
|
|
222
|
+
const t = this._iframe.parentNode;
|
|
223
|
+
C(this._instance) && this._instance.dragInObjectEnd(), this._currentDrag.element && document.body.removeChild(this._currentDrag.element), this._currentDrag = {}, this._firefoxDragPosition = { x: 0, y: 0 };
|
|
224
|
+
const e = t.querySelector(
|
|
225
|
+
"." + m
|
|
226
|
+
);
|
|
227
|
+
e && e.classList.add(x.DISPLAY_NONE);
|
|
228
|
+
}
|
|
229
|
+
touchStart(t, e) {
|
|
230
|
+
e.preventDefault();
|
|
231
|
+
const n = (s, r) => {
|
|
232
|
+
this.dragStart(t, r);
|
|
233
|
+
};
|
|
234
|
+
this._currentTouch = new $(void 0, {
|
|
235
|
+
onTouchDragStart: n
|
|
236
|
+
}), this._currentTouch.onTouchStart(e);
|
|
237
|
+
}
|
|
238
|
+
touchMove(t) {
|
|
239
|
+
this._currentTouch && this._currentTouch.onTouchMove(t), this._currentDrag.event && this.dragUpdate(t);
|
|
240
|
+
}
|
|
241
|
+
touchEnd() {
|
|
242
|
+
this._currentTouch && this._currentTouch.onTouchEnd(), this._currentTouch = null, this.dragEnd();
|
|
243
|
+
}
|
|
244
|
+
dispose() {
|
|
245
|
+
document.removeEventListener("dragover", this._firefoxFallback);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
export {
|
|
249
|
+
U as DragIn
|
|
250
|
+
};
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
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
|
+
};
|
|
26
|
+
constructor(iframe: HTMLIFrameElement);
|
|
27
|
+
setInstance(instance: ExposedApi): void;
|
|
28
|
+
private _firefoxFallback;
|
|
29
|
+
dragStart(id: RapiId, event: DragEvent | TouchEvent): void;
|
|
30
|
+
dragUpdate(event: DragEvent | TouchEvent): void;
|
|
31
|
+
dragEnd(): void;
|
|
32
|
+
touchStart(id: RapiId, event: TouchEvent): void;
|
|
33
|
+
touchMove(event: TouchEvent): void;
|
|
34
|
+
touchEnd(): void;
|
|
35
|
+
dispose(): void;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare type RoomleConfiguratorApi = RoomleEmbeddingApi<default_4, default_3>;
|
|
39
|
+
|
|
40
|
+
declare class RoomleEmbeddingApi<SdkType, SdkCallbacks> implements RoomleEmbeddingApiKeys {
|
|
41
|
+
static createPlanner(configuratorId: string, container: HTMLElement, initData: UiInitData, plugins?: Array<keyof AvailablePlugins>): Promise<RoomlePlannerApi>;
|
|
42
|
+
/**
|
|
43
|
+
* Method to create a new instance of a Roomle Configurator
|
|
44
|
+
* @param configuratorId the id which identifies your configurator, you will get this ID from your Roomle Contact Person
|
|
45
|
+
* @param container DOM container in which the configurator should be placed
|
|
46
|
+
* @param initData settings with which the configurator should be started
|
|
47
|
+
*/
|
|
48
|
+
static createConfigurator(configuratorId: string, container: HTMLElement, initData: UiInitData, plugins?: Array<keyof AvailablePlugins>): Promise<RoomleConfiguratorApi>;
|
|
49
|
+
/**
|
|
50
|
+
* Method to create a new instance of a Roomle Configurator
|
|
51
|
+
* @deprecated please use "createConfigurator"
|
|
52
|
+
* @param configuratorId the id which identifies your configurator, you will get this ID from your Roomle Contact Person
|
|
53
|
+
* @param container DOM container in which the configurator should be placed
|
|
54
|
+
* @param initData settings with which the configurator should be started
|
|
55
|
+
*/
|
|
56
|
+
static create(configuratorId: string, container: HTMLElement, initData: UiInitData, plugins: Array<keyof AvailablePlugins>): Promise<RoomleConfiguratorApi>;
|
|
57
|
+
/**
|
|
58
|
+
* Method to create a new instance of a Roomle Viewer
|
|
59
|
+
* @param configuratorId the id which identifies your configurator, you will get this ID from your Roomle Contact Person
|
|
60
|
+
* @param container DOM container in which the configurator should be placed
|
|
61
|
+
* @param initData settings with which the configurator should be started
|
|
62
|
+
*/
|
|
63
|
+
static createViewer(configuratorId: string, container: HTMLElement, initData: UiInitData, plugins?: Array<keyof AvailablePlugins>): Promise<RoomleViewerApi>;
|
|
64
|
+
private static _create;
|
|
65
|
+
ui: ExposedApi_2;
|
|
66
|
+
extended: SdkType;
|
|
67
|
+
analytics: {
|
|
68
|
+
callbacks: ExposedAnalyticsCallbacks;
|
|
69
|
+
};
|
|
70
|
+
global: {
|
|
71
|
+
callbacks: GlobalCallback;
|
|
72
|
+
};
|
|
73
|
+
plugins: AvailablePlugins;
|
|
74
|
+
private _waitForIframe;
|
|
75
|
+
private _container;
|
|
76
|
+
private _messageHandler;
|
|
77
|
+
private _configuratorSettings;
|
|
78
|
+
private _initData;
|
|
79
|
+
private _iframe;
|
|
80
|
+
pluginsLoaded: Array<Promise<void>>;
|
|
81
|
+
private constructor();
|
|
82
|
+
teardown(): void;
|
|
83
|
+
private _createIframe;
|
|
84
|
+
private _onResize;
|
|
85
|
+
private _onUseFullPage;
|
|
86
|
+
private _onBackToWebsite;
|
|
87
|
+
private _executeMessage;
|
|
88
|
+
}
|
|
89
|
+
export default RoomleEmbeddingApi;
|
|
90
|
+
|
|
91
|
+
declare interface RoomleEmbeddingApiKeys {
|
|
92
|
+
extended: any;
|
|
93
|
+
ui: any;
|
|
94
|
+
analytics: any;
|
|
95
|
+
global: any;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
declare type RoomlePlannerApi = RoomleEmbeddingApi<default_2, default_3>;
|
|
99
|
+
|
|
100
|
+
declare type RoomleViewerApi = RoomleEmbeddingApi<default_5, default_3>;
|
|
101
|
+
|
|
102
|
+
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-debug.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.2"
|
|
33
|
+
},
|
|
20
34
|
"repository": {
|
|
21
35
|
"type": "git",
|
|
22
36
|
"url": "git+https://github.com/roomle-build/npm-packages.git"
|