@juo/blocks 1.13.0 → 1.15.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/ExtensionRoot-C3lVJEBl.js +385 -0
- package/dist/block.d.ts.map +1 -1
- package/dist/block.devtools.test.d.ts +2 -0
- package/dist/block.devtools.test.d.ts.map +1 -0
- package/dist/{bridge-w5KQ-czl.js → bridge-xiKEzCGR.js} +146 -32
- package/dist/context.d.ts.map +1 -1
- package/dist/context.devtools.test.d.ts +2 -0
- package/dist/context.devtools.test.d.ts.map +1 -0
- package/dist/core.js +786 -37
- package/dist/{juo-workflow-BlG9CcAG.js → css-runtime-ClH0MEYr.js} +511 -618
- package/dist/devtools/env.d.ts +3 -0
- package/dist/devtools/env.d.ts.map +1 -0
- package/dist/devtools/hook.d.ts +40 -0
- package/dist/devtools/hook.d.ts.map +1 -0
- package/dist/devtools/index.d.ts +5 -0
- package/dist/devtools/index.d.ts.map +1 -0
- package/dist/devtools/instrumentation.d.ts +47 -0
- package/dist/devtools/instrumentation.d.ts.map +1 -0
- package/dist/devtools/protocol.d.ts +77 -0
- package/dist/devtools/protocol.d.ts.map +1 -0
- package/dist/devtools.js +11 -0
- package/dist/editor/bridge.d.ts +8 -0
- package/dist/editor/bridge.d.ts.map +1 -1
- package/dist/editor/canvas-mode-signal.d.ts +22 -0
- package/dist/editor/canvas-mode-signal.d.ts.map +1 -0
- package/dist/editor/canvas-mode.d.ts +15 -0
- package/dist/editor/canvas-mode.d.ts.map +1 -0
- package/dist/editor/canvas-mode.test.d.ts +2 -0
- package/dist/editor/canvas-mode.test.d.ts.map +1 -0
- package/dist/editor/components.d.ts +113 -0
- package/dist/editor/components.d.ts.map +1 -1
- package/dist/editor/components.test.d.ts.map +1 -1
- package/dist/editor/handler.d.ts.map +1 -1
- package/dist/editor/handler.test.d.ts +2 -0
- package/dist/editor/handler.test.d.ts.map +1 -0
- package/dist/editor/layout-command-emitter.d.ts +37 -0
- package/dist/editor/layout-command-emitter.d.ts.map +1 -0
- package/dist/editor/layout-command-emitter.test.d.ts +2 -0
- package/dist/editor/layout-command-emitter.test.d.ts.map +1 -0
- package/dist/editor/layout-system-signal.d.ts +21 -0
- package/dist/editor/layout-system-signal.d.ts.map +1 -0
- package/dist/editor/main.d.ts +1 -0
- package/dist/editor/main.d.ts.map +1 -1
- package/dist/editor/messages.d.ts +96 -3
- package/dist/editor/messages.d.ts.map +1 -1
- package/dist/editor/messages.test.d.ts +2 -0
- package/dist/editor/messages.test.d.ts.map +1 -0
- package/dist/editor/surface-context.d.ts +7 -0
- package/dist/editor/surface-context.d.ts.map +1 -0
- package/dist/editor/surface-context.test.d.ts +2 -0
- package/dist/editor/surface-context.test.d.ts.map +1 -0
- package/dist/editor/wrapper-shared.d.ts +31 -0
- package/dist/editor/wrapper-shared.d.ts.map +1 -0
- package/dist/editor.js +882 -57
- package/dist/gridstack-adapter-CDWbSpbt.js +5489 -0
- package/dist/index-JSv6UH_o.js +169 -0
- package/dist/layout/css-runtime.d.ts +41 -0
- package/dist/layout/css-runtime.d.ts.map +1 -0
- package/dist/layout/css-runtime.test.d.ts +2 -0
- package/dist/layout/css-runtime.test.d.ts.map +1 -0
- package/dist/layout/derive.d.ts +4 -0
- package/dist/layout/derive.d.ts.map +1 -0
- package/dist/layout/derive.test.d.ts +2 -0
- package/dist/layout/derive.test.d.ts.map +1 -0
- package/dist/layout/dividers.d.ts +34 -0
- package/dist/layout/dividers.d.ts.map +1 -0
- package/dist/layout/dividers.test.d.ts +2 -0
- package/dist/layout/dividers.test.d.ts.map +1 -0
- package/dist/layout/engine.d.ts +3 -0
- package/dist/layout/engine.d.ts.map +1 -0
- package/dist/layout/engine.test.d.ts +2 -0
- package/dist/layout/engine.test.d.ts.map +1 -0
- package/dist/layout/grid-utils.d.ts +57 -0
- package/dist/layout/grid-utils.d.ts.map +1 -0
- package/dist/layout/grid-utils.test.d.ts +2 -0
- package/dist/layout/grid-utils.test.d.ts.map +1 -0
- package/dist/layout/index.d.ts +13 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/index.test.d.ts +2 -0
- package/dist/layout/index.test.d.ts.map +1 -0
- package/dist/layout/insert.d.ts +34 -0
- package/dist/layout/insert.d.ts.map +1 -0
- package/dist/layout/insert.test.d.ts +2 -0
- package/dist/layout/insert.test.d.ts.map +1 -0
- package/dist/layout/override.d.ts +10 -0
- package/dist/layout/override.d.ts.map +1 -0
- package/dist/layout/override.test.d.ts +2 -0
- package/dist/layout/override.test.d.ts.map +1 -0
- package/dist/layout/project-css.d.ts +6 -0
- package/dist/layout/project-css.d.ts.map +1 -0
- package/dist/layout/project-css.test.d.ts +2 -0
- package/dist/layout/project-css.test.d.ts.map +1 -0
- package/dist/layout/project-gridstack.d.ts +50 -0
- package/dist/layout/project-gridstack.d.ts.map +1 -0
- package/dist/layout/project-gridstack.test.d.ts +2 -0
- package/dist/layout/project-gridstack.test.d.ts.map +1 -0
- package/dist/layout/reconcile.d.ts +23 -0
- package/dist/layout/reconcile.d.ts.map +1 -0
- package/dist/layout/reconcile.test.d.ts +2 -0
- package/dist/layout/reconcile.test.d.ts.map +1 -0
- package/dist/layout/types.d.ts +118 -0
- package/dist/layout/types.d.ts.map +1 -0
- package/dist/layout-mode-adapter-BBd4JRQd.js +21 -0
- package/dist/main.d.ts +7 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/morph-n4LMxOYo.js +182 -0
- package/dist/preact/block.d.ts.map +1 -1
- package/dist/preact.js +14 -10
- package/dist/project-gridstack-CM783oKI.js +52 -0
- package/dist/react/block.d.ts.map +1 -1
- package/dist/react.js +13 -9
- package/dist/registry.devtools.test.d.ts +2 -0
- package/dist/registry.devtools.test.d.ts.map +1 -0
- package/dist/theme-state.d.ts +16 -0
- package/dist/theme-state.d.ts.map +1 -1
- package/dist/theme-state.layout.test.d.ts +2 -0
- package/dist/theme-state.layout.test.d.ts.map +1 -0
- package/dist/theme-state.test.d.ts +2 -0
- package/dist/theme-state.test.d.ts.map +1 -0
- package/dist/vue/block.d.ts.map +1 -1
- package/dist/vue.js +22 -4
- package/dist/web-components/ExtensionRoot.d.ts +50 -2
- package/dist/web-components/ExtensionRoot.d.ts.map +1 -1
- package/dist/web-components/editor/ExtensionRoot.d.ts +11 -0
- package/dist/web-components/editor/ExtensionRoot.d.ts.map +1 -0
- package/dist/web-components/editor/ExtensionRoot.test.d.ts +2 -0
- package/dist/web-components/editor/ExtensionRoot.test.d.ts.map +1 -0
- package/dist/web-components/editor/InlineText.d.ts +1 -0
- package/dist/web-components/editor/InlineText.d.ts.map +1 -1
- package/dist/web-components/editor/editor-layout-controller.d.ts +28 -0
- package/dist/web-components/editor/editor-layout-controller.d.ts.map +1 -0
- package/dist/web-components/editor/gridstack-adapter.d.ts +3 -0
- package/dist/web-components/editor/gridstack-adapter.d.ts.map +1 -0
- package/dist/web-components/editor/gridstack-adapter.test.d.ts +2 -0
- package/dist/web-components/editor/gridstack-adapter.test.d.ts.map +1 -0
- package/dist/web-components/editor/morph.d.ts +32 -0
- package/dist/web-components/editor/morph.d.ts.map +1 -0
- package/dist/web-components/editor/morph.test.d.ts +2 -0
- package/dist/web-components/editor/morph.test.d.ts.map +1 -0
- package/dist/web-components/layout/layout-controller.d.ts +55 -0
- package/dist/web-components/layout/layout-controller.d.ts.map +1 -0
- package/dist/web-components/layout/view-layout-controller.d.ts +17 -0
- package/dist/web-components/layout/view-layout-controller.d.ts.map +1 -0
- package/dist/web-components/layout/view-layout-controller.test.d.ts +2 -0
- package/dist/web-components/layout/view-layout-controller.test.d.ts.map +1 -0
- package/dist/web-components/layout-grid.d.ts +47 -0
- package/dist/web-components/layout-grid.d.ts.map +1 -0
- package/dist/web-components/layout-grid.test.d.ts +2 -0
- package/dist/web-components/layout-grid.test.d.ts.map +1 -0
- package/dist/web-components/layout-mode-adapter.d.ts +57 -0
- package/dist/web-components/layout-mode-adapter.d.ts.map +1 -0
- package/dist/web-components/layout-mode-adapter.test.d.ts +2 -0
- package/dist/web-components/layout-mode-adapter.test.d.ts.map +1 -0
- package/dist/web-components-editor.js +130 -17
- package/dist/web-components-runtime.js +4 -3
- package/package.json +7 -2
- package/dist/ExtensionRoot-2xTGTu3K.js +0 -219
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/devtools/env.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,EAMJ,OAAO,UAAU,CAAC;AAEjC,eAAO,MAAM,SAAS,SAAgC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { DevtoolsEvent, DevtoolsEventKind, PropsSchema } from './protocol';
|
|
2
|
+
/**
|
|
3
|
+
* The page-side resolver surface the framework (`blocks/core`) publishes on the
|
|
4
|
+
* hook so a backend running in a *separate bundle* (e.g. an injected extension
|
|
5
|
+
* script) can read/write live block state without importing `@juo/blocks`.
|
|
6
|
+
* Tree + picker are NOT here — the backend derives them from the DOM.
|
|
7
|
+
*/
|
|
8
|
+
export interface DevtoolsResolverSurface {
|
|
9
|
+
getBlockState(id: string): {
|
|
10
|
+
props: Record<string, unknown>;
|
|
11
|
+
propsSchema: PropsSchema;
|
|
12
|
+
} | null;
|
|
13
|
+
setBlockProp(id: string, key: string, value: unknown): {
|
|
14
|
+
props: Record<string, unknown>;
|
|
15
|
+
} | null;
|
|
16
|
+
/** Registry name → editor display label (displayName ?? name). */
|
|
17
|
+
getBlockCatalog(): Record<string, string>;
|
|
18
|
+
}
|
|
19
|
+
export interface JuoBlocksDevtoolsHook {
|
|
20
|
+
readonly version: number;
|
|
21
|
+
emit(kind: DevtoolsEventKind, payload: Record<string, unknown>): void;
|
|
22
|
+
on(cb: (e: DevtoolsEvent) => void): () => void;
|
|
23
|
+
off(cb: (e: DevtoolsEvent) => void): void;
|
|
24
|
+
/** Attached by `blocks/core` on first lifecycle emit; undefined until then. */
|
|
25
|
+
resolvers?: DevtoolsResolverSurface;
|
|
26
|
+
/**
|
|
27
|
+
* @internal Lazily-created `BlocksInstrumentation` implementation, cached
|
|
28
|
+
* here so it is shared across separately-bundled `block.ts` module instances.
|
|
29
|
+
*/
|
|
30
|
+
__instrumentation?: unknown;
|
|
31
|
+
}
|
|
32
|
+
declare global {
|
|
33
|
+
var __JUO_BLOCKS_DEVTOOLS_HOOK__: JuoBlocksDevtoolsHook | undefined;
|
|
34
|
+
}
|
|
35
|
+
export declare function createHook(): JuoBlocksDevtoolsHook;
|
|
36
|
+
/** Installs (idempotently) and returns the global hook. */
|
|
37
|
+
export declare function installHook(): JuoBlocksDevtoolsHook;
|
|
38
|
+
/** Returns the global hook if a shell has installed one, else undefined. */
|
|
39
|
+
export declare function getHook(): JuoBlocksDevtoolsHook | undefined;
|
|
40
|
+
//# sourceMappingURL=hook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../../src/devtools/hook.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EACjB,MAAM,YAAY,CAAC;AAIpB;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG;QACzB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC/B,WAAW,EAAE,WAAW,CAAC;KAC1B,GAAG,IAAI,CAAC;IACT,YAAY,CACV,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,OAAO,GACb;QACD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAChC,GAAG,IAAI,CAAC;IACT,kEAAkE;IAClE,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACtE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,aAAa,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAC/C,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,aAAa,KAAK,IAAI,GAAG,IAAI,CAAC;IAC1C,+EAA+E;IAC/E,SAAS,CAAC,EAAE,uBAAuB,CAAC;IACpC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,4BAA4B,EAAE,qBAAqB,GAAG,SAAS,CAAC;CACrE;AAED,wBAAgB,UAAU,IAAI,qBAAqB,CAqBlD;AAED,2DAA2D;AAC3D,wBAAgB,WAAW,IAAI,qBAAqB,CAEnD;AAED,4EAA4E;AAC5E,wBAAgB,OAAO,IAAI,qBAAqB,GAAG,SAAS,CAE3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/devtools/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,kBAAkB,EAAE,KAAK,qBAAqB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { BlockDefinition, BlockInstance } from '../block';
|
|
2
|
+
/** @internal Wires the block registry into the devtools instrumentation. */
|
|
3
|
+
export declare function __setDefinedBlocksReader(fn: () => BlockDefinition[]): void;
|
|
4
|
+
/**
|
|
5
|
+
* The single seam between the framework runtime and devtools.
|
|
6
|
+
*
|
|
7
|
+
* Regular code calls `getInstrumentation().X(...)` at each touchpoint — never
|
|
8
|
+
* `getHook()` and never a null check. In production (no devtools shell) the
|
|
9
|
+
* shared {@link noop} implementation is returned, so every call is a single
|
|
10
|
+
* global read followed by a do-nothing method (and `resolveProps` is the
|
|
11
|
+
* identity on `block.props`, with no allocation). When a devtools shell has
|
|
12
|
+
* installed the hook, the real implementation is created lazily and cached on
|
|
13
|
+
* the hook so it is shared across separately-bundled `block.ts` module
|
|
14
|
+
* instances (see `createDevtoolsInstrumentation`).
|
|
15
|
+
*/
|
|
16
|
+
export interface BlocksInstrumentation {
|
|
17
|
+
/** A block definition was registered. */
|
|
18
|
+
onBlockRegistered(def: BlockDefinition): void;
|
|
19
|
+
/** A block instance finished rendering into `el`. */
|
|
20
|
+
onBlockRendered(block: BlockInstance, el: HTMLElement): void;
|
|
21
|
+
/** A block instance was removed from the page (editor delete, cache prune, …). */
|
|
22
|
+
onBlockUnmounted(id: string): void;
|
|
23
|
+
/** A context value was provided. */
|
|
24
|
+
onContextProvided(context: unknown): void;
|
|
25
|
+
/** A context value was requested. */
|
|
26
|
+
onContextRequested(context: unknown): void;
|
|
27
|
+
/**
|
|
28
|
+
* Returns the props to render now: the block's base props merged with any
|
|
29
|
+
* recorded devtools override. The identity on `block.props` in production.
|
|
30
|
+
*/
|
|
31
|
+
resolveProps(block: BlockInstance): Record<string, unknown>;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the props to render now and, for renderers that mount into a plain
|
|
34
|
+
* element (React/Preact/Vue) and aren't reactive to DOM property sets,
|
|
35
|
+
* registers a live setter that re-renders via `rerender` on each devtools
|
|
36
|
+
* edit. `getBaseProps` lets a renderer that keeps a live instance (Vue) supply
|
|
37
|
+
* its latest base props. Returns the base props (no setter) in production.
|
|
38
|
+
*/
|
|
39
|
+
bindLiveProps(block: BlockInstance, rerender: (props: Record<string, unknown>) => void, getBaseProps?: () => Record<string, unknown>): Record<string, unknown>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Returns the active instrumentation. The no-op when no devtools shell has
|
|
43
|
+
* installed the hook; otherwise the real implementation, created lazily and
|
|
44
|
+
* cached on the hook so it is shared across module instances.
|
|
45
|
+
*/
|
|
46
|
+
export declare function getInstrumentation(): BlocksInstrumentation;
|
|
47
|
+
//# sourceMappingURL=instrumentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../src/devtools/instrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAa/D,4EAA4E;AAC5E,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,MAAM,eAAe,EAAE,GAAG,IAAI,CAE1E;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,qBAAqB;IACpC,yCAAyC;IACzC,iBAAiB,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI,CAAC;IAC9C,qDAAqD;IACrD,eAAe,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7D,kFAAkF;IAClF,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,oCAAoC;IACpC,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1C,qCAAqC;IACrC,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3C;;;OAGG;IACH,YAAY,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5D;;;;;;OAMG;IACH,aAAa,CACX,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,EAClD,YAAY,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC3C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5B;AAgLD;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,qBAAqB,CAO1D"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export declare const PROTOCOL_VERSION: 1;
|
|
2
|
+
export type BlockNode = {
|
|
3
|
+
id: string;
|
|
4
|
+
type: string;
|
|
5
|
+
slot: string | null;
|
|
6
|
+
parentId: string | null;
|
|
7
|
+
propKeys: string[];
|
|
8
|
+
};
|
|
9
|
+
/** A node in the DOM-derived, nested block tree. */
|
|
10
|
+
export type BlockTreeNode = {
|
|
11
|
+
id: string;
|
|
12
|
+
type: string;
|
|
13
|
+
slot: string | null;
|
|
14
|
+
children: BlockTreeNode[];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* The `props` sub-schema of a block definition (a JSON Schema object), as used
|
|
18
|
+
* by the visual editor to pick controls. Carried to the panel so it can render
|
|
19
|
+
* controls that reflect each prop's real type (dropdowns for enums, color
|
|
20
|
+
* pickers, steppers, …) instead of guessing from the runtime value. JSON-safe.
|
|
21
|
+
*/
|
|
22
|
+
export type PropsSchema = {
|
|
23
|
+
type?: string;
|
|
24
|
+
properties?: Record<string, Record<string, unknown>>;
|
|
25
|
+
required?: string[];
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
} | null;
|
|
28
|
+
export type DevtoolsEventKind = "block:registered" | "block:mounted" | "block:updated" | "block:unmounted" | "signal:changed" | "context:provide" | "context:request" | "block:picked" | "tree:changed";
|
|
29
|
+
export interface DevtoolsEvent {
|
|
30
|
+
v: typeof PROTOCOL_VERSION;
|
|
31
|
+
kind: DevtoolsEventKind;
|
|
32
|
+
ts: number;
|
|
33
|
+
payload: Record<string, unknown>;
|
|
34
|
+
}
|
|
35
|
+
/** Pull-on-demand RPC the engine (server) exposes to the client. */
|
|
36
|
+
export interface DevtoolsServerFns {
|
|
37
|
+
getSnapshot(): Promise<{
|
|
38
|
+
nodes: BlockNode[];
|
|
39
|
+
registered: string[];
|
|
40
|
+
/** Registry name → editor display label. */
|
|
41
|
+
blockLabels: Record<string, string>;
|
|
42
|
+
}>;
|
|
43
|
+
getBlockState(id: string): Promise<{
|
|
44
|
+
props: Record<string, unknown>;
|
|
45
|
+
propsSchema: PropsSchema;
|
|
46
|
+
} | null>;
|
|
47
|
+
/**
|
|
48
|
+
* Writes a single prop on a live block and returns its updated state.
|
|
49
|
+
* Works for custom-element blocks (the property set is reactive); the edit
|
|
50
|
+
* is a live tweak and may be overwritten if upstream data re-renders.
|
|
51
|
+
*/
|
|
52
|
+
setBlockProp(id: string, key: string, value: unknown): Promise<{
|
|
53
|
+
props: Record<string, unknown>;
|
|
54
|
+
} | null>;
|
|
55
|
+
/** Returns the live, nested block tree derived from the page DOM. */
|
|
56
|
+
getTree(): Promise<BlockTreeNode[]>;
|
|
57
|
+
highlight(id: string | null): Promise<void>;
|
|
58
|
+
/** Persistent outline for the currently selected block in the tree. */
|
|
59
|
+
highlightSelected(id: string | null): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Scrolls the block's element into view in the page and briefly flashes the
|
|
62
|
+
* highlight box over it (auto-hiding after a short delay). Purely a viewport
|
|
63
|
+
* affordance — it does not change selection.
|
|
64
|
+
*/
|
|
65
|
+
scrollToBlock(id: string): Promise<void>;
|
|
66
|
+
/** Begins the page-side element picker; resolves immediately. The pick
|
|
67
|
+
* arrives later as a pushed `block:picked` event. */
|
|
68
|
+
startPicker(): Promise<void>;
|
|
69
|
+
/** Cancels the page-side element picker if active. */
|
|
70
|
+
stopPicker(): Promise<void>;
|
|
71
|
+
}
|
|
72
|
+
/** Functions the client exposes to the server (push notifications). */
|
|
73
|
+
export interface DevtoolsClientFns {
|
|
74
|
+
onEvent(e: DevtoolsEvent): void;
|
|
75
|
+
}
|
|
76
|
+
export declare function isDevtoolsEvent(x: unknown): x is DevtoolsEvent;
|
|
77
|
+
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/devtools/protocol.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,EAAG,CAAU,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AE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACrC,CAAC,CAAC;IACH,aAAa,CACX,EAAE,EAAE,MAAM,GACT,OAAO,CAAC;QACT,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC/B,WAAW,EAAE,WAAW,CAAC;KAC1B,GAAG,IAAI,CAAC,CAAC;IACV;;;;OAIG;IACH,YAAY,CACV,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,OAAO,GACb,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,GAAG,IAAI,CAAC,CAAC;IACtD,qEAAqE;IACrE,OAAO,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IACpC,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,uEAAuE;IACvE,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD;;;;OAIG;IACH,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC;yDACqD;IACrD,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,sDAAsD;IACtD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B;AAED,uEAAuE;AACvE,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;CACjC;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,aAAa,CAQ9D"}
|
package/dist/devtools.js
ADDED
package/dist/editor/bridge.d.ts
CHANGED
|
@@ -61,6 +61,14 @@ export interface EditorBridge {
|
|
|
61
61
|
upsertThemeState: (surface: ThemeSurface, id: string, blocks: Block[]) => void;
|
|
62
62
|
requestTranslationOverrides: (locale: string) => Promise<TranslationOverride[]>;
|
|
63
63
|
requestGlobalStyles: () => Promise<GlobalStyles>;
|
|
64
|
+
/**
|
|
65
|
+
* Preserve the iframe scroll position across a re-render that transiently
|
|
66
|
+
* collapses content height (e.g. toggling layout mode). Capture is synchronous,
|
|
67
|
+
* so call this BEFORE triggering the re-render; the position is restored once
|
|
68
|
+
* layout settles, with scroll-report echoes suppressed so the parent isn't
|
|
69
|
+
* dragged to the transient clamped (top) position.
|
|
70
|
+
*/
|
|
71
|
+
preserveScrollAcrossReflow: () => void;
|
|
64
72
|
/**
|
|
65
73
|
* Tears down the bridge: removes event listeners, rejects pending requests,
|
|
66
74
|
* clears message handlers, and resets the singleton so a new bridge can be created.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../src/editor/bridge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EAGd,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../src/editor/bridge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EAGd,MAAM,YAAY,CAAC;AAapB,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,UAAU,CAAC;AAGtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,MAAM,WAAW,UAAU,CACzB,MAAM,GAAG,OAAO,EAChB,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAElC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,QAAQ,CAAC;CACnB;AAED,MAAM,MAAM,kBAAkB,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,QAAQ,CAAC,SAAS;IAC1E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MAAM,IAAI,CAAC;CACrB;AAID;;;GAGG;AACH,wBAAgB,eAAe,IAAI,YAAY,GAAG,IAAI,CAErD;AAED,wBAAgB,kBAAkB,IAAI,YAAY,CA8gBjD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Signal } from '@preact/signals-core';
|
|
2
|
+
/**
|
|
3
|
+
* Iframe-side flag: is the editor canvas currently in layouting mode?
|
|
4
|
+
*
|
|
5
|
+
* `ExtensionRoot` reads this reactively; when on AND the host opts into
|
|
6
|
+
* grid-layout AND a LayoutDocument exists AND a LayoutModeAdapter is
|
|
7
|
+
* registered, rendering is delegated to the adapter instead of the CSS Grid
|
|
8
|
+
* path.
|
|
9
|
+
*
|
|
10
|
+
* Owned by core (`@juo/blocks`) so it is a SINGLE shared instance across the
|
|
11
|
+
* separately-loaded production bundles. The arrange handle / `enterLayout`
|
|
12
|
+
* live in `editor.js` and write this; `ExtensionRoot` lives in
|
|
13
|
+
* `web-components-editor.js` and subscribes to it. Because `@juo/blocks` is
|
|
14
|
+
* `external` in the build, both bundles resolve this import to the one copy in
|
|
15
|
+
* `core.js` — the same mechanism `themeState` and the re-exported signals
|
|
16
|
+
* runtime already rely on to cross the bundle boundary. It lives in its own
|
|
17
|
+
* dependency-free module (no editor `bridge` import) so owning it in core does
|
|
18
|
+
* not pull editor-only code into `core.js`; the bridge-dependent behavior
|
|
19
|
+
* (`setCanvasMode`/`resetCanvasMode`) stays in `./canvas-mode`.
|
|
20
|
+
*/
|
|
21
|
+
export declare const canvasMode: Signal<boolean>;
|
|
22
|
+
//# sourceMappingURL=canvas-mode-signal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canvas-mode-signal.d.ts","sourceRoot":"","sources":["../../src/editor/canvas-mode-signal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAU,MAAM,sBAAsB,CAAC;AAE3D;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,OAAO,CAA0B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { canvasMode } from '../main.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Editor-side behavior for the canvas layouting flag.
|
|
4
|
+
*
|
|
5
|
+
* The `canvasMode` signal itself is owned by core (`./canvas-mode-signal`,
|
|
6
|
+
* re-exported from `@juo/blocks`) so it is a single shared instance across the
|
|
7
|
+
* separately-loaded `editor.js` / `web-components-editor.js` bundles. This
|
|
8
|
+
* module only holds the mutators, which depend on the editor `bridge` and must
|
|
9
|
+
* therefore stay out of `core.js`. It re-exports `canvasMode` so existing
|
|
10
|
+
* importers of `./canvas-mode` keep working.
|
|
11
|
+
*/
|
|
12
|
+
export { canvasMode };
|
|
13
|
+
export declare function setCanvasMode(enabled: boolean): void;
|
|
14
|
+
export declare function resetCanvasMode(): void;
|
|
15
|
+
//# sourceMappingURL=canvas-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canvas-mode.d.ts","sourceRoot":"","sources":["../../src/editor/canvas-mode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC;;;;;;;;;GASG;AACH,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAOpD;AAED,wBAAgB,eAAe,IAAI,IAAI,CAEtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canvas-mode.test.d.ts","sourceRoot":"","sources":["../../src/editor/canvas-mode.test.ts"],"names":[],"mappings":""}
|
|
@@ -51,4 +51,117 @@ declare global {
|
|
|
51
51
|
"juo-editor-block-wrapper": BlockWrapper;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
+
export declare class LayoutBlockWrapper extends HTMLElement {
|
|
55
|
+
private block;
|
|
56
|
+
private editorBridge;
|
|
57
|
+
private skeletonTitle;
|
|
58
|
+
private skeletonLines;
|
|
59
|
+
private skeletonResizeObserver;
|
|
60
|
+
private toolbar;
|
|
61
|
+
private toolbarRafId;
|
|
62
|
+
private toolbarScrollListening;
|
|
63
|
+
private hoverOutlineTarget;
|
|
64
|
+
private selectionOutlineTarget;
|
|
65
|
+
static get observedAttributes(): string[];
|
|
66
|
+
attributeChangedCallback(name: string): void;
|
|
67
|
+
private skeletonRafId;
|
|
68
|
+
private scheduleSkeletonRecompute;
|
|
69
|
+
constructor();
|
|
70
|
+
private setupTemplate;
|
|
71
|
+
/**
|
|
72
|
+
* Build the center hover toolbar. Buttons (left→right): layout toggle (grip,
|
|
73
|
+
* leading), add-below, delete, fill-horizontal.
|
|
74
|
+
* pointerdown/click are stopped at the container so selecting a tool never
|
|
75
|
+
* bubbles to the bridge's global-click selection.
|
|
76
|
+
*/
|
|
77
|
+
private buildToolbar;
|
|
78
|
+
private createToolButton;
|
|
79
|
+
/**
|
|
80
|
+
* Pointerdown on the layout toggle grip.
|
|
81
|
+
*
|
|
82
|
+
* - View mode: "arm" layout mode — the canvas morphs into GridStack, after
|
|
83
|
+
* which the merchant drags/resizes natively. Passing THIS element (not its
|
|
84
|
+
* id) lets the morph controller scroll + pop the exact block grabbed.
|
|
85
|
+
* stopPropagation keeps the bridge's global-click selection — and the morph
|
|
86
|
+
* controller's click-away exit — from also firing.
|
|
87
|
+
* - Layout mode: the grip IS GridStack's drag handle, so we do nothing here and
|
|
88
|
+
* let the event fall through. GridStack starts the drag off `mousedown` (a
|
|
89
|
+
* separate event from this `pointerdown`), so it is unaffected by the
|
|
90
|
+
* toolbar's pointerdown stop; toggling back to view would abort the drag
|
|
91
|
+
* before it begins.
|
|
92
|
+
*/
|
|
93
|
+
private handleMorphGrab;
|
|
94
|
+
/** Open the add-block menu anchored to the toolbar button, inserting AFTER. */
|
|
95
|
+
private handleAddBelow;
|
|
96
|
+
/**
|
|
97
|
+
* Traverse up the DOM (crossing shadow-root boundaries) to resolve the
|
|
98
|
+
* containing block wrapper's id, then send REMOVE_BLOCK. Mirrors the legacy
|
|
99
|
+
* wrapper's removal, but recognizes either wrapper tag (grid nesting uses the
|
|
100
|
+
* layout wrapper).
|
|
101
|
+
*/
|
|
102
|
+
private handleRemoveBlock;
|
|
103
|
+
/** Resolve the parent element, crossing shadow-root boundaries. */
|
|
104
|
+
private getParentElement;
|
|
105
|
+
/**
|
|
106
|
+
* Toggle the block's sticky fill flag. Emitted as a layout command; the parent
|
|
107
|
+
* engine flips the flag, expands the block into its free row-band space, pushes
|
|
108
|
+
* the change to history + re-syncs the iframe.
|
|
109
|
+
*/
|
|
110
|
+
private handleFillWidth;
|
|
111
|
+
connectedCallback(): void;
|
|
112
|
+
disconnectedCallback(): void;
|
|
113
|
+
private handleHoverEnter;
|
|
114
|
+
private handleHoverLeave;
|
|
115
|
+
/**
|
|
116
|
+
* Center the toolbar on the block's VISIBLE portion so it stays reachable when
|
|
117
|
+
* the block is taller than / partially scrolled out of the viewport. When the
|
|
118
|
+
* block is fully on screen this equals its geometric center.
|
|
119
|
+
*/
|
|
120
|
+
private positionToolbar;
|
|
121
|
+
private startToolbarTracking;
|
|
122
|
+
private stopToolbarTracking;
|
|
123
|
+
private scheduleToolbarReposition;
|
|
124
|
+
private paintTarget;
|
|
125
|
+
private updateActiveState;
|
|
126
|
+
/**
|
|
127
|
+
* Height-tiers for the placeholder bar count. Deliberately sparse: the bars
|
|
128
|
+
* are a hint at "a block lives here", not a faithful line count, so we show
|
|
129
|
+
* few and cap hard to avoid a noisy wall of identical bars on tall blocks.
|
|
130
|
+
* Cells too short for >= 2 bars render header-only (no lonely single bar).
|
|
131
|
+
*/
|
|
132
|
+
private static readonly SKELETON_LINE_H;
|
|
133
|
+
private static readonly SKELETON_GAP;
|
|
134
|
+
private static readonly SKELETON_MAX_BARS;
|
|
135
|
+
/**
|
|
136
|
+
* Per-block width sequence. Widths are read from this palette starting at a
|
|
137
|
+
* block-type-seeded offset so neighbouring blocks of different types get a
|
|
138
|
+
* different width rhythm (deterministic — the same block type always renders
|
|
139
|
+
* the same sequence). Chosen to look like varied text lines, none too short.
|
|
140
|
+
*/
|
|
141
|
+
private static readonly SKELETON_BAR_WIDTHS;
|
|
142
|
+
/**
|
|
143
|
+
* Match the placeholder bars to the (dynamic) cell height. Bars are a fixed
|
|
144
|
+
* height with a uniform gap and stay top-aligned under the header, so every
|
|
145
|
+
* skeleton reads identically. The count scales gently with height but is
|
|
146
|
+
* halved and capped so tall cells don't fill with noise; very short cells
|
|
147
|
+
* (< 2 bars) drop the bars entirely and show just the header. Count depends
|
|
148
|
+
* only on the cell height (not on the bars), so there is no measure→mutate
|
|
149
|
+
* feedback loop.
|
|
150
|
+
*/
|
|
151
|
+
private recomputeSkeletonLines;
|
|
152
|
+
/**
|
|
153
|
+
* Stable offset into {@link LayoutBlockWrapper.SKELETON_BAR_WIDTHS} derived
|
|
154
|
+
* from the block type, so each block type has its own width rhythm and
|
|
155
|
+
* adjacent (differently-typed) blocks don't line up.
|
|
156
|
+
*/
|
|
157
|
+
private skeletonWidthOffset;
|
|
158
|
+
/** Assign each bar its width from the block-type-seeded sequence. */
|
|
159
|
+
private applyBarWidths;
|
|
160
|
+
setBlock(block: BlockInstance): void;
|
|
161
|
+
}
|
|
162
|
+
declare global {
|
|
163
|
+
interface HTMLElementTagNameMap {
|
|
164
|
+
"juo-editor-layout-block-wrapper": LayoutBlockWrapper;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
54
167
|
//# sourceMappingURL=components.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/editor/components.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/editor/components.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AA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cAAc;IAWtB,QAAQ,CAAC,KAAK,EAAE,aAAa;CAS9B;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iCAAiC,EAAE,kBAAkB,CAAC;KACvD;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.test.d.ts","sourceRoot":"","sources":["../../src/editor/components.test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"components.test.d.ts","sourceRoot":"","sources":["../../src/editor/components.test.ts"],"names":[],"mappings":"AAGA,OAAO,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/editor/handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/editor/handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAKL,KAAK,UAAU,EAEhB,MAAM,aAAa,CAAC;AAGrB,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,UAAU,CAAC;IACvB,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;CACrD;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,oBAAoB;6BAsE/B,aAAa;EAgU9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handler.test.d.ts","sourceRoot":"","sources":["../../src/editor/handler.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { GridRect, LayoutCommand } from '../layout';
|
|
2
|
+
import { ThemeSurface } from '../theme-state';
|
|
3
|
+
/**
|
|
4
|
+
* Payload the editor canvas adapter emits to the parent when a gesture
|
|
5
|
+
* commits. Translates to a LAYOUT_COMMAND { kind: "setRects" } message
|
|
6
|
+
* over the editor bridge.
|
|
7
|
+
*/
|
|
8
|
+
export type LayoutSetRectsEvent = {
|
|
9
|
+
surface: ThemeSurface;
|
|
10
|
+
id: string;
|
|
11
|
+
rects: Record<string, GridRect>;
|
|
12
|
+
/**
|
|
13
|
+
* Breakpoint the gesture was made against, so the parent engine writes the
|
|
14
|
+
* rects to that breakpoint's layout (e.g. `mobile`) instead of always the
|
|
15
|
+
* authored base. Optional for back-compat; the parent falls back to base.
|
|
16
|
+
*/
|
|
17
|
+
breakpoint?: string;
|
|
18
|
+
};
|
|
19
|
+
export type LayoutCommandEmitter = (event: LayoutSetRectsEvent) => void;
|
|
20
|
+
export declare function setLayoutCommandEmitter(emitter: LayoutCommandEmitter | null): void;
|
|
21
|
+
export declare function emitLayoutSetRects(event: LayoutSetRectsEvent): void;
|
|
22
|
+
/**
|
|
23
|
+
* Payload for emitting an arbitrary {@link LayoutCommand} (e.g. `fillWidth`
|
|
24
|
+
* from the block toolbar). Translates to a LAYOUT_COMMAND message carrying the
|
|
25
|
+
* command verbatim, so the parent engine resolves grid context (cols) and
|
|
26
|
+
* history. Kept as a separate dispatcher from the setRects emitter above so the
|
|
27
|
+
* gesture-commit fast path stays untouched.
|
|
28
|
+
*/
|
|
29
|
+
export type LayoutCommandEvent = {
|
|
30
|
+
surface: ThemeSurface;
|
|
31
|
+
id: string;
|
|
32
|
+
command: LayoutCommand;
|
|
33
|
+
};
|
|
34
|
+
export type LayoutCommandDispatcher = (event: LayoutCommandEvent) => void;
|
|
35
|
+
export declare function setLayoutCommandDispatcher(dispatcher: LayoutCommandDispatcher | null): void;
|
|
36
|
+
export declare function emitLayoutCommand(event: LayoutCommandEvent): void;
|
|
37
|
+
//# sourceMappingURL=layout-command-emitter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-command-emitter.d.ts","sourceRoot":"","sources":["../../src/editor/layout-command-emitter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,YAAY,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAChC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;AAcxE,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,oBAAoB,GAAG,IAAI,GACnC,IAAI,CAEN;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,CAEnE;AAED;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,YAAY,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,aAAa,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;AAI1E,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,uBAAuB,GAAG,IAAI,GACzC,IAAI,CAEN;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAEjE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-command-emitter.test.d.ts","sourceRoot":"","sources":["../../src/editor/layout-command-emitter.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Signal } from '@preact/signals-core';
|
|
2
|
+
/**
|
|
3
|
+
* Iframe/editor-side flag: is the active theme using the grid-based layout
|
|
4
|
+
* engine (`GlobalStyles.layoutEngine === "grid-v1"`)?
|
|
5
|
+
*
|
|
6
|
+
* Drives wrapper selection at block-creation time: `withWrapper`
|
|
7
|
+
* (`blocks/core/src/block.ts`) and the editor's `handleBlockWrapperRender`
|
|
8
|
+
* (`blocks/editor/lib/Editor.ce.vue`) create the minimal
|
|
9
|
+
* `juo-editor-layout-block-wrapper` when this is `true`, and the classic
|
|
10
|
+
* `juo-editor-block-wrapper` otherwise.
|
|
11
|
+
*
|
|
12
|
+
* Owned by core (`@juo/blocks`) so it is a SINGLE shared instance across the
|
|
13
|
+
* separately-loaded production bundles — the same cross-bundle mechanism used
|
|
14
|
+
* by `canvasMode` (see `./canvas-mode-signal`). It lives in its own
|
|
15
|
+
* dependency-free module so owning it in core doesn't pull editor-only code
|
|
16
|
+
* into `core.js`. It is mirrored from the theme's `GlobalStyles.layoutEngine`
|
|
17
|
+
* by an effect in `theme-state.ts`.
|
|
18
|
+
*/
|
|
19
|
+
export declare const layoutSystemEnabled: Signal<boolean>;
|
|
20
|
+
export declare function setLayoutSystemEnabled(enabled: boolean): void;
|
|
21
|
+
//# sourceMappingURL=layout-system-signal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-system-signal.d.ts","sourceRoot":"","sources":["../../src/editor/layout-system-signal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAU,MAAM,sBAAsB,CAAC;AAE3D;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,OAAO,CAA0B,CAAC;AAE3E,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAM7D"}
|
package/dist/editor/main.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/editor/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,aAAa,
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/editor/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,aAAa,EAQnB,MAAM,aAAa,CAAC;AASrB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAmD7B,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAC7C,kFAAkF;AAClF,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAEhD,wBAAgB,6BAA6B,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAM7E;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE;IAAE,aAAa,EAAE,aAAa,CAAC;IAAC,UAAU,EAAE,UAAU,CAAA;CAAE,GAC7D,OAAO,CAAC,MAAM,IAAI,CAAC,CAiFrB"}
|