@thomasfosterau/effect-richtext 0.0.0-stage → 0.1.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.
Files changed (176) hide show
  1. package/LICENSE +48 -0
  2. package/README.md +118 -2
  3. package/dist/_virtual/_rolldown/runtime.js +12 -0
  4. package/dist/commands/commands.d.ts +323 -0
  5. package/dist/commands/commands.js +722 -0
  6. package/dist/commands/internal.js +43 -0
  7. package/dist/commands/keymaps.d.ts +46 -0
  8. package/dist/commands/keymaps.js +64 -0
  9. package/dist/commands.d.ts +3 -0
  10. package/dist/commands.js +3 -0
  11. package/dist/compat/commands.d.ts +250 -0
  12. package/dist/compat/commands.js +275 -0
  13. package/dist/compat/internal/core.d.ts +20 -0
  14. package/dist/compat/internal/core.js +148 -0
  15. package/dist/compat/internal/props.js +82 -0
  16. package/dist/compat/keymap.d.ts +21 -0
  17. package/dist/compat/keymap.js +38 -0
  18. package/dist/compat/model.d.ts +893 -0
  19. package/dist/compat/model.js +1212 -0
  20. package/dist/compat/orderedmap.d.ts +74 -0
  21. package/dist/compat/orderedmap.js +124 -0
  22. package/dist/compat/schema-basic.d.ts +38 -0
  23. package/dist/compat/schema-basic.js +238 -0
  24. package/dist/compat/schema-list.d.ts +81 -0
  25. package/dist/compat/schema-list.js +156 -0
  26. package/dist/compat/state.d.ts +415 -0
  27. package/dist/compat/state.js +689 -0
  28. package/dist/compat/test-builder.d.ts +98 -0
  29. package/dist/compat/test-builder.js +197 -0
  30. package/dist/compat/transform.d.ts +458 -0
  31. package/dist/compat/transform.js +803 -0
  32. package/dist/compat/view.d.ts +411 -0
  33. package/dist/compat/view.js +409 -0
  34. package/dist/dropcursor.d.ts +46 -0
  35. package/dist/dropcursor.js +176 -0
  36. package/dist/extensions/defaults.d.ts +716 -0
  37. package/dist/extensions/defaults.js +209 -0
  38. package/dist/extensions/editor.d.ts +246 -0
  39. package/dist/extensions/editor.js +271 -0
  40. package/dist/extensions/extension.d.ts +375 -0
  41. package/dist/extensions/extension.js +233 -0
  42. package/dist/extensions.d.ts +4 -0
  43. package/dist/extensions.js +4 -0
  44. package/dist/gapcursor.d.ts +66 -0
  45. package/dist/gapcursor.js +273 -0
  46. package/dist/history.d.ts +178 -0
  47. package/dist/history.js +412 -0
  48. package/dist/html.d.ts +158 -0
  49. package/dist/html.js +164 -0
  50. package/dist/inputrules.d.ts +271 -0
  51. package/dist/inputrules.js +321 -0
  52. package/dist/internal/attempt.js +15 -0
  53. package/dist/internal/json.js +29 -0
  54. package/dist/keymap/keymap.d.ts +130 -0
  55. package/dist/keymap/keymap.js +159 -0
  56. package/dist/keymap.d.ts +2 -0
  57. package/dist/keymap.js +1 -0
  58. package/dist/markdown/errors.d.ts +23 -0
  59. package/dist/markdown/errors.js +26 -0
  60. package/dist/markdown/from_markdown.d.ts +185 -0
  61. package/dist/markdown/from_markdown.js +266 -0
  62. package/dist/markdown/schema.d.ts +522 -0
  63. package/dist/markdown/schema.js +292 -0
  64. package/dist/markdown/to_markdown.d.ts +251 -0
  65. package/dist/markdown/to_markdown.js +413 -0
  66. package/dist/markdown.d.ts +5 -0
  67. package/dist/markdown.js +5 -0
  68. package/dist/model/attrsCodec.js +48 -0
  69. package/dist/model/comparedeep.js +17 -0
  70. package/dist/model/content.d.ts +232 -0
  71. package/dist/model/content.js +630 -0
  72. package/dist/model/diff.js +66 -0
  73. package/dist/model/dom.d.ts +3 -0
  74. package/dist/model/errors.d.ts +90 -0
  75. package/dist/model/errors.js +76 -0
  76. package/dist/model/fragment.d.ts +131 -0
  77. package/dist/model/fragment.js +262 -0
  78. package/dist/model/from_dom.d.ts +299 -0
  79. package/dist/model/from_dom.js +618 -0
  80. package/dist/model/json.d.ts +37 -0
  81. package/dist/model/json.js +126 -0
  82. package/dist/model/mark.d.ts +73 -0
  83. package/dist/model/mark.js +121 -0
  84. package/dist/model/node.d.ts +267 -0
  85. package/dist/model/node.js +434 -0
  86. package/dist/model/replace.d.ts +78 -0
  87. package/dist/model/replace.js +207 -0
  88. package/dist/model/resolvedpos.d.ts +196 -0
  89. package/dist/model/resolvedpos.js +305 -0
  90. package/dist/model/schema.d.ts +740 -0
  91. package/dist/model/schema.js +451 -0
  92. package/dist/model/to_dom.d.ts +169 -0
  93. package/dist/model/to_dom.js +238 -0
  94. package/dist/model.d.ts +12 -0
  95. package/dist/model.js +12 -0
  96. package/dist/placeholder.d.ts +53 -0
  97. package/dist/placeholder.js +79 -0
  98. package/dist/reactive/observer.d.ts +54 -0
  99. package/dist/reactive/observer.js +61 -0
  100. package/dist/reactive/selectors.d.ts +22 -0
  101. package/dist/reactive/selectors.js +61 -0
  102. package/dist/reactive/stateref.d.ts +72 -0
  103. package/dist/reactive/stateref.js +71 -0
  104. package/dist/reactive/streams.d.ts +83 -0
  105. package/dist/reactive/streams.js +85 -0
  106. package/dist/reactive.d.ts +16 -0
  107. package/dist/reactive.js +26 -0
  108. package/dist/schema-basic.d.ts +448 -0
  109. package/dist/schema-basic.js +269 -0
  110. package/dist/schema-list/commands.d.ts +66 -0
  111. package/dist/schema-list/commands.js +203 -0
  112. package/dist/schema-list.d.ts +92 -0
  113. package/dist/schema-list.js +100 -0
  114. package/dist/state/errors.d.ts +39 -0
  115. package/dist/state/errors.js +32 -0
  116. package/dist/state/plugin.d.ts +232 -0
  117. package/dist/state/plugin.js +82 -0
  118. package/dist/state/selection.d.ts +297 -0
  119. package/dist/state/selection.js +486 -0
  120. package/dist/state/state.d.ts +212 -0
  121. package/dist/state/state.js +489 -0
  122. package/dist/state/transaction.d.ts +145 -0
  123. package/dist/state/transaction.js +195 -0
  124. package/dist/state.d.ts +6 -0
  125. package/dist/state.js +6 -0
  126. package/dist/test-builder.d.ts +3582 -0
  127. package/dist/test-builder.js +239 -0
  128. package/dist/transform/attr_step.d.ts +60 -0
  129. package/dist/transform/attr_step.js +105 -0
  130. package/dist/transform/errors.d.ts +50 -0
  131. package/dist/transform/errors.js +35 -0
  132. package/dist/transform/map.d.ts +182 -0
  133. package/dist/transform/map.js +280 -0
  134. package/dist/transform/mark.js +98 -0
  135. package/dist/transform/mark_set_step.js +69 -0
  136. package/dist/transform/mark_step.d.ts +113 -0
  137. package/dist/transform/mark_step.js +225 -0
  138. package/dist/transform/replace.d.ts +18 -0
  139. package/dist/transform/replace.js +381 -0
  140. package/dist/transform/replace_step.d.ts +109 -0
  141. package/dist/transform/replace_step.js +175 -0
  142. package/dist/transform/step.d.ts +157 -0
  143. package/dist/transform/step.js +168 -0
  144. package/dist/transform/structure.d.ts +89 -0
  145. package/dist/transform/structure.js +350 -0
  146. package/dist/transform/transform.d.ts +248 -0
  147. package/dist/transform/transform.js +373 -0
  148. package/dist/transform.d.ts +10 -0
  149. package/dist/transform.js +10 -0
  150. package/dist/view/browser.js +39 -0
  151. package/dist/view/capturekeys.js +282 -0
  152. package/dist/view/clipboard.d.ts +8 -0
  153. package/dist/view/clipboard.js +245 -0
  154. package/dist/view/decoration.d.ts +339 -0
  155. package/dist/view/decoration.js +566 -0
  156. package/dist/view/dom.d.ts +18 -0
  157. package/dist/view/dom.js +140 -0
  158. package/dist/view/domchange.js +295 -0
  159. package/dist/view/domcoords.d.ts +22 -0
  160. package/dist/view/domcoords.js +448 -0
  161. package/dist/view/domobserver.d.ts +47 -0
  162. package/dist/view/domobserver.js +328 -0
  163. package/dist/view/errors.d.ts +18 -0
  164. package/dist/view/errors.js +21 -0
  165. package/dist/view/input.d.ts +58 -0
  166. package/dist/view/input.js +704 -0
  167. package/dist/view/selection.js +198 -0
  168. package/dist/view/view.d.ts +699 -0
  169. package/dist/view/view.js +623 -0
  170. package/dist/view/viewdesc.d.ts +236 -0
  171. package/dist/view/viewdesc.js +1205 -0
  172. package/dist/view-css.d.ts +43 -0
  173. package/dist/view-css.js +124 -0
  174. package/dist/view.d.ts +6 -0
  175. package/dist/view.js +4 -0
  176. package/package.json +206 -3
@@ -0,0 +1,716 @@
1
+ import { AnySchema, AttrsOptional, MarkAttrsInput, MarkNames, MarkSpecOf, NodeAttrsInput, NodeNames, NodeSpecOf } from "../model/schema.js";
2
+ import { Mark } from "../model/mark.js";
3
+ import { Node } from "../model/node.js";
4
+ import { ContentExpr } from "../model/content.js";
5
+ import { CommandSignature, CommandsExtension, Extension, MergeTypes, SpecTypes } from "./extension.js";
6
+ import { Command, Dispatch } from "../state/transaction.js";
7
+ import { EditorState } from "../state/state.js";
8
+ import { EditorViewLike, Plugin } from "../state/plugin.js";
9
+ import "../model.js";
10
+ import { ToggleMarkOptions } from "../commands/commands.js";
11
+ import { Keymap } from "../commands/keymaps.js";
12
+ import "../commands.js";
13
+ import { HistoryCommand, HistoryOptions, HistoryState } from "../history.js";
14
+ import "../state.js";
15
+ import * as Effect from "effect/Effect";
16
+ /**
17
+ * The top-level `doc` node, containing one or more `block` nodes.
18
+ *
19
+ * @since 0.1.0
20
+ * @category nodes
21
+ */
22
+ export declare const defineDoc: () => Extension<SpecTypes<{
23
+ readonly doc: {
24
+ readonly content: ContentExpr<"block">;
25
+ };
26
+ }, {}, readonly [], {}, {}>>;
27
+ /**
28
+ * The `text` node (in the `inline` group).
29
+ *
30
+ * @since 0.1.0
31
+ * @category nodes
32
+ */
33
+ export declare const defineText: () => Extension<SpecTypes<{
34
+ readonly text: {
35
+ readonly group: "inline";
36
+ };
37
+ }, {}, readonly [], {}, {}>>;
38
+ /**
39
+ * The `paragraph` node (`<p>`). It has the highest priority, so that it
40
+ * is the first (and thus default) node of the `block` group.
41
+ *
42
+ * @since 0.1.0
43
+ * @category nodes
44
+ */
45
+ export declare const defineParagraph: () => Extension<SpecTypes<{
46
+ readonly paragraph: {
47
+ readonly content: ContentExpr<"inline">;
48
+ readonly group: "block";
49
+ readonly parseDOM: readonly [{
50
+ readonly tag: "p";
51
+ }];
52
+ readonly toDOM: () => readonly any[] | readonly [string, ...any[]];
53
+ };
54
+ }, {}, readonly [], {}, {}>>;
55
+ /**
56
+ * The `heading` node, with a `level` attribute (`<h1>`–`<h6>`).
57
+ *
58
+ * @since 0.1.0
59
+ * @category nodes
60
+ */
61
+ export declare const defineHeading: () => Extension<SpecTypes<{
62
+ readonly heading: {
63
+ readonly attrs: {
64
+ readonly level: {
65
+ readonly schema: import("effect/Schema").Number;
66
+ readonly default: 1;
67
+ };
68
+ };
69
+ readonly content: ContentExpr<"inline">;
70
+ readonly group: "block";
71
+ readonly defining: true;
72
+ readonly parseDOM: readonly [{
73
+ readonly tag: "h1";
74
+ readonly attrs: {
75
+ readonly level: 1;
76
+ };
77
+ }, {
78
+ readonly tag: "h2";
79
+ readonly attrs: {
80
+ readonly level: 2;
81
+ };
82
+ }, {
83
+ readonly tag: "h3";
84
+ readonly attrs: {
85
+ readonly level: 3;
86
+ };
87
+ }, {
88
+ readonly tag: "h4";
89
+ readonly attrs: {
90
+ readonly level: 4;
91
+ };
92
+ }, {
93
+ readonly tag: "h5";
94
+ readonly attrs: {
95
+ readonly level: 5;
96
+ };
97
+ }, {
98
+ readonly tag: "h6";
99
+ readonly attrs: {
100
+ readonly level: 6;
101
+ };
102
+ }];
103
+ readonly toDOM: (node: Node<any, any>) => [string, number];
104
+ };
105
+ }, {}, readonly [], {}, {}>>;
106
+ /**
107
+ * The `blockquote` node.
108
+ *
109
+ * @since 0.1.0
110
+ * @category nodes
111
+ */
112
+ export declare const defineBlockquote: () => Extension<SpecTypes<{
113
+ readonly blockquote: {
114
+ readonly content: ContentExpr<"block">;
115
+ readonly group: "block";
116
+ readonly defining: true;
117
+ readonly parseDOM: readonly [{
118
+ readonly tag: "blockquote";
119
+ }];
120
+ readonly toDOM: () => readonly any[] | readonly [string, ...any[]];
121
+ };
122
+ }, {}, readonly [], {}, {}>>;
123
+ /**
124
+ * The `horizontal_rule` node.
125
+ *
126
+ * @since 0.1.0
127
+ * @category nodes
128
+ */
129
+ export declare const defineHorizontalRule: () => Extension<SpecTypes<{
130
+ readonly horizontal_rule: {
131
+ readonly group: "block";
132
+ readonly parseDOM: readonly [{
133
+ readonly tag: "hr";
134
+ }];
135
+ readonly toDOM: () => readonly any[] | readonly [string, ...any[]];
136
+ };
137
+ }, {}, readonly [], {}, {}>>;
138
+ /**
139
+ * The `code_block` node.
140
+ *
141
+ * @since 0.1.0
142
+ * @category nodes
143
+ */
144
+ export declare const defineCodeBlock: () => Extension<SpecTypes<{
145
+ readonly code_block: {
146
+ readonly content: ContentExpr<"text">;
147
+ readonly marks: "";
148
+ readonly group: "block";
149
+ readonly code: true;
150
+ readonly defining: true;
151
+ readonly parseDOM: readonly [{
152
+ readonly tag: "pre";
153
+ readonly preserveWhitespace: "full";
154
+ }];
155
+ readonly toDOM: () => readonly any[] | readonly [string, ...any[]];
156
+ };
157
+ }, {}, readonly [], {}, {}>>;
158
+ /**
159
+ * The inline `image` node.
160
+ *
161
+ * @since 0.1.0
162
+ * @category nodes
163
+ */
164
+ export declare const defineImage: () => Extension<SpecTypes<{
165
+ readonly image: {
166
+ readonly inline: true;
167
+ readonly attrs: {
168
+ readonly src: import("effect/Schema").String;
169
+ readonly alt: {
170
+ readonly schema: import("effect/Schema").NullOr<import("effect/Schema").String>;
171
+ readonly default: null;
172
+ };
173
+ readonly title: {
174
+ readonly schema: import("effect/Schema").NullOr<import("effect/Schema").String>;
175
+ readonly default: null;
176
+ };
177
+ };
178
+ readonly group: "inline";
179
+ readonly draggable: true;
180
+ readonly parseDOM: readonly [{
181
+ readonly tag: "img[src]";
182
+ readonly getAttrs: (dom: HTMLElement) => {
183
+ src: string | null;
184
+ title: string | null;
185
+ alt: string | null;
186
+ };
187
+ }];
188
+ readonly toDOM: (node: Node<any, any>) => [string, {
189
+ src: any;
190
+ alt: any;
191
+ title: any;
192
+ }];
193
+ };
194
+ }, {}, readonly [], {}, {}>>;
195
+ /**
196
+ * The inline `hard_break` node.
197
+ *
198
+ * @since 0.1.0
199
+ * @category nodes
200
+ */
201
+ export declare const defineHardBreak: () => Extension<SpecTypes<{
202
+ readonly hard_break: {
203
+ readonly inline: true;
204
+ readonly group: "inline";
205
+ readonly selectable: false;
206
+ readonly parseDOM: readonly [{
207
+ readonly tag: "br";
208
+ }];
209
+ readonly toDOM: () => readonly any[] | readonly [string, ...any[]];
210
+ };
211
+ }, {}, readonly [], {}, {}>>;
212
+ /**
213
+ * The `link` mark.
214
+ *
215
+ * @since 0.1.0
216
+ * @category marks
217
+ */
218
+ export declare const defineLink: () => Extension<SpecTypes<{}, {
219
+ readonly link: {
220
+ readonly attrs: {
221
+ readonly href: import("effect/Schema").String;
222
+ readonly title: {
223
+ readonly schema: import("effect/Schema").NullOr<import("effect/Schema").String>;
224
+ readonly default: null;
225
+ };
226
+ };
227
+ readonly inclusive: false;
228
+ readonly parseDOM: readonly [{
229
+ readonly tag: "a[href]";
230
+ readonly getAttrs: (dom: HTMLElement) => {
231
+ href: string | null;
232
+ title: string | null;
233
+ };
234
+ }];
235
+ readonly toDOM: (node: Mark<any, any>) => [string, {
236
+ href: any;
237
+ title: any;
238
+ }, number];
239
+ };
240
+ }, readonly [], {}, {}>>;
241
+ /**
242
+ * The `em` mark.
243
+ *
244
+ * @since 0.1.0
245
+ * @category marks
246
+ */
247
+ export declare const defineEm: () => Extension<SpecTypes<{}, {
248
+ readonly em: {
249
+ readonly parseDOM: readonly [{
250
+ readonly tag: "i";
251
+ }, {
252
+ readonly tag: "em";
253
+ }, {
254
+ readonly style: "font-style=italic";
255
+ }, {
256
+ readonly style: "font-style=normal";
257
+ readonly clearMark: (m: Mark<any, any>) => boolean;
258
+ }];
259
+ readonly toDOM: () => readonly any[] | readonly [string, ...any[]];
260
+ };
261
+ }, readonly [], {}, {}>>;
262
+ /**
263
+ * The `strong` mark.
264
+ *
265
+ * @since 0.1.0
266
+ * @category marks
267
+ */
268
+ export declare const defineStrong: () => Extension<SpecTypes<{}, {
269
+ readonly strong: {
270
+ readonly parseDOM: readonly [{
271
+ readonly tag: "strong";
272
+ }, {
273
+ readonly tag: "b";
274
+ readonly getAttrs: (node: HTMLElement) => false | null;
275
+ }, {
276
+ readonly style: "font-weight=400";
277
+ readonly clearMark: (m: Mark<any, any>) => boolean;
278
+ }, {
279
+ readonly style: "font-weight";
280
+ readonly getAttrs: (value: string) => false | null;
281
+ }];
282
+ readonly toDOM: () => readonly any[] | readonly [string, ...any[]];
283
+ };
284
+ }, readonly [], {}, {}>>;
285
+ /**
286
+ * The `code` mark.
287
+ *
288
+ * @since 0.1.0
289
+ * @category marks
290
+ */
291
+ export declare const defineCode: () => Extension<SpecTypes<{}, {
292
+ readonly code: {
293
+ readonly code: true;
294
+ readonly parseDOM: readonly [{
295
+ readonly tag: "code";
296
+ }];
297
+ readonly toDOM: () => readonly any[] | readonly [string, ...any[]];
298
+ };
299
+ }, readonly [], {}, {}>>;
300
+ type MarkArgs<Sc, M extends string> = AttrsOptional<MarkSpecOf<Sc, M>> extends true ? [attrs?: MarkAttrsInput<Sc, M> | null, options?: ToggleMarkOptions] : [attrs: MarkAttrsInput<Sc, M>, options?: ToggleMarkOptions];
301
+ type NodeArgs<Sc, N extends string> = AttrsOptional<NodeSpecOf<Sc, N>> extends true ? [attrs?: NodeAttrsInput<Sc, N> | null] : [attrs: NodeAttrsInput<Sc, N>];
302
+ /**
303
+ * `toggleMark(name, attrs?, options?)`: toggles a mark of the editor's
304
+ * schema, by name.
305
+ *
306
+ * @since 0.1.0
307
+ * @category type-level
308
+ */
309
+ export interface ToggleMarkCommand extends CommandSignature {
310
+ readonly signature: <M extends MarkNames<this["Schema"]>>(mark: M, ...args: MarkArgs<this["Schema"], M>) => this["Return"];
311
+ }
312
+ /**
313
+ * A command taking a node name of the editor's schema and its
314
+ * attributes (`setBlockType`, `wrapIn`, `insertNode`).
315
+ *
316
+ * @since 0.1.0
317
+ * @category type-level
318
+ */
319
+ export interface NodeTypeCommand extends CommandSignature {
320
+ readonly signature: <N extends NodeNames<this["Schema"]>>(node: N, ...args: NodeArgs<this["Schema"], N>) => this["Return"];
321
+ }
322
+ /**
323
+ * The commands added by `defineBaseCommands`.
324
+ *
325
+ * @since 0.1.0
326
+ * @category type-level
327
+ */
328
+ export type BaseCommands = {
329
+ readonly toggleMark: ToggleMarkCommand;
330
+ readonly setBlockType: NodeTypeCommand;
331
+ readonly wrapIn: NodeTypeCommand;
332
+ readonly insertNode: NodeTypeCommand;
333
+ readonly insertText: readonly [text: string, from?: number, to?: number];
334
+ readonly deleteSelection: readonly [];
335
+ readonly selectAll: readonly [];
336
+ readonly selectParentNode: readonly [];
337
+ readonly joinUp: readonly [];
338
+ readonly joinDown: readonly [];
339
+ readonly joinBackward: readonly [];
340
+ readonly joinForward: readonly [];
341
+ readonly lift: readonly [];
342
+ readonly splitBlock: readonly [];
343
+ };
344
+ /**
345
+ * Commands wrapping the core editing commands. Node and mark types are
346
+ * referenced by name and typed against the editor's final schema:
347
+ * `editor.commands.toggleMark("strong")` only type-checks when the
348
+ * schema has a `strong` mark. Commands referring to a type the schema
349
+ * doesn't have don't apply.
350
+ *
351
+ * @since 0.1.0
352
+ * @category commands
353
+ */
354
+ export declare const defineBaseCommands: () => CommandsExtension<BaseCommands>;
355
+ /**
356
+ * The platform's base keymap (`baseKeymap` from `@thomasfosterau/effect-richtext/commands`:
357
+ * Enter, Backspace, Delete, Mod-a, …), at low priority so that other
358
+ * keymaps take precedence.
359
+ *
360
+ * @since 0.1.0
361
+ * @category keymaps
362
+ */
363
+ export declare const defineBaseKeymap: () => Extension<SpecTypes<{}, {}, readonly [], Keymap, {}>>;
364
+ /**
365
+ * Undo history: the `history` plugin, `undo`/`redo` commands, and
366
+ * **Mod-z** (undo), **Mod-y** and **Shift-Mod-z** (redo) bindings.
367
+ * Include it at most once per editor (the history plugin is keyed).
368
+ *
369
+ * @since 0.1.0
370
+ * @category history
371
+ */
372
+ export declare const defineHistory: (options?: HistoryOptions) => Extension<MergeTypes<SpecTypes<{}, {}, readonly [Plugin<HistoryState, AnySchema, never, never>], {}, {}> | SpecTypes<{}, {}, readonly [], {
373
+ readonly "Mod-z": HistoryCommand;
374
+ readonly "Mod-y": HistoryCommand;
375
+ readonly "Shift-Mod-z": HistoryCommand;
376
+ }, {}> | SpecTypes<{}, {}, readonly [], {}, {
377
+ readonly undo: () => (state: EditorState<any, any, any>, dispatch?: Dispatch<any> | undefined, view?: EditorViewLike) => Effect.Effect<boolean>;
378
+ readonly redo: () => (state: EditorState<any, any, any>, dispatch?: Dispatch<any> | undefined, view?: EditorViewLike) => Effect.Effect<boolean>;
379
+ }>>>;
380
+ /**
381
+ * `wrapInList(name, attrs?)`.
382
+ *
383
+ * @since 0.1.0
384
+ * @category type-level
385
+ */
386
+ export type ListCommands = {
387
+ readonly wrapInList: NodeTypeCommand;
388
+ readonly splitListItem: readonly [];
389
+ readonly liftListItem: readonly [];
390
+ readonly sinkListItem: readonly [];
391
+ };
392
+ /**
393
+ * Lists: the `ordered_list`, `bullet_list` (both in the `block` group)
394
+ * and `list_item` (`paragraph block*`) nodes, the list commands
395
+ * (`wrapInList(name, attrs?)`, `splitListItem`, `liftListItem`,
396
+ * `sinkListItem`), and **Enter** (split item), **Mod-[** (lift) and
397
+ * **Mod-]** (sink) bindings.
398
+ *
399
+ * @since 0.1.0
400
+ * @category lists
401
+ */
402
+ export declare const defineList: () => Extension<MergeTypes<SpecTypes<{
403
+ readonly ordered_list: {
404
+ readonly attrs: {
405
+ readonly order: {
406
+ readonly schema: import("effect/Schema").Number;
407
+ readonly default: 1;
408
+ };
409
+ };
410
+ readonly parseDOM: readonly [{
411
+ readonly tag: "ol";
412
+ readonly getAttrs: (dom: HTMLElement) => {
413
+ order: number;
414
+ };
415
+ }];
416
+ readonly toDOM: (node: Node<any, any>) => readonly any[];
417
+ } & {
418
+ readonly content: ContentExpr<"list_item">;
419
+ readonly group: "block";
420
+ };
421
+ }, {}, readonly [], {}, {}> | SpecTypes<{
422
+ readonly bullet_list: {
423
+ readonly parseDOM: readonly [{
424
+ readonly tag: "ul";
425
+ }];
426
+ readonly toDOM: () => readonly any[] | readonly [string, ...any[]];
427
+ } & {
428
+ readonly content: ContentExpr<"list_item">;
429
+ readonly group: "block";
430
+ };
431
+ }, {}, readonly [], {}, {}> | SpecTypes<{
432
+ readonly list_item: {
433
+ readonly parseDOM: readonly [{
434
+ readonly tag: "li";
435
+ }];
436
+ readonly toDOM: () => readonly any[] | readonly [string, ...any[]];
437
+ readonly defining: true;
438
+ } & {
439
+ readonly content: ContentExpr<"block" | "paragraph">;
440
+ };
441
+ }, {}, readonly [], {}, {}> | SpecTypes<{}, {}, readonly [], {
442
+ readonly Enter: Command<any>;
443
+ readonly "Mod-[": Command<any>;
444
+ readonly "Mod-]": Command<any>;
445
+ }, {}> | {
446
+ readonly nodes: {};
447
+ readonly marks: {};
448
+ readonly commands: ListCommands;
449
+ readonly E: never;
450
+ readonly R: never;
451
+ }>>;
452
+ /**
453
+ * Everything above: the nodes and marks of `@thomasfosterau/effect-richtext/schema-basic`,
454
+ * lists, base commands, the base keymap and history.
455
+ *
456
+ * @since 0.1.0
457
+ * @category basic
458
+ */
459
+ export declare const defineBasicExtension: (options?: {
460
+ readonly history?: HistoryOptions | undefined;
461
+ }) => Extension<MergeTypes<SpecTypes<{
462
+ readonly doc: {
463
+ readonly content: ContentExpr<"block">;
464
+ };
465
+ }, {}, readonly [], {}, {}> | SpecTypes<{
466
+ readonly text: {
467
+ readonly group: "inline";
468
+ };
469
+ }, {}, readonly [], {}, {}> | SpecTypes<{
470
+ readonly paragraph: {
471
+ readonly content: ContentExpr<"inline">;
472
+ readonly group: "block";
473
+ readonly parseDOM: readonly [{
474
+ readonly tag: "p";
475
+ }];
476
+ readonly toDOM: () => readonly any[] | readonly [string, ...any[]];
477
+ };
478
+ }, {}, readonly [], {}, {}> | SpecTypes<{
479
+ readonly heading: {
480
+ readonly attrs: {
481
+ readonly level: {
482
+ readonly schema: import("effect/Schema").Number;
483
+ readonly default: 1;
484
+ };
485
+ };
486
+ readonly content: ContentExpr<"inline">;
487
+ readonly group: "block";
488
+ readonly defining: true;
489
+ readonly parseDOM: readonly [{
490
+ readonly tag: "h1";
491
+ readonly attrs: {
492
+ readonly level: 1;
493
+ };
494
+ }, {
495
+ readonly tag: "h2";
496
+ readonly attrs: {
497
+ readonly level: 2;
498
+ };
499
+ }, {
500
+ readonly tag: "h3";
501
+ readonly attrs: {
502
+ readonly level: 3;
503
+ };
504
+ }, {
505
+ readonly tag: "h4";
506
+ readonly attrs: {
507
+ readonly level: 4;
508
+ };
509
+ }, {
510
+ readonly tag: "h5";
511
+ readonly attrs: {
512
+ readonly level: 5;
513
+ };
514
+ }, {
515
+ readonly tag: "h6";
516
+ readonly attrs: {
517
+ readonly level: 6;
518
+ };
519
+ }];
520
+ readonly toDOM: (node: Node<any, any>) => [string, number];
521
+ };
522
+ }, {}, readonly [], {}, {}> | SpecTypes<{
523
+ readonly blockquote: {
524
+ readonly content: ContentExpr<"block">;
525
+ readonly group: "block";
526
+ readonly defining: true;
527
+ readonly parseDOM: readonly [{
528
+ readonly tag: "blockquote";
529
+ }];
530
+ readonly toDOM: () => readonly any[] | readonly [string, ...any[]];
531
+ };
532
+ }, {}, readonly [], {}, {}> | SpecTypes<{
533
+ readonly horizontal_rule: {
534
+ readonly group: "block";
535
+ readonly parseDOM: readonly [{
536
+ readonly tag: "hr";
537
+ }];
538
+ readonly toDOM: () => readonly any[] | readonly [string, ...any[]];
539
+ };
540
+ }, {}, readonly [], {}, {}> | SpecTypes<{
541
+ readonly code_block: {
542
+ readonly content: ContentExpr<"text">;
543
+ readonly marks: "";
544
+ readonly group: "block";
545
+ readonly code: true;
546
+ readonly defining: true;
547
+ readonly parseDOM: readonly [{
548
+ readonly tag: "pre";
549
+ readonly preserveWhitespace: "full";
550
+ }];
551
+ readonly toDOM: () => readonly any[] | readonly [string, ...any[]];
552
+ };
553
+ }, {}, readonly [], {}, {}> | SpecTypes<{
554
+ readonly image: {
555
+ readonly inline: true;
556
+ readonly attrs: {
557
+ readonly src: import("effect/Schema").String;
558
+ readonly alt: {
559
+ readonly schema: import("effect/Schema").NullOr<import("effect/Schema").String>;
560
+ readonly default: null;
561
+ };
562
+ readonly title: {
563
+ readonly schema: import("effect/Schema").NullOr<import("effect/Schema").String>;
564
+ readonly default: null;
565
+ };
566
+ };
567
+ readonly group: "inline";
568
+ readonly draggable: true;
569
+ readonly parseDOM: readonly [{
570
+ readonly tag: "img[src]";
571
+ readonly getAttrs: (dom: HTMLElement) => {
572
+ src: string | null;
573
+ title: string | null;
574
+ alt: string | null;
575
+ };
576
+ }];
577
+ readonly toDOM: (node: Node<any, any>) => [string, {
578
+ src: any;
579
+ alt: any;
580
+ title: any;
581
+ }];
582
+ };
583
+ }, {}, readonly [], {}, {}> | SpecTypes<{
584
+ readonly hard_break: {
585
+ readonly inline: true;
586
+ readonly group: "inline";
587
+ readonly selectable: false;
588
+ readonly parseDOM: readonly [{
589
+ readonly tag: "br";
590
+ }];
591
+ readonly toDOM: () => readonly any[] | readonly [string, ...any[]];
592
+ };
593
+ }, {}, readonly [], {}, {}> | SpecTypes<{}, {
594
+ readonly link: {
595
+ readonly attrs: {
596
+ readonly href: import("effect/Schema").String;
597
+ readonly title: {
598
+ readonly schema: import("effect/Schema").NullOr<import("effect/Schema").String>;
599
+ readonly default: null;
600
+ };
601
+ };
602
+ readonly inclusive: false;
603
+ readonly parseDOM: readonly [{
604
+ readonly tag: "a[href]";
605
+ readonly getAttrs: (dom: HTMLElement) => {
606
+ href: string | null;
607
+ title: string | null;
608
+ };
609
+ }];
610
+ readonly toDOM: (node: Mark<any, any>) => [string, {
611
+ href: any;
612
+ title: any;
613
+ }, number];
614
+ };
615
+ }, readonly [], {}, {}> | SpecTypes<{}, {
616
+ readonly em: {
617
+ readonly parseDOM: readonly [{
618
+ readonly tag: "i";
619
+ }, {
620
+ readonly tag: "em";
621
+ }, {
622
+ readonly style: "font-style=italic";
623
+ }, {
624
+ readonly style: "font-style=normal";
625
+ readonly clearMark: (m: Mark<any, any>) => boolean;
626
+ }];
627
+ readonly toDOM: () => readonly any[] | readonly [string, ...any[]];
628
+ };
629
+ }, readonly [], {}, {}> | SpecTypes<{}, {
630
+ readonly strong: {
631
+ readonly parseDOM: readonly [{
632
+ readonly tag: "strong";
633
+ }, {
634
+ readonly tag: "b";
635
+ readonly getAttrs: (node: HTMLElement) => false | null;
636
+ }, {
637
+ readonly style: "font-weight=400";
638
+ readonly clearMark: (m: Mark<any, any>) => boolean;
639
+ }, {
640
+ readonly style: "font-weight";
641
+ readonly getAttrs: (value: string) => false | null;
642
+ }];
643
+ readonly toDOM: () => readonly any[] | readonly [string, ...any[]];
644
+ };
645
+ }, readonly [], {}, {}> | SpecTypes<{}, {
646
+ readonly code: {
647
+ readonly code: true;
648
+ readonly parseDOM: readonly [{
649
+ readonly tag: "code";
650
+ }];
651
+ readonly toDOM: () => readonly any[] | readonly [string, ...any[]];
652
+ };
653
+ }, readonly [], {}, {}> | SpecTypes<{}, {}, readonly [], Keymap, {}> | MergeTypes<SpecTypes<{}, {}, readonly [Plugin<HistoryState, AnySchema, never, never>], {}, {}> | SpecTypes<{}, {}, readonly [], {
654
+ readonly "Mod-z": HistoryCommand;
655
+ readonly "Mod-y": HistoryCommand;
656
+ readonly "Shift-Mod-z": HistoryCommand;
657
+ }, {}> | SpecTypes<{}, {}, readonly [], {}, {
658
+ readonly undo: () => (state: EditorState<any, any, any>, dispatch?: Dispatch<any> | undefined, view?: EditorViewLike) => Effect.Effect<boolean>;
659
+ readonly redo: () => (state: EditorState<any, any, any>, dispatch?: Dispatch<any> | undefined, view?: EditorViewLike) => Effect.Effect<boolean>;
660
+ }>> | MergeTypes<SpecTypes<{
661
+ readonly ordered_list: {
662
+ readonly attrs: {
663
+ readonly order: {
664
+ readonly schema: import("effect/Schema").Number;
665
+ readonly default: 1;
666
+ };
667
+ };
668
+ readonly parseDOM: readonly [{
669
+ readonly tag: "ol";
670
+ readonly getAttrs: (dom: HTMLElement) => {
671
+ order: number;
672
+ };
673
+ }];
674
+ readonly toDOM: (node: Node<any, any>) => readonly any[];
675
+ } & {
676
+ readonly content: ContentExpr<"list_item">;
677
+ readonly group: "block";
678
+ };
679
+ }, {}, readonly [], {}, {}> | SpecTypes<{
680
+ readonly bullet_list: {
681
+ readonly parseDOM: readonly [{
682
+ readonly tag: "ul";
683
+ }];
684
+ readonly toDOM: () => readonly any[] | readonly [string, ...any[]];
685
+ } & {
686
+ readonly content: ContentExpr<"list_item">;
687
+ readonly group: "block";
688
+ };
689
+ }, {}, readonly [], {}, {}> | SpecTypes<{
690
+ readonly list_item: {
691
+ readonly parseDOM: readonly [{
692
+ readonly tag: "li";
693
+ }];
694
+ readonly toDOM: () => readonly any[] | readonly [string, ...any[]];
695
+ readonly defining: true;
696
+ } & {
697
+ readonly content: ContentExpr<"block" | "paragraph">;
698
+ };
699
+ }, {}, readonly [], {}, {}> | SpecTypes<{}, {}, readonly [], {
700
+ readonly Enter: Command<any>;
701
+ readonly "Mod-[": Command<any>;
702
+ readonly "Mod-]": Command<any>;
703
+ }, {}> | {
704
+ readonly nodes: {};
705
+ readonly marks: {};
706
+ readonly commands: ListCommands;
707
+ readonly E: never;
708
+ readonly R: never;
709
+ }> | {
710
+ readonly nodes: {};
711
+ readonly marks: {};
712
+ readonly commands: BaseCommands;
713
+ readonly E: never;
714
+ readonly R: never;
715
+ }>>;
716
+ export {};