jenosize-ui 0.2.2 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/README.md +183 -63
  2. package/THIRD-PARTY-NOTICES.md +95 -0
  3. package/dist/GradientPicker-Bv3V3vL_.d.ts +144 -0
  4. package/dist/{PaymentInput-Dn5WVQVy.d.ts → PaymentInput-s7_s3UDi.d.ts} +1 -1
  5. package/dist/{Select-Dt5ARIH8.d.ts → Select-r233iMaU.d.ts} +15 -1
  6. package/dist/{TagInput-BaBeve6L.d.ts → TagInput-w_l9Fp5i.d.ts} +1 -1
  7. package/dist/area-chart.d.ts +2 -2
  8. package/dist/area-chart.js +8 -6
  9. package/dist/at-least-one-BZ2dsck-.d.ts +18 -0
  10. package/dist/avatar.d.ts +1 -1
  11. package/dist/avatar.js +12 -10
  12. package/dist/badge.d.ts +1 -1
  13. package/dist/badge.js +7 -6
  14. package/dist/bar-chart.d.ts +2 -2
  15. package/dist/bar-chart.js +8 -6
  16. package/dist/breadcrumb.d.ts +1 -1
  17. package/dist/breadcrumb.js +5 -4
  18. package/dist/button.d.ts +1 -1
  19. package/dist/button.js +12 -10
  20. package/dist/calendar.d.ts +1 -1
  21. package/dist/calendar.js +16 -14
  22. package/dist/callout.d.ts +4 -2
  23. package/dist/callout.js +13 -11
  24. package/dist/card.d.ts +59 -3
  25. package/dist/card.js +4 -3
  26. package/dist/carousel.d.ts +169 -0
  27. package/dist/carousel.js +10 -0
  28. package/dist/catalog.json +11976 -0
  29. package/dist/checkbox.js +9 -7
  30. package/dist/{chunk-AIARANKE.js → chunk-2EUVBRKG.js} +4 -4
  31. package/dist/{chunk-5ZEUTSCV.js → chunk-2RRPWOKT.js} +6 -6
  32. package/dist/{chunk-DD5KJVFV.js → chunk-3JFSKCVU.js} +19 -19
  33. package/dist/{chunk-OACWA4TC.js → chunk-3ZZZPT5G.js} +6 -6
  34. package/dist/{chunk-LQURV7HQ.js → chunk-47EOHGXM.js} +4 -4
  35. package/dist/{chunk-CGHYXWTT.js → chunk-4KRCT3Q2.js} +4 -4
  36. package/dist/chunk-4P3JA653.js +1129 -0
  37. package/dist/{chunk-FWRHBMWT.js → chunk-4Y32RIC7.js} +5 -19
  38. package/dist/{chunk-BBKE4W3B.js → chunk-5Z26DU23.js} +7 -7
  39. package/dist/{chunk-7QXOGAN6.js → chunk-6CJYVYVN.js} +87 -538
  40. package/dist/{chunk-3HOHLQVP.js → chunk-6FGLABYH.js} +3 -3
  41. package/dist/{chunk-GQRSABRN.js → chunk-6Q4VVBFO.js} +4 -4
  42. package/dist/{chunk-MCQG4H6T.js → chunk-6T3QAO5K.js} +12 -4
  43. package/dist/chunk-7JOW3LEH.js +4852 -0
  44. package/dist/{chunk-AFYXSZGW.js → chunk-7LSUUEAF.js} +7 -5
  45. package/dist/{chunk-7VLYQR4D.js → chunk-7OFGPDYJ.js} +3 -3
  46. package/dist/{chunk-7GUPNTAH.js → chunk-7RD5RTHU.js} +7 -7
  47. package/dist/{chunk-X2VMIBK5.js → chunk-A36W77MQ.js} +4 -4
  48. package/dist/chunk-AZFHRLYF.js +67 -0
  49. package/dist/{chunk-CFFWYXDW.js → chunk-B6LYO33Y.js} +5 -5
  50. package/dist/{chunk-P6CON2R2.js → chunk-BH32X25C.js} +3 -3
  51. package/dist/{chunk-KHGW72BM.js → chunk-CH2XMCWX.js} +3 -3
  52. package/dist/{chunk-FNQJJO63.js → chunk-D46OKHTH.js} +4 -4
  53. package/dist/{chunk-LE44X5GS.js → chunk-D4YGYNNY.js} +9 -9
  54. package/dist/{chunk-T5574MXM.js → chunk-D7WD4SUC.js} +8 -8
  55. package/dist/{chunk-33TOK7ES.js → chunk-DCKVNHV5.js} +5 -5
  56. package/dist/chunk-EBZNUQ6E.js +525 -0
  57. package/dist/{chunk-22M75A3N.js → chunk-ED5UCYAV.js} +14 -11
  58. package/dist/{chunk-IQNVSQRK.js → chunk-EDVYLO2N.js} +5 -5
  59. package/dist/{chunk-N3RVMBPX.js → chunk-EJKQGUUM.js} +4 -4
  60. package/dist/{chunk-POQTE7JI.js → chunk-EKQLIUV5.js} +7 -7
  61. package/dist/{chunk-ULGCGKOE.js → chunk-EKV3CVTY.js} +4 -4
  62. package/dist/{chunk-LCG34A5T.js → chunk-EVINS473.js} +5 -3
  63. package/dist/{chunk-ZZSNTCCL.js → chunk-G7B2QUQP.js} +4 -4
  64. package/dist/{chunk-SB3DG572.js → chunk-GHRZC5LS.js} +6 -6
  65. package/dist/{chunk-5YWH2ANQ.js → chunk-GIC6T647.js} +11 -10
  66. package/dist/{chunk-7ZM7SNCZ.js → chunk-GPHGPY6T.js} +3 -3
  67. package/dist/chunk-GV2KTRRP.js +325 -0
  68. package/dist/{chunk-4RBIWI2Q.js → chunk-GYL4KOPT.js} +3 -3
  69. package/dist/{chunk-5KSD4WKN.js → chunk-HB6UA6EF.js} +5 -5
  70. package/dist/{chunk-CGZXQ7PA.js → chunk-HNNNJP3A.js} +3 -3
  71. package/dist/chunk-HTWGTTSF.js +1011 -0
  72. package/dist/chunk-IH2F5UNQ.js +109 -0
  73. package/dist/{chunk-QNIKRB62.js → chunk-INYUL4DX.js} +4 -4
  74. package/dist/{chunk-SKRR3ZMP.js → chunk-IUB5TSSH.js} +3 -3
  75. package/dist/chunk-JGGSRKHW.js +344 -0
  76. package/dist/{chunk-ZR6HNKSN.js → chunk-JHHJNIW2.js} +3 -3
  77. package/dist/chunk-KBI442IB.js +113 -0
  78. package/dist/chunk-KBQJIVUB.js +33 -0
  79. package/dist/{chunk-3QXLIZIX.js → chunk-KNGJ3CSB.js} +3 -3
  80. package/dist/chunk-KNKR5TUM.js +183 -0
  81. package/dist/{chunk-KZP6B6B3.js → chunk-KTWTYK5U.js} +16 -5
  82. package/dist/{chunk-5XPMY2LF.js → chunk-LKUAVDWP.js} +5 -5
  83. package/dist/{chunk-YHBI52P2.js → chunk-LPWSP523.js} +3 -3
  84. package/dist/{chunk-GLKFFA7N.js → chunk-LY7IJOUF.js} +5 -5
  85. package/dist/{chunk-R4Z7BINC.js → chunk-LYWQD5KL.js} +8 -8
  86. package/dist/{chunk-LLPWQDF7.js → chunk-MTOTPAYZ.js} +3 -3
  87. package/dist/{chunk-AZ7DKRBY.js → chunk-MVF7FA4D.js} +5 -5
  88. package/dist/{chunk-AIGYMTCU.js → chunk-MVUNB43J.js} +3 -3
  89. package/dist/{chunk-T4ZFZTY6.js → chunk-N7DLNDER.js} +4 -4
  90. package/dist/{chunk-E2YZ7IMT.js → chunk-NDRQETOQ.js} +15 -11
  91. package/dist/{chunk-ZD3MOLIB.js → chunk-O7CPRU67.js} +4 -4
  92. package/dist/{chunk-OLLD2BZN.js → chunk-OEYKTHG7.js} +3 -3
  93. package/dist/{chunk-TX57TNJS.js → chunk-OG3H3RP2.js} +9 -9
  94. package/dist/{chunk-UGBNYSBN.js → chunk-PFKPKE6O.js} +20 -34
  95. package/dist/chunk-PRWPFBA5.js +619 -0
  96. package/dist/{chunk-QDKETK7D.js → chunk-S55JKMG7.js} +5 -5
  97. package/dist/{chunk-QDYE5LVT.js → chunk-SF3HCW4G.js} +45 -4
  98. package/dist/{chunk-6MMBQVRO.js → chunk-TDKKZA63.js} +9 -9
  99. package/dist/{chunk-HHYEAFCL.js → chunk-TDXHBS2C.js} +11 -11
  100. package/dist/{chunk-74AIU53R.js → chunk-THGGU64E.js} +3 -3
  101. package/dist/chunk-UHSGD4CD.js +364 -0
  102. package/dist/{chunk-HV2W6HUR.js → chunk-URAURI6G.js} +10 -10
  103. package/dist/{chunk-D6XO4JVM.js → chunk-UU6KUS5O.js} +42 -20
  104. package/dist/{chunk-NKG4N6HA.js → chunk-V7KEEDSF.js} +5 -4
  105. package/dist/{chunk-IEAWNA3V.js → chunk-VDFWWWLL.js} +3 -3
  106. package/dist/chunk-VHAA22YE.js +11 -0
  107. package/dist/chunk-WJB5GWAZ.js +20 -0
  108. package/dist/{chunk-KJ5JUS53.js → chunk-WM6DGNIA.js} +9 -9
  109. package/dist/{chunk-MFFA5MXY.js → chunk-WUXMLJEC.js} +5 -5
  110. package/dist/{chunk-YPNL2NBD.js → chunk-XNXBO44X.js} +33 -11
  111. package/dist/chunk-XPY3XT7L.js +5671 -0
  112. package/dist/{chunk-54SIZR63.js → chunk-XVFRDKZJ.js} +7 -7
  113. package/dist/{chunk-LYXPJERB.js → chunk-YDD46AX2.js} +5 -5
  114. package/dist/{chunk-NC63TYNW.js → chunk-YHQJGNXD.js} +7 -7
  115. package/dist/{chunk-I6WMNXC7.js → chunk-YKRE5NIH.js} +6 -6
  116. package/dist/{chunk-RJTVCA62.js → chunk-ZIEGUI25.js} +3 -3
  117. package/dist/{chunk-5DP7W5HX.js → chunk-ZLDWYTDA.js} +3 -3
  118. package/dist/color-input.d.ts +93 -0
  119. package/dist/color-input.js +36 -0
  120. package/dist/color-picker.d.ts +268 -0
  121. package/dist/color-picker.js +29 -0
  122. package/dist/color-value-DYzChVOW.d.ts +129 -0
  123. package/dist/combobox.d.ts +1 -1
  124. package/dist/combobox.js +14 -12
  125. package/dist/data-map.d.ts +1673 -0
  126. package/dist/data-map.js +36 -0
  127. package/dist/date-calendar.d.ts +49 -0
  128. package/dist/date-calendar.js +13 -0
  129. package/dist/date-input.d.ts +1 -1
  130. package/dist/date-input.js +12 -10
  131. package/dist/date-picker.d.ts +15 -131
  132. package/dist/date-picker.js +26 -21
  133. package/dist/date-types-CLZek3W2.d.ts +100 -0
  134. package/dist/dialog.d.ts +1 -1
  135. package/dist/dialog.js +10 -9
  136. package/dist/drawer.d.ts +1 -1
  137. package/dist/drawer.js +9 -8
  138. package/dist/dropdown-menu.d.ts +1 -1
  139. package/dist/dropdown-menu.js +5 -4
  140. package/dist/dropzone.d.ts +3 -3
  141. package/dist/dropzone.js +18 -16
  142. package/dist/file-trigger.js +1 -0
  143. package/dist/form.d.ts +15 -5
  144. package/dist/form.js +75 -35
  145. package/dist/header-navigation.d.ts +2 -2
  146. package/dist/header-navigation.js +20 -18
  147. package/dist/helper.d.ts +1 -1
  148. package/dist/helper.js +1 -0
  149. package/dist/illustration.js +1 -0
  150. package/dist/index.d.ts +26 -11
  151. package/dist/index.js +92 -77
  152. package/dist/indicator.js +5 -4
  153. package/dist/inline-banner.d.ts +68 -0
  154. package/dist/inline-banner.js +21 -0
  155. package/dist/input.d.ts +1 -1
  156. package/dist/input.js +11 -9
  157. package/dist/kanban-board.d.ts +2 -2
  158. package/dist/kanban-board.js +15 -13
  159. package/dist/labels-CuSlirP_.d.ts +1381 -0
  160. package/dist/line-chart.d.ts +2 -2
  161. package/dist/line-chart.js +8 -6
  162. package/dist/mcp.js +231 -0
  163. package/dist/number-input.d.ts +1 -1
  164. package/dist/number-input.js +11 -9
  165. package/dist/pagination.d.ts +1 -1
  166. package/dist/pagination.js +15 -13
  167. package/dist/{card-D56VxyAe.d.ts → panel-CUGm_Mxy.d.ts} +9 -57
  168. package/dist/payment-input.d.ts +3 -3
  169. package/dist/payment-input.js +11 -9
  170. package/dist/picker-draft-BPV3MUPY.d.ts +9 -0
  171. package/dist/pie-chart.d.ts +2 -2
  172. package/dist/pie-chart.js +8 -6
  173. package/dist/popover.d.ts +65 -4
  174. package/dist/popover.js +9 -8
  175. package/dist/progress-steps.js +5 -4
  176. package/dist/progress.js +4 -3
  177. package/dist/provider.d.ts +1 -1
  178. package/dist/provider.js +4 -3
  179. package/dist/qr-code.d.ts +227 -0
  180. package/dist/qr-code.js +20 -0
  181. package/dist/radar-chart.d.ts +2 -2
  182. package/dist/radar-chart.js +8 -6
  183. package/dist/radial-chart.d.ts +2 -2
  184. package/dist/radial-chart.js +8 -6
  185. package/dist/radio.js +9 -7
  186. package/dist/rich-text-editor.d.ts +624 -0
  187. package/dist/rich-text-editor.js +52 -0
  188. package/dist/rich-text-highlight.d.ts +11 -0
  189. package/dist/rich-text-highlight.js +65 -0
  190. package/dist/rich-text-sanitize.d.ts +17 -0
  191. package/dist/rich-text-sanitize.js +176 -0
  192. package/dist/scroll-area.js +1 -0
  193. package/dist/select.d.ts +2 -2
  194. package/dist/select.js +17 -15
  195. package/dist/separator.js +3 -2
  196. package/dist/shared-CGf2D8ZX.d.ts +20 -0
  197. package/dist/sidebar-navigation.d.ts +73 -32
  198. package/dist/sidebar-navigation.js +15 -13
  199. package/dist/sidebar-state.d.ts +76 -0
  200. package/dist/sidebar-state.js +27 -0
  201. package/dist/skeleton.js +3 -2
  202. package/dist/slider.d.ts +321 -0
  203. package/dist/slider.js +14 -0
  204. package/dist/styles.css +1 -1
  205. package/dist/switch.d.ts +1 -1
  206. package/dist/switch.js +3 -2
  207. package/dist/table.d.ts +3 -19
  208. package/dist/table.js +34 -32
  209. package/dist/tabs.js +3 -2
  210. package/dist/tag-input.d.ts +3 -3
  211. package/dist/tag-input.js +14 -12
  212. package/dist/tag.d.ts +1 -1
  213. package/dist/tag.js +5 -4
  214. package/dist/textarea.js +9 -7
  215. package/dist/theme.css +965 -0
  216. package/dist/theme.js +13 -11
  217. package/dist/toast.d.ts +1 -1
  218. package/dist/toast.js +13 -11
  219. package/dist/tooltip.js +5 -3
  220. package/dist/tree.d.ts +1 -1
  221. package/dist/tree.js +7 -6
  222. package/dist/{types-DR9rAEy1.d.ts → types-BoZ6XeLB.d.ts} +1 -1
  223. package/dist/{use-uploads-KaPqDklo.d.ts → use-uploads-cHo2p7Gn.d.ts} +1 -1
  224. package/dist/verification-code-input.js +11 -9
  225. package/package.json +105 -8
  226. package/dist/chunk-BLIZ3CL3.js +0 -49
  227. package/dist/labels-DPrh0se9.d.ts +0 -627
  228. package/dist/panel-El4oI68p.d.ts +0 -9
  229. package/dist/shared-BYXJPnsN.d.ts +0 -11
@@ -0,0 +1,624 @@
1
+ import * as React from 'react';
2
+ import { b as ColorKind } from './color-value-DYzChVOW.js';
3
+ import { R as RichTextEditorLabels } from './labels-CuSlirP_.js';
4
+ import { C as ControlSize } from './control-size-CaxQhkKh.js';
5
+
6
+ /**
7
+ * Every tool the editor can render. Phase 2 shipped the first thirteen — the marks/blocks every editor
8
+ * on earth ships, plus history; phase 3 adds Tier 2, which is what turns `"full"` into a full toolbar.
9
+ *
10
+ * Ordering here is the DECLARATION order, not the toolbar order; the toolbar's order and grouping is
11
+ * {@link TOOLBAR_PRESETS}, because the same tool sits in different groups in different presets.
12
+ */
13
+ type RichTextTool = "bold" | "italic" | "underline" | "strike" | "clearFormat" | "blockType" | "bulletList" | "orderedList" | "indent" | "outdent" | "link" | "undo" | "redo" | "blockquote" | "hr" | "code" | "codeBlock" | "codeLanguage" | "taskList" | "alignLeft" | "alignCenter" | "alignRight" | "alignJustify" | "superscript" | "subscript" | "image" | "table" | "textColor" | "highlight" | "fullscreen";
14
+ /**
15
+ * The block types the `blockType` Select offers. A closed set with its own union, so the Select's
16
+ * `value` is checked against it — never a bare `string` that could carry a level the schema has no
17
+ * node for.
18
+ *
19
+ * Heading levels stop at 3 deliberately: StarterKit's `heading` allows 1–6, but a document with six
20
+ * heading ranks is an outline nobody can hold, and the reference's own text-style menu stops at 3.
21
+ */
22
+ type RichTextBlockType = "paragraph" | "heading1" | "heading2" | "heading3";
23
+ /**
24
+ * What the `toolbar` prop accepts. ONE prop with a `"none"` member — never `showToolbar` +
25
+ * `toolbarItems`, which could express the contradiction `showToolbar={false} toolbarItems={[…]}` and
26
+ * would then need a dev-warn to police a state the type invented (AGENTS §4).
27
+ */
28
+ type RichTextToolbar = "basic" | "full" | "none" | readonly (readonly RichTextTool[])[];
29
+
30
+ /**
31
+ * The eight colours the library ships, in grid order.
32
+ *
33
+ * Eight rather than the six hues `utility-*` happens to declare: six is thin for a text editor, and
34
+ * the palette is not the badge ramp (see the `--color-prose-*` block in `theme.css` for why it is
35
+ * its own role family). `brand` is in the set because it is the one name whose whole point is that
36
+ * it is late-bound — a document coloured "brand" follows the site through a rebrand.
37
+ *
38
+ * **`orange` was measured and cut, and the reason is the chip rather than the colour.** At the text
39
+ * stop it and `amber` are both burnt orange (`orange-700` and `amber-700` differ by a few degrees of
40
+ * hue), and their `-50` washes are both pale peach — so the grid rendered two adjacent circles a
41
+ * user could not tell apart, which is a picker offering a choice that is not one. `amber` stayed
42
+ * because it is the house's own warning hue and because a highlighter is yellow. A ninth colour that
43
+ * is genuinely distinguishable is a `colors` entry away; a ninth that is not is worse than eight.
44
+ */
45
+ declare const PROSE_COLOR_NAMES: readonly ["neutral", "brand", "red", "amber", "green", "blue", "purple", "pink"];
46
+ /** One of the eight names the library ships a role for. */
47
+ type ProseColorName = (typeof PROSE_COLOR_NAMES)[number];
48
+ /**
49
+ * A colour the caller adds beyond the eight — the escape hatch that keeps the default palette bounded
50
+ * without hard-capping it.
51
+ *
52
+ * `name` is **open by design** (`OPEN_BY_DESIGN` in `scripts/check-prop-types.mjs`): it is a CSS
53
+ * class fragment and a custom-property suffix that only the consuming app's own stylesheet can
54
+ * define, so nothing in this library could enumerate it. That openness is exactly why it owes a
55
+ * dev-mode warning rather than silent absorption — see {@link resolveProseColors}. Everything else
56
+ * about the slot is closed: there is no colour VALUE here, because the value lives in the app's CSS
57
+ * and is therefore written once.
58
+ *
59
+ * ```css
60
+ * :root { --color-prose-teal: #0e7490 }
61
+ * .jz-prose .jz-color--teal { --jz-color: var(--color-prose-teal) }
62
+ * .jz-prose .jz-mark--teal { --jz-mark: var(--color-prose-teal) }
63
+ * ```
64
+ */
65
+ interface ProseColorSlot {
66
+ /** The stored name. Becomes `jz-color--<name>` in the document and `--color-prose-<name>` in CSS,
67
+ * so it must be a bare CSS identifier: letters, digits, `-` and `_`. */
68
+ name: string;
69
+ /** What the chip announces. Per-instance CONTENT, so it is a prop rather than a `labels` key —
70
+ * the library cannot have a default for a colour it does not ship. */
71
+ label: string;
72
+ }
73
+ /** A member of the `colors` prop: one of ours by name, or one of the caller's own. */
74
+ type RichTextColor = ProseColorName | ProseColorSlot;
75
+ /**
76
+ * What one coloured run carries — **exactly one of three answers, never a combination.**
77
+ *
78
+ * A union rather than a `name` / `custom` / `gradient` triple of nullable attributes (AGENTS §4,
79
+ * "mutually exclusive ⇒ ONE union"): the triple can express two answers at once, which would then
80
+ * need a rule about which wins, and every reader would have to know it. Here the parser produces one
81
+ * member and the serializer consumes one member.
82
+ *
83
+ * The `kind` is DECLARED, never sniffed off the string's shape. A `gradient` is not "a `color` that
84
+ * happens to start with `linear-gradient(`" — that is the `separators?: string[]` mistake AGENTS §4
85
+ * names, and it would make a CSS function name load-bearing in the storage format.
86
+ */
87
+ type ProseColorValue =
88
+ /** One of the palette names — late-bound through `--color-prose-<name>`, so it repaints for dark. */
89
+ {
90
+ readonly kind: "name";
91
+ readonly name: string;
92
+ }
93
+ /** A literal CSS colour. Theme-fixed, by nature: a value cannot follow a palette it is not in. */
94
+ | {
95
+ readonly kind: "solid";
96
+ readonly color: string;
97
+ }
98
+ /** A literal CSS gradient, as `toCss()` writes it. Painted through `background-clip: text`. */
99
+ | {
100
+ readonly kind: "gradient";
101
+ readonly gradient: string;
102
+ };
103
+
104
+ /**
105
+ * **The counter strip** — the band under the document that says how long it is.
106
+ *
107
+ * A separate component for one reason that is not tidiness: it subscribes to the document's SIZE, and
108
+ * every keystroke changes that. Reading the counts in `RichTextEditor` would re-render the whole
109
+ * editor — toolbar, popovers and all — on every character typed. Here the subscription is scoped to a
110
+ * strip made of two spans, and `useEditorState`'s equality function stops even that when the numbers
111
+ * did not change (typing inside a word changes neither count until a space arrives).
112
+ *
113
+ * Internal — `RichTextEditor` is Tier A and ships no public parts.
114
+ */
115
+
116
+ /**
117
+ * What the strip shows.
118
+ *
119
+ * **One union, not `showWordCount` + `showCharacterCount`.** Two booleans answering the same question
120
+ * can express every combination including the one that has no name — "neither", which would then be
121
+ * an unspellable default — and AGENTS §4 is explicit that a set of answers to one question is a union.
122
+ * `"none"` is the named off state, and it is the default: a counter is chrome, and chrome nobody asked
123
+ * for is chrome they have to look past.
124
+ *
125
+ * `maxLength` does NOT imply a member. A cap can be enforced silently — a `<textarea maxlength>` is —
126
+ * and a caller who wants the user to see it coming asks for `"characters"`, which then renders the
127
+ * fraction rather than the bare number.
128
+ */
129
+ type RichTextCount = "none" | "characters" | "words" | "both";
130
+
131
+ /**
132
+ * **The mention node — an inline atom the document owns, written here rather than installed.**
133
+ *
134
+ * `@tiptap/extension-mention` exists and is deliberately not a dependency: it ships its own suggestion
135
+ * plugin, and we already own that surface. Taking the package would put two menus on one `@`, the
136
+ * second one positioned by a system that is not our `<Popover>` — the same objection `engine.ts`
137
+ * records for `BubbleMenu`. What is left after removing the plugin is ~40 lines of schema, and schema
138
+ * is exactly the thing worth writing down where its attributes, its serialization and its paint can be
139
+ * read together.
140
+ *
141
+ * **Three schema decisions, each of which is a bug if it goes the other way:**
142
+ *
143
+ * 1. **`atom: true`, so there is no caret position inside it.** A mention is one indivisible thing; a
144
+ * caret between `@Ja` and `ne` would let a user edit a name into something that no longer matches
145
+ * the `id` the app stored. ProseMirror gives an atom's DOM `contentEditable="false"` at view time —
146
+ * verified in `prosemirror-view`'s `NodeViewDesc.create`, which sets it on any leaf whose `toDOM`
147
+ * did not already declare one — so the attribute never reaches the serialized `value`. That is why
148
+ * this node needs no NodeView at all, and why the caret-trap hazard the plan warns about does not
149
+ * apply: the caret sits *beside* the atom on both sides, which is ProseMirror's default for an
150
+ * inline leaf.
151
+ * 2. **The label is STORED, not derived.** `renderHTML` writes `data-mention-label` as well as the
152
+ * visible `@label` text, so `parseHTML` reads the name back exactly instead of stripping a `@` off
153
+ * the text content — which would silently corrupt a name that contains one, and would make the
154
+ * round-trip depend on the paint.
155
+ * 3. **The visible text carries the `@`.** A document read WITHOUT our stylesheet — a plain-text
156
+ * export, an email, phase 7's `jz-prose` — still reads "…ask @Jane about it". The paint
157
+ * (`prose.ts`) only adds the chip; it is never what makes the mention legible.
158
+ */
159
+
160
+ /**
161
+ * One person (or team, or anything else) the `@` menu can insert.
162
+ *
163
+ * `id` is the caller's own key and the only thing that survives into the document besides the name —
164
+ * it is what an app looks up later, so it is required rather than defaulted from the label.
165
+ */
166
+ interface MentionItem {
167
+ /** The caller's stable identifier. Written to the document as `data-mention-id`. */
168
+ id: string;
169
+ /** The displayed name. Written to the document, so it survives without a lookup. */
170
+ label: string;
171
+ /** Muted text after the name in the MENU only — a handle, a team, an email. Never stored: it is how
172
+ * a user tells two Janes apart while choosing, not part of what they inserted. */
173
+ hint?: string;
174
+ /** Leading slot for the menu row — an `<Avatar size="xxs">`, an `<Indicator>`, an icon. The caller
175
+ * composes the node and owns its size and its a11y semantics (AGENTS §4 · Slots). Never stored. */
176
+ leading?: React.ReactNode;
177
+ }
178
+
179
+ /**
180
+ * **The mention menu** — `@` at a word boundary opens the caller's directory at the caret.
181
+ *
182
+ * The one suggestion surface whose rows the library does not know. `mentions` is a FUNCTION, and that
183
+ * is the whole configuration: present ⇒ the feature is on, absent ⇒ `@` is a plain character. A
184
+ * separate `showMentions` boolean beside it could express the contradiction "on, with nothing to show"
185
+ * and would need a dev-warn to police a state the type invented (AGENTS §4).
186
+ *
187
+ * **The wire is the caller's, the state is ours** — the same split the library holds everywhere else.
188
+ * We own the query, the debouncing question, the pending flag, the race guard and the surface; the
189
+ * caller owns the request. Concretely: **there is no debounce here on purpose.** A directory that lives
190
+ * in memory should answer on every keystroke, and one that lives behind HTTP should be debounced by
191
+ * the function that makes the request — where the caller can also cache, abort and retry. A debounce
192
+ * baked in here would be latency the in-memory case cannot remove.
193
+ *
194
+ * What we DO own is the race: responses can arrive out of order, and a slow answer for `ja` landing
195
+ * after a fast one for `jane` would show the wrong list under the right query. Every request carries a
196
+ * sequence number and a stale one is dropped — the same guard `Combobox`'s async search uses.
197
+ */
198
+
199
+ /**
200
+ * Where the rows come from.
201
+ *
202
+ * Async by declaration even for an in-memory list, because the two cannot be one type without the
203
+ * caller having to know which one we will `await` — and a directory that starts in memory and moves
204
+ * behind an API later should not be a breaking change at the call site. `async () => PEOPLE` is the
205
+ * in-memory spelling and costs one microtask.
206
+ *
207
+ * The `query` is what was typed after the `@`, already trimmed of the trigger. It is `""` the moment
208
+ * the menu opens, and that call is a real one: it is what fills the list before anyone has typed.
209
+ */
210
+ type MentionSource = (query: string) => Promise<readonly MentionItem[]>;
211
+
212
+ /**
213
+ * How an ordered list COUNTS. A closed set, so a named union whose member owns every behaviour
214
+ * derived from it (AGENTS §4) — there is one table below and nothing re-derives a second answer.
215
+ */
216
+ type RichTextNumbering = "decimal" | "outline";
217
+
218
+ /** What a pasted image URL becomes. A closed set of outcomes, so a union rather than a boolean — and
219
+ * `"link"` is a real member rather than an unspellable "feature off" (AGENTS §4). */
220
+ type RichTextPasteImageUrl = "image" | "link";
221
+
222
+ type RichTextEditorSize = ControlSize;
223
+
224
+ /**
225
+ * **Full screen travels as a PAIR, and the type is what enforces it.**
226
+ *
227
+ * A controlled `fullscreen` with no `onFullscreenChange` is a mode with no way out: Escape and the
228
+ * toolbar tool both REQUEST the change, the prop keeps answering `true`, and the user is left in an
229
+ * overlay covering their whole screen with no exit at all. That is not a mistake worth a dev-warn —
230
+ * a warning is a note in a console nobody has open while a person is stuck, and this library's own
231
+ * rule is that a hard limit belongs in the type, with the runtime as the second line rather than the
232
+ * first.
233
+ *
234
+ * So the two spellings are the two REAL states: **controlled** (both, and the handler is what makes
235
+ * the exit reachable) or **self-driving** (neither, or the handler alone to observe a mode the editor
236
+ * is running itself). `fullscreen?: never` is what makes the third combination a compile error rather
237
+ * than a support ticket.
238
+ *
239
+ * ---
240
+ *
241
+ * **`fullscreen`** — whether the editor fills the viewport, the whole box and toolbar included, lifted
242
+ * out of the page. Omit it and the `fullscreen` toolbar tool (a member of the `"full"` preset, and
243
+ * listable in any hand-written `toolbar`) drives the editor's own state; pass it and the editor
244
+ * renders what you say, so the mode can come from your own chrome, a keyboard shortcut, or a route.
245
+ * **`onFullscreenChange`** reports every request either way — from the tool, and from **Escape**,
246
+ * which is the exit no button of yours can tell you about. @default false
247
+ *
248
+ * **It is a positioned overlay, not the platform's Fullscreen API, and that is a hard constraint
249
+ * rather than a preference.** `requestFullscreen()` paints only DESCENDANTS of the element it was
250
+ * called on, and every surface this component owns — eight popovers, two caret menus, four floating
251
+ * strips, every tooltip — is PORTALLED to `document.body`. In native fullscreen the entire toolbar's
252
+ * output would be invisible: buttons that open nothing. So the shell goes `fixed inset-0` under the
253
+ * portal layer instead, which leaves all of it working and additionally keeps the browser's own
254
+ * chrome, where ⌘F, the URL bar and the tab strip live.
255
+ *
256
+ * **Entering moves focus into the box and leaving puts it back**, and the page behind goes `inert`
257
+ * for as long as it is covered — see the effects in the component for both, and
258
+ * `docs/components/rich-text-editor.md` § The view for why a covered page that is still tabbable is
259
+ * the defect those two exist to close.
260
+ */
261
+ type RichTextEditorFullscreenProps = {
262
+ fullscreen: boolean;
263
+ onFullscreenChange: (fullscreen: boolean) => void;
264
+ } | {
265
+ fullscreen?: never;
266
+ onFullscreenChange?: (fullscreen: boolean) => void;
267
+ };
268
+ interface RichTextEditorBaseProps {
269
+ /**
270
+ * The document, as an HTML string. Controlled.
271
+ *
272
+ * **Open by design** (`OPEN_BY_DESIGN` in `scripts/check-prop-types.mjs`): an HTML document is a
273
+ * grammar, not a vocabulary we own, so there is no union that could describe it. Inbound safety is
274
+ * the schema's — ProseMirror drops any node or mark it does not know at parse time, which is what
275
+ * makes both this prop and paste safe without a sanitizer. Outbound is the caller's.
276
+ */
277
+ value?: string;
278
+ /** Initial document for the uncontrolled shape. Read on the first render only — Tiptap owns the
279
+ * document after that, so later changes are ignored rather than silently fighting the user. */
280
+ defaultValue?: string;
281
+ /** Fires with the serialized document on every edit. */
282
+ onChange?: (html: string) => void;
283
+ /** Hint shown while the document is empty. Per-instance CONTENT, so a prop and not a label. */
284
+ placeholder?: string;
285
+ /**
286
+ * Which tools the toolbar carries. ONE prop with a `"none"` member — never `showToolbar` +
287
+ * `toolbarItems`, which could express the contradiction `showToolbar={false} toolbarItems={[…]}`
288
+ * and would then need a dev-warn to police a state the type invented (AGENTS §4).
289
+ *
290
+ * A nested array is the visual grouping: each inner array is one group, separated by a rule.
291
+ * @default "basic"
292
+ */
293
+ toolbar?: RichTextToolbar;
294
+ /**
295
+ * A compact strip that floats over a **text selection** — the same tools, in the same vocabulary as
296
+ * {@link toolbar}, so `"basic"` and a grouped array mean exactly what they mean there.
297
+ *
298
+ * **Off by default**, and that is a decision rather than caution: a formatting strip nobody asked
299
+ * for, appearing over the words they just selected, is the behaviour people turn off first in every
300
+ * editor that ships it on. Turn it on where the toolbar is far away — a full-page document, or an
301
+ * editor with `toolbar="none"`, which is the pairing this exists for.
302
+ *
303
+ * The strip never takes focus, so the selection stays live and visible underneath it.
304
+ * @default "none"
305
+ */
306
+ bubbleToolbar?: RichTextToolbar;
307
+ /**
308
+ * Whether typing `/` at the start of a word opens the **insert menu** at the caret — the block
309
+ * conversions and insertions from the same tables the toolbar renders from, filtered as you type,
310
+ * chosen with ↑/↓ and Enter.
311
+ *
312
+ * A plain boolean because it is an independent switch, not a second answer to what the toolbar shows
313
+ * (AGENTS §4 keeps booleans for exactly that case). The menu's CONTENTS are not configurable: they
314
+ * are every tool that declares a slash entry, which is what stops the menu and the toolbar drifting.
315
+ *
316
+ * It stays out of the way by construction — a `/` mid-word, in a code block, or mid-composition
317
+ * never opens it, and a query that matches nothing closes it rather than sitting over the document.
318
+ * @default true
319
+ */
320
+ slashMenu?: boolean;
321
+ /**
322
+ * Whether markdown shortcuts apply as you type: `# `, `## `, `- `, `1. `, `> `, ` ``` `, `---`,
323
+ * `**bold**`, `*italic*`, `` `code` ``.
324
+ *
325
+ * **Read when the editor is created.** Toggling it on a live editor cannot take effect — the rules
326
+ * are compiled into the schema's plugin list at construction, and rebuilding that under a live
327
+ * document would mean recreating the editor and losing the undo history with it. Changing it after
328
+ * mount warns in dev rather than failing silently. Pasting is unaffected either way: paste rules are
329
+ * a different mechanism and stay on.
330
+ * @default true
331
+ */
332
+ markdownInput?: boolean;
333
+ /**
334
+ * Where the `@` menu's people come from — **and the presence of this function is the switch.**
335
+ *
336
+ * There is no `mentions={true}` beside a list, and no `showMentions` boolean: a directory the
337
+ * library cannot know is the only thing the feature needs, so supplying it turns `@` into a trigger
338
+ * and omitting it leaves `@` a character. A boolean beside the function could express "on, with
339
+ * nothing to show", which is a state the type would have invented (AGENTS §4).
340
+ *
341
+ * It is called with whatever has been typed after the `@` — including the empty string the moment
342
+ * the menu opens, which is the call that fills the list before anyone types. **Debounce inside it if
343
+ * it hits the network**: the library owns the query, the race guard and the pending state; the
344
+ * request is the caller's, because only the caller can cache, abort or retry it.
345
+ *
346
+ * A stored mention parses back with no `mentions` function at all — the node is always in the
347
+ * schema, so a read-only view of a document containing one renders it correctly.
348
+ */
349
+ mentions?: MentionSource;
350
+ /**
351
+ * Whether pasted HTML is cleaned before the schema parses it.
352
+ *
353
+ * What it removes is the source application's THEME — fonts, colours, margins, Word's `mso-`
354
+ * properties — while converting the marks those styles were carrying (`font-weight: 700` and
355
+ * friends) into the bold/italic/underline/strike the schema knows. It also unwraps the
356
+ * `<b style="font-weight:normal">` a Google Docs copy is wrapped in, which is the one that matters:
357
+ * without it, a naive style strip turns an entire pasted document bold.
358
+ *
359
+ * Turn it off to take pasted markup exactly as the schema parses it. This is a cleanup, never a
360
+ * sanitizer — inbound safety is the schema's either way. @default true
361
+ */
362
+ pasteCleanup?: boolean;
363
+ /**
364
+ * What a pasted — or dropped — **URL that points at an image** becomes.
365
+ *
366
+ * `"image"` inserts the picture; `"link"` keeps the anchor a paste has always produced, which is the
367
+ * opt-out for authoring a link *to* an image file. A union rather than a boolean because both
368
+ * outcomes are real answers and the off state deserves a name (AGENTS §4).
369
+ *
370
+ * **A URL naming an image extension is inserted immediately. Any other `http(s)` URL is pasted as a
371
+ * link and then LOADED to find out**, and replaced only if it really is an image. That second half
372
+ * is not defensive engineering: `https://encrypted-tbn0.gstatic.com/images?q=…` is what "Copy image
373
+ * address" gives you on Google Images, and nothing in that string says "image". The cost is a
374
+ * request per pasted URL — sent with `no-referrer`, memoised per editor, and never for a URL you
375
+ * paste twice. Set `"link"` to send none at all.
376
+ *
377
+ * Three things it deliberately does not do: it never fires when the paste **replaces a selection**
378
+ * (that is "link this text"), it never moves the caret when the late replacement lands, and it does
379
+ * not touch a paste that already carries HTML — `Copy image` puts an `<img>` on the clipboard and
380
+ * the schema has always turned that into a picture on its own. @default "image"
381
+ */
382
+ pasteImageUrl?: RichTextPasteImageUrl;
383
+ /**
384
+ * Whether a **grip appears in the gutter** beside the block under the pointer, and drags it to a new
385
+ * place in the document.
386
+ *
387
+ * Turning it on indents the document by a gutter's width — a grip that floated over the text would
388
+ * sit on the first character of every line, and one that fitted inside the existing padding would
389
+ * clip at the box's edge. That indent is the visible cost, which is why this is opt-in.
390
+ *
391
+ * It moves **top-level blocks only**. A grip on a list item would need drop logic that understands
392
+ * list structure, and half of that is worse than none — a handle that sometimes flattens a list.
393
+ * The grip is a real `<button>`: pressing it selects the block, so the feature is not mouse-only.
394
+ * @default false
395
+ */
396
+ dragHandle?: boolean;
397
+ /**
398
+ * Whether **⌘F / Ctrl+F inside the editor** opens a find & replace band instead of the browser's own
399
+ * find.
400
+ *
401
+ * **Off by default, and that is the same decision `bubbleToolbar` records**: taking a platform-wide
402
+ * shortcut is something a caller opts into, never something a component does on their behalf. Turn it
403
+ * on for a full-page document, where the browser's find cannot help anyway once the text is inside a
404
+ * scroller of its own.
405
+ *
406
+ * Searching changes nothing: matches are a view decoration, so `value` is byte-identical while a
407
+ * search is open and the undo stack is untouched. Replacing all is ONE undo step. @default false
408
+ */
409
+ findReplace?: boolean;
410
+ /**
411
+ * Which readout the strip under the document shows. `"none"` is the named off state and the
412
+ * default — a counter is chrome, and chrome nobody asked for is chrome they have to look past.
413
+ *
414
+ * ONE prop with four members rather than `showWordCount` + `showCharacterCount`: two booleans
415
+ * answering the same question can express a combination with no name (AGENTS §4). @default "none"
416
+ */
417
+ count?: RichTextCount;
418
+ /**
419
+ * Hard cap on the document's character count — a keystroke that would exceed it is rejected rather
420
+ * than trimmed, so the caret never jumps and nothing the user typed disappears behind their back.
421
+ *
422
+ * **Open by design** (`OPEN_BY_DESIGN` in `scripts/check-prop-types.mjs`): a length is a genuinely
423
+ * open range. It therefore owes a dev-mode warning rather than a silent clamp — a `Math.max(0, …)`
424
+ * here would absorb a `maxLength={-1}` and leave the caller wondering why the editor takes nothing.
425
+ *
426
+ * It does NOT imply a visible counter: a cap can be enforced silently, exactly as `<textarea
427
+ * maxlength>` is. Pass `count="characters"` to show the fraction.
428
+ *
429
+ * **Read when the editor is created**, like {@link markdownInput} — the limit is compiled into the
430
+ * document's plugin list. Changing it after mount recreates nothing and warns in dev.
431
+ */
432
+ maxLength?: number;
433
+ /**
434
+ * The palette the `textColor` and `highlight` surfaces offer — **names, never values.**
435
+ *
436
+ * A coloured run stores `class="jz-color jz-color--blue"`, and `@utility jz-prose` binds that name
437
+ * to a `--color-prose-*` role. So the colour repaints for dark mode on its own, and a site
438
+ * recolours every blue run ever written with one `:root` line. **This is still the default answer
439
+ * and still the one-click path** — it is the grid at the top of the surface, above the picker
440
+ * {@link customColors} adds.
441
+ *
442
+ * A member is one of the eight names the library ships a role for, or a `{ name, label }` slot the
443
+ * consuming app defines in its own CSS —
444
+ *
445
+ * ```css
446
+ * :root { --color-prose-teal: #0e7490 }
447
+ * .jz-prose .jz-color--teal { --jz-color: var(--color-prose-teal) }
448
+ * .jz-prose .jz-mark--teal { --jz-mark: var(--color-prose-teal) }
449
+ * ```
450
+ *
451
+ * — written once, because the picker's chip reads the same role the document does. The list is
452
+ * shared by both grids: a site that adds a brand colour means it for text and for highlighting
453
+ * alike. `[]` leaves both grids with only their "none" chip; drop the two tools from `toolbar`
454
+ * instead if the feature is not wanted.
455
+ *
456
+ * `custom` and `gradient` are reserved (they are how a run stores a literal) and a slot claiming
457
+ * either is dropped with a dev-warn.
458
+ *
459
+ * @default the eight shipped names — grey · brand · red · amber · green · blue · purple · pink
460
+ */
461
+ colors?: readonly RichTextColor[];
462
+ /**
463
+ * Which CUSTOM colour modes the surface offers under the palette — the full `<ColorPicker>`:
464
+ * saturation plane, hue and opacity tracks, five notations, the eyedropper, and a Gradient tab.
465
+ *
466
+ * **`[]` is the names-only editor**, and it is the one setting that keeps the old guarantee whole:
467
+ * with no picker there is no surface that accepts a literal, so every colour in every stored
468
+ * document is a NAME and therefore theme-aware.
469
+ *
470
+ * **The cost of the other settings, stated plainly, because it is not recoverable later:** a custom
471
+ * pick stores its value (`style="--jz-color:#175cd3"`), and **a value cannot repaint for dark.** A
472
+ * document coloured from the palette reads correctly on a black page; one coloured from the picker
473
+ * is the same blue on both. `colors` is what a site should grow when it wants a colour to be both
474
+ * available and theme-aware — one `:root` line and a chip appears in the grid for everyone.
475
+ *
476
+ * A gradient additionally paints through `background-clip: text`, which clips PER LINE FRAGMENT —
477
+ * a gradient run that wraps restarts its ramp on the next line. It is a headline affordance.
478
+ *
479
+ * @default ["solid", "gradient"]
480
+ */
481
+ customColors?: readonly ColorKind[];
482
+ /**
483
+ * Extra chips for the **Custom** group, beside the palette — the caller's own saved colours.
484
+ *
485
+ * **Additive, never the whole group.** What the surface renders is these, plus whatever this editor
486
+ * saved through the picker in this session, plus the colours already IN the document — deduped, in
487
+ * that order. So a caller that passes nothing still gets a Custom group as soon as a document
488
+ * carries a literal, and a caller that persists colours does not have to re-send the session's.
489
+ *
490
+ * **Persistence is the caller's**, the same contract `<ColorPicker>` and `<ColorInput>` state: a
491
+ * saved palette is a preference, and a preference the server must render is a cookie that arrives
492
+ * as a prop — `localStorage` is invisible to `renderToString`. What the library keeps is the
493
+ * SESSION list only, which is gone on unmount by design.
494
+ *
495
+ * A {@link ProseColorValue}, not a bare string: the kind is DECLARED rather than sniffed off the
496
+ * string's shape, which is the same rule the storage format follows (AGENTS §4 — a gradient is not
497
+ * "a colour that happens to start with `linear-gradient(`").
498
+ */
499
+ savedColors?: readonly ProseColorValue[];
500
+ /**
501
+ * A colour was authored in the picker and applied.
502
+ *
503
+ * Reported so a caller can persist it; the chip does not wait for that, because the library already
504
+ * holds the session list — which is why there is no `adding…` flag here. Fires once per Apply, with
505
+ * the value exactly as it was stored.
506
+ */
507
+ onAddColor?: (value: ProseColorValue) => void;
508
+ /**
509
+ * Cap the DOCUMENT's own column, in pixels — the text is centred at that width while the toolbar,
510
+ * the find band and the count strip stay full-bleed. `null` (and omitting it) is uncapped.
511
+ *
512
+ * **This is not `className`'s job and cannot be**: `className` is layout-only and lands on the FIELD
513
+ * column, so it bounds the whole control — chrome included — and in {@link fullscreen} there is no
514
+ * outer column left to bound. The measure is the one geometry a caller cannot reach from outside,
515
+ * which is why it is a prop.
516
+ *
517
+ * **What it is for:** a line of text 2,500px wide is not a design preference, it is unreadable — the
518
+ * eye loses the start of the next line on the return sweep. Editors cap it for that reason
519
+ * (Notion ~700px, Medium ~700px), and full screen is exactly where the cap starts to matter. `720`
520
+ * is a good reading measure at this type scale; `960` leaves tables and code blocks room.
521
+ *
522
+ * **Open by design** (`OPEN_BY_DESIGN` in `scripts/check-prop-types.mjs`): a length is a genuinely
523
+ * open range, so no union could describe it. It therefore owes a dev-mode warning rather than a
524
+ * silent clamp, the same contract {@link maxLength} keeps — a `Math.max(320, …)` here would absorb
525
+ * `maxWidth={4}` and leave the caller wondering why their document is one character wide.
526
+ */
527
+ maxWidth?: number | null;
528
+ /** Padding / text / minimum height. The editor is a BOX control like `Textarea`, so it takes
529
+ * Textarea's padding step rather than a bar control's. @default "md" */
530
+ size?: RichTextEditorSize;
531
+ /**
532
+ * How an ordered list COUNTS: `decimal` is the native marker, which restarts at `1.` inside a nested
533
+ * list; `outline` is the multi-level `1.` / `1.1.` / `1.1.1.` form.
534
+ *
535
+ * **A rendering decision, not a content one, and that is why it is a prop rather than a tool.** Both
536
+ * members paint the same `<ol><li>` tree, so `value` is byte-identical either way and a reader that
537
+ * does not ship our CSS shows plain restarting decimals. It is per EDITOR, not per list — Word lets
538
+ * you number one list differently from its neighbour, and that would need a node attribute on the
539
+ * list itself, which is a document change and a different feature.
540
+ *
541
+ * One thing `outline` cannot carry: an `<ol start="7">`. A CSS counter cannot read an attribute, so
542
+ * a list that begins part-way through renders from `1.` again — pass `decimal` where a document
543
+ * relies on `start`. @default "decimal"
544
+ */
545
+ numbering?: RichTextNumbering;
546
+ /**
547
+ * Render the document without editing it — and **this is the documented safe renderer for stored
548
+ * HTML**: it round-trips through the same schema that sanitizes inbound content, so
549
+ * `<RichTextEditor readOnly toolbar="none" value={html} />` is how a saved document is displayed
550
+ * where a user might still start editing it.
551
+ *
552
+ * **For a PUBLISHED page, reach for `<RichTextContent>` instead.** The pixels are identical — same
553
+ * class, same schema — but this one is a live ProseMirror instance with `immediatelyRender: false`,
554
+ * so it renders NOTHING on the server and ships the whole Tiptap runtime to a route that never
555
+ * edits. @default false
556
+ */
557
+ readOnly?: boolean;
558
+ /** Override this component's own copy — the i18n seam. Merges under `<JenosizeUIProvider labels>`;
559
+ * a per-instance key wins. See `docs/i18n-policy.md`. */
560
+ labels?: RichTextEditorLabels;
561
+ /** Visible label, auto-associated with the editable region. */
562
+ label?: string;
563
+ /** Help-circle tooltip after the label (title line). */
564
+ tooltip?: string;
565
+ /** Optional secondary line under {@link tooltip}. */
566
+ tooltipDescription?: string;
567
+ /** Helper text under the field. Hidden while an `error` shows. */
568
+ hint?: React.ReactNode;
569
+ /** Append a required `*` after the label. @default false */
570
+ required?: boolean;
571
+ /** Suppress the visual `*` while keeping `required` semantics. @default false */
572
+ hideRequiredIndicator?: boolean;
573
+ /** Error state: error edge + `aria-invalid`. @default false */
574
+ invalid?: boolean;
575
+ /** Error message. A non-empty `error` also implies `invalid`. */
576
+ error?: string;
577
+ /** Disabled styling + a non-editable document. @default false */
578
+ disabled?: boolean;
579
+ /** Whether the field column takes `w-full`. Only OBSERVABLE where the parent would let the column
580
+ * shrink-to-fit. To BOUND the field, put a width in `className`. @default true */
581
+ fullWidth?: boolean;
582
+ /** Layout/spacing only, merged via `cn()`. Never restyles internals. */
583
+ className?: string;
584
+ /** Accessible name when there is no visible `label`. */
585
+ "aria-label"?: string;
586
+ /** Ids of elements naming the editable region. */
587
+ "aria-labelledby"?: string;
588
+ }
589
+ /** The component's props: everything above, plus the full-screen pair — see
590
+ * {@link RichTextEditorFullscreenProps} for why those two are a union rather than two optionals. */
591
+ type RichTextEditorProps = RichTextEditorBaseProps & RichTextEditorFullscreenProps;
592
+ declare function RichTextEditor(props: RichTextEditorProps): React.JSX.Element;
593
+
594
+ interface RichTextContentProps {
595
+ /**
596
+ * The stored document, as HTML.
597
+ *
598
+ * **Open by design** — an HTML document is a grammar, not a vocabulary we own, so there is no
599
+ * narrower type available (the same reason `RichTextEditor`'s `value` is open). It is written into
600
+ * the DOM as markup: pass something produced by `RichTextEditor`, or run it through
601
+ * `sanitizeRichText` on write. See the note above for why this component does not do it for you.
602
+ */
603
+ value: string;
604
+ /** Base type size for the document. Matches `RichTextEditor`'s, so an editor and its published
605
+ * page read at the same scale. @default "md" */
606
+ size?: ControlSize;
607
+ /** How an ordered list counts — the same closed union, and the same ONE table, the editor uses.
608
+ * @default "decimal" */
609
+ numbering?: RichTextNumbering;
610
+ /** Layout and spacing only, merged via `cn()`. Never restyles the prose — that is `jz-prose`'s. */
611
+ className?: string;
612
+ }
613
+ /**
614
+ * Render a stored `RichTextEditor` document.
615
+ *
616
+ * Not a Field control: no label, no validity, no `fullWidth`, and it must never touch `FieldFrame` —
617
+ * that would enrol it in `field:check` and owe it all ten frame props for nothing.
618
+ */
619
+ declare function RichTextContent({ value, size, numbering, className }: RichTextContentProps): React.JSX.Element;
620
+ declare namespace RichTextContent {
621
+ var displayName: string;
622
+ }
623
+
624
+ export { type MentionItem, type MentionSource, type ProseColorName, type ProseColorSlot, type ProseColorValue, type RichTextBlockType, type RichTextColor, RichTextContent, type RichTextContentProps, type RichTextCount, RichTextEditor, type RichTextEditorBaseProps, type RichTextEditorFullscreenProps, RichTextEditorLabels, type RichTextEditorProps, type RichTextEditorSize, type RichTextNumbering, type RichTextTool, type RichTextToolbar };