@mdxeditor/editor 1.9.2 → 1.10.0
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/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 +2 -1
- 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';
|
|
@@ -120,6 +121,7 @@ export declare const codeBlockSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
120
121
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
121
122
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
122
123
|
onBlur: RealmNode<FocusEvent>;
|
|
124
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
123
125
|
}>], (r: Realm, [{ insertDecoratorNode }]: [{
|
|
124
126
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
125
127
|
inFocus: RealmNode<boolean>;
|
|
@@ -175,6 +177,7 @@ export declare const codeBlockSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
175
177
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
176
178
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
177
179
|
onBlur: RealmNode<FocusEvent>;
|
|
180
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
178
181
|
}]) => {
|
|
179
182
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
180
183
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -253,6 +256,7 @@ codeBlockPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
253
256
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
254
257
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
255
258
|
onBlur: RealmNode<FocusEvent>;
|
|
259
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
256
260
|
}>], (r: Realm, [{ insertDecoratorNode }]: [{
|
|
257
261
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
258
262
|
inFocus: RealmNode<boolean>;
|
|
@@ -308,6 +312,7 @@ codeBlockPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
308
312
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
309
313
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
310
314
|
onBlur: RealmNode<FocusEvent>;
|
|
315
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
311
316
|
}]) => {
|
|
312
317
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
313
318
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -378,8 +383,9 @@ codeBlockPluginHooks: {
|
|
|
378
383
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
379
384
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
380
385
|
onBlur: RealmNode<FocusEvent>;
|
|
386
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
381
387
|
}>;
|
|
382
|
-
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">(key: K, callback: (value: ValueForKey<{
|
|
388
|
+
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">(key: K, callback: (value: ValueForKey<{
|
|
383
389
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
384
390
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
385
391
|
appendCodeBlockEditorDescriptor: RealmNode<CodeBlockEditorDescriptor>;
|
|
@@ -439,6 +445,7 @@ codeBlockPluginHooks: {
|
|
|
439
445
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
440
446
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
441
447
|
onBlur: RealmNode<FocusEvent>;
|
|
448
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
442
449
|
}, K>) => void) => void;
|
|
443
450
|
useEmitterValues: <K_1 extends SystemKeys<{
|
|
444
451
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
@@ -500,6 +507,7 @@ codeBlockPluginHooks: {
|
|
|
500
507
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
501
508
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
502
509
|
onBlur: RealmNode<FocusEvent>;
|
|
510
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
503
511
|
}>>(...keys: K_1) => ValuesForKeys<{
|
|
504
512
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
505
513
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -560,6 +568,7 @@ codeBlockPluginHooks: {
|
|
|
560
568
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
561
569
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
562
570
|
onBlur: RealmNode<FocusEvent>;
|
|
571
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
563
572
|
}, K_1>;
|
|
564
573
|
usePubKeys: () => (values: SystemDict<{
|
|
565
574
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
@@ -621,8 +630,9 @@ codeBlockPluginHooks: {
|
|
|
621
630
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
622
631
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
623
632
|
onBlur: RealmNode<FocusEvent>;
|
|
633
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
624
634
|
}>) => void;
|
|
625
|
-
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">(key: K_2) => (value: ValueForKey<{
|
|
635
|
+
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">(key: K_2) => (value: ValueForKey<{
|
|
626
636
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
627
637
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
628
638
|
appendCodeBlockEditorDescriptor: RealmNode<CodeBlockEditorDescriptor>;
|
|
@@ -682,5 +692,6 @@ codeBlockPluginHooks: {
|
|
|
682
692
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
683
693
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
684
694
|
onBlur: RealmNode<FocusEvent>;
|
|
695
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
685
696
|
}, K_2>) => void;
|
|
686
697
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CodeBlockEditorDescriptor, CreateCodeBlockNodeOptions } from '../codeblock';
|
|
2
|
+
import type { IconKey } from '../core/Icon';
|
|
2
3
|
import type { RefObject, ReactNode, ComponentType } from 'react';
|
|
3
4
|
import type { Options } from 'mdast-util-to-markdown';
|
|
4
5
|
import type { Config } from 'mdast-util-from-markdown/lib';
|
|
@@ -68,6 +69,7 @@ export declare const codeMirrorSystem: 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
|
}>, SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
72
74
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
73
75
|
inFocus: RealmNode<boolean>;
|
|
@@ -123,6 +125,7 @@ export declare const codeMirrorSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
123
125
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
124
126
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
125
127
|
onBlur: RealmNode<FocusEvent>;
|
|
128
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
126
129
|
}>], (r: Realm, [{ insertDecoratorNode }]: [{
|
|
127
130
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
128
131
|
inFocus: RealmNode<boolean>;
|
|
@@ -178,6 +181,7 @@ export declare const codeMirrorSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
178
181
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
179
182
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
180
183
|
onBlur: RealmNode<FocusEvent>;
|
|
184
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
181
185
|
}]) => {
|
|
182
186
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
183
187
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -238,6 +242,7 @@ export declare const codeMirrorSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
238
242
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
239
243
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
240
244
|
onBlur: RealmNode<FocusEvent>;
|
|
245
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
241
246
|
}, {
|
|
242
247
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
243
248
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -307,6 +312,7 @@ codeMirrorPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
307
312
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
308
313
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
309
314
|
onBlur: RealmNode<FocusEvent>;
|
|
315
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
310
316
|
}>, SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
311
317
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
312
318
|
inFocus: RealmNode<boolean>;
|
|
@@ -362,6 +368,7 @@ codeMirrorPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
362
368
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
363
369
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
364
370
|
onBlur: RealmNode<FocusEvent>;
|
|
371
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
365
372
|
}>], (r: Realm, [{ insertDecoratorNode }]: [{
|
|
366
373
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
367
374
|
inFocus: RealmNode<boolean>;
|
|
@@ -417,6 +424,7 @@ codeMirrorPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
417
424
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
418
425
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
419
426
|
onBlur: RealmNode<FocusEvent>;
|
|
427
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
420
428
|
}]) => {
|
|
421
429
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
422
430
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -477,6 +485,7 @@ codeMirrorPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
477
485
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
478
486
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
479
487
|
onBlur: RealmNode<FocusEvent>;
|
|
488
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
480
489
|
}, {
|
|
481
490
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
482
491
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -554,13 +563,14 @@ codeMirrorHooks: {
|
|
|
554
563
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
555
564
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
556
565
|
onBlur: RealmNode<FocusEvent>;
|
|
566
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
557
567
|
} & {
|
|
558
568
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
559
569
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
560
570
|
appendCodeBlockEditorDescriptor: RealmNode<CodeBlockEditorDescriptor>;
|
|
561
571
|
insertCodeBlock: RealmNode<Partial<CreateCodeBlockNodeOptions>>;
|
|
562
572
|
}>;
|
|
563
|
-
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" | "codeBlockLanguages" | "insertCodeMirror">(key: K, callback: (value: ValueForKey<{
|
|
573
|
+
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" | "codeBlockLanguages" | "insertCodeMirror">(key: K, callback: (value: ValueForKey<{
|
|
564
574
|
codeBlockLanguages: RealmNode<Record<string, string>>;
|
|
565
575
|
insertCodeMirror: RealmNode<{
|
|
566
576
|
language: string;
|
|
@@ -621,6 +631,7 @@ codeMirrorHooks: {
|
|
|
621
631
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
622
632
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
623
633
|
onBlur: RealmNode<FocusEvent>;
|
|
634
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
624
635
|
} & {
|
|
625
636
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
626
637
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -688,6 +699,7 @@ codeMirrorHooks: {
|
|
|
688
699
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
689
700
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
690
701
|
onBlur: RealmNode<FocusEvent>;
|
|
702
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
691
703
|
} & {
|
|
692
704
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
693
705
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -754,6 +766,7 @@ codeMirrorHooks: {
|
|
|
754
766
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
755
767
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
756
768
|
onBlur: RealmNode<FocusEvent>;
|
|
769
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
757
770
|
} & {
|
|
758
771
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
759
772
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -821,13 +834,14 @@ codeMirrorHooks: {
|
|
|
821
834
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
822
835
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
823
836
|
onBlur: RealmNode<FocusEvent>;
|
|
837
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
824
838
|
} & {
|
|
825
839
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
826
840
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
827
841
|
appendCodeBlockEditorDescriptor: RealmNode<CodeBlockEditorDescriptor>;
|
|
828
842
|
insertCodeBlock: RealmNode<Partial<CreateCodeBlockNodeOptions>>;
|
|
829
843
|
}>) => void;
|
|
830
|
-
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" | "codeBlockLanguages" | "insertCodeMirror">(key: K_2) => (value: ValueForKey<{
|
|
844
|
+
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" | "codeBlockLanguages" | "insertCodeMirror">(key: K_2) => (value: ValueForKey<{
|
|
831
845
|
codeBlockLanguages: RealmNode<Record<string, string>>;
|
|
832
846
|
insertCodeMirror: RealmNode<{
|
|
833
847
|
language: string;
|
|
@@ -888,6 +902,7 @@ codeMirrorHooks: {
|
|
|
888
902
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
889
903
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
890
904
|
onBlur: RealmNode<FocusEvent>;
|
|
905
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
891
906
|
} & {
|
|
892
907
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
893
908
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type IconKey = 'add_column' | 'add_photo' | 'add_row' | 'arrow_drop_down' | 'check' | 'check_small' | 'close' | 'code' | 'content_copy' | 'delete_big' | 'delete_small' | 'sandpack' | 'difference' | 'edit' | 'admonition' | 'extension' | 'format_align_center' | 'format_align_left' | 'format_align_right' | 'format_bold' | 'format_italic' | 'format_list_bulleted' | 'format_list_checked' | 'format_list_numbered' | 'format_underlined' | 'frame_source' | 'frontmatter' | 'horizontal_rule' | 'insert_col_left' | 'insert_col_right' | 'insert_row_above' | 'insert_row_below' | 'link' | 'link_off' | 'markdown' | 'more_horiz' | 'more_vert' | 'open_in_new' | 'redo' | 'rich_text' | 'settings' | 'table' | 'undo';
|
|
3
|
+
declare const Icon: React.FC<{
|
|
4
|
+
name: IconKey;
|
|
5
|
+
}>;
|
|
6
|
+
export default Icon;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import React__default from "react";
|
|
2
|
+
import SvgAddColumn from "../../icons/add_column.svg.js";
|
|
3
|
+
import SvgAddPhoto from "../../icons/add_photo.svg.js";
|
|
4
|
+
import SvgAddRow from "../../icons/add_row.svg.js";
|
|
5
|
+
import SvgArrowDropDown from "../../icons/arrow_drop_down.svg.js";
|
|
6
|
+
import SvgCheck from "../../icons/check.svg.js";
|
|
7
|
+
import SvgCheckSmall from "../../icons/check_small.svg.js";
|
|
8
|
+
import SvgClose from "../../icons/close.svg.js";
|
|
9
|
+
import SvgCode from "../../icons/code.svg.js";
|
|
10
|
+
import SvgContentCopy from "../../icons/content_copy.svg.js";
|
|
11
|
+
import SvgDeleteBig from "../../icons/delete_big.svg.js";
|
|
12
|
+
import SvgDeleteSmall from "../../icons/delete_small.svg.js";
|
|
13
|
+
import SvgSandpack from "../../icons/sandpack.svg.js";
|
|
14
|
+
import SvgDifference from "../../icons/difference.svg.js";
|
|
15
|
+
import SvgEdit from "../../icons/edit.svg.js";
|
|
16
|
+
import SvgAdmonition from "../../icons/admonition.svg.js";
|
|
17
|
+
import SvgExtension from "../../icons/extension.svg.js";
|
|
18
|
+
import SvgFormatAlignCenter from "../../icons/format_align_center.svg.js";
|
|
19
|
+
import SvgFormatAlignLeft from "../../icons/format_align_left.svg.js";
|
|
20
|
+
import SvgFormatAlignRight from "../../icons/format_align_right.svg.js";
|
|
21
|
+
import SvgFormatBold from "../../icons/format_bold.svg.js";
|
|
22
|
+
import SvgFormatItalic from "../../icons/format_italic.svg.js";
|
|
23
|
+
import SvgFormatListBulleted from "../../icons/format_list_bulleted.svg.js";
|
|
24
|
+
import SvgFormatListChecked from "../../icons/format_list_checked.svg.js";
|
|
25
|
+
import SvgFormatListNumbered from "../../icons/format_list_numbered.svg.js";
|
|
26
|
+
import SvgFormatUnderlined from "../../icons/format_underlined.svg.js";
|
|
27
|
+
import SvgFrameSource from "../../icons/frame_source.svg.js";
|
|
28
|
+
import SvgFrontmatter from "../../icons/frontmatter.svg.js";
|
|
29
|
+
import SvgHorizontalRule from "../../icons/horizontal_rule.svg.js";
|
|
30
|
+
import SvgInsertColLeft from "../../icons/insert_col_left.svg.js";
|
|
31
|
+
import SvgInsertColRight from "../../icons/insert_col_right.svg.js";
|
|
32
|
+
import SvgInsertRowAbove from "../../icons/insert_row_above.svg.js";
|
|
33
|
+
import SvgInsertRowBelow from "../../icons/insert_row_below.svg.js";
|
|
34
|
+
import SvgLink from "../../icons/link.svg.js";
|
|
35
|
+
import SvgLinkOff from "../../icons/link_off.svg.js";
|
|
36
|
+
import SvgMarkdown from "../../icons/markdown.svg.js";
|
|
37
|
+
import SvgMoreHoriz from "../../icons/more_horiz.svg.js";
|
|
38
|
+
import SvgMoreVert from "../../icons/more_vert.svg.js";
|
|
39
|
+
import SvgOpenInNew from "../../icons/open_in_new.svg.js";
|
|
40
|
+
import SvgRedo from "../../icons/redo.svg.js";
|
|
41
|
+
import SvgRichText from "../../icons/rich_text.svg.js";
|
|
42
|
+
import SvgSettings from "../../icons/settings.svg.js";
|
|
43
|
+
import SvgTable from "../../icons/table.svg.js";
|
|
44
|
+
import SvgUndo from "../../icons/undo.svg.js";
|
|
45
|
+
const IconMap = {
|
|
46
|
+
add_column: SvgAddColumn,
|
|
47
|
+
add_photo: SvgAddPhoto,
|
|
48
|
+
add_row: SvgAddRow,
|
|
49
|
+
arrow_drop_down: SvgArrowDropDown,
|
|
50
|
+
check: SvgCheck,
|
|
51
|
+
check_small: SvgCheckSmall,
|
|
52
|
+
close: SvgClose,
|
|
53
|
+
code: SvgCode,
|
|
54
|
+
content_copy: SvgContentCopy,
|
|
55
|
+
delete_big: SvgDeleteBig,
|
|
56
|
+
delete_small: SvgDeleteSmall,
|
|
57
|
+
sandpack: SvgSandpack,
|
|
58
|
+
difference: SvgDifference,
|
|
59
|
+
edit: SvgEdit,
|
|
60
|
+
admonition: SvgAdmonition,
|
|
61
|
+
extension: SvgExtension,
|
|
62
|
+
format_align_center: SvgFormatAlignCenter,
|
|
63
|
+
format_align_left: SvgFormatAlignLeft,
|
|
64
|
+
format_align_right: SvgFormatAlignRight,
|
|
65
|
+
format_bold: SvgFormatBold,
|
|
66
|
+
format_italic: SvgFormatItalic,
|
|
67
|
+
format_list_bulleted: SvgFormatListBulleted,
|
|
68
|
+
format_list_checked: SvgFormatListChecked,
|
|
69
|
+
format_list_numbered: SvgFormatListNumbered,
|
|
70
|
+
format_underlined: SvgFormatUnderlined,
|
|
71
|
+
frame_source: SvgFrameSource,
|
|
72
|
+
frontmatter: SvgFrontmatter,
|
|
73
|
+
horizontal_rule: SvgHorizontalRule,
|
|
74
|
+
insert_col_left: SvgInsertColLeft,
|
|
75
|
+
insert_col_right: SvgInsertColRight,
|
|
76
|
+
insert_row_above: SvgInsertRowAbove,
|
|
77
|
+
insert_row_below: SvgInsertRowBelow,
|
|
78
|
+
link: SvgLink,
|
|
79
|
+
link_off: SvgLinkOff,
|
|
80
|
+
markdown: SvgMarkdown,
|
|
81
|
+
more_horiz: SvgMoreHoriz,
|
|
82
|
+
more_vert: SvgMoreVert,
|
|
83
|
+
open_in_new: SvgOpenInNew,
|
|
84
|
+
redo: SvgRedo,
|
|
85
|
+
rich_text: SvgRichText,
|
|
86
|
+
settings: SvgSettings,
|
|
87
|
+
table: SvgTable,
|
|
88
|
+
undo: SvgUndo
|
|
89
|
+
};
|
|
90
|
+
const Icon = ({ name }) => {
|
|
91
|
+
const IconComponent = IconMap[name];
|
|
92
|
+
return /* @__PURE__ */ React__default.createElement(IconComponent, null);
|
|
93
|
+
};
|
|
94
|
+
export {
|
|
95
|
+
Icon as default
|
|
96
|
+
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import * as RadixPopover from "@radix-ui/react-popover";
|
|
2
2
|
import React__default from "react";
|
|
3
3
|
import { useForm } from "react-hook-form";
|
|
4
|
-
import SettingsIcon from "../../icons/settings.svg.js";
|
|
5
4
|
import styles from "../../styles/ui.module.css.js";
|
|
6
5
|
import { PopoverPortal, PopoverContent } from "./ui/PopoverUtils.js";
|
|
6
|
+
import { corePluginHooks } from "./index.js";
|
|
7
7
|
const PropertyPopover = ({ title, properties, onChange }) => {
|
|
8
8
|
const [open, setOpen] = React__default.useState(false);
|
|
9
|
+
const [iconComponentFor] = corePluginHooks.useEmitterValues("iconComponentFor");
|
|
9
10
|
const { register, handleSubmit, reset } = useForm({ defaultValues: properties });
|
|
10
|
-
return /* @__PURE__ */ React__default.createElement(RadixPopover.Root, { open, onOpenChange: (v) => setOpen(v) }, /* @__PURE__ */ React__default.createElement(RadixPopover.Trigger, { className: styles.iconButton }, /* @__PURE__ */ React__default.createElement(
|
|
11
|
+
return /* @__PURE__ */ React__default.createElement(RadixPopover.Root, { open, onOpenChange: (v) => setOpen(v) }, /* @__PURE__ */ React__default.createElement(RadixPopover.Trigger, { className: styles.iconButton }, /* @__PURE__ */ React__default.createElement("div", null, iconComponentFor("settings"))), /* @__PURE__ */ React__default.createElement(PopoverPortal, null, /* @__PURE__ */ React__default.createElement(PopoverContent, null, /* @__PURE__ */ React__default.createElement(
|
|
11
12
|
"form",
|
|
12
13
|
{
|
|
13
14
|
onSubmit: (e) => {
|
|
@@ -11,6 +11,7 @@ import type { LexicalVisitor, LexicalConvertOptions } from '../../exportMarkdown
|
|
|
11
11
|
import type { SystemSpec, Realm, PluginConstructor, TypedRealm, ValueForKey, SystemKeys, ValuesForKeys, SystemDict, RealmNode } from '../../gurx';
|
|
12
12
|
import { MdastImportVisitor } from '../../importMarkdownToLexical';
|
|
13
13
|
import type { JsxComponentDescriptor } from '../jsx';
|
|
14
|
+
import { type IconKey } from './Icon';
|
|
14
15
|
/** @internal */
|
|
15
16
|
export type EditorSubscription = (activeEditor: LexicalEditor) => () => void;
|
|
16
17
|
/** @internal */
|
|
@@ -83,6 +84,7 @@ export declare const coreSystem: SystemSpec<[], (r: Realm) => {
|
|
|
83
84
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
84
85
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
85
86
|
onBlur: RealmNode<FocusEvent>;
|
|
87
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
86
88
|
}>;
|
|
87
89
|
interface CorePluginParams {
|
|
88
90
|
initialMarkdown: string;
|
|
@@ -96,6 +98,7 @@ interface CorePluginParams {
|
|
|
96
98
|
onBlur?: (e: FocusEvent) => void;
|
|
97
99
|
toMarkdownOptions: NonNullable<LexicalConvertOptions['toMarkdownOptions']>;
|
|
98
100
|
readOnly: boolean;
|
|
101
|
+
iconComponentFor: (name: IconKey) => React.ReactElement;
|
|
99
102
|
}
|
|
100
103
|
export declare const
|
|
101
104
|
/** @internal */
|
|
@@ -154,6 +157,7 @@ corePlugin: PluginConstructor<SystemSpec<[], (r: Realm) => {
|
|
|
154
157
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
155
158
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
156
159
|
onBlur: RealmNode<FocusEvent>;
|
|
160
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
157
161
|
}>, CorePluginParams>,
|
|
158
162
|
/** @internal */
|
|
159
163
|
corePluginHooks: {
|
|
@@ -212,8 +216,9 @@ corePluginHooks: {
|
|
|
212
216
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
213
217
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
214
218
|
onBlur: RealmNode<FocusEvent>;
|
|
219
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
215
220
|
}>;
|
|
216
|
-
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<{
|
|
221
|
+
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<{
|
|
217
222
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
218
223
|
inFocus: RealmNode<boolean>;
|
|
219
224
|
historyState: RealmNode<HistoryState>;
|
|
@@ -268,6 +273,7 @@ corePluginHooks: {
|
|
|
268
273
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
269
274
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
270
275
|
onBlur: RealmNode<FocusEvent>;
|
|
276
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
271
277
|
}, K>) => void) => void;
|
|
272
278
|
useEmitterValues: <K_1 extends SystemKeys<{
|
|
273
279
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
@@ -324,6 +330,7 @@ corePluginHooks: {
|
|
|
324
330
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
325
331
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
326
332
|
onBlur: RealmNode<FocusEvent>;
|
|
333
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
327
334
|
}>>(...keys: K_1) => ValuesForKeys<{
|
|
328
335
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
329
336
|
inFocus: RealmNode<boolean>;
|
|
@@ -379,6 +386,7 @@ corePluginHooks: {
|
|
|
379
386
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
380
387
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
381
388
|
onBlur: RealmNode<FocusEvent>;
|
|
389
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
382
390
|
}, K_1>;
|
|
383
391
|
usePubKeys: () => (values: SystemDict<{
|
|
384
392
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
@@ -435,8 +443,9 @@ corePluginHooks: {
|
|
|
435
443
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
436
444
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
437
445
|
onBlur: RealmNode<FocusEvent>;
|
|
446
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
438
447
|
}>) => void;
|
|
439
|
-
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<{
|
|
448
|
+
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<{
|
|
440
449
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
441
450
|
inFocus: RealmNode<boolean>;
|
|
442
451
|
historyState: RealmNode<HistoryState>;
|
|
@@ -491,6 +500,7 @@ corePluginHooks: {
|
|
|
491
500
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
492
501
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
493
502
|
onBlur: RealmNode<FocusEvent>;
|
|
503
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
494
504
|
}, K_2>) => void;
|
|
495
505
|
};
|
|
496
506
|
export {};
|
|
@@ -53,6 +53,9 @@ const coreSystem = system((r) => {
|
|
|
53
53
|
const rootEditorSubscriptions = r.node([]);
|
|
54
54
|
const editorInFocus = r.node(null);
|
|
55
55
|
const onBlur = r.node();
|
|
56
|
+
const iconComponentFor = r.node((name) => {
|
|
57
|
+
throw new Error(`No icon component for ${name}`);
|
|
58
|
+
});
|
|
56
59
|
const rebind = () => r.o.scan((teardowns, [subs, activeEditorValue]) => {
|
|
57
60
|
teardowns.forEach((teardown) => {
|
|
58
61
|
if (!teardown) {
|
|
@@ -297,7 +300,7 @@ const coreSystem = system((r) => {
|
|
|
297
300
|
} else {
|
|
298
301
|
$insertNodeToNearestRoot(node);
|
|
299
302
|
}
|
|
300
|
-
if (
|
|
303
|
+
if ("select" in node && typeof node.select === "function") {
|
|
301
304
|
setTimeout(() => node.select());
|
|
302
305
|
}
|
|
303
306
|
});
|
|
@@ -368,7 +371,8 @@ const coreSystem = system((r) => {
|
|
|
368
371
|
convertSelectionToNode,
|
|
369
372
|
insertDecoratorNode,
|
|
370
373
|
// Events
|
|
371
|
-
onBlur
|
|
374
|
+
onBlur,
|
|
375
|
+
iconComponentFor
|
|
372
376
|
};
|
|
373
377
|
}, []);
|
|
374
378
|
const [
|
|
@@ -392,6 +396,7 @@ const [
|
|
|
392
396
|
},
|
|
393
397
|
init(realm, params) {
|
|
394
398
|
realm.pubKey("initialMarkdown", params.initialMarkdown.trim());
|
|
399
|
+
realm.pubKey("iconComponentFor", params.iconComponentFor);
|
|
395
400
|
realm.pubKey("addImportVisitor", MdastRootVisitor);
|
|
396
401
|
realm.pubKey("addImportVisitor", MdastParagraphVisitor);
|
|
397
402
|
realm.pubKey("addImportVisitor", MdastTextVisitor);
|
|
@@ -2,7 +2,7 @@ import { useCombobox } from "downshift";
|
|
|
2
2
|
import React__default from "react";
|
|
3
3
|
import { Controller } from "react-hook-form";
|
|
4
4
|
import styles from "../../../styles/ui.module.css.js";
|
|
5
|
-
import
|
|
5
|
+
import { corePluginHooks } from "../index.js";
|
|
6
6
|
const MAX_SUGGESTIONS = 20;
|
|
7
7
|
const DownshiftAutoComplete = (props) => {
|
|
8
8
|
if (props.suggestions.length > 0) {
|
|
@@ -21,6 +21,7 @@ const DownshiftAutoCompleteWithSuggestions = ({
|
|
|
21
21
|
setValue
|
|
22
22
|
}) => {
|
|
23
23
|
const [items, setItems] = React__default.useState(suggestions.slice(0, MAX_SUGGESTIONS));
|
|
24
|
+
const [iconComponentFor] = corePluginHooks.useEmitterValues("iconComponentFor");
|
|
24
25
|
const enableAutoComplete = suggestions.length > 0;
|
|
25
26
|
const { isOpen, getToggleButtonProps, getMenuProps, getInputProps, highlightedIndex, getItemProps, selectedItem } = useCombobox({
|
|
26
27
|
initialInputValue,
|
|
@@ -65,7 +66,7 @@ const DownshiftAutoCompleteWithSuggestions = ({
|
|
|
65
66
|
);
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
|
-
), enableAutoComplete && /* @__PURE__ */ React__default.createElement("button", { "aria-label": "toggle menu", type: "button", ...getToggleButtonProps() },
|
|
69
|
+
), enableAutoComplete && /* @__PURE__ */ React__default.createElement("button", { "aria-label": "toggle menu", type: "button", ...getToggleButtonProps() }, iconComponentFor("arrow_drop_down"))), /* @__PURE__ */ React__default.createElement("div", { className: styles.downshiftAutocompleteContainer }, /* @__PURE__ */ React__default.createElement("ul", { ...getMenuProps(), "data-visible": dropdownIsVisible }, items.map((item, index) => /* @__PURE__ */ React__default.createElement(
|
|
69
70
|
"li",
|
|
70
71
|
{
|
|
71
72
|
"data-selected": selectedItem === item,
|
|
@@ -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';
|
|
@@ -70,6 +71,7 @@ export declare const diffSourceSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
70
71
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
71
72
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
72
73
|
onBlur: RealmNode<FocusEvent>;
|
|
74
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
73
75
|
}>], (r: Realm, [{ markdown, setMarkdown }]: [{
|
|
74
76
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
75
77
|
inFocus: RealmNode<boolean>;
|
|
@@ -125,6 +127,7 @@ export declare const diffSourceSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
125
127
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
126
128
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
127
129
|
onBlur: RealmNode<FocusEvent>;
|
|
130
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
128
131
|
}]) => {
|
|
129
132
|
viewMode: RealmNode<ViewMode>;
|
|
130
133
|
diffMarkdown: RealmNode<string>;
|
|
@@ -193,6 +196,7 @@ diffSourcePlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
193
196
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
194
197
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
195
198
|
onBlur: RealmNode<FocusEvent>;
|
|
199
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
196
200
|
}>], (r: Realm, [{ markdown, setMarkdown }]: [{
|
|
197
201
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
198
202
|
inFocus: RealmNode<boolean>;
|
|
@@ -248,6 +252,7 @@ diffSourcePlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
248
252
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
249
253
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
250
254
|
onBlur: RealmNode<FocusEvent>;
|
|
255
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
251
256
|
}]) => {
|
|
252
257
|
viewMode: RealmNode<ViewMode>;
|
|
253
258
|
diffMarkdown: RealmNode<string>;
|
|
@@ -316,8 +321,9 @@ diffSourcePluginHooks: {
|
|
|
316
321
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
317
322
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
318
323
|
onBlur: RealmNode<FocusEvent>;
|
|
324
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
319
325
|
}>;
|
|
320
|
-
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" | "markdownSourceEditorValue" | "viewMode" | "diffMarkdown" | "cmExtensions">(key: K, callback: (value: ValueForKey<{
|
|
326
|
+
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" | "markdownSourceEditorValue" | "viewMode" | "diffMarkdown" | "cmExtensions">(key: K, callback: (value: ValueForKey<{
|
|
321
327
|
viewMode: RealmNode<ViewMode>;
|
|
322
328
|
diffMarkdown: RealmNode<string>;
|
|
323
329
|
markdownSourceEditorValue: RealmNode<string>;
|
|
@@ -377,6 +383,7 @@ diffSourcePluginHooks: {
|
|
|
377
383
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
378
384
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
379
385
|
onBlur: RealmNode<FocusEvent>;
|
|
386
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
380
387
|
}, K>) => void) => void;
|
|
381
388
|
useEmitterValues: <K_1 extends SystemKeys<{
|
|
382
389
|
viewMode: RealmNode<ViewMode>;
|
|
@@ -438,6 +445,7 @@ diffSourcePluginHooks: {
|
|
|
438
445
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
439
446
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
440
447
|
onBlur: RealmNode<FocusEvent>;
|
|
448
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
441
449
|
}>>(...keys: K_1) => ValuesForKeys<{
|
|
442
450
|
viewMode: RealmNode<ViewMode>;
|
|
443
451
|
diffMarkdown: RealmNode<string>;
|
|
@@ -498,6 +506,7 @@ diffSourcePluginHooks: {
|
|
|
498
506
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
499
507
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
500
508
|
onBlur: RealmNode<FocusEvent>;
|
|
509
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
501
510
|
}, K_1>;
|
|
502
511
|
usePubKeys: () => (values: SystemDict<{
|
|
503
512
|
viewMode: RealmNode<ViewMode>;
|
|
@@ -559,8 +568,9 @@ diffSourcePluginHooks: {
|
|
|
559
568
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
560
569
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
561
570
|
onBlur: RealmNode<FocusEvent>;
|
|
571
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
562
572
|
}>) => void;
|
|
563
|
-
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" | "markdownSourceEditorValue" | "viewMode" | "diffMarkdown" | "cmExtensions">(key: K_2) => (value: ValueForKey<{
|
|
573
|
+
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" | "markdownSourceEditorValue" | "viewMode" | "diffMarkdown" | "cmExtensions">(key: K_2) => (value: ValueForKey<{
|
|
564
574
|
viewMode: RealmNode<ViewMode>;
|
|
565
575
|
diffMarkdown: RealmNode<string>;
|
|
566
576
|
markdownSourceEditorValue: RealmNode<string>;
|
|
@@ -620,5 +630,6 @@ diffSourcePluginHooks: {
|
|
|
620
630
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
621
631
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
622
632
|
onBlur: RealmNode<FocusEvent>;
|
|
633
|
+
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
623
634
|
}, K_2>) => void;
|
|
624
635
|
};
|