neo.mjs 5.16.3 → 5.16.4
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/apps/ServiceWorker.mjs
CHANGED
package/package.json
CHANGED
package/src/DefaultConfig.mjs
CHANGED
@@ -245,12 +245,12 @@ const DefaultConfig = {
|
|
245
245
|
useVdomWorker: true,
|
246
246
|
/**
|
247
247
|
* buildScripts/injectPackageVersion.mjs will update this value
|
248
|
-
* @default '5.16.
|
248
|
+
* @default '5.16.4'
|
249
249
|
* @memberOf! module:Neo
|
250
250
|
* @name config.version
|
251
251
|
* @type String
|
252
252
|
*/
|
253
|
-
version: '5.16.
|
253
|
+
version: '5.16.4'
|
254
254
|
};
|
255
255
|
|
256
256
|
Object.assign(DefaultConfig, {
|
@@ -49,21 +49,46 @@ class NeoResizeObserver extends Base {
|
|
49
49
|
}
|
50
50
|
|
51
51
|
/**
|
52
|
-
* Internal callback for the ResizeObserver instance
|
52
|
+
* Internal callback for the ResizeObserver instance.
|
53
|
+
* See: https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry
|
53
54
|
* @param {HTMLElement[]} entries
|
54
55
|
* @param {ResizeObserver} observer
|
55
56
|
* @protected
|
56
57
|
*/
|
57
58
|
onResize(entries, observer) {
|
58
59
|
entries.forEach(entry => {
|
60
|
+
// the content of entry is not spreadable, so we need to manually convert it
|
61
|
+
// structuredClone(entry) throws a JS error => ResizeObserverEntry object could not be cloned.
|
62
|
+
|
63
|
+
let borderBoxSize = entry.borderBoxSize[0],
|
64
|
+
contentBoxSize = entry.contentBoxSize[0],
|
65
|
+
devicePixelContentBoxSize = entry.devicePixelContentBoxSize?.[0] || {}, // Not supported in Safari yet
|
66
|
+
path = DomEvents.getPathFromElement(entry.target).map(e => DomEvents.getTargetData(e));
|
67
|
+
|
59
68
|
Neo.worker.Manager.sendMessage('app', {
|
60
69
|
action : 'domEvent',
|
61
70
|
eventName: 'resize',
|
62
71
|
|
63
72
|
data: {
|
64
|
-
|
65
|
-
|
66
|
-
|
73
|
+
contentRect: DomEvents.parseDomRect(entry.contentRect),
|
74
|
+
id : entry.target.id,
|
75
|
+
path,
|
76
|
+
rect : path[0].rect,
|
77
|
+
|
78
|
+
borderBoxSize: {
|
79
|
+
blockSize : borderBoxSize.blockSize,
|
80
|
+
inlineSize: borderBoxSize.inlineSize
|
81
|
+
},
|
82
|
+
|
83
|
+
contentBoxSize: {
|
84
|
+
blockSize : contentBoxSize.blockSize,
|
85
|
+
inlineSize: contentBoxSize.inlineSize
|
86
|
+
},
|
87
|
+
|
88
|
+
devicePixelContentBoxSize: {
|
89
|
+
blockSize : devicePixelContentBoxSize.blockSize,
|
90
|
+
inlineSize: devicePixelContentBoxSize.inlineSize
|
91
|
+
}
|
67
92
|
}
|
68
93
|
})
|
69
94
|
})
|