@astryxdesign/richtext 0.6.5-canary.c8d8a1d → 0.6.5-canary.cb30e20

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 (69) hide show
  1. package/dist/CodeBlockHeaderPlugin.d.ts +7 -0
  2. package/dist/CodeBlockHeaderPlugin.d.ts.map +1 -0
  3. package/dist/CodeBlockHeaderPlugin.js +196 -0
  4. package/dist/RichTextEditor.d.ts +4 -2
  5. package/dist/RichTextEditor.d.ts.map +1 -1
  6. package/dist/RichTextEditor.js +12 -7
  7. package/dist/RichTextView.d.ts +5 -2
  8. package/dist/RichTextView.d.ts.map +1 -1
  9. package/dist/RichTextView.js +13 -10
  10. package/dist/TableColumnFloorPlugin.d.ts +12 -0
  11. package/dist/TableColumnFloorPlugin.d.ts.map +1 -0
  12. package/dist/TableColumnFloorPlugin.js +84 -0
  13. package/dist/TableScrollRegionPlugin.d.ts +9 -0
  14. package/dist/TableScrollRegionPlugin.d.ts.map +1 -0
  15. package/dist/TableScrollRegionPlugin.js +95 -0
  16. package/dist/editorNodes.d.ts.map +1 -1
  17. package/dist/editorNodes.js +2 -1
  18. package/dist/editorTheme.d.ts.map +1 -1
  19. package/dist/editorTheme.js +254 -59
  20. package/dist/markdownCharacterReferences.d.ts +28 -0
  21. package/dist/markdownCharacterReferences.d.ts.map +1 -0
  22. package/dist/markdownCharacterReferences.js +314 -0
  23. package/dist/markdownHardLineBreak.d.ts +22 -0
  24. package/dist/markdownHardLineBreak.d.ts.map +1 -0
  25. package/dist/markdownHardLineBreak.js +38 -0
  26. package/dist/markdownListExport.d.ts +3 -0
  27. package/dist/markdownListExport.d.ts.map +1 -0
  28. package/dist/markdownListExport.js +60 -0
  29. package/dist/markdownListIndentation.d.ts +8 -0
  30. package/dist/markdownListIndentation.d.ts.map +1 -0
  31. package/dist/markdownListIndentation.js +85 -0
  32. package/dist/markdownSerializers.d.ts.map +1 -1
  33. package/dist/markdownSerializers.js +5 -9
  34. package/dist/markdownSource.d.ts +79 -0
  35. package/dist/markdownSource.d.ts.map +1 -0
  36. package/dist/markdownSource.js +577 -0
  37. package/dist/markdownTable.d.ts +4 -2
  38. package/dist/markdownTable.d.ts.map +1 -1
  39. package/dist/markdownTable.js +9 -3
  40. package/dist/markdownThematicBreak.d.ts +3 -0
  41. package/dist/markdownThematicBreak.d.ts.map +1 -0
  42. package/dist/markdownThematicBreak.js +55 -0
  43. package/dist/richtext.css +82 -16
  44. package/package.json +9 -4
  45. package/src/CodeBlockHeaderPlugin.test.tsx +100 -0
  46. package/src/CodeBlockHeaderPlugin.tsx +261 -0
  47. package/src/RichTextEditor.doc.mjs +9 -4
  48. package/src/RichTextEditor.tsx +18 -8
  49. package/src/RichTextView.tsx +16 -21
  50. package/src/TableColumnFloorPlugin.test.tsx +49 -0
  51. package/src/TableColumnFloorPlugin.tsx +99 -0
  52. package/src/TableScrollRegionPlugin.test.tsx +138 -0
  53. package/src/TableScrollRegionPlugin.tsx +107 -0
  54. package/src/__tests__/MarkdownParitySandbox.a11y.chromium.spec.ts +716 -2
  55. package/src/editorNodes.ts +2 -0
  56. package/src/editorTheme.ts +317 -60
  57. package/src/markdownCharacterReferences.test.ts +202 -0
  58. package/src/markdownCharacterReferences.ts +339 -0
  59. package/src/markdownHardLineBreak.ts +47 -0
  60. package/src/markdownListExport.ts +77 -0
  61. package/src/markdownListIndentation.test.ts +235 -0
  62. package/src/markdownListIndentation.ts +89 -0
  63. package/src/markdownSerializers.ts +9 -14
  64. package/src/markdownSource.test.tsx +646 -0
  65. package/src/markdownSource.ts +743 -0
  66. package/src/markdownTable.test.tsx +20 -3
  67. package/src/markdownTable.ts +10 -2
  68. package/src/markdownThematicBreak.test.tsx +185 -0
  69. package/src/markdownThematicBreak.ts +66 -0
@@ -0,0 +1,7 @@
1
+ import { type JSX } from 'react';
2
+ /**
3
+ * Draws a header over each top-level code block and keeps it there as the
4
+ * document, the editor's size, or the window changes.
5
+ */
6
+ export declare function CodeBlockHeaderPlugin(): JSX.Element;
7
+ //# sourceMappingURL=CodeBlockHeaderPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeBlockHeaderPlugin.d.ts","sourceRoot":"","sources":["../src/CodeBlockHeaderPlugin.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAsB,KAAK,GAAG,EAAC,MAAM,OAAO,CAAC;AA8JpD;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,GAAG,CAAC,OAAO,CA+EnD"}
@@ -0,0 +1,196 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ /**
6
+ * @file CodeBlockHeaderPlugin.tsx
7
+ * @input Uses @lexical/react (composer context), @lexical/code (CodeNode),
8
+ * lexical, and core IconButton, Icon, useClipboard, and useTranslator.
9
+ * @output Exports CodeBlockHeaderPlugin, which draws core CodeBlock's header
10
+ * over every fenced code block: the language label and a copy button, or
11
+ * just the copy button in the corner when the block names no language.
12
+ * @position Rendered by RichTextEditor and RichTextView inside the positioned
13
+ * element that holds the content editable. The headers are siblings of the
14
+ * editable text, never inside it, so they are not part of the document and
15
+ * cannot be edited (spec:AST-061 FR8, DEC-4). The code block's theme class
16
+ * reserves the header's height, so the code sits where core Markdown's does.
17
+ */
18
+ import * as stylex from '@stylexjs/stylex';
19
+ import { useEffect, useState } from 'react';
20
+ import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
21
+ import { $isCodeNode } from '@lexical/code';
22
+ import { $getNodeByKey, $getRoot } from 'lexical';
23
+ import { Icon } from '@astryxdesign/core/Icon';
24
+ import { IconButton } from '@astryxdesign/core/IconButton';
25
+ import { useClipboard } from '@astryxdesign/core/hooks';
26
+ import { useTranslator } from '@astryxdesign/core/i18n';
27
+ import '@astryxdesign/core/theme/tokens.stylex';
28
+ import { fontWeightVars, spacingVars, typeScaleVars, typographyVars } from '@astryxdesign/core/theme/tokens.stylex';
29
+
30
+ /** Where one code block's header goes, in the container's coordinates. */
31
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
32
+ const styles = {
33
+ header: {
34
+ kVAEAm: "x10l6tqk",
35
+ k1xSpc: "x78zum5",
36
+ kGNEyG: "x6s0dn4",
37
+ kjj79g: "x1qughib",
38
+ k8WAf4: "xce4md1",
39
+ kg3NbH: "x1pzlopt",
40
+ kB7OPa: "x9f619",
41
+ $$css: true
42
+ },
43
+ corner: {
44
+ kVAEAm: "x10l6tqk",
45
+ k1xSpc: "x78zum5",
46
+ kjj79g: "x13a6bvl",
47
+ kmVPX3: "xlsj2fj",
48
+ kB7OPa: "x9f619",
49
+ kfzvcC: "x47corl",
50
+ $$css: true
51
+ },
52
+ cornerButton: {
53
+ kfzvcC: "x67bb7w",
54
+ $$css: true
55
+ },
56
+ copyButton: {
57
+ kMwMTN: "x1mjzq1q",
58
+ $$css: true
59
+ },
60
+ placement: (top, left, width) => [{
61
+ k87sOh: top != null ? "xjbys53" : top,
62
+ kbCHJM: left != null ? "xgq9j65" : left,
63
+ kzqmXN: width != null ? "x5lhr3w" : width,
64
+ $$css: true
65
+ }, {
66
+ "--x-top": (val => typeof val === "number" ? val + "px" : val != null ? val : undefined)(top),
67
+ "--x-left": (val => typeof val === "number" ? val + "px" : val != null ? val : undefined)(left),
68
+ "--x-width": (val => typeof val === "number" ? val + "px" : val != null ? val : undefined)(width)
69
+ }]
70
+ };
71
+
72
+ /**
73
+ * The language a header names, as core CodeBlock decides it: none for a fence
74
+ * without one, and none for exactly `plaintext`, which core Markdown gives a
75
+ * fence with no info string.
76
+ */
77
+ function displayLanguageOf(language) {
78
+ return language == null || language === '' || language === PLAIN_TEXT ? null : language;
79
+ }
80
+ const PLAIN_TEXT = 'plaintext';
81
+ function samePlacements(a, b) {
82
+ return a.length === b.length && a.every((placement, index) => placement.key === b[index].key && placement.language === b[index].language && placement.top === b[index].top && placement.left === b[index].left && placement.width === b[index].width);
83
+ }
84
+ function CodeBlockHeader({
85
+ placement
86
+ }) {
87
+ const [editor] = useLexicalComposerContext();
88
+ const t = useTranslator();
89
+ const {
90
+ copy,
91
+ isCopied
92
+ } = useClipboard({
93
+ announce: t('@astryx.codeBlock.copied')
94
+ });
95
+ const copyButton = /*#__PURE__*/_jsx(IconButton, {
96
+ variant: "ghost",
97
+ size: "sm",
98
+ icon: /*#__PURE__*/_jsx(Icon, {
99
+ icon: isCopied ? 'check' : 'copy',
100
+ size: "sm",
101
+ color: "inherit"
102
+ }),
103
+ tooltip: t('@astryx.codeBlock.copyCode'),
104
+ label: isCopied ? t('@astryx.codeBlock.copied') : t('@astryx.codeBlock.copyCode'),
105
+ onClick: () => {
106
+ const code = editor.getEditorState().read(() => $getNodeByKey(placement.key)?.getTextContent() ?? '');
107
+ void copy(code);
108
+ },
109
+ xstyle: [styles.copyButton, placement.language == null && styles.cornerButton]
110
+ });
111
+ const position = styles.placement(placement.top, placement.left, placement.width);
112
+ if (placement.language == null) {
113
+ return /*#__PURE__*/_jsx("div", {
114
+ "data-richtext-code-header": "",
115
+ ...stylex.props(styles.corner, position),
116
+ children: copyButton
117
+ });
118
+ }
119
+ return /*#__PURE__*/_jsxs("div", {
120
+ "data-richtext-code-header": "",
121
+ ...stylex.props(styles.header, position),
122
+ children: [/*#__PURE__*/_jsx("span", {
123
+ ...{
124
+ className: "x141an7d x9m5x89 x1e4wzip x1ltkj2j x1mjzq1q xeuugli xb3r6kr xlyipyv xuxw1ft"
125
+ },
126
+ children: placement.language
127
+ }), copyButton]
128
+ });
129
+ }
130
+
131
+ /**
132
+ * Draws a header over each top-level code block and keeps it there as the
133
+ * document, the editor's size, or the window changes.
134
+ */
135
+ export function CodeBlockHeaderPlugin() {
136
+ const [editor] = useLexicalComposerContext();
137
+ const [placements, setPlacements] = useState([]);
138
+ useEffect(() => {
139
+ let frame = 0;
140
+ const measure = () => {
141
+ frame = 0;
142
+ const root = editor.getRootElement();
143
+ const container = root?.parentElement;
144
+ if (root == null || container == null) {
145
+ setPlacements(current => current.length === 0 ? current : []);
146
+ return;
147
+ }
148
+ const origin = container.getBoundingClientRect();
149
+ const next = editor.getEditorState().read(() => $getRoot().getChildren().filter($isCodeNode).flatMap(node => {
150
+ const element = editor.getElementByKey(node.getKey());
151
+ if (element == null) {
152
+ return [];
153
+ }
154
+ const box = element.getBoundingClientRect();
155
+ // Inside the block's border, so the header lines up with the
156
+ // padding the theme reserves for it.
157
+ return [{
158
+ key: node.getKey(),
159
+ language: displayLanguageOf(node.getLanguage()),
160
+ top: box.top - origin.top + element.clientTop,
161
+ left: box.left - origin.left + element.clientLeft,
162
+ width: element.clientWidth
163
+ }];
164
+ }));
165
+ setPlacements(current => samePlacements(current, next) ? current : next);
166
+ };
167
+ const schedule = () => {
168
+ if (frame === 0) {
169
+ frame = requestAnimationFrame(measure);
170
+ }
171
+ };
172
+ const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(schedule);
173
+ const unregisterRoot = editor.registerRootListener(root => {
174
+ observer?.disconnect();
175
+ if (root != null) {
176
+ observer?.observe(root);
177
+ }
178
+ schedule();
179
+ });
180
+ const unregisterUpdate = editor.registerUpdateListener(schedule);
181
+ window.addEventListener('resize', schedule);
182
+ schedule();
183
+ return () => {
184
+ cancelAnimationFrame(frame);
185
+ observer?.disconnect();
186
+ unregisterRoot();
187
+ unregisterUpdate();
188
+ window.removeEventListener('resize', schedule);
189
+ };
190
+ }, [editor]);
191
+ return /*#__PURE__*/_jsx(_Fragment, {
192
+ children: placements.map(placement => /*#__PURE__*/_jsx(CodeBlockHeader, {
193
+ placement: placement
194
+ }, placement.key))
195
+ });
196
+ }
@@ -57,8 +57,10 @@ export interface RichTextEditorRef {
57
57
  /**
58
58
  * Serialize the current content to a Markdown string, using the same
59
59
  * `transformers` the editor is configured with (so custom transformers
60
- * layered in via the `transformers` prop are honored). Equivalent to
61
- * `$convertToMarkdownString` run in a read context.
60
+ * layered in via the `transformers` prop are honored). Content imported
61
+ * with `markdownToEditorStateJSON` comes back as written: blocks nobody
62
+ * changed byte for byte, and only edited or added blocks in canonical
63
+ * Markdown.
62
64
  */
63
65
  getMarkdown: () => string;
64
66
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextEditor.d.ts","sourceRoot":"","sources":["../src/RichTextEditor.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAQL,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AASf,OAAO,EAML,KAAK,kBAAkB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAGlD,OAAO,EAAyB,KAAK,SAAS,EAAC,MAAM,0BAA0B,CAAC;AAehF,OAAO,EAA2B,KAAK,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAC7E,YAAY,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAInD,OAAO,EASL,KAAK,WAAW,EAChB,KAAK,KAAK,EACV,KAAK,aAAa,EAClB,KAAK,WAAW,EAEjB,MAAM,SAAS,CAAC;AAwJjB,MAAM,MAAM,wBAAwB,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAEvE,MAAM,MAAM,kBAAkB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEpD,MAAM,WAAW,oBAAoB;IACnC,qCAAqC;IACrC,IAAI,EAAE,wBAAwB,CAAC;IAC/B,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB;;;OAGG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,6EAA6E;IAC7E,cAAc,EAAE,MAAM,WAAW,CAAC;IAClC;;;;;OAKG;IACH,WAAW,EAAE,MAAM,MAAM,CAAC;IAC1B;;;;OAIG;IACH,OAAO,EAAE,MAAM,MAAM,CAAC;IACtB;;;O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CAAC;IACtB;;;OAGG;IACH,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B;;;;OAIG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IAC1C;;;;;OAKG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;;;;;;;;;;;;;;OAiBG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IAC1C,yEAAyE;IACzE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,cAAc,mHAwQzB,CAAC"}
@@ -48,9 +48,12 @@ import { TabIndentationPlugin } from '@lexical/react/LexicalTabIndentationPlugin
48
48
  import { MarkdownShortcutPlugin } from '@lexical/react/LexicalMarkdownShortcutPlugin';
49
49
  import { OnChangePlugin } from '@lexical/react/LexicalOnChangePlugin';
50
50
  import { TablePlugin } from '@lexical/react/LexicalTablePlugin';
51
- import { $convertToMarkdownString } from '@lexical/markdown';
51
+ import { HorizontalRuleExtension } from '@lexical/extension';
52
+ import { TableColumnFloorPlugin } from "./TableColumnFloorPlugin.js";
53
+ import { CodeBlockHeaderPlugin } from "./CodeBlockHeaderPlugin.js";
52
54
  import { $generateHtmlFromNodes } from '@lexical/html';
53
55
  import { DEFAULT_NODES } from "./editorNodes.js";
56
+ import { $exportMarkdownKeepingSource } from "./markdownSource.js";
54
57
  import { DEFAULT_TRANSFORMERS } from "./markdownTable.js";
55
58
  import { BLUR_COMMAND, COMMAND_PRIORITY_LOW, defineExtension, KEY_DOWN_COMMAND, KEY_ESCAPE_COMMAND, KEY_TAB_COMMAND, mergeRegister } from 'lexical';
56
59
 
@@ -271,6 +274,8 @@ export const RichTextEditor = /*#__PURE__*/forwardRef(function RichTextEditor({
271
274
  theme: themeRef.current,
272
275
  editable,
273
276
  nodes: nodes ? [...DEFAULT_NODES, ...nodes] : [...DEFAULT_NODES],
277
+ // Horizontal rules select on click and show their selection.
278
+ dependencies: [HorizontalRuleExtension],
274
279
  // `undefined` (not `null`) leaves Lexical's default initializer in place,
275
280
  // which seeds the empty document with one paragraph — what
276
281
  // LexicalComposer did when no `editorState` was given. `null` would mean
@@ -352,7 +357,7 @@ export const RichTextEditor = /*#__PURE__*/forwardRef(function RichTextEditor({
352
357
  hasCellBackgroundColor: false,
353
358
  hasTabHandler: false,
354
359
  hasHorizontalScroll: true
355
- }), /*#__PURE__*/_jsx(TabIndentationPlugin, {}), /*#__PURE__*/_jsx(TabFocusEscapePlugin, {}), hasMarkdownShortcuts && /*#__PURE__*/_jsx(MarkdownShortcutPlugin, {
360
+ }), /*#__PURE__*/_jsx(TableColumnFloorPlugin, {}), /*#__PURE__*/_jsx(CodeBlockHeaderPlugin, {}), /*#__PURE__*/_jsx(TabIndentationPlugin, {}), /*#__PURE__*/_jsx(TabFocusEscapePlugin, {}), hasMarkdownShortcuts && /*#__PURE__*/_jsx(MarkdownShortcutPlugin, {
356
361
  transformers: markdownTransformers
357
362
  }), hasAutoFocus && /*#__PURE__*/_jsx(AutoFocusOnMount, {}), onChange && /*#__PURE__*/_jsx(OnChangePlugin, {
358
363
  onChange: onChange,
@@ -516,11 +521,11 @@ function EditorRefBridge({
516
521
  },
517
522
  getEditorState: () => editor.getEditorState(),
518
523
  getMarkdown: () =>
519
- // $convertToMarkdownString must run inside a read context. Honors the
520
- // same transformers the editor uses for shortcuts, so custom
521
- // transformers round-trip to Markdown. `@lexical/markdown` is a
522
- // subpackage (built dist) — safe, unlike a top-level `lexical` import.
523
- editor.getEditorState().read(() => $convertToMarkdownString(transformers)),
524
+ // Untouched blocks export exactly as imported and changed blocks in
525
+ // canonical form (spec:AST-062). Honors the same transformers the
526
+ // editor uses for shortcuts, so custom transformers round-trip. Reads
527
+ // the state without changing it.
528
+ editor.getEditorState().read(() => $exportMarkdownKeepingSource(transformers)),
524
529
  getHTML: () =>
525
530
  // $generateHtmlFromNodes serializes the whole document (null selection)
526
531
  // to HTML; must run in a read context and requires a DOM.
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * @file RichTextView.tsx
3
3
  * @input Uses React, Lexical (lexical + @lexical/react, composed through
4
- * LexicalExtensionComposer), mergeProps from core utils, design tokens
4
+ * LexicalExtensionComposer), mergeProps from core utils, design tokens,
5
+ * TableScrollRegionPlugin
5
6
  * @output Exports RichTextView component and RichTextViewProps
6
7
  * @position Read-only renderer for serialized Lexical editor state, exposed to
7
8
  * assistive technology as document content rather than a form field;
@@ -55,7 +56,9 @@ export interface RichTextViewProps extends BaseProps {
55
56
  *
56
57
  * The output is document content, not a form field: headings, lists and links
57
58
  * keep their own roles for assistive technology, and the view takes no label.
58
- * For a labelled, read-only field, use `<RichTextEditor isReadOnly />`.
59
+ * For a labelled, read-only field, use `<RichTextEditor isReadOnly />`. A
60
+ * table wider than the view scrolls inside a region named "Table" that takes a
61
+ * tab stop while it overflows, as core `Table` does.
59
62
  *
60
63
  * @example
61
64
  * ```
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextView.d.ts","sourceRoot":"","sources":["../src/RichTextView.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAA8B,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAGlE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAclD,OAAO,KAAK,EAEV,KAAK,EACL,WAAW,EAEZ,MAAM,SAAS,CAAC;AAkDjB,MAAM,WAAW,iBAAkB,SAAQ,SAAS;IAClD;;;OA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AIG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;CAC3B;AAyCD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,KAAK,EACL,OAAO,EACP,SAAyB,EACzB,YAAY,EACZ,aAAoB,EACpB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,iBAAiB,+BAmHnB;yBA9He,YAAY"}
@@ -5,7 +5,8 @@
5
5
  /**
6
6
  * @file RichTextView.tsx
7
7
  * @input Uses React, Lexical (lexical + @lexical/react, composed through
8
- * LexicalExtensionComposer), mergeProps from core utils, design tokens
8
+ * LexicalExtensionComposer), mergeProps from core utils, design tokens,
9
+ * TableScrollRegionPlugin
9
10
  * @output Exports RichTextView component and RichTextViewProps
10
11
  * @position Read-only renderer for serialized Lexical editor state, exposed to
11
12
  * assistive technology as document content rather than a form field;
@@ -26,20 +27,20 @@ import { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin';
26
27
  import { ContentEditable } from '@lexical/react/LexicalContentEditable';
27
28
  import { LexicalErrorBoundary } from '@lexical/react/LexicalErrorBoundary';
28
29
  import { TablePlugin } from '@lexical/react/LexicalTablePlugin';
29
- import { ListNode, ListItemNode } from '@lexical/list';
30
- import { HeadingNode, QuoteNode } from '@lexical/rich-text';
31
- import { LinkNode, AutoLinkNode } from '@lexical/link';
32
- import { CodeNode, CodeHighlightNode } from '@lexical/code';
33
- import { TableNode, TableRowNode, TableCellNode } from '@lexical/table';
30
+ import { TableScrollRegionPlugin } from "./TableScrollRegionPlugin.js";
31
+ import { TableColumnFloorPlugin } from "./TableColumnFloorPlugin.js";
32
+ import { CodeBlockHeaderPlugin } from "./CodeBlockHeaderPlugin.js";
34
33
  import { defineExtension } from 'lexical';
34
+ // The same node set as the editor, so anything it writes renders here.
35
+ import { DEFAULT_NODES } from "./editorNodes.js";
35
36
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
36
37
  const styles = {
37
38
  root: {
38
39
  kzqmXN: "xh8yej3",
40
+ kVAEAm: "x1n2onr6",
39
41
  $$css: true
40
42
  }
41
43
  };
42
- const DEFAULT_NODES = [HeadingNode, QuoteNode, ListNode, ListItemNode, LinkNode, AutoLinkNode, CodeNode, CodeHighlightNode, TableNode, TableRowNode, TableCellNode];
43
44
 
44
45
  /**
45
46
  * Lexical's `ContentEditable` renders `role="textbox"` and widget-only ARIA
@@ -114,7 +115,9 @@ function SyncValuePlugin({
114
115
  *
115
116
  * The output is document content, not a form field: headings, lists and links
116
117
  * keep their own roles for assistive technology, and the view takes no label.
117
- * For a labelled, read-only field, use `<RichTextEditor isReadOnly />`.
118
+ * For a labelled, read-only field, use `<RichTextEditor isReadOnly />`. A
119
+ * table wider than the view scrolls inside a region named "Table" that takes a
120
+ * tab stop while it overflows, as core `Table` does.
118
121
  *
119
122
  * @example
120
123
  * ```
@@ -225,13 +228,13 @@ export function RichTextView({
225
228
  hasCellBackgroundColor: false,
226
229
  hasTabHandler: false,
227
230
  hasHorizontalScroll: true
228
- }), /*#__PURE__*/_jsx(RichTextPlugin, {
231
+ }), /*#__PURE__*/_jsx(TableScrollRegionPlugin, {}), /*#__PURE__*/_jsx(TableColumnFloorPlugin, {}), /*#__PURE__*/_jsx(RichTextPlugin, {
229
232
  contentEditable: /*#__PURE__*/_jsx(ContentEditable, {
230
233
  ...VIEW_CONTENT_EDITABLE_PROPS
231
234
  }),
232
235
  placeholder: null,
233
236
  ErrorBoundary: LexicalErrorBoundary
234
- }), plugins]
237
+ }), /*#__PURE__*/_jsx(CodeBlockHeaderPlugin, {}), plugins]
235
238
  })
236
239
  });
237
240
  }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Each column's floor in `ch`, from the text length of every cell, header row
3
+ * first: the longest cell wraps to about two lines, the header reads on one
4
+ * line up to its cap, and every floor stays between the bounds.
5
+ */
6
+ export declare function tableColumnFloors(rows: ReadonlyArray<ReadonlyArray<number>>): Array<number>;
7
+ /**
8
+ * Sets each top-level table's header cells to their column's floor after
9
+ * every update, so the floors follow edits.
10
+ */
11
+ export declare function TableColumnFloorPlugin(): null;
12
+ //# sourceMappingURL=TableColumnFloorPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableColumnFloorPlugin.d.ts","sourceRoot":"","sources":["../src/TableColumnFloorPlugin.tsx"],"names":[],"mappings":"AA8BA;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,GACzC,KAAK,CAAC,MAAM,CAAC,CAiBf;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAsC7C"}
@@ -0,0 +1,84 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ /**
6
+ * @file TableColumnFloorPlugin.tsx
7
+ * @input Uses @lexical/react (composer context), @lexical/table, and lexical.
8
+ * @output Exports TableColumnFloorPlugin, which gives each table column core
9
+ * Markdown's readable width floor, and tableColumnFloors, the rule itself.
10
+ * @position Rendered by RichTextEditor and RichTextView. Matches core
11
+ * Markdown's table column floors (spec:AST-061 FR4): automatic table layout
12
+ * already keeps every column at least as wide as its longest word, but a
13
+ * prose column's longest word is short, so a narrow table still wraps one
14
+ * word per line. The floor lets a column's longest cell wrap to about two
15
+ * lines instead, keeps a header label on one line up to a cap, and stays
16
+ * bounded so a table of short columns still fits; a wider table scrolls
17
+ * inside its wrapper. The floors are `ch` on content-box cells, so they
18
+ * follow the reader's font size and cell padding does not eat into them.
19
+ */
20
+ import { useEffect } from 'react';
21
+ import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
22
+ import { $isTableCellNode, $isTableNode, $isTableRowNode } from '@lexical/table';
23
+ import { $getRoot } from 'lexical';
24
+ const TABLE_COLUMN_MIN_CH = 4;
25
+ const TABLE_COLUMN_MAX_CH = 24;
26
+ const TABLE_COLUMN_TARGET_LINES = 2;
27
+ const TABLE_HEADER_ONE_LINE_MAX_CH = 20;
28
+
29
+ /**
30
+ * Each column's floor in `ch`, from the text length of every cell, header row
31
+ * first: the longest cell wraps to about two lines, the header reads on one
32
+ * line up to its cap, and every floor stays between the bounds.
33
+ */
34
+ export function tableColumnFloors(rows) {
35
+ const [header, ...body] = rows;
36
+ if (header == null) {
37
+ return [];
38
+ }
39
+ return header.map((headerLength, column) => {
40
+ const longest = Math.max(headerLength, ...body.map(row => row[column] ?? 0));
41
+ const bodyFloor = Math.ceil(longest / TABLE_COLUMN_TARGET_LINES);
42
+ const headerFloor = Math.min(headerLength, TABLE_HEADER_ONE_LINE_MAX_CH);
43
+ return Math.min(TABLE_COLUMN_MAX_CH, Math.max(TABLE_COLUMN_MIN_CH, bodyFloor, headerFloor));
44
+ });
45
+ }
46
+
47
+ /**
48
+ * Sets each top-level table's header cells to their column's floor after
49
+ * every update, so the floors follow edits.
50
+ */
51
+ export function TableColumnFloorPlugin() {
52
+ const [editor] = useLexicalComposerContext();
53
+ useEffect(() => {
54
+ let frame = 0;
55
+ const apply = () => {
56
+ frame = 0;
57
+ editor.getEditorState().read(() => {
58
+ for (const table of $getRoot().getChildren().filter($isTableNode)) {
59
+ const rows = table.getChildren().filter($isTableRowNode).map(row => row.getChildren().filter($isTableCellNode));
60
+ const floors = tableColumnFloors(rows.map(cells => cells.map(cell => cell.getTextContentSize())));
61
+ rows[0]?.forEach((cell, column) => {
62
+ const element = editor.getElementByKey(cell.getKey());
63
+ const floor = `${floors[column]}ch`;
64
+ if (element != null && element.style.minWidth !== floor) {
65
+ element.style.minWidth = floor;
66
+ }
67
+ });
68
+ }
69
+ });
70
+ };
71
+ const schedule = () => {
72
+ if (frame === 0) {
73
+ frame = requestAnimationFrame(apply);
74
+ }
75
+ };
76
+ const unregister = editor.registerUpdateListener(schedule);
77
+ schedule();
78
+ return () => {
79
+ cancelAnimationFrame(frame);
80
+ unregister();
81
+ };
82
+ }, [editor]);
83
+ return null;
84
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * A read-only view has no caret, so nothing inside a wide table can scroll it
3
+ * from the keyboard. Like core Table's scroll region, each table's wrapper is
4
+ * a group named "Table" that takes a tab stop only while the table overflows
5
+ * it; a table that fits adds no stop. The tab stop is explicit, so browsers
6
+ * that do not make scroll containers focusable on their own still reach it.
7
+ */
8
+ export declare function TableScrollRegionPlugin(): null;
9
+ //# sourceMappingURL=TableScrollRegionPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableScrollRegionPlugin.d.ts","sourceRoot":"","sources":["../src/TableScrollRegionPlugin.tsx"],"names":[],"mappings":"AAmCA;;;;;;GAMG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CAgE9C"}
@@ -0,0 +1,95 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ 'use client';
4
+
5
+ /**
6
+ * @file TableScrollRegionPlugin.tsx
7
+ * @input Lexical's TableNode mutations, the scroll wrapper that TablePlugin's
8
+ * horizontal-scroll mode renders around each table, and core's translator
9
+ * for the region's name.
10
+ * @output TableScrollRegionPlugin: gives each table's scroll wrapper the
11
+ * semantics of core Table's scroll region.
12
+ * @position Internal to @astryxdesign/richtext; rendered by RichTextView only.
13
+ * The editor needs none of this: its caret scrolls a wide table, and a tab
14
+ * stop inside the editable surface would break Escape-then-Tab.
15
+ */
16
+ import { useEffect } from 'react';
17
+ import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
18
+ import { TableNode } from '@lexical/table';
19
+ import { useTranslator } from '@astryxdesign/core/i18n';
20
+ /** A tab stop only while the table is wider than its wrapper. */
21
+ function syncTabStop(wrapper) {
22
+ if (wrapper.scrollWidth > wrapper.clientWidth) {
23
+ wrapper.tabIndex = 0;
24
+ } else {
25
+ wrapper.removeAttribute('tabindex');
26
+ }
27
+ }
28
+
29
+ /**
30
+ * A read-only view has no caret, so nothing inside a wide table can scroll it
31
+ * from the keyboard. Like core Table's scroll region, each table's wrapper is
32
+ * a group named "Table" that takes a tab stop only while the table overflows
33
+ * it; a table that fits adds no stop. The tab stop is explicit, so browsers
34
+ * that do not make scroll containers focusable on their own still reach it.
35
+ */
36
+ export function TableScrollRegionPlugin() {
37
+ const [editor] = useLexicalComposerContext();
38
+ const t = useTranslator();
39
+ const label = t('@astryx.table.label');
40
+ useEffect(() => {
41
+ const regions = new Map();
42
+ const release = key => {
43
+ regions.get(key)?.observer?.disconnect();
44
+ regions.delete(key);
45
+ };
46
+ const track = key => {
47
+ // With horizontal scroll active, a table node's DOM is its wrapper.
48
+ const wrapper = editor.getElementByKey(key);
49
+ if (!(wrapper instanceof HTMLDivElement)) {
50
+ release(key);
51
+ return;
52
+ }
53
+ if (regions.get(key)?.wrapper === wrapper) {
54
+ syncTabStop(wrapper);
55
+ return;
56
+ }
57
+ release(key);
58
+ wrapper.setAttribute('role', 'group');
59
+ wrapper.setAttribute('aria-label', label);
60
+ let observer = null;
61
+ if (typeof ResizeObserver !== 'undefined') {
62
+ observer = new ResizeObserver(() => syncTabStop(wrapper));
63
+ // The wrapper resizes with its container, the table with its content.
64
+ observer.observe(wrapper);
65
+ const table = wrapper.querySelector(':scope > table');
66
+ if (table != null) {
67
+ observer.observe(table);
68
+ }
69
+ }
70
+ regions.set(key, {
71
+ wrapper,
72
+ observer
73
+ });
74
+ syncTabStop(wrapper);
75
+ };
76
+ const unregister = editor.registerMutationListener(TableNode, mutations => {
77
+ for (const [key, mutation] of mutations) {
78
+ if (mutation === 'destroyed') {
79
+ release(key);
80
+ } else {
81
+ track(key);
82
+ }
83
+ }
84
+ }, {
85
+ skipInitialization: false
86
+ });
87
+ return () => {
88
+ unregister();
89
+ for (const key of [...regions.keys()]) {
90
+ release(key);
91
+ }
92
+ };
93
+ }, [editor, label]);
94
+ return null;
95
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"editorNodes.d.ts","sourceRoot":"","sources":["../src/editorNodes.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAC,KAAK,EAAE,WAAW,EAAC,MAAM,SAAS,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,CAY3D,CAAC"}
1
+ {"version":3,"file":"editorNodes.d.ts","sourceRoot":"","sources":["../src/editorNodes.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAC,KAAK,EAAE,WAAW,EAAC,MAAM,SAAS,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,CAa3D,CAAC"}
@@ -16,9 +16,10 @@ import { HeadingNode, QuoteNode } from '@lexical/rich-text';
16
16
  import { LinkNode, AutoLinkNode } from '@lexical/link';
17
17
  import { CodeNode, CodeHighlightNode } from '@lexical/code';
18
18
  import { TableNode, TableRowNode, TableCellNode } from '@lexical/table';
19
+ import { HorizontalRuleNode } from '@lexical/extension';
19
20
  /**
20
21
  * The default OSS node set registered with the editor: headings, quotes,
21
22
  * lists, links, code, and tables. Extend via the `nodes` prop / option rather
22
23
  * than editing this list.
23
24
  */
24
- export const DEFAULT_NODES = [HeadingNode, QuoteNode, ListNode, ListItemNode, LinkNode, AutoLinkNode, CodeNode, CodeHighlightNode, TableNode, TableRowNode, TableCellNode];
25
+ export const DEFAULT_NODES = [HeadingNode, QuoteNode, ListNode, ListItemNode, LinkNode, AutoLinkNode, CodeNode, CodeHighlightNode, TableNode, TableRowNode, TableCellNode, HorizontalRuleNode];
@@ -1 +1 @@
1
- {"version":3,"file":"editorTheme.d.ts","sourceRoot":"","sources":["../src/editorTheme.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAC;AA8IhD;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,kBAAkB,CAoDtD"}
1
+ {"version":3,"file":"editorTheme.d.ts","sourceRoot":"","sources":["../src/editorTheme.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAC;AA2XhD;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,kBAAkB,CAqEtD"}