@zero-library/common 2.3.10 → 2.3.12

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
@@ -2089,72 +2089,88 @@ var PdfImagePreview_default = ({ fileUrl, pageNo, scale = 1, isHasThumbnails = t
2089
2089
  }
2090
2090
  }, [zoom, virtualizer]);
2091
2091
  return error ? /* @__PURE__ */ jsx(Result, { status: "error", title: error }) : /* @__PURE__ */ jsxs(Splitter, { className: classNames2(styles_module_default.nsPreviewPdfImage), children: [
2092
- isHasThumbnails && /* @__PURE__ */ jsx(Splitter.Panel, { resizable: false, min: 400, max: 400, collapsible: true, children: /* @__PURE__ */ jsx("div", { ref: thumbsParentRef, className: classNames2(styles_module_default.pdfImageNav, "height-full", "scroll-fade-in"), children: thumbsVirtualizer.getVirtualItems().map((item) => {
2093
- return /* @__PURE__ */ jsxs(
2094
- Flex,
2095
- {
2096
- vertical: true,
2097
- align: "center",
2098
- className: classNames2(styles_module_default.pdfImageNavItem),
2099
- style: {
2100
- top: item.start,
2101
- height: `${THUMB_IMG_HEIGHT}px`
2102
- },
2103
- onClick: () => {
2104
- virtualizer.scrollToIndex(item.index);
2105
- },
2106
- children: [
2107
- /* @__PURE__ */ jsx(
2108
- "div",
2109
- {
2110
- className: classNames2(styles_module_default.pdfImageNavItemImgWrapper, "flex-1", {
2111
- [styles_module_default.pdfImageNavItemActive]: item.index === currentIndex
2112
- }),
2113
- children: /* @__PURE__ */ jsx("img", { className: styles_module_default.pdfImageNavItemImg, src: images[item.index].thumbnail || images[item.index].imageUrl })
2114
- }
2115
- ),
2116
- /* @__PURE__ */ jsx("div", { className: styles_module_default.pdfImageNavItemTip, children: item.index + 1 })
2117
- ]
2092
+ isHasThumbnails && /* @__PURE__ */ jsx(Splitter.Panel, { resizable: false, min: 400, max: 400, collapsible: true, children: /* @__PURE__ */ jsx("div", { ref: thumbsParentRef, className: classNames2(styles_module_default.pdfImageNav, "height-full", "scroll-fade-in"), children: /* @__PURE__ */ jsx(
2093
+ "div",
2094
+ {
2095
+ style: {
2096
+ height: `${thumbsVirtualizer.getTotalSize()}px`
2118
2097
  },
2119
- item.index
2120
- );
2121
- }) }) }),
2098
+ children: thumbsVirtualizer.getVirtualItems().map((item) => {
2099
+ return /* @__PURE__ */ jsxs(
2100
+ Flex,
2101
+ {
2102
+ vertical: true,
2103
+ align: "center",
2104
+ className: classNames2(styles_module_default.pdfImageNavItem),
2105
+ style: {
2106
+ top: item.start,
2107
+ height: `${THUMB_IMG_HEIGHT}px`
2108
+ },
2109
+ onClick: () => {
2110
+ virtualizer.scrollToIndex(item.index);
2111
+ },
2112
+ children: [
2113
+ /* @__PURE__ */ jsx(
2114
+ "div",
2115
+ {
2116
+ className: classNames2(styles_module_default.pdfImageNavItemImgWrapper, "flex-1", {
2117
+ [styles_module_default.pdfImageNavItemActive]: item.index === currentIndex
2118
+ }),
2119
+ children: /* @__PURE__ */ jsx("img", { className: styles_module_default.pdfImageNavItemImg, src: images[item.index].thumbnail || images[item.index].imageUrl })
2120
+ }
2121
+ ),
2122
+ /* @__PURE__ */ jsx("div", { className: styles_module_default.pdfImageNavItemTip, children: item.index + 1 })
2123
+ ]
2124
+ },
2125
+ item.index
2126
+ );
2127
+ })
2128
+ }
2129
+ ) }) }),
2122
2130
  /* @__PURE__ */ jsx(Splitter.Panel, { children: /* @__PURE__ */ jsxs("div", { className: classNames2("height-full", styles_module_default.pdfImageBody), children: [
2123
2131
  /* @__PURE__ */ jsxs(Flex, { gap: 6, align: "center", className: styles_module_default.pdfImageBodyToolbar, children: [
2124
2132
  /* @__PURE__ */ jsx(Button, { onClick: zoomOut, icon: /* @__PURE__ */ jsx(MinusCircleOutlined, {}), title: "\u7F29\u5C0F" }),
2125
2133
  /* @__PURE__ */ jsx(Button, { onClick: zoomIn, icon: /* @__PURE__ */ jsx(PlusCircleOutlined, {}), title: "\u653E\u5927" }),
2126
2134
  /* @__PURE__ */ jsx(Button, { onClick: zoomFitWidth, icon: /* @__PURE__ */ jsx(ColumnWidthOutlined, {}), title: "\u9002\u5E94\u5BBD\u5EA6" })
2127
2135
  ] }),
2128
- /* @__PURE__ */ jsx("div", { ref: containerRef, className: "height-full scroll-fade-in", children: virtualizer.getVirtualItems().map((item) => {
2129
- return /* @__PURE__ */ jsx(
2130
- "div",
2131
- {
2132
- className: styles_module_default.pdfImageBodyItem,
2133
- style: {
2134
- top: item.start
2135
- },
2136
- children: /* @__PURE__ */ jsx(
2136
+ /* @__PURE__ */ jsx("div", { ref: containerRef, className: "height-full scroll-fade-in", children: /* @__PURE__ */ jsx(
2137
+ "div",
2138
+ {
2139
+ style: {
2140
+ height: `${virtualizer.getTotalSize()}px`
2141
+ },
2142
+ children: virtualizer.getVirtualItems().map((item) => {
2143
+ return /* @__PURE__ */ jsx(
2137
2144
  "div",
2138
2145
  {
2139
- className: classNames2(styles_module_default.pdfImageBodyItemInnerWrapper, "p-8"),
2146
+ className: styles_module_default.pdfImageBodyItem,
2140
2147
  style: {
2141
- width: `${MAIN_IMG_WIDTH * zoom}px`,
2142
- height: `${MAIN_IMG_HEIGHT * zoom}px`
2148
+ top: item.start
2143
2149
  },
2144
- children: /* @__PURE__ */ jsx("div", { className: classNames2(styles_module_default.pdfImageBodyItemInner, { [styles_module_default.pdfImageBodyItemActive]: item.index === currentIndex }), children: /* @__PURE__ */ jsx(
2145
- "img",
2150
+ children: /* @__PURE__ */ jsx(
2151
+ "div",
2146
2152
  {
2147
- className: classNames2(styles_module_default.pdfImageBodyItemImg),
2148
- src: images[item.index].imageUrl,
2149
- loading: item.index === currentIndex ? "eager" : "lazy"
2153
+ className: classNames2(styles_module_default.pdfImageBodyItemInnerWrapper, "p-8"),
2154
+ style: {
2155
+ width: `${MAIN_IMG_WIDTH * zoom}px`,
2156
+ height: `${MAIN_IMG_HEIGHT * zoom}px`
2157
+ },
2158
+ children: /* @__PURE__ */ jsx("div", { className: classNames2(styles_module_default.pdfImageBodyItemInner, { [styles_module_default.pdfImageBodyItemActive]: item.index === currentIndex }), children: /* @__PURE__ */ jsx(
2159
+ "img",
2160
+ {
2161
+ className: classNames2(styles_module_default.pdfImageBodyItemImg),
2162
+ src: images[item.index].imageUrl,
2163
+ loading: item.index === currentIndex ? "eager" : "lazy"
2164
+ }
2165
+ ) })
2150
2166
  }
2151
- ) })
2152
- }
2153
- )
2154
- },
2155
- `${item.index}-${images[item.index].pageNum}`
2156
- );
2157
- }) })
2167
+ )
2168
+ },
2169
+ `${item.index}-${images[item.index].pageNum}`
2170
+ );
2171
+ })
2172
+ }
2173
+ ) })
2158
2174
  ] }) })
2159
2175
  ] });
2160
2176
  };
@@ -2454,8 +2470,9 @@ var PAGE_NO_KEY = "PageNo";
2454
2470
  var pageNoMark_default = Node.create({
2455
2471
  name: PAGE_NO_KEY,
2456
2472
  // 节点名称
2457
- group: "block",
2458
- // 可以作为块级元素
2473
+ group: "inline",
2474
+ inline: true,
2475
+ atom: true,
2459
2476
  // content: 'block+', // 能嵌套多个块级内容(如 heading, paragraph 等)
2460
2477
  // defining: true, // 使其在文档结构中稳定,避免被合并
2461
2478
  // 自定义渲染HTML