@mdxeditor/editor 1.9.2 → 1.10.1
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 +6 -1
- package/dist/icons/add_column.svg.js +1 -2
- package/dist/icons/add_photo.svg.js +1 -2
- package/dist/icons/add_row.svg.js +1 -2
- package/dist/icons/{emergency_home.svg.js → admonition.svg.js} +2 -3
- package/dist/icons/arrow_drop_down.svg.js +3 -4
- package/dist/icons/check.svg.js +1 -2
- package/dist/icons/check_small.svg.js +7 -0
- package/dist/icons/close.svg.js +1 -2
- package/dist/icons/code.svg.js +1 -2
- package/dist/icons/content_copy.svg.js +1 -2
- package/dist/icons/delete_big.svg.js +7 -0
- package/dist/icons/delete_small.svg.js +1 -2
- package/dist/icons/difference.svg.js +1 -2
- package/dist/icons/edit.svg.js +1 -2
- package/dist/icons/extension.svg.js +7 -0
- package/dist/icons/format_align_center.svg.js +1 -2
- package/dist/icons/format_align_left.svg.js +1 -2
- package/dist/icons/format_align_right.svg.js +1 -2
- package/dist/icons/format_bold.svg.js +1 -2
- package/dist/icons/format_italic.svg.js +1 -2
- package/dist/icons/format_list_bulleted.svg.js +1 -2
- package/dist/icons/format_list_checked.svg.js +1 -2
- package/dist/icons/format_list_numbered.svg.js +1 -2
- package/dist/icons/format_underlined.svg.js +1 -2
- package/dist/icons/frame_source.svg.js +1 -2
- package/dist/icons/frontmatter.svg.js +1 -2
- package/dist/icons/horizontal_rule.svg.js +1 -2
- package/dist/icons/insert_col_left.svg.js +1 -2
- package/dist/icons/insert_col_right.svg.js +1 -2
- package/dist/icons/insert_row_above.svg.js +1 -2
- package/dist/icons/insert_row_below.svg.js +1 -2
- package/dist/icons/link.svg.js +1 -2
- package/dist/icons/link_off.svg.js +1 -2
- package/dist/icons/markdown.svg.js +1 -2
- package/dist/icons/more_horiz.svg.js +1 -2
- package/dist/icons/more_vert.svg.js +7 -0
- package/dist/icons/open_in_new.svg.js +1 -2
- package/dist/icons/redo.svg.js +1 -2
- package/dist/icons/rich_text.svg.js +1 -2
- package/dist/icons/{deployed_code.svg.js → sandpack.svg.js} +2 -3
- package/dist/icons/settings.svg.js +1 -2
- package/dist/icons/table.svg.js +1 -2
- package/dist/icons/undo.svg.js +1 -2
- package/dist/plugins/codeblock/index.d.ts +13 -2
- package/dist/plugins/codemirror/index.d.ts +17 -2
- package/dist/plugins/core/Icon.d.ts +6 -0
- package/dist/plugins/core/Icon.js +96 -0
- package/dist/plugins/core/PropertyPopover.js +3 -2
- package/dist/plugins/core/index.d.ts +12 -2
- package/dist/plugins/core/index.js +7 -2
- package/dist/plugins/core/ui/DownshiftAutoComplete.js +3 -2
- package/dist/plugins/diff-source/index.d.ts +13 -2
- package/dist/plugins/directives/index.d.ts +13 -2
- package/dist/plugins/frontmatter/FrontmatterEditor.js +7 -5
- package/dist/plugins/frontmatter/index.d.ts +13 -2
- package/dist/plugins/headings/index.d.ts +13 -2
- package/dist/plugins/image/ImageEditor.js +3 -2
- package/dist/plugins/image/index.d.ts +13 -2
- package/dist/plugins/jsx/index.d.ts +13 -2
- package/dist/plugins/link/index.d.ts +2 -0
- package/dist/plugins/link-dialog/LinkDialog.js +11 -14
- package/dist/plugins/link-dialog/index.d.ts +11 -2
- package/dist/plugins/link-dialog/index.js +0 -6
- package/dist/plugins/lists/index.d.ts +13 -2
- package/dist/plugins/markdown-shortcut/index.d.ts +2 -0
- package/dist/plugins/quote/index.d.ts +10 -2
- package/dist/plugins/sandpack/index.d.ts +17 -2
- package/dist/plugins/table/TableEditor.js +22 -28
- package/dist/plugins/table/index.d.ts +13 -2
- package/dist/plugins/thematic-break/index.d.ts +13 -2
- package/dist/plugins/toolbar/components/BoldItalicUnderlineToggles.js +4 -6
- package/dist/plugins/toolbar/components/CodeToggle.js +2 -3
- package/dist/plugins/toolbar/components/CreateLink.js +2 -2
- package/dist/plugins/toolbar/components/DiffSourceToggleWrapper.js +4 -6
- package/dist/plugins/toolbar/components/InsertAdmonition.js +2 -2
- package/dist/plugins/toolbar/components/InsertCodeBlock.js +2 -2
- package/dist/plugins/toolbar/components/InsertFrontmatter.js +2 -2
- package/dist/plugins/toolbar/components/InsertImage.js +2 -3
- package/dist/plugins/toolbar/components/InsertSandpack.js +2 -2
- package/dist/plugins/toolbar/components/InsertTable.js +2 -2
- package/dist/plugins/toolbar/components/InsertThematicBreak.js +2 -2
- package/dist/plugins/toolbar/components/ListsToggle.js +4 -6
- package/dist/plugins/toolbar/components/ShowSandpackInfo.js +3 -4
- package/dist/plugins/toolbar/components/UndoRedo.js +3 -4
- package/dist/plugins/toolbar/index.d.ts +11 -2
- package/dist/plugins/toolbar/primitives/DialogButton.js +4 -6
- package/dist/plugins/toolbar/primitives/TooltipWrap.js +1 -1
- package/dist/plugins/toolbar/primitives/select.js +4 -5
- package/dist/style.css +252 -236
- package/dist/styles/ui.module.css.js +105 -102
- package/package.json +12 -11
- package/dist/icons/delete.svg.js +0 -8
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React__default from "react";
|
|
2
|
-
import { corePluginHooks } from "../../core/index.js";
|
|
3
2
|
import styles from "../../../styles/ui.module.css.js";
|
|
3
|
+
import { corePluginHooks } from "../../core/index.js";
|
|
4
4
|
import { sandpackPluginHooks } from "../../sandpack/index.js";
|
|
5
5
|
import { ButtonWithTooltip } from "../primitives/toolbar.js";
|
|
6
|
-
import DeleteIcon from "../../../icons/delete.svg.js";
|
|
7
6
|
const ShowSandpackInfo = () => {
|
|
8
|
-
const [editorInFocus, theEditor] = corePluginHooks.useEmitterValues("editorInFocus", "activeEditor");
|
|
7
|
+
const [editorInFocus, theEditor, iconComponentFor] = corePluginHooks.useEmitterValues("editorInFocus", "activeEditor", "iconComponentFor");
|
|
9
8
|
const sandpackNode = editorInFocus.rootNode;
|
|
10
9
|
const [sandpackConfig] = sandpackPluginHooks.useEmitterValues("sandpackConfig");
|
|
11
10
|
const preset = sandpackConfig.presets.find((preset2) => preset2.meta === sandpackNode.getMeta());
|
|
@@ -24,7 +23,7 @@ const ShowSandpackInfo = () => {
|
|
|
24
23
|
});
|
|
25
24
|
}
|
|
26
25
|
},
|
|
27
|
-
|
|
26
|
+
iconComponentFor("delete_big")
|
|
28
27
|
), /* @__PURE__ */ React__default.createElement("label", null, "Sandpack preset: ", preset.name));
|
|
29
28
|
};
|
|
30
29
|
export {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { mergeRegister } from "@lexical/utils";
|
|
2
2
|
import { CAN_UNDO_COMMAND, COMMAND_PRIORITY_CRITICAL, CAN_REDO_COMMAND, UNDO_COMMAND, REDO_COMMAND } from "lexical";
|
|
3
3
|
import React__default from "react";
|
|
4
|
-
import RedoIcon from "../../../icons/redo.svg.js";
|
|
5
|
-
import UndoIcon from "../../../icons/undo.svg.js";
|
|
6
4
|
import { IS_APPLE } from "../../../utils/detectMac.js";
|
|
7
5
|
import { corePluginHooks } from "../../core/index.js";
|
|
8
6
|
import { MultipleChoiceToggleGroup } from "../primitives/toolbar.js";
|
|
9
7
|
const UndoRedo = () => {
|
|
8
|
+
const [iconComponentFor] = corePluginHooks.useEmitterValues("iconComponentFor");
|
|
10
9
|
const [activeEditor] = corePluginHooks.useEmitterValues("activeEditor");
|
|
11
10
|
const [canUndo, setCanUndo] = React__default.useState(false);
|
|
12
11
|
const [canRedo, setCanRedo] = React__default.useState(false);
|
|
@@ -39,14 +38,14 @@ const UndoRedo = () => {
|
|
|
39
38
|
{
|
|
40
39
|
title: IS_APPLE ? "Undo (⌘Z)" : "Undo (Ctrl+Z)",
|
|
41
40
|
disabled: !canUndo,
|
|
42
|
-
contents:
|
|
41
|
+
contents: iconComponentFor("undo"),
|
|
43
42
|
active: false,
|
|
44
43
|
onChange: () => activeEditor == null ? void 0 : activeEditor.dispatchCommand(UNDO_COMMAND, void 0)
|
|
45
44
|
},
|
|
46
45
|
{
|
|
47
46
|
title: IS_APPLE ? "Redo (⌘Y)" : "Redo (Ctrl+Y)",
|
|
48
47
|
disabled: !canRedo,
|
|
49
|
-
contents:
|
|
48
|
+
contents: iconComponentFor("redo"),
|
|
50
49
|
active: false,
|
|
51
50
|
onChange: () => activeEditor == null ? void 0 : activeEditor.dispatchCommand(REDO_COMMAND, void 0)
|
|
52
51
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IconKey } from '../core/Icon';
|
|
1
2
|
import type { Options } from 'mdast-util-to-markdown';
|
|
2
3
|
import type { Config } from 'mdast-util-from-markdown/lib';
|
|
3
4
|
import type { Extension } from 'micromark-util-types';
|
|
@@ -66,6 +67,7 @@ export declare const toolbarSystem: SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
66
67
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
67
68
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
68
69
|
onBlur: RealmNode<FocusEvent>;
|
|
70
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
69
71
|
}>], (r: Realm) => {
|
|
70
72
|
toolbarContents: RealmNode<() => React.ReactNode>;
|
|
71
73
|
}>;
|
|
@@ -126,6 +128,7 @@ toolbarPlugin: PluginConstructor<SystemSpec<[SystemSpec<[], (r: Realm) => {
|
|
|
126
128
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
127
129
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
128
130
|
onBlur: RealmNode<FocusEvent>;
|
|
131
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
129
132
|
}>], (r: Realm) => {
|
|
130
133
|
toolbarContents: RealmNode<() => React.ReactNode>;
|
|
131
134
|
}>, {
|
|
@@ -190,8 +193,9 @@ toolbarPluginHooks: {
|
|
|
190
193
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
191
194
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
192
195
|
onBlur: RealmNode<FocusEvent>;
|
|
196
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
193
197
|
}>;
|
|
194
|
-
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" | "toolbarContents">(key: K, callback: (value: ValueForKey<{
|
|
198
|
+
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" | "toolbarContents">(key: K, callback: (value: ValueForKey<{
|
|
195
199
|
toolbarContents: RealmNode<() => React.ReactNode>;
|
|
196
200
|
} & {
|
|
197
201
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
@@ -248,6 +252,7 @@ toolbarPluginHooks: {
|
|
|
248
252
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
249
253
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
250
254
|
onBlur: RealmNode<FocusEvent>;
|
|
255
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
251
256
|
}, K>) => void) => void;
|
|
252
257
|
useEmitterValues: <K_1 extends SystemKeys<{
|
|
253
258
|
toolbarContents: RealmNode<() => React.ReactNode>;
|
|
@@ -306,6 +311,7 @@ toolbarPluginHooks: {
|
|
|
306
311
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
307
312
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
308
313
|
onBlur: RealmNode<FocusEvent>;
|
|
314
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
309
315
|
}>>(...keys: K_1) => ValuesForKeys<{
|
|
310
316
|
toolbarContents: RealmNode<() => React.ReactNode>;
|
|
311
317
|
} & {
|
|
@@ -363,6 +369,7 @@ toolbarPluginHooks: {
|
|
|
363
369
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
364
370
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
365
371
|
onBlur: RealmNode<FocusEvent>;
|
|
372
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
366
373
|
}, K_1>;
|
|
367
374
|
usePubKeys: () => (values: SystemDict<{
|
|
368
375
|
toolbarContents: RealmNode<() => React.ReactNode>;
|
|
@@ -421,8 +428,9 @@ toolbarPluginHooks: {
|
|
|
421
428
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
422
429
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
423
430
|
onBlur: RealmNode<FocusEvent>;
|
|
431
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
424
432
|
}>) => void;
|
|
425
|
-
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" | "toolbarContents">(key: K_2) => (value: ValueForKey<{
|
|
433
|
+
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" | "toolbarContents">(key: K_2) => (value: ValueForKey<{
|
|
426
434
|
toolbarContents: RealmNode<() => React.ReactNode>;
|
|
427
435
|
} & {
|
|
428
436
|
activeEditor: RealmNode<LexicalEditor | null>;
|
|
@@ -479,5 +487,6 @@ toolbarPluginHooks: {
|
|
|
479
487
|
convertSelectionToNode: RealmNode<() => ElementNode>;
|
|
480
488
|
insertDecoratorNode: RealmNode<() => DecoratorNode<unknown>>;
|
|
481
489
|
onBlur: RealmNode<FocusEvent>;
|
|
490
|
+
iconComponentFor: RealmNode<(name: IconKey) => React.ReactNode>;
|
|
482
491
|
}, K_2>) => void;
|
|
483
492
|
};
|
|
@@ -3,9 +3,6 @@ import * as RadixToolbar from "@radix-ui/react-toolbar";
|
|
|
3
3
|
import React__default from "react";
|
|
4
4
|
import classNames from "classnames";
|
|
5
5
|
import { useCombobox } from "downshift";
|
|
6
|
-
import DropDownIcon from "../../../icons/arrow_drop_down.svg.js";
|
|
7
|
-
import CheckIcon from "../../../icons/check.svg.js";
|
|
8
|
-
import CloseIcon from "../../../icons/close.svg.js";
|
|
9
6
|
import { corePluginHooks } from "../../core/index.js";
|
|
10
7
|
import styles from "../../../styles/ui.module.css.js";
|
|
11
8
|
import { TooltipWrap } from "./TooltipWrap.js";
|
|
@@ -34,6 +31,7 @@ const DialogButton = React__default.forwardRef(
|
|
|
34
31
|
);
|
|
35
32
|
const DialogForm = ({ autocompleteSuggestions, onSubmitCallback, dialogInputPlaceholder, submitButtonTitle }) => {
|
|
36
33
|
const [items, setItems] = React__default.useState(autocompleteSuggestions.slice(0, MAX_SUGGESTIONS));
|
|
34
|
+
const [iconComponentFor] = corePluginHooks.useEmitterValues("iconComponentFor");
|
|
37
35
|
const enableAutoComplete = autocompleteSuggestions.length > 0;
|
|
38
36
|
const { isOpen, getToggleButtonProps, getMenuProps, getInputProps, highlightedIndex, getItemProps, selectedItem } = useCombobox({
|
|
39
37
|
initialInputValue: "",
|
|
@@ -91,7 +89,7 @@ const DialogForm = ({ autocompleteSuggestions, onSubmitCallback, dialogInputPlac
|
|
|
91
89
|
size: 30,
|
|
92
90
|
"data-editor-dialog": true
|
|
93
91
|
}
|
|
94
|
-
), enableAutoComplete && /* @__PURE__ */ React__default.createElement("button", { "aria-label": "toggle menu", type: "button", ...getToggleButtonProps() },
|
|
92
|
+
), enableAutoComplete && /* @__PURE__ */ React__default.createElement("button", { "aria-label": "toggle menu", type: "button", ...getToggleButtonProps() }, iconComponentFor("arrow_drop_down"))), /* @__PURE__ */ React__default.createElement("div", { className: styles.downshiftAutocompleteContainer }, /* @__PURE__ */ React__default.createElement("ul", { ...getMenuProps(), "data-visible": dropdownIsVisible }, items.map((item, index) => /* @__PURE__ */ React__default.createElement(
|
|
95
93
|
"li",
|
|
96
94
|
{
|
|
97
95
|
"data-selected": selectedItem === item,
|
|
@@ -108,8 +106,8 @@ const DialogForm = ({ autocompleteSuggestions, onSubmitCallback, dialogInputPlac
|
|
|
108
106
|
"aria-label": submitButtonTitle,
|
|
109
107
|
className: classNames(styles.actionButton, styles.primaryActionButton)
|
|
110
108
|
},
|
|
111
|
-
|
|
112
|
-
), /* @__PURE__ */ React__default.createElement(Dialog.Close, { className: styles.actionButton },
|
|
109
|
+
iconComponentFor("check")
|
|
110
|
+
), /* @__PURE__ */ React__default.createElement(Dialog.Close, { className: styles.actionButton }, iconComponentFor("close")));
|
|
113
111
|
};
|
|
114
112
|
export {
|
|
115
113
|
DialogButton
|
|
@@ -5,7 +5,7 @@ import styles from "../../../styles/ui.module.css.js";
|
|
|
5
5
|
import { corePluginHooks } from "../../core/index.js";
|
|
6
6
|
const TooltipWrap = React__default.forwardRef(({ title, children }, ref) => {
|
|
7
7
|
const [editorRootElementRef] = corePluginHooks.useEmitterValues("editorRootElementRef");
|
|
8
|
-
return /* @__PURE__ */ React__default.createElement(Tooltip.Provider, { delayDuration: 100 }, /* @__PURE__ */ React__default.createElement(Tooltip.Root, null, /* @__PURE__ */ React__default.createElement(Tooltip.Trigger, { ref, asChild: true }, /* @__PURE__ */ React__default.createElement("span",
|
|
8
|
+
return /* @__PURE__ */ React__default.createElement(Tooltip.Provider, { delayDuration: 100 }, /* @__PURE__ */ React__default.createElement(Tooltip.Root, null, /* @__PURE__ */ React__default.createElement(Tooltip.Trigger, { ref, asChild: true }, /* @__PURE__ */ React__default.createElement("span", { className: styles.tooltipTrigger }, children)), /* @__PURE__ */ React__default.createElement(Tooltip.Portal, { container: editorRootElementRef == null ? void 0 : editorRootElementRef.current }, /* @__PURE__ */ React__default.createElement(Tooltip.Content, { className: classNames(styles.tooltipContent), sideOffset: 10 }, title))));
|
|
9
9
|
});
|
|
10
10
|
export {
|
|
11
11
|
TooltipWrap
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React__default from "react";
|
|
2
2
|
import * as RadixSelect from "@radix-ui/react-select";
|
|
3
|
-
import DropDownIcon from "../../../icons/arrow_drop_down.svg.js";
|
|
4
3
|
import classNames from "classnames";
|
|
5
4
|
import styles from "../../../styles/ui.module.css.js";
|
|
6
5
|
import { TooltipWrap } from "./TooltipWrap.js";
|
|
@@ -11,7 +10,7 @@ const SelectItem = React__default.forwardRef(
|
|
|
11
10
|
}
|
|
12
11
|
);
|
|
13
12
|
const SelectTrigger = ({ title, placeholder, className }) => {
|
|
14
|
-
const [readOnly] = corePluginHooks.useEmitterValues("readOnly");
|
|
13
|
+
const [readOnly, iconComponentFor] = corePluginHooks.useEmitterValues("readOnly", "iconComponentFor");
|
|
15
14
|
return /* @__PURE__ */ React__default.createElement(TooltipWrap, { title }, /* @__PURE__ */ React__default.createElement(
|
|
16
15
|
RadixSelect.Trigger,
|
|
17
16
|
{
|
|
@@ -21,7 +20,7 @@ const SelectTrigger = ({ title, placeholder, className }) => {
|
|
|
21
20
|
disabled: readOnly
|
|
22
21
|
},
|
|
23
22
|
/* @__PURE__ */ React__default.createElement(RadixSelect.Value, { placeholder }),
|
|
24
|
-
/* @__PURE__ */ React__default.createElement(RadixSelect.Icon, { className: styles.selectDropdownArrow },
|
|
23
|
+
/* @__PURE__ */ React__default.createElement(RadixSelect.Icon, { className: styles.selectDropdownArrow }, iconComponentFor("arrow_drop_down"))
|
|
25
24
|
));
|
|
26
25
|
};
|
|
27
26
|
const SelectContent = ({
|
|
@@ -36,8 +35,8 @@ const SelectButtonTrigger = ({
|
|
|
36
35
|
title,
|
|
37
36
|
className
|
|
38
37
|
}) => {
|
|
39
|
-
const [readOnly] = corePluginHooks.useEmitterValues("readOnly");
|
|
40
|
-
return /* @__PURE__ */ React__default.createElement(TooltipWrap, { title }, /* @__PURE__ */ React__default.createElement(RadixSelect.Trigger, { className: classNames(styles.toolbarButtonSelectTrigger, className), disabled: readOnly }, children, /* @__PURE__ */ React__default.createElement(RadixSelect.Icon, { className: styles.selectDropdownArrow },
|
|
38
|
+
const [readOnly, iconComponentFor] = corePluginHooks.useEmitterValues("readOnly", "iconComponentFor");
|
|
39
|
+
return /* @__PURE__ */ React__default.createElement(TooltipWrap, { title }, /* @__PURE__ */ React__default.createElement(RadixSelect.Trigger, { className: classNames(styles.toolbarButtonSelectTrigger, className), disabled: readOnly }, children, /* @__PURE__ */ React__default.createElement(RadixSelect.Icon, { className: styles.selectDropdownArrow }, iconComponentFor("arrow_drop_down"))));
|
|
41
40
|
};
|
|
42
41
|
const Select = (props) => {
|
|
43
42
|
return /* @__PURE__ */ React__default.createElement(RadixSelect.Root, { value: props.value || void 0, onValueChange: props.onChange }, /* @__PURE__ */ React__default.createElement(SelectTrigger, { title: props.triggerTitle, placeholder: props.placeholder }), /* @__PURE__ */ React__default.createElement(SelectContent, null, props.items.map((item, index) => {
|