@mdxeditor/editor 0.4.0 → 0.4.2
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/index.cjs +1 -1
- package/dist/index.js +60 -61
- package/dist/style.css +132 -130
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2932,59 +2932,59 @@ const SvgArrowDropDown$1 = (props) => /* @__PURE__ */ React.createElement("svg",
|
|
|
2932
2932
|
maskType: "alpha"
|
|
2933
2933
|
} }, /* @__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" })));
|
|
2934
2934
|
const DropDownIcon = SvgArrowDropDown$1;
|
|
2935
|
-
const editorRoot = "
|
|
2936
|
-
const editorWrapper = "
|
|
2937
|
-
const nestedListItem = "
|
|
2938
|
-
const toolbarRoot = "
|
|
2939
|
-
const toolbarModeSwitch = "
|
|
2940
|
-
const toolbarToggleItem = "
|
|
2941
|
-
const toolbarGroupOfGroups = "
|
|
2942
|
-
const toolbarToggleSingleGroup = "
|
|
2943
|
-
const toolbarButton = "
|
|
2944
|
-
const toolbarNodeKindSelectContainer = "
|
|
2945
|
-
const toolbarButtonDropdownContainer = "
|
|
2946
|
-
const toolbarCodeBlockLanguageSelectContent = "
|
|
2947
|
-
const toolbarNodeKindSelectTrigger = "
|
|
2948
|
-
const toolbarButtonSelectTrigger = "
|
|
2949
|
-
const toolbarCodeBlockLanguageSelectTrigger = "
|
|
2950
|
-
const toolbarNodeKindSelectItem = "
|
|
2951
|
-
const toolbarNodeKindSelectDropdownArrow = "
|
|
2952
|
-
const contentEditable = "
|
|
2953
|
-
const sandpackWrapper = "
|
|
2954
|
-
const frontmatterWrapper = "
|
|
2955
|
-
const frontmatterToggleButton = "
|
|
2956
|
-
const frontmatterEditorTable = "
|
|
2957
|
-
const iconButton = "
|
|
2958
|
-
const frontmatterInput = "
|
|
2959
|
-
const primaryButton = "
|
|
2960
|
-
const linkDialogEditForm = "
|
|
2961
|
-
const linkDialogInputContainer = "
|
|
2962
|
-
const linkDialogInputWrapper = "
|
|
2963
|
-
const linkDialogInput = "
|
|
2964
|
-
const linkDialogAutocompleteContainer = "
|
|
2965
|
-
const linkDialogAnchor = "
|
|
2966
|
-
const linkDialogPopoverContent = "
|
|
2967
|
-
const tableColumnEditorPopoverContent = "
|
|
2968
|
-
const dialogContent = "
|
|
2969
|
-
const linkDialogPreviewAnchor = "
|
|
2970
|
-
const tooltipContent = "
|
|
2971
|
-
const actionButton = "
|
|
2972
|
-
const primaryActionButton = "
|
|
2973
|
-
const tableEditor = "
|
|
2974
|
-
const toolCell = "
|
|
2975
|
-
const tableColumnEditorTrigger = "
|
|
2976
|
-
const tableRowEditorTrigger = "
|
|
2977
|
-
const addRowButton = "
|
|
2978
|
-
const addColumnButton = "
|
|
2979
|
-
const tableColumnEditorToolbar = "
|
|
2980
|
-
const toggleGroupRoot = "
|
|
2981
|
-
const tableToolsColumn = "
|
|
2982
|
-
const leftAlignedCell = "
|
|
2983
|
-
const rightAlignedCell = "
|
|
2984
|
-
const centeredCell = "
|
|
2985
|
-
const dialogOverlay = "
|
|
2986
|
-
const overlayShow = "
|
|
2987
|
-
const contentShow = "
|
|
2935
|
+
const editorRoot = "_editorRoot_gm91f_47";
|
|
2936
|
+
const editorWrapper = "_editorWrapper_gm91f_141";
|
|
2937
|
+
const nestedListItem = "_nestedListItem_gm91f_145";
|
|
2938
|
+
const toolbarRoot = "_toolbarRoot_gm91f_149";
|
|
2939
|
+
const toolbarModeSwitch = "_toolbarModeSwitch_gm91f_170";
|
|
2940
|
+
const toolbarToggleItem = "_toolbarToggleItem_gm91f_179";
|
|
2941
|
+
const toolbarGroupOfGroups = "_toolbarGroupOfGroups_gm91f_189";
|
|
2942
|
+
const toolbarToggleSingleGroup = "_toolbarToggleSingleGroup_gm91f_193";
|
|
2943
|
+
const toolbarButton = "_toolbarButton_gm91f_207";
|
|
2944
|
+
const toolbarNodeKindSelectContainer = "_toolbarNodeKindSelectContainer_gm91f_236";
|
|
2945
|
+
const toolbarButtonDropdownContainer = "_toolbarButtonDropdownContainer_gm91f_237";
|
|
2946
|
+
const toolbarCodeBlockLanguageSelectContent = "_toolbarCodeBlockLanguageSelectContent_gm91f_238";
|
|
2947
|
+
const toolbarNodeKindSelectTrigger = "_toolbarNodeKindSelectTrigger_gm91f_252";
|
|
2948
|
+
const toolbarButtonSelectTrigger = "_toolbarButtonSelectTrigger_gm91f_253";
|
|
2949
|
+
const toolbarCodeBlockLanguageSelectTrigger = "_toolbarCodeBlockLanguageSelectTrigger_gm91f_286";
|
|
2950
|
+
const toolbarNodeKindSelectItem = "_toolbarNodeKindSelectItem_gm91f_292";
|
|
2951
|
+
const toolbarNodeKindSelectDropdownArrow = "_toolbarNodeKindSelectDropdownArrow_gm91f_315";
|
|
2952
|
+
const contentEditable = "_contentEditable_gm91f_319";
|
|
2953
|
+
const sandpackWrapper = "_sandpackWrapper_gm91f_327";
|
|
2954
|
+
const frontmatterWrapper = "_frontmatterWrapper_gm91f_331";
|
|
2955
|
+
const frontmatterToggleButton = "_frontmatterToggleButton_gm91f_341";
|
|
2956
|
+
const frontmatterEditorTable = "_frontmatterEditorTable_gm91f_349";
|
|
2957
|
+
const iconButton = "_iconButton_gm91f_367";
|
|
2958
|
+
const frontmatterInput = "_frontmatterInput_gm91f_373";
|
|
2959
|
+
const primaryButton = "_primaryButton_gm91f_388";
|
|
2960
|
+
const linkDialogEditForm = "_linkDialogEditForm_gm91f_398";
|
|
2961
|
+
const linkDialogInputContainer = "_linkDialogInputContainer_gm91f_404";
|
|
2962
|
+
const linkDialogInputWrapper = "_linkDialogInputWrapper_gm91f_410";
|
|
2963
|
+
const linkDialogInput = "_linkDialogInput_gm91f_404";
|
|
2964
|
+
const linkDialogAutocompleteContainer = "_linkDialogAutocompleteContainer_gm91f_440";
|
|
2965
|
+
const linkDialogAnchor = "_linkDialogAnchor_gm91f_485";
|
|
2966
|
+
const linkDialogPopoverContent = "_linkDialogPopoverContent_gm91f_499";
|
|
2967
|
+
const tableColumnEditorPopoverContent = "_tableColumnEditorPopoverContent_gm91f_499";
|
|
2968
|
+
const dialogContent = "_dialogContent_gm91f_499";
|
|
2969
|
+
const linkDialogPreviewAnchor = "_linkDialogPreviewAnchor_gm91f_513";
|
|
2970
|
+
const tooltipContent = "_tooltipContent_gm91f_535";
|
|
2971
|
+
const actionButton = "_actionButton_gm91f_549";
|
|
2972
|
+
const primaryActionButton = "_primaryActionButton_gm91f_555";
|
|
2973
|
+
const tableEditor = "_tableEditor_gm91f_564";
|
|
2974
|
+
const toolCell = "_toolCell_gm91f_575";
|
|
2975
|
+
const tableColumnEditorTrigger = "_tableColumnEditorTrigger_gm91f_592";
|
|
2976
|
+
const tableRowEditorTrigger = "_tableRowEditorTrigger_gm91f_592";
|
|
2977
|
+
const addRowButton = "_addRowButton_gm91f_592";
|
|
2978
|
+
const addColumnButton = "_addColumnButton_gm91f_592";
|
|
2979
|
+
const tableColumnEditorToolbar = "_tableColumnEditorToolbar_gm91f_626";
|
|
2980
|
+
const toggleGroupRoot = "_toggleGroupRoot_gm91f_638";
|
|
2981
|
+
const tableToolsColumn = "_tableToolsColumn_gm91f_655";
|
|
2982
|
+
const leftAlignedCell = "_leftAlignedCell_gm91f_663";
|
|
2983
|
+
const rightAlignedCell = "_rightAlignedCell_gm91f_667";
|
|
2984
|
+
const centeredCell = "_centeredCell_gm91f_671";
|
|
2985
|
+
const dialogOverlay = "_dialogOverlay_gm91f_699";
|
|
2986
|
+
const overlayShow = "_overlayShow_gm91f_1";
|
|
2987
|
+
const contentShow = "_contentShow_gm91f_1";
|
|
2988
2988
|
const styles = {
|
|
2989
2989
|
editorRoot,
|
|
2990
2990
|
editorWrapper,
|
|
@@ -3954,7 +3954,7 @@ const SourceEditor = () => {
|
|
|
3954
3954
|
};
|
|
3955
3955
|
const InstantTooltip = React__default.forwardRef(({ title, children }, ref) => {
|
|
3956
3956
|
const [editorRootElementRef] = useEmitterValues("editorRootElementRef");
|
|
3957
|
-
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 }, 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))));
|
|
3957
|
+
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", null, 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))));
|
|
3958
3958
|
});
|
|
3959
3959
|
const SelectItem = React__default.forwardRef(
|
|
3960
3960
|
({ children, className, ...props }, forwardedRef) => {
|
|
@@ -4090,7 +4090,7 @@ const ImageButton = React__default.forwardRef((props, forwardedRef) => {
|
|
|
4090
4090
|
},
|
|
4091
4091
|
[insertImage]
|
|
4092
4092
|
);
|
|
4093
|
-
return /* @__PURE__ */ React__default.createElement(Dialog.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React__default.createElement(Dialog.Trigger, { asChild: true }, /* @__PURE__ */ React__default.createElement(
|
|
4093
|
+
return /* @__PURE__ */ React__default.createElement(Dialog.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React__default.createElement(Dialog.Trigger, { asChild: true }, /* @__PURE__ */ React__default.createElement(RadixToolbar.Button, { className: styles.toolbarButton, ...props, ref: forwardedRef }, /* @__PURE__ */ React__default.createElement(InstantTooltip, { title: "Insert image" }, /* @__PURE__ */ React__default.createElement(AddPhotoIcon, null)))), /* @__PURE__ */ React__default.createElement(Dialog.Portal, { container: editorRootElementRef.current }, /* @__PURE__ */ React__default.createElement(Dialog.Overlay, { className: styles.dialogOverlay }), /* @__PURE__ */ React__default.createElement(Dialog.Content, { className: styles.dialogContent }, /* @__PURE__ */ React__default.createElement(ImageForm, { initialUrl: "", onSubmit, imageAutocompleteSuggestions }))));
|
|
4094
4094
|
});
|
|
4095
4095
|
createCommand();
|
|
4096
4096
|
const MAX_SUGGESTIONS = 20;
|
|
@@ -4166,13 +4166,13 @@ const ActionButton = React__default.forwardRef(({ className, ...props }, ref) =>
|
|
|
4166
4166
|
return /* @__PURE__ */ React__default.createElement("button", { className: classNames(styles.actionButton, className), ref, ...props });
|
|
4167
4167
|
});
|
|
4168
4168
|
const ToggleItem = React__default.forwardRef(
|
|
4169
|
-
({ title, className: passedClassName, ...props }, forwardedRef) => {
|
|
4170
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
4169
|
+
({ title, children, className: passedClassName, ...props }, forwardedRef) => {
|
|
4170
|
+
return /* @__PURE__ */ React__default.createElement(RadixToolbar.ToggleItem, { className: classNames(passedClassName, styles.toolbarToggleItem), ...props, ref: forwardedRef }, /* @__PURE__ */ React__default.createElement(InstantTooltip, { title }, children));
|
|
4171
4171
|
}
|
|
4172
4172
|
);
|
|
4173
4173
|
const ToolbarButton = React__default.forwardRef(
|
|
4174
|
-
({ title, ...props }, forwardedRef) => {
|
|
4175
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
4174
|
+
({ title, children, ...props }, forwardedRef) => {
|
|
4175
|
+
return /* @__PURE__ */ React__default.createElement(RadixToolbar.Button, { className: styles.toolbarButton, ...props, ref: forwardedRef }, /* @__PURE__ */ React__default.createElement(InstantTooltip, { title }, children));
|
|
4176
4176
|
}
|
|
4177
4177
|
);
|
|
4178
4178
|
const ToggleSingleGroup = React__default.forwardRef(
|
|
@@ -4278,8 +4278,7 @@ const ViewModeSwitch = () => {
|
|
|
4278
4278
|
value: viewMode,
|
|
4279
4279
|
className: styles.toolbarModeSwitch
|
|
4280
4280
|
},
|
|
4281
|
-
/* @__PURE__ */ React__default.createElement(RichTextIcon, null),
|
|
4282
|
-
/* @__PURE__ */ React__default.createElement(ToggleItem, { value: "editor", "aria-label": "Rich text", title: "Rich text mode" }),
|
|
4281
|
+
/* @__PURE__ */ React__default.createElement(ToggleItem, { value: "editor", "aria-label": "Rich text", title: "Rich text mode" }, /* @__PURE__ */ React__default.createElement(RichTextIcon, null)),
|
|
4283
4282
|
/* @__PURE__ */ React__default.createElement(ToggleItem, { value: "diff", "aria-label": "View diff", title: "Diff mode" }, /* @__PURE__ */ React__default.createElement(DifferenceIcon, null)),
|
|
4284
4283
|
/* @__PURE__ */ React__default.createElement(ToggleItem, { value: "markdown", "aria-label": "View Markdown", title: "Markdown source mode" }, /* @__PURE__ */ React__default.createElement(MarkdownIcon, null))
|
|
4285
4284
|
);
|