@roomle/embedding-lib 5.34.0-debug.1 → 5.34.0-debug.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/comlink-BAiXCcU9.mjs +258 -0
  2. package/comlink-CmT64Qi3.mjs +1 -0
  3. package/docs/md/web/embedding/CHANGELOG.md +28 -332
  4. package/{drag-in-BEjBh6zz.mjs → embedding-plugins-CjNos83d.mjs} +15 -14
  5. package/embedding-plugins-DePKqSKW.mjs +1 -0
  6. package/embedding-plugins.d.ts +2 -0
  7. package/embedding-plugins.js +13 -0
  8. package/embedding-plugins.min.js +1 -0
  9. package/{from-custom-view-CobBUshK.mjs → from-custom-view-BAiOXktb.mjs} +9 -8
  10. package/from-custom-view-Ch3rb-JF.mjs +1 -0
  11. package/from-website-B-Vh-DVX.mjs +1 -0
  12. package/{from-website-C2cG-X9g.mjs → from-website-BicmMNsE.mjs} +11 -10
  13. package/hi.d.ts +2 -0
  14. package/hi.js +106 -0
  15. package/hi.min.js +1 -0
  16. package/package.json +19 -9
  17. package/packages/embedding-lib/src/connector.d.ts +1 -1
  18. package/packages/embedding-lib/src/embedding-plugins.d.ts +9 -0
  19. package/packages/embedding-lib/src/hi.d.ts +16 -0
  20. package/packages/embedding-lib/src/homag-intelligence/hi-callbacks.d.ts +1 -1
  21. package/packages/embedding-lib/src/homag-intelligence/hi-order-manager.d.ts +3 -0
  22. package/packages/embedding-lib/src/homag-intelligence/hi-requests.d.ts +1 -4
  23. package/packages/embedding-lib/src/homag-intelligence/hi-setup.d.ts +4 -0
  24. package/packages/embedding-lib/src/homag-intelligence/hi-utils.d.ts +1 -0
  25. package/packages/embedding-lib/src/plugins/drag-in.d.ts +1 -1
  26. package/packages/embedding-lib/src/plugins/strategy/from-custom-view.d.ts +1 -1
  27. package/packages/embedding-lib/src/plugins/strategy/from-website.d.ts +1 -1
  28. package/packages/embedding-lib/src/plugins/strategy/types.d.ts +1 -1
  29. package/packages/embedding-lib/src/{embedding-lib.d.ts → roomle-embedding-lib.d.ts} +23 -3
  30. package/packages/embedding-lib/src/utils.d.ts +1 -0
  31. package/roomle-embedding-lib.d.ts +6 -0
  32. package/roomle-embedding-lib.js +587 -0
  33. package/roomle-embedding-lib.min.js +1 -0
  34. package/touch-drag-BzREygxc.mjs +1 -0
  35. package/touch-drag-DWISKgWm.mjs +57 -0
  36. package/utils-D--vltCL.mjs +113 -0
  37. package/utils-uEcN1DUR.mjs +1 -0
  38. package/drag-in-BmoiEqfA.mjs +0 -1
  39. package/from-custom-view-fYea37BE.mjs +0 -1
  40. package/from-website-CDEUbvDF.mjs +0 -1
  41. package/index.d.ts +0 -4
  42. package/packages/embedding-lib/src/example.d.ts +0 -5
  43. package/packages/embedding-lib/src/examples/activate-deactivate-rd.d.ts +0 -7
  44. package/packages/embedding-lib/src/examples/api-false.d.ts +0 -7
  45. package/packages/embedding-lib/src/examples/configurator-only.d.ts +0 -6
  46. package/packages/embedding-lib/src/examples/download-partlist.d.ts +0 -6
  47. package/packages/embedding-lib/src/examples/drag-in.d.ts +0 -7
  48. package/packages/embedding-lib/src/examples/ext-catalog/ext-catalog-connection.d.ts +0 -1
  49. package/packages/embedding-lib/src/examples/ext-catalog.d.ts +0 -6
  50. package/packages/embedding-lib/src/examples/ext-selection-overlay.d.ts +0 -7
  51. package/packages/embedding-lib/src/examples/hi-single-object-configurator.d.ts +0 -11
  52. package/packages/embedding-lib/src/examples/homag-intelligence-catalog-example.d.ts +0 -11
  53. package/packages/embedding-lib/src/examples/homag-intelligence-catalog-load-async.d.ts +0 -13
  54. package/packages/embedding-lib/src/examples/homag-intelligence-example.d.ts +0 -19
  55. package/packages/embedding-lib/src/examples/planner-and-configurator.d.ts +0 -6
  56. package/packages/embedding-lib/src/examples/start-and-end-configurator.d.ts +0 -6
  57. package/packages/embedding-lib/src/examples/utils/api-false/helpers.d.ts +0 -2
  58. package/packages/embedding-lib/src/examples/utils/drag-listeners.d.ts +0 -3
  59. package/packages/embedding-lib/src/examples/utils/homag-intelligence/create-catalog.d.ts +0 -3
  60. package/packages/embedding-lib/src/examples/utils/homag-intelligence/default-api-options.d.ts +0 -21
  61. package/packages/embedding-lib/src/examples/utils/homag-intelligence/dom-helper.d.ts +0 -12
  62. package/packages/embedding-lib/src/examples/utils/homag-intelligence/drag-in.d.ts +0 -3
  63. package/packages/embedding-lib/src/examples/utils/homag-intelligence/nobilia-api-options.d.ts +0 -38
  64. package/packages/embedding-lib/src/examples/utils/homag-intelligence/overlay.d.ts +0 -2
  65. package/packages/embedding-lib/src/examples/utils/homag-intelligence/state.d.ts +0 -20
  66. package/packages/embedding-lib/src/examples/utils/homag-intelligence/utils.d.ts +0 -18
  67. package/packages/embedding-lib/src/examples/utils/query-params.d.ts +0 -1
  68. package/packages/embedding-lib/src/examples/utils/server-url.d.ts +0 -1
  69. package/packages/embedding-lib/src/overview.d.ts +0 -1
  70. package/roomle-embedding-lib.es.js +0 -833
  71. package/roomle-embedding-lib.es.min.js +0 -1
  72. package/roomle-embedding-lib.umd.js +0 -21
  73. package/roomle-embedding-lib.umd.min.js +0 -1
  74. package/touch-drag-B5zCf87J.mjs +0 -1
  75. package/touch-drag-DXJTOrk5.mjs +0 -146
@@ -0,0 +1,113 @@
1
+ class g {
2
+ _computedStyleCache = /* @__PURE__ */ new Map();
3
+ _maxLifetime = 16;
4
+ _cacheCleanInterval = null;
5
+ constructor(e = 16) {
6
+ this._maxLifetime = e;
7
+ }
8
+ get(e) {
9
+ const o = this._computedStyleCache.get(e), n = Date.now();
10
+ if (o && n - o.updated < this._maxLifetime)
11
+ return o.style;
12
+ const i = getComputedStyle(e);
13
+ return this._computedStyleCache.set(e, { style: i, updated: n }), this._cacheCleanInterval || (this._cacheCleanInterval = setInterval(
14
+ () => this._cleanUpCache,
15
+ Math.max(this._maxLifetime * 1e3, 5e3)
16
+ )), i;
17
+ }
18
+ _cleanUpCache() {
19
+ const e = Date.now();
20
+ for (const [o, { updated: n }] of this._computedStyleCache.entries())
21
+ e - n >= this._maxLifetime && this._computedStyleCache.delete(o);
22
+ this._computedStyleCache.size === 0 && this._cacheCleanInterval && (clearInterval(this._cacheCleanInterval), this._cacheCleanInterval = null);
23
+ }
24
+ }
25
+ const C = (t) => window.TouchEvent && t instanceof window.TouchEvent;
26
+ let a;
27
+ const l = (t) => (a || (a = new g()), a.get(t)), d = (t, e, o) => {
28
+ const n = parseFloat(t), i = window.devicePixelRatio || 1;
29
+ if (e === "px")
30
+ return n;
31
+ if (e === "%") {
32
+ const c = o === document.documentElement ? window.innerWidth : o.offsetWidth;
33
+ return n / 100 * c;
34
+ }
35
+ if (e === "rem") {
36
+ const c = parseFloat(
37
+ l(document.documentElement).fontSize
38
+ );
39
+ return n * c;
40
+ }
41
+ if (e === "em") {
42
+ const c = parseFloat(
43
+ l(o).fontSize
44
+ );
45
+ return n * c;
46
+ }
47
+ if (e === "vh" || e === "vw" || e === "vmin" || e === "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[e];
55
+ }
56
+ const s = {
57
+ cm: 37.7952755906,
58
+ mm: 3.77952755906,
59
+ in: 96
60
+ };
61
+ return e in s ? n * s[e] * i : (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
+ }, _ = (t, e, o = { x: 0, y: 0 }) => {
65
+ const n = t.getBoundingClientRect(), s = l(t).transform;
66
+ let c = 0, h = 0;
67
+ if (s !== "none") {
68
+ const p = /translate\(\s*([-+]?\d*\.?\d+|\d+)(px|%)?,?\s*([-+]?\d*\.?\d+|\d+)?(px|%)?\s*\)/, r = s.match(p);
69
+ r && (c = d(r[1], r[2], t), h = d(r[3], r[4], t));
70
+ }
71
+ const { clientX: u, clientY: m } = x(e, o), f = u - n.left - c + t.scrollLeft, w = m - n.top - h + t.scrollTop;
72
+ return { x: f, y: w };
73
+ }, x = (t, e = null) => {
74
+ const { clientX: o, clientY: n } = C(t) ? y(t) : t, i = o > 0 ? o : e ? e.x : o, s = n > 0 ? n : e ? e.y : n;
75
+ return { clientX: i, clientY: s };
76
+ }, y = (t) => {
77
+ if (t.touches.length) {
78
+ let { clientX: o, clientY: n } = t.touches[0];
79
+ if (t.touches.length > 1) {
80
+ const i = t.touches[1], s = i.clientX, c = i.clientY;
81
+ o = (o + s) / 2, n = (n + c) / 2;
82
+ }
83
+ return { clientX: o, clientY: n };
84
+ }
85
+ const e = t.changedTouches[0];
86
+ return { clientX: e.clientX, clientY: e.clientY };
87
+ }, S = (t) => {
88
+ const e = {
89
+ /**
90
+ * The 'get' trap is fired when a property is accessed on the proxy.
91
+ * @param target The original object.
92
+ * @param prop The name of the property being accessed.
93
+ * @param receiver The proxy or an object that inherits from it.
94
+ */
95
+ get(o, n, i) {
96
+ const s = Reflect.get(o, n, i);
97
+ return s !== void 0 ? s : (console.warn(
98
+ `[Homag Intelligence Callbacks] Method '${String(
99
+ n
100
+ )}' is not implemented. Executing a no-op.`
101
+ ), (...c) => {
102
+ });
103
+ }
104
+ };
105
+ return new Proxy(t, e);
106
+ };
107
+ export {
108
+ _ as a,
109
+ S as c,
110
+ x as e,
111
+ l as g,
112
+ C as i
113
+ };
@@ -0,0 +1 @@
1
+ class e{_computedStyleCache=new Map;_maxLifetime=16;_cacheCleanInterval=null;constructor(e=16){this._maxLifetime=e}get(e){const t=this._computedStyleCache.get(e),n=Date.now();if(t&&n-t.updated<this._maxLifetime)return t.style;const i=getComputedStyle(e);return this._computedStyleCache.set(e,{style:i,updated:n}),this._cacheCleanInterval||(this._cacheCleanInterval=setInterval(()=>this._cleanUpCache,Math.max(1e3*this._maxLifetime,5e3))),i}_cleanUpCache(){const e=Date.now();for(const[t,{updated:n}]of this._computedStyleCache.entries())e-n>=this._maxLifetime&&this._computedStyleCache.delete(t);0===this._computedStyleCache.size&&this._cacheCleanInterval&&(clearInterval(this._cacheCleanInterval),this._cacheCleanInterval=null)}}const t=e=>window.TouchEvent&&e instanceof window.TouchEvent;let n;const i=t=>(n||(n=new e),n.get(t)),c=(e,t,n)=>{const c=parseFloat(e),a=window.devicePixelRatio||1;if("px"===t)return c;if("%"===t)return c/100*(n===document.documentElement?window.innerWidth:n.offsetWidth);if("rem"===t)return c*parseFloat(i(document.documentElement).fontSize);if("em"===t)return c*parseFloat(i(n).fontSize);if("vh"===t||"vw"===t||"vmin"===t||"vmax"===t)return c/100*{vh:window.innerHeight,vw:window.innerWidth,vmin:Math.min(window.innerWidth,window.innerHeight),vmax:Math.max(window.innerWidth,window.innerHeight)}[t];const l={cm:37.7952755906,mm:3.77952755906,in:96};return t in l?c*l[t]*a:0},a=(e,t,n={x:0,y:0})=>{const a=e.getBoundingClientRect(),o=i(e).transform;let s=0,r=0;if("none"!==o){const t=/translate\(\s*([-+]?\d*\.?\d+|\d+)(px|%)?,?\s*([-+]?\d*\.?\d+|\d+)?(px|%)?\s*\)/,n=o.match(t);n&&(s=c(n[1],n[2],e),r=c(n[3],n[4],e))}const{clientX:h,clientY:d}=l(t,n);return{x:h-a.left-s+e.scrollLeft,y:d-a.top-r+e.scrollTop}},l=(e,n=null)=>{const{clientX:i,clientY:c}=t(e)?o(e):e;return{clientX:i>0?i:n?n.x:i,clientY:c>0?c:n?n.y:c}},o=e=>{if(e.touches.length){let{clientX:t,clientY:n}=e.touches[0];if(e.touches.length>1){const i=e.touches[1];t=(t+i.clientX)/2,n=(n+i.clientY)/2}return{clientX:t,clientY:n}}const t=e.changedTouches[0];return{clientX:t.clientX,clientY:t.clientY}},s=e=>new Proxy(e,{get(e,t,n){const i=Reflect.get(e,t,n);return void 0!==i?i:(...e)=>{}}});export{a,s as c,l as e,i as g,t as i};
@@ -1 +0,0 @@
1
- class t{_mainDomElement;_instance;_mode="website";_viewName="main";constructor(t,e,s,a){this._instance=t,this._mainDomElement=e,this._mode=s,this._viewName=a}async init(){return Promise.resolve()}}const e="rml-drag-in-styles",s="rml-drag-in-drag-element",a="rml-drag-in-overlay",r="rml-drag-in-drag-ghost",i="rml-drag-in-fade-in",n="rml-drag-in-fade-out",o={DISPLAY_NONE:"rml-display-none"},d="250ms",m="forwards",g=`@keyframes ${i} {from{opacity: 0;}to {opacity: 0.5;}}`,l=`@keyframes ${n} {from{opacity: 0.5;}to {opacity: 0;}}`,c=`${i} ${d} ${m}`,h=`${n} ${d} ${m}`,u="https://res.cloudinary.com/roomle/image/upload/v1729679975/fallback_afpyqr.jpg",p=112,_=112,y=Object.freeze(Object.defineProperty({__proto__:null,DragIn:class extends t{options={};_customDragSignal=new AbortController;_injectStyles(){if(!document.getElementById(e)){const t=document.createElement("style");t.type="text/css",t.id=e,t.innerHTML=`\n .${o.DISPLAY_NONE}{display:none}\n .${a}{position:absolute;top:0;left:0;width:100%;height:100%;z-index:999;}\n .${r}{position:absolute;top:0;left:0;width:1px;height:1px;z-index:999;pointer-events:none;background-color:transparent;}\n ${g}\n ${l}\n `,document.head.appendChild(t)}}_initializeDragGhost(){const t=this._mainDomElement.parentNode;let e=t.querySelector("."+r);e||(e=document.createElement("div"),e.classList.add(r),e.innerText=" ",t.appendChild(e))}constructor(t,e,s,a){super(t,e,s,a),this._mainDomElement=e,this._injectStyles(),this._initializeDragGhost()}async init(){if(await super.init(),"website"===this._mode)try{const{DragInFromWebsiteStrategy:t}=await import("./from-website-CDEUbvDF.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-fYea37BE.mjs");this._strategy=new t(this._instance,this._mainDomElement,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 r=this._customDragSignal.signal,i=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",i,{signal:r}),document.addEventListener("mouseup",n,{signal:r}),document.addEventListener("mousemove",o,{signal:r}),document.addEventListener("mouseleave",n,{signal:r}),document.addEventListener("touchstart",i,{signal:r}),document.addEventListener("touchend",n,{signal:r}),document.addEventListener("touchmove",o,{signal:r})}unregisterCustomDrag(){this._customDragSignal.abort(),this._customDragSignal=new AbortController}releaseInput(t){this._strategy.releaseInput(t)}}},Symbol.toStringTag,{value:"Module"}));export{s as R,e as a,g as b,l as c,u as d,p as e,_ as f,c as g,h,a as i,o as j,r as k,y as l};
@@ -1 +0,0 @@
1
- import{C as t,e,T as r,i as s,b as a,c as i,d as n}from"./touch-drag-B5zCf87J.mjs";import{f as o,e as h,d as g}from"./drag-in-BmoiEqfA.mjs";const _=t=>{t.preventDefault(),t.stopPropagation()};class l{_startX=0;_startY=0;_lastX=0;_lastY=0;_epsilon;_isWaiting=!1;_onCustomDragStart;constructor({onCustomDragStart:e},r={}){this._epsilon="number"==typeof r.epsilon?r.epsilon:t,this._onCustomDragStart=e}onMove(t){this._lastX=t.clientX,this._lastY=t.clientY,this._isWaiting&&((t,e)=>{const r=this._lastX-t,s=this._lastY-e;return Math.sqrt(r*r+s*s)})(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 u="data-rml-old-draggable",c=(e,r)=>{const o=s(e),h={delay:o?i:n,epsilon:o?a:t};if(!r)return h;if(!(o||e instanceof MouseEvent))return h;const{delayKey:g,epsilonKey:_}=o?{delayKey:"touchDragDelay",epsilonKey:"touchDragEpsilon"}:{delayKey:"customDragDelay",epsilonKey:"customDragEpsilon"};return"number"==typeof r[g]&&(h.delay=r.touchDragDelay),"number"==typeof r[_]&&(h.epsilon=r.touchDragEpsilon),h};class d{_options={};_instance;_mainDomElement;_viewName;_currentCustomDrag=null;_currentBb=null;_startTarget=null;_onBeforeUpdateDrag=()=>({});isDragging=!1;constructor(t,e,r,s){this._instance=t,this._options=r||{},this._viewName=s,this._mainDomElement=e,this._mainDomElement.parentElement?.addEventListener("dragleave",()=>{this._instance.cancelDragIn()})}beforeUpdateGhost(t){this._onBeforeUpdateDrag=t}async _dragStart(t,r,s="rml_id"){var a;this._startTarget&&(this._startTarget.style.pointerEvents="none",this._startTarget.style.userSelect="none",this._startTarget.setAttribute(u,this._startTarget.draggable.toString()),this._startTarget.draggable=!1,this._startTarget.removeEventListener("dragstart",_),this._startTarget.addEventListener("dragstart",_)),this._currentBb=await this._instance.getBoundingClientRect((a=this._viewName,`[data-rml-custom-view="${a}"]`));const{clientX:i,clientY:n}=e(r),o=this._currentBb.x+i,h=this._currentBb.y+n;this.isDragging=!0,this._instance.dragInObject(t,o,h,s)}_dragUpdate(t){if(document.body.focus(),this._currentCustomDrag&&this._currentCustomDrag.onMove(t),!this._currentBb||!this.isDragging)return;const{clientX:r,clientY:s}=e(t),{url:a,width:i,height:n}=(t=>{let e="",r=h,s=o;if(!t)return{url:g,width:r,height:s};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"),o=a.getAttribute("data-rml-ghost-height");i?e=i:!i&&a instanceof HTMLImageElement&&a.src&&(e=a.src),e?(r=t.width,s=t.height):e=g,r=n?parseInt(n,10):r,s=o?parseInt(o,10):s}return{url:e||g,width:r,height:s}})(this._startTarget),_=this._currentBb.x+r,l=this._currentBb.y+s,u=this._options||{},c={ghost:{visibleIn:{x:this._currentBb.x-(u.dragInOverlapX||0),y:this._currentBb.y+(u.dragInOverlapY||0),width:this._currentBb.width+(u.dragInOverlapX||0),height:this._currentBb.height+(u.dragInOverlapY||0)},url:a,width:i,height:n},mode:"custom-view"},{x:d,y:m,options:p}=this._onBeforeUpdateDrag(_,l,c),D="number"==typeof d?d:_,b="number"==typeof m?m:l,y=p||c;this._instance.updateDrag(D,b,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,e,a){this._instance.disableEvents(),this._startTarget=e.target,this._currentCustomDrag=s(e)?new r(void 0,{onTouchDragStart:(e,r)=>{this._dragStart(t,r,a)}},c(e,this._options)):new l({onCustomDragStart:e=>this._dragStart(t,e,a)},c(e,this._options)),this._currentCustomDrag.onStart(e)}dragEnd(){this._dragEnd()}dragUpdate(t){this._dragUpdate(t)}touchStart(t,e,r="rml_id"){this.dragStart(t,e,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(u),this._startTarget.removeAttribute(u),this._startTarget.removeEventListener("dragstart",_))}releaseInput(t){this._currentCustomDrag&&this._currentCustomDrag.onEnd(),this._resetStartTarget()}}export{d as DragInFromCustomViewStrategy};
@@ -1 +0,0 @@
1
- import{g as t,e,a as n,i as s,T as i}from"./touch-drag-B5zCf87J.mjs";import{R as a,a as o,b as r,c as h,d as g,e as d,f as l,g as m,h as c,i as u,j as _,k as f}from"./drag-in-BmoiEqfA.mjs";const p=(t,e,n=0,s=0)=>{const i=e.x+e.width+n,a=e.x-n,o=e.y+e.height+s,r=e.y-s,{x:h,y:g}=t;return h>=a&&h<=i&&g>=r&&g<=o},D=(t,e,n,s=0,i=0)=>{if(n&&(n.hiddenIn||n.visibleIn))return n.visibleIn?p({x:t,y:e},n.visibleIn,s,i):!!n.hiddenIn&&!p({x:t,y:e},n.hiddenIn,-s,-i)};class y{_dragGhostAnimationFrameId=null;_dragGhostRemoveAnimationFrameId=null;_dragGhostElement=null;constructor(t=null){this._dragGhostElement=t}updateDragGhost(t,e,n){this._dragGhostRemoveAnimationFrameId&&(cancelAnimationFrame(this._dragGhostRemoveAnimationFrameId),this._dragGhostRemoveAnimationFrameId=null),!n.ghost?.external&&n.ghost&&(this._dragGhostAnimationFrameId||(this._dragGhostAnimationFrameId=requestAnimationFrame(()=>{(()=>{if(!document.getElementById(o)){const t=document.createElement("style");t.type="text/css",t.id=o,t.innerHTML=`\n ${r}\n ${h}\n `,document.head.appendChild(t)}})();const s={x:t,y:e};!n.ghost&&this._dragGhostElement&&(n.ghost={}),n.ghost&&!n.ghost.element&&this._dragGhostElement&&(n.ghost.element=this._dragGhostElement),(({x:t,y:e},n)=>{let s=document.getElementById(a);if(!s){if(s=document.createElement("div"),n.ghost?.element)s.appendChild(n.ghost.element);else{const t=document.createElement("img");t.src=n.ghost?.url||g,t.width=n.ghost?.width||d,t.height=n.ghost?.height||l,s.appendChild(t)}s.id=a,s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.willChange="transform",s.style.transform="translate3d(0, 0, 0)",s.style.zIndex="9999",s.style.opacity="0.5",D(t,e,n.ghost||{},n.settings?.dragInOverlapX,n.settings?.dragInOverlapY)||(s.style.display="none"),s.style.pointerEvents="none",document.body.appendChild(s)}})(s,n),(({x:t,y:e},n)=>{const s=document.getElementById(a);if(!s)return;let i=n.ghost?.width,o=n.ghost?.height;typeof i>"u"&&(i=s.getBoundingClientRect().width||d),typeof o>"u"&&(o=s.getBoundingClientRect().height||l);const r=t-i/2,h=e-o/2;s.style.transform=`translate3d(${r}px, ${h}px, 0)`,n.ghost&&(D(t,e,n.ghost,n.settings?.dragInOverlapX,n.settings?.dragInOverlapY)?s.style.animation!=m&&(s.style.animation=m):s.style.animation!=c&&(s.style.animation=c))})(s,n),this._dragGhostAnimationFrameId=null})))}removeDragGhost(){this._dragGhostAnimationFrameId&&(cancelAnimationFrame(this._dragGhostAnimationFrameId),this._dragGhostAnimationFrameId=null),this._dragGhostRemoveAnimationFrameId||(this._dragGhostRemoveAnimationFrameId=requestAnimationFrame(()=>{const t=document.getElementById(a);t&&document.body.removeChild(t),this._dragGhostRemoveAnimationFrameId=null}))}}class x{_options={};_instance;_mainDomElement;_currentDrag={};_currentTouch=null;_firefoxDragPosition={x:0,y:0};_onBeforeUpdateDrag=()=>({});isDragging=!1;_firefoxFallback=t=>{if(!this._currentDrag.event)return;t.preventDefault();const e=t||window.event;this._firefoxDragPosition.x=e.pageX||0,this._firefoxDragPosition.y=e.pageY||0};constructor(t,e,n){this._instance=t,this._mainDomElement=e,this._options=n||{},this._firefoxFallback=this._firefoxFallback.bind(this),document.addEventListener("dragover",this._firefoxFallback),this._mainDomElement.parentElement?.addEventListener("dragleave",()=>{this._instance.cancelDragIn()})}beforeUpdateGhost(t){this._onBeforeUpdateDrag=t}dragStart(s,i,a="rml_id"){const o=this._mainDomElement.parentNode;if("relative"!==t(o).position)return;this._mainDomElement.style.pointerEvents="none";let r=o.querySelector("."+u);r||(r=document.createElement("div"),r.classList.add(u),o.appendChild(r)),r.classList.remove(_.DISPLAY_NONE),i.target.getAttribute("draggable");const h=o.querySelector("."+f);this._currentDrag.event=i;const g=i.target,d=g.cloneNode(!0),l=g.getBoundingClientRect();d.style.width=`${l.width}px`,d.style.height=`${l.height}px`,this._currentDrag.ghost=new y(d),this._currentDrag.offset||(this._currentDrag.offset={x:0,y:0});const{clientX:m,clientY:c}=e(i,this._firefoxDragPosition);this._currentDrag.offset.x=m-l.left,this._currentDrag.offset.y=c-l.top,i instanceof DragEvent&&i.dataTransfer&&i.dataTransfer.setDragImage&&i.dataTransfer.setDragImage(h,0,0);const{x:p,y:D}=n(o,this._currentDrag.event||i,this._firefoxDragPosition),x=Math.max(1,p),v=Math.max(1,D);this.isDragging=!0,this._instance.dragInObject(s,x,v,a)}dragUpdate(t){const i=this._mainDomElement.parentNode,{x:a,y:o}=n(i,t,this._firefoxDragPosition);if(0===a&&0===o)return;const r=Math.max(1,a),h=Math.max(1,o);if(1===r&&1===h)return;let g=r,d=h;if(s(t)){const t=this._options.settings?.fingerSize||0;g=Math.max(2,r+t),d=Math.max(2,h-t)}const{x:l,y:m,options:c}=this._onBeforeUpdateDrag(g,d,{}),u=c||{settings:{},ghost:{}};u.ghost||(u.ghost={}),u.ghost.visibleIn&&u.ghost.hiddenIn||(u.ghost.hiddenIn=this._mainDomElement.getBoundingClientRect());const _="number"==typeof l?l:g,f="number"==typeof m?m:d;if(this._currentDrag.ghost){const{clientX:n,clientY:s}=e(t,this._firefoxDragPosition);this._currentDrag.ghost.updateDragGhost(n,s,u)}this._instance.updateDrag(_,f,{})}dragEnd(){this._mainDomElement.style.pointerEvents="all";const t=this._mainDomElement.parentNode;this.isDragging=!1,this._instance.dragInObjectEnd(),this._currentDrag.ghost&&(this._currentDrag.ghost.removeDragGhost(),this._currentDrag.ghost=null),this._currentDrag={},this._firefoxDragPosition={x:0,y:0};const e=t.querySelector("."+u);e&&e.classList.add(_.DISPLAY_NONE)}touchStart(t,e,n="rml_id"){e.preventDefault();const s={};"number"==typeof this._options?.settings?.touchDragDelay&&(s.delay=this._options.settings.touchDragDelay),this._options?.settings?.touchDragEpsilon&&(s.epsilon=this._options.settings.touchDragEpsilon),this._currentTouch=new i(void 0,{onTouchDragStart:(e,s)=>{this.dragStart(t,s,n)}},s),this._currentTouch.onStart(e)}touchMove(t){this._currentTouch&&this._currentTouch.onMove(t),this._currentDrag.event&&this.dragUpdate(t)}touchEnd(){this._currentTouch&&this._currentTouch.onEnd(),this._currentTouch=null,this.dragEnd()}dispose(){document.removeEventListener("dragover",this._firefoxFallback)}releaseInput(t){}}export{x as DragInFromWebsiteStrategy};
package/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export {}
2
- import _default from './packages/embedding-lib/src/embedding-lib'
3
- export default _default
4
- export {}
@@ -1,5 +0,0 @@
1
- export interface Example {
2
- setupHtml(parent: HTMLElement): Promise<void>;
3
- runExample(): Promise<void>;
4
- closeExample(): Promise<void>;
5
- }
@@ -1,7 +0,0 @@
1
- import { Example } from '../example';
2
- export default class DragInExample implements Example {
3
- private _abortController;
4
- setupHtml(parent: HTMLElement): Promise<void>;
5
- closeExample(): Promise<void>;
6
- runExample(): Promise<void>;
7
- }
@@ -1,7 +0,0 @@
1
- import { Example } from '../example';
2
- export default class ExtCatalog implements Example {
3
- url: string;
4
- setupHtml(parent: HTMLElement): Promise<void>;
5
- closeExample(): Promise<void>;
6
- runExample(): Promise<void>;
7
- }
@@ -1,6 +0,0 @@
1
- import { Example } from '../example';
2
- export default class DragInExample implements Example {
3
- setupHtml(parent: HTMLElement): Promise<void>;
4
- closeExample(): Promise<void>;
5
- runExample(): Promise<void>;
6
- }
@@ -1,6 +0,0 @@
1
- import { Example } from '../example';
2
- export default class DragInExample implements Example {
3
- setupHtml(parent: HTMLElement): Promise<void>;
4
- closeExample(): Promise<void>;
5
- runExample(): Promise<void>;
6
- }
@@ -1,7 +0,0 @@
1
- import { Example } from '../example';
2
- export default class DragInExample implements Example {
3
- private _abortController;
4
- setupHtml(parent: HTMLElement): Promise<void>;
5
- closeExample(): Promise<void>;
6
- runExample(): Promise<void>;
7
- }
@@ -1,6 +0,0 @@
1
- import { Example } from '../example';
2
- export default class ExtCatalog implements Example {
3
- setupHtml(parent: HTMLElement): Promise<void>;
4
- closeExample(): Promise<void>;
5
- runExample(): Promise<void>;
6
- }
@@ -1,7 +0,0 @@
1
- import { Example } from '../example';
2
- export default class ExtCatalog implements Example {
3
- private _abortController;
4
- setupHtml(parent: HTMLElement): Promise<void>;
5
- closeExample(): Promise<void>;
6
- runExample(): Promise<void>;
7
- }
@@ -1,11 +0,0 @@
1
- import { Example } from '../example';
2
- import { RoomDesignerApiType } from './utils/homag-intelligence/overlay';
3
- export default class DragInExample implements Example {
4
- private _abortController;
5
- setupHtml(parent: HTMLElement): Promise<void>;
6
- closeExample(): Promise<void>;
7
- private start;
8
- onRequestPlan(roomDesignerApi: RoomDesignerApiType): Promise<void>;
9
- doPriceCalculation(roomDesignerApi: RoomDesignerApiType): Promise<void>;
10
- runExample(): Promise<void>;
11
- }
@@ -1,11 +0,0 @@
1
- import { Example } from '../example';
2
- import { RoomDesignerApiType } from './utils/homag-intelligence/overlay';
3
- export default class DragInExample implements Example {
4
- private _abortController;
5
- setupHtml(parent: HTMLElement): Promise<void>;
6
- closeExample(): Promise<void>;
7
- private start;
8
- onRequestPlan(roomDesignerApi: RoomDesignerApiType): Promise<void>;
9
- doPriceCalculation(roomDesignerApi: RoomDesignerApiType): Promise<void>;
10
- runExample(): Promise<void>;
11
- }
@@ -1,13 +0,0 @@
1
- import { Example } from '../example';
2
- import { RoomDesignerApiType } from './utils/homag-intelligence/overlay';
3
- export default class DragInExample implements Example {
4
- private _abortController;
5
- private _roomDesignerApi;
6
- setupHtml(parent: HTMLElement): Promise<void>;
7
- closeExample(): Promise<void>;
8
- private start;
9
- loadHiCatalogAsync(roomDesignerApi: RoomDesignerApiType): Promise<void>;
10
- onRequestPlan(roomDesignerApi: RoomDesignerApiType): Promise<void>;
11
- doPriceCalculation(roomDesignerApi: RoomDesignerApiType): Promise<void>;
12
- runExample(): Promise<void>;
13
- }
@@ -1,19 +0,0 @@
1
- import { Example } from '../example';
2
- export default class HomagIntelligenceExample implements Example {
3
- private _abortController;
4
- private _masterDataJson;
5
- private _groupMap;
6
- private _uiContainer;
7
- private _uiMap;
8
- private _roomDesignerApi;
9
- setupHtml(parent: HTMLElement): Promise<void>;
10
- closeExample(): Promise<void>;
11
- private start;
12
- runExample(): Promise<void>;
13
- private _clearUiELements;
14
- private _createUiElements;
15
- private _getThumbnailUrl;
16
- private _addUiElements;
17
- private _removeUiElements;
18
- private _addButton;
19
- }
@@ -1,6 +0,0 @@
1
- import { Example } from '../example';
2
- export default class DragInExample implements Example {
3
- setupHtml(parent: HTMLElement): Promise<void>;
4
- closeExample(): Promise<void>;
5
- runExample(): Promise<void>;
6
- }
@@ -1,6 +0,0 @@
1
- import { Example } from '../example';
2
- export default class DragInExample implements Example {
3
- setupHtml(parent: HTMLElement): Promise<void>;
4
- closeExample(): Promise<void>;
5
- runExample(): Promise<void>;
6
- }
@@ -1,2 +0,0 @@
1
- export declare const getHtml: () => string;
2
- export declare const getIframeUrl: (url: string) => string;
@@ -1,3 +0,0 @@
1
- import { RoomleConfigurator, ConfiguratorUiCallbacks, RoomlePlanner } from '../../../../web-sdk/packages';
2
- import { Connector } from '../../connector';
3
- export declare const attachDragListeners: (el: HTMLElement, instance: Connector<RoomleConfigurator | RoomlePlanner, ConfiguratorUiCallbacks>, signal: AbortSignal) => void;
@@ -1,3 +0,0 @@
1
- export declare const FAKE_ROOT_TAG = "external:root-tag";
2
- export declare const setCatalogArticles: (data: any) => void;
3
- export declare const createCatalog: (articleCatalog: HTMLElement, draggable?: boolean) => Promise<void>;
@@ -1,21 +0,0 @@
1
- import { HiApiOptions } from '../../../../../web-sdk/packages';
2
- interface TcOptions extends HiApiOptions {
3
- libraryId: string;
4
- }
5
- declare const _default: {
6
- enableArrangementCorrection: boolean;
7
- uiConfiguration: {
8
- userRight: string;
9
- showPossibleSubModules: boolean;
10
- animatedOpenClose: boolean;
11
- showThumbnails: boolean;
12
- };
13
- materialConfiguration: {
14
- defaultMaterial: string;
15
- };
16
- debugConfiguration: {
17
- createDebugGeometry: boolean;
18
- };
19
- tecConfigInfo: TcOptions;
20
- };
21
- export default _default;
@@ -1,12 +0,0 @@
1
- import { RoomDesignerApiType } from './overlay';
2
- export declare const GROUP_SELECTION_STR = "Group selection";
3
- export declare const getOverlayDomElement: () => HTMLElement;
4
- export declare const positionOverlay: (roomDesignerApi: RoomDesignerApiType) => Promise<void>;
5
- export declare const showOverlay: () => void;
6
- export declare const hideOverlay: () => void;
7
- export declare const addShadow: (roomDesignerApi: RoomDesignerApiType) => Promise<void>;
8
- export declare const removeShadow: () => void;
9
- export declare const currentSelectionType: (selectionPayload: any) => "Group selection" | "Unknown selection type" | "Root module selection" | "Sub module selection";
10
- export declare const showItemSelectionWarning: (roomDesignerApi: RoomDesignerApiType) => Promise<void>;
11
- export declare const showCustomItemSelectionView: (state: any, roomDesignerApi: RoomDesignerApiType) => Promise<void>;
12
- export declare const showCustomCatalogView: (roomDesignerApi: RoomDesignerApiType) => Promise<void>;
@@ -1,3 +0,0 @@
1
- import { RoomDesignerApiType } from './overlay';
2
- export declare const addClickEventListeners: (roomDesignerApi: RoomDesignerApiType, signal: AbortSignal, element?: HTMLElement | null) => void;
3
- export declare const addDragEventListeners: (roomDesignerApi: RoomDesignerApiType, catalogElements: NodeListOf<Element> | Element[], signal: AbortSignal, element?: HTMLElement | null) => void;
@@ -1,38 +0,0 @@
1
- declare const _default: {
2
- enableArrangementCorrection: boolean;
3
- uiConfiguration: {
4
- userRight: string;
5
- showPossibleSubModules: boolean;
6
- animatedOpenClose: boolean;
7
- showThumbnails: boolean;
8
- };
9
- materialConfiguration: {
10
- defaultMaterial: string;
11
- };
12
- debugConfiguration: {
13
- createDebugGeometry: boolean;
14
- };
15
- tecConfigInfo: {
16
- baseUrlDebug: string;
17
- /**
18
- * If you do not want to use the proxy provided by Roomle
19
- * uncomment the next three lines and comment the line
20
- * which has the Roomle proxy URL in it.
21
- * BE AWARE: That the example url dfteccdeveu01-app.azurewebsites.net
22
- * only works if you requesting from localhost:3100 otherwise you
23
- * will have CORS issues
24
- */
25
- subscriptionId: string;
26
- key: string;
27
- /** comment this line if you do not want to use the Roomle proxy */
28
- baseUrl: string;
29
- om: {
30
- subscriptionId: string;
31
- key: string;
32
- endpointUrl: string;
33
- };
34
- libraryId: string;
35
- language: string;
36
- };
37
- };
38
- export default _default;
@@ -1,2 +0,0 @@
1
- export type RoomDesignerApiType = any;
2
- export declare const initOverlayLogic: (roomDesignerApi: RoomDesignerApiType, posMode: boolean) => Promise<void>;
@@ -1,20 +0,0 @@
1
- export declare const state: {
2
- selection: {
3
- type: string | null;
4
- payload: {
5
- groupId: string;
6
- rootModuleId: string;
7
- subModuleId: string;
8
- } | {
9
- id: string;
10
- } | null;
11
- parameters: any[];
12
- };
13
- currentContext: string;
14
- currentCustomView: string | null;
15
- currentSidebar: string | null;
16
- abortController: AbortController;
17
- isBuildingCatalog: Promise<any> | null;
18
- waitForCatalog: () => Promise<void>;
19
- };
20
- export declare const resetSelectionState: () => void;
@@ -1,18 +0,0 @@
1
- export declare const logInUi: (area: string, message: string, args?: (string | null)[]) => void;
2
- export declare const logMessage: (message: string, ...args: (string | null)[]) => void;
3
- export declare const logApiCall: (message: string) => void;
4
- export declare const logApiCallback: (message: string, ...args: (string | null)[]) => void;
5
- export declare const logLink: (message: string, linkUrl: string) => void;
6
- export declare class RenderQueue {
7
- reRenders: number;
8
- queue: Array<{
9
- renderFn: any;
10
- resolve: any;
11
- reject: any;
12
- }>;
13
- isProcessing: boolean;
14
- constructor();
15
- enqueue(renderFn: any): Promise<unknown>;
16
- processQueue(): Promise<void>;
17
- }
18
- export declare const downloadJsonObject: (data: object, filename: string) => void;
@@ -1 +0,0 @@
1
- export declare const getQueryParam: (key: string, url?: string) => string;
@@ -1 +0,0 @@
1
- export declare const getServerUrl: () => string;
@@ -1 +0,0 @@
1
- export {};