@astryxdesign/richtext 0.7.0-canary.693da50 → 0.7.0-canary.6ecd417
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditorToolbar.d.ts","sourceRoot":"","sources":["../src/RichTextEditorToolbar.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"RichTextEditorToolbar.d.ts","sourceRoot":"","sources":["../src/RichTextEditorToolbar.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AA6If;;;;;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,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;IAClD;;;;OAIG;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,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;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,iBAAwB,EACxB,UAAU,GACX,EAAE,0BAA0B,+BAwgB5B;yBAhhBe,qBAAqB"}
|
|
@@ -50,7 +50,7 @@ import { Dialog, DialogHeader } from '@astryxdesign/core/Dialog';
|
|
|
50
50
|
import { TextInput } from '@astryxdesign/core/TextInput';
|
|
51
51
|
import { Button } from '@astryxdesign/core/Button';
|
|
52
52
|
import { Stack } from '@astryxdesign/core/Stack';
|
|
53
|
-
import { HStack, Layout, LayoutContent, LayoutFooter } from '@astryxdesign/core/Layout';
|
|
53
|
+
import { EDGE_COMP_ATTR, HStack, Layout, LayoutContent, LayoutFooter } from '@astryxdesign/core/Layout';
|
|
54
54
|
import { getExtendedIcon } from '@astryxdesign/core/Icon';
|
|
55
55
|
import { useThemeName } from '@astryxdesign/core/theme';
|
|
56
56
|
import { rtlStyles } from '@astryxdesign/core/utils';
|
|
@@ -102,6 +102,14 @@ const toolbarScrollStyles = {
|
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
104
|
|
|
105
|
+
// The scroll row is this standalone toolbar's sole slot child. Opting it into
|
|
106
|
+
// Toolbar's container-owned edge compensation gives the formatting surface a
|
|
107
|
+
// 4px inline inset at `sm` without moving generic nested Toolbar content off
|
|
108
|
+
// its surrounding Card/Section content line.
|
|
109
|
+
const toolbarEdgeCompensationProps = {
|
|
110
|
+
[EDGE_COMP_ATTR]: ''
|
|
111
|
+
};
|
|
112
|
+
|
|
105
113
|
/**
|
|
106
114
|
* Whether `event` is the insert-link shortcut (Cmd/Ctrl+K). Uses Lexical's
|
|
107
115
|
* `isExactShortcutMatch`, which — unlike a loose `metaKey || ctrlKey` check —
|
|
@@ -690,6 +698,7 @@ export function RichTextEditorToolbar({
|
|
|
690
698
|
label: label,
|
|
691
699
|
size: size,
|
|
692
700
|
startContent: /*#__PURE__*/_jsxs(HStack, {
|
|
701
|
+
...toolbarEdgeCompensationProps,
|
|
693
702
|
gap: 1,
|
|
694
703
|
role: "group",
|
|
695
704
|
"aria-label": t('@astryx.richTextEditor.toolbar.actions'),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/richtext",
|
|
3
3
|
"displayName": "Rich Text",
|
|
4
|
-
"version": "0.7.0-canary.
|
|
4
|
+
"version": "0.7.0-canary.6ecd417",
|
|
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",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"@stylexjs/stylex": ">=0.10.0",
|
|
58
|
-
"@astryxdesign/core": "0.7.0-canary.
|
|
58
|
+
"@astryxdesign/core": "0.7.0-canary.6ecd417",
|
|
59
59
|
"react": ">=19.0.0",
|
|
60
60
|
"react-dom": ">=19.0.0",
|
|
61
61
|
"lexical": "^0.46.0",
|
|
@@ -114,8 +114,8 @@
|
|
|
114
114
|
}
|
|
115
115
|
},
|
|
116
116
|
"devDependencies": {
|
|
117
|
-
"@astryxdesign/a11y-spec": "0.7.0-canary.
|
|
118
|
-
"@astryxdesign/cli": "0.7.0-canary.
|
|
117
|
+
"@astryxdesign/a11y-spec": "0.7.0-canary.6ecd417",
|
|
118
|
+
"@astryxdesign/cli": "0.7.0-canary.6ecd417",
|
|
119
119
|
"@babel/cli": "^7.29.7",
|
|
120
120
|
"@babel/core": "^7.29.7",
|
|
121
121
|
"@babel/preset-react": "^7.29.7",
|
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
} from './markdownSerializers';
|
|
42
42
|
import {RichTextEditorToolbar} from './RichTextEditorToolbar';
|
|
43
43
|
import {registerIcons, resetIcons} from '@astryxdesign/core/Icon';
|
|
44
|
+
import {EDGE_COMP_ATTR} from '@astryxdesign/core/Layout';
|
|
44
45
|
import {Theme, defineTheme} from '@astryxdesign/core/theme';
|
|
45
46
|
import {rtlStyles} from '@astryxdesign/core/utils';
|
|
46
47
|
import {InternationalizationProvider} from '@astryxdesign/core/i18n';
|
|
@@ -1420,6 +1421,7 @@ describe('RichTextEditorToolbar', () => {
|
|
|
1420
1421
|
const actionRow = screen.getByRole('group', {
|
|
1421
1422
|
name: 'Formatting actions',
|
|
1422
1423
|
});
|
|
1424
|
+
expect(actionRow).toHaveAttribute(EDGE_COMP_ATTR);
|
|
1423
1425
|
for (const name of [
|
|
1424
1426
|
'Bold',
|
|
1425
1427
|
'Italic',
|
|
@@ -70,6 +70,7 @@ import {TextInput} from '@astryxdesign/core/TextInput';
|
|
|
70
70
|
import {Button} from '@astryxdesign/core/Button';
|
|
71
71
|
import {Stack} from '@astryxdesign/core/Stack';
|
|
72
72
|
import {
|
|
73
|
+
EDGE_COMP_ATTR,
|
|
73
74
|
HStack,
|
|
74
75
|
Layout,
|
|
75
76
|
LayoutContent,
|
|
@@ -165,6 +166,12 @@ const toolbarScrollStyles = stylex.create({
|
|
|
165
166
|
},
|
|
166
167
|
});
|
|
167
168
|
|
|
169
|
+
// The scroll row is this standalone toolbar's sole slot child. Opting it into
|
|
170
|
+
// Toolbar's container-owned edge compensation gives the formatting surface a
|
|
171
|
+
// 4px inline inset at `sm` without moving generic nested Toolbar content off
|
|
172
|
+
// its surrounding Card/Section content line.
|
|
173
|
+
const toolbarEdgeCompensationProps = {[EDGE_COMP_ATTR]: ''};
|
|
174
|
+
|
|
168
175
|
/**
|
|
169
176
|
* Whether `event` is the insert-link shortcut (Cmd/Ctrl+K). Uses Lexical's
|
|
170
177
|
* `isExactShortcutMatch`, which — unlike a loose `metaKey || ctrlKey` check —
|
|
@@ -889,6 +896,7 @@ export function RichTextEditorToolbar({
|
|
|
889
896
|
size={size}
|
|
890
897
|
startContent={
|
|
891
898
|
<HStack
|
|
899
|
+
{...toolbarEdgeCompensationProps}
|
|
892
900
|
gap={1}
|
|
893
901
|
role="group"
|
|
894
902
|
aria-label={t('@astryx.richTextEditor.toolbar.actions')}
|