@zero-library/common 2.3.6 → 2.3.7

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.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
2
  import Icon, { MinusCircleOutlined, PlusCircleOutlined, RedoOutlined, FileUnknownOutlined, FileZipOutlined, FileMarkdownOutlined, FileGifOutlined, FileImageOutlined, FileJpgOutlined, NotificationOutlined, VideoCameraOutlined, FilePptOutlined, FileExcelOutlined, FileWordOutlined, FilePdfOutlined, FileTextOutlined, MessageOutlined, BookOutlined, AudioMutedOutlined, AudioOutlined, EditOutlined, DeleteOutlined, CloseOutlined } from '@ant-design/icons';
3
- import { Spin, Input, Typography, message, Flex, Button, Alert, Skeleton, Result, Splitter, Empty, Image, Drawer, Avatar, notification, Modal, Form, Card as Card$1, List, Space, Popconfirm } from 'antd';
3
+ import { Spin, Input, Typography, Tooltip as Tooltip$1, Button, message, Flex, Alert, Skeleton, Result, Splitter, Empty, Image, Drawer, Avatar, notification, Modal, Form, Card as Card$1, List, Space, Popconfirm } from 'antd';
4
4
  import classNames2 from 'classnames';
5
5
  import { renderAsync } from 'docx-preview';
6
6
  import * as React from 'react';
@@ -2054,7 +2054,7 @@ var PdfImagePreview_default = ({ fileUrl, pageNo, scale = 1, isHasThumbnails = t
2054
2054
  return index;
2055
2055
  }
2056
2056
  }
2057
- return 0;
2057
+ return getCurrentIndex() ?? 0;
2058
2058
  };
2059
2059
  useEffect(() => {
2060
2060
  const index = getIndex(pageNo);
@@ -8108,7 +8108,7 @@ function useSelect(editor, disabled = false, hideWhenUnavailable = false) {
8108
8108
  };
8109
8109
  }
8110
8110
  var SelectButton = React__default.forwardRef(
8111
- ({ editor: providedEditor, text, className = "", disabled = false, hideWhenUnavailable = false, onClick, children, icon, ...buttonProps }, ref) => {
8111
+ ({ editor: providedEditor, disabled = false, hideWhenUnavailable = false, onClick, children, icon, tooltip, ...buttonProps }, ref) => {
8112
8112
  const { editor } = useTiptapEditor(providedEditor);
8113
8113
  const { isDisabled, shouldShow, getText, getMarkdown } = useSelect(editor, disabled, hideWhenUnavailable);
8114
8114
  const handleClick = React__default.useCallback(
@@ -8121,23 +8121,7 @@ var SelectButton = React__default.forwardRef(
8121
8121
  [onClick, editor, isDisabled, getText, getMarkdown]
8122
8122
  );
8123
8123
  if (!shouldShow || !editor || !editor.isEditable) return null;
8124
- return /* @__PURE__ */ jsx(
8125
- Button4,
8126
- {
8127
- type: "button",
8128
- className: className.trim(),
8129
- disabled: isDisabled,
8130
- "data-style": "ghost",
8131
- "data-disabled": isDisabled,
8132
- onClick: handleClick,
8133
- ...buttonProps,
8134
- ref,
8135
- children: children || /* @__PURE__ */ jsxs(Fragment, { children: [
8136
- icon,
8137
- text && /* @__PURE__ */ jsx("span", { className: "tiptap-button-text", children: text })
8138
- ] })
8139
- }
8140
- );
8124
+ return /* @__PURE__ */ jsx(Tooltip$1, { placement: "bottom", title: tooltip, arrow: false, children: /* @__PURE__ */ jsx(Button, { color: "orange", variant: "text", size: "small", icon, onClick: handleClick, disabled: isDisabled, ...buttonProps, ref, children }) });
8141
8125
  }
8142
8126
  );
8143
8127
  SelectButton.displayName = "SelectButton";
@@ -8344,14 +8328,14 @@ var SearchAndReplace = Extension.create({
8344
8328
  }
8345
8329
  });
8346
8330
  var searchAndReplace_default = SearchAndReplace;
8347
- var QuoteIcon = React.memo(({ className, ...props }) => {
8348
- return /* @__PURE__ */ jsx("svg", { width: "24", height: "24", className, viewBox: "0 0 1024 1024", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ...props, children: /* @__PURE__ */ jsx(
8331
+ var QuoteIcon = React.memo(({ ...props }) => {
8332
+ return /* @__PURE__ */ jsx("span", { className: "anticon", children: /* @__PURE__ */ jsx("svg", { width: "1em", height: "1em", viewBox: "0 0 1024 1024", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ...props, children: /* @__PURE__ */ jsx(
8349
8333
  "path",
8350
8334
  {
8351
8335
  d: "M130.16 789.92V500.25q-1.85-62.51 18-117.41T204 286.23a308 308 0 0 1 86.13-69.1A304.32 304.32 0 0 1 386.26 184 11 11 0 0 1 399 194.86v104.52a11 11 0 0 1-7.21 10.29q-66.13 24.5-91.25 70.31-24.41 44.36-26.32 107a11 11 0 0 0 11 11.3h102.84a11 11 0 0 1 11 11V779a11 11 0 0 1-11 11h-257.9z m403.3 0V500.25q-2-62.51 17.95-117.41t55.85-96.61q35.94-41.6 86.13-69.1A304.7 304.7 0 0 1 789.56 184a11 11 0 0 1 12.76 10.82v104.56a11 11 0 0 1-7.21 10.29Q729 334.18 703.86 380q-24.41 44.36-26.32 107a11 11 0 0 0 11 11.3h102.82a11 11 0 0 1 11 11V779a11 11 0 0 1-11 11H533.45z m0 0",
8352
8336
  fill: "currentColor"
8353
8337
  }
8354
- ) });
8338
+ ) }) });
8355
8339
  });
8356
8340
  QuoteIcon.displayName = "QuoteIcon";
8357
8341
  var MainToolbarContent = ({
@@ -8372,7 +8356,7 @@ var MainToolbarContent = ({
8372
8356
  ] }),
8373
8357
  /* @__PURE__ */ jsx(ToolbarSeparator, {})
8374
8358
  ] }),
8375
- onQuote && /* @__PURE__ */ jsx(ToolbarGroup, { children: /* @__PURE__ */ jsx(SelectButton, { icon: /* @__PURE__ */ jsx(QuoteIcon, { className: "tiptap-button-icon" }), tooltip: "\u5F15\u7528\u9009\u4E2D\u6587\u672C", onClick: onQuote }) }),
8359
+ onQuote && /* @__PURE__ */ jsx(ToolbarGroup, { children: /* @__PURE__ */ jsx(SelectButton, { icon: /* @__PURE__ */ jsx(QuoteIcon, {}), tooltip: "\u5F15\u7528\u9009\u4E2D\u6587\u672C", onClick: onQuote }) }),
8376
8360
  onCreateAnnotation && /* @__PURE__ */ jsx(ToolbarGroup, { children: /* @__PURE__ */ jsx(SelectButton, { icon: /* @__PURE__ */ jsx(MessageOutlined, {}), tooltip: "\u6279\u6CE8", onClick: onCreateAnnotation }) }),
8377
8361
  onCreateCollection && /* @__PURE__ */ jsx(ToolbarGroup, { children: /* @__PURE__ */ jsx(SelectButton, { icon: /* @__PURE__ */ jsx(BookOutlined, {}), tooltip: "\u6458\u5F55\u7B14\u8BB0", onClick: onCreateCollection }) }),
8378
8362
  /* @__PURE__ */ jsxs(ToolbarGroup, { children: [