@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,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';
|
|
@@ -126,6 +127,7 @@ export declare const directivesSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
126
127
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
127
128
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
128
129
|
onBlur: RealmNode<FocusEvent>;
|
|
130
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
129
131
|
}>], (r: Realm, [{ insertDecoratorNode }]: [{
|
|
130
132
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
131
133
|
inFocus: RealmNode<boolean>;
|
|
@@ -181,6 +183,7 @@ export declare const directivesSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
181
183
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
182
184
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
183
185
|
onBlur: RealmNode<FocusEvent>;
|
|
186
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
184
187
|
}]) => {
|
|
185
188
|
directiveDescriptors: RealmNode<DirectiveDescriptor<any>[]>;
|
|
186
189
|
insertDirective: RealmNode<InsertDirectivePayload>;
|
|
@@ -254,6 +257,7 @@ directivesPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
254
257
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
255
258
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
256
259
|
onBlur: RealmNode<FocusEvent>;
|
|
260
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
257
261
|
}>], (r: Realm, [{ insertDecoratorNode }]: [{
|
|
258
262
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
259
263
|
inFocus: RealmNode<boolean>;
|
|
@@ -309,6 +313,7 @@ directivesPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
309
313
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
310
314
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
311
315
|
onBlur: RealmNode<FocusEvent>;
|
|
316
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
312
317
|
}]) => {
|
|
313
318
|
directiveDescriptors: RealmNode<DirectiveDescriptor<any>[]>;
|
|
314
319
|
insertDirective: RealmNode<InsertDirectivePayload>;
|
|
@@ -373,8 +378,9 @@ directivesPluginHooks: {
|
|
|
373
378
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
374
379
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
375
380
|
onBlur: RealmNode<FocusEvent>;
|
|
381
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
376
382
|
}>;
|
|
377
|
-
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" | "directiveDescriptors" | "insertDirective">(key: K, callback: (value: ValueForKey<{
|
|
383
|
+
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" | "directiveDescriptors" | "insertDirective">(key: K, callback: (value: ValueForKey<{
|
|
378
384
|
directiveDescriptors: RealmNode<DirectiveDescriptor<any>[]>;
|
|
379
385
|
insertDirective: RealmNode<InsertDirectivePayload>;
|
|
380
386
|
} & {
|
|
@@ -432,6 +438,7 @@ directivesPluginHooks: {
|
|
|
432
438
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
433
439
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
434
440
|
onBlur: RealmNode<FocusEvent>;
|
|
441
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
435
442
|
}, K>) => void) => void;
|
|
436
443
|
useEmitterValues: <K_1 extends SystemKeys<{
|
|
437
444
|
directiveDescriptors: RealmNode<DirectiveDescriptor<any>[]>;
|
|
@@ -491,6 +498,7 @@ directivesPluginHooks: {
|
|
|
491
498
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
492
499
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
493
500
|
onBlur: RealmNode<FocusEvent>;
|
|
501
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
494
502
|
}>>(...keys: K_1) => ValuesForKeys<{
|
|
495
503
|
directiveDescriptors: RealmNode<DirectiveDescriptor<any>[]>;
|
|
496
504
|
insertDirective: RealmNode<InsertDirectivePayload>;
|
|
@@ -549,6 +557,7 @@ directivesPluginHooks: {
|
|
|
549
557
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
550
558
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
551
559
|
onBlur: RealmNode<FocusEvent>;
|
|
560
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
552
561
|
}, K_1>;
|
|
553
562
|
usePubKeys: () => (values: SystemDict<{
|
|
554
563
|
directiveDescriptors: RealmNode<DirectiveDescriptor<any>[]>;
|
|
@@ -608,8 +617,9 @@ directivesPluginHooks: {
|
|
|
608
617
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
609
618
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
610
619
|
onBlur: RealmNode<FocusEvent>;
|
|
620
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
611
621
|
}>) => void;
|
|
612
|
-
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" | "directiveDescriptors" | "insertDirective">(key: K_2) => (value: ValueForKey<{
|
|
622
|
+
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" | "directiveDescriptors" | "insertDirective">(key: K_2) => (value: ValueForKey<{
|
|
613
623
|
directiveDescriptors: RealmNode<DirectiveDescriptor<any>[]>;
|
|
614
624
|
insertDirective: RealmNode<InsertDirectivePayload>;
|
|
615
625
|
} & {
|
|
@@ -667,6 +677,7 @@ directivesPluginHooks: {
|
|
|
667
677
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
668
678
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
669
679
|
onBlur: RealmNode<FocusEvent>;
|
|
680
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
670
681
|
}, K_2>) => void;
|
|
671
682
|
};
|
|
672
683
|
export {};
|
|
@@ -4,12 +4,14 @@ import YamlParser from "js-yaml";
|
|
|
4
4
|
import React__default from "react";
|
|
5
5
|
import { useForm, useFieldArray } from "react-hook-form";
|
|
6
6
|
import { frontmatterPluginHooks } from "./index.js";
|
|
7
|
-
import CloseIcon from "../../icons/close.svg.js";
|
|
8
|
-
import DeleteIcon from "../../icons/delete.svg.js";
|
|
9
7
|
import styles from "../../styles/ui.module.css.js";
|
|
10
8
|
import { corePluginHooks } from "../core/index.js";
|
|
11
9
|
const FrontmatterEditor = ({ yaml, onChange }) => {
|
|
12
|
-
const [readOnly, editorRootElementRef] = corePluginHooks.useEmitterValues(
|
|
10
|
+
const [readOnly, editorRootElementRef, iconComponentFor] = corePluginHooks.useEmitterValues(
|
|
11
|
+
"readOnly",
|
|
12
|
+
"editorRootElementRef",
|
|
13
|
+
"iconComponentFor"
|
|
14
|
+
);
|
|
13
15
|
const [frontmatterDialogOpen] = frontmatterPluginHooks.useEmitterValues("frontmatterDialogOpen");
|
|
14
16
|
const setFrontmatterDialogOpen = frontmatterPluginHooks.usePublisher("frontmatterDialogOpen");
|
|
15
17
|
const removeFrontmatter = frontmatterPluginHooks.usePublisher("removeFrontmatter");
|
|
@@ -59,7 +61,7 @@ const FrontmatterEditor = ({ yaml, onChange }) => {
|
|
|
59
61
|
}
|
|
60
62
|
},
|
|
61
63
|
/* @__PURE__ */ React__default.createElement("table", { className: styles.propertyEditorTable }, /* @__PURE__ */ React__default.createElement("colgroup", null, /* @__PURE__ */ React__default.createElement("col", null), /* @__PURE__ */ React__default.createElement("col", null), /* @__PURE__ */ React__default.createElement("col", null)), /* @__PURE__ */ React__default.createElement("thead", null, /* @__PURE__ */ React__default.createElement("tr", null, /* @__PURE__ */ React__default.createElement("th", null, "Key"), /* @__PURE__ */ React__default.createElement("th", null, "Value"), /* @__PURE__ */ React__default.createElement("th", null))), /* @__PURE__ */ React__default.createElement("tbody", null, fields.map((item, index) => {
|
|
62
|
-
return /* @__PURE__ */ React__default.createElement("tr", { key: item.id }, /* @__PURE__ */ React__default.createElement("td", null, /* @__PURE__ */ React__default.createElement(TableInput, { ...register(`yamlConfig.${index}.key`, { required: true }), autofocusIfEmpty: true, readOnly })), /* @__PURE__ */ React__default.createElement("td", null, /* @__PURE__ */ React__default.createElement(TableInput, { ...register(`yamlConfig.${index}.value`, { required: true }), readOnly })), /* @__PURE__ */ React__default.createElement("td", null, /* @__PURE__ */ React__default.createElement("button", { type: "button", onClick: () => remove(index), className: styles.iconButton, disabled: readOnly },
|
|
64
|
+
return /* @__PURE__ */ React__default.createElement("tr", { key: item.id }, /* @__PURE__ */ React__default.createElement("td", null, /* @__PURE__ */ React__default.createElement(TableInput, { ...register(`yamlConfig.${index}.key`, { required: true }), autofocusIfEmpty: true, readOnly })), /* @__PURE__ */ React__default.createElement("td", null, /* @__PURE__ */ React__default.createElement(TableInput, { ...register(`yamlConfig.${index}.value`, { required: true }), readOnly })), /* @__PURE__ */ React__default.createElement("td", null, /* @__PURE__ */ React__default.createElement("button", { type: "button", onClick: () => remove(index), className: styles.iconButton, disabled: readOnly }, iconComponentFor("delete_big"))));
|
|
63
65
|
})), /* @__PURE__ */ React__default.createElement("tfoot", null, /* @__PURE__ */ React__default.createElement("tr", null, /* @__PURE__ */ React__default.createElement("td", null, /* @__PURE__ */ React__default.createElement(
|
|
64
66
|
"button",
|
|
65
67
|
{
|
|
@@ -73,7 +75,7 @@ const FrontmatterEditor = ({ yaml, onChange }) => {
|
|
|
73
75
|
"Add entry"
|
|
74
76
|
))))),
|
|
75
77
|
/* @__PURE__ */ React__default.createElement("div", { style: { display: "flex", justifyContent: "flex-end", gap: "var(--spacing-2)" } }, /* @__PURE__ */ React__default.createElement("button", { type: "submit", className: styles.primaryButton }, "Save"), /* @__PURE__ */ React__default.createElement("button", { type: "reset", className: styles.secondaryButton }, "Cancel"))
|
|
76
|
-
), /* @__PURE__ */ React__default.createElement(Dialog.Close, { asChild: true }, /* @__PURE__ */ React__default.createElement("button", { className: styles.dialogCloseButton, "aria-label": "Close" },
|
|
78
|
+
), /* @__PURE__ */ React__default.createElement(Dialog.Close, { asChild: true }, /* @__PURE__ */ React__default.createElement("button", { className: styles.dialogCloseButton, "aria-label": "Close" }, iconComponentFor("close")))))));
|
|
77
79
|
};
|
|
78
80
|
const TableInput = React__default.forwardRef(({ className, autofocusIfEmpty: _, ...props }, ref) => {
|
|
79
81
|
return /* @__PURE__ */ React__default.createElement("input", { className: classNames(styles.propertyEditorInput, 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';
|
|
@@ -67,6 +68,7 @@ export declare const frontmatterSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
67
68
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
68
69
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
69
70
|
onBlur: RealmNode<FocusEvent>;
|
|
71
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
70
72
|
}>], (r: Realm, [{ rootEditor, createRootEditorSubscription }]: [{
|
|
71
73
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
72
74
|
inFocus: RealmNode<boolean>;
|
|
@@ -122,6 +124,7 @@ export declare const frontmatterSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
122
124
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
123
125
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
124
126
|
onBlur: RealmNode<FocusEvent>;
|
|
127
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
125
128
|
}]) => {
|
|
126
129
|
insertFrontmatter: RealmNode<true>;
|
|
127
130
|
removeFrontmatter: RealmNode<true>;
|
|
@@ -185,6 +188,7 @@ frontmatterPlugin: 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, [{ rootEditor, createRootEditorSubscription }]: [{
|
|
189
193
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
190
194
|
inFocus: RealmNode<boolean>;
|
|
@@ -240,6 +244,7 @@ frontmatterPlugin: 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
|
insertFrontmatter: RealmNode<true>;
|
|
245
250
|
removeFrontmatter: RealmNode<true>;
|
|
@@ -308,8 +313,9 @@ frontmatterPluginHooks: {
|
|
|
308
313
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
309
314
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
310
315
|
onBlur: RealmNode<FocusEvent>;
|
|
316
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
311
317
|
}>;
|
|
312
|
-
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" | "insertFrontmatter" | "removeFrontmatter" | "hasFrontmatter" | "frontmatterDialogOpen">(key: K, callback: (value: ValueForKey<{
|
|
318
|
+
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" | "insertFrontmatter" | "removeFrontmatter" | "hasFrontmatter" | "frontmatterDialogOpen">(key: K, callback: (value: ValueForKey<{
|
|
313
319
|
insertFrontmatter: RealmNode<true>;
|
|
314
320
|
removeFrontmatter: RealmNode<true>;
|
|
315
321
|
hasFrontmatter: RealmNode<boolean>;
|
|
@@ -369,6 +375,7 @@ frontmatterPluginHooks: {
|
|
|
369
375
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
370
376
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
371
377
|
onBlur: RealmNode<FocusEvent>;
|
|
378
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
372
379
|
}, K>) => void) => void;
|
|
373
380
|
useEmitterValues: <K_1 extends SystemKeys<{
|
|
374
381
|
insertFrontmatter: RealmNode<true>;
|
|
@@ -430,6 +437,7 @@ frontmatterPluginHooks: {
|
|
|
430
437
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
431
438
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
432
439
|
onBlur: RealmNode<FocusEvent>;
|
|
440
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
433
441
|
}>>(...keys: K_1) => ValuesForKeys<{
|
|
434
442
|
insertFrontmatter: RealmNode<true>;
|
|
435
443
|
removeFrontmatter: RealmNode<true>;
|
|
@@ -490,6 +498,7 @@ frontmatterPluginHooks: {
|
|
|
490
498
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
491
499
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
492
500
|
onBlur: RealmNode<FocusEvent>;
|
|
501
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
493
502
|
}, K_1>;
|
|
494
503
|
usePubKeys: () => (values: SystemDict<{
|
|
495
504
|
insertFrontmatter: RealmNode<true>;
|
|
@@ -551,8 +560,9 @@ frontmatterPluginHooks: {
|
|
|
551
560
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
552
561
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
553
562
|
onBlur: RealmNode<FocusEvent>;
|
|
563
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
554
564
|
}>) => void;
|
|
555
|
-
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" | "insertFrontmatter" | "removeFrontmatter" | "hasFrontmatter" | "frontmatterDialogOpen">(key: K_2) => (value: ValueForKey<{
|
|
565
|
+
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" | "insertFrontmatter" | "removeFrontmatter" | "hasFrontmatter" | "frontmatterDialogOpen">(key: K_2) => (value: ValueForKey<{
|
|
556
566
|
insertFrontmatter: RealmNode<true>;
|
|
557
567
|
removeFrontmatter: RealmNode<true>;
|
|
558
568
|
hasFrontmatter: RealmNode<boolean>;
|
|
@@ -612,5 +622,6 @@ frontmatterPluginHooks: {
|
|
|
612
622
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
613
623
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
614
624
|
onBlur: RealmNode<FocusEvent>;
|
|
625
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
615
626
|
}, K_2>) => void;
|
|
616
627
|
};
|
|
@@ -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';
|
|
@@ -71,6 +72,7 @@ export declare const headingsSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
71
72
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
72
73
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
73
74
|
onBlur: RealmNode<FocusEvent>;
|
|
75
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
74
76
|
}>], (r: Realm, [{ createRootEditorSubscription, convertSelectionToNode }]: [{
|
|
75
77
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
76
78
|
inFocus: RealmNode<boolean>;
|
|
@@ -126,6 +128,7 @@ export declare const headingsSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
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
133
|
allowedHeadingLevels: RealmNode<readonly (1 | 2 | 4 | 3 | 5 | 6)[]>;
|
|
131
134
|
}>;
|
|
@@ -197,6 +200,7 @@ export declare const headingsPlugin: PluginConstructor<SystemSpec<[SystemSpec<[]
|
|
|
197
200
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
198
201
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
199
202
|
onBlur: RealmNode<FocusEvent>;
|
|
203
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
200
204
|
}>], (r: Realm, [{ createRootEditorSubscription, convertSelectionToNode }]: [{
|
|
201
205
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
202
206
|
inFocus: RealmNode<boolean>;
|
|
@@ -252,6 +256,7 @@ export declare const headingsPlugin: PluginConstructor<SystemSpec<[SystemSpec<[]
|
|
|
252
256
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
253
257
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
254
258
|
onBlur: RealmNode<FocusEvent>;
|
|
259
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
255
260
|
}]) => {
|
|
256
261
|
allowedHeadingLevels: RealmNode<readonly (1 | 2 | 4 | 3 | 5 | 6)[]>;
|
|
257
262
|
}>, HeadingsPluginParams>, headingsPluginHooks: {
|
|
@@ -312,8 +317,9 @@ export declare const headingsPlugin: PluginConstructor<SystemSpec<[SystemSpec<[]
|
|
|
312
317
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
313
318
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
314
319
|
onBlur: RealmNode<FocusEvent>;
|
|
320
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
315
321
|
}>;
|
|
316
|
-
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" | "allowedHeadingLevels">(key: K, callback: (value: ValueForKey<{
|
|
322
|
+
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" | "allowedHeadingLevels">(key: K, callback: (value: ValueForKey<{
|
|
317
323
|
allowedHeadingLevels: RealmNode<readonly (1 | 2 | 4 | 3 | 5 | 6)[]>;
|
|
318
324
|
} & {
|
|
319
325
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
@@ -370,6 +376,7 @@ export declare const headingsPlugin: PluginConstructor<SystemSpec<[SystemSpec<[]
|
|
|
370
376
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
371
377
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
372
378
|
onBlur: RealmNode<FocusEvent>;
|
|
379
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
373
380
|
}, K>) => void) => void;
|
|
374
381
|
useEmitterValues: <K_1 extends SystemKeys<{
|
|
375
382
|
allowedHeadingLevels: RealmNode<readonly (1 | 2 | 4 | 3 | 5 | 6)[]>;
|
|
@@ -428,6 +435,7 @@ export declare const headingsPlugin: PluginConstructor<SystemSpec<[SystemSpec<[]
|
|
|
428
435
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
429
436
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
430
437
|
onBlur: RealmNode<FocusEvent>;
|
|
438
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
431
439
|
}>>(...keys: K_1) => ValuesForKeys<{
|
|
432
440
|
allowedHeadingLevels: RealmNode<readonly (1 | 2 | 4 | 3 | 5 | 6)[]>;
|
|
433
441
|
} & {
|
|
@@ -485,6 +493,7 @@ export declare const headingsPlugin: PluginConstructor<SystemSpec<[SystemSpec<[]
|
|
|
485
493
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
486
494
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
487
495
|
onBlur: RealmNode<FocusEvent>;
|
|
496
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
488
497
|
}, K_1>;
|
|
489
498
|
usePubKeys: () => (values: SystemDict<{
|
|
490
499
|
allowedHeadingLevels: RealmNode<readonly (1 | 2 | 4 | 3 | 5 | 6)[]>;
|
|
@@ -543,8 +552,9 @@ export declare const headingsPlugin: PluginConstructor<SystemSpec<[SystemSpec<[]
|
|
|
543
552
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
544
553
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
545
554
|
onBlur: RealmNode<FocusEvent>;
|
|
555
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
546
556
|
}>) => void;
|
|
547
|
-
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" | "allowedHeadingLevels">(key: K_2) => (value: ValueForKey<{
|
|
557
|
+
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" | "allowedHeadingLevels">(key: K_2) => (value: ValueForKey<{
|
|
548
558
|
allowedHeadingLevels: RealmNode<readonly (1 | 2 | 4 | 3 | 5 | 6)[]>;
|
|
549
559
|
} & {
|
|
550
560
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
@@ -601,6 +611,7 @@ export declare const headingsPlugin: PluginConstructor<SystemSpec<[SystemSpec<[]
|
|
|
601
611
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
602
612
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
603
613
|
onBlur: RealmNode<FocusEvent>;
|
|
614
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
604
615
|
}, K_2>) => void;
|
|
605
616
|
};
|
|
606
617
|
export {};
|
|
@@ -5,8 +5,8 @@ import { mergeRegister } from "@lexical/utils";
|
|
|
5
5
|
import classNames from "classnames";
|
|
6
6
|
import { $isNodeSelection, $getSelection, $getNodeByKey, $setSelection, SELECTION_CHANGE_COMMAND, COMMAND_PRIORITY_LOW, CLICK_COMMAND, DRAGSTART_COMMAND, KEY_DELETE_COMMAND, KEY_BACKSPACE_COMMAND, KEY_ENTER_COMMAND, KEY_ESCAPE_COMMAND } from "lexical";
|
|
7
7
|
import { imagePluginHooks } from "./index.js";
|
|
8
|
-
import SettingsIcon from "../../icons/settings.svg.js";
|
|
9
8
|
import styles from "../../styles/ui.module.css.js";
|
|
9
|
+
import { corePluginHooks } from "../core/index.js";
|
|
10
10
|
import { $isImageNode } from "./ImageNode.js";
|
|
11
11
|
import ImageResizer from "./ImageResizer.js";
|
|
12
12
|
const imageCache = /* @__PURE__ */ new Set();
|
|
@@ -58,6 +58,7 @@ function ImageEditor({ src, title, alt, nodeKey, width, height }) {
|
|
|
58
58
|
const [imagePreviewHandler] = imagePluginHooks.useEmitterValues("imagePreviewHandler");
|
|
59
59
|
const [imageSource, setImageSource] = React__default.useState(null);
|
|
60
60
|
const openEditImageDialog = imagePluginHooks.usePublisher("openEditImageDialog");
|
|
61
|
+
const [iconComponentFor] = corePluginHooks.useEmitterValues("iconComponentFor");
|
|
61
62
|
const onDelete = React__default.useCallback(
|
|
62
63
|
(payload) => {
|
|
63
64
|
if (isSelected && $isNodeSelection($getSelection())) {
|
|
@@ -218,7 +219,7 @@ function ImageEditor({ src, title, alt, nodeKey, width, height }) {
|
|
|
218
219
|
});
|
|
219
220
|
}
|
|
220
221
|
},
|
|
221
|
-
|
|
222
|
+
iconComponentFor("settings")
|
|
222
223
|
))) : null;
|
|
223
224
|
}
|
|
224
225
|
export {
|
|
@@ -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';
|
|
@@ -88,6 +89,7 @@ export declare const imageSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
88
89
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
89
90
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
90
91
|
onBlur: RealmNode<FocusEvent>;
|
|
92
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
91
93
|
}>], (r: Realm, [{ rootEditor }]: [{
|
|
92
94
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
93
95
|
inFocus: RealmNode<boolean>;
|
|
@@ -143,6 +145,7 @@ export declare const imageSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
143
145
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
144
146
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
145
147
|
onBlur: RealmNode<FocusEvent>;
|
|
148
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
146
149
|
}]) => {
|
|
147
150
|
imageDialogState: RealmNode<InactiveImageDialogState | NewImageDialogState | EditingImageDialogState>;
|
|
148
151
|
saveImage: RealmNode<InsertImageFormValues>;
|
|
@@ -218,6 +221,7 @@ imagePlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
218
221
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
219
222
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
220
223
|
onBlur: RealmNode<FocusEvent>;
|
|
224
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
221
225
|
}>], (r: Realm, [{ rootEditor }]: [{
|
|
222
226
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
223
227
|
inFocus: RealmNode<boolean>;
|
|
@@ -273,6 +277,7 @@ imagePlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
273
277
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
274
278
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
275
279
|
onBlur: RealmNode<FocusEvent>;
|
|
280
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
276
281
|
}]) => {
|
|
277
282
|
imageDialogState: RealmNode<InactiveImageDialogState | NewImageDialogState | EditingImageDialogState>;
|
|
278
283
|
saveImage: RealmNode<InsertImageFormValues>;
|
|
@@ -353,8 +358,9 @@ imagePluginHooks: {
|
|
|
353
358
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
354
359
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
355
360
|
onBlur: RealmNode<FocusEvent>;
|
|
361
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
356
362
|
}>;
|
|
357
|
-
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" | "imageDialogState" | "saveImage" | "openNewImageDialog" | "openEditImageDialog" | "closeImageDialog" | "imageUploadHandler" | "imageAutocompleteSuggestions" | "disableImageResize" | "insertImage" | "imagePreviewHandler">(key: K, callback: (value: ValueForKey<{
|
|
363
|
+
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" | "imageDialogState" | "saveImage" | "openNewImageDialog" | "openEditImageDialog" | "closeImageDialog" | "imageUploadHandler" | "imageAutocompleteSuggestions" | "disableImageResize" | "insertImage" | "imagePreviewHandler">(key: K, callback: (value: ValueForKey<{
|
|
358
364
|
imageDialogState: RealmNode<InactiveImageDialogState | NewImageDialogState | EditingImageDialogState>;
|
|
359
365
|
saveImage: RealmNode<InsertImageFormValues>;
|
|
360
366
|
openNewImageDialog: RealmNode<true>;
|
|
@@ -420,6 +426,7 @@ imagePluginHooks: {
|
|
|
420
426
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
421
427
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
422
428
|
onBlur: RealmNode<FocusEvent>;
|
|
429
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
423
430
|
}, K>) => void) => void;
|
|
424
431
|
useEmitterValues: <K_1 extends SystemKeys<{
|
|
425
432
|
imageDialogState: RealmNode<InactiveImageDialogState | NewImageDialogState | EditingImageDialogState>;
|
|
@@ -487,6 +494,7 @@ imagePluginHooks: {
|
|
|
487
494
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
488
495
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
489
496
|
onBlur: RealmNode<FocusEvent>;
|
|
497
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
490
498
|
}>>(...keys: K_1) => ValuesForKeys<{
|
|
491
499
|
imageDialogState: RealmNode<InactiveImageDialogState | NewImageDialogState | EditingImageDialogState>;
|
|
492
500
|
saveImage: RealmNode<InsertImageFormValues>;
|
|
@@ -553,6 +561,7 @@ imagePluginHooks: {
|
|
|
553
561
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
554
562
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
555
563
|
onBlur: RealmNode<FocusEvent>;
|
|
564
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
556
565
|
}, K_1>;
|
|
557
566
|
usePubKeys: () => (values: SystemDict<{
|
|
558
567
|
imageDialogState: RealmNode<InactiveImageDialogState | NewImageDialogState | EditingImageDialogState>;
|
|
@@ -620,8 +629,9 @@ imagePluginHooks: {
|
|
|
620
629
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
621
630
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
622
631
|
onBlur: RealmNode<FocusEvent>;
|
|
632
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
623
633
|
}>) => void;
|
|
624
|
-
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" | "imageDialogState" | "saveImage" | "openNewImageDialog" | "openEditImageDialog" | "closeImageDialog" | "imageUploadHandler" | "imageAutocompleteSuggestions" | "disableImageResize" | "insertImage" | "imagePreviewHandler">(key: K_2) => (value: ValueForKey<{
|
|
634
|
+
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" | "imageDialogState" | "saveImage" | "openNewImageDialog" | "openEditImageDialog" | "closeImageDialog" | "imageUploadHandler" | "imageAutocompleteSuggestions" | "disableImageResize" | "insertImage" | "imagePreviewHandler">(key: K_2) => (value: ValueForKey<{
|
|
625
635
|
imageDialogState: RealmNode<InactiveImageDialogState | NewImageDialogState | EditingImageDialogState>;
|
|
626
636
|
saveImage: RealmNode<InsertImageFormValues>;
|
|
627
637
|
openNewImageDialog: RealmNode<true>;
|
|
@@ -687,6 +697,7 @@ imagePluginHooks: {
|
|
|
687
697
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
688
698
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
689
699
|
onBlur: RealmNode<FocusEvent>;
|
|
700
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
690
701
|
}, K_2>) => void;
|
|
691
702
|
};
|
|
692
703
|
/** @internal */
|
|
@@ -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';
|
|
@@ -142,6 +143,7 @@ export declare const jsxSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
142
143
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
143
144
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
144
145
|
onBlur: RealmNode<FocusEvent>;
|
|
146
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
145
147
|
}>], (r: Realm, [{ insertDecoratorNode }]: [{
|
|
146
148
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
147
149
|
inFocus: RealmNode<boolean>;
|
|
@@ -197,6 +199,7 @@ export declare const jsxSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
197
199
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
198
200
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
199
201
|
onBlur: RealmNode<FocusEvent>;
|
|
202
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
200
203
|
}]) => {
|
|
201
204
|
insertJsx: RealmNode<InsertJsxPayload>;
|
|
202
205
|
}>;
|
|
@@ -266,6 +269,7 @@ jsxPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
266
269
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
267
270
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
268
271
|
onBlur: RealmNode<FocusEvent>;
|
|
272
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
269
273
|
}>], (r: Realm, [{ insertDecoratorNode }]: [{
|
|
270
274
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
271
275
|
inFocus: RealmNode<boolean>;
|
|
@@ -321,6 +325,7 @@ jsxPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
321
325
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
322
326
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
323
327
|
onBlur: RealmNode<FocusEvent>;
|
|
328
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
324
329
|
}]) => {
|
|
325
330
|
insertJsx: RealmNode<InsertJsxPayload>;
|
|
326
331
|
}>, JsxPluginParams>,
|
|
@@ -383,8 +388,9 @@ jsxPluginHooks: {
|
|
|
383
388
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
384
389
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
385
390
|
onBlur: RealmNode<FocusEvent>;
|
|
391
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
386
392
|
}>;
|
|
387
|
-
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" | "insertJsx">(key: K, callback: (value: ValueForKey<{
|
|
393
|
+
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" | "insertJsx">(key: K, callback: (value: ValueForKey<{
|
|
388
394
|
insertJsx: RealmNode<InsertJsxPayload>;
|
|
389
395
|
} & {
|
|
390
396
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
@@ -441,6 +447,7 @@ jsxPluginHooks: {
|
|
|
441
447
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
442
448
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
443
449
|
onBlur: RealmNode<FocusEvent>;
|
|
450
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
444
451
|
}, K>) => void) => void;
|
|
445
452
|
useEmitterValues: <K_1 extends SystemKeys<{
|
|
446
453
|
insertJsx: RealmNode<InsertJsxPayload>;
|
|
@@ -499,6 +506,7 @@ jsxPluginHooks: {
|
|
|
499
506
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
500
507
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
501
508
|
onBlur: RealmNode<FocusEvent>;
|
|
509
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
502
510
|
}>>(...keys: K_1) => ValuesForKeys<{
|
|
503
511
|
insertJsx: RealmNode<InsertJsxPayload>;
|
|
504
512
|
} & {
|
|
@@ -556,6 +564,7 @@ jsxPluginHooks: {
|
|
|
556
564
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
557
565
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
558
566
|
onBlur: RealmNode<FocusEvent>;
|
|
567
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
559
568
|
}, K_1>;
|
|
560
569
|
usePubKeys: () => (values: SystemDict<{
|
|
561
570
|
insertJsx: RealmNode<InsertJsxPayload>;
|
|
@@ -614,8 +623,9 @@ jsxPluginHooks: {
|
|
|
614
623
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
615
624
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
616
625
|
onBlur: RealmNode<FocusEvent>;
|
|
626
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
617
627
|
}>) => void;
|
|
618
|
-
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" | "insertJsx">(key: K_2) => (value: ValueForKey<{
|
|
628
|
+
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" | "insertJsx">(key: K_2) => (value: ValueForKey<{
|
|
619
629
|
insertJsx: RealmNode<InsertJsxPayload>;
|
|
620
630
|
} & {
|
|
621
631
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
@@ -672,6 +682,7 @@ jsxPluginHooks: {
|
|
|
672
682
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
673
683
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
674
684
|
onBlur: RealmNode<FocusEvent>;
|
|
685
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
675
686
|
}, K_2>) => void;
|
|
676
687
|
};
|
|
677
688
|
export {};
|
|
@@ -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';
|
|
@@ -84,6 +85,7 @@ export declare const linkPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r
|
|
|
84
85
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
85
86
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
86
87
|
onBlur: RealmNode<FocusEvent>;
|
|
88
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
87
89
|
}>], (r: Realm) => {
|
|
88
90
|
disableAutoLink: RealmNode<boolean>;
|
|
89
91
|
}>, LinkPluginParams>;
|