@jc-times/business-ui 0.3.0 → 0.3.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.
Files changed (57) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/THIRD_PARTY_NOTICES.md +5 -0
  3. package/assets/pdf-fonts/NotoSans-Bold.ttf +0 -0
  4. package/assets/pdf-fonts/NotoSans-BoldItalic.ttf +0 -0
  5. package/assets/pdf-fonts/NotoSans-Italic.ttf +0 -0
  6. package/assets/pdf-fonts/NotoSans-Regular.ttf +0 -0
  7. package/assets/pdf-fonts/NotoSansHans-Regular.otf +0 -0
  8. package/assets/pdf-fonts/OFL-CJK.txt +92 -0
  9. package/assets/pdf-fonts/OFL-Latin.txt +94 -0
  10. package/assets/pdf-fonts/README.md +11 -0
  11. package/dist/Alert.js +5 -1
  12. package/dist/Button.js +1 -1
  13. package/dist/Cascader.js +19 -19
  14. package/dist/Combobox.js +38 -38
  15. package/dist/DataTableIcons.js +25 -25
  16. package/dist/DateInput.js +67 -67
  17. package/dist/DropdownMenu.js +35 -35
  18. package/dist/EmptyState.js +8 -8
  19. package/dist/ExplainableButton.js +11 -11
  20. package/dist/FloatingControls.js +31 -31
  21. package/dist/ModalShell.js +32 -32
  22. package/dist/MultiSelect.js +37 -37
  23. package/dist/Pagination.js +27 -27
  24. package/dist/RecoverableAsyncState.js +8 -8
  25. package/dist/Select.js +17 -17
  26. package/dist/SortableList.js +18 -18
  27. package/dist/Toast.js +30 -30
  28. package/dist/TreeSelect.js +107 -107
  29. package/dist/data-table.js +71 -71
  30. package/dist/document-viewer/PdfToolbar.js +12 -12
  31. package/dist/document-viewer/PdfWorkspace.js +15 -15
  32. package/dist/document-viewer-v2/DocumentViewerV2.js +49 -48
  33. package/dist/document-viewer-v2/HeadlessPdfViewer.js +128 -124
  34. package/dist/document-viewer-v2/pdf-font-fallback.js +35 -0
  35. package/dist/types/document-viewer-v2/pdf-font-fallback.d.ts +2 -0
  36. package/dist/vendor/embedpdf-zoom-react.js +3 -186
  37. package/dist/vendor/embedpdf-zoom-react10.js +6 -0
  38. package/dist/vendor/embedpdf-zoom-react11.js +30 -0
  39. package/dist/vendor/embedpdf-zoom-react12.js +16 -0
  40. package/dist/vendor/embedpdf-zoom-react13.js +15 -0
  41. package/dist/vendor/embedpdf-zoom-react14.js +33 -0
  42. package/dist/vendor/embedpdf-zoom-react15.js +20 -0
  43. package/dist/vendor/embedpdf-zoom-react16.js +26 -0
  44. package/dist/vendor/embedpdf-zoom-react17.js +25 -0
  45. package/dist/vendor/embedpdf-zoom-react18.js +17 -0
  46. package/dist/vendor/embedpdf-zoom-react19.js +187 -0
  47. package/dist/vendor/embedpdf-zoom-react2.js +13 -0
  48. package/dist/vendor/embedpdf-zoom-react3.js +14 -0
  49. package/dist/vendor/embedpdf-zoom-react4.js +8 -0
  50. package/dist/vendor/embedpdf-zoom-react5.js +4 -0
  51. package/dist/vendor/embedpdf-zoom-react6.js +14 -0
  52. package/dist/vendor/embedpdf-zoom-react7.js +40 -0
  53. package/dist/vendor/embedpdf-zoom-react8.js +17 -0
  54. package/dist/vendor/embedpdf-zoom-react9.js +7 -0
  55. package/docs/agent-guide.md +2 -0
  56. package/docs/document-viewer-v2.md +2 -2
  57. package/package.json +7 -3
@@ -2,42 +2,43 @@ import { Button as e } from "../Button.js";
2
2
  import { PdfWorkspace as t } from "../document-viewer/PdfWorkspace.js";
3
3
  import { PdfToolbar as n } from "../document-viewer/PdfToolbar.js";
4
4
  import { usePdfViewport as r } from "../document-viewer/usePdfViewport.js";
5
- import { ZoomGestureWrapper as i, react_exports as a, useZoom as o } from "../vendor/embedpdf-zoom-react.js";
6
- import { HeadlessSearch as s } from "./HeadlessSearch.js";
7
- import { Search as ee, X as te } from "lucide-react";
8
- import { useEffect as c, useLayoutEffect as ne, useMemo as re, useRef as l, useState as u } from "react";
5
+ import { pdfFontFallback as i } from "./pdf-font-fallback.js";
6
+ import { ZoomGestureWrapper as a, react_exports as o, useZoom as s } from "../vendor/embedpdf-zoom-react19.js";
7
+ import { HeadlessSearch as ee } from "./HeadlessSearch.js";
8
+ import { useEffect as c, useLayoutEffect as te, useMemo as ne, useRef as l, useState as u } from "react";
9
9
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
10
+ import { Search as re, X as ie } from "lucide-react";
10
11
  import { createPluginRegistration as p } from "@embedpdf/core";
11
- import { EmbedPDF as m, useDocumentState as ie } from "@embedpdf/core/react";
12
+ import { EmbedPDF as m, useDocumentState as ae } from "@embedpdf/core/react";
12
13
  import { usePdfiumEngine as h } from "@embedpdf/engines/react";
13
14
  import { DocumentManagerPluginPackage as g } from "@embedpdf/plugin-document-manager/react";
14
- import { Viewport as ae, ViewportPluginPackage as _, useViewportCapability as oe } from "@embedpdf/plugin-viewport/react";
15
- import { ScrollPluginPackage as v, Scroller as se, useScrollCapability as ce } from "@embedpdf/plugin-scroll/react";
16
- import { RenderLayer as le, RenderPluginPackage as y } from "@embedpdf/plugin-render/react";
17
- import { Rotate as ue, RotatePluginPackage as b, useRotate as de } from "@embedpdf/plugin-rotate/react";
18
- import { ThumbImg as fe, ThumbnailPluginPackage as x, ThumbnailsPane as pe } from "@embedpdf/plugin-thumbnail/react";
19
- import { SearchLayer as me, SearchPluginPackage as S, useSearch as he } from "@embedpdf/plugin-search/react";
20
- import { SelectionLayer as ge, SelectionPluginPackage as _e, useSelectionCapability as ve } from "@embedpdf/plugin-selection/react";
21
- import { InteractionManagerPluginPackage as C, PagePointerProvider as ye } from "@embedpdf/plugin-interaction-manager/react";
15
+ import { Viewport as oe, ViewportPluginPackage as _, useViewportCapability as se } from "@embedpdf/plugin-viewport/react";
16
+ import { ScrollPluginPackage as v, Scroller as ce, useScrollCapability as le } from "@embedpdf/plugin-scroll/react";
17
+ import { RenderLayer as ue, RenderPluginPackage as y } from "@embedpdf/plugin-render/react";
18
+ import { Rotate as de, RotatePluginPackage as b, useRotate as fe } from "@embedpdf/plugin-rotate/react";
19
+ import { ThumbImg as pe, ThumbnailPluginPackage as x, ThumbnailsPane as me } from "@embedpdf/plugin-thumbnail/react";
20
+ import { SearchLayer as he, SearchPluginPackage as S, useSearch as ge } from "@embedpdf/plugin-search/react";
21
+ import { SelectionLayer as _e, SelectionPluginPackage as C, useSelectionCapability as ve } from "@embedpdf/plugin-selection/react";
22
+ import { InteractionManagerPluginPackage as w, PagePointerProvider as ye } from "@embedpdf/plugin-interaction-manager/react";
22
23
  //#region src/document-viewer-v2/HeadlessPdfViewer.tsx
23
- var w = "(max-width: 900px), (hover: none) and (pointer: coarse)";
24
+ var T = "(max-width: 900px), (hover: none) and (pointer: coarse)";
24
25
  function be(e) {
25
- let [t, n] = u(() => e && typeof window < "u" && window.matchMedia(w).matches);
26
+ let [t, n] = u(() => e && typeof window < "u" && window.matchMedia(T).matches);
26
27
  return c(() => {
27
28
  if (!e) {
28
29
  n(!1);
29
30
  return;
30
31
  }
31
- let t = window.matchMedia(w), r = () => n(t.matches);
32
+ let t = window.matchMedia(T), r = () => n(t.matches);
32
33
  return r(), t.addEventListener("change", r), () => t.removeEventListener("change", r);
33
34
  }, [e]), t;
34
35
  }
35
- function T(e) {
36
+ function E(e) {
36
37
  let { engine: t, isLoading: n, error: r } = h({
37
38
  worker: !0,
38
- fontFallback: null,
39
+ fontFallback: i,
39
40
  ...e.engineOptions
40
- }), [i] = u(() => {
41
+ }), [a] = u(() => {
41
42
  let { id: t, kind: n, ...r } = e.source;
42
43
  return [
43
44
  p(g, { initialDocuments: [{
@@ -47,16 +48,19 @@ function T(e) {
47
48
  }] }),
48
49
  p(_),
49
50
  p(v, { defaultPageGap: 20 }),
50
- p(y, { withAnnotations: !0 }),
51
- p(a.ZoomPluginPackage, {
51
+ p(y, {
52
+ withAnnotations: !0,
53
+ withForms: !0
54
+ }),
55
+ p(o.ZoomPluginPackage, {
52
56
  defaultZoomLevel: 1,
53
57
  minZoom: e.initialZoom === "fit-width" ? .1 : .5,
54
58
  maxZoom: 3
55
59
  }),
56
60
  p(b),
57
- p(C, { exclusionRules: { dataAttributes: ["data-pdf-business-control"] } }),
61
+ p(w, { exclusionRules: { dataAttributes: ["data-pdf-business-control"] } }),
58
62
  p(S),
59
- p(_e, { marquee: { enabled: !1 } }),
63
+ p(C, { marquee: { enabled: !1 } }),
60
64
  p(x, { width: 100 })
61
65
  ];
62
66
  });
@@ -68,44 +72,44 @@ function T(e) {
68
72
  children: "正在加载 PDF 引擎…"
69
73
  }) : /* @__PURE__ */ d(m, {
70
74
  engine: t,
71
- plugins: i,
75
+ plugins: a,
72
76
  onInitialized: async (t) => {
73
77
  e.onReady?.(t);
74
78
  },
75
- children: /* @__PURE__ */ d(E, { ...e })
79
+ children: /* @__PURE__ */ d(D, { ...e })
76
80
  });
77
81
  }
78
- function E(p) {
79
- let m = p.source.id, h = ie(m), g = h?.document, { provides: _ } = ce(), v = re(() => _?.forDocument(m), [_, m]), { provides: y, state: b } = o(m), { provides: x } = oe(), { provides: S } = ve(), { provides: _e } = he(m), { provides: C, rotation: w } = de(m), T = r(m), [E, D] = u(1), [O, k] = u(null), A = be(p.mobileMode === "continuous-reader"), j = p.searchMode === "collapsible", M = p.features?.search !== !1, [N, P] = u(!j), F = g?.pages.length ?? 0, I = Math.max(1, Math.min(F || 1, p.currentPage ?? E)), L = p.pageMode === "single" && !A, R = p.features?.textSelection !== !1 && !A, z = l(p);
80
- z.current = p, c(() => {
82
+ function D(i) {
83
+ let p = i.source.id, m = ae(p), h = m?.document, { provides: g } = le(), _ = ne(() => g?.forDocument(p), [g, p]), { provides: v, state: y } = s(p), { provides: b } = se(), { provides: x } = ve(), { provides: S } = ge(p), { provides: C, rotation: w } = fe(p), T = r(p), [E, D] = u(1), [O, k] = u(null), A = be(i.mobileMode === "continuous-reader"), j = i.searchMode === "collapsible", M = i.features?.search !== !1, [N, P] = u(!j), F = h?.pages.length ?? 0, I = Math.max(1, Math.min(F || 1, i.currentPage ?? E)), L = i.pageMode === "single" && !A, R = i.features?.textSelection !== !1 && !A, z = l(i);
84
+ z.current = i, c(() => {
81
85
  P(!j), k(null);
82
- }, [m, j]);
83
- let B = h?.scale ?? 1, V = l(!1), H = l(p.currentPage ?? 1), U = l(!0), W = l(I), G = l(L), K = l(null);
84
- ne(() => {
86
+ }, [p, j]);
87
+ let B = m?.scale ?? 1, V = l(!1), H = l(i.currentPage ?? 1), U = l(!0), W = l(I), G = l(L), K = l(null);
88
+ te(() => {
85
89
  (W.current !== I || G.current !== L) && ((G.current !== L || I !== K.current) && (H.current = I), G.current !== L && (U.current = !0), W.current = I, G.current = L, K.current = null);
86
90
  }, [I, L]);
87
- let q = l(y);
88
- q.current = y, c(() => {
89
- if (!x || !F) return;
91
+ let q = l(v);
92
+ q.current = v, c(() => {
93
+ if (!b || !F) return;
90
94
  let e = () => {
91
- let e = x.forDocument(m).getMetrics();
92
- !V.current && e.clientWidth && e.clientHeight && q.current && (V.current = !0, q.current.requestZoom(z.current.zoom ?? (z.current.initialZoom === "fit-width" ? a.ZoomMode.FitWidth : z.current.initialZoom ?? 1)));
93
- }, t = x.onViewportResize((t) => {
94
- t.documentId === m && e();
95
+ let e = b.forDocument(p).getMetrics();
96
+ !V.current && e.clientWidth && e.clientHeight && q.current && (V.current = !0, q.current.requestZoom(z.current.zoom ?? (z.current.initialZoom === "fit-width" ? o.ZoomMode.FitWidth : z.current.initialZoom ?? 1)));
97
+ }, t = b.onViewportResize((t) => {
98
+ t.documentId === p && e();
95
99
  });
96
100
  return e(), t;
97
101
  }, [
98
- x,
99
- m,
102
+ b,
103
+ p,
100
104
  F
101
105
  ]), c(() => {
102
- if (v && !L) return v.onPageChange((e) => {
106
+ if (_ && !L) return _.onPageChange((e) => {
103
107
  V.current && !U.current && (z.current.currentPage === void 0 && D(e.pageNumber), e.pageNumber !== z.current.currentPage && (K.current = e.pageNumber, z.current.onCurrentPageChange?.(e.pageNumber)));
104
108
  });
105
- }, [v, L]), c(() => {
106
- if (!v || L || !F) return;
109
+ }, [_, L]), c(() => {
110
+ if (!_ || L || !F) return;
107
111
  let e = () => {
108
- H.current !== null && (U.current = !0, v.scrollToPage({
112
+ H.current !== null && (U.current = !0, _.scrollToPage({
109
113
  pageNumber: H.current,
110
114
  behavior: "instant",
111
115
  ...O?.page === H.current ? {
@@ -114,19 +118,19 @@ function E(p) {
114
118
  alignY: 40
115
119
  } : {}
116
120
  }));
117
- }, t = _?.onLayoutReady((t) => {
118
- t.documentId === m && e();
119
- }), n = x?.onViewportResize((t) => {
120
- t.documentId === m && e();
121
+ }, t = g?.onLayoutReady((t) => {
122
+ t.documentId === p && e();
123
+ }), n = b?.onViewportResize((t) => {
124
+ t.documentId === p && e();
121
125
  }), r = requestAnimationFrame(e);
122
126
  return () => {
123
127
  cancelAnimationFrame(r), t?.(), n?.();
124
128
  };
125
129
  }, [
126
- v,
127
130
  _,
128
- x,
129
- m,
131
+ g,
132
+ b,
133
+ p,
130
134
  L,
131
135
  F,
132
136
  I,
@@ -134,9 +138,9 @@ function E(p) {
134
138
  w,
135
139
  O
136
140
  ]), c(() => {
137
- if (!L || !O || !x) return;
138
- let e = () => xe(T.containerRef.current, O, x.forDocument(m)), t = x.onViewportResize((t) => {
139
- t.documentId === m && e();
141
+ if (!L || !O || !b) return;
142
+ let e = () => xe(T.containerRef.current, O, b.forDocument(p)), t = b.onViewportResize((t) => {
143
+ t.documentId === p && e();
140
144
  }), n = requestAnimationFrame(e);
141
145
  return () => {
142
146
  cancelAnimationFrame(n), t();
@@ -144,23 +148,23 @@ function E(p) {
144
148
  }, [
145
149
  L,
146
150
  O,
147
- x,
148
- m,
151
+ b,
152
+ p,
149
153
  I,
150
154
  B,
151
155
  w
152
156
  ]);
153
- let J = l(p.zoom ?? null), Y = l(p.rotation ?? null), X = l(B), Se = l(w);
157
+ let J = l(i.zoom ?? null), Y = l(i.rotation ?? null), X = l(B), Se = l(w);
154
158
  c(() => {
155
- p.zoom !== void 0 && y && F && Math.abs(p.zoom - B) > .001 && (J.current = p.zoom, y.requestZoom(p.zoom));
159
+ i.zoom !== void 0 && v && F && Math.abs(i.zoom - B) > .001 && (J.current = i.zoom, v.requestZoom(i.zoom));
156
160
  }, [
157
- p.zoom,
158
- !!y,
161
+ i.zoom,
162
+ !!v,
159
163
  F
160
164
  ]), c(() => {
161
- p.rotation !== void 0 && C && F && p.rotation !== w * 90 && (Y.current = p.rotation, C.setRotation((p.rotation / 90 % 4 + 4) % 4));
165
+ i.rotation !== void 0 && C && F && i.rotation !== w * 90 && (Y.current = i.rotation, C.setRotation((i.rotation / 90 % 4 + 4) % 4));
162
166
  }, [
163
- p.rotation,
167
+ i.rotation,
164
168
  !!C,
165
169
  F
166
170
  ]), c(() => {
@@ -176,8 +180,8 @@ function E(p) {
176
180
  }
177
181
  Se.current !== w && z.current.onRotationChange?.(w * 90), Se.current = w;
178
182
  }, [w]), c(() => {
179
- let e = p.focusTarget, t = e && g?.pages[e.page - 1];
180
- e && t && v && !L && (U.current = !0, v.scrollToPage({
183
+ let e = i.focusTarget, t = e && h?.pages[e.page - 1];
184
+ e && t && _ && !L && (U.current = !0, _.scrollToPage({
181
185
  pageNumber: e.page,
182
186
  pageCoordinates: {
183
187
  x: t.size.width / 2,
@@ -187,8 +191,8 @@ function E(p) {
187
191
  behavior: "instant"
188
192
  }));
189
193
  }, [
190
- p.focusTarget?.token,
191
- v,
194
+ i.focusTarget?.token,
195
+ _,
192
196
  F,
193
197
  L
194
198
  ]);
@@ -197,54 +201,54 @@ function E(p) {
197
201
  }, Q = (e) => {
198
202
  K.current = null;
199
203
  let t = Math.max(1, Math.min(F, e));
200
- p.currentPage === void 0 && D(t), p.onCurrentPageChange?.(t);
204
+ i.currentPage === void 0 && D(t), i.onCurrentPageChange?.(t);
201
205
  }, Ce = (e) => {
202
- let t = g?.pages[e];
206
+ let t = h?.pages[e];
203
207
  if (!t) return null;
204
- let n = (t.rotation + w) % 4, { width: r, height: i } = t.size, a = {
205
- documentId: m,
208
+ let n = (t.rotation + w) % 4, { width: r, height: a } = t.size, o = {
209
+ documentId: p,
206
210
  page: e + 1,
207
211
  pageIndex: e,
208
212
  width: r,
209
- height: i,
213
+ height: a,
210
214
  zoom: B,
211
215
  rotation: n * 90
212
- }, o = n % 2 == 1;
216
+ }, s = n % 2 == 1;
213
217
  return /* @__PURE__ */ d("div", {
214
218
  className: "ui-v2-native-page",
215
219
  "data-page": e + 1,
216
220
  style: {
217
221
  position: "relative",
218
- width: (o ? i : r) * B,
219
- height: (o ? r : i) * B
222
+ width: (s ? a : r) * B,
223
+ height: (s ? r : a) * B
220
224
  },
221
225
  children: /* @__PURE__ */ d(ye, {
222
- documentId: m,
226
+ documentId: p,
223
227
  pageIndex: e,
224
228
  rotation: n,
225
229
  scale: B,
226
- children: /* @__PURE__ */ f(ue, {
227
- documentId: m,
230
+ children: /* @__PURE__ */ f(de, {
231
+ documentId: p,
228
232
  pageIndex: e,
229
233
  rotation: n,
230
234
  style: {
231
235
  width: r * B,
232
- height: i * B
236
+ height: a * B
233
237
  },
234
238
  children: [
235
- p.renderPage ? p.renderPage({
239
+ i.renderPage ? i.renderPage({
236
240
  page: e + 1,
237
241
  zoom: B,
238
242
  rotation: n * 90
239
- }) : /* @__PURE__ */ d(le, {
243
+ }) : /* @__PURE__ */ d(ue, {
240
244
  draggable: !1,
241
- documentId: m,
245
+ documentId: p,
242
246
  pageIndex: e,
243
247
  "aria-label": `第 ${e + 1} 页`
244
248
  }),
245
- M && N && /* @__PURE__ */ d(me, {
249
+ M && N && /* @__PURE__ */ d(he, {
246
250
  "data-ui-search-layer": !0,
247
- documentId: m,
251
+ documentId: p,
248
252
  pageIndex: e,
249
253
  scale: B
250
254
  }),
@@ -259,24 +263,24 @@ function E(p) {
259
263
  pointerEvents: "none"
260
264
  }
261
265
  }),
262
- R && /* @__PURE__ */ d(ge, {
263
- documentId: m,
266
+ R && /* @__PURE__ */ d(_e, {
267
+ documentId: p,
264
268
  pageIndex: e,
265
269
  scale: B,
266
270
  rotation: 0
267
271
  }),
268
- p.renderPageOverlay && /* @__PURE__ */ d("div", {
272
+ i.renderPageOverlay && /* @__PURE__ */ d("div", {
269
273
  className: "ui-v2-page-overlay",
270
274
  style: {
271
275
  position: "absolute",
272
276
  inset: 0,
273
277
  width: r,
274
- height: i,
278
+ height: a,
275
279
  transform: `scale(${B})`,
276
280
  transformOrigin: "0 0",
277
281
  pointerEvents: "none"
278
282
  },
279
- children: p.renderPageOverlay(a)
283
+ children: i.renderPageOverlay(o)
280
284
  })
281
285
  ]
282
286
  })
@@ -288,61 +292,61 @@ function E(p) {
288
292
  "aria-expanded": N,
289
293
  "aria-label": N ? "收起文档搜索" : "搜索文档",
290
294
  onClick: () => {
291
- N && (_e?.stopSearch(), k(null)), P(!N);
295
+ N && (S?.stopSearch(), k(null)), P(!N);
292
296
  },
293
- children: [d(N ? te : ee, { size: 15 }), /* @__PURE__ */ d("span", {
297
+ children: [d(N ? ie : re, { size: 15 }), /* @__PURE__ */ d("span", {
294
298
  className: "ui-mobile-reader-search-label",
295
299
  children: N ? "收起搜索" : "搜索文档"
296
300
  })]
297
301
  });
298
302
  return /* @__PURE__ */ f("section", {
299
303
  ref: T.containerRef,
300
- style: p.style,
304
+ style: i.style,
301
305
  onKeyDown: (e) => {
302
306
  if (!R || !(e.ctrlKey || e.metaKey) || e.key.toLowerCase() !== "c" || e.target.closest("input, textarea, [contenteditable=\"true\"]")) return;
303
- let t = S?.forDocument(m);
307
+ let t = x?.forDocument(p);
304
308
  t?.getState().selection && (e.preventDefault(), t.copyToClipboard());
305
309
  },
306
- "aria-label": p.ariaLabel ?? "PDF 文档查看器",
310
+ "aria-label": i.ariaLabel ?? "PDF 文档查看器",
307
311
  className: [
308
312
  "ui-document-viewer",
309
313
  "ui-document-viewer-v2-headless",
310
- p.layoutMode === "fill" && "ui-viewer-fill",
314
+ i.layoutMode === "fill" && "ui-viewer-fill",
311
315
  A && "ui-mobile-continuous-reader",
312
316
  T.fullscreen && "ui-viewer-fullscreen",
313
- p.className
317
+ i.className
314
318
  ].filter(Boolean).join(" "),
315
319
  children: [
316
- p.showToolbar !== !1 && /* @__PURE__ */ f("div", {
320
+ i.showToolbar !== !1 && /* @__PURE__ */ f("div", {
317
321
  className: "ui-viewer-toolbar",
318
322
  children: [
319
- p.title !== void 0 && /* @__PURE__ */ d("div", {
323
+ i.title !== void 0 && /* @__PURE__ */ d("div", {
320
324
  className: "ui-viewer-title",
321
- children: p.title
325
+ children: i.title
322
326
  }),
323
- p.toolbar,
327
+ i.toolbar,
324
328
  $,
325
329
  /* @__PURE__ */ d(n, {
326
- zoom: b.currentZoomLevel,
330
+ zoom: y.currentZoomLevel,
327
331
  disabled: !F,
328
332
  fullscreen: T.fullscreen,
329
333
  canZoomIn: B < 3,
330
- canZoomOut: B > (p.initialZoom === "fit-width" ? .1 : .5),
331
- onZoomIn: () => y?.zoomIn(),
332
- onZoomOut: () => y?.zoomOut(),
334
+ canZoomOut: B > (i.initialZoom === "fit-width" ? .1 : .5),
335
+ onZoomIn: () => v?.zoomIn(),
336
+ onZoomOut: () => v?.zoomOut(),
333
337
  onRotate: () => C?.rotateForward(),
334
338
  onToggleFullscreen: T.toggleFullscreen
335
339
  })
336
340
  ]
337
341
  }),
338
- p.showToolbar === !1 && $ && /* @__PURE__ */ d("div", {
342
+ i.showToolbar === !1 && $ && /* @__PURE__ */ d("div", {
339
343
  className: "ui-v2-search-disclosure",
340
344
  children: $
341
345
  }),
342
- M && N && /* @__PURE__ */ d(s, {
346
+ M && N && /* @__PURE__ */ d(ee, {
343
347
  onClear: () => k(null),
344
348
  enabled: !!F,
345
- documentId: m,
349
+ documentId: p,
346
350
  onPageChange: (e, t) => {
347
351
  H.current = e, k(t ? {
348
352
  page: e,
@@ -350,13 +354,13 @@ function E(p) {
350
354
  } : null), Q(e);
351
355
  }
352
356
  }),
353
- h?.status === "error" ? /* @__PURE__ */ f("div", {
357
+ m?.status === "error" ? /* @__PURE__ */ f("div", {
354
358
  role: "alert",
355
- children: ["PDF 加载失败:", h.error]
356
- }) : g ? /* @__PURE__ */ d(t, {
357
- defaultRailCollapsed: p.defaultRailCollapsed,
358
- rail: /* @__PURE__ */ d(pe, {
359
- documentId: m,
359
+ children: ["PDF 加载失败:", m.error]
360
+ }) : h ? /* @__PURE__ */ d(t, {
361
+ defaultRailCollapsed: i.defaultRailCollapsed,
362
+ rail: /* @__PURE__ */ d(me, {
363
+ documentId: p,
360
364
  children: (t) => /* @__PURE__ */ f(e, {
361
365
  variant: "ghost",
362
366
  className: "ui-v2-thumbnail",
@@ -370,8 +374,8 @@ function E(p) {
370
374
  height: t.wrapperHeight,
371
375
  display: "grid"
372
376
  },
373
- children: [/* @__PURE__ */ d(fe, {
374
- documentId: m,
377
+ children: [/* @__PURE__ */ d(pe, {
378
+ documentId: p,
375
379
  meta: t,
376
380
  className: "ui-v2-thumbnail-image",
377
381
  style: {
@@ -381,8 +385,8 @@ function E(p) {
381
385
  }), /* @__PURE__ */ d("span", { children: t.pageIndex + 1 })]
382
386
  }, t.pageIndex)
383
387
  }),
384
- children: /* @__PURE__ */ d(ae, {
385
- documentId: m,
388
+ children: /* @__PURE__ */ d(oe, {
389
+ documentId: p,
386
390
  className: "ui-v2-native-viewport",
387
391
  tabIndex: 0,
388
392
  "aria-label": "PDF 页面滚动区域",
@@ -395,16 +399,16 @@ function E(p) {
395
399
  onTouchMoveCapture: Z,
396
400
  onPointerDownCapture: Z,
397
401
  onKeyDownCapture: Z,
398
- children: /* @__PURE__ */ d(i, {
399
- documentId: m,
400
- enablePinch: p.features?.pinchZoom !== !1,
401
- minZoom: p.initialZoom === "fit-width" ? .1 : .5,
402
+ children: /* @__PURE__ */ d(a, {
403
+ documentId: p,
404
+ enablePinch: i.features?.pinchZoom !== !1,
405
+ minZoom: i.initialZoom === "fit-width" ? .1 : .5,
402
406
  maxZoom: 3,
403
407
  children: L ? /* @__PURE__ */ d("div", {
404
408
  className: "ui-v2-native-single",
405
409
  children: Ce(I - 1)
406
- }) : /* @__PURE__ */ d(se, {
407
- documentId: m,
410
+ }) : /* @__PURE__ */ d(ce, {
411
+ documentId: p,
408
412
  renderPage: ({ pageIndex: e }) => Ce(e)
409
413
  })
410
414
  })
@@ -438,7 +442,7 @@ function E(p) {
438
442
  onClick: () => Q(I + 1),
439
443
  children: "下一页"
440
444
  }),
441
- p.footer
445
+ i.footer
442
446
  ]
443
447
  })
444
448
  ]
@@ -456,4 +460,4 @@ function xe(e, t, n) {
456
460
  });
457
461
  }
458
462
  //#endregion
459
- export { T as default };
463
+ export { E as default };
@@ -0,0 +1,35 @@
1
+ import e from "@jc-times/business-ui/pdf-fonts/NotoSansHans-Regular.otf?url";
2
+ import t from "@jc-times/business-ui/pdf-fonts/NotoSans-Regular.ttf?url";
3
+ import n from "@jc-times/business-ui/pdf-fonts/NotoSans-Bold.ttf?url";
4
+ import r from "@jc-times/business-ui/pdf-fonts/NotoSans-Italic.ttf?url";
5
+ import i from "@jc-times/business-ui/pdf-fonts/NotoSans-BoldItalic.ttf?url";
6
+ //#region src/document-viewer-v2/pdf-font-fallback.ts
7
+ var a = (e) => typeof window > "u" ? e : new URL(e, window.location.href).href, o = {
8
+ fonts: {
9
+ 0: [
10
+ {
11
+ url: a(t),
12
+ weight: 400
13
+ },
14
+ {
15
+ url: a(n),
16
+ weight: 700
17
+ },
18
+ {
19
+ url: a(r),
20
+ weight: 400,
21
+ italic: !0
22
+ },
23
+ {
24
+ url: a(i),
25
+ weight: 700,
26
+ italic: !0
27
+ }
28
+ ],
29
+ 1: a(e),
30
+ 134: a(e)
31
+ },
32
+ defaultFont: a(e)
33
+ };
34
+ //#endregion
35
+ export { o as pdfFontFallback };
@@ -0,0 +1,2 @@
1
+ import type { FontFallbackConfig } from '@embedpdf/engines/pdfium';
2
+ export declare const pdfFontFallback: FontFallbackConfig;