@pixerate/editor 0.23.0 → 0.25.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/README.md +167 -2
- package/THIRD_PARTY_NOTICES.md +80 -0
- package/dist/agent/index.cjs +10 -8
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.d.cts +4 -3
- package/dist/agent/index.d.ts +4 -3
- package/dist/agent/index.js +4 -2
- package/dist/agent/index.js.map +1 -1
- package/dist/canvas/index.cjs +4437 -411
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +934 -4
- package/dist/canvas/index.d.ts +934 -4
- package/dist/canvas/index.js +4309 -283
- package/dist/canvas/index.js.map +1 -1
- package/dist/chunk-4BVP64JJ.cjs +1406 -0
- package/dist/chunk-4BVP64JJ.cjs.map +1 -0
- package/dist/chunk-664LQYFJ.js +115 -0
- package/dist/chunk-664LQYFJ.js.map +1 -0
- package/dist/chunk-7WISYZFO.cjs +740 -0
- package/dist/chunk-7WISYZFO.cjs.map +1 -0
- package/dist/chunk-AL6JMGWW.cjs +783 -0
- package/dist/chunk-AL6JMGWW.cjs.map +1 -0
- package/dist/chunk-BVP3TSLH.cjs +69 -0
- package/dist/chunk-BVP3TSLH.cjs.map +1 -0
- package/dist/{chunk-RIKBJLS2.cjs → chunk-C7P22VIP.cjs} +2001 -279
- package/dist/chunk-C7P22VIP.cjs.map +1 -0
- package/dist/chunk-D6FH2YAX.cjs +131 -0
- package/dist/chunk-D6FH2YAX.cjs.map +1 -0
- package/dist/chunk-ECCCYKGL.js +740 -0
- package/dist/chunk-ECCCYKGL.js.map +1 -0
- package/dist/{chunk-4SUNJZWB.cjs → chunk-FD4LPFAE.cjs} +48 -200
- package/dist/chunk-FD4LPFAE.cjs.map +1 -0
- package/dist/{chunk-QBJ22YZR.js → chunk-FH6F67DN.js} +1999 -277
- package/dist/chunk-FH6F67DN.js.map +1 -0
- package/dist/{chunk-OYXSKQFR.js → chunk-FPENXAEJ.js} +35 -187
- package/dist/chunk-FPENXAEJ.js.map +1 -0
- package/dist/chunk-HLIMTC6N.js +1 -0
- package/dist/chunk-HLIMTC6N.js.map +1 -0
- package/dist/chunk-HRMEDT2L.js +1406 -0
- package/dist/chunk-HRMEDT2L.js.map +1 -0
- package/dist/{chunk-QGHGJ56O.js → chunk-IXHSYOVY.js} +2518 -122
- package/dist/chunk-IXHSYOVY.js.map +1 -0
- package/dist/chunk-MKA3AHLV.cjs +256 -0
- package/dist/chunk-MKA3AHLV.cjs.map +1 -0
- package/dist/chunk-NAXVVS5I.js +783 -0
- package/dist/chunk-NAXVVS5I.js.map +1 -0
- package/dist/chunk-O5RYH2PG.js +69 -0
- package/dist/chunk-O5RYH2PG.js.map +1 -0
- package/dist/chunk-OXSV64JX.js +689 -0
- package/dist/chunk-OXSV64JX.js.map +1 -0
- package/dist/chunk-P3RQ5UJE.cjs +689 -0
- package/dist/chunk-P3RQ5UJE.cjs.map +1 -0
- package/dist/chunk-P6ODPZ4W.js +256 -0
- package/dist/chunk-P6ODPZ4W.js.map +1 -0
- package/dist/chunk-PL4JB3BF.cjs +1 -0
- package/dist/chunk-PL4JB3BF.cjs.map +1 -0
- package/dist/{chunk-GVSMRPHB.cjs → chunk-PO6A6QQH.cjs} +2607 -211
- package/dist/chunk-PO6A6QQH.cjs.map +1 -0
- package/dist/{chunk-JJDLPEWL.js → chunk-QGYDWPRM.js} +2 -2
- package/dist/chunk-RR7F5GUM.js +5726 -0
- package/dist/chunk-RR7F5GUM.js.map +1 -0
- package/dist/chunk-TNNJXF46.cjs +115 -0
- package/dist/chunk-TNNJXF46.cjs.map +1 -0
- package/dist/chunk-U5HZSFCS.js +131 -0
- package/dist/chunk-U5HZSFCS.js.map +1 -0
- package/dist/{chunk-MJZBNWG7.js → chunk-UAKDG62Z.js} +309 -581
- package/dist/chunk-UAKDG62Z.js.map +1 -0
- package/dist/{chunk-CL37JGFW.cjs → chunk-V3CHHWOE.cjs} +4 -4
- package/dist/{chunk-CL37JGFW.cjs.map → chunk-V3CHHWOE.cjs.map} +1 -1
- package/dist/chunk-WSQKHXW7.cjs +5726 -0
- package/dist/chunk-WSQKHXW7.cjs.map +1 -0
- package/dist/{chunk-AA4ZEVCC.cjs → chunk-X4N4WUKB.cjs} +336 -608
- package/dist/chunk-X4N4WUKB.cjs.map +1 -0
- package/dist/commands/index.cjs +74 -1
- package/dist/commands/index.cjs.map +1 -1
- package/dist/commands/index.d.cts +38 -353
- package/dist/commands/index.d.ts +38 -353
- package/dist/commands/index.js +73 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/comment-store-BEMgVlAA.d.cts +135 -0
- package/dist/comment-store-BEMgVlAA.d.ts +135 -0
- package/dist/compare/index.cjs +15 -0
- package/dist/compare/index.cjs.map +1 -0
- package/dist/compare/index.d.cts +58 -0
- package/dist/compare/index.d.ts +58 -0
- package/dist/compare/index.js +15 -0
- package/dist/compare/index.js.map +1 -0
- package/dist/controller-BIJiNoVs.d.cts +1842 -0
- package/dist/controller-BIJiNoVs.d.ts +1842 -0
- package/dist/documents-CHT1U5Vs.d.ts +86 -0
- package/dist/documents-Gp7wb0Me.d.cts +86 -0
- package/dist/extensions/index.cjs +100 -5
- package/dist/extensions/index.cjs.map +1 -1
- package/dist/extensions/index.d.cts +16 -4
- package/dist/extensions/index.d.ts +16 -4
- package/dist/extensions/index.js +100 -5
- package/dist/generation/index.cjs +2317 -0
- package/dist/generation/index.cjs.map +1 -0
- package/dist/generation/index.d.cts +1015 -0
- package/dist/generation/index.d.ts +1015 -0
- package/dist/generation/index.js +2317 -0
- package/dist/generation/index.js.map +1 -0
- package/dist/grammar/index.cjs +48 -3
- package/dist/grammar/index.cjs.map +1 -1
- package/dist/grammar/index.d.cts +322 -100
- package/dist/grammar/index.d.ts +322 -100
- package/dist/grammar/index.js +54 -9
- package/dist/image-editor/index.cjs +4392 -481
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +1249 -97
- package/dist/image-editor/index.d.ts +1249 -97
- package/dist/image-editor/index.js +4281 -370
- package/dist/image-editor/index.js.map +1 -1
- package/dist/index-7a6bHTLy.d.ts +1754 -0
- package/dist/index-Csd5qI8u.d.cts +1754 -0
- package/dist/index.cjs +1682 -99
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +118 -21
- package/dist/index.d.ts +118 -21
- package/dist/index.js +1630 -47
- package/dist/index.js.map +1 -1
- package/dist/mention-text-CDnCFd3c.d.cts +53 -0
- package/dist/mention-text-CDnCFd3c.d.ts +53 -0
- package/dist/migrate-iTlm3a8h.d.cts +112 -0
- package/dist/migrate-iTlm3a8h.d.ts +112 -0
- package/dist/model-C1zApQM8.d.cts +219 -0
- package/dist/model-C1zApQM8.d.ts +219 -0
- package/dist/persistence/index.cjs +676 -0
- package/dist/persistence/index.cjs.map +1 -0
- package/dist/persistence/index.d.cts +230 -0
- package/dist/persistence/index.d.ts +230 -0
- package/dist/persistence/index.js +676 -0
- package/dist/persistence/index.js.map +1 -0
- package/dist/{registry-D5-R90p0.d.cts → registry-BDe-vlv3.d.ts} +2 -40
- package/dist/{registry-GJI4gToU.d.ts → registry-CEgwXED1.d.cts} +12 -1
- package/dist/{registry-GJI4gToU.d.cts → registry-CEgwXED1.d.ts} +12 -1
- package/dist/registry-D32LpIc4.d.cts +354 -0
- package/dist/{registry-D5-R90p0.d.ts → registry-DnzpgY27.d.cts} +2 -40
- package/dist/registry-evKTP4ls.d.ts +354 -0
- package/dist/schema-DYDGdYL9.d.cts +41 -0
- package/dist/schema-DYDGdYL9.d.ts +41 -0
- package/dist/serializers/index.cjs +12 -3
- package/dist/serializers/index.cjs.map +1 -1
- package/dist/serializers/index.d.cts +40 -12
- package/dist/serializers/index.d.ts +40 -12
- package/dist/serializers/index.js +12 -3
- package/dist/sourcemap-C8AH3MBQ.d.cts +91 -0
- package/dist/sourcemap-DA1Evhrv.d.ts +91 -0
- package/dist/spreadsheet/index.cjs +161 -3
- package/dist/spreadsheet/index.cjs.map +1 -1
- package/dist/spreadsheet/index.d.cts +611 -20
- package/dist/spreadsheet/index.d.ts +611 -20
- package/dist/spreadsheet/index.js +168 -10
- package/dist/storage-BpFfspHm.d.cts +120 -0
- package/dist/storage-BpFfspHm.d.ts +120 -0
- package/dist/tokens/index.cjs +115 -0
- package/dist/tokens/index.cjs.map +1 -0
- package/dist/tokens/index.d.cts +212 -0
- package/dist/tokens/index.d.ts +212 -0
- package/dist/tokens/index.js +115 -0
- package/dist/tokens/index.js.map +1 -0
- package/dist/{tokens-CyLZmIei.d.cts → tokens-D7yXvUU6.d.cts} +15 -2
- package/dist/{tokens-CyLZmIei.d.ts → tokens-D7yXvUU6.d.ts} +15 -2
- package/dist/{track-changes-BSF58RK0.d.cts → track-changes-D_VAPELi.d.cts} +110 -144
- package/dist/{track-changes-BSF58RK0.d.ts → track-changes-Db_fGEvx.d.ts} +110 -144
- package/package.json +21 -1
- package/dist/chunk-4SUNJZWB.cjs.map +0 -1
- package/dist/chunk-AA4ZEVCC.cjs.map +0 -1
- package/dist/chunk-AXV2ZW34.cjs +0 -118
- package/dist/chunk-AXV2ZW34.cjs.map +0 -1
- package/dist/chunk-B2ZRLN4S.js +0 -118
- package/dist/chunk-B2ZRLN4S.js.map +0 -1
- package/dist/chunk-GVSMRPHB.cjs.map +0 -1
- package/dist/chunk-K3R5NG2D.js +0 -3100
- package/dist/chunk-K3R5NG2D.js.map +0 -1
- package/dist/chunk-MJZBNWG7.js.map +0 -1
- package/dist/chunk-OYXSKQFR.js.map +0 -1
- package/dist/chunk-QBJ22YZR.js.map +0 -1
- package/dist/chunk-QGHGJ56O.js.map +0 -1
- package/dist/chunk-RIKBJLS2.cjs.map +0 -1
- package/dist/chunk-XDMXXC4Z.cjs +0 -3100
- package/dist/chunk-XDMXXC4Z.cjs.map +0 -1
- package/dist/controller-pePCJLT1.d.cts +0 -959
- package/dist/controller-pePCJLT1.d.ts +0 -959
- package/dist/index-CCr_z9kF.d.cts +0 -899
- package/dist/index-Ck6ajwXh.d.ts +0 -899
- /package/dist/{chunk-JJDLPEWL.js.map → chunk-QGYDWPRM.js.map} +0 -0
|
@@ -0,0 +1,1754 @@
|
|
|
1
|
+
import { Mark, Extension, Node, Editor, Extensions } from '@tiptap/core';
|
|
2
|
+
import { C as ColorGradient, T as Template } from './tokens-D7yXvUU6.cjs';
|
|
3
|
+
import { EditorState, PluginKey, Transaction } from '@tiptap/pm/state';
|
|
4
|
+
import { DecorationSet, EditorView } from '@tiptap/pm/view';
|
|
5
|
+
import { Node as Node$1 } from '@tiptap/pm/model';
|
|
6
|
+
import * as _tiptap_extension_underline from '@tiptap/extension-underline';
|
|
7
|
+
import * as _tiptap_extension_text_style from '@tiptap/extension-text-style';
|
|
8
|
+
import * as _tiptap_extension_text_align from '@tiptap/extension-text-align';
|
|
9
|
+
import * as _tiptap_extension_task_list from '@tiptap/extension-task-list';
|
|
10
|
+
import * as _tiptap_extension_link from '@tiptap/extension-link';
|
|
11
|
+
import * as _tiptap_extension_image from '@tiptap/extension-image';
|
|
12
|
+
import { ImageOptions as ImageOptions$1 } from '@tiptap/extension-image';
|
|
13
|
+
import * as _tiptap_extension_highlight from '@tiptap/extension-highlight';
|
|
14
|
+
import * as _tiptap_extension_color from '@tiptap/extension-color';
|
|
15
|
+
import * as _tiptap_starter_kit from '@tiptap/starter-kit';
|
|
16
|
+
import { f as MentionOptions, h as TrackChangesOptions } from './track-changes-D_VAPELi.cjs';
|
|
17
|
+
import { MarkdownOptions } from 'tiptap-markdown';
|
|
18
|
+
import { R as ReviewAuthor, b as CommentStore, C as CommentAnchor } from './comment-store-BEMgVlAA.cjs';
|
|
19
|
+
import { b as ImportAdapter, I as ImportAdapterRegistry, c as FindImportAdapterQuery, i as ImportTarget, h as ImportInput, g as ImportFileOptions, a as ImportOutcome, R as RegisterImportAdapterOptions, F as FileLike } from './registry-CEgwXED1.cjs';
|
|
20
|
+
import { b as CompareSource, C as CompareDocumentsOptions, a as CompareDocumentsResult } from './documents-Gp7wb0Me.cjs';
|
|
21
|
+
import { c as CommandSpec } from './registry-D32LpIc4.cjs';
|
|
22
|
+
|
|
23
|
+
interface GradientTextOptions {
|
|
24
|
+
templateColorMap: Map<string, ColorGradient>;
|
|
25
|
+
speed?: number;
|
|
26
|
+
jsonVariables?: string[] | Set<string>;
|
|
27
|
+
onTemplateClick?: (templateName: string, event: MouseEvent) => void;
|
|
28
|
+
}
|
|
29
|
+
declare const GradientText: Mark<GradientTextOptions, any>;
|
|
30
|
+
|
|
31
|
+
interface SlashCommandMatchData {
|
|
32
|
+
match: RegExpMatchArray;
|
|
33
|
+
query: string;
|
|
34
|
+
from: number;
|
|
35
|
+
to: number;
|
|
36
|
+
coords: {
|
|
37
|
+
top: number;
|
|
38
|
+
left: number;
|
|
39
|
+
bottom: number;
|
|
40
|
+
right: number;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
interface SlashCommandsOptions {
|
|
44
|
+
trigger?: string;
|
|
45
|
+
onMatch?: (data: SlashCommandMatchData) => void;
|
|
46
|
+
onClear?: () => void;
|
|
47
|
+
containerId?: string;
|
|
48
|
+
}
|
|
49
|
+
declare const SlashCommands: Extension<SlashCommandsOptions, any>;
|
|
50
|
+
|
|
51
|
+
interface TemplateSuggestionsOptions {
|
|
52
|
+
templates: Template[];
|
|
53
|
+
char?: string;
|
|
54
|
+
onSuggestion?: (props: {
|
|
55
|
+
query: string;
|
|
56
|
+
range: {
|
|
57
|
+
from: number;
|
|
58
|
+
to: number;
|
|
59
|
+
};
|
|
60
|
+
clientRect?: (() => DOMRect | null) | null;
|
|
61
|
+
items: Template[];
|
|
62
|
+
command: (props: {
|
|
63
|
+
name: string;
|
|
64
|
+
}) => void;
|
|
65
|
+
}) => void;
|
|
66
|
+
}
|
|
67
|
+
declare const TemplateSuggestions: Extension<TemplateSuggestionsOptions, any>;
|
|
68
|
+
|
|
69
|
+
declare const LoadingNode: Node<any, any>;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Context passed to function replacements.
|
|
73
|
+
*/
|
|
74
|
+
interface AutocorrectContext {
|
|
75
|
+
/** Text of the current block before the caret, including the typed text. */
|
|
76
|
+
textBefore: string;
|
|
77
|
+
/** Returns true if `text` is in the exceptions list (case-insensitive). */
|
|
78
|
+
isException: (text: string) => boolean;
|
|
79
|
+
/** Editor state before the typed text was inserted. */
|
|
80
|
+
state: EditorState;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* An autocorrect rule. Rules are checked in order after every typed character
|
|
84
|
+
* against the text before the caret; the first one that produces a
|
|
85
|
+
* replacement wins.
|
|
86
|
+
*
|
|
87
|
+
* - `find: string` matches when the text before the caret ends with it.
|
|
88
|
+
* With `wholeWord: true` it must also be a whole word followed by a space or
|
|
89
|
+
* punctuation (Word's AutoCorrect entries, e.g. `teh ` -> `the `); the
|
|
90
|
+
* delimiter is kept.
|
|
91
|
+
* - `find: RegExp` must match at the end of the text (anchor it with `$`).
|
|
92
|
+
*
|
|
93
|
+
* `replace` replaces the whole match. A string is inserted literally (no `$1`
|
|
94
|
+
* patterns); use a function to reuse capture groups. Return `null` from a
|
|
95
|
+
* function to skip the correction.
|
|
96
|
+
*/
|
|
97
|
+
interface AutocorrectRule {
|
|
98
|
+
id: string;
|
|
99
|
+
find: string | RegExp;
|
|
100
|
+
replace: string | ((match: RegExpMatchArray, context: AutocorrectContext) => string | null | undefined);
|
|
101
|
+
wholeWord?: boolean;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* A correction that was applied.
|
|
105
|
+
*/
|
|
106
|
+
interface AutocorrectCorrection {
|
|
107
|
+
ruleId: string;
|
|
108
|
+
/** Document range of the replacement text after the correction. */
|
|
109
|
+
from: number;
|
|
110
|
+
to: number;
|
|
111
|
+
original: string;
|
|
112
|
+
replacement: string;
|
|
113
|
+
}
|
|
114
|
+
interface AutocorrectOptions {
|
|
115
|
+
/** Rules in priority order. Defaults to `defaultAutocorrectRules`. */
|
|
116
|
+
rules: AutocorrectRule[];
|
|
117
|
+
/**
|
|
118
|
+
* Exceptions (Word's AutoCorrect exceptions). Matched case-insensitively.
|
|
119
|
+
* - Abbreviations ending in `.` (e.g. `e.g.`) do not end a sentence, so the
|
|
120
|
+
* next word is not capitalized.
|
|
121
|
+
* - Words like `IDs` are not "fixed" by the two-initial-capitals rule.
|
|
122
|
+
* - Any other entry is text that should never be corrected (the matched
|
|
123
|
+
* text, e.g. `(c)` or `teh`).
|
|
124
|
+
*/
|
|
125
|
+
exceptions: string[];
|
|
126
|
+
/** Node types in which nothing is corrected (plus any node with `code: true`). */
|
|
127
|
+
ignoreNodes: string[];
|
|
128
|
+
/** Mark types in which nothing is corrected (plus any mark with `code: true`). */
|
|
129
|
+
ignoreMarks: string[];
|
|
130
|
+
/** Skip corrections inside `{{template}}`, `{variable}` and `__instruction__` tokens. */
|
|
131
|
+
ignorePromptTokens: boolean;
|
|
132
|
+
/** Called after each correction. */
|
|
133
|
+
onCorrection?: (correction: AutocorrectCorrection) => void;
|
|
134
|
+
}
|
|
135
|
+
interface AutocorrectStorage {
|
|
136
|
+
/** Whether corrections are applied. Toggle with `setAutocorrectEnabled`. */
|
|
137
|
+
enabled: boolean;
|
|
138
|
+
/** Live exceptions set (lowercased). Edit with the exception commands. */
|
|
139
|
+
exceptions: Set<string>;
|
|
140
|
+
}
|
|
141
|
+
declare module "@tiptap/core" {
|
|
142
|
+
interface Commands<ReturnType> {
|
|
143
|
+
autocorrect: {
|
|
144
|
+
/** Reverts the last correction if nothing else has changed since. */
|
|
145
|
+
undoAutocorrect: () => ReturnType;
|
|
146
|
+
/** Enables or disables autocorrect. */
|
|
147
|
+
setAutocorrectEnabled: (enabled: boolean) => ReturnType;
|
|
148
|
+
/** Adds an entry to the exceptions list. */
|
|
149
|
+
addAutocorrectException: (text: string) => ReturnType;
|
|
150
|
+
/** Removes an entry from the exceptions list. */
|
|
151
|
+
removeAutocorrectException: (text: string) => ReturnType;
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/** Smart (curly) quotes and apostrophes. */
|
|
156
|
+
declare const smartQuoteRules: AutocorrectRule[];
|
|
157
|
+
/** Symbols: em dash, ellipsis, arrows, copyright, registered, trademark. */
|
|
158
|
+
declare const symbolRules: AutocorrectRule[];
|
|
159
|
+
/** Fractions (`1/2`, `1/4`, `3/4`), corrected once the number is complete. */
|
|
160
|
+
declare const fractionRules: AutocorrectRule[];
|
|
161
|
+
/**
|
|
162
|
+
* Capitalizes the first letter of a sentence when the word is completed.
|
|
163
|
+
* Abbreviations in the exceptions list (and single-letter initials such as
|
|
164
|
+
* `J.`) do not end a sentence.
|
|
165
|
+
*/
|
|
166
|
+
declare const capitalizeSentenceRules: AutocorrectRule[];
|
|
167
|
+
/** Fixes TWo INitial CApitals (`THe ` -> `The `), unless the word is an exception. */
|
|
168
|
+
declare const twoInitialCapitalsRules: AutocorrectRule[];
|
|
169
|
+
/**
|
|
170
|
+
* The default rule set: smart quotes, symbols, fractions, sentence
|
|
171
|
+
* capitalization and two-initial-capitals.
|
|
172
|
+
*/
|
|
173
|
+
declare const defaultAutocorrectRules: AutocorrectRule[];
|
|
174
|
+
/** Default exceptions: common abbreviations and two-capital words. */
|
|
175
|
+
declare const DEFAULT_AUTOCORRECT_EXCEPTIONS: string[];
|
|
176
|
+
declare const autocorrectPluginKey: PluginKey<AutocorrectPluginState>;
|
|
177
|
+
interface AutocorrectPluginState {
|
|
178
|
+
last: AutocorrectCorrection | null;
|
|
179
|
+
/** The next typed text should start a new undo group. */
|
|
180
|
+
closePending: boolean;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Finds the first matching rule for `textBefore`. Exported for testing and for
|
|
184
|
+
* custom input pipelines.
|
|
185
|
+
*/
|
|
186
|
+
declare function findAutocorrection(textBefore: string, rules: readonly AutocorrectRule[], context: Omit<AutocorrectContext, "textBefore">): {
|
|
187
|
+
ruleId: string;
|
|
188
|
+
start: number;
|
|
189
|
+
original: string;
|
|
190
|
+
replacement: string;
|
|
191
|
+
} | null;
|
|
192
|
+
/**
|
|
193
|
+
* True when the end of `textBefore` is inside an unclosed prompt token:
|
|
194
|
+
* `{{template`, `{variable` or `__instruction`.
|
|
195
|
+
*/
|
|
196
|
+
declare function isInsidePromptToken(textBefore: string): boolean;
|
|
197
|
+
/**
|
|
198
|
+
* Word-style AutoCorrect with a configurable rule registry and exceptions
|
|
199
|
+
* list. Each correction is its own undo step: undo (Mod-z) right after a
|
|
200
|
+
* correction restores exactly what was typed. Corrections never apply inside
|
|
201
|
+
* code blocks, inline code or (by default) prompt tokens.
|
|
202
|
+
*
|
|
203
|
+
* Do not combine with `@tiptap/extension-typography`: TipTap's input rules
|
|
204
|
+
* run first and would pre-empt the overlapping rules. `createRichTextPreset`
|
|
205
|
+
* drops Typography when `autocorrect` is enabled.
|
|
206
|
+
*/
|
|
207
|
+
declare const Autocorrect: Extension<AutocorrectOptions, AutocorrectStorage>;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Smilie patterns (each ending in a typed space) and their replacements.
|
|
211
|
+
* Longer patterns come first so they win over their prefixes.
|
|
212
|
+
*/
|
|
213
|
+
declare const SMILIE_REPLACEMENTS: ReadonlyArray<readonly [RegExp, string]>;
|
|
214
|
+
/**
|
|
215
|
+
* The smilies as `Autocorrect` rules. Straight apostrophes in the patterns
|
|
216
|
+
* also match curly `‘` and `’`, because the smart-quote rule converts `'` as soon as
|
|
217
|
+
* it is typed.
|
|
218
|
+
*/
|
|
219
|
+
declare const smilieAutocorrectRules: AutocorrectRule[];
|
|
220
|
+
declare const SmilieReplacer: Extension<any, any>;
|
|
221
|
+
|
|
222
|
+
declare function findHexColors(doc: Node$1): DecorationSet;
|
|
223
|
+
declare const ColorHighlighter: Extension<any, any>;
|
|
224
|
+
|
|
225
|
+
declare module "@tiptap/core" {
|
|
226
|
+
interface Commands<ReturnType> {
|
|
227
|
+
fontSize: {
|
|
228
|
+
setFontSize: (size: string) => ReturnType;
|
|
229
|
+
unsetFontSize: () => ReturnType;
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
declare const FontSize: Extension<any, any>;
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Built-in native Markdown extension for @pixerate/editor based on tiptap-markdown.
|
|
237
|
+
* Enables automatic markdown parsing, serialization, and clipboard handling.
|
|
238
|
+
*/
|
|
239
|
+
declare const Markdown: any;
|
|
240
|
+
|
|
241
|
+
interface ImageOptions extends Partial<ImageOptions$1> {
|
|
242
|
+
/**
|
|
243
|
+
* Custom upload handler called when an image is pasted or dropped.
|
|
244
|
+
* Resolves to the uploaded image URL string.
|
|
245
|
+
*/
|
|
246
|
+
upload?: (file: File) => Promise<string> | string;
|
|
247
|
+
/**
|
|
248
|
+
* Callback invoked if the upload handler throws or rejects, or if an image
|
|
249
|
+
* exceeds maxBase64Size when no upload handler is configured.
|
|
250
|
+
*/
|
|
251
|
+
onUploadError?: (error: Error, file: File) => void;
|
|
252
|
+
/**
|
|
253
|
+
* Maximum allowed file size (in bytes) when embedding images as base64 data URLs
|
|
254
|
+
* without an upload handler. Defaults to 65536 (64 KB).
|
|
255
|
+
* Files larger than this will be rejected to avoid memory bloat and prompt/stream saturation.
|
|
256
|
+
*/
|
|
257
|
+
maxBase64Size?: number;
|
|
258
|
+
/**
|
|
259
|
+
* Whether to enable automatic image pasting from clipboard. Defaults to true.
|
|
260
|
+
*/
|
|
261
|
+
enablePaste?: boolean;
|
|
262
|
+
/**
|
|
263
|
+
* Whether to enable automatic image drop. Defaults to true.
|
|
264
|
+
*/
|
|
265
|
+
enableDrop?: boolean;
|
|
266
|
+
}
|
|
267
|
+
declare const imagePastePluginKey: PluginKey<any>;
|
|
268
|
+
/**
|
|
269
|
+
* Inserts an image node into the editor view at the current selection.
|
|
270
|
+
*/
|
|
271
|
+
declare function insertImageNode(view: any, src: string, alt?: string): void;
|
|
272
|
+
/**
|
|
273
|
+
* Updates an existing image node's src attribute across document positions.
|
|
274
|
+
*/
|
|
275
|
+
declare function updateImageSrc(view: any, oldSrc: string, newSrc: string): void;
|
|
276
|
+
/**
|
|
277
|
+
* Removes an existing image node matching src attribute across document positions.
|
|
278
|
+
*/
|
|
279
|
+
declare function removeImageNode(view: any, src: string): void;
|
|
280
|
+
/**
|
|
281
|
+
* Handles inserting a pasted or dropped image file, supporting both async upload
|
|
282
|
+
* handlers and direct base64/object-URL fallbacks.
|
|
283
|
+
*/
|
|
284
|
+
declare function handleImageInsertion(view: any, file: File, options: ImageOptions): void;
|
|
285
|
+
declare const Image: any;
|
|
286
|
+
|
|
287
|
+
interface CommentsOptions {
|
|
288
|
+
/**
|
|
289
|
+
* The store holding the threads. Pass your own to share it with UI or to
|
|
290
|
+
* persist it; otherwise one is created and exposed as
|
|
291
|
+
* `editor.storage.comment.store`.
|
|
292
|
+
*/
|
|
293
|
+
store: CommentStore | null;
|
|
294
|
+
/** The current user, used as author of new comments. */
|
|
295
|
+
author: ReviewAuthor | (() => ReviewAuthor);
|
|
296
|
+
HTMLAttributes: Record<string, any>;
|
|
297
|
+
/** Class for unresolved comment ranges (applied as a decoration). */
|
|
298
|
+
commentClass: string;
|
|
299
|
+
/** Extra class for the active thread's range. */
|
|
300
|
+
activeClass: string;
|
|
301
|
+
/** Class for resolved comment ranges. Empty hides them. */
|
|
302
|
+
resolvedClass: string;
|
|
303
|
+
/** Make the thread under the caret active when the selection moves. */
|
|
304
|
+
activateOnSelection: boolean;
|
|
305
|
+
}
|
|
306
|
+
interface CommentsStorage {
|
|
307
|
+
store: CommentStore;
|
|
308
|
+
}
|
|
309
|
+
interface AddCommentOptions {
|
|
310
|
+
body?: string;
|
|
311
|
+
id?: string;
|
|
312
|
+
author?: ReviewAuthor;
|
|
313
|
+
}
|
|
314
|
+
interface CommentRange {
|
|
315
|
+
from: number;
|
|
316
|
+
to: number;
|
|
317
|
+
}
|
|
318
|
+
declare module "@tiptap/core" {
|
|
319
|
+
interface Commands<ReturnType> {
|
|
320
|
+
comment: {
|
|
321
|
+
/**
|
|
322
|
+
* Adds a comment thread on the current (non-empty) selection. The new
|
|
323
|
+
* thread becomes active. An empty `body` creates a draft for the UI to
|
|
324
|
+
* fill in.
|
|
325
|
+
*/
|
|
326
|
+
addComment: (options?: AddCommentOptions) => ReturnType;
|
|
327
|
+
/** Resolves (or re-opens with `false`) a thread. */
|
|
328
|
+
resolveComment: (id: string, resolved?: boolean) => ReturnType;
|
|
329
|
+
/** Removes the thread's mark from the document and deletes the thread. */
|
|
330
|
+
deleteComment: (id: string) => ReturnType;
|
|
331
|
+
setActiveComment: (id: string | null) => ReturnType;
|
|
332
|
+
/** Selects the thread's text, scrolls to it and makes it active. */
|
|
333
|
+
focusComment: (id: string) => ReturnType;
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
declare const commentsPluginKey: PluginKey<any>;
|
|
338
|
+
declare const COMMENT_MARK_NAME = "comment";
|
|
339
|
+
/**
|
|
340
|
+
* Returns every range covered by a `comment` mark, grouped by thread id and
|
|
341
|
+
* merged where contiguous, in document order.
|
|
342
|
+
*/
|
|
343
|
+
declare function findCommentRanges(doc: Node$1): Map<string, CommentRange[]>;
|
|
344
|
+
/**
|
|
345
|
+
* Computes one anchor per thread (spanning all of its ranges) from the document.
|
|
346
|
+
*/
|
|
347
|
+
declare function getCommentAnchors(doc: Node$1): Map<string, CommentAnchor>;
|
|
348
|
+
/** Thread ids of the comment marks at a position (caret or selection start). */
|
|
349
|
+
declare function getCommentIdsAt(state: EditorState, pos?: number): string[];
|
|
350
|
+
/** Returns the comment store of an editor using the `Comments` extension. */
|
|
351
|
+
declare function getCommentStore(editor: Editor | null | undefined): CommentStore | null;
|
|
352
|
+
/**
|
|
353
|
+
* Comment threads anchored to text with a `comment` mark. Thread content
|
|
354
|
+
* (bodies, replies, resolved state) lives in a headless `CommentStore`; the
|
|
355
|
+
* document only stores thread ids, so overlapping comments are allowed.
|
|
356
|
+
*
|
|
357
|
+
* Threads whose text is deleted are flagged `orphaned` (not removed), so
|
|
358
|
+
* undoing the deletion re-attaches them.
|
|
359
|
+
*/
|
|
360
|
+
declare const Comments: Mark<CommentsOptions, CommentsStorage>;
|
|
361
|
+
/** The current author configured on an editor's `Comments` extension. */
|
|
362
|
+
declare function getCommentAuthor(editor: Editor | null | undefined): ReviewAuthor | null;
|
|
363
|
+
|
|
364
|
+
/** A positioned piece of text, e.g. a pdf.js text item. */
|
|
365
|
+
interface PdfTextRun {
|
|
366
|
+
text: string;
|
|
367
|
+
/** Left edge (points). */
|
|
368
|
+
x: number;
|
|
369
|
+
/** Baseline, y up (points). */
|
|
370
|
+
y: number;
|
|
371
|
+
/** Advance width (points). Estimated from the text length when missing. */
|
|
372
|
+
width?: number;
|
|
373
|
+
/** Font size (points). Falls back to `height`, then 10. */
|
|
374
|
+
fontSize?: number;
|
|
375
|
+
height?: number;
|
|
376
|
+
/** Font name; `Bold` / `Italic` / `Oblique` in it set the style when `bold` / `italic` are absent. */
|
|
377
|
+
fontName?: string;
|
|
378
|
+
bold?: boolean;
|
|
379
|
+
italic?: boolean;
|
|
380
|
+
}
|
|
381
|
+
/** A stroked line or thin filled rectangle on a page (table rules). */
|
|
382
|
+
interface PdfRuleLine {
|
|
383
|
+
x1: number;
|
|
384
|
+
y1: number;
|
|
385
|
+
x2: number;
|
|
386
|
+
y2: number;
|
|
387
|
+
}
|
|
388
|
+
interface PdfLayoutPage {
|
|
389
|
+
runs: readonly PdfTextRun[];
|
|
390
|
+
/** Ruling lines, when the extractor can read the page's vector graphics. */
|
|
391
|
+
rules?: readonly PdfRuleLine[];
|
|
392
|
+
}
|
|
393
|
+
interface PdfLayoutOptions {
|
|
394
|
+
/**
|
|
395
|
+
* A baseline gap larger than this multiple of the typical line pitch starts
|
|
396
|
+
* a new paragraph (default `1.4`).
|
|
397
|
+
*/
|
|
398
|
+
paragraphGap?: number;
|
|
399
|
+
/** Remove running headers, footers and page numbers repeated across pages (default `true`). */
|
|
400
|
+
removeHeadersAndFooters?: boolean;
|
|
401
|
+
/** Read multi-column pages column by column (default `true`). */
|
|
402
|
+
detectColumns?: boolean;
|
|
403
|
+
/** Detect headings from font size and weight (default `true`). */
|
|
404
|
+
detectHeadings?: boolean;
|
|
405
|
+
/** Detect bulleted and numbered lists (default `true`). */
|
|
406
|
+
detectLists?: boolean;
|
|
407
|
+
/** Detect tables from ruling lines and aligned columns (default `true`). */
|
|
408
|
+
detectTables?: boolean;
|
|
409
|
+
/** Re-join words hyphenated across line ends (default `true`). */
|
|
410
|
+
dehyphenate?: boolean;
|
|
411
|
+
}
|
|
412
|
+
interface PdfTableCell {
|
|
413
|
+
text: string;
|
|
414
|
+
colSpan: number;
|
|
415
|
+
rowSpan: number;
|
|
416
|
+
header: boolean;
|
|
417
|
+
}
|
|
418
|
+
type PdfLayoutBlock = {
|
|
419
|
+
type: "heading";
|
|
420
|
+
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
421
|
+
text: string;
|
|
422
|
+
page: number;
|
|
423
|
+
confidence: number;
|
|
424
|
+
} | {
|
|
425
|
+
type: "paragraph";
|
|
426
|
+
text: string;
|
|
427
|
+
page: number;
|
|
428
|
+
} | {
|
|
429
|
+
type: "list";
|
|
430
|
+
page: number;
|
|
431
|
+
confidence: number;
|
|
432
|
+
/** Items in order; `depth` 0 is the outermost level and grows by at most one per item. */
|
|
433
|
+
items: {
|
|
434
|
+
text: string;
|
|
435
|
+
depth: number;
|
|
436
|
+
ordered: boolean;
|
|
437
|
+
start?: number;
|
|
438
|
+
}[];
|
|
439
|
+
} | {
|
|
440
|
+
type: "table";
|
|
441
|
+
page: number;
|
|
442
|
+
confidence: number;
|
|
443
|
+
/** `true` when the grid came from ruling lines. */
|
|
444
|
+
ruled: boolean;
|
|
445
|
+
/** Rows of cells; cells covered by a span are left out. */
|
|
446
|
+
rows: PdfTableCell[][];
|
|
447
|
+
columns: number;
|
|
448
|
+
headerRows: number;
|
|
449
|
+
};
|
|
450
|
+
/** One detected structure, for import reports. */
|
|
451
|
+
interface ImportStructureItem {
|
|
452
|
+
type: "heading" | "list" | "table" | "columns";
|
|
453
|
+
/** 1-based page. */
|
|
454
|
+
page: number;
|
|
455
|
+
/** 0–1. */
|
|
456
|
+
confidence: number;
|
|
457
|
+
/** Short human-readable description, e.g. `H2 "Results"` or `3×4 table`. */
|
|
458
|
+
detail: string;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* What a structure-aware importer recognised. Adapters attach it to
|
|
462
|
+
* `DocumentImport.structure`; `summarizeImportStructure` aggregates it.
|
|
463
|
+
*/
|
|
464
|
+
interface ImportStructureReport {
|
|
465
|
+
/** `"plain"` when structure detection was off (paragraphs only). */
|
|
466
|
+
mode: "structured" | "plain";
|
|
467
|
+
counts: {
|
|
468
|
+
headings: number;
|
|
469
|
+
lists: number;
|
|
470
|
+
tables: number;
|
|
471
|
+
paragraphs: number;
|
|
472
|
+
};
|
|
473
|
+
/** Pages read as several columns. */
|
|
474
|
+
multiColumnPages: number;
|
|
475
|
+
/** Mean confidence of the detected structures (1 when nothing was detected). */
|
|
476
|
+
confidence: number;
|
|
477
|
+
items: ImportStructureItem[];
|
|
478
|
+
}
|
|
479
|
+
interface PdfStructureReport extends ImportStructureReport {
|
|
480
|
+
pages: number;
|
|
481
|
+
removed: {
|
|
482
|
+
headers: number;
|
|
483
|
+
footers: number;
|
|
484
|
+
pageNumbers: number;
|
|
485
|
+
};
|
|
486
|
+
/** Words re-joined across a line-end hyphen. */
|
|
487
|
+
dehyphenated: number;
|
|
488
|
+
}
|
|
489
|
+
interface PdfLayoutResult {
|
|
490
|
+
blocks: PdfLayoutBlock[];
|
|
491
|
+
report: PdfStructureReport;
|
|
492
|
+
}
|
|
493
|
+
/**
|
|
494
|
+
* Analyses positioned text runs (one entry per page) and returns blocks in
|
|
495
|
+
* reading order plus a report of what was detected.
|
|
496
|
+
*/
|
|
497
|
+
declare function analyzePdfLayout(pages: readonly PdfLayoutPage[], options?: PdfLayoutOptions): PdfLayoutResult;
|
|
498
|
+
/** Renders layout blocks as editor HTML (`h1`–`h6`, `p`, `ul`/`ol`, `table`). Text is escaped. */
|
|
499
|
+
declare function pdfLayoutBlocksToHtml(blocks: readonly PdfLayoutBlock[]): string;
|
|
500
|
+
|
|
501
|
+
/** Result of every `document` adapter: sanitized TipTap HTML plus plain text. */
|
|
502
|
+
interface DocumentImport {
|
|
503
|
+
/** Sanitized HTML ready for `setContent` / `insertContent`. */
|
|
504
|
+
html: string;
|
|
505
|
+
/** Plain-text version, used by plain-text (prompt) editors. */
|
|
506
|
+
text: string;
|
|
507
|
+
/**
|
|
508
|
+
* What a structure-aware importer recognised (headings, lists, tables,
|
|
509
|
+
* columns) with confidences; set by the PDF adapter.
|
|
510
|
+
*/
|
|
511
|
+
structure?: ImportStructureReport;
|
|
512
|
+
}
|
|
513
|
+
type DocumentImportAdapter = ImportAdapter<DocumentImport>;
|
|
514
|
+
/**
|
|
515
|
+
* Markdown files. Rendered with the same sanitizing pipeline as
|
|
516
|
+
* `markdownToTipTapHtml`. `.txt` is deliberately left to the plain-text
|
|
517
|
+
* adapter so ordinary text files are not reinterpreted as markdown; `.md.txt`
|
|
518
|
+
* still matches here because the longest extension wins.
|
|
519
|
+
*/
|
|
520
|
+
declare const markdownImportAdapter: DocumentImportAdapter;
|
|
521
|
+
/** HTML files and fragments, sanitized with `sanitizeImportedHtml`. */
|
|
522
|
+
declare const htmlImportAdapter: DocumentImportAdapter;
|
|
523
|
+
/** Plain text: one paragraph per line, always escaped. */
|
|
524
|
+
declare const plainTextImportAdapter: DocumentImportAdapter;
|
|
525
|
+
/**
|
|
526
|
+
* RTF: best-effort text extraction with `rtfToPlainText` (paragraphs and
|
|
527
|
+
* characters only; formatting, tables and images are dropped).
|
|
528
|
+
*/
|
|
529
|
+
declare const rtfImportAdapter: DocumentImportAdapter;
|
|
530
|
+
declare const BUILT_IN_IMPORT_ADAPTERS: readonly DocumentImportAdapter[];
|
|
531
|
+
interface CreateImportAdapterRegistryOptions {
|
|
532
|
+
/** Register the built-in document adapters (default `true`). */
|
|
533
|
+
builtIns?: boolean;
|
|
534
|
+
}
|
|
535
|
+
declare function createImportAdapterRegistry(options?: CreateImportAdapterRegistryOptions): ImportAdapterRegistry;
|
|
536
|
+
/** Shared registry used by the module-level helpers and editor integrations. */
|
|
537
|
+
declare const defaultImportRegistry: ImportAdapterRegistry;
|
|
538
|
+
/** Registers an adapter on the default registry; returns an unregister function. */
|
|
539
|
+
declare function registerImportAdapter<TResult>(adapter: ImportAdapter<TResult>, options?: RegisterImportAdapterOptions): () => void;
|
|
540
|
+
declare function unregisterImportAdapter(adapterOrId: string | ImportAdapter<any>): boolean;
|
|
541
|
+
declare function findImportAdapter(query: FindImportAdapterQuery): ImportAdapter | undefined;
|
|
542
|
+
/** Imports a file with the default registry. */
|
|
543
|
+
declare function importFile<TResult = unknown>(input: ImportInput, options?: ImportFileOptions): Promise<ImportOutcome<TResult>>;
|
|
544
|
+
/** `accept` attribute value for the default registry. */
|
|
545
|
+
declare function getImportAccept(target?: ImportTarget): string;
|
|
546
|
+
|
|
547
|
+
interface FileImportOptions {
|
|
548
|
+
/** Registry used to match files (default: the shared default registry). */
|
|
549
|
+
registry?: ImportAdapterRegistry;
|
|
550
|
+
/** Per-adapter options keyed by adapter id, e.g. `{ pdf: { structure: false } }`. */
|
|
551
|
+
adapterOptions?: Record<string, unknown>;
|
|
552
|
+
/** Insert extracted plain text instead of HTML (plain-text / prompt editors). */
|
|
553
|
+
asPlainText?: boolean;
|
|
554
|
+
/** Import files dropped onto the editor (default `true`). */
|
|
555
|
+
enableDrop?: boolean;
|
|
556
|
+
/** Import files pasted into the editor, e.g. copied in a file manager (default `true`). */
|
|
557
|
+
enablePaste?: boolean;
|
|
558
|
+
/** Called after each imported file has been inserted. */
|
|
559
|
+
onImport?: (outcome: ImportOutcome<DocumentImport>, file: FileLike) => void;
|
|
560
|
+
/** Called when a file fails to import. */
|
|
561
|
+
onImportError?: (error: Error, file: FileLike) => void;
|
|
562
|
+
}
|
|
563
|
+
declare const fileImportPluginKey: PluginKey<any>;
|
|
564
|
+
/**
|
|
565
|
+
* Imports files dropped or pasted into the editor through the import adapter
|
|
566
|
+
* registry (markdown, HTML, plain text and RTF by default) and inserts the
|
|
567
|
+
* converted content at the drop position or selection.
|
|
568
|
+
*
|
|
569
|
+
* Opt-in: add it to `extensions` or pass `fileImport: true` to
|
|
570
|
+
* `createRichTextPreset`. Only drops where every file has a `document`
|
|
571
|
+
* adapter are handled; anything else (e.g. images) falls through.
|
|
572
|
+
*/
|
|
573
|
+
declare const FileImport: Extension<FileImportOptions, any>;
|
|
574
|
+
|
|
575
|
+
interface RichClipboardOptions {
|
|
576
|
+
/** MIME type for the slice JSON (default `application/x.pixerate.document+json`). */
|
|
577
|
+
mimeType?: string;
|
|
578
|
+
/**
|
|
579
|
+
* Never paste the rich payload; leave paste to the existing plain-text
|
|
580
|
+
* handling. `EditorController` sets this automatically in `plainTextMode`.
|
|
581
|
+
*/
|
|
582
|
+
plainTextMode?: boolean;
|
|
583
|
+
}
|
|
584
|
+
interface RichClipboardStorage {
|
|
585
|
+
plainTextMode: boolean;
|
|
586
|
+
}
|
|
587
|
+
declare const richClipboardPluginKey: PluginKey<any>;
|
|
588
|
+
/**
|
|
589
|
+
* Writes the selection to the clipboard event as HTML, plain text and the
|
|
590
|
+
* custom slice JSON. Mirrors ProseMirror's own copy handler (which would
|
|
591
|
+
* otherwise clear the extra MIME type) and returns `false` when the event has
|
|
592
|
+
* no writable clipboard data, so ProseMirror's handler runs instead.
|
|
593
|
+
*/
|
|
594
|
+
declare function writeRichClipboard(view: EditorView, event: ClipboardEvent, options?: {
|
|
595
|
+
cut?: boolean;
|
|
596
|
+
mimeType?: string;
|
|
597
|
+
}): boolean;
|
|
598
|
+
/**
|
|
599
|
+
* Internal rich-text clipboard. On copy/cut it also writes the selection as a
|
|
600
|
+
* ProseMirror slice under `application/x.pixerate.document+json` together
|
|
601
|
+
* with the schema signature; on paste it prefers that payload when the
|
|
602
|
+
* signature matches the target editor and otherwise falls back to the normal
|
|
603
|
+
* HTML / plain-text handling.
|
|
604
|
+
*
|
|
605
|
+
* Opt-in: add it to `extensions` or pass `richClipboard: true` to
|
|
606
|
+
* `createRichTextPreset`.
|
|
607
|
+
*/
|
|
608
|
+
declare const RichClipboard: Extension<RichClipboardOptions, RichClipboardStorage>;
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* A heading in the document outline, in document order.
|
|
612
|
+
*/
|
|
613
|
+
interface OutlineHeading {
|
|
614
|
+
/** Stable id stored on the heading node (`id` attribute). */
|
|
615
|
+
id: string;
|
|
616
|
+
/** Heading level (1-6). */
|
|
617
|
+
level: number;
|
|
618
|
+
/** Plain text of the heading. */
|
|
619
|
+
text: string;
|
|
620
|
+
/** Position of the heading node in the current document. */
|
|
621
|
+
pos: number;
|
|
622
|
+
/** Index of the heading in the outline. */
|
|
623
|
+
index: number;
|
|
624
|
+
/**
|
|
625
|
+
* Nesting depth (0-based) relative to the enclosing headings, so skipped
|
|
626
|
+
* levels (an h1 followed directly by an h3) only indent one step.
|
|
627
|
+
*/
|
|
628
|
+
depth: number;
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* A heading with its nested sub-headings.
|
|
632
|
+
*/
|
|
633
|
+
interface OutlineTreeItem extends OutlineHeading {
|
|
634
|
+
children: OutlineTreeItem[];
|
|
635
|
+
}
|
|
636
|
+
interface OutlineOptions {
|
|
637
|
+
/** Node types treated as headings. Defaults to `["heading"]`. */
|
|
638
|
+
types: string[];
|
|
639
|
+
/** Generates ids for headings that have none. */
|
|
640
|
+
generateId: () => string;
|
|
641
|
+
/** Called with the new outline whenever it changes. */
|
|
642
|
+
onUpdate?: (headings: OutlineHeading[]) => void;
|
|
643
|
+
}
|
|
644
|
+
interface OutlineStorage {
|
|
645
|
+
/** The latest outline. Prefer `getOutline(editor)` for a fresh read. */
|
|
646
|
+
headings: OutlineHeading[];
|
|
647
|
+
}
|
|
648
|
+
interface FocusHeadingOptions {
|
|
649
|
+
/** Scroll behaviour for the heading's DOM node. Defaults to `"smooth"`. */
|
|
650
|
+
behavior?: ScrollBehavior;
|
|
651
|
+
/** Whether to focus the editor and place the caret in the heading. Defaults to `true`. */
|
|
652
|
+
focus?: boolean;
|
|
653
|
+
}
|
|
654
|
+
declare module "@tiptap/core" {
|
|
655
|
+
interface Commands<ReturnType> {
|
|
656
|
+
outline: {
|
|
657
|
+
/** Places the caret at the start of a heading, focuses and scrolls to it. */
|
|
658
|
+
focusHeading: (id: string, options?: FocusHeadingOptions) => ReturnType;
|
|
659
|
+
/** Scrolls a heading into view without moving the selection. */
|
|
660
|
+
scrollToHeading: (id: string, options?: Omit<FocusHeadingOptions, "focus">) => ReturnType;
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
declare const outlinePluginKey: PluginKey<OutlineHeading[]>;
|
|
665
|
+
/**
|
|
666
|
+
* Derives the heading outline from a document. Only block nodes are visited
|
|
667
|
+
* (headings cannot nest inside text), so the cost is proportional to the number
|
|
668
|
+
* of blocks, not characters.
|
|
669
|
+
*/
|
|
670
|
+
declare function computeOutline(doc: Node$1, types?: readonly string[]): OutlineHeading[];
|
|
671
|
+
/**
|
|
672
|
+
* Nests a flat outline into a tree by heading level.
|
|
673
|
+
*/
|
|
674
|
+
declare function buildOutlineTree(headings: readonly OutlineHeading[]): OutlineTreeItem[];
|
|
675
|
+
/**
|
|
676
|
+
* Returns the outline of an editor state. Uses the Outline plugin's cached
|
|
677
|
+
* outline when the extension is installed, otherwise computes it.
|
|
678
|
+
*/
|
|
679
|
+
declare function getOutline(editorOrState: Editor | EditorState): OutlineHeading[];
|
|
680
|
+
/**
|
|
681
|
+
* Returns the heading whose section contains the selection head: the last
|
|
682
|
+
* heading starting at or before it.
|
|
683
|
+
*/
|
|
684
|
+
declare function getActiveHeading(editorOrState: Editor | EditorState, headings?: readonly OutlineHeading[]): OutlineHeading | null;
|
|
685
|
+
/**
|
|
686
|
+
* Snapshot of the outline for UI bindings. Snapshots are immutable and only
|
|
687
|
+
* replaced when the outline or the active heading changes, so they can be used
|
|
688
|
+
* directly with `useSyncExternalStore` or Svelte state.
|
|
689
|
+
*/
|
|
690
|
+
interface OutlineSnapshot {
|
|
691
|
+
headings: OutlineHeading[];
|
|
692
|
+
tree: OutlineTreeItem[];
|
|
693
|
+
activeId: string | null;
|
|
694
|
+
}
|
|
695
|
+
interface OutlineStore {
|
|
696
|
+
getSnapshot: () => OutlineSnapshot;
|
|
697
|
+
subscribe: (listener: () => void) => () => void;
|
|
698
|
+
destroy: () => void;
|
|
699
|
+
}
|
|
700
|
+
/**
|
|
701
|
+
* Creates an observable outline store for an editor, shared by the React and
|
|
702
|
+
* Svelte outline panels.
|
|
703
|
+
*/
|
|
704
|
+
declare function createOutlineStore(editor: Editor | null | undefined): OutlineStore;
|
|
705
|
+
/**
|
|
706
|
+
* Moves the caret to the start of a heading, focuses the editor and scrolls the
|
|
707
|
+
* heading into view. Works with or without the Outline extension installed.
|
|
708
|
+
*/
|
|
709
|
+
declare function navigateToHeading(editor: Editor, heading: Pick<OutlineHeading, "id" | "pos">, options?: FocusHeadingOptions): boolean;
|
|
710
|
+
/**
|
|
711
|
+
* Headless document outline. Gives every heading a stable `id` attribute
|
|
712
|
+
* (rendered as the HTML `id`, so `#id` links work in exported HTML) and keeps
|
|
713
|
+
* an up-to-date outline in plugin state. Read it with `getOutline(editor)` or
|
|
714
|
+
* observe it with `createOutlineStore(editor)`.
|
|
715
|
+
*/
|
|
716
|
+
declare const Outline: Extension<OutlineOptions, OutlineStorage>;
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* An entry rendered by a table of contents node.
|
|
720
|
+
*/
|
|
721
|
+
interface TableOfContentsEntry {
|
|
722
|
+
id: string | null;
|
|
723
|
+
level: number;
|
|
724
|
+
text: string;
|
|
725
|
+
depth: number;
|
|
726
|
+
}
|
|
727
|
+
interface TableOfContentsOptions {
|
|
728
|
+
HTMLAttributes: Record<string, any>;
|
|
729
|
+
/** Heading node types to list. Defaults to `["heading"]`. */
|
|
730
|
+
headingTypes: string[];
|
|
731
|
+
/** Default title for newly inserted tables of contents. */
|
|
732
|
+
defaultTitle: string;
|
|
733
|
+
/** Text shown when the document has no headings. */
|
|
734
|
+
emptyText: string;
|
|
735
|
+
}
|
|
736
|
+
interface InsertTableOfContentsOptions {
|
|
737
|
+
title?: string;
|
|
738
|
+
minLevel?: number;
|
|
739
|
+
maxLevel?: number;
|
|
740
|
+
}
|
|
741
|
+
declare module "@tiptap/core" {
|
|
742
|
+
interface Commands<ReturnType> {
|
|
743
|
+
tableOfContents: {
|
|
744
|
+
/** Inserts a table of contents block at the selection. */
|
|
745
|
+
insertTableOfContents: (options?: InsertTableOfContentsOptions) => ReturnType;
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
declare const tableOfContentsPluginKey: PluginKey<boolean>;
|
|
750
|
+
/**
|
|
751
|
+
* Builds table of contents entries from an outline, limited to a level range.
|
|
752
|
+
* Depth is recomputed within the range so the shallowest listed level is 0.
|
|
753
|
+
*/
|
|
754
|
+
declare function getTableOfContentsEntries(headings: readonly OutlineHeading[], minLevel?: number, maxLevel?: number): TableOfContentsEntry[];
|
|
755
|
+
/**
|
|
756
|
+
* Table of contents block. An atom node whose entries mirror the document's
|
|
757
|
+
* headings; they are refreshed on every document change, so exported HTML
|
|
758
|
+
* always contains the current, linked list. Install the `Outline` extension
|
|
759
|
+
* alongside it so headings get stable ids to link to.
|
|
760
|
+
*
|
|
761
|
+
* Markdown: serialized as a `[[toc]]` line and parsed back from `[[toc]]` or
|
|
762
|
+
* `[TOC]`.
|
|
763
|
+
*/
|
|
764
|
+
declare const TableOfContents: Node<TableOfContentsOptions, any>;
|
|
765
|
+
|
|
766
|
+
/**
|
|
767
|
+
* A footnote as listed by `getFootnotes`.
|
|
768
|
+
*/
|
|
769
|
+
interface FootnoteInfo {
|
|
770
|
+
id: string;
|
|
771
|
+
/** 1-based number, in document order of the references. */
|
|
772
|
+
number: number;
|
|
773
|
+
/** Plain text of the footnote content (paragraphs joined by blank lines). */
|
|
774
|
+
text: string;
|
|
775
|
+
/** Position of the reference node. */
|
|
776
|
+
referencePos: number;
|
|
777
|
+
/** Position of the footnote node in the footnotes list, if present. */
|
|
778
|
+
footnotePos: number | null;
|
|
779
|
+
}
|
|
780
|
+
interface FootnotesOptions {
|
|
781
|
+
HTMLAttributes: Record<string, any>;
|
|
782
|
+
/** Generates ids for new footnotes. */
|
|
783
|
+
generateId: () => string;
|
|
784
|
+
}
|
|
785
|
+
interface InsertFootnoteOptions {
|
|
786
|
+
/** Plain-text content. Blank lines separate paragraphs. */
|
|
787
|
+
content?: string;
|
|
788
|
+
/** Explicit id; generated when omitted. */
|
|
789
|
+
id?: string;
|
|
790
|
+
/**
|
|
791
|
+
* Move the caret into the new footnote (Word's behaviour). Defaults to `true`
|
|
792
|
+
* when no `content` is given.
|
|
793
|
+
*/
|
|
794
|
+
focusContent?: boolean;
|
|
795
|
+
}
|
|
796
|
+
declare module "@tiptap/core" {
|
|
797
|
+
interface Commands<ReturnType> {
|
|
798
|
+
footnotes: {
|
|
799
|
+
/** Inserts a footnote reference at the selection, plus its footnote. */
|
|
800
|
+
insertFootnote: (options?: InsertFootnoteOptions) => ReturnType;
|
|
801
|
+
/** Replaces a footnote's content with plain text. */
|
|
802
|
+
updateFootnote: (id: string, content: string) => ReturnType;
|
|
803
|
+
/** Removes a footnote and its reference. */
|
|
804
|
+
deleteFootnote: (id: string) => ReturnType;
|
|
805
|
+
/** Moves the caret into a footnote's content. */
|
|
806
|
+
goToFootnote: (id: string) => ReturnType;
|
|
807
|
+
/** Selects a footnote's reference in the body text. */
|
|
808
|
+
goToFootnoteReference: (id: string) => ReturnType;
|
|
809
|
+
};
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
declare const footnotesPluginKey: PluginKey<boolean>;
|
|
813
|
+
/**
|
|
814
|
+
* Lists the footnotes of a document in reference order.
|
|
815
|
+
*/
|
|
816
|
+
declare function getFootnotes(doc: Node$1): FootnoteInfo[];
|
|
817
|
+
/**
|
|
818
|
+
* Brings the footnotes list in line with the references: one footnote per
|
|
819
|
+
* reference, in reference order, numbered 1..n, in a single list that is the
|
|
820
|
+
* last child of the document. Orphaned footnotes are dropped, missing ones are
|
|
821
|
+
* created (empty, or with `contents[id]`), and duplicated references (from
|
|
822
|
+
* copy/paste) get a new id with a copy of the original footnote.
|
|
823
|
+
*
|
|
824
|
+
* Returns true if the transaction was modified.
|
|
825
|
+
*/
|
|
826
|
+
declare function syncFootnotes(tr: Transaction, options?: {
|
|
827
|
+
generateId?: () => string;
|
|
828
|
+
contents?: Record<string, string>;
|
|
829
|
+
}): boolean;
|
|
830
|
+
/**
|
|
831
|
+
* Inline footnote reference, auto-numbered in document order. Its content
|
|
832
|
+
* lives in a `footnote` item of the `footnotes` list at the end of the
|
|
833
|
+
* document, which is created, renumbered, reordered and pruned automatically.
|
|
834
|
+
*
|
|
835
|
+
* Markdown: serialized as `[^n]` with `[^n]: text` definitions, and parsed
|
|
836
|
+
* back when the Markdown extension is installed.
|
|
837
|
+
*/
|
|
838
|
+
declare const FootnoteReference: Node<FootnotesOptions, any>;
|
|
839
|
+
/**
|
|
840
|
+
* The footnotes list at the end of the document. Managed automatically by
|
|
841
|
+
* `FootnoteReference`; you rarely create it directly.
|
|
842
|
+
*/
|
|
843
|
+
declare const Footnotes: Node<any, any>;
|
|
844
|
+
/**
|
|
845
|
+
* A single footnote's content inside the `footnotes` list.
|
|
846
|
+
*/
|
|
847
|
+
declare const Footnote: Node<any, any>;
|
|
848
|
+
|
|
849
|
+
/**
|
|
850
|
+
* A bookmark as listed by `getBookmarks`.
|
|
851
|
+
*/
|
|
852
|
+
interface BookmarkInfo {
|
|
853
|
+
id: string;
|
|
854
|
+
name: string;
|
|
855
|
+
/** Bookmarked text (all ranges carrying the bookmark, in document order). */
|
|
856
|
+
text: string;
|
|
857
|
+
/** Start of the first bookmarked range. */
|
|
858
|
+
from: number;
|
|
859
|
+
/** End of the last bookmarked range. */
|
|
860
|
+
to: number;
|
|
861
|
+
}
|
|
862
|
+
interface BookmarkOptions {
|
|
863
|
+
HTMLAttributes: Record<string, any>;
|
|
864
|
+
/** Generates ids for new bookmarks. */
|
|
865
|
+
generateId: () => string;
|
|
866
|
+
}
|
|
867
|
+
interface SetBookmarkOptions {
|
|
868
|
+
/** Display name. Setting a name that already exists moves that bookmark. */
|
|
869
|
+
name: string;
|
|
870
|
+
/** Explicit id; generated (or reused from a same-named bookmark) when omitted. */
|
|
871
|
+
id?: string;
|
|
872
|
+
}
|
|
873
|
+
declare module "@tiptap/core" {
|
|
874
|
+
interface Commands<ReturnType> {
|
|
875
|
+
bookmark: {
|
|
876
|
+
/**
|
|
877
|
+
* Bookmarks the selected text (or the word at the caret when the
|
|
878
|
+
* selection is empty).
|
|
879
|
+
*/
|
|
880
|
+
setBookmark: (options: SetBookmarkOptions) => ReturnType;
|
|
881
|
+
/** Removes a bookmark (the text stays). */
|
|
882
|
+
removeBookmark: (id: string) => ReturnType;
|
|
883
|
+
/** Renames a bookmark. */
|
|
884
|
+
renameBookmark: (id: string, name: string) => ReturnType;
|
|
885
|
+
/** Selects a bookmark's text and scrolls to it. */
|
|
886
|
+
goToBookmark: (id: string) => ReturnType;
|
|
887
|
+
};
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
/**
|
|
891
|
+
* Lists the bookmarks in a document, merging the text nodes that carry each
|
|
892
|
+
* bookmark into one entry.
|
|
893
|
+
*/
|
|
894
|
+
declare function getBookmarks(doc: Node$1): BookmarkInfo[];
|
|
895
|
+
/**
|
|
896
|
+
* Word-style bookmark: a named, non-inclusive mark over a text range. Several
|
|
897
|
+
* bookmarks may overlap. Cross-references (`CrossReference`) can point to a
|
|
898
|
+
* bookmark by id and display its current text.
|
|
899
|
+
*/
|
|
900
|
+
declare const Bookmark: Mark<BookmarkOptions, any>;
|
|
901
|
+
|
|
902
|
+
type CrossReferenceTargetType = "heading" | "bookmark";
|
|
903
|
+
/**
|
|
904
|
+
* Something a cross-reference can point to.
|
|
905
|
+
*/
|
|
906
|
+
interface CrossReferenceTarget {
|
|
907
|
+
type: CrossReferenceTargetType;
|
|
908
|
+
id: string;
|
|
909
|
+
/** Current text of the target (heading text or bookmarked text). */
|
|
910
|
+
text: string;
|
|
911
|
+
/** Bookmark name, or heading text. */
|
|
912
|
+
name: string;
|
|
913
|
+
/** Heading level (headings only). */
|
|
914
|
+
level?: number;
|
|
915
|
+
}
|
|
916
|
+
interface CrossReferenceOptions {
|
|
917
|
+
HTMLAttributes: Record<string, any>;
|
|
918
|
+
/** Heading node types that can be referenced. Defaults to `["heading"]`. */
|
|
919
|
+
headingTypes: string[];
|
|
920
|
+
/** Text shown while the target no longer exists (Word: "Error! Reference source not found."). */
|
|
921
|
+
brokenText: string;
|
|
922
|
+
}
|
|
923
|
+
declare module "@tiptap/core" {
|
|
924
|
+
interface Commands<ReturnType> {
|
|
925
|
+
crossReference: {
|
|
926
|
+
/** Inserts a cross-reference to a heading or bookmark at the selection. */
|
|
927
|
+
insertCrossReference: (target: {
|
|
928
|
+
targetType: CrossReferenceTargetType;
|
|
929
|
+
targetId: string;
|
|
930
|
+
}) => ReturnType;
|
|
931
|
+
/**
|
|
932
|
+
* Moves the caret to the target of the cross-reference at `pos` (or the
|
|
933
|
+
* selected cross-reference).
|
|
934
|
+
*/
|
|
935
|
+
followCrossReference: (pos?: number) => ReturnType;
|
|
936
|
+
};
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
declare const crossReferencePluginKey: PluginKey<boolean>;
|
|
940
|
+
/**
|
|
941
|
+
* Lists the headings (with stable ids, see `Outline`) and bookmarks in a
|
|
942
|
+
* document, for building a cross-reference picker.
|
|
943
|
+
*/
|
|
944
|
+
declare function getCrossReferenceTargets(doc: Node$1, headingTypes?: readonly string[]): CrossReferenceTarget[];
|
|
945
|
+
/**
|
|
946
|
+
* Inline cross-reference to a heading or bookmark. It displays the target's
|
|
947
|
+
* current text, follows renames, and switches to a broken-reference state
|
|
948
|
+
* (class `is-broken`, `brokenText`) when the target is removed. Undoing the
|
|
949
|
+
* removal restores it. Heading targets need the `Outline` extension, which
|
|
950
|
+
* gives headings stable ids.
|
|
951
|
+
*/
|
|
952
|
+
declare const CrossReference: Node<CrossReferenceOptions, any>;
|
|
953
|
+
|
|
954
|
+
interface DocumentStructureCommandArgs {
|
|
955
|
+
/** Range to delete first, e.g. the `/toc` text matched by `SlashCommands`. */
|
|
956
|
+
range?: {
|
|
957
|
+
from: number;
|
|
958
|
+
to: number;
|
|
959
|
+
};
|
|
960
|
+
/** Bookmark name (bookmark item). */
|
|
961
|
+
name?: string;
|
|
962
|
+
/** Footnote text (footnote item). */
|
|
963
|
+
content?: string;
|
|
964
|
+
/** Cross-reference target (cross-reference item). */
|
|
965
|
+
targetType?: CrossReferenceTargetType;
|
|
966
|
+
targetId?: string;
|
|
967
|
+
}
|
|
968
|
+
/**
|
|
969
|
+
* A framework-agnostic menu entry for slash menus and toolbars.
|
|
970
|
+
*/
|
|
971
|
+
interface DocumentStructureCommandItem {
|
|
972
|
+
id: "table-of-contents" | "footnote" | "bookmark" | "cross-reference";
|
|
973
|
+
title: string;
|
|
974
|
+
description: string;
|
|
975
|
+
keywords: string[];
|
|
976
|
+
/** Name of the extension that must be installed for the item to work. */
|
|
977
|
+
extension: string;
|
|
978
|
+
/**
|
|
979
|
+
* Input the host UI must collect before calling `run`: a bookmark name, or
|
|
980
|
+
* a cross-reference target (see `getCrossReferenceTargets`).
|
|
981
|
+
*/
|
|
982
|
+
requires?: "name" | "target";
|
|
983
|
+
run: (editor: Editor, args?: DocumentStructureCommandArgs) => boolean;
|
|
984
|
+
}
|
|
985
|
+
/**
|
|
986
|
+
* Menu entries for the document-structure commands.
|
|
987
|
+
*/
|
|
988
|
+
declare const documentStructureCommandItems: DocumentStructureCommandItem[];
|
|
989
|
+
/**
|
|
990
|
+
* Returns the document-structure items whose extension is installed in the
|
|
991
|
+
* editor, optionally filtered by a slash-command query.
|
|
992
|
+
*/
|
|
993
|
+
declare function getDocumentStructureCommandItems(editor: Editor | null | undefined, query?: string): DocumentStructureCommandItem[];
|
|
994
|
+
|
|
995
|
+
/**
|
|
996
|
+
* markdown-it plugins used by the document-structure extensions' markdown
|
|
997
|
+
* parse hooks (tiptap-markdown). tiptap-markdown calls every extension's
|
|
998
|
+
* `parse.setup` before *each* parse on the same markdown-it instance, so the
|
|
999
|
+
* plugins guard against registering their rules twice.
|
|
1000
|
+
*/
|
|
1001
|
+
/**
|
|
1002
|
+
* Parses a line containing only `[[toc]]` (or `[TOC]`) into a table of
|
|
1003
|
+
* contents placeholder that the `TableOfContents` node parses.
|
|
1004
|
+
*/
|
|
1005
|
+
declare function tableOfContentsMarkdownIt(md: any): void;
|
|
1006
|
+
/**
|
|
1007
|
+
* Minimal footnote syntax: `[^label]` references and `[^label]: text`
|
|
1008
|
+
* definitions (continuation paragraphs indented by four spaces). Renders the
|
|
1009
|
+
* HTML the `FootnoteReference`, `Footnotes` and `Footnote` nodes parse.
|
|
1010
|
+
*/
|
|
1011
|
+
declare function footnotesMarkdownIt(md: any): void;
|
|
1012
|
+
|
|
1013
|
+
/**
|
|
1014
|
+
* Word's Find and Replace patterns: special characters (`^p`, `^t`, `^#` …),
|
|
1015
|
+
* the "Use wildcards" language (`?`, `*`, `[a-z]`, `[!x]`, `{n,m}`, `@`, `<`,
|
|
1016
|
+
* `>`, `( )`) and a raw regular-expression mode.
|
|
1017
|
+
*
|
|
1018
|
+
* Special and wildcard patterns are compiled to a small program run by a
|
|
1019
|
+
* Pike VM, which takes time linear in the text for a given pattern, so no
|
|
1020
|
+
* Find text can backtrack catastrophically (JavaScript's `RegExp` would). The
|
|
1021
|
+
* raw regex mode uses the native `RegExp` engine; it rejects nested
|
|
1022
|
+
* repetition and is bounded by the search budget between matches only.
|
|
1023
|
+
*
|
|
1024
|
+
* Pure TypeScript: no ProseMirror or DOM.
|
|
1025
|
+
*/
|
|
1026
|
+
/** A paragraph mark in the searched text (`^p`). */
|
|
1027
|
+
declare const FIND_PARAGRAPH_MARK = "\r";
|
|
1028
|
+
/** Longest Find what text, in characters. */
|
|
1029
|
+
declare const MAX_FIND_PATTERN_LENGTH = 1024;
|
|
1030
|
+
interface FindOptions {
|
|
1031
|
+
matchCase?: boolean;
|
|
1032
|
+
/** Find whole words only (ignored with wildcards, like Word). */
|
|
1033
|
+
wholeWord?: boolean;
|
|
1034
|
+
/** The match must start a word. */
|
|
1035
|
+
matchPrefix?: boolean;
|
|
1036
|
+
/** The match must end a word. */
|
|
1037
|
+
matchSuffix?: boolean;
|
|
1038
|
+
/** Skip punctuation between the characters of the Find text. */
|
|
1039
|
+
ignorePunctuation?: boolean;
|
|
1040
|
+
/** Skip spaces and tabs between the characters of the Find text. */
|
|
1041
|
+
ignoreWhitespace?: boolean;
|
|
1042
|
+
/** Word's "Use wildcards". Always matches case. */
|
|
1043
|
+
wildcards?: boolean;
|
|
1044
|
+
/** A JavaScript regular expression (wins over `wildcards`). Replace text is literal. */
|
|
1045
|
+
regex?: boolean;
|
|
1046
|
+
/** Read the Find and Replace text literally: no `^` codes. */
|
|
1047
|
+
literal?: boolean;
|
|
1048
|
+
}
|
|
1049
|
+
type FindPatternErrorCode = "too_long" | "invalid_pattern" | "too_complex";
|
|
1050
|
+
/** Why a Find text cannot be used. Commands report it; they never throw it. */
|
|
1051
|
+
interface FindPatternError {
|
|
1052
|
+
code: FindPatternErrorCode;
|
|
1053
|
+
message: string;
|
|
1054
|
+
}
|
|
1055
|
+
/** One match in a searched string (UTF-16 offsets). */
|
|
1056
|
+
interface PatternMatch {
|
|
1057
|
+
start: number;
|
|
1058
|
+
end: number;
|
|
1059
|
+
/** Text of each group; index 0 is the whole match, unmatched groups are `undefined`. */
|
|
1060
|
+
groups: (string | undefined)[];
|
|
1061
|
+
}
|
|
1062
|
+
/** Shared limit on the work one search may do. */
|
|
1063
|
+
interface SearchBudget {
|
|
1064
|
+
/** `performance.now()`/`Date.now()` value after which the search stops. */
|
|
1065
|
+
deadline: number;
|
|
1066
|
+
/** VM steps left. */
|
|
1067
|
+
steps: number;
|
|
1068
|
+
/** Set once the budget ran out. */
|
|
1069
|
+
exhausted: boolean;
|
|
1070
|
+
}
|
|
1071
|
+
interface SearchBudgetOptions {
|
|
1072
|
+
/** Wall-clock limit in milliseconds (default 250). */
|
|
1073
|
+
timeLimitMs?: number;
|
|
1074
|
+
/** Pike VM thread steps (default 50 million). */
|
|
1075
|
+
maxSteps?: number;
|
|
1076
|
+
}
|
|
1077
|
+
declare function createSearchBudget(options?: SearchBudgetOptions): SearchBudget;
|
|
1078
|
+
interface CompiledFindPattern {
|
|
1079
|
+
mode: "special" | "wildcards" | "regex";
|
|
1080
|
+
/** The pattern can match a paragraph mark, so paragraphs must be read together. */
|
|
1081
|
+
spansParagraphs: boolean;
|
|
1082
|
+
caseInsensitive: boolean;
|
|
1083
|
+
/** Number of capture groups (not counting the whole match). */
|
|
1084
|
+
groupCount: number;
|
|
1085
|
+
/**
|
|
1086
|
+
* The leftmost match in `hay[start, end)`; text outside the range is
|
|
1087
|
+
* context for word assertions. `"budget"` when the budget ran out.
|
|
1088
|
+
*/
|
|
1089
|
+
exec(hay: string, start: number, end: number, budget: SearchBudget): PatternMatch | null | "budget";
|
|
1090
|
+
}
|
|
1091
|
+
type CompileFindPatternResult = {
|
|
1092
|
+
ok: true;
|
|
1093
|
+
pattern: CompiledFindPattern;
|
|
1094
|
+
} | {
|
|
1095
|
+
ok: false;
|
|
1096
|
+
error: FindPatternError;
|
|
1097
|
+
};
|
|
1098
|
+
/** Simple (one code point to one code point) lower-case fold. */
|
|
1099
|
+
declare function foldCodePoint(cp: number): number;
|
|
1100
|
+
/** Translates Word's Find what text. Never throws: invalid text returns `{ ok: false, error }`. */
|
|
1101
|
+
declare function compileFindPattern(query: string, options?: FindOptions): CompileFindPatternResult;
|
|
1102
|
+
interface FindAllOptions {
|
|
1103
|
+
/**
|
|
1104
|
+
* Offsets where the live text breaks (e.g. where tracked-deleted text was
|
|
1105
|
+
* skipped): no match spans a cut.
|
|
1106
|
+
*/
|
|
1107
|
+
cuts?: readonly number[];
|
|
1108
|
+
budget?: SearchBudget;
|
|
1109
|
+
/** Stop after this many matches (default 10 000). */
|
|
1110
|
+
maxMatches?: number;
|
|
1111
|
+
}
|
|
1112
|
+
interface FindAllResult {
|
|
1113
|
+
matches: PatternMatch[];
|
|
1114
|
+
/** The search stopped early (match cap or time budget). */
|
|
1115
|
+
truncated: boolean;
|
|
1116
|
+
}
|
|
1117
|
+
/**
|
|
1118
|
+
* Every non-empty match in `hay`, left to right, without overlaps. Empty
|
|
1119
|
+
* matches are stepped past so the search always moves on.
|
|
1120
|
+
*/
|
|
1121
|
+
declare function findAllMatches(pattern: CompiledFindPattern, hay: string, options?: FindAllOptions): FindAllResult;
|
|
1122
|
+
/** A piece of Replace with text. */
|
|
1123
|
+
type ReplacePiece = {
|
|
1124
|
+
type: "text";
|
|
1125
|
+
text: string;
|
|
1126
|
+
}
|
|
1127
|
+
/** `^&`: the text found. */
|
|
1128
|
+
| {
|
|
1129
|
+
type: "found";
|
|
1130
|
+
}
|
|
1131
|
+
/** `\n` with wildcards: group `n`. */
|
|
1132
|
+
| {
|
|
1133
|
+
type: "group";
|
|
1134
|
+
index: number;
|
|
1135
|
+
}
|
|
1136
|
+
/** `^c`: the clipboard. */
|
|
1137
|
+
| {
|
|
1138
|
+
type: "clipboard";
|
|
1139
|
+
};
|
|
1140
|
+
/** Reads Replace with text: `^` codes (unless `literal`), and `\1`–`\9` with wildcards. Regex mode is literal. */
|
|
1141
|
+
declare function parseReplacement(replacement: string, options?: FindOptions): ReplacePiece[];
|
|
1142
|
+
/** Fills in Replace with text for one match. Paragraph marks in the result are `\r`. */
|
|
1143
|
+
declare function expandReplacement(pieces: readonly ReplacePiece[], match: PatternMatch, clipboardText?: string): string;
|
|
1144
|
+
|
|
1145
|
+
interface FindMatch {
|
|
1146
|
+
/** Document position of the first matched character. */
|
|
1147
|
+
from: number;
|
|
1148
|
+
/** Document position after the last matched character. */
|
|
1149
|
+
to: number;
|
|
1150
|
+
/** The matched text (`\r` for paragraph marks, `\n` for hard breaks). */
|
|
1151
|
+
text: string;
|
|
1152
|
+
/** The Replace with text for this match (`\r` splits paragraphs). */
|
|
1153
|
+
replacement: string;
|
|
1154
|
+
}
|
|
1155
|
+
interface DocumentSearchOptions {
|
|
1156
|
+
/** Replace with text (`^&`, `^c`, `\1`…). */
|
|
1157
|
+
replacement?: string;
|
|
1158
|
+
/** Text of `^c` in the replacement. */
|
|
1159
|
+
clipboardText?: string;
|
|
1160
|
+
/** Wall-clock budget for the whole search (default 250 ms). */
|
|
1161
|
+
timeLimitMs?: number;
|
|
1162
|
+
/** Match cap (default 10 000). */
|
|
1163
|
+
maxMatches?: number;
|
|
1164
|
+
}
|
|
1165
|
+
interface DocumentSearchResult {
|
|
1166
|
+
matches: FindMatch[];
|
|
1167
|
+
/** The search stopped early at the match cap or time budget. */
|
|
1168
|
+
truncated: boolean;
|
|
1169
|
+
error: FindPatternError | null;
|
|
1170
|
+
}
|
|
1171
|
+
/**
|
|
1172
|
+
* Finds `query` in a document. Each textblock is read as text without
|
|
1173
|
+
* tracked-deleted runs (a deletion "cuts" the text, so no match spans it, but
|
|
1174
|
+
* word boundaries see the live text on both sides); a pattern that can match
|
|
1175
|
+
* `^p` reads runs of sibling textblocks as one text with `\r` between them.
|
|
1176
|
+
*/
|
|
1177
|
+
declare function searchDocument(doc: Node$1, query: string, options?: FindOptions, searchOptions?: DocumentSearchOptions): DocumentSearchResult;
|
|
1178
|
+
/**
|
|
1179
|
+
* Replaces matches in one transaction, last first so earlier positions stay
|
|
1180
|
+
* valid. A paragraph mark (`\r` or U+2029) in a replacement splits the
|
|
1181
|
+
* paragraph. Returns the mapped end of each replacement (in match order).
|
|
1182
|
+
*/
|
|
1183
|
+
declare function applyReplacements(tr: Transaction, matches: readonly FindMatch[]): number[];
|
|
1184
|
+
|
|
1185
|
+
type FindReplaceMode = "find" | "replace";
|
|
1186
|
+
/** Everything a find bar needs. Snapshots are cached, so they suit `useSyncExternalStore`. */
|
|
1187
|
+
interface FindReplaceSnapshot {
|
|
1188
|
+
/** Whether the find bar should be shown (`openFindReplace` / Mod+F). */
|
|
1189
|
+
open: boolean;
|
|
1190
|
+
mode: FindReplaceMode;
|
|
1191
|
+
query: string;
|
|
1192
|
+
replacement: string;
|
|
1193
|
+
options: Readonly<FindOptions>;
|
|
1194
|
+
matches: readonly FindMatch[];
|
|
1195
|
+
/** Index of the current match, or -1. */
|
|
1196
|
+
currentIndex: number;
|
|
1197
|
+
error: FindPatternError | null;
|
|
1198
|
+
/** The search stopped at the match cap or time budget. */
|
|
1199
|
+
truncated: boolean;
|
|
1200
|
+
/** Replacements made by the last `replaceAll` / `replaceCurrent` (`null` before any). */
|
|
1201
|
+
lastReplaceCount: number | null;
|
|
1202
|
+
/** Bumped whenever the bar is asked to focus its find field (Mod+F while open). */
|
|
1203
|
+
focusRequest: number;
|
|
1204
|
+
}
|
|
1205
|
+
declare const EMPTY_FIND_REPLACE_SNAPSHOT: FindReplaceSnapshot;
|
|
1206
|
+
/**
|
|
1207
|
+
* External store over the find state. `subscribe` calls the listener
|
|
1208
|
+
* immediately (Svelte store contract).
|
|
1209
|
+
*/
|
|
1210
|
+
declare class FindReplaceStore {
|
|
1211
|
+
private snapshot;
|
|
1212
|
+
private listeners;
|
|
1213
|
+
subscribe: (listener: (snapshot: FindReplaceSnapshot) => void) => (() => void);
|
|
1214
|
+
getSnapshot: () => FindReplaceSnapshot;
|
|
1215
|
+
/** @internal Called by the extension's plugin view. */
|
|
1216
|
+
set(snapshot: FindReplaceSnapshot): void;
|
|
1217
|
+
}
|
|
1218
|
+
interface FindReplaceOptions {
|
|
1219
|
+
/** Bind Mod+F / Mod+H (and Mod+Shift+H) to open the bar, F3 / Mod+G to step. Default `true`. */
|
|
1220
|
+
shortcuts: boolean;
|
|
1221
|
+
/** Class of every match. */
|
|
1222
|
+
matchClass: string;
|
|
1223
|
+
/** Class of the current match. */
|
|
1224
|
+
currentMatchClass: string;
|
|
1225
|
+
/** Wall-clock budget per search in milliseconds (default 250). */
|
|
1226
|
+
timeLimitMs: number;
|
|
1227
|
+
/** Match cap per search (default 10 000). */
|
|
1228
|
+
maxMatches: number;
|
|
1229
|
+
/** Text of `^c` in Replace with (clipboard reads are async in browsers, so supply it). */
|
|
1230
|
+
getClipboardText: () => string;
|
|
1231
|
+
/** Longest selection copied into the find field by Mod+F. Default 256. */
|
|
1232
|
+
maxPrefillLength: number;
|
|
1233
|
+
}
|
|
1234
|
+
interface FindReplaceStorage {
|
|
1235
|
+
store: FindReplaceStore;
|
|
1236
|
+
}
|
|
1237
|
+
interface SetSearchParams {
|
|
1238
|
+
query?: string;
|
|
1239
|
+
replacement?: string;
|
|
1240
|
+
/** Merged into the current options. */
|
|
1241
|
+
options?: Partial<FindOptions>;
|
|
1242
|
+
}
|
|
1243
|
+
interface OpenFindReplaceParams {
|
|
1244
|
+
mode?: FindReplaceMode;
|
|
1245
|
+
/** Find text; defaults to the selected text (single paragraph, short). */
|
|
1246
|
+
query?: string;
|
|
1247
|
+
}
|
|
1248
|
+
interface PluginState {
|
|
1249
|
+
active: boolean;
|
|
1250
|
+
open: boolean;
|
|
1251
|
+
mode: FindReplaceMode;
|
|
1252
|
+
query: string;
|
|
1253
|
+
replacement: string;
|
|
1254
|
+
options: Readonly<FindOptions>;
|
|
1255
|
+
matches: readonly FindMatch[];
|
|
1256
|
+
currentIndex: number;
|
|
1257
|
+
/** Position the current match is chosen from (first match at or after it) after a re-search. */
|
|
1258
|
+
anchor: number;
|
|
1259
|
+
error: FindPatternError | null;
|
|
1260
|
+
truncated: boolean;
|
|
1261
|
+
lastReplaceCount: number | null;
|
|
1262
|
+
focusRequest: number;
|
|
1263
|
+
decorations: DecorationSet;
|
|
1264
|
+
}
|
|
1265
|
+
declare const findReplacePluginKey: PluginKey<PluginState>;
|
|
1266
|
+
declare module "@tiptap/core" {
|
|
1267
|
+
interface Commands<ReturnType> {
|
|
1268
|
+
findReplace: {
|
|
1269
|
+
/** Sets the find text, replace text and/or options and searches. */
|
|
1270
|
+
setSearch: (params: SetSearchParams) => ReturnType;
|
|
1271
|
+
/** Shows the find bar (and searches its text). */
|
|
1272
|
+
openFindReplace: (params?: OpenFindReplaceParams) => ReturnType;
|
|
1273
|
+
/** Hides the find bar and its highlights; the find text is kept. */
|
|
1274
|
+
closeFindReplace: () => ReturnType;
|
|
1275
|
+
/** Clears the find text and highlights. */
|
|
1276
|
+
clearSearch: () => ReturnType;
|
|
1277
|
+
/** Selects the next match after the selection, wrapping around. */
|
|
1278
|
+
findNext: () => ReturnType;
|
|
1279
|
+
/** Selects the previous match before the selection, wrapping around. */
|
|
1280
|
+
findPrevious: () => ReturnType;
|
|
1281
|
+
/** Replaces the current match and moves on to the next one. */
|
|
1282
|
+
replaceCurrent: () => ReturnType;
|
|
1283
|
+
/** Replaces every match in one transaction (one undo step). */
|
|
1284
|
+
replaceAll: () => ReturnType;
|
|
1285
|
+
};
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1288
|
+
/** The extension's plugin state, or `null` without `FindReplace`. */
|
|
1289
|
+
declare function getFindReplaceState(source: Editor | EditorState | null | undefined): FindReplaceSnapshot | null;
|
|
1290
|
+
/** Returns the find store of an editor using `FindReplace`. */
|
|
1291
|
+
declare function getFindReplaceStore(editor: Editor | null | undefined): FindReplaceStore | null;
|
|
1292
|
+
interface FindOptionToggle {
|
|
1293
|
+
key: keyof FindOptions;
|
|
1294
|
+
label: string;
|
|
1295
|
+
/** Compact button text. */
|
|
1296
|
+
short: string;
|
|
1297
|
+
/** Shown under "More options" rather than as a toolbar toggle. */
|
|
1298
|
+
advanced: boolean;
|
|
1299
|
+
}
|
|
1300
|
+
/** The option toggles of the React and Svelte find bars, in display order. */
|
|
1301
|
+
declare const FIND_OPTION_TOGGLES: readonly FindOptionToggle[];
|
|
1302
|
+
/**
|
|
1303
|
+
* Text of a find bar's match counter: `"3 of 12"`, `"12 results"` (no
|
|
1304
|
+
* current match), `"No results"`, `"10000+ results"` when truncated, or the
|
|
1305
|
+
* pattern error. Empty without a query.
|
|
1306
|
+
*/
|
|
1307
|
+
declare function formatFindStatus(s: Pick<FindReplaceSnapshot, "query" | "matches" | "currentIndex" | "error" | "truncated">): string;
|
|
1308
|
+
/**
|
|
1309
|
+
* Word-style Find and Replace: Match case, Whole words, prefix/suffix,
|
|
1310
|
+
* Ignore punctuation/white space, `^` special characters, wildcards (with
|
|
1311
|
+
* `\1` groups in the replacement) and a raw regex mode. Matches are
|
|
1312
|
+
* decorated; tracked-deleted text is skipped, and replacements made while
|
|
1313
|
+
* Track Changes is on become tracked changes.
|
|
1314
|
+
*/
|
|
1315
|
+
declare const FindReplace: Extension<FindReplaceOptions, FindReplaceStorage>;
|
|
1316
|
+
|
|
1317
|
+
/** Paragraph styles format whole blocks; character styles format runs of text. */
|
|
1318
|
+
type StyleKind = "paragraph" | "character";
|
|
1319
|
+
/** Character formatting of a style (CSS values). */
|
|
1320
|
+
interface CharacterFormat {
|
|
1321
|
+
fontFamily?: string;
|
|
1322
|
+
/** CSS length, e.g. `"1.5em"` or `"18px"`. */
|
|
1323
|
+
fontSize?: string;
|
|
1324
|
+
bold?: boolean;
|
|
1325
|
+
italic?: boolean;
|
|
1326
|
+
underline?: boolean;
|
|
1327
|
+
strike?: boolean;
|
|
1328
|
+
color?: string;
|
|
1329
|
+
backgroundColor?: string;
|
|
1330
|
+
letterSpacing?: string;
|
|
1331
|
+
textTransform?: "none" | "uppercase" | "lowercase" | "capitalize";
|
|
1332
|
+
smallCaps?: boolean;
|
|
1333
|
+
}
|
|
1334
|
+
/** Paragraph formatting of a style (CSS values). */
|
|
1335
|
+
interface ParagraphFormat {
|
|
1336
|
+
textAlign?: "left" | "center" | "right" | "justify";
|
|
1337
|
+
lineHeight?: string;
|
|
1338
|
+
spaceBefore?: string;
|
|
1339
|
+
spaceAfter?: string;
|
|
1340
|
+
indentLeft?: string;
|
|
1341
|
+
indentRight?: string;
|
|
1342
|
+
indentFirstLine?: string;
|
|
1343
|
+
/** CSS border shorthand, e.g. `"3px solid currentColor"`. */
|
|
1344
|
+
borderLeft?: string;
|
|
1345
|
+
paddingLeft?: string;
|
|
1346
|
+
backgroundColor?: string;
|
|
1347
|
+
}
|
|
1348
|
+
/** The block node a paragraph style uses (`heading` with `level` for Heading N). */
|
|
1349
|
+
interface StyleBlock {
|
|
1350
|
+
type: string;
|
|
1351
|
+
attrs?: Record<string, any>;
|
|
1352
|
+
}
|
|
1353
|
+
interface StyleDefinition {
|
|
1354
|
+
/** Stable id (`Heading1`): letters, digits, `_` and `-`, starting with a letter. */
|
|
1355
|
+
id: string;
|
|
1356
|
+
/** Display name (`Heading 1`). */
|
|
1357
|
+
name: string;
|
|
1358
|
+
kind: StyleKind;
|
|
1359
|
+
/** Style this one inherits from; what it sets wins over its base. */
|
|
1360
|
+
basedOn?: string | null;
|
|
1361
|
+
/** Style of the paragraph after this one when Enter is pressed at its end (paragraph styles). */
|
|
1362
|
+
next?: string | null;
|
|
1363
|
+
/** Linked style: a paragraph style's character style, or a character style's paragraph style. */
|
|
1364
|
+
linked?: string | null;
|
|
1365
|
+
paragraph?: ParagraphFormat;
|
|
1366
|
+
character?: CharacterFormat;
|
|
1367
|
+
/** Block node of a paragraph style. Inherited along `basedOn`; `paragraph` by default. */
|
|
1368
|
+
block?: StyleBlock | null;
|
|
1369
|
+
/** Gallery order (lower first). */
|
|
1370
|
+
priority?: number;
|
|
1371
|
+
/** Shown in the styles gallery. */
|
|
1372
|
+
quick?: boolean;
|
|
1373
|
+
hidden?: boolean;
|
|
1374
|
+
/** Built in (cannot be removed). */
|
|
1375
|
+
builtin?: boolean;
|
|
1376
|
+
}
|
|
1377
|
+
/** A style with its `basedOn` chain and the defaults merged. */
|
|
1378
|
+
interface ResolvedStyle {
|
|
1379
|
+
id: string;
|
|
1380
|
+
paragraph: ParagraphFormat;
|
|
1381
|
+
character: CharacterFormat;
|
|
1382
|
+
block: StyleBlock;
|
|
1383
|
+
/** Id of the style after Enter at the end of a paragraph. */
|
|
1384
|
+
next: string;
|
|
1385
|
+
}
|
|
1386
|
+
interface StyleDefaults {
|
|
1387
|
+
paragraph?: ParagraphFormat;
|
|
1388
|
+
character?: CharacterFormat;
|
|
1389
|
+
}
|
|
1390
|
+
interface StyleRegistryOptions {
|
|
1391
|
+
/** Styles added to (or replacing) the built-in ones. */
|
|
1392
|
+
styles?: readonly StyleDefinition[];
|
|
1393
|
+
/** Include the built-in styles. Default `true`. */
|
|
1394
|
+
builtins?: boolean;
|
|
1395
|
+
/** Document defaults, applied below every style. */
|
|
1396
|
+
defaults?: StyleDefaults;
|
|
1397
|
+
}
|
|
1398
|
+
interface StyleRegistrySnapshot {
|
|
1399
|
+
styles: readonly StyleDefinition[];
|
|
1400
|
+
defaults: StyleDefaults;
|
|
1401
|
+
/** Increases on every change. */
|
|
1402
|
+
version: number;
|
|
1403
|
+
}
|
|
1404
|
+
/** Serializable registry content (`registry.toJSON()`). */
|
|
1405
|
+
interface StyleRegistryJSON {
|
|
1406
|
+
styles: StyleDefinition[];
|
|
1407
|
+
defaults: StyleDefaults;
|
|
1408
|
+
}
|
|
1409
|
+
interface StyleCSSOptions {
|
|
1410
|
+
/** Selector the rules are scoped to. Default `.ProseMirror`. */
|
|
1411
|
+
scope?: string;
|
|
1412
|
+
/**
|
|
1413
|
+
* Element selector of blocks that use a style without naming it
|
|
1414
|
+
* (`data-style` absent), e.g. `h2` for Heading 2. Return `null` for none.
|
|
1415
|
+
*/
|
|
1416
|
+
tagFor?: (block: StyleBlock) => string | null;
|
|
1417
|
+
}
|
|
1418
|
+
declare const NORMAL_STYLE_ID = "Normal";
|
|
1419
|
+
/** Whether `id` is a valid style id. */
|
|
1420
|
+
declare function isValidStyleId(id: unknown): id is string;
|
|
1421
|
+
/** The built-in styles: Normal, Title, Subtitle, Heading 1–6, Quote, Code, List Paragraph and character styles. */
|
|
1422
|
+
declare const DEFAULT_STYLES: readonly StyleDefinition[];
|
|
1423
|
+
/**
|
|
1424
|
+
* Style definitions with `basedOn` inheritance, next-style and linked
|
|
1425
|
+
* character/paragraph styles, resolved in cascade order: document defaults →
|
|
1426
|
+
* style chain (base first) → direct formatting. Chains are cycle-safe.
|
|
1427
|
+
*
|
|
1428
|
+
* `subscribe` calls the listener immediately and on every change (Svelte
|
|
1429
|
+
* store contract); `getSnapshot` is stable between changes.
|
|
1430
|
+
*/
|
|
1431
|
+
declare class StyleRegistry {
|
|
1432
|
+
private styles;
|
|
1433
|
+
private defaults;
|
|
1434
|
+
private version;
|
|
1435
|
+
private snapshot;
|
|
1436
|
+
private listeners;
|
|
1437
|
+
constructor(options?: StyleRegistryOptions);
|
|
1438
|
+
get(id: string | null | undefined): StyleDefinition | undefined;
|
|
1439
|
+
/** Finds a style by id or display name (case-insensitive). */
|
|
1440
|
+
find(nameOrId: string): StyleDefinition | undefined;
|
|
1441
|
+
/** All styles (optionally of one kind) in gallery order. */
|
|
1442
|
+
list(kind?: StyleKind): StyleDefinition[];
|
|
1443
|
+
/** Styles shown in the gallery (`quick`, not hidden), paragraph styles by default. */
|
|
1444
|
+
gallery(kind?: StyleKind): StyleDefinition[];
|
|
1445
|
+
/** The `basedOn` chain from the root style down to `id` (cycle-safe, bounded). */
|
|
1446
|
+
chain(id: string): StyleDefinition[];
|
|
1447
|
+
/**
|
|
1448
|
+
* Resolves a paragraph style: defaults, then each style of the chain (base
|
|
1449
|
+
* first). Unknown ids resolve to the defaults in a `paragraph` block.
|
|
1450
|
+
*/
|
|
1451
|
+
resolve(id: string): ResolvedStyle;
|
|
1452
|
+
/** Character formatting a paragraph style's chain sets (without defaults). */
|
|
1453
|
+
private paragraphCharacter;
|
|
1454
|
+
/**
|
|
1455
|
+
* Character formatting of a character style's chain. A style linked to a
|
|
1456
|
+
* paragraph style takes that style's character formatting first.
|
|
1457
|
+
*/
|
|
1458
|
+
resolveCharacterStyle(id: string): CharacterFormat;
|
|
1459
|
+
/**
|
|
1460
|
+
* Character formatting of text: defaults → paragraph style chain →
|
|
1461
|
+
* character style chain → direct formatting.
|
|
1462
|
+
*/
|
|
1463
|
+
resolveText(input: {
|
|
1464
|
+
paragraphStyle?: string | null;
|
|
1465
|
+
characterStyle?: string | null;
|
|
1466
|
+
direct?: CharacterFormat;
|
|
1467
|
+
}): CharacterFormat;
|
|
1468
|
+
/** The style after Enter at the end of a paragraph of `id` (itself when unset or unknown). */
|
|
1469
|
+
nextStyleId(id: string): string;
|
|
1470
|
+
/** The linked character style of a paragraph style, if any. */
|
|
1471
|
+
linkedCharacterStyle(id: string): StyleDefinition | undefined;
|
|
1472
|
+
/**
|
|
1473
|
+
* The style a block uses when it names none: Normal for paragraphs,
|
|
1474
|
+
* Heading N for headings of level N, Code for code blocks (the built-in
|
|
1475
|
+
* style whose own `block` matches).
|
|
1476
|
+
*/
|
|
1477
|
+
defaultStyleFor(type: string, attrs?: Record<string, any>): string | null;
|
|
1478
|
+
/** The style of a block: its `styleId` when known, otherwise the block's default style. */
|
|
1479
|
+
styleOfBlock(type: string, attrs?: Record<string, any>): string | null;
|
|
1480
|
+
getSnapshot: () => StyleRegistrySnapshot;
|
|
1481
|
+
subscribe: (listener: (snapshot: StyleRegistrySnapshot) => void) => (() => void);
|
|
1482
|
+
toJSON(): StyleRegistryJSON;
|
|
1483
|
+
/** Adds or replaces a style. Throws on an invalid id. */
|
|
1484
|
+
upsert(style: StyleDefinition): StyleDefinition;
|
|
1485
|
+
/** Merges `patch` into a style (formats are merged key by key). Returns `undefined` for unknown ids. */
|
|
1486
|
+
update(id: string, patch: Partial<Omit<StyleDefinition, "id">>): StyleDefinition | undefined;
|
|
1487
|
+
/**
|
|
1488
|
+
* Removes a style and returns it. Built-in styles cannot be removed. Styles
|
|
1489
|
+
* based on it are rebased onto its own base, and `next`/`linked`
|
|
1490
|
+
* references to it are dropped.
|
|
1491
|
+
*/
|
|
1492
|
+
remove(id: string): StyleDefinition | undefined;
|
|
1493
|
+
/** Replaces the document defaults. */
|
|
1494
|
+
setDefaults(defaults: StyleDefaults): void;
|
|
1495
|
+
/** An unused id derived from a display name (`My Style` → `MyStyle`, then `MyStyle1`, …). */
|
|
1496
|
+
newId(name: string): string;
|
|
1497
|
+
/** CSS declarations (`property: value`) of a resolved paragraph or character style. */
|
|
1498
|
+
cssDeclarations(id: string): Record<string, string>;
|
|
1499
|
+
/**
|
|
1500
|
+
* Declarations for previewing a style in a menu or gallery: font family,
|
|
1501
|
+
* weight, style, color, decoration, case and letter spacing (no sizes,
|
|
1502
|
+
* margins or borders).
|
|
1503
|
+
*/
|
|
1504
|
+
previewDeclarations(id: string): Record<string, string>;
|
|
1505
|
+
/**
|
|
1506
|
+
* A stylesheet for the styles: `[data-style="Id"]` rules for paragraph
|
|
1507
|
+
* styles (plus the plain element of blocks that use their default style,
|
|
1508
|
+
* e.g. `h2:not([data-style])`), `[data-char-style="Id"]` for character
|
|
1509
|
+
* styles and the defaults on the scope element.
|
|
1510
|
+
*/
|
|
1511
|
+
toCSS(options?: StyleCSSOptions): string;
|
|
1512
|
+
private put;
|
|
1513
|
+
private changed;
|
|
1514
|
+
}
|
|
1515
|
+
/** A CSS value, or `undefined` when it is unsafe or empty. */
|
|
1516
|
+
declare function safeCSSValue(value: unknown): string | undefined;
|
|
1517
|
+
/** Creates a style registry with the built-in styles (unless `builtins: false`) and `styles`. */
|
|
1518
|
+
declare function createStyleRegistry(options?: StyleRegistryOptions | StyleRegistryJSON): StyleRegistry;
|
|
1519
|
+
|
|
1520
|
+
/** Node attribute naming a block's paragraph style (`data-style` in HTML). */
|
|
1521
|
+
declare const STYLE_ID_ATTRIBUTE = "styleId";
|
|
1522
|
+
/** Mark applying a character style (`<span data-char-style>`). */
|
|
1523
|
+
declare const CHARACTER_STYLE_MARK_NAME = "characterStyle";
|
|
1524
|
+
interface ParagraphStylesOptions {
|
|
1525
|
+
/** The style registry. Defaults to a new registry with the built-in styles per editor. */
|
|
1526
|
+
registry: StyleRegistry | null;
|
|
1527
|
+
/** Block types that carry the `styleId` attribute. */
|
|
1528
|
+
types: string[];
|
|
1529
|
+
/**
|
|
1530
|
+
* Inject a `<style>` element with `registry.toCSS({ scope })` while the
|
|
1531
|
+
* editor exists (kept up to date). Default `true`.
|
|
1532
|
+
*/
|
|
1533
|
+
injectCSS: boolean;
|
|
1534
|
+
/** Selector the injected CSS is scoped to. Default `.ProseMirror`. */
|
|
1535
|
+
cssScope: string;
|
|
1536
|
+
/** Nonce of the injected `<style>` element (Content Security Policy). */
|
|
1537
|
+
cssNonce?: string;
|
|
1538
|
+
/**
|
|
1539
|
+
* Applying a paragraph style to a partial selection inside one paragraph
|
|
1540
|
+
* applies its linked character style instead (as in Word). Default `true`.
|
|
1541
|
+
*/
|
|
1542
|
+
linkedCharacterStyles: boolean;
|
|
1543
|
+
}
|
|
1544
|
+
interface ParagraphStylesStorage {
|
|
1545
|
+
registry: StyleRegistry;
|
|
1546
|
+
}
|
|
1547
|
+
interface CreateStyleFromSelectionOptions {
|
|
1548
|
+
/** Id of the new style. Default: derived from the name. */
|
|
1549
|
+
id?: string;
|
|
1550
|
+
/** Base style. Default: the style at the selection. */
|
|
1551
|
+
basedOn?: string | null;
|
|
1552
|
+
/** Apply the new style to the selected paragraphs. Default `true`. */
|
|
1553
|
+
apply?: boolean;
|
|
1554
|
+
}
|
|
1555
|
+
declare module "@tiptap/core" {
|
|
1556
|
+
interface Commands<ReturnType> {
|
|
1557
|
+
paragraphStyles: {
|
|
1558
|
+
/** Applies a paragraph style to the selected blocks (changing headings/code blocks as the style needs). */
|
|
1559
|
+
setParagraphStyle: (id: string) => ReturnType;
|
|
1560
|
+
/** Resets the selected blocks to the Normal style. */
|
|
1561
|
+
clearParagraphStyle: () => ReturnType;
|
|
1562
|
+
/** Applies a character style to the selection. */
|
|
1563
|
+
setCharacterStyle: (id: string) => ReturnType;
|
|
1564
|
+
unsetCharacterStyle: () => ReturnType;
|
|
1565
|
+
/**
|
|
1566
|
+
* Updates a style (default: the style at the selection) to the direct
|
|
1567
|
+
* formatting at the selection ("Update to match selection").
|
|
1568
|
+
*/
|
|
1569
|
+
updateParagraphStyleFromSelection: (id?: string) => ReturnType;
|
|
1570
|
+
/** Creates a paragraph style from the formatting at the selection ("New style from selection"). */
|
|
1571
|
+
createParagraphStyleFromSelection: (name: string, options?: CreateStyleFromSelectionOptions) => ReturnType;
|
|
1572
|
+
};
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1575
|
+
declare const paragraphStylesPluginKey: PluginKey<any>;
|
|
1576
|
+
/** The style registry of an editor using `ParagraphStyles`. */
|
|
1577
|
+
declare function getStyleRegistry(editor: Editor | null | undefined): StyleRegistry | null;
|
|
1578
|
+
/**
|
|
1579
|
+
* Whether a paragraph style can be applied in this editor: its block type is
|
|
1580
|
+
* in the schema (and, for headings, its level is configured).
|
|
1581
|
+
*/
|
|
1582
|
+
declare function isParagraphStyleAvailable(editor: Editor, registry: StyleRegistry, id: string): boolean;
|
|
1583
|
+
/** The paragraph style of the textblock at `pos` (defaults to the selection start). */
|
|
1584
|
+
declare function getParagraphStyleAt(state: EditorState, registry: StyleRegistry, pos?: number): string | null;
|
|
1585
|
+
/**
|
|
1586
|
+
* The direct formatting at the selection, as style formats: bold, italic,
|
|
1587
|
+
* underline, strike, font family/size, color and highlight from marks, and
|
|
1588
|
+
* the alignment of the block.
|
|
1589
|
+
*/
|
|
1590
|
+
declare function captureSelectionFormat(state: EditorState): {
|
|
1591
|
+
paragraph: ParagraphFormat;
|
|
1592
|
+
character: CharacterFormat;
|
|
1593
|
+
};
|
|
1594
|
+
/** Character style applied to a run of text. */
|
|
1595
|
+
declare const CharacterStyle: Mark<any, any>;
|
|
1596
|
+
/**
|
|
1597
|
+
* Paragraph styles (Normal, Title, Heading 1, …) from a `StyleRegistry`:
|
|
1598
|
+
* a `styleId` attribute on paragraphs and headings (`data-style` in HTML),
|
|
1599
|
+
* a `characterStyle` mark, apply/clear/update/create commands, next-style
|
|
1600
|
+
* on Enter and an injected stylesheet. Headings without a `styleId` use
|
|
1601
|
+
* Heading N, plain paragraphs Normal, so existing documents are unchanged.
|
|
1602
|
+
*/
|
|
1603
|
+
declare const ParagraphStyles: Extension<ParagraphStylesOptions, ParagraphStylesStorage>;
|
|
1604
|
+
interface ParagraphStylesSnapshot {
|
|
1605
|
+
/** Paragraph styles for the gallery (quick, not hidden, available in this editor). */
|
|
1606
|
+
gallery: readonly StyleDefinition[];
|
|
1607
|
+
/** All paragraph styles available in this editor. */
|
|
1608
|
+
styles: readonly StyleDefinition[];
|
|
1609
|
+
/** Character styles. */
|
|
1610
|
+
characterStyles: readonly StyleDefinition[];
|
|
1611
|
+
/** The style of the block at the selection. */
|
|
1612
|
+
currentStyleId: string | null;
|
|
1613
|
+
/** Registry version (changes when styles change). */
|
|
1614
|
+
version: number;
|
|
1615
|
+
}
|
|
1616
|
+
interface ParagraphStylesStore {
|
|
1617
|
+
getSnapshot(): ParagraphStylesSnapshot;
|
|
1618
|
+
subscribe(listener: () => void): () => void;
|
|
1619
|
+
destroy(): void;
|
|
1620
|
+
}
|
|
1621
|
+
/**
|
|
1622
|
+
* External store over an editor's paragraph styles and the style at the
|
|
1623
|
+
* selection, for `useSyncExternalStore` and Svelte runes. Snapshots change
|
|
1624
|
+
* only when the styles or the current style change. Listeners are attached
|
|
1625
|
+
* to the editor only while subscribed.
|
|
1626
|
+
*/
|
|
1627
|
+
declare function createParagraphStylesStore(editor: Editor | null | undefined): ParagraphStylesStore;
|
|
1628
|
+
|
|
1629
|
+
/**
|
|
1630
|
+
* The TipTap packages whose commands the preset installs. Exported only so the
|
|
1631
|
+
* published declarations import them: each package augments `@tiptap/core`'s
|
|
1632
|
+
* `Commands` interface, which is what types `editor.chain().toggleBold()`,
|
|
1633
|
+
* `toggleHeading()`, `setTextAlign()` and so on for apps that use the preset
|
|
1634
|
+
* without depending on those packages themselves. (Triple-slash references are
|
|
1635
|
+
* dropped by the declaration bundler, and runtime imports leave no trace in .d.ts.)
|
|
1636
|
+
*/
|
|
1637
|
+
type RichTextPresetCommandPackages = [
|
|
1638
|
+
typeof _tiptap_starter_kit,
|
|
1639
|
+
typeof _tiptap_extension_color,
|
|
1640
|
+
typeof _tiptap_extension_highlight,
|
|
1641
|
+
typeof _tiptap_extension_image,
|
|
1642
|
+
typeof _tiptap_extension_link,
|
|
1643
|
+
typeof _tiptap_extension_task_list,
|
|
1644
|
+
typeof _tiptap_extension_text_align,
|
|
1645
|
+
typeof _tiptap_extension_text_style,
|
|
1646
|
+
typeof _tiptap_extension_underline
|
|
1647
|
+
];
|
|
1648
|
+
interface RichTextPresetOptions {
|
|
1649
|
+
placeholder?: string | ((props: {
|
|
1650
|
+
node: any;
|
|
1651
|
+
}) => string);
|
|
1652
|
+
characterLimit?: number;
|
|
1653
|
+
openLinksOnClick?: boolean;
|
|
1654
|
+
enableSmilies?: boolean;
|
|
1655
|
+
enableColorHighlighter?: boolean;
|
|
1656
|
+
headingLevels?: (1 | 2 | 3 | 4 | 5 | 6)[];
|
|
1657
|
+
mention?: MentionOptions | boolean;
|
|
1658
|
+
markdown?: MarkdownOptions | boolean;
|
|
1659
|
+
image?: ImageOptions | boolean;
|
|
1660
|
+
/** Adds the `Comments` extension (off by default). */
|
|
1661
|
+
comments?: Partial<CommentsOptions> | boolean;
|
|
1662
|
+
/** Adds the `TrackChanges` and `DocumentCompare` extensions (off by default). */
|
|
1663
|
+
trackChanges?: Partial<TrackChangesOptions> | boolean;
|
|
1664
|
+
/** Import dropped/pasted .md, .html, .txt and .rtf files (opt-in). */
|
|
1665
|
+
fileImport?: FileImportOptions | boolean;
|
|
1666
|
+
/** Copy/paste lossless ProseMirror slices between editors (opt-in). */
|
|
1667
|
+
richClipboard?: RichClipboardOptions | boolean;
|
|
1668
|
+
/**
|
|
1669
|
+
* Word-style AutoCorrect (smart quotes, symbols, fractions, sentence
|
|
1670
|
+
* capitalization, ...). Off by default. Replaces the Typography extension
|
|
1671
|
+
* when enabled, since both handle quotes and dashes.
|
|
1672
|
+
*/
|
|
1673
|
+
autocorrect?: Partial<AutocorrectOptions> | boolean;
|
|
1674
|
+
/** Heading outline with stable heading ids. Off by default. */
|
|
1675
|
+
outline?: Partial<OutlineOptions> | boolean;
|
|
1676
|
+
/** Table of contents block (also enables `outline`). Off by default. */
|
|
1677
|
+
tableOfContents?: Partial<TableOfContentsOptions> | boolean;
|
|
1678
|
+
/** Footnote references and the footnotes list. Off by default. */
|
|
1679
|
+
footnotes?: Partial<FootnotesOptions> | boolean;
|
|
1680
|
+
/** Named bookmarks. Off by default. */
|
|
1681
|
+
bookmarks?: Partial<BookmarkOptions> | boolean;
|
|
1682
|
+
/** Cross-references to headings and bookmarks (also enables `outline`). Off by default. */
|
|
1683
|
+
crossReferences?: Partial<CrossReferenceOptions> | boolean;
|
|
1684
|
+
/** Word-style Find and Replace (Mod+F / Mod+H, match highlights). Off by default. */
|
|
1685
|
+
findReplace?: Partial<FindReplaceOptions> | boolean;
|
|
1686
|
+
/**
|
|
1687
|
+
* Paragraph styles (Normal, Title, Heading 1–6, Quote, …) with a style
|
|
1688
|
+
* registry, `data-style` attributes and next-style on Enter. Off by default.
|
|
1689
|
+
*/
|
|
1690
|
+
paragraphStyles?: Partial<ParagraphStylesOptions> | boolean;
|
|
1691
|
+
}
|
|
1692
|
+
/**
|
|
1693
|
+
* Creates a standard rich-text extensions bundle with full formatting support.
|
|
1694
|
+
*/
|
|
1695
|
+
declare function createRichTextPreset(options?: RichTextPresetOptions): Extensions;
|
|
1696
|
+
|
|
1697
|
+
/** Options of a comparison run in an editor (the schema is the editor's). */
|
|
1698
|
+
type EditorCompareOptions = Omit<CompareDocumentsOptions, "schema">;
|
|
1699
|
+
declare module "@tiptap/core" {
|
|
1700
|
+
interface Commands<ReturnType> {
|
|
1701
|
+
documentCompare: {
|
|
1702
|
+
/**
|
|
1703
|
+
* Replaces the content with the comparison of `original` and
|
|
1704
|
+
* `revised` (nodes, JSON or HTML) as tracked changes. The content is
|
|
1705
|
+
* set without being tracked; the summary is stored in
|
|
1706
|
+
* `editor.storage.documentCompare.lastResult`.
|
|
1707
|
+
*/
|
|
1708
|
+
setContentFromComparison: (original: CompareSource, revised: CompareSource, options?: EditorCompareOptions) => ReturnType;
|
|
1709
|
+
};
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
interface DocumentCompareOptions {
|
|
1713
|
+
/** Defaults for every comparison (author defaults to the track-changes author). */
|
|
1714
|
+
compare: EditorCompareOptions;
|
|
1715
|
+
}
|
|
1716
|
+
interface DocumentCompareStorage {
|
|
1717
|
+
lastResult: CompareDocumentsResult | null;
|
|
1718
|
+
}
|
|
1719
|
+
/**
|
|
1720
|
+
* Compares two versions in the editor's schema and returns the result
|
|
1721
|
+
* without changing the editor. The author defaults to the `TrackChanges`
|
|
1722
|
+
* author.
|
|
1723
|
+
*/
|
|
1724
|
+
declare function compareInEditor(editor: Editor, original: CompareSource, revised: CompareSource, options?: EditorCompareOptions): CompareDocumentsResult;
|
|
1725
|
+
/**
|
|
1726
|
+
* Compares two versions and replaces the editor content with the result
|
|
1727
|
+
* (one undoable step, not tracked). Works without the `DocumentCompare`
|
|
1728
|
+
* extension; the schema needs `TrackChanges`.
|
|
1729
|
+
*/
|
|
1730
|
+
declare function applyDocumentComparison(editor: Editor, original: CompareSource, revised: CompareSource, options?: EditorCompareOptions): CompareDocumentsResult;
|
|
1731
|
+
/** Adds the `setContentFromComparison` command. Requires `TrackChanges`. */
|
|
1732
|
+
declare const DocumentCompare: Extension<DocumentCompareOptions, DocumentCompareStorage>;
|
|
1733
|
+
|
|
1734
|
+
interface FindReplaceCommandOptions {
|
|
1735
|
+
/** Id prefix (default `findReplace.`). */
|
|
1736
|
+
prefix?: string;
|
|
1737
|
+
group?: string;
|
|
1738
|
+
scope?: string;
|
|
1739
|
+
/**
|
|
1740
|
+
* Give the open commands default shortcuts (Mod+F, Mod+H). Off by default
|
|
1741
|
+
* because the `FindReplace` extension already binds them inside the editor.
|
|
1742
|
+
*/
|
|
1743
|
+
shortcuts?: boolean;
|
|
1744
|
+
}
|
|
1745
|
+
/**
|
|
1746
|
+
* Find and Replace commands for the command registry (`@pixerate/editor/commands`):
|
|
1747
|
+
* open the bar, step through matches, and find / replace with explicit
|
|
1748
|
+
* params (useful for agents). Requires the `FindReplace` extension.
|
|
1749
|
+
*/
|
|
1750
|
+
declare function createFindReplaceCommands(editor: Editor, options?: FindReplaceCommandOptions): CommandSpec[];
|
|
1751
|
+
/** Validates Find text without an editor (e.g. to show an error while typing). */
|
|
1752
|
+
declare function validateFindPattern(query: string, options?: FindOptions): FindPatternError | null;
|
|
1753
|
+
|
|
1754
|
+
export { type FindOptions as $, type AddCommentOptions as A, BUILT_IN_IMPORT_ADAPTERS as B, CHARACTER_STYLE_MARK_NAME as C, type DocumentImport as D, type CrossReferenceOptions as E, type CrossReferenceTarget as F, type CrossReferenceTargetType as G, DEFAULT_AUTOCORRECT_EXCEPTIONS as H, DEFAULT_STYLES as I, DocumentCompare as J, type DocumentCompareOptions as K, type DocumentCompareStorage as L, type DocumentSearchOptions as M, type DocumentSearchResult as N, type DocumentStructureCommandArgs as O, type PdfStructureReport as P, type DocumentStructureCommandItem as Q, EMPTY_FIND_REPLACE_SNAPSHOT as R, type EditorCompareOptions as S, FIND_OPTION_TOGGLES as T, FIND_PARAGRAPH_MARK as U, FileImport as V, type FileImportOptions as W, type FindAllOptions as X, type FindAllResult as Y, type FindMatch as Z, type FindOptionToggle as _, type DocumentImportAdapter as a, SmilieReplacer as a$, type FindPatternError as a0, type FindPatternErrorCode as a1, FindReplace as a2, type FindReplaceCommandOptions as a3, type FindReplaceMode as a4, type FindReplaceOptions as a5, type FindReplaceSnapshot as a6, type FindReplaceStorage as a7, FindReplaceStore as a8, type FocusHeadingOptions as a9, type ParagraphFormat as aA, ParagraphStyles as aB, type ParagraphStylesOptions as aC, type ParagraphStylesSnapshot as aD, type ParagraphStylesStorage as aE, type ParagraphStylesStore as aF, type PatternMatch as aG, type PdfLayoutBlock as aH, type PdfLayoutPage as aI, type PdfLayoutResult as aJ, type PdfTableCell as aK, type ReplacePiece as aL, type ResolvedStyle as aM, RichClipboard as aN, type RichClipboardOptions as aO, type RichClipboardStorage as aP, type RichTextPresetCommandPackages as aQ, type RichTextPresetOptions as aR, SMILIE_REPLACEMENTS as aS, STYLE_ID_ATTRIBUTE as aT, type SearchBudget as aU, type SearchBudgetOptions as aV, type SetBookmarkOptions as aW, type SetSearchParams as aX, type SlashCommandMatchData as aY, SlashCommands as aZ, type SlashCommandsOptions as a_, FontSize as aa, Footnote as ab, type FootnoteInfo as ac, FootnoteReference as ad, Footnotes as ae, type FootnotesOptions as af, GradientText as ag, type GradientTextOptions as ah, Image as ai, type ImageOptions as aj, type ImportStructureItem as ak, type ImportStructureReport as al, type InsertFootnoteOptions as am, type InsertTableOfContentsOptions as an, LoadingNode as ao, MAX_FIND_PATTERN_LENGTH as ap, Markdown as aq, NORMAL_STYLE_ID as ar, type OpenFindReplaceParams as as, Outline as at, type OutlineHeading as au, type OutlineOptions as av, type OutlineSnapshot as aw, type OutlineStorage as ax, type OutlineStore as ay, type OutlineTreeItem as az, type PdfLayoutOptions as b, getStyleRegistry as b$, type StyleBlock as b0, type StyleCSSOptions as b1, type StyleDefaults as b2, type StyleDefinition as b3, type StyleKind as b4, StyleRegistry as b5, type StyleRegistryJSON as b6, type StyleRegistryOptions as b7, type StyleRegistrySnapshot as b8, TableOfContents as b9, expandReplacement as bA, fileImportPluginKey as bB, findAllMatches as bC, findAutocorrection as bD, findCommentRanges as bE, findHexColors as bF, findImportAdapter as bG, findReplacePluginKey as bH, foldCodePoint as bI, footnotesMarkdownIt as bJ, footnotesPluginKey as bK, formatFindStatus as bL, fractionRules as bM, getActiveHeading as bN, getBookmarks as bO, getCommentAnchors as bP, getCommentAuthor as bQ, getCommentIdsAt as bR, getCommentStore as bS, getCrossReferenceTargets as bT, getDocumentStructureCommandItems as bU, getFindReplaceState as bV, getFindReplaceStore as bW, getFootnotes as bX, getImportAccept as bY, getOutline as bZ, getParagraphStyleAt as b_, type TableOfContentsEntry as ba, type TableOfContentsOptions as bb, TemplateSuggestions as bc, type TemplateSuggestionsOptions as bd, analyzePdfLayout as be, applyDocumentComparison as bf, applyReplacements as bg, autocorrectPluginKey as bh, buildOutlineTree as bi, capitalizeSentenceRules as bj, captureSelectionFormat as bk, commentsPluginKey as bl, compareInEditor as bm, compileFindPattern as bn, computeOutline as bo, createFindReplaceCommands as bp, createImportAdapterRegistry as bq, createOutlineStore as br, createParagraphStylesStore as bs, createRichTextPreset as bt, createSearchBudget as bu, createStyleRegistry as bv, crossReferencePluginKey as bw, defaultAutocorrectRules as bx, defaultImportRegistry as by, documentStructureCommandItems as bz, type PdfRuleLine as c, getTableOfContentsEntries as c0, handleImageInsertion as c1, htmlImportAdapter as c2, imagePastePluginKey as c3, importFile as c4, insertImageNode as c5, isInsidePromptToken as c6, isParagraphStyleAvailable as c7, isValidStyleId as c8, markdownImportAdapter as c9, navigateToHeading as ca, outlinePluginKey as cb, paragraphStylesPluginKey as cc, parseReplacement as cd, pdfLayoutBlocksToHtml as ce, plainTextImportAdapter as cf, registerImportAdapter as cg, removeImageNode as ch, richClipboardPluginKey as ci, rtfImportAdapter as cj, safeCSSValue as ck, searchDocument as cl, smartQuoteRules as cm, smilieAutocorrectRules as cn, symbolRules as co, syncFootnotes as cp, tableOfContentsMarkdownIt as cq, tableOfContentsPluginKey as cr, twoInitialCapitalsRules as cs, unregisterImportAdapter as ct, updateImageSrc as cu, validateFindPattern as cv, writeRichClipboard as cw, type PdfTextRun as d, Autocorrect as e, type AutocorrectContext as f, type AutocorrectCorrection as g, type AutocorrectOptions as h, type AutocorrectRule as i, type AutocorrectStorage as j, Bookmark as k, type BookmarkInfo as l, type BookmarkOptions as m, COMMENT_MARK_NAME as n, type CharacterFormat as o, CharacterStyle as p, ColorHighlighter as q, type CommentRange as r, Comments as s, type CommentsOptions as t, type CommentsStorage as u, type CompileFindPatternResult as v, type CompiledFindPattern as w, type CreateImportAdapterRegistryOptions as x, type CreateStyleFromSelectionOptions as y, CrossReference as z };
|