@cmssy/react 12.7.1 → 12.8.0
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/dist/client.cjs +6 -0
- package/dist/client.js +6 -0
- package/package.json +2 -2
package/dist/client.cjs
CHANGED
|
@@ -223,6 +223,10 @@ function findBlockEl(blockId) {
|
|
|
223
223
|
return null;
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
|
+
function announceResize() {
|
|
227
|
+
if (typeof window === "undefined") return;
|
|
228
|
+
window.dispatchEvent(new Event("resize"));
|
|
229
|
+
}
|
|
226
230
|
function canDetectInvisibleBlocks() {
|
|
227
231
|
return typeof document !== "undefined" && typeof IntersectionObserver !== "undefined";
|
|
228
232
|
}
|
|
@@ -375,6 +379,8 @@ function useEditBridge(page, config) {
|
|
|
375
379
|
setRemoved(
|
|
376
380
|
(prev) => prev.includes(message.blockId) ? prev : [...prev, message.blockId]
|
|
377
381
|
);
|
|
382
|
+
} else if (message.type === "cmssy:viewport") {
|
|
383
|
+
announceResize();
|
|
378
384
|
} else if (message.type === "cmssy:parent-ready") {
|
|
379
385
|
sendReady();
|
|
380
386
|
}
|
package/dist/client.js
CHANGED
|
@@ -221,6 +221,10 @@ function findBlockEl(blockId) {
|
|
|
221
221
|
return null;
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
+
function announceResize() {
|
|
225
|
+
if (typeof window === "undefined") return;
|
|
226
|
+
window.dispatchEvent(new Event("resize"));
|
|
227
|
+
}
|
|
224
228
|
function canDetectInvisibleBlocks() {
|
|
225
229
|
return typeof document !== "undefined" && typeof IntersectionObserver !== "undefined";
|
|
226
230
|
}
|
|
@@ -373,6 +377,8 @@ function useEditBridge(page, config) {
|
|
|
373
377
|
setRemoved(
|
|
374
378
|
(prev) => prev.includes(message.blockId) ? prev : [...prev, message.blockId]
|
|
375
379
|
);
|
|
380
|
+
} else if (message.type === "cmssy:viewport") {
|
|
381
|
+
announceResize();
|
|
376
382
|
} else if (message.type === "cmssy:parent-ready") {
|
|
377
383
|
sendReady();
|
|
378
384
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cmssy/react",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.8.0",
|
|
4
4
|
"description": "React blocks, renderers, data client and editor bridge for cmssy headless sites",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cmssy",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
},
|
|
98
98
|
"dependencies": {
|
|
99
99
|
"@cmssy/types": "0.35.0",
|
|
100
|
-
"@cmssy/core": "12.
|
|
100
|
+
"@cmssy/core": "12.8.0"
|
|
101
101
|
},
|
|
102
102
|
"scripts": {
|
|
103
103
|
"build": "tsup",
|