@mdxeditor/editor 1.9.2 → 1.10.1
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/MDXEditor.d.ts +5 -0
- package/dist/MDXEditor.js +6 -1
- package/dist/icons/add_column.svg.js +1 -2
- package/dist/icons/add_photo.svg.js +1 -2
- package/dist/icons/add_row.svg.js +1 -2
- package/dist/icons/{emergency_home.svg.js → admonition.svg.js} +2 -3
- package/dist/icons/arrow_drop_down.svg.js +3 -4
- package/dist/icons/check.svg.js +1 -2
- package/dist/icons/check_small.svg.js +7 -0
- package/dist/icons/close.svg.js +1 -2
- package/dist/icons/code.svg.js +1 -2
- package/dist/icons/content_copy.svg.js +1 -2
- package/dist/icons/delete_big.svg.js +7 -0
- package/dist/icons/delete_small.svg.js +1 -2
- package/dist/icons/difference.svg.js +1 -2
- package/dist/icons/edit.svg.js +1 -2
- package/dist/icons/extension.svg.js +7 -0
- package/dist/icons/format_align_center.svg.js +1 -2
- package/dist/icons/format_align_left.svg.js +1 -2
- package/dist/icons/format_align_right.svg.js +1 -2
- package/dist/icons/format_bold.svg.js +1 -2
- package/dist/icons/format_italic.svg.js +1 -2
- package/dist/icons/format_list_bulleted.svg.js +1 -2
- package/dist/icons/format_list_checked.svg.js +1 -2
- package/dist/icons/format_list_numbered.svg.js +1 -2
- package/dist/icons/format_underlined.svg.js +1 -2
- package/dist/icons/frame_source.svg.js +1 -2
- package/dist/icons/frontmatter.svg.js +1 -2
- package/dist/icons/horizontal_rule.svg.js +1 -2
- package/dist/icons/insert_col_left.svg.js +1 -2
- package/dist/icons/insert_col_right.svg.js +1 -2
- package/dist/icons/insert_row_above.svg.js +1 -2
- package/dist/icons/insert_row_below.svg.js +1 -2
- package/dist/icons/link.svg.js +1 -2
- package/dist/icons/link_off.svg.js +1 -2
- package/dist/icons/markdown.svg.js +1 -2
- package/dist/icons/more_horiz.svg.js +1 -2
- package/dist/icons/more_vert.svg.js +7 -0
- package/dist/icons/open_in_new.svg.js +1 -2
- package/dist/icons/redo.svg.js +1 -2
- package/dist/icons/rich_text.svg.js +1 -2
- package/dist/icons/{deployed_code.svg.js → sandpack.svg.js} +2 -3
- package/dist/icons/settings.svg.js +1 -2
- package/dist/icons/table.svg.js +1 -2
- package/dist/icons/undo.svg.js +1 -2
- package/dist/plugins/codeblock/index.d.ts +13 -2
- package/dist/plugins/codemirror/index.d.ts +17 -2
- package/dist/plugins/core/Icon.d.ts +6 -0
- package/dist/plugins/core/Icon.js +96 -0
- package/dist/plugins/core/PropertyPopover.js +3 -2
- package/dist/plugins/core/index.d.ts +12 -2
- package/dist/plugins/core/index.js +7 -2
- package/dist/plugins/core/ui/DownshiftAutoComplete.js +3 -2
- package/dist/plugins/diff-source/index.d.ts +13 -2
- package/dist/plugins/directives/index.d.ts +13 -2
- package/dist/plugins/frontmatter/FrontmatterEditor.js +7 -5
- package/dist/plugins/frontmatter/index.d.ts +13 -2
- package/dist/plugins/headings/index.d.ts +13 -2
- package/dist/plugins/image/ImageEditor.js +3 -2
- package/dist/plugins/image/index.d.ts +13 -2
- package/dist/plugins/jsx/index.d.ts +13 -2
- package/dist/plugins/link/index.d.ts +2 -0
- package/dist/plugins/link-dialog/LinkDialog.js +11 -14
- package/dist/plugins/link-dialog/index.d.ts +11 -2
- package/dist/plugins/link-dialog/index.js +0 -6
- package/dist/plugins/lists/index.d.ts +13 -2
- package/dist/plugins/markdown-shortcut/index.d.ts +2 -0
- package/dist/plugins/quote/index.d.ts +10 -2
- package/dist/plugins/sandpack/index.d.ts +17 -2
- package/dist/plugins/table/TableEditor.js +22 -28
- package/dist/plugins/table/index.d.ts +13 -2
- package/dist/plugins/thematic-break/index.d.ts +13 -2
- package/dist/plugins/toolbar/components/BoldItalicUnderlineToggles.js +4 -6
- package/dist/plugins/toolbar/components/CodeToggle.js +2 -3
- package/dist/plugins/toolbar/components/CreateLink.js +2 -2
- package/dist/plugins/toolbar/components/DiffSourceToggleWrapper.js +4 -6
- package/dist/plugins/toolbar/components/InsertAdmonition.js +2 -2
- package/dist/plugins/toolbar/components/InsertCodeBlock.js +2 -2
- package/dist/plugins/toolbar/components/InsertFrontmatter.js +2 -2
- package/dist/plugins/toolbar/components/InsertImage.js +2 -3
- package/dist/plugins/toolbar/components/InsertSandpack.js +2 -2
- package/dist/plugins/toolbar/components/InsertTable.js +2 -2
- package/dist/plugins/toolbar/components/InsertThematicBreak.js +2 -2
- package/dist/plugins/toolbar/components/ListsToggle.js +4 -6
- package/dist/plugins/toolbar/components/ShowSandpackInfo.js +3 -4
- package/dist/plugins/toolbar/components/UndoRedo.js +3 -4
- package/dist/plugins/toolbar/index.d.ts +11 -2
- package/dist/plugins/toolbar/primitives/DialogButton.js +4 -6
- package/dist/plugins/toolbar/primitives/TooltipWrap.js +1 -1
- package/dist/plugins/toolbar/primitives/select.js +4 -5
- package/dist/style.css +252 -236
- package/dist/styles/ui.module.css.js +105 -102
- package/package.json +12 -11
- package/dist/icons/delete.svg.js +0 -8
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import * as RadixPopover from "@radix-ui/react-popover";
|
|
2
2
|
import * as Tooltip from "@radix-ui/react-tooltip";
|
|
3
3
|
import React__default from "react";
|
|
4
|
-
import { createCommand } from "lexical";
|
|
5
|
-
import CheckIcon from "../../icons/check.svg.js";
|
|
6
|
-
import CopyIcon from "../../icons/content_copy.svg.js";
|
|
7
|
-
import EditIcon from "../../icons/edit.svg.js";
|
|
8
|
-
import LinkOffIcon from "../../icons/link_off.svg.js";
|
|
9
|
-
import OpenInNewIcon from "../../icons/open_in_new.svg.js";
|
|
10
|
-
import classNames from "classnames";
|
|
11
|
-
import styles from "../../styles/ui.module.css.js";
|
|
12
4
|
import { corePluginHooks } from "../core/index.js";
|
|
13
|
-
import { linkDialogPluginHooks } from "./index.js";
|
|
14
|
-
import { useForm } from "react-hook-form";
|
|
15
5
|
import { DownshiftAutoComplete } from "../core/ui/DownshiftAutoComplete.js";
|
|
6
|
+
import styles from "../../styles/ui.module.css.js";
|
|
7
|
+
import classNames from "classnames";
|
|
8
|
+
import { createCommand } from "lexical";
|
|
9
|
+
import { useForm } from "react-hook-form";
|
|
10
|
+
import { linkDialogPluginHooks } from "./index.js";
|
|
16
11
|
createCommand();
|
|
17
12
|
function LinkEditForm({ url, title, onSubmit, onCancel, linkAutocompleteSuggestions }) {
|
|
18
13
|
const {
|
|
@@ -62,6 +57,7 @@ const LinkDialog = () => {
|
|
|
62
57
|
const [editorRootElementRef] = corePluginHooks.useEmitterValues("editorRootElementRef");
|
|
63
58
|
const publishWindowChange = linkDialogPluginHooks.usePublisher("onWindowChange");
|
|
64
59
|
const [activeEditor] = corePluginHooks.useEmitterValues("activeEditor");
|
|
60
|
+
const [iconComponentFor] = corePluginHooks.useEmitterValues("iconComponentFor");
|
|
65
61
|
const [linkDialogState, linkAutocompleteSuggestions] = linkDialogPluginHooks.useEmitterValues(
|
|
66
62
|
"linkDialogState",
|
|
67
63
|
"linkAutocompleteSuggestions"
|
|
@@ -125,8 +121,8 @@ const LinkDialog = () => {
|
|
|
125
121
|
title: urlIsExternal ? `Open ${linkDialogState.url} in new window` : linkDialogState.url
|
|
126
122
|
},
|
|
127
123
|
/* @__PURE__ */ React__default.createElement("span", null, linkDialogState.url),
|
|
128
|
-
urlIsExternal &&
|
|
129
|
-
), /* @__PURE__ */ React__default.createElement(ActionButton, { onClick: () => switchFromPreviewToLinkEdit(true), title: "Edit link URL", "aria-label": "Edit link URL" },
|
|
124
|
+
urlIsExternal && iconComponentFor("open_in_new")
|
|
125
|
+
), /* @__PURE__ */ React__default.createElement(ActionButton, { onClick: () => switchFromPreviewToLinkEdit(true), title: "Edit link URL", "aria-label": "Edit link URL" }, iconComponentFor("edit")), /* @__PURE__ */ React__default.createElement(Tooltip.Provider, null, /* @__PURE__ */ React__default.createElement(Tooltip.Root, { open: copyUrlTooltipOpen }, /* @__PURE__ */ React__default.createElement(Tooltip.Trigger, { asChild: true }, /* @__PURE__ */ React__default.createElement(
|
|
130
126
|
ActionButton,
|
|
131
127
|
{
|
|
132
128
|
title: "Copy to clipboard",
|
|
@@ -138,8 +134,9 @@ const LinkDialog = () => {
|
|
|
138
134
|
});
|
|
139
135
|
}
|
|
140
136
|
},
|
|
141
|
-
copyUrlTooltipOpen ?
|
|
142
|
-
)), /* @__PURE__ */ React__default.createElement(Tooltip.Portal, { container: editorRootElementRef == null ? void 0 : editorRootElementRef.current }, /* @__PURE__ */ React__default.createElement(Tooltip.Content, { className: classNames(styles.tooltipContent), sideOffset: 5 }, "Copied!", /* @__PURE__ */ React__default.createElement(Tooltip.Arrow, null))))), /* @__PURE__ */ React__default.createElement(ActionButton, { title: "Remove link", "aria-label": "Remove link", onClick: () => removeLink(true) },
|
|
137
|
+
copyUrlTooltipOpen ? iconComponentFor("check") : iconComponentFor("content_copy")
|
|
138
|
+
)), /* @__PURE__ */ React__default.createElement(Tooltip.Portal, { container: editorRootElementRef == null ? void 0 : editorRootElementRef.current }, /* @__PURE__ */ React__default.createElement(Tooltip.Content, { className: classNames(styles.tooltipContent), sideOffset: 5 }, "Copied!", /* @__PURE__ */ React__default.createElement(Tooltip.Arrow, null))))), /* @__PURE__ */ React__default.createElement(ActionButton, { title: "Remove link", "aria-label": "Remove link", onClick: () => removeLink(true) }, iconComponentFor("link_off"))),
|
|
139
|
+
/* @__PURE__ */ React__default.createElement(RadixPopover.Arrow, { className: styles.popoverArrow })
|
|
143
140
|
)));
|
|
144
141
|
};
|
|
145
142
|
const ActionButton = React__default.forwardRef(({ className, ...props }, ref) => {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IconKey } from '../core/Icon';
|
|
1
2
|
import type { RefObject, ReactNode, ComponentType } from 'react';
|
|
2
3
|
import type { Options } from 'mdast-util-to-markdown';
|
|
3
4
|
import type { Config } from 'mdast-util-from-markdown/lib';
|
|
@@ -89,6 +90,7 @@ linkDialogPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
89
90
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
90
91
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
91
92
|
onBlur: RealmNode<FocusEvent>;
|
|
93
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
92
94
|
}>], (r: Realm, [{ activeEditor, currentSelection, createActiveEditorSubscription }]: [{
|
|
93
95
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
94
96
|
inFocus: RealmNode<boolean>;
|
|
@@ -144,6 +146,7 @@ linkDialogPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
144
146
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
145
147
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
146
148
|
onBlur: RealmNode<FocusEvent>;
|
|
149
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
147
150
|
}]) => {
|
|
148
151
|
dialogState: RealmNode<boolean>;
|
|
149
152
|
onWindowChange: RealmNode<true>;
|
|
@@ -232,8 +235,9 @@ linkDialogPluginHooks: {
|
|
|
232
235
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
233
236
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
234
237
|
onBlur: RealmNode<FocusEvent>;
|
|
238
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
235
239
|
}>;
|
|
236
|
-
useEmitter: <K extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "dialogState" | "onWindowChange" | "linkDialogState" | "updateLink" | "switchFromPreviewToLinkEdit" | "cancelLinkEdit" | "removeLink" | "openLinkEditDialog" | "applyLinkChanges" | "linkAutocompleteSuggestions">(key: K, callback: (value: ValueForKey<{
|
|
240
|
+
useEmitter: <K extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "iconComponentFor" | "dialogState" | "onWindowChange" | "linkDialogState" | "updateLink" | "switchFromPreviewToLinkEdit" | "cancelLinkEdit" | "removeLink" | "openLinkEditDialog" | "applyLinkChanges" | "linkAutocompleteSuggestions">(key: K, callback: (value: ValueForKey<{
|
|
237
241
|
dialogState: RealmNode<boolean>;
|
|
238
242
|
onWindowChange: RealmNode<true>;
|
|
239
243
|
linkDialogState: RealmNode<InactiveLinkDialog | PreviewLinkDialog | EditLinkDialog>;
|
|
@@ -302,6 +306,7 @@ linkDialogPluginHooks: {
|
|
|
302
306
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
303
307
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
304
308
|
onBlur: RealmNode<FocusEvent>;
|
|
309
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
305
310
|
}, K>) => void) => void;
|
|
306
311
|
useEmitterValues: <K_1 extends SystemKeys<{
|
|
307
312
|
dialogState: RealmNode<boolean>;
|
|
@@ -372,6 +377,7 @@ linkDialogPluginHooks: {
|
|
|
372
377
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
373
378
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
374
379
|
onBlur: RealmNode<FocusEvent>;
|
|
380
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
375
381
|
}>>(...keys: K_1) => ValuesForKeys<{
|
|
376
382
|
dialogState: RealmNode<boolean>;
|
|
377
383
|
onWindowChange: RealmNode<true>;
|
|
@@ -441,6 +447,7 @@ linkDialogPluginHooks: {
|
|
|
441
447
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
442
448
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
443
449
|
onBlur: RealmNode<FocusEvent>;
|
|
450
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
444
451
|
}, K_1>;
|
|
445
452
|
usePubKeys: () => (values: SystemDict<{
|
|
446
453
|
dialogState: RealmNode<boolean>;
|
|
@@ -511,8 +518,9 @@ linkDialogPluginHooks: {
|
|
|
511
518
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
512
519
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
513
520
|
onBlur: RealmNode<FocusEvent>;
|
|
521
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
514
522
|
}>) => void;
|
|
515
|
-
usePublisher: <K_2 extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "dialogState" | "onWindowChange" | "linkDialogState" | "updateLink" | "switchFromPreviewToLinkEdit" | "cancelLinkEdit" | "removeLink" | "openLinkEditDialog" | "applyLinkChanges" | "linkAutocompleteSuggestions">(key: K_2) => (value: ValueForKey<{
|
|
523
|
+
usePublisher: <K_2 extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "iconComponentFor" | "dialogState" | "onWindowChange" | "linkDialogState" | "updateLink" | "switchFromPreviewToLinkEdit" | "cancelLinkEdit" | "removeLink" | "openLinkEditDialog" | "applyLinkChanges" | "linkAutocompleteSuggestions">(key: K_2) => (value: ValueForKey<{
|
|
516
524
|
dialogState: RealmNode<boolean>;
|
|
517
525
|
onWindowChange: RealmNode<true>;
|
|
518
526
|
linkDialogState: RealmNode<InactiveLinkDialog | PreviewLinkDialog | EditLinkDialog>;
|
|
@@ -581,6 +589,7 @@ linkDialogPluginHooks: {
|
|
|
581
589
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
582
590
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
583
591
|
onBlur: RealmNode<FocusEvent>;
|
|
592
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
584
593
|
}, K_2>) => void;
|
|
585
594
|
};
|
|
586
595
|
export {};
|
|
@@ -147,12 +147,6 @@ const linkDialogSystem = system(
|
|
|
147
147
|
);
|
|
148
148
|
}
|
|
149
149
|
editor == null ? void 0 : editor.dispatchCommand(TOGGLE_LINK_COMMAND, { url, title });
|
|
150
|
-
setTimeout(() => {
|
|
151
|
-
editor == null ? void 0 : editor.update(() => {
|
|
152
|
-
const node = getLinkNodeInSelection($getSelection());
|
|
153
|
-
node == null ? void 0 : node.setTitle(title);
|
|
154
|
-
});
|
|
155
|
-
}, 100);
|
|
156
150
|
r.pub(linkDialogState, {
|
|
157
151
|
type: "preview",
|
|
158
152
|
linkNodeKey: state.linkNodeKey,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IconKey } from '../core/Icon';
|
|
1
2
|
import type { RefObject, ReactNode, ComponentType } from 'react';
|
|
2
3
|
import type { Options } from 'mdast-util-to-markdown';
|
|
3
4
|
import type { Config } from 'mdast-util-from-markdown/lib';
|
|
@@ -69,6 +70,7 @@ export declare const listsSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
69
70
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
70
71
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
71
72
|
onBlur: RealmNode<FocusEvent>;
|
|
73
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
72
74
|
}>], (r: Realm, [{ activeEditor, currentSelection }]: [{
|
|
73
75
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
74
76
|
inFocus: RealmNode<boolean>;
|
|
@@ -124,6 +126,7 @@ export declare const listsSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
124
126
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
125
127
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
126
128
|
onBlur: RealmNode<FocusEvent>;
|
|
129
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
127
130
|
}]) => {
|
|
128
131
|
currentListType: RealmNode<"" | ListType>;
|
|
129
132
|
applyListType: RealmNode<"" | ListType>;
|
|
@@ -185,6 +188,7 @@ listsPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
185
188
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
186
189
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
187
190
|
onBlur: RealmNode<FocusEvent>;
|
|
191
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
188
192
|
}>], (r: Realm, [{ activeEditor, currentSelection }]: [{
|
|
189
193
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
190
194
|
inFocus: RealmNode<boolean>;
|
|
@@ -240,6 +244,7 @@ listsPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
240
244
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
241
245
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
242
246
|
onBlur: RealmNode<FocusEvent>;
|
|
247
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
243
248
|
}]) => {
|
|
244
249
|
currentListType: RealmNode<"" | ListType>;
|
|
245
250
|
applyListType: RealmNode<"" | ListType>;
|
|
@@ -304,8 +309,9 @@ listsPluginHooks: {
|
|
|
304
309
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
305
310
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
306
311
|
onBlur: RealmNode<FocusEvent>;
|
|
312
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
307
313
|
}>;
|
|
308
|
-
useEmitter: <K extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "currentListType" | "applyListType">(key: K, callback: (value: ValueForKey<{
|
|
314
|
+
useEmitter: <K extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "iconComponentFor" | "currentListType" | "applyListType">(key: K, callback: (value: ValueForKey<{
|
|
309
315
|
currentListType: RealmNode<"" | ListType>;
|
|
310
316
|
applyListType: RealmNode<"" | ListType>;
|
|
311
317
|
} & {
|
|
@@ -363,6 +369,7 @@ listsPluginHooks: {
|
|
|
363
369
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
364
370
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
365
371
|
onBlur: RealmNode<FocusEvent>;
|
|
372
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
366
373
|
}, K>) => void) => void;
|
|
367
374
|
useEmitterValues: <K_1 extends SystemKeys<{
|
|
368
375
|
currentListType: RealmNode<"" | ListType>;
|
|
@@ -422,6 +429,7 @@ listsPluginHooks: {
|
|
|
422
429
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
423
430
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
424
431
|
onBlur: RealmNode<FocusEvent>;
|
|
432
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
425
433
|
}>>(...keys: K_1) => ValuesForKeys<{
|
|
426
434
|
currentListType: RealmNode<"" | ListType>;
|
|
427
435
|
applyListType: RealmNode<"" | ListType>;
|
|
@@ -480,6 +488,7 @@ listsPluginHooks: {
|
|
|
480
488
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
481
489
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
482
490
|
onBlur: RealmNode<FocusEvent>;
|
|
491
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
483
492
|
}, K_1>;
|
|
484
493
|
usePubKeys: () => (values: SystemDict<{
|
|
485
494
|
currentListType: RealmNode<"" | ListType>;
|
|
@@ -539,8 +548,9 @@ listsPluginHooks: {
|
|
|
539
548
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
540
549
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
541
550
|
onBlur: RealmNode<FocusEvent>;
|
|
551
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
542
552
|
}>) => void;
|
|
543
|
-
usePublisher: <K_2 extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "currentListType" | "applyListType">(key: K_2) => (value: ValueForKey<{
|
|
553
|
+
usePublisher: <K_2 extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "iconComponentFor" | "currentListType" | "applyListType">(key: K_2) => (value: ValueForKey<{
|
|
544
554
|
currentListType: RealmNode<"" | ListType>;
|
|
545
555
|
applyListType: RealmNode<"" | ListType>;
|
|
546
556
|
} & {
|
|
@@ -598,5 +608,6 @@ listsPluginHooks: {
|
|
|
598
608
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
599
609
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
600
610
|
onBlur: RealmNode<FocusEvent>;
|
|
611
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
601
612
|
}, K_2>) => void;
|
|
602
613
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IconKey } from '../core/Icon';
|
|
1
2
|
import type { Options } from 'mdast-util-to-markdown';
|
|
2
3
|
import type { Config } from 'mdast-util-from-markdown/lib';
|
|
3
4
|
import type { Extension } from 'micromark-util-types';
|
|
@@ -66,4 +67,5 @@ export declare const markdownShortcutPlugin: PluginConstructor<SystemSpec<[Syste
|
|
|
66
67
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
67
68
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
68
69
|
onBlur: RealmNode<FocusEvent>;
|
|
70
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
69
71
|
}>], (_: Realm) => {}>, object>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IconKey } from '../core/Icon';
|
|
1
2
|
import type { RefObject, ReactNode, ComponentType } from 'react';
|
|
2
3
|
import type { Options } from 'mdast-util-to-markdown';
|
|
3
4
|
import type { Config } from 'mdast-util-from-markdown/lib';
|
|
@@ -68,6 +69,7 @@ quotePlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
68
69
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
69
70
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
70
71
|
onBlur: RealmNode<FocusEvent>;
|
|
72
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
71
73
|
}>], () => {}>, object>,
|
|
72
74
|
/** @internal */
|
|
73
75
|
quotePluginHooks: {
|
|
@@ -126,8 +128,9 @@ quotePluginHooks: {
|
|
|
126
128
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
127
129
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
128
130
|
onBlur: RealmNode<FocusEvent>;
|
|
131
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
129
132
|
}>;
|
|
130
|
-
useEmitter: <K extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur">(key: K, callback: (value: ValueForKey<{
|
|
133
|
+
useEmitter: <K extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "iconComponentFor">(key: K, callback: (value: ValueForKey<{
|
|
131
134
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
132
135
|
inFocus: RealmNode<boolean>;
|
|
133
136
|
historyState: RealmNode<HistoryState>;
|
|
@@ -182,6 +185,7 @@ quotePluginHooks: {
|
|
|
182
185
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
183
186
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
184
187
|
onBlur: RealmNode<FocusEvent>;
|
|
188
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
185
189
|
}, K>) => void) => void;
|
|
186
190
|
useEmitterValues: <K_1 extends SystemKeys<{
|
|
187
191
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
@@ -238,6 +242,7 @@ quotePluginHooks: {
|
|
|
238
242
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
239
243
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
240
244
|
onBlur: RealmNode<FocusEvent>;
|
|
245
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
241
246
|
}>>(...keys: K_1) => ValuesForKeys<{
|
|
242
247
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
243
248
|
inFocus: RealmNode<boolean>;
|
|
@@ -293,6 +298,7 @@ quotePluginHooks: {
|
|
|
293
298
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
294
299
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
295
300
|
onBlur: RealmNode<FocusEvent>;
|
|
301
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
296
302
|
}, K_1>;
|
|
297
303
|
usePubKeys: () => (values: SystemDict<{
|
|
298
304
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
@@ -349,8 +355,9 @@ quotePluginHooks: {
|
|
|
349
355
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
350
356
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
351
357
|
onBlur: RealmNode<FocusEvent>;
|
|
358
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
352
359
|
}>) => void;
|
|
353
|
-
usePublisher: <K_2 extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur">(key: K_2) => (value: ValueForKey<{
|
|
360
|
+
usePublisher: <K_2 extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "iconComponentFor">(key: K_2) => (value: ValueForKey<{
|
|
354
361
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
355
362
|
inFocus: RealmNode<boolean>;
|
|
356
363
|
historyState: RealmNode<HistoryState>;
|
|
@@ -405,5 +412,6 @@ quotePluginHooks: {
|
|
|
405
412
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
406
413
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
407
414
|
onBlur: RealmNode<FocusEvent>;
|
|
415
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
408
416
|
}, K_2>) => void;
|
|
409
417
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CodeBlockEditorDescriptor, CreateCodeBlockNodeOptions } from '../codeblock';
|
|
2
|
+
import type { IconKey } from '../core/Icon';
|
|
2
3
|
import type { Options } from 'mdast-util-to-markdown';
|
|
3
4
|
import type { Config } from 'mdast-util-from-markdown/lib';
|
|
4
5
|
import type { Extension } from 'micromark-util-types';
|
|
@@ -130,6 +131,7 @@ export declare const sandpackSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
130
131
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
131
132
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
132
133
|
onBlur: RealmNode<FocusEvent>;
|
|
134
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
133
135
|
}>, SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
134
136
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
135
137
|
inFocus: RealmNode<boolean>;
|
|
@@ -185,6 +187,7 @@ export declare const sandpackSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
185
187
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
186
188
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
187
189
|
onBlur: RealmNode<FocusEvent>;
|
|
190
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
188
191
|
}>], (r: Realm, [{ insertDecoratorNode }]: [{
|
|
189
192
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
190
193
|
inFocus: RealmNode<boolean>;
|
|
@@ -240,6 +243,7 @@ export declare const sandpackSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
240
243
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
241
244
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
242
245
|
onBlur: RealmNode<FocusEvent>;
|
|
246
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
243
247
|
}]) => {
|
|
244
248
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
245
249
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -300,6 +304,7 @@ export declare const sandpackSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
300
304
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
301
305
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
302
306
|
onBlur: RealmNode<FocusEvent>;
|
|
307
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
303
308
|
}, {
|
|
304
309
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
305
310
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -366,6 +371,7 @@ sandpackPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
366
371
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
367
372
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
368
373
|
onBlur: RealmNode<FocusEvent>;
|
|
374
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
369
375
|
}>, SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
370
376
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
371
377
|
inFocus: RealmNode<boolean>;
|
|
@@ -421,6 +427,7 @@ sandpackPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
421
427
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
422
428
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
423
429
|
onBlur: RealmNode<FocusEvent>;
|
|
430
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
424
431
|
}>], (r: Realm, [{ insertDecoratorNode }]: [{
|
|
425
432
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
426
433
|
inFocus: RealmNode<boolean>;
|
|
@@ -476,6 +483,7 @@ sandpackPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
476
483
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
477
484
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
478
485
|
onBlur: RealmNode<FocusEvent>;
|
|
486
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
479
487
|
}]) => {
|
|
480
488
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
481
489
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -536,6 +544,7 @@ sandpackPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
536
544
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
537
545
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
538
546
|
onBlur: RealmNode<FocusEvent>;
|
|
547
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
539
548
|
}, {
|
|
540
549
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
541
550
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -607,13 +616,14 @@ sandpackPluginHooks: {
|
|
|
607
616
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
608
617
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
609
618
|
onBlur: RealmNode<FocusEvent>;
|
|
619
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
610
620
|
} & {
|
|
611
621
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
612
622
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
613
623
|
appendCodeBlockEditorDescriptor: RealmNode<CodeBlockEditorDescriptor>;
|
|
614
624
|
insertCodeBlock: RealmNode<Partial<CreateCodeBlockNodeOptions>>;
|
|
615
625
|
}>;
|
|
616
|
-
useEmitter: <K extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "codeBlockEditorDescriptors" | "defaultCodeBlockLanguage" | "appendCodeBlockEditorDescriptor" | "insertCodeBlock" | "insertSandpack" | "sandpackConfig">(key: K, callback: (value: ValueForKey<{
|
|
626
|
+
useEmitter: <K extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "iconComponentFor" | "codeBlockEditorDescriptors" | "defaultCodeBlockLanguage" | "appendCodeBlockEditorDescriptor" | "insertCodeBlock" | "insertSandpack" | "sandpackConfig">(key: K, callback: (value: ValueForKey<{
|
|
617
627
|
insertSandpack: RealmNode<string>;
|
|
618
628
|
sandpackConfig: RealmNode<SandpackConfig>;
|
|
619
629
|
} & {
|
|
@@ -671,6 +681,7 @@ sandpackPluginHooks: {
|
|
|
671
681
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
672
682
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
673
683
|
onBlur: RealmNode<FocusEvent>;
|
|
684
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
674
685
|
} & {
|
|
675
686
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
676
687
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -735,6 +746,7 @@ sandpackPluginHooks: {
|
|
|
735
746
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
736
747
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
737
748
|
onBlur: RealmNode<FocusEvent>;
|
|
749
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
738
750
|
} & {
|
|
739
751
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
740
752
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -798,6 +810,7 @@ sandpackPluginHooks: {
|
|
|
798
810
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
799
811
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
800
812
|
onBlur: RealmNode<FocusEvent>;
|
|
813
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
801
814
|
} & {
|
|
802
815
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
803
816
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -862,13 +875,14 @@ sandpackPluginHooks: {
|
|
|
862
875
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
863
876
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
864
877
|
onBlur: RealmNode<FocusEvent>;
|
|
878
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
865
879
|
} & {
|
|
866
880
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
867
881
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
868
882
|
appendCodeBlockEditorDescriptor: RealmNode<CodeBlockEditorDescriptor>;
|
|
869
883
|
insertCodeBlock: RealmNode<Partial<CreateCodeBlockNodeOptions>>;
|
|
870
884
|
}>) => void;
|
|
871
|
-
usePublisher: <K_2 extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "codeBlockEditorDescriptors" | "defaultCodeBlockLanguage" | "appendCodeBlockEditorDescriptor" | "insertCodeBlock" | "insertSandpack" | "sandpackConfig">(key: K_2) => (value: ValueForKey<{
|
|
885
|
+
usePublisher: <K_2 extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "iconComponentFor" | "codeBlockEditorDescriptors" | "defaultCodeBlockLanguage" | "appendCodeBlockEditorDescriptor" | "insertCodeBlock" | "insertSandpack" | "sandpackConfig">(key: K_2) => (value: ValueForKey<{
|
|
872
886
|
insertSandpack: RealmNode<string>;
|
|
873
887
|
sandpackConfig: RealmNode<SandpackConfig>;
|
|
874
888
|
} & {
|
|
@@ -926,6 +940,7 @@ sandpackPluginHooks: {
|
|
|
926
940
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
927
941
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
928
942
|
onBlur: RealmNode<FocusEvent>;
|
|
943
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
929
944
|
} & {
|
|
930
945
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
931
946
|
defaultCodeBlockLanguage: RealmNode<string>;
|