smartrte-core 0.2.0 → 1.0.0-beta.1
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 +21 -0
- package/dist/foundation/atom/formats.js +77 -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 +20 -0
- package/dist/foundation/list/formats.js +795 -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 +26 -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 +45 -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,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compatibility API for features that have not migrated to the foundation
|
|
3
|
+
* contracts. Contract names are deliberately prefixed with `Legacy`; the
|
|
4
|
+
* canonical unprefixed names belong to the package root/foundation kernel.
|
|
5
|
+
*/
|
|
6
|
+
export * from "../model.js";
|
|
7
|
+
export * from "../command.js";
|
|
8
|
+
export * from "../editor.js";
|
|
9
|
+
export * from "../marks.js";
|
|
10
|
+
export * from "../plugin.js";
|
|
11
|
+
export * from "../preset.js";
|
|
12
|
+
export * from "../history.js";
|
|
13
|
+
export * from "../selection.js";
|
|
14
|
+
export * from "../listScope.js";
|
|
15
|
+
export * from "../listPresets.js";
|
|
16
|
+
export * from "../selectionMapping.js";
|
|
17
|
+
export * from "../schema.js";
|
|
18
|
+
export * from "../table.js";
|
|
19
|
+
export * from "../transaction.js";
|
|
20
|
+
export * from "../tree.js";
|
|
21
|
+
export * from "../legacyCommands/list.js";
|
|
22
|
+
export * from "../legacyCommands/code.js";
|
|
23
|
+
export * from "../legacyCommands/marks.js";
|
|
24
|
+
export * from "../legacyCommands/alignment.js";
|
|
25
|
+
export * from "../legacyCommands/checklist.js";
|
|
26
|
+
export * from "../legacyCommands/media.js";
|
|
27
|
+
export * from "../legacyCommands/formula.js";
|
|
28
|
+
export * from "../legacyCommands/inlineAtoms.js";
|
|
29
|
+
export * from "../legacyCommands/blocks.js";
|
|
30
|
+
export * from "../legacyCommands/table.js";
|
|
31
|
+
export * from "../legacyCommands/move.js";
|
|
32
|
+
export * from "../plugins/basicFormatting.js";
|
|
33
|
+
export * from "../plugins/list.js";
|
|
34
|
+
export * from "../plugins/checklist.js";
|
|
35
|
+
export * from "../plugins/media.js";
|
|
36
|
+
export * from "../plugins/formula.js";
|
|
37
|
+
export * from "../plugins/alignment.js";
|
|
38
|
+
export * from "../plugins/codeBlock.js";
|
|
39
|
+
export * from "../plugins/blockType.js";
|
|
40
|
+
export * from "../plugins/blockquote.js";
|
|
41
|
+
export * from "../plugins/table.js";
|
|
42
|
+
export * from "../plugins/move.js";
|
|
43
|
+
export * from "../html/compatibility.js";
|
|
44
|
+
export * from "../markdown/compatibility.js";
|
|
45
|
+
export * from "../security/urlPolicy.js";
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compatibility API for features that have not migrated to the foundation
|
|
3
|
+
* contracts. Contract names are deliberately prefixed with `Legacy`; the
|
|
4
|
+
* canonical unprefixed names belong to the package root/foundation kernel.
|
|
5
|
+
*/
|
|
6
|
+
export * from "../model.js";
|
|
7
|
+
export * from "../command.js";
|
|
8
|
+
export * from "../editor.js";
|
|
9
|
+
export * from "../marks.js";
|
|
10
|
+
export * from "../plugin.js";
|
|
11
|
+
export * from "../preset.js";
|
|
12
|
+
export * from "../history.js";
|
|
13
|
+
export * from "../selection.js";
|
|
14
|
+
export * from "../listScope.js";
|
|
15
|
+
export * from "../listPresets.js";
|
|
16
|
+
export * from "../selectionMapping.js";
|
|
17
|
+
export * from "../schema.js";
|
|
18
|
+
export * from "../table.js";
|
|
19
|
+
export * from "../transaction.js";
|
|
20
|
+
export * from "../tree.js";
|
|
21
|
+
export * from "../legacyCommands/list.js";
|
|
22
|
+
export * from "../legacyCommands/code.js";
|
|
23
|
+
export * from "../legacyCommands/marks.js";
|
|
24
|
+
export * from "../legacyCommands/alignment.js";
|
|
25
|
+
export * from "../legacyCommands/checklist.js";
|
|
26
|
+
export * from "../legacyCommands/media.js";
|
|
27
|
+
export * from "../legacyCommands/formula.js";
|
|
28
|
+
export * from "../legacyCommands/inlineAtoms.js";
|
|
29
|
+
export * from "../legacyCommands/blocks.js";
|
|
30
|
+
export * from "../legacyCommands/table.js";
|
|
31
|
+
export * from "../legacyCommands/move.js";
|
|
32
|
+
export * from "../plugins/basicFormatting.js";
|
|
33
|
+
export * from "../plugins/list.js";
|
|
34
|
+
export * from "../plugins/checklist.js";
|
|
35
|
+
export * from "../plugins/media.js";
|
|
36
|
+
export * from "../plugins/formula.js";
|
|
37
|
+
export * from "../plugins/alignment.js";
|
|
38
|
+
export * from "../plugins/codeBlock.js";
|
|
39
|
+
export * from "../plugins/blockType.js";
|
|
40
|
+
export * from "../plugins/blockquote.js";
|
|
41
|
+
export * from "../plugins/table.js";
|
|
42
|
+
export * from "../plugins/move.js";
|
|
43
|
+
export * from "../html/compatibility.js";
|
|
44
|
+
export * from "../markdown/compatibility.js";
|
|
45
|
+
export * from "../security/urlPolicy.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Path, type LegacySmartDocument, type TextAlignment } from "../model.js";
|
|
2
|
+
import type { LegacySmartSelection } from "../selection.js";
|
|
3
|
+
import type { SmartCommand } from "../command.js";
|
|
4
|
+
export interface SetTextAlignmentInput {
|
|
5
|
+
paths: readonly Path[];
|
|
6
|
+
alignment: TextAlignment | null;
|
|
7
|
+
}
|
|
8
|
+
export declare const setTextAlignment: (document: LegacySmartDocument, selection: LegacySmartSelection, input: SetTextAlignmentInput) => {
|
|
9
|
+
document: LegacySmartDocument;
|
|
10
|
+
transaction: {
|
|
11
|
+
id: string;
|
|
12
|
+
source: "user";
|
|
13
|
+
operations: import("../transaction.js").LegacySmartOperation[];
|
|
14
|
+
selectionBefore: LegacySmartSelection;
|
|
15
|
+
selectionAfter: LegacySmartSelection;
|
|
16
|
+
addToHistory: boolean;
|
|
17
|
+
timestamp: number;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare const setAlignment: SmartCommand<SetTextAlignmentInput>;
|
|
@@ -32,3 +32,20 @@ export const setTextAlignment = (document, selection, input) => {
|
|
|
32
32
|
},
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
|
+
export const setAlignment = {
|
|
36
|
+
id: "alignment.set",
|
|
37
|
+
isEnabled: (context, input) => {
|
|
38
|
+
if (!input?.paths.length)
|
|
39
|
+
return false;
|
|
40
|
+
return input.paths.every((path) => {
|
|
41
|
+
const type = getNodeAtPath(context.document, path)?.type;
|
|
42
|
+
return ["paragraph", "heading", "listItem", "blockquote", "codeBlock"].includes(type || "");
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
execute: (context, input) => {
|
|
46
|
+
if (!input || !setAlignment.isEnabled(context, input)) {
|
|
47
|
+
throw new Error("alignment.set requires alignable block paths.");
|
|
48
|
+
}
|
|
49
|
+
return setTextAlignment(context.document, context.selection, input).transaction;
|
|
50
|
+
},
|
|
51
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SmartCommand } from "../command.js";
|
|
2
|
+
import { type Path, type SmartHeadingNode } from "../model.js";
|
|
3
|
+
export interface SetBlockTypeInput {
|
|
4
|
+
parentPath: Path;
|
|
5
|
+
blockIndexes: readonly number[];
|
|
6
|
+
type: "paragraph" | "heading";
|
|
7
|
+
level?: SmartHeadingNode["level"];
|
|
8
|
+
}
|
|
9
|
+
export declare const setBlockType: SmartCommand<SetBlockTypeInput>;
|
|
10
|
+
export interface ToggleBlockquoteInput {
|
|
11
|
+
parentPath: Path;
|
|
12
|
+
blockIndexes: readonly number[];
|
|
13
|
+
}
|
|
14
|
+
export declare const toggleBlockquote: SmartCommand<ToggleBlockquoteInput>;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { getNodeAtPath, paragraph, } from "../model.js";
|
|
2
|
+
import { isSmartContainer } from "../tree.js";
|
|
3
|
+
const selectedSiblingBlocks = (context, parentPath, indexes) => {
|
|
4
|
+
const parent = getNodeAtPath(context.document, parentPath);
|
|
5
|
+
const unique = [...new Set(indexes)].sort((a, b) => a - b);
|
|
6
|
+
if (!isSmartContainer(parent) || !unique.length)
|
|
7
|
+
return null;
|
|
8
|
+
if (unique.some((index) => index < 0 || index >= parent.children.length))
|
|
9
|
+
return null;
|
|
10
|
+
return { parent, indexes: unique };
|
|
11
|
+
};
|
|
12
|
+
export const setBlockType = {
|
|
13
|
+
id: "block-type.set",
|
|
14
|
+
isEnabled: (context, input) => {
|
|
15
|
+
if (!input || input.type === "heading" &&
|
|
16
|
+
(!Number.isInteger(input.level) || (input.level || 0) < 1 || (input.level || 0) > 6))
|
|
17
|
+
return false;
|
|
18
|
+
const selected = selectedSiblingBlocks(context, input.parentPath, input.blockIndexes);
|
|
19
|
+
return Boolean(selected && selected.indexes.every((index) => {
|
|
20
|
+
const type = selected.parent.children[index].type;
|
|
21
|
+
return type === "paragraph" || type === "heading";
|
|
22
|
+
}));
|
|
23
|
+
},
|
|
24
|
+
execute: (context, input) => {
|
|
25
|
+
if (!input || !setBlockType.isEnabled(context, input)) {
|
|
26
|
+
throw new Error("block-type.set requires paragraph or heading sibling blocks.");
|
|
27
|
+
}
|
|
28
|
+
const selected = selectedSiblingBlocks(context, input.parentPath, input.blockIndexes);
|
|
29
|
+
const indexSet = new Set(selected.indexes);
|
|
30
|
+
const children = selected.parent.children.map((node, index) => {
|
|
31
|
+
if (!indexSet.has(index))
|
|
32
|
+
return node;
|
|
33
|
+
const block = node;
|
|
34
|
+
return input.type === "paragraph"
|
|
35
|
+
? { type: "paragraph", ...(block.alignment ? { alignment: block.alignment } : {}), children: block.children }
|
|
36
|
+
: {
|
|
37
|
+
type: "heading",
|
|
38
|
+
level: input.level,
|
|
39
|
+
...(block.alignment ? { alignment: block.alignment } : {}),
|
|
40
|
+
children: block.children.map((child) => {
|
|
41
|
+
if (child.type !== "text")
|
|
42
|
+
return child;
|
|
43
|
+
const marks = child.marks?.filter((mark) => mark.type !== "fontSize");
|
|
44
|
+
return marks?.length
|
|
45
|
+
? { ...child, marks }
|
|
46
|
+
: { type: "text", text: child.text };
|
|
47
|
+
}),
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
return {
|
|
51
|
+
id: "block-type.set",
|
|
52
|
+
source: "user",
|
|
53
|
+
operations: [{
|
|
54
|
+
type: "replaceNode",
|
|
55
|
+
path: input.parentPath,
|
|
56
|
+
node: { ...selected.parent, children },
|
|
57
|
+
}],
|
|
58
|
+
selectionBefore: context.selection,
|
|
59
|
+
selectionAfter: context.selection,
|
|
60
|
+
addToHistory: true,
|
|
61
|
+
timestamp: context.now?.() ?? Date.now(),
|
|
62
|
+
};
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
export const toggleBlockquote = {
|
|
66
|
+
id: "blockquote.toggle",
|
|
67
|
+
isEnabled: (context, input) => {
|
|
68
|
+
const selected = input && selectedSiblingBlocks(context, input.parentPath, input.blockIndexes);
|
|
69
|
+
if (!selected)
|
|
70
|
+
return false;
|
|
71
|
+
return selected.indexes.every((index, offset) => offset === 0 || index === selected.indexes[offset - 1] + 1);
|
|
72
|
+
},
|
|
73
|
+
execute: (context, input) => {
|
|
74
|
+
if (!input || !toggleBlockquote.isEnabled(context, input)) {
|
|
75
|
+
throw new Error("blockquote.toggle requires contiguous sibling blocks.");
|
|
76
|
+
}
|
|
77
|
+
const selected = selectedSiblingBlocks(context, input.parentPath, input.blockIndexes);
|
|
78
|
+
const first = selected.indexes[0];
|
|
79
|
+
const last = selected.indexes[selected.indexes.length - 1];
|
|
80
|
+
const blocks = selected.parent.children.slice(first, last + 1);
|
|
81
|
+
const replacement = blocks.every((block) => block.type === "blockquote")
|
|
82
|
+
? blocks.flatMap((block) => block.type === "blockquote" ? block.children : [block])
|
|
83
|
+
: [{ type: "blockquote", children: blocks.length ? blocks : [paragraph()] }];
|
|
84
|
+
return {
|
|
85
|
+
id: "blockquote.toggle",
|
|
86
|
+
source: "user",
|
|
87
|
+
operations: [{
|
|
88
|
+
type: "replaceNode",
|
|
89
|
+
path: input.parentPath,
|
|
90
|
+
node: {
|
|
91
|
+
...selected.parent,
|
|
92
|
+
children: [
|
|
93
|
+
...selected.parent.children.slice(0, first),
|
|
94
|
+
...replacement,
|
|
95
|
+
...selected.parent.children.slice(last + 1),
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
}],
|
|
99
|
+
selectionBefore: context.selection,
|
|
100
|
+
selectionAfter: { type: "node", path: [...input.parentPath, first] },
|
|
101
|
+
addToHistory: true,
|
|
102
|
+
timestamp: context.now?.() ?? Date.now(),
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SmartCommand } from "../command.js";
|
|
2
|
+
import { type Path } from "../model.js";
|
|
3
|
+
export interface ToggleChecklistInput {
|
|
4
|
+
strikeCompleted?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const toggleChecklist: SmartCommand<ToggleChecklistInput>;
|
|
7
|
+
export interface SetChecklistItemInput {
|
|
8
|
+
path: Path;
|
|
9
|
+
checked?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const setChecklistItemChecked: SmartCommand<SetChecklistItemInput>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { getNodeAtPath } from "../model.js";
|
|
2
|
+
import { toggleList } from "./list.js";
|
|
3
|
+
export const toggleChecklist = {
|
|
4
|
+
id: "checklist.toggle",
|
|
5
|
+
isEnabled: (context) => toggleList.isEnabled(context, { style: "disc", checklist: true }),
|
|
6
|
+
execute: (context, input) => ({
|
|
7
|
+
...toggleList.execute(context, {
|
|
8
|
+
style: "disc",
|
|
9
|
+
checklist: true,
|
|
10
|
+
strikeCompleted: input?.strikeCompleted,
|
|
11
|
+
}),
|
|
12
|
+
id: "checklist.toggle",
|
|
13
|
+
}),
|
|
14
|
+
};
|
|
15
|
+
export const setChecklistItemChecked = {
|
|
16
|
+
id: "checklist.set-checked",
|
|
17
|
+
isEnabled: (context, input) => {
|
|
18
|
+
if (!input)
|
|
19
|
+
return false;
|
|
20
|
+
const item = getNodeAtPath(context.document, input.path);
|
|
21
|
+
const list = getNodeAtPath(context.document, input.path.slice(0, -1));
|
|
22
|
+
return item?.type === "listItem" &&
|
|
23
|
+
list?.type === "list" &&
|
|
24
|
+
Boolean(list.checklist);
|
|
25
|
+
},
|
|
26
|
+
execute: (context, input) => {
|
|
27
|
+
if (!input || !setChecklistItemChecked.isEnabled(context, input)) {
|
|
28
|
+
throw new Error("checklist.set-checked requires an item in a checklist.");
|
|
29
|
+
}
|
|
30
|
+
const item = getNodeAtPath(context.document, input.path);
|
|
31
|
+
return {
|
|
32
|
+
id: "checklist.set-checked",
|
|
33
|
+
source: "user",
|
|
34
|
+
operations: [{
|
|
35
|
+
type: "setNodeAttrs",
|
|
36
|
+
path: input.path,
|
|
37
|
+
attrs: { checked: input.checked ?? !item.checked },
|
|
38
|
+
}],
|
|
39
|
+
selectionBefore: context.selection,
|
|
40
|
+
selectionAfter: context.selection,
|
|
41
|
+
addToHistory: true,
|
|
42
|
+
timestamp: context.now?.() ?? Date.now(),
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Path, type LegacySmartDocument } from "../model.js";
|
|
2
|
+
import type { LegacySmartSelection } from "../selection.js";
|
|
3
|
+
import type { LegacySmartTransaction } from "../transaction.js";
|
|
4
|
+
import type { SmartCommand } from "../command.js";
|
|
5
|
+
export interface ToggleCodeBlocksInput {
|
|
6
|
+
parentPath: Path;
|
|
7
|
+
blockIndexes: readonly number[];
|
|
8
|
+
}
|
|
9
|
+
export interface CodeCommandResult {
|
|
10
|
+
document: LegacySmartDocument;
|
|
11
|
+
transaction: LegacySmartTransaction;
|
|
12
|
+
}
|
|
13
|
+
/** Converts selected sibling blocks only; neighbours are never inferred or changed. */
|
|
14
|
+
export declare const toggleCodeBlocks: (document: LegacySmartDocument, selection: LegacySmartSelection, input: ToggleCodeBlocksInput) => CodeCommandResult;
|
|
15
|
+
export declare const toggleCodeBlock: SmartCommand<ToggleCodeBlocksInput>;
|
|
@@ -6,7 +6,13 @@ const toCodeBlock = (block) => {
|
|
|
6
6
|
if (block.type === "paragraph" || block.type === "heading") {
|
|
7
7
|
return {
|
|
8
8
|
type: "codeBlock",
|
|
9
|
-
text: block.children.map((child) =>
|
|
9
|
+
text: block.children.map((child) => {
|
|
10
|
+
if (child.type === "text")
|
|
11
|
+
return child.text;
|
|
12
|
+
if (child.type === "formula")
|
|
13
|
+
return child.displayText ?? child.value;
|
|
14
|
+
return child.alt ?? "";
|
|
15
|
+
}).join(""),
|
|
10
16
|
};
|
|
11
17
|
}
|
|
12
18
|
throw new Error(`Cannot convert ${block.type} to a code block.`);
|
|
@@ -54,3 +60,21 @@ export const toggleCodeBlocks = (document, selection, input) => {
|
|
|
54
60
|
},
|
|
55
61
|
};
|
|
56
62
|
};
|
|
63
|
+
export const toggleCodeBlock = {
|
|
64
|
+
id: "code-block.toggle",
|
|
65
|
+
isEnabled: (context, input) => {
|
|
66
|
+
if (!input?.blockIndexes.length)
|
|
67
|
+
return false;
|
|
68
|
+
const parent = getNodeAtPath(context.document, input.parentPath);
|
|
69
|
+
return isSmartContainer(parent) && input.blockIndexes.every((index) => {
|
|
70
|
+
const type = parent.children[index]?.type;
|
|
71
|
+
return type === "paragraph" || type === "heading" || type === "codeBlock";
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
execute: (context, input) => {
|
|
75
|
+
if (!input || !toggleCodeBlock.isEnabled(context, input)) {
|
|
76
|
+
throw new Error("code-block.toggle requires convertible sibling blocks.");
|
|
77
|
+
}
|
|
78
|
+
return toggleCodeBlocks(context.document, context.selection, input).transaction;
|
|
79
|
+
},
|
|
80
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SmartCommand } from "../command.js";
|
|
2
|
+
export interface InsertFormulaInput {
|
|
3
|
+
value: string;
|
|
4
|
+
displayText?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const insertFormula: SmartCommand<InsertFormulaInput>;
|
|
7
|
+
export declare const deleteFormula: SmartCommand<import("./inlineAtoms.js").InlineAtomPathInput>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { getNodeAtPath } from "../model.js";
|
|
2
|
+
import { isSmartContainer } from "../tree.js";
|
|
3
|
+
import { createDeleteInlineAtomCommand } from "./inlineAtoms.js";
|
|
4
|
+
const resolveFormulaTarget = (context, input) => {
|
|
5
|
+
if (!input?.value.trim() || context.selection.type !== "text")
|
|
6
|
+
return null;
|
|
7
|
+
const { anchor, focus } = context.selection;
|
|
8
|
+
if (anchor.offset !== focus.offset ||
|
|
9
|
+
anchor.path.length !== focus.path.length ||
|
|
10
|
+
!anchor.path.every((part, index) => focus.path[index] === part))
|
|
11
|
+
return null;
|
|
12
|
+
const node = getNodeAtPath(context.document, anchor.path);
|
|
13
|
+
const parentPath = anchor.path.slice(0, -1);
|
|
14
|
+
const parent = getNodeAtPath(context.document, parentPath);
|
|
15
|
+
if (node?.type !== "text" || !isSmartContainer(parent) ||
|
|
16
|
+
anchor.offset < 0 || anchor.offset > node.text.length)
|
|
17
|
+
return null;
|
|
18
|
+
return { node, parent, parentPath, index: anchor.path[anchor.path.length - 1], offset: anchor.offset };
|
|
19
|
+
};
|
|
20
|
+
export const insertFormula = {
|
|
21
|
+
id: "formula.insert",
|
|
22
|
+
isEnabled: (context, input) => Boolean(resolveFormulaTarget(context, input)),
|
|
23
|
+
execute: (context, input) => {
|
|
24
|
+
const target = resolveFormulaTarget(context, input);
|
|
25
|
+
if (!target || !input)
|
|
26
|
+
throw new Error("formula.insert requires a collapsed text selection and a formula.");
|
|
27
|
+
const formulaText = input.displayText ?? input.value;
|
|
28
|
+
const children = [...target.parent.children];
|
|
29
|
+
const replacement = [];
|
|
30
|
+
if (target.offset > 0) {
|
|
31
|
+
replacement.push({ ...target.node, text: target.node.text.slice(0, target.offset) });
|
|
32
|
+
}
|
|
33
|
+
replacement.push({
|
|
34
|
+
type: "formula",
|
|
35
|
+
value: input.value.trim(),
|
|
36
|
+
...(formulaText !== input.value ? { displayText: formulaText } : {}),
|
|
37
|
+
});
|
|
38
|
+
const formulaIndex = target.index + (target.offset > 0 ? 1 : 0);
|
|
39
|
+
const trailingText = target.node.text.slice(target.offset);
|
|
40
|
+
replacement.push({ ...target.node, text: trailingText });
|
|
41
|
+
return {
|
|
42
|
+
id: "formula.insert",
|
|
43
|
+
source: "user",
|
|
44
|
+
operations: [{
|
|
45
|
+
type: "replaceNode",
|
|
46
|
+
path: target.parentPath,
|
|
47
|
+
node: {
|
|
48
|
+
...target.parent,
|
|
49
|
+
children: [
|
|
50
|
+
...children.slice(0, target.index),
|
|
51
|
+
...replacement,
|
|
52
|
+
...children.slice(target.index + 1),
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
}],
|
|
56
|
+
selectionBefore: context.selection,
|
|
57
|
+
selectionAfter: {
|
|
58
|
+
type: "text",
|
|
59
|
+
anchor: { path: [...target.parentPath, formulaIndex + 1], offset: 0 },
|
|
60
|
+
focus: { path: [...target.parentPath, formulaIndex + 1], offset: 0 },
|
|
61
|
+
},
|
|
62
|
+
addToHistory: true,
|
|
63
|
+
timestamp: context.now?.() ?? Date.now(),
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
export const deleteFormula = createDeleteInlineAtomCommand("formula.delete", "formula");
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SmartCommand } from "../command.js";
|
|
2
|
+
import { type Path, type SmartFormulaNode, type SmartInlineImageNode } from "../model.js";
|
|
3
|
+
export type SmartInlineAtom = SmartFormulaNode | SmartInlineImageNode;
|
|
4
|
+
export interface InlineAtomPathInput {
|
|
5
|
+
path: Path;
|
|
6
|
+
}
|
|
7
|
+
export declare const createDeleteInlineAtomCommand: (id: string, expectedType: SmartInlineAtom["type"]) => SmartCommand<InlineAtomPathInput>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { getNodeAtPath, } from "../model.js";
|
|
2
|
+
import { isSmartContainer } from "../tree.js";
|
|
3
|
+
const resolveAtom = (context, input, expectedType) => {
|
|
4
|
+
if (!input?.path.length)
|
|
5
|
+
return null;
|
|
6
|
+
const atom = getNodeAtPath(context.document, input.path);
|
|
7
|
+
const parentPath = input.path.slice(0, -1);
|
|
8
|
+
const parent = getNodeAtPath(context.document, parentPath);
|
|
9
|
+
const index = input.path[input.path.length - 1];
|
|
10
|
+
if (atom?.type !== expectedType ||
|
|
11
|
+
!isSmartContainer(parent) ||
|
|
12
|
+
!["paragraph", "heading"].includes(String(parent.type)) ||
|
|
13
|
+
parent.children[index] !== atom)
|
|
14
|
+
return null;
|
|
15
|
+
return { parent, parentPath, index };
|
|
16
|
+
};
|
|
17
|
+
export const createDeleteInlineAtomCommand = (id, expectedType) => ({
|
|
18
|
+
id,
|
|
19
|
+
isEnabled: (context, input) => Boolean(resolveAtom(context, input, expectedType)),
|
|
20
|
+
execute: (context, input) => {
|
|
21
|
+
const target = resolveAtom(context, input, expectedType);
|
|
22
|
+
if (!target)
|
|
23
|
+
throw new Error(`${id} requires a valid ${expectedType} path.`);
|
|
24
|
+
const children = target.parent.children.filter((_, index) => index !== target.index);
|
|
25
|
+
let caretIndex = target.index;
|
|
26
|
+
if (!children.length) {
|
|
27
|
+
children.push({ type: "text", text: "" });
|
|
28
|
+
caretIndex = 0;
|
|
29
|
+
}
|
|
30
|
+
else if (children[caretIndex]?.type !== "text") {
|
|
31
|
+
if (caretIndex > 0 && children[caretIndex - 1]?.type === "text") {
|
|
32
|
+
caretIndex -= 1;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
children.splice(caretIndex, 0, { type: "text", text: "" });
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const caret = children[caretIndex];
|
|
39
|
+
const offset = caret?.type === "text" && caretIndex < target.index ? caret.text.length : 0;
|
|
40
|
+
return {
|
|
41
|
+
id,
|
|
42
|
+
source: "user",
|
|
43
|
+
operations: [{
|
|
44
|
+
type: "replaceNode",
|
|
45
|
+
path: target.parentPath,
|
|
46
|
+
node: { ...target.parent, children },
|
|
47
|
+
}],
|
|
48
|
+
selectionBefore: context.selection,
|
|
49
|
+
selectionAfter: {
|
|
50
|
+
type: "text",
|
|
51
|
+
anchor: { path: [...target.parentPath, caretIndex], offset },
|
|
52
|
+
focus: { path: [...target.parentPath, caretIndex], offset },
|
|
53
|
+
},
|
|
54
|
+
addToHistory: true,
|
|
55
|
+
timestamp: context.now?.() ?? Date.now(),
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type Path, type LegacySmartDocument, type SmartListNode, type SmartListPreset } from "../model.js";
|
|
2
|
+
import type { SmartCommand } from "../command.js";
|
|
3
|
+
import type { LegacySmartSelection } from "../selection.js";
|
|
4
|
+
import type { LegacySmartTransaction } from "../transaction.js";
|
|
5
|
+
export type ListStyle = SmartListNode["style"];
|
|
6
|
+
export interface ToggleTableCellListInput {
|
|
7
|
+
tablePath: Path;
|
|
8
|
+
row: number;
|
|
9
|
+
column: number;
|
|
10
|
+
blockIndexes: readonly number[];
|
|
11
|
+
style: ListStyle;
|
|
12
|
+
preset?: SmartListPreset;
|
|
13
|
+
}
|
|
14
|
+
export interface CommandResult {
|
|
15
|
+
document: LegacySmartDocument;
|
|
16
|
+
transaction: LegacySmartTransaction;
|
|
17
|
+
}
|
|
18
|
+
export interface ToggleListInput {
|
|
19
|
+
style: ListStyle;
|
|
20
|
+
preset?: SmartListPreset;
|
|
21
|
+
/**
|
|
22
|
+
* Toolbar list buttons use `containing-list` semantics by default, matching
|
|
23
|
+
* document editors that change the whole list when selection is inside it.
|
|
24
|
+
* Contextual item tools may request an exact selected run instead.
|
|
25
|
+
*/
|
|
26
|
+
scope?: "containing-list" | "selected-items";
|
|
27
|
+
cascadeStyles?: boolean;
|
|
28
|
+
checklist?: boolean;
|
|
29
|
+
strikeCompleted?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare const toggleList: SmartCommand<ToggleListInput>;
|
|
32
|
+
export declare const indentListItems: SmartCommand<void>;
|
|
33
|
+
export declare const outdentListItems: SmartCommand<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Converts explicitly selected block nodes in one table cell into a single
|
|
36
|
+
* list. No DOM ranges, wrappers, or React state participate in this command.
|
|
37
|
+
*/
|
|
38
|
+
export declare const toggleTableCellList: (document: LegacySmartDocument, selection: LegacySmartSelection, input: ToggleTableCellListInput) => CommandResult;
|