@mdxeditor/editor 0.15.2 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MDXEditor.d.ts +5 -0
- package/dist/MDXEditor.js +8 -2
- package/dist/gurx/react.js +1 -1
- package/dist/plugins/codeblock/index.d.ts +12 -2
- package/dist/plugins/codemirror/CodeMirrorEditor.js +6 -3
- package/dist/plugins/codemirror/index.d.ts +16 -2
- package/dist/plugins/core/index.d.ts +11 -2
- package/dist/plugins/core/index.js +12 -4
- package/dist/plugins/diff-source/SourceEditor.js +2 -1
- 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 +4 -1
- package/dist/plugins/frontmatter/index.d.ts +12 -2
- package/dist/plugins/headings/index.d.ts +4 -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/SandpackEditor.js +3 -1
- 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/components/DiffSourceToggleWrapper.js +1 -1
- package/dist/plugins/toolbar/index.d.ts +10 -2
- package/dist/plugins/toolbar/index.js +3 -2
- package/dist/plugins/toolbar/primitives/DialogButton.js +2 -2
- package/dist/plugins/toolbar/primitives/select.js +14 -2
- package/dist/plugins/toolbar/primitives/toolbar.d.ts +4 -1
- package/dist/plugins/toolbar/primitives/toolbar.js +12 -8
- package/dist/style.css +211 -169
- package/dist/styles/ui.module.css.js +88 -85
- package/package.json +1 -1
|
@@ -45,6 +45,7 @@ export declare const listsSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
45
45
|
contentEditableClassName: RealmNode<string>;
|
|
46
46
|
placeholder: RealmNode<ReactNode>;
|
|
47
47
|
autoFocus: RealmNode<boolean>;
|
|
48
|
+
readOnly: RealmNode<boolean>;
|
|
48
49
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
49
50
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
50
51
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -95,6 +96,7 @@ export declare const listsSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
95
96
|
contentEditableClassName: RealmNode<string>;
|
|
96
97
|
placeholder: RealmNode<ReactNode>;
|
|
97
98
|
autoFocus: RealmNode<boolean>;
|
|
99
|
+
readOnly: RealmNode<boolean>;
|
|
98
100
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
99
101
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
100
102
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -151,6 +153,7 @@ listsPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
151
153
|
contentEditableClassName: RealmNode<string>;
|
|
152
154
|
placeholder: RealmNode<ReactNode>;
|
|
153
155
|
autoFocus: RealmNode<boolean>;
|
|
156
|
+
readOnly: RealmNode<boolean>;
|
|
154
157
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
155
158
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
156
159
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -201,6 +204,7 @@ listsPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
201
204
|
contentEditableClassName: RealmNode<string>;
|
|
202
205
|
placeholder: RealmNode<ReactNode>;
|
|
203
206
|
autoFocus: RealmNode<boolean>;
|
|
207
|
+
readOnly: RealmNode<boolean>;
|
|
204
208
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
205
209
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
206
210
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -260,6 +264,7 @@ listsPluginHooks: {
|
|
|
260
264
|
contentEditableClassName: RealmNode<string>;
|
|
261
265
|
placeholder: RealmNode<ReactNode>;
|
|
262
266
|
autoFocus: RealmNode<boolean>;
|
|
267
|
+
readOnly: RealmNode<boolean>;
|
|
263
268
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
264
269
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
265
270
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -280,7 +285,7 @@ listsPluginHooks: {
|
|
|
280
285
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
281
286
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
282
287
|
}>;
|
|
283
|
-
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" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "currentListType" | "applyListType">(key: K, callback: (value: ValueForKey<{
|
|
288
|
+
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" | "currentListType" | "applyListType">(key: K, callback: (value: ValueForKey<{
|
|
284
289
|
currentListType: RealmNode<"" | ListType>;
|
|
285
290
|
applyListType: RealmNode<"" | ListType>;
|
|
286
291
|
} & {
|
|
@@ -314,6 +319,7 @@ listsPluginHooks: {
|
|
|
314
319
|
contentEditableClassName: RealmNode<string>;
|
|
315
320
|
placeholder: RealmNode<ReactNode>;
|
|
316
321
|
autoFocus: RealmNode<boolean>;
|
|
322
|
+
readOnly: RealmNode<boolean>;
|
|
317
323
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
318
324
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
319
325
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -368,6 +374,7 @@ listsPluginHooks: {
|
|
|
368
374
|
contentEditableClassName: RealmNode<string>;
|
|
369
375
|
placeholder: RealmNode<ReactNode>;
|
|
370
376
|
autoFocus: RealmNode<boolean>;
|
|
377
|
+
readOnly: RealmNode<boolean>;
|
|
371
378
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
372
379
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
373
380
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -421,6 +428,7 @@ listsPluginHooks: {
|
|
|
421
428
|
contentEditableClassName: RealmNode<string>;
|
|
422
429
|
placeholder: RealmNode<ReactNode>;
|
|
423
430
|
autoFocus: RealmNode<boolean>;
|
|
431
|
+
readOnly: RealmNode<boolean>;
|
|
424
432
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
425
433
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
426
434
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -475,6 +483,7 @@ listsPluginHooks: {
|
|
|
475
483
|
contentEditableClassName: RealmNode<string>;
|
|
476
484
|
placeholder: RealmNode<ReactNode>;
|
|
477
485
|
autoFocus: RealmNode<boolean>;
|
|
486
|
+
readOnly: RealmNode<boolean>;
|
|
478
487
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
479
488
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
480
489
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -495,7 +504,7 @@ listsPluginHooks: {
|
|
|
495
504
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
496
505
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
497
506
|
}>) => void;
|
|
498
|
-
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" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "currentListType" | "applyListType">(key: K_2) => (value: ValueForKey<{
|
|
507
|
+
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" | "currentListType" | "applyListType">(key: K_2) => (value: ValueForKey<{
|
|
499
508
|
currentListType: RealmNode<"" | ListType>;
|
|
500
509
|
applyListType: RealmNode<"" | ListType>;
|
|
501
510
|
} & {
|
|
@@ -529,6 +538,7 @@ listsPluginHooks: {
|
|
|
529
538
|
contentEditableClassName: RealmNode<string>;
|
|
530
539
|
placeholder: RealmNode<ReactNode>;
|
|
531
540
|
autoFocus: RealmNode<boolean>;
|
|
541
|
+
readOnly: RealmNode<boolean>;
|
|
532
542
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
533
543
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
534
544
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -42,6 +42,7 @@ export declare const markdownShortcutPlugin: PluginConstructor<SystemSpec<[Syste
|
|
|
42
42
|
contentEditableClassName: RealmNode<string>;
|
|
43
43
|
placeholder: RealmNode<React.ReactNode>;
|
|
44
44
|
autoFocus: RealmNode<boolean>;
|
|
45
|
+
readOnly: RealmNode<boolean>;
|
|
45
46
|
composerChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
46
47
|
addComposerChild: RealmNode<React.ComponentType<{}>>;
|
|
47
48
|
topAreaChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
@@ -44,6 +44,7 @@ quotePlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
44
44
|
contentEditableClassName: RealmNode<string>;
|
|
45
45
|
placeholder: RealmNode<ReactNode>;
|
|
46
46
|
autoFocus: RealmNode<boolean>;
|
|
47
|
+
readOnly: RealmNode<boolean>;
|
|
47
48
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
48
49
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
49
50
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -97,6 +98,7 @@ quotePluginHooks: {
|
|
|
97
98
|
contentEditableClassName: RealmNode<string>;
|
|
98
99
|
placeholder: RealmNode<ReactNode>;
|
|
99
100
|
autoFocus: RealmNode<boolean>;
|
|
101
|
+
readOnly: RealmNode<boolean>;
|
|
100
102
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
101
103
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
102
104
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -117,7 +119,7 @@ quotePluginHooks: {
|
|
|
117
119
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
118
120
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
119
121
|
}>;
|
|
120
|
-
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" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode">(key: K, callback: (value: ValueForKey<{
|
|
122
|
+
useEmitter: <K extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode">(key: K, callback: (value: ValueForKey<{
|
|
121
123
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
122
124
|
inFocus: RealmNode<boolean>;
|
|
123
125
|
historyState: RealmNode<HistoryState>;
|
|
@@ -148,6 +150,7 @@ quotePluginHooks: {
|
|
|
148
150
|
contentEditableClassName: RealmNode<string>;
|
|
149
151
|
placeholder: RealmNode<ReactNode>;
|
|
150
152
|
autoFocus: RealmNode<boolean>;
|
|
153
|
+
readOnly: RealmNode<boolean>;
|
|
151
154
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
152
155
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
153
156
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -199,6 +202,7 @@ quotePluginHooks: {
|
|
|
199
202
|
contentEditableClassName: RealmNode<string>;
|
|
200
203
|
placeholder: RealmNode<ReactNode>;
|
|
201
204
|
autoFocus: RealmNode<boolean>;
|
|
205
|
+
readOnly: RealmNode<boolean>;
|
|
202
206
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
203
207
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
204
208
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -249,6 +253,7 @@ quotePluginHooks: {
|
|
|
249
253
|
contentEditableClassName: RealmNode<string>;
|
|
250
254
|
placeholder: RealmNode<ReactNode>;
|
|
251
255
|
autoFocus: RealmNode<boolean>;
|
|
256
|
+
readOnly: RealmNode<boolean>;
|
|
252
257
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
253
258
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
254
259
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -300,6 +305,7 @@ quotePluginHooks: {
|
|
|
300
305
|
contentEditableClassName: RealmNode<string>;
|
|
301
306
|
placeholder: RealmNode<ReactNode>;
|
|
302
307
|
autoFocus: RealmNode<boolean>;
|
|
308
|
+
readOnly: RealmNode<boolean>;
|
|
303
309
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
304
310
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
305
311
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -320,7 +326,7 @@ quotePluginHooks: {
|
|
|
320
326
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
321
327
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
322
328
|
}>) => void;
|
|
323
|
-
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" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode">(key: K_2) => (value: ValueForKey<{
|
|
329
|
+
usePublisher: <K_2 extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode">(key: K_2) => (value: ValueForKey<{
|
|
324
330
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
325
331
|
inFocus: RealmNode<boolean>;
|
|
326
332
|
historyState: RealmNode<HistoryState>;
|
|
@@ -351,6 +357,7 @@ quotePluginHooks: {
|
|
|
351
357
|
contentEditableClassName: RealmNode<string>;
|
|
352
358
|
placeholder: RealmNode<ReactNode>;
|
|
353
359
|
autoFocus: RealmNode<boolean>;
|
|
360
|
+
readOnly: RealmNode<boolean>;
|
|
354
361
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
355
362
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
356
363
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -2,6 +2,7 @@ import React__default from "react";
|
|
|
2
2
|
import { useCodeMirrorRef } from "./useCodeMirrorRef.js";
|
|
3
3
|
import { SandpackProvider, SandpackLayout, SandpackCodeEditor, SandpackPreview, useSandpack } from "@codesandbox/sandpack-react";
|
|
4
4
|
import { useCodeBlockEditorContext } from "../codeblock/CodeBlockNode.js";
|
|
5
|
+
import { corePluginHooks } from "../core/index.js";
|
|
5
6
|
const CodeUpdateEmitter = ({ onChange, snippetFileName }) => {
|
|
6
7
|
const { sandpack } = useSandpack();
|
|
7
8
|
onChange(sandpack.files[snippetFileName].code);
|
|
@@ -9,6 +10,7 @@ const CodeUpdateEmitter = ({ onChange, snippetFileName }) => {
|
|
|
9
10
|
};
|
|
10
11
|
const SandpackEditor = ({ nodeKey, code, focusEmitter, preset }) => {
|
|
11
12
|
const codeMirrorRef = useCodeMirrorRef(nodeKey, "sandpack", "jsx", focusEmitter);
|
|
13
|
+
const [readOnly] = corePluginHooks.useEmitterValues("readOnly");
|
|
12
14
|
const { setCode } = useCodeBlockEditorContext();
|
|
13
15
|
return /* @__PURE__ */ React__default.createElement(
|
|
14
16
|
SandpackProvider,
|
|
@@ -26,7 +28,7 @@ const SandpackEditor = ({ nodeKey, code, focusEmitter, preset }) => {
|
|
|
26
28
|
dependencies: preset.dependencies
|
|
27
29
|
}
|
|
28
30
|
},
|
|
29
|
-
/* @__PURE__ */ React__default.createElement(SandpackLayout, null, /* @__PURE__ */ React__default.createElement(SandpackCodeEditor, { showLineNumbers: true, showInlineErrors: true, ref: codeMirrorRef }), /* @__PURE__ */ React__default.createElement(SandpackPreview, null)),
|
|
31
|
+
/* @__PURE__ */ React__default.createElement(SandpackLayout, null, /* @__PURE__ */ React__default.createElement(SandpackCodeEditor, { readOnly, showLineNumbers: true, showInlineErrors: true, ref: codeMirrorRef }), /* @__PURE__ */ React__default.createElement(SandpackPreview, null)),
|
|
30
32
|
/* @__PURE__ */ React__default.createElement(CodeUpdateEmitter, { onChange: setCode, snippetFileName: preset.snippetFileName })
|
|
31
33
|
);
|
|
32
34
|
};
|
|
@@ -106,6 +106,7 @@ export declare const sandpackSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
106
106
|
contentEditableClassName: RealmNode<string>;
|
|
107
107
|
placeholder: RealmNode<React.ReactNode>;
|
|
108
108
|
autoFocus: RealmNode<boolean>;
|
|
109
|
+
readOnly: RealmNode<boolean>;
|
|
109
110
|
composerChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
110
111
|
addComposerChild: RealmNode<React.ComponentType<{}>>;
|
|
111
112
|
topAreaChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
@@ -156,6 +157,7 @@ export declare const sandpackSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
156
157
|
contentEditableClassName: RealmNode<string>;
|
|
157
158
|
placeholder: RealmNode<React.ReactNode>;
|
|
158
159
|
autoFocus: RealmNode<boolean>;
|
|
160
|
+
readOnly: RealmNode<boolean>;
|
|
159
161
|
composerChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
160
162
|
addComposerChild: RealmNode<React.ComponentType<{}>>;
|
|
161
163
|
topAreaChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
@@ -206,6 +208,7 @@ export declare const sandpackSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
206
208
|
contentEditableClassName: RealmNode<string>;
|
|
207
209
|
placeholder: RealmNode<React.ReactNode>;
|
|
208
210
|
autoFocus: RealmNode<boolean>;
|
|
211
|
+
readOnly: RealmNode<boolean>;
|
|
209
212
|
composerChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
210
213
|
addComposerChild: RealmNode<React.ComponentType<{}>>;
|
|
211
214
|
topAreaChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
@@ -261,6 +264,7 @@ export declare const sandpackSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
261
264
|
contentEditableClassName: RealmNode<string>;
|
|
262
265
|
placeholder: RealmNode<React.ReactNode>;
|
|
263
266
|
autoFocus: RealmNode<boolean>;
|
|
267
|
+
readOnly: RealmNode<boolean>;
|
|
264
268
|
composerChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
265
269
|
addComposerChild: RealmNode<React.ComponentType<{}>>;
|
|
266
270
|
topAreaChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
@@ -322,6 +326,7 @@ sandpackPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
322
326
|
contentEditableClassName: RealmNode<string>;
|
|
323
327
|
placeholder: RealmNode<React.ReactNode>;
|
|
324
328
|
autoFocus: RealmNode<boolean>;
|
|
329
|
+
readOnly: RealmNode<boolean>;
|
|
325
330
|
composerChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
326
331
|
addComposerChild: RealmNode<React.ComponentType<{}>>;
|
|
327
332
|
topAreaChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
@@ -372,6 +377,7 @@ sandpackPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
372
377
|
contentEditableClassName: RealmNode<string>;
|
|
373
378
|
placeholder: RealmNode<React.ReactNode>;
|
|
374
379
|
autoFocus: RealmNode<boolean>;
|
|
380
|
+
readOnly: RealmNode<boolean>;
|
|
375
381
|
composerChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
376
382
|
addComposerChild: RealmNode<React.ComponentType<{}>>;
|
|
377
383
|
topAreaChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
@@ -422,6 +428,7 @@ sandpackPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
422
428
|
contentEditableClassName: RealmNode<string>;
|
|
423
429
|
placeholder: RealmNode<React.ReactNode>;
|
|
424
430
|
autoFocus: RealmNode<boolean>;
|
|
431
|
+
readOnly: RealmNode<boolean>;
|
|
425
432
|
composerChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
426
433
|
addComposerChild: RealmNode<React.ComponentType<{}>>;
|
|
427
434
|
topAreaChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
@@ -477,6 +484,7 @@ sandpackPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
477
484
|
contentEditableClassName: RealmNode<string>;
|
|
478
485
|
placeholder: RealmNode<React.ReactNode>;
|
|
479
486
|
autoFocus: RealmNode<boolean>;
|
|
487
|
+
readOnly: RealmNode<boolean>;
|
|
480
488
|
composerChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
481
489
|
addComposerChild: RealmNode<React.ComponentType<{}>>;
|
|
482
490
|
topAreaChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
@@ -543,6 +551,7 @@ sandpackPluginHooks: {
|
|
|
543
551
|
contentEditableClassName: RealmNode<string>;
|
|
544
552
|
placeholder: RealmNode<React.ReactNode>;
|
|
545
553
|
autoFocus: RealmNode<boolean>;
|
|
554
|
+
readOnly: RealmNode<boolean>;
|
|
546
555
|
composerChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
547
556
|
addComposerChild: RealmNode<React.ComponentType<{}>>;
|
|
548
557
|
topAreaChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
@@ -568,7 +577,7 @@ sandpackPluginHooks: {
|
|
|
568
577
|
appendCodeBlockEditorDescriptor: RealmNode<CodeBlockEditorDescriptor>;
|
|
569
578
|
insertCodeBlock: RealmNode<Partial<CreateCodeBlockNodeOptions>>;
|
|
570
579
|
}>;
|
|
571
|
-
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" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "codeBlockEditorDescriptors" | "defaultCodeBlockLanguage" | "appendCodeBlockEditorDescriptor" | "insertCodeBlock" | "insertSandpack" | "sandpackConfig">(key: K, callback: (value: ValueForKey<{
|
|
580
|
+
useEmitter: <K extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "codeBlockEditorDescriptors" | "defaultCodeBlockLanguage" | "appendCodeBlockEditorDescriptor" | "insertCodeBlock" | "insertSandpack" | "sandpackConfig">(key: K, callback: (value: ValueForKey<{
|
|
572
581
|
insertSandpack: RealmNode<string>;
|
|
573
582
|
sandpackConfig: RealmNode<SandpackConfig>;
|
|
574
583
|
} & {
|
|
@@ -602,6 +611,7 @@ sandpackPluginHooks: {
|
|
|
602
611
|
contentEditableClassName: RealmNode<string>;
|
|
603
612
|
placeholder: RealmNode<React.ReactNode>;
|
|
604
613
|
autoFocus: RealmNode<boolean>;
|
|
614
|
+
readOnly: RealmNode<boolean>;
|
|
605
615
|
composerChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
606
616
|
addComposerChild: RealmNode<React.ComponentType<{}>>;
|
|
607
617
|
topAreaChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
@@ -661,6 +671,7 @@ sandpackPluginHooks: {
|
|
|
661
671
|
contentEditableClassName: RealmNode<string>;
|
|
662
672
|
placeholder: RealmNode<React.ReactNode>;
|
|
663
673
|
autoFocus: RealmNode<boolean>;
|
|
674
|
+
readOnly: RealmNode<boolean>;
|
|
664
675
|
composerChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
665
676
|
addComposerChild: RealmNode<React.ComponentType<{}>>;
|
|
666
677
|
topAreaChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
@@ -719,6 +730,7 @@ sandpackPluginHooks: {
|
|
|
719
730
|
contentEditableClassName: RealmNode<string>;
|
|
720
731
|
placeholder: RealmNode<React.ReactNode>;
|
|
721
732
|
autoFocus: RealmNode<boolean>;
|
|
733
|
+
readOnly: RealmNode<boolean>;
|
|
722
734
|
composerChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
723
735
|
addComposerChild: RealmNode<React.ComponentType<{}>>;
|
|
724
736
|
topAreaChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
@@ -778,6 +790,7 @@ sandpackPluginHooks: {
|
|
|
778
790
|
contentEditableClassName: RealmNode<string>;
|
|
779
791
|
placeholder: RealmNode<React.ReactNode>;
|
|
780
792
|
autoFocus: RealmNode<boolean>;
|
|
793
|
+
readOnly: RealmNode<boolean>;
|
|
781
794
|
composerChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
782
795
|
addComposerChild: RealmNode<React.ComponentType<{}>>;
|
|
783
796
|
topAreaChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
@@ -803,7 +816,7 @@ sandpackPluginHooks: {
|
|
|
803
816
|
appendCodeBlockEditorDescriptor: RealmNode<CodeBlockEditorDescriptor>;
|
|
804
817
|
insertCodeBlock: RealmNode<Partial<CreateCodeBlockNodeOptions>>;
|
|
805
818
|
}>) => void;
|
|
806
|
-
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" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "codeBlockEditorDescriptors" | "defaultCodeBlockLanguage" | "appendCodeBlockEditorDescriptor" | "insertCodeBlock" | "insertSandpack" | "sandpackConfig">(key: K_2) => (value: ValueForKey<{
|
|
819
|
+
usePublisher: <K_2 extends "jsxComponentDescriptors" | "jsxIsAvailable" | "toMarkdownOptions" | "toMarkdownExtensions" | "mdastExtensions" | "syntaxExtensions" | "markdown" | "activeEditor" | "inFocus" | "historyState" | "currentSelection" | "initialRootEditorState" | "rootEditor" | "createRootEditorSubscription" | "createActiveEditorSubscription" | "importVisitors" | "usedLexicalNodes" | "addImportVisitor" | "addLexicalNode" | "addSyntaxExtension" | "addMdastExtension" | "addToMarkdownExtension" | "addExportVisitor" | "exportVisitors" | "initialMarkdown" | "setMarkdown" | "editorRootElementRef" | "contentEditableClassName" | "placeholder" | "autoFocus" | "readOnly" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "codeBlockEditorDescriptors" | "defaultCodeBlockLanguage" | "appendCodeBlockEditorDescriptor" | "insertCodeBlock" | "insertSandpack" | "sandpackConfig">(key: K_2) => (value: ValueForKey<{
|
|
807
820
|
insertSandpack: RealmNode<string>;
|
|
808
821
|
sandpackConfig: RealmNode<SandpackConfig>;
|
|
809
822
|
} & {
|
|
@@ -837,6 +850,7 @@ sandpackPluginHooks: {
|
|
|
837
850
|
contentEditableClassName: RealmNode<string>;
|
|
838
851
|
placeholder: RealmNode<React.ReactNode>;
|
|
839
852
|
autoFocus: RealmNode<boolean>;
|
|
853
|
+
readOnly: RealmNode<boolean>;
|
|
840
854
|
composerChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
841
855
|
addComposerChild: RealmNode<React.ComponentType<{}>>;
|
|
842
856
|
topAreaChildren: RealmNode<React.ComponentType<{}>[]>;
|
|
@@ -43,6 +43,7 @@ export declare const tableSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
43
43
|
contentEditableClassName: RealmNode<string>;
|
|
44
44
|
placeholder: RealmNode<ReactNode>;
|
|
45
45
|
autoFocus: RealmNode<boolean>;
|
|
46
|
+
readOnly: RealmNode<boolean>;
|
|
46
47
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
47
48
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
48
49
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -93,6 +94,7 @@ export declare const tableSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
93
94
|
contentEditableClassName: RealmNode<string>;
|
|
94
95
|
placeholder: RealmNode<ReactNode>;
|
|
95
96
|
autoFocus: RealmNode<boolean>;
|
|
97
|
+
readOnly: RealmNode<boolean>;
|
|
96
98
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
97
99
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
98
100
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -148,6 +150,7 @@ tablePlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
148
150
|
contentEditableClassName: RealmNode<string>;
|
|
149
151
|
placeholder: RealmNode<ReactNode>;
|
|
150
152
|
autoFocus: RealmNode<boolean>;
|
|
153
|
+
readOnly: RealmNode<boolean>;
|
|
151
154
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
152
155
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
153
156
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -198,6 +201,7 @@ tablePlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
198
201
|
contentEditableClassName: RealmNode<string>;
|
|
199
202
|
placeholder: RealmNode<ReactNode>;
|
|
200
203
|
autoFocus: RealmNode<boolean>;
|
|
204
|
+
readOnly: RealmNode<boolean>;
|
|
201
205
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
202
206
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
203
207
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -255,6 +259,7 @@ tablePluginHooks: {
|
|
|
255
259
|
contentEditableClassName: RealmNode<string>;
|
|
256
260
|
placeholder: RealmNode<ReactNode>;
|
|
257
261
|
autoFocus: RealmNode<boolean>;
|
|
262
|
+
readOnly: RealmNode<boolean>;
|
|
258
263
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
259
264
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
260
265
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -275,7 +280,7 @@ tablePluginHooks: {
|
|
|
275
280
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
276
281
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
277
282
|
}>;
|
|
278
|
-
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" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "insertTable">(key: K, callback: (value: ValueForKey<{
|
|
283
|
+
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" | "insertTable">(key: K, callback: (value: ValueForKey<{
|
|
279
284
|
insertTable: RealmNode<true>;
|
|
280
285
|
} & {
|
|
281
286
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
@@ -308,6 +313,7 @@ tablePluginHooks: {
|
|
|
308
313
|
contentEditableClassName: RealmNode<string>;
|
|
309
314
|
placeholder: RealmNode<ReactNode>;
|
|
310
315
|
autoFocus: RealmNode<boolean>;
|
|
316
|
+
readOnly: RealmNode<boolean>;
|
|
311
317
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
312
318
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
313
319
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -361,6 +367,7 @@ tablePluginHooks: {
|
|
|
361
367
|
contentEditableClassName: RealmNode<string>;
|
|
362
368
|
placeholder: RealmNode<ReactNode>;
|
|
363
369
|
autoFocus: RealmNode<boolean>;
|
|
370
|
+
readOnly: RealmNode<boolean>;
|
|
364
371
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
365
372
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
366
373
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -413,6 +420,7 @@ tablePluginHooks: {
|
|
|
413
420
|
contentEditableClassName: RealmNode<string>;
|
|
414
421
|
placeholder: RealmNode<ReactNode>;
|
|
415
422
|
autoFocus: RealmNode<boolean>;
|
|
423
|
+
readOnly: RealmNode<boolean>;
|
|
416
424
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
417
425
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
418
426
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -466,6 +474,7 @@ tablePluginHooks: {
|
|
|
466
474
|
contentEditableClassName: RealmNode<string>;
|
|
467
475
|
placeholder: RealmNode<ReactNode>;
|
|
468
476
|
autoFocus: RealmNode<boolean>;
|
|
477
|
+
readOnly: RealmNode<boolean>;
|
|
469
478
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
470
479
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
471
480
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -486,7 +495,7 @@ tablePluginHooks: {
|
|
|
486
495
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
487
496
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
488
497
|
}>) => void;
|
|
489
|
-
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" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "insertTable">(key: K_2) => (value: ValueForKey<{
|
|
498
|
+
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" | "insertTable">(key: K_2) => (value: ValueForKey<{
|
|
490
499
|
insertTable: RealmNode<true>;
|
|
491
500
|
} & {
|
|
492
501
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
@@ -519,6 +528,7 @@ tablePluginHooks: {
|
|
|
519
528
|
contentEditableClassName: RealmNode<string>;
|
|
520
529
|
placeholder: RealmNode<ReactNode>;
|
|
521
530
|
autoFocus: RealmNode<boolean>;
|
|
531
|
+
readOnly: RealmNode<boolean>;
|
|
522
532
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
523
533
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
524
534
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -43,6 +43,7 @@ export declare const thematicBreakSystem: SystemSpec<[SystemSpec<[], (r: Realm)
|
|
|
43
43
|
contentEditableClassName: RealmNode<string>;
|
|
44
44
|
placeholder: RealmNode<ReactNode>;
|
|
45
45
|
autoFocus: RealmNode<boolean>;
|
|
46
|
+
readOnly: RealmNode<boolean>;
|
|
46
47
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
47
48
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
48
49
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -93,6 +94,7 @@ export declare const thematicBreakSystem: SystemSpec<[SystemSpec<[], (r: Realm)
|
|
|
93
94
|
contentEditableClassName: RealmNode<string>;
|
|
94
95
|
placeholder: RealmNode<ReactNode>;
|
|
95
96
|
autoFocus: RealmNode<boolean>;
|
|
97
|
+
readOnly: RealmNode<boolean>;
|
|
96
98
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
97
99
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
98
100
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -148,6 +150,7 @@ thematicBreakPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
148
150
|
contentEditableClassName: RealmNode<string>;
|
|
149
151
|
placeholder: RealmNode<ReactNode>;
|
|
150
152
|
autoFocus: RealmNode<boolean>;
|
|
153
|
+
readOnly: RealmNode<boolean>;
|
|
151
154
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
152
155
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
153
156
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -198,6 +201,7 @@ thematicBreakPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) =>
|
|
|
198
201
|
contentEditableClassName: RealmNode<string>;
|
|
199
202
|
placeholder: RealmNode<ReactNode>;
|
|
200
203
|
autoFocus: RealmNode<boolean>;
|
|
204
|
+
readOnly: RealmNode<boolean>;
|
|
201
205
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
202
206
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
203
207
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -255,6 +259,7 @@ thematicBreakPluginHooks: {
|
|
|
255
259
|
contentEditableClassName: RealmNode<string>;
|
|
256
260
|
placeholder: RealmNode<ReactNode>;
|
|
257
261
|
autoFocus: RealmNode<boolean>;
|
|
262
|
+
readOnly: RealmNode<boolean>;
|
|
258
263
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
259
264
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
260
265
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -275,7 +280,7 @@ thematicBreakPluginHooks: {
|
|
|
275
280
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
276
281
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
277
282
|
}>;
|
|
278
|
-
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" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "insertThematicBreak">(key: K, callback: (value: ValueForKey<{
|
|
283
|
+
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" | "insertThematicBreak">(key: K, callback: (value: ValueForKey<{
|
|
279
284
|
insertThematicBreak: RealmNode<true>;
|
|
280
285
|
} & {
|
|
281
286
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
@@ -308,6 +313,7 @@ thematicBreakPluginHooks: {
|
|
|
308
313
|
contentEditableClassName: RealmNode<string>;
|
|
309
314
|
placeholder: RealmNode<ReactNode>;
|
|
310
315
|
autoFocus: RealmNode<boolean>;
|
|
316
|
+
readOnly: RealmNode<boolean>;
|
|
311
317
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
312
318
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
313
319
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -361,6 +367,7 @@ thematicBreakPluginHooks: {
|
|
|
361
367
|
contentEditableClassName: RealmNode<string>;
|
|
362
368
|
placeholder: RealmNode<ReactNode>;
|
|
363
369
|
autoFocus: RealmNode<boolean>;
|
|
370
|
+
readOnly: RealmNode<boolean>;
|
|
364
371
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
365
372
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
366
373
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -413,6 +420,7 @@ thematicBreakPluginHooks: {
|
|
|
413
420
|
contentEditableClassName: RealmNode<string>;
|
|
414
421
|
placeholder: RealmNode<ReactNode>;
|
|
415
422
|
autoFocus: RealmNode<boolean>;
|
|
423
|
+
readOnly: RealmNode<boolean>;
|
|
416
424
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
417
425
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
418
426
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -466,6 +474,7 @@ thematicBreakPluginHooks: {
|
|
|
466
474
|
contentEditableClassName: RealmNode<string>;
|
|
467
475
|
placeholder: RealmNode<ReactNode>;
|
|
468
476
|
autoFocus: RealmNode<boolean>;
|
|
477
|
+
readOnly: RealmNode<boolean>;
|
|
469
478
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
470
479
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
471
480
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -486,7 +495,7 @@ thematicBreakPluginHooks: {
|
|
|
486
495
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
487
496
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
488
497
|
}>) => void;
|
|
489
|
-
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" | "composerChildren" | "addComposerChild" | "topAreaChildren" | "addTopAreaChild" | "nestedEditorChildren" | "addNestedEditorChild" | "editorWrappers" | "addEditorWrapper" | "currentFormat" | "editorInFocus" | "applyFormat" | "currentBlockType" | "applyBlockType" | "convertSelectionToNode" | "insertDecoratorNode" | "insertThematicBreak">(key: K_2) => (value: ValueForKey<{
|
|
498
|
+
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" | "insertThematicBreak">(key: K_2) => (value: ValueForKey<{
|
|
490
499
|
insertThematicBreak: RealmNode<true>;
|
|
491
500
|
} & {
|
|
492
501
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
@@ -519,6 +528,7 @@ thematicBreakPluginHooks: {
|
|
|
519
528
|
contentEditableClassName: RealmNode<string>;
|
|
520
529
|
placeholder: RealmNode<ReactNode>;
|
|
521
530
|
autoFocus: RealmNode<boolean>;
|
|
531
|
+
readOnly: RealmNode<boolean>;
|
|
522
532
|
composerChildren: RealmNode<ComponentType<{}>[]>;
|
|
523
533
|
addComposerChild: RealmNode<ComponentType<{}>>;
|
|
524
534
|
topAreaChildren: RealmNode<ComponentType<{}>[]>;
|
|
@@ -8,7 +8,7 @@ import styles from "../../../styles/ui.module.css.js";
|
|
|
8
8
|
const DiffSourceToggleWrapper = ({ children }) => {
|
|
9
9
|
const [viewMode] = diffSourcePluginHooks.useEmitterValues("viewMode");
|
|
10
10
|
const changeViewMode = diffSourcePluginHooks.usePublisher("viewMode");
|
|
11
|
-
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, viewMode === "rich-text" ? children : viewMode === "diff" ? /* @__PURE__ */ React__default.createElement("span", { className: styles.toolbarTitleMode }, "Diff mode") : /* @__PURE__ */ React__default.createElement("span", { className: styles.toolbarTitleMode }, "Source mode"), /* @__PURE__ */ React__default.createElement("div", { style: { marginLeft: "auto" } }, /* @__PURE__ */ React__default.createElement(
|
|
11
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, viewMode === "rich-text" ? children : viewMode === "diff" ? /* @__PURE__ */ React__default.createElement("span", { className: styles.toolbarTitleMode }, "Diff mode") : /* @__PURE__ */ React__default.createElement("span", { className: styles.toolbarTitleMode }, "Source mode"), /* @__PURE__ */ React__default.createElement("div", { style: { marginLeft: "auto", pointerEvents: "auto", opacity: 1 } }, /* @__PURE__ */ React__default.createElement(
|
|
12
12
|
SingleChoiceToggleGroup,
|
|
13
13
|
{
|
|
14
14
|
className: styles.diffSourceToggle,
|