@astryxdesign/richtext 0.6.5-canary.d6fa1d6 → 0.6.5-canary.eb0010b
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/dist/RichTextEditor.d.ts +0 -10
- package/dist/RichTextEditor.d.ts.map +1 -1
- package/dist/RichTextEditor.js +4 -17
- package/dist/RichTextEditorToolbar.d.ts.map +1 -1
- package/dist/RichTextEditorToolbar.js +3 -11
- package/dist/RichTextView.d.ts +1 -11
- package/dist/RichTextView.d.ts.map +1 -1
- package/dist/RichTextView.js +1 -19
- package/dist/editorNodes.d.ts.map +1 -1
- package/dist/editorNodes.js +1 -6
- package/dist/editorTheme.d.ts.map +1 -1
- package/dist/editorTheme.js +71 -224
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/markdownListExport.d.ts.map +1 -1
- package/dist/markdownListExport.js +2 -7
- package/dist/markdownSerializers.d.ts +0 -8
- package/dist/markdownSerializers.d.ts.map +1 -1
- package/dist/markdownSerializers.js +4 -7
- package/dist/markdownSource.d.ts +9 -9
- package/dist/markdownSource.d.ts.map +1 -1
- package/dist/markdownSource.js +18 -177
- package/dist/markdownTable.d.ts +3 -8
- package/dist/markdownTable.d.ts.map +1 -1
- package/dist/markdownTable.js +6 -15
- package/dist/richtext.css +5 -36
- package/package.json +4 -9
- package/src/RichTextEditor.doc.mjs +1 -12
- package/src/RichTextEditor.tsx +2 -30
- package/src/RichTextEditorToolbar.tsx +2 -15
- package/src/RichTextView.tsx +0 -37
- package/src/__tests__/MarkdownParitySandbox.a11y.chromium.spec.ts +5 -1169
- package/src/editorNodes.ts +0 -4
- package/src/editorTheme.ts +75 -119
- package/src/index.ts +0 -5
- package/src/markdownListExport.ts +3 -6
- package/src/markdownSerializers.ts +4 -13
- package/src/markdownSource.test.tsx +2 -114
- package/src/markdownSource.ts +21 -241
- package/src/markdownTable.ts +5 -29
- package/dist/CodeBlockHeaderPlugin.d.ts +0 -7
- package/dist/CodeBlockHeaderPlugin.d.ts.map +0 -1
- package/dist/CodeBlockHeaderPlugin.js +0 -196
- package/dist/CodeSyntaxPlugin.d.ts +0 -12
- package/dist/CodeSyntaxPlugin.d.ts.map +0 -1
- package/dist/CodeSyntaxPlugin.js +0 -154
- package/dist/MarkdownExtensionsPlugin.d.ts +0 -17
- package/dist/MarkdownExtensionsPlugin.d.ts.map +0 -1
- package/dist/MarkdownExtensionsPlugin.js +0 -185
- package/dist/TableColumnFloorPlugin.d.ts +0 -12
- package/dist/TableColumnFloorPlugin.d.ts.map +0 -1
- package/dist/TableColumnFloorPlugin.js +0 -84
- package/dist/TaskCheckboxPlugin.d.ts +0 -7
- package/dist/TaskCheckboxPlugin.d.ts.map +0 -1
- package/dist/TaskCheckboxPlugin.js +0 -193
- package/dist/markdown.d.ts +0 -17
- package/dist/markdown.d.ts.map +0 -1
- package/dist/markdown.js +0 -17
- package/dist/markdownCharacterReferences.d.ts +0 -110
- package/dist/markdownCharacterReferences.d.ts.map +0 -1
- package/dist/markdownCharacterReferences.js +0 -913
- package/dist/markdownCodeFence.d.ts +0 -4
- package/dist/markdownCodeFence.d.ts.map +0 -1
- package/dist/markdownCodeFence.js +0 -153
- package/dist/markdownExtensionNode.d.ts +0 -88
- package/dist/markdownExtensionNode.d.ts.map +0 -1
- package/dist/markdownExtensionNode.js +0 -244
- package/dist/markdownExtensions.d.ts +0 -115
- package/dist/markdownExtensions.d.ts.map +0 -1
- package/dist/markdownExtensions.js +0 -392
- package/dist/markdownLink.d.ts +0 -5
- package/dist/markdownLink.d.ts.map +0 -1
- package/dist/markdownLink.js +0 -82
- package/dist/markdownOrderedList.d.ts +0 -3
- package/dist/markdownOrderedList.d.ts.map +0 -1
- package/dist/markdownOrderedList.js +0 -51
- package/dist/markdownTaskList.d.ts +0 -48
- package/dist/markdownTaskList.d.ts.map +0 -1
- package/dist/markdownTaskList.js +0 -166
- package/dist/textSemantics.d.ts +0 -3
- package/dist/textSemantics.d.ts.map +0 -1
- package/dist/textSemantics.js +0 -87
- package/src/CodeBlockHeaderPlugin.test.tsx +0 -100
- package/src/CodeBlockHeaderPlugin.tsx +0 -261
- package/src/CodeSyntaxPlugin.test.tsx +0 -40
- package/src/CodeSyntaxPlugin.tsx +0 -193
- package/src/MarkdownExtensionsPlugin.test.tsx +0 -279
- package/src/MarkdownExtensionsPlugin.tsx +0 -289
- package/src/TableColumnFloorPlugin.test.tsx +0 -49
- package/src/TableColumnFloorPlugin.tsx +0 -99
- package/src/TaskCheckboxPlugin.tsx +0 -242
- package/src/__tests__/MarkdownPlugins.a11y.chromium.spec.ts +0 -372
- package/src/__tests__/MarkdownPluginsImportExport.a11y.chromium.spec.ts +0 -117
- package/src/markdown.ts +0 -25
- package/src/markdownAngleDestinations.test.ts +0 -134
- package/src/markdownCharacterReferences.test.ts +0 -202
- package/src/markdownCharacterReferences.ts +0 -919
- package/src/markdownCodeFence.test.ts +0 -181
- package/src/markdownCodeFence.ts +0 -193
- package/src/markdownCodeSpans.test.ts +0 -399
- package/src/markdownEscapes.test.ts +0 -234
- package/src/markdownExtensionNode.ts +0 -332
- package/src/markdownExtensionSelection.test.ts +0 -102
- package/src/markdownExtensions.test.ts +0 -765
- package/src/markdownExtensions.ts +0 -496
- package/src/markdownLink.ts +0 -86
- package/src/markdownOrderedList.test.ts +0 -62
- package/src/markdownOrderedList.ts +0 -60
- package/src/markdownRefusedLinks.test.tsx +0 -193
- package/src/markdownTableLinks.test.ts +0 -69
- package/src/markdownTaskList.test.tsx +0 -445
- package/src/markdownTaskList.ts +0 -222
- package/src/textSemantics.test.tsx +0 -368
- package/src/textSemantics.ts +0 -104
package/dist/RichTextEditor.d.ts
CHANGED
|
@@ -26,7 +26,6 @@ import { type ReactNode } from 'react';
|
|
|
26
26
|
import { type FieldStatusVariant } from '@astryxdesign/core/Field';
|
|
27
27
|
import type { BaseProps } from '@astryxdesign/core';
|
|
28
28
|
import { type SizeValue } from '@astryxdesign/core/utils';
|
|
29
|
-
import type { RichTextMarkdownExtension } from './markdownExtensions';
|
|
30
29
|
import { type Transformer } from '@lexical/markdown';
|
|
31
30
|
export type { Transformer } from '@lexical/markdown';
|
|
32
31
|
import { type EditorState, type Klass, type LexicalEditor, type LexicalNode } from 'lexical';
|
|
@@ -202,15 +201,6 @@ export interface RichTextEditorProps extends Omit<BaseProps, 'onChange' | 'defau
|
|
|
202
201
|
* the serialization APIs added in later phases.
|
|
203
202
|
*/
|
|
204
203
|
transformers?: ReadonlyArray<Transformer>;
|
|
205
|
-
/**
|
|
206
|
-
* Markdown plugins whose nodes this surface draws, each adopted with
|
|
207
|
-
* `createRichTextExtension` (spec:AST-064). A plugin node renders exactly as
|
|
208
|
-
* core `Markdown` renders it, and one whose plugin is not given here shows
|
|
209
|
-
* its source. Pass the extensions the content was converted with. Create
|
|
210
|
-
* them in a client module: they hold the plugins' functions, so they are not
|
|
211
|
-
* serializable props.
|
|
212
|
-
*/
|
|
213
|
-
markdownExtensions?: ReadonlyArray<RichTextMarkdownExtension>;
|
|
214
204
|
/** Whether to automatically focus the editor on mount. @default false */
|
|
215
205
|
hasAutoFocus?: boolean;
|
|
216
206
|
/**
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"RichTextEditor.d.ts","sourceRoot":"","sources":["../src/RichTextEditor.tsx"],"names":[],"mappings":"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"}
|
package/dist/RichTextEditor.js
CHANGED
|
@@ -49,12 +49,6 @@ import { MarkdownShortcutPlugin } from '@lexical/react/LexicalMarkdownShortcutPl
|
|
|
49
49
|
import { OnChangePlugin } from '@lexical/react/LexicalOnChangePlugin';
|
|
50
50
|
import { TablePlugin } from '@lexical/react/LexicalTablePlugin';
|
|
51
51
|
import { HorizontalRuleExtension } from '@lexical/extension';
|
|
52
|
-
import { TextSemanticsExtension } from "./textSemantics.js";
|
|
53
|
-
import { TableColumnFloorPlugin } from "./TableColumnFloorPlugin.js";
|
|
54
|
-
import { CodeBlockHeaderPlugin } from "./CodeBlockHeaderPlugin.js";
|
|
55
|
-
import { CodeSyntaxPlugin } from "./CodeSyntaxPlugin.js";
|
|
56
|
-
import { MarkdownExtensionsPlugin } from "./MarkdownExtensionsPlugin.js";
|
|
57
|
-
import { TaskCheckboxPlugin } from "./TaskCheckboxPlugin.js";
|
|
58
52
|
import { $generateHtmlFromNodes } from '@lexical/html';
|
|
59
53
|
import { DEFAULT_NODES } from "./editorNodes.js";
|
|
60
54
|
import { $exportMarkdownKeepingSource } from "./markdownSource.js";
|
|
@@ -225,7 +219,6 @@ export const RichTextEditor = /*#__PURE__*/forwardRef(function RichTextEditor({
|
|
|
225
219
|
plugins,
|
|
226
220
|
hasMarkdownShortcuts = true,
|
|
227
221
|
transformers = DEFAULT_TRANSFORMERS,
|
|
228
|
-
markdownExtensions,
|
|
229
222
|
hasAutoFocus = false,
|
|
230
223
|
tabEscapeHint = DEFAULT_TAB_ESCAPE_HINT,
|
|
231
224
|
maxLength,
|
|
@@ -279,9 +272,8 @@ export const RichTextEditor = /*#__PURE__*/forwardRef(function RichTextEditor({
|
|
|
279
272
|
theme: themeRef.current,
|
|
280
273
|
editable,
|
|
281
274
|
nodes: nodes ? [...DEFAULT_NODES, ...nodes] : [...DEFAULT_NODES],
|
|
282
|
-
// Horizontal rules select on click and show their selection
|
|
283
|
-
|
|
284
|
-
dependencies: [HorizontalRuleExtension, TextSemanticsExtension],
|
|
275
|
+
// Horizontal rules select on click and show their selection.
|
|
276
|
+
dependencies: [HorizontalRuleExtension],
|
|
285
277
|
// `undefined` (not `null`) leaves Lexical's default initializer in place,
|
|
286
278
|
// which seeds the empty document with one paragraph — what
|
|
287
279
|
// LexicalComposer did when no `editorState` was given. `null` would mean
|
|
@@ -358,17 +350,12 @@ export const RichTextEditor = /*#__PURE__*/forwardRef(function RichTextEditor({
|
|
|
358
350
|
}),
|
|
359
351
|
placeholder: null,
|
|
360
352
|
ErrorBoundary: LexicalErrorBoundary
|
|
361
|
-
}), /*#__PURE__*/_jsx(HistoryPlugin, {}), /*#__PURE__*/_jsx(ListPlugin, {}), /*#__PURE__*/_jsx(
|
|
362
|
-
isReadOnly: isReadOnly || isDisabled
|
|
363
|
-
}), /*#__PURE__*/_jsx(LinkPlugin, {}), /*#__PURE__*/_jsx(TablePlugin, {
|
|
353
|
+
}), /*#__PURE__*/_jsx(HistoryPlugin, {}), /*#__PURE__*/_jsx(ListPlugin, {}), /*#__PURE__*/_jsx(LinkPlugin, {}), /*#__PURE__*/_jsx(TablePlugin, {
|
|
364
354
|
hasCellMerge: false,
|
|
365
355
|
hasCellBackgroundColor: false,
|
|
366
356
|
hasTabHandler: false,
|
|
367
357
|
hasHorizontalScroll: true
|
|
368
|
-
}), /*#__PURE__*/_jsx(
|
|
369
|
-
extensions: markdownExtensions,
|
|
370
|
-
transformers: markdownTransformers
|
|
371
|
-
}) : null, /*#__PURE__*/_jsx(TabIndentationPlugin, {}), /*#__PURE__*/_jsx(TabFocusEscapePlugin, {}), hasMarkdownShortcuts && /*#__PURE__*/_jsx(MarkdownShortcutPlugin, {
|
|
358
|
+
}), /*#__PURE__*/_jsx(TabIndentationPlugin, {}), /*#__PURE__*/_jsx(TabFocusEscapePlugin, {}), hasMarkdownShortcuts && /*#__PURE__*/_jsx(MarkdownShortcutPlugin, {
|
|
372
359
|
transformers: markdownTransformers
|
|
373
360
|
}), hasAutoFocus && /*#__PURE__*/_jsx(AutoFocusOnMount, {}), onChange && /*#__PURE__*/_jsx(OnChangePlugin, {
|
|
374
361
|
onChange: onChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditorToolbar.d.ts","sourceRoot":"","sources":["../src/RichTextEditorToolbar.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"RichTextEditorToolbar.d.ts","sourceRoot":"","sources":["../src/RichTextEditorToolbar.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAgHf;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;CAgBrB,CAAC;AAwOX,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,KAAyB,EACzB,aAAkC,EAClC,IAAW,EACX,OAAc,EACd,YAAY,EACZ,iBAAwB,EACxB,UAAU,GACX,EAAE,0BAA0B,+BA6d5B;yBAree,qBAAqB"}
|
|
@@ -51,9 +51,8 @@ import { Button } from '@astryxdesign/core/Button';
|
|
|
51
51
|
import { Stack } from '@astryxdesign/core/Stack';
|
|
52
52
|
import { HStack, Layout, LayoutContent, LayoutFooter } from '@astryxdesign/core/Layout';
|
|
53
53
|
import { getExtendedIcon } from '@astryxdesign/core/Icon';
|
|
54
|
-
import { FORMAT_TEXT_COMMAND, UNDO_COMMAND, REDO_COMMAND, CAN_UNDO_COMMAND, CAN_REDO_COMMAND, SELECTION_CHANGE_COMMAND, KEY_DOWN_COMMAND, COMMAND_PRIORITY_CRITICAL, COMMAND_PRIORITY_NORMAL, IS_APPLE, isExactShortcutMatch, $getSelection, $
|
|
54
|
+
import { FORMAT_TEXT_COMMAND, UNDO_COMMAND, REDO_COMMAND, CAN_UNDO_COMMAND, CAN_REDO_COMMAND, SELECTION_CHANGE_COMMAND, KEY_DOWN_COMMAND, COMMAND_PRIORITY_CRITICAL, COMMAND_PRIORITY_NORMAL, IS_APPLE, isExactShortcutMatch, $getSelection, $isRangeSelection, $setSelection, $createParagraphNode, $createTextNode } from 'lexical';
|
|
55
55
|
import { sanitizeUrl } from "./linkUtils.js";
|
|
56
|
-
import { $selectedExtensionNodesOnly } from "./markdownExtensionNode.js";
|
|
57
56
|
|
|
58
57
|
/** Block types exposed by the toolbar's format selector. */
|
|
59
58
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -420,23 +419,16 @@ export function RichTextEditorToolbar({
|
|
|
420
419
|
const [linkError, setLinkError] = useState('');
|
|
421
420
|
const $syncToolbar = useCallback(() => {
|
|
422
421
|
const selection = $getSelection();
|
|
423
|
-
if (!$isRangeSelection(selection)
|
|
422
|
+
if (!$isRangeSelection(selection)) {
|
|
424
423
|
return;
|
|
425
424
|
}
|
|
426
425
|
const formats = new Set();
|
|
427
|
-
// A selection of Markdown plugin nodes alone — a range around them, or
|
|
428
|
-
// a node selection from a click — shows their formats. Any other node
|
|
429
|
-
// selection, such as a rule, has none.
|
|
430
|
-
const nodesOnly = $selectedExtensionNodesOnly(selection);
|
|
431
426
|
for (const fmt of ['bold', 'italic', 'underline', 'strikethrough', 'code']) {
|
|
432
|
-
if (
|
|
427
|
+
if (selection.hasFormat(fmt)) {
|
|
433
428
|
formats.add(fmt);
|
|
434
429
|
}
|
|
435
430
|
}
|
|
436
431
|
setActiveFormats(formats);
|
|
437
|
-
if (!$isRangeSelection(selection)) {
|
|
438
|
-
return;
|
|
439
|
-
}
|
|
440
432
|
|
|
441
433
|
// Link active state — a link is "active" when the caret/selection anchor
|
|
442
434
|
// sits inside a LinkNode (or its immediate parent is one):
|
package/dist/RichTextView.d.ts
CHANGED
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { type ReactNode } from 'react';
|
|
17
17
|
import type { BaseProps } from '@astryxdesign/core';
|
|
18
|
-
import type { RichTextMarkdownExtension } from './markdownExtensions';
|
|
19
18
|
import type { Klass, LexicalNode } from 'lexical';
|
|
20
19
|
export interface RichTextViewProps extends BaseProps {
|
|
21
20
|
/**
|
|
@@ -28,15 +27,6 @@ export interface RichTextViewProps extends BaseProps {
|
|
|
28
27
|
* the nodes used to author `value` so custom node types deserialize.
|
|
29
28
|
*/
|
|
30
29
|
nodes?: ReadonlyArray<Klass<LexicalNode>>;
|
|
31
|
-
/**
|
|
32
|
-
* Markdown plugins whose nodes this surface draws, each adopted with
|
|
33
|
-
* `createRichTextExtension` (spec:AST-064). A plugin node renders exactly as
|
|
34
|
-
* core `Markdown` renders it, and one whose plugin is not given here shows
|
|
35
|
-
* its source. Pass the extensions the content was converted with. Create
|
|
36
|
-
* them in a client module: they hold the plugins' functions, so they are not
|
|
37
|
-
* serializable props.
|
|
38
|
-
*/
|
|
39
|
-
markdownExtensions?: ReadonlyArray<RichTextMarkdownExtension>;
|
|
40
30
|
/**
|
|
41
31
|
* Additional read-only plugins to render inside the composer (e.g. hover
|
|
42
32
|
* cards, decorators).
|
|
@@ -76,7 +66,7 @@ export interface RichTextViewProps extends BaseProps {
|
|
|
76
66
|
* <RichTextView value={storedEditorStateJSON} />
|
|
77
67
|
* ```
|
|
78
68
|
*/
|
|
79
|
-
export declare function RichTextView({ value, nodes,
|
|
69
|
+
export declare function RichTextView({ value, nodes, plugins, namespace, onParseError, errorFallback, xstyle, className, style, ...rest }: RichTextViewProps): import("react").JSX.Element;
|
|
80
70
|
export declare namespace RichTextView {
|
|
81
71
|
var displayName: string;
|
|
82
72
|
}
|
|
@@ -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;
|
|
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;IACpB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACtC;;;;OAIG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;CAC3B;AAyCD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,KAAK,EACL,OAAO,EACP,SAAyB,EACzB,YAAY,EACZ,aAAoB,EACpB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,iBAAiB,+BAgHnB;yBA3He,YAAY"}
|
package/dist/RichTextView.js
CHANGED
|
@@ -28,20 +28,13 @@ import { ContentEditable } from '@lexical/react/LexicalContentEditable';
|
|
|
28
28
|
import { LexicalErrorBoundary } from '@lexical/react/LexicalErrorBoundary';
|
|
29
29
|
import { TablePlugin } from '@lexical/react/LexicalTablePlugin';
|
|
30
30
|
import { TableScrollRegionPlugin } from "./TableScrollRegionPlugin.js";
|
|
31
|
-
import { TableColumnFloorPlugin } from "./TableColumnFloorPlugin.js";
|
|
32
|
-
import { CodeBlockHeaderPlugin } from "./CodeBlockHeaderPlugin.js";
|
|
33
|
-
import { CodeSyntaxPlugin } from "./CodeSyntaxPlugin.js";
|
|
34
|
-
import { MarkdownExtensionsPlugin } from "./MarkdownExtensionsPlugin.js";
|
|
35
|
-
import { TaskCheckboxPlugin } from "./TaskCheckboxPlugin.js";
|
|
36
31
|
import { defineExtension } from 'lexical';
|
|
37
|
-
import { TextSemanticsExtension } from "./textSemantics.js";
|
|
38
32
|
// The same node set as the editor, so anything it writes renders here.
|
|
39
33
|
import { DEFAULT_NODES } from "./editorNodes.js";
|
|
40
34
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
41
35
|
const styles = {
|
|
42
36
|
root: {
|
|
43
37
|
kzqmXN: "xh8yej3",
|
|
44
|
-
kVAEAm: "x1n2onr6",
|
|
45
38
|
$$css: true
|
|
46
39
|
}
|
|
47
40
|
};
|
|
@@ -72,9 +65,6 @@ const VIEW_CONTENT_EDITABLE_PROPS = {
|
|
|
72
65
|
'aria-readonly': undefined,
|
|
73
66
|
role: null
|
|
74
67
|
};
|
|
75
|
-
|
|
76
|
-
/** The view imports and exports no Markdown, so it uses no transformers. */
|
|
77
|
-
const NO_TRANSFORMERS = [];
|
|
78
68
|
/**
|
|
79
69
|
* Keeps the rendered content in sync with the `value` prop after mount.
|
|
80
70
|
*
|
|
@@ -135,7 +125,6 @@ function SyncValuePlugin({
|
|
|
135
125
|
export function RichTextView({
|
|
136
126
|
value,
|
|
137
127
|
nodes,
|
|
138
|
-
markdownExtensions,
|
|
139
128
|
plugins,
|
|
140
129
|
namespace = 'astryx-view',
|
|
141
130
|
onParseError,
|
|
@@ -217,8 +206,6 @@ export function RichTextView({
|
|
|
217
206
|
theme: themeRef.current,
|
|
218
207
|
editable: false,
|
|
219
208
|
nodes: nodes ? [...DEFAULT_NODES, ...nodes] : [...DEFAULT_NODES],
|
|
220
|
-
// Struck text is a deletion.
|
|
221
|
-
dependencies: [TextSemanticsExtension],
|
|
222
209
|
$initialEditorState: value,
|
|
223
210
|
// A read-only view renders persisted content; a bad node/schema should not
|
|
224
211
|
// crash the host. Surface it via onParseError + fallback instead of re-throwing.
|
|
@@ -238,17 +225,12 @@ export function RichTextView({
|
|
|
238
225
|
hasCellBackgroundColor: false,
|
|
239
226
|
hasTabHandler: false,
|
|
240
227
|
hasHorizontalScroll: true
|
|
241
|
-
}), /*#__PURE__*/_jsx(TableScrollRegionPlugin, {}), /*#__PURE__*/_jsx(
|
|
228
|
+
}), /*#__PURE__*/_jsx(TableScrollRegionPlugin, {}), /*#__PURE__*/_jsx(RichTextPlugin, {
|
|
242
229
|
contentEditable: /*#__PURE__*/_jsx(ContentEditable, {
|
|
243
230
|
...VIEW_CONTENT_EDITABLE_PROPS
|
|
244
231
|
}),
|
|
245
232
|
placeholder: null,
|
|
246
233
|
ErrorBoundary: LexicalErrorBoundary
|
|
247
|
-
}), /*#__PURE__*/_jsx(CodeBlockHeaderPlugin, {}), /*#__PURE__*/_jsx(CodeSyntaxPlugin, {}), markdownExtensions != null && markdownExtensions.length > 0 ? /*#__PURE__*/_jsx(MarkdownExtensionsPlugin, {
|
|
248
|
-
extensions: markdownExtensions,
|
|
249
|
-
transformers: NO_TRANSFORMERS
|
|
250
|
-
}) : null, /*#__PURE__*/_jsx(TaskCheckboxPlugin, {
|
|
251
|
-
isReadOnly: true
|
|
252
234
|
}), plugins]
|
|
253
235
|
})
|
|
254
236
|
});
|
|
@@ -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;
|
|
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"}
|
package/dist/editorNodes.js
CHANGED
|
@@ -17,14 +17,9 @@ import { LinkNode, AutoLinkNode } from '@lexical/link';
|
|
|
17
17
|
import { CodeNode, CodeHighlightNode } from '@lexical/code';
|
|
18
18
|
import { TableNode, TableRowNode, TableCellNode } from '@lexical/table';
|
|
19
19
|
import { HorizontalRuleNode } from '@lexical/extension';
|
|
20
|
-
import { RichTextExtensionNode } from "./markdownExtensionNode.js";
|
|
21
|
-
|
|
22
20
|
/**
|
|
23
21
|
* The default OSS node set registered with the editor: headings, quotes,
|
|
24
22
|
* lists, links, code, and tables. Extend via the `nodes` prop / option rather
|
|
25
23
|
* than editing this list.
|
|
26
24
|
*/
|
|
27
|
-
export const DEFAULT_NODES = [HeadingNode, QuoteNode, ListNode, ListItemNode, LinkNode, AutoLinkNode, CodeNode, CodeHighlightNode, TableNode, TableRowNode, TableCellNode, HorizontalRuleNode
|
|
28
|
-
// Markdown plugin nodes (spec:AST-064): registered everywhere so stored
|
|
29
|
-
// state that holds them always loads.
|
|
30
|
-
RichTextExtensionNode];
|
|
25
|
+
export const DEFAULT_NODES = [HeadingNode, QuoteNode, ListNode, ListItemNode, LinkNode, AutoLinkNode, CodeNode, CodeHighlightNode, TableNode, TableRowNode, TableCellNode, HorizontalRuleNode];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editorTheme.d.ts","sourceRoot":"","sources":["../src/editorTheme.ts"],"names":[],"mappings":"
|
|
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"}
|
package/dist/editorTheme.js
CHANGED
|
@@ -14,8 +14,7 @@
|
|
|
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
|
|
18
|
-
import { CODE_SYNTAX_CLASS } from "./CodeSyntaxPlugin.js";
|
|
17
|
+
import { colorVars, spacingVars, radiusVars, typographyVars, typeScaleVars, fontWeightVars, borderVars, focusVars } from '@astryxdesign/core/theme/tokens.stylex';
|
|
19
18
|
// Document blocks follow core Markdown's typography, spacing, and measure
|
|
20
19
|
// (spec:AST-061 FR2–FR4): type-scale tokens for text, one block spacing table
|
|
21
20
|
// with no margin before the first block or after the last, and prose capped
|
|
@@ -33,235 +32,78 @@ const MINOR_HEADING_AFTER = `calc(${spacingVars['--spacing-2']})`;
|
|
|
33
32
|
const TEXT_BLOCK_SPACE = `calc(${spacingVars['--spacing-3']})`;
|
|
34
33
|
const WIDE_BLOCK_SPACE = `calc(${spacingVars['--spacing-4']})`;
|
|
35
34
|
const LIST_ITEM_SPACE = `calc(${spacingVars['--spacing-1']})`;
|
|
36
|
-
const TASK_BOX_SIZE = '20px';
|
|
37
35
|
const LIST_ROW_GAP = `calc(${spacingVars['--spacing-0-5']})`;
|
|
38
36
|
const LIST_ROW_FLUSH = `calc(${spacingVars['--spacing-0']})`;
|
|
39
37
|
const NESTED_LIST_SPACE = `calc(${spacingVars['--spacing-2']})`;
|
|
40
38
|
const RULE_SPACE = `calc(${spacingVars['--spacing-6']})`;
|
|
41
|
-
const CODE_SPACE = `calc(${spacingVars['--spacing-3']})`;
|
|
42
|
-
// Core CodeBlock's header (8px, a small control, 8px) overlaps the code's
|
|
43
|
-
// 12px top padding by 8px, so its code starts 8px + control + 12px down.
|
|
44
|
-
const CODE_HEADER_SPACE = `calc(${spacingVars['--spacing-2']} + ${sizeVars['--size-element-sm']} + ${spacingVars['--spacing-3']})`;
|
|
45
|
-
const editorTheme = {
|
|
46
|
-
providerDirection: {
|
|
47
|
-
ksoyAI: "x1epdd7z",
|
|
48
|
-
$$css: true
|
|
49
|
-
},
|
|
50
|
-
paragraph: {
|
|
51
|
-
keoZOQ: "x1ftnraw xnhvf09",
|
|
52
|
-
k1K539: "x18pneqc xfo59cc",
|
|
53
|
-
ks0D6T: "x7ep2pv",
|
|
54
|
-
k63SB2: "x1pd3egz",
|
|
55
|
-
kMwMTN: "x1heor9g",
|
|
56
|
-
$$css: true
|
|
57
|
-
},
|
|
58
|
-
h1: {
|
|
59
|
-
kMv6JI: "x1g81bgm",
|
|
60
|
-
kGuDYH: "xcg7oai",
|
|
61
|
-
k63SB2: "x1v68xuy",
|
|
62
|
-
kLWn49: "xfmsba7",
|
|
63
|
-
keoZOQ: "x13xmvwt xnhvf09",
|
|
64
|
-
k1K539: "x18pneqc xfo59cc",
|
|
65
|
-
ks0D6T: "x7ep2pv",
|
|
66
|
-
$$css: true
|
|
67
|
-
},
|
|
68
|
-
h2: {
|
|
69
|
-
kMv6JI: "x1g81bgm",
|
|
70
|
-
kGuDYH: "x1xvnhcw",
|
|
71
|
-
k63SB2: "x12yy4cs",
|
|
72
|
-
kLWn49: "x1cpk1wn",
|
|
73
|
-
keoZOQ: "x13xmvwt xnhvf09",
|
|
74
|
-
k1K539: "x18pneqc xfo59cc",
|
|
75
|
-
ks0D6T: "x7ep2pv",
|
|
76
|
-
$$css: true
|
|
77
|
-
},
|
|
78
|
-
h3: {
|
|
79
|
-
kMv6JI: "x1g81bgm",
|
|
80
|
-
kGuDYH: "xii13ha",
|
|
81
|
-
k63SB2: "x1jcxfy8",
|
|
82
|
-
kLWn49: "xwjzt0u",
|
|
83
|
-
keoZOQ: "x13xmvwt xnhvf09",
|
|
84
|
-
k1K539: "x18pneqc xfo59cc",
|
|
85
|
-
ks0D6T: "x7ep2pv",
|
|
86
|
-
$$css: true
|
|
87
|
-
},
|
|
88
|
-
h4: {
|
|
89
|
-
kMv6JI: "x1g81bgm",
|
|
90
|
-
kGuDYH: "x8tkxat",
|
|
91
|
-
k63SB2: "x2hcmsi",
|
|
92
|
-
kLWn49: "xqerer",
|
|
93
|
-
keoZOQ: "x1w2a574 xnhvf09",
|
|
94
|
-
k1K539: "x1hws3vx xfo59cc",
|
|
95
|
-
ks0D6T: "x7ep2pv",
|
|
96
|
-
$$css: true
|
|
97
|
-
},
|
|
98
|
-
h5: {
|
|
99
|
-
kMv6JI: "x1g81bgm",
|
|
100
|
-
kGuDYH: "xsgqta0",
|
|
101
|
-
k63SB2: "xno150v",
|
|
102
|
-
kLWn49: "xo3gurs",
|
|
103
|
-
keoZOQ: "x1w2a574 xnhvf09",
|
|
104
|
-
k1K539: "x1hws3vx xfo59cc",
|
|
105
|
-
ks0D6T: "x7ep2pv",
|
|
106
|
-
$$css: true
|
|
107
|
-
},
|
|
108
|
-
h6: {
|
|
109
|
-
kMv6JI: "x1g81bgm",
|
|
110
|
-
kGuDYH: "xw5ohdf",
|
|
111
|
-
k63SB2: "x1pw4frv",
|
|
112
|
-
kLWn49: "xeixjfn",
|
|
113
|
-
keoZOQ: "x1w2a574 xnhvf09",
|
|
114
|
-
k1K539: "x1hws3vx xfo59cc",
|
|
115
|
-
ks0D6T: "x7ep2pv",
|
|
116
|
-
$$css: true
|
|
117
|
-
},
|
|
118
|
-
quote: {
|
|
119
|
-
keoZOQ: "x1w2a574 xnhvf09",
|
|
120
|
-
k1K539: "x1u2y747 xfo59cc",
|
|
121
|
-
kUOVxO: "xrxpjvj",
|
|
122
|
-
ks0D6T: "x7ep2pv",
|
|
123
|
-
kZCmMZ: "x1rey3nv",
|
|
124
|
-
k2ei4v: "xyumdvf",
|
|
125
|
-
kVhnKS: "x1t7ytsu",
|
|
126
|
-
kGJrpR: "x14ydlgx",
|
|
127
|
-
kMwMTN: "xv1l7n4",
|
|
128
|
-
$$css: true
|
|
129
|
-
},
|
|
130
|
-
ul: {
|
|
131
|
-
keoZOQ: "x1ftnraw xnhvf09",
|
|
132
|
-
k1K539: "x18pneqc xfo59cc",
|
|
133
|
-
ks0D6T: "x7ep2pv",
|
|
134
|
-
kZCmMZ: "x31w388",
|
|
135
|
-
kpqbRz: "x43c9pm",
|
|
136
|
-
$$css: true
|
|
137
|
-
},
|
|
138
|
-
ol: {
|
|
139
|
-
keoZOQ: "x1ftnraw xnhvf09",
|
|
140
|
-
k1K539: "x18pneqc xfo59cc",
|
|
141
|
-
ks0D6T: "x7ep2pv",
|
|
142
|
-
kZCmMZ: "x31w388",
|
|
143
|
-
kpqbRz: "x43c9pm",
|
|
144
|
-
$$css: true
|
|
145
|
-
},
|
|
146
|
-
ulMarker0: {
|
|
147
|
-
kH6xsr: "xtaz4m5",
|
|
148
|
-
$$css: true
|
|
149
|
-
},
|
|
150
|
-
ulMarker1: {
|
|
151
|
-
kH6xsr: "xrylv2j",
|
|
152
|
-
$$css: true
|
|
153
|
-
},
|
|
154
|
-
ulMarker2: {
|
|
155
|
-
kH6xsr: "x152237o",
|
|
156
|
-
$$css: true
|
|
157
|
-
},
|
|
158
|
-
olMarker0: {
|
|
159
|
-
kH6xsr: "x3yw8vx",
|
|
160
|
-
$$css: true
|
|
161
|
-
},
|
|
162
|
-
olMarker1: {
|
|
163
|
-
kH6xsr: "x1rrqm6h",
|
|
164
|
-
$$css: true
|
|
165
|
-
},
|
|
166
|
-
olMarker2: {
|
|
167
|
-
kH6xsr: "x19k9dhg",
|
|
168
|
-
$$css: true
|
|
169
|
-
},
|
|
170
|
-
tableScrollableWrapper: {
|
|
171
|
-
kXHlph: "xw2csxc",
|
|
172
|
-
ks0D6T: "x193iq5w",
|
|
173
|
-
k1xSpc: "xrvj5dj",
|
|
174
|
-
kumcoG: "x1mkdm3x",
|
|
175
|
-
keoZOQ: "x1w2a574 xnhvf09",
|
|
176
|
-
k1K539: "x1u2y747 xfo59cc",
|
|
177
|
-
$$css: true
|
|
178
|
-
},
|
|
179
|
-
table: {
|
|
180
|
-
kLvRdT: "x1mwwwfo",
|
|
181
|
-
kzqmXN: "xh8yej3",
|
|
182
|
-
$$css: true
|
|
183
|
-
},
|
|
184
|
-
tableRow: {
|
|
185
|
-
kt9PQ7: "xso031l",
|
|
186
|
-
kfdmCh: "x1q0q8m5",
|
|
187
|
-
kL6WhQ: "xw8gpjh x1bta2m4",
|
|
188
|
-
$$css: true
|
|
189
|
-
},
|
|
190
|
-
tableCell: {
|
|
191
|
-
kB7OPa: "x1afcbsf",
|
|
192
|
-
k8WAf4: "xce4md1",
|
|
193
|
-
kg3NbH: "xf314gf",
|
|
194
|
-
k9WMMc: "x1yc453h",
|
|
195
|
-
kXLuUW: "xxymvpz",
|
|
196
|
-
kHjlTd: "x1mzt3pk",
|
|
197
|
-
$$css: true
|
|
198
|
-
},
|
|
199
|
-
tableCellHeader: {
|
|
200
|
-
k63SB2: "x2mo6ok",
|
|
201
|
-
kMwMTN: "xv1l7n4",
|
|
202
|
-
$$css: true
|
|
203
|
-
},
|
|
204
|
-
code: {
|
|
205
|
-
k1xSpc: "x1lliihq",
|
|
206
|
-
kMv6JI: "x9m5x89",
|
|
207
|
-
kGuDYH: "xp03k98",
|
|
208
|
-
kLWn49: "x17iicif",
|
|
209
|
-
kWkggS: "xzyc27v",
|
|
210
|
-
kMzoRj: "x1litavf",
|
|
211
|
-
ksu8eU: "x1y0btm7",
|
|
212
|
-
kVAM5u: "x14i3s5s",
|
|
213
|
-
kaIpWk: "xh6dtrn",
|
|
214
|
-
kLKAdn: "xekneqv x2w4pp4",
|
|
215
|
-
kGO01o: "xvmdzux",
|
|
216
|
-
kg3NbH: "x1pzlopt",
|
|
217
|
-
kB7OPa: "x9f619",
|
|
218
|
-
kzqmXN: "xeq5yr9",
|
|
219
|
-
k7Eaqz: "xejm5pw",
|
|
220
|
-
ks0D6T: "x193iq5w",
|
|
221
|
-
keoZOQ: "x1w2a574 xnhvf09",
|
|
222
|
-
k1K539: "x1u2y747 xfo59cc",
|
|
223
|
-
khDVqt: "x126k92a",
|
|
224
|
-
kHjlTd: "xj0a0fe",
|
|
225
|
-
$$css: true
|
|
226
|
-
}
|
|
227
|
-
};
|
|
228
|
-
|
|
229
39
|
/**
|
|
230
40
|
* Builds the Lexical EditorThemeClasses object. Lexical expects plain
|
|
231
41
|
* class-name strings, which `stylex.props(...).className` yields.
|
|
232
42
|
*/
|
|
233
43
|
export function sharedEditorTheme() {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
44
|
+
const ulClass = {
|
|
45
|
+
className: "x1ftnraw xnhvf09 x18pneqc xfo59cc x7ep2pv x31w388 xtaz4m5 x43c9pm"
|
|
46
|
+
}.className ?? '';
|
|
47
|
+
const olClass = {
|
|
48
|
+
className: "x1ftnraw xnhvf09 x18pneqc xfo59cc x7ep2pv x31w388 x3yw8vx x43c9pm"
|
|
49
|
+
}.className ?? '';
|
|
50
|
+
const ulDepth2Class = {
|
|
51
|
+
className: "x7ep2pv x31w388 x43c9pm xdj266r xat24cr xrylv2j"
|
|
52
|
+
}.className ?? '';
|
|
53
|
+
const ulDepth3Class = {
|
|
54
|
+
className: "x7ep2pv x31w388 x43c9pm xdj266r xat24cr x152237o"
|
|
55
|
+
}.className ?? '';
|
|
56
|
+
const olDepth2Class = {
|
|
57
|
+
className: "x7ep2pv x31w388 x43c9pm xdj266r xat24cr x1rrqm6h"
|
|
58
|
+
}.className ?? '';
|
|
59
|
+
const olDepth3Class = {
|
|
60
|
+
className: "x7ep2pv x31w388 x43c9pm xdj266r xat24cr x19k9dhg"
|
|
61
|
+
}.className ?? '';
|
|
237
62
|
return {
|
|
238
|
-
paragraph:
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
markdownExtensionBlock: block(editorTheme.paragraph),
|
|
63
|
+
paragraph: {
|
|
64
|
+
className: "x1ftnraw xnhvf09 x18pneqc xfo59cc x7ep2pv x1pd3egz x1heor9g"
|
|
65
|
+
}.className,
|
|
242
66
|
heading: {
|
|
243
|
-
h1:
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
67
|
+
h1: {
|
|
68
|
+
className: "x1g81bgm xcg7oai x1v68xuy xfmsba7 x13xmvwt xnhvf09 x18pneqc xfo59cc x7ep2pv"
|
|
69
|
+
}.className,
|
|
70
|
+
h2: {
|
|
71
|
+
className: "x1g81bgm x1xvnhcw x12yy4cs x1cpk1wn x13xmvwt xnhvf09 x18pneqc xfo59cc x7ep2pv"
|
|
72
|
+
}.className,
|
|
73
|
+
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"
|
|
84
|
+
}.className
|
|
249
85
|
},
|
|
250
|
-
quote:
|
|
86
|
+
quote: {
|
|
87
|
+
className: "x1w2a574 xnhvf09 x1u2y747 xfo59cc xrxpjvj x7ep2pv x1rey3nv xyumdvf x1t7ytsu x14ydlgx xv1l7n4"
|
|
88
|
+
}.className,
|
|
251
89
|
list: {
|
|
252
|
-
ul:
|
|
253
|
-
ol:
|
|
90
|
+
ul: ulClass,
|
|
91
|
+
ol: olClass,
|
|
92
|
+
checklist: {
|
|
93
|
+
className: "x1ftnraw xnhvf09 x18pneqc xfo59cc x7ep2pv x43c9pm x3ct3a4 x12gdq22"
|
|
94
|
+
}.className,
|
|
254
95
|
listitem: {
|
|
255
|
-
className: "x1f3mx8c xmvvslv x1uerj9w x13xdy6z x1wqhfsw xkuhcwz xsgnyjk x10j6jf0 xfo59cc x1sle589 x81k3mc xovwveo
|
|
96
|
+
className: "x1f3mx8c xmvvslv x1uerj9w x13xdy6z x1wqhfsw xkuhcwz xsgnyjk x10j6jf0 xfo59cc x1sle589 x81k3mc xovwveo"
|
|
256
97
|
}.className,
|
|
257
98
|
nested: {
|
|
258
99
|
listitem: {
|
|
259
|
-
className: "x1f3mx8c xmvvslv x1uerj9w x13xdy6z x1wqhfsw xkuhcwz xsgnyjk x10j6jf0 xfo59cc x1sle589 x81k3mc xovwveo
|
|
100
|
+
className: "x1f3mx8c xmvvslv x1uerj9w x13xdy6z x1wqhfsw xkuhcwz xsgnyjk x10j6jf0 xfo59cc x1sle589 x81k3mc xovwveo"
|
|
260
101
|
}.className
|
|
261
102
|
},
|
|
262
|
-
//
|
|
263
|
-
|
|
264
|
-
|
|
103
|
+
// Depth arrays cycle via `depth % length`, so three entries give three
|
|
104
|
+
// distinct nesting levels before repeating (disc→circle→square, etc.).
|
|
105
|
+
ulDepth: [ulClass, ulDepth2Class, ulDepth3Class],
|
|
106
|
+
olDepth: [olClass, olDepth2Class, olDepth3Class]
|
|
265
107
|
},
|
|
266
108
|
link: {
|
|
267
109
|
className: "xjse4m1 x1bvjpef x1ypdohk"
|
|
@@ -283,24 +125,29 @@ export function sharedEditorTheme() {
|
|
|
283
125
|
className: "x9m5x89 xwmxj5m x7a5moj xx3sua9"
|
|
284
126
|
}.className
|
|
285
127
|
},
|
|
286
|
-
|
|
287
|
-
|
|
128
|
+
code: {
|
|
129
|
+
className: "x1lliihq x9m5x89 xwmxj5m x1b2ylru xx3sua9 x141an7d x1w2a574 xnhvf09 x1u2y747 xfo59cc x126k92a"
|
|
130
|
+
}.className,
|
|
288
131
|
hr: {
|
|
289
132
|
className: "xc342km x11xkdxz x13fuv20 x1pc3f07 x13xmvwt xnhvf09 x1qaki06 xfo59cc"
|
|
290
133
|
}.className,
|
|
291
134
|
hrSelected: {
|
|
292
135
|
className: "xak0ai5 x9ssot5 x19bwoy8 x1eqjuhu"
|
|
293
136
|
}.className,
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
137
|
+
table: {
|
|
138
|
+
className: "x1mwwwfo xh8yej3"
|
|
139
|
+
}.className,
|
|
140
|
+
tableRow: {
|
|
141
|
+
className: "xso031l x1q0q8m5 xw8gpjh x1bta2m4"
|
|
142
|
+
}.className,
|
|
143
|
+
tableCell: {
|
|
144
|
+
className: "xce4md1 xf314gf x1yc453h xxymvpz x1mzt3pk"
|
|
145
|
+
}.className,
|
|
146
|
+
tableCellHeader: {
|
|
147
|
+
className: "x2mo6ok xv1l7n4"
|
|
297
148
|
}.className,
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
tableRow: block(editorTheme.tableRow),
|
|
302
|
-
tableCell: block(editorTheme.tableCell),
|
|
303
|
-
tableCellHeader: block(editorTheme.tableCellHeader),
|
|
304
|
-
tableScrollableWrapper: block(editorTheme.tableScrollableWrapper)
|
|
149
|
+
tableScrollableWrapper: {
|
|
150
|
+
className: "xw2csxc x193iq5w xrvj5dj x1mkdm3x x1w2a574 xnhvf09 x1u2y747 xfo59cc"
|
|
151
|
+
}.className
|
|
305
152
|
};
|
|
306
153
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -16,8 +16,6 @@ export type { RichTextViewProps } from './RichTextView';
|
|
|
16
16
|
export { sharedEditorTheme } from './editorTheme';
|
|
17
17
|
export { markdownToEditorStateJSON, editorStateJSONToMarkdown, } from './markdownSerializers';
|
|
18
18
|
export type { MarkdownSerializerOptions } from './markdownSerializers';
|
|
19
|
-
export { createRichTextExtension, RichTextExtensionError, } from './markdownExtensions';
|
|
20
|
-
export type { RichTextMarkdownExtension } from './markdownExtensions';
|
|
21
19
|
export { RichTextEditorToolbar, RICHTEXT_ICON_KEYS, } from './RichTextEditorToolbar';
|
|
22
20
|
export type { RichTextEditorToolbarProps } from './RichTextEditorToolbar';
|
|
23
21
|
export { RichTextEditorAutoLinkPlugin, DEFAULT_LINK_MATCHERS, NEW_TAB_LINK_ATTRIBUTES, } from './RichTextEditorAutoLinkPlugin';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AAEH,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,wBAAwB,EACxB,kBAAkB,EAClB,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,YAAY,EAAC,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAEhD,OAAO,EACL,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAC,yBAAyB,EAAC,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AAEH,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,wBAAwB,EACxB,kBAAkB,EAClB,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,YAAY,EAAC,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAEhD,OAAO,EACL,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAC,yBAAyB,EAAC,MAAM,uBAAuB,CAAC;AAErE,OAAO,EACL,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAC,0BAA0B,EAAC,MAAM,yBAAyB,CAAC;AAExE,OAAO,EACL,4BAA4B,EAC5B,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,gCAAgC,CAAC;AACxC,YAAY,EAAC,iCAAiC,EAAC,MAAM,gCAAgC,CAAC;AAEtF,OAAO,EACL,WAAW,EACX,WAAW,EACX,WAAW,EACX,aAAa,GACd,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,6 @@ export { RichTextEditor } from "./RichTextEditor.js";
|
|
|
17
17
|
export { RichTextView } from "./RichTextView.js";
|
|
18
18
|
export { sharedEditorTheme } from "./editorTheme.js";
|
|
19
19
|
export { markdownToEditorStateJSON, editorStateJSONToMarkdown } from "./markdownSerializers.js";
|
|
20
|
-
export { createRichTextExtension, RichTextExtensionError } from "./markdownExtensions.js";
|
|
21
20
|
export { RichTextEditorToolbar, RICHTEXT_ICON_KEYS } from "./RichTextEditorToolbar.js";
|
|
22
21
|
export { RichTextEditorAutoLinkPlugin, DEFAULT_LINK_MATCHERS, NEW_TAB_LINK_ATTRIBUTES } from "./RichTextEditorAutoLinkPlugin.js";
|
|
23
22
|
export { sanitizeUrl, validateUrl, URL_MATCHER, EMAIL_MATCHER } from "./linkUtils.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdownListExport.d.ts","sourceRoot":"","sources":["../src/markdownListExport.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"markdownListExport.d.ts","sourceRoot":"","sources":["../src/markdownListExport.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,mBAAmB,CAAC;AA6C1D,eAAO,MAAM,WAAW,EAAE,kBAQzB,CAAC"}
|