@juo/blocks 1.15.0 → 2.0.0-alpha.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/{ExtensionRoot-C3lVJEBl.js → ExtensionRoot-DRpD5EcC.js} +24 -6
- package/dist/block-BjJztStr.js +993 -0
- package/dist/{block-VhmfGB3N.js → block-DnhzyZ1H.js} +38 -3
- package/dist/block.d.ts +56 -0
- package/dist/block.d.ts.map +1 -1
- package/dist/{bridge-xiKEzCGR.js → bridge-Mz0CqG6E.js} +39 -30
- package/dist/core.js +2429 -399
- package/dist/css-runtime-B7tZrBIp.js +749 -0
- package/dist/devtools/hook.d.ts +0 -5
- package/dist/devtools/hook.d.ts.map +1 -1
- package/dist/devtools/index.d.ts +0 -1
- package/dist/devtools/index.d.ts.map +1 -1
- package/dist/devtools/protocol.d.ts +15 -1
- package/dist/devtools/protocol.d.ts.map +1 -1
- package/dist/devtools.js +42 -9
- package/dist/editor/bridge.d.ts +7 -0
- package/dist/editor/bridge.d.ts.map +1 -1
- package/dist/editor/components.d.ts.map +1 -1
- package/dist/editor/main.d.ts +2 -1
- package/dist/editor/main.d.ts.map +1 -1
- package/dist/editor/messages.d.ts +13 -2
- package/dist/editor/messages.d.ts.map +1 -1
- package/dist/editor/overlays.d.ts +14 -0
- package/dist/editor/overlays.d.ts.map +1 -0
- package/dist/editor/overlays.test.d.ts +2 -0
- package/dist/editor/overlays.test.d.ts.map +1 -0
- package/dist/editor.js +52 -33
- package/dist/{gridstack-adapter-CDWbSpbt.js → gridstack-adapter-BGKGC-eO.js} +2 -2
- package/dist/main.d.ts +3 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/{morph-n4LMxOYo.js → morph-CT5hc5Qp.js} +1 -1
- package/dist/overlay-wrapper.d.ts +69 -0
- package/dist/overlay-wrapper.d.ts.map +1 -0
- package/dist/overlay-wrapper.test.d.ts +2 -0
- package/dist/overlay-wrapper.test.d.ts.map +1 -0
- package/dist/overlays/OverlayService.d.ts +34 -0
- package/dist/overlays/OverlayService.d.ts.map +1 -0
- package/dist/overlays/OverlayService.test.d.ts +2 -0
- package/dist/overlays/OverlayService.test.d.ts.map +1 -0
- package/dist/preact/block.d.ts.map +1 -1
- package/dist/preact/context.d.ts.map +1 -1
- package/dist/preact/context.test.d.ts +2 -0
- package/dist/preact/context.test.d.ts.map +1 -0
- package/dist/preact/signals.d.ts +19 -0
- package/dist/preact/signals.d.ts.map +1 -1
- package/dist/preact/useContextSubscription.test.d.ts +2 -0
- package/dist/preact/useContextSubscription.test.d.ts.map +1 -0
- package/dist/preact.js +33 -7
- package/dist/{project-gridstack-CM783oKI.js → project-gridstack-PxN_DIfP.js} +1 -1
- package/dist/react/block.d.ts.map +1 -1
- package/dist/react/context.d.ts.map +1 -1
- package/dist/react/context.test.d.ts +2 -0
- package/dist/react/context.test.d.ts.map +1 -0
- package/dist/react/signals.d.ts +19 -0
- package/dist/react/signals.d.ts.map +1 -1
- package/dist/react/useContextSubscription.test.d.ts +2 -0
- package/dist/react/useContextSubscription.test.d.ts.map +1 -0
- package/dist/react.js +40 -8
- package/dist/services/customer/adapter.d.ts +8 -0
- package/dist/services/customer/adapter.d.ts.map +1 -0
- package/dist/services/customer/customerService.d.ts +3 -2
- package/dist/services/customer/customerService.d.ts.map +1 -1
- package/dist/services/customer/index.d.ts +1 -0
- package/dist/services/customer/index.d.ts.map +1 -1
- package/dist/services/customer/types.d.ts +4 -1
- package/dist/services/customer/types.d.ts.map +1 -1
- package/dist/services/index.d.ts +4 -1
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/login/adapter.d.ts +33 -0
- package/dist/services/login/adapter.d.ts.map +1 -0
- package/dist/services/login/index.d.ts +3 -1
- package/dist/services/login/index.d.ts.map +1 -1
- package/dist/services/login/loginService.d.ts +6 -2
- package/dist/services/login/loginService.d.ts.map +1 -1
- package/dist/services/order/adapter.d.ts +10 -0
- package/dist/services/order/adapter.d.ts.map +1 -0
- package/dist/services/order/index.d.ts +4 -0
- package/dist/services/order/index.d.ts.map +1 -0
- package/dist/services/order/orderService.d.ts +6 -0
- package/dist/services/order/orderService.d.ts.map +1 -0
- package/dist/services/order/orderService.test.d.ts +2 -0
- package/dist/services/order/orderService.test.d.ts.map +1 -0
- package/dist/services/{orders → order}/types.d.ts +3 -3
- package/dist/services/order/types.d.ts.map +1 -0
- package/dist/services/product/adapter.d.ts +27 -2
- package/dist/services/product/adapter.d.ts.map +1 -1
- package/dist/services/product/adapter.test.d.ts +2 -0
- package/dist/services/product/adapter.test.d.ts.map +1 -0
- package/dist/services/product/index.d.ts +1 -1
- package/dist/services/product/index.d.ts.map +1 -1
- package/dist/services/product/productService.d.ts.map +1 -1
- package/dist/services/product/types.d.ts +68 -0
- package/dist/services/product/types.d.ts.map +1 -1
- package/dist/services/schedules/adapter.d.ts +94 -0
- package/dist/services/schedules/adapter.d.ts.map +1 -0
- package/dist/services/schedules/adapter.test.d.ts +2 -0
- package/dist/services/schedules/adapter.test.d.ts.map +1 -0
- package/dist/services/schedules/apiSchedulesAdapter.test.d.ts +2 -0
- package/dist/services/schedules/apiSchedulesAdapter.test.d.ts.map +1 -0
- package/dist/services/schedules/index.d.ts +5 -0
- package/dist/services/schedules/index.d.ts.map +1 -0
- package/dist/services/schedules/schedulesService.d.ts +11 -0
- package/dist/services/schedules/schedulesService.d.ts.map +1 -0
- package/dist/services/schedules/schedulesService.test.d.ts +2 -0
- package/dist/services/schedules/schedulesService.test.d.ts.map +1 -0
- package/dist/services/schedules/types.d.ts +290 -0
- package/dist/services/schedules/types.d.ts.map +1 -0
- package/dist/services/settings/index.d.ts +3 -0
- package/dist/services/settings/index.d.ts.map +1 -0
- package/dist/services/settings/settingsService.d.ts +7 -0
- package/dist/services/settings/settingsService.d.ts.map +1 -0
- package/dist/services/settings/settingsService.test.d.ts +2 -0
- package/dist/services/settings/settingsService.test.d.ts.map +1 -0
- package/dist/services/settings/types.d.ts +35 -0
- package/dist/services/settings/types.d.ts.map +1 -0
- package/dist/services/shop/index.d.ts +3 -0
- package/dist/services/shop/index.d.ts.map +1 -0
- package/dist/services/shop/shopService.d.ts +12 -0
- package/dist/services/shop/shopService.d.ts.map +1 -0
- package/dist/services/shop/shopService.test.d.ts +2 -0
- package/dist/services/shop/shopService.test.d.ts.map +1 -0
- package/dist/services/shop/types.d.ts +7 -0
- package/dist/services/shop/types.d.ts.map +1 -0
- package/dist/services/subscription/adapter.d.ts +77 -2
- package/dist/services/subscription/adapter.d.ts.map +1 -1
- package/dist/services/subscription/adapter.test.d.ts +2 -0
- package/dist/services/subscription/adapter.test.d.ts.map +1 -0
- package/dist/services/subscription/index.d.ts +1 -1
- package/dist/services/subscription/index.d.ts.map +1 -1
- package/dist/services/subscription/subscriptionService.d.ts +1 -6
- package/dist/services/subscription/subscriptionService.d.ts.map +1 -1
- package/dist/services/subscription/types.d.ts +220 -9
- package/dist/services/subscription/types.d.ts.map +1 -1
- package/dist/services/subscription/types.test.d.ts +2 -0
- package/dist/services/subscription/types.test.d.ts.map +1 -0
- package/dist/shared/context.d.ts +10 -3
- package/dist/shared/context.d.ts.map +1 -1
- package/dist/shared/touchSignals.d.ts +17 -0
- package/dist/shared/touchSignals.d.ts.map +1 -0
- package/dist/shared/touchSignals.test.d.ts +2 -0
- package/dist/shared/touchSignals.test.d.ts.map +1 -0
- package/dist/theme-state.d.ts +2 -1
- package/dist/theme-state.d.ts.map +1 -1
- package/dist/theme-state.params.test.d.ts +2 -0
- package/dist/theme-state.params.test.d.ts.map +1 -0
- package/dist/theme-state.translations.test.d.ts +2 -0
- package/dist/theme-state.translations.test.d.ts.map +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/vue/block.d.ts.map +1 -1
- package/dist/vue/context.d.ts +1 -0
- package/dist/vue/context.d.ts.map +1 -1
- package/dist/vue.js +28 -15
- package/dist/web-components/ExtensionRoot.d.ts +1 -0
- package/dist/web-components/ExtensionRoot.d.ts.map +1 -1
- package/dist/web-components-editor.js +6 -5
- package/dist/web-components-runtime.js +3 -2
- package/package.json +1 -1
- package/dist/css-runtime-ClH0MEYr.js +0 -1570
- package/dist/devtools/instrumentation.d.ts +0 -47
- package/dist/devtools/instrumentation.d.ts.map +0 -1
- package/dist/index-JSv6UH_o.js +0 -169
- package/dist/services/orders/adapter.d.ts +0 -8
- package/dist/services/orders/adapter.d.ts.map +0 -1
- package/dist/services/orders/index.d.ts +0 -4
- package/dist/services/orders/index.d.ts.map +0 -1
- package/dist/services/orders/ordersService.d.ts +0 -6
- package/dist/services/orders/ordersService.d.ts.map +0 -1
- package/dist/services/orders/ordersService.test.d.ts +0 -2
- package/dist/services/orders/ordersService.test.d.ts.map +0 -1
- package/dist/services/orders/types.d.ts.map +0 -1
|
@@ -17,15 +17,49 @@ function setSignalValue(signal2, value) {
|
|
|
17
17
|
}
|
|
18
18
|
signal2.value = value;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function touchSignals(obj) {
|
|
21
|
+
walk(obj, /* @__PURE__ */ new WeakSet());
|
|
22
|
+
}
|
|
23
|
+
function walk(value, seen) {
|
|
24
|
+
if (typeof value !== "object" || value == null || Array.isArray(value)) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (seen.has(value)) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
seen.add(value);
|
|
31
|
+
if ("brand" in value) {
|
|
32
|
+
void value.value;
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
for (const key of Object.keys(value)) {
|
|
36
|
+
walk(value[key], seen);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function wrapContext(obj) {
|
|
21
40
|
if (typeof obj !== "object" || obj == null) {
|
|
22
41
|
return obj;
|
|
23
42
|
}
|
|
43
|
+
const boundCache = /* @__PURE__ */ new WeakMap();
|
|
24
44
|
return new Proxy(obj, {
|
|
25
45
|
get(target, key) {
|
|
26
46
|
const val = target[key];
|
|
27
47
|
if (typeof val === "object" && val != null && "brand" in val) {
|
|
28
|
-
|
|
48
|
+
const sig = val;
|
|
49
|
+
return [
|
|
50
|
+
sig.value,
|
|
51
|
+
(value) => {
|
|
52
|
+
sig.value = value;
|
|
53
|
+
}
|
|
54
|
+
];
|
|
55
|
+
}
|
|
56
|
+
if (typeof val === "function") {
|
|
57
|
+
let bound = boundCache.get(val);
|
|
58
|
+
if (!bound) {
|
|
59
|
+
bound = val.bind(target);
|
|
60
|
+
boundCache.set(val, bound);
|
|
61
|
+
}
|
|
62
|
+
return bound;
|
|
29
63
|
}
|
|
30
64
|
return val;
|
|
31
65
|
}
|
|
@@ -43,9 +77,10 @@ function createSlotChildren(block) {
|
|
|
43
77
|
});
|
|
44
78
|
}
|
|
45
79
|
export {
|
|
80
|
+
toSignal as a,
|
|
46
81
|
createSlotChildren as c,
|
|
47
82
|
getSignalValue as g,
|
|
48
83
|
setSignalValue as s,
|
|
49
|
-
|
|
84
|
+
touchSignals as t,
|
|
50
85
|
wrapContext as w
|
|
51
86
|
};
|
package/dist/block.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { JSONSchema } from 'json-schema-to-ts';
|
|
2
|
+
import { JuoBlocksDevtoolsHook } from './devtools';
|
|
2
3
|
/**
|
|
3
4
|
* Returns true if `scope` has at least one visible direct element child.
|
|
4
5
|
* "Visible" follows the platform's `Element.checkVisibility()` rule
|
|
@@ -116,6 +117,61 @@ declare global {
|
|
|
116
117
|
"juo:block-wrapper-render": BlockWrapperEvent;
|
|
117
118
|
}
|
|
118
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* @internal devtools — merges any recorded devtools overrides for `id` on top
|
|
122
|
+
* of the given base props. Returns `props` unchanged when there is no override
|
|
123
|
+
* (the production path), avoiding allocation. Devtools edits live in the shared
|
|
124
|
+
* store (keyed by block id) so they survive re-renders: every renderer
|
|
125
|
+
* re-applies them, and the recorded snapshot reflects them too.
|
|
126
|
+
*/
|
|
127
|
+
export declare function applyDevtoolsPropOverride(id: string, props: Record<string, unknown>): Record<string, unknown>;
|
|
128
|
+
/**
|
|
129
|
+
* @internal devtools — registers a renderer-specific live prop setter. Non-CE
|
|
130
|
+
* renderers (e.g. the Vue `<div>` renderer) aren't reactive to DOM property
|
|
131
|
+
* sets, so they register a setter that mutates their reactive props source.
|
|
132
|
+
* `setDevtoolsBlockProp` prefers this over writing a DOM property.
|
|
133
|
+
*/
|
|
134
|
+
export declare function __recordDevtoolsPropSetter(id: string, setProp: (key: string, value: unknown) => void): void;
|
|
135
|
+
/** @internal devtools/test helper — records a rendered block instance for state pull. */
|
|
136
|
+
export declare function __recordDevtoolsInstance(inst: {
|
|
137
|
+
id: string;
|
|
138
|
+
type: string;
|
|
139
|
+
props: Record<string, unknown>;
|
|
140
|
+
el?: HTMLElement;
|
|
141
|
+
}): void;
|
|
142
|
+
/**
|
|
143
|
+
* @internal devtools — drops all recorded devtools state for an unmounted
|
|
144
|
+
* block (instance snapshot, live prop setter, prop overrides) so the maps
|
|
145
|
+
* don't leak across re-renders and `getBlockState` reflects the removal.
|
|
146
|
+
*/
|
|
147
|
+
export declare function __clearDevtoolsBlockState(id: string): void;
|
|
148
|
+
export declare function getDevtoolsBlockState(id: string): {
|
|
149
|
+
props: Record<string, unknown>;
|
|
150
|
+
propsSchema: Record<string, unknown> | null;
|
|
151
|
+
} | null;
|
|
152
|
+
/**
|
|
153
|
+
* Writes a single prop override for a recorded block instance. The override is
|
|
154
|
+
* stored centrally (so it survives re-renders) and then applied live:
|
|
155
|
+
*
|
|
156
|
+
* - Non-CE renderers register a setter via `__recordDevtoolsPropSetter` that
|
|
157
|
+
* re-applies the merged overrides to their reactive props source.
|
|
158
|
+
* - CE blocks fall back to writing the DOM property on the live custom element,
|
|
159
|
+
* which is reactive.
|
|
160
|
+
*
|
|
161
|
+
* Returns the updated (merged) state, or null when the block isn't recorded.
|
|
162
|
+
*/
|
|
163
|
+
export declare function setDevtoolsBlockProp(id: string, key: string, value: unknown): {
|
|
164
|
+
props: Record<string, unknown>;
|
|
165
|
+
} | null;
|
|
166
|
+
/**
|
|
167
|
+
* @internal devtools — publishes the (already-defined) state resolvers on the
|
|
168
|
+
* hook so a backend in a separate bundle can reach live block state. Idempotent
|
|
169
|
+
* and only ever runs when a devtools shell has installed the hook, so it is
|
|
170
|
+
* prod-inert.
|
|
171
|
+
*/
|
|
172
|
+
/** Human-readable block labels keyed by registry name (displayName ?? name). */
|
|
173
|
+
export declare function getDevtoolsBlockCatalog(): Record<string, string>;
|
|
174
|
+
export declare function attachDevtoolsResolvers(hook: JuoBlocksDevtoolsHook): void;
|
|
119
175
|
export declare function withWrapper(fn: (block: BlockInstance) => HTMLElement): (block: BlockInstance) => HTMLElement;
|
|
120
176
|
export declare function registerBlock<T>(block: BlockDefinition<T>): void;
|
|
121
177
|
export declare function onRegisterBlock(cb: (name: string, block: BlockDefinition) => void): () => void;
|
package/dist/block.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../src/block.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../src/block.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAW,KAAK,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAKjE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAkB7D;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,WAAW,EACjB,KAAK,CAAC,EAAE,UAAU,GACjB,MAAM,IAAI,CAmBZ;AAED,KAAK,MAAM,GAAG,EAAE,GAAG,CAAC,UAAU,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAA;CAA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ED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CA6BtE;AAWD,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,GAAG,CAAC;IAAC,KAAK,CAAC,EAAE,GAAG,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/C,aAAa,CA2Cf;AAED,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,KAAK,GAAG,aAAa,CAczE;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAUxE"}
|
|
@@ -31,7 +31,7 @@ function isEditorMessage(message) {
|
|
|
31
31
|
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" || message.type === "SCROLL_SYNC" || message.type === "REQUEST_CONTENT_HEIGHT" || message.type === "ADD_BLOCK_MENU_CLOSED" || message.type === "PROVIDE_LAYOUT" || message.type === "PROVIDE_LAYOUT_DOCUMENT" || message.type === "SET_LAYOUTING_MODE";
|
|
32
32
|
}
|
|
33
33
|
function isIframeMessage(message) {
|
|
34
|
-
return message.type === "SELECT_BLOCK" || message.type === "IFRAME_READY" || message.type === "REGISTER_BLOCKS" || message.type === "REGISTER_ROUTES" || message.type === "REMOVE_BLOCK" || message.type === "UPDATE_BLOCK_PROPS" || message.type === "REQUEST_THEME_STATE" || message.type === "UPSERT_THEME_STATE" || message.type === "REQUEST_TRANSLATION_OVERRIDES" || message.type === "UPDATE_BLOCK_TRANSLATION" || message.type === "REGISTER_BLOCK_TRANSLATION_KEYS" || message.type === "FOCUS_INLINE_TEXT" || message.type === "REQUEST_GLOBAL_STYLES" || message.type === "PROVIDE_INITIAL_GLOBAL_STYLES" || message.type === "REPORT_CONTENT_HEIGHT" || message.type === "SCROLL_SYNC" || message.type === "OPEN_ADD_BLOCK_MENU" || message.type === "REQUEST_CLOSE_ADD_BLOCK_MENU" || message.type === "LAYOUT_COMMAND" || message.type === "LAYOUTING_MODE_CHANGED" || message.type === "REPORT_BLOCK_CONTENT_SIZE";
|
|
34
|
+
return message.type === "SELECT_BLOCK" || message.type === "IFRAME_READY" || message.type === "REGISTER_BLOCKS" || message.type === "REGISTER_ROUTES" || message.type === "REGISTER_OVERLAYS" || message.type === "REMOVE_BLOCK" || message.type === "UPDATE_BLOCK_PROPS" || message.type === "REQUEST_THEME_STATE" || message.type === "UPSERT_THEME_STATE" || message.type === "REQUEST_TRANSLATION_OVERRIDES" || message.type === "UPDATE_BLOCK_TRANSLATION" || message.type === "REGISTER_BLOCK_TRANSLATION_KEYS" || message.type === "FOCUS_INLINE_TEXT" || message.type === "REQUEST_GLOBAL_STYLES" || message.type === "PROVIDE_INITIAL_GLOBAL_STYLES" || message.type === "REPORT_CONTENT_HEIGHT" || message.type === "SCROLL_SYNC" || message.type === "OPEN_ADD_BLOCK_MENU" || message.type === "REQUEST_CLOSE_ADD_BLOCK_MENU" || message.type === "LAYOUT_COMMAND" || message.type === "LAYOUTING_MODE_CHANGED" || message.type === "REPORT_BLOCK_CONTENT_SIZE";
|
|
35
35
|
}
|
|
36
36
|
function createProvideThemeStateMessage(payload) {
|
|
37
37
|
return {
|
|
@@ -170,6 +170,13 @@ function createRegisterRoutesMessage(payload) {
|
|
|
170
170
|
timestamp: Date.now()
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
|
+
function createRegisterOverlaysMessage(payload) {
|
|
174
|
+
return {
|
|
175
|
+
type: "REGISTER_OVERLAYS",
|
|
176
|
+
payload,
|
|
177
|
+
timestamp: Date.now()
|
|
178
|
+
};
|
|
179
|
+
}
|
|
173
180
|
function createSetGlobalStylesMessage(payload) {
|
|
174
181
|
return {
|
|
175
182
|
type: "SET_GLOBAL_STYLES",
|
|
@@ -614,6 +621,7 @@ function createEditorBridge() {
|
|
|
614
621
|
isEditorMode,
|
|
615
622
|
sendMessage,
|
|
616
623
|
onMessage,
|
|
624
|
+
getSelectedBlockId: () => selectedBlockId.value,
|
|
617
625
|
onBlockPresetChange,
|
|
618
626
|
requestThemeState,
|
|
619
627
|
upsertThemeState,
|
|
@@ -625,20 +633,21 @@ function createEditorBridge() {
|
|
|
625
633
|
return bridgeInstance;
|
|
626
634
|
}
|
|
627
635
|
export {
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
636
|
+
createRequestGlobalStylesMessage as A,
|
|
637
|
+
createRequestThemeStateMessage as B,
|
|
638
|
+
createRequestTranslationOverridesMessage as C,
|
|
639
|
+
createScrollSyncMessage as D,
|
|
640
|
+
createSelectBlockMessage as E,
|
|
641
|
+
createSetBlockPresetMessage as F,
|
|
642
|
+
createSetGlobalStylesMessage as G,
|
|
643
|
+
createSetLayoutingModeMessage as H,
|
|
644
|
+
createSetLocaleMessage as I,
|
|
645
|
+
createUpdateBlockPropsMessage as J,
|
|
646
|
+
createUpdateBlockTranslationMessage as K,
|
|
639
647
|
LAYOUT_BLOCK_WRAPPER_TAG as L,
|
|
640
|
-
|
|
641
|
-
|
|
648
|
+
createUpsertThemeStateMessage as M,
|
|
649
|
+
isEditorMessage as N,
|
|
650
|
+
isIframeMessage as O,
|
|
642
651
|
WRAPPER_SELECTOR as W,
|
|
643
652
|
createEditorBridge as a,
|
|
644
653
|
createOpenAddBlockMenuMessage as b,
|
|
@@ -649,21 +658,21 @@ export {
|
|
|
649
658
|
getEditorBridge as g,
|
|
650
659
|
createRegisterBlocksMessage as h,
|
|
651
660
|
isBlockWrapperTag as i,
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
661
|
+
createRegisterOverlaysMessage as j,
|
|
662
|
+
createRegisterRoutesMessage as k,
|
|
663
|
+
createAddBlockMenuClosedMessage as l,
|
|
664
|
+
createAddBlockMessage as m,
|
|
665
|
+
createFocusInlineTextMessage as n,
|
|
666
|
+
createMoveBlockMessage as o,
|
|
667
|
+
createProvideGlobalStylesMessage as p,
|
|
668
|
+
createProvideInitialGlobalStylesMessage as q,
|
|
660
669
|
resolveOutlineTarget as r,
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
670
|
+
createProvideLayoutDocumentMessage as s,
|
|
671
|
+
createProvideLayoutMessage as t,
|
|
672
|
+
createProvideThemeStateMessage as u,
|
|
673
|
+
createProvideTranslationOverridesMessage as v,
|
|
674
|
+
createRegisterBlockTranslationKeysMessage as w,
|
|
675
|
+
createReportBlockContentSizeMessage as x,
|
|
676
|
+
createReportContentHeightMessage as y,
|
|
677
|
+
createRequestCloseAddBlockMenuMessage as z
|
|
669
678
|
};
|