@astryxdesign/richtext 0.7.1-canary.9d2b656 → 0.7.1-canary.9f2cdc0

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 (47) hide show
  1. package/README.md +47 -57
  2. package/astryx.integration.mjs +1 -1
  3. package/dist/RichTextEditor.d.ts +16 -12
  4. package/dist/RichTextEditor.d.ts.map +1 -1
  5. package/dist/RichTextEditor.js +40 -45
  6. package/dist/RichTextEditorAutoLinkPlugin.d.ts +3 -3
  7. package/dist/RichTextEditorAutoLinkPlugin.js +3 -3
  8. package/dist/RichTextEditorToolbar.d.ts +19 -8
  9. package/dist/RichTextEditorToolbar.d.ts.map +1 -1
  10. package/dist/RichTextEditorToolbar.js +16 -9
  11. package/dist/RichTextView.d.ts +1 -1
  12. package/dist/RichTextView.js +1 -1
  13. package/dist/editorTheme.d.ts.map +1 -1
  14. package/dist/editorTheme.js +15 -4
  15. package/dist/index.d.ts +10 -5
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +9 -4
  18. package/dist/linkUtils.js +1 -1
  19. package/dist/markdownLink.d.ts.map +1 -1
  20. package/dist/markdownLink.js +25 -33
  21. package/dist/markdownListExport.d.ts.map +1 -1
  22. package/dist/markdownListExport.js +4 -1
  23. package/dist/markdownSerializers.d.ts.map +1 -1
  24. package/dist/markdownSerializers.js +2 -3
  25. package/dist/richtext.css +6 -1
  26. package/package.json +34 -36
  27. package/src/RichTextEditor.doc.mjs +3 -3
  28. package/src/RichTextEditor.test.tsx +36 -2
  29. package/src/RichTextEditor.tsx +54 -54
  30. package/src/RichTextEditorAutoLinkPlugin.tsx +3 -3
  31. package/src/RichTextEditorToolbar.tsx +27 -10
  32. package/src/RichTextView.tsx +1 -1
  33. package/src/__tests__/MarkdownParitySandbox.a11y.chromium.spec.ts +40 -23
  34. package/src/__tests__/MarkdownPlugins.a11y.chromium.spec.ts +2 -2
  35. package/src/__tests__/MarkdownPluginsImportExport.a11y.chromium.spec.ts +35 -1
  36. package/src/__tests__/Playground.a11y.chromium.spec.ts +298 -0
  37. package/src/__tests__/RichTextEditorToolbar.a11y.chromium.spec.ts +1 -1
  38. package/src/__tests__/RichTextView.a11y.chromium.spec.ts +1 -1
  39. package/src/__tests__/TableCellSelection.a11y.chromium.spec.ts +379 -0
  40. package/src/editorTheme.ts +53 -3
  41. package/src/index.ts +9 -11
  42. package/src/linkUtils.ts +1 -1
  43. package/src/markdownAngleDestinations.test.ts +29 -0
  44. package/src/markdownLink.ts +29 -35
  45. package/src/markdownListExport.ts +6 -1
  46. package/src/markdownSerializers.ts +2 -3
  47. package/src/publicSurface.test.ts +42 -0
package/README.md CHANGED
@@ -12,74 +12,64 @@ import {RichTextEditor, RichTextView} from '@astryxdesign/richtext';
12
12
 
13
13
  The editor is deliberately minimal and extensible: pass `nodes` and `plugins` to
14
14
  layer richer behaviour (toolbars, mentions, hover cards) on top without forking.
15
- `RichTextEditorToolbar` is a composable formatting toolbar that drops into the
16
- editor's `plugins` slot, and `markdownToEditorStateJSON` /
17
- `editorStateJSONToMarkdown` convert Markdown to/from serialized editor state
18
- headlessly (no mounted editor required). It consumes `@astryxdesign/core` theme
19
- tokens directly (StyleX build mirrors `@astryxdesign/lab` / `@astryxdesign/charts`).
20
-
21
- `lexical` and the `@lexical/*` packages are **optional** peer dependencies —
22
- install them alongside richtext to use the editor. See the RFC:
15
+ `RichTextEditorToolbar` is a composable formatting toolbar for the editor's
16
+ `toolbar` slot, and `markdownToEditorStateJSON` / `editorStateJSONToMarkdown`
17
+ convert Markdown to and from serialized editor state headlessly (no mounted
18
+ editor required). The server-safe serializers are also available from
19
+ `@astryxdesign/richtext/markdown`.
20
+
21
+ `RichTextView` and core `Markdown` render the same document the same way, and
22
+ Markdown imported into the editor exports back byte for byte when nothing was
23
+ edited.
24
+
25
+ ## Built on Lexical
26
+
27
+ RichText is built on [Lexical](https://lexical.dev) and does not hide it:
28
+ `nodes` and `transformers` take Lexical types, `plugins` takes Lexical React
29
+ plugins, and `onChange(editorState, editor)` and the editor ref's
30
+ `getEditorState()` report Lexical types, so you extend the editor with Lexical
31
+ directly. The value you store is serialized Lexical editor state;
32
+ `markdownToEditorStateJSON` and `editorStateJSONToMarkdown` convert it to and
33
+ from Markdown.
34
+
35
+ RichText supports one Lexical minor at a time, named by its `lexical` and
36
+ `@lexical/*` peer ranges. Those are **optional** peer dependencies, so your
37
+ package manager does not add them: install them at that minor alongside
38
+ richtext. See the RFC:
23
39
  [facebook/astryx#3899](https://github.com/facebook/astryx/issues/3899).
24
40
 
25
- It ships to npm **only under the `@canary` dist-tag** — there is never a stable
26
- (`latest`) release yet.
41
+ ## Install
27
42
 
28
- > Note: this package is the successor to the experimental `RichTextEditor` that
29
- > used to live in `@astryxdesign/lab`; that code has moved here so it can be
30
- > canaried independently by an adopting application without a fresh package
31
- > rollout.
32
-
33
- ## Status
43
+ ```bash
44
+ npm install @astryxdesign/richtext @astryxdesign/core
45
+ ```
34
46
 
35
- Under active development. The editor, view, composable toolbar, and Markdown
36
- serializers are in place; API and visuals are still being refined. The goal is
37
- graduation to `@astryxdesign/core` after the design/API stabilizes.
47
+ Then install every `lexical` and `@lexical/*` package listed in richtext's
48
+ `peerDependencies`, at the range shown there (`npm view @astryxdesign/richtext
49
+ peerDependencies` prints them).
38
50
 
39
- ## Usage
51
+ `@astryxdesign/richtext` is released together with `@astryxdesign/core` at the
52
+ same version; install matching versions. `lexical` and the `@lexical/*` packages
53
+ are optional peer dependencies, so a project that only uses the headless
54
+ Markdown serializers installs just those.
40
55
 
41
- Inside the monorepo (storybook/sandbox), imports resolve via pnpm workspaces:
56
+ RichText ships prebuilt CSS and JS, like `@astryxdesign/core`: import its
57
+ stylesheet beside Core's and your theme's, with no StyleX or Babel setup. Never
58
+ compile richtext's source.
42
59
 
43
60
  ```tsx
44
- import {RichTextEditor, RichTextView} from '@astryxdesign/richtext';
61
+ import '@astryxdesign/core/reset.css';
45
62
  import '@astryxdesign/core/astryx.css';
63
+ import '@astryxdesign/theme-neutral/theme.css'; // or your theme's CSS
46
64
  import '@astryxdesign/richtext/richtext.css';
47
65
  ```
48
66
 
49
- Interactive examples live in the storybook app under **Lab/RichTextEditor**
50
- (`apps/storybook/stories/RichTextEditor.stories.tsx`).
51
-
52
- ### Trying richtext in your own project (canary)
67
+ `richtext.css` emits into `@layer astryx-base`, the layer `astryx.css` opens,
68
+ so your theme's token overrides (`@layer astryx-theme`) win over it, as long
69
+ as Core's `reset.css` (or a `@layer reset, astryx-base, astryx-theme;` line,
70
+ if your app has its own reset) loads first.
53
71
 
54
- `@astryxdesign/richtext` is published **only** under the `@canary` dist-tag, so
55
- you must request that tag explicitly. There is no `latest` version to install.
72
+ ## Examples
56
73
 
57
- ```bash
58
- npm install @astryxdesign/richtext@canary @astryxdesign/core@canary
59
- # plus the optional lexical peers you use:
60
- npm install lexical @lexical/react @lexical/markdown @lexical/rich-text
61
- ```
62
-
63
- > Canary builds track the latest commit on `main` (`0.x.y-canary.<sha>`). They
64
- > can break between any two versions — pin an exact version if you need
65
- > stability.
66
-
67
- ## Why no stable release?
68
-
69
- `package.json` keeps `"private": true` plus an `"astryx": { "canaryOnly": true }`
70
- marker. The release workflow's stable (`latest`) job skips both private and
71
- `canaryOnly` packages, while the canary job strips `private` in its ephemeral CI
72
- checkout only (never in git) to publish the `@canary` tag. The committed
73
- `private: true` is npm's hard guarantee that no stable publish can ever happen —
74
- **do not remove it.**
75
-
76
- ## Publishing publicly (when the editor/view are ready)
77
-
78
- When maintainers are ready to promote richtext to a stable public release:
79
-
80
- 1. Remove `"private": true` **and** the `"astryx": { "canaryOnly": true }`
81
- marker from `package.json`.
82
- 2. Add a changeset (`pnpm changeset`) selecting `@astryxdesign/richtext` so the
83
- release workflow versions and publishes it to the `latest` dist-tag.
84
- 3. The stable (`latest`) release job (`.github/workflows/release.yml`) will then
85
- include richtext on the next release.
74
+ Interactive examples live in Storybook under **RichText/RichTextEditor**
75
+ (`apps/storybook/stories/RichTextEditor.stories.tsx`).
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * Astryx CLI integration for the canary-only Rich Text package.
4
+ * Astryx CLI integration for the Rich Text package.
5
5
  * Package identity and version come from package.json.
6
6
  */
7
7
  export default {
@@ -7,7 +7,7 @@
7
7
  * top toolbar slot, configurable editable-surface minimum height, and distinct
8
8
  * read-only and disabled states that follow prop changes, RichTextEditorProps,
9
9
  * RichTextEditorStatus, RichTextEditorStatusType, RichTextEditorSize
10
- * @position Experimental (richtext) implementation; consumed by the package index.ts and
10
+ * @position @astryxdesign/richtext implementation; consumed by the package index.ts and
11
11
  * re-exported from @astryxdesign/richtext. Tested by RichTextEditor.test.tsx.
12
12
  *
13
13
  * SYNC: When modified, update these files to stay in sync:
@@ -16,19 +16,15 @@
16
16
  * - /packages/richtext/src/index.ts (exports if types change)
17
17
  * - /apps/storybook/stories/RichTextEditor.stories.tsx (storybook stories)
18
18
  *
19
- * NOTE: This is an EXPERIMENTAL component in @astryxdesign/richtext (published only under
20
- * the `@canary` dist-tag, never as stable `latest`). It is the initial landing for the
21
- * OSS Lexical editor RFC; the goal is graduation to @astryxdesign/core after the
22
- * Component Specification Protocol. `lexical` and `@lexical/*` are OPTIONAL peer
23
- * dependencies — install them to use this component.
19
+ * NOTE: `lexical` and `@lexical/*` are OPTIONAL peer dependencies — install them to
20
+ * use this component.
24
21
  */
25
- import { type ReactNode } from 'react';
22
+ import { type ReactNode, type Ref } from 'react';
26
23
  import { type FieldStatusVariant } from '@astryxdesign/core/Field';
27
24
  import type { BaseProps } from '@astryxdesign/core';
28
25
  import { type SizeValue } from '@astryxdesign/core/utils';
29
26
  import type { RichTextMarkdownExtension } from './markdownExtensions';
30
27
  import { type Transformer } from '@lexical/markdown';
31
- export type { Transformer } from '@lexical/markdown';
32
28
  import { type EditorState, type Klass, type LexicalEditor, type LexicalNode } from 'lexical';
33
29
  export type RichTextEditorStatusType = 'warning' | 'error' | 'success';
34
30
  export type RichTextEditorSize = 'sm' | 'md' | 'lg';
@@ -77,6 +73,12 @@ export interface RichTextEditorRef {
77
73
  getEditor: () => LexicalEditor;
78
74
  }
79
75
  export interface RichTextEditorProps extends Omit<BaseProps, 'onChange' | 'defaultValue'> {
76
+ /**
77
+ * Imperative handle for callers that manage the editor from outside. In
78
+ * React 19 `ref` is an ordinary prop, so it is declared here rather than
79
+ * supplied by a `forwardRef` wrapper.
80
+ */
81
+ ref?: Ref<RichTextEditorRef>;
80
82
  /** Label text for the editor (always rendered for accessibility). */
81
83
  label: string;
82
84
  /**
@@ -238,9 +240,8 @@ export interface RichTextEditorProps extends Omit<BaseProps, 'onChange' | 'defau
238
240
  }
239
241
  /**
240
242
  * A WYSIWYG rich-text editor built on Lexical, styled with Astryx design
241
- * tokens. Experimental — ships from `@astryxdesign/richtext` (canary). `lexical` and
242
- * `@lexical/*` are optional peer dependencies — install them to use this
243
- * component.
243
+ * tokens. Ships from `@astryxdesign/richtext`. `lexical` and `@lexical/*` are
244
+ * optional peer dependencies — install them to use this component.
244
245
  *
245
246
  * The editor is intentionally minimal and extensible: pass `toolbar`, `nodes`,
246
247
  * and `plugins` to layer richer behaviour (formatting, mentions, hover cards)
@@ -261,5 +262,8 @@ export interface RichTextEditorProps extends Omit<BaseProps, 'onChange' | 'defau
261
262
  * />
262
263
  * ```
263
264
  */
264
- export declare const RichTextEditor: import("react").ForwardRefExoticComponent<RichTextEditorProps & import("react").RefAttributes<RichTextEditorRef>>;
265
+ export declare const RichTextEditor: {
266
+ ({ label, isLabelHidden, description, isOptional, isRequired, defaultValue, onChange, placeholder, isReadOnly, isDisabled, status, statusVariant, width, minHeight, labelTooltip, size: sizeProp, nodes, toolbar, plugins, hasMarkdownShortcuts, transformers, markdownExtensions, hasAutoFocus, tabEscapeHint: tabEscapeHintFromProps, maxLength, namespace, xstyle, className, style, ref, ...rest }: RichTextEditorProps): import("react").JSX.Element;
267
+ displayName: string;
268
+ };
265
269
  //# sourceMappingUR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AAa,CAAC,EAAE,kBAAkB,CAAC;IACnC;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,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;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,aAAa,CAAC,yBAAyB,CAAC,CAAC;IAC9D,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;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,cAAc;4YAgCxB,mBAAmB;;CAoPrB,CAAC"}
@@ -11,7 +11,7 @@
11
11
  * top toolbar slot, configurable editable-surface minimum height, and distinct
12
12
  * read-only and disabled states that follow prop changes, RichTextEditorProps,
13
13
  * RichTextEditorStatus, RichTextEditorStatusType, RichTextEditorSize
14
- * @position Experimental (richtext) implementation; consumed by the package index.ts and
14
+ * @position @astryxdesign/richtext implementation; consumed by the package index.ts and
15
15
  * re-exported from @astryxdesign/richtext. Tested by RichTextEditor.test.tsx.
16
16
  *
17
17
  * SYNC: When modified, update these files to stay in sync:
@@ -20,13 +20,10 @@
20
20
  * - /packages/richtext/src/index.ts (exports if types change)
21
21
  * - /apps/storybook/stories/RichTextEditor.stories.tsx (storybook stories)
22
22
  *
23
- * NOTE: This is an EXPERIMENTAL component in @astryxdesign/richtext (published only under
24
- * the `@canary` dist-tag, never as stable `latest`). It is the initial landing for the
25
- * OSS Lexical editor RFC; the goal is graduation to @astryxdesign/core after the
26
- * Component Specification Protocol. `lexical` and `@lexical/*` are OPTIONAL peer
27
- * dependencies — install them to use this component.
23
+ * NOTE: `lexical` and `@lexical/*` are OPTIONAL peer dependencies — install them to
24
+ * use this component.
28
25
  */
29
- import { useEffect, useId, useImperativeHandle, useMemo, useRef, useState, forwardRef } from 'react';
26
+ import { useEffect, useId, useImperativeHandle, useMemo, useRef, useState } from 'react';
30
27
  import * as stylex from '@stylexjs/stylex';
31
28
  import '@astryxdesign/core/theme/tokens.stylex';
32
29
  import { colorVars, spacingVars, typographyVars, typeScaleVars } from '@astryxdesign/core/theme/tokens.stylex';
@@ -108,24 +105,6 @@ const styles = {
108
105
  kAzted: "x65nank",
109
106
  $$css: true
110
107
  },
111
- editorBody: {
112
- kVAEAm: "x1n2onr6",
113
- kB7OPa: "x9f619",
114
- kzqmXN: "xh8yej3",
115
- k8WAf4: "xu0wf1k",
116
- kg3NbH: "xf314gf",
117
- $$css: true
118
- },
119
- editorBodyWithToolbar: {
120
- kEafiO: "x178xt8z",
121
- kPef9Z: "x13fuv20",
122
- kLZC3w: "x1pc3f07",
123
- $$css: true
124
- },
125
- editorBodyWithStatus: {
126
- kwRFfy: "xp74n0j",
127
- $$css: true
128
- },
129
108
  contentEditable: {
130
109
  k1xSpc: "x1lliihq",
131
110
  kzqmXN: "xh8yej3",
@@ -149,19 +128,6 @@ const dynamicStyles = {
149
128
  "--x-minHeight": (val => typeof val === "number" ? val + "px" : val != null ? val : undefined)(minHeight)
150
129
  }]
151
130
  };
152
- const editorBodySizeStyles = {
153
- sm: {
154
- $$css: true
155
- },
156
- md: {
157
- $$css: true
158
- },
159
- lg: {
160
- k8WAf4: "xce4md1",
161
- $$css: true
162
- }
163
- };
164
-
165
131
  /**
166
132
  * Fraction of `maxLength` at which the character counter begins announcing
167
133
  * remaining/over-limit characters to screen readers. Matches TextArea.
@@ -175,9 +141,8 @@ const COUNTER_WARNING_THRESHOLD = 0.8;
175
141
 
176
142
  /**
177
143
  * A WYSIWYG rich-text editor built on Lexical, styled with Astryx design
178
- * tokens. Experimental — ships from `@astryxdesign/richtext` (canary). `lexical` and
179
- * `@lexical/*` are optional peer dependencies — install them to use this
180
- * component.
144
+ * tokens. Ships from `@astryxdesign/richtext`. `lexical` and `@lexical/*` are
145
+ * optional peer dependencies — install them to use this component.
181
146
  *
182
147
  * The editor is intentionally minimal and extensible: pass `toolbar`, `nodes`,
183
148
  * and `plugins` to layer richer behaviour (formatting, mentions, hover cards)
@@ -198,7 +163,7 @@ const COUNTER_WARNING_THRESHOLD = 0.8;
198
163
  * />
199
164
  * ```
200
165
  */
201
- export const RichTextEditor = /*#__PURE__*/forwardRef(function RichTextEditor({
166
+ export const RichTextEditor = function RichTextEditor({
202
167
  label,
203
168
  isLabelHidden = false,
204
169
  description,
@@ -228,8 +193,9 @@ export const RichTextEditor = /*#__PURE__*/forwardRef(function RichTextEditor({
228
193
  xstyle,
229
194
  className,
230
195
  style,
196
+ ref,
231
197
  ...rest
232
- }, ref) {
198
+ }) {
233
199
  const size = useSize(sizeProp, 'md');
234
200
  const t = useTranslator();
235
201
  const tabEscapeHint = tabEscapeHintFromProps ?? t('@astryx.richTextEditor.tabEscapeHint');
@@ -333,7 +299,32 @@ export const RichTextEditor = /*#__PURE__*/forwardRef(function RichTextEditor({
333
299
  extension: extensionRef.current,
334
300
  contentEditable: null,
335
301
  children: [hasToolbar ? toolbar : null, /*#__PURE__*/_jsxs("div", {
336
- ...stylex.props(styles.editorBody, hasToolbar && styles.editorBodyWithToolbar, !!statusIcon && styles.editorBodyWithStatus, editorBodySizeStyles[size]),
302
+ ...{
303
+ 0: {
304
+ className: "x1n2onr6 x9f619 xh8yej3 xu0wf1k xf314gf"
305
+ },
306
+ 4: {
307
+ className: "x1n2onr6 x9f619 xh8yej3 xu0wf1k xf314gf x178xt8z x13fuv20 x1pc3f07"
308
+ },
309
+ 2: {
310
+ className: "x1n2onr6 x9f619 xh8yej3 xu0wf1k xf314gf xp74n0j"
311
+ },
312
+ 6: {
313
+ className: "x1n2onr6 x9f619 xh8yej3 xu0wf1k xf314gf x178xt8z x13fuv20 x1pc3f07 xp74n0j"
314
+ },
315
+ 1: {
316
+ className: "x1n2onr6 x9f619 xh8yej3 xf314gf xce4md1"
317
+ },
318
+ 5: {
319
+ className: "x1n2onr6 x9f619 xh8yej3 xf314gf x178xt8z x13fuv20 x1pc3f07 xce4md1"
320
+ },
321
+ 3: {
322
+ className: "x1n2onr6 x9f619 xh8yej3 xf314gf xp74n0j xce4md1"
323
+ },
324
+ 7: {
325
+ className: "x1n2onr6 x9f619 xh8yej3 xf314gf x178xt8z x13fuv20 x1pc3f07 xp74n0j xce4md1"
326
+ }
327
+ }[!!hasToolbar << 2 | !!!!statusIcon << 1 | !!(size === 'lg') << 0],
337
328
  children: [/*#__PURE__*/_jsxs("div", {
338
329
  ...{
339
330
  className: "x1n2onr6 xh8yej3 x9ynric xjm74w1 xf9zqsd xw6l6zx"
@@ -409,7 +400,11 @@ export const RichTextEditor = /*#__PURE__*/forwardRef(function RichTextEditor({
409
400
  })]
410
401
  })]
411
402
  });
412
- });
403
+ };
404
+
405
+ // Keeps the editor inside `@astryx/require-baseprops-passthrough`, which only
406
+ // checks components that assign a top-level `displayName`. Without it, a
407
+ // dropped `className`, `style` or `xstyle` on the root stops warning.
413
408
  RichTextEditor.displayName = 'RichTextEditor';
414
409
 
415
410
  /**
@@ -5,7 +5,7 @@
5
5
  * `linkUtils`.
6
6
  * @output Exports `RichTextEditorAutoLinkPlugin` and its props type, plus the
7
7
  * default `DEFAULT_LINK_MATCHERS`.
8
- * @position Experimental (lab). Drop into RichTextEditor's `plugins` slot to
8
+ * @position @astryxdesign/richtext. Drop into RichTextEditor's `plugins` slot to
9
9
  * auto-linkify URLs and emails as they are typed or pasted. Requires
10
10
  * `AutoLinkNode` to be registered (it is, by default).
11
11
  *
@@ -15,8 +15,8 @@
15
15
  * - /packages/richtext/src/RichTextEditor.test.tsx (tests)
16
16
  * - /apps/storybook/stories/RichTextEditor.stories.tsx (story)
17
17
  *
18
- * NOTE: Experimental `@astryxdesign/richtext` component (canary). `lexical` and
19
- * `@lexical/*` are OPTIONAL peer dependencies — install them to use this.
18
+ * NOTE: `lexical` and `@lexical/*` are OPTIONAL peer dependencies — install them
19
+ * to use this.
20
20
  *
21
21
  * COMPATIBILITY: the plugin is deliberately a thin pass-through so an
22
22
  * application with its own link conventions can adopt it without forking. It
@@ -9,7 +9,7 @@
9
9
  * `linkUtils`.
10
10
  * @output Exports `RichTextEditorAutoLinkPlugin` and its props type, plus the
11
11
  * default `DEFAULT_LINK_MATCHERS`.
12
- * @position Experimental (lab). Drop into RichTextEditor's `plugins` slot to
12
+ * @position @astryxdesign/richtext. Drop into RichTextEditor's `plugins` slot to
13
13
  * auto-linkify URLs and emails as they are typed or pasted. Requires
14
14
  * `AutoLinkNode` to be registered (it is, by default).
15
15
  *
@@ -19,8 +19,8 @@
19
19
  * - /packages/richtext/src/RichTextEditor.test.tsx (tests)
20
20
  * - /apps/storybook/stories/RichTextEditor.stories.tsx (story)
21
21
  *
22
- * NOTE: Experimental `@astryxdesign/richtext` component (canary). `lexical` and
23
- * `@lexical/*` are OPTIONAL peer dependencies — install them to use this.
22
+ * NOTE: `lexical` and `@lexical/*` are OPTIONAL peer dependencies — install them
23
+ * to use this.
24
24
  *
25
25
  * COMPATIBILITY: the plugin is deliberately a thin pass-through so an
26
26
  * application with its own link conventions can adopt it without forking. It
@@ -7,9 +7,11 @@
7
7
  * @output Exports RichTextEditorToolbar (a compact formatting toolbar with a
8
8
  * RichText-owned 4px control gutter and horizontally scrollable action row)
9
9
  * and RichTextEditorToolbarProps.
10
- * @position Experimental (richtext). Drop into RichTextEditor's `toolbar` slot to
10
+ * @position @astryxdesign/richtext. Drop into RichTextEditor's `toolbar` slot to
11
11
  * add a flush top formatting toolbar. Themed via Astryx Toolbar, Selector,
12
- * IconButton, and ToggleButton, so it inherits the active theme.
12
+ * IconButton, and ToggleButton, so it inherits the active theme. Base props
13
+ * pass through to the Astryx Toolbar exactly as Toolbar places them
14
+ * (spec:AST-061/DEC-8).
13
15
  *
14
16
  * SYNC: When modified, update:
15
17
  * - /packages/richtext/src/index.ts (exports)
@@ -17,8 +19,8 @@
17
19
  * - /packages/richtext/src/RichTextEditor.test.tsx (tests)
18
20
  * - /apps/storybook/stories/RichTextEditor.stories.tsx (WithToolbar story)
19
21
  *
20
- * NOTE: Experimental `@astryxdesign/richtext` component (canary). `lexical` and
21
- * `@lexical/*` are OPTIONAL peer dependencies — install them to use this.
22
+ * NOTE: `lexical` and `@lexical/*` are OPTIONAL peer dependencies — install them
23
+ * to use this.
22
24
  * Behavior mirrors the Lexical playground toolbar (selection sync + format
23
25
  * commands); the UI is built from Astryx primitives so it matches the theme.
24
26
  *
@@ -30,7 +32,8 @@
30
32
  * Undo and redo point backward and forward in time, so they mirror under RTL
31
33
  * whichever glyph draws them.
32
34
  */
33
- import { type ReactNode } from 'react';
35
+ import { type ReactNode, type Ref } from 'react';
36
+ import type { BaseProps } from '@astryxdesign/core';
34
37
  /**
35
38
  * Stable icon-registry keys for the toolbar's controls. A theme overrides any
36
39
  * of these by key: `defineTheme({icons: {'richtext:bold': <MyIcon />}})`.
@@ -54,7 +57,15 @@ export declare const RICHTEXT_ICON_KEYS: {
54
57
  readonly undo: "richtext:undo";
55
58
  readonly redo: "richtext:redo";
56
59
  };
57
- export interface RichTextEditorToolbarProps {
60
+ export interface RichTextEditorToolbarProps extends BaseProps<HTMLDivElement> {
61
+ /**
62
+ * Ref to the toolbar's root element. Base props pass through to the
63
+ * underlying Astryx `Toolbar`: the ref, `className`, `style`, and `xstyle`
64
+ * reach its root, and `data-*`, other `aria-*` attributes, and DOM
65
+ * handlers reach the `role="toolbar"` element inside it. The toolbar names
66
+ * itself, so pass `label` rather than `aria-label`.
67
+ */
68
+ ref?: Ref<HTMLDivElement>;
58
69
  /**
59
70
  * Accessible label for the toolbar element.
60
71
  * @default 'Text formatting', translated for the active locale
@@ -98,7 +109,7 @@ export interface RichTextEditorToolbarProps {
98
109
  * create same-tab links.
99
110
  * @default true
100
111
  */
101
- linkOpensInNewTab?: boolean;
112
+ hasNewTabLinks?: boolean;
102
113
  /**
103
114
  * Extra items rendered at the end of the toolbar (after a divider). Use this
104
115
  * to compose product-specific controls (e.g. mentions, AI) alongside the
@@ -126,7 +137,7 @@ export interface RichTextEditorToolbarProps {
126
137
  * />
127
138
  * ```
128
139
  */
129
- export declare function RichTextEditorToolbar({ label: labelFromProps, headingLevels, size, hasLink, promptForUrl, linkOpensInNewTab, endContent, }: RichTextEditorToolbarProps): import("react").JSX.Element;
140
+ export declare function RichTextEditorToolbar({ label: labelFromProps, headingLevels, size, hasLink, promptForUrl, hasNewTabLinks, endContent, xstyle, ref, ...rest }: RichTextEditorToolbarProps): import("react").JSX.Element;
130
141
  export declare namespace RichTextEditorToolbar {
131
142
  var displayName: string;
132
143
  }
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextEditorToolbar.d.ts","sourceRoot":"","sources":["../src/RichTextEditorToolbar.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAgJf;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;CAgBrB,CAAC;AAmPX,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC,IA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G;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACnE;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;OAIG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EAAE,cAAc,EACrB,aAAkC,EAClC,IAAW,EACX,OAAc,EACd,YAAY,EACZ,cAAqB,EACrB,UAAU,EACV,MAAM,EACN,GAAG,EACH,GAAG,IAAI,EACR,EAAE,0BAA0B,+BA0gB5B;yBArhBe,qBAAqB"}
@@ -11,9 +11,11 @@
11
11
  * @output Exports RichTextEditorToolbar (a compact formatting toolbar with a
12
12
  * RichText-owned 4px control gutter and horizontally scrollable action row)
13
13
  * and RichTextEditorToolbarProps.
14
- * @position Experimental (richtext). Drop into RichTextEditor's `toolbar` slot to
14
+ * @position @astryxdesign/richtext. Drop into RichTextEditor's `toolbar` slot to
15
15
  * add a flush top formatting toolbar. Themed via Astryx Toolbar, Selector,
16
- * IconButton, and ToggleButton, so it inherits the active theme.
16
+ * IconButton, and ToggleButton, so it inherits the active theme. Base props
17
+ * pass through to the Astryx Toolbar exactly as Toolbar places them
18
+ * (spec:AST-061/DEC-8).
17
19
  *
18
20
  * SYNC: When modified, update:
19
21
  * - /packages/richtext/src/index.ts (exports)
@@ -21,8 +23,8 @@
21
23
  * - /packages/richtext/src/RichTextEditor.test.tsx (tests)
22
24
  * - /apps/storybook/stories/RichTextEditor.stories.tsx (WithToolbar story)
23
25
  *
24
- * NOTE: Experimental `@astryxdesign/richtext` component (canary). `lexical` and
25
- * `@lexical/*` are OPTIONAL peer dependencies — install them to use this.
26
+ * NOTE: `lexical` and `@lexical/*` are OPTIONAL peer dependencies — install them
27
+ * to use this.
26
28
  * Behavior mirrors the Lexical playground toolbar (selection sync + format
27
29
  * commands); the UI is built from Astryx primitives so it matches the theme.
28
30
  *
@@ -416,8 +418,11 @@ export function RichTextEditorToolbar({
416
418
  size = 'sm',
417
419
  hasLink = true,
418
420
  promptForUrl,
419
- linkOpensInNewTab = true,
420
- endContent
421
+ hasNewTabLinks = true,
422
+ endContent,
423
+ xstyle,
424
+ ref,
425
+ ...rest
421
426
  }) {
422
427
  const [editor] = useLexicalComposerContext();
423
428
  const themeName = useThemeName();
@@ -537,7 +542,7 @@ export function RichTextEditorToolbar({
537
542
  return false;
538
543
  }
539
544
  restoreLinkSelection();
540
- const linkAttributes = linkOpensInNewTab ? {
545
+ const linkAttributes = hasNewTabLinks ? {
541
546
  target: '_blank',
542
547
  rel: 'noopener noreferrer'
543
548
  } : {};
@@ -556,7 +561,7 @@ export function RichTextEditorToolbar({
556
561
  });
557
562
  }
558
563
  return true;
559
- }, [editor, linkOpensInNewTab, restoreLinkSelection]);
564
+ }, [editor, hasNewTabLinks, restoreLinkSelection]);
560
565
  const toggleLink = useCallback(() => {
561
566
  if (!editor.isEditable()) {
562
567
  return;
@@ -695,9 +700,11 @@ export function RichTextEditorToolbar({
695
700
  }];
696
701
  return /*#__PURE__*/_jsxs(_Fragment, {
697
702
  children: [/*#__PURE__*/_jsx(Toolbar, {
703
+ ...rest,
704
+ ref: ref,
698
705
  label: label,
699
706
  size: size,
700
- xstyle: toolbarScrollStyles.compactToolbar,
707
+ xstyle: [toolbarScrollStyles.compactToolbar, xstyle],
701
708
  startContent: /*#__PURE__*/_jsxs(HStack, {
702
709
  gap: 1,
703
710
  role: "group",
@@ -6,7 +6,7 @@
6
6
  * @output Exports RichTextView component and RichTextViewProps
7
7
  * @position Read-only renderer for serialized Lexical editor state, exposed to
8
8
  * assistive technology as document content rather than a form field;
9
- * experimental (richtext), exported from @astryxdesign/richtext
9
+ * exported from @astryxdesign/richtext
10
10
  *
11
11
  * SYNC: When modified, update these files to stay in sync:
12
12
  * - /packages/richtext/src/RichTextEditor.test.tsx
@@ -10,7 +10,7 @@
10
10
  * @output Exports RichTextView component and RichTextViewProps
11
11
  * @position Read-only renderer for serialized Lexical editor state, exposed to
12
12
  * assistive technology as document content rather than a form field;
13
- * experimental (richtext), exported from @astryxdesign/richtext
13
+ * exported from @astryxdesign/richtext
14
14
  *
15
15
  * SYNC: When modified, update these files to stay in sync:
16
16
  * - /packages/richtext/src/RichTextEditor.test.tsx
@@ -1 +1 @@
1
- {"version":3,"file":"editorTheme.d.ts","sourceRoot":"","sources":["../src/editorTheme.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAC;AAyXhD;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,kBAAkB,CA6DtD"}
1
+ {"version":3,"file":"editorTheme.d.ts","sourceRoot":"","sources":["../src/editorTheme.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAC;AAwahD;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,kBAAkB,CAgEtD"}
@@ -48,8 +48,8 @@ const editorTheme = {
48
48
  $$css: true
49
49
  },
50
50
  paragraph: {
51
- keoZOQ: "x1ftnraw xnhvf09",
52
- k1K539: "x18pneqc xfo59cc",
51
+ keoZOQ: "x1ftnraw xnhvf09 xe66n16",
52
+ k1K539: "x18pneqc xfo59cc x1vugyqv",
53
53
  ks0D6T: "x7ep2pv",
54
54
  k63SB2: "x1pd3egz",
55
55
  kMwMTN: "x1heor9g",
@@ -201,6 +201,13 @@ const editorTheme = {
201
201
  kMwMTN: "xv1l7n4",
202
202
  $$css: true
203
203
  },
204
+ tableCellSelected: {
205
+ kMeerF: "xak0ai5",
206
+ k3XXqK: "x9ssot5",
207
+ kjBf7l: "x19bwoy8",
208
+ kInvED: "x1c097ug",
209
+ $$css: true
210
+ },
204
211
  code: {
205
212
  k1xSpc: "x1lliihq",
206
213
  kMv6JI: "x9m5x89",
@@ -221,7 +228,8 @@ const editorTheme = {
221
228
  keoZOQ: "x1w2a574 xnhvf09",
222
229
  k1K539: "x1u2y747 xfo59cc",
223
230
  khDVqt: "x126k92a",
224
- kHjlTd: "xj0a0fe",
231
+ kTgw9: "x1yn0g08",
232
+ kHjlTd: "x1mzt3pk",
225
233
  $$css: true
226
234
  }
227
235
  };
@@ -286,7 +294,7 @@ export function sharedEditorTheme() {
286
294
  // The plain class lets CodeSyntaxPlugin's highlight rules find code blocks.
287
295
  code: `${block(editorTheme.code)} ${CODE_SYNTAX_CLASS}`,
288
296
  hr: {
289
- className: "xc342km x11xkdxz x13fuv20 x1pc3f07 x13xmvwt xnhvf09 x1qaki06 xfo59cc"
297
+ className: "xc342km x11xkdxz x13fuv20 x1pc3f07 x13xmvwt xnhvf09 xe66n16 x1qaki06 xfo59cc x1vugyqv"
290
298
  }.className,
291
299
  hrSelected: {
292
300
  className: "xak0ai5 x9ssot5 x19bwoy8 x1eqjuhu"
@@ -301,6 +309,9 @@ export function sharedEditorTheme() {
301
309
  tableRow: block(editorTheme.tableRow),
302
310
  tableCell: block(editorTheme.tableCell),
303
311
  tableCellHeader: block(editorTheme.tableCellHeader),
312
+ // Added on top of the cell's own class by Lexical while the cell is in a
313
+ // table selection, so it carries no direction of its own.
314
+ tableCellSelected: className(editorTheme.tableCellSelected),
304
315
  tableScrollableWrapper: block(editorTheme.tableScrollableWrapper)
305
316
  };
306
317
  }