@zuilib/text-editor 0.11.1 → 0.12.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 (49) hide show
  1. package/CHANGELOG.md +174 -18
  2. package/DRAWING_FORMAT.md +23 -21
  3. package/README.md +485 -67
  4. package/dist/chunk-32RX4GZF.js +2 -0
  5. package/dist/chunk-3TZVOXWX.js +16 -0
  6. package/dist/chunk-5VRVC56Y.js +2 -0
  7. package/dist/chunk-7Z3CW6Q3.js +2 -0
  8. package/dist/chunk-A7MCBSAZ.js +2 -0
  9. package/dist/chunk-AGTPMKLK.js +2 -0
  10. package/dist/chunk-C7VEINKX.js +2 -0
  11. package/dist/chunk-LDVPFZCN.js +2 -0
  12. package/dist/chunk-N5JWZ2VW.js +9 -0
  13. package/dist/chunk-QKHMJQO3.js +2 -0
  14. package/dist/chunk-R5PL4Q7X.js +5 -0
  15. package/dist/chunk-SDICQI2B.js +2 -0
  16. package/dist/chunk-TGVEPLDM.js +1 -0
  17. package/dist/chunk-XP3MZRCW.js +2 -0
  18. package/dist/chunk-XRJNLGI4.js +2 -0
  19. package/dist/chunk-YFFSTMIR.js +2 -0
  20. package/dist/chunk-ZXZMYJ7F.js +2 -0
  21. package/dist/comment-markers-BrrrAdSL.d.ts +27 -0
  22. package/dist/comments.d.ts +68 -0
  23. package/dist/comments.js +2 -0
  24. package/dist/drawing-data-EWzEQ1_i.d.ts +111 -0
  25. package/dist/drawing-preset-Ag7a7F9h.d.ts +69 -0
  26. package/dist/drawing.d.ts +7 -0
  27. package/dist/drawing.js +2 -0
  28. package/dist/image-node-kR1Zf5kz.d.ts +70 -0
  29. package/dist/images.d.ts +66 -0
  30. package/dist/images.js +2 -0
  31. package/dist/index-A4S7bRwQ.d.ts +425 -0
  32. package/dist/index.d.ts +36 -1394
  33. package/dist/index.js +1 -7449
  34. package/dist/lexical.d.ts +117 -0
  35. package/dist/lexical.js +2 -0
  36. package/dist/markdown.d.ts +29 -0
  37. package/dist/markdown.js +2 -0
  38. package/dist/mention-node-eSsjUpaE.d.ts +44 -0
  39. package/dist/mentions-plugin-gio3_XKd.d.ts +74 -0
  40. package/dist/mentions.d.ts +5 -0
  41. package/dist/mentions.js +2 -0
  42. package/dist/mermaid-BwGHjwpk.d.ts +553 -0
  43. package/dist/paste.d.ts +45 -0
  44. package/dist/paste.js +2 -0
  45. package/dist/presets-BtNPH0pa.d.ts +78 -0
  46. package/dist/styles.css +402 -95
  47. package/dist/table-grid-D70tNhp2.d.ts +459 -0
  48. package/package.json +52 -7
  49. package/dist/index.css +0 -79
@@ -0,0 +1,78 @@
1
+ import { ReactNode } from 'react';
2
+ import { Klass, LexicalNode } from 'lexical';
3
+ import { Transformer } from '@lexical/markdown';
4
+
5
+ /**
6
+ * Horizontal sizing of a block that would otherwise span the editor:
7
+ *
8
+ * - `full` — the container width (the content pane, minus its gutters).
9
+ * The default; omitted when serialised.
10
+ * - `text` — the text column: the block's edges align with the paragraphs
11
+ * around it. Only differs from `full` when a text-column cap is set
12
+ * (`--zui-text-editor-measure` / the `maxTextWidth` prop); otherwise the
13
+ * two are visually identical.
14
+ * - `content` — shrinks to fit what is inside (table columns, drawing
15
+ * shapes), left-aligned with the text and never wider than the column.
16
+ */
17
+ type BlockWidth = 'full' | 'text' | 'content';
18
+ declare const BLOCK_WIDTHS: readonly BlockWidth[];
19
+ declare function isBlockWidth(value: unknown): value is BlockWidth;
20
+ /**
21
+ * Width written into the markdown when a new table / drawing is inserted
22
+ * (`MarkdownEditor.Root`'s `newBlockWidth`). Only affects insertion:
23
+ * existing markdown without a width marker always means `full`.
24
+ */
25
+ type NewBlockWidths = Readonly<{
26
+ table?: BlockWidth;
27
+ drawing?: BlockWidth;
28
+ }>;
29
+
30
+ /**
31
+ * "Ink" rendering: one confident pen stroke instead of a plotted outline.
32
+ * Every shape's centerline is resampled densely, displaced along its normal
33
+ * by a smooth low-frequency field (two sines, integer frequencies on closed
34
+ * paths so the seam is continuous) and widened by a slowly varying pressure
35
+ * factor. The result is a filled ring path, not an SVG stroke, so the width
36
+ * can breathe along the path. Everything is seeded from the shape id: the
37
+ * same shape draws the same way on every render, undo, export and machine.
38
+ *
39
+ * This is a renderer concern only — the drawing format never sees it.
40
+ */
41
+ type DrawingStyle = 'clean' | 'ink';
42
+
43
+ /**
44
+ * What an entry point wires into the composer before the host's own
45
+ * `nodes` / `transformers` / children are applied. The default entry adds
46
+ * the drawing node, its transformers and `DrawingPlugin` on top of `CORE`.
47
+ */
48
+ type EditorPreset = Readonly<{
49
+ nodes: ReadonlyArray<Klass<LexicalNode>>;
50
+ /** Full import / export set, in matching order */
51
+ transformers: readonly Transformer[];
52
+ /** Non-visual plugins mounted under the composer */
53
+ plugins?: ReactNode;
54
+ }>;
55
+ declare const MARKDOWN_NODES: ReadonlyArray<Klass<LexicalNode>>;
56
+ /**
57
+ * Markdown transformers of the `./core` entry (no drawings). FRONTMATTER
58
+ * first so it claims a leading `---` block before anything else, then LISTS
59
+ * and CHECK_LIST so they match before UNORDERED_LIST on import. CODE_BLOCK
60
+ * replaces CODE so untagged blocks export as bare fences.
61
+ */
62
+ declare const MARKDOWN_TRANSFORMERS: readonly Transformer[];
63
+ declare const MARKDOWN_PRESET: EditorPreset;
64
+ type TransformersInput = readonly Transformer[] | ((defaults: readonly Transformer[]) => readonly Transformer[]);
65
+ /**
66
+ * The import / export list for a host's `transformers` prop: an array is
67
+ * placed before the defaults (so it claims its syntax first); a function
68
+ * receives the defaults and returns the whole list.
69
+ */
70
+ declare function resolveTransformers(defaults: readonly Transformer[], prop: TransformersInput | undefined): Transformer[];
71
+ /**
72
+ * The typing-shortcut subset of a transformer list: fenced blocks are
73
+ * handled by CodeBlockShortcutPlugin, checklists by ChecklistShortcutPlugin
74
+ * and the remaining multiline transformers only make sense on import.
75
+ */
76
+ declare function shortcutTransformers(transformers: readonly Transformer[]): Transformer[];
77
+
78
+ export { BLOCK_WIDTHS as B, type DrawingStyle as D, type EditorPreset as E, MARKDOWN_NODES as M, type NewBlockWidths as N, type TransformersInput as T, type BlockWidth as a, MARKDOWN_PRESET as b, MARKDOWN_TRANSFORMERS as c, isBlockWidth as i, resolveTransformers as r, shortcutTransformers as s };