@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,169 @@
|
|
|
1
|
+
const target = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : {};
|
|
2
|
+
const isBrowser = typeof window !== "undefined";
|
|
3
|
+
const PROTOCOL_VERSION = 1;
|
|
4
|
+
function isDevtoolsEvent(x) {
|
|
5
|
+
return typeof x === "object" && x !== null && x.v === PROTOCOL_VERSION && typeof x.kind === "string" && typeof x.ts === "number";
|
|
6
|
+
}
|
|
7
|
+
const HOOK_KEY = "__JUO_BLOCKS_DEVTOOLS_HOOK__";
|
|
8
|
+
function createHook() {
|
|
9
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
10
|
+
return {
|
|
11
|
+
version: PROTOCOL_VERSION,
|
|
12
|
+
emit(kind, payload) {
|
|
13
|
+
const event = {
|
|
14
|
+
v: PROTOCOL_VERSION,
|
|
15
|
+
kind,
|
|
16
|
+
ts: Date.now(),
|
|
17
|
+
payload
|
|
18
|
+
};
|
|
19
|
+
listeners.forEach((cb) => cb(event));
|
|
20
|
+
},
|
|
21
|
+
on(cb) {
|
|
22
|
+
listeners.add(cb);
|
|
23
|
+
return () => listeners.delete(cb);
|
|
24
|
+
},
|
|
25
|
+
off(cb) {
|
|
26
|
+
listeners.delete(cb);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function installHook() {
|
|
31
|
+
return target[HOOK_KEY] ?? (target[HOOK_KEY] = createHook());
|
|
32
|
+
}
|
|
33
|
+
function getHook() {
|
|
34
|
+
return target[HOOK_KEY];
|
|
35
|
+
}
|
|
36
|
+
let readDefinedBlocks = () => [];
|
|
37
|
+
function __setDefinedBlocksReader(fn) {
|
|
38
|
+
readDefinedBlocks = fn;
|
|
39
|
+
}
|
|
40
|
+
const noop = {
|
|
41
|
+
onBlockRegistered() {
|
|
42
|
+
},
|
|
43
|
+
onBlockRendered() {
|
|
44
|
+
},
|
|
45
|
+
onBlockUnmounted() {
|
|
46
|
+
},
|
|
47
|
+
onContextProvided() {
|
|
48
|
+
},
|
|
49
|
+
onContextRequested() {
|
|
50
|
+
},
|
|
51
|
+
resolveProps: (block) => block.props ?? {},
|
|
52
|
+
bindLiveProps: (block) => block.props ?? {}
|
|
53
|
+
};
|
|
54
|
+
function getState(hook) {
|
|
55
|
+
const holder = hook;
|
|
56
|
+
return holder.__blockDevtoolsState ?? (holder.__blockDevtoolsState = {
|
|
57
|
+
instances: /* @__PURE__ */ new Map(),
|
|
58
|
+
propSetters: /* @__PURE__ */ new Map(),
|
|
59
|
+
propOverrides: /* @__PURE__ */ new Map()
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function applyOverride(state, id, props) {
|
|
63
|
+
const override = state.propOverrides.get(id);
|
|
64
|
+
return override ? { ...props, ...override } : props;
|
|
65
|
+
}
|
|
66
|
+
function getPropsSchema(type) {
|
|
67
|
+
var _a;
|
|
68
|
+
const def = readDefinedBlocks().find((d) => d.name === type);
|
|
69
|
+
const schema = def == null ? void 0 : def.schema;
|
|
70
|
+
const props = (_a = schema == null ? void 0 : schema.properties) == null ? void 0 : _a.props;
|
|
71
|
+
return props && typeof props === "object" ? props : null;
|
|
72
|
+
}
|
|
73
|
+
function createDevtoolsInstrumentation(hook) {
|
|
74
|
+
const state = getState(hook);
|
|
75
|
+
const getBlockState = (id) => {
|
|
76
|
+
const inst = state.instances.get(id);
|
|
77
|
+
if (!inst) return null;
|
|
78
|
+
return {
|
|
79
|
+
props: applyOverride(state, id, inst.props),
|
|
80
|
+
propsSchema: getPropsSchema(inst.type)
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
const setBlockProp = (id, key, value) => {
|
|
84
|
+
const inst = state.instances.get(id);
|
|
85
|
+
if (!inst) return null;
|
|
86
|
+
state.propOverrides.set(id, {
|
|
87
|
+
...state.propOverrides.get(id) ?? {},
|
|
88
|
+
[key]: value
|
|
89
|
+
});
|
|
90
|
+
const setter = state.propSetters.get(id);
|
|
91
|
+
if (setter) {
|
|
92
|
+
setter(key, value);
|
|
93
|
+
} else if (inst.el) {
|
|
94
|
+
inst.el[key] = value;
|
|
95
|
+
}
|
|
96
|
+
return { props: applyOverride(state, id, inst.props) };
|
|
97
|
+
};
|
|
98
|
+
const getBlockCatalog = () => {
|
|
99
|
+
const catalog = {};
|
|
100
|
+
for (const def of readDefinedBlocks()) {
|
|
101
|
+
catalog[def.name] = def.displayName ?? def.name;
|
|
102
|
+
}
|
|
103
|
+
return catalog;
|
|
104
|
+
};
|
|
105
|
+
if (!hook.resolvers) {
|
|
106
|
+
hook.resolvers = { getBlockState, setBlockProp, getBlockCatalog };
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
onBlockRegistered(def) {
|
|
110
|
+
hook.emit("block:registered", {
|
|
111
|
+
name: def.name,
|
|
112
|
+
group: def.group,
|
|
113
|
+
displayName: def.displayName ?? def.name
|
|
114
|
+
});
|
|
115
|
+
},
|
|
116
|
+
onBlockRendered(block, el) {
|
|
117
|
+
state.instances.set(block.id, {
|
|
118
|
+
type: block.type,
|
|
119
|
+
props: block.props ?? {},
|
|
120
|
+
el
|
|
121
|
+
});
|
|
122
|
+
hook.emit("block:mounted", {
|
|
123
|
+
id: block.id,
|
|
124
|
+
type: block.type,
|
|
125
|
+
slot: null,
|
|
126
|
+
parentId: null,
|
|
127
|
+
propKeys: Object.keys(block.props ?? {})
|
|
128
|
+
});
|
|
129
|
+
},
|
|
130
|
+
onBlockUnmounted(id) {
|
|
131
|
+
state.instances.delete(id);
|
|
132
|
+
state.propSetters.delete(id);
|
|
133
|
+
state.propOverrides.delete(id);
|
|
134
|
+
hook.emit("block:unmounted", { id });
|
|
135
|
+
},
|
|
136
|
+
onContextProvided(context) {
|
|
137
|
+
hook.emit("context:provide", { context: String(context) });
|
|
138
|
+
},
|
|
139
|
+
onContextRequested(context) {
|
|
140
|
+
hook.emit("context:request", { context: String(context) });
|
|
141
|
+
},
|
|
142
|
+
resolveProps(block) {
|
|
143
|
+
return applyOverride(state, block.id, block.props ?? {});
|
|
144
|
+
},
|
|
145
|
+
bindLiveProps(block, rerender, getBaseProps = () => block.props ?? {}) {
|
|
146
|
+
state.propSetters.set(block.id, () => {
|
|
147
|
+
rerender(applyOverride(state, block.id, getBaseProps()));
|
|
148
|
+
});
|
|
149
|
+
return applyOverride(state, block.id, block.props ?? {});
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
function getInstrumentation() {
|
|
154
|
+
const hook = getHook();
|
|
155
|
+
if (!hook) return noop;
|
|
156
|
+
const holder = hook;
|
|
157
|
+
return holder.__instrumentation ?? (holder.__instrumentation = createDevtoolsInstrumentation(hook));
|
|
158
|
+
}
|
|
159
|
+
export {
|
|
160
|
+
PROTOCOL_VERSION as P,
|
|
161
|
+
__setDefinedBlocksReader as _,
|
|
162
|
+
getHook as a,
|
|
163
|
+
isBrowser as b,
|
|
164
|
+
createHook as c,
|
|
165
|
+
isDevtoolsEvent as d,
|
|
166
|
+
getInstrumentation as g,
|
|
167
|
+
installHook as i,
|
|
168
|
+
target as t
|
|
169
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { LayoutDocument } from './types';
|
|
2
|
+
/** Attribute that scopes a runtime grid container's generated stylesheet. */
|
|
3
|
+
export declare const LAYOUT_SCOPE_ATTR = "data-juo-layout";
|
|
4
|
+
/** CSS attribute selector for a given grid scope id. */
|
|
5
|
+
export declare function layoutScopeSelector(scopeId: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Build the scoped CSS Grid stylesheet for a layout, reconciled against the
|
|
8
|
+
* block ids actually being rendered (prune orphans / autofill unplaced).
|
|
9
|
+
* Pure: no DOM access.
|
|
10
|
+
*/
|
|
11
|
+
export declare function buildLayoutCss(layout: LayoutDocument, blockIds: string[], scopeId: string): string;
|
|
12
|
+
export type GridLayoutRuntime = {
|
|
13
|
+
css: string;
|
|
14
|
+
/**
|
|
15
|
+
* Leader block ids (leftmost block of each divider row) — draw the full-width
|
|
16
|
+
* bare-style divider line above their row.
|
|
17
|
+
*/
|
|
18
|
+
dividerBlockIds: Set<string>;
|
|
19
|
+
/**
|
|
20
|
+
* Every block on a divider row — get the extra divider-row spacing so the gap
|
|
21
|
+
* grows (gap | divider | gap) only where a divider is drawn.
|
|
22
|
+
*/
|
|
23
|
+
dividerRowBlockIds: Set<string>;
|
|
24
|
+
/**
|
|
25
|
+
* Blocks with the sticky `fill` flag set. Used to reflect the "fill" toggle's
|
|
26
|
+
* active/pressed state onto the block wrapper chrome (only the block the
|
|
27
|
+
* merchant filled — never its neighbours).
|
|
28
|
+
*/
|
|
29
|
+
fullWidthBlockIds: Set<string>;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Reconcile layout, emit scoped CSS, and classify bare-style row dividers in
|
|
33
|
+
* one pass (avoids double reconciliation in ExtensionRoot).
|
|
34
|
+
*
|
|
35
|
+
* Empty-block collapse is handled entirely in CSS (see `collapseRule` in
|
|
36
|
+
* project-css): an empty block sets `display:none` and, because row spacing is a
|
|
37
|
+
* per-item bottom margin rather than row-gap, its row closes up with no ghost
|
|
38
|
+
* gap — no runtime re-projection needed.
|
|
39
|
+
*/
|
|
40
|
+
export declare function buildGridLayout(layout: LayoutDocument, blockIds: string[], scopeId: string): GridLayoutRuntime;
|
|
41
|
+
//# sourceMappingURL=css-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css-runtime.d.ts","sourceRoot":"","sources":["../../src/layout/css-runtime.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,6EAA6E;AAC7E,eAAO,MAAM,iBAAiB,oBAAoB,CAAC;AAEnD,wDAAwD;AACxD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,MAAM,EAAE,EAClB,OAAO,EAAE,MAAM,GACd,MAAM,CAMR;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7B;;;OAGG;IACH,kBAAkB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAChC;;;;OAIG;IACH,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAChC,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,MAAM,EAAE,EAClB,OAAO,EAAE,MAAM,GACd,iBAAiB,CAsBnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css-runtime.test.d.ts","sourceRoot":"","sources":["../../src/layout/css-runtime.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { BreakpointDef, LayoutDocument, LayoutForBreakpoint } from './types';
|
|
2
|
+
export declare function deriveLayout(base: LayoutForBreakpoint, target: BreakpointDef): LayoutForBreakpoint;
|
|
3
|
+
export declare function resolveLayout(doc: LayoutDocument, breakpointId: string): LayoutForBreakpoint;
|
|
4
|
+
//# sourceMappingURL=derive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derive.d.ts","sourceRoot":"","sources":["../../src/layout/derive.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAY,cAAc,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE5F,wBAAgB,YAAY,CAC1B,IAAI,EAAE,mBAAmB,EACzB,MAAM,EAAE,aAAa,GACpB,mBAAmB,CAWrB;AAED,wBAAgB,aAAa,CAC3B,GAAG,EAAE,cAAc,EACnB,YAAY,EAAE,MAAM,GACnB,mBAAmB,CAYrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derive.test.d.ts","sourceRoot":"","sources":["../../src/layout/derive.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { GridRect } from './types';
|
|
2
|
+
export type RowDividerClassification = {
|
|
3
|
+
/**
|
|
4
|
+
* Leftmost block (reading order) of each divider row — draws the full-width
|
|
5
|
+
* horizontal divider line above its row. A subset of `rowBlockIds`.
|
|
6
|
+
*/
|
|
7
|
+
leaderBlockIds: Set<string>;
|
|
8
|
+
/**
|
|
9
|
+
* Every block belonging to a divider row. These receive the extra
|
|
10
|
+
* divider-row spacing (a top margin) so the boundary grows to
|
|
11
|
+
* gap | divider | gap ONLY where a divider is actually drawn — boundaries
|
|
12
|
+
* without a divider keep the regular single row-gap. Tagging all members
|
|
13
|
+
* (not just the leader) keeps side-by-side blocks on the same row aligned.
|
|
14
|
+
*/
|
|
15
|
+
rowBlockIds: Set<string>;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Classify "divider rows": grid rows below the first whose top boundary is a
|
|
19
|
+
* clean full-width break (not crossed by any spanning block). Such a boundary
|
|
20
|
+
* gets a horizontal divider line plus extra breathing room.
|
|
21
|
+
*
|
|
22
|
+
* Rules:
|
|
23
|
+
* 1. The first row is never a divider row (no divider above the content top).
|
|
24
|
+
* 2. If any block spans across a row boundary (a tall block with
|
|
25
|
+
* `r < boundary < r + h`), that boundary is NOT a clean break — drawing a
|
|
26
|
+
* full-width line there would slice through the spanning block, and the
|
|
27
|
+
* rows beside it should read as a single band. Such rows are skipped, so
|
|
28
|
+
* they keep the regular gap with no divider (e.g. a tall "Upcoming items"
|
|
29
|
+
* next to a stacked "Upcoming renewal" / "Subscription notifications").
|
|
30
|
+
* 3. Only the leftmost block of a divider row leads the line (drawn once,
|
|
31
|
+
* full canvas width); every block on that row gets the spacing margin.
|
|
32
|
+
*/
|
|
33
|
+
export declare function classifyRowDividers(items: Record<string, GridRect>, blockIds: readonly string[]): RowDividerClassification;
|
|
34
|
+
//# sourceMappingURL=dividers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dividers.d.ts","sourceRoot":"","sources":["../../src/layout/dividers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,MAAM,wBAAwB,GAAG;IACrC;;;OAGG;IACH,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B;;;;;;OAMG;IACH,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC1B,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EAC/B,QAAQ,EAAE,SAAS,MAAM,EAAE,GAC1B,wBAAwB,CA8B1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dividers.test.d.ts","sourceRoot":"","sources":["../../src/layout/dividers.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/layout/engine.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,KAAK,YAAY,EAElB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,YAAY,EAAE,YAiG1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine.test.d.ts","sourceRoot":"","sources":["../../src/layout/engine.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { GridRect } from './types';
|
|
2
|
+
export declare function clampRect(rect: GridRect, cols: number): GridRect;
|
|
3
|
+
export declare function rectsOverlap(a: GridRect, b: GridRect): boolean;
|
|
4
|
+
export declare function readingOrder(items: Record<string, GridRect>): string[];
|
|
5
|
+
/**
|
|
6
|
+
* Compact items with GridStack `float:false` gravity: pull every block up as
|
|
7
|
+
* far as it fits, preserving its column (`c`) and size (`w`/`h`), in reading
|
|
8
|
+
* order (row then column). This:
|
|
9
|
+
* - removes vertical gaps (e.g. left behind by a deleted block), and
|
|
10
|
+
* - resolves overlaps (e.g. after a block is stretched to full width over its
|
|
11
|
+
* row-mates) by pushing later blocks down instead of letting them overlay.
|
|
12
|
+
*
|
|
13
|
+
* The result is deterministic and idempotent for an already-compact layout, so
|
|
14
|
+
* it matches what layout mode (GridStack) shows and is safe to re-run.
|
|
15
|
+
*/
|
|
16
|
+
export declare function compactItems(items: Record<string, GridRect>, cols: number): Record<string, GridRect>;
|
|
17
|
+
/**
|
|
18
|
+
* Compute the free horizontal span available to `target` within its row band
|
|
19
|
+
* (the rows it vertically overlaps), given the other blocks in `items`.
|
|
20
|
+
*
|
|
21
|
+
* - `left` = the right edge (c + w) of the nearest block sitting to the left of
|
|
22
|
+
* `target` in the same band, or 0 if none.
|
|
23
|
+
* - `right` = the left edge (c) of the nearest block sitting to the right of
|
|
24
|
+
* `target` in the same band, or `cols` if none.
|
|
25
|
+
*
|
|
26
|
+
* Blocks that don't share any row with `target`, and the target itself
|
|
27
|
+
* (`target.id` compared via reference is not possible here, so pass `excludeId`),
|
|
28
|
+
* are ignored. This defines the maximum width a block can grow to WITHOUT moving
|
|
29
|
+
* any neighbour — the basis for the "fill" toggle.
|
|
30
|
+
*/
|
|
31
|
+
export declare function rowBandBounds(items: Record<string, GridRect>, target: GridRect, cols: number, excludeId?: string): {
|
|
32
|
+
left: number;
|
|
33
|
+
right: number;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Re-apply every sticky `fill` block's layout. Fill blocks that share a row band
|
|
37
|
+
* and the same free segment (the span between the non-fill blocks that bound
|
|
38
|
+
* them) split that segment EQUALLY, laid left→right in reading order. As a
|
|
39
|
+
* neighbour is stretched the segment shrinks and the fill blocks squeeze down
|
|
40
|
+
* together; once a block's equal share would fall below the minimum width
|
|
41
|
+
* (`ceil(cols / MAX_BLOCKS_PER_ROW)`) it can no longer squeeze, so the overflow
|
|
42
|
+
* blocks wrap to their own fresh full-width rows below the band.
|
|
43
|
+
*
|
|
44
|
+
* When nothing overflows, non-fill blocks are never moved and no compaction runs
|
|
45
|
+
* — fill only ever consumes empty columns in place, so it can't create overlaps.
|
|
46
|
+
* When a block wraps, the layout is compacted so the vacated/added rows close up.
|
|
47
|
+
*
|
|
48
|
+
* Run after any mutation (drag, delete, resize, reflow) so filled blocks reclaim
|
|
49
|
+
* the space a neighbour vacates and re-equalise as row-mates come and go.
|
|
50
|
+
*/
|
|
51
|
+
export declare function applyFillExpansion(items: Record<string, GridRect>, cols: number): Record<string, GridRect>;
|
|
52
|
+
/** Finds the first free cell scanning rows top-to-bottom, columns left-to-right. @param cols must be >= 1. */
|
|
53
|
+
export declare function findFreeRect(items: Record<string, GridRect>, size: {
|
|
54
|
+
w: number;
|
|
55
|
+
h: number;
|
|
56
|
+
}, cols: number): GridRect;
|
|
57
|
+
//# sourceMappingURL=grid-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-utils.d.ts","sourceRoot":"","sources":["../../src/layout/grid-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AAY5D,wBAAgB,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAOhE;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,CAO9D;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,MAAM,EAAE,CAOtE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EAC/B,IAAI,EAAE,MAAM,GACX,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAe1B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EAC/B,MAAM,EAAE,QAAQ,EAChB,IAAI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,MAAM,GACjB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAejC;AAmCD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EAC/B,IAAI,EAAE,MAAM,GACX,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CA6E1B;AAED,8GAA8G;AAC9G,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EAC/B,IAAI,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EAC9B,IAAI,EAAE,MAAM,GACX,QAAQ,CAYV"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-utils.test.d.ts","sourceRoot":"","sources":["../../src/layout/grid-utils.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type { BreakpointId, GridRect, GridConfig, ContainerQuery, BreakpointDef, LayoutForBreakpoint, LayoutDocument, GridCtx, LayoutCommand, LayoutEngine, LayoutEngineId, } from './types';
|
|
2
|
+
export { GRID_V1_ENGINE_ID, DEFAULT_GRID, DEFAULT_BREAKPOINTS, PAGE_ROOT_SLOT, } from './types';
|
|
3
|
+
export { clampRect, rectsOverlap, readingOrder, findFreeRect, compactItems, } from './grid-utils';
|
|
4
|
+
export { gridV1Engine } from './engine';
|
|
5
|
+
export { deriveLayout, resolveLayout } from './derive';
|
|
6
|
+
export { resetBreakpoint } from './override';
|
|
7
|
+
export { projectToCss } from './project-css';
|
|
8
|
+
export { projectToGridStack, type GridStackProjection, type GridStackWidgetProjection, } from './project-gridstack';
|
|
9
|
+
export { createDefaultLayoutDocument, reconcileLayout, compactLayoutDocument, expandFillLayoutDocument, } from './reconcile';
|
|
10
|
+
export { classifyRowDividers, type RowDividerClassification, } from './dividers';
|
|
11
|
+
export { DEFAULT_NEW_BLOCK_HEIGHT, insertRectRelative, type InsertPosition, } from './insert';
|
|
12
|
+
export { LAYOUT_SCOPE_ATTR, layoutScopeSelector, buildLayoutCss, buildGridLayout, type GridLayoutRuntime, } from './css-runtime';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layout/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,OAAO,EACP,aAAa,EACb,YAAY,EACZ,cAAc,GACf,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,cAAc,GACf,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EACL,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,GAC/B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,2BAA2B,EAC3B,eAAe,EACf,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,mBAAmB,EACnB,KAAK,wBAAwB,GAC9B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,KAAK,cAAc,GACpB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,KAAK,iBAAiB,GACvB,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/layout/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { LayoutDocument } from './types';
|
|
2
|
+
export type InsertPosition = "before" | "after";
|
|
3
|
+
/**
|
|
4
|
+
* Default height (in row units) for a freshly added block. `1` row (= rowUnit,
|
|
5
|
+
* 40px by default) is too short for the layout-mode skeleton's icon + name +
|
|
6
|
+
* lines and clips the label, so new blocks start a few rows tall. The merchant
|
|
7
|
+
* can still resize down in layout mode.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DEFAULT_NEW_BLOCK_HEIGHT = 4;
|
|
10
|
+
/**
|
|
11
|
+
* Insert a rect for `blockId` adjacent to `targetId` in EVERY stored breakpoint
|
|
12
|
+
* of `doc`, so a block added via the editor's add buttons lands directly
|
|
13
|
+
* above/below the block it was added relative to — not at the end of the grid —
|
|
14
|
+
* in each viewport (desktop and an independent `layouts.mobile` alike).
|
|
15
|
+
*
|
|
16
|
+
* Within each breakpoint the new block inherits that breakpoint's target column
|
|
17
|
+
* (`c`) and width (`w`), so it appears in the same lane the user added it from
|
|
18
|
+
* (full-width when the target is full-width; the single mobile lane on a cols:1
|
|
19
|
+
* breakpoint). Every block at or below the insertion row is shifted down by the
|
|
20
|
+
* new block's height so reading order is preserved regardless of GridStack's
|
|
21
|
+
* compaction. Because each breakpoint uses its own target rect, the desktop and
|
|
22
|
+
* mobile orders stay independent.
|
|
23
|
+
*
|
|
24
|
+
* Returns a NEW document; the input is never mutated. Breakpoints whose layout
|
|
25
|
+
* doesn't contain the target (not reconciled yet, or derived-on-demand) are
|
|
26
|
+
* skipped; if no breakpoint contains it the document is returned unchanged and
|
|
27
|
+
* `reconcileLayout` falls back to its default end-of-grid placement.
|
|
28
|
+
*/
|
|
29
|
+
export declare function insertRectRelative(doc: LayoutDocument, args: {
|
|
30
|
+
blockId: string;
|
|
31
|
+
targetId: string;
|
|
32
|
+
position: InsertPosition;
|
|
33
|
+
}): LayoutDocument;
|
|
34
|
+
//# sourceMappingURL=insert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insert.d.ts","sourceRoot":"","sources":["../../src/layout/insert.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAE5D,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEhD;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE;IACJ,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,cAAc,CAAC;CAC1B,GACA,cAAc,CAgChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insert.test.d.ts","sourceRoot":"","sources":["../../src/layout/insert.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LayoutDocument } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Couple a non-base breakpoint back to desktop: drop its stored layout so it
|
|
4
|
+
* follows the base breakpoint again. All-or-nothing.
|
|
5
|
+
*
|
|
6
|
+
* No-op when the breakpoint is the base (never delete the authored layout) or
|
|
7
|
+
* when nothing is stored for it. Never mutates the input document.
|
|
8
|
+
*/
|
|
9
|
+
export declare function resetBreakpoint(doc: LayoutDocument, breakpointId: string): LayoutDocument;
|
|
10
|
+
//# sourceMappingURL=override.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"override.d.ts","sourceRoot":"","sources":["../../src/layout/override.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,cAAc,EACnB,YAAY,EAAE,MAAM,GACnB,cAAc,CAQhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"override.test.d.ts","sourceRoot":"","sources":["../../src/layout/override.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-css.d.ts","sourceRoot":"","sources":["../../src/layout/project-css.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAwB,cAAc,EAAuB,MAAM,SAAS,CAAC;AAwOzF,wBAAgB,YAAY,CAC1B,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,GAC3C,MAAM,CAqBR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-css.test.d.ts","sourceRoot":"","sources":["../../src/layout/project-css.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { LayoutDocument } from './types';
|
|
2
|
+
export { MAX_BLOCKS_PER_ROW } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Minimum height (in row units) the merchant may resize a block to in layout
|
|
5
|
+
* mode. Below this the layout-mode skeleton's icon + name label gets clipped
|
|
6
|
+
* and the block becomes unidentifiable, so we floor the resize handle here
|
|
7
|
+
* (enforced via GridStack's per-widget `minH`).
|
|
8
|
+
*/
|
|
9
|
+
export declare const MIN_BLOCK_ROWS = 2;
|
|
10
|
+
/**
|
|
11
|
+
* Minimum width (in CSS px) the merchant may resize a block to in layout mode.
|
|
12
|
+
* Sized so a block can shrink to a third of the grid (≈4 of 12 columns) at
|
|
13
|
+
* realistic canvas widths, letting three blocks sit alongside each other — the
|
|
14
|
+
* previous 320px "mobile block" floor forced blocks to ~half the grid, capping
|
|
15
|
+
* a row at two. Columns are a fraction of the grid width, so this is converted
|
|
16
|
+
* to a per-widget `minW` (column count) by the adapter, which is the only place
|
|
17
|
+
* that knows the live pixel width.
|
|
18
|
+
*/
|
|
19
|
+
export declare const MIN_BLOCK_PX = 200;
|
|
20
|
+
export type GridStackWidgetProjection = {
|
|
21
|
+
id: string;
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
w: number;
|
|
25
|
+
h: number;
|
|
26
|
+
minH: number;
|
|
27
|
+
/** True when the block already fills the free span of its row band. */
|
|
28
|
+
filled: boolean;
|
|
29
|
+
};
|
|
30
|
+
export type GridStackProjection = {
|
|
31
|
+
options: {
|
|
32
|
+
column: number;
|
|
33
|
+
cellHeight: number;
|
|
34
|
+
margin: number;
|
|
35
|
+
float: boolean;
|
|
36
|
+
sizeToContent: boolean;
|
|
37
|
+
};
|
|
38
|
+
widgets: GridStackWidgetProjection[];
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Resolve which breakpoint a container of `containerWidthPx` renders, mirroring
|
|
42
|
+
* the CSS `@container (max-width:N)` cascade in `project-css.ts`: start at the
|
|
43
|
+
* base (widest) breakpoint and let each narrower breakpoint whose `maxWidth`
|
|
44
|
+
* query matches override it (document order = widest→narrowest, so the last
|
|
45
|
+
* match — the narrowest applicable — wins). Returns the base id when the width
|
|
46
|
+
* can't be measured (0 / jsdom), so layout mode defaults to desktop.
|
|
47
|
+
*/
|
|
48
|
+
export declare function resolveActiveBreakpoint(doc: LayoutDocument, containerWidthPx: number): string;
|
|
49
|
+
export declare function projectToGridStack(doc: LayoutDocument, breakpointId: string): GridStackProjection;
|
|
50
|
+
//# sourceMappingURL=project-gridstack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-gridstack.d.ts","sourceRoot":"","sources":["../../src/layout/project-gridstack.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,MAAM,CAAC;AAEhC,MAAM,MAAM,yBAAyB,GAAG;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,OAAO,CAAC;QACf,aAAa,EAAE,OAAO,CAAC;KACxB,CAAC;IACF,OAAO,EAAE,yBAAyB,EAAE,CAAC;CACtC,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,cAAc,EACnB,gBAAgB,EAAE,MAAM,GACvB,MAAM,CAQR;AAED,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,cAAc,EACnB,YAAY,EAAE,MAAM,GACnB,mBAAmB,CAgCrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-gridstack.test.d.ts","sourceRoot":"","sources":["../../src/layout/project-gridstack.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { LayoutDocument } from './types';
|
|
2
|
+
export declare function createDefaultLayoutDocument(blockIds: string[]): LayoutDocument;
|
|
3
|
+
export declare function reconcileLayout(doc: LayoutDocument | null | undefined, blockIds: string[]): LayoutDocument;
|
|
4
|
+
/**
|
|
5
|
+
* Compact the base (authored) breakpoint of a layout document with
|
|
6
|
+
* `float:false` gravity (see `compactItems`). Used after mutations that can
|
|
7
|
+
* leave the settled CSS-grid view out of sync with the GridStack model — most
|
|
8
|
+
* notably deleting a block (which otherwise leaves a vertical gap) or stretching
|
|
9
|
+
* one to full width (which otherwise overlays its row-mates). Runs on every
|
|
10
|
+
* stored breakpoint so an independent `layouts.mobile` compacts too; absent
|
|
11
|
+
* (derived) breakpoints are untouched.
|
|
12
|
+
*/
|
|
13
|
+
export declare function compactLayoutDocument(doc: LayoutDocument | null | undefined): LayoutDocument | null | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Re-apply sticky `fill` expansion to the base (authored) breakpoint of a layout
|
|
16
|
+
* document (see `applyFillExpansion`). Mutations routed through the block tree
|
|
17
|
+
* (e.g. deleting or adding a block) reconcile + compact the layout but do NOT go
|
|
18
|
+
* through the grid engine's command pipeline, so without this a fill block never
|
|
19
|
+
* reclaims the columns a deleted row-mate vacates. Kept document-level to mirror
|
|
20
|
+
* `compactLayoutDocument` and run right after it, across every stored breakpoint.
|
|
21
|
+
*/
|
|
22
|
+
export declare function expandFillLayoutDocument(doc: LayoutDocument | null | undefined): LayoutDocument | null | undefined;
|
|
23
|
+
//# sourceMappingURL=reconcile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconcile.d.ts","sourceRoot":"","sources":["../../src/layout/reconcile.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,cAAc,EAEpB,MAAM,SAAS,CAAC;AAEjB,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,cAAc,CAa9E;AAmCD,wBAAgB,eAAe,CAC7B,GAAG,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,EACtC,QAAQ,EAAE,MAAM,EAAE,GACjB,cAAc,CA0ChB;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,GACrC,cAAc,GAAG,IAAI,GAAG,SAAS,CAYnC;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,GACrC,cAAc,GAAG,IAAI,GAAG,SAAS,CAYnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconcile.test.d.ts","sourceRoot":"","sources":["../../src/layout/reconcile.test.ts"],"names":[],"mappings":""}
|