@juo/orion-extensions 0.10.0-staging.2 → 0.10.1
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/extensions.js +1 -56
- package/package.json +2 -2
package/dist/extensions.js
CHANGED
|
@@ -7783,7 +7783,7 @@ function createVueCeRenderer(name, component, { shadowRoot = true } = {}) {
|
|
|
7783
7783
|
return createCeRenderer(name);
|
|
7784
7784
|
}
|
|
7785
7785
|
function isEditorMessage(message) {
|
|
7786
|
-
return message.type === "PROVIDE_THEME_STATE" || message.type === "PROVIDE_TRANSLATION_OVERRIDES" || message.type === "SELECT_BLOCK" || message.type === "UPDATE_BLOCK_PROPS" || message.type === "ADD_BLOCK" || message.type === "REMOVE_BLOCK" || message.type === "MOVE_BLOCK" || message.type === "SET_BLOCK_PRESET" || message.type === "SET_LOCALE" || message.type === "SET_GLOBAL_STYLES" || message.type === "PROVIDE_GLOBAL_STYLES"
|
|
7786
|
+
return message.type === "PROVIDE_THEME_STATE" || message.type === "PROVIDE_TRANSLATION_OVERRIDES" || message.type === "SELECT_BLOCK" || message.type === "UPDATE_BLOCK_PROPS" || message.type === "ADD_BLOCK" || message.type === "REMOVE_BLOCK" || message.type === "MOVE_BLOCK" || message.type === "SET_BLOCK_PRESET" || message.type === "SET_LOCALE" || message.type === "SET_GLOBAL_STYLES" || message.type === "PROVIDE_GLOBAL_STYLES";
|
|
7787
7787
|
}
|
|
7788
7788
|
function createRequestThemeStateMessage(payload) {
|
|
7789
7789
|
return {
|
|
@@ -7814,20 +7814,6 @@ function createRequestGlobalStylesMessage(payload) {
|
|
|
7814
7814
|
timestamp: Date.now()
|
|
7815
7815
|
};
|
|
7816
7816
|
}
|
|
7817
|
-
function createScrollSyncMessage(payload) {
|
|
7818
|
-
return {
|
|
7819
|
-
type: "SCROLL_SYNC",
|
|
7820
|
-
payload,
|
|
7821
|
-
timestamp: Date.now()
|
|
7822
|
-
};
|
|
7823
|
-
}
|
|
7824
|
-
function createReportContentHeightMessage(payload) {
|
|
7825
|
-
return {
|
|
7826
|
-
type: "REPORT_CONTENT_HEIGHT",
|
|
7827
|
-
payload,
|
|
7828
|
-
timestamp: Date.now()
|
|
7829
|
-
};
|
|
7830
|
-
}
|
|
7831
7817
|
let bridgeInstance = null;
|
|
7832
7818
|
function createEditorBridge() {
|
|
7833
7819
|
if (bridgeInstance !== null) {
|
|
@@ -8010,13 +7996,6 @@ function createEditorBridge() {
|
|
|
8010
7996
|
}
|
|
8011
7997
|
} else if (data.type === "SELECT_BLOCK") {
|
|
8012
7998
|
updateBlockSelection(data.payload.blockId);
|
|
8013
|
-
} else if (data.type === "SCROLL_SYNC") {
|
|
8014
|
-
suppressScrollReport = true;
|
|
8015
|
-
window.scrollTo(0, data.payload.scrollY);
|
|
8016
|
-
return;
|
|
8017
|
-
} else if (data.type === "REQUEST_CONTENT_HEIGHT") {
|
|
8018
|
-
reportContentHeight();
|
|
8019
|
-
return;
|
|
8020
7999
|
}
|
|
8021
8000
|
messageHandlers.forEach((handler) => handler(data));
|
|
8022
8001
|
}
|
|
@@ -8038,35 +8017,6 @@ function createEditorBridge() {
|
|
|
8038
8017
|
});
|
|
8039
8018
|
}
|
|
8040
8019
|
const isEditorMode = window.parent !== window;
|
|
8041
|
-
let ghostScrollStyleEl = null;
|
|
8042
|
-
let ghostScrollObserver = null;
|
|
8043
|
-
let suppressScrollReport = false;
|
|
8044
|
-
function reportContentHeight() {
|
|
8045
|
-
var _a;
|
|
8046
|
-
if (!isEditorMode)
|
|
8047
|
-
return;
|
|
8048
|
-
const height = Math.max(
|
|
8049
|
-
document.documentElement.scrollHeight,
|
|
8050
|
-
((_a = document.body) == null ? void 0 : _a.scrollHeight) ?? 0
|
|
8051
|
-
);
|
|
8052
|
-
sendMessage(createReportContentHeightMessage({ height }));
|
|
8053
|
-
}
|
|
8054
|
-
function handleScrollEvent() {
|
|
8055
|
-
if (suppressScrollReport) {
|
|
8056
|
-
suppressScrollReport = false;
|
|
8057
|
-
return;
|
|
8058
|
-
}
|
|
8059
|
-
sendMessage(createScrollSyncMessage({ scrollY: window.scrollY }));
|
|
8060
|
-
}
|
|
8061
|
-
if (isEditorMode) {
|
|
8062
|
-
ghostScrollStyleEl = document.createElement("style");
|
|
8063
|
-
ghostScrollStyleEl.textContent = "html { scrollbar-width: none; } html::-webkit-scrollbar { display: none; }";
|
|
8064
|
-
document.head.appendChild(ghostScrollStyleEl);
|
|
8065
|
-
window.addEventListener("scroll", handleScrollEvent, { passive: true });
|
|
8066
|
-
ghostScrollObserver = new ResizeObserver(reportContentHeight);
|
|
8067
|
-
ghostScrollObserver.observe(document.documentElement);
|
|
8068
|
-
reportContentHeight();
|
|
8069
|
-
}
|
|
8070
8020
|
function onBlockPresetChange(blockId, callback) {
|
|
8071
8021
|
return onMessage((message) => {
|
|
8072
8022
|
if (message.type !== "SET_BLOCK_PRESET")
|
|
@@ -8083,11 +8033,6 @@ function createEditorBridge() {
|
|
|
8083
8033
|
function destroy() {
|
|
8084
8034
|
window.removeEventListener("message", handleWindowMessage);
|
|
8085
8035
|
document.removeEventListener("click", handleGlobalClick, true);
|
|
8086
|
-
window.removeEventListener("scroll", handleScrollEvent);
|
|
8087
|
-
ghostScrollObserver == null ? void 0 : ghostScrollObserver.disconnect();
|
|
8088
|
-
ghostScrollObserver = null;
|
|
8089
|
-
ghostScrollStyleEl == null ? void 0 : ghostScrollStyleEl.remove();
|
|
8090
|
-
ghostScrollStyleEl = null;
|
|
8091
8036
|
for (const [, { timer }] of pendingRequests) {
|
|
8092
8037
|
clearTimeout(timer);
|
|
8093
8038
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juo/orion-extensions",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.10.
|
|
4
|
+
"version": "0.10.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"tailwindcss": "3.3.5",
|
|
45
45
|
"vue": "3.5.13",
|
|
46
46
|
"@juo/customer-ui": "0.2.0",
|
|
47
|
-
"@juo/orion-core": "0.14.0
|
|
47
|
+
"@juo/orion-core": "0.14.0"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"dev": "vite build -w",
|