@elia-ori/editor 0.1.19 → 0.1.21

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 CHANGED
@@ -2029,7 +2029,7 @@ var DropdownMenuSubContent = (0, import_react27.forwardRef)(({ className, portal
2029
2029
  return portal ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DropdownMenuPortal, { ...typeof portal === "object" ? portal : {}, children: content }) : content;
2030
2030
  });
2031
2031
  DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
2032
- var DropdownMenuContent = (0, import_react27.forwardRef)(({ className, sideOffset = 4, portal = false, ...props }, ref) => {
2032
+ var DropdownMenuContent = (0, import_react27.forwardRef)(({ className, sideOffset = 4, portal = true, ...props }, ref) => {
2033
2033
  const content = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2034
2034
  DropdownMenuPrimitive.Content,
2035
2035
  {
@@ -2118,7 +2118,7 @@ var HeadingDropdownMenu = (0, import_react29.forwardRef)(
2118
2118
  editor: providedEditor,
2119
2119
  levels = [1, 2, 3, 4, 5, 6],
2120
2120
  hideWhenUnavailable = false,
2121
- portal = false,
2121
+ portal = true,
2122
2122
  onOpenChange,
2123
2123
  ...buttonProps
2124
2124
  }, ref) => {
@@ -3016,7 +3016,7 @@ function ListDropdownMenu({
3016
3016
  types = ["bulletList", "orderedList", "taskList"],
3017
3017
  hideWhenUnavailable = false,
3018
3018
  onOpenChange,
3019
- portal = false,
3019
+ portal = true,
3020
3020
  ...props
3021
3021
  }) {
3022
3022
  const { editor } = useTiptapEditor(providedEditor);
@@ -5545,7 +5545,7 @@ var CALLOUT_OPTIONS = [
5545
5545
  { type: "error", label: "\u932F\u8AA4\u63D0\u793A", className: "callout-option--error" },
5546
5546
  { type: "info", label: "\u8CC7\u8A0A\u63D0\u793A", className: "callout-option--info" }
5547
5547
  ];
5548
- function CalloutButton({ portal = false }) {
5548
+ function CalloutButton({ portal = true }) {
5549
5549
  const { editor } = useTiptapEditor();
5550
5550
  const [isOpen, setIsOpen] = React.useState(false);
5551
5551
  const [isVisible, setIsVisible] = React.useState(true);
@@ -5614,7 +5614,7 @@ var React2 = __toESM(require("react"), 1);
5614
5614
  var import_jsx_runtime60 = require("react/jsx-runtime");
5615
5615
  var GRID_SIZE = 6;
5616
5616
  var TOTAL_CELLS = GRID_SIZE * GRID_SIZE;
5617
- function TableButton({ portal = false }) {
5617
+ function TableButton({ portal = true }) {
5618
5618
  const { editor } = useTiptapEditor();
5619
5619
  const [isOpen, setIsOpen] = React2.useState(false);
5620
5620
  const [isVisible, setIsVisible] = React2.useState(true);
@@ -5754,7 +5754,7 @@ var TEXT_COLORS = [
5754
5754
  { color: "var(--tt-color-text-pink)", label: "\u7C89\u7D05", className: "text-color--pink" },
5755
5755
  { color: "var(--tt-color-text-red)", label: "\u7D05\u8272", className: "text-color--red" }
5756
5756
  ];
5757
- function TextColorButton({ portal = false }) {
5757
+ function TextColorButton({ portal = true }) {
5758
5758
  const { editor } = useTiptapEditor();
5759
5759
  const [isOpen, setIsOpen] = React3.useState(false);
5760
5760
  const [isVisible, setIsVisible] = React3.useState(true);
@@ -6124,18 +6124,17 @@ var MainToolbarContent = ({
6124
6124
  ] }),
6125
6125
  has("undo-redo") && (has("heading") || has("list") || has("blockquote") || has("code-block") || has("callout") || has("table")) && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ToolbarSeparator, {}),
6126
6126
  (has("heading") || has("list") || has("blockquote") || has("code-block") || has("callout") || has("table")) && /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(ToolbarGroup, { children: [
6127
- has("heading") && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(HeadingDropdownMenu, { levels: [1, 2, 3, 4], portal: isMobile }),
6127
+ has("heading") && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(HeadingDropdownMenu, { levels: [1, 2, 3, 4] }),
6128
6128
  has("list") && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
6129
6129
  ListDropdownMenu,
6130
6130
  {
6131
- types: ["bulletList", "orderedList", "taskList"],
6132
- portal: isMobile
6131
+ types: ["bulletList", "orderedList", "taskList"]
6133
6132
  }
6134
6133
  ),
6135
6134
  has("blockquote") && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(BlockquoteButton, {}),
6136
6135
  has("code-block") && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(CodeBlockButton, {}),
6137
- has("callout") && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(CalloutButton, { portal: isMobile }),
6138
- has("table") && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(TableButton, { portal: isMobile })
6136
+ has("callout") && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(CalloutButton, {}),
6137
+ has("table") && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(TableButton, {})
6139
6138
  ] }),
6140
6139
  (has("heading") || has("list") || has("blockquote") || has("code-block") || has("callout") || has("table")) && (has("format") || has("text-color") || has("highlight") || has("link")) && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ToolbarSeparator, {}),
6141
6140
  (has("format") || has("text-color") || has("highlight") || has("link")) && /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(ToolbarGroup, { children: [
@@ -6146,7 +6145,7 @@ var MainToolbarContent = ({
6146
6145
  /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(MarkButton, { type: "code" }),
6147
6146
  /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(MarkButton, { type: "underline" })
6148
6147
  ] }),
6149
- has("text-color") && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(TextColorButton, { portal: isMobile }),
6148
+ has("text-color") && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(TextColorButton, {}),
6150
6149
  has("highlight") && (!isMobile ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ColorHighlightPopover, {}) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ColorHighlightPopoverButton, { onClick: onHighlighterClick })),
6151
6150
  has("link") && (!isMobile ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(LinkPopover, {}) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(LinkButton, { onClick: onLinkClick }))
6152
6151
  ] }),