@mdxeditor/editor 1.10.1 → 1.11.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/exportMarkdownFromLexical.d.ts +4 -0
- package/dist/exportMarkdownFromLexical.js +34 -0
- package/dist/gurx/realmFactory.d.ts +1 -1
- package/dist/importMarkdownToLexical.d.ts +4 -0
- package/dist/importMarkdownToLexical.js +1 -0
- package/dist/index.js +4 -0
- package/dist/plugins/codeblock/index.d.ts +12 -2
- package/dist/plugins/codemirror/index.d.ts +16 -2
- package/dist/plugins/core/GenericHTMLNode.d.ts +38 -0
- package/dist/plugins/core/GenericHTMLNode.js +117 -0
- package/dist/plugins/core/LexicalGenericHTMLNodeVisitor.d.ts +4 -0
- package/dist/plugins/core/LexicalGenericHTMLNodeVisitor.js +15 -0
- package/dist/plugins/core/LexicalTextVisitor.js +17 -1
- package/dist/plugins/core/MdastHTMLNode.d.ts +13 -0
- package/dist/plugins/core/MdastHTMLNode.js +122 -0
- package/dist/plugins/core/MdastHTMLVisitor.d.ts +3 -0
- package/dist/plugins/core/MdastHTMLVisitor.js +12 -0
- package/dist/plugins/core/index.d.ts +11 -3
- package/dist/plugins/core/index.js +19 -1
- package/dist/plugins/diff-source/SourceEditor.js +7 -1
- package/dist/plugins/diff-source/index.d.ts +14 -4
- package/dist/plugins/diff-source/index.js +2 -1
- 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/dist/style.css +3 -0
- package/dist/utils/mergeStyleAttributes.d.ts +1 -0
- package/dist/utils/mergeStyleAttributes.js +22 -0
- package/package.json +2 -1
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
const MDX_NODE_TYPES = ["mdxJsxTextElement", "mdxJsxFlowElement"];
|
|
2
|
+
function isMdastHTMLNode(node) {
|
|
3
|
+
var _a;
|
|
4
|
+
return MDX_NODE_TYPES.includes(node.type) && htmlTags.includes(((_a = node.name) == null ? void 0 : _a.toLowerCase()) ?? "");
|
|
5
|
+
}
|
|
6
|
+
const htmlTags = [
|
|
7
|
+
"a",
|
|
8
|
+
"abbr",
|
|
9
|
+
"address",
|
|
10
|
+
"area",
|
|
11
|
+
"article",
|
|
12
|
+
"aside",
|
|
13
|
+
"audio",
|
|
14
|
+
"b",
|
|
15
|
+
"base",
|
|
16
|
+
"bdi",
|
|
17
|
+
"bdo",
|
|
18
|
+
"blockquote",
|
|
19
|
+
"body",
|
|
20
|
+
"br",
|
|
21
|
+
"button",
|
|
22
|
+
"canvas",
|
|
23
|
+
"caption",
|
|
24
|
+
"cite",
|
|
25
|
+
"code",
|
|
26
|
+
"col",
|
|
27
|
+
"colgroup",
|
|
28
|
+
"data",
|
|
29
|
+
"datalist",
|
|
30
|
+
"dd",
|
|
31
|
+
"del",
|
|
32
|
+
"details",
|
|
33
|
+
"dfn",
|
|
34
|
+
"dialog",
|
|
35
|
+
"div",
|
|
36
|
+
"dl",
|
|
37
|
+
"dt",
|
|
38
|
+
"em",
|
|
39
|
+
"embed",
|
|
40
|
+
"fieldset",
|
|
41
|
+
"figcaption",
|
|
42
|
+
"figure",
|
|
43
|
+
"footer",
|
|
44
|
+
"form",
|
|
45
|
+
"h1",
|
|
46
|
+
"h2",
|
|
47
|
+
"h3",
|
|
48
|
+
"h4",
|
|
49
|
+
"h5",
|
|
50
|
+
"h6",
|
|
51
|
+
"head",
|
|
52
|
+
"header",
|
|
53
|
+
"hgroup",
|
|
54
|
+
"hr",
|
|
55
|
+
"html",
|
|
56
|
+
"i",
|
|
57
|
+
"iframe",
|
|
58
|
+
// 'img',
|
|
59
|
+
"input",
|
|
60
|
+
"ins",
|
|
61
|
+
"kbd",
|
|
62
|
+
"label",
|
|
63
|
+
"legend",
|
|
64
|
+
"li",
|
|
65
|
+
"link",
|
|
66
|
+
"main",
|
|
67
|
+
"map",
|
|
68
|
+
"mark",
|
|
69
|
+
"meta",
|
|
70
|
+
"meter",
|
|
71
|
+
"nav",
|
|
72
|
+
"noscript",
|
|
73
|
+
"object",
|
|
74
|
+
"ol",
|
|
75
|
+
"optgroup",
|
|
76
|
+
"option",
|
|
77
|
+
"output",
|
|
78
|
+
"p",
|
|
79
|
+
"param",
|
|
80
|
+
"picture",
|
|
81
|
+
"pre",
|
|
82
|
+
"progress",
|
|
83
|
+
"q",
|
|
84
|
+
"rp",
|
|
85
|
+
"rt",
|
|
86
|
+
"ruby",
|
|
87
|
+
"s",
|
|
88
|
+
"samp",
|
|
89
|
+
"script",
|
|
90
|
+
"section",
|
|
91
|
+
"select",
|
|
92
|
+
"small",
|
|
93
|
+
"source",
|
|
94
|
+
"span",
|
|
95
|
+
"strong",
|
|
96
|
+
"style",
|
|
97
|
+
"sub",
|
|
98
|
+
"summary",
|
|
99
|
+
"sup",
|
|
100
|
+
"table",
|
|
101
|
+
"tbody",
|
|
102
|
+
"td",
|
|
103
|
+
"template",
|
|
104
|
+
"textarea",
|
|
105
|
+
"tfoot",
|
|
106
|
+
"th",
|
|
107
|
+
"thead",
|
|
108
|
+
"time",
|
|
109
|
+
"title",
|
|
110
|
+
"tr",
|
|
111
|
+
"track",
|
|
112
|
+
"u",
|
|
113
|
+
"ul",
|
|
114
|
+
"var",
|
|
115
|
+
"video",
|
|
116
|
+
"wbr"
|
|
117
|
+
];
|
|
118
|
+
export {
|
|
119
|
+
MDX_NODE_TYPES,
|
|
120
|
+
htmlTags,
|
|
121
|
+
isMdastHTMLNode
|
|
122
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { $createGenericHTMLNode } from "./GenericHTMLNode.js";
|
|
2
|
+
import { isMdastHTMLNode } from "./MdastHTMLNode.js";
|
|
3
|
+
const MdastHTMLVisitor = {
|
|
4
|
+
testNode: isMdastHTMLNode,
|
|
5
|
+
visitNode: function({ mdastNode, actions }) {
|
|
6
|
+
actions.addAndStepInto($createGenericHTMLNode(mdastNode.name, mdastNode.type, mdastNode.attributes));
|
|
7
|
+
},
|
|
8
|
+
priority: -100
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
MdastHTMLVisitor
|
|
12
|
+
};
|
|
@@ -12,6 +12,7 @@ import type { SystemSpec, Realm, PluginConstructor, TypedRealm, ValueForKey, Sys
|
|
|
12
12
|
import { MdastImportVisitor } from '../../importMarkdownToLexical';
|
|
13
13
|
import type { JsxComponentDescriptor } from '../jsx';
|
|
14
14
|
import { type IconKey } from './Icon';
|
|
15
|
+
export * from './GenericHTMLNode';
|
|
15
16
|
/** @internal */
|
|
16
17
|
export type EditorSubscription = (activeEditor: LexicalEditor) => () => void;
|
|
17
18
|
/** @internal */
|
|
@@ -56,6 +57,7 @@ export declare const coreSystem: SystemSpec<[], (r: Realm) => {
|
|
|
56
57
|
initialMarkdown: RealmNode<string>;
|
|
57
58
|
setMarkdown: RealmNode<string>;
|
|
58
59
|
markdown: RealmNode<string>;
|
|
60
|
+
markdownSignal: RealmNode<string>;
|
|
59
61
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
60
62
|
contentEditableClassName: RealmNode<string>;
|
|
61
63
|
placeholder: RealmNode<React.ReactNode>;
|
|
@@ -129,6 +131,7 @@ corePlugin: PluginConstructor<SystemSpec<[], (r: Realm) => {
|
|
|
129
131
|
initialMarkdown: RealmNode<string>;
|
|
130
132
|
setMarkdown: RealmNode<string>;
|
|
131
133
|
markdown: RealmNode<string>;
|
|
134
|
+
markdownSignal: RealmNode<string>;
|
|
132
135
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
133
136
|
contentEditableClassName: RealmNode<string>;
|
|
134
137
|
placeholder: RealmNode<React.ReactNode>;
|
|
@@ -188,6 +191,7 @@ corePluginHooks: {
|
|
|
188
191
|
initialMarkdown: RealmNode<string>;
|
|
189
192
|
setMarkdown: RealmNode<string>;
|
|
190
193
|
markdown: RealmNode<string>;
|
|
194
|
+
markdownSignal: RealmNode<string>;
|
|
191
195
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
192
196
|
contentEditableClassName: RealmNode<string>;
|
|
193
197
|
placeholder: RealmNode<React.ReactNode>;
|
|
@@ -218,7 +222,7 @@ corePluginHooks: {
|
|
|
218
222
|
onBlur: RealmNode<FocusEvent>;
|
|
219
223
|
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
220
224
|
}>;
|
|
221
|
-
useEmitter: <K extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "iconComponentFor">(key: K, callback: (value: ValueForKey<{
|
|
225
|
+
useEmitter: <K extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "markdownSignal" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "iconComponentFor">(key: K, callback: (value: ValueForKey<{
|
|
222
226
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
223
227
|
inFocus: RealmNode<boolean>;
|
|
224
228
|
historyState: RealmNode<HistoryState>;
|
|
@@ -245,6 +249,7 @@ corePluginHooks: {
|
|
|
245
249
|
initialMarkdown: RealmNode<string>;
|
|
246
250
|
setMarkdown: RealmNode<string>;
|
|
247
251
|
markdown: RealmNode<string>;
|
|
252
|
+
markdownSignal: RealmNode<string>;
|
|
248
253
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
249
254
|
contentEditableClassName: RealmNode<string>;
|
|
250
255
|
placeholder: RealmNode<React.ReactNode>;
|
|
@@ -302,6 +307,7 @@ corePluginHooks: {
|
|
|
302
307
|
initialMarkdown: RealmNode<string>;
|
|
303
308
|
setMarkdown: RealmNode<string>;
|
|
304
309
|
markdown: RealmNode<string>;
|
|
310
|
+
markdownSignal: RealmNode<string>;
|
|
305
311
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
306
312
|
contentEditableClassName: RealmNode<string>;
|
|
307
313
|
placeholder: RealmNode<React.ReactNode>;
|
|
@@ -358,6 +364,7 @@ corePluginHooks: {
|
|
|
358
364
|
initialMarkdown: RealmNode<string>;
|
|
359
365
|
setMarkdown: RealmNode<string>;
|
|
360
366
|
markdown: RealmNode<string>;
|
|
367
|
+
markdownSignal: RealmNode<string>;
|
|
361
368
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
362
369
|
contentEditableClassName: RealmNode<string>;
|
|
363
370
|
placeholder: RealmNode<React.ReactNode>;
|
|
@@ -415,6 +422,7 @@ corePluginHooks: {
|
|
|
415
422
|
initialMarkdown: RealmNode<string>;
|
|
416
423
|
setMarkdown: RealmNode<string>;
|
|
417
424
|
markdown: RealmNode<string>;
|
|
425
|
+
markdownSignal: RealmNode<string>;
|
|
418
426
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
419
427
|
contentEditableClassName: RealmNode<string>;
|
|
420
428
|
placeholder: RealmNode<React.ReactNode>;
|
|
@@ -445,7 +453,7 @@ corePluginHooks: {
|
|
|
445
453
|
onBlur: RealmNode<FocusEvent>;
|
|
446
454
|
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
447
455
|
}>) => void;
|
|
448
|
-
usePublisher: <K_2 extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "iconComponentFor">(key: K_2) => (value: ValueForKey<{
|
|
456
|
+
usePublisher: <K_2 extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "markdownSignal" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "iconComponentFor">(key: K_2) => (value: ValueForKey<{
|
|
449
457
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
450
458
|
inFocus: RealmNode<boolean>;
|
|
451
459
|
historyState: RealmNode<HistoryState>;
|
|
@@ -472,6 +480,7 @@ corePluginHooks: {
|
|
|
472
480
|
initialMarkdown: RealmNode<string>;
|
|
473
481
|
setMarkdown: RealmNode<string>;
|
|
474
482
|
markdown: RealmNode<string>;
|
|
483
|
+
markdownSignal: RealmNode<string>;
|
|
475
484
|
editorRootElementRef: RealmNode<React.RefObject<HTMLDivElement> | null>;
|
|
476
485
|
contentEditableClassName: RealmNode<string>;
|
|
477
486
|
placeholder: RealmNode<React.ReactNode>;
|
|
@@ -503,4 +512,3 @@ corePluginHooks: {
|
|
|
503
512
|
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
504
513
|
}, K_2>) => void;
|
|
505
514
|
};
|
|
506
|
-
export {};
|
|
@@ -18,6 +18,12 @@ import { SharedHistoryPlugin } from "./SharedHistoryPlugin.js";
|
|
|
18
18
|
import { noop } from "../../utils/fp.js";
|
|
19
19
|
import { controlOrMeta } from "../../utils/detectMac.js";
|
|
20
20
|
import { MdastBreakVisitor } from "./MdastBreakVisitor.js";
|
|
21
|
+
import { mdxJsxFromMarkdown, mdxJsxToMarkdown } from "mdast-util-mdx-jsx";
|
|
22
|
+
import { mdxJsx } from "micromark-extension-mdx-jsx";
|
|
23
|
+
import { MdastHTMLVisitor } from "./MdastHTMLVisitor.js";
|
|
24
|
+
import { GenericHTMLNode } from "./GenericHTMLNode.js";
|
|
25
|
+
import { $createGenericHTMLNode, $isGenericHTMLNode } from "./GenericHTMLNode.js";
|
|
26
|
+
import { LexicalGenericHTMLVisitor } from "./LexicalGenericHTMLNodeVisitor.js";
|
|
21
27
|
import { system } from "../../gurx/realmFactory.js";
|
|
22
28
|
import { realmPlugin } from "../../gurx/react.js";
|
|
23
29
|
const NESTED_EDITOR_UPDATED_COMMAND = createCommand("NESTED_EDITOR_UPDATED_COMMAND");
|
|
@@ -121,6 +127,8 @@ const coreSystem = system((r) => {
|
|
|
121
127
|
});
|
|
122
128
|
const initialMarkdown = r.node("");
|
|
123
129
|
const markdown = r.node("", true);
|
|
130
|
+
const markdownSignal = r.node();
|
|
131
|
+
r.link(markdown, markdownSignal);
|
|
124
132
|
r.link(initialMarkdown, markdown);
|
|
125
133
|
const importVisitors = r.node([]);
|
|
126
134
|
const syntaxExtensions = r.node([]);
|
|
@@ -347,6 +355,7 @@ const coreSystem = system((r) => {
|
|
|
347
355
|
initialMarkdown,
|
|
348
356
|
setMarkdown,
|
|
349
357
|
markdown,
|
|
358
|
+
markdownSignal,
|
|
350
359
|
// DOM
|
|
351
360
|
editorRootElementRef,
|
|
352
361
|
contentEditableClassName,
|
|
@@ -391,28 +400,37 @@ const [
|
|
|
391
400
|
placeholder: params.placeholder,
|
|
392
401
|
readOnly: params.readOnly
|
|
393
402
|
});
|
|
394
|
-
realm.singletonSubKey("
|
|
403
|
+
realm.singletonSubKey("markdownSignal", params.onChange);
|
|
395
404
|
realm.singletonSubKey("onBlur", params.onBlur);
|
|
396
405
|
},
|
|
397
406
|
init(realm, params) {
|
|
398
407
|
realm.pubKey("initialMarkdown", params.initialMarkdown.trim());
|
|
399
408
|
realm.pubKey("iconComponentFor", params.iconComponentFor);
|
|
409
|
+
realm.pubKey("addMdastExtension", mdxJsxFromMarkdown());
|
|
410
|
+
realm.pubKey("addSyntaxExtension", mdxJsx());
|
|
411
|
+
realm.pubKey("addToMarkdownExtension", mdxJsxToMarkdown());
|
|
400
412
|
realm.pubKey("addImportVisitor", MdastRootVisitor);
|
|
401
413
|
realm.pubKey("addImportVisitor", MdastParagraphVisitor);
|
|
402
414
|
realm.pubKey("addImportVisitor", MdastTextVisitor);
|
|
403
415
|
realm.pubKey("addImportVisitor", MdastFormattingVisitor);
|
|
404
416
|
realm.pubKey("addImportVisitor", MdastInlineCodeVisitor);
|
|
405
417
|
realm.pubKey("addImportVisitor", MdastBreakVisitor);
|
|
418
|
+
realm.pubKey("addImportVisitor", MdastHTMLVisitor);
|
|
406
419
|
realm.pubKey("addLexicalNode", ParagraphNode);
|
|
407
420
|
realm.pubKey("addLexicalNode", TextNode);
|
|
421
|
+
realm.pubKey("addLexicalNode", GenericHTMLNode);
|
|
408
422
|
realm.pubKey("addExportVisitor", LexicalRootVisitor);
|
|
409
423
|
realm.pubKey("addExportVisitor", LexicalParagraphVisitor);
|
|
410
424
|
realm.pubKey("addExportVisitor", LexicalTextVisitor);
|
|
411
425
|
realm.pubKey("addExportVisitor", LexicalLinebreakVisitor);
|
|
426
|
+
realm.pubKey("addExportVisitor", LexicalGenericHTMLVisitor);
|
|
412
427
|
realm.pubKey("addComposerChild", SharedHistoryPlugin);
|
|
413
428
|
}
|
|
414
429
|
});
|
|
415
430
|
export {
|
|
431
|
+
$createGenericHTMLNode,
|
|
432
|
+
$isGenericHTMLNode,
|
|
433
|
+
GenericHTMLNode,
|
|
416
434
|
NESTED_EDITOR_UPDATED_COMMAND,
|
|
417
435
|
corePlugin,
|
|
418
436
|
corePluginHooks,
|
|
@@ -6,7 +6,13 @@ import { basicSetup } from "codemirror";
|
|
|
6
6
|
import React__default from "react";
|
|
7
7
|
import { diffSourcePluginHooks } from "./index.js";
|
|
8
8
|
import { corePluginHooks } from "../core/index.js";
|
|
9
|
-
const COMMON_STATE_CONFIG_EXTENSIONS = [
|
|
9
|
+
const COMMON_STATE_CONFIG_EXTENSIONS = [
|
|
10
|
+
basicSetup,
|
|
11
|
+
basicLight,
|
|
12
|
+
markdown(),
|
|
13
|
+
lineNumbers(),
|
|
14
|
+
EditorView.lineWrapping
|
|
15
|
+
];
|
|
10
16
|
const SourceEditor = () => {
|
|
11
17
|
const [markdown2, readOnly] = corePluginHooks.useEmitterValues("markdown", "readOnly");
|
|
12
18
|
const [cmExtensions] = diffSourcePluginHooks.useEmitterValues("cmExtensions");
|
|
@@ -43,6 +43,7 @@ export declare const diffSourceSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
43
43
|
initialMarkdown: RealmNode<string>;
|
|
44
44
|
setMarkdown: RealmNode<string>;
|
|
45
45
|
markdown: RealmNode<string>;
|
|
46
|
+
markdownSignal: RealmNode<string>;
|
|
46
47
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
47
48
|
contentEditableClassName: RealmNode<string>;
|
|
48
49
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -72,7 +73,7 @@ export declare const diffSourceSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
72
73
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
73
74
|
onBlur: RealmNode<FocusEvent>;
|
|
74
75
|
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
75
|
-
}>], (r: Realm, [{ markdown, setMarkdown }]: [{
|
|
76
|
+
}>], (r: Realm, [{ markdown, setMarkdown, markdownSignal }]: [{
|
|
76
77
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
77
78
|
inFocus: RealmNode<boolean>;
|
|
78
79
|
historyState: RealmNode<HistoryState>;
|
|
@@ -99,6 +100,7 @@ export declare const diffSourceSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
99
100
|
initialMarkdown: RealmNode<string>;
|
|
100
101
|
setMarkdown: RealmNode<string>;
|
|
101
102
|
markdown: RealmNode<string>;
|
|
103
|
+
markdownSignal: RealmNode<string>;
|
|
102
104
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
103
105
|
contentEditableClassName: RealmNode<string>;
|
|
104
106
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -168,6 +170,7 @@ diffSourcePlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
168
170
|
initialMarkdown: RealmNode<string>;
|
|
169
171
|
setMarkdown: RealmNode<string>;
|
|
170
172
|
markdown: RealmNode<string>;
|
|
173
|
+
markdownSignal: RealmNode<string>;
|
|
171
174
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
172
175
|
contentEditableClassName: RealmNode<string>;
|
|
173
176
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -197,7 +200,7 @@ diffSourcePlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
197
200
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
198
201
|
onBlur: RealmNode<FocusEvent>;
|
|
199
202
|
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
200
|
-
}>], (r: Realm, [{ markdown, setMarkdown }]: [{
|
|
203
|
+
}>], (r: Realm, [{ markdown, setMarkdown, markdownSignal }]: [{
|
|
201
204
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
202
205
|
inFocus: RealmNode<boolean>;
|
|
203
206
|
historyState: RealmNode<HistoryState>;
|
|
@@ -224,6 +227,7 @@ diffSourcePlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
224
227
|
initialMarkdown: RealmNode<string>;
|
|
225
228
|
setMarkdown: RealmNode<string>;
|
|
226
229
|
markdown: RealmNode<string>;
|
|
230
|
+
markdownSignal: RealmNode<string>;
|
|
227
231
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
228
232
|
contentEditableClassName: RealmNode<string>;
|
|
229
233
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -293,6 +297,7 @@ diffSourcePluginHooks: {
|
|
|
293
297
|
initialMarkdown: RealmNode<string>;
|
|
294
298
|
setMarkdown: RealmNode<string>;
|
|
295
299
|
markdown: RealmNode<string>;
|
|
300
|
+
markdownSignal: RealmNode<string>;
|
|
296
301
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
297
302
|
contentEditableClassName: RealmNode<string>;
|
|
298
303
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -323,7 +328,7 @@ diffSourcePluginHooks: {
|
|
|
323
328
|
onBlur: RealmNode<FocusEvent>;
|
|
324
329
|
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
325
330
|
}>;
|
|
326
|
-
useEmitter: <K extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "iconComponentFor" | "markdownSourceEditorValue" | "viewMode" | "diffMarkdown" | "cmExtensions">(key: K, callback: (value: ValueForKey<{
|
|
331
|
+
useEmitter: <K extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "markdownSignal" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "iconComponentFor" | "markdownSourceEditorValue" | "viewMode" | "diffMarkdown" | "cmExtensions">(key: K, callback: (value: ValueForKey<{
|
|
327
332
|
viewMode: RealmNode<ViewMode>;
|
|
328
333
|
diffMarkdown: RealmNode<string>;
|
|
329
334
|
markdownSourceEditorValue: RealmNode<string>;
|
|
@@ -355,6 +360,7 @@ diffSourcePluginHooks: {
|
|
|
355
360
|
initialMarkdown: RealmNode<string>;
|
|
356
361
|
setMarkdown: RealmNode<string>;
|
|
357
362
|
markdown: RealmNode<string>;
|
|
363
|
+
markdownSignal: RealmNode<string>;
|
|
358
364
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
359
365
|
contentEditableClassName: RealmNode<string>;
|
|
360
366
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -417,6 +423,7 @@ diffSourcePluginHooks: {
|
|
|
417
423
|
initialMarkdown: RealmNode<string>;
|
|
418
424
|
setMarkdown: RealmNode<string>;
|
|
419
425
|
markdown: RealmNode<string>;
|
|
426
|
+
markdownSignal: RealmNode<string>;
|
|
420
427
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
421
428
|
contentEditableClassName: RealmNode<string>;
|
|
422
429
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -478,6 +485,7 @@ diffSourcePluginHooks: {
|
|
|
478
485
|
initialMarkdown: RealmNode<string>;
|
|
479
486
|
setMarkdown: RealmNode<string>;
|
|
480
487
|
markdown: RealmNode<string>;
|
|
488
|
+
markdownSignal: RealmNode<string>;
|
|
481
489
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
482
490
|
contentEditableClassName: RealmNode<string>;
|
|
483
491
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -540,6 +548,7 @@ diffSourcePluginHooks: {
|
|
|
540
548
|
initialMarkdown: RealmNode<string>;
|
|
541
549
|
setMarkdown: RealmNode<string>;
|
|
542
550
|
markdown: RealmNode<string>;
|
|
551
|
+
markdownSignal: RealmNode<string>;
|
|
543
552
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
544
553
|
contentEditableClassName: RealmNode<string>;
|
|
545
554
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -570,7 +579,7 @@ diffSourcePluginHooks: {
|
|
|
570
579
|
onBlur: RealmNode<FocusEvent>;
|
|
571
580
|
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
572
581
|
}>) => void;
|
|
573
|
-
usePublisher: <K_2 extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "iconComponentFor" | "markdownSourceEditorValue" | "viewMode" | "diffMarkdown" | "cmExtensions">(key: K_2) => (value: ValueForKey<{
|
|
582
|
+
usePublisher: <K_2 extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "markdownSignal" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "iconComponentFor" | "markdownSourceEditorValue" | "viewMode" | "diffMarkdown" | "cmExtensions">(key: K_2) => (value: ValueForKey<{
|
|
574
583
|
viewMode: RealmNode<ViewMode>;
|
|
575
584
|
diffMarkdown: RealmNode<string>;
|
|
576
585
|
markdownSourceEditorValue: RealmNode<string>;
|
|
@@ -602,6 +611,7 @@ diffSourcePluginHooks: {
|
|
|
602
611
|
initialMarkdown: RealmNode<string>;
|
|
603
612
|
setMarkdown: RealmNode<string>;
|
|
604
613
|
markdown: RealmNode<string>;
|
|
614
|
+
markdownSignal: RealmNode<string>;
|
|
605
615
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
606
616
|
contentEditableClassName: RealmNode<string>;
|
|
607
617
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -3,11 +3,12 @@ import { DiffSourceWrapper } from "./DiffSourceWrapper.js";
|
|
|
3
3
|
import { system } from "../../gurx/realmFactory.js";
|
|
4
4
|
import { realmPlugin } from "../../gurx/react.js";
|
|
5
5
|
const diffSourceSystem = system(
|
|
6
|
-
(r, [{ markdown, setMarkdown }]) => {
|
|
6
|
+
(r, [{ markdown, setMarkdown, markdownSignal }]) => {
|
|
7
7
|
const diffMarkdown = r.node("");
|
|
8
8
|
const markdownSourceEditorValue = r.node("");
|
|
9
9
|
const cmExtensions = r.node([]);
|
|
10
10
|
r.link(markdown, markdownSourceEditorValue);
|
|
11
|
+
r.link(markdownSourceEditorValue, markdownSignal);
|
|
11
12
|
const viewMode = r.node("rich-text");
|
|
12
13
|
r.sub(
|
|
13
14
|
r.pipe(
|
|
@@ -99,6 +99,7 @@ export declare const directivesSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
99
99
|
initialMarkdown: RealmNode<string>;
|
|
100
100
|
setMarkdown: RealmNode<string>;
|
|
101
101
|
markdown: RealmNode<string>;
|
|
102
|
+
markdownSignal: RealmNode<string>;
|
|
102
103
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
103
104
|
contentEditableClassName: RealmNode<string>;
|
|
104
105
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -155,6 +156,7 @@ export declare const directivesSystem: SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
155
156
|
initialMarkdown: RealmNode<string>;
|
|
156
157
|
setMarkdown: RealmNode<string>;
|
|
157
158
|
markdown: RealmNode<string>;
|
|
159
|
+
markdownSignal: RealmNode<string>;
|
|
158
160
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
159
161
|
contentEditableClassName: RealmNode<string>;
|
|
160
162
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -229,6 +231,7 @@ directivesPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
229
231
|
initialMarkdown: RealmNode<string>;
|
|
230
232
|
setMarkdown: RealmNode<string>;
|
|
231
233
|
markdown: RealmNode<string>;
|
|
234
|
+
markdownSignal: RealmNode<string>;
|
|
232
235
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
233
236
|
contentEditableClassName: RealmNode<string>;
|
|
234
237
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -285,6 +288,7 @@ directivesPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
285
288
|
initialMarkdown: RealmNode<string>;
|
|
286
289
|
setMarkdown: RealmNode<string>;
|
|
287
290
|
markdown: RealmNode<string>;
|
|
291
|
+
markdownSignal: RealmNode<string>;
|
|
288
292
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
289
293
|
contentEditableClassName: RealmNode<string>;
|
|
290
294
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -350,6 +354,7 @@ directivesPluginHooks: {
|
|
|
350
354
|
initialMarkdown: RealmNode<string>;
|
|
351
355
|
setMarkdown: RealmNode<string>;
|
|
352
356
|
markdown: RealmNode<string>;
|
|
357
|
+
markdownSignal: RealmNode<string>;
|
|
353
358
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
354
359
|
contentEditableClassName: RealmNode<string>;
|
|
355
360
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -380,7 +385,7 @@ directivesPluginHooks: {
|
|
|
380
385
|
onBlur: RealmNode<FocusEvent>;
|
|
381
386
|
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
382
387
|
}>;
|
|
383
|
-
useEmitter: <K extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "iconComponentFor" | "directiveDescriptors" | "insertDirective">(key: K, callback: (value: ValueForKey<{
|
|
388
|
+
useEmitter: <K extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "markdownSignal" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "iconComponentFor" | "directiveDescriptors" | "insertDirective">(key: K, callback: (value: ValueForKey<{
|
|
384
389
|
directiveDescriptors: RealmNode<DirectiveDescriptor<any>[]>;
|
|
385
390
|
insertDirective: RealmNode<InsertDirectivePayload>;
|
|
386
391
|
} & {
|
|
@@ -410,6 +415,7 @@ directivesPluginHooks: {
|
|
|
410
415
|
initialMarkdown: RealmNode<string>;
|
|
411
416
|
setMarkdown: RealmNode<string>;
|
|
412
417
|
markdown: RealmNode<string>;
|
|
418
|
+
markdownSignal: RealmNode<string>;
|
|
413
419
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
414
420
|
contentEditableClassName: RealmNode<string>;
|
|
415
421
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -470,6 +476,7 @@ directivesPluginHooks: {
|
|
|
470
476
|
initialMarkdown: RealmNode<string>;
|
|
471
477
|
setMarkdown: RealmNode<string>;
|
|
472
478
|
markdown: RealmNode<string>;
|
|
479
|
+
markdownSignal: RealmNode<string>;
|
|
473
480
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
474
481
|
contentEditableClassName: RealmNode<string>;
|
|
475
482
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -529,6 +536,7 @@ directivesPluginHooks: {
|
|
|
529
536
|
initialMarkdown: RealmNode<string>;
|
|
530
537
|
setMarkdown: RealmNode<string>;
|
|
531
538
|
markdown: RealmNode<string>;
|
|
539
|
+
markdownSignal: RealmNode<string>;
|
|
532
540
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
533
541
|
contentEditableClassName: RealmNode<string>;
|
|
534
542
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -589,6 +597,7 @@ directivesPluginHooks: {
|
|
|
589
597
|
initialMarkdown: RealmNode<string>;
|
|
590
598
|
setMarkdown: RealmNode<string>;
|
|
591
599
|
markdown: RealmNode<string>;
|
|
600
|
+
markdownSignal: RealmNode<string>;
|
|
592
601
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
593
602
|
contentEditableClassName: RealmNode<string>;
|
|
594
603
|
placeholder: RealmNode<ReactNode>;
|
|
@@ -619,7 +628,7 @@ directivesPluginHooks: {
|
|
|
619
628
|
onBlur: RealmNode<FocusEvent>;
|
|
620
629
|
iconComponentFor: RealmNode<(name: IconKey) => ReactNode>;
|
|
621
630
|
}>) => void;
|
|
622
|
-
usePublisher: <K_2 extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "iconComponentFor" | "directiveDescriptors" | "insertDirective">(key: K_2) => (value: ValueForKey<{
|
|
631
|
+
usePublisher: <K_2 extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "markdownSignal" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "onBlur" | "iconComponentFor" | "directiveDescriptors" | "insertDirective">(key: K_2) => (value: ValueForKey<{
|
|
623
632
|
directiveDescriptors: RealmNode<DirectiveDescriptor<any>[]>;
|
|
624
633
|
insertDirective: RealmNode<InsertDirectivePayload>;
|
|
625
634
|
} & {
|
|
@@ -649,6 +658,7 @@ directivesPluginHooks: {
|
|
|
649
658
|
initialMarkdown: RealmNode<string>;
|
|
650
659
|
setMarkdown: RealmNode<string>;
|
|
651
660
|
markdown: RealmNode<string>;
|
|
661
|
+
markdownSignal: RealmNode<string>;
|
|
652
662
|
editorRootElementRef: RealmNode<RefObject<HTMLDivElement> | null>;
|
|
653
663
|
contentEditableClassName: RealmNode<string>;
|
|
654
664
|
placeholder: RealmNode<ReactNode>;
|