@mdxeditor/editor 0.0.0-development → 0.0.4-development
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 +11 -0
- package/dist/MDXEditor.js +3 -1
- package/dist/exportMarkdownFromLexical.d.ts +6 -1
- package/dist/exportMarkdownFromLexical.js +43 -6
- package/dist/gurx/realmFactory.d.ts +1 -1
- package/dist/icons/add_column.svg.js +1 -1
- package/dist/icons/add_photo.svg.js +1 -1
- package/dist/icons/add_row.svg.js +1 -1
- package/dist/icons/admonition.svg.js +1 -1
- package/dist/icons/arrow_drop_down.svg.js +1 -1
- package/dist/icons/check.svg.js +1 -1
- package/dist/icons/close.svg.js +1 -1
- package/dist/icons/code.svg.js +1 -1
- package/dist/icons/content_copy.svg.js +1 -1
- package/dist/icons/delete_big.svg.js +1 -1
- package/dist/icons/delete_small.svg.js +1 -1
- package/dist/icons/difference.svg.js +1 -1
- package/dist/icons/edit.svg.js +1 -1
- package/dist/icons/format_align_center.svg.js +1 -1
- package/dist/icons/format_align_left.svg.js +1 -1
- package/dist/icons/format_align_right.svg.js +1 -1
- package/dist/icons/format_bold.svg.js +1 -1
- package/dist/icons/format_italic.svg.js +1 -1
- package/dist/icons/format_list_bulleted.svg.js +1 -3
- package/dist/icons/format_list_checked.svg.js +1 -1
- package/dist/icons/format_list_numbered.svg.js +1 -1
- package/dist/icons/format_underlined.svg.js +1 -1
- package/dist/icons/frame_source.svg.js +5 -0
- package/dist/icons/frontmatter.svg.js +1 -1
- package/dist/icons/horizontal_rule.svg.js +1 -1
- package/dist/icons/insert_col_left.svg.js +1 -1
- package/dist/icons/insert_col_right.svg.js +1 -1
- package/dist/icons/insert_row_above.svg.js +1 -1
- package/dist/icons/insert_row_below.svg.js +1 -1
- package/dist/icons/link.svg.js +1 -1
- package/dist/icons/link_off.svg.js +1 -1
- package/dist/icons/markdown.svg.js +1 -1
- package/dist/icons/more_horiz.svg.js +1 -1
- package/dist/icons/more_vert.svg.js +1 -1
- package/dist/icons/open_in_new.svg.js +1 -1
- package/dist/icons/redo.svg.js +1 -1
- package/dist/icons/rich_text.svg.js +1 -1
- package/dist/icons/sandpack.svg.js +1 -1
- package/dist/icons/settings.svg.js +1 -3
- package/dist/icons/table.svg.js +1 -1
- package/dist/icons/undo.svg.js +1 -1
- package/dist/importMarkdownToLexical.d.ts +10 -0
- package/dist/importMarkdownToLexical.js +31 -7
- package/dist/index.d.ts +8 -0
- package/dist/index.js +41 -3
- package/dist/plugins/codeblock/index.d.ts +92 -2
- package/dist/plugins/codemirror/index.d.ts +128 -2
- package/dist/plugins/core/GenericHTMLNode.d.ts +38 -0
- package/dist/plugins/core/GenericHTMLNode.js +117 -0
- package/dist/plugins/core/Icon.d.ts +1 -1
- package/dist/plugins/core/Icon.js +2 -4
- package/dist/plugins/core/LexicalGenericHTMLNodeVisitor.d.ts +4 -0
- package/dist/plugins/core/LexicalGenericHTMLNodeVisitor.js +15 -0
- package/dist/plugins/core/LexicalTextVisitor.js +18 -1
- package/dist/plugins/core/MdastHTMLNode.d.ts +13 -0
- package/dist/plugins/core/MdastHTMLNode.js +122 -0
- package/dist/plugins/core/MdastHTMLVisitor.d.ts +3 -0
- package/dist/plugins/core/MdastHTMLVisitor.js +12 -0
- package/dist/plugins/core/NestedLexicalEditor.js +14 -9
- package/dist/plugins/core/index.d.ts +80 -3
- package/dist/plugins/core/index.js +90 -20
- package/dist/plugins/diff-source/DiffSourceWrapper.js +4 -1
- package/dist/plugins/diff-source/SourceEditor.js +7 -1
- package/dist/plugins/diff-source/index.d.ts +94 -4
- package/dist/plugins/diff-source/index.js +3 -4
- package/dist/plugins/directives/index.d.ts +92 -2
- package/dist/plugins/frontmatter/index.d.ts +92 -2
- package/dist/plugins/headings/index.d.ts +92 -2
- package/dist/plugins/image/index.d.ts +92 -2
- package/dist/plugins/jsx/LexicalJsxVisitor.js +12 -0
- package/dist/plugins/jsx/index.d.ts +114 -23
- package/dist/plugins/jsx/index.js +4 -0
- package/dist/plugins/link/index.d.ts +9 -0
- package/dist/plugins/link-dialog/index.d.ts +79 -5
- package/dist/plugins/link-dialog/index.js +2 -8
- package/dist/plugins/lists/index.d.ts +92 -2
- package/dist/plugins/lists/index.js +3 -0
- package/dist/plugins/markdown-shortcut/index.d.ts +9 -0
- package/dist/plugins/quote/index.d.ts +65 -2
- package/dist/plugins/sandpack/index.d.ts +128 -2
- package/dist/plugins/table/index.d.ts +92 -2
- package/dist/plugins/thematic-break/index.d.ts +92 -2
- package/dist/plugins/toolbar/components/ChangeAdmonitionType.js +1 -1
- package/dist/plugins/toolbar/components/InsertCodeBlock.js +1 -1
- package/dist/plugins/toolbar/index.d.ts +74 -2
- package/dist/style.css +210 -195
- package/dist/styles/ui.module.css.js +105 -102
- package/dist/utils/fp.js +31 -1
- package/dist/utils/lexicalHelpers.js +20 -2
- package/dist/utils/makeHslTransparent.d.ts +1 -0
- package/dist/utils/makeHslTransparent.js +6 -0
- package/dist/utils/mergeStyleAttributes.d.ts +1 -0
- package/dist/utils/mergeStyleAttributes.js +22 -0
- package/dist/utils/whitespaceConversion.d.ts +2 -0
- package/dist/utils/whitespaceConversion.js +9 -0
- package/package.json +17 -11
- package/dist/icons/check_small.svg.js +0 -5
- package/dist/icons/code_block.svg.js +0 -5
|
@@ -2,7 +2,6 @@ import type { IconKey } from '../core/Icon';
|
|
|
2
2
|
import type { Options } from 'mdast-util-to-markdown';
|
|
3
3
|
import type { Config } from 'mdast-util-from-markdown/lib';
|
|
4
4
|
import type { Extension } from 'micromark-util-types';
|
|
5
|
-
import type { Content } from 'mdast';
|
|
6
5
|
import type { MdastImportVisitor, LexicalVisitor } from '../..';
|
|
7
6
|
import type { EditorSubscription, EditorInFocus, BlockType } from '../core';
|
|
8
7
|
import type { InitialEditorStateType } from '@lexical/react/LexicalComposer';
|
|
@@ -11,6 +10,7 @@ import type { LexicalEditor, RangeSelection, Klass, LexicalNode, TextFormatType,
|
|
|
11
10
|
import type { SystemSpec, Realm, RealmNode, PluginConstructor, TypedRealm, ValueForKey, SystemKeys, ValuesForKeys, SystemDict } from '../../gurx';
|
|
12
11
|
import type { MdxJsxFlowElement, MdxJsxTextElement } from 'mdast-util-mdx-jsx';
|
|
13
12
|
import React from 'react';
|
|
13
|
+
import * as Mdast from 'mdast';
|
|
14
14
|
/**
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
@@ -87,6 +87,7 @@ type JsxFlowPayload = {
|
|
|
87
87
|
children?: MdxJsxFlowElement['children'];
|
|
88
88
|
};
|
|
89
89
|
type InsertJsxPayload = JsxTextPayload | JsxFlowPayload;
|
|
90
|
+
export declare function isMdastJsxNode(node: Mdast.Content | Mdast.Parent | Mdast.Root): node is MdastJsx;
|
|
90
91
|
/** @internal */
|
|
91
92
|
export declare const jsxSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
92
93
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
@@ -99,11 +100,11 @@ export declare const jsxSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
99
100
|
rootEditor: RealmNode<LexicalEditor | null>;
|
|
100
101
|
createRootEditorSubscription: RealmNode<EditorSubscription>;
|
|
101
102
|
createActiveEditorSubscription: RealmNode<EditorSubscription>;
|
|
102
|
-
importVisitors: RealmNode<MdastImportVisitor<Content>[]>;
|
|
103
|
+
importVisitors: RealmNode<MdastImportVisitor<Mdast.Content>[]>;
|
|
103
104
|
syntaxExtensions: RealmNode<Extension[]>;
|
|
104
105
|
mdastExtensions: RealmNode<(Partial<Config> | Partial<Config>[])[] | null | undefined>;
|
|
105
106
|
usedLexicalNodes: RealmNode<Klass<LexicalNode>[]>;
|
|
106
|
-
addImportVisitor: RealmNode<MdastImportVisitor<Content>>;
|
|
107
|
+
addImportVisitor: RealmNode<MdastImportVisitor<Mdast.Content>>;
|
|
107
108
|
addLexicalNode: RealmNode<Klass<LexicalNode>>;
|
|
108
109
|
addSyntaxExtension: RealmNode<Extension>;
|
|
109
110
|
addMdastExtension: RealmNode<Partial<Config> | Partial<Config>[]>;
|
|
@@ -115,6 +116,7 @@ export declare const jsxSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
115
116
|
initialMarkdown: RealmNode<string>;
|
|
116
117
|
setMarkdown: RealmNode<string>;
|
|
117
118
|
markdown: RealmNode<string>;
|
|
119
|
+
markdownSignal: RealmNode<string>;
|
|
118
120
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
119
121
|
contentEditableClassName: RealmNode<string>;
|
|
120
122
|
placeholder: RealmNode<React.ReactNode>;
|
|
@@ -144,6 +146,14 @@ export declare const jsxSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
144
146
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
145
147
|
onBlur: RealmNode<FocusEvent>;
|
|
146
148
|
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
149
|
+
markdownProcessingError: RealmNode<{
|
|
150
|
+
error: string;
|
|
151
|
+
source: string;
|
|
152
|
+
} | null>;
|
|
153
|
+
markdownErrorSignal: RealmNode<{
|
|
154
|
+
error: string;
|
|
155
|
+
source: string;
|
|
156
|
+
}>;
|
|
147
157
|
}>], (r: Realm, [{ insertDecoratorNode }]: [{
|
|
148
158
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
149
159
|
inFocus: RealmNode<boolean>;
|
|
@@ -155,11 +165,11 @@ export declare const jsxSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
155
165
|
rootEditor: RealmNode<LexicalEditor | null>;
|
|
156
166
|
createRootEditorSubscription: RealmNode<EditorSubscription>;
|
|
157
167
|
createActiveEditorSubscription: RealmNode<EditorSubscription>;
|
|
158
|
-
importVisitors: RealmNode<MdastImportVisitor<Content>[]>;
|
|
168
|
+
importVisitors: RealmNode<MdastImportVisitor<Mdast.Content>[]>;
|
|
159
169
|
syntaxExtensions: RealmNode<Extension[]>;
|
|
160
170
|
mdastExtensions: RealmNode<(Partial<Config> | Partial<Config>[])[] | null | undefined>;
|
|
161
171
|
usedLexicalNodes: RealmNode<Klass<LexicalNode>[]>;
|
|
162
|
-
addImportVisitor: RealmNode<MdastImportVisitor<Content>>;
|
|
172
|
+
addImportVisitor: RealmNode<MdastImportVisitor<Mdast.Content>>;
|
|
163
173
|
addLexicalNode: RealmNode<Klass<LexicalNode>>;
|
|
164
174
|
addSyntaxExtension: RealmNode<Extension>;
|
|
165
175
|
addMdastExtension: RealmNode<Partial<Config> | Partial<Config>[]>;
|
|
@@ -171,6 +181,7 @@ export declare const jsxSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
171
181
|
initialMarkdown: RealmNode<string>;
|
|
172
182
|
setMarkdown: RealmNode<string>;
|
|
173
183
|
markdown: RealmNode<string>;
|
|
184
|
+
markdownSignal: RealmNode<string>;
|
|
174
185
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
175
186
|
contentEditableClassName: RealmNode<string>;
|
|
176
187
|
placeholder: RealmNode<React.ReactNode>;
|
|
@@ -200,6 +211,14 @@ export declare const jsxSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
200
211
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
201
212
|
onBlur: RealmNode<FocusEvent>;
|
|
202
213
|
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
214
|
+
markdownProcessingError: RealmNode<{
|
|
215
|
+
error: string;
|
|
216
|
+
source: string;
|
|
217
|
+
} | null>;
|
|
218
|
+
markdownErrorSignal: RealmNode<{
|
|
219
|
+
error: string;
|
|
220
|
+
source: string;
|
|
221
|
+
}>;
|
|
203
222
|
}]) => {
|
|
204
223
|
insertJsx: RealmNode<InsertJsxPayload>;
|
|
205
224
|
}>;
|
|
@@ -225,11 +244,11 @@ jsxPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
225
244
|
rootEditor: RealmNode<LexicalEditor | null>;
|
|
226
245
|
createRootEditorSubscription: RealmNode<EditorSubscription>;
|
|
227
246
|
createActiveEditorSubscription: RealmNode<EditorSubscription>;
|
|
228
|
-
importVisitors: RealmNode<MdastImportVisitor<Content>[]>;
|
|
247
|
+
importVisitors: RealmNode<MdastImportVisitor<Mdast.Content>[]>;
|
|
229
248
|
syntaxExtensions: RealmNode<Extension[]>;
|
|
230
249
|
mdastExtensions: RealmNode<(Partial<Config> | Partial<Config>[])[] | null | undefined>;
|
|
231
250
|
usedLexicalNodes: RealmNode<Klass<LexicalNode>[]>;
|
|
232
|
-
addImportVisitor: RealmNode<MdastImportVisitor<Content>>;
|
|
251
|
+
addImportVisitor: RealmNode<MdastImportVisitor<Mdast.Content>>;
|
|
233
252
|
addLexicalNode: RealmNode<Klass<LexicalNode>>;
|
|
234
253
|
addSyntaxExtension: RealmNode<Extension>;
|
|
235
254
|
addMdastExtension: RealmNode<Partial<Config> | Partial<Config>[]>;
|
|
@@ -241,6 +260,7 @@ jsxPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
241
260
|
initialMarkdown: RealmNode<string>;
|
|
242
261
|
setMarkdown: RealmNode<string>;
|
|
243
262
|
markdown: RealmNode<string>;
|
|
263
|
+
markdownSignal: RealmNode<string>;
|
|
244
264
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
245
265
|
contentEditableClassName: RealmNode<string>;
|
|
246
266
|
placeholder: RealmNode<React.ReactNode>;
|
|
@@ -270,6 +290,14 @@ jsxPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
270
290
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
271
291
|
onBlur: RealmNode<FocusEvent>;
|
|
272
292
|
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
293
|
+
markdownProcessingError: RealmNode<{
|
|
294
|
+
error: string;
|
|
295
|
+
source: string;
|
|
296
|
+
} | null>;
|
|
297
|
+
markdownErrorSignal: RealmNode<{
|
|
298
|
+
error: string;
|
|
299
|
+
source: string;
|
|
300
|
+
}>;
|
|
273
301
|
}>], (r: Realm, [{ insertDecoratorNode }]: [{
|
|
274
302
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
275
303
|
inFocus: RealmNode<boolean>;
|
|
@@ -281,11 +309,11 @@ jsxPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
281
309
|
rootEditor: RealmNode<LexicalEditor | null>;
|
|
282
310
|
createRootEditorSubscription: RealmNode<EditorSubscription>;
|
|
283
311
|
createActiveEditorSubscription: RealmNode<EditorSubscription>;
|
|
284
|
-
importVisitors: RealmNode<MdastImportVisitor<Content>[]>;
|
|
312
|
+
importVisitors: RealmNode<MdastImportVisitor<Mdast.Content>[]>;
|
|
285
313
|
syntaxExtensions: RealmNode<Extension[]>;
|
|
286
314
|
mdastExtensions: RealmNode<(Partial<Config> | Partial<Config>[])[] | null | undefined>;
|
|
287
315
|
usedLexicalNodes: RealmNode<Klass<LexicalNode>[]>;
|
|
288
|
-
addImportVisitor: RealmNode<MdastImportVisitor<Content>>;
|
|
316
|
+
addImportVisitor: RealmNode<MdastImportVisitor<Mdast.Content>>;
|
|
289
317
|
addLexicalNode: RealmNode<Klass<LexicalNode>>;
|
|
290
318
|
addSyntaxExtension: RealmNode<Extension>;
|
|
291
319
|
addMdastExtension: RealmNode<Partial<Config> | Partial<Config>[]>;
|
|
@@ -297,6 +325,7 @@ jsxPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
297
325
|
initialMarkdown: RealmNode<string>;
|
|
298
326
|
setMarkdown: RealmNode<string>;
|
|
299
327
|
markdown: RealmNode<string>;
|
|
328
|
+
markdownSignal: RealmNode<string>;
|
|
300
329
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
301
330
|
contentEditableClassName: RealmNode<string>;
|
|
302
331
|
placeholder: RealmNode<React.ReactNode>;
|
|
@@ -326,6 +355,14 @@ jsxPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
326
355
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
327
356
|
onBlur: RealmNode<FocusEvent>;
|
|
328
357
|
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
358
|
+
markdownProcessingError: RealmNode<{
|
|
359
|
+
error: string;
|
|
360
|
+
source: string;
|
|
361
|
+
} | null>;
|
|
362
|
+
markdownErrorSignal: RealmNode<{
|
|
363
|
+
error: string;
|
|
364
|
+
source: string;
|
|
365
|
+
}>;
|
|
329
366
|
}]) => {
|
|
330
367
|
insertJsx: RealmNode<InsertJsxPayload>;
|
|
331
368
|
}>, JsxPluginParams>,
|
|
@@ -344,11 +381,11 @@ jsxPluginHooks: {
|
|
|
344
381
|
rootEditor: RealmNode<LexicalEditor | null>;
|
|
345
382
|
createRootEditorSubscription: RealmNode<EditorSubscription>;
|
|
346
383
|
createActiveEditorSubscription: RealmNode<EditorSubscription>;
|
|
347
|
-
importVisitors: RealmNode<MdastImportVisitor<Content>[]>;
|
|
384
|
+
importVisitors: RealmNode<MdastImportVisitor<Mdast.Content>[]>;
|
|
348
385
|
syntaxExtensions: RealmNode<Extension[]>;
|
|
349
386
|
mdastExtensions: RealmNode<(Partial<Config> | Partial<Config>[])[] | null | undefined>;
|
|
350
387
|
usedLexicalNodes: RealmNode<Klass<LexicalNode>[]>;
|
|
351
|
-
addImportVisitor: RealmNode<MdastImportVisitor<Content>>;
|
|
388
|
+
addImportVisitor: RealmNode<MdastImportVisitor<Mdast.Content>>;
|
|
352
389
|
addLexicalNode: RealmNode<Klass<LexicalNode>>;
|
|
353
390
|
addSyntaxExtension: RealmNode<Extension>;
|
|
354
391
|
addMdastExtension: RealmNode<Partial<Config> | Partial<Config>[]>;
|
|
@@ -360,6 +397,7 @@ jsxPluginHooks: {
|
|
|
360
397
|
initialMarkdown: RealmNode<string>;
|
|
361
398
|
setMarkdown: RealmNode<string>;
|
|
362
399
|
markdown: RealmNode<string>;
|
|
400
|
+
markdownSignal: RealmNode<string>;
|
|
363
401
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
364
402
|
contentEditableClassName: RealmNode<string>;
|
|
365
403
|
placeholder: RealmNode<React.ReactNode>;
|
|
@@ -389,8 +427,16 @@ jsxPluginHooks: {
|
|
|
389
427
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
390
428
|
onBlur: RealmNode<FocusEvent>;
|
|
391
429
|
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
430
|
+
markdownProcessingError: RealmNode<{
|
|
431
|
+
error: string;
|
|
432
|
+
source: string;
|
|
433
|
+
} | null>;
|
|
434
|
+
markdownErrorSignal: RealmNode<{
|
|
435
|
+
error: string;
|
|
436
|
+
source: string;
|
|
437
|
+
}>;
|
|
392
438
|
}>;
|
|
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<{
|
|
439
|
+
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" | "markdownSignal" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "iconComponentFor" | "markdownProcessingError" | "markdownErrorSignal" | "insertJsx">(key: K, callback: (value: ValueForKey<{
|
|
394
440
|
insertJsx: RealmNode<InsertJsxPayload>;
|
|
395
441
|
} & {
|
|
396
442
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
@@ -403,11 +449,11 @@ jsxPluginHooks: {
|
|
|
403
449
|
rootEditor: RealmNode<LexicalEditor | null>;
|
|
404
450
|
createRootEditorSubscription: RealmNode<EditorSubscription>;
|
|
405
451
|
createActiveEditorSubscription: RealmNode<EditorSubscription>;
|
|
406
|
-
importVisitors: RealmNode<MdastImportVisitor<Content>[]>;
|
|
452
|
+
importVisitors: RealmNode<MdastImportVisitor<Mdast.Content>[]>;
|
|
407
453
|
syntaxExtensions: RealmNode<Extension[]>;
|
|
408
454
|
mdastExtensions: RealmNode<(Partial<Config> | Partial<Config>[])[] | null | undefined>;
|
|
409
455
|
usedLexicalNodes: RealmNode<Klass<LexicalNode>[]>;
|
|
410
|
-
addImportVisitor: RealmNode<MdastImportVisitor<Content>>;
|
|
456
|
+
addImportVisitor: RealmNode<MdastImportVisitor<Mdast.Content>>;
|
|
411
457
|
addLexicalNode: RealmNode<Klass<LexicalNode>>;
|
|
412
458
|
addSyntaxExtension: RealmNode<Extension>;
|
|
413
459
|
addMdastExtension: RealmNode<Partial<Config> | Partial<Config>[]>;
|
|
@@ -419,6 +465,7 @@ jsxPluginHooks: {
|
|
|
419
465
|
initialMarkdown: RealmNode<string>;
|
|
420
466
|
setMarkdown: RealmNode<string>;
|
|
421
467
|
markdown: RealmNode<string>;
|
|
468
|
+
markdownSignal: RealmNode<string>;
|
|
422
469
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
423
470
|
contentEditableClassName: RealmNode<string>;
|
|
424
471
|
placeholder: RealmNode<React.ReactNode>;
|
|
@@ -448,6 +495,14 @@ jsxPluginHooks: {
|
|
|
448
495
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
449
496
|
onBlur: RealmNode<FocusEvent>;
|
|
450
497
|
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
498
|
+
markdownProcessingError: RealmNode<{
|
|
499
|
+
error: string;
|
|
500
|
+
source: string;
|
|
501
|
+
} | null>;
|
|
502
|
+
markdownErrorSignal: RealmNode<{
|
|
503
|
+
error: string;
|
|
504
|
+
source: string;
|
|
505
|
+
}>;
|
|
451
506
|
}, K>) => void) => void;
|
|
452
507
|
useEmitterValues: <K_1 extends SystemKeys<{
|
|
453
508
|
insertJsx: RealmNode<InsertJsxPayload>;
|
|
@@ -462,11 +517,11 @@ jsxPluginHooks: {
|
|
|
462
517
|
rootEditor: RealmNode<LexicalEditor | null>;
|
|
463
518
|
createRootEditorSubscription: RealmNode<EditorSubscription>;
|
|
464
519
|
createActiveEditorSubscription: RealmNode<EditorSubscription>;
|
|
465
|
-
importVisitors: RealmNode<MdastImportVisitor<Content>[]>;
|
|
520
|
+
importVisitors: RealmNode<MdastImportVisitor<Mdast.Content>[]>;
|
|
466
521
|
syntaxExtensions: RealmNode<Extension[]>;
|
|
467
522
|
mdastExtensions: RealmNode<(Partial<Config> | Partial<Config>[])[] | null | undefined>;
|
|
468
523
|
usedLexicalNodes: RealmNode<Klass<LexicalNode>[]>;
|
|
469
|
-
addImportVisitor: RealmNode<MdastImportVisitor<Content>>;
|
|
524
|
+
addImportVisitor: RealmNode<MdastImportVisitor<Mdast.Content>>;
|
|
470
525
|
addLexicalNode: RealmNode<Klass<LexicalNode>>;
|
|
471
526
|
addSyntaxExtension: RealmNode<Extension>;
|
|
472
527
|
addMdastExtension: RealmNode<Partial<Config> | Partial<Config>[]>;
|
|
@@ -478,6 +533,7 @@ jsxPluginHooks: {
|
|
|
478
533
|
initialMarkdown: RealmNode<string>;
|
|
479
534
|
setMarkdown: RealmNode<string>;
|
|
480
535
|
markdown: RealmNode<string>;
|
|
536
|
+
markdownSignal: RealmNode<string>;
|
|
481
537
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
482
538
|
contentEditableClassName: RealmNode<string>;
|
|
483
539
|
placeholder: RealmNode<React.ReactNode>;
|
|
@@ -507,6 +563,14 @@ jsxPluginHooks: {
|
|
|
507
563
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
508
564
|
onBlur: RealmNode<FocusEvent>;
|
|
509
565
|
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
566
|
+
markdownProcessingError: RealmNode<{
|
|
567
|
+
error: string;
|
|
568
|
+
source: string;
|
|
569
|
+
} | null>;
|
|
570
|
+
markdownErrorSignal: RealmNode<{
|
|
571
|
+
error: string;
|
|
572
|
+
source: string;
|
|
573
|
+
}>;
|
|
510
574
|
}>>(...keys: K_1) => ValuesForKeys<{
|
|
511
575
|
insertJsx: RealmNode<InsertJsxPayload>;
|
|
512
576
|
} & {
|
|
@@ -520,11 +584,11 @@ jsxPluginHooks: {
|
|
|
520
584
|
rootEditor: RealmNode<LexicalEditor | null>;
|
|
521
585
|
createRootEditorSubscription: RealmNode<EditorSubscription>;
|
|
522
586
|
createActiveEditorSubscription: RealmNode<EditorSubscription>;
|
|
523
|
-
importVisitors: RealmNode<MdastImportVisitor<Content>[]>;
|
|
587
|
+
importVisitors: RealmNode<MdastImportVisitor<Mdast.Content>[]>;
|
|
524
588
|
syntaxExtensions: RealmNode<Extension[]>;
|
|
525
589
|
mdastExtensions: RealmNode<(Partial<Config> | Partial<Config>[])[] | null | undefined>;
|
|
526
590
|
usedLexicalNodes: RealmNode<Klass<LexicalNode>[]>;
|
|
527
|
-
addImportVisitor: RealmNode<MdastImportVisitor<Content>>;
|
|
591
|
+
addImportVisitor: RealmNode<MdastImportVisitor<Mdast.Content>>;
|
|
528
592
|
addLexicalNode: RealmNode<Klass<LexicalNode>>;
|
|
529
593
|
addSyntaxExtension: RealmNode<Extension>;
|
|
530
594
|
addMdastExtension: RealmNode<Partial<Config> | Partial<Config>[]>;
|
|
@@ -536,6 +600,7 @@ jsxPluginHooks: {
|
|
|
536
600
|
initialMarkdown: RealmNode<string>;
|
|
537
601
|
setMarkdown: RealmNode<string>;
|
|
538
602
|
markdown: RealmNode<string>;
|
|
603
|
+
markdownSignal: RealmNode<string>;
|
|
539
604
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
540
605
|
contentEditableClassName: RealmNode<string>;
|
|
541
606
|
placeholder: RealmNode<React.ReactNode>;
|
|
@@ -565,6 +630,14 @@ jsxPluginHooks: {
|
|
|
565
630
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
566
631
|
onBlur: RealmNode<FocusEvent>;
|
|
567
632
|
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
633
|
+
markdownProcessingError: RealmNode<{
|
|
634
|
+
error: string;
|
|
635
|
+
source: string;
|
|
636
|
+
} | null>;
|
|
637
|
+
markdownErrorSignal: RealmNode<{
|
|
638
|
+
error: string;
|
|
639
|
+
source: string;
|
|
640
|
+
}>;
|
|
568
641
|
}, K_1>;
|
|
569
642
|
usePubKeys: () => (values: SystemDict<{
|
|
570
643
|
insertJsx: RealmNode<InsertJsxPayload>;
|
|
@@ -579,11 +652,11 @@ jsxPluginHooks: {
|
|
|
579
652
|
rootEditor: RealmNode<LexicalEditor | null>;
|
|
580
653
|
createRootEditorSubscription: RealmNode<EditorSubscription>;
|
|
581
654
|
createActiveEditorSubscription: RealmNode<EditorSubscription>;
|
|
582
|
-
importVisitors: RealmNode<MdastImportVisitor<Content>[]>;
|
|
655
|
+
importVisitors: RealmNode<MdastImportVisitor<Mdast.Content>[]>;
|
|
583
656
|
syntaxExtensions: RealmNode<Extension[]>;
|
|
584
657
|
mdastExtensions: RealmNode<(Partial<Config> | Partial<Config>[])[] | null | undefined>;
|
|
585
658
|
usedLexicalNodes: RealmNode<Klass<LexicalNode>[]>;
|
|
586
|
-
addImportVisitor: RealmNode<MdastImportVisitor<Content>>;
|
|
659
|
+
addImportVisitor: RealmNode<MdastImportVisitor<Mdast.Content>>;
|
|
587
660
|
addLexicalNode: RealmNode<Klass<LexicalNode>>;
|
|
588
661
|
addSyntaxExtension: RealmNode<Extension>;
|
|
589
662
|
addMdastExtension: RealmNode<Partial<Config> | Partial<Config>[]>;
|
|
@@ -595,6 +668,7 @@ jsxPluginHooks: {
|
|
|
595
668
|
initialMarkdown: RealmNode<string>;
|
|
596
669
|
setMarkdown: RealmNode<string>;
|
|
597
670
|
markdown: RealmNode<string>;
|
|
671
|
+
markdownSignal: RealmNode<string>;
|
|
598
672
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
599
673
|
contentEditableClassName: RealmNode<string>;
|
|
600
674
|
placeholder: RealmNode<React.ReactNode>;
|
|
@@ -624,8 +698,16 @@ jsxPluginHooks: {
|
|
|
624
698
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
625
699
|
onBlur: RealmNode<FocusEvent>;
|
|
626
700
|
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
701
|
+
markdownProcessingError: RealmNode<{
|
|
702
|
+
error: string;
|
|
703
|
+
source: string;
|
|
704
|
+
} | null>;
|
|
705
|
+
markdownErrorSignal: RealmNode<{
|
|
706
|
+
error: string;
|
|
707
|
+
source: string;
|
|
708
|
+
}>;
|
|
627
709
|
}>) => void;
|
|
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<{
|
|
710
|
+
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" | "markdownSignal" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "iconComponentFor" | "markdownProcessingError" | "markdownErrorSignal" | "insertJsx">(key: K_2) => (value: ValueForKey<{
|
|
629
711
|
insertJsx: RealmNode<InsertJsxPayload>;
|
|
630
712
|
} & {
|
|
631
713
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
@@ -638,11 +720,11 @@ jsxPluginHooks: {
|
|
|
638
720
|
rootEditor: RealmNode<LexicalEditor | null>;
|
|
639
721
|
createRootEditorSubscription: RealmNode<EditorSubscription>;
|
|
640
722
|
createActiveEditorSubscription: RealmNode<EditorSubscription>;
|
|
641
|
-
importVisitors: RealmNode<MdastImportVisitor<Content>[]>;
|
|
723
|
+
importVisitors: RealmNode<MdastImportVisitor<Mdast.Content>[]>;
|
|
642
724
|
syntaxExtensions: RealmNode<Extension[]>;
|
|
643
725
|
mdastExtensions: RealmNode<(Partial<Config> | Partial<Config>[])[] | null | undefined>;
|
|
644
726
|
usedLexicalNodes: RealmNode<Klass<LexicalNode>[]>;
|
|
645
|
-
addImportVisitor: RealmNode<MdastImportVisitor<Content>>;
|
|
727
|
+
addImportVisitor: RealmNode<MdastImportVisitor<Mdast.Content>>;
|
|
646
728
|
addLexicalNode: RealmNode<Klass<LexicalNode>>;
|
|
647
729
|
addSyntaxExtension: RealmNode<Extension>;
|
|
648
730
|
addMdastExtension: RealmNode<Partial<Config> | Partial<Config>[]>;
|
|
@@ -654,6 +736,7 @@ jsxPluginHooks: {
|
|
|
654
736
|
initialMarkdown: RealmNode<string>;
|
|
655
737
|
setMarkdown: RealmNode<string>;
|
|
656
738
|
markdown: RealmNode<string>;
|
|
739
|
+
markdownSignal: RealmNode<string>;
|
|
657
740
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
658
741
|
contentEditableClassName: RealmNode<string>;
|
|
659
742
|
placeholder: RealmNode<React.ReactNode>;
|
|
@@ -683,6 +766,14 @@ jsxPluginHooks: {
|
|
|
683
766
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
684
767
|
onBlur: RealmNode<FocusEvent>;
|
|
685
768
|
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
769
|
+
markdownProcessingError: RealmNode<{
|
|
770
|
+
error: string;
|
|
771
|
+
source: string;
|
|
772
|
+
} | null>;
|
|
773
|
+
markdownErrorSignal: RealmNode<{
|
|
774
|
+
error: string;
|
|
775
|
+
source: string;
|
|
776
|
+
}>;
|
|
686
777
|
}, K_2>) => void;
|
|
687
778
|
};
|
|
688
779
|
export {};
|
|
@@ -7,6 +7,9 @@ import { MdastMdxJsEsmVisitor } from "./MdastMdxJsEsmVisitor.js";
|
|
|
7
7
|
import { MdastMdxJsxElementVisitor } from "./MdastMdxJsxElementVisitor.js";
|
|
8
8
|
import { system } from "../../gurx/realmFactory.js";
|
|
9
9
|
import { realmPlugin } from "../../gurx/react.js";
|
|
10
|
+
function isMdastJsxNode(node) {
|
|
11
|
+
return node.type === "mdxJsxFlowElement" || node.type === "mdxJsxTextElement";
|
|
12
|
+
}
|
|
10
13
|
function toMdastJsxAttributes(attributes) {
|
|
11
14
|
return Object.entries(attributes).map(([name, value]) => ({
|
|
12
15
|
type: "mdxJsxAttribute",
|
|
@@ -72,6 +75,7 @@ const [
|
|
|
72
75
|
}
|
|
73
76
|
});
|
|
74
77
|
export {
|
|
78
|
+
isMdastJsxNode,
|
|
75
79
|
jsxPlugin,
|
|
76
80
|
jsxPluginHooks,
|
|
77
81
|
jsxSystem
|
|
@@ -57,6 +57,7 @@ export declare const linkPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r
|
|
|
57
57
|
initialMarkdown: RealmNode<string>;
|
|
58
58
|
setMarkdown: RealmNode<string>;
|
|
59
59
|
markdown: RealmNode<string>;
|
|
60
|
+
markdownSignal: RealmNode<string>;
|
|
60
61
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
61
62
|
contentEditableClassName: RealmNode<string>;
|
|
62
63
|
placeholder: RealmNode<React.ReactNode>;
|
|
@@ -86,6 +87,14 @@ export declare const linkPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r
|
|
|
86
87
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
87
88
|
onBlur: RealmNode<FocusEvent>;
|
|
88
89
|
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
90
|
+
markdownProcessingError: RealmNode<{
|
|
91
|
+
error: string;
|
|
92
|
+
source: string;
|
|
93
|
+
} | null>;
|
|
94
|
+
markdownErrorSignal: RealmNode<{
|
|
95
|
+
error: string;
|
|
96
|
+
source: string;
|
|
97
|
+
}>;
|
|
89
98
|
}>], (r: Realm) => {
|
|
90
99
|
disableAutoLink: RealmNode<boolean>;
|
|
91
100
|
}>, LinkPluginParams>;
|
|
@@ -33,6 +33,10 @@ type EditLinkDialog = {
|
|
|
33
33
|
linkNodeKey: string;
|
|
34
34
|
rectangle: RectData;
|
|
35
35
|
};
|
|
36
|
+
type LinkDialogPluginParamsType = {
|
|
37
|
+
LinkDialog?: () => JSX.Element;
|
|
38
|
+
linkAutocompleteSuggestions?: string[];
|
|
39
|
+
};
|
|
36
40
|
export declare const
|
|
37
41
|
/** @internal */
|
|
38
42
|
linkDialogPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
@@ -62,6 +66,7 @@ linkDialogPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
62
66
|
initialMarkdown: RealmNode<string>;
|
|
63
67
|
setMarkdown: RealmNode<string>;
|
|
64
68
|
markdown: RealmNode<string>;
|
|
69
|
+
markdownSignal: RealmNode<string>;
|
|
65
70
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
66
71
|
contentEditableClassName: RealmNode<string>;
|
|
67
72
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -91,6 +96,14 @@ linkDialogPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
91
96
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
92
97
|
onBlur: RealmNode<FocusEvent>;
|
|
93
98
|
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
99
|
+
markdownProcessingError: RealmNode<{
|
|
100
|
+
error: string;
|
|
101
|
+
source: string;
|
|
102
|
+
} | null>;
|
|
103
|
+
markdownErrorSignal: RealmNode<{
|
|
104
|
+
error: string;
|
|
105
|
+
source: string;
|
|
106
|
+
}>;
|
|
94
107
|
}>], (r: Realm, [{ activeEditor, currentSelection, createActiveEditorSubscription }]: [{
|
|
95
108
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
96
109
|
inFocus: RealmNode<boolean>;
|
|
@@ -118,6 +131,7 @@ linkDialogPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
118
131
|
initialMarkdown: RealmNode<string>;
|
|
119
132
|
setMarkdown: RealmNode<string>;
|
|
120
133
|
markdown: RealmNode<string>;
|
|
134
|
+
markdownSignal: RealmNode<string>;
|
|
121
135
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
122
136
|
contentEditableClassName: RealmNode<string>;
|
|
123
137
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -147,6 +161,14 @@ linkDialogPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
147
161
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
148
162
|
onBlur: RealmNode<FocusEvent>;
|
|
149
163
|
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
164
|
+
markdownProcessingError: RealmNode<{
|
|
165
|
+
error: string;
|
|
166
|
+
source: string;
|
|
167
|
+
} | null>;
|
|
168
|
+
markdownErrorSignal: RealmNode<{
|
|
169
|
+
error: string;
|
|
170
|
+
source: string;
|
|
171
|
+
}>;
|
|
150
172
|
}]) => {
|
|
151
173
|
dialogState: RealmNode<boolean>;
|
|
152
174
|
onWindowChange: RealmNode<true>;
|
|
@@ -161,9 +183,7 @@ linkDialogPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
161
183
|
openLinkEditDialog: RealmNode<true>;
|
|
162
184
|
applyLinkChanges: RealmNode<true>;
|
|
163
185
|
linkAutocompleteSuggestions: RealmNode<string[]>;
|
|
164
|
-
}>,
|
|
165
|
-
linkAutocompleteSuggestions?: string[] | undefined;
|
|
166
|
-
}>,
|
|
186
|
+
}>, LinkDialogPluginParamsType>,
|
|
167
187
|
/** @internal */
|
|
168
188
|
linkDialogPluginHooks: {
|
|
169
189
|
useRealmContext: () => TypedRealm<{
|
|
@@ -207,6 +227,7 @@ linkDialogPluginHooks: {
|
|
|
207
227
|
initialMarkdown: RealmNode<string>;
|
|
208
228
|
setMarkdown: RealmNode<string>;
|
|
209
229
|
markdown: RealmNode<string>;
|
|
230
|
+
markdownSignal: RealmNode<string>;
|
|
210
231
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
211
232
|
contentEditableClassName: RealmNode<string>;
|
|
212
233
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -236,8 +257,16 @@ linkDialogPluginHooks: {
|
|
|
236
257
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
237
258
|
onBlur: RealmNode<FocusEvent>;
|
|
238
259
|
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
260
|
+
markdownProcessingError: RealmNode<{
|
|
261
|
+
error: string;
|
|
262
|
+
source: string;
|
|
263
|
+
} | null>;
|
|
264
|
+
markdownErrorSignal: RealmNode<{
|
|
265
|
+
error: string;
|
|
266
|
+
source: string;
|
|
267
|
+
}>;
|
|
239
268
|
}>;
|
|
240
|
-
useEmitter: <K extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "iconComponentFor" | "dialogState" | "onWindowChange" | "linkDialogState" | "updateLink" | "switchFromPreviewToLinkEdit" | "cancelLinkEdit" | "removeLink" | "openLinkEditDialog" | "applyLinkChanges" | "linkAutocompleteSuggestions">(key: K, callback: (value: ValueForKey<{
|
|
269
|
+
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" | "markdownSignal" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "iconComponentFor" | "markdownProcessingError" | "markdownErrorSignal" | "dialogState" | "onWindowChange" | "linkDialogState" | "updateLink" | "switchFromPreviewToLinkEdit" | "cancelLinkEdit" | "removeLink" | "openLinkEditDialog" | "applyLinkChanges" | "linkAutocompleteSuggestions">(key: K, callback: (value: ValueForKey<{
|
|
241
270
|
dialogState: RealmNode<boolean>;
|
|
242
271
|
onWindowChange: RealmNode<true>;
|
|
243
272
|
linkDialogState: RealmNode<InactiveLinkDialog | PreviewLinkDialog | EditLinkDialog>;
|
|
@@ -278,6 +307,7 @@ linkDialogPluginHooks: {
|
|
|
278
307
|
initialMarkdown: RealmNode<string>;
|
|
279
308
|
setMarkdown: RealmNode<string>;
|
|
280
309
|
markdown: RealmNode<string>;
|
|
310
|
+
markdownSignal: RealmNode<string>;
|
|
281
311
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
282
312
|
contentEditableClassName: RealmNode<string>;
|
|
283
313
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -307,6 +337,14 @@ linkDialogPluginHooks: {
|
|
|
307
337
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
308
338
|
onBlur: RealmNode<FocusEvent>;
|
|
309
339
|
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
340
|
+
markdownProcessingError: RealmNode<{
|
|
341
|
+
error: string;
|
|
342
|
+
source: string;
|
|
343
|
+
} | null>;
|
|
344
|
+
markdownErrorSignal: RealmNode<{
|
|
345
|
+
error: string;
|
|
346
|
+
source: string;
|
|
347
|
+
}>;
|
|
310
348
|
}, K>) => void) => void;
|
|
311
349
|
useEmitterValues: <K_1 extends SystemKeys<{
|
|
312
350
|
dialogState: RealmNode<boolean>;
|
|
@@ -349,6 +387,7 @@ linkDialogPluginHooks: {
|
|
|
349
387
|
initialMarkdown: RealmNode<string>;
|
|
350
388
|
setMarkdown: RealmNode<string>;
|
|
351
389
|
markdown: RealmNode<string>;
|
|
390
|
+
markdownSignal: RealmNode<string>;
|
|
352
391
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
353
392
|
contentEditableClassName: RealmNode<string>;
|
|
354
393
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -378,6 +417,14 @@ linkDialogPluginHooks: {
|
|
|
378
417
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
379
418
|
onBlur: RealmNode<FocusEvent>;
|
|
380
419
|
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
420
|
+
markdownProcessingError: RealmNode<{
|
|
421
|
+
error: string;
|
|
422
|
+
source: string;
|
|
423
|
+
} | null>;
|
|
424
|
+
markdownErrorSignal: RealmNode<{
|
|
425
|
+
error: string;
|
|
426
|
+
source: string;
|
|
427
|
+
}>;
|
|
381
428
|
}>>(...keys: K_1) => ValuesForKeys<{
|
|
382
429
|
dialogState: RealmNode<boolean>;
|
|
383
430
|
onWindowChange: RealmNode<true>;
|
|
@@ -419,6 +466,7 @@ linkDialogPluginHooks: {
|
|
|
419
466
|
initialMarkdown: RealmNode<string>;
|
|
420
467
|
setMarkdown: RealmNode<string>;
|
|
421
468
|
markdown: RealmNode<string>;
|
|
469
|
+
markdownSignal: RealmNode<string>;
|
|
422
470
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
423
471
|
contentEditableClassName: RealmNode<string>;
|
|
424
472
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -448,6 +496,14 @@ linkDialogPluginHooks: {
|
|
|
448
496
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
449
497
|
onBlur: RealmNode<FocusEvent>;
|
|
450
498
|
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
499
|
+
markdownProcessingError: RealmNode<{
|
|
500
|
+
error: string;
|
|
501
|
+
source: string;
|
|
502
|
+
} | null>;
|
|
503
|
+
markdownErrorSignal: RealmNode<{
|
|
504
|
+
error: string;
|
|
505
|
+
source: string;
|
|
506
|
+
}>;
|
|
451
507
|
}, K_1>;
|
|
452
508
|
usePubKeys: () => (values: SystemDict<{
|
|
453
509
|
dialogState: RealmNode<boolean>;
|
|
@@ -490,6 +546,7 @@ linkDialogPluginHooks: {
|
|
|
490
546
|
initialMarkdown: RealmNode<string>;
|
|
491
547
|
setMarkdown: RealmNode<string>;
|
|
492
548
|
markdown: RealmNode<string>;
|
|
549
|
+
markdownSignal: RealmNode<string>;
|
|
493
550
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
494
551
|
contentEditableClassName: RealmNode<string>;
|
|
495
552
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -519,8 +576,16 @@ linkDialogPluginHooks: {
|
|
|
519
576
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
520
577
|
onBlur: RealmNode<FocusEvent>;
|
|
521
578
|
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
579
|
+
markdownProcessingError: RealmNode<{
|
|
580
|
+
error: string;
|
|
581
|
+
source: string;
|
|
582
|
+
} | null>;
|
|
583
|
+
markdownErrorSignal: RealmNode<{
|
|
584
|
+
error: string;
|
|
585
|
+
source: string;
|
|
586
|
+
}>;
|
|
522
587
|
}>) => void;
|
|
523
|
-
usePublisher: <K_2 extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "iconComponentFor" | "dialogState" | "onWindowChange" | "linkDialogState" | "updateLink" | "switchFromPreviewToLinkEdit" | "cancelLinkEdit" | "removeLink" | "openLinkEditDialog" | "applyLinkChanges" | "linkAutocompleteSuggestions">(key: K_2) => (value: ValueForKey<{
|
|
588
|
+
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" | "markdownSignal" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "iconComponentFor" | "markdownProcessingError" | "markdownErrorSignal" | "dialogState" | "onWindowChange" | "linkDialogState" | "updateLink" | "switchFromPreviewToLinkEdit" | "cancelLinkEdit" | "removeLink" | "openLinkEditDialog" | "applyLinkChanges" | "linkAutocompleteSuggestions">(key: K_2) => (value: ValueForKey<{
|
|
524
589
|
dialogState: RealmNode<boolean>;
|
|
525
590
|
onWindowChange: RealmNode<true>;
|
|
526
591
|
linkDialogState: RealmNode<InactiveLinkDialog | PreviewLinkDialog | EditLinkDialog>;
|
|
@@ -561,6 +626,7 @@ linkDialogPluginHooks: {
|
|
|
561
626
|
initialMarkdown: RealmNode<string>;
|
|
562
627
|
setMarkdown: RealmNode<string>;
|
|
563
628
|
markdown: RealmNode<string>;
|
|
629
|
+
markdownSignal: RealmNode<string>;
|
|
564
630
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
565
631
|
contentEditableClassName: RealmNode<string>;
|
|
566
632
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -590,6 +656,14 @@ linkDialogPluginHooks: {
|
|
|
590
656
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
591
657
|
onBlur: RealmNode<FocusEvent>;
|
|
592
658
|
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
659
|
+
markdownProcessingError: RealmNode<{
|
|
660
|
+
error: string;
|
|
661
|
+
source: string;
|
|
662
|
+
} | null>;
|
|
663
|
+
markdownErrorSignal: RealmNode<{
|
|
664
|
+
error: string;
|
|
665
|
+
source: string;
|
|
666
|
+
}>;
|
|
593
667
|
}, K_2>) => void;
|
|
594
668
|
};
|
|
595
669
|
export {};
|