@assemora/pages 0.1.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/LICENSE +202 -0
- package/README.md +40 -0
- package/dist/block.d.ts +99 -0
- package/dist/block.d.ts.map +1 -0
- package/dist/block.js +115 -0
- package/dist/block.js.map +1 -0
- package/dist/commands.d.ts +586 -0
- package/dist/commands.d.ts.map +1 -0
- package/dist/commands.js +377 -0
- package/dist/commands.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/models.d.ts +46 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +31 -0
- package/dist/models.js.map +1 -0
- package/dist/module.d.ts +18 -0
- package/dist/module.d.ts.map +1 -0
- package/dist/module.js +80 -0
- package/dist/module.js.map +1 -0
- package/dist/queries.d.ts +162 -0
- package/dist/queries.d.ts.map +1 -0
- package/dist/queries.js +195 -0
- package/dist/queries.js.map +1 -0
- package/dist/tree.d.ts +52 -0
- package/dist/tree.d.ts.map +1 -0
- package/dist/tree.js +207 -0
- package/dist/tree.js.map +1 -0
- package/package.json +42 -0
package/dist/tree.js
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Editing a block tree (SPEC.md §54, §56, §60).
|
|
3
|
+
*
|
|
4
|
+
* Every operation is a pure function from one tree to the next, which is what lets
|
|
5
|
+
* the same code serve a click in Studio, a REST call and an agent's proposal — and
|
|
6
|
+
* what lets a dry run compute a diff without touching anything (SPEC.md §73).
|
|
7
|
+
*
|
|
8
|
+
* An invalid tree is never produced: the nesting rules a block declares are checked
|
|
9
|
+
* here, before anything is stored.
|
|
10
|
+
*/
|
|
11
|
+
import { randomUUID } from 'node:crypto';
|
|
12
|
+
import { AssemoraError, ValidationError } from '@assemora/core';
|
|
13
|
+
import { blockDesign, findBlock, } from '@assemora/schema';
|
|
14
|
+
import { blockFor, validateProps } from './block.js';
|
|
15
|
+
// Annotated on the variable, not just on the arrow: that is what lets TypeScript
|
|
16
|
+
// narrow after a call to it.
|
|
17
|
+
const invalid = (message) => {
|
|
18
|
+
throw new AssemoraError('INVALID_BLOCK_TREE', message, { status: 422 });
|
|
19
|
+
};
|
|
20
|
+
/** Refuses a placement the parent's own declaration forbids (SPEC.md §56). */
|
|
21
|
+
const checkPlacement = (tree, type, placement, moving) => {
|
|
22
|
+
if (placement.parentId === undefined)
|
|
23
|
+
return;
|
|
24
|
+
const parent = findBlock(tree, placement.parentId);
|
|
25
|
+
if (parent === undefined)
|
|
26
|
+
invalid(`There is no block "${placement.parentId}" to nest under`);
|
|
27
|
+
const definition = blockFor(parent.type);
|
|
28
|
+
if (!definition.acceptsChildren) {
|
|
29
|
+
invalid(`The ${parent.type} block does not accept children`);
|
|
30
|
+
}
|
|
31
|
+
if (definition.allowedChildren.length > 0 && !definition.allowedChildren.includes(type)) {
|
|
32
|
+
invalid(`The ${parent.type} block does not accept a ${type} inside it`);
|
|
33
|
+
}
|
|
34
|
+
const siblings = parent.children.filter((child) => child.id !== moving).length;
|
|
35
|
+
if (definition.maxChildren !== undefined && siblings >= definition.maxChildren) {
|
|
36
|
+
invalid(`The ${parent.type} block holds at most ${definition.maxChildren} children`);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const insert = (nodes, node, index) => {
|
|
40
|
+
const at = index === undefined ? nodes.length : Math.max(0, Math.min(index, nodes.length));
|
|
41
|
+
return [...nodes.slice(0, at), node, ...nodes.slice(at)];
|
|
42
|
+
};
|
|
43
|
+
const mapNodes = (nodes, transform) => nodes.flatMap((node) => {
|
|
44
|
+
const mapped = transform(node);
|
|
45
|
+
if (mapped === undefined)
|
|
46
|
+
return [];
|
|
47
|
+
return [{ ...mapped, children: mapNodes(mapped.children, transform) }];
|
|
48
|
+
});
|
|
49
|
+
const withPlacement = (tree, node, placement) => {
|
|
50
|
+
if (placement.parentId === undefined) {
|
|
51
|
+
return { blocks: insert(tree.blocks, node, placement.index) };
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
blocks: mapNodes(tree.blocks, (candidate) => candidate.id === placement.parentId
|
|
55
|
+
? { ...candidate, children: insert(candidate.children, node, placement.index) }
|
|
56
|
+
: candidate),
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
const detach = (tree, id) => ({
|
|
60
|
+
blocks: mapNodes(tree.blocks, (node) => (node.id === id ? undefined : node)),
|
|
61
|
+
});
|
|
62
|
+
const contains = (node, id) => node.id === id || node.children.some((child) => contains(child, id));
|
|
63
|
+
export const addBlock = (tree, request) => {
|
|
64
|
+
const definition = blockFor(request.type);
|
|
65
|
+
// A block is added before it is written. Publishing is what insists (SPEC.md §60).
|
|
66
|
+
const props = validateProps(definition, request.props ?? {}, 'editing');
|
|
67
|
+
if (!props.ok)
|
|
68
|
+
throw new ValidationError(props.issues);
|
|
69
|
+
checkPlacement(tree, request.type, request);
|
|
70
|
+
const node = {
|
|
71
|
+
id: randomUUID(),
|
|
72
|
+
type: request.type,
|
|
73
|
+
version: 1,
|
|
74
|
+
props: props.value,
|
|
75
|
+
children: [],
|
|
76
|
+
};
|
|
77
|
+
return { tree: withPlacement(tree, node, request), id: node.id };
|
|
78
|
+
};
|
|
79
|
+
export const updateBlockProps = (tree, id, props) => {
|
|
80
|
+
const existing = findBlock(tree, id) ?? invalid(`There is no block "${id}"`);
|
|
81
|
+
const definition = blockFor(existing.type);
|
|
82
|
+
const merged = validateProps(definition, { ...existing.props, ...props }, 'editing');
|
|
83
|
+
if (!merged.ok)
|
|
84
|
+
throw new ValidationError(merged.issues);
|
|
85
|
+
return {
|
|
86
|
+
blocks: mapNodes(tree.blocks, (node) => node.id === id ? { ...node, props: merged.value, version: node.version + 1 } : node),
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Sets the universal design controls of SPEC.md §61.
|
|
91
|
+
*
|
|
92
|
+
* They are merged, not replaced: a properties panel sends the one control that
|
|
93
|
+
* changed, not the whole set. `null` for a control clears it, because "no spacing"
|
|
94
|
+
* and "the theme decides" are different answers.
|
|
95
|
+
*/
|
|
96
|
+
export const setBlockDesign = (tree, id, design) => {
|
|
97
|
+
const existing = findBlock(tree, id) ?? invalid(`There is no block "${id}"`);
|
|
98
|
+
const merged = { ...existing.design };
|
|
99
|
+
for (const [key, value] of Object.entries(design)) {
|
|
100
|
+
if (value === null || value === undefined)
|
|
101
|
+
delete merged[key];
|
|
102
|
+
else
|
|
103
|
+
merged[key] = value;
|
|
104
|
+
}
|
|
105
|
+
const checked = blockDesign().parse(merged);
|
|
106
|
+
if (!checked.ok)
|
|
107
|
+
throw new ValidationError(checked.issues);
|
|
108
|
+
const settings = checked.value;
|
|
109
|
+
return {
|
|
110
|
+
blocks: mapNodes(tree.blocks, (node) => node.id === id ? { ...node, design: settings, version: node.version + 1 } : node),
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
export const setBlockHidden = (tree, id, hidden) => {
|
|
114
|
+
findBlock(tree, id) ?? invalid(`There is no block "${id}"`);
|
|
115
|
+
return {
|
|
116
|
+
blocks: mapNodes(tree.blocks, (node) => (node.id === id ? { ...node, hidden } : node)),
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
export const removeBlock = (tree, id) => {
|
|
120
|
+
findBlock(tree, id) ?? invalid(`There is no block "${id}"`);
|
|
121
|
+
return detach(tree, id);
|
|
122
|
+
};
|
|
123
|
+
export const moveBlock = (tree, id, placement) => {
|
|
124
|
+
const node = findBlock(tree, id) ?? invalid(`There is no block "${id}"`);
|
|
125
|
+
if (placement.parentId !== undefined && contains(node, placement.parentId)) {
|
|
126
|
+
invalid('A block cannot be moved inside itself');
|
|
127
|
+
}
|
|
128
|
+
checkPlacement(tree, node.type, placement, id);
|
|
129
|
+
return withPlacement(detach(tree, id), node, placement);
|
|
130
|
+
};
|
|
131
|
+
/** A copy with new ids all the way down: an id is never shared (SPEC.md §54). */
|
|
132
|
+
const reidentify = (node) => ({
|
|
133
|
+
...node,
|
|
134
|
+
id: randomUUID(),
|
|
135
|
+
children: node.children.map(reidentify),
|
|
136
|
+
});
|
|
137
|
+
export const duplicateBlock = (tree, id) => {
|
|
138
|
+
const node = findBlock(tree, id) ?? invalid(`There is no block "${id}"`);
|
|
139
|
+
const copy = reidentify(node);
|
|
140
|
+
const { parentId, index } = positionOf(tree, id);
|
|
141
|
+
// A copy lands beside its original, under the same parent — which needs the index
|
|
142
|
+
// as much as the parent. Appended, it arrived at the bottom of a page the editor
|
|
143
|
+
// was halfway down, and walking it back took one `blocks.move` per slot.
|
|
144
|
+
const placement = {
|
|
145
|
+
...(parentId === null ? {} : { parentId }),
|
|
146
|
+
index: index + 1,
|
|
147
|
+
};
|
|
148
|
+
// A copy is an addition, not a move, so the parent counts one more child than it
|
|
149
|
+
// did. Nothing checked that before, and duplicating the second child of a
|
|
150
|
+
// `maxChildren: 2` block quietly produced a tree the same block could not be
|
|
151
|
+
// added to (SPEC.md §56).
|
|
152
|
+
checkPlacement(tree, node.type, placement);
|
|
153
|
+
return { tree: withPlacement(tree, copy, placement), id: copy.id };
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Every block that is not yet fit to be seen (SPEC.md §55, §60).
|
|
157
|
+
*
|
|
158
|
+
* A draft may hold an unfinished block; a published page may not. This is what
|
|
159
|
+
* publishing checks, and it names the block so an editor can go and fix it.
|
|
160
|
+
*/
|
|
161
|
+
export const unfinishedBlocks = (tree) => {
|
|
162
|
+
const issues = [];
|
|
163
|
+
const visit = (nodes) => {
|
|
164
|
+
for (const node of nodes) {
|
|
165
|
+
// A hidden block is not rendered, so it is not asked to be complete.
|
|
166
|
+
if (node.hidden !== true) {
|
|
167
|
+
const checked = validateProps(blockFor(node.type), node.props, 'complete');
|
|
168
|
+
if (!checked.ok) {
|
|
169
|
+
issues.push(...checked.issues.map((issue) => ({
|
|
170
|
+
...issue,
|
|
171
|
+
path: [node.type, ...issue.path],
|
|
172
|
+
})));
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
visit(node.children);
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
visit(tree.blocks);
|
|
179
|
+
return issues;
|
|
180
|
+
};
|
|
181
|
+
/** The id of the block that holds this one, or `null` at the top level. */
|
|
182
|
+
export const parentOf = (tree, id) => {
|
|
183
|
+
const search = (nodes, parent) => {
|
|
184
|
+
for (const node of nodes) {
|
|
185
|
+
if (node.id === id)
|
|
186
|
+
return parent;
|
|
187
|
+
const found = search(node.children, node.id);
|
|
188
|
+
if (found !== undefined)
|
|
189
|
+
return found;
|
|
190
|
+
}
|
|
191
|
+
return undefined;
|
|
192
|
+
};
|
|
193
|
+
return search(tree.blocks, null) ?? null;
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* Where a block sits: whose child it is, and where among that parent's children.
|
|
197
|
+
*
|
|
198
|
+
* The two travel together. A placement that carries the parent and forgets the index
|
|
199
|
+
* is not "beside" anything — it is the bottom of the list, which is the one place an
|
|
200
|
+
* editor never means.
|
|
201
|
+
*/
|
|
202
|
+
export const positionOf = (tree, id) => {
|
|
203
|
+
const parentId = parentOf(tree, id);
|
|
204
|
+
const siblings = parentId === null ? tree.blocks : (findBlock(tree, parentId)?.children ?? []);
|
|
205
|
+
return { parentId, index: siblings.findIndex((node) => node.id === id) };
|
|
206
|
+
};
|
|
207
|
+
//# sourceMappingURL=tree.js.map
|
package/dist/tree.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.js","sourceRoot":"","sources":["../src/tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAC/D,OAAO,EAKL,WAAW,EACX,SAAS,GAEV,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,QAAQ,EAAE,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,QAAQ,IAAI,EAAE,CAAC,CAAA;IAE9F,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,IAAe,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAA;AACrF,CAAC,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@assemora/pages",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Pages, block tree, drafts and publishing",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/assemora/assemora.git",
|
|
12
|
+
"directory": "packages/pages"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"main": "./dist/index.js",
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"!dist/.tsbuildinfo"
|
|
26
|
+
],
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@assemora/schema": "0.1.0",
|
|
29
|
+
"@assemora/core": "0.1.0",
|
|
30
|
+
"@assemora/data": "0.1.0",
|
|
31
|
+
"@assemora/resources": "0.1.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/node": "24.13.3",
|
|
35
|
+
"@assemora/database": "0.1.0"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsc -b tsconfig.build.json",
|
|
39
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
40
|
+
"clean": "rm -rf dist *.tsbuildinfo"
|
|
41
|
+
}
|
|
42
|
+
}
|