@arbidocs/blocks 0.4.120 → 0.4.121
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/agents/index.cjs +286 -286
- package/dist/agents/index.js +10 -10
- package/dist/calls/index.cjs +1 -1
- package/dist/calls/index.js +1 -1
- package/dist/{chunk-XFZ7HNPG.js → chunk-4MRQKBD2.js} +3 -3
- package/dist/{chunk-XFZ7HNPG.js.map → chunk-4MRQKBD2.js.map} +1 -1
- package/dist/{chunk-XSUOEJB3.cjs → chunk-5JVPLVDT.cjs} +3 -3
- package/dist/{chunk-XSUOEJB3.cjs.map → chunk-5JVPLVDT.cjs.map} +1 -1
- package/dist/{chunk-P5ST47VY.js → chunk-5Y7JRY7Y.js} +3 -3
- package/dist/{chunk-P5ST47VY.js.map → chunk-5Y7JRY7Y.js.map} +1 -1
- package/dist/{chunk-AY32GGKU.js → chunk-DFHDWO6U.js} +3 -3
- package/dist/{chunk-AY32GGKU.js.map → chunk-DFHDWO6U.js.map} +1 -1
- package/dist/{chunk-US5ASM4G.cjs → chunk-GIEHWHVO.cjs} +5 -5
- package/dist/{chunk-US5ASM4G.cjs.map → chunk-GIEHWHVO.cjs.map} +1 -1
- package/dist/{chunk-6Z7DLJU2.js → chunk-N5S6JG7S.js} +11 -11
- package/dist/{chunk-6Z7DLJU2.js.map → chunk-N5S6JG7S.js.map} +1 -1
- package/dist/{chunk-ZV3BKLFY.cjs → chunk-NYHGG2IA.cjs} +3 -3
- package/dist/{chunk-ZV3BKLFY.cjs.map → chunk-NYHGG2IA.cjs.map} +1 -1
- package/dist/{chunk-FXUQZFAN.cjs → chunk-SCLMCCMU.cjs} +55 -55
- package/dist/{chunk-FXUQZFAN.cjs.map → chunk-SCLMCCMU.cjs.map} +1 -1
- package/dist/collaboration/index.cjs +10 -10
- package/dist/collaboration/index.js +2 -2
- package/dist/connect/index.cjs +39 -29
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.js +20 -10
- package/dist/connect/index.js.map +1 -1
- package/dist/document-tools/index.cjs +1 -1
- package/dist/document-tools/index.js +1 -1
- package/dist/facts/index.cjs +3 -3
- package/dist/facts/index.js +3 -3
- package/dist/files/index.cjs +3 -3
- package/dist/files/index.js +3 -3
- package/dist/home/index.cjs +18 -18
- package/dist/home/index.js +4 -4
- package/dist/index.cjs +406 -406
- package/dist/index.js +16 -16
- package/dist/retrieval/index.cjs +1 -1
- package/dist/retrieval/index.js +1 -1
- package/dist/settings/index.cjs +11 -11
- package/dist/settings/index.js +3 -3
- package/dist/shell/index.cjs +11 -11
- package/dist/shell/index.js +3 -3
- package/dist/site/index.cjs +5 -5
- package/dist/site/index.js +1 -1
- package/dist/studio/index.cjs +2 -2
- package/dist/studio/index.js +2 -2
- package/dist/workflow-canvas/index.cjs +53 -53
- package/dist/workflow-canvas/index.js +10 -10
- package/dist/workspaces/index.cjs +1 -1
- package/dist/workspaces/index.js +1 -1
- package/node_modules/@arbidocs/coedit/dist/commands.cjs +222 -12
- package/node_modules/@arbidocs/coedit/dist/commands.cjs.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/commands.d.cts +82 -5
- package/node_modules/@arbidocs/coedit/dist/commands.d.ts +82 -5
- package/node_modules/@arbidocs/coedit/dist/commands.js +217 -13
- package/node_modules/@arbidocs/coedit/dist/commands.js.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/encoding.d.cts +2 -0
- package/node_modules/@arbidocs/coedit/dist/encoding.d.ts +2 -0
- package/node_modules/@arbidocs/coedit/dist/hocuspocus.cjs +27 -0
- package/node_modules/@arbidocs/coedit/dist/hocuspocus.cjs.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/hocuspocus.js +27 -0
- package/node_modules/@arbidocs/coedit/dist/hocuspocus.js.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/index.cjs +27 -0
- package/node_modules/@arbidocs/coedit/dist/index.cjs.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/index.js +27 -0
- package/node_modules/@arbidocs/coedit/dist/index.js.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/{port-ip7WByvH.d.cts → port-BbN5OZHx.d.cts} +24 -1
- package/node_modules/@arbidocs/coedit/dist/{port-ip7WByvH.d.ts → port-BbN5OZHx.d.ts} +24 -1
- package/node_modules/@arbidocs/coedit/dist/server.cjs +65 -2
- package/node_modules/@arbidocs/coedit/dist/server.cjs.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/server.d.cts +1 -1
- package/node_modules/@arbidocs/coedit/dist/server.d.ts +1 -1
- package/node_modules/@arbidocs/coedit/dist/server.js +65 -2
- package/node_modules/@arbidocs/coedit/dist/server.js.map +1 -1
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +4 -4
|
@@ -51,7 +51,30 @@ interface DocParagraph {
|
|
|
51
51
|
marks?: DocMark[];
|
|
52
52
|
/** Its footnote and endnote references. */
|
|
53
53
|
notes?: DocNote[];
|
|
54
|
+
/** Its pending tracked insertions and deletions, in document order. */
|
|
55
|
+
revisions?: DocRevision[];
|
|
54
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* A pending tracked change in a paragraph. `text` leaves deleted text out, while the engine's
|
|
59
|
+
* offsets (a {@link DocPoint}) count it: an insertion covers `length` characters of `text` from
|
|
60
|
+
* `offset`; a deletion's `text` sits at `offset`, between the characters of `text` around it.
|
|
61
|
+
*/
|
|
62
|
+
interface DocRevision {
|
|
63
|
+
kind: 'insert' | 'delete';
|
|
64
|
+
offset: number;
|
|
65
|
+
length: number;
|
|
66
|
+
author?: string;
|
|
67
|
+
/** A deletion's text. */
|
|
68
|
+
text?: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Where a position in a paragraph's `text` is in the engine's offsets, which count pending
|
|
72
|
+
* deleted text. `pastDeletions`: a position with deleted text right at it is placed after that
|
|
73
|
+
* text rather than before it.
|
|
74
|
+
*/
|
|
75
|
+
declare function engineOffset(paragraph: DocParagraph, offset: number, pastDeletions?: boolean): number;
|
|
76
|
+
/** A paragraph's length in the engine's offsets: its text and its pending deleted text. */
|
|
77
|
+
declare const engineLength: (paragraph: DocParagraph) => number;
|
|
55
78
|
/** A stretch of a paragraph's text in a watched character style. */
|
|
56
79
|
interface DocMark {
|
|
57
80
|
styleId: string;
|
|
@@ -185,4 +208,4 @@ interface ReferencesPort extends DefinitionsPort {
|
|
|
185
208
|
runsXml(paragraphId: string): string | null;
|
|
186
209
|
}
|
|
187
210
|
|
|
188
|
-
export { BROKEN_CROSS_REFERENCE_STYLE as B, CROSS_REFERENCE_STYLE as C, DEFINED_TERM_STYLE as D, FIELD_ATOM as F, type LevelInfo as L, type NumberingSource as N, type OoxmlNodeLike as O, type ReferencesPort as R, WATCHED_STYLES as W, type CrossReferenceTarget as a, type DefinitionsPort as b, type DocField as c, type DocLink as d, type DocMark as e, type DocNote as f, type DocParagraph as g, type DocPoint as h, type
|
|
211
|
+
export { BROKEN_CROSS_REFERENCE_STYLE as B, CROSS_REFERENCE_STYLE as C, DEFINED_TERM_STYLE as D, FIELD_ATOM as F, type LevelInfo as L, type NumberingSource as N, type OoxmlNodeLike as O, type ReferencesPort as R, WATCHED_STYLES as W, type CrossReferenceTarget as a, type DefinitionsPort as b, type DocField as c, type DocLink as d, type DocMark as e, type DocNote as f, type DocParagraph as g, type DocPoint as h, type DocRevision as i, type DocumentNumbering as j, type LevelOf as k, type ListItemInfo as l, documentNumbering as m, engineLength as n, engineOffset as o, filterTargets as p, listTargets as q, paragraphNumber as r, readParagraphs as s, styleNames as t };
|
|
@@ -51,7 +51,30 @@ interface DocParagraph {
|
|
|
51
51
|
marks?: DocMark[];
|
|
52
52
|
/** Its footnote and endnote references. */
|
|
53
53
|
notes?: DocNote[];
|
|
54
|
+
/** Its pending tracked insertions and deletions, in document order. */
|
|
55
|
+
revisions?: DocRevision[];
|
|
54
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* A pending tracked change in a paragraph. `text` leaves deleted text out, while the engine's
|
|
59
|
+
* offsets (a {@link DocPoint}) count it: an insertion covers `length` characters of `text` from
|
|
60
|
+
* `offset`; a deletion's `text` sits at `offset`, between the characters of `text` around it.
|
|
61
|
+
*/
|
|
62
|
+
interface DocRevision {
|
|
63
|
+
kind: 'insert' | 'delete';
|
|
64
|
+
offset: number;
|
|
65
|
+
length: number;
|
|
66
|
+
author?: string;
|
|
67
|
+
/** A deletion's text. */
|
|
68
|
+
text?: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Where a position in a paragraph's `text` is in the engine's offsets, which count pending
|
|
72
|
+
* deleted text. `pastDeletions`: a position with deleted text right at it is placed after that
|
|
73
|
+
* text rather than before it.
|
|
74
|
+
*/
|
|
75
|
+
declare function engineOffset(paragraph: DocParagraph, offset: number, pastDeletions?: boolean): number;
|
|
76
|
+
/** A paragraph's length in the engine's offsets: its text and its pending deleted text. */
|
|
77
|
+
declare const engineLength: (paragraph: DocParagraph) => number;
|
|
55
78
|
/** A stretch of a paragraph's text in a watched character style. */
|
|
56
79
|
interface DocMark {
|
|
57
80
|
styleId: string;
|
|
@@ -185,4 +208,4 @@ interface ReferencesPort extends DefinitionsPort {
|
|
|
185
208
|
runsXml(paragraphId: string): string | null;
|
|
186
209
|
}
|
|
187
210
|
|
|
188
|
-
export { BROKEN_CROSS_REFERENCE_STYLE as B, CROSS_REFERENCE_STYLE as C, DEFINED_TERM_STYLE as D, FIELD_ATOM as F, type LevelInfo as L, type NumberingSource as N, type OoxmlNodeLike as O, type ReferencesPort as R, WATCHED_STYLES as W, type CrossReferenceTarget as a, type DefinitionsPort as b, type DocField as c, type DocLink as d, type DocMark as e, type DocNote as f, type DocParagraph as g, type DocPoint as h, type
|
|
211
|
+
export { BROKEN_CROSS_REFERENCE_STYLE as B, CROSS_REFERENCE_STYLE as C, DEFINED_TERM_STYLE as D, FIELD_ATOM as F, type LevelInfo as L, type NumberingSource as N, type OoxmlNodeLike as O, type ReferencesPort as R, WATCHED_STYLES as W, type CrossReferenceTarget as a, type DefinitionsPort as b, type DocField as c, type DocLink as d, type DocMark as e, type DocNote as f, type DocParagraph as g, type DocPoint as h, type DocRevision as i, type DocumentNumbering as j, type LevelOf as k, type ListItemInfo as l, documentNumbering as m, engineLength as n, engineOffset as o, filterTargets as p, listTargets as q, paragraphNumber as r, readParagraphs as s, styleNames as t };
|
|
@@ -69,6 +69,7 @@ function readParagraph(node, topLevel, bookmarks) {
|
|
|
69
69
|
let runStyle;
|
|
70
70
|
const fields = [];
|
|
71
71
|
const notes = [];
|
|
72
|
+
const revisions = [];
|
|
72
73
|
let current = null;
|
|
73
74
|
const field = (c) => {
|
|
74
75
|
const type = attr(c, "fldCharType");
|
|
@@ -110,7 +111,31 @@ function readParagraph(node, topLevel, bookmarks) {
|
|
|
110
111
|
}
|
|
111
112
|
continue;
|
|
112
113
|
}
|
|
113
|
-
if (c.localName === "
|
|
114
|
+
if (c.localName === "del") {
|
|
115
|
+
const deleted = deletedText(c);
|
|
116
|
+
if (deleted && fieldDepth === 0)
|
|
117
|
+
revisions.push({
|
|
118
|
+
kind: "delete",
|
|
119
|
+
offset: text.length,
|
|
120
|
+
length: deleted.length,
|
|
121
|
+
author: attr(c, "author"),
|
|
122
|
+
text: deleted
|
|
123
|
+
});
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
if (c.localName === "ins") {
|
|
127
|
+
const start = text.length;
|
|
128
|
+
walk(c, link);
|
|
129
|
+
if (text.length > start && fieldDepth === 0)
|
|
130
|
+
revisions.push({
|
|
131
|
+
kind: "insert",
|
|
132
|
+
offset: start,
|
|
133
|
+
length: text.length - start,
|
|
134
|
+
author: attr(c, "author")
|
|
135
|
+
});
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
if (c.localName === "delText" || c.localName === "rPr") continue;
|
|
114
139
|
if (c.localName === "r") {
|
|
115
140
|
const rStyle = c.children?.find((x) => x.localName === "rPr")?.children?.find((x) => x.localName === "rStyle");
|
|
116
141
|
const watched = rStyle && attr(rStyle, "val");
|
|
@@ -173,9 +198,20 @@ function readParagraph(node, topLevel, bookmarks) {
|
|
|
173
198
|
links,
|
|
174
199
|
...fields.length ? { fields } : {},
|
|
175
200
|
...marks.length ? { marks } : {},
|
|
176
|
-
...notes.length ? { notes } : {}
|
|
201
|
+
...notes.length ? { notes } : {},
|
|
202
|
+
...revisions.length ? { revisions } : {}
|
|
177
203
|
};
|
|
178
204
|
}
|
|
205
|
+
function deletedText(node) {
|
|
206
|
+
let out = "";
|
|
207
|
+
for (const c of node.children ?? []) {
|
|
208
|
+
if (c.localName === "instrText") continue;
|
|
209
|
+
if (c.localName === "delText") out += (c.children ?? []).map((t) => t.value ?? "").join("");
|
|
210
|
+
else if (c.localName === "tab") out += " ";
|
|
211
|
+
else if (c.localName !== "rPr") out += deletedText(c);
|
|
212
|
+
}
|
|
213
|
+
return out;
|
|
214
|
+
}
|
|
179
215
|
function documentNumbering(source) {
|
|
180
216
|
let numbering;
|
|
181
217
|
let cascade;
|
|
@@ -1350,6 +1386,10 @@ var NodeRegistry = class {
|
|
|
1350
1386
|
get(id) {
|
|
1351
1387
|
return this.entries.get(id);
|
|
1352
1388
|
}
|
|
1389
|
+
/** Whether the id names a node, one inside a paragraph that is not open yet included. */
|
|
1390
|
+
has(id) {
|
|
1391
|
+
return (this.entries.get(id) ?? this.resolveInsideParagraph(id)) !== void 0;
|
|
1392
|
+
}
|
|
1353
1393
|
require(id) {
|
|
1354
1394
|
let entry = this.entries.get(id) ?? this.resolveInsideParagraph(id);
|
|
1355
1395
|
if (!entry) throw new RegistryError(`journal names unknown node ${id}`);
|
|
@@ -1750,8 +1790,31 @@ function moveNode(registry, id, destinationId, destinationIndex) {
|
|
|
1750
1790
|
const destination = childrenOf(asLiveElement(destinationEntry.live, destinationId));
|
|
1751
1791
|
destination.insert(destinationIndex, [registry.toLive(copy)]);
|
|
1752
1792
|
}
|
|
1793
|
+
function renameNode(registry, id, qname) {
|
|
1794
|
+
const entry = registry.require(id);
|
|
1795
|
+
if ("plain" in entry) {
|
|
1796
|
+
const el2 = entry.plain;
|
|
1797
|
+
if (el2.type !== "element") return false;
|
|
1798
|
+
el2.ns = qname.namespaceUri;
|
|
1799
|
+
el2.local = qname.localName;
|
|
1800
|
+
if (qname.prefix === void 0) delete el2.prefix;
|
|
1801
|
+
else el2.prefix = qname.prefix;
|
|
1802
|
+
registry.touch(el2);
|
|
1803
|
+
return true;
|
|
1804
|
+
}
|
|
1805
|
+
const live = entry.live;
|
|
1806
|
+
if (live instanceof Y3__namespace.Text || isRichParagraph(live)) return false;
|
|
1807
|
+
if (live.get("ns") !== qname.namespaceUri) live.set("ns", qname.namespaceUri);
|
|
1808
|
+
if (live.get("local") !== qname.localName) live.set("local", qname.localName);
|
|
1809
|
+
if (qname.prefix === void 0) {
|
|
1810
|
+
if (live.has("prefix")) live.delete("prefix");
|
|
1811
|
+
} else if (live.get("prefix") !== qname.prefix) live.set("prefix", qname.prefix);
|
|
1812
|
+
return true;
|
|
1813
|
+
}
|
|
1753
1814
|
function putNode(registry, effect) {
|
|
1754
1815
|
const d = effect.descriptor;
|
|
1816
|
+
if (d.kind !== "textValue" && registry.has(d.logicalId) && renameNode(registry, d.logicalId, d.qname))
|
|
1817
|
+
return;
|
|
1755
1818
|
if (d.kind === "textValue") {
|
|
1756
1819
|
registry.registerPlain({ type: "text", id: d.logicalId, value: "" });
|
|
1757
1820
|
return;
|