@astryxdesign/richtext 0.7.6-canary.fdabeba → 0.7.6
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.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @astryxdesign/richtext
|
|
2
2
|
|
|
3
|
+
# 0.7.6
|
|
4
|
+
|
|
5
|
+
#### Fixes
|
|
6
|
+
|
|
7
|
+
- RichTextEditor's `toolbar` now treats `''` as empty, as it already treated `null`, `undefined` and booleans, so `toolbar=""` no longer adds the toolbar's top border to the editing surface. RichTextEditorToolbar's `endContent` treats `''`, `false` and `true` as empty, so it no longer adds a trailing separator. `0` still counts as content and shows "0". (#9265)
|
|
8
|
+
- Published packages no longer include repository test and benchmark files, reducing install size without changing exports. (#9153)
|
|
9
|
+
|
|
10
|
+
#### Other Changes
|
|
11
|
+
|
|
12
|
+
- RichTextEditor: `statusVariant` names `'tooltip'` in its own type, so it keeps accepting `statusVariant="tooltip"` after FieldStatus drops its deprecated `tooltip` variant in the next minor release. No behavior change. (#9196)
|
|
13
|
+
|
|
14
|
+
#### Contributors
|
|
15
|
+
|
|
16
|
+
Thanks to everyone who contributed to this release:
|
|
17
|
+
|
|
18
|
+
- @cixzhang
|
|
19
|
+
- @ernestt
|
|
20
|
+
- @parinith-web
|
|
21
|
+
- @potatowagon
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
3
25
|
# 0.7.5
|
|
4
26
|
|
|
5
27
|
#### New Features
|
package/dist/RichTextEditor.d.ts
CHANGED
|
@@ -141,7 +141,7 @@ export interface RichTextEditorProps extends Omit<BaseProps, 'onChange' | 'defau
|
|
|
141
141
|
* info-tip button that reveals the message
|
|
142
142
|
* @default 'attached'
|
|
143
143
|
*/
|
|
144
|
-
statusVariant?: FieldStatusVariant;
|
|
144
|
+
statusVariant?: FieldStatusVariant | 'tooltip';
|
|
145
145
|
/**
|
|
146
146
|
* Width of the field. Numbers are treated as pixels, strings are used as-is
|
|
147
147
|
* (e.g. `'100%'`).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditor.d.ts","sourceRoot":"","sources":["../src/RichTextEditor.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAOL,KAAK,SAAS,EACd,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AASf,OAAO,EAML,KAAK,kBAAkB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAIlD,OAAO,
|
|
1
|
+
{"version":3,"file":"RichTextEditor.d.ts","sourceRoot":"","sources":["../src/RichTextEditor.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAOL,KAAK,SAAS,EACd,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AASf,OAAO,EAML,KAAK,kBAAkB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAIlD,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,0BAA0B,CAAC;AAqBlC,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,sBAAsB,CAAC;AACpE,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAC,KAAK,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,OAAO,GAAG,SAAS,CAAC;AAEvE,MAAM,MAAM,kBAAkB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEpD,MAAM,WAAW,oBAAoB;IACnC,qCAAqC;IACrC,IAAI,EA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AkB,GAAG,SAAS,CAAC;IAC/C;;;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;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IAC5C,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;2ZAiCxB,mBAAmB;;CAqPrB,CAAC"}
|
package/dist/RichTextEditor.js
CHANGED
|
@@ -32,7 +32,7 @@ import { Field, inputWrapperStyles, inputStatusBorderStyles, inputStatusHoverSha
|
|
|
32
32
|
import { useInputStatusIcon } from '@astryxdesign/core/hooks';
|
|
33
33
|
import { VisuallyHidden } from '@astryxdesign/core/VisuallyHidden';
|
|
34
34
|
import { useTranslator } from '@astryxdesign/core/i18n';
|
|
35
|
-
import { mergeProps, themeProps } from '@astryxdesign/core/utils';
|
|
35
|
+
import { isRenderable, mergeProps, themeProps } from '@astryxdesign/core/utils';
|
|
36
36
|
import { useSize } from '@astryxdesign/core/SizeContext';
|
|
37
37
|
import { LexicalExtensionComposer } from '@lexical/react/LexicalExtensionComposer';
|
|
38
38
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
@@ -258,7 +258,7 @@ export const RichTextEditor = function RichTextEditor({
|
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
260
|
const hasTabEscapeHint = editable && tabEscapeHint !== '';
|
|
261
|
-
const hasToolbar = toolbar
|
|
261
|
+
const hasToolbar = isRenderable(toolbar);
|
|
262
262
|
const {
|
|
263
263
|
statusIcon,
|
|
264
264
|
describedBy: statusTooltipDescribedBy
|
|
@@ -56,7 +56,7 @@ import { Stack } from '@astryxdesign/core/Stack';
|
|
|
56
56
|
import { HStack, Layout, LayoutContent, LayoutFooter } from '@astryxdesign/core/Layout';
|
|
57
57
|
import { getExtendedIcon } from '@astryxdesign/core/Icon';
|
|
58
58
|
import { useThemeName } from '@astryxdesign/core/theme';
|
|
59
|
-
import { rtlStyles } from '@astryxdesign/core/utils';
|
|
59
|
+
import { isRenderable, rtlStyles } from '@astryxdesign/core/utils';
|
|
60
60
|
import '@astryxdesign/core/theme/tokens.stylex';
|
|
61
61
|
import { fontWeightVars, spacingVars, typeScaleVars } from '@astryxdesign/core/theme/tokens.stylex';
|
|
62
62
|
import { useTranslator } from '@astryxdesign/core/i18n';
|
|
@@ -770,7 +770,7 @@ export function RichTextEditorToolbar({
|
|
|
770
770
|
"aria-expanded": isLinkDialogOpen,
|
|
771
771
|
onMouseDown: event => event.preventDefault(),
|
|
772
772
|
onPressedChange: toggleLink
|
|
773
|
-
}, "link"), endContent
|
|
773
|
+
}, "link"), isRenderable(endContent) && /*#__PURE__*/_jsxs(_Fragment, {
|
|
774
774
|
children: [/*#__PURE__*/_jsx(Divider, {
|
|
775
775
|
orientation: "vertical"
|
|
776
776
|
}), endContent]
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/richtext",
|
|
3
3
|
"displayName": "Rich Text",
|
|
4
|
-
"version": "0.7.6
|
|
4
|
+
"version": "0.7.6",
|
|
5
5
|
"description": "Astryx rich text — a Lexical-based rich text editor and viewer, styled with Astryx design tokens.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
7
7
|
"license": "MIT",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"@stylexjs/stylex": ">=0.10.0",
|
|
69
|
-
"@astryxdesign/core": "0.7.6
|
|
69
|
+
"@astryxdesign/core": "0.7.6",
|
|
70
70
|
"react": ">=19.0.0",
|
|
71
71
|
"react-dom": ">=19.0.0",
|
|
72
72
|
"lexical": "^0.52.0",
|
|
@@ -125,8 +125,6 @@
|
|
|
125
125
|
}
|
|
126
126
|
},
|
|
127
127
|
"devDependencies": {
|
|
128
|
-
"@astryxdesign/a11y-spec": "0.7.6-canary.fdabeba",
|
|
129
|
-
"@astryxdesign/cli": "0.7.6-canary.fdabeba",
|
|
130
128
|
"@babel/cli": "^7.29.7",
|
|
131
129
|
"@babel/core": "^7.29.7",
|
|
132
130
|
"@babel/preset-react": "^7.29.7",
|
|
@@ -145,9 +143,12 @@
|
|
|
145
143
|
"@lexical/utils": "^0.52.0",
|
|
146
144
|
"@stylexjs/babel-plugin": "^0.19.0",
|
|
147
145
|
"@testing-library/react": "^16.3.2",
|
|
148
|
-
"lexical": "^0.52.0"
|
|
146
|
+
"lexical": "^0.52.0",
|
|
147
|
+
"@astryxdesign/a11y-spec": "0.0.0",
|
|
148
|
+
"@astryxdesign/cli": "0.7.6"
|
|
149
149
|
},
|
|
150
150
|
"scripts": {
|
|
151
|
+
"api:report": "node ../../scripts/api-report/cli.mjs --package .",
|
|
151
152
|
"build": "node ../../scripts/clean-dist.mjs && pnpm build:esm && tsc --project tsconfig.build.json && node ../../scripts/add-declaration-extensions.mjs && pnpm build:css && node ../../scripts/check-no-dev-jsx.mjs && node ../../scripts/check-fully-specified.mjs",
|
|
152
153
|
"build:esm": "babel src --out-dir dist --extensions \".ts,.tsx\" --out-file-extension \".js\" --ignore \"**/*.test.ts,**/*.test.tsx,**/__tests__/**,**/*.perf.test.*,**/*.doc.mjs,**/*.d.ts,**/*.css,**/*.css.d.ts\" --config-file ./babel.config.cjs",
|
|
153
154
|
"build:css": "node ../../scripts/build-css.mjs --package richtext",
|
package/src/RichTextEditor.tsx
CHANGED
|
@@ -54,7 +54,12 @@ import type {BaseProps} from '@astryxdesign/core';
|
|
|
54
54
|
import {useInputStatusIcon} from '@astryxdesign/core/hooks';
|
|
55
55
|
import {VisuallyHidden} from '@astryxdesign/core/VisuallyHidden';
|
|
56
56
|
import {useTranslator} from '@astryxdesign/core/i18n';
|
|
57
|
-
import {
|
|
57
|
+
import {
|
|
58
|
+
isRenderable,
|
|
59
|
+
mergeProps,
|
|
60
|
+
themeProps,
|
|
61
|
+
type SizeValue,
|
|
62
|
+
} from '@astryxdesign/core/utils';
|
|
58
63
|
import {useSize} from '@astryxdesign/core/SizeContext';
|
|
59
64
|
|
|
60
65
|
import {LexicalExtensionComposer} from '@lexical/react/LexicalExtensionComposer';
|
|
@@ -370,7 +375,7 @@ export interface RichTextEditorProps extends Omit<
|
|
|
370
375
|
* info-tip button that reveals the message
|
|
371
376
|
* @default 'attached'
|
|
372
377
|
*/
|
|
373
|
-
statusVariant?: FieldStatusVariant;
|
|
378
|
+
statusVariant?: FieldStatusVariant | 'tooltip';
|
|
374
379
|
/**
|
|
375
380
|
* Width of the field. Numbers are treated as pixels, strings are used as-is
|
|
376
381
|
* (e.g. `'100%'`).
|
|
@@ -599,7 +604,7 @@ export const RichTextEditor = function RichTextEditor({
|
|
|
599
604
|
}
|
|
600
605
|
|
|
601
606
|
const hasTabEscapeHint = editable && tabEscapeHint !== '';
|
|
602
|
-
const hasToolbar = toolbar
|
|
607
|
+
const hasToolbar = isRenderable(toolbar);
|
|
603
608
|
|
|
604
609
|
const {statusIcon, describedBy: statusTooltipDescribedBy} =
|
|
605
610
|
useInputStatusIcon({
|
|
@@ -755,6 +760,7 @@ export const RichTextEditor = function RichTextEditor({
|
|
|
755
760
|
<VisuallyHidden id={tabEscapeHintID}>{tabEscapeHint}</VisuallyHidden>
|
|
756
761
|
)}
|
|
757
762
|
</div>
|
|
763
|
+
{/* eslint-disable-next-line @astryx/no-nullish-jsx-guard -- `maxLength` is a number; 0 still shows its counter */}
|
|
758
764
|
{maxLength != null && (
|
|
759
765
|
<div
|
|
760
766
|
id={counterID}
|
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
} from '@astryxdesign/core/Layout';
|
|
83
83
|
import {getExtendedIcon} from '@astryxdesign/core/Icon';
|
|
84
84
|
import {useThemeName} from '@astryxdesign/core/theme';
|
|
85
|
-
import {rtlStyles} from '@astryxdesign/core/utils';
|
|
85
|
+
import {isRenderable, rtlStyles} from '@astryxdesign/core/utils';
|
|
86
86
|
import {
|
|
87
87
|
fontWeightVars,
|
|
88
88
|
spacingVars,
|
|
@@ -988,7 +988,7 @@ export function RichTextEditorToolbar({
|
|
|
988
988
|
onPressedChange={toggleLink}
|
|
989
989
|
/>
|
|
990
990
|
)}
|
|
991
|
-
{endContent
|
|
991
|
+
{isRenderable(endContent) && (
|
|
992
992
|
<>
|
|
993
993
|
<Divider orientation="vertical" />
|
|
994
994
|
{endContent}
|