An open source design system that's fully customizable and agent ready
TypeScript
chore(richtext): remove internal-only references from public source and docs (#6975)
Cindy Zhangf27f74937a95
diff --git a/packages/core/src/theme/generateThemeRules.test.ts b/packages/core/src/theme/generateThemeRules.test.tsindex 318cd18177..3a2aa3542d 100644--- a/packages/core/src/theme/generateThemeRules.test.ts+++ b/packages/core/src/theme/generateThemeRules.test.ts@@ -1116,7 +1116,7 @@ describe('derived var expansion', () => {name: 'test-derived-textarea',components: {textarea: {- base: {paddingInline: 'var(--eps-input-padding-x)'},+ base: {paddingInline: 'var(--app-input-padding-x)'},},},});@@ -1125,11 +1125,11 @@ describe('derived var expansion', () => {expect(rule).toBeDefined();// Value flows to the inner <textarea> via the var…expect(rule).toContain(- '--_textarea-inline-padding: var(--eps-input-padding-x)',+ '--_textarea-inline-padding: var(--app-input-padding-x)',);// …and must NOT land on the flush wrapper, which would re-inset the// full-bleed textarea and push the native resize grip off the corner.- expect(rule).not.toContain('padding-inline: var(--eps-input-padding-x)');+ expect(rule).not.toContain('padding-inline: var(--app-input-padding-x)');});it('lowers onDark and onLight text-area paddingInline to the adaptation leaf', () => {diff --git a/packages/lab/src/index.ts b/packages/lab/src/index.tsindex d66e45e746..86ba68beb4 100644--- a/packages/lab/src/index.ts+++ b/packages/lab/src/index.ts@@ -269,5 +269,5 @@ export {// RichTextEditor (RFC facebook/astryx#3899) has graduated out of @astryxdesign/lab// into its own canary-only package, @astryxdesign/richtext, so it can be canaried-// independently (e.g. into EPS/Nest). Import it from there:+// independently by an adopting application. Import it from there:// import {RichTextEditor, RichTextView} from '@astryxdesign/richtext';diff --git a/packages/richtext/README.md b/packages/richtext/README.mdindex bde1f5cbd9..51a5c3d472 100644--- a/packages/richtext/README.md+++ b/packages/richtext/README.md@@ -27,7 +27,8 @@ It ships to npm **only under the `@canary` dist-tag** — there is never a stabl> Note: this package is the successor to the experimental `RichTextEditor` that> used to live in `@astryxdesign/lab`; that code has moved here so it can be-> canaried independently (e.g. into EPS/Nest) without a fresh package rollout.+> canaried independently by an adopting application without a fresh package+> rollout.## Statusdiff --git a/packages/richtext/src/RichTextEditorAutoLinkPlugin.tsx b/packages/richtext/src/RichTextEditorAutoLinkPlugin.tsxindex aa543b246b..0f3c119a75 100644--- a/packages/richtext/src/RichTextEditorAutoLinkPlugin.tsx+++ b/packages/richtext/src/RichTextEditorAutoLinkPlugin.tsx@@ -22,16 +22,15 @@* NOTE: Experimental `@astryxdesign/richtext` component (canary). `lexical` and* `@lexical/*` are OPTIONAL peer dependencies — install them to use this.*- * COMPATIBILITY: astryx aims for its RichTextEditor internals to eventually- * back Meta's EPS `EPSRichTextArea` (nest/libs/eps-lexical). EPS's auto-link is- * matcher-driven and applies `target="_blank"` + `rel="noopener noreferrer"` to- * created links (its `NEW_TAB_LINK_ATTRIBUTES`). This plugin uses the same- * matcher shape (`createLinkMatcherWithRegExp` + `attributes`) and the same- * new-tab defaults, so EPS can pass its own richer matcher set (e.g. shortform- * `D123` / `T456` / `S789` intern URLs) through the `matchers` prop without- * changing the contract. EPS ships a hardened fork of the transform itself- * (expanded separators, code-block exclusion) — astryx stays on the OSS- * `AutoLinkPlugin`, and EPS can substitute its own plugin in the same slot.+ * COMPATIBILITY: the plugin is deliberately a thin pass-through so an+ * application with its own link conventions can adopt it without forking. It+ * uses the stock matcher shape (`createLinkMatcherWithRegExp` + `attributes`)+ * and new-tab defaults, so a consumer supplies a richer matcher set — an+ * application-specific identifier or ticket syntax, say — through the+ * `matchers` prop without changing the contract. An application needing a+ * hardened transform (expanded separators, code-block exclusion) substitutes+ * its own plugin in the same slot; astryx stays on the upstream+ * `AutoLinkPlugin`.*/import {@@ -44,7 +43,7 @@ import {URL_MATCHER, EMAIL_MATCHER, sanitizeUrl} from './linkUtils';/*** Attributes written onto every auto-created link so it opens in a new tab.* `rel="noopener noreferrer"` is required whenever `target="_blank"` is set, to- * prevent reverse-tabnabbing. Matches EPS eps-lexical's `NEW_TAB_LINK_ATTRIBUTES`.+ * prevent reverse-tabnabbing.*/export const NEW_TAB_LINK_ATTRIBUTES = {target: '_blank',diff --git a/packages/richtext/src/RichTextEditorToolbar.tsx b/packages/richtext/src/RichTextEditorToolbar.tsxindex 9cdc0911d7..dc43dfd4e1 100644--- a/packages/richtext/src/RichTextEditorToolbar.tsx+++ b/packages/richtext/src/RichTextEditorToolbar.tsx@@ -526,9 +526,8 @@ export function RichTextEditorToolbar({setActiveFormats(formats);// Link active state — a link is "active" when the caret/selection anchor- // sits inside a LinkNode (or its immediate parent is one). Mirrors the EPS- // eps-lexical toolbar (`$isLinkNode(parent) || $isLinkNode(node)`), which is- // the implementation astryx aims to be swappable with.+ // sits inside a LinkNode (or its immediate parent is one):+ // `$isLinkNode(parent) || $isLinkNode(node)`.const node = selection.anchor.getNode();const parent = node.getParent();const linkNode = $isLinkNode(node)