@mdxeditor/editor 0.2.0 → 0.3.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/README.md +14 -75
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +29 -27
- package/dist/index.js +138 -132
- package/dist/style.css +298 -154
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -274,23 +274,6 @@ export declare type DefaultMdxOptionValues = {
|
|
|
274
274
|
*/
|
|
275
275
|
export declare const defaultMdxOptionValues: DefaultMdxOptionValues;
|
|
276
276
|
|
|
277
|
-
declare interface ExportLexicalTreeOptions {
|
|
278
|
-
root: RootNode;
|
|
279
|
-
visitors: LexicalVisitor[];
|
|
280
|
-
jsxComponentDescriptors: JsxComponentDescriptor[];
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
declare interface ExportMarkdownFromLexicalOptions extends ExportLexicalTreeOptions {
|
|
284
|
-
/**
|
|
285
|
-
* the markdown extensions to use
|
|
286
|
-
*/
|
|
287
|
-
toMarkdownExtensions: Array<ToMarkdownExtension>;
|
|
288
|
-
/**
|
|
289
|
-
* The options to pass to `toMarkdown`
|
|
290
|
-
*/
|
|
291
|
-
toMarkdownOptions: ToMarkdownOptions;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
277
|
declare type ExtendedEditorConfig = EditorConfig & {
|
|
295
278
|
theme: EditorConfig['theme'] & {
|
|
296
279
|
nodeDecoratorComponents: NodeDecoratorComponents;
|
|
@@ -435,6 +418,24 @@ export declare interface JsxPropertyDescriptor {
|
|
|
435
418
|
required?: boolean;
|
|
436
419
|
}
|
|
437
420
|
|
|
421
|
+
/**
|
|
422
|
+
* Configures how the lexical tree is converted to a mdast tree and then to markdown.
|
|
423
|
+
*/
|
|
424
|
+
export declare interface LexicalConvertOptions {
|
|
425
|
+
/**
|
|
426
|
+
* The visitors to use when processing the lexical tree
|
|
427
|
+
*/
|
|
428
|
+
visitors?: LexicalVisitor[];
|
|
429
|
+
/**
|
|
430
|
+
* the markdown extensions to use
|
|
431
|
+
*/
|
|
432
|
+
toMarkdownExtensions?: Array<ToMarkdownExtension>;
|
|
433
|
+
/**
|
|
434
|
+
* The options to pass to `toMarkdown`
|
|
435
|
+
*/
|
|
436
|
+
toMarkdownOptions?: ToMarkdownOptions;
|
|
437
|
+
}
|
|
438
|
+
|
|
438
439
|
/**
|
|
439
440
|
* Implement this interface in order to process mdast node(s) into a lexical tree.
|
|
440
441
|
* This is part of the process that converts the editor contents to markdown.
|
|
@@ -661,13 +662,14 @@ export declare interface MDXEditorProps {
|
|
|
661
662
|
*/
|
|
662
663
|
markdownParseOptions?: Partial<MarkdownParseOptions>;
|
|
663
664
|
/**
|
|
664
|
-
* The {@link https://lexical.dev/ Lexical nodes} used by the editor.
|
|
665
|
+
* The {@link https://lexical.dev/ | Lexical nodes} used by the editor.
|
|
665
666
|
*/
|
|
666
667
|
lexicalNodes?: Klass<LexicalNode>[];
|
|
667
668
|
/**
|
|
668
669
|
* The options used when converting the lexical tree to markdown.
|
|
670
|
+
* @see the {@link LexicalConvertOptions} interface for more details.
|
|
669
671
|
*/
|
|
670
|
-
lexicalConvertOptions?:
|
|
672
|
+
lexicalConvertOptions?: LexicalConvertOptions;
|
|
671
673
|
/**
|
|
672
674
|
* The supported code block languages.
|
|
673
675
|
*/
|
|
@@ -683,15 +685,15 @@ declare interface NodeDecoratorComponents {
|
|
|
683
685
|
}
|
|
684
686
|
|
|
685
687
|
/**
|
|
686
|
-
* The configuration for the available sandpack presets
|
|
688
|
+
* The configuration for the available sandpack presets.
|
|
687
689
|
*/
|
|
688
690
|
export declare interface SandpackConfig {
|
|
689
691
|
/**
|
|
690
|
-
* The name of the default preset that will be used if no meta (other than live) is set
|
|
692
|
+
* The name of the default preset that will be used if no meta (other than live) is set.
|
|
691
693
|
*/
|
|
692
694
|
defaultPreset: string;
|
|
693
695
|
/**
|
|
694
|
-
* The list of sandpack presets that can be used
|
|
696
|
+
* The list of sandpack presets that can be used.
|
|
695
697
|
*/
|
|
696
698
|
presets: Array<SandpackPreset>;
|
|
697
699
|
}
|
|
@@ -737,11 +739,11 @@ export declare class SandpackNode extends DecoratorNode<JSX.Element> {
|
|
|
737
739
|
*/
|
|
738
740
|
export declare interface SandpackPreset {
|
|
739
741
|
/**
|
|
740
|
-
* The name of the preset - use this to reference the preset from the defaultPreset field
|
|
742
|
+
* The name of the preset - use this to reference the preset from the defaultPreset field.
|
|
741
743
|
*/
|
|
742
744
|
name: string;
|
|
743
745
|
/**
|
|
744
|
-
* The label of
|
|
746
|
+
* The label of the preset, displayed in the sandpack button dropdown.
|
|
745
747
|
*/
|
|
746
748
|
label: string;
|
|
747
749
|
/**
|
|
@@ -757,11 +759,11 @@ export declare interface SandpackPreset {
|
|
|
757
759
|
*/
|
|
758
760
|
sandpackTheme: SandpackProviderProps['theme'];
|
|
759
761
|
/**
|
|
760
|
-
* The name of the file that will be created in the sandbox. e.g. "/App.js"
|
|
762
|
+
* The name of the file that will be created in the sandbox. e.g. "/App.js".
|
|
761
763
|
*/
|
|
762
764
|
snippetFileName: string;
|
|
763
765
|
/**
|
|
764
|
-
* The dependencies that will be added to the sandbox, just like in package.json
|
|
766
|
+
* The dependencies that will be added to the sandbox, just like in package.json.
|
|
765
767
|
*/
|
|
766
768
|
dependencies?: Record<string, string>;
|
|
767
769
|
/**
|
|
@@ -770,7 +772,7 @@ export declare interface SandpackPreset {
|
|
|
770
772
|
*/
|
|
771
773
|
files?: Record<string, string>;
|
|
772
774
|
/**
|
|
773
|
-
* The language used in the editable snippet. e.g. "jsx", "tsx", etc
|
|
775
|
+
* The language used in the editable snippet. e.g. "jsx", "tsx", etc.
|
|
774
776
|
*/
|
|
775
777
|
snippetLanguage?: string;
|
|
776
778
|
/**
|
package/dist/index.js
CHANGED
|
@@ -17,17 +17,16 @@ import { ElementNode, $createParagraphNode, $applyNodeReplacement, DecoratorNode
|
|
|
17
17
|
import { AdmonitionKind } from "lexical";
|
|
18
18
|
import * as React from "react";
|
|
19
19
|
import React__default, { createContext, forwardRef, useMemo, useImperativeHandle, createElement, useCallback, useContext, useState, useEffect } from "react";
|
|
20
|
-
import { directiveToMarkdown, directiveFromMarkdown } from "mdast-util-directive";
|
|
21
|
-
import { frontmatterToMarkdown, frontmatterFromMarkdown } from "mdast-util-frontmatter";
|
|
22
|
-
import { gfmTableToMarkdown, gfmTableFromMarkdown } from "mdast-util-gfm-table";
|
|
23
|
-
import { mdxToMarkdown, mdxFromMarkdown } from "mdast-util-mdx";
|
|
24
|
-
import { toMarkdown } from "mdast-util-to-markdown";
|
|
25
20
|
import { CodeNode } from "@lexical/code";
|
|
26
21
|
import { $isLinkNode, LinkNode, $createLinkNode, TOGGLE_LINK_COMMAND } from "@lexical/link";
|
|
27
22
|
import { $isListNode, $isListItemNode, ListNode, ListItemNode, $createListNode, $createListItemNode, INSERT_ORDERED_LIST_COMMAND, INSERT_UNORDERED_LIST_COMMAND, REMOVE_LIST_COMMAND, $getListDepth } from "@lexical/list";
|
|
28
23
|
import { $isHorizontalRuleNode, HorizontalRuleNode, $createHorizontalRuleNode, INSERT_HORIZONTAL_RULE_COMMAND } from "@lexical/react/LexicalHorizontalRuleNode";
|
|
29
24
|
import { $isHeadingNode, $isQuoteNode, HeadingNode, QuoteNode, $createHeadingNode, $createQuoteNode } from "@lexical/rich-text";
|
|
25
|
+
import { directiveToMarkdown, directiveFromMarkdown } from "mdast-util-directive";
|
|
30
26
|
import { fromMarkdown } from "mdast-util-from-markdown";
|
|
27
|
+
import { frontmatterToMarkdown, frontmatterFromMarkdown } from "mdast-util-frontmatter";
|
|
28
|
+
import { gfmTableToMarkdown, gfmTableFromMarkdown } from "mdast-util-gfm-table";
|
|
29
|
+
import { mdxToMarkdown, mdxFromMarkdown } from "mdast-util-mdx";
|
|
31
30
|
import { directive } from "micromark-extension-directive";
|
|
32
31
|
import { frontmatter } from "micromark-extension-frontmatter";
|
|
33
32
|
import { gfmTable } from "micromark-extension-gfm-table";
|
|
@@ -36,6 +35,7 @@ import { addClassNamesToElement, $insertNodeToNearestRoot, $findMatchingParent,
|
|
|
36
35
|
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
37
36
|
import { $setBlocksType, $isAtNodeEnd } from "@lexical/selection";
|
|
38
37
|
import { createEmptyHistoryState, HistoryPlugin } from "@lexical/react/LexicalHistoryPlugin";
|
|
38
|
+
import { toMarkdown } from "mdast-util-to-markdown";
|
|
39
39
|
import * as RadixPopover from "@radix-ui/react-popover";
|
|
40
40
|
import * as Tooltip from "@radix-ui/react-tooltip";
|
|
41
41
|
import { useCombobox } from "downshift";
|
|
@@ -391,21 +391,23 @@ function $createImageNode(options) {
|
|
|
391
391
|
function $isImageNode(node) {
|
|
392
392
|
return node instanceof ImageNode;
|
|
393
393
|
}
|
|
394
|
-
const
|
|
395
|
-
const
|
|
396
|
-
const
|
|
397
|
-
const
|
|
398
|
-
const
|
|
399
|
-
const
|
|
400
|
-
const
|
|
401
|
-
const
|
|
402
|
-
const
|
|
403
|
-
const
|
|
404
|
-
const
|
|
405
|
-
const
|
|
406
|
-
const
|
|
407
|
-
const
|
|
394
|
+
const darkTheme = "_dark-theme_13nbk_1";
|
|
395
|
+
const bold = "_bold_13nbk_10";
|
|
396
|
+
const italic = "_italic_13nbk_14";
|
|
397
|
+
const underline = "_underline_13nbk_18";
|
|
398
|
+
const strikethrough = "_strikethrough_13nbk_34";
|
|
399
|
+
const underlineStrikethrough = "_underlineStrikethrough_13nbk_38";
|
|
400
|
+
const subscript = "_subscript_13nbk_42";
|
|
401
|
+
const superscript = "_superscript_13nbk_47";
|
|
402
|
+
const code = "_code_13nbk_52";
|
|
403
|
+
const nestedListItem$1 = "_nestedListItem_13nbk_59";
|
|
404
|
+
const admonitionDanger = "_admonitionDanger_13nbk_63";
|
|
405
|
+
const admonitionInfo = "_admonitionInfo_13nbk_63";
|
|
406
|
+
const admonitionNote = "_admonitionNote_13nbk_63";
|
|
407
|
+
const admonitionTip = "_admonitionTip_13nbk_63";
|
|
408
|
+
const admonitionCaution = "_admonitionCaution_13nbk_63";
|
|
408
409
|
const styles$1 = {
|
|
410
|
+
darkTheme,
|
|
409
411
|
bold,
|
|
410
412
|
italic,
|
|
411
413
|
underline,
|
|
@@ -421,6 +423,115 @@ const styles$1 = {
|
|
|
421
423
|
admonitionTip,
|
|
422
424
|
admonitionCaution
|
|
423
425
|
};
|
|
426
|
+
const editorRoot = "_editorRoot_1x7ym_47";
|
|
427
|
+
const editorWrapper = "_editorWrapper_1x7ym_141";
|
|
428
|
+
const nestedListItem = "_nestedListItem_1x7ym_145";
|
|
429
|
+
const toolbarRoot = "_toolbarRoot_1x7ym_149";
|
|
430
|
+
const toolbarModeSwitch = "_toolbarModeSwitch_1x7ym_170";
|
|
431
|
+
const toolbarToggleItem = "_toolbarToggleItem_1x7ym_179";
|
|
432
|
+
const toolbarGroupOfGroups = "_toolbarGroupOfGroups_1x7ym_189";
|
|
433
|
+
const toolbarToggleSingleGroup = "_toolbarToggleSingleGroup_1x7ym_193";
|
|
434
|
+
const toolbarButton = "_toolbarButton_1x7ym_207";
|
|
435
|
+
const toolbarNodeKindSelectContainer = "_toolbarNodeKindSelectContainer_1x7ym_236";
|
|
436
|
+
const toolbarButtonDropdownContainer = "_toolbarButtonDropdownContainer_1x7ym_237";
|
|
437
|
+
const toolbarCodeBlockLanguageSelectContent = "_toolbarCodeBlockLanguageSelectContent_1x7ym_238";
|
|
438
|
+
const toolbarNodeKindSelectTrigger = "_toolbarNodeKindSelectTrigger_1x7ym_252";
|
|
439
|
+
const toolbarButtonSelectTrigger = "_toolbarButtonSelectTrigger_1x7ym_253";
|
|
440
|
+
const toolbarCodeBlockLanguageSelectTrigger = "_toolbarCodeBlockLanguageSelectTrigger_1x7ym_286";
|
|
441
|
+
const toolbarNodeKindSelectItem = "_toolbarNodeKindSelectItem_1x7ym_292";
|
|
442
|
+
const toolbarNodeKindSelectDropdownArrow = "_toolbarNodeKindSelectDropdownArrow_1x7ym_315";
|
|
443
|
+
const contentEditable = "_contentEditable_1x7ym_319";
|
|
444
|
+
const sandpackWrapper = "_sandpackWrapper_1x7ym_327";
|
|
445
|
+
const frontmatterWrapper = "_frontmatterWrapper_1x7ym_331";
|
|
446
|
+
const frontmatterToggleButton = "_frontmatterToggleButton_1x7ym_341";
|
|
447
|
+
const frontmatterEditorTable = "_frontmatterEditorTable_1x7ym_349";
|
|
448
|
+
const iconButton = "_iconButton_1x7ym_367";
|
|
449
|
+
const frontmatterInput = "_frontmatterInput_1x7ym_373";
|
|
450
|
+
const primaryButton = "_primaryButton_1x7ym_388";
|
|
451
|
+
const linkDialogEditForm = "_linkDialogEditForm_1x7ym_398";
|
|
452
|
+
const linkDialogInputContainer = "_linkDialogInputContainer_1x7ym_404";
|
|
453
|
+
const linkDialogInputWrapper = "_linkDialogInputWrapper_1x7ym_410";
|
|
454
|
+
const linkDialogInput = "_linkDialogInput_1x7ym_404";
|
|
455
|
+
const linkDialogAutocompleteContainer = "_linkDialogAutocompleteContainer_1x7ym_440";
|
|
456
|
+
const linkDialogAnchor = "_linkDialogAnchor_1x7ym_485";
|
|
457
|
+
const linkDialogPopoverContent = "_linkDialogPopoverContent_1x7ym_499";
|
|
458
|
+
const tableColumnEditorPopoverContent = "_tableColumnEditorPopoverContent_1x7ym_499";
|
|
459
|
+
const dialogContent = "_dialogContent_1x7ym_499";
|
|
460
|
+
const linkDialogPreviewAnchor = "_linkDialogPreviewAnchor_1x7ym_513";
|
|
461
|
+
const tooltipContent = "_tooltipContent_1x7ym_535";
|
|
462
|
+
const actionButton = "_actionButton_1x7ym_547";
|
|
463
|
+
const primaryActionButton = "_primaryActionButton_1x7ym_553";
|
|
464
|
+
const tableEditor = "_tableEditor_1x7ym_562";
|
|
465
|
+
const toolCell = "_toolCell_1x7ym_573";
|
|
466
|
+
const tableColumnEditorTrigger = "_tableColumnEditorTrigger_1x7ym_590";
|
|
467
|
+
const tableRowEditorTrigger = "_tableRowEditorTrigger_1x7ym_590";
|
|
468
|
+
const addRowButton = "_addRowButton_1x7ym_590";
|
|
469
|
+
const addColumnButton = "_addColumnButton_1x7ym_590";
|
|
470
|
+
const tableColumnEditorToolbar = "_tableColumnEditorToolbar_1x7ym_624";
|
|
471
|
+
const toggleGroupRoot = "_toggleGroupRoot_1x7ym_636";
|
|
472
|
+
const tableToolsColumn = "_tableToolsColumn_1x7ym_653";
|
|
473
|
+
const leftAlignedCell = "_leftAlignedCell_1x7ym_661";
|
|
474
|
+
const rightAlignedCell = "_rightAlignedCell_1x7ym_665";
|
|
475
|
+
const centeredCell = "_centeredCell_1x7ym_669";
|
|
476
|
+
const dialogOverlay = "_dialogOverlay_1x7ym_697";
|
|
477
|
+
const overlayShow = "_overlayShow_1x7ym_1";
|
|
478
|
+
const contentShow = "_contentShow_1x7ym_1";
|
|
479
|
+
const styles = {
|
|
480
|
+
editorRoot,
|
|
481
|
+
editorWrapper,
|
|
482
|
+
nestedListItem,
|
|
483
|
+
toolbarRoot,
|
|
484
|
+
toolbarModeSwitch,
|
|
485
|
+
toolbarToggleItem,
|
|
486
|
+
toolbarGroupOfGroups,
|
|
487
|
+
toolbarToggleSingleGroup,
|
|
488
|
+
toolbarButton,
|
|
489
|
+
toolbarNodeKindSelectContainer,
|
|
490
|
+
toolbarButtonDropdownContainer,
|
|
491
|
+
toolbarCodeBlockLanguageSelectContent,
|
|
492
|
+
toolbarNodeKindSelectTrigger,
|
|
493
|
+
toolbarButtonSelectTrigger,
|
|
494
|
+
toolbarCodeBlockLanguageSelectTrigger,
|
|
495
|
+
toolbarNodeKindSelectItem,
|
|
496
|
+
toolbarNodeKindSelectDropdownArrow,
|
|
497
|
+
contentEditable,
|
|
498
|
+
sandpackWrapper,
|
|
499
|
+
frontmatterWrapper,
|
|
500
|
+
frontmatterToggleButton,
|
|
501
|
+
frontmatterEditorTable,
|
|
502
|
+
iconButton,
|
|
503
|
+
frontmatterInput,
|
|
504
|
+
primaryButton,
|
|
505
|
+
linkDialogEditForm,
|
|
506
|
+
linkDialogInputContainer,
|
|
507
|
+
linkDialogInputWrapper,
|
|
508
|
+
linkDialogInput,
|
|
509
|
+
linkDialogAutocompleteContainer,
|
|
510
|
+
linkDialogAnchor,
|
|
511
|
+
linkDialogPopoverContent,
|
|
512
|
+
tableColumnEditorPopoverContent,
|
|
513
|
+
dialogContent,
|
|
514
|
+
linkDialogPreviewAnchor,
|
|
515
|
+
tooltipContent,
|
|
516
|
+
actionButton,
|
|
517
|
+
primaryActionButton,
|
|
518
|
+
tableEditor,
|
|
519
|
+
toolCell,
|
|
520
|
+
tableColumnEditorTrigger,
|
|
521
|
+
tableRowEditorTrigger,
|
|
522
|
+
addRowButton,
|
|
523
|
+
addColumnButton,
|
|
524
|
+
tableColumnEditorToolbar,
|
|
525
|
+
toggleGroupRoot,
|
|
526
|
+
tableToolsColumn,
|
|
527
|
+
leftAlignedCell,
|
|
528
|
+
rightAlignedCell,
|
|
529
|
+
centeredCell,
|
|
530
|
+
dialogOverlay,
|
|
531
|
+
overlayShow,
|
|
532
|
+
contentShow
|
|
533
|
+
};
|
|
534
|
+
console.log(styles);
|
|
424
535
|
const theme = {
|
|
425
536
|
text: {
|
|
426
537
|
bold: styles$1.bold,
|
|
@@ -786,7 +897,7 @@ class TableNode extends DecoratorNode {
|
|
|
786
897
|
const row = table.children[rowIndex];
|
|
787
898
|
const cells = row.children;
|
|
788
899
|
const cellsClone = Array.from(cells);
|
|
789
|
-
const rowClone = { ...row,
|
|
900
|
+
const rowClone = { ...row, children: cellsClone };
|
|
790
901
|
cellsClone.splice(colIndex, 1);
|
|
791
902
|
table.children[rowIndex] = rowClone;
|
|
792
903
|
}
|
|
@@ -912,10 +1023,13 @@ const LexicalQuoteVisitor = {
|
|
|
912
1023
|
};
|
|
913
1024
|
const AdmonitionVisitor = {
|
|
914
1025
|
testLexicalNode: $isAdmonitionNode,
|
|
915
|
-
visitLexicalNode: ({ lexicalNode, actions }) => {
|
|
916
|
-
actions.
|
|
917
|
-
|
|
1026
|
+
visitLexicalNode: ({ mdastParent, lexicalNode, actions }) => {
|
|
1027
|
+
const admonition = actions.appendToParent(mdastParent, {
|
|
1028
|
+
type: "containerDirective",
|
|
1029
|
+
name: lexicalNode.getKind(),
|
|
1030
|
+
children: [{ type: "paragraph", children: [] }]
|
|
918
1031
|
});
|
|
1032
|
+
actions.visitChildren(lexicalNode, admonition.children[0]);
|
|
919
1033
|
}
|
|
920
1034
|
};
|
|
921
1035
|
const SandpackNodeVisitor = {
|
|
@@ -2925,114 +3039,6 @@ const SvgArrowDropDown$1 = (props) => /* @__PURE__ */ React.createElement("svg",
|
|
|
2925
3039
|
maskType: "alpha"
|
|
2926
3040
|
} }, /* @__PURE__ */ React.createElement("path", { d: "M0 0h24v24H0z" })), /* @__PURE__ */ React.createElement("g", { mask: "url(#a)" }, /* @__PURE__ */ React.createElement("path", { d: "m12 15-5-5h10l-5 5Z" })));
|
|
2927
3041
|
const DropDownIcon = SvgArrowDropDown$1;
|
|
2928
|
-
const editorRoot = "_editorRoot_1bxeh_43";
|
|
2929
|
-
const editorWrapper = "_editorWrapper_1bxeh_121";
|
|
2930
|
-
const nestedListItem = "_nestedListItem_1bxeh_125";
|
|
2931
|
-
const toolbarRoot = "_toolbarRoot_1bxeh_129";
|
|
2932
|
-
const toolbarModeSwitch = "_toolbarModeSwitch_1bxeh_150";
|
|
2933
|
-
const toolbarToggleItem = "_toolbarToggleItem_1bxeh_159";
|
|
2934
|
-
const toolbarGroupOfGroups = "_toolbarGroupOfGroups_1bxeh_169";
|
|
2935
|
-
const toolbarToggleSingleGroup = "_toolbarToggleSingleGroup_1bxeh_173";
|
|
2936
|
-
const toolbarButton = "_toolbarButton_1bxeh_187";
|
|
2937
|
-
const toolbarNodeKindSelectContainer = "_toolbarNodeKindSelectContainer_1bxeh_216";
|
|
2938
|
-
const toolbarButtonDropdownContainer = "_toolbarButtonDropdownContainer_1bxeh_217";
|
|
2939
|
-
const toolbarCodeBlockLanguageSelectContent = "_toolbarCodeBlockLanguageSelectContent_1bxeh_218";
|
|
2940
|
-
const toolbarNodeKindSelectTrigger = "_toolbarNodeKindSelectTrigger_1bxeh_232";
|
|
2941
|
-
const toolbarButtonSelectTrigger = "_toolbarButtonSelectTrigger_1bxeh_233";
|
|
2942
|
-
const toolbarCodeBlockLanguageSelectTrigger = "_toolbarCodeBlockLanguageSelectTrigger_1bxeh_266";
|
|
2943
|
-
const toolbarNodeKindSelectItem = "_toolbarNodeKindSelectItem_1bxeh_272";
|
|
2944
|
-
const toolbarNodeKindSelectDropdownArrow = "_toolbarNodeKindSelectDropdownArrow_1bxeh_295";
|
|
2945
|
-
const contentEditable = "_contentEditable_1bxeh_299";
|
|
2946
|
-
const sandpackWrapper = "_sandpackWrapper_1bxeh_307";
|
|
2947
|
-
const frontmatterWrapper = "_frontmatterWrapper_1bxeh_311";
|
|
2948
|
-
const frontmatterToggleButton = "_frontmatterToggleButton_1bxeh_321";
|
|
2949
|
-
const frontmatterEditorTable = "_frontmatterEditorTable_1bxeh_329";
|
|
2950
|
-
const iconButton = "_iconButton_1bxeh_347";
|
|
2951
|
-
const frontmatterInput = "_frontmatterInput_1bxeh_353";
|
|
2952
|
-
const primaryButton = "_primaryButton_1bxeh_368";
|
|
2953
|
-
const linkDialogEditForm = "_linkDialogEditForm_1bxeh_378";
|
|
2954
|
-
const linkDialogInputContainer = "_linkDialogInputContainer_1bxeh_384";
|
|
2955
|
-
const linkDialogInputWrapper = "_linkDialogInputWrapper_1bxeh_390";
|
|
2956
|
-
const linkDialogInput = "_linkDialogInput_1bxeh_384";
|
|
2957
|
-
const linkDialogAutocompleteContainer = "_linkDialogAutocompleteContainer_1bxeh_420";
|
|
2958
|
-
const linkDialogAnchor = "_linkDialogAnchor_1bxeh_465";
|
|
2959
|
-
const linkDialogPopoverContent = "_linkDialogPopoverContent_1bxeh_479";
|
|
2960
|
-
const tableColumnEditorPopoverContent = "_tableColumnEditorPopoverContent_1bxeh_479";
|
|
2961
|
-
const dialogContent = "_dialogContent_1bxeh_479";
|
|
2962
|
-
const linkDialogPreviewAnchor = "_linkDialogPreviewAnchor_1bxeh_493";
|
|
2963
|
-
const tooltipContent = "_tooltipContent_1bxeh_515";
|
|
2964
|
-
const actionButton = "_actionButton_1bxeh_527";
|
|
2965
|
-
const primaryActionButton = "_primaryActionButton_1bxeh_533";
|
|
2966
|
-
const tableEditor = "_tableEditor_1bxeh_542";
|
|
2967
|
-
const toolCell = "_toolCell_1bxeh_553";
|
|
2968
|
-
const tableColumnEditorTrigger = "_tableColumnEditorTrigger_1bxeh_570";
|
|
2969
|
-
const tableRowEditorTrigger = "_tableRowEditorTrigger_1bxeh_570";
|
|
2970
|
-
const addRowButton = "_addRowButton_1bxeh_570";
|
|
2971
|
-
const addColumnButton = "_addColumnButton_1bxeh_570";
|
|
2972
|
-
const tableColumnEditorToolbar = "_tableColumnEditorToolbar_1bxeh_604";
|
|
2973
|
-
const toggleGroupRoot = "_toggleGroupRoot_1bxeh_616";
|
|
2974
|
-
const tableToolsColumn = "_tableToolsColumn_1bxeh_633";
|
|
2975
|
-
const leftAlignedCell = "_leftAlignedCell_1bxeh_641";
|
|
2976
|
-
const rightAlignedCell = "_rightAlignedCell_1bxeh_645";
|
|
2977
|
-
const centeredCell = "_centeredCell_1bxeh_649";
|
|
2978
|
-
const dialogOverlay = "_dialogOverlay_1bxeh_677";
|
|
2979
|
-
const overlayShow = "_overlayShow_1bxeh_1";
|
|
2980
|
-
const contentShow = "_contentShow_1bxeh_1";
|
|
2981
|
-
const styles = {
|
|
2982
|
-
editorRoot,
|
|
2983
|
-
editorWrapper,
|
|
2984
|
-
nestedListItem,
|
|
2985
|
-
toolbarRoot,
|
|
2986
|
-
toolbarModeSwitch,
|
|
2987
|
-
toolbarToggleItem,
|
|
2988
|
-
toolbarGroupOfGroups,
|
|
2989
|
-
toolbarToggleSingleGroup,
|
|
2990
|
-
toolbarButton,
|
|
2991
|
-
toolbarNodeKindSelectContainer,
|
|
2992
|
-
toolbarButtonDropdownContainer,
|
|
2993
|
-
toolbarCodeBlockLanguageSelectContent,
|
|
2994
|
-
toolbarNodeKindSelectTrigger,
|
|
2995
|
-
toolbarButtonSelectTrigger,
|
|
2996
|
-
toolbarCodeBlockLanguageSelectTrigger,
|
|
2997
|
-
toolbarNodeKindSelectItem,
|
|
2998
|
-
toolbarNodeKindSelectDropdownArrow,
|
|
2999
|
-
contentEditable,
|
|
3000
|
-
sandpackWrapper,
|
|
3001
|
-
frontmatterWrapper,
|
|
3002
|
-
frontmatterToggleButton,
|
|
3003
|
-
frontmatterEditorTable,
|
|
3004
|
-
iconButton,
|
|
3005
|
-
frontmatterInput,
|
|
3006
|
-
primaryButton,
|
|
3007
|
-
linkDialogEditForm,
|
|
3008
|
-
linkDialogInputContainer,
|
|
3009
|
-
linkDialogInputWrapper,
|
|
3010
|
-
linkDialogInput,
|
|
3011
|
-
linkDialogAutocompleteContainer,
|
|
3012
|
-
linkDialogAnchor,
|
|
3013
|
-
linkDialogPopoverContent,
|
|
3014
|
-
tableColumnEditorPopoverContent,
|
|
3015
|
-
dialogContent,
|
|
3016
|
-
linkDialogPreviewAnchor,
|
|
3017
|
-
tooltipContent,
|
|
3018
|
-
actionButton,
|
|
3019
|
-
primaryActionButton,
|
|
3020
|
-
tableEditor,
|
|
3021
|
-
toolCell,
|
|
3022
|
-
tableColumnEditorTrigger,
|
|
3023
|
-
tableRowEditorTrigger,
|
|
3024
|
-
addRowButton,
|
|
3025
|
-
addColumnButton,
|
|
3026
|
-
tableColumnEditorToolbar,
|
|
3027
|
-
toggleGroupRoot,
|
|
3028
|
-
tableToolsColumn,
|
|
3029
|
-
leftAlignedCell,
|
|
3030
|
-
rightAlignedCell,
|
|
3031
|
-
centeredCell,
|
|
3032
|
-
dialogOverlay,
|
|
3033
|
-
overlayShow,
|
|
3034
|
-
contentShow
|
|
3035
|
-
};
|
|
3036
3042
|
createCommand();
|
|
3037
3043
|
const MAX_SUGGESTIONS$1 = 20;
|
|
3038
3044
|
function LinkEditForm({ initialUrl, onSubmit, onCancel, linkAutocompleteSuggestions }) {
|
|
@@ -4062,7 +4068,7 @@ const TableIcon = SvgTable;
|
|
|
4062
4068
|
const BlockTypeSelect = () => {
|
|
4063
4069
|
const [currentBlockType] = useEmitterValues("currentBlockType");
|
|
4064
4070
|
const applyBlockType = usePublisher("applyBlockType");
|
|
4065
|
-
return /* @__PURE__ */ React__default.createElement(Select.Root, { value: currentBlockType || "", onValueChange: applyBlockType }, /* @__PURE__ */ React__default.createElement(SelectTrigger, { placeholder: "Block type" }), /* @__PURE__ */ React__default.createElement(SelectContent, null, /* @__PURE__ */ React__default.createElement(SelectItem, { value: "paragraph" }, "Paragraph"), /* @__PURE__ */ React__default.createElement(SelectItem, { value: "quote" }, "Quote"), /* @__PURE__ */ React__default.createElement(Select.Separator, null), /* @__PURE__ */ React__default.createElement(SelectItem, { value: "h1" }, "Heading 1"), /* @__PURE__ */ React__default.createElement(SelectItem, { value: "h2" }, "Heading 2"), /* @__PURE__ */ React__default.createElement(SelectItem, { value: "h3" }, "Heading 3"), /* @__PURE__ */ React__default.createElement(SelectItem, { value: "h4" }, "Heading 4"), /* @__PURE__ */ React__default.createElement(SelectItem, { value: "h5" }, "Heading 5"), /* @__PURE__ */ React__default.createElement(SelectItem, { value: "h6" }, "Heading 6"), /* @__PURE__ */ React__default.createElement(Select.Separator, null), /* @__PURE__ */ React__default.createElement(SelectItem, { value: "info" }, "Info")));
|
|
4071
|
+
return /* @__PURE__ */ React__default.createElement(Select.Root, { value: currentBlockType || "", onValueChange: applyBlockType }, /* @__PURE__ */ React__default.createElement(SelectTrigger, { placeholder: "Block type" }), /* @__PURE__ */ React__default.createElement(SelectContent, null, /* @__PURE__ */ React__default.createElement(SelectItem, { value: "paragraph" }, "Paragraph"), /* @__PURE__ */ React__default.createElement(SelectItem, { value: "quote" }, "Quote"), /* @__PURE__ */ React__default.createElement(Select.Separator, null), /* @__PURE__ */ React__default.createElement(SelectItem, { value: "h1" }, "Heading 1"), /* @__PURE__ */ React__default.createElement(SelectItem, { value: "h2" }, "Heading 2"), /* @__PURE__ */ React__default.createElement(SelectItem, { value: "h3" }, "Heading 3"), /* @__PURE__ */ React__default.createElement(SelectItem, { value: "h4" }, "Heading 4"), /* @__PURE__ */ React__default.createElement(SelectItem, { value: "h5" }, "Heading 5"), /* @__PURE__ */ React__default.createElement(SelectItem, { value: "h6" }, "Heading 6"), /* @__PURE__ */ React__default.createElement(Select.Separator, null), /* @__PURE__ */ React__default.createElement(SelectItem, { value: "note" }, "Note"), /* @__PURE__ */ React__default.createElement(SelectItem, { value: "tip" }, "Tip"), /* @__PURE__ */ React__default.createElement(SelectItem, { value: "info" }, "Info"), /* @__PURE__ */ React__default.createElement(SelectItem, { value: "caution" }, "Caution"), /* @__PURE__ */ React__default.createElement(SelectItem, { value: "danger" }, "Danger")));
|
|
4066
4072
|
};
|
|
4067
4073
|
const SvgAddPhoto = (props) => /* @__PURE__ */ React.createElement("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ React.createElement("mask", { id: "mask0_343_38", style: {
|
|
4068
4074
|
maskType: "alpha"
|