@roomle/embedding-lib 5.25.0-alpha.4 → 5.25.0-alpha.6

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 (40) hide show
  1. package/docs/md/web/embedding/CHANGELOG.md +2 -26
  2. package/drag-in-DTA1FCDc.mjs +1 -0
  3. package/drag-in-DuufO5eB.mjs +138 -0
  4. package/from-custom-view-BdnViEhf.mjs +163 -0
  5. package/from-custom-view-DIYHP31u.mjs +1 -0
  6. package/from-website-CcDHgCCy.mjs +1 -0
  7. package/from-website-CktA6Icy.mjs +201 -0
  8. package/package.json +1 -1
  9. package/packages/web-sdk/packages/common-core/src/static-files/environment-maps.d.ts +6 -4
  10. package/packages/web-sdk/packages/common-core/src/static-files/libs.d.ts +3 -1
  11. package/packages/web-sdk/packages/common-core/src/static-files/light-settings.d.ts +8 -6
  12. package/packages/web-sdk/packages/common-core/src/static-files/luts.d.ts +11 -9
  13. package/packages/web-sdk/packages/common-core/src/static-files/roomle-core.d.ts +8 -6
  14. package/packages/web-sdk/packages/configurator-core/src/static-files/fonts.d.ts +4 -2
  15. package/packages/web-sdk/packages/configurator-core/src/static-files/geometries.d.ts +3 -1
  16. package/packages/web-sdk/packages/configurator-core/src/static-files/settings.d.ts +3 -1
  17. package/packages/web-sdk/packages/configurator-core/src/static-files/textures.d.ts +3 -1
  18. package/packages/web-sdk/packages/configurator-core/src/utils/component-dimensioning-helper.d.ts +1 -1
  19. package/packages/web-sdk/packages/configurator-core/src/utils/test-helpers/utils.d.ts +2 -2
  20. package/packages/web-sdk/packages/configurator-core/src/webgl/configurator-scene-manager.d.ts +4 -0
  21. package/packages/web-sdk/packages/test-helpers/unit/global-setup.d.ts +1 -1
  22. package/packages/web-sdk/packages/workers/src/static-files/workers.d.ts +4 -2
  23. package/roomle-embedding-lib.es.js +306 -316
  24. package/roomle-embedding-lib.es.min.js +1 -1
  25. package/roomle-embedding-lib.umd.js +17 -17
  26. package/roomle-embedding-lib.umd.min.js +1 -1
  27. package/touch-drag-B5zCf87J.mjs +1 -0
  28. package/touch-drag-DXJTOrk5.mjs +146 -0
  29. package/drag-in-CqBNfbIX.mjs +0 -142
  30. package/drag-in-ltdVSMsI.mjs +0 -1
  31. package/from-custom-view-Bg3_d6Sp.mjs +0 -1
  32. package/from-custom-view-V503ai3X.mjs +0 -167
  33. package/from-website-BAX9bdN9.mjs +0 -210
  34. package/from-website-DsBWpkdv.mjs +0 -1
  35. package/packages/web-sdk/packages/acceptance-tests/src/utils/async-acceptance-test.d.ts +0 -3
  36. package/packages/web-sdk/packages/configurator-core/__acceptance__/boot.d.ts +0 -1
  37. package/packages/web-sdk/packages/vite-plugins/vite-plugin-auto-workers.d.ts +0 -8
  38. package/packages/web-sdk/packages/vite-plugins/vite-plugin-bundle-sw.d.ts +0 -10
  39. package/touch-drag-BEct6jbW.mjs +0 -1
  40. package/touch-drag-DNDPwZ-_.mjs +0 -149
@@ -1,149 +0,0 @@
1
- var X = Object.defineProperty;
2
- var x = (e, t, n) => t in e ? X(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var o = (e, t, n) => x(e, typeof t != "symbol" ? t + "" : t, n);
4
- class D {
5
- constructor(t = 16) {
6
- o(this, "_computedStyleCache", /* @__PURE__ */ new Map());
7
- o(this, "_maxLifetime", 16);
8
- o(this, "_cacheCleanInterval", null);
9
- this._maxLifetime = t;
10
- }
11
- get(t) {
12
- const n = this._computedStyleCache.get(t), i = Date.now();
13
- if (n && i - n.updated < this._maxLifetime)
14
- return n.style;
15
- const s = getComputedStyle(t);
16
- return this._computedStyleCache.set(t, { style: s, updated: i }), this._cacheCleanInterval || (this._cacheCleanInterval = setInterval(
17
- () => this._cleanUpCache,
18
- Math.max(this._maxLifetime * 1e3, 5e3)
19
- )), s;
20
- }
21
- _cleanUpCache() {
22
- const t = Date.now();
23
- for (const [n, { updated: i }] of this._computedStyleCache.entries())
24
- t - i >= this._maxLifetime && this._computedStyleCache.delete(n);
25
- this._computedStyleCache.size === 0 && this._cacheCleanInterval && (clearInterval(this._cacheCleanInterval), this._cacheCleanInterval = null);
26
- }
27
- }
28
- const h = (e) => window.TouchEvent && e instanceof window.TouchEvent;
29
- let l;
30
- const d = (e) => (l || (l = new D()), l.get(e)), m = (e, t, n) => {
31
- const i = parseFloat(e), s = window.devicePixelRatio || 1;
32
- if (t === "px")
33
- return i;
34
- if (t === "%") {
35
- const c = n === document.documentElement ? window.innerWidth : n.offsetWidth;
36
- return i / 100 * c;
37
- }
38
- if (t === "rem") {
39
- const c = parseFloat(
40
- d(document.documentElement).fontSize
41
- );
42
- return i * c;
43
- }
44
- if (t === "em") {
45
- const c = parseFloat(
46
- d(n).fontSize
47
- );
48
- return i * c;
49
- }
50
- if (t === "vh" || t === "vw" || t === "vmin" || t === "vmax") {
51
- const c = {
52
- vh: window.innerHeight,
53
- vw: window.innerWidth,
54
- vmin: Math.min(window.innerWidth, window.innerHeight),
55
- vmax: Math.max(window.innerWidth, window.innerHeight)
56
- };
57
- return i / 100 * c[t];
58
- }
59
- const a = {
60
- cm: 37.7952755906,
61
- mm: 3.77952755906,
62
- in: 96
63
- };
64
- return t in a ? i * a[t] * s : (console.warn(
65
- "Unable to determine coordinates for drag-in. Therefore drag-in is not possible. Check the CSS that positions the iframe of Roomle"
66
- ), 0);
67
- }, L = (e, t, n = { x: 0, y: 0 }) => {
68
- const i = e.getBoundingClientRect(), a = d(e).transform;
69
- let c = 0, _ = 0;
70
- if (a !== "none") {
71
- const S = /translate\(\s*([-+]?\d*\.?\d+|\d+)(px|%)?,?\s*([-+]?\d*\.?\d+|\d+)?(px|%)?\s*\)/, r = a.match(S);
72
- r && (c = m(r[1], r[2], e), _ = m(r[3], r[4], e));
73
- }
74
- const { clientX: g, clientY: w } = Y(t, n), C = g - i.left - c + e.scrollLeft, y = w - i.top - _ + e.scrollTop;
75
- return { x: C, y };
76
- }, Y = (e, t = null) => {
77
- const { clientX: n, clientY: i } = h(e) ? E(e) : e, s = n > 0 ? n : t ? t.x : n, a = i > 0 ? i : t ? t.y : i;
78
- return { clientX: s, clientY: a };
79
- }, E = (e) => {
80
- if (e.touches.length) {
81
- let { clientX: n, clientY: i } = e.touches[0];
82
- if (e.touches.length > 1) {
83
- const s = e.touches[1], a = s.clientX, c = s.clientY;
84
- n = (n + a) / 2, i = (i + c) / 2;
85
- }
86
- return { clientX: n, clientY: i };
87
- }
88
- const t = e.changedTouches[0];
89
- return { clientX: t.clientX, clientY: t.clientY };
90
- }, f = 500, T = 10, I = 100, M = 15, u = (e, t = 0) => h(e) ? {
91
- clientX: e.touches[t].clientX,
92
- clientY: e.touches[t].clientY
93
- } : {
94
- clientX: e.clientX,
95
- clientY: e.clientY
96
- }, p = (e) => e && h(e) ? e.touches.length > 0 : !0;
97
- class R {
98
- constructor(t, { onTouchDragStart: n }, i = {}) {
99
- o(this, "_touchDragTimeOut");
100
- o(this, "_onTouchDragStart");
101
- o(this, "_payload", null);
102
- o(this, "_delay", f);
103
- o(this, "_firstTouch", null);
104
- o(this, "_lastTouch", null);
105
- o(this, "_epsilon", T);
106
- this._payload = t, this._onTouchDragStart = n, this._delay = typeof i.delay == "number" ? i.delay : f, this._epsilon = typeof i.epsilon == "number" ? i.epsilon : T;
107
- }
108
- onStart(t) {
109
- p(t) && (this._touchDragTimeOut || (this._firstTouch = u(
110
- t,
111
- h(t) ? t.touches.length - 1 : 0
112
- ), this._touchDragTimeOut = setTimeout(() => {
113
- this._clearTimeout(), this._lastTouch || (this._lastTouch = u(t)), this._checkXDistance(t)();
114
- }, this._delay)));
115
- }
116
- onEnd() {
117
- this._resetTouches();
118
- }
119
- onMove(t) {
120
- p(t) && (this._lastTouch = u(t));
121
- }
122
- _clearTimeout() {
123
- this._touchDragTimeOut && (clearTimeout(this._touchDragTimeOut), this._touchDragTimeOut = null);
124
- }
125
- _resetTouches() {
126
- this._clearTimeout(), this._lastTouch = null, this._firstTouch = null, this._payload = null;
127
- }
128
- _checkXDistance(t) {
129
- return () => {
130
- if (!this._firstTouch || !this._lastTouch)
131
- return;
132
- let n = !1;
133
- n = Math.abs(
134
- this._firstTouch.clientX - this._lastTouch.clientX
135
- ) < this._epsilon, n && (this._onTouchDragStart(this._payload, t), this._resetTouches());
136
- };
137
- }
138
- }
139
- export {
140
- M as C,
141
- R as T,
142
- L as a,
143
- f as b,
144
- I as c,
145
- T as d,
146
- Y as e,
147
- d as g,
148
- h as i
149
- };