@w100n/documents 0.12.1 → 0.14.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/{SheetView-3XTEV2VT.css → SheetView-43MPR64N.css} +5 -4
- package/dist/{SheetView-3XTEV2VT.css.map → SheetView-43MPR64N.css.map} +1 -1
- package/dist/{SheetView-G3YWPH5V.js → SheetView-4TPL7DES.js} +51 -10
- package/dist/SheetView-4TPL7DES.js.map +1 -0
- package/dist/{TextEditor-SPEVB5HX.js → TextEditor-VBHWUOZR.js} +636 -225
- package/dist/TextEditor-VBHWUOZR.js.map +1 -0
- package/dist/{chunk-L765DZPO.js → chunk-2CA3HQTI.js} +3 -3
- package/dist/{chunk-L765DZPO.js.map → chunk-2CA3HQTI.js.map} +1 -1
- package/dist/{chunk-UWASFTDF.js → chunk-5MH4WDW4.js} +133 -20
- package/dist/chunk-5MH4WDW4.js.map +1 -0
- package/dist/{chunk-BKUFGMEA.js → chunk-DR3TTJWZ.js} +410 -29
- package/dist/chunk-DR3TTJWZ.js.map +1 -0
- package/dist/{chunk-5NT5ALOF.js → chunk-RCQODE2Z.js} +2 -2
- package/dist/collab.cjs +523 -46
- package/dist/collab.cjs.map +1 -1
- package/dist/collab.d.cts +2 -2
- package/dist/collab.d.ts +2 -2
- package/dist/collab.js +2 -2
- package/dist/{grid-EI5JNZAA.js → grid-Q4XBPQFY.js} +3 -3
- package/dist/grid-Q4XBPQFY.js.map +1 -0
- package/dist/index.cjs +2271 -882
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1037 -189
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +9 -4
- package/dist/index.d.ts +9 -4
- package/dist/index.js +804 -336
- package/dist/index.js.map +1 -1
- package/dist/kinds.cjs +2 -2
- package/dist/kinds.cjs.map +1 -1
- package/dist/kinds.d.cts +2 -2
- package/dist/kinds.d.ts +2 -2
- package/dist/kinds.js +1 -1
- package/dist/memory.cjs +12 -1
- package/dist/memory.cjs.map +1 -1
- package/dist/memory.d.cts +1 -1
- package/dist/memory.d.ts +1 -1
- package/dist/memory.js +13 -2
- package/dist/memory.js.map +1 -1
- package/dist/{types-B5oF25dn.d.ts → types-BTsVooZw.d.cts} +8 -1
- package/dist/{types-B5oF25dn.d.cts → types-BTsVooZw.d.ts} +8 -1
- package/dist/write-BCI8yool.d.cts +16 -0
- package/dist/write-BCI8yool.d.ts +16 -0
- package/package.json +1 -1
- package/dist/SheetView-G3YWPH5V.js.map +0 -1
- package/dist/TextEditor-SPEVB5HX.js.map +0 -1
- package/dist/chunk-BKUFGMEA.js.map +0 -1
- package/dist/chunk-UWASFTDF.js.map +0 -1
- package/dist/grid-EI5JNZAA.js.map +0 -1
- package/dist/write-DaVtTJCS.d.cts +0 -6
- package/dist/write-DaVtTJCS.d.ts +0 -6
- /package/dist/{chunk-5NT5ALOF.js.map → chunk-RCQODE2Z.js.map} +0 -0
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
unzip,
|
|
13
13
|
writeDocx,
|
|
14
14
|
zip
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-DR3TTJWZ.js";
|
|
16
16
|
import {
|
|
17
17
|
a1,
|
|
18
18
|
box,
|
|
@@ -35,7 +35,7 @@ import { prosemirrorJSONToYXmlFragment, updateYFragment, yXmlFragmentToProseMirr
|
|
|
35
35
|
import * as Y2 from "yjs";
|
|
36
36
|
|
|
37
37
|
// package.json
|
|
38
|
-
var version = "0.
|
|
38
|
+
var version = "0.14.0";
|
|
39
39
|
|
|
40
40
|
// src/editor/extensions.ts
|
|
41
41
|
import { Extension as Extension2, Mark, Node } from "@tiptap/core";
|
|
@@ -97,10 +97,10 @@ var Pager = Extension.create({
|
|
|
97
97
|
addProseMirrorPlugins: () => [new Plugin({
|
|
98
98
|
key: paging,
|
|
99
99
|
state: {
|
|
100
|
-
init: () => ({ set: DecorationSet.empty, page: a4 }),
|
|
100
|
+
init: () => ({ set: DecorationSet.empty, page: a4, marks: { header: "", footer: "" } }),
|
|
101
101
|
apply(tr, value2) {
|
|
102
102
|
const next = tr.getMeta(paging);
|
|
103
|
-
return { set: next?.set ?? value2.set.map(tr.mapping, tr.doc), page: next?.page ?? value2.page };
|
|
103
|
+
return { set: next?.set ?? value2.set.map(tr.mapping, tr.doc), page: next?.page ?? value2.page, marks: next?.marks ?? value2.marks };
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
106
|
props: { decorations: (state) => paging.getState(state).set },
|
|
@@ -110,17 +110,34 @@ var Pager = Extension.create({
|
|
|
110
110
|
const run = () => {
|
|
111
111
|
if (!view.dom.isConnected) return;
|
|
112
112
|
const gaps = measure(view);
|
|
113
|
-
const
|
|
113
|
+
const { marks } = paging.getState(view.state);
|
|
114
|
+
const next = gaps.map((g) => `${g.pos}:${g.height}`).join() + `|${marks.header}|${marks.footer}`;
|
|
114
115
|
if (next === sig) return;
|
|
115
116
|
sig = next;
|
|
116
|
-
const
|
|
117
|
+
const line = (parent, cls, text) => {
|
|
118
|
+
if (!text) return;
|
|
119
|
+
const span2 = document.createElement("span");
|
|
120
|
+
span2.className = cls;
|
|
121
|
+
span2.textContent = text;
|
|
122
|
+
parent.append(span2);
|
|
123
|
+
};
|
|
124
|
+
const first = Decoration.widget(0, () => {
|
|
125
|
+
const el = document.createElement("div");
|
|
126
|
+
el.className = "w100n-text-first";
|
|
127
|
+
el.contentEditable = "false";
|
|
128
|
+
line(el, "w100n-text-head", marks.header);
|
|
129
|
+
return el;
|
|
130
|
+
}, { key: `first:${marks.header}`, side: -1, ignoreSelection: true });
|
|
131
|
+
const set = DecorationSet.create(view.state.doc, [first, ...gaps.map((g) => Decoration.widget(g.pos, () => {
|
|
117
132
|
const el = document.createElement("div");
|
|
118
133
|
el.className = g.end ? "w100n-text-gap is-end" : "w100n-text-gap";
|
|
119
134
|
el.style.height = `${g.height}px`;
|
|
120
135
|
el.dataset.page = String(g.page);
|
|
121
136
|
el.contentEditable = "false";
|
|
137
|
+
line(el, "w100n-text-foot", marks.footer);
|
|
138
|
+
if (!g.end) line(el, "w100n-text-head", marks.header);
|
|
122
139
|
return el;
|
|
123
|
-
}, { key: `${g.pos}:${g.height}:${g.page}`, side: -1, ignoreSelection: true })));
|
|
140
|
+
}, { key: `${g.pos}:${g.height}:${g.page}:${marks.header}:${marks.footer}`, side: -1, ignoreSelection: true }))]);
|
|
124
141
|
view.dispatch(view.state.tr.setMeta(paging, { set }).setMeta("addToHistory", false));
|
|
125
142
|
};
|
|
126
143
|
const later = (ms) => {
|
|
@@ -132,7 +149,7 @@ var Pager = Extension.create({
|
|
|
132
149
|
later(0);
|
|
133
150
|
return {
|
|
134
151
|
update: (next, prev) => {
|
|
135
|
-
if (paging.getState(next.state).page !== paging.getState(prev).page) later(0);
|
|
152
|
+
if (paging.getState(next.state).page !== paging.getState(prev).page || paging.getState(next.state).marks !== paging.getState(prev).marks) later(0);
|
|
136
153
|
else if (next.state.doc !== prev.doc) later(400);
|
|
137
154
|
},
|
|
138
155
|
destroy: () => {
|
|
@@ -175,6 +192,63 @@ var changed = (trs) => {
|
|
|
175
192
|
}));
|
|
176
193
|
return ranges;
|
|
177
194
|
};
|
|
195
|
+
var Cells = Extension2.create({
|
|
196
|
+
name: "cells",
|
|
197
|
+
addGlobalAttributes: () => [
|
|
198
|
+
{ types: ["tableCell", "tableHeader"], attributes: { background: { default: null, parseHTML: (el) => el.dataset.fill ?? null, renderHTML: (attrs2) => attrs2.background ? { "data-fill": attrs2.background, style: `background-color: ${attrs2.background}` } : {} } } },
|
|
199
|
+
{ types: ["table"], attributes: { borders: { default: null, parseHTML: (el) => el.dataset.borders ?? null, renderHTML: (attrs2) => attrs2.borders ? { "data-borders": attrs2.borders } : {} } } }
|
|
200
|
+
]
|
|
201
|
+
});
|
|
202
|
+
var searching = new PluginKey2("w100n-search");
|
|
203
|
+
var lookup = (doc, query, matchCase) => {
|
|
204
|
+
const hits = [];
|
|
205
|
+
if (!query) return hits;
|
|
206
|
+
const needle = matchCase ? query : query.toLowerCase();
|
|
207
|
+
doc.descendants((node, pos) => {
|
|
208
|
+
if (!node.isTextblock) return true;
|
|
209
|
+
let text = "";
|
|
210
|
+
const at = [];
|
|
211
|
+
node.forEach((child, offset) => {
|
|
212
|
+
const part = child.isText ? child.text : "\uFFFC";
|
|
213
|
+
for (let i = 0; i < part.length; i++) at.push(pos + 1 + offset + i);
|
|
214
|
+
text += part;
|
|
215
|
+
});
|
|
216
|
+
const hay = matchCase ? text : text.toLowerCase();
|
|
217
|
+
for (let i = hay.indexOf(needle); i >= 0; i = hay.indexOf(needle, i + needle.length)) hits.push({ from: at[i], to: at[i + needle.length - 1] + 1 });
|
|
218
|
+
return false;
|
|
219
|
+
});
|
|
220
|
+
return hits;
|
|
221
|
+
};
|
|
222
|
+
var Search = Extension2.create({
|
|
223
|
+
name: "search",
|
|
224
|
+
addProseMirrorPlugins: () => [new Plugin2({
|
|
225
|
+
key: searching,
|
|
226
|
+
state: {
|
|
227
|
+
init: () => ({ query: "", matchCase: false, hits: [], at: 0, set: DecorationSet2.empty }),
|
|
228
|
+
apply(tr, value2) {
|
|
229
|
+
const meta = tr.getMeta(searching);
|
|
230
|
+
if (!meta && !tr.docChanged) return value2;
|
|
231
|
+
const next = { ...value2, ...meta };
|
|
232
|
+
const hits = lookup(tr.doc, next.query, next.matchCase);
|
|
233
|
+
const at = hits.length ? (next.at % hits.length + hits.length) % hits.length : 0;
|
|
234
|
+
return { ...next, hits, at, set: DecorationSet2.create(tr.doc, hits.map((h, i) => Decoration2.inline(h.from, h.to, { class: i === at ? "w100n-found is-current" : "w100n-found" }))) };
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
props: { decorations: (state) => searching.getState(state).set }
|
|
238
|
+
})]
|
|
239
|
+
});
|
|
240
|
+
var replace = (editor, text, all) => {
|
|
241
|
+
const { hits, at } = searching.getState(editor.state);
|
|
242
|
+
if (!hits.length) return 0;
|
|
243
|
+
const tr = editor.state.tr;
|
|
244
|
+
for (const hit of all ? [...hits].reverse() : [hits[at]]) tr.insertText(text, hit.from, hit.to);
|
|
245
|
+
editor.view.dispatch(tr);
|
|
246
|
+
return all ? hits.length : 1;
|
|
247
|
+
};
|
|
248
|
+
var cleanPaste = (html) => html.replace(/<!--\[if[\s\S]*?<!\[endif\]-->/g, "").replace(/<o:p>[\s\S]*?<\/o:p>/g, "").replace(/\sclass=("|')?Mso[^"'\s>]*\1?/g, "").replace(/<img\b[^>]*\ssrc=("|')file:[^"']*\1[^>]*>/gi, "").replace(/\sstyle=("|')([^"']*)\1/g, (_, q, css) => {
|
|
249
|
+
const kept = css.split(";").map((x) => x.trim()).filter((x) => x && !/^mso-|^tab-stops|^font-family:\s*["']?(Symbol|Wingdings)/i.test(x)).join("; ");
|
|
250
|
+
return kept ? ` style=${q}${kept}${q}` : "";
|
|
251
|
+
});
|
|
178
252
|
var Blocks = Extension2.create({
|
|
179
253
|
name: "blocks",
|
|
180
254
|
addGlobalAttributes: () => [{
|
|
@@ -182,6 +256,8 @@ var Blocks = Extension2.create({
|
|
|
182
256
|
attributes: {
|
|
183
257
|
align: { default: null, parseHTML: (el) => el.style.textAlign || null, renderHTML: (attrs2) => attrs2.align ? { style: `text-align: ${attrs2.align}` } : {} },
|
|
184
258
|
indent: { default: 0, parseHTML: (el) => Number(el.dataset.indent) || 0, renderHTML: (attrs2) => attrs2.indent ? { "data-indent": attrs2.indent, style: `margin-left: ${attrs2.indent * 0.5}in` } : {} },
|
|
259
|
+
line: { default: null, parseHTML: (el) => Number(el.dataset.line) || null, renderHTML: (attrs2) => attrs2.line ? { "data-line": attrs2.line, style: `line-height: ${attrs2.line * 1.15}` } : {} },
|
|
260
|
+
after: { default: null, parseHTML: (el) => el.dataset.after ? Number(el.dataset.after) : null, renderHTML: (attrs2) => attrs2.after === null || attrs2.after === void 0 ? {} : { "data-after": attrs2.after, style: `margin-bottom: ${attrs2.after}pt` } },
|
|
185
261
|
ref: { default: null, rendered: false, keepOnSplit: false }
|
|
186
262
|
}
|
|
187
263
|
}],
|
|
@@ -521,18 +597,35 @@ var Notes = Extension2.create({
|
|
|
521
597
|
props: { decorations: (state) => notes.getState(state).set }
|
|
522
598
|
})]
|
|
523
599
|
});
|
|
600
|
+
var script = (name, tag, other) => Mark.create({
|
|
601
|
+
name,
|
|
602
|
+
excludes: other,
|
|
603
|
+
parseHTML: () => [{ tag }, { style: `vertical-align=${name === "superscript" ? "super" : "sub"}` }],
|
|
604
|
+
renderHTML: () => [tag, 0],
|
|
605
|
+
addKeyboardShortcuts() {
|
|
606
|
+
return { [name === "superscript" ? "Mod-." : "Mod-,"]: () => this.editor.commands.toggleMark(name) };
|
|
607
|
+
}
|
|
608
|
+
});
|
|
524
609
|
function kit(kind, t, live) {
|
|
525
610
|
return [
|
|
526
611
|
StarterKit.configure({ trailingNode: false, link: { openOnClick: false, autolink: true, defaultProtocol: "https" }, dropcursor: { color: "#8b5cf6", width: 2 }, ...live ? { undoRedo: false } : {} }),
|
|
527
612
|
TaskList,
|
|
528
613
|
TaskItem.configure({ nested: true, a11y: { checkboxLabel: (node) => node.textContent || t.tasks } }),
|
|
529
|
-
TableKit.configure({ table: { resizable:
|
|
530
|
-
|
|
614
|
+
TableKit.configure({ table: { resizable: true, cellMinWidth: 32 } }),
|
|
615
|
+
Cells,
|
|
616
|
+
Search,
|
|
617
|
+
Image.extend({
|
|
618
|
+
addAttributes() {
|
|
619
|
+
return { ...this.parent?.(), wrap: { default: null, parseHTML: (el) => el.dataset.wrap ?? null, renderHTML: (attrs2) => attrs2.wrap ? { "data-wrap": attrs2.wrap } : {} } };
|
|
620
|
+
}
|
|
621
|
+
}).configure({ inline: true, allowBase64: true, resize: { enabled: true, directions: ["top-left", "top-right", "bottom-left", "bottom-right"], minWidth: 24, minHeight: 24, alwaysPreserveAspectRatio: true } }),
|
|
531
622
|
Highlight.configure({ multicolor: true }),
|
|
532
623
|
TextStyle,
|
|
533
624
|
Color,
|
|
534
625
|
FontSize,
|
|
535
626
|
FontFamily,
|
|
627
|
+
script("superscript", "sup", "subscript"),
|
|
628
|
+
script("subscript", "sub", "superscript"),
|
|
536
629
|
Blocks,
|
|
537
630
|
PageBreak.configure({ label: t.pageBreak }),
|
|
538
631
|
Toc.configure({ relative: kind === "markdown", label: t.toc, empty: t.tocEmpty }),
|
|
@@ -551,6 +644,7 @@ var textblocks = (editor, change) => editor.chain().focus().command(({ tr, state
|
|
|
551
644
|
return true;
|
|
552
645
|
}).run();
|
|
553
646
|
var align = (editor, value2) => textblocks(editor, () => ({ align: value2 === "left" ? null : value2 }));
|
|
647
|
+
var spacing = (editor, change) => textblocks(editor, () => change);
|
|
554
648
|
var indent = (editor, step) => {
|
|
555
649
|
const type = editor.isActive("taskItem") ? "taskItem" : editor.isActive("listItem") ? "listItem" : null;
|
|
556
650
|
if (type) return step > 0 ? editor.chain().focus().sinkListItem(type).run() : editor.chain().focus().liftListItem(type).run();
|
|
@@ -2172,7 +2266,7 @@ function equalValue(a, b) {
|
|
|
2172
2266
|
if (typeof a === "number" && typeof b === "number") return a === b || Math.abs(a - b) <= 1e-9 * Math.max(1, Math.abs(a), Math.abs(b));
|
|
2173
2267
|
return a === b;
|
|
2174
2268
|
}
|
|
2175
|
-
function
|
|
2269
|
+
function lookup2(book, s) {
|
|
2176
2270
|
if (!s) return {};
|
|
2177
2271
|
return (typeof s === "string" ? book.styles[s] : s) ?? {};
|
|
2178
2272
|
}
|
|
@@ -2330,7 +2424,7 @@ function writeXlsx(original, model) {
|
|
|
2330
2424
|
const id = typeof s === "string" ? (bk === cur ? "c" : "b") + s : "";
|
|
2331
2425
|
const known = id && seen2.get(id);
|
|
2332
2426
|
if (known) return known;
|
|
2333
|
-
const look = norm({ ...defaults, ...
|
|
2427
|
+
const look = norm({ ...defaults, ...lookup2(bk, s) });
|
|
2334
2428
|
const made2 = { look, json: JSON.stringify(look) };
|
|
2335
2429
|
if (id) seen2.set(id, made2);
|
|
2336
2430
|
return made2;
|
|
@@ -2371,8 +2465,8 @@ function writeXlsx(original, model) {
|
|
|
2371
2465
|
changed2 = true;
|
|
2372
2466
|
tag = setAttr(tag, "hidden", hidden ? "1" : null);
|
|
2373
2467
|
}
|
|
2374
|
-
const look = rd.s ? norm({ ...defaults, ...
|
|
2375
|
-
const was = od.s ? norm({ ...defaults, ...
|
|
2468
|
+
const look = rd.s ? norm({ ...defaults, ...lookup2(cur, rd.s) }) : null;
|
|
2469
|
+
const was = od.s ? norm({ ...defaults, ...lookup2(base.book, od.s) }) : null;
|
|
2376
2470
|
if (!same(look, was)) {
|
|
2377
2471
|
changed2 = true;
|
|
2378
2472
|
tag = setAttr(setAttr(tag, "s", look ? String(xfFor(look, xfOf(od.s))) : null), "customFormat", look ? "1" : null);
|
|
@@ -2663,7 +2757,7 @@ function cellXml(p, ref, xf, x, f, v) {
|
|
|
2663
2757
|
function columns(p, rec, sheet, old, cols, defaults, cur, baseBook, xfFor, xfOf) {
|
|
2664
2758
|
const now = sheet.columnData ?? {}, was = old.columnData ?? {};
|
|
2665
2759
|
const count = sheet.columnCount ?? 26;
|
|
2666
|
-
const look = (bk, s) => s ? norm({ ...defaults, ...
|
|
2760
|
+
const look = (bk, s) => s ? norm({ ...defaults, ...lookup2(bk, s) }) : null;
|
|
2667
2761
|
let differs = cols.moved;
|
|
2668
2762
|
for (let c = 0; c < count && !differs; c++) {
|
|
2669
2763
|
const c0 = cols.from(c);
|
|
@@ -3052,6 +3146,11 @@ function applyCells(doc, list, origin) {
|
|
|
3052
3146
|
|
|
3053
3147
|
// src/sheets/text.ts
|
|
3054
3148
|
var en = {
|
|
3149
|
+
asCurrency: "Format as euro",
|
|
3150
|
+
asPercent: "Format as percent",
|
|
3151
|
+
fewerDecimals: "Fewer decimal places",
|
|
3152
|
+
moreDecimals: "More decimal places",
|
|
3153
|
+
sum: "Sum",
|
|
3055
3154
|
tools: "Sheet tools",
|
|
3056
3155
|
loading: "Opening the sheet",
|
|
3057
3156
|
failed: "This sheet could not be opened",
|
|
@@ -3120,6 +3219,11 @@ var en = {
|
|
|
3120
3219
|
}
|
|
3121
3220
|
};
|
|
3122
3221
|
var pl = {
|
|
3222
|
+
asCurrency: "Formatuj jako euro",
|
|
3223
|
+
asPercent: "Formatuj jako procent",
|
|
3224
|
+
fewerDecimals: "Mniej miejsc po przecinku",
|
|
3225
|
+
moreDecimals: "Wi\u0119cej miejsc po przecinku",
|
|
3226
|
+
sum: "Suma",
|
|
3123
3227
|
tools: "Narz\u0119dzia arkusza",
|
|
3124
3228
|
loading: "Otwieranie arkusza",
|
|
3125
3229
|
failed: "Nie uda\u0142o si\u0119 otworzy\u0107 tego arkusza",
|
|
@@ -3188,6 +3292,11 @@ var pl = {
|
|
|
3188
3292
|
}
|
|
3189
3293
|
};
|
|
3190
3294
|
var uk = {
|
|
3295
|
+
asCurrency: "\u0424\u043E\u0440\u043C\u0430\u0442 \u0454\u0432\u0440\u043E",
|
|
3296
|
+
asPercent: "\u0424\u043E\u0440\u043C\u0430\u0442 \u0432\u0456\u0434\u0441\u043E\u0442\u043A\u0456\u0432",
|
|
3297
|
+
fewerDecimals: "\u041C\u0435\u043D\u0448\u0435 \u0437\u043D\u0430\u043A\u0456\u0432 \u043F\u0456\u0441\u043B\u044F \u043A\u043E\u043C\u0438",
|
|
3298
|
+
moreDecimals: "\u0411\u0456\u043B\u044C\u0448\u0435 \u0437\u043D\u0430\u043A\u0456\u0432 \u043F\u0456\u0441\u043B\u044F \u043A\u043E\u043C\u0438",
|
|
3299
|
+
sum: "\u0421\u0443\u043C\u0430",
|
|
3191
3300
|
tools: "\u0406\u043D\u0441\u0442\u0440\u0443\u043C\u0435\u043D\u0442\u0438 \u0442\u0430\u0431\u043B\u0438\u0446\u0456",
|
|
3192
3301
|
loading: "\u0412\u0456\u0434\u043A\u0440\u0438\u0432\u0430\u0454\u043C\u043E \u0442\u0430\u0431\u043B\u0438\u0446\u044E",
|
|
3193
3302
|
failed: "\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438 \u0446\u044E \u0442\u0430\u0431\u043B\u0438\u0446\u044E",
|
|
@@ -3262,7 +3371,7 @@ var ours = "w100n-collab";
|
|
|
3262
3371
|
var schemas = /* @__PURE__ */ new Map();
|
|
3263
3372
|
var schemaOf = (kind) => schemas.get(kind) ?? schemas.set(kind, getSchema(kit(kind, texts.en))).get(kind);
|
|
3264
3373
|
var parse2 = async (kind, bytes) => kind === "docx" ? (await readDocx(bytes)).doc : fromMarkdown(new TextDecoder().decode(bytes)).doc;
|
|
3265
|
-
var edits = (tr) => tr.changedParentTypes.has(tr.doc.get("default")) || tr.changedParentTypes.has(tr.doc.get("book"));
|
|
3374
|
+
var edits = (tr) => tr.changedParentTypes.has(tr.doc.get("default")) || tr.changedParentTypes.has(tr.doc.get("book")) || tr.changedParentTypes.has(tr.doc.get("setup"));
|
|
3266
3375
|
var filled = (doc) => doc.getXmlFragment("default").length > 0 || doc.getMap("book").size > 0;
|
|
3267
3376
|
function seed(doc, kind, bytes, json) {
|
|
3268
3377
|
if (filled(doc)) return false;
|
|
@@ -3310,8 +3419,8 @@ function applyText(doc, kind, changes2, origin) {
|
|
|
3310
3419
|
updateYFragment({ transact: (run) => doc.transact(run, origin) }, fragment, step.doc, { mapping: /* @__PURE__ */ new Map(), isOMark: /* @__PURE__ */ new Map() });
|
|
3311
3420
|
return changes2.length;
|
|
3312
3421
|
}
|
|
3313
|
-
async function write(kind, base, node, load2) {
|
|
3314
|
-
if (kind === "docx") return writeDocx(base, node.toJSON(), load2);
|
|
3422
|
+
async function write(kind, base, node, load2, setup) {
|
|
3423
|
+
if (kind === "docx") return writeDocx(base, node.toJSON(), load2, setup);
|
|
3315
3424
|
const parsed = fromMarkdown(new TextDecoder().decode(base));
|
|
3316
3425
|
return new TextEncoder().encode(toMarkdown(node, track(parsed, node.type.schema.nodeFromJSON(parsed.doc))).text).buffer;
|
|
3317
3426
|
}
|
|
@@ -3348,7 +3457,7 @@ async function save(doc, kind, base, put, load2, note) {
|
|
|
3348
3457
|
};
|
|
3349
3458
|
doc.on("afterTransaction", watch);
|
|
3350
3459
|
try {
|
|
3351
|
-
const bytes = await write(kind, base, node, load2);
|
|
3460
|
+
const bytes = await write(kind, base, node, load2, doc.getMap("setup").size ? doc.getMap("setup").toJSON() : void 0);
|
|
3352
3461
|
const changed2 = !same2(bytes, base);
|
|
3353
3462
|
const id = changed2 ? await put(bytes, note ?? named((texts[who[0].language] ?? texts.en).editedNote, who)) : null;
|
|
3354
3463
|
const refs = [];
|
|
@@ -3398,12 +3507,16 @@ export {
|
|
|
3398
3507
|
letter,
|
|
3399
3508
|
paging,
|
|
3400
3509
|
notes,
|
|
3510
|
+
searching,
|
|
3511
|
+
replace,
|
|
3512
|
+
cleanPaste,
|
|
3401
3513
|
entries,
|
|
3402
3514
|
changes,
|
|
3403
3515
|
decide,
|
|
3404
3516
|
suggesting,
|
|
3405
3517
|
kit,
|
|
3406
3518
|
align,
|
|
3519
|
+
spacing,
|
|
3407
3520
|
indent,
|
|
3408
3521
|
clear,
|
|
3409
3522
|
locate,
|
|
@@ -3444,4 +3557,4 @@ export {
|
|
|
3444
3557
|
applyText,
|
|
3445
3558
|
save
|
|
3446
3559
|
};
|
|
3447
|
-
//# sourceMappingURL=chunk-
|
|
3560
|
+
//# sourceMappingURL=chunk-5MH4WDW4.js.map
|