iobroker.webui 1.38.3 → 1.38.7

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/README.md CHANGED
@@ -133,6 +133,18 @@ runtime.html?screenName=screen2
133
133
  Placeholder for next versions:
134
134
  ### __WORK IN PROGRESS__
135
135
  -->
136
+ ### 1.38.7 (2025-11-29)
137
+ - upgrade designer once more
138
+
139
+ ### 1.38.6 (2025-11-24)
140
+ - fix package.lock
141
+
142
+ ### 1.38.5 (2025-11-24)
143
+ - fix package.lock
144
+
145
+ ### 1.38.4 (2025-11-24)
146
+ - update npm packages again (for fixes in box quads)
147
+
136
148
  ### 1.38.3 (2025-11-22)
137
149
  - update npm packges (fixes box quads)
138
150
 
package/io-package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "webui",
4
- "version": "1.38.3",
4
+ "version": "1.38.7",
5
5
  "titleLang": {
6
6
  "en": "webui",
7
7
  "de": "webui",
@@ -29,6 +29,58 @@
29
29
  "zh-cn": "使用万维网传送器的高锰用户接口"
30
30
  },
31
31
  "news": {
32
+ "1.38.7": {
33
+ "en": "upgrade designer once more",
34
+ "de": "upgrade-designer noch einmal",
35
+ "ru": "обновление дизайнера снова",
36
+ "pt": "atualizar o designer mais uma vez",
37
+ "nl": "upgrade ontwerper opnieuw",
38
+ "fr": "upgrade designer une fois de plus",
39
+ "it": "aggiornamento designer ancora una volta",
40
+ "es": "diseñador de actualización una vez más",
41
+ "pl": "upgrade designer jeszcze raz",
42
+ "uk": "модернізація дизайнера",
43
+ "zh-cn": "再次升级设计器"
44
+ },
45
+ "1.38.6": {
46
+ "en": "fix package.lock",
47
+ "de": "paket reparieren.lock",
48
+ "ru": "исправить упаковку",
49
+ "pt": "corrigir pacote.lock",
50
+ "nl": "fix pakket.lock",
51
+ "fr": "réparer paquet.lock",
52
+ "it": "fix package.lock",
53
+ "es": "arreglar paquete.lock",
54
+ "pl": "fix package.lock",
55
+ "uk": "засупу 10 ток",
56
+ "zh-cn": "固定软件包.lock"
57
+ },
58
+ "1.38.5": {
59
+ "en": "fix package.lock",
60
+ "de": "paket reparieren.lock",
61
+ "ru": "исправить упаковку",
62
+ "pt": "corrigir pacote.lock",
63
+ "nl": "fix pakket.lock",
64
+ "fr": "réparer paquet.lock",
65
+ "it": "fix package.lock",
66
+ "es": "arreglar paquete.lock",
67
+ "pl": "fix package.lock",
68
+ "uk": "засупу 10 ток",
69
+ "zh-cn": "固定软件包.lock"
70
+ },
71
+ "1.38.4": {
72
+ "en": "update npm packages again (for fixes in box quads)",
73
+ "de": "npm pakete erneut aktualisieren (für fixes in box quads)",
74
+ "ru": "обновление пакетов npm (для исправлений в квадратах коробки)",
75
+ "pt": "atualizar pacotes npm novamente (para correções em quads de caixa)",
76
+ "nl": "npm-pakketten opnieuw bijwerken (voor fixes in box quads)",
77
+ "fr": "mettre à jour à nouveau les paquets npm (pour les corrections dans la case quads)",
78
+ "it": "aggiornamento npm pacchetti di nuovo (per correzioni in box quads)",
79
+ "es": "actualizar paquetes npm de nuevo (para correcciones en cuádruples de caja)",
80
+ "pl": "aktualizacja pakietów npm ponownie (dla poprawek w kwadratach pola)",
81
+ "uk": "оновлення npm пакетів знову (для фіксації в квадроциклах коробки)",
82
+ "zh-cn": "再次更新 npm 包( 用于在框四区修正)"
83
+ },
32
84
  "1.38.3": {
33
85
  "en": "update npm packges (fixes box quads)",
34
86
  "de": "update npm packges (fixes box quads)",
@@ -67,58 +119,6 @@
67
119
  "pl": "naprawić po zmianie połączenia",
68
120
  "uk": "фіксувати після змін з'єднання",
69
121
  "zh-cn": "连接更改后修复"
70
- },
71
- "1.38.0": {
72
- "en": "update npms",
73
- "de": "aktualisierung von npms",
74
- "ru": "обновление npms",
75
- "pt": "atualizar npms",
76
- "nl": "npms bijwerken",
77
- "fr": "mettre à jour npms",
78
- "it": "aggiornamento npm",
79
- "es": "actualización npms",
80
- "pl": "update npms",
81
- "uk": "оновлення npms",
82
- "zh-cn": "更新 npms"
83
- },
84
- "1.37.0": {
85
- "en": "fix bug in bundled code\nuse minified code for config",
86
- "de": "fehler in gebündeltem code beheben\nminified code für config",
87
- "ru": "исправить ошибку in bundled code\nминифицированный код для конфигурирования",
88
- "pt": "corrigir o erro no código empacotado\nusar código minimizado para configuração",
89
- "nl": "fix bug in gebundelde code\nvermineerde code voor config gebruiken",
90
- "fr": "correction du bogue dans le code groupé\nutiliser le code minifié pour la configuration",
91
- "it": "fix bug in codice bundle\nutilizzare il codice miniificato per la configurazione",
92
- "es": "solucionar error en código incluido\nuse minified code for config",
93
- "pl": "fix błąd w kodzie pakietowym\nużyj minionego kodu dla konfiguracji",
94
- "uk": "виправлення помилок в коді\nвикористовуйте норифікований код для налаштування",
95
- "zh-cn": "在捆绑的代码中修复错误\n配置使用已修改的代码"
96
- },
97
- "1.36.0": {
98
- "en": "fix some boxQuads edge cases",
99
- "de": "befestigen Sie einige BoxQuads Randgehäuse",
100
- "ru": "исправьте некоторые случаи BoxQuads edge",
101
- "pt": "corrigir algumas caixasQuads edge cases",
102
- "nl": "fix sommige doosQuads rand gevallen",
103
- "fr": "fixer quelques cas de bord de boxQuads",
104
- "it": "risolvere alcuni casi di bordo boxQuads",
105
- "es": "arreglar algunas cajas de borde Cuads",
106
- "pl": "naprawić kilka skrzynek boxQuads krawędzi",
107
- "uk": "закріпити якусь коробкуШвидких крайових випадків",
108
- "zh-cn": "修补一些框 Quads 边框"
109
- },
110
- "1.35.4": {
111
- "en": "clear cache on reload",
112
- "de": "löschen cache auf nachladen",
113
- "ru": "чистый кэш на перезагрузке",
114
- "pt": "limpar cache ao recarregar",
115
- "nl": "cache wissen bij herladen",
116
- "fr": "effacer le cache lors du rechargement",
117
- "it": "cache chiara su ricarica",
118
- "es": "caché transparente en la recarga",
119
- "pl": "klarowna pamięć podręczna przy ponownym załadowaniu",
120
- "uk": "прозорий кеш на перевантаження",
121
- "zh-cn": "重新装入时清除缓存"
122
122
  }
123
123
  },
124
124
  "icon": "logo.png",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.webui",
3
- "version": "1.38.3",
3
+ "version": "1.38.7",
4
4
  "description": "ioBroker webui",
5
5
  "type": "module",
6
6
  "main": "dist/backend/main.js",
@@ -60,7 +60,7 @@
60
60
  "@node-projects/node-html-parser-esm": "^6.4.1",
61
61
  "@node-projects/propertygrid.webcomponent": "^1.4.1",
62
62
  "@node-projects/splitview.webcomponent": "^1.0.1",
63
- "@node-projects/web-component-designer": "^0.1.316",
63
+ "@node-projects/web-component-designer": "^0.1.321",
64
64
  "@node-projects/web-component-designer-codeview-monaco": "^0.1.33",
65
65
  "@node-projects/web-component-designer-htmlparserservice-nodehtmlparser": "^0.1.12",
66
66
  "@node-projects/web-component-designer-stylesheetservice-css-tools": "^0.1.11",
@@ -93,7 +93,7 @@
93
93
  "ts-node": "^10.9.2",
94
94
  "tslib": "^2.8.1",
95
95
  "typescript": "^5.9.3",
96
- "typescript-json-schema": "^0.66.0",
96
+ "typescript-json-schema": "^0.67.0",
97
97
  "wunderbaum": "0.13.0"
98
98
  }
99
99
  }
package/www/index.html CHANGED
@@ -217,7 +217,7 @@
217
217
  </button>
218
218
  <button data-command="save" title="save" disabled><img src="./node_modules/@node-projects/web-component-designer/assets/icons/save.svg"></button>
219
219
  <div style="margin-left: 30px;">
220
- webui - 1.38.3 - 9517cda
220
+ webui - 1.38.7 - e7559a4
221
221
  </div>
222
222
  <button style="margin-left: 30px;" data-command="paste" title="paste" disabled><img
223
223
  src="./node_modules/@node-projects/web-component-designer/assets/icons/paste.svg"></button>
@@ -69,11 +69,11 @@ export function convertQuadFromNode(node, quad, from, options) {
69
69
  const m1 = getResultingTransformationBetweenElementAndAllAncestors(from, document.body, options?.iframes);
70
70
  const m2 = getResultingTransformationBetweenElementAndAllAncestors(node, document.body, options?.iframes).inverse();
71
71
  if (options?.fromBox && options?.fromBox !== 'border') {
72
- quad = new DOMQuad(transformPointBox(quad.p1, options.fromBox, (node.ownerDocument.defaultView ?? window).getComputedStyle(from), -1), transformPointBox(quad.p2, options.fromBox, (node.ownerDocument.defaultView ?? window).getComputedStyle(from), -1), transformPointBox(quad.p3, options.fromBox, (node.ownerDocument.defaultView ?? window).getComputedStyle(from), -1), transformPointBox(quad.p4, options.fromBox, (node.ownerDocument.defaultView ?? window).getComputedStyle(from), -1));
72
+ quad = new DOMQuad(transformPointBox(quad.p1, options.fromBox, getCachedComputedStyle(from), -1), transformPointBox(quad.p2, options.fromBox, getCachedComputedStyle(from), -1), transformPointBox(quad.p3, options.fromBox, getCachedComputedStyle(from), -1), transformPointBox(quad.p4, options.fromBox, getCachedComputedStyle(from), -1));
73
73
  }
74
74
  let res = new DOMQuad(m2.transformPoint(m1.transformPoint(quad.p1)), m2.transformPoint(m1.transformPoint(quad.p2)), m2.transformPoint(m1.transformPoint(quad.p3)), m2.transformPoint(m1.transformPoint(quad.p4)));
75
75
  if (options?.toBox && options?.toBox !== 'border' && (node instanceof Element || node instanceof (node.ownerDocument.defaultView ?? window).Element)) {
76
- res = new DOMQuad(transformPointBox(res.p1, options.toBox, (node.ownerDocument.defaultView ?? window).getComputedStyle(node), -1), transformPointBox(res.p2, options.toBox, (node.ownerDocument.defaultView ?? window).getComputedStyle(node), -1), transformPointBox(res.p3, options.toBox, (node.ownerDocument.defaultView ?? window).getComputedStyle(node), -1), transformPointBox(res.p4, options.toBox, (node.ownerDocument.defaultView ?? window).getComputedStyle(node), -1));
76
+ res = new DOMQuad(transformPointBox(res.p1, options.toBox, getCachedComputedStyle(node), -1), transformPointBox(res.p2, options.toBox, getCachedComputedStyle(node), -1), transformPointBox(res.p3, options.toBox, getCachedComputedStyle(node), -1), transformPointBox(res.p4, options.toBox, getCachedComputedStyle(node), -1));
77
77
  }
78
78
  return res;
79
79
  }
@@ -88,12 +88,12 @@ export function convertRectFromNode(node, rect, from, options) {
88
88
  const m1 = getResultingTransformationBetweenElementAndAllAncestors(from, (node.ownerDocument.defaultView ?? window).document.body.parentElement, options?.iframes);
89
89
  const m2 = getResultingTransformationBetweenElementAndAllAncestors(node, (node.ownerDocument.defaultView ?? window).document.body.parentElement, options?.iframes).inverse();
90
90
  if (options?.fromBox && options?.fromBox !== 'border') {
91
- const p = transformPointBox(new DOMPoint(rect.x, rect.y), options.fromBox, (node.ownerDocument.defaultView ?? window).getComputedStyle(from), 1);
91
+ const p = transformPointBox(new DOMPoint(rect.x, rect.y), options.fromBox, getCachedComputedStyle(from), 1);
92
92
  rect = new DOMRect(p.x, p.y, rect.width, rect.height);
93
93
  }
94
94
  let res = new DOMQuad(m2.transformPoint(m1.transformPoint(new DOMPoint(rect.x, rect.y))), m2.transformPoint(m1.transformPoint(new DOMPoint(rect.x + rect.width, rect.y))), m2.transformPoint(m1.transformPoint(new DOMPoint(rect.x + rect.width, rect.y + rect.height))), m2.transformPoint(m1.transformPoint(new DOMPoint(rect.x, rect.y + rect.height))));
95
95
  if (options?.toBox && options?.toBox !== 'border' && (node instanceof Element || node instanceof (node.ownerDocument.defaultView ?? window).Element)) {
96
- res = new DOMQuad(transformPointBox(res.p1, options.toBox, (node.ownerDocument.defaultView ?? window).getComputedStyle(node), -1), transformPointBox(res.p2, options.toBox, (node.ownerDocument.defaultView ?? window).getComputedStyle(node), -1), transformPointBox(res.p3, options.toBox, (node.ownerDocument.defaultView ?? window).getComputedStyle(node), -1), transformPointBox(res.p4, options.toBox, (node.ownerDocument.defaultView ?? window).getComputedStyle(node), -1));
96
+ res = new DOMQuad(transformPointBox(res.p1, options.toBox, getCachedComputedStyle(node), -1), transformPointBox(res.p2, options.toBox, getCachedComputedStyle(node), -1), transformPointBox(res.p3, options.toBox, getCachedComputedStyle(node), -1), transformPointBox(res.p4, options.toBox, getCachedComputedStyle(node), -1));
97
97
  }
98
98
  return res;
99
99
  }
@@ -108,11 +108,11 @@ export function convertPointFromNode(node, point, from, options) {
108
108
  const m1 = getResultingTransformationBetweenElementAndAllAncestors(from, (node.ownerDocument.defaultView ?? window).document.body.parentElement, options?.iframes);
109
109
  const m2 = getResultingTransformationBetweenElementAndAllAncestors(node, document.body, options?.iframes).inverse();
110
110
  if (options?.fromBox && options?.fromBox !== 'border') {
111
- point = transformPointBox(point, options.fromBox, (node.ownerDocument.defaultView ?? window).getComputedStyle(from), 1);
111
+ point = transformPointBox(point, options.fromBox, getCachedComputedStyle(from), 1);
112
112
  }
113
113
  let res = m2.transformPoint(m1.transformPoint(point));
114
114
  if (options?.toBox && options?.toBox !== 'border' && (node instanceof Element || node instanceof (node.ownerDocument.defaultView ?? window).Element)) {
115
- res = transformPointBox(res, options.toBox, (node.ownerDocument.defaultView ?? window).getComputedStyle(node), -1);
115
+ res = transformPointBox(res, options.toBox, getCachedComputedStyle(node), -1);
116
116
  }
117
117
  return res;
118
118
  }
@@ -142,15 +142,34 @@ let hash;
142
142
  let boxQuadsCache;
143
143
  /** @type { Map<string, DOMMatrix> } */
144
144
  let transformCache;
145
+ /** @type { WeakMap<Node, CSSStyleDeclaration> } */
146
+ let computedStyleCache;
145
147
  let hashId = 0;
146
148
  export function clearCache() {
147
149
  boxQuadsCache.clear();
148
150
  transformCache.clear();
151
+ computedStyleCache = new WeakMap();
149
152
  }
150
153
  export function useCache() {
151
154
  hash = new WeakMap();
152
155
  boxQuadsCache = new Map();
153
156
  transformCache = new Map();
157
+ computedStyleCache = new WeakMap();
158
+ }
159
+ /**
160
+ * @param {Element} element
161
+ * @returns {CSSStyleDeclaration}
162
+ */
163
+ function getCachedComputedStyle(element) {
164
+ if (!computedStyleCache) {
165
+ return (element.ownerDocument.defaultView ?? window).getComputedStyle(element);
166
+ }
167
+ let style = computedStyleCache.get(element);
168
+ if (!style) {
169
+ style = (element.ownerDocument.defaultView ?? window).getComputedStyle(element);
170
+ computedStyleCache.set(element, style);
171
+ }
172
+ return style;
154
173
  }
155
174
  /**
156
175
  * @param {Node} node
@@ -182,15 +201,15 @@ export function getBoxQuads(node, options) {
182
201
  let o = null;
183
202
  if ((node instanceof Element || node instanceof (node.ownerDocument.defaultView ?? window).Element)) {
184
203
  if (options?.box === 'margin') {
185
- const cs = (node.ownerDocument.defaultView ?? window).getComputedStyle(node);
204
+ const cs = getCachedComputedStyle(node);
186
205
  o = [{ x: parseFloat(cs.marginLeft), y: parseFloat(cs.marginTop) }, { x: -parseFloat(cs.marginRight), y: parseFloat(cs.marginTop) }, { x: -parseFloat(cs.marginRight), y: -parseFloat(cs.marginBottom) }, { x: parseFloat(cs.marginLeft), y: -parseFloat(cs.marginBottom) }];
187
206
  }
188
207
  else if (options?.box === 'padding') {
189
- const cs = (node.ownerDocument.defaultView ?? window).getComputedStyle(node);
208
+ const cs = getCachedComputedStyle(node);
190
209
  o = [{ x: -parseFloat(cs.borderLeftWidth), y: -parseFloat(cs.borderTopWidth) }, { x: parseFloat(cs.borderRightWidth), y: -parseFloat(cs.borderTopWidth) }, { x: parseFloat(cs.borderRightWidth), y: parseFloat(cs.borderBottomWidth) }, { x: -parseFloat(cs.borderLeftWidth), y: parseFloat(cs.borderBottomWidth) }];
191
210
  }
192
211
  else if (options?.box === 'content') {
193
- const cs = (node.ownerDocument.defaultView ?? window).getComputedStyle(node);
212
+ const cs = getCachedComputedStyle(node);
194
213
  o = [{ x: -parseFloat(cs.borderLeftWidth) - parseFloat(cs.paddingLeft), y: -parseFloat(cs.borderTopWidth) - parseFloat(cs.paddingTop) }, { x: parseFloat(cs.borderRightWidth) + parseFloat(cs.paddingRight), y: -parseFloat(cs.borderTopWidth) - parseFloat(cs.paddingTop) }, { x: parseFloat(cs.borderRightWidth) + parseFloat(cs.paddingRight), y: parseFloat(cs.borderBottomWidth) + parseFloat(cs.paddingBottom) }, { x: -parseFloat(cs.borderLeftWidth) - parseFloat(cs.paddingLeft), y: parseFloat(cs.borderBottomWidth) + parseFloat(cs.paddingBottom) }];
195
214
  }
196
215
  }
@@ -268,12 +287,12 @@ export function getElementSize(node, matrix) {
268
287
  */
269
288
  function getElementOffsetsInContainer(node, includeScroll, iframes) {
270
289
  if ((node instanceof HTMLElement || node instanceof (node.ownerDocument.defaultView ?? window).HTMLElement)) {
271
- let cs = (node.ownerDocument.defaultView ?? window).getComputedStyle(node);
290
+ let cs = getCachedComputedStyle(node);
272
291
  if (cs.offsetPath && cs.offsetPath !== 'none') {
273
292
  return new DOMPoint(0, 0);
274
293
  }
275
294
  if (includeScroll) {
276
- const cs = (node.ownerDocument.defaultView ?? window).getComputedStyle(node);
295
+ const cs = getCachedComputedStyle(node);
277
296
  return new DOMPoint(node.offsetLeft - (includeScroll ? node.scrollLeft - parseFloat(cs.borderLeftWidth) : 0), node.offsetTop - (includeScroll ? node.scrollTop - parseFloat(cs.borderTopWidth) : 0));
278
297
  }
279
298
  else {
@@ -297,16 +316,16 @@ function getElementOffsetsInContainer(node, includeScroll, iframes) {
297
316
  const bb = node.getBBox();
298
317
  return new DOMPoint(bb.x, bb.y);
299
318
  }
300
- const cs = (node.ownerDocument.defaultView ?? window).getComputedStyle(node);
319
+ const cs = getCachedComputedStyle(node);
301
320
  if (cs.position === 'absolute') {
302
321
  return new DOMPoint(parseFloat(cs.left), parseFloat(cs.top));
303
322
  }
304
323
  const par = getParentElementIncludingSlots(node, iframes);
305
- const m = getResultingTransformationBetweenElementAndAllAncestors(par, document.body, iframes);
324
+ const m = getResultingTransformationBetweenElementAndAllAncestors(par, document.body, iframes).inverse();
306
325
  const r1 = node.getBoundingClientRect();
307
- const r1t = m.inverse().transformPoint(r1);
326
+ const r1t = m.transformPoint(r1);
308
327
  const r2 = par.getBoundingClientRect();
309
- const r2t = m.inverse().transformPoint(r2);
328
+ const r2t = m.transformPoint(r2);
310
329
  return new DOMPoint(r1t.x - r2t.x, r1t.y - r2t.y);
311
330
  }
312
331
  }
@@ -338,7 +357,7 @@ export function getResultingTransformationBetweenElementAndAllAncestors(node, an
338
357
  let originalElementAndAllParentsMultipliedMatrix = getElementCombinedTransform(actualElement, iframes);
339
358
  let perspectiveParentElement = getParentElementIncludingSlots(actualElement, iframes);
340
359
  if (perspectiveParentElement) {
341
- let s = (actualElement.ownerDocument.defaultView ?? window).getComputedStyle(perspectiveParentElement);
360
+ let s = getCachedComputedStyle(perspectiveParentElement);
342
361
  if (s.transformStyle !== 'preserve-3d') {
343
362
  projectTo2D(originalElementAndAllParentsMultipliedMatrix);
344
363
  }
@@ -347,26 +366,25 @@ export function getResultingTransformationBetweenElementAndAllAncestors(node, an
347
366
  while (actualElement != ancestor && actualElement != null) {
348
367
  const parentElement = getParentElementIncludingSlots(actualElement, iframes);
349
368
  if (actualElement.assignedSlot != null) {
350
- const st = (perspectiveParentElement.ownerDocument.defaultView ?? window).getComputedStyle(actualElement);
351
- if (st.position !== "static") {
352
- const mvMat = new DOMMatrix().translate(parseFloat(st.left), parseFloat(st.top));
353
- originalElementAndAllParentsMultipliedMatrix = mvMat.multiply(originalElementAndAllParentsMultipliedMatrix);
354
- }
369
+ const l = offsetTopLeftPolyfill(actualElement, 'offsetLeft');
370
+ const t = offsetTopLeftPolyfill(actualElement, 'offsetTop');
371
+ const mvMat = new DOMMatrix().translateSelf(l, t);
372
+ originalElementAndAllParentsMultipliedMatrix = mvMat.multiplySelf(originalElementAndAllParentsMultipliedMatrix);
355
373
  }
356
374
  else {
357
375
  if ((actualElement instanceof HTMLElement || actualElement instanceof (actualElement.ownerDocument.defaultView ?? window).HTMLElement)) {
358
376
  if (lastOffsetParent !== actualElement.offsetParent && !((actualElement instanceof HTMLSlotElement || actualElement instanceof (actualElement.ownerDocument.defaultView ?? window).HTMLSlotElement))) {
359
377
  const offsets = getElementOffsetsInContainer(actualElement, actualElement !== node, iframes);
360
378
  lastOffsetParent = actualElement.offsetParent;
361
- const mvMat = new DOMMatrix().translate(offsets.x, offsets.y);
362
- originalElementAndAllParentsMultipliedMatrix = mvMat.multiply(originalElementAndAllParentsMultipliedMatrix);
379
+ const mvMat = new DOMMatrix().translateSelf(offsets.x, offsets.y);
380
+ originalElementAndAllParentsMultipliedMatrix = mvMat.multiplySelf(originalElementAndAllParentsMultipliedMatrix);
363
381
  }
364
382
  }
365
383
  else {
366
384
  const offsets = getElementOffsetsInContainer(actualElement, actualElement !== node, iframes);
367
385
  lastOffsetParent = null;
368
- const mvMat = new DOMMatrix().translate(offsets.x, offsets.y);
369
- originalElementAndAllParentsMultipliedMatrix = mvMat.multiply(originalElementAndAllParentsMultipliedMatrix);
386
+ const mvMat = new DOMMatrix().translateSelf(offsets.x, offsets.y);
387
+ originalElementAndAllParentsMultipliedMatrix = mvMat.multiplySelf(originalElementAndAllParentsMultipliedMatrix);
370
388
  }
371
389
  }
372
390
  if (parentElement) {
@@ -375,7 +393,7 @@ export function getResultingTransformationBetweenElementAndAllAncestors(node, an
375
393
  originalElementAndAllParentsMultipliedMatrix = parentElementMatrix.multiply(originalElementAndAllParentsMultipliedMatrix);
376
394
  perspectiveParentElement = getParentElementIncludingSlots(parentElement, iframes);
377
395
  if (perspectiveParentElement) {
378
- const s = (perspectiveParentElement.ownerDocument.defaultView ?? window).getComputedStyle(perspectiveParentElement);
396
+ const s = getCachedComputedStyle(perspectiveParentElement);
379
397
  if (s.transformStyle !== 'preserve-3d') {
380
398
  projectTo2D(originalElementAndAllParentsMultipliedMatrix);
381
399
  }
@@ -423,16 +441,13 @@ export function getElementCombinedTransform(element, iframes) {
423
441
  if ((element instanceof Text || element instanceof (element.ownerDocument.defaultView ?? window).Text))
424
442
  return new DOMMatrix;
425
443
  //https://www.w3.org/TR/css-transforms-2/#ctm
426
- let s = (element.ownerDocument.defaultView ?? window).getComputedStyle(element);
444
+ let s = getCachedComputedStyle(element);
427
445
  let m = new DOMMatrix();
428
446
  const origin = s.transformOrigin.split(' ');
429
447
  const originX = parseFloat(origin[0]);
430
448
  const originY = parseFloat(origin[1]);
431
449
  const originZ = origin[2] ? parseFloat(origin[2]) : 0;
432
450
  const mOri = new DOMMatrix().translate(originX, originY, originZ);
433
- if (s.offsetPath && s.offsetPath !== 'none') {
434
- m = m.multiply(computeOffsetTransformMatrix(element));
435
- }
436
451
  if (s.translate != 'none' && s.translate) {
437
452
  let tr = s.translate;
438
453
  if (tr.includes('%')) {
@@ -444,24 +459,27 @@ export function getElementCombinedTransform(element, iframes) {
444
459
  v[1] = (parseFloat(v[1]) * r.height / 100) + 'px';
445
460
  tr = v.join(',');
446
461
  }
447
- m = m.multiply(new DOMMatrix('translate(' + tr.replace(' ', ',') + ')'));
462
+ m.multiplySelf(new DOMMatrix('translate(' + tr.replaceAll(' ', ',') + ')'));
448
463
  }
449
464
  if (s.rotate != 'none' && s.rotate) {
450
- m = m.multiply(new DOMMatrix('rotate(' + s.rotate.replace(' ', ',') + ')'));
465
+ m.multiplySelf(new DOMMatrix('rotate(' + s.rotate.replaceAll(' ', ',') + ')'));
451
466
  }
452
467
  if (s.scale != 'none' && s.scale) {
453
- m = m.multiply(new DOMMatrix('scale(' + s.scale.replace(' ', ',') + ')'));
468
+ m.multiplySelf(new DOMMatrix('scale(' + s.scale.replaceAll(' ', ',') + ')'));
454
469
  }
455
470
  if (s.transform != 'none' && s.transform) {
456
- m = m.multiply(new DOMMatrix(s.transform));
471
+ m.multiplySelf(new DOMMatrix(s.transform));
472
+ }
473
+ m = mOri.multiply(m.multiply(mOri.inverse()));
474
+ if (s.offsetPath && s.offsetPath !== 'none') {
475
+ m.multiplySelf(computeOffsetTransformMatrix(element));
457
476
  }
458
- let res = mOri.multiply(m.multiply(mOri.inverse()));
459
477
  //@ts-ignore
460
478
  const pt = getElementPerspectiveTransform(element, iframes);
461
479
  if (pt != null) {
462
- res = pt.multiply(res);
480
+ m = pt.multiply(m);
463
481
  }
464
- return res;
482
+ return m;
465
483
  }
466
484
  /**
467
485
  * project a DOM-Matrix to 2D (from firefox matrix.h)
@@ -503,7 +521,7 @@ function getElementPerspectiveTransform(element, iframes) {
503
521
  const perspectiveNode = getParentElementIncludingSlots(element, iframes);
504
522
  if (perspectiveNode) {
505
523
  //https://drafts.csswg.org/css-transforms-2/#perspective-matrix-computation
506
- let s = (element.ownerDocument.defaultView ?? window).getComputedStyle(perspectiveNode);
524
+ let s = getCachedComputedStyle(perspectiveNode);
507
525
  if (s.perspective !== 'none') {
508
526
  let m = new DOMMatrix();
509
527
  let p = parseFloat(s.perspective);
@@ -522,11 +540,12 @@ function getElementPerspectiveTransform(element, iframes) {
522
540
  return null;
523
541
  }
524
542
  function computeOffsetTransformMatrix(elem) {
525
- const cs = (elem.ownerDocument.defaultView ?? window).getComputedStyle(elem);
543
+ const cs = getCachedComputedStyle(elem);
526
544
  const offsetPath = cs.offsetPath; // e.g. "path('M0,0 ...')"
527
545
  const offsetDistance = cs.offsetDistance; // e.g. "50%"
528
546
  const offsetRotate = cs.offsetRotate; // e.g. "auto", "45deg", "auto 30deg"
529
547
  const offsetAnchor = cs.offsetAnchor;
548
+ const transformOrigin = cs.transformOrigin;
530
549
  // Parse offset-distance (px or %)
531
550
  let distance = parseOffsetDistance(offsetDistance);
532
551
  // Compute position & tangent on path
@@ -541,21 +560,19 @@ function computeOffsetTransformMatrix(elem) {
541
560
  else {
542
561
  rotateFinal = parseFloat(offsetRotate);
543
562
  }
544
- let anchor = parseOffsetAnchor(offsetAnchor, elem);
545
- const anchorMatrix = new DOMMatrix()
546
- .translateSelf(-anchor.x, -anchor.y);
547
- let m = anchorMatrix.translateSelf(x, y);
548
- m = m.rotateSelf(rotateFinal);
563
+ const anchor = parseOffsetAnchor(offsetAnchor, transformOrigin, elem);
564
+ const anchorMatrix = new DOMMatrix().translateSelf(-anchor.x, -anchor.y);
565
+ let m = anchorMatrix.translate(x, y);
566
+ m.multiplySelf(anchorMatrix.invertSelf());
567
+ m.rotateSelf(rotateFinal);
568
+ m.translateSelf(-anchor.x, -anchor.y);
549
569
  return m;
550
570
  }
551
- function parseOffsetAnchor(str, elem) {
552
- let width = elem.offsetWidth;
553
- let height = elem.offsetHeight;
554
- //if (!(elem instanceof HTMLElement)) {
555
- // const rect = elem.getBoundingClientRect();
556
- //}
571
+ function parseOffsetAnchor(str, transformOrigin, elem) {
572
+ const width = elem.offsetWidth;
573
+ const height = elem.offsetHeight;
557
574
  if (!str || str === "auto") {
558
- return { x: width / 2, y: height / 2 };
575
+ str = transformOrigin;
559
576
  }
560
577
  const parts = str.split(/\s+/);
561
578
  if (parts.length === 1) {
@@ -773,4 +790,86 @@ function rectPath(top, left, right, bottom, t) {
773
790
  let y = bottom - dist;
774
791
  return { x: left, y, angle: 270 };
775
792
  }
793
+ //Code from: https://github.com/floating-ui/floating-ui/blob/master/packages/utils/src/dom.ts
794
+ const transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective'];
795
+ const willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'];
796
+ const containValues = ['paint', 'layout', 'strict', 'content'];
797
+ function isElement(value) {
798
+ const elType = value?.ownerDocument?.defaultView?.Element;
799
+ return value instanceof Element || (elType != null && value instanceof elType);
800
+ }
801
+ /**
802
+ *
803
+ * @param {Element | CSSStyleDeclaration} elementOrCss
804
+ * @returns {boolean}
805
+ */
806
+ function isContainingBlock(elementOrCss) {
807
+ /** @type {CSSStyleDeclaration } */
808
+ //@ts-ignore
809
+ const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
810
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
811
+ // https://drafts.csswg.org/css-transforms-2/#individual-transforms
812
+ return (transformProperties.some((value) => css[value] ? css[value] !== 'none' : false) ||
813
+ (css.containerType ? css.containerType !== 'normal' : false) ||
814
+ (css.backdropFilter ? css.backdropFilter !== 'none' : false) ||
815
+ (css.filter ? css.filter !== 'none' : false) ||
816
+ willChangeValues.some((value) => (css.willChange || '').includes(value)) ||
817
+ containValues.some((value) => (css.contain || '').includes(value)));
818
+ }
819
+ //Code from: https://github.com/jcfranco/composed-offset-position/blob/main/src/index.ts
820
+ function flatTreeParent(element) {
821
+ if (element.assignedSlot)
822
+ return element.assignedSlot;
823
+ if (element.parentNode instanceof ShadowRoot)
824
+ return element.parentNode.host;
825
+ return element.parentNode;
826
+ }
827
+ function ancestorTreeScopes(element) {
828
+ const scopes = new Set();
829
+ let currentScope = element.getRootNode();
830
+ while (currentScope) {
831
+ scopes.add(currentScope);
832
+ currentScope = currentScope.parentNode
833
+ ? currentScope.parentNode.getRootNode()
834
+ : null;
835
+ }
836
+ return scopes;
837
+ }
838
+ function offsetParentPolyfill(element) {
839
+ // Do an initial walk to check for display:none ancestors.
840
+ for (let ancestor = element; ancestor; ancestor = flatTreeParent(ancestor)) {
841
+ if (!(ancestor instanceof Element))
842
+ continue;
843
+ if (getCachedComputedStyle(ancestor).display === 'none')
844
+ return null;
845
+ }
846
+ for (let ancestor = flatTreeParent(element); ancestor; ancestor = flatTreeParent(ancestor)) {
847
+ if (!(ancestor instanceof Element))
848
+ continue;
849
+ const style = getCachedComputedStyle(ancestor);
850
+ if (style.display === 'contents')
851
+ continue;
852
+ if (style.position !== 'static' || isContainingBlock(style))
853
+ return ancestor;
854
+ if (ancestor.tagName === 'BODY')
855
+ return ancestor;
856
+ }
857
+ return null;
858
+ }
859
+ /**
860
+ *
861
+ * @param {*} element
862
+ * @param {'offsetTop' | 'offsetLeft'} offsetTopOrLeft
863
+ * @returns
864
+ */
865
+ function offsetTopLeftPolyfill(element, offsetTopOrLeft) {
866
+ let value = element[offsetTopOrLeft];
867
+ let nextOffsetParent = offsetParentPolyfill(element);
868
+ const scopes = ancestorTreeScopes(element);
869
+ while (nextOffsetParent && !scopes.has(nextOffsetParent.getRootNode())) {
870
+ value -= nextOffsetParent[offsetTopOrLeft];
871
+ nextOffsetParent = offsetParentPolyfill(nextOffsetParent);
872
+ }
873
+ return value;
874
+ }
776
875
  //# sourceMappingURL=getBoxQuads.js.map
@@ -270,7 +270,8 @@ export class DesignItem {
270
270
  grp.commit();
271
271
  }
272
272
  get innerHTML() {
273
- return this.element.innerHTML;
273
+ const innerHTML = DomConverter.ConvertToString([...this.children()], false);
274
+ return innerHTML;
274
275
  }
275
276
  set innerHTML(value) {
276
277
  if (this.nodeType != NodeType.TextNode) {
@@ -302,15 +302,18 @@ export class PointerTool {
302
302
  else {
303
303
  const cp = { x: currentPoint.x - this._moveItemsOffset.x, y: currentPoint.y - this._moveItemsOffset.y };
304
304
  if (!this._started) {
305
- for (const item of this._actionStartedDesignItems) {
306
- designerCanvas.extensionManager.removeExtension(item, ExtensionType.Placement);
307
- designerCanvas.extensionManager.removeExtension(item, ExtensionType.MouseOver);
308
- designerCanvas.extensionManager.applyExtension(item, ExtensionType.Placement, event);
305
+ if (!currentContainerService.startPlacementAllowed || currentContainerService.startPlacementAllowed(event, designerCanvas, this._actionStartedDesignItem.parent, this._actionStartedDesignItems)) {
306
+ for (const item of this._actionStartedDesignItems) {
307
+ designerCanvas.extensionManager.removeExtension(item, ExtensionType.Placement);
308
+ designerCanvas.extensionManager.removeExtension(item, ExtensionType.MouseOver);
309
+ designerCanvas.extensionManager.applyExtension(item, ExtensionType.Placement, event);
310
+ }
311
+ currentContainerService.startPlace(event, designerCanvas, this._actionStartedDesignItem.parent, this._initialPoint, this._initialOffset, cp, this._actionStartedDesignItems);
312
+ this._started = true;
309
313
  }
310
- currentContainerService.startPlace(event, designerCanvas, this._actionStartedDesignItem.parent, this._initialPoint, this._initialOffset, cp, this._actionStartedDesignItems);
311
- this._started = true;
312
314
  }
313
- currentContainerService.place(event, designerCanvas, this._actionStartedDesignItem.parent, this._initialPoint, this._initialOffset, cp, this._actionStartedDesignItems);
315
+ else
316
+ currentContainerService.place(event, designerCanvas, this._actionStartedDesignItem.parent, this._initialPoint, this._initialOffset, cp, this._actionStartedDesignItems);
314
317
  }
315
318
  designerCanvas.extensionManager.refreshExtensions(this._actionStartedDesignItems, null, event, null, 20);
316
319
  }