@roomle/embedding-lib 5.25.0-alpha.1 → 5.25.0-alpha.10
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/docs/md/web/embedding/CHANGELOG.md +2 -28
- package/drag-in-DTA1FCDc.mjs +1 -0
- package/drag-in-DuufO5eB.mjs +138 -0
- package/from-custom-view-BdnViEhf.mjs +163 -0
- package/from-custom-view-DIYHP31u.mjs +1 -0
- package/from-website-CcDHgCCy.mjs +1 -0
- package/from-website-CktA6Icy.mjs +201 -0
- package/package.json +1 -1
- package/packages/embedding-lib/src/examples/homag-intelligence-example.d.ts +9 -0
- package/packages/embedding-lib/src/examples/utils/homag-intelligence/create-catalog.d.ts +1 -0
- package/packages/embedding-lib/src/examples/utils/homag-intelligence/default-api-options.d.ts +43 -0
- package/packages/embedding-lib/src/examples/utils/homag-intelligence/dom-helper.d.ts +13 -0
- package/packages/embedding-lib/src/examples/utils/homag-intelligence/drag-in.d.ts +3 -0
- package/packages/embedding-lib/src/examples/utils/homag-intelligence/overlay.d.ts +2 -0
- package/packages/embedding-lib/src/examples/utils/homag-intelligence/state.d.ts +14 -0
- package/packages/embedding-lib/src/examples/utils/homag-intelligence/util.d.ts +19 -0
- package/packages/embedding-lib/src/plugins/strategy/from-custom-view.d.ts +1 -0
- package/packages/web-sdk/packages/common-core/src/input/input-manager.d.ts +1 -0
- package/packages/web-sdk/packages/common-core/src/main.d.ts +2 -2
- package/packages/web-sdk/packages/common-core/src/static-files/environment-maps.d.ts +6 -7
- package/packages/web-sdk/packages/common-core/src/static-files/libs.d.ts +3 -1
- package/packages/web-sdk/packages/common-core/src/static-files/light-settings.d.ts +8 -6
- package/packages/web-sdk/packages/common-core/src/static-files/luts.d.ts +11 -9
- package/packages/web-sdk/packages/common-core/src/static-files/roomle-core.d.ts +8 -6
- package/packages/web-sdk/packages/common-core/src/utils/common-utils.d.ts +0 -1
- package/packages/web-sdk/packages/common-core/src/utils/init-data.d.ts +2 -0
- package/packages/web-sdk/packages/common-core/src/utils/shims.d.ts +6 -0
- package/packages/web-sdk/packages/common-core/src/webgl/renderer/pass/gbuffer-render-pass.d.ts +1 -1
- package/packages/web-sdk/packages/configurator-core/src/configurator.d.ts +1 -1
- package/packages/web-sdk/packages/configurator-core/src/roomle-configurator.d.ts +13 -0
- package/packages/web-sdk/packages/configurator-core/src/static-files/fonts.d.ts +4 -2
- package/packages/web-sdk/packages/configurator-core/src/static-files/geometries.d.ts +3 -1
- package/packages/web-sdk/packages/configurator-core/src/static-files/settings.d.ts +3 -1
- package/packages/web-sdk/packages/configurator-core/src/static-files/textures.d.ts +3 -1
- package/packages/web-sdk/packages/configurator-core/src/utils/animation/animation-value-map.d.ts +1 -0
- package/packages/web-sdk/packages/configurator-core/src/utils/component-dimensioning-helper.d.ts +3 -3
- package/packages/web-sdk/packages/configurator-core/src/utils/component-raycast-helper.d.ts +1 -1
- package/packages/web-sdk/packages/configurator-core/src/utils/dimensioning-helper.d.ts +1 -0
- package/packages/web-sdk/packages/configurator-core/src/utils/test-helpers/utils.d.ts +2 -2
- package/packages/web-sdk/packages/configurator-core/src/webgl/configurator-scene-manager.d.ts +4 -0
- package/packages/web-sdk/packages/glb-viewer-core/src/glb-viewer.d.ts +1 -1
- package/packages/web-sdk/packages/homag-intelligence/src/api.d.ts +22 -0
- package/packages/web-sdk/packages/homag-intelligence/src/callbacks.d.ts +37 -0
- package/packages/web-sdk/packages/homag-intelligence/src/emulator.d.ts +101 -0
- package/packages/web-sdk/packages/homag-intelligence/src/homag-intelligence.d.ts +28 -0
- package/packages/web-sdk/packages/homag-intelligence/src/loader.d.ts +24 -0
- package/packages/web-sdk/packages/homag-intelligence/src/model/oc-scripts-domain.model.d.ts +312 -0
- package/packages/web-sdk/packages/homag-intelligence/src/orders.d.ts +39 -0
- package/packages/web-sdk/packages/homag-intelligence/src/rml-plugin.d.ts +3 -0
- package/packages/web-sdk/packages/homag-intelligence/src/util.d.ts +5 -0
- package/packages/web-sdk/packages/material-viewer/src/material-viewer.d.ts +1 -1
- package/packages/web-sdk/packages/planner-core/src/planner.d.ts +1 -1
- package/packages/web-sdk/packages/planner-core/src/roomle-planner.d.ts +13 -1
- package/packages/web-sdk/packages/planner-core/src/webgl/planner-scene-manager.d.ts +1 -0
- package/packages/web-sdk/packages/test-helpers/unit/global-setup.d.ts +1 -1
- package/packages/web-sdk/packages/tools-core/src/tools-core.d.ts +1 -1
- package/packages/web-sdk/packages/typings/external-objects.d.ts +8 -0
- package/packages/web-sdk/packages/typings/planner.d.ts +1 -1
- package/packages/web-sdk/packages/workers/src/static-files/workers.d.ts +4 -2
- package/roomle-embedding-lib.es.js +306 -316
- package/roomle-embedding-lib.es.min.js +1 -1
- package/roomle-embedding-lib.umd.js +17 -17
- package/roomle-embedding-lib.umd.min.js +1 -1
- package/src/common/components/collection-view/-utils/collection-view-dynamic-components.d.ts +1 -1
- package/src/common/composables/use-configurator-api.d.ts +1 -1
- package/src/common/composables/use-core-instances.d.ts +1 -1
- package/src/common/composables/use-static-item-parameters.d.ts +1 -1
- package/src/common/utils/helper.d.ts +1 -1
- package/src/common/utils/parameters.d.ts +0 -1
- package/src/common/utils/types.d.ts +0 -7
- package/src/configurator/business-logic/roomle-sdk-wrapper.d.ts +2 -1
- package/src/configurator/embedding/exposed-api.d.ts +7 -1
- package/src/planner/components/overlays/ProductSettings.vue.d.ts +2 -2
- package/src/planner/components/overlays/product-settings/ProductPositions.vue.d.ts +2 -2
- package/src/planner/components/overlays/product-settings/ProductRotation.vue.d.ts +2 -2
- package/src/planner/components/overlays/product-settings/ProductSettingsInfos.vue.d.ts +2 -2
- package/src/planner/components/overlays/product-settings/ProductSize.vue.d.ts +2 -2
- package/src/planner/components/overlays/product-settings/ProductXYZChanger.vue.d.ts +2 -2
- package/src/planner/components/overlays/rooms/ConstructionVariants.vue.d.ts +2 -2
- package/src/planner/components/overlays/rooms/DoorParametersSetting.vue.d.ts +7 -7
- package/src/planner/components/overlays/rooms/ElementLengthScaling.vue.d.ts +1 -1
- package/src/planner/components/overlays/rooms/WindowParametersSetting.vue.d.ts +2 -2
- package/src/planner/components/utils/AssureConfiguratorHandlers.vue.d.ts +1 -1
- package/src/planner/components/utils/AssureSdkHandlers.vue.d.ts +1 -1
- package/src/planner/utils/planner-sidebar.d.ts +1 -1
- package/touch-drag-B5zCf87J.mjs +1 -0
- package/touch-drag-DXJTOrk5.mjs +146 -0
- package/drag-in-BWioG4OL.mjs +0 -1
- package/drag-in-D5QSQ86J.mjs +0 -141
- package/from-custom-view-BcXfK7VI.mjs +0 -163
- package/from-custom-view-DRAqJ-yY.mjs +0 -1
- package/from-website-B3kPg18n.mjs +0 -207
- package/from-website-DR93OSJD.mjs +0 -1
- package/packages/web-sdk/packages/acceptance-tests/src/utils/async-acceptance-test.d.ts +0 -3
- package/packages/web-sdk/packages/configurator-core/__acceptance__/boot.d.ts +0 -1
- package/packages/web-sdk/packages/vite-plugins/vite-plugin-auto-workers.d.ts +0 -8
- package/packages/web-sdk/packages/vite-plugins/vite-plugin-bundle-sw.d.ts +0 -10
- package/touch-drag-BEct6jbW.mjs +0 -1
- package/touch-drag-DNDPwZ-_.mjs +0 -149
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: import('vue').DefineComponent<{
|
|
2
|
-
api:
|
|
2
|
+
api: RoomlePlannerWithExtObjs;
|
|
3
3
|
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
4
|
-
api:
|
|
4
|
+
api: RoomlePlannerWithExtObjs;
|
|
5
5
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
6
6
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const _default: import('vue').DefineComponent<{
|
|
2
|
-
api:
|
|
2
|
+
api: RoomlePlannerWithExtObjs;
|
|
3
3
|
setValues: (values: KernelVector3) => Promise<void>;
|
|
4
4
|
getValues: () => KernelVector3;
|
|
5
5
|
labels: {
|
|
@@ -13,7 +13,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
13
13
|
z: boolean;
|
|
14
14
|
};
|
|
15
15
|
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
16
|
-
api:
|
|
16
|
+
api: RoomlePlannerWithExtObjs;
|
|
17
17
|
setValues: (values: KernelVector3) => Promise<void>;
|
|
18
18
|
getValues: () => KernelVector3;
|
|
19
19
|
labels: {
|
|
@@ -4,14 +4,14 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
4
4
|
onExpand: (event: MouseEvent) => void;
|
|
5
5
|
onCollapse?: (_payload: MouseEvent) => void;
|
|
6
6
|
isDesktop?: boolean;
|
|
7
|
-
api:
|
|
7
|
+
api: RoomlePlannerWithExtObjs;
|
|
8
8
|
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
9
9
|
groups: RapiTag[];
|
|
10
10
|
isExpanded?: boolean;
|
|
11
11
|
onExpand: (event: MouseEvent) => void;
|
|
12
12
|
onCollapse?: (_payload: MouseEvent) => void;
|
|
13
13
|
isDesktop?: boolean;
|
|
14
|
-
api:
|
|
14
|
+
api: RoomlePlannerWithExtObjs;
|
|
15
15
|
}> & Readonly<{}>, {
|
|
16
16
|
isDesktop: boolean;
|
|
17
17
|
isExpanded: boolean;
|
|
@@ -7,7 +7,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
7
7
|
required: true;
|
|
8
8
|
};
|
|
9
9
|
api: {
|
|
10
|
-
type: PropType<
|
|
10
|
+
type: PropType<RoomlePlannerWithExtObjs>;
|
|
11
11
|
required: true;
|
|
12
12
|
};
|
|
13
13
|
interactionHandler: {
|
|
@@ -2260,7 +2260,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
2260
2260
|
required: true;
|
|
2261
2261
|
};
|
|
2262
2262
|
api: {
|
|
2263
|
-
type: PropType<
|
|
2263
|
+
type: PropType<RoomlePlannerWithExtObjs>;
|
|
2264
2264
|
required: true;
|
|
2265
2265
|
};
|
|
2266
2266
|
interactionHandler: {
|
|
@@ -2497,7 +2497,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
2497
2497
|
required: true;
|
|
2498
2498
|
};
|
|
2499
2499
|
}>, {
|
|
2500
|
-
api: import('vue').ShallowRef<
|
|
2500
|
+
api: import('vue').ShallowRef<RoomlePlannerWithExtObjs>;
|
|
2501
2501
|
}, {
|
|
2502
2502
|
scalingDirection: number;
|
|
2503
2503
|
}, {}, {
|
|
@@ -4851,24 +4851,24 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
4851
4851
|
onExpand: (event: MouseEvent) => void;
|
|
4852
4852
|
onCollapse?: (_payload: MouseEvent) => void;
|
|
4853
4853
|
isDesktop?: boolean;
|
|
4854
|
-
api:
|
|
4854
|
+
api: RoomlePlannerWithExtObjs;
|
|
4855
4855
|
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
4856
4856
|
groups: RapiTag[];
|
|
4857
4857
|
isExpanded?: boolean;
|
|
4858
4858
|
onExpand: (event: MouseEvent) => void;
|
|
4859
4859
|
onCollapse?: (_payload: MouseEvent) => void;
|
|
4860
4860
|
isDesktop?: boolean;
|
|
4861
|
-
api:
|
|
4861
|
+
api: RoomlePlannerWithExtObjs;
|
|
4862
4862
|
}> & Readonly<{}>, {
|
|
4863
4863
|
isDesktop: boolean;
|
|
4864
4864
|
isExpanded: boolean;
|
|
4865
4865
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
4866
4866
|
LoadingSpinner: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
4867
4867
|
ProductPositions: import('vue').DefineComponent<{
|
|
4868
|
-
api:
|
|
4868
|
+
api: RoomlePlannerWithExtObjs;
|
|
4869
4869
|
isConstructionElement?: boolean;
|
|
4870
4870
|
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
4871
|
-
api:
|
|
4871
|
+
api: RoomlePlannerWithExtObjs;
|
|
4872
4872
|
isConstructionElement?: boolean;
|
|
4873
4873
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
4874
4874
|
}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -19,7 +19,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
19
19
|
required: true;
|
|
20
20
|
};
|
|
21
21
|
}>, {
|
|
22
|
-
api: ShallowRef<
|
|
22
|
+
api: ShallowRef<RoomlePlannerWithExtObjs>;
|
|
23
23
|
}, {
|
|
24
24
|
scalingDirection: number;
|
|
25
25
|
}, {}, {
|
|
@@ -5,11 +5,11 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
5
5
|
onClose: (_buttonAction: BUTTON_ACTIONS, _reason: CloseReason) => Promise<void>;
|
|
6
6
|
onToggleExpand?: () => void;
|
|
7
7
|
interactionHandler: PlanInteractionHandler;
|
|
8
|
-
api:
|
|
8
|
+
api: RoomlePlannerWithExtObjs;
|
|
9
9
|
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
10
10
|
onClose: (_buttonAction: BUTTON_ACTIONS, _reason: CloseReason) => Promise<void>;
|
|
11
11
|
onToggleExpand?: () => void;
|
|
12
12
|
interactionHandler: PlanInteractionHandler;
|
|
13
|
-
api:
|
|
13
|
+
api: RoomlePlannerWithExtObjs;
|
|
14
14
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
15
15
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const _default: import('vue').DefineComponent<{}, {
|
|
2
|
-
configuratorApi: import('vue').ShallowRef<
|
|
2
|
+
configuratorApi: import('vue').ShallowRef<RoomleConfiguratorType>;
|
|
3
3
|
}, {}, {
|
|
4
4
|
isLoaded(): boolean;
|
|
5
5
|
}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const _default: import('vue').DefineComponent<{}, {
|
|
2
|
-
api: import('vue').ShallowRef<
|
|
2
|
+
api: import('vue').ShallowRef<RoomlePlannerWithExtObjs>;
|
|
3
3
|
planInteractionHandler: import('vue').ShallowRef<PlanInteractionHandler>;
|
|
4
4
|
}, {}, {
|
|
5
5
|
isLoaded(): boolean;
|
|
@@ -25,4 +25,4 @@ export declare const CONFIGURATOR_SIDEBAR_STATE_KEYS: {
|
|
|
25
25
|
readonly SHOULD_SHOW_COLLECTION_VIEW_ELEMENT: "configurator_sidebar_show_collection_view_element";
|
|
26
26
|
};
|
|
27
27
|
export declare const matchProductListAndQuantity: (productList: UiPlanObject[]) => ProductListItem[];
|
|
28
|
-
export declare const fillPartList: (data: RapiItem | RapiConfiguration, partList: KernelPartList, hash: string, plannerApi:
|
|
28
|
+
export declare const fillPartList: (data: RapiItem | RapiConfiguration, partList: KernelPartList, hash: string, plannerApi: RoomlePlannerWithExtObjs, store: Store<StoreState>) => Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
class t{_computedStyleCache=new Map;_maxLifetime=16;_cacheCleanInterval=null;constructor(t=16){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 i=getComputedStyle(t);return this._computedStyleCache.set(t,{style:i,updated:n}),this._cacheCleanInterval||(this._cacheCleanInterval=setInterval(()=>this._cleanUpCache,Math.max(1e3*this._maxLifetime,5e3))),i}_cleanUpCache(){const t=Date.now();for(const[e,{updated:n}]of this._computedStyleCache.entries())t-n>=this._maxLifetime&&this._computedStyleCache.delete(e);0===this._computedStyleCache.size&&this._cacheCleanInterval&&(clearInterval(this._cacheCleanInterval),this._cacheCleanInterval=null)}}const e=t=>window.TouchEvent&&t instanceof window.TouchEvent;let n;const i=e=>(n||(n=new t),n.get(e)),c=(t,e,n)=>{const c=parseFloat(t),s=window.devicePixelRatio||1;if("px"===e)return c;if("%"===e)return c/100*(n===document.documentElement?window.innerWidth:n.offsetWidth);if("rem"===e)return c*parseFloat(i(document.documentElement).fontSize);if("em"===e)return c*parseFloat(i(n).fontSize);if("vh"===e||"vw"===e||"vmin"===e||"vmax"===e)return c/100*{vh:window.innerHeight,vw:window.innerWidth,vmin:Math.min(window.innerWidth,window.innerHeight),vmax:Math.max(window.innerWidth,window.innerHeight)}[e];const l={cm:37.7952755906,mm:3.77952755906,in:96};return e in l?c*l[e]*s:0},s=(t,e,n={x:0,y:0})=>{const s=t.getBoundingClientRect(),o=i(t).transform;let a=0,h=0;if("none"!==o){const e=/translate\(\s*([-+]?\d*\.?\d+|\d+)(px|%)?,?\s*([-+]?\d*\.?\d+|\d+)?(px|%)?\s*\)/,n=o.match(e);n&&(a=c(n[1],n[2],t),h=c(n[3],n[4],t))}const{clientX:u,clientY:r}=l(e,n);return{x:u-s.left-a+t.scrollLeft,y:r-s.top-h+t.scrollTop}},l=(t,n=null)=>{const{clientX:i,clientY:c}=e(t)?o(t):t;return{clientX:i>0?i:n?n.x:i,clientY:c>0?c:n?n.y:c}},o=t=>{if(t.touches.length){let{clientX:e,clientY:n}=t.touches[0];if(t.touches.length>1){const i=t.touches[1];e=(e+i.clientX)/2,n=(n+i.clientY)/2}return{clientX:e,clientY:n}}const e=t.changedTouches[0];return{clientX:e.clientX,clientY:e.clientY}},a=500,h=10,u=100,r=15,_=(t,n=0)=>e(t)?{clientX:t.touches[n].clientX,clientY:t.touches[n].clientY}:{clientX:t.clientX,clientY:t.clientY},d=t=>!t||!e(t)||t.touches.length>0;class m{_touchDragTimeOut;_onTouchDragStart;_payload=null;_delay=500;_firstTouch=null;_lastTouch=null;_epsilon=10;constructor(t,{onTouchDragStart:e},n={}){this._payload=t,this._onTouchDragStart=e,this._delay="number"==typeof n.delay?n.delay:500,this._epsilon="number"==typeof n.epsilon?n.epsilon:10}onStart(t){d(t)&&(this._touchDragTimeOut||(this._firstTouch=_(t,e(t)?t.touches.length-1:0),this._touchDragTimeOut=setTimeout(()=>{this._clearTimeout(),this._lastTouch||(this._lastTouch=_(t)),this._checkXDistance(t)()},this._delay)))}onEnd(){this._resetTouches()}onMove(t){d(t)&&(this._lastTouch=_(t))}_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())}}}export{r as C,m as T,s as a,h as b,a as c,u as d,l as e,i as g,e as i};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
class S {
|
|
2
|
+
_computedStyleCache = /* @__PURE__ */ new Map();
|
|
3
|
+
_maxLifetime = 16;
|
|
4
|
+
_cacheCleanInterval = null;
|
|
5
|
+
constructor(t = 16) {
|
|
6
|
+
this._maxLifetime = t;
|
|
7
|
+
}
|
|
8
|
+
get(t) {
|
|
9
|
+
const i = this._computedStyleCache.get(t), n = Date.now();
|
|
10
|
+
if (i && n - i.updated < this._maxLifetime)
|
|
11
|
+
return i.style;
|
|
12
|
+
const o = getComputedStyle(t);
|
|
13
|
+
return this._computedStyleCache.set(t, { style: o, updated: n }), this._cacheCleanInterval || (this._cacheCleanInterval = setInterval(
|
|
14
|
+
() => this._cleanUpCache,
|
|
15
|
+
Math.max(this._maxLifetime * 1e3, 5e3)
|
|
16
|
+
)), o;
|
|
17
|
+
}
|
|
18
|
+
_cleanUpCache() {
|
|
19
|
+
const t = Date.now();
|
|
20
|
+
for (const [i, { updated: n }] of this._computedStyleCache.entries())
|
|
21
|
+
t - n >= this._maxLifetime && this._computedStyleCache.delete(i);
|
|
22
|
+
this._computedStyleCache.size === 0 && this._cacheCleanInterval && (clearInterval(this._cacheCleanInterval), this._cacheCleanInterval = null);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
const r = (e) => window.TouchEvent && e instanceof window.TouchEvent;
|
|
26
|
+
let h;
|
|
27
|
+
const u = (e) => (h || (h = new S()), h.get(e)), _ = (e, t, i) => {
|
|
28
|
+
const n = parseFloat(e), o = window.devicePixelRatio || 1;
|
|
29
|
+
if (t === "px")
|
|
30
|
+
return n;
|
|
31
|
+
if (t === "%") {
|
|
32
|
+
const c = i === document.documentElement ? window.innerWidth : i.offsetWidth;
|
|
33
|
+
return n / 100 * c;
|
|
34
|
+
}
|
|
35
|
+
if (t === "rem") {
|
|
36
|
+
const c = parseFloat(
|
|
37
|
+
u(document.documentElement).fontSize
|
|
38
|
+
);
|
|
39
|
+
return n * c;
|
|
40
|
+
}
|
|
41
|
+
if (t === "em") {
|
|
42
|
+
const c = parseFloat(
|
|
43
|
+
u(i).fontSize
|
|
44
|
+
);
|
|
45
|
+
return n * c;
|
|
46
|
+
}
|
|
47
|
+
if (t === "vh" || t === "vw" || t === "vmin" || t === "vmax") {
|
|
48
|
+
const c = {
|
|
49
|
+
vh: window.innerHeight,
|
|
50
|
+
vw: window.innerWidth,
|
|
51
|
+
vmin: Math.min(window.innerWidth, window.innerHeight),
|
|
52
|
+
vmax: Math.max(window.innerWidth, window.innerHeight)
|
|
53
|
+
};
|
|
54
|
+
return n / 100 * c[t];
|
|
55
|
+
}
|
|
56
|
+
const s = {
|
|
57
|
+
cm: 37.7952755906,
|
|
58
|
+
mm: 3.77952755906,
|
|
59
|
+
in: 96
|
|
60
|
+
};
|
|
61
|
+
return t in s ? n * s[t] * o : (console.warn(
|
|
62
|
+
"Unable to determine coordinates for drag-in. Therefore drag-in is not possible. Check the CSS that positions the iframe of Roomle"
|
|
63
|
+
), 0);
|
|
64
|
+
}, D = (e, t, i = { x: 0, y: 0 }) => {
|
|
65
|
+
const n = e.getBoundingClientRect(), s = u(e).transform;
|
|
66
|
+
let c = 0, d = 0;
|
|
67
|
+
if (s !== "none") {
|
|
68
|
+
const y = /translate\(\s*([-+]?\d*\.?\d+|\d+)(px|%)?,?\s*([-+]?\d*\.?\d+|\d+)?(px|%)?\s*\)/, a = s.match(y);
|
|
69
|
+
a && (c = _(a[1], a[2], e), d = _(a[3], a[4], e));
|
|
70
|
+
}
|
|
71
|
+
const { clientX: p, clientY: g } = X(t, i), w = p - n.left - c + e.scrollLeft, C = g - n.top - d + e.scrollTop;
|
|
72
|
+
return { x: w, y: C };
|
|
73
|
+
}, X = (e, t = null) => {
|
|
74
|
+
const { clientX: i, clientY: n } = r(e) ? x(e) : e, o = i > 0 ? i : t ? t.x : i, s = n > 0 ? n : t ? t.y : n;
|
|
75
|
+
return { clientX: o, clientY: s };
|
|
76
|
+
}, x = (e) => {
|
|
77
|
+
if (e.touches.length) {
|
|
78
|
+
let { clientX: i, clientY: n } = e.touches[0];
|
|
79
|
+
if (e.touches.length > 1) {
|
|
80
|
+
const o = e.touches[1], s = o.clientX, c = o.clientY;
|
|
81
|
+
i = (i + s) / 2, n = (n + c) / 2;
|
|
82
|
+
}
|
|
83
|
+
return { clientX: i, clientY: n };
|
|
84
|
+
}
|
|
85
|
+
const t = e.changedTouches[0];
|
|
86
|
+
return { clientX: t.clientX, clientY: t.clientY };
|
|
87
|
+
}, m = 500, f = 10, Y = 100, E = 15, l = (e, t = 0) => r(e) ? {
|
|
88
|
+
clientX: e.touches[t].clientX,
|
|
89
|
+
clientY: e.touches[t].clientY
|
|
90
|
+
} : {
|
|
91
|
+
clientX: e.clientX,
|
|
92
|
+
clientY: e.clientY
|
|
93
|
+
}, T = (e) => e && r(e) ? e.touches.length > 0 : !0;
|
|
94
|
+
class O {
|
|
95
|
+
_touchDragTimeOut;
|
|
96
|
+
_onTouchDragStart;
|
|
97
|
+
_payload = null;
|
|
98
|
+
_delay = m;
|
|
99
|
+
_firstTouch = null;
|
|
100
|
+
_lastTouch = null;
|
|
101
|
+
_epsilon = f;
|
|
102
|
+
constructor(t, { onTouchDragStart: i }, n = {}) {
|
|
103
|
+
this._payload = t, this._onTouchDragStart = i, this._delay = typeof n.delay == "number" ? n.delay : m, this._epsilon = typeof n.epsilon == "number" ? n.epsilon : f;
|
|
104
|
+
}
|
|
105
|
+
onStart(t) {
|
|
106
|
+
T(t) && (this._touchDragTimeOut || (this._firstTouch = l(
|
|
107
|
+
t,
|
|
108
|
+
r(t) ? t.touches.length - 1 : 0
|
|
109
|
+
), this._touchDragTimeOut = setTimeout(() => {
|
|
110
|
+
this._clearTimeout(), this._lastTouch || (this._lastTouch = l(t)), this._checkXDistance(t)();
|
|
111
|
+
}, this._delay)));
|
|
112
|
+
}
|
|
113
|
+
onEnd() {
|
|
114
|
+
this._resetTouches();
|
|
115
|
+
}
|
|
116
|
+
onMove(t) {
|
|
117
|
+
T(t) && (this._lastTouch = l(t));
|
|
118
|
+
}
|
|
119
|
+
_clearTimeout() {
|
|
120
|
+
this._touchDragTimeOut && (clearTimeout(this._touchDragTimeOut), this._touchDragTimeOut = null);
|
|
121
|
+
}
|
|
122
|
+
_resetTouches() {
|
|
123
|
+
this._clearTimeout(), this._lastTouch = null, this._firstTouch = null, this._payload = null;
|
|
124
|
+
}
|
|
125
|
+
_checkXDistance(t) {
|
|
126
|
+
return () => {
|
|
127
|
+
if (!this._firstTouch || !this._lastTouch)
|
|
128
|
+
return;
|
|
129
|
+
let i = !1;
|
|
130
|
+
i = Math.abs(
|
|
131
|
+
this._firstTouch.clientX - this._lastTouch.clientX
|
|
132
|
+
) < this._epsilon, i && (this._onTouchDragStart(this._payload, t), this._resetTouches());
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
export {
|
|
137
|
+
E as C,
|
|
138
|
+
O as T,
|
|
139
|
+
D as a,
|
|
140
|
+
f as b,
|
|
141
|
+
m as c,
|
|
142
|
+
Y as d,
|
|
143
|
+
X as e,
|
|
144
|
+
u as g,
|
|
145
|
+
r as i
|
|
146
|
+
};
|
package/drag-in-BWioG4OL.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t=Object.defineProperty,e=(e,s,a)=>((e,s,a)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[s]=a)(e,"symbol"!=typeof s?s+"":s,a);class s{constructor(t,s,a,i){e(this,"_mainDomElement"),e(this,"_instance"),e(this,"_mode","website"),e(this,"_viewName","main"),this._instance=t,this._mainDomElement=s,this._mode=a,this._viewName=i}async init(){return Promise.resolve()}}const a="rml-drag-in-styles",i="rml-drag-in-drag-element",r="rml-drag-in-overlay",n="rml-drag-in-drag-ghost",o="rml-drag-in-fade-in",d="rml-drag-in-fade-out",m={DISPLAY_NONE:"rml-display-none"},g="250ms",l="forwards",c=`@keyframes ${o} {from{opacity: 0;}to {opacity: 0.5;}}`,h=`@keyframes ${d} {from{opacity: 0.5;}to {opacity: 0;}}`,u=`${o} ${g} ${l}`,p=`${d} ${g} ${l}`,_="https://res.cloudinary.com/roomle/image/upload/v1729679975/fallback_afpyqr.jpg",y=112,b=112,f=Object.freeze(Object.defineProperty({__proto__:null,DragIn:class extends s{constructor(t,s,a,i){super(t,s,a,i),e(this,"options",{}),e(this,"_customDragSignal",new AbortController),this._mainDomElement=s,this._injectStyles(),this._initializeDragGhost()}_injectStyles(){if(!document.getElementById(a)){const t=document.createElement("style");t.type="text/css",t.id=a,t.innerHTML=`\n .${m.DISPLAY_NONE}{display:none}\n .${r}{position:absolute;top:0;left:0;width:100%;height:100%;z-index:999;}\n .${n}{position:absolute;top:0;left:0;width:1px;height:1px;z-index:999;pointer-events:none;background-color:transparent;}\n ${c}\n ${h}\n `,document.head.appendChild(t)}}_initializeDragGhost(){const t=this._mainDomElement.parentNode;let e=t.querySelector("."+n);e||(e=document.createElement("div"),e.classList.add(n),e.innerText=" ",t.appendChild(e))}async init(){if(await super.init(),"website"===this._mode)try{const{DragInFromWebsiteStrategy:t}=await import("./from-website-DR93OSJD.mjs");this._strategy=new t(this._instance,this._mainDomElement,{settings:this.options,mode:"website"})}catch(t){throw t}else{if("custom-view"!==this._mode)throw new Error("Unsupported mode");try{const{DragInFromCustomViewStrategy:t}=await import("./from-custom-view-DRAqJ-yY.mjs");this._strategy=new t(this._instance,this.options,this._viewName)}catch(t){throw t}}}get isDragging(){return this._strategy.isDragging}dragStart(t,e,s="rml_id"){this._strategy.dragStart(t,e,s)}dragUpdate(t){this._strategy.dragUpdate(t)}dragEnd(){this._strategy.dragEnd()}touchStart(t,e,s="rml_id"){this._strategy.touchStart(t,e,s)}touchMove(t){this._strategy.touchMove(t)}touchEnd(){this._strategy.touchEnd()}dispose(){this._strategy.dispose()}beforeUpdateGhost(t){this._strategy.beforeUpdateGhost(t)}registerCustomDrag({customDragStart:t,customDragEnd:e,customDragUpdate:s,beforeUpdateGhost:a}){a&&this._strategy.beforeUpdateGhost(a);const i=this._customDragSignal.signal,r=e=>{"true"===e.target.getAttribute("data-rml-draggable")&&t(e)},n=t=>{this._strategy.releaseInput(t),this._strategy.isDragging&&e(t)},o=t=>{s(t)};document.querySelectorAll('[data-rml-draggable="true"]').forEach(t=>{t.draggable=!1}),document.addEventListener("mousedown",r,{signal:i}),document.addEventListener("mouseup",n,{signal:i}),document.addEventListener("mousemove",o,{signal:i}),document.addEventListener("mouseleave",n,{signal:i}),document.addEventListener("touchstart",r,{signal:i}),document.addEventListener("touchend",n,{signal:i}),document.addEventListener("touchmove",o,{signal:i})}unregisterCustomDrag(){this._customDragSignal.abort(),this._customDragSignal=new AbortController}releaseInput(t){this._strategy.releaseInput(t)}}},Symbol.toStringTag,{value:"Module"}));export{i as R,a,c as b,h as c,_ as d,y as e,b as f,u as g,p as h,r as i,m as j,n as k,f as l};
|
package/drag-in-D5QSQ86J.mjs
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
var p = Object.defineProperty;
|
|
2
|
-
var S = (o, s, t) => s in o ? p(o, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[s] = t;
|
|
3
|
-
var i = (o, s, t) => S(o, typeof s != "symbol" ? s + "" : s, t);
|
|
4
|
-
class I {
|
|
5
|
-
constructor(s, t, e, a) {
|
|
6
|
-
i(this, "_mainDomElement");
|
|
7
|
-
i(this, "_instance");
|
|
8
|
-
i(this, "_mode", "website");
|
|
9
|
-
i(this, "_viewName", "main");
|
|
10
|
-
this._instance = s, this._mainDomElement = t, this._mode = e, this._viewName = a;
|
|
11
|
-
}
|
|
12
|
-
async init() {
|
|
13
|
-
return Promise.resolve();
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
const m = "rml-drag-in-styles", f = "rml-drag-in-drag-element", E = "rml-drag-in-overlay", g = "rml-drag-in-drag-ghost", h = "rml-drag-in-fade-in", u = "rml-drag-in-fade-out", L = {
|
|
17
|
-
DISPLAY_NONE: "rml-display-none"
|
|
18
|
-
}, A = 0.5, D = "250ms", y = "forwards", N = `@keyframes ${h} {from{opacity: 0;}to {opacity: ${A};}}`, R = `@keyframes ${u} {from{opacity: ${A};}to {opacity: 0;}}`, M = `${h} ${D} ${y}`, O = `${u} ${D} ${y}`, w = "https://res.cloudinary.com/roomle/image/upload/v1729679975/fallback_afpyqr.jpg", C = 112, v = 112;
|
|
19
|
-
class G extends I {
|
|
20
|
-
constructor(t, e, a, _) {
|
|
21
|
-
super(t, e, a, _);
|
|
22
|
-
i(this, "options", {});
|
|
23
|
-
i(this, "_customDragSignal", new AbortController());
|
|
24
|
-
this._mainDomElement = e, this._injectStyles(), this._initializeDragGhost();
|
|
25
|
-
}
|
|
26
|
-
_injectStyles() {
|
|
27
|
-
if (!!!document.getElementById(m)) {
|
|
28
|
-
const e = document.createElement("style");
|
|
29
|
-
e.type = "text/css", e.id = m, e.innerHTML = `
|
|
30
|
-
.${L.DISPLAY_NONE}{display:none}
|
|
31
|
-
.${E}{position:absolute;top:0;left:0;width:100%;height:100%;z-index:999;}
|
|
32
|
-
.${g}{position:absolute;top:0;left:0;width:1px;height:1px;z-index:999;pointer-events:none;background-color:transparent;}
|
|
33
|
-
${N}
|
|
34
|
-
${R}
|
|
35
|
-
`, document.head.appendChild(e);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
_initializeDragGhost() {
|
|
39
|
-
const t = this._mainDomElement.parentNode;
|
|
40
|
-
let e = t.querySelector(
|
|
41
|
-
"." + g
|
|
42
|
-
);
|
|
43
|
-
e || (e = document.createElement("div"), e.classList.add(g), e.innerText = " ", t.appendChild(e));
|
|
44
|
-
}
|
|
45
|
-
async init() {
|
|
46
|
-
if (await super.init(), this._mode === "website")
|
|
47
|
-
try {
|
|
48
|
-
const { DragInFromWebsiteStrategy: t } = await import("./from-website-B3kPg18n.mjs");
|
|
49
|
-
this._strategy = new t(
|
|
50
|
-
this._instance,
|
|
51
|
-
this._mainDomElement,
|
|
52
|
-
{ settings: this.options, mode: "website" }
|
|
53
|
-
);
|
|
54
|
-
} catch (t) {
|
|
55
|
-
throw console.error('Could not load Dragin strategy "FromWebsite"'), t;
|
|
56
|
-
}
|
|
57
|
-
else if (this._mode === "custom-view")
|
|
58
|
-
try {
|
|
59
|
-
const { DragInFromCustomViewStrategy: t } = await import("./from-custom-view-BcXfK7VI.mjs");
|
|
60
|
-
this._strategy = new t(
|
|
61
|
-
this._instance,
|
|
62
|
-
this.options,
|
|
63
|
-
this._viewName
|
|
64
|
-
);
|
|
65
|
-
} catch (t) {
|
|
66
|
-
throw console.error('Could not load Dragin strategy "FromCustomView"'), t;
|
|
67
|
-
}
|
|
68
|
-
else
|
|
69
|
-
throw new Error("Unsupported mode");
|
|
70
|
-
}
|
|
71
|
-
get isDragging() {
|
|
72
|
-
return this._strategy.isDragging;
|
|
73
|
-
}
|
|
74
|
-
dragStart(t, e, a = "rml_id") {
|
|
75
|
-
this._strategy.dragStart(t, e, a);
|
|
76
|
-
}
|
|
77
|
-
dragUpdate(t) {
|
|
78
|
-
this._strategy.dragUpdate(t);
|
|
79
|
-
}
|
|
80
|
-
dragEnd() {
|
|
81
|
-
this._strategy.dragEnd();
|
|
82
|
-
}
|
|
83
|
-
touchStart(t, e, a = "rml_id") {
|
|
84
|
-
this._strategy.touchStart(t, e, a);
|
|
85
|
-
}
|
|
86
|
-
touchMove(t) {
|
|
87
|
-
this._strategy.touchMove(t);
|
|
88
|
-
}
|
|
89
|
-
touchEnd() {
|
|
90
|
-
this._strategy.touchEnd();
|
|
91
|
-
}
|
|
92
|
-
dispose() {
|
|
93
|
-
this._strategy.dispose();
|
|
94
|
-
}
|
|
95
|
-
beforeUpdateGhost(t) {
|
|
96
|
-
this._strategy.beforeUpdateGhost(t);
|
|
97
|
-
}
|
|
98
|
-
registerCustomDrag({
|
|
99
|
-
customDragStart: t,
|
|
100
|
-
customDragEnd: e,
|
|
101
|
-
customDragUpdate: a,
|
|
102
|
-
beforeUpdateGhost: _
|
|
103
|
-
}) {
|
|
104
|
-
_ && this._strategy.beforeUpdateGhost(_);
|
|
105
|
-
const n = this._customDragSignal.signal, c = (r) => {
|
|
106
|
-
r.target.getAttribute("data-rml-draggable") === "true" && t(r);
|
|
107
|
-
}, d = (r) => {
|
|
108
|
-
this._strategy.releaseInput(r), this._strategy.isDragging && e(r);
|
|
109
|
-
}, l = (r) => {
|
|
110
|
-
a(r);
|
|
111
|
-
};
|
|
112
|
-
document.querySelectorAll('[data-rml-draggable="true"]').forEach((r) => {
|
|
113
|
-
r.draggable = !1;
|
|
114
|
-
}), document.addEventListener("mousedown", c, { signal: n }), document.addEventListener("mouseup", d, { signal: n }), document.addEventListener("mousemove", l, { signal: n }), document.addEventListener("mouseleave", d, { signal: n }), document.addEventListener("touchstart", c, { signal: n }), document.addEventListener("touchend", d, { signal: n }), document.addEventListener("touchmove", l, { signal: n });
|
|
115
|
-
}
|
|
116
|
-
unregisterCustomDrag() {
|
|
117
|
-
this._customDragSignal.abort(), this._customDragSignal = new AbortController();
|
|
118
|
-
}
|
|
119
|
-
releaseInput(t) {
|
|
120
|
-
this._strategy.releaseInput(t);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
const $ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
124
|
-
__proto__: null,
|
|
125
|
-
DragIn: G
|
|
126
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
127
|
-
export {
|
|
128
|
-
f as R,
|
|
129
|
-
m as a,
|
|
130
|
-
N as b,
|
|
131
|
-
R as c,
|
|
132
|
-
w as d,
|
|
133
|
-
C as e,
|
|
134
|
-
v as f,
|
|
135
|
-
M as g,
|
|
136
|
-
O as h,
|
|
137
|
-
E as i,
|
|
138
|
-
L as j,
|
|
139
|
-
g as k,
|
|
140
|
-
$ as l
|
|
141
|
-
};
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
var A = Object.defineProperty;
|
|
2
|
-
var O = (e, t, s) => t in e ? A(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
|
-
var i = (e, t, s) => O(e, typeof t != "symbol" ? t + "" : t, s);
|
|
4
|
-
import { C as T, e as m, i as b, T as v, b as B, c as I, d as L } from "./touch-drag-DNDPwZ-_.mjs";
|
|
5
|
-
import { d as c, e as Y, f as X } from "./drag-in-D5QSQ86J.mjs";
|
|
6
|
-
const G = (e) => `[data-rml-custom-view="${e}"]`, l = (e) => {
|
|
7
|
-
e.preventDefault(), e.stopPropagation();
|
|
8
|
-
}, w = (e, t, s, r) => {
|
|
9
|
-
const a = s - e, n = r - t;
|
|
10
|
-
return Math.sqrt(a * a + n * n);
|
|
11
|
-
};
|
|
12
|
-
class U {
|
|
13
|
-
constructor({ onCustomDragStart: t }, s = {}) {
|
|
14
|
-
i(this, "_startX", 0);
|
|
15
|
-
i(this, "_startY", 0);
|
|
16
|
-
i(this, "_lastX", 0);
|
|
17
|
-
i(this, "_lastY", 0);
|
|
18
|
-
i(this, "_epsilon");
|
|
19
|
-
i(this, "_isWaiting", !1);
|
|
20
|
-
i(this, "_onCustomDragStart");
|
|
21
|
-
this._epsilon = typeof s.epsilon == "number" ? s.epsilon : T, this._onCustomDragStart = t;
|
|
22
|
-
}
|
|
23
|
-
onMove(t) {
|
|
24
|
-
this._lastX = t.clientX, this._lastY = t.clientY, this._isWaiting && w(
|
|
25
|
-
this._startX,
|
|
26
|
-
this._startY,
|
|
27
|
-
this._lastX,
|
|
28
|
-
this._lastY
|
|
29
|
-
) > this._epsilon && (this._onCustomDragStart(t), this._isWaiting = !1);
|
|
30
|
-
}
|
|
31
|
-
onStart(t) {
|
|
32
|
-
this._startX = t.clientX, this._startY = t.clientY, this.onMove(t), this._isWaiting = !0;
|
|
33
|
-
}
|
|
34
|
-
onEnd() {
|
|
35
|
-
this._reset();
|
|
36
|
-
}
|
|
37
|
-
_reset() {
|
|
38
|
-
this._startX = 0, this._startY = 0, this._lastX = 0, this._lastY = 0, this._isWaiting = !1;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
const u = "data-rml-old-draggable", R = void 0, f = (e, t) => {
|
|
42
|
-
const s = b(e), r = {
|
|
43
|
-
delay: s ? B : I,
|
|
44
|
-
epsilon: s ? L : T
|
|
45
|
-
};
|
|
46
|
-
if (!t)
|
|
47
|
-
return r;
|
|
48
|
-
if (!s && !(e instanceof MouseEvent))
|
|
49
|
-
return console.warn(
|
|
50
|
-
"Unsupported event! It is not TouchEvent and also not MouseEvent"
|
|
51
|
-
), r;
|
|
52
|
-
const {
|
|
53
|
-
delayKey: a,
|
|
54
|
-
epsilonKey: n
|
|
55
|
-
} = s ? { delayKey: "touchDragDelay", epsilonKey: "touchDragEpsilon" } : { delayKey: "customDragDelay", epsilonKey: "customDragEpsilon" };
|
|
56
|
-
return typeof t[a] == "number" && (r.delay = t.touchDragDelay), typeof t[n] == "number" && (r.epsilon = t.touchDragEpsilon), r;
|
|
57
|
-
}, M = (e) => {
|
|
58
|
-
let t = "", s = Y, r = X;
|
|
59
|
-
if (!e)
|
|
60
|
-
return { url: c, width: s, height: r };
|
|
61
|
-
const a = e;
|
|
62
|
-
if (a instanceof HTMLElement) {
|
|
63
|
-
const n = a.getBoundingClientRect(), o = a.getAttribute("data-rml-ghost-url"), h = a.getAttribute("data-rml-ghost-width"), g = a.getAttribute("data-rml-ghost-height");
|
|
64
|
-
o ? t = o : !o && a instanceof HTMLImageElement && a.src && (t = a.src), t ? (s = n.width, r = n.height) : t = c, s = h ? parseInt(h, 10) : s, r = g ? parseInt(g, 10) : r;
|
|
65
|
-
}
|
|
66
|
-
return { url: t || c, width: s, height: r };
|
|
67
|
-
};
|
|
68
|
-
class N {
|
|
69
|
-
constructor(t, s, r) {
|
|
70
|
-
i(this, "_options", {});
|
|
71
|
-
i(this, "_instance");
|
|
72
|
-
i(this, "_viewName");
|
|
73
|
-
i(this, "_currentCustomDrag", null);
|
|
74
|
-
i(this, "_currentBb", null);
|
|
75
|
-
i(this, "_startTarget", null);
|
|
76
|
-
i(this, "_onBeforeUpdateDrag", () => ({}));
|
|
77
|
-
i(this, "isDragging", !1);
|
|
78
|
-
this._instance = t, this._options = s || {}, this._viewName = r;
|
|
79
|
-
}
|
|
80
|
-
beforeUpdateGhost(t) {
|
|
81
|
-
this._onBeforeUpdateDrag = t;
|
|
82
|
-
}
|
|
83
|
-
async _dragStart(t, s, r = "rml_id") {
|
|
84
|
-
this._startTarget && (this._startTarget.style.pointerEvents = "none", this._startTarget.style.userSelect = "none", this._startTarget.setAttribute(
|
|
85
|
-
u,
|
|
86
|
-
this._startTarget.draggable.toString()
|
|
87
|
-
), this._startTarget.draggable = !1, this._startTarget.removeEventListener("dragstart", l), this._startTarget.addEventListener("dragstart", l)), this._currentBb = await this._instance.getBoundingClientRect(
|
|
88
|
-
G(this._viewName)
|
|
89
|
-
);
|
|
90
|
-
const { clientX: a, clientY: n } = m(s), o = this._currentBb.x + a, h = this._currentBb.y + n;
|
|
91
|
-
this.isDragging = !0, this._instance.dragInObject(t, o, h, r);
|
|
92
|
-
}
|
|
93
|
-
_dragUpdate(t) {
|
|
94
|
-
if (document.body.focus(), this._currentCustomDrag && this._currentCustomDrag.onMove(t), !this._currentBb || !this.isDragging)
|
|
95
|
-
return;
|
|
96
|
-
const { clientX: s, clientY: r } = m(t), { url: a, width: n, height: o } = M(this._startTarget), h = this._currentBb.x + s, g = this._currentBb.y + r, _ = this._options || {}, d = {
|
|
97
|
-
ghost: {
|
|
98
|
-
visibleIn: {
|
|
99
|
-
x: this._currentBb.x - (_.dragInOverlapX || 0),
|
|
100
|
-
y: this._currentBb.y + (_.dragInOverlapY || 0),
|
|
101
|
-
width: this._currentBb.width + (_.dragInOverlapX || 0),
|
|
102
|
-
height: this._currentBb.height + (_.dragInOverlapY || 0)
|
|
103
|
-
},
|
|
104
|
-
url: a,
|
|
105
|
-
width: n,
|
|
106
|
-
height: o
|
|
107
|
-
},
|
|
108
|
-
mode: "custom-view"
|
|
109
|
-
}, {
|
|
110
|
-
x: D,
|
|
111
|
-
y: p,
|
|
112
|
-
options: E
|
|
113
|
-
} = this._onBeforeUpdateDrag(h, g, d), y = typeof D == "number" ? D : h, C = typeof p == "number" ? p : g, S = E || d;
|
|
114
|
-
this._instance.updateDrag(y, C, S);
|
|
115
|
-
}
|
|
116
|
-
_dragEnd() {
|
|
117
|
-
this._currentCustomDrag && this._currentCustomDrag.onEnd(), this._currentCustomDrag = null, this.isDragging = !1, this._currentBb = null, this._resetStartTarget(), this._instance.enableEvents(), this._instance.dragInObjectEnd();
|
|
118
|
-
}
|
|
119
|
-
dragStart(t, s, r) {
|
|
120
|
-
this._instance.disableEvents(), this._startTarget = s.target;
|
|
121
|
-
const a = (n, o) => {
|
|
122
|
-
this._dragStart(t, o, r);
|
|
123
|
-
};
|
|
124
|
-
this._currentCustomDrag = b(s) ? new v(
|
|
125
|
-
R,
|
|
126
|
-
{
|
|
127
|
-
onTouchDragStart: a
|
|
128
|
-
},
|
|
129
|
-
f(s, this._options)
|
|
130
|
-
) : new U(
|
|
131
|
-
{
|
|
132
|
-
onCustomDragStart: (n) => this._dragStart(t, n, r)
|
|
133
|
-
},
|
|
134
|
-
f(s, this._options)
|
|
135
|
-
), this._currentCustomDrag.onStart(s);
|
|
136
|
-
}
|
|
137
|
-
dragEnd() {
|
|
138
|
-
this._dragEnd();
|
|
139
|
-
}
|
|
140
|
-
dragUpdate(t) {
|
|
141
|
-
this._dragUpdate(t);
|
|
142
|
-
}
|
|
143
|
-
touchStart(t, s, r = "rml_id") {
|
|
144
|
-
this.dragStart(t, s, r);
|
|
145
|
-
}
|
|
146
|
-
touchMove(t) {
|
|
147
|
-
this.dragUpdate(t);
|
|
148
|
-
}
|
|
149
|
-
touchEnd() {
|
|
150
|
-
this.dragEnd();
|
|
151
|
-
}
|
|
152
|
-
dispose() {
|
|
153
|
-
}
|
|
154
|
-
_resetStartTarget() {
|
|
155
|
-
this._startTarget && (this._startTarget.style.pointerEvents = "", this._startTarget.style.userSelect = "", this._startTarget.draggable = this._startTarget.getAttribute(u) === "true", this._startTarget.removeAttribute(u), this._startTarget.removeEventListener("dragstart", l));
|
|
156
|
-
}
|
|
157
|
-
releaseInput(t) {
|
|
158
|
-
this._currentCustomDrag && this._currentCustomDrag.onEnd(), this._resetStartTarget();
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
export {
|
|
162
|
-
N as DragInFromCustomViewStrategy
|
|
163
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t=Object.defineProperty,s=(s,r,e)=>((s,r,e)=>r in s?t(s,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[r]=e)(s,"symbol"!=typeof r?r+"":r,e);import{C as r,e,i as a,T as i,b as n,c as h,d as o}from"./touch-drag-BEct6jbW.mjs";import{d as g,e as _,f as u}from"./drag-in-BWioG4OL.mjs";const l=t=>{t.preventDefault(),t.stopPropagation()};class c{constructor({onCustomDragStart:t},e={}){s(this,"_startX",0),s(this,"_startY",0),s(this,"_lastX",0),s(this,"_lastY",0),s(this,"_epsilon"),s(this,"_isWaiting",!1),s(this,"_onCustomDragStart"),this._epsilon="number"==typeof e.epsilon?e.epsilon:r,this._onCustomDragStart=t}onMove(t){this._lastX=t.clientX,this._lastY=t.clientY,this._isWaiting&&((t,s)=>{const r=this._lastX-t,e=this._lastY-s;return Math.sqrt(r*r+e*e)})(this._startX,this._startY)>this._epsilon&&(this._onCustomDragStart(t),this._isWaiting=!1)}onStart(t){this._startX=t.clientX,this._startY=t.clientY,this.onMove(t),this._isWaiting=!0}onEnd(){this._reset()}_reset(){this._startX=0,this._startY=0,this._lastX=0,this._lastY=0,this._isWaiting=!1}}const d="data-rml-old-draggable",m=(t,s)=>{const e=a(t),i={delay:e?n:h,epsilon:e?o:r};if(!s)return i;if(!(e||t instanceof MouseEvent))return i;const{delayKey:g,epsilonKey:_}=e?{delayKey:"touchDragDelay",epsilonKey:"touchDragEpsilon"}:{delayKey:"customDragDelay",epsilonKey:"customDragEpsilon"};return"number"==typeof s[g]&&(i.delay=s.touchDragDelay),"number"==typeof s[_]&&(i.epsilon=s.touchDragEpsilon),i};class p{constructor(t,r,e){s(this,"_options",{}),s(this,"_instance"),s(this,"_viewName"),s(this,"_currentCustomDrag",null),s(this,"_currentBb",null),s(this,"_startTarget",null),s(this,"_onBeforeUpdateDrag",()=>({})),s(this,"isDragging",!1),this._instance=t,this._options=r||{},this._viewName=e}beforeUpdateGhost(t){this._onBeforeUpdateDrag=t}async _dragStart(t,s,r="rml_id"){var a;this._startTarget&&(this._startTarget.style.pointerEvents="none",this._startTarget.style.userSelect="none",this._startTarget.setAttribute(d,this._startTarget.draggable.toString()),this._startTarget.draggable=!1,this._startTarget.removeEventListener("dragstart",l),this._startTarget.addEventListener("dragstart",l)),this._currentBb=await this._instance.getBoundingClientRect((a=this._viewName,`[data-rml-custom-view="${a}"]`));const{clientX:i,clientY:n}=e(s),h=this._currentBb.x+i,o=this._currentBb.y+n;this.isDragging=!0,this._instance.dragInObject(t,h,o,r)}_dragUpdate(t){if(document.body.focus(),this._currentCustomDrag&&this._currentCustomDrag.onMove(t),!this._currentBb||!this.isDragging)return;const{clientX:s,clientY:r}=e(t),{url:a,width:i,height:n}=(t=>{let s="",r=_,e=u;if(!t)return{url:g,width:r,height:e};const a=t;if(a instanceof HTMLElement){const t=a.getBoundingClientRect(),i=a.getAttribute("data-rml-ghost-url"),n=a.getAttribute("data-rml-ghost-width"),h=a.getAttribute("data-rml-ghost-height");i?s=i:!i&&a instanceof HTMLImageElement&&a.src&&(s=a.src),s?(r=t.width,e=t.height):s=g,r=n?parseInt(n,10):r,e=h?parseInt(h,10):e}return{url:s||g,width:r,height:e}})(this._startTarget),h=this._currentBb.x+s,o=this._currentBb.y+r,l=this._options||{},c={ghost:{visibleIn:{x:this._currentBb.x-(l.dragInOverlapX||0),y:this._currentBb.y+(l.dragInOverlapY||0),width:this._currentBb.width+(l.dragInOverlapX||0),height:this._currentBb.height+(l.dragInOverlapY||0)},url:a,width:i,height:n},mode:"custom-view"},{x:d,y:m,options:p}=this._onBeforeUpdateDrag(h,o,c),b="number"==typeof d?d:h,D="number"==typeof m?m:o,y=p||c;this._instance.updateDrag(b,D,y)}_dragEnd(){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._currentCustomDrag=null,this.isDragging=!1,this._currentBb=null,this._resetStartTarget(),this._instance.enableEvents(),this._instance.dragInObjectEnd()}dragStart(t,s,r){this._instance.disableEvents(),this._startTarget=s.target,this._currentCustomDrag=a(s)?new i(void 0,{onTouchDragStart:(s,e)=>{this._dragStart(t,e,r)}},m(s,this._options)):new c({onCustomDragStart:s=>this._dragStart(t,s,r)},m(s,this._options)),this._currentCustomDrag.onStart(s)}dragEnd(){this._dragEnd()}dragUpdate(t){this._dragUpdate(t)}touchStart(t,s,r="rml_id"){this.dragStart(t,s,r)}touchMove(t){this.dragUpdate(t)}touchEnd(){this.dragEnd()}dispose(){}_resetStartTarget(){this._startTarget&&(this._startTarget.style.pointerEvents="",this._startTarget.style.userSelect="",this._startTarget.draggable="true"===this._startTarget.getAttribute(d),this._startTarget.removeAttribute(d),this._startTarget.removeEventListener("dragstart",l))}releaseInput(t){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._resetStartTarget()}}export{p as DragInFromCustomViewStrategy};
|