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

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 (45) hide show
  1. package/dist/RichTextEditor.d.ts +2 -4
  2. package/dist/RichTextEditor.d.ts.map +1 -1
  3. package/dist/RichTextEditor.js +6 -9
  4. package/dist/RichTextView.d.ts +2 -5
  5. package/dist/RichTextView.d.ts.map +1 -1
  6. package/dist/RichTextView.js +9 -9
  7. package/dist/editorNodes.d.ts.map +1 -1
  8. package/dist/editorNodes.js +1 -2
  9. package/dist/editorTheme.d.ts.map +1 -1
  10. package/dist/editorTheme.js +22 -58
  11. package/dist/markdownSerializers.d.ts.map +1 -1
  12. package/dist/markdownSerializers.js +9 -5
  13. package/dist/markdownTable.d.ts +2 -4
  14. package/dist/markdownTable.d.ts.map +1 -1
  15. package/dist/markdownTable.js +3 -8
  16. package/dist/richtext.css +15 -51
  17. package/package.json +4 -9
  18. package/src/RichTextEditor.doc.mjs +4 -9
  19. package/src/RichTextEditor.tsx +8 -14
  20. package/src/RichTextView.tsx +21 -9
  21. package/src/__tests__/MarkdownParitySandbox.a11y.chromium.spec.ts +1 -321
  22. package/src/editorNodes.ts +0 -2
  23. package/src/editorTheme.ts +29 -230
  24. package/src/markdownSerializers.ts +14 -9
  25. package/src/markdownTable.test.tsx +3 -20
  26. package/src/markdownTable.ts +2 -8
  27. package/dist/TableScrollRegionPlugin.d.ts +0 -9
  28. package/dist/TableScrollRegionPlugin.d.ts.map +0 -1
  29. package/dist/TableScrollRegionPlugin.js +0 -95
  30. package/dist/markdownHardLineBreak.d.ts +0 -22
  31. package/dist/markdownHardLineBreak.d.ts.map +0 -1
  32. package/dist/markdownHardLineBreak.js +0 -38
  33. package/dist/markdownSource.d.ts +0 -71
  34. package/dist/markdownSource.d.ts.map +0 -1
  35. package/dist/markdownSource.js +0 -538
  36. package/dist/markdownThematicBreak.d.ts +0 -3
  37. package/dist/markdownThematicBreak.d.ts.map +0 -1
  38. package/dist/markdownThematicBreak.js +0 -55
  39. package/src/TableScrollRegionPlugin.test.tsx +0 -138
  40. package/src/TableScrollRegionPlugin.tsx +0 -107
  41. package/src/markdownHardLineBreak.ts +0 -47
  42. package/src/markdownSource.test.tsx +0 -632
  43. package/src/markdownSource.ts +0 -702
  44. package/src/markdownThematicBreak.test.tsx +0 -185
  45. package/src/markdownThematicBreak.ts +0 -66
@@ -57,10 +57,8 @@ 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). 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.
60
+ * layered in via the `transformers` prop are honored). Equivalent to
61
+ * `$convertToMarkdownString` run in a read context.
64
62
  */
65
63
  getMarkdown: () => string;
66
64
  /**
@@ -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;AAgBhF,OAAO,EAAC,KAAK,WAAW,EAAC,MAAM,mBAAmB,CAAC;AACnD,YAAY,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAKnD,OAAO,EASL,KAAK,WAAW,EAChB,KAAK,KAAK,EACV,KAAK,aAAa,EAClB,KAAK,WAAW,EAEjB,MAAM,SAAS,CAAC;AAwJjB,MAAM,MAAM,wBAAwB,GAAG,SAAS,GAAG,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{ 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 { HorizontalRuleExtension } from '@lexical/extension';
51
+ import { $convertToMarkdownString } from '@lexical/markdown';
52
52
  import { $generateHtmlFromNodes } from '@lexical/html';
53
53
  import { DEFAULT_NODES } from "./editorNodes.js";
54
- import { $exportMarkdownKeepingSource } from "./markdownSource.js";
55
54
  import { DEFAULT_TRANSFORMERS } from "./markdownTable.js";
56
55
  import { BLUR_COMMAND, COMMAND_PRIORITY_LOW, defineExtension, KEY_DOWN_COMMAND, KEY_ESCAPE_COMMAND, KEY_TAB_COMMAND, mergeRegister } from 'lexical';
57
56
 
@@ -272,8 +271,6 @@ export const RichTextEditor = /*#__PURE__*/forwardRef(function RichTextEditor({
272
271
  theme: themeRef.current,
273
272
  editable,
274
273
  nodes: nodes ? [...DEFAULT_NODES, ...nodes] : [...DEFAULT_NODES],
275
- // Horizontal rules select on click and show their selection.
276
- dependencies: [HorizontalRuleExtension],
277
274
  // `undefined` (not `null`) leaves Lexical's default initializer in place,
278
275
  // which seeds the empty document with one paragraph — what
279
276
  // LexicalComposer did when no `editorState` was given. `null` would mean
@@ -519,11 +516,11 @@ function EditorRefBridge({
519
516
  },
520
517
  getEditorState: () => editor.getEditorState(),
521
518
  getMarkdown: () =>
522
- // Untouched blocks export exactly as imported and changed blocks in
523
- // canonical form (spec:AST-062). Honors the same transformers the
524
- // editor uses for shortcuts, so custom transformers round-trip. Reads
525
- // the state without changing it.
526
- editor.getEditorState().read(() => $exportMarkdownKeepingSource(transformers)),
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)),
527
524
  getHTML: () =>
528
525
  // $generateHtmlFromNodes serializes the whole document (null selection)
529
526
  // to HTML; must run in a read context and requires a DOM.
@@ -1,8 +1,7 @@
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,
5
- * TableScrollRegionPlugin
4
+ * LexicalExtensionComposer), mergeProps from core utils, design tokens
6
5
  * @output Exports RichTextView component and RichTextViewProps
7
6
  * @position Read-only renderer for serialized Lexical editor state, exposed to
8
7
  * assistive technology as document content rather than a form field;
@@ -56,9 +55,7 @@ export interface RichTextViewProps extends BaseProps {
56
55
  *
57
56
  * The output is document content, not a form field: headings, lists and links
58
57
  * keep their own roles for assistive technology, and the view takes no label.
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.
58
+ * For a labelled, read-only field, use `<RichTextEditor isReadOnly />`.
62
59
  *
63
60
  * @example
64
61
  * ```
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextView.d.ts","sourceRoot":"","sources":["../src/RichTextView.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAA8B,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAGlE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAUlD,OAAO,KAAK,EAEV,KAAK,EACL,WAAW,EAEZ,MAAM,SAAS,CAAC;AAsCjB,MAAM,WAAW,iBAAkB,SAAQ,SAAS;IAClD;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IAC1C;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IAC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B,EACpB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,iBAAiB,+BA+GnB;yBA1He,YAAY"}
@@ -5,8 +5,7 @@
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,
9
- * TableScrollRegionPlugin
8
+ * LexicalExtensionComposer), mergeProps from core utils, design tokens
10
9
  * @output Exports RichTextView component and RichTextViewProps
11
10
  * @position Read-only renderer for serialized Lexical editor state, exposed to
12
11
  * assistive technology as document content rather than a form field;
@@ -27,10 +26,12 @@ import { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin';
27
26
  import { ContentEditable } from '@lexical/react/LexicalContentEditable';
28
27
  import { LexicalErrorBoundary } from '@lexical/react/LexicalErrorBoundary';
29
28
  import { TablePlugin } from '@lexical/react/LexicalTablePlugin';
30
- import { TableScrollRegionPlugin } from "./TableScrollRegionPlugin.js";
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';
31
34
  import { defineExtension } from 'lexical';
32
- // The same node set as the editor, so anything it writes renders here.
33
- import { DEFAULT_NODES } from "./editorNodes.js";
34
35
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
35
36
  const styles = {
36
37
  root: {
@@ -38,6 +39,7 @@ const styles = {
38
39
  $$css: true
39
40
  }
40
41
  };
42
+ const DEFAULT_NODES = [HeadingNode, QuoteNode, ListNode, ListItemNode, LinkNode, AutoLinkNode, CodeNode, CodeHighlightNode, TableNode, TableRowNode, TableCellNode];
41
43
 
42
44
  /**
43
45
  * Lexical's `ContentEditable` renders `role="textbox"` and widget-only ARIA
@@ -112,9 +114,7 @@ function SyncValuePlugin({
112
114
  *
113
115
  * The output is document content, not a form field: headings, lists and links
114
116
  * keep their own roles for assistive technology, and the view takes no label.
115
- * For a labelled, read-only field, use `<RichTextEditor isReadOnly />`. A
116
- * table wider than the view scrolls inside a region named "Table" that takes a
117
- * tab stop while it overflows, as core `Table` does.
117
+ * For a labelled, read-only field, use `<RichTextEditor isReadOnly />`.
118
118
  *
119
119
  * @example
120
120
  * ```
@@ -225,7 +225,7 @@ export function RichTextView({
225
225
  hasCellBackgroundColor: false,
226
226
  hasTabHandler: false,
227
227
  hasHorizontalScroll: true
228
- }), /*#__PURE__*/_jsx(TableScrollRegionPlugin, {}), /*#__PURE__*/_jsx(RichTextPlugin, {
228
+ }), /*#__PURE__*/_jsx(RichTextPlugin, {
229
229
  contentEditable: /*#__PURE__*/_jsx(ContentEditable, {
230
230
  ...VIEW_CONTENT_EDITABLE_PROPS
231
231
  }),
@@ -1 +1 @@
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"}
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"}
@@ -16,10 +16,9 @@ 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';
20
19
  /**
21
20
  * The default OSS node set registered with the editor: headings, quotes,
22
21
  * lists, links, code, and tables. Extend via the `nodes` prop / option rather
23
22
  * than editing this list.
24
23
  */
25
- export const DEFAULT_NODES = [HeadingNode, QuoteNode, ListNode, ListItemNode, LinkNode, AutoLinkNode, CodeNode, CodeHighlightNode, TableNode, TableRowNode, TableCellNode, HorizontalRuleNode];
24
+ export const DEFAULT_NODES = [HeadingNode, QuoteNode, ListNode, ListItemNode, LinkNode, AutoLinkNode, CodeNode, CodeHighlightNode, TableNode, TableRowNode, TableCellNode];
@@ -1 +1 @@
1
- {"version":3,"file":"editorTheme.d.ts","sourceRoot":"","sources":["../src/editorTheme.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAC;AAgVhD;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,kBAAkB,CAyDtD"}
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"}
@@ -4,8 +4,8 @@
4
4
  * @file editorTheme.ts
5
5
  * @input Uses StyleX + Astryx design tokens
6
6
  * @output Exports sharedEditorTheme(), which builds a Lexical EditorThemeClasses
7
- * object mapping Lexical's theme slots to StyleX-generated class names, with
8
- * document blocks styled like core Markdown (spec:AST-061 FR2–FR4).
7
+ * object mapping Lexical's theme slots to StyleX-generated class names and
8
+ * normalizes paragraph spacing for editor/view alignment.
9
9
  * @position Shared by RichTextEditor.tsx and RichTextView.tsx so editor and
10
10
  * read-only view render identically.
11
11
  *
@@ -14,90 +14,60 @@
14
14
 
15
15
  import * as stylex from '@stylexjs/stylex';
16
16
  import '@astryxdesign/core/theme/tokens.stylex';
17
- import { colorVars, spacingVars, radiusVars, typographyVars, typeScaleVars, fontWeightVars, borderVars, focusVars } from '@astryxdesign/core/theme/tokens.stylex';
18
- // Document blocks follow core Markdown's typography, spacing, and measure
19
- // (spec:AST-061 FR2–FR4): type-scale tokens for text, one block spacing table
20
- // with no margin before the first block or after the last, and prose capped
21
- // at Markdown's default content width while code and tables span the editor.
22
- const PROSE_MEASURE = '680px';
23
-
24
- // Block margins wrap their spacing tokens in calc(). The value is unique to
25
- // these rules, so its atomic class never matches a margin declared by other
26
- // code; a stylesheet in a later cascade layer therefore cannot outrank the
27
- // :first-child and :last-child rules that remove the outer margins.
28
- const MAJOR_HEADING_BEFORE = `calc(${spacingVars['--spacing-6']})`;
29
- const MAJOR_HEADING_AFTER = `calc(${spacingVars['--spacing-3']})`;
30
- const MINOR_HEADING_BEFORE = `calc(${spacingVars['--spacing-4']})`;
31
- const MINOR_HEADING_AFTER = `calc(${spacingVars['--spacing-2']})`;
32
- const TEXT_BLOCK_SPACE = `calc(${spacingVars['--spacing-3']})`;
33
- const WIDE_BLOCK_SPACE = `calc(${spacingVars['--spacing-4']})`;
34
- const LIST_ITEM_SPACE = `calc(${spacingVars['--spacing-1']})`;
35
- const LIST_ROW_GAP = `calc(${spacingVars['--spacing-0-5']})`;
36
- const LIST_ROW_FLUSH = `calc(${spacingVars['--spacing-0']})`;
37
- const NESTED_LIST_SPACE = `calc(${spacingVars['--spacing-2']})`;
38
- const RULE_SPACE = `calc(${spacingVars['--spacing-6']})`;
17
+ import { colorVars, spacingVars, radiusVars, typographyVars, typeScaleVars, fontWeightVars } from '@astryxdesign/core/theme/tokens.stylex';
39
18
  /**
40
19
  * Builds the Lexical EditorThemeClasses object. Lexical expects plain
41
20
  * class-name strings, which `stylex.props(...).className` yields.
42
21
  */
43
22
  export function sharedEditorTheme() {
44
23
  const ulClass = {
45
- className: "x1ftnraw xnhvf09 x18pneqc xfo59cc x7ep2pv x31w388 xtaz4m5 x43c9pm"
24
+ className: "xsq74q5 x31w388 xtaz4m5 x43c9pm"
46
25
  }.className ?? '';
47
26
  const olClass = {
48
- className: "x1ftnraw xnhvf09 x18pneqc xfo59cc x7ep2pv x31w388 x3yw8vx x43c9pm"
27
+ className: "xsq74q5 x31w388 x3yw8vx x43c9pm"
49
28
  }.className ?? '';
50
29
  const ulDepth2Class = {
51
- className: "x7ep2pv x31w388 x43c9pm xdj266r xat24cr xrylv2j"
30
+ className: "x31w388 x43c9pm x10im51j xrylv2j"
52
31
  }.className ?? '';
53
32
  const ulDepth3Class = {
54
- className: "x7ep2pv x31w388 x43c9pm xdj266r xat24cr x152237o"
33
+ className: "x31w388 x43c9pm x10im51j x152237o"
55
34
  }.className ?? '';
56
35
  const olDepth2Class = {
57
- className: "x7ep2pv x31w388 x43c9pm xdj266r xat24cr x1rrqm6h"
36
+ className: "x31w388 x43c9pm x10im51j x1rrqm6h"
58
37
  }.className ?? '';
59
38
  const olDepth3Class = {
60
- className: "x7ep2pv x31w388 x43c9pm xdj266r xat24cr x19k9dhg"
39
+ className: "x31w388 x43c9pm x10im51j x19k9dhg"
61
40
  }.className ?? '';
62
41
  return {
63
42
  paragraph: {
64
- className: "x1ftnraw xnhvf09 x18pneqc xfo59cc x7ep2pv x1pd3egz x1heor9g"
43
+ className: "x17ilvqm x14cgwvg"
65
44
  }.className,
66
45
  heading: {
67
46
  h1: {
68
- className: "x1g81bgm xcg7oai x1v68xuy xfmsba7 x13xmvwt xnhvf09 x18pneqc xfo59cc x7ep2pv"
47
+ className: "x1g81bgm xngnso2 x2mo6ok x1g06x3t"
69
48
  }.className,
70
49
  h2: {
71
- className: "x1g81bgm x1xvnhcw x12yy4cs x1cpk1wn x13xmvwt xnhvf09 x18pneqc xfo59cc x7ep2pv"
50
+ className: "x1g81bgm x1603h9y x2mo6ok x1g06x3t"
72
51
  }.className,
73
52
  h3: {
74
- className: "x1g81bgm xii13ha x1jcxfy8 xwjzt0u x13xmvwt xnhvf09 x18pneqc xfo59cc x7ep2pv"
75
- }.className,
76
- h4: {
77
- className: "x1g81bgm x8tkxat x2hcmsi xqerer x1w2a574 xnhvf09 x1hws3vx xfo59cc x7ep2pv"
78
- }.className,
79
- h5: {
80
- className: "x1g81bgm xsgqta0 xno150v xo3gurs x1w2a574 xnhvf09 x1hws3vx xfo59cc x7ep2pv"
81
- }.className,
82
- h6: {
83
- className: "x1g81bgm xw5ohdf x1pw4frv xeixjfn x1w2a574 xnhvf09 x1hws3vx xfo59cc x7ep2pv"
53
+ className: "x1g81bgm x1c3i2sq x2mo6ok xsq74q5"
84
54
  }.className
85
55
  },
86
56
  quote: {
87
- className: "x1w2a574 xnhvf09 x1u2y747 xfo59cc xrxpjvj x7ep2pv x1rey3nv xyumdvf x1t7ytsu x14ydlgx xv1l7n4"
57
+ className: "x1g06x3t xrxpjvj x126nfab xct1zlm x1t7ytsu x14ydlgx xv1l7n4"
88
58
  }.className,
89
59
  list: {
90
60
  ul: ulClass,
91
61
  ol: olClass,
92
62
  checklist: {
93
- className: "x1ftnraw xnhvf09 x18pneqc xfo59cc x7ep2pv x43c9pm x3ct3a4 x12gdq22"
63
+ className: "xsq74q5 x43c9pm x3ct3a4 x12gdq22"
94
64
  }.className,
95
65
  listitem: {
96
- className: "x1f3mx8c xmvvslv x1uerj9w x13xdy6z x1wqhfsw xkuhcwz xsgnyjk x10j6jf0 xfo59cc x1sle589 x81k3mc xovwveo"
66
+ className: "x1yqqeh1 x1sle589"
97
67
  }.className,
98
68
  nested: {
99
69
  listitem: {
100
- className: "x1f3mx8c xmvvslv x1uerj9w x13xdy6z x1wqhfsw xkuhcwz xsgnyjk x10j6jf0 xfo59cc x1sle589 x81k3mc xovwveo"
70
+ className: "x1yqqeh1 x1sle589"
101
71
  }.className
102
72
  },
103
73
  // Depth arrays cycle via `depth % length`, so three entries give three
@@ -110,7 +80,7 @@ export function sharedEditorTheme() {
110
80
  }.className,
111
81
  text: {
112
82
  bold: {
113
- className: "x2mo6ok"
83
+ className: "x1lvx875"
114
84
  }.className,
115
85
  italic: {
116
86
  className: "x1k4tb9n"
@@ -122,20 +92,14 @@ export function sharedEditorTheme() {
122
92
  className: "xmqliwb"
123
93
  }.className,
124
94
  code: {
125
- className: "x9m5x89 xwmxj5m x7a5moj xx3sua9"
95
+ className: "x9m5x89 xwmxj5m x7a5moj x13f7esw xx3sua9 xeb7xqv"
126
96
  }.className
127
97
  },
128
98
  code: {
129
- className: "x1lliihq x9m5x89 xwmxj5m x1b2ylru xx3sua9 x141an7d x1w2a574 xnhvf09 x1u2y747 xfo59cc x126k92a"
130
- }.className,
131
- hr: {
132
- className: "xc342km x11xkdxz x13fuv20 x1pc3f07 x13xmvwt xnhvf09 x1qaki06 xfo59cc"
133
- }.className,
134
- hrSelected: {
135
- className: "xak0ai5 x9ssot5 x19bwoy8 x1eqjuhu"
99
+ className: "x1lliihq x9m5x89 xwmxj5m x1b2ylru xx3sua9 x141an7d x1g06x3t x126k92a"
136
100
  }.className,
137
101
  table: {
138
- className: "x1mwwwfo xh8yej3"
102
+ className: "x1mwwwfo xh8yej3 xfo4z36"
139
103
  }.className,
140
104
  tableRow: {
141
105
  className: "xso031l x1q0q8m5 xw8gpjh x1bta2m4"
@@ -147,7 +111,7 @@ export function sharedEditorTheme() {
147
111
  className: "x2mo6ok xv1l7n4"
148
112
  }.className,
149
113
  tableScrollableWrapper: {
150
- className: "xw2csxc x193iq5w xrvj5dj x1mkdm3x x1w2a574 xnhvf09 x1u2y747 xfo59cc"
114
+ className: "xw2csxc x193iq5w"
151
115
  }.className
152
116
  };
153
117
  }
@@ -1 +1 @@
1
- {"version":3,"file":"markdownSerializers.d.ts","sourceRoot":"","sources":["../src/markdownSerializers.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAC,KAAK,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAOnD,OAAO,KAAK,EAAC,KAAK,EAAE,WAAW,EAAC,MAAM,SAAS,CAAC;AAEhD,yDAAyD;AACzD,MAAM,WAAW,yBAAyB;IACxC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IAC1C;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;CAC3C;AAYD;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,yBAA8B,GACtC,MAAM,CAKR;AAED;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CACvC,eAAe,EAAE,MAAM,EACvB,OAAO,GAAE,yBAA8B,GACtC,MAAM,CAKR"}
1
+ {"version":3,"file":"markdownSerializers.d.ts","sourceRoot":"","sources":["../src/markdownSerializers.ts"],"names":[],"mappings":"AAyBA,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,KAAK,EAAC,KAAK,EAAE,WAAW,EAAC,MAAM,SAAS,CAAC;AAEhD,yDAAyD;AACzD,MAAM,WAAW,yBAAyB;IACxC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IAC1C;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;CAC3C;AAYD;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,yBAA8B,GACtC,MAAM,CAUR;AAED;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CACvC,eAAe,EAAE,MAAM,EACvB,OAAO,GAAE,yBAA8B,GACtC,MAAM,CAKR"}
@@ -3,8 +3,8 @@
3
3
  /**
4
4
  * @file markdownSerializers.ts
5
5
  * @input Uses @lexical/headless (createHeadlessEditor), @lexical/markdown
6
- * (transformer types), the shared DEFAULT_NODES set, DEFAULT_TRANSFORMERS,
7
- * and the source-preserving import and export in markdownSource.ts.
6
+ * ($convertFromMarkdownString / $convertToMarkdownString), the shared
7
+ * DEFAULT_NODES set, and DEFAULT_TRANSFORMERS.
8
8
  * @output Standalone Markdown <-> serialized EditorState helpers:
9
9
  * markdownToEditorStateJSON, editorStateJSONToMarkdown.
10
10
  * @position Re-exported from RichTextEditor/index.ts and the @astryxdesign/richtext
@@ -23,8 +23,8 @@
23
23
  */
24
24
 
25
25
  import { createHeadlessEditor } from '@lexical/headless';
26
+ import { $convertFromMarkdownString, $convertToMarkdownString } from '@lexical/markdown';
26
27
  import { DEFAULT_NODES } from "./editorNodes.js";
27
- import { $exportMarkdownKeepingSource, importMarkdownKeepingSource } from "./markdownSource.js";
28
28
  import { DEFAULT_TRANSFORMERS } from "./markdownTable.js";
29
29
 
30
30
  /** Options shared by the Markdown serializer helpers. */
@@ -56,7 +56,11 @@ export function markdownToEditorStateJSON(markdown, options = {}) {
56
56
  nodes
57
57
  } = options;
58
58
  const editor = createSerializerEditor(nodes);
59
- importMarkdownKeepingSource(editor, markdown, [...transformers]);
59
+ editor.update(() => {
60
+ $convertFromMarkdownString(markdown, [...transformers]);
61
+ }, {
62
+ discrete: true
63
+ });
60
64
  return JSON.stringify(editor.getEditorState().toJSON());
61
65
  }
62
66
 
@@ -77,5 +81,5 @@ export function editorStateJSONToMarkdown(editorStateJSON, options = {}) {
77
81
  } = options;
78
82
  const editor = createSerializerEditor(nodes);
79
83
  const state = editor.parseEditorState(editorStateJSON);
80
- return state.read(() => $exportMarkdownKeepingSource([...transformers]));
84
+ return state.read(() => $convertToMarkdownString([...transformers]));
81
85
  }
@@ -21,10 +21,8 @@ import { type MultilineElementTransformer, type Transformer } from '@lexical/mar
21
21
  */
22
22
  export declare const TABLE: MultilineElementTransformer;
23
23
  /**
24
- * The editor's default Markdown transformers: thematic breaks, Lexical's
25
- * standard set, hard line breaks for breaks typed in the editor, and GFM
26
- * tables. Thematic breaks come first so a line such as `* * *` is a rule
27
- * rather than a list item.
24
+ * The editor's default Markdown transformers: Lexical's standard set plus GFM
25
+ * tables.
28
26
  */
29
27
  export declare const DEFAULT_TRANSFORMERS: ReadonlyArray<Transformer>;
30
28
  //# sourceMappingURL=markdownTable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"markdownTable.d.ts","sourceRoot":"","sources":["../src/markdownTable.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAML,KAAK,2BAA2B,EAChC,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAC;AA8I3B;;;;;GAKG;AACH,eAAO,MAAM,KAAK,EAAE,2BA8DnB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,aAAa,CAAC,WAAW,CAK3D,CAAC"}
1
+ {"version":3,"file":"markdownTable.d.ts","sourceRoot":"","sources":["../src/markdownTable.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAML,KAAK,2BAA2B,EAChC,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAC;AA4I3B;;;;;GAKG;AACH,eAAO,MAAM,KAAK,EAAE,2BA8DnB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,aAAa,CAAC,WAAW,CAG3D,CAAC"}
@@ -17,9 +17,6 @@
17
17
 
18
18
  import { $convertFromMarkdownString, $convertToMarkdownString, TEXT_FORMAT_TRANSFORMERS, TEXT_MATCH_TRANSFORMERS, TRANSFORMERS } from '@lexical/markdown';
19
19
  import { $createTableCellNode, $createTableNode, $createTableRowNode, $isTableCellNode, $isTableNode, $isTableRowNode, TableCellHeaderStates, TableCellNode, TableNode, TableRowNode } from '@lexical/table';
20
- import { HARD_LINE_BREAK } from "./markdownHardLineBreak.js";
21
- import { THEMATIC_BREAK } from "./markdownThematicBreak.js";
22
-
23
20
  /**
24
21
  * Cells hold inline Markdown only, so they are imported and exported with the
25
22
  * inline transformers.
@@ -179,9 +176,7 @@ export const TABLE = {
179
176
  };
180
177
 
181
178
  /**
182
- * The editor's default Markdown transformers: thematic breaks, Lexical's
183
- * standard set, hard line breaks for breaks typed in the editor, and GFM
184
- * tables. Thematic breaks come first so a line such as `* * *` is a rule
185
- * rather than a list item.
179
+ * The editor's default Markdown transformers: Lexical's standard set plus GFM
180
+ * tables.
186
181
  */
187
- export const DEFAULT_TRANSFORMERS = [THEMATIC_BREAK, ...TRANSFORMERS, HARD_LINE_BREAK, TABLE];
182
+ export const DEFAULT_TRANSFORMERS = [...TRANSFORMERS, TABLE];
package/dist/richtext.css CHANGED
@@ -14,8 +14,14 @@
14
14
  .xc342km:not(#\#):not(#\#){border-width:0}
15
15
  .x845mor:not(#\#):not(#\#){flex:1 1 0%}
16
16
  .xsn7fz1:not(#\#):not(#\#){gap:var(--spacing-0)}
17
+ .x10im51j:not(#\#):not(#\#){margin-block:0}
18
+ .x1yqqeh1:not(#\#):not(#\#){margin-block:var(--spacing-0-5)}
19
+ .xsq74q5:not(#\#):not(#\#){margin-block:var(--spacing-1)}
20
+ .x1g06x3t:not(#\#):not(#\#){margin-block:var(--spacing-2)}
21
+ .xfo4z36:not(#\#):not(#\#){margin-block:var(--spacing-4)}
17
22
  .xrxpjvj:not(#\#):not(#\#){margin-inline:0}
18
23
  .x1a2a7pz:not(#\#):not(#\#){outline:none}
24
+ .x13f7esw:not(#\#):not(#\#){padding-block:var(--spacing-0-5)}
19
25
  .x1hp7d8q:not(#\#):not(#\#){padding-block:var(--spacing-0)}
20
26
  .xu0wf1k:not(#\#):not(#\#){padding-block:var(--spacing-1)}
21
27
  .xce4md1:not(#\#):not(#\#){padding-block:var(--spacing-2)}
@@ -31,9 +37,8 @@
31
37
  .x1mwwwfo:not(#\#):not(#\#):not(#\#){border-collapse:collapse}
32
38
  .x14ydlgx:not(#\#):not(#\#):not(#\#){border-inline-start-color:var(--color-border-emphasized)}
33
39
  .x1t7ytsu:not(#\#):not(#\#):not(#\#){border-inline-start-style:solid}
34
- .xyumdvf:not(#\#):not(#\#):not(#\#){border-inline-start-width:2px}
40
+ .xct1zlm:not(#\#):not(#\#):not(#\#){border-inline-start-width:3px}
35
41
  .x9f619:not(#\#):not(#\#):not(#\#){box-sizing:border-box}
36
- .x1heor9g:not(#\#):not(#\#):not(#\#){color:inherit}
37
42
  .xjt36v0:not(#\#):not(#\#):not(#\#){color:var(--color-error)}
38
43
  .xjse4m1:not(#\#):not(#\#):not(#\#){color:var(--color-text-accent)}
39
44
  .x1tgivj0:not(#\#):not(#\#):not(#\#){color:var(--color-text-primary)}
@@ -42,39 +47,23 @@
42
47
  .x1ypdohk:not(#\#):not(#\#):not(#\#){cursor:pointer}
43
48
  .x1lliihq:not(#\#):not(#\#):not(#\#){display:block}
44
49
  .x78zum5:not(#\#):not(#\#):not(#\#){display:flex}
45
- .xrvj5dj:not(#\#):not(#\#):not(#\#){display:grid}
46
50
  .xdt5ytf:not(#\#):not(#\#):not(#\#){flex-direction:column}
47
51
  .x9ynric:not(#\#):not(#\#):not(#\#){font-family:var(--font-family-body)}
48
52
  .x9m5x89:not(#\#):not(#\#):not(#\#){font-family:var(--font-family-code)}
49
53
  .x1g81bgm:not(#\#):not(#\#):not(#\#){font-family:var(--font-family-heading)}
54
+ .xeb7xqv:not(#\#):not(#\#):not(#\#){font-size:.9em}
55
+ .x1c3i2sq:not(#\#):not(#\#):not(#\#){font-size:1.125rem}
56
+ .x1603h9y:not(#\#):not(#\#):not(#\#){font-size:1.25rem}
57
+ .xngnso2:not(#\#):not(#\#):not(#\#){font-size:1.5rem}
50
58
  .xjm74w1:not(#\#):not(#\#):not(#\#){font-size:var(--text-body-size)}
51
- .xcg7oai:not(#\#):not(#\#):not(#\#){font-size:var(--text-heading-1-size)}
52
- .x1xvnhcw:not(#\#):not(#\#):not(#\#){font-size:var(--text-heading-2-size)}
53
- .xii13ha:not(#\#):not(#\#):not(#\#){font-size:var(--text-heading-3-size)}
54
- .x8tkxat:not(#\#):not(#\#):not(#\#){font-size:var(--text-heading-4-size)}
55
- .xsgqta0:not(#\#):not(#\#):not(#\#){font-size:var(--text-heading-5-size)}
56
- .xw5ohdf:not(#\#):not(#\#):not(#\#){font-size:var(--text-heading-6-size)}
57
59
  .x141an7d:not(#\#):not(#\#):not(#\#){font-size:var(--text-supporting-size)}
58
60
  .x1k4tb9n:not(#\#):not(#\#):not(#\#){font-style:italic}
59
- .x1pd3egz:not(#\#):not(#\#):not(#\#){font-weight:inherit}
61
+ .x1lvx875:not(#\#):not(#\#):not(#\#){font-weight:var(--font-weight-bold)}
60
62
  .x2mo6ok:not(#\#):not(#\#):not(#\#){font-weight:var(--font-weight-semibold)}
61
- .x1v68xuy:not(#\#):not(#\#):not(#\#){font-weight:var(--text-heading-1-weight)}
62
- .x12yy4cs:not(#\#):not(#\#):not(#\#){font-weight:var(--text-heading-2-weight)}
63
- .x1jcxfy8:not(#\#):not(#\#):not(#\#){font-weight:var(--text-heading-3-weight)}
64
- .x2hcmsi:not(#\#):not(#\#):not(#\#){font-weight:var(--text-heading-4-weight)}
65
- .xno150v:not(#\#):not(#\#):not(#\#){font-weight:var(--text-heading-5-weight)}
66
- .x1pw4frv:not(#\#):not(#\#):not(#\#){font-weight:var(--text-heading-6-weight)}
67
- .x1mkdm3x:not(#\#):not(#\#):not(#\#){grid-template-columns:minmax(0,1fr)}
68
63
  .x72tfeb:not(#\#):not(#\#):not(#\#){inset-inline-end:var(--spacing-2)}
69
64
  .x1o0tod:not(#\#):not(#\#):not(#\#){inset-inline-start:0}
70
65
  .x13a6bvl:not(#\#):not(#\#):not(#\#){justify-content:flex-end}
71
66
  .xw6l6zx:not(#\#):not(#\#):not(#\#){line-height:var(--text-body-leading)}
72
- .xfmsba7:not(#\#):not(#\#):not(#\#){line-height:var(--text-heading-1-leading)}
73
- .x1cpk1wn:not(#\#):not(#\#):not(#\#){line-height:var(--text-heading-2-leading)}
74
- .xwjzt0u:not(#\#):not(#\#):not(#\#){line-height:var(--text-heading-3-leading)}
75
- .xqerer:not(#\#):not(#\#):not(#\#){line-height:var(--text-heading-4-leading)}
76
- .xo3gurs:not(#\#):not(#\#):not(#\#){line-height:var(--text-heading-5-leading)}
77
- .xeixjfn:not(#\#):not(#\#):not(#\#){line-height:var(--text-heading-6-leading)}
78
67
  .x43c9pm:not(#\#):not(#\#):not(#\#){list-style-position:outside}
79
68
  .xrylv2j:not(#\#):not(#\#):not(#\#){list-style-type:circle}
80
69
  .x3yw8vx:not(#\#):not(#\#):not(#\#){list-style-type:decimal}
@@ -84,14 +73,10 @@
84
73
  .x19k9dhg:not(#\#):not(#\#):not(#\#){list-style-type:lower-roman}
85
74
  .x3ct3a4:not(#\#):not(#\#):not(#\#){list-style-type:none}
86
75
  .x152237o:not(#\#):not(#\#):not(#\#){list-style-type:square}
87
- .x19bwoy8:not(#\#):not(#\#):not(#\#){outline-color:var(--focus-outline-color)}
88
- .x1eqjuhu:not(#\#):not(#\#):not(#\#){outline-offset:var(--focus-outline-offset)}
89
- .x9ssot5:not(#\#):not(#\#):not(#\#){outline-style:var(--focus-outline-style)}
90
- .xak0ai5:not(#\#):not(#\#):not(#\#){outline-width:var(--focus-outline-width)}
91
76
  .x1mzt3pk:not(#\#):not(#\#):not(#\#){overflow-wrap:break-word}
92
77
  .xp74n0j:not(#\#):not(#\#):not(#\#){padding-inline-end:calc(var(--spacing-2) + var(--spacing-6))}
93
78
  .x12gdq22:not(#\#):not(#\#):not(#\#){padding-inline-start:var(--spacing-2)}
94
- .x1rey3nv:not(#\#):not(#\#):not(#\#){padding-inline-start:var(--spacing-4)}
79
+ .x126nfab:not(#\#):not(#\#):not(#\#){padding-inline-start:var(--spacing-3)}
95
80
  .x31w388:not(#\#):not(#\#):not(#\#){padding-inline-start:var(--spacing-6)}
96
81
  .x47corl:not(#\#):not(#\#):not(#\#){pointer-events:none}
97
82
  .x10l6tqk:not(#\#):not(#\#):not(#\#){position:absolute}
@@ -102,8 +87,6 @@
102
87
  .xxymvpz:not(#\#):not(#\#):not(#\#){vertical-align:middle}
103
88
  .x126k92a:not(#\#):not(#\#):not(#\#){white-space:pre-wrap}
104
89
  .x1vjfegm:not(#\#):not(#\#):not(#\#){z-index:1}
105
- .x81k3mc:has(ul):not(#\#):not(#\#):not(#\#){list-style-type:none}
106
- .xovwveo:has(ol):not(#\#):not(#\#):not(#\#){list-style-type:none}
107
90
  @supports (-webkit-touch-callout: none){@media (pointer: coarse){.xf9zqsd.xf9zqsd.xf9zqsd:not(#\#):not(#\#):not(#\#){font-size:max(1rem,var(--text-body-size))}}}
108
91
  .xw8gpjh:not(#\#):not(#\#):not(#\#):not(#\#){border-bottom-color:var(--color-border)}
109
92
  .x1q0q8m5:not(#\#):not(#\#):not(#\#):not(#\#){border-bottom-style:solid}
@@ -111,39 +94,20 @@
111
94
  .x1pc3f07:not(#\#):not(#\#):not(#\#):not(#\#){border-top-color:var(--color-border)}
112
95
  .x13fuv20:not(#\#):not(#\#):not(#\#):not(#\#){border-top-style:solid}
113
96
  .x178xt8z:not(#\#):not(#\#):not(#\#):not(#\#){border-top-width:1px}
114
- .x11xkdxz:not(#\#):not(#\#):not(#\#):not(#\#){border-top-width:var(--border-width)}
115
97
  .xt7dq6l:not(#\#):not(#\#):not(#\#):not(#\#){height:auto}
116
- .xat24cr:not(#\#):not(#\#):not(#\#):not(#\#){margin-bottom:0}
117
- .x10j6jf0:not(#\#):not(#\#):not(#\#):not(#\#){margin-bottom:calc(var(--spacing-0-5))}
118
- .x1hws3vx:not(#\#):not(#\#):not(#\#):not(#\#){margin-bottom:calc(var(--spacing-2))}
119
- .x18pneqc:not(#\#):not(#\#):not(#\#):not(#\#){margin-bottom:calc(var(--spacing-3))}
120
- .x1u2y747:not(#\#):not(#\#):not(#\#):not(#\#){margin-bottom:calc(var(--spacing-4))}
121
- .x1qaki06:not(#\#):not(#\#):not(#\#):not(#\#){margin-bottom:calc(var(--spacing-6))}
122
- .xdj266r:not(#\#):not(#\#):not(#\#):not(#\#){margin-top:0}
123
- .x1wqhfsw:not(#\#):not(#\#):not(#\#):not(#\#){margin-top:calc(var(--spacing-0))}
124
- .x1ftnraw:not(#\#):not(#\#):not(#\#):not(#\#){margin-top:calc(var(--spacing-3))}
125
- .x1w2a574:not(#\#):not(#\#):not(#\#):not(#\#){margin-top:calc(var(--spacing-4))}
126
- .x13xmvwt:not(#\#):not(#\#):not(#\#):not(#\#){margin-top:calc(var(--spacing-6))}
98
+ .x14cgwvg:not(#\#):not(#\#):not(#\#):not(#\#){margin-bottom:var(--spacing-1)}
99
+ .x17ilvqm:not(#\#):not(#\#):not(#\#):not(#\#){margin-top:var(--spacing-0)}
127
100
  .xcsaf9d:not(#\#):not(#\#):not(#\#):not(#\#){margin-top:var(--spacing-1)}
128
101
  .x193iq5w:not(#\#):not(#\#):not(#\#):not(#\#){max-width:100%}
129
- .x7ep2pv:not(#\#):not(#\#):not(#\#):not(#\#){max-width:680px}
130
102
  .x65nank:not(#\#):not(#\#):not(#\#):not(#\#){min-height:auto}
131
103
  .x82snj4:not(#\#):not(#\#):not(#\#):not(#\#){min-height:var(--x-minHeight)}
132
104
  .xeuugli:not(#\#):not(#\#):not(#\#):not(#\#){min-width:0}
133
105
  .xw2csxc:not(#\#):not(#\#):not(#\#):not(#\#){overflow-x:auto}
134
106
  .x10wlt62:not(#\#):not(#\#):not(#\#):not(#\#){overflow-y:hidden}
135
107
  .x7p5m3t:not(#\#):not(#\#):not(#\#):not(#\#){overscroll-behavior-x:contain}
136
- .x13xdy6z:not(#\#):not(#\#):not(#\#):not(#\#){padding-bottom:calc(var(--spacing-1))}
137
- .x1f3mx8c:not(#\#):not(#\#):not(#\#):not(#\#){padding-top:calc(var(--spacing-1))}
138
108
  .x4xegtk:not(#\#):not(#\#):not(#\#):not(#\#){top:var(--spacing-0)}
139
109
  .xctzyg:not(#\#):not(#\#):not(#\#):not(#\#){top:var(--spacing-2)}
140
110
  .xnalus7:not(#\#):not(#\#):not(#\#):not(#\#){width:0}
141
111
  .xh8yej3:not(#\#):not(#\#):not(#\#):not(#\#){width:100%}
142
- .xkuhcwz:has(ul):not(#\#):not(#\#):not(#\#):not(#\#){margin-top:calc(var(--spacing-2))}
143
- .xsgnyjk:has(ol):not(#\#):not(#\#):not(#\#):not(#\#){margin-top:calc(var(--spacing-2))}
144
- .x1uerj9w:has(ol):not(#\#):not(#\#):not(#\#):not(#\#){padding-top:var(--spacing-0)}
145
- .xmvvslv:has(ul):not(#\#):not(#\#):not(#\#):not(#\#){padding-top:var(--spacing-0)}
146
- .xnhvf09:first-child:not(#\#):not(#\#):not(#\#):not(#\#){margin-top:var(--spacing-0)}
147
112
  .x1bta2m4:last-child:not(#\#):not(#\#):not(#\#):not(#\#){border-bottom-color:transparent}
148
- .xfo59cc:last-child:not(#\#):not(#\#):not(#\#):not(#\#){margin-bottom:var(--spacing-0)}
149
113
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@astryxdesign/richtext",
3
3
  "displayName": "Rich Text",
4
- "version": "0.6.5-canary.c245985",
4
+ "version": "0.6.5-canary.c8d8a1d",
5
5
  "description": "Astryx rich text — a Lexical-based rich text editor and viewer. Published to npm only under the @canary dist-tag for early testing; never released as a stable (latest) version.",
6
6
  "author": "Meta Open Source",
7
7
  "license": "MIT",
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "peerDependencies": {
52
52
  "@stylexjs/stylex": ">=0.10.0",
53
- "@astryxdesign/core": "0.6.5-canary.c245985",
53
+ "@astryxdesign/core": "0.6.5-canary.c8d8a1d",
54
54
  "react": ">=19.0.0",
55
55
  "react-dom": ">=19.0.0",
56
56
  "lexical": "^0.46.0",
@@ -63,7 +63,6 @@
63
63
  "@lexical/rich-text": "^0.46.0",
64
64
  "@lexical/selection": "^0.46.0",
65
65
  "@lexical/code": "^0.46.0",
66
- "@lexical/extension": "^0.46.0",
67
66
  "@lexical/table": "^0.46.0",
68
67
  "@lexical/utils": "^0.46.0"
69
68
  },
@@ -98,9 +97,6 @@
98
97
  "@lexical/code": {
99
98
  "optional": true
100
99
  },
101
- "@lexical/extension": {
102
- "optional": true
103
- },
104
100
  "@lexical/table": {
105
101
  "optional": true
106
102
  },
@@ -109,14 +105,13 @@
109
105
  }
110
106
  },
111
107
  "devDependencies": {
112
- "@astryxdesign/a11y-spec": "0.6.5-canary.c245985",
113
- "@astryxdesign/cli": "0.6.5-canary.c245985",
108
+ "@astryxdesign/a11y-spec": "0.6.5-canary.c8d8a1d",
109
+ "@astryxdesign/cli": "0.6.5-canary.c8d8a1d",
114
110
  "@babel/cli": "^7.29.7",
115
111
  "@babel/core": "^7.29.7",
116
112
  "@babel/preset-react": "^7.29.7",
117
113
  "@babel/preset-typescript": "^7.29.7",
118
114
  "@lexical/code": "^0.46.0",
119
- "@lexical/extension": "^0.46.0",
120
115
  "@lexical/headless": "^0.46.0",
121
116
  "@lexical/html": "^0.46.0",
122
117
  "@lexical/link": "^0.46.0",