smartrte-core 0.2.1 → 1.0.0-beta.2
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 +16 -0
- package/README.md +23 -0
- package/dist/command.d.ts +8 -8
- package/dist/editor.d.ts +32 -0
- package/dist/editor.js +121 -0
- package/dist/foundation/annotations/index.d.ts +2 -0
- package/dist/foundation/annotations/index.js +2 -0
- package/dist/foundation/annotations/range.d.ts +54 -0
- package/dist/foundation/annotations/range.js +158 -0
- package/dist/foundation/annotations/types.d.ts +33 -0
- package/dist/foundation/annotations/types.js +1 -0
- package/dist/foundation/atom/commands.d.ts +11 -0
- package/dist/foundation/atom/commands.js +118 -0
- package/dist/foundation/atom/composition.d.ts +8 -0
- package/dist/foundation/atom/composition.js +22 -0
- package/dist/foundation/atom/declarations.d.ts +2 -0
- package/dist/foundation/atom/declarations.js +17 -0
- package/dist/foundation/atom/formats.d.ts +24 -0
- package/dist/foundation/atom/formats.js +105 -0
- package/dist/foundation/atom/index.d.ts +10 -0
- package/dist/foundation/atom/index.js +10 -0
- package/dist/foundation/atom/lifecycle.d.ts +12 -0
- package/dist/foundation/atom/lifecycle.js +41 -0
- package/dist/foundation/atom/persistence.d.ts +3 -0
- package/dist/foundation/atom/persistence.js +20 -0
- package/dist/foundation/atom/plugin.d.ts +20 -0
- package/dist/foundation/atom/plugin.js +55 -0
- package/dist/foundation/atom/schema.d.ts +3 -0
- package/dist/foundation/atom/schema.js +29 -0
- package/dist/foundation/atom/security.d.ts +10 -0
- package/dist/foundation/atom/security.js +20 -0
- package/dist/foundation/atom/selection.d.ts +3 -0
- package/dist/foundation/atom/selection.js +4 -0
- package/dist/foundation/atom/types.d.ts +47 -0
- package/dist/foundation/atom/types.js +1 -0
- package/dist/foundation/block/commands.d.ts +17 -0
- package/dist/foundation/block/commands.js +197 -0
- package/dist/foundation/block/formats.d.ts +33 -0
- package/dist/foundation/block/formats.js +57 -0
- package/dist/foundation/block/index.d.ts +5 -0
- package/dist/foundation/block/index.js +5 -0
- package/dist/foundation/block/input.d.ts +19 -0
- package/dist/foundation/block/input.js +67 -0
- package/dist/foundation/block/plugin.d.ts +26 -0
- package/dist/foundation/block/plugin.js +79 -0
- package/dist/foundation/block/schema.d.ts +49 -0
- package/dist/foundation/block/schema.js +27 -0
- package/dist/foundation/block/types.d.ts +40 -0
- package/dist/foundation/block/types.js +1 -0
- package/dist/foundation/boundaries.d.ts +11 -0
- package/dist/foundation/boundaries.js +117 -0
- package/dist/foundation/clipboard/detection.d.ts +3 -0
- package/dist/foundation/clipboard/detection.js +29 -0
- package/dist/foundation/clipboard/diagnostics.d.ts +24 -0
- package/dist/foundation/clipboard/diagnostics.js +59 -0
- package/dist/foundation/clipboard/index.d.ts +8 -0
- package/dist/foundation/clipboard/index.js +8 -0
- package/dist/foundation/clipboard/insertion.d.ts +22 -0
- package/dist/foundation/clipboard/insertion.js +210 -0
- package/dist/foundation/clipboard/normalizers.d.ts +8 -0
- package/dist/foundation/clipboard/normalizers.js +229 -0
- package/dist/foundation/clipboard/pipeline.d.ts +13 -0
- package/dist/foundation/clipboard/pipeline.js +58 -0
- package/dist/foundation/clipboard/sanitizer.d.ts +3 -0
- package/dist/foundation/clipboard/sanitizer.js +58 -0
- package/dist/foundation/clipboard/serialization.d.ts +5 -0
- package/dist/foundation/clipboard/serialization.js +33 -0
- package/dist/foundation/clipboard/transfer.d.ts +11 -0
- package/dist/foundation/clipboard/transfer.js +108 -0
- package/dist/foundation/clipboard/types.d.ts +65 -0
- package/dist/foundation/clipboard/types.js +1 -0
- package/dist/foundation/collab/index.d.ts +3 -0
- package/dist/foundation/collab/index.js +3 -0
- package/dist/foundation/collab/rebase.d.ts +28 -0
- package/dist/foundation/collab/rebase.js +82 -0
- package/dist/foundation/collab/transform.d.ts +73 -0
- package/dist/foundation/collab/transform.js +251 -0
- package/dist/foundation/collab/types.d.ts +52 -0
- package/dist/foundation/collab/types.js +1 -0
- package/dist/foundation/comments/fromSelection.d.ts +16 -0
- package/dist/foundation/comments/fromSelection.js +24 -0
- package/dist/foundation/comments/index.d.ts +3 -0
- package/dist/foundation/comments/index.js +3 -0
- package/dist/foundation/comments/rebase.d.ts +31 -0
- package/dist/foundation/comments/rebase.js +43 -0
- package/dist/foundation/comments/types.d.ts +37 -0
- package/dist/foundation/comments/types.js +1 -0
- package/dist/foundation/diff/documentDiff.d.ts +12 -0
- package/dist/foundation/diff/documentDiff.js +148 -0
- package/dist/foundation/diff/index.d.ts +3 -0
- package/dist/foundation/diff/index.js +3 -0
- package/dist/foundation/diff/textDiff.d.ts +12 -0
- package/dist/foundation/diff/textDiff.js +114 -0
- package/dist/foundation/diff/types.d.ts +74 -0
- package/dist/foundation/diff/types.js +1 -0
- package/dist/foundation/editor.d.ts +138 -0
- package/dist/foundation/editor.js +398 -0
- package/dist/foundation/formats/codec.d.ts +45 -0
- package/dist/foundation/formats/codec.js +1 -0
- package/dist/foundation/formats/docx/export.d.ts +4 -0
- package/dist/foundation/formats/docx/export.js +285 -0
- package/dist/foundation/formats/docx/import.d.ts +9 -0
- package/dist/foundation/formats/docx/import.js +37 -0
- package/dist/foundation/formats/docx/nestingGuard.d.ts +40 -0
- package/dist/foundation/formats/docx/nestingGuard.js +66 -0
- package/dist/foundation/formats/docx/portableAtoms.d.ts +4 -0
- package/dist/foundation/formats/docx/portableAtoms.js +66 -0
- package/dist/foundation/formats/docx/styledImport.d.ts +10 -0
- package/dist/foundation/formats/docx/styledImport.js +205 -0
- package/dist/foundation/formats/featureCodecs.d.ts +37 -0
- package/dist/foundation/formats/featureCodecs.js +69 -0
- package/dist/foundation/formats/fidelity.d.ts +31 -0
- package/dist/foundation/formats/fidelity.js +123 -0
- package/dist/foundation/formats/index.d.ts +7 -0
- package/dist/foundation/formats/index.js +7 -0
- package/dist/foundation/formats/pdf/format.d.ts +29 -0
- package/dist/foundation/formats/pdf/format.js +190 -0
- package/dist/foundation/history.d.ts +20 -0
- package/dist/foundation/history.js +121 -0
- package/dist/foundation/identity.d.ts +8 -0
- package/dist/foundation/identity.js +30 -0
- package/dist/foundation/index.d.ts +30 -0
- package/dist/foundation/index.js +30 -0
- package/dist/foundation/list/commands.d.ts +28 -0
- package/dist/foundation/list/commands.js +422 -0
- package/dist/foundation/list/formats.d.ts +21 -0
- package/dist/foundation/list/formats.js +813 -0
- package/dist/foundation/list/index.d.ts +8 -0
- package/dist/foundation/list/index.js +8 -0
- package/dist/foundation/list/input.d.ts +35 -0
- package/dist/foundation/list/input.js +320 -0
- package/dist/foundation/list/plugin.d.ts +21 -0
- package/dist/foundation/list/plugin.js +71 -0
- package/dist/foundation/list/presets.d.ts +16 -0
- package/dist/foundation/list/presets.js +21 -0
- package/dist/foundation/list/schema.d.ts +35 -0
- package/dist/foundation/list/schema.js +29 -0
- package/dist/foundation/list/shadow.d.ts +54 -0
- package/dist/foundation/list/shadow.js +75 -0
- package/dist/foundation/list/shadowCorpus.d.ts +10 -0
- package/dist/foundation/list/shadowCorpus.js +41 -0
- package/dist/foundation/list/types.d.ts +50 -0
- package/dist/foundation/list/types.js +1 -0
- package/dist/foundation/mapping.d.ts +11 -0
- package/dist/foundation/mapping.js +40 -0
- package/dist/foundation/marks/canonical.d.ts +9 -0
- package/dist/foundation/marks/canonical.js +72 -0
- package/dist/foundation/marks/commands.d.ts +21 -0
- package/dist/foundation/marks/commands.js +136 -0
- package/dist/foundation/marks/dom.d.ts +2 -0
- package/dist/foundation/marks/dom.js +46 -0
- package/dist/foundation/marks/editor.d.ts +8 -0
- package/dist/foundation/marks/editor.js +50 -0
- package/dist/foundation/marks/formats.d.ts +37 -0
- package/dist/foundation/marks/formats.js +49 -0
- package/dist/foundation/marks/hardBreak.d.ts +8 -0
- package/dist/foundation/marks/hardBreak.js +80 -0
- package/dist/foundation/marks/index.d.ts +11 -0
- package/dist/foundation/marks/index.js +11 -0
- package/dist/foundation/marks/normalization.d.ts +2 -0
- package/dist/foundation/marks/normalization.js +49 -0
- package/dist/foundation/marks/plugin.d.ts +14 -0
- package/dist/foundation/marks/plugin.js +63 -0
- package/dist/foundation/marks/resolveMarkRun.d.ts +8 -0
- package/dist/foundation/marks/resolveMarkRun.js +47 -0
- package/dist/foundation/marks/schema.d.ts +167 -0
- package/dist/foundation/marks/schema.js +50 -0
- package/dist/foundation/marks/stored.d.ts +2 -0
- package/dist/foundation/marks/stored.js +31 -0
- package/dist/foundation/marks/types.d.ts +40 -0
- package/dist/foundation/marks/types.js +1 -0
- package/dist/foundation/modelDom.d.ts +38 -0
- package/dist/foundation/modelDom.js +327 -0
- package/dist/foundation/normalization.d.ts +22 -0
- package/dist/foundation/normalization.js +132 -0
- package/dist/foundation/operations.d.ts +28 -0
- package/dist/foundation/operations.js +568 -0
- package/dist/foundation/plugin/builtins.d.ts +10 -0
- package/dist/foundation/plugin/builtins.js +27 -0
- package/dist/foundation/plugin/dispatch.d.ts +33 -0
- package/dist/foundation/plugin/dispatch.js +34 -0
- package/dist/foundation/plugin/index.d.ts +4 -0
- package/dist/foundation/plugin/index.js +4 -0
- package/dist/foundation/plugin/registry.d.ts +36 -0
- package/dist/foundation/plugin/registry.js +115 -0
- package/dist/foundation/plugin/types.d.ts +141 -0
- package/dist/foundation/plugin/types.js +13 -0
- package/dist/foundation/positions.d.ts +20 -0
- package/dist/foundation/positions.js +121 -0
- package/dist/foundation/schema.d.ts +57 -0
- package/dist/foundation/schema.js +371 -0
- package/dist/foundation/schemaBuilder.d.ts +41 -0
- package/dist/foundation/schemaBuilder.js +96 -0
- package/dist/foundation/scope/index.d.ts +2 -0
- package/dist/foundation/scope/index.js +2 -0
- package/dist/foundation/scope/resolveScope.d.ts +13 -0
- package/dist/foundation/scope/resolveScope.js +860 -0
- package/dist/foundation/scope/types.d.ts +122 -0
- package/dist/foundation/scope/types.js +1 -0
- package/dist/foundation/security/urlPolicy.d.ts +21 -0
- package/dist/foundation/security/urlPolicy.js +75 -0
- package/dist/foundation/structural/contentTarget.d.ts +21 -0
- package/dist/foundation/structural/contentTarget.js +51 -0
- package/dist/foundation/structural/index.d.ts +2 -0
- package/dist/foundation/structural/index.js +2 -0
- package/dist/foundation/structural/move.d.ts +7 -0
- package/dist/foundation/structural/move.js +35 -0
- package/dist/foundation/suggestions/index.d.ts +3 -0
- package/dist/foundation/suggestions/index.js +3 -0
- package/dist/foundation/suggestions/inline.d.ts +64 -0
- package/dist/foundation/suggestions/inline.js +116 -0
- package/dist/foundation/suggestions/structural.d.ts +40 -0
- package/dist/foundation/suggestions/structural.js +47 -0
- package/dist/foundation/suggestions/types.d.ts +19 -0
- package/dist/foundation/suggestions/types.js +1 -0
- package/dist/foundation/surface/index.d.ts +3 -0
- package/dist/foundation/surface/index.js +3 -0
- package/dist/foundation/surface/input.d.ts +127 -0
- package/dist/foundation/surface/input.js +1761 -0
- package/dist/foundation/surface/renderer.d.ts +84 -0
- package/dist/foundation/surface/renderer.js +974 -0
- package/dist/foundation/surface/types.d.ts +48 -0
- package/dist/foundation/surface/types.js +1 -0
- package/dist/foundation/table/commands.d.ts +31 -0
- package/dist/foundation/table/commands.js +470 -0
- package/dist/foundation/table/formats.d.ts +27 -0
- package/dist/foundation/table/formats.js +40 -0
- package/dist/foundation/table/grid.d.ts +8 -0
- package/dist/foundation/table/grid.js +178 -0
- package/dist/foundation/table/index.d.ts +6 -0
- package/dist/foundation/table/index.js +6 -0
- package/dist/foundation/table/plugin.d.ts +23 -0
- package/dist/foundation/table/plugin.js +119 -0
- package/dist/foundation/table/schema.d.ts +2 -0
- package/dist/foundation/table/schema.js +38 -0
- package/dist/foundation/table/selection.d.ts +7 -0
- package/dist/foundation/table/selection.js +35 -0
- package/dist/foundation/table/types.d.ts +109 -0
- package/dist/foundation/table/types.js +1 -0
- package/dist/foundation/transactions.d.ts +41 -0
- package/dist/foundation/transactions.js +90 -0
- package/dist/foundation/types.d.ts +261 -0
- package/dist/foundation/types.js +1 -0
- package/dist/foundation/versioning/diffVersions.d.ts +5 -0
- package/dist/foundation/versioning/diffVersions.js +3 -0
- package/dist/foundation/versioning/index.d.ts +2 -0
- package/dist/foundation/versioning/index.js +2 -0
- package/dist/foundation/versioning/types.d.ts +17 -0
- package/dist/foundation/versioning/types.js +1 -0
- package/dist/history.d.ts +20 -0
- package/dist/history.js +165 -0
- package/dist/html/compatibility.js +7 -1
- package/dist/index.d.ts +1 -14
- package/dist/index.js +9 -14
- package/dist/legacy/index.d.ts +45 -0
- package/dist/legacy/index.js +45 -0
- package/dist/legacyCommands/alignment.d.ts +20 -0
- package/dist/{commands → legacyCommands}/alignment.js +17 -0
- package/dist/legacyCommands/blocks.d.ts +14 -0
- package/dist/legacyCommands/blocks.js +105 -0
- package/dist/legacyCommands/checklist.d.ts +11 -0
- package/dist/legacyCommands/checklist.js +45 -0
- package/dist/legacyCommands/code.d.ts +15 -0
- package/dist/{commands → legacyCommands}/code.js +25 -1
- package/dist/legacyCommands/formula.d.ts +7 -0
- package/dist/legacyCommands/formula.js +67 -0
- package/dist/legacyCommands/inlineAtoms.d.ts +7 -0
- package/dist/legacyCommands/inlineAtoms.js +58 -0
- package/dist/legacyCommands/list.d.ts +38 -0
- package/dist/legacyCommands/list.js +477 -0
- package/dist/{commands → legacyCommands}/marks.d.ts +3 -0
- package/dist/{commands → legacyCommands}/marks.js +28 -11
- package/dist/legacyCommands/media.d.ts +31 -0
- package/dist/legacyCommands/media.js +205 -0
- package/dist/legacyCommands/move.d.ts +14 -0
- package/dist/legacyCommands/move.js +91 -0
- package/dist/legacyCommands/table.d.ts +91 -0
- package/dist/legacyCommands/table.js +547 -0
- package/dist/listPresets.d.ts +12 -0
- package/dist/listPresets.js +6 -0
- package/dist/listScope.d.ts +27 -0
- package/dist/listScope.js +104 -0
- package/dist/markdown/compatibility.d.ts +2 -0
- package/dist/markdown/compatibility.js +94 -2
- package/dist/marks.d.ts +5 -5
- package/dist/model.d.ts +65 -9
- package/dist/plugin.d.ts +15 -0
- package/dist/plugin.js +31 -0
- package/dist/plugins/alignment.d.ts +3 -0
- package/dist/plugins/alignment.js +6 -0
- package/dist/plugins/basicFormatting.d.ts +9 -0
- package/dist/plugins/basicFormatting.js +24 -0
- package/dist/plugins/blockType.d.ts +3 -0
- package/dist/plugins/blockType.js +6 -0
- package/dist/plugins/blockquote.d.ts +3 -0
- package/dist/plugins/blockquote.js +6 -0
- package/dist/plugins/checklist.d.ts +3 -0
- package/dist/plugins/checklist.js +10 -0
- package/dist/plugins/codeBlock.d.ts +3 -0
- package/dist/plugins/codeBlock.js +6 -0
- package/dist/plugins/formula.d.ts +3 -0
- package/dist/plugins/formula.js +9 -0
- package/dist/plugins/list.d.ts +3 -0
- package/dist/plugins/list.js +10 -0
- package/dist/plugins/media.d.ts +3 -0
- package/dist/plugins/media.js +12 -0
- package/dist/plugins/move.d.ts +3 -0
- package/dist/plugins/move.js +9 -0
- package/dist/plugins/table.d.ts +3 -0
- package/dist/plugins/table.js +22 -0
- package/dist/preset.d.ts +12 -0
- package/dist/preset.js +40 -0
- package/dist/schema.d.ts +22 -0
- package/dist/schema.js +333 -0
- package/dist/security/urlPolicy.d.ts +1 -17
- package/dist/security/urlPolicy.js +3 -69
- package/dist/selection.d.ts +1 -1
- package/dist/selectionMapping.d.ts +4 -0
- package/dist/selectionMapping.js +222 -0
- package/dist/table.d.ts +3 -3
- package/dist/transaction.d.ts +35 -12
- package/dist/transaction.js +174 -28
- package/dist/tree.d.ts +8 -2
- package/dist/tree.js +44 -0
- package/package.json +27 -8
- package/dist/commands/alignment.d.ts +0 -18
- package/dist/commands/code.d.ts +0 -13
- package/dist/commands/list.d.ts +0 -20
- package/dist/commands/list.js +0 -52
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { parseCanonicalListHtml, serializeCanonicalListHtml } from "../../list/formats.js";
|
|
2
|
+
export const PDF_MEDIA_TYPE = "application/pdf";
|
|
3
|
+
const escapeHtml = (value) => value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
4
|
+
const spanFor = (item) => {
|
|
5
|
+
const family = item.fontFamily?.toLowerCase() || "";
|
|
6
|
+
const styles = [
|
|
7
|
+
`font-size:${Math.max(8, Math.round(item.height))}px`,
|
|
8
|
+
family.includes("bold") ? "font-weight:700" : "",
|
|
9
|
+
family.includes("italic") || family.includes("oblique") ? "font-style:italic" : "",
|
|
10
|
+
].filter(Boolean).join(";");
|
|
11
|
+
return `<span style="${styles}">${escapeHtml(item.text)}</span>`;
|
|
12
|
+
};
|
|
13
|
+
const lineContent = (items) => {
|
|
14
|
+
let previousRight;
|
|
15
|
+
let text = "";
|
|
16
|
+
let html = "";
|
|
17
|
+
const starts = [];
|
|
18
|
+
const gaps = [];
|
|
19
|
+
items.forEach((item, index) => {
|
|
20
|
+
const gap = previousRight === undefined ? 0 : item.x - previousRight;
|
|
21
|
+
if (index === 0 || gap > 20)
|
|
22
|
+
starts.push(item.x);
|
|
23
|
+
if (gap > 2) {
|
|
24
|
+
text += " ";
|
|
25
|
+
html += " ";
|
|
26
|
+
if (gap > 20)
|
|
27
|
+
gaps.push(gap);
|
|
28
|
+
}
|
|
29
|
+
text += item.text;
|
|
30
|
+
html += spanFor(item);
|
|
31
|
+
previousRight = item.x + item.width;
|
|
32
|
+
});
|
|
33
|
+
return { text, html, starts, gaps };
|
|
34
|
+
};
|
|
35
|
+
const alignmentForLine = (items, pageWidth) => {
|
|
36
|
+
const first = items[0]?.x || 0;
|
|
37
|
+
const last = items[items.length - 1];
|
|
38
|
+
const right = last ? last.x + last.width : first;
|
|
39
|
+
const center = (first + right) / 2;
|
|
40
|
+
if (Math.abs(center - pageWidth / 2) < pageWidth * 0.12)
|
|
41
|
+
return "center";
|
|
42
|
+
if (first > pageWidth * 0.55)
|
|
43
|
+
return "right";
|
|
44
|
+
return "";
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Fidelity: `lossy` for everything - PDF has no structural document model to
|
|
48
|
+
* recover, only positioned text runs. This is a best-effort layout
|
|
49
|
+
* reconstruction (lines -> paragraphs/headings/lists/tables via position
|
|
50
|
+
* heuristics), not a round-trip format. Matches the standing scope decision
|
|
51
|
+
* since Phase 1.
|
|
52
|
+
*/
|
|
53
|
+
export const reconstructPdfPages = (pages) => {
|
|
54
|
+
let layoutHtml = "";
|
|
55
|
+
pages.forEach((page) => {
|
|
56
|
+
const heights = page.items.map((item) => item.height).filter((height) => height > 0).sort((a, b) => a - b);
|
|
57
|
+
const medianHeight = heights[Math.floor(heights.length / 2)] || 12;
|
|
58
|
+
const lines = [];
|
|
59
|
+
page.items.filter((item) => item.text.trim()).forEach((item) => {
|
|
60
|
+
const line = lines.find((candidate) => Math.abs(candidate.y - item.y) < medianHeight * 0.5);
|
|
61
|
+
if (line)
|
|
62
|
+
line.items.push(item);
|
|
63
|
+
else
|
|
64
|
+
lines.push({ y: item.y, items: [item] });
|
|
65
|
+
});
|
|
66
|
+
lines.sort((left, right) => right.y - left.y);
|
|
67
|
+
lines.forEach((line) => line.items.sort((left, right) => left.x - right.x));
|
|
68
|
+
let pageHtml = "";
|
|
69
|
+
let activeList;
|
|
70
|
+
let tableColumns = [];
|
|
71
|
+
let tableRows = [];
|
|
72
|
+
const closeList = () => {
|
|
73
|
+
if (activeList)
|
|
74
|
+
pageHtml += `</${activeList}>`;
|
|
75
|
+
activeList = undefined;
|
|
76
|
+
};
|
|
77
|
+
const closeTable = () => {
|
|
78
|
+
if (tableRows.length) {
|
|
79
|
+
pageHtml += `<table style="border-collapse:collapse;width:100%"><tbody>${tableRows.join("")}</tbody></table>`;
|
|
80
|
+
}
|
|
81
|
+
tableRows = [];
|
|
82
|
+
tableColumns = [];
|
|
83
|
+
};
|
|
84
|
+
lines.forEach((line) => {
|
|
85
|
+
const content = lineContent(line.items);
|
|
86
|
+
const alignsWithTable = tableColumns.length > 0
|
|
87
|
+
&& content.starts.some((x) => tableColumns.some((column) => Math.abs(column - x) < 20));
|
|
88
|
+
const beginsTable = content.starts.length >= 2 && content.gaps.some((gap) => gap > 30);
|
|
89
|
+
if (beginsTable || alignsWithTable) {
|
|
90
|
+
closeList();
|
|
91
|
+
if (!tableColumns.length)
|
|
92
|
+
tableColumns = [...content.starts];
|
|
93
|
+
const cells = new Array(tableColumns.length).fill("");
|
|
94
|
+
line.items.forEach((item) => {
|
|
95
|
+
let column = 0;
|
|
96
|
+
tableColumns.forEach((start, index) => {
|
|
97
|
+
if (item.x >= start - 10)
|
|
98
|
+
column = index;
|
|
99
|
+
});
|
|
100
|
+
cells[column] += `${cells[column] ? " " : ""}${spanFor(item)}`;
|
|
101
|
+
});
|
|
102
|
+
tableRows.push(`<tr>${cells.map((cell) => `<td style="border:1px solid #d1d5db;padding:8px;vertical-align:top">${cell || " "}</td>`).join("")}</tr>`);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
closeTable();
|
|
106
|
+
const bullet = /^[•\-*]\s/.test(content.text);
|
|
107
|
+
const numbered = /^\d+[.)]\s/.test(content.text);
|
|
108
|
+
if (bullet || numbered) {
|
|
109
|
+
const type = bullet ? "ul" : "ol";
|
|
110
|
+
if (activeList !== type) {
|
|
111
|
+
closeList();
|
|
112
|
+
activeList = type;
|
|
113
|
+
pageHtml += `<${type}>`;
|
|
114
|
+
}
|
|
115
|
+
const listItems = line.items.map((item, index) => index === 0
|
|
116
|
+
? { ...item, text: item.text.replace(bullet ? /^[•\-*]\s*/ : /^\d+[.)]\s*/, "") }
|
|
117
|
+
: item);
|
|
118
|
+
pageHtml += `<li>${lineContent(listItems).html.trim()}</li>`;
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
closeList();
|
|
122
|
+
const largest = Math.max(...line.items.map((item) => item.height));
|
|
123
|
+
const heading = largest > medianHeight * 1.2;
|
|
124
|
+
const tag = heading ? (largest > medianHeight * 1.5 ? "h2" : "h3") : "p";
|
|
125
|
+
const alignment = alignmentForLine(line.items, page.width);
|
|
126
|
+
const indent = !alignment && line.items[0]?.x > 40 ? `margin-left:${Math.round(line.items[0].x)}px` : "";
|
|
127
|
+
const style = [alignment ? `text-align:${alignment}` : "", indent].filter(Boolean).join(";");
|
|
128
|
+
pageHtml += `<${tag}${style ? ` style="${style}"` : ""}>${content.html}</${tag}>`;
|
|
129
|
+
});
|
|
130
|
+
closeList();
|
|
131
|
+
closeTable();
|
|
132
|
+
layoutHtml += pageHtml;
|
|
133
|
+
});
|
|
134
|
+
return { document: parseCanonicalListHtml(layoutHtml), layoutHtml, pages: pages.length };
|
|
135
|
+
};
|
|
136
|
+
export const importPdfDocument = async (arrayBuffer) => {
|
|
137
|
+
const pdfjsLib = await import("pdfjs-dist");
|
|
138
|
+
if (typeof window !== "undefined") {
|
|
139
|
+
pdfjsLib.GlobalWorkerOptions.workerSrc = new URL("pdfjs-dist/build/pdf.worker.min.mjs", import.meta.url).toString();
|
|
140
|
+
}
|
|
141
|
+
const pdf = await pdfjsLib.getDocument({ data: arrayBuffer }).promise;
|
|
142
|
+
const pages = [];
|
|
143
|
+
for (let index = 1; index <= pdf.numPages; index += 1) {
|
|
144
|
+
const page = await pdf.getPage(index);
|
|
145
|
+
const viewport = page.getViewport({ scale: 1 });
|
|
146
|
+
const content = await page.getTextContent();
|
|
147
|
+
const styles = content.styles;
|
|
148
|
+
pages.push({
|
|
149
|
+
width: viewport.width,
|
|
150
|
+
items: content.items.map((item) => ({
|
|
151
|
+
text: item.str || "",
|
|
152
|
+
x: item.transform[4],
|
|
153
|
+
y: item.transform[5],
|
|
154
|
+
width: item.width || 0,
|
|
155
|
+
height: Math.abs(item.transform[3]) || 0,
|
|
156
|
+
fontFamily: styles[item.fontName]?.fontFamily,
|
|
157
|
+
})),
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
return reconstructPdfPages(pages);
|
|
161
|
+
};
|
|
162
|
+
export const buildPdfPrintDocument = (document) => {
|
|
163
|
+
const html = serializeCanonicalListHtml(document, { clean: true });
|
|
164
|
+
return `<!doctype html>
|
|
165
|
+
<html lang="en">
|
|
166
|
+
<head>
|
|
167
|
+
<meta charset="utf-8">
|
|
168
|
+
<title>Smart RTE PDF Export</title>
|
|
169
|
+
<style>
|
|
170
|
+
@page { margin: 18mm; }
|
|
171
|
+
html, body { background: #fff; }
|
|
172
|
+
body {
|
|
173
|
+
color: #111;
|
|
174
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
175
|
+
line-height: 1.6;
|
|
176
|
+
padding: 32px;
|
|
177
|
+
}
|
|
178
|
+
table { border-collapse: collapse; width: 100%; margin: 12px 0; break-inside: auto; }
|
|
179
|
+
tr, img, blockquote, pre { break-inside: avoid; }
|
|
180
|
+
td, th { border: 1px solid #d1d5db; padding: 8px; vertical-align: top; }
|
|
181
|
+
img { max-width: 100%; height: auto; }
|
|
182
|
+
blockquote { border-left: 4px solid #d1d5db; padding-left: 12px; color: #374151; }
|
|
183
|
+
pre, code { background: #f3f4f6; }
|
|
184
|
+
pre { padding: 12px; white-space: pre-wrap; }
|
|
185
|
+
@media print { body { padding: 0; } }
|
|
186
|
+
</style>
|
|
187
|
+
</head>
|
|
188
|
+
<body>${html || "<p></p>"}</body>
|
|
189
|
+
</html>`;
|
|
190
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Attrs, HistoryEntry, SmartHistory, SmartTransaction } from "./types.js";
|
|
2
|
+
export declare const DEFAULT_HISTORY_LIMIT = 200;
|
|
3
|
+
export declare const DEFAULT_HISTORY_BYTE_LIMIT: number;
|
|
4
|
+
export declare const DEFAULT_COALESCENCE_WINDOW_MS = 400;
|
|
5
|
+
export declare const createHistory: (options?: {
|
|
6
|
+
limit?: number;
|
|
7
|
+
byteLimit?: number;
|
|
8
|
+
coalescenceWindowMs?: number;
|
|
9
|
+
}) => SmartHistory;
|
|
10
|
+
export declare const recordHistory: (history: SmartHistory, transaction: SmartTransaction) => SmartHistory;
|
|
11
|
+
export declare const popUndo: (history: SmartHistory) => {
|
|
12
|
+
entry: HistoryEntry;
|
|
13
|
+
history: SmartHistory;
|
|
14
|
+
} | null;
|
|
15
|
+
export declare const popRedo: (history: SmartHistory) => {
|
|
16
|
+
entry: HistoryEntry;
|
|
17
|
+
history: SmartHistory;
|
|
18
|
+
} | null;
|
|
19
|
+
/** Keeps stored undo/redo payloads applicable through non-history async state updates. */
|
|
20
|
+
export declare const rebaseHistoryNodeAttributes: (history: SmartHistory, nodeId: string, before: Attrs, after: Attrs) => SmartHistory;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { invertTransaction } from "./transactions.js";
|
|
2
|
+
import { isTextNode } from "./identity.js";
|
|
3
|
+
export const DEFAULT_HISTORY_LIMIT = 200;
|
|
4
|
+
export const DEFAULT_HISTORY_BYTE_LIMIT = 32 * 1024 * 1024;
|
|
5
|
+
export const DEFAULT_COALESCENCE_WINDOW_MS = 400;
|
|
6
|
+
export const createHistory = (options = {}) => ({
|
|
7
|
+
undo: [],
|
|
8
|
+
redo: [],
|
|
9
|
+
limit: Math.max(1, Math.floor(options.limit ?? DEFAULT_HISTORY_LIMIT)),
|
|
10
|
+
byteLimit: Math.max(1, Math.floor(options.byteLimit ?? DEFAULT_HISTORY_BYTE_LIMIT)),
|
|
11
|
+
coalescenceWindowMs: Math.max(0, options.coalescenceWindowMs ?? DEFAULT_COALESCENCE_WINDOW_MS),
|
|
12
|
+
});
|
|
13
|
+
const typingTail = (transaction) => {
|
|
14
|
+
if (!transaction.operations.length || transaction.operations.some((operation) => operation.type !== "insertText"))
|
|
15
|
+
return null;
|
|
16
|
+
return transaction.operations[transaction.operations.length - 1];
|
|
17
|
+
};
|
|
18
|
+
const equalPos = (left, right) => left.offset === right.offset && left.path.length === right.path.length && left.path.every((part, index) => part === right.path[index]);
|
|
19
|
+
const canCoalesce = (previous, next, windowMs) => {
|
|
20
|
+
if (previous.metadata.historyGroup || next.metadata.historyGroup) {
|
|
21
|
+
return Boolean(previous.metadata.historyGroup && previous.metadata.historyGroup === next.metadata.historyGroup);
|
|
22
|
+
}
|
|
23
|
+
if (previous.metadata.compositionId || next.metadata.compositionId) {
|
|
24
|
+
return Boolean(previous.metadata.compositionId && previous.metadata.compositionId === next.metadata.compositionId);
|
|
25
|
+
}
|
|
26
|
+
const left = typingTail(previous);
|
|
27
|
+
const right = next.operations.length === 1 ? typingTail(next) : null;
|
|
28
|
+
return Boolean(left && right &&
|
|
29
|
+
previous.metadata.source === next.metadata.source &&
|
|
30
|
+
previous.metadata.source === "input" &&
|
|
31
|
+
next.metadata.timestamp - previous.metadata.timestamp >= 0 &&
|
|
32
|
+
next.metadata.timestamp - previous.metadata.timestamp <= windowMs &&
|
|
33
|
+
equalPos(previous.selectionAfter.anchor, next.selectionBefore.anchor) &&
|
|
34
|
+
equalPos(previous.selectionAfter.head, next.selectionBefore.head) &&
|
|
35
|
+
equalPos({ path: left.pos.path, offset: left.pos.offset + left.text.length }, right.pos));
|
|
36
|
+
};
|
|
37
|
+
const entryFor = (transaction) => {
|
|
38
|
+
const forward = structuredClone(transaction);
|
|
39
|
+
const inverse = invertTransaction(transaction);
|
|
40
|
+
return { forward, inverse, estimatedBytes: JSON.stringify(forward).length + JSON.stringify(inverse).length };
|
|
41
|
+
};
|
|
42
|
+
const evictToBudget = (entries, limit, byteLimit) => {
|
|
43
|
+
if (entries.length > limit)
|
|
44
|
+
entries.splice(0, entries.length - limit);
|
|
45
|
+
let bytes = entries.reduce((total, entry) => total + entry.estimatedBytes, 0);
|
|
46
|
+
// Keep the newest intent even when it alone exceeds the budget so undo never
|
|
47
|
+
// becomes unavailable immediately after a large paste or table operation.
|
|
48
|
+
while (entries.length > 1 && bytes > byteLimit)
|
|
49
|
+
bytes -= entries.shift().estimatedBytes;
|
|
50
|
+
return entries;
|
|
51
|
+
};
|
|
52
|
+
export const recordHistory = (history, transaction) => {
|
|
53
|
+
if (!transaction.metadata.addToHistory)
|
|
54
|
+
return history;
|
|
55
|
+
const undo = [...history.undo];
|
|
56
|
+
const previous = undo[undo.length - 1];
|
|
57
|
+
if (previous && canCoalesce(previous.forward, transaction, history.coalescenceWindowMs)) {
|
|
58
|
+
const combined = {
|
|
59
|
+
...previous.forward,
|
|
60
|
+
operations: [...previous.forward.operations, ...structuredClone(transaction.operations)],
|
|
61
|
+
selectionAfter: structuredClone(transaction.selectionAfter),
|
|
62
|
+
storedMarksAfter: structuredClone(transaction.storedMarksAfter),
|
|
63
|
+
metadata: { ...previous.forward.metadata, timestamp: transaction.metadata.timestamp },
|
|
64
|
+
};
|
|
65
|
+
undo[undo.length - 1] = entryFor(combined);
|
|
66
|
+
}
|
|
67
|
+
else
|
|
68
|
+
undo.push(entryFor(transaction));
|
|
69
|
+
evictToBudget(undo, history.limit, history.byteLimit);
|
|
70
|
+
return { ...history, undo, redo: [] };
|
|
71
|
+
};
|
|
72
|
+
export const popUndo = (history) => {
|
|
73
|
+
const entry = history.undo[history.undo.length - 1];
|
|
74
|
+
if (!entry)
|
|
75
|
+
return null;
|
|
76
|
+
return { entry, history: { ...history, undo: history.undo.slice(0, -1), redo: [...history.redo, entry] } };
|
|
77
|
+
};
|
|
78
|
+
export const popRedo = (history) => {
|
|
79
|
+
const entry = history.redo[history.redo.length - 1];
|
|
80
|
+
if (!entry)
|
|
81
|
+
return null;
|
|
82
|
+
return { entry, history: { ...history, redo: history.redo.slice(0, -1), undo: [...history.undo, entry] } };
|
|
83
|
+
};
|
|
84
|
+
const rewriteNodeAttrs = (node, nodeId, before, after) => {
|
|
85
|
+
if (isTextNode(node))
|
|
86
|
+
return node;
|
|
87
|
+
const children = node.children?.map((child) => rewriteNodeAttrs(child, nodeId, before, after));
|
|
88
|
+
if (node.id !== nodeId)
|
|
89
|
+
return children ? { ...node, children } : node;
|
|
90
|
+
if (JSON.stringify(node.attrs || {}) !== JSON.stringify(before))
|
|
91
|
+
return children ? { ...node, children } : node;
|
|
92
|
+
const { attrs: _attrs, ...rest } = node;
|
|
93
|
+
return Object.keys(after).length ? { ...rest, attrs: structuredClone(after), ...(children ? { children } : {}) } : { ...rest, ...(children ? { children } : {}) };
|
|
94
|
+
};
|
|
95
|
+
/** Keeps stored undo/redo payloads applicable through non-history async state updates. */
|
|
96
|
+
export const rebaseHistoryNodeAttributes = (history, nodeId, before, after) => {
|
|
97
|
+
const transaction = (value) => ({
|
|
98
|
+
...value,
|
|
99
|
+
operations: value.operations.map((operation) => {
|
|
100
|
+
if (operation.type === "insertNode" || operation.type === "removeNode")
|
|
101
|
+
return { ...operation, node: rewriteNodeAttrs(operation.node, nodeId, before, after) };
|
|
102
|
+
if (operation.type === "replaceNode")
|
|
103
|
+
return {
|
|
104
|
+
...operation,
|
|
105
|
+
before: rewriteNodeAttrs(operation.before, nodeId, before, after),
|
|
106
|
+
after: rewriteNodeAttrs(operation.after, nodeId, before, after),
|
|
107
|
+
};
|
|
108
|
+
return operation;
|
|
109
|
+
}),
|
|
110
|
+
});
|
|
111
|
+
const entry = (value) => {
|
|
112
|
+
const forward = transaction(value.forward);
|
|
113
|
+
const inverse = transaction(value.inverse);
|
|
114
|
+
return { forward, inverse, estimatedBytes: JSON.stringify(forward).length + JSON.stringify(inverse).length };
|
|
115
|
+
};
|
|
116
|
+
return {
|
|
117
|
+
...history,
|
|
118
|
+
undo: evictToBudget(history.undo.map(entry), history.limit, history.byteLimit),
|
|
119
|
+
redo: evictToBudget(history.redo.map(entry), history.limit, history.byteLimit),
|
|
120
|
+
};
|
|
121
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SmartDocument, SmartNode } from "./types.js";
|
|
2
|
+
export declare const createNodeId: () => string;
|
|
3
|
+
export declare const isTextNode: (node: SmartNode) => node is Extract<SmartNode, {
|
|
4
|
+
type: "text";
|
|
5
|
+
}>;
|
|
6
|
+
export declare const cloneNode: <T extends SmartNode>(node: T) => T;
|
|
7
|
+
export declare const collectNodeIds: (document: SmartDocument) => string[];
|
|
8
|
+
export declare const assertUniqueNodeIds: (document: SmartDocument) => void;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export const createNodeId = () => {
|
|
2
|
+
const cryptoApi = globalThis.crypto;
|
|
3
|
+
if (cryptoApi?.randomUUID)
|
|
4
|
+
return cryptoApi.randomUUID();
|
|
5
|
+
if (!cryptoApi?.getRandomValues)
|
|
6
|
+
throw new Error("A cryptographically secure random source is required for node IDs.");
|
|
7
|
+
const bytes = cryptoApi.getRandomValues(new Uint8Array(16));
|
|
8
|
+
bytes[6] = (bytes[6] & 0x0f) | 0x40;
|
|
9
|
+
bytes[8] = (bytes[8] & 0x3f) | 0x80;
|
|
10
|
+
const hex = [...bytes].map((value) => value.toString(16).padStart(2, "0"));
|
|
11
|
+
return `${hex.slice(0, 4).join("")}-${hex.slice(4, 6).join("")}-${hex.slice(6, 8).join("")}-${hex.slice(8, 10).join("")}-${hex.slice(10).join("")}`;
|
|
12
|
+
};
|
|
13
|
+
export const isTextNode = (node) => node.type === "text";
|
|
14
|
+
export const cloneNode = (node) => structuredClone(node);
|
|
15
|
+
export const collectNodeIds = (document) => {
|
|
16
|
+
const result = [];
|
|
17
|
+
const visit = (node) => {
|
|
18
|
+
if (isTextNode(node))
|
|
19
|
+
return;
|
|
20
|
+
result.push(node.id);
|
|
21
|
+
node.children?.forEach(visit);
|
|
22
|
+
};
|
|
23
|
+
visit(document);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
export const assertUniqueNodeIds = (document) => {
|
|
27
|
+
const ids = collectNodeIds(document);
|
|
28
|
+
if (new Set(ids).size !== ids.length)
|
|
29
|
+
throw new Error("Duplicate live node id in document.");
|
|
30
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export * from "./types.js";
|
|
2
|
+
export * from "./identity.js";
|
|
3
|
+
export * from "./schema.js";
|
|
4
|
+
export { resolvePos, selectionRange, graphemeBoundaries, inlineGraphemeBoundaries, previousGraphemeBoundary, nextGraphemeBoundary, moveGrapheme, graphemeBackspaceRange, } from "./positions.js";
|
|
5
|
+
export * from "./operations.js";
|
|
6
|
+
export * from "./mapping.js";
|
|
7
|
+
export * from "./transactions.js";
|
|
8
|
+
export * from "./normalization.js";
|
|
9
|
+
export * from "./boundaries.js";
|
|
10
|
+
export * from "./history.js";
|
|
11
|
+
export * from "./editor.js";
|
|
12
|
+
export * from "./modelDom.js";
|
|
13
|
+
export * from "./scope/index.js";
|
|
14
|
+
export * from "./surface/index.js";
|
|
15
|
+
export * from "./list/index.js";
|
|
16
|
+
export * from "./marks/index.js";
|
|
17
|
+
export * from "./security/urlPolicy.js";
|
|
18
|
+
export * from "./structural/index.js";
|
|
19
|
+
export * from "./block/index.js";
|
|
20
|
+
export * from "./table/index.js";
|
|
21
|
+
export * from "./atom/index.js";
|
|
22
|
+
export * from "./clipboard/index.js";
|
|
23
|
+
export * from "./formats/index.js";
|
|
24
|
+
export * from "./annotations/index.js";
|
|
25
|
+
export * from "./diff/index.js";
|
|
26
|
+
export * from "./versioning/index.js";
|
|
27
|
+
export * from "./comments/index.js";
|
|
28
|
+
export * from "./suggestions/index.js";
|
|
29
|
+
export * from "./plugin/index.js";
|
|
30
|
+
export * from "./collab/index.js";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export * from "./types.js";
|
|
2
|
+
export * from "./identity.js";
|
|
3
|
+
export * from "./schema.js";
|
|
4
|
+
export { resolvePos, selectionRange, graphemeBoundaries, inlineGraphemeBoundaries, previousGraphemeBoundary, nextGraphemeBoundary, moveGrapheme, graphemeBackspaceRange, } from "./positions.js";
|
|
5
|
+
export * from "./operations.js";
|
|
6
|
+
export * from "./mapping.js";
|
|
7
|
+
export * from "./transactions.js";
|
|
8
|
+
export * from "./normalization.js";
|
|
9
|
+
export * from "./boundaries.js";
|
|
10
|
+
export * from "./history.js";
|
|
11
|
+
export * from "./editor.js";
|
|
12
|
+
export * from "./modelDom.js";
|
|
13
|
+
export * from "./scope/index.js";
|
|
14
|
+
export * from "./surface/index.js";
|
|
15
|
+
export * from "./list/index.js";
|
|
16
|
+
export * from "./marks/index.js";
|
|
17
|
+
export * from "./security/urlPolicy.js";
|
|
18
|
+
export * from "./structural/index.js";
|
|
19
|
+
export * from "./block/index.js";
|
|
20
|
+
export * from "./table/index.js";
|
|
21
|
+
export * from "./atom/index.js";
|
|
22
|
+
export * from "./clipboard/index.js";
|
|
23
|
+
export * from "./formats/index.js";
|
|
24
|
+
export * from "./annotations/index.js";
|
|
25
|
+
export * from "./diff/index.js";
|
|
26
|
+
export * from "./versioning/index.js";
|
|
27
|
+
export * from "./comments/index.js";
|
|
28
|
+
export * from "./suggestions/index.js";
|
|
29
|
+
export * from "./plugin/index.js";
|
|
30
|
+
export * from "./collab/index.js";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { SmartElementNode } from "../types.js";
|
|
2
|
+
import type { ContinueListNumberingParams, CreateListParams, IndentListParams, InsertListFragmentParams, ListCommand, MoveListItemsParams, OutdentListParams, RestartListNumberingParams, SetListCheckedParams, SetListPresetParams, SetListStyleParams, UnwrapListParams } from "./types.js";
|
|
3
|
+
/** Explicit style is the current-level override; preset supplies other levels. */
|
|
4
|
+
export declare const effectiveListStyle: (list: SmartElementNode) => string | undefined;
|
|
5
|
+
export declare const createList: ListCommand<CreateListParams>;
|
|
6
|
+
export declare const unwrapList: ListCommand<UnwrapListParams>;
|
|
7
|
+
export declare const indentList: ListCommand<IndentListParams>;
|
|
8
|
+
export declare const outdentList: ListCommand<OutdentListParams>;
|
|
9
|
+
export declare const setListPreset: ListCommand<SetListPresetParams>;
|
|
10
|
+
export declare const setListStyle: ListCommand<SetListStyleParams>;
|
|
11
|
+
export declare const setListChecked: ListCommand<SetListCheckedParams>;
|
|
12
|
+
/** Moves one contiguous item run by one sibling while preserving every item subtree and ID. */
|
|
13
|
+
export declare const moveListItems: ListCommand<MoveListItemsParams>;
|
|
14
|
+
export declare const restartListNumbering: ListCommand<RestartListNumberingParams>;
|
|
15
|
+
export declare const continueListNumbering: ListCommand<ContinueListNumberingParams>;
|
|
16
|
+
export declare const insertListFragment: ListCommand<InsertListFragmentParams>;
|
|
17
|
+
export declare const listCommands: {
|
|
18
|
+
readonly "list.create": ListCommand<CreateListParams>;
|
|
19
|
+
readonly "list.unwrap": ListCommand<UnwrapListParams>;
|
|
20
|
+
readonly "list.indent": ListCommand<IndentListParams>;
|
|
21
|
+
readonly "list.outdent": ListCommand<OutdentListParams>;
|
|
22
|
+
readonly "list.setPreset": ListCommand<SetListPresetParams>;
|
|
23
|
+
readonly "list.setStyle": ListCommand<SetListStyleParams>;
|
|
24
|
+
readonly "list.setChecked": ListCommand<SetListCheckedParams>;
|
|
25
|
+
readonly "list.move": ListCommand<MoveListItemsParams>;
|
|
26
|
+
readonly "list.restartNumbering": ListCommand<RestartListNumberingParams>;
|
|
27
|
+
readonly "list.continueNumbering": ListCommand<ContinueListNumberingParams>;
|
|
28
|
+
};
|