@folijs/agent 0.0.0-stage → 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/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/README.md +156 -2
- package/dist/handles.d.ts +2 -0
- package/dist/handles.d.ts.map +1 -0
- package/dist/handles.js +72 -0
- package/dist/handles.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/operations.d.ts +20 -0
- package/dist/operations.d.ts.map +1 -0
- package/dist/operations.js +369 -0
- package/dist/operations.js.map +1 -0
- package/dist/read.d.ts +50 -0
- package/dist/read.d.ts.map +1 -0
- package/dist/read.js +223 -0
- package/dist/read.js.map +1 -0
- package/dist/result.d.ts +11 -0
- package/dist/result.d.ts.map +1 -0
- package/dist/result.js +7 -0
- package/dist/result.js.map +1 -0
- package/dist/session.d.ts +116 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +68 -0
- package/dist/session.js.map +1 -0
- package/dist/templates.d.ts +43 -0
- package/dist/templates.d.ts.map +1 -0
- package/dist/templates.js +176 -0
- package/dist/templates.js.map +1 -0
- package/package.json +38 -3
- package/src/handles.ts +73 -0
- package/src/index.ts +11 -0
- package/src/operations.ts +479 -0
- package/src/read.ts +271 -0
- package/src/result.ts +26 -0
- package/src/session.ts +203 -0
- package/src/templates.ts +243 -0
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
import { addComment, controlIsReadOnly, controlProperties, controlsIn, deleteTable, findAll, paragraphStyles, replace, setParagraphStyle, untracked, } from "@folijs/core";
|
|
2
|
+
import { wordContext } from "@folijs/core/internal";
|
|
3
|
+
import { formatBlocks, readBlocks } from "./read.js";
|
|
4
|
+
import { refuse } from "./result.js";
|
|
5
|
+
/** A paragraph's attributes that are its mark's own: a new paragraph does not take them. */
|
|
6
|
+
const MARK_ONLY = { section: null, revision: null, formatChange: null, attributes: null };
|
|
7
|
+
const WHY = {
|
|
8
|
+
locked: "it is in a locked content control",
|
|
9
|
+
control: "the content control there does not take it",
|
|
10
|
+
field: "it runs over the edge of a field's result",
|
|
11
|
+
"field-code": "it is in a field's code",
|
|
12
|
+
deleted: "it is in text already deleted",
|
|
13
|
+
stale: "the text is no longer there",
|
|
14
|
+
refused: "the change could not be recorded as a tracked change",
|
|
15
|
+
};
|
|
16
|
+
/** Text as a model writes it, as the document takes it: ↵ is a line break, no control characters. */
|
|
17
|
+
const typed = (text) => text
|
|
18
|
+
.replace(/\r\n?/g, "\n")
|
|
19
|
+
.replaceAll("↵", "\n")
|
|
20
|
+
// biome-ignore lint/suspicious/noControlCharactersInRegex: control characters are what goes
|
|
21
|
+
.replace(/[\u0000-\u0008\u000B-\u001F]/g, "");
|
|
22
|
+
const quote = (text) => JSON.stringify(text.length > 80 ? `${text.slice(0, 77)}…` : text);
|
|
23
|
+
/** @internal Why `handle` names no block now, or the block. */
|
|
24
|
+
export function resolve(context, handle) {
|
|
25
|
+
if (typeof handle !== "string")
|
|
26
|
+
return refuse("invalid", "A block is named by its handle, a string as read gives it: b7.");
|
|
27
|
+
const found = context.handles.resolve(handle);
|
|
28
|
+
if (found) {
|
|
29
|
+
if (readBlocks(context.editor.state, context.handles).some((b) => b.handle === handle))
|
|
30
|
+
return found;
|
|
31
|
+
return refuse("gone", `Block ${handle} was deleted as a tracked change: it is not read.`);
|
|
32
|
+
}
|
|
33
|
+
return context.handles.issued(handle)
|
|
34
|
+
? refuse("gone", `Block ${handle} is no longer in the document. Read again for the blocks there are.`)
|
|
35
|
+
: refuse("unknown-handle", `There is no block ${handle}. Handles come from read: [b1], [b2]…`);
|
|
36
|
+
}
|
|
37
|
+
/** @internal The blocks with these handles as they read now, in document order. */
|
|
38
|
+
export function changed(context, handles) {
|
|
39
|
+
const wanted = new Set(handles);
|
|
40
|
+
const blocks = readBlocks(context.editor.state, context.handles).filter((b) => wanted.has(b.handle));
|
|
41
|
+
return { blocks, text: formatBlocks(blocks) };
|
|
42
|
+
}
|
|
43
|
+
/** @internal The id of the paragraph style a model named (by its name or id), or the refusal. */
|
|
44
|
+
export function styleId(context, name) {
|
|
45
|
+
const styles = paragraphStyles(context.editor.state);
|
|
46
|
+
if (typeof name !== "string")
|
|
47
|
+
return refuse("invalid", "A style is named by its name, a string.");
|
|
48
|
+
const wanted = name.trim().toLowerCase();
|
|
49
|
+
const style = styles.find((s) => s.name.toLowerCase() === wanted) ??
|
|
50
|
+
styles.find((s) => s.id.toLowerCase() === wanted);
|
|
51
|
+
if (style)
|
|
52
|
+
return style.id;
|
|
53
|
+
return refuse("unknown-style", `There is no paragraph style ${quote(name)}. The styles are: ${styles.map((s) => s.name).join(", ")}.`);
|
|
54
|
+
}
|
|
55
|
+
/** The content controls `node` at `pos` is in or holds that may not be edited, by name. */
|
|
56
|
+
function lockedControls(context, pos, node) {
|
|
57
|
+
const { state } = context.editor;
|
|
58
|
+
const ids = new Set(node.attrs.controls ?? []);
|
|
59
|
+
const end = pos + node.nodeSize;
|
|
60
|
+
for (const range of controlsIn(state.doc))
|
|
61
|
+
if (range.from < end && pos < range.to)
|
|
62
|
+
ids.add(range.id);
|
|
63
|
+
const names = [];
|
|
64
|
+
for (const id of ids) {
|
|
65
|
+
const control = controlProperties(state, id);
|
|
66
|
+
if (control && controlIsReadOnly(control))
|
|
67
|
+
names.push(control.alias ?? control.tag ?? id);
|
|
68
|
+
}
|
|
69
|
+
return names;
|
|
70
|
+
}
|
|
71
|
+
/** @internal */
|
|
72
|
+
export function replaceText(context, handle, find, replacement, options = {}) {
|
|
73
|
+
const { editor } = context;
|
|
74
|
+
const target = resolve(context, handle);
|
|
75
|
+
if ("ok" in target)
|
|
76
|
+
return target;
|
|
77
|
+
if (target.node.type.name !== "paragraph")
|
|
78
|
+
return refuse("not-a-paragraph", `Block ${handle} is not a paragraph: text is replaced in paragraphs (a table's are its cells' blocks).`);
|
|
79
|
+
if (typeof find !== "string" || typeof replacement !== "string")
|
|
80
|
+
return refuse("invalid", 'find and replacement must be strings (replacement "" deletes).');
|
|
81
|
+
const query = typed(find);
|
|
82
|
+
const text = typed(replacement);
|
|
83
|
+
if (!query)
|
|
84
|
+
return refuse("invalid", "find must be the text to replace, as read shows it.");
|
|
85
|
+
const from = target.pos;
|
|
86
|
+
const to = target.pos + target.node.nodeSize;
|
|
87
|
+
const matches = findAll(editor, query, { matchCase: true }).filter((m) => m.story === null && m.from >= from && m.to <= to);
|
|
88
|
+
if (!matches.length) {
|
|
89
|
+
const now = changed(context, [handle]).blocks[0]?.text ?? "";
|
|
90
|
+
const brackets = /\[[^\]]+\]/.test(query)
|
|
91
|
+
? " What read shows in brackets ([picture], [empty: …]) is not text: leave it out of find."
|
|
92
|
+
: "";
|
|
93
|
+
return refuse("no-match", `${quote(query)} is not in block ${handle}. Capitals and spaces count.${brackets} Its text is: ${JSON.stringify(now)}`);
|
|
94
|
+
}
|
|
95
|
+
if (matches.length > 1 && !options?.all)
|
|
96
|
+
return refuse("several-matches", `${quote(query)} is in block ${handle} ${matches.length} times. Give a longer find that is there once, or all: true to replace every one.`);
|
|
97
|
+
// Nothing to record: the text is what it would become.
|
|
98
|
+
if (query === text)
|
|
99
|
+
return { ok: true, replaced: 0, refused: 0, ...changed(context, [handle]) };
|
|
100
|
+
let replaced = 0;
|
|
101
|
+
let refused = 0;
|
|
102
|
+
let why;
|
|
103
|
+
// Last first: a replacement moves what comes after it.
|
|
104
|
+
for (const match of matches.reverse()) {
|
|
105
|
+
const report = replace(editor, match, text, { matchCase: true });
|
|
106
|
+
replaced += report.replaced;
|
|
107
|
+
refused += report.refused.length;
|
|
108
|
+
why ??= report.refused[0]?.reason;
|
|
109
|
+
}
|
|
110
|
+
const reason = why ? WHY[why] : "the document refused the change";
|
|
111
|
+
if (!replaced)
|
|
112
|
+
return refuse(why === "locked" || why === "control" ? "read-only" : "refused", `${quote(query)} in block ${handle} was not replaced: ${reason}.`);
|
|
113
|
+
const result = changed(context, [handle]);
|
|
114
|
+
if (refused)
|
|
115
|
+
result.text += `\n${refused} of ${matches.length} not replaced: ${reason}.`;
|
|
116
|
+
return { ok: true, replaced, refused, ...result };
|
|
117
|
+
}
|
|
118
|
+
/** A new paragraph's content: its text, line breaks and tabs. */
|
|
119
|
+
function inline(editor, text) {
|
|
120
|
+
const { schema } = editor.state;
|
|
121
|
+
const nodes = [];
|
|
122
|
+
for (const part of typed(text).split(/(\n|\t)/)) {
|
|
123
|
+
if (part === "\n")
|
|
124
|
+
nodes.push(schema.node("hardBreak"));
|
|
125
|
+
else if (part === "\t")
|
|
126
|
+
nodes.push(schema.node("tab"));
|
|
127
|
+
else if (part)
|
|
128
|
+
nodes.push(schema.text(part));
|
|
129
|
+
}
|
|
130
|
+
return nodes;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* The attributes of a paragraph put next to `node`, as Enter gives in Word (core's
|
|
134
|
+
* `splitAttrs`): the paragraph's own properties and controls, without its mark's own. After a
|
|
135
|
+
* paragraph whose style names another as the next (a heading: Normal), that style, without the
|
|
136
|
+
* direct formatting.
|
|
137
|
+
*/
|
|
138
|
+
function attrsLike(context, node, side) {
|
|
139
|
+
if (node.type.name !== "paragraph")
|
|
140
|
+
return null;
|
|
141
|
+
const attrs = node.attrs;
|
|
142
|
+
if (side === "after") {
|
|
143
|
+
const styles = wordContext(context.editor.state)?.envelope.styles ?? [];
|
|
144
|
+
const paragraph = styles.filter((s) => s.type === "paragraph");
|
|
145
|
+
const id = attrs.style ?? paragraph.filter((s) => s.isDefault).at(-1)?.id ?? null;
|
|
146
|
+
const next = paragraph.find((s) => s.id === id)?.next;
|
|
147
|
+
if (next !== undefined && next !== id)
|
|
148
|
+
return { controls: attrs.controls ?? null, style: next };
|
|
149
|
+
}
|
|
150
|
+
return { ...attrs, ...MARK_ONLY };
|
|
151
|
+
}
|
|
152
|
+
/** @internal Inserts paragraphs before or after the block `handle`. */
|
|
153
|
+
export function insert(context, handle, paragraphs, side) {
|
|
154
|
+
const { editor, handles } = context;
|
|
155
|
+
const target = resolve(context, handle);
|
|
156
|
+
if ("ok" in target)
|
|
157
|
+
return target;
|
|
158
|
+
// One paragraph given bare is one paragraph.
|
|
159
|
+
const list = Array.isArray(paragraphs) ? paragraphs : [paragraphs];
|
|
160
|
+
if (!list.length)
|
|
161
|
+
return refuse("invalid", "Give at least one paragraph to insert.");
|
|
162
|
+
const like = attrsLike(context, target.node, side);
|
|
163
|
+
// A new paragraph next to one in a control is in that control: not when it is locked.
|
|
164
|
+
for (const id of like?.controls ?? []) {
|
|
165
|
+
const control = controlProperties(editor.state, id);
|
|
166
|
+
if (control && controlIsReadOnly(control))
|
|
167
|
+
return refuse("read-only", `Block ${handle} is in the locked content control ${quote(control.alias ?? control.tag ?? id)}: nothing is inserted there.`);
|
|
168
|
+
}
|
|
169
|
+
const known = new Set(wordContext(editor.state)?.envelope.styles.map((s) => s.id));
|
|
170
|
+
const { schema } = editor.state;
|
|
171
|
+
const nodes = [];
|
|
172
|
+
/** Styles Word has built in that the document has not yet: put on once the paragraph is there. */
|
|
173
|
+
const later = [];
|
|
174
|
+
for (const [index, paragraph] of list.entries()) {
|
|
175
|
+
const given = typeof paragraph === "string" ? { text: paragraph } : paragraph;
|
|
176
|
+
const { text, style } = (given ?? {});
|
|
177
|
+
if (typeof text !== "string")
|
|
178
|
+
return refuse("invalid", 'A paragraph to insert is its text, or { "text": …, "style": … } with the text a string.');
|
|
179
|
+
let attrs = like;
|
|
180
|
+
if (style !== undefined) {
|
|
181
|
+
const id = styleId(context, style);
|
|
182
|
+
if (typeof id !== "string")
|
|
183
|
+
return id;
|
|
184
|
+
// In a style of its own: none of the neighbour's numbering or indents.
|
|
185
|
+
attrs = { controls: like?.controls ?? null, ...(known.has(id) ? { style: id } : {}) };
|
|
186
|
+
if (!known.has(id))
|
|
187
|
+
later.push({ index, id });
|
|
188
|
+
}
|
|
189
|
+
nodes.push(schema.node("paragraph", attrs, inline(editor, text)));
|
|
190
|
+
}
|
|
191
|
+
const at = side === "after" ? target.pos + target.node.nodeSize : target.pos;
|
|
192
|
+
const before = editor.state.doc;
|
|
193
|
+
editor.dispatch(editor.state.tr.insert(at, nodes));
|
|
194
|
+
if (editor.state.doc === before)
|
|
195
|
+
return refuse("refused", `Nothing could be inserted ${side} block ${handle}.`);
|
|
196
|
+
const made = [];
|
|
197
|
+
let pos = at;
|
|
198
|
+
for (const [index] of nodes.entries()) {
|
|
199
|
+
const style = later.find((l) => l.index === index);
|
|
200
|
+
if (style) {
|
|
201
|
+
// shortcut: a second change and undo step; only for a built-in style the document lacks.
|
|
202
|
+
editor.select(pos + 1);
|
|
203
|
+
editor.run(setParagraphStyle(style.id));
|
|
204
|
+
}
|
|
205
|
+
const node = editor.state.doc.nodeAt(pos);
|
|
206
|
+
if (!node)
|
|
207
|
+
break;
|
|
208
|
+
made.push(handles.at(pos, node));
|
|
209
|
+
pos += node.nodeSize;
|
|
210
|
+
}
|
|
211
|
+
return { ok: true, ...changed(context, made) };
|
|
212
|
+
}
|
|
213
|
+
/** Why a paragraph must stay where it is, or null when it may go whole. */
|
|
214
|
+
function mustStay(node, previous, next) {
|
|
215
|
+
if (node.attrs.section)
|
|
216
|
+
return "it ends a section, and its section break stays with it";
|
|
217
|
+
if (!next)
|
|
218
|
+
return "a paragraph must end the document, and a table's cell";
|
|
219
|
+
if (next.type.name !== "paragraph")
|
|
220
|
+
return previous?.type.name === "table" && next.type.name === "table"
|
|
221
|
+
? "a paragraph must stand between two tables"
|
|
222
|
+
: "the block after it is not a paragraph it can join";
|
|
223
|
+
return null;
|
|
224
|
+
}
|
|
225
|
+
/** Whether a paragraph has anything left to delete: content not deleted already. */
|
|
226
|
+
const hasContent = (node) => {
|
|
227
|
+
let live = false;
|
|
228
|
+
node.forEach((child) => {
|
|
229
|
+
live ||= !child.marks.some((m) => m.type.name === "deletion");
|
|
230
|
+
});
|
|
231
|
+
return live;
|
|
232
|
+
};
|
|
233
|
+
/** @internal */
|
|
234
|
+
export function deleteBlock(context, handle) {
|
|
235
|
+
const { editor, author } = context;
|
|
236
|
+
const target = resolve(context, handle);
|
|
237
|
+
if ("ok" in target)
|
|
238
|
+
return target;
|
|
239
|
+
const { node, pos } = target;
|
|
240
|
+
const name = node.type.name;
|
|
241
|
+
if (name !== "table" && name !== "paragraph")
|
|
242
|
+
return refuse("read-only", `Block ${handle} is content Foli does not edit: it cannot be deleted.`);
|
|
243
|
+
const locked = lockedControls(context, pos, node);
|
|
244
|
+
if (locked.length)
|
|
245
|
+
return refuse("read-only", `Block ${handle} is in or holds the locked content control ${quote(locked[0])}: it cannot be deleted.`);
|
|
246
|
+
const before = editor.state.doc;
|
|
247
|
+
if (name === "table") {
|
|
248
|
+
// The caret in a paragraph of the table's own first cell (a cell ends with one), not in a
|
|
249
|
+
// table nested there: `deleteTable` takes the innermost table around the caret.
|
|
250
|
+
const cell = node.child(0).child(0);
|
|
251
|
+
const last = cell.child(cell.childCount - 1);
|
|
252
|
+
editor.select(pos + 2 + cell.content.size - last.nodeSize + 2);
|
|
253
|
+
editor.run(deleteTable);
|
|
254
|
+
if (editor.state.doc === before || changed(context, [handle]).blocks.length)
|
|
255
|
+
return refuse("refused", `Table ${handle} was not deleted: the document refused the change.`);
|
|
256
|
+
return { ok: true, text: `Deleted table ${handle} with its cells.` };
|
|
257
|
+
}
|
|
258
|
+
// Word's rules: a cell and the body end with a paragraph, two tables never touch, and a
|
|
259
|
+
// paragraph mark that cannot join a paragraph after it stays when its deletion is accepted.
|
|
260
|
+
// Where the paragraph must stay, only its content goes.
|
|
261
|
+
const $pos = editor.state.doc.resolve(pos);
|
|
262
|
+
const index = $pos.index();
|
|
263
|
+
const parent = $pos.parent;
|
|
264
|
+
const next = index + 1 < parent.childCount ? parent.child(index + 1) : null;
|
|
265
|
+
const previous = index > 0 ? parent.child(index - 1) : null;
|
|
266
|
+
const stays = mustStay(node, previous, next);
|
|
267
|
+
const own = node.attrs.revision?.insertion;
|
|
268
|
+
if (stays &&
|
|
269
|
+
!node.attrs.section &&
|
|
270
|
+
own?.author === author &&
|
|
271
|
+
previous?.type.name === "paragraph") {
|
|
272
|
+
// The session's own paragraph, never accepted: it goes for real, as its text would.
|
|
273
|
+
editor.dispatch(editor.state.tr.delete(pos, pos + node.nodeSize).setMeta(untracked, true));
|
|
274
|
+
if (editor.state.doc !== before)
|
|
275
|
+
return { ok: true, text: `Deleted block ${handle}.` };
|
|
276
|
+
}
|
|
277
|
+
if (stays && !hasContent(node))
|
|
278
|
+
return refuse("refused", `Block ${handle} was not deleted: it is already empty, and it stays because ${stays}.`);
|
|
279
|
+
const tr = editor.state.tr;
|
|
280
|
+
editor.dispatch(stays ? tr.delete(pos + 1, pos + node.nodeSize - 1) : tr.delete(pos, pos + node.nodeSize));
|
|
281
|
+
if (editor.state.doc === before)
|
|
282
|
+
return refuse("refused", `Block ${handle} was not deleted: the document refused the change.`);
|
|
283
|
+
const left = changed(context, [handle]);
|
|
284
|
+
if (left.blocks.length)
|
|
285
|
+
return {
|
|
286
|
+
ok: true,
|
|
287
|
+
text: `Block ${handle} was emptied but stays: ${stays ?? "its paragraph mark could not be deleted"}.\n${left.text}`,
|
|
288
|
+
};
|
|
289
|
+
return { ok: true, text: `Deleted block ${handle}.` };
|
|
290
|
+
}
|
|
291
|
+
/** @internal The paragraph `handle` names, or why an operation on a paragraph cannot go on. */
|
|
292
|
+
function paragraphAt(context, handle, what) {
|
|
293
|
+
const target = resolve(context, handle);
|
|
294
|
+
if ("ok" in target || target.node.type.name === "paragraph")
|
|
295
|
+
return target;
|
|
296
|
+
return refuse("not-a-paragraph", `Block ${handle} is not a paragraph: ${what} (a table's are its cells' blocks).`);
|
|
297
|
+
}
|
|
298
|
+
/** @internal The paragraph styles there are to name, as `read` names them. */
|
|
299
|
+
export function styles(context) {
|
|
300
|
+
return paragraphStyles(context.editor.state).map((style) => style.name);
|
|
301
|
+
}
|
|
302
|
+
/** @internal */
|
|
303
|
+
export function setStyle(context, handle, style) {
|
|
304
|
+
const { editor } = context;
|
|
305
|
+
const target = paragraphAt(context, handle, "a style is set on paragraphs");
|
|
306
|
+
if ("ok" in target)
|
|
307
|
+
return target;
|
|
308
|
+
const id = styleId(context, style);
|
|
309
|
+
if (typeof id !== "string")
|
|
310
|
+
return id;
|
|
311
|
+
const resolver = wordContext(editor.state)?.resolver;
|
|
312
|
+
const now = resolver?.paragraph(target.node.attrs).paragraph.style;
|
|
313
|
+
if (now !== id) {
|
|
314
|
+
const before = editor.state.doc;
|
|
315
|
+
editor.select(target.pos + 1);
|
|
316
|
+
editor.run(setParagraphStyle(id));
|
|
317
|
+
// The command says yes before the document's rules have their say (a locked control).
|
|
318
|
+
if (editor.state.doc === before) {
|
|
319
|
+
const locked = lockedControls(context, target.pos, target.node)[0];
|
|
320
|
+
return locked
|
|
321
|
+
? refuse("read-only", `Block ${handle} is in the locked content control ${quote(locked)}: its style cannot be changed.`)
|
|
322
|
+
: refuse("refused", `The style of block ${handle} could not be changed.`);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return { ok: true, ...changed(context, [handle]) };
|
|
326
|
+
}
|
|
327
|
+
/** @internal */
|
|
328
|
+
export function comment(context, handle, text, options = {}) {
|
|
329
|
+
const { editor } = context;
|
|
330
|
+
const target = paragraphAt(context, handle, "a comment is anchored in a paragraph");
|
|
331
|
+
if ("ok" in target)
|
|
332
|
+
return target;
|
|
333
|
+
const content = typeof text === "string" ? typed(text).trim() : "";
|
|
334
|
+
if (!content)
|
|
335
|
+
return refuse("invalid", "A comment needs its text, a string.");
|
|
336
|
+
let from = target.pos + 1;
|
|
337
|
+
let to = target.pos + target.node.nodeSize - 1;
|
|
338
|
+
const on = options?.on;
|
|
339
|
+
if (on !== undefined) {
|
|
340
|
+
const query = typeof on === "string" ? typed(on) : "";
|
|
341
|
+
if (!query)
|
|
342
|
+
return refuse("invalid", "on must be text of the block, as read shows it.");
|
|
343
|
+
const matches = findAll(editor, query, { matchCase: true }).filter((m) => m.story === null && m.from >= from && m.to <= to);
|
|
344
|
+
const match = matches[0];
|
|
345
|
+
if (!match || matches.length > 1) {
|
|
346
|
+
const now = changed(context, [handle]).blocks[0]?.text ?? "";
|
|
347
|
+
return match
|
|
348
|
+
? refuse("several-matches", `${quote(query)} is in block ${handle} ${matches.length} times. Give a longer text that is there once.`)
|
|
349
|
+
: refuse("no-match", `${quote(query)} is not in block ${handle}. Capitals and spaces count. Its text is: ${JSON.stringify(now)}`);
|
|
350
|
+
}
|
|
351
|
+
({ from, to } = match);
|
|
352
|
+
}
|
|
353
|
+
const ids = () => new Set(wordContext(editor.state)?.envelope.comments.map((c) => c.id));
|
|
354
|
+
const before = ids();
|
|
355
|
+
editor.select(from, to);
|
|
356
|
+
// Word shows a comment's initials beside it: the author's, as Word makes them.
|
|
357
|
+
const initials = context.author
|
|
358
|
+
.split(/\s+/)
|
|
359
|
+
.map((word) => word[0] ?? "")
|
|
360
|
+
.join("")
|
|
361
|
+
.slice(0, 9);
|
|
362
|
+
if (!editor.run(addComment(content, { initials })))
|
|
363
|
+
return refuse("refused", `Block ${handle} could not be commented.`);
|
|
364
|
+
const made = [...ids()].find((id) => !before.has(id));
|
|
365
|
+
if (made === undefined)
|
|
366
|
+
return refuse("refused", `Block ${handle} could not be commented.`);
|
|
367
|
+
return { ok: true, comment: made, ...changed(context, [handle]) };
|
|
368
|
+
}
|
|
369
|
+
//# sourceMappingURL=operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../src/operations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,WAAW,EAEX,OAAO,EAEP,eAAe,EAEf,OAAO,EACP,iBAAiB,EACjB,SAAS,GACV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EAAc,YAAY,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,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CAAC;SACR,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACf,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QAChD,OAAO,MAAM,CAAC,SAAS,EAAE,SAAS,MAAM,0BAA0B,CAAC,CAAC;IACtE,MAAM,IAAI,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IACtD,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC,SAAS,EAAE,SAAS,MAAM,0BAA0B,CAAC,CAAC;IAC5F,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;AACpE,CAAC"}
|
package/dist/read.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** A block as an agent reads it: the document as it would be with every change accepted. */
|
|
2
|
+
export interface Block {
|
|
3
|
+
/** Its name in the session's operations. It stays the block's across edits. */
|
|
4
|
+
handle: string;
|
|
5
|
+
/** `other`: content Foli does not model, or a custom block. It cannot be edited. */
|
|
6
|
+
kind: "paragraph" | "table" | "other";
|
|
7
|
+
/** A paragraph's style, by the name Word shows; the default style when it names none. */
|
|
8
|
+
style?: string;
|
|
9
|
+
/** A numbered or bulleted paragraph's marker, as Word shows it ("1.", "(a)", "•"). */
|
|
10
|
+
number?: string;
|
|
11
|
+
/**
|
|
12
|
+
* A paragraph's text: tabs as tabs, line breaks as "\n". What is not text stands in brackets:
|
|
13
|
+
* "[picture]", "[note]" (a note's reference), "[page break]", "[column break]", "[empty: Offer
|
|
14
|
+
* date]" (a content control showing its placeholder, by its title), "[object]". Text deleted
|
|
15
|
+
* as a tracked change, hidden text and field codes are left out. A table: "". Other: what it
|
|
16
|
+
* is.
|
|
17
|
+
*/
|
|
18
|
+
text: string;
|
|
19
|
+
/** A table's size: its rows, and the cells of its longest row. */
|
|
20
|
+
rows?: number;
|
|
21
|
+
columns?: number;
|
|
22
|
+
/** Where a block in a table is: its table's handle, row and cell in the row, from 1. */
|
|
23
|
+
cell?: {
|
|
24
|
+
table: string;
|
|
25
|
+
row: number;
|
|
26
|
+
column: number;
|
|
27
|
+
};
|
|
28
|
+
/** How many tables it is inside: 0 in the body. */
|
|
29
|
+
depth: number;
|
|
30
|
+
/** It holds tracked changes not yet accepted or rejected (anyone's). */
|
|
31
|
+
changed: boolean;
|
|
32
|
+
/** How many comments are anchored in it. */
|
|
33
|
+
comments: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Blocks as the text a model reads, a line each:
|
|
37
|
+
*
|
|
38
|
+
* [b1] Title: Mutual Non-Disclosure Agreement
|
|
39
|
+
* [b2] Heading 1, 1.: Purpose
|
|
40
|
+
* [b3] Normal, changed, 2 comments: The parties wish to…
|
|
41
|
+
* [b4] table, 3 rows, 2 columns
|
|
42
|
+
* [b5] r1 c1, Normal: Item
|
|
43
|
+
* [b9] not editable: w:sdt
|
|
44
|
+
*
|
|
45
|
+
* After the handle: where it is in a table, its style, its list number, `changed` when it holds
|
|
46
|
+
* tracked changes, its comments; after the colon, its text. A line break inside a paragraph
|
|
47
|
+
* shows as ↵, so a block is always one line.
|
|
48
|
+
*/
|
|
49
|
+
export declare function formatBlocks(blocks: readonly Block[]): string;
|
|
50
|
+
//# sourceMappingURL=read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../src/read.ts"],"names":[],"mappings":"AAIA,4FAA4F;AAC5F,MAAM,WAAW,KAAK;IACpB,+EAA+E;IAC/E,MAAM,EAAE,MAAM,CAAC;IACf,oFAAoF;IACpF,IAAI,EAAE,WAAW,GAAG,OAAO,GAAG,OAAO,CAAC;IACtC,yFAAyF;IACzF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sFAAsF;IACtF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wFAAwF;IACxF,IAAI,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACtD,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,OAAO,EAAE,OAAO,CAAC;IACjB,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,CAAC;CAClB;AA6MD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,GAAG,MAAM,CAkB7D"}
|