@mdxeditor/editor 0.17.2 → 0.19.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 +8 -0
- package/dist/MDXEditor.js +5 -0
- package/dist/gurx/realm.d.ts +2 -2
- package/dist/gurx/realm.js +5 -1
- package/dist/plugins/codeblock/index.d.ts +12 -2
- package/dist/plugins/codemirror/index.d.ts +16 -2
- package/dist/plugins/core/index.d.ts +11 -2
- package/dist/plugins/core/index.js +9 -2
- package/dist/plugins/diff-source/index.d.ts +12 -2
- package/dist/plugins/directives/index.d.ts +12 -2
- package/dist/plugins/frontmatter/index.d.ts +12 -2
- package/dist/plugins/headings/index.d.ts +12 -2
- package/dist/plugins/image/index.d.ts +12 -2
- package/dist/plugins/jsx/index.d.ts +12 -2
- package/dist/plugins/link/index.d.ts +1 -0
- package/dist/plugins/link-dialog/index.d.ts +10 -2
- package/dist/plugins/lists/index.d.ts +12 -2
- package/dist/plugins/markdown-shortcut/index.d.ts +1 -0
- package/dist/plugins/quote/index.d.ts +9 -2
- package/dist/plugins/sandpack/index.d.ts +16 -2
- package/dist/plugins/table/index.d.ts +12 -2
- package/dist/plugins/thematic-break/index.d.ts +12 -2
- package/dist/plugins/toolbar/index.d.ts +10 -2
- package/package.json +1 -1
package/dist/MDXEditor.d.ts
CHANGED
|
@@ -38,6 +38,10 @@ export interface MDXEditorProps {
|
|
|
38
38
|
* pass if you would like to have the editor automatically focused when mounted.
|
|
39
39
|
*/
|
|
40
40
|
autoFocus?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Triggered when focus leaves the editor
|
|
43
|
+
*/
|
|
44
|
+
onBlur?: (e: FocusEvent) => void;
|
|
41
45
|
/**
|
|
42
46
|
* The placeholder contents, displayed when the editor is empty.
|
|
43
47
|
*/
|
|
@@ -66,6 +70,10 @@ export interface MDXEditorMethods {
|
|
|
66
70
|
* Updates the markdown value of the editor.
|
|
67
71
|
*/
|
|
68
72
|
setMarkdown: (value: string) => void;
|
|
73
|
+
/**
|
|
74
|
+
* Sets focus on input
|
|
75
|
+
*/
|
|
76
|
+
focus: (callbackFn?: (() => void) | undefined, defaultSelection?: 'rootStart' | 'rootEnd') => void;
|
|
69
77
|
}
|
|
70
78
|
/**
|
|
71
79
|
* The MDXEditor React component. See {@link MDXEditorProps} for the list of properties supported and the {@link MDXEditorMethods} for the methods accessible through the ref.
|
package/dist/MDXEditor.js
CHANGED
|
@@ -88,6 +88,10 @@ const Methods = ({ mdxRef }) => {
|
|
|
88
88
|
},
|
|
89
89
|
setMarkdown: (markdown) => {
|
|
90
90
|
realm.pubKey("setMarkdown", markdown);
|
|
91
|
+
},
|
|
92
|
+
focus: (callbackFn, defaultSelection) => {
|
|
93
|
+
var _a;
|
|
94
|
+
(_a = realm.getKeyValue("rootEditor")) == null ? void 0 : _a.focus(callbackFn, { defaultSelection });
|
|
91
95
|
}
|
|
92
96
|
};
|
|
93
97
|
},
|
|
@@ -104,6 +108,7 @@ const MDXEditor = React__default.forwardRef((props, ref) => {
|
|
|
104
108
|
contentEditableClassName: props.contentEditableClassName ?? "",
|
|
105
109
|
initialMarkdown: props.markdown,
|
|
106
110
|
onChange: props.onChange ?? noop,
|
|
111
|
+
onBlur: props.onBlur ?? noop,
|
|
107
112
|
toMarkdownOptions: props.toMarkdownOptions ?? DEFAULT_MARKDOWN_OPTIONS,
|
|
108
113
|
autoFocus: props.autoFocus ?? false,
|
|
109
114
|
placeholder: props.placeholder ?? "",
|
package/dist/gurx/realm.d.ts
CHANGED
|
@@ -132,8 +132,8 @@ export declare function realm(): {
|
|
|
132
132
|
pubKey: (key: string, value: unknown) => void;
|
|
133
133
|
pubKeys: (values: Record<string, unknown>) => void;
|
|
134
134
|
resetSingletonSubs: () => void;
|
|
135
|
-
singletonSub: <T_13>({ key }: RealmNode<T_13>, subscription: Subscription<T_13>) => UnsubscribeHandle;
|
|
136
|
-
singletonSubKey: <T_14>(key: string, subscription: Subscription<T_14>) => UnsubscribeHandle;
|
|
135
|
+
singletonSub: <T_13>({ key }: RealmNode<T_13>, subscription: Subscription<T_13> | undefined) => UnsubscribeHandle;
|
|
136
|
+
singletonSubKey: <T_14>(key: string, subscription: Subscription<T_14> | undefined) => UnsubscribeHandle;
|
|
137
137
|
spread: <T_15 extends LongTuple<unknown>>(source: RealmNode<T_15>, initialValues: T_15) => NodesFromValues<T_15>;
|
|
138
138
|
sub: {
|
|
139
139
|
<T1_27>(args_0: RN<T1_27>, args_1: Subscription<T1_27>): UnsubscribeHandle;
|
package/dist/gurx/realm.js
CHANGED
|
@@ -81,7 +81,11 @@ function realm() {
|
|
|
81
81
|
return () => nodeSubscriptions.delete(subscription);
|
|
82
82
|
}
|
|
83
83
|
function singletonSub({ key }, subscription) {
|
|
84
|
-
|
|
84
|
+
if (!subscription) {
|
|
85
|
+
singletonSubscriptions.delete(key);
|
|
86
|
+
} else {
|
|
87
|
+
singletonSubscriptions.set(key, subscription);
|
|
88
|
+
}
|
|
85
89
|
return () => singletonSubscriptions.delete(key);
|
|
86
90
|
}
|
|
87
91
|
function singletonSubKey(key, subscription) {
|
|
@@ -116,6 +116,7 @@ export declare const codeBlockSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
116
116
|
applyBlockType: RealmNode<BlockType>;
|
|
117
117
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
118
118
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
119
|
+
onBlur: RealmNode<FocusEvent>;
|
|
119
120
|
}>], (r: Realm, [{ insertDecoratorNode }]: [{
|
|
120
121
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
121
122
|
inFocus: RealmNode<boolean>;
|
|
@@ -167,6 +168,7 @@ export declare const codeBlockSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
167
168
|
applyBlockType: RealmNode<BlockType>;
|
|
168
169
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
169
170
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
171
|
+
onBlur: RealmNode<FocusEvent>;
|
|
170
172
|
}]) => {
|
|
171
173
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
172
174
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -241,6 +243,7 @@ codeBlockPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
241
243
|
applyBlockType: RealmNode<BlockType>;
|
|
242
244
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
243
245
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
246
|
+
onBlur: RealmNode<FocusEvent>;
|
|
244
247
|
}>], (r: Realm, [{ insertDecoratorNode }]: [{
|
|
245
248
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
246
249
|
inFocus: RealmNode<boolean>;
|
|
@@ -292,6 +295,7 @@ codeBlockPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
292
295
|
applyBlockType: RealmNode<BlockType>;
|
|
293
296
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
294
297
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
298
|
+
onBlur: RealmNode<FocusEvent>;
|
|
295
299
|
}]) => {
|
|
296
300
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
297
301
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -358,8 +362,9 @@ codeBlockPluginHooks: {
|
|
|
358
362
|
applyBlockType: RealmNode<BlockType>;
|
|
359
363
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
360
364
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
365
|
+
onBlur: RealmNode<FocusEvent>;
|
|
361
366
|
}>;
|
|
362
|
-
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" | "codeBlockEditorDescriptors" | "defaultCodeBlockLanguage" | "appendCodeBlockEditorDescriptor" | "insertCodeBlock">(key: K, callback: (value: ValueForKey<{
|
|
367
|
+
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<{
|
|
363
368
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
364
369
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
365
370
|
appendCodeBlockEditorDescriptor: RealmNode<CodeBlockEditorDescriptor>;
|
|
@@ -415,6 +420,7 @@ codeBlockPluginHooks: {
|
|
|
415
420
|
applyBlockType: RealmNode<BlockType>;
|
|
416
421
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
417
422
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
423
|
+
onBlur: RealmNode<FocusEvent>;
|
|
418
424
|
}, K>) => void) => void;
|
|
419
425
|
useEmitterValues: <K_1 extends SystemKeys<{
|
|
420
426
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
@@ -472,6 +478,7 @@ codeBlockPluginHooks: {
|
|
|
472
478
|
applyBlockType: RealmNode<BlockType>;
|
|
473
479
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
474
480
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
481
|
+
onBlur: RealmNode<FocusEvent>;
|
|
475
482
|
}>>(...keys: K_1) => ValuesForKeys<{
|
|
476
483
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
477
484
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -528,6 +535,7 @@ codeBlockPluginHooks: {
|
|
|
528
535
|
applyBlockType: RealmNode<BlockType>;
|
|
529
536
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
530
537
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
538
|
+
onBlur: RealmNode<FocusEvent>;
|
|
531
539
|
}, K_1>;
|
|
532
540
|
usePubKeys: () => (values: SystemDict<{
|
|
533
541
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
@@ -585,8 +593,9 @@ codeBlockPluginHooks: {
|
|
|
585
593
|
applyBlockType: RealmNode<BlockType>;
|
|
586
594
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
587
595
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
596
|
+
onBlur: RealmNode<FocusEvent>;
|
|
588
597
|
}>) => void;
|
|
589
|
-
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" | "codeBlockEditorDescriptors" | "defaultCodeBlockLanguage" | "appendCodeBlockEditorDescriptor" | "insertCodeBlock">(key: K_2) => (value: ValueForKey<{
|
|
598
|
+
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<{
|
|
590
599
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
591
600
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
592
601
|
appendCodeBlockEditorDescriptor: RealmNode<CodeBlockEditorDescriptor>;
|
|
@@ -642,5 +651,6 @@ codeBlockPluginHooks: {
|
|
|
642
651
|
applyBlockType: RealmNode<BlockType>;
|
|
643
652
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
644
653
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
654
|
+
onBlur: RealmNode<FocusEvent>;
|
|
645
655
|
}, K_2>) => void;
|
|
646
656
|
};
|
|
@@ -64,6 +64,7 @@ export declare const codeMirrorSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
64
64
|
applyBlockType: RealmNode<BlockType>;
|
|
65
65
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
66
66
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
67
|
+
onBlur: RealmNode<FocusEvent>;
|
|
67
68
|
}>, SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
68
69
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
69
70
|
inFocus: RealmNode<boolean>;
|
|
@@ -115,6 +116,7 @@ export declare const codeMirrorSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
115
116
|
applyBlockType: RealmNode<BlockType>;
|
|
116
117
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
117
118
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
119
|
+
onBlur: RealmNode<FocusEvent>;
|
|
118
120
|
}>], (r: Realm, [{ insertDecoratorNode }]: [{
|
|
119
121
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
120
122
|
inFocus: RealmNode<boolean>;
|
|
@@ -166,6 +168,7 @@ export declare const codeMirrorSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
166
168
|
applyBlockType: RealmNode<BlockType>;
|
|
167
169
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
168
170
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
171
|
+
onBlur: RealmNode<FocusEvent>;
|
|
169
172
|
}]) => {
|
|
170
173
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
171
174
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -222,6 +225,7 @@ export declare const codeMirrorSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
222
225
|
applyBlockType: RealmNode<BlockType>;
|
|
223
226
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
224
227
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
228
|
+
onBlur: RealmNode<FocusEvent>;
|
|
225
229
|
}, {
|
|
226
230
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
227
231
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -287,6 +291,7 @@ codeMirrorPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
287
291
|
applyBlockType: RealmNode<BlockType>;
|
|
288
292
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
289
293
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
294
|
+
onBlur: RealmNode<FocusEvent>;
|
|
290
295
|
}>, SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
291
296
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
292
297
|
inFocus: RealmNode<boolean>;
|
|
@@ -338,6 +343,7 @@ codeMirrorPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
338
343
|
applyBlockType: RealmNode<BlockType>;
|
|
339
344
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
340
345
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
346
|
+
onBlur: RealmNode<FocusEvent>;
|
|
341
347
|
}>], (r: Realm, [{ insertDecoratorNode }]: [{
|
|
342
348
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
343
349
|
inFocus: RealmNode<boolean>;
|
|
@@ -389,6 +395,7 @@ codeMirrorPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
389
395
|
applyBlockType: RealmNode<BlockType>;
|
|
390
396
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
391
397
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
398
|
+
onBlur: RealmNode<FocusEvent>;
|
|
392
399
|
}]) => {
|
|
393
400
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
394
401
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -445,6 +452,7 @@ codeMirrorPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
445
452
|
applyBlockType: RealmNode<BlockType>;
|
|
446
453
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
447
454
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
455
|
+
onBlur: RealmNode<FocusEvent>;
|
|
448
456
|
}, {
|
|
449
457
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
450
458
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -518,13 +526,14 @@ codeMirrorHooks: {
|
|
|
518
526
|
applyBlockType: RealmNode<BlockType>;
|
|
519
527
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
520
528
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
529
|
+
onBlur: RealmNode<FocusEvent>;
|
|
521
530
|
} & {
|
|
522
531
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
523
532
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
524
533
|
appendCodeBlockEditorDescriptor: RealmNode<CodeBlockEditorDescriptor>;
|
|
525
534
|
insertCodeBlock: RealmNode<Partial<CreateCodeBlockNodeOptions>>;
|
|
526
535
|
}>;
|
|
527
|
-
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" | "codeBlockEditorDescriptors" | "defaultCodeBlockLanguage" | "appendCodeBlockEditorDescriptor" | "insertCodeBlock" | "codeBlockLanguages" | "insertCodeMirror">(key: K, callback: (value: ValueForKey<{
|
|
536
|
+
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<{
|
|
528
537
|
codeBlockLanguages: RealmNode<Record<string, string>>;
|
|
529
538
|
insertCodeMirror: RealmNode<{
|
|
530
539
|
language: string;
|
|
@@ -581,6 +590,7 @@ codeMirrorHooks: {
|
|
|
581
590
|
applyBlockType: RealmNode<BlockType>;
|
|
582
591
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
583
592
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
593
|
+
onBlur: RealmNode<FocusEvent>;
|
|
584
594
|
} & {
|
|
585
595
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
586
596
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -644,6 +654,7 @@ codeMirrorHooks: {
|
|
|
644
654
|
applyBlockType: RealmNode<BlockType>;
|
|
645
655
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
646
656
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
657
|
+
onBlur: RealmNode<FocusEvent>;
|
|
647
658
|
} & {
|
|
648
659
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
649
660
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -706,6 +717,7 @@ codeMirrorHooks: {
|
|
|
706
717
|
applyBlockType: RealmNode<BlockType>;
|
|
707
718
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
708
719
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
720
|
+
onBlur: RealmNode<FocusEvent>;
|
|
709
721
|
} & {
|
|
710
722
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
711
723
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -769,13 +781,14 @@ codeMirrorHooks: {
|
|
|
769
781
|
applyBlockType: RealmNode<BlockType>;
|
|
770
782
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
771
783
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
784
|
+
onBlur: RealmNode<FocusEvent>;
|
|
772
785
|
} & {
|
|
773
786
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
774
787
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
775
788
|
appendCodeBlockEditorDescriptor: RealmNode<CodeBlockEditorDescriptor>;
|
|
776
789
|
insertCodeBlock: RealmNode<Partial<CreateCodeBlockNodeOptions>>;
|
|
777
790
|
}>) => void;
|
|
778
|
-
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" | "codeBlockEditorDescriptors" | "defaultCodeBlockLanguage" | "appendCodeBlockEditorDescriptor" | "insertCodeBlock" | "codeBlockLanguages" | "insertCodeMirror">(key: K_2) => (value: ValueForKey<{
|
|
791
|
+
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<{
|
|
779
792
|
codeBlockLanguages: RealmNode<Record<string, string>>;
|
|
780
793
|
insertCodeMirror: RealmNode<{
|
|
781
794
|
language: string;
|
|
@@ -832,6 +845,7 @@ codeMirrorHooks: {
|
|
|
832
845
|
applyBlockType: RealmNode<BlockType>;
|
|
833
846
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
834
847
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
848
|
+
onBlur: RealmNode<FocusEvent>;
|
|
835
849
|
} & {
|
|
836
850
|
codeBlockEditorDescriptors: RealmNode<CodeBlockEditorDescriptor[]>;
|
|
837
851
|
defaultCodeBlockLanguage: RealmNode<string>;
|
|
@@ -79,6 +79,7 @@ export declare const coreSystem: SystemSpec<[], (r: Realm) => {
|
|
|
79
79
|
applyBlockType: RealmNode<BlockType>;
|
|
80
80
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
81
81
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
82
|
+
onBlur: RealmNode<FocusEvent>;
|
|
82
83
|
}>;
|
|
83
84
|
interface CorePluginParams {
|
|
84
85
|
initialMarkdown: string;
|
|
@@ -86,6 +87,7 @@ interface CorePluginParams {
|
|
|
86
87
|
placeholder?: React.ReactNode;
|
|
87
88
|
autoFocus: boolean;
|
|
88
89
|
onChange: (markdown: string) => void;
|
|
90
|
+
onBlur?: (e: FocusEvent) => void;
|
|
89
91
|
toMarkdownOptions: NonNullable<LexicalConvertOptions['toMarkdownOptions']>;
|
|
90
92
|
readOnly: boolean;
|
|
91
93
|
}
|
|
@@ -142,6 +144,7 @@ corePlugin: PluginConstructor<SystemSpec<[], (r: Realm) => {
|
|
|
142
144
|
applyBlockType: RealmNode<BlockType>;
|
|
143
145
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
144
146
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
147
|
+
onBlur: RealmNode<FocusEvent>;
|
|
145
148
|
}>, CorePluginParams>,
|
|
146
149
|
/** @internal */
|
|
147
150
|
corePluginHooks: {
|
|
@@ -196,8 +199,9 @@ corePluginHooks: {
|
|
|
196
199
|
applyBlockType: RealmNode<BlockType>;
|
|
197
200
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
198
201
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
202
|
+
onBlur: RealmNode<FocusEvent>;
|
|
199
203
|
}>;
|
|
200
|
-
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">(key: K, callback: (value: ValueForKey<{
|
|
204
|
+
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<{
|
|
201
205
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
202
206
|
inFocus: RealmNode<boolean>;
|
|
203
207
|
historyState: RealmNode<HistoryState>;
|
|
@@ -248,6 +252,7 @@ corePluginHooks: {
|
|
|
248
252
|
applyBlockType: RealmNode<BlockType>;
|
|
249
253
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
250
254
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
255
|
+
onBlur: RealmNode<FocusEvent>;
|
|
251
256
|
}, K>) => void) => void;
|
|
252
257
|
useEmitterValues: <K_1 extends SystemKeys<{
|
|
253
258
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
@@ -300,6 +305,7 @@ corePluginHooks: {
|
|
|
300
305
|
applyBlockType: RealmNode<BlockType>;
|
|
301
306
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
302
307
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
308
|
+
onBlur: RealmNode<FocusEvent>;
|
|
303
309
|
}>>(...keys: K_1) => ValuesForKeys<{
|
|
304
310
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
305
311
|
inFocus: RealmNode<boolean>;
|
|
@@ -351,6 +357,7 @@ corePluginHooks: {
|
|
|
351
357
|
applyBlockType: RealmNode<BlockType>;
|
|
352
358
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
353
359
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
360
|
+
onBlur: RealmNode<FocusEvent>;
|
|
354
361
|
}, K_1>;
|
|
355
362
|
usePubKeys: () => (values: SystemDict<{
|
|
356
363
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
@@ -403,8 +410,9 @@ corePluginHooks: {
|
|
|
403
410
|
applyBlockType: RealmNode<BlockType>;
|
|
404
411
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
405
412
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
413
|
+
onBlur: RealmNode<FocusEvent>;
|
|
406
414
|
}>) => void;
|
|
407
|
-
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">(key: K_2) => (value: ValueForKey<{
|
|
415
|
+
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<{
|
|
408
416
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
409
417
|
inFocus: RealmNode<boolean>;
|
|
410
418
|
historyState: RealmNode<HistoryState>;
|
|
@@ -455,6 +463,7 @@ corePluginHooks: {
|
|
|
455
463
|
applyBlockType: RealmNode<BlockType>;
|
|
456
464
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
457
465
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
466
|
+
onBlur: RealmNode<FocusEvent>;
|
|
458
467
|
}, K_2>) => void;
|
|
459
468
|
};
|
|
460
469
|
export {};
|
|
@@ -51,6 +51,7 @@ const coreSystem = system((r) => {
|
|
|
51
51
|
const activeEditorSubscriptions = r.node([]);
|
|
52
52
|
const rootEditorSubscriptions = r.node([]);
|
|
53
53
|
const editorInFocus = r.node(null);
|
|
54
|
+
const onBlur = r.node();
|
|
54
55
|
const rebind = () => r.o.scan((teardowns, [subs, activeEditorValue]) => {
|
|
55
56
|
teardowns.forEach((teardown) => {
|
|
56
57
|
if (!teardown) {
|
|
@@ -179,7 +180,10 @@ const coreSystem = system((r) => {
|
|
|
179
180
|
if (theRootEditor) {
|
|
180
181
|
const movingOutside = !((_a = theRootEditor.getRootElement()) == null ? void 0 : _a.contains(payload.relatedTarget));
|
|
181
182
|
if (movingOutside) {
|
|
182
|
-
r.
|
|
183
|
+
r.pubIn({
|
|
184
|
+
[inFocus.key]: false,
|
|
185
|
+
[onBlur.key]: payload
|
|
186
|
+
});
|
|
183
187
|
}
|
|
184
188
|
}
|
|
185
189
|
return false;
|
|
@@ -344,7 +348,9 @@ const coreSystem = system((r) => {
|
|
|
344
348
|
currentBlockType,
|
|
345
349
|
applyBlockType,
|
|
346
350
|
convertSelectionToNode,
|
|
347
|
-
insertDecoratorNode
|
|
351
|
+
insertDecoratorNode,
|
|
352
|
+
// Events
|
|
353
|
+
onBlur
|
|
348
354
|
};
|
|
349
355
|
}, []);
|
|
350
356
|
const [
|
|
@@ -364,6 +370,7 @@ const [
|
|
|
364
370
|
readOnly: params.readOnly
|
|
365
371
|
});
|
|
366
372
|
realm.singletonSubKey("markdown", params.onChange);
|
|
373
|
+
realm.singletonSubKey("onBlur", params.onBlur);
|
|
367
374
|
},
|
|
368
375
|
init(realm, params) {
|
|
369
376
|
realm.pubKey("initialMarkdown", params.initialMarkdown.trim());
|
|
@@ -65,6 +65,7 @@ export declare const diffSourceSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
65
65
|
applyBlockType: RealmNode<BlockType>;
|
|
66
66
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
67
67
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
68
|
+
onBlur: RealmNode<FocusEvent>;
|
|
68
69
|
}>], (r: Realm, [{ markdown, setMarkdown }]: [{
|
|
69
70
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
70
71
|
inFocus: RealmNode<boolean>;
|
|
@@ -116,6 +117,7 @@ export declare const diffSourceSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
116
117
|
applyBlockType: RealmNode<BlockType>;
|
|
117
118
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
118
119
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
120
|
+
onBlur: RealmNode<FocusEvent>;
|
|
119
121
|
}]) => {
|
|
120
122
|
viewMode: RealmNode<ViewMode>;
|
|
121
123
|
diffMarkdown: RealmNode<string>;
|
|
@@ -174,6 +176,7 @@ diffSourcePlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
174
176
|
applyBlockType: RealmNode<BlockType>;
|
|
175
177
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
176
178
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
179
|
+
onBlur: RealmNode<FocusEvent>;
|
|
177
180
|
}>], (r: Realm, [{ markdown, setMarkdown }]: [{
|
|
178
181
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
179
182
|
inFocus: RealmNode<boolean>;
|
|
@@ -225,6 +228,7 @@ diffSourcePlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
225
228
|
applyBlockType: RealmNode<BlockType>;
|
|
226
229
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
227
230
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
231
|
+
onBlur: RealmNode<FocusEvent>;
|
|
228
232
|
}]) => {
|
|
229
233
|
viewMode: RealmNode<ViewMode>;
|
|
230
234
|
diffMarkdown: RealmNode<string>;
|
|
@@ -290,8 +294,9 @@ diffSourcePluginHooks: {
|
|
|
290
294
|
applyBlockType: RealmNode<BlockType>;
|
|
291
295
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
292
296
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
297
|
+
onBlur: RealmNode<FocusEvent>;
|
|
293
298
|
}>;
|
|
294
|
-
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" | "viewMode" | "diffMarkdown" | "markdownSourceEditorValue">(key: K, callback: (value: ValueForKey<{
|
|
299
|
+
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" | "viewMode" | "diffMarkdown" | "markdownSourceEditorValue">(key: K, callback: (value: ValueForKey<{
|
|
295
300
|
viewMode: RealmNode<ViewMode>;
|
|
296
301
|
diffMarkdown: RealmNode<string>;
|
|
297
302
|
markdownSourceEditorValue: RealmNode<string>;
|
|
@@ -346,6 +351,7 @@ diffSourcePluginHooks: {
|
|
|
346
351
|
applyBlockType: RealmNode<BlockType>;
|
|
347
352
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
348
353
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
354
|
+
onBlur: RealmNode<FocusEvent>;
|
|
349
355
|
}, K>) => void) => void;
|
|
350
356
|
useEmitterValues: <K_1 extends SystemKeys<{
|
|
351
357
|
viewMode: RealmNode<ViewMode>;
|
|
@@ -402,6 +408,7 @@ diffSourcePluginHooks: {
|
|
|
402
408
|
applyBlockType: RealmNode<BlockType>;
|
|
403
409
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
404
410
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
411
|
+
onBlur: RealmNode<FocusEvent>;
|
|
405
412
|
}>>(...keys: K_1) => ValuesForKeys<{
|
|
406
413
|
viewMode: RealmNode<ViewMode>;
|
|
407
414
|
diffMarkdown: RealmNode<string>;
|
|
@@ -457,6 +464,7 @@ diffSourcePluginHooks: {
|
|
|
457
464
|
applyBlockType: RealmNode<BlockType>;
|
|
458
465
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
459
466
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
467
|
+
onBlur: RealmNode<FocusEvent>;
|
|
460
468
|
}, K_1>;
|
|
461
469
|
usePubKeys: () => (values: SystemDict<{
|
|
462
470
|
viewMode: RealmNode<ViewMode>;
|
|
@@ -513,8 +521,9 @@ diffSourcePluginHooks: {
|
|
|
513
521
|
applyBlockType: RealmNode<BlockType>;
|
|
514
522
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
515
523
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
524
|
+
onBlur: RealmNode<FocusEvent>;
|
|
516
525
|
}>) => void;
|
|
517
|
-
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" | "viewMode" | "diffMarkdown" | "markdownSourceEditorValue">(key: K_2) => (value: ValueForKey<{
|
|
526
|
+
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" | "viewMode" | "diffMarkdown" | "markdownSourceEditorValue">(key: K_2) => (value: ValueForKey<{
|
|
518
527
|
viewMode: RealmNode<ViewMode>;
|
|
519
528
|
diffMarkdown: RealmNode<string>;
|
|
520
529
|
markdownSourceEditorValue: RealmNode<string>;
|
|
@@ -569,5 +578,6 @@ diffSourcePluginHooks: {
|
|
|
569
578
|
applyBlockType: RealmNode<BlockType>;
|
|
570
579
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
571
580
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
581
|
+
onBlur: RealmNode<FocusEvent>;
|
|
572
582
|
}, K_2>) => void;
|
|
573
583
|
};
|
|
@@ -122,6 +122,7 @@ export declare const directivesSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
122
122
|
applyBlockType: RealmNode<BlockType>;
|
|
123
123
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
124
124
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
125
|
+
onBlur: RealmNode<FocusEvent>;
|
|
125
126
|
}>], (r: Realm, [{ insertDecoratorNode }]: [{
|
|
126
127
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
127
128
|
inFocus: RealmNode<boolean>;
|
|
@@ -173,6 +174,7 @@ export declare const directivesSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
173
174
|
applyBlockType: RealmNode<BlockType>;
|
|
174
175
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
175
176
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
177
|
+
onBlur: RealmNode<FocusEvent>;
|
|
176
178
|
}]) => {
|
|
177
179
|
directiveDescriptors: RealmNode<DirectiveDescriptor<any>[]>;
|
|
178
180
|
insertDirective: RealmNode<InsertDirectivePayload>;
|
|
@@ -242,6 +244,7 @@ directivesPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
242
244
|
applyBlockType: RealmNode<BlockType>;
|
|
243
245
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
244
246
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
247
|
+
onBlur: RealmNode<FocusEvent>;
|
|
245
248
|
}>], (r: Realm, [{ insertDecoratorNode }]: [{
|
|
246
249
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
247
250
|
inFocus: RealmNode<boolean>;
|
|
@@ -293,6 +296,7 @@ directivesPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
293
296
|
applyBlockType: RealmNode<BlockType>;
|
|
294
297
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
295
298
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
299
|
+
onBlur: RealmNode<FocusEvent>;
|
|
296
300
|
}]) => {
|
|
297
301
|
directiveDescriptors: RealmNode<DirectiveDescriptor<any>[]>;
|
|
298
302
|
insertDirective: RealmNode<InsertDirectivePayload>;
|
|
@@ -353,8 +357,9 @@ directivesPluginHooks: {
|
|
|
353
357
|
applyBlockType: RealmNode<BlockType>;
|
|
354
358
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
355
359
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
360
|
+
onBlur: RealmNode<FocusEvent>;
|
|
356
361
|
}>;
|
|
357
|
-
useEmitter: <K extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "directiveDescriptors" | "insertDirective">(key: K, callback: (value: ValueForKey<{
|
|
362
|
+
useEmitter: <K extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "directiveDescriptors" | "insertDirective">(key: K, callback: (value: ValueForKey<{
|
|
358
363
|
directiveDescriptors: RealmNode<DirectiveDescriptor<any>[]>;
|
|
359
364
|
insertDirective: RealmNode<InsertDirectivePayload>;
|
|
360
365
|
} & {
|
|
@@ -408,6 +413,7 @@ directivesPluginHooks: {
|
|
|
408
413
|
applyBlockType: RealmNode<BlockType>;
|
|
409
414
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
410
415
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
416
|
+
onBlur: RealmNode<FocusEvent>;
|
|
411
417
|
}, K>) => void) => void;
|
|
412
418
|
useEmitterValues: <K_1 extends SystemKeys<{
|
|
413
419
|
directiveDescriptors: RealmNode<DirectiveDescriptor<any>[]>;
|
|
@@ -463,6 +469,7 @@ directivesPluginHooks: {
|
|
|
463
469
|
applyBlockType: RealmNode<BlockType>;
|
|
464
470
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
465
471
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
472
|
+
onBlur: RealmNode<FocusEvent>;
|
|
466
473
|
}>>(...keys: K_1) => ValuesForKeys<{
|
|
467
474
|
directiveDescriptors: RealmNode<DirectiveDescriptor<any>[]>;
|
|
468
475
|
insertDirective: RealmNode<InsertDirectivePayload>;
|
|
@@ -517,6 +524,7 @@ directivesPluginHooks: {
|
|
|
517
524
|
applyBlockType: RealmNode<BlockType>;
|
|
518
525
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
519
526
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
527
|
+
onBlur: RealmNode<FocusEvent>;
|
|
520
528
|
}, K_1>;
|
|
521
529
|
usePubKeys: () => (values: SystemDict<{
|
|
522
530
|
directiveDescriptors: RealmNode<DirectiveDescriptor<any>[]>;
|
|
@@ -572,8 +580,9 @@ directivesPluginHooks: {
|
|
|
572
580
|
applyBlockType: RealmNode<BlockType>;
|
|
573
581
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
574
582
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
583
|
+
onBlur: RealmNode<FocusEvent>;
|
|
575
584
|
}>) => void;
|
|
576
|
-
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" | "directiveDescriptors" | "insertDirective">(key: K_2) => (value: ValueForKey<{
|
|
585
|
+
usePublisher: <K_2 extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "directiveDescriptors" | "insertDirective">(key: K_2) => (value: ValueForKey<{
|
|
577
586
|
directiveDescriptors: RealmNode<DirectiveDescriptor<any>[]>;
|
|
578
587
|
insertDirective: RealmNode<InsertDirectivePayload>;
|
|
579
588
|
} & {
|
|
@@ -627,6 +636,7 @@ directivesPluginHooks: {
|
|
|
627
636
|
applyBlockType: RealmNode<BlockType>;
|
|
628
637
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
629
638
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
639
|
+
onBlur: RealmNode<FocusEvent>;
|
|
630
640
|
}, K_2>) => void;
|
|
631
641
|
};
|
|
632
642
|
export {};
|