@zero-library/common 2.3.5 → 2.3.6

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.js CHANGED
@@ -3330,7 +3330,7 @@ var isSelectionValid = (editor, selection, excludedNodeTypes = ["imageUpload", "
3330
3330
  const { state } = editor;
3331
3331
  const { doc } = state;
3332
3332
  const { empty, from, to } = selection;
3333
- const isEmptyTextBlock = !doc.textBetween(from, to).length && react$1.isTextSelection(selection);
3333
+ const isEmptyTextBlock = !doc.textBetween(from, to).length && !react$1.isTextSelection(selection);
3334
3334
  const isCodeBlock = selection.$from.parent.type.spec.code || react$1.isNodeSelection(selection) && selection.node.type.spec.code;
3335
3335
  const isExcludedNode = react$1.isNodeSelection(selection) && excludedNodeTypes.includes(selection.node.type.name);
3336
3336
  const isTableCell = selection instanceof tables.CellSelection;
@@ -7501,7 +7501,7 @@ var createHtmlMark = (markName, ATTRS, classNames7) => {
7501
7501
  return core.Mark.create({
7502
7502
  name: markName,
7503
7503
  priority: 1e3,
7504
- // 高优先级确保收录不会被其他marks覆盖
7504
+ // 高优先级确保摘录不会被其他marks覆盖
7505
7505
  excludes: "",
7506
7506
  // 允许相同类型 mark 叠加
7507
7507
  inclusive: false,
@@ -7957,7 +7957,7 @@ var collectionSidebar_default = ({
7957
7957
  /* @__PURE__ */ jsxRuntime.jsxs(antd.Space, { children: [
7958
7958
  /* @__PURE__ */ jsxRuntime.jsx(Icon.BookOutlined, {}),
7959
7959
  /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
7960
- "\u6536\u5F55",
7960
+ "\u6458\u5F55",
7961
7961
  collections.length > 0 && `\uFF08${collections.length}\uFF09`
7962
7962
  ] })
7963
7963
  ] }),
@@ -8003,9 +8003,9 @@ var collectionSidebar_default = ({
8003
8003
  title: "\u63D0\u793A",
8004
8004
  okText: "\u786E\u5B9A",
8005
8005
  cancelText: "\u53D6\u6D88",
8006
- description: "\u786E\u8BA4\u5220\u9664\u5F53\u524D\u6536\u5F55\u5417?",
8006
+ description: "\u786E\u8BA4\u5220\u9664\u5F53\u524D\u6458\u5F55\u5417?",
8007
8007
  onConfirm: () => onDeleteCollection(collection[COLLECTION_ATTRS[0]]),
8008
- children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "text", size: "small", title: "\u5220\u9664\u6536\u5F55", icon: /* @__PURE__ */ jsxRuntime.jsx(Icon.DeleteOutlined, {}) })
8008
+ children: /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { type: "text", size: "small", title: "\u5220\u9664\u6458\u5F55", icon: /* @__PURE__ */ jsxRuntime.jsx(Icon.DeleteOutlined, {}) })
8009
8009
  }
8010
8010
  ) })
8011
8011
  ] })
@@ -8014,7 +8014,7 @@ var collectionSidebar_default = ({
8014
8014
  );
8015
8015
  }
8016
8016
  }
8017
- ) : /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { className: "m-t-24", description: "\u6682\u65E0\u6536\u5F55" })
8017
+ ) : /* @__PURE__ */ jsxRuntime.jsx(antd.Empty, { className: "m-t-24", description: "\u6682\u65E0\u6458\u5F55" })
8018
8018
  }
8019
8019
  );
8020
8020
  const container = collectionConfig?.getContainer?.();
@@ -8417,7 +8417,7 @@ var MainToolbarContent = ({
8417
8417
  ] }),
8418
8418
  onQuote && /* @__PURE__ */ jsxRuntime.jsx(ToolbarGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectButton, { icon: /* @__PURE__ */ jsxRuntime.jsx(QuoteIcon, { className: "tiptap-button-icon" }), tooltip: "\u5F15\u7528\u9009\u4E2D\u6587\u672C", onClick: onQuote }) }),
8419
8419
  onCreateAnnotation && /* @__PURE__ */ jsxRuntime.jsx(ToolbarGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectButton, { icon: /* @__PURE__ */ jsxRuntime.jsx(Icon.MessageOutlined, {}), tooltip: "\u6279\u6CE8", onClick: onCreateAnnotation }) }),
8420
- onCreateCollection && /* @__PURE__ */ jsxRuntime.jsx(ToolbarGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectButton, { icon: /* @__PURE__ */ jsxRuntime.jsx(Icon.BookOutlined, {}), tooltip: "\u6536\u5F55\u7B14\u8BB0", onClick: onCreateCollection }) }),
8420
+ onCreateCollection && /* @__PURE__ */ jsxRuntime.jsx(ToolbarGroup, { children: /* @__PURE__ */ jsxRuntime.jsx(SelectButton, { icon: /* @__PURE__ */ jsxRuntime.jsx(Icon.BookOutlined, {}), tooltip: "\u6458\u5F55\u7B14\u8BB0", onClick: onCreateCollection }) }),
8421
8421
  /* @__PURE__ */ jsxRuntime.jsxs(ToolbarGroup, { children: [
8422
8422
  /* @__PURE__ */ jsxRuntime.jsx(HeadingDropdownMenu, { levels: [1, 2, 3, 4], portal: isMobile }),
8423
8423
  /* @__PURE__ */ jsxRuntime.jsx(ListDropdownMenu, { types: ["bulletList", "orderedList", "taskList"], portal: isMobile }),
@@ -8585,7 +8585,7 @@ var MarkdownEditor_default = ({
8585
8585
  }
8586
8586
  })
8587
8587
  ] : [],
8588
- // 收录功能扩展
8588
+ // 摘录功能扩展
8589
8589
  ...collectionConfig?.enabled ? [
8590
8590
  CollectionMark,
8591
8591
  CollectionPlugin.configure({
@@ -8607,6 +8607,7 @@ var MarkdownEditor_default = ({
8607
8607
  });
8608
8608
  const getMarkdown = () => {
8609
8609
  if (!editor) return "";
8610
+ if (editor.isEmpty) return "";
8610
8611
  return editor.getMarkdown();
8611
8612
  };
8612
8613
  React.useEffect(() => {
@@ -8669,28 +8670,30 @@ var MarkdownEditor_default = ({
8669
8670
  NsToolBar({ isBubble: false }),
8670
8671
  /* @__PURE__ */ jsxRuntime.jsxs(antd.Flex, { gap: 8, align: "center", className: classNames2__default.default(styles_module_default4.extraToolbar), children: [
8671
8672
  annotationConfig?.enabled && annotationConfig?.showList !== false && /* @__PURE__ */ jsxRuntime.jsx(
8672
- antd.Tag,
8673
+ antd.Button,
8673
8674
  {
8675
+ size: "small",
8674
8676
  title: "\u6279\u6CE8\u5217\u8868",
8675
- bordered: false,
8676
- color: "default",
8677
- className: "cursor-pointer",
8678
- onClick: () => setShowAnnotation(!showAnnotation),
8679
- children: /* @__PURE__ */ jsxRuntime.jsx(Icon.MessageOutlined, {})
8677
+ icon: /* @__PURE__ */ jsxRuntime.jsx(Icon.MessageOutlined, {}),
8678
+ color: "primary",
8679
+ variant: "text",
8680
+ onClick: () => setShowAnnotation(!showAnnotation)
8680
8681
  }
8681
8682
  ),
8682
8683
  collectionConfig?.enabled && collectionConfig?.showList !== false && /* @__PURE__ */ jsxRuntime.jsx(
8683
- antd.Tag,
8684
+ antd.Button,
8684
8685
  {
8685
- title: "\u6536\u5F55\u5217\u8868",
8686
- bordered: false,
8687
- color: "default",
8688
- className: "cursor-pointer",
8686
+ style: { gap: "2px" },
8687
+ size: "small",
8688
+ title: "\u6458\u5F55\u5217\u8868",
8689
+ icon: /* @__PURE__ */ jsxRuntime.jsx(Icon.BookOutlined, {}),
8690
+ color: "primary",
8691
+ variant: "text",
8689
8692
  onClick: () => setShowCollection(!showCollection),
8690
- children: /* @__PURE__ */ jsxRuntime.jsx(Icon.BookOutlined, {})
8693
+ children: "\u6458\u5F55"
8691
8694
  }
8692
8695
  ),
8693
- onDownloadFile && /* @__PURE__ */ jsxRuntime.jsx(antd.Tag, { bordered: false, color: "default", className: "cursor-pointer", onClick: downloadFile2, children: "\u4E0B\u8F7D" }),
8696
+ onDownloadFile && /* @__PURE__ */ jsxRuntime.jsx(antd.Button, { size: "small", color: "primary", variant: "text", onClick: downloadFile2, children: "\u4E0B\u8F7D" }),
8694
8697
  extraNav
8695
8698
  ] })
8696
8699
  ] }),