@mdxeditor/editor 0.11.1 → 0.12.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 +4 -0
- package/dist/MDXEditor.js +4 -2
- package/dist/exportMarkdownFromLexical.d.ts +19 -0
- package/dist/gurx/react.d.ts +34 -6
- package/dist/gurx/realm.d.ts +18 -2
- package/dist/gurx/realmFactory.d.ts +23 -2
- package/dist/icons/rich_text.svg.js +2 -2
- package/dist/importMarkdownToLexical.d.ts +7 -0
- 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 +21 -2
- package/dist/plugins/core/index.js +7 -0
- package/dist/plugins/diff-source/index.d.ts +12 -2
- package/dist/plugins/directives/index.d.ts +12 -2
- package/dist/plugins/frontmatter/FrontmatterEditor.js +1 -2
- package/dist/plugins/frontmatter/index.d.ts +12 -2
- package/dist/plugins/headings/index.d.ts +2 -0
- 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/dist/plugins/toolbar/primitives/select.js +1 -1
- package/dist/style.css +167 -164
- package/dist/styles/ui.module.css.js +83 -83
- package/package.json +1 -1
|
@@ -11,13 +11,23 @@ import type { LexicalVisitor, LexicalConvertOptions } from '../../exportMarkdown
|
|
|
11
11
|
import type { SystemSpec, Realm, PluginConstructor, TypedRealm, ValueForKey, SystemKeys, ValuesForKeys, SystemDict, RealmNode } from '../../gurx';
|
|
12
12
|
import { MdastImportVisitor } from '../../importMarkdownToLexical';
|
|
13
13
|
import type { JsxComponentDescriptor } from '../jsx';
|
|
14
|
+
/** @internal */
|
|
14
15
|
export type EditorSubscription = (activeEditor: LexicalEditor) => () => void;
|
|
16
|
+
/** @internal */
|
|
15
17
|
export type BlockType = 'paragraph' | 'quote' | HeadingTagType | '';
|
|
18
|
+
/**
|
|
19
|
+
* The type of the editor being edited currently. Custom editors can override this, so that the toolbar can change contents.
|
|
20
|
+
*/
|
|
16
21
|
export interface EditorInFocus {
|
|
17
22
|
editorType: string;
|
|
18
23
|
rootNode: LexicalNode | null;
|
|
19
24
|
}
|
|
25
|
+
/** @internal */
|
|
20
26
|
export declare const NESTED_EDITOR_UPDATED_COMMAND: LexicalCommand<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Add the the core system when creating systemf for your own plugins.
|
|
29
|
+
* This gives you access to the component core state and logic, like the visitors, the lexical nodes, and the publishers used to insert nodes in the editor.
|
|
30
|
+
*/
|
|
21
31
|
export declare const coreSystem: SystemSpec<[], (r: Realm) => {
|
|
22
32
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
23
33
|
inFocus: RealmNode<boolean>;
|
|
@@ -47,6 +57,7 @@ export declare const coreSystem: SystemSpec<[], (r: Realm) => {
|
|
|
47
57
|
markdown: RealmNode<string>;
|
|
48
58
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
49
59
|
contentEditableClassName: RealmNode<string>;
|
|
60
|
+
autoFocus: RealmNode<boolean>;
|
|
50
61
|
composerChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
51
62
|
addComposerChild: RealmNode<React.ComponentType<{}>>;
|
|
52
63
|
topAreaChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
@@ -70,6 +81,7 @@ export declare const coreSystem: SystemSpec<[], (r: Realm) => {
|
|
|
70
81
|
interface CorePluginParams {
|
|
71
82
|
initialMarkdown: string;
|
|
72
83
|
contentEditableClassName: string;
|
|
84
|
+
autoFocus: boolean;
|
|
73
85
|
onChange: (markdown: string) => void;
|
|
74
86
|
toMarkdownOptions: NonNullable<LexicalConvertOptions['toMarkdownOptions']>;
|
|
75
87
|
}
|
|
@@ -104,6 +116,7 @@ corePlugin: PluginConstructor<SystemSpec<[], (r: Realm) => {
|
|
|
104
116
|
markdown: RealmNode<string>;
|
|
105
117
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
106
118
|
contentEditableClassName: RealmNode<string>;
|
|
119
|
+
autoFocus: RealmNode<boolean>;
|
|
107
120
|
composerChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
108
121
|
addComposerChild: RealmNode<React.ComponentType<{}>>;
|
|
109
122
|
topAreaChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
@@ -155,6 +168,7 @@ corePluginHooks: {
|
|
|
155
168
|
markdown: RealmNode<string>;
|
|
156
169
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
157
170
|
contentEditableClassName: RealmNode<string>;
|
|
171
|
+
autoFocus: RealmNode<boolean>;
|
|
158
172
|
composerChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
159
173
|
addComposerChild: RealmNode<React.ComponentType<{}>>;
|
|
160
174
|
topAreaChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
@@ -175,7 +189,7 @@ corePluginHooks: {
|
|
|
175
189
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
176
190
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
177
191
|
}>;
|
|
178
|
-
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" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode">(key: K, callback: (value: ValueForKey<{
|
|
192
|
+
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" | "autoFocus" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode">(key: K, callback: (value: ValueForKey<{
|
|
179
193
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
180
194
|
inFocus: RealmNode<boolean>;
|
|
181
195
|
historyState: RealmNode<HistoryState>;
|
|
@@ -204,6 +218,7 @@ corePluginHooks: {
|
|
|
204
218
|
markdown: RealmNode<string>;
|
|
205
219
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
206
220
|
contentEditableClassName: RealmNode<string>;
|
|
221
|
+
autoFocus: RealmNode<boolean>;
|
|
207
222
|
composerChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
208
223
|
addComposerChild: RealmNode<React.ComponentType<{}>>;
|
|
209
224
|
topAreaChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
@@ -253,6 +268,7 @@ corePluginHooks: {
|
|
|
253
268
|
markdown: RealmNode<string>;
|
|
254
269
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
255
270
|
contentEditableClassName: RealmNode<string>;
|
|
271
|
+
autoFocus: RealmNode<boolean>;
|
|
256
272
|
composerChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
257
273
|
addComposerChild: RealmNode<React.ComponentType<{}>>;
|
|
258
274
|
topAreaChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
@@ -301,6 +317,7 @@ corePluginHooks: {
|
|
|
301
317
|
markdown: RealmNode<string>;
|
|
302
318
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
303
319
|
contentEditableClassName: RealmNode<string>;
|
|
320
|
+
autoFocus: RealmNode<boolean>;
|
|
304
321
|
composerChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
305
322
|
addComposerChild: RealmNode<React.ComponentType<{}>>;
|
|
306
323
|
topAreaChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
@@ -350,6 +367,7 @@ corePluginHooks: {
|
|
|
350
367
|
markdown: RealmNode<string>;
|
|
351
368
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
352
369
|
contentEditableClassName: RealmNode<string>;
|
|
370
|
+
autoFocus: RealmNode<boolean>;
|
|
353
371
|
composerChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
354
372
|
addComposerChild: RealmNode<React.ComponentType<{}>>;
|
|
355
373
|
topAreaChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
@@ -370,7 +388,7 @@ corePluginHooks: {
|
|
|
370
388
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
371
389
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
372
390
|
}>) => void;
|
|
373
|
-
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" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode">(key: K_2) => (value: ValueForKey<{
|
|
391
|
+
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" | "autoFocus" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode">(key: K_2) => (value: ValueForKey<{
|
|
374
392
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
375
393
|
inFocus: RealmNode<boolean>;
|
|
376
394
|
historyState: RealmNode<HistoryState>;
|
|
@@ -399,6 +417,7 @@ corePluginHooks: {
|
|
|
399
417
|
markdown: RealmNode<string>;
|
|
400
418
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
401
419
|
contentEditableClassName: RealmNode<string>;
|
|
420
|
+
autoFocus: RealmNode<boolean>;
|
|
402
421
|
composerChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
403
422
|
addComposerChild: RealmNode<React.ComponentType<{}>>;
|
|
404
423
|
topAreaChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
@@ -15,6 +15,7 @@ import { MdastParagraphVisitor } from "./MdastParagraphVisitor.js";
|
|
|
15
15
|
import { MdastRootVisitor } from "./MdastRootVisitor.js";
|
|
16
16
|
import { MdastTextVisitor } from "./MdastTextVisitor.js";
|
|
17
17
|
import { SharedHistoryPlugin } from "./SharedHistoryPlugin.js";
|
|
18
|
+
import { noop } from "../../utils/fp.js";
|
|
18
19
|
import { system } from "../../gurx/realmFactory.js";
|
|
19
20
|
import { realmPlugin } from "../../gurx/react.js";
|
|
20
21
|
const NESTED_EDITOR_UPDATED_COMMAND = createCommand("NESTED_EDITOR_UPDATED_COMMAND");
|
|
@@ -39,6 +40,7 @@ const coreSystem = system((r) => {
|
|
|
39
40
|
const rootEditor = r.node(null);
|
|
40
41
|
const activeEditor = r.node(null, true);
|
|
41
42
|
const contentEditableClassName = r.node("");
|
|
43
|
+
const autoFocus = r.node(false);
|
|
42
44
|
const inFocus = r.node(false, true);
|
|
43
45
|
const currentFormat = r.node(0, true);
|
|
44
46
|
const applyFormat = r.node();
|
|
@@ -154,6 +156,9 @@ const coreSystem = system((r) => {
|
|
|
154
156
|
markdown: r.getValue(initialMarkdown),
|
|
155
157
|
syntaxExtensions: r.getValue(syntaxExtensions)
|
|
156
158
|
});
|
|
159
|
+
if (r.getValue(autoFocus)) {
|
|
160
|
+
setTimeout(() => theRootEditor.focus(noop, { defaultSelection: "rootStart" }));
|
|
161
|
+
}
|
|
157
162
|
});
|
|
158
163
|
r.pub(createActiveEditorSubscription, (editor) => {
|
|
159
164
|
return editor.registerUpdateListener(({ editorState }) => {
|
|
@@ -290,6 +295,7 @@ const coreSystem = system((r) => {
|
|
|
290
295
|
// DOM
|
|
291
296
|
editorRootElementRef,
|
|
292
297
|
contentEditableClassName,
|
|
298
|
+
autoFocus,
|
|
293
299
|
// child controls
|
|
294
300
|
composerChildren,
|
|
295
301
|
addComposerChild,
|
|
@@ -320,6 +326,7 @@ const [
|
|
|
320
326
|
applyParamsToSystem(realm, params) {
|
|
321
327
|
realm.pubKey("contentEditableClassName", params.contentEditableClassName);
|
|
322
328
|
realm.pubKey("toMarkdownOptions", params.toMarkdownOptions);
|
|
329
|
+
realm.pubKey("autoFocus", params.autoFocus);
|
|
323
330
|
realm.singletonSubKey("markdown", params.onChange);
|
|
324
331
|
},
|
|
325
332
|
init(realm, params) {
|
|
@@ -43,6 +43,7 @@ export declare const diffSourceSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
43
43
|
markdown: RealmNode<string>;
|
|
44
44
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
45
45
|
contentEditableClassName: RealmNode<string>;
|
|
46
|
+
autoFocus: RealmNode<boolean>;
|
|
46
47
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
47
48
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
48
49
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -91,6 +92,7 @@ export declare const diffSourceSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
91
92
|
markdown: RealmNode<string>;
|
|
92
93
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
93
94
|
contentEditableClassName: RealmNode<string>;
|
|
95
|
+
autoFocus: RealmNode<boolean>;
|
|
94
96
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
95
97
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
96
98
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -146,6 +148,7 @@ diffSourcePlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
146
148
|
markdown: RealmNode<string>;
|
|
147
149
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
148
150
|
contentEditableClassName: RealmNode<string>;
|
|
151
|
+
autoFocus: RealmNode<boolean>;
|
|
149
152
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
150
153
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
151
154
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -194,6 +197,7 @@ diffSourcePlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
194
197
|
markdown: RealmNode<string>;
|
|
195
198
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
196
199
|
contentEditableClassName: RealmNode<string>;
|
|
200
|
+
autoFocus: RealmNode<boolean>;
|
|
197
201
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
198
202
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
199
203
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -256,6 +260,7 @@ diffSourcePluginHooks: {
|
|
|
256
260
|
markdown: RealmNode<string>;
|
|
257
261
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
258
262
|
contentEditableClassName: RealmNode<string>;
|
|
263
|
+
autoFocus: RealmNode<boolean>;
|
|
259
264
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
260
265
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
261
266
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -276,7 +281,7 @@ diffSourcePluginHooks: {
|
|
|
276
281
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
277
282
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
278
283
|
}>;
|
|
279
|
-
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" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "viewMode" | "diffMarkdown" | "markdownSourceEditorValue">(key: K, callback: (value: ValueForKey<{
|
|
284
|
+
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" | "autoFocus" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "viewMode" | "diffMarkdown" | "markdownSourceEditorValue">(key: K, callback: (value: ValueForKey<{
|
|
280
285
|
viewMode: RealmNode<ViewMode>;
|
|
281
286
|
diffMarkdown: RealmNode<string>;
|
|
282
287
|
markdownSourceEditorValue: RealmNode<string>;
|
|
@@ -309,6 +314,7 @@ diffSourcePluginHooks: {
|
|
|
309
314
|
markdown: RealmNode<string>;
|
|
310
315
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
311
316
|
contentEditableClassName: RealmNode<string>;
|
|
317
|
+
autoFocus: RealmNode<boolean>;
|
|
312
318
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
313
319
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
314
320
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -362,6 +368,7 @@ diffSourcePluginHooks: {
|
|
|
362
368
|
markdown: RealmNode<string>;
|
|
363
369
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
364
370
|
contentEditableClassName: RealmNode<string>;
|
|
371
|
+
autoFocus: RealmNode<boolean>;
|
|
365
372
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
366
373
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
367
374
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -414,6 +421,7 @@ diffSourcePluginHooks: {
|
|
|
414
421
|
markdown: RealmNode<string>;
|
|
415
422
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
416
423
|
contentEditableClassName: RealmNode<string>;
|
|
424
|
+
autoFocus: RealmNode<boolean>;
|
|
417
425
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
418
426
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
419
427
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -467,6 +475,7 @@ diffSourcePluginHooks: {
|
|
|
467
475
|
markdown: RealmNode<string>;
|
|
468
476
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
469
477
|
contentEditableClassName: RealmNode<string>;
|
|
478
|
+
autoFocus: RealmNode<boolean>;
|
|
470
479
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
471
480
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
472
481
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -487,7 +496,7 @@ diffSourcePluginHooks: {
|
|
|
487
496
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
488
497
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
489
498
|
}>) => void;
|
|
490
|
-
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" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "viewMode" | "diffMarkdown" | "markdownSourceEditorValue">(key: K_2) => (value: ValueForKey<{
|
|
499
|
+
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" | "autoFocus" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "viewMode" | "diffMarkdown" | "markdownSourceEditorValue">(key: K_2) => (value: ValueForKey<{
|
|
491
500
|
viewMode: RealmNode<ViewMode>;
|
|
492
501
|
diffMarkdown: RealmNode<string>;
|
|
493
502
|
markdownSourceEditorValue: RealmNode<string>;
|
|
@@ -520,6 +529,7 @@ diffSourcePluginHooks: {
|
|
|
520
529
|
markdown: RealmNode<string>;
|
|
521
530
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
522
531
|
contentEditableClassName: RealmNode<string>;
|
|
532
|
+
autoFocus: RealmNode<boolean>;
|
|
523
533
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
524
534
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
525
535
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -100,6 +100,7 @@ export declare const directivesSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
100
100
|
markdown: RealmNode<string>;
|
|
101
101
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
102
102
|
contentEditableClassName: RealmNode<string>;
|
|
103
|
+
autoFocus: RealmNode<boolean>;
|
|
103
104
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
104
105
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
105
106
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -148,6 +149,7 @@ export declare const directivesSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
148
149
|
markdown: RealmNode<string>;
|
|
149
150
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
150
151
|
contentEditableClassName: RealmNode<string>;
|
|
152
|
+
autoFocus: RealmNode<boolean>;
|
|
151
153
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
152
154
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
153
155
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -214,6 +216,7 @@ directivesPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
214
216
|
markdown: RealmNode<string>;
|
|
215
217
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
216
218
|
contentEditableClassName: RealmNode<string>;
|
|
219
|
+
autoFocus: RealmNode<boolean>;
|
|
217
220
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
218
221
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
219
222
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -262,6 +265,7 @@ directivesPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
262
265
|
markdown: RealmNode<string>;
|
|
263
266
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
264
267
|
contentEditableClassName: RealmNode<string>;
|
|
268
|
+
autoFocus: RealmNode<boolean>;
|
|
265
269
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
266
270
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
267
271
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -319,6 +323,7 @@ directivesPluginHooks: {
|
|
|
319
323
|
markdown: RealmNode<string>;
|
|
320
324
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
321
325
|
contentEditableClassName: RealmNode<string>;
|
|
326
|
+
autoFocus: RealmNode<boolean>;
|
|
322
327
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
323
328
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
324
329
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -339,7 +344,7 @@ directivesPluginHooks: {
|
|
|
339
344
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
340
345
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
341
346
|
}>;
|
|
342
|
-
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" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "directiveDescriptors" | "insertDirective">(key: K, callback: (value: ValueForKey<{
|
|
347
|
+
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" | "autoFocus" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "directiveDescriptors" | "insertDirective">(key: K, callback: (value: ValueForKey<{
|
|
343
348
|
directiveDescriptors: RealmNode<DirectiveDescriptor<any>[]>;
|
|
344
349
|
insertDirective: RealmNode<InsertDirectivePayload>;
|
|
345
350
|
} & {
|
|
@@ -371,6 +376,7 @@ directivesPluginHooks: {
|
|
|
371
376
|
markdown: RealmNode<string>;
|
|
372
377
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
373
378
|
contentEditableClassName: RealmNode<string>;
|
|
379
|
+
autoFocus: RealmNode<boolean>;
|
|
374
380
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
375
381
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
376
382
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -423,6 +429,7 @@ directivesPluginHooks: {
|
|
|
423
429
|
markdown: RealmNode<string>;
|
|
424
430
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
425
431
|
contentEditableClassName: RealmNode<string>;
|
|
432
|
+
autoFocus: RealmNode<boolean>;
|
|
426
433
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
427
434
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
428
435
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -474,6 +481,7 @@ directivesPluginHooks: {
|
|
|
474
481
|
markdown: RealmNode<string>;
|
|
475
482
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
476
483
|
contentEditableClassName: RealmNode<string>;
|
|
484
|
+
autoFocus: RealmNode<boolean>;
|
|
477
485
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
478
486
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
479
487
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -526,6 +534,7 @@ directivesPluginHooks: {
|
|
|
526
534
|
markdown: RealmNode<string>;
|
|
527
535
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
528
536
|
contentEditableClassName: RealmNode<string>;
|
|
537
|
+
autoFocus: RealmNode<boolean>;
|
|
529
538
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
530
539
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
531
540
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -546,7 +555,7 @@ directivesPluginHooks: {
|
|
|
546
555
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
547
556
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
548
557
|
}>) => void;
|
|
549
|
-
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" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "directiveDescriptors" | "insertDirective">(key: K_2) => (value: ValueForKey<{
|
|
558
|
+
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" | "autoFocus" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "directiveDescriptors" | "insertDirective">(key: K_2) => (value: ValueForKey<{
|
|
550
559
|
directiveDescriptors: RealmNode<DirectiveDescriptor<any>[]>;
|
|
551
560
|
insertDirective: RealmNode<InsertDirectivePayload>;
|
|
552
561
|
} & {
|
|
@@ -578,6 +587,7 @@ directivesPluginHooks: {
|
|
|
578
587
|
markdown: RealmNode<string>;
|
|
579
588
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
580
589
|
contentEditableClassName: RealmNode<string>;
|
|
590
|
+
autoFocus: RealmNode<boolean>;
|
|
581
591
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
582
592
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
583
593
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -60,8 +60,7 @@ const FrontmatterEditor = ({ yaml, onChange }) => {
|
|
|
60
60
|
"Add new key"
|
|
61
61
|
)))))));
|
|
62
62
|
};
|
|
63
|
-
const TableInput = React__default.forwardRef(({ className, autofocusIfEmpty, ...props }, ref) => {
|
|
64
|
-
props.autoFocus = Boolean(!props.value && autofocusIfEmpty);
|
|
63
|
+
const TableInput = React__default.forwardRef(({ className, autofocusIfEmpty: _, ...props }, ref) => {
|
|
65
64
|
return /* @__PURE__ */ React__default.createElement("input", { className: classNames(styles.propertyEditorInput, className), ...props, ref });
|
|
66
65
|
});
|
|
67
66
|
export {
|
|
@@ -41,6 +41,7 @@ export declare const frontmatterSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
41
41
|
markdown: RealmNode<string>;
|
|
42
42
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
43
43
|
contentEditableClassName: RealmNode<string>;
|
|
44
|
+
autoFocus: RealmNode<boolean>;
|
|
44
45
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
45
46
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
46
47
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -89,6 +90,7 @@ export declare const frontmatterSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
89
90
|
markdown: RealmNode<string>;
|
|
90
91
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
91
92
|
contentEditableClassName: RealmNode<string>;
|
|
93
|
+
autoFocus: RealmNode<boolean>;
|
|
92
94
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
93
95
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
94
96
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -142,6 +144,7 @@ frontmatterPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
142
144
|
markdown: RealmNode<string>;
|
|
143
145
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
144
146
|
contentEditableClassName: RealmNode<string>;
|
|
147
|
+
autoFocus: RealmNode<boolean>;
|
|
145
148
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
146
149
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
147
150
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -190,6 +193,7 @@ frontmatterPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
190
193
|
markdown: RealmNode<string>;
|
|
191
194
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
192
195
|
contentEditableClassName: RealmNode<string>;
|
|
196
|
+
autoFocus: RealmNode<boolean>;
|
|
193
197
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
194
198
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
195
199
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -245,6 +249,7 @@ frontmatterPluginHooks: {
|
|
|
245
249
|
markdown: RealmNode<string>;
|
|
246
250
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
247
251
|
contentEditableClassName: RealmNode<string>;
|
|
252
|
+
autoFocus: RealmNode<boolean>;
|
|
248
253
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
249
254
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
250
255
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -265,7 +270,7 @@ frontmatterPluginHooks: {
|
|
|
265
270
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
266
271
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
267
272
|
}>;
|
|
268
|
-
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" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "insertFrontmatter">(key: K, callback: (value: ValueForKey<{
|
|
273
|
+
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" | "autoFocus" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "insertFrontmatter">(key: K, callback: (value: ValueForKey<{
|
|
269
274
|
insertFrontmatter: RealmNode<true>;
|
|
270
275
|
} & {
|
|
271
276
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
@@ -296,6 +301,7 @@ frontmatterPluginHooks: {
|
|
|
296
301
|
markdown: RealmNode<string>;
|
|
297
302
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
298
303
|
contentEditableClassName: RealmNode<string>;
|
|
304
|
+
autoFocus: RealmNode<boolean>;
|
|
299
305
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
300
306
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
301
307
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -347,6 +353,7 @@ frontmatterPluginHooks: {
|
|
|
347
353
|
markdown: RealmNode<string>;
|
|
348
354
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
349
355
|
contentEditableClassName: RealmNode<string>;
|
|
356
|
+
autoFocus: RealmNode<boolean>;
|
|
350
357
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
351
358
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
352
359
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -397,6 +404,7 @@ frontmatterPluginHooks: {
|
|
|
397
404
|
markdown: RealmNode<string>;
|
|
398
405
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
399
406
|
contentEditableClassName: RealmNode<string>;
|
|
407
|
+
autoFocus: RealmNode<boolean>;
|
|
400
408
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
401
409
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
402
410
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -448,6 +456,7 @@ frontmatterPluginHooks: {
|
|
|
448
456
|
markdown: RealmNode<string>;
|
|
449
457
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
450
458
|
contentEditableClassName: RealmNode<string>;
|
|
459
|
+
autoFocus: RealmNode<boolean>;
|
|
451
460
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
452
461
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
453
462
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -468,7 +477,7 @@ frontmatterPluginHooks: {
|
|
|
468
477
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
469
478
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
470
479
|
}>) => void;
|
|
471
|
-
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" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "insertFrontmatter">(key: K_2) => (value: ValueForKey<{
|
|
480
|
+
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" | "autoFocus" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "insertFrontmatter">(key: K_2) => (value: ValueForKey<{
|
|
472
481
|
insertFrontmatter: RealmNode<true>;
|
|
473
482
|
} & {
|
|
474
483
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
@@ -499,6 +508,7 @@ frontmatterPluginHooks: {
|
|
|
499
508
|
markdown: RealmNode<string>;
|
|
500
509
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
501
510
|
contentEditableClassName: RealmNode<string>;
|
|
511
|
+
autoFocus: RealmNode<boolean>;
|
|
502
512
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
503
513
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
504
514
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -43,6 +43,7 @@ export declare const headingsSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
43
43
|
markdown: RealmNode<string>;
|
|
44
44
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
45
45
|
contentEditableClassName: RealmNode<string>;
|
|
46
|
+
autoFocus: RealmNode<boolean>;
|
|
46
47
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
47
48
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
48
49
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -95,6 +96,7 @@ export declare const headingsPlugin: PluginConstructor<SystemSpec<[SystemSpec<[]
|
|
|
95
96
|
markdown: RealmNode<string>;
|
|
96
97
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
97
98
|
contentEditableClassName: RealmNode<string>;
|
|
99
|
+
autoFocus: RealmNode<boolean>;
|
|
98
100
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
99
101
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
100
102
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -43,6 +43,7 @@ export declare const imageSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
43
43
|
markdown: RealmNode<string>;
|
|
44
44
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
45
45
|
contentEditableClassName: RealmNode<string>;
|
|
46
|
+
autoFocus: RealmNode<boolean>;
|
|
46
47
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
47
48
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
48
49
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -91,6 +92,7 @@ export declare const imageSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
91
92
|
markdown: RealmNode<string>;
|
|
92
93
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
93
94
|
contentEditableClassName: RealmNode<string>;
|
|
95
|
+
autoFocus: RealmNode<boolean>;
|
|
94
96
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
95
97
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
96
98
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -150,6 +152,7 @@ imagePlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
150
152
|
markdown: RealmNode<string>;
|
|
151
153
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
152
154
|
contentEditableClassName: RealmNode<string>;
|
|
155
|
+
autoFocus: RealmNode<boolean>;
|
|
153
156
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
154
157
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
155
158
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -198,6 +201,7 @@ imagePlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
198
201
|
markdown: RealmNode<string>;
|
|
199
202
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
200
203
|
contentEditableClassName: RealmNode<string>;
|
|
204
|
+
autoFocus: RealmNode<boolean>;
|
|
201
205
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
202
206
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
203
207
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -257,6 +261,7 @@ imagePluginHooks: {
|
|
|
257
261
|
markdown: RealmNode<string>;
|
|
258
262
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
259
263
|
contentEditableClassName: RealmNode<string>;
|
|
264
|
+
autoFocus: RealmNode<boolean>;
|
|
260
265
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
261
266
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
262
267
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -277,7 +282,7 @@ imagePluginHooks: {
|
|
|
277
282
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
278
283
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
279
284
|
}>;
|
|
280
|
-
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" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "imageUploadHandler" | "imageAutocompleteSuggestions" | "insertImage">(key: K, callback: (value: ValueForKey<{
|
|
285
|
+
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" | "autoFocus" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "imageUploadHandler" | "imageAutocompleteSuggestions" | "insertImage">(key: K, callback: (value: ValueForKey<{
|
|
281
286
|
imageUploadHandler: RealmNode<(image: File) => Promise<string>>;
|
|
282
287
|
imageAutocompleteSuggestions: RealmNode<string[]>;
|
|
283
288
|
insertImage: RealmNode<string>;
|
|
@@ -310,6 +315,7 @@ imagePluginHooks: {
|
|
|
310
315
|
markdown: RealmNode<string>;
|
|
311
316
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
312
317
|
contentEditableClassName: RealmNode<string>;
|
|
318
|
+
autoFocus: RealmNode<boolean>;
|
|
313
319
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
314
320
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
315
321
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -363,6 +369,7 @@ imagePluginHooks: {
|
|
|
363
369
|
markdown: RealmNode<string>;
|
|
364
370
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
365
371
|
contentEditableClassName: RealmNode<string>;
|
|
372
|
+
autoFocus: RealmNode<boolean>;
|
|
366
373
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
367
374
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
368
375
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -415,6 +422,7 @@ imagePluginHooks: {
|
|
|
415
422
|
markdown: RealmNode<string>;
|
|
416
423
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
417
424
|
contentEditableClassName: RealmNode<string>;
|
|
425
|
+
autoFocus: RealmNode<boolean>;
|
|
418
426
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
419
427
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
420
428
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -468,6 +476,7 @@ imagePluginHooks: {
|
|
|
468
476
|
markdown: RealmNode<string>;
|
|
469
477
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
470
478
|
contentEditableClassName: RealmNode<string>;
|
|
479
|
+
autoFocus: RealmNode<boolean>;
|
|
471
480
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
472
481
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
473
482
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -488,7 +497,7 @@ imagePluginHooks: {
|
|
|
488
497
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
489
498
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
490
499
|
}>) => void;
|
|
491
|
-
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" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "imageUploadHandler" | "imageAutocompleteSuggestions" | "insertImage">(key: K_2) => (value: ValueForKey<{
|
|
500
|
+
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" | "autoFocus" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "imageUploadHandler" | "imageAutocompleteSuggestions" | "insertImage">(key: K_2) => (value: ValueForKey<{
|
|
492
501
|
imageUploadHandler: RealmNode<(image: File) => Promise<string>>;
|
|
493
502
|
imageAutocompleteSuggestions: RealmNode<string[]>;
|
|
494
503
|
insertImage: RealmNode<string>;
|
|
@@ -521,6 +530,7 @@ imagePluginHooks: {
|
|
|
521
530
|
markdown: RealmNode<string>;
|
|
522
531
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
523
532
|
contentEditableClassName: RealmNode<string>;
|
|
533
|
+
autoFocus: RealmNode<boolean>;
|
|
524
534
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
525
535
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
526
536
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|