@jc-times/business-ui 0.2.43 → 0.2.53

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 (44) hide show
  1. package/AGENTS.md +6 -6
  2. package/CHANGELOG.md +51 -14
  3. package/README.md +7 -7
  4. package/THIRD_PARTY_NOTICES.md +12 -10
  5. package/dist/Cascader.js +8 -0
  6. package/dist/Combobox.js +104 -61
  7. package/dist/DataTableHorizontalScrollbar.js +14 -11
  8. package/dist/FloatingControls.js +14 -13
  9. package/dist/MultilineAutoComplete.js +80 -0
  10. package/dist/SortableList.js +105 -32
  11. package/dist/UserProfilePopover.js +69 -0
  12. package/dist/_virtual/_rolldown/runtime.js +17 -0
  13. package/dist/business-ui.js +41 -38
  14. package/dist/document-viewer/PdfWorkspace.js +14 -12
  15. package/dist/document-viewer-v2/HeadlessPdfViewer.js +147 -142
  16. package/dist/sortable-transfer-scope.js +33 -0
  17. package/dist/styles.css +1 -1
  18. package/dist/types/Combobox.d.ts +1 -0
  19. package/dist/types/FloatingControls.d.ts +2 -1
  20. package/dist/types/MultilineAutoComplete.d.ts +20 -0
  21. package/dist/types/SortableList.d.ts +10 -2
  22. package/dist/types/UserProfilePopover.d.ts +20 -0
  23. package/dist/types/document-viewer/PdfWorkspace.d.ts +2 -1
  24. package/dist/types/document-viewer-v2/HeadlessPdfViewer.d.ts +1 -0
  25. package/dist/types/index.d.ts +2 -0
  26. package/dist/types/sortable-transfer-scope.d.ts +27 -0
  27. package/dist/vendor/embedpdf-zoom-react.js +187 -0
  28. package/docs/agent-guide.md +26 -3
  29. package/docs/api.md +39 -14
  30. package/docs/cascader.md +2 -0
  31. package/docs/component-strategy.md +1 -1
  32. package/docs/data-table.md +124 -120
  33. package/docs/dependencies.md +57 -57
  34. package/docs/document-viewer-v2.md +8 -0
  35. package/docs/document-viewer.md +28 -28
  36. package/docs/file-preparation.md +11 -11
  37. package/docs/maturity-migration.md +62 -62
  38. package/docs/mrt-poc.md +204 -204
  39. package/docs/release.md +32 -32
  40. package/docs/user-profile.md +17 -0
  41. package/docs/viewport-qa.md +37 -7
  42. package/licenses/embedpdf-MIT.txt +21 -0
  43. package/package.json +164 -161
  44. package/patches/@embedpdf__plugin-zoom@2.15.0.patch +77 -0
@@ -2,93 +2,95 @@ 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 { HeadlessSearch as i } from "./HeadlessSearch.js";
6
- import { useEffect as a, useMemo as o, useRef as s, useState as c } from "react";
7
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
8
- import { createPluginRegistration as d } from "@embedpdf/core";
9
- import { EmbedPDF as f, useDocumentState as p } from "@embedpdf/core/react";
10
- import { usePdfiumEngine as m } from "@embedpdf/engines/react";
11
- import { DocumentManagerPluginPackage as h } from "@embedpdf/plugin-document-manager/react";
12
- import { Viewport as ee, ViewportPluginPackage as g, useViewportCapability as te } from "@embedpdf/plugin-viewport/react";
13
- import { ScrollPluginPackage as _, Scroller as ne, useScrollCapability as re } from "@embedpdf/plugin-scroll/react";
14
- import { RenderLayer as v, RenderPluginPackage as y } from "@embedpdf/plugin-render/react";
15
- import { Rotate as ie, RotatePluginPackage as b, useRotate as x } from "@embedpdf/plugin-rotate/react";
16
- import { ZoomGestureWrapper as S, ZoomMode as C, ZoomPluginPackage as w, useZoom as ae } from "@embedpdf/plugin-zoom/react";
17
- import { ThumbImg as T, ThumbnailPluginPackage as E, ThumbnailsPane as oe } from "@embedpdf/plugin-thumbnail/react";
18
- import { SearchLayer as se, SearchPluginPackage as D } from "@embedpdf/plugin-search/react";
19
- import { SelectionLayer as O, SelectionPluginPackage as k, useSelectionCapability as ce } from "@embedpdf/plugin-selection/react";
20
- import { InteractionManagerPluginPackage as A, PagePointerProvider as le } from "@embedpdf/plugin-interaction-manager/react";
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 { useEffect as c, useLayoutEffect as l, useMemo as ee, useRef as u, useState as d } from "react";
8
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
9
+ import { createPluginRegistration as m } from "@embedpdf/core";
10
+ import { EmbedPDF as h, useDocumentState as g } from "@embedpdf/core/react";
11
+ import { usePdfiumEngine as _ } from "@embedpdf/engines/react";
12
+ import { DocumentManagerPluginPackage as v } from "@embedpdf/plugin-document-manager/react";
13
+ import { Viewport as te, ViewportPluginPackage as y, useViewportCapability as ne } from "@embedpdf/plugin-viewport/react";
14
+ import { ScrollPluginPackage as b, Scroller as x, useScrollCapability as re } from "@embedpdf/plugin-scroll/react";
15
+ import { RenderLayer as ie, RenderPluginPackage as S } from "@embedpdf/plugin-render/react";
16
+ import { Rotate as ae, RotatePluginPackage as C, useRotate as oe } from "@embedpdf/plugin-rotate/react";
17
+ import { ThumbImg as se, ThumbnailPluginPackage as w, ThumbnailsPane as ce } from "@embedpdf/plugin-thumbnail/react";
18
+ import { SearchLayer as le, SearchPluginPackage as T } from "@embedpdf/plugin-search/react";
19
+ import { SelectionLayer as ue, SelectionPluginPackage as E, useSelectionCapability as D } from "@embedpdf/plugin-selection/react";
20
+ import { InteractionManagerPluginPackage as O, PagePointerProvider as k } from "@embedpdf/plugin-interaction-manager/react";
21
21
  //#region src/document-viewer-v2/HeadlessPdfViewer.tsx
22
- function j(e) {
23
- let { engine: t, isLoading: n, error: r } = m({
22
+ function A(e) {
23
+ let { engine: t, isLoading: n, error: r } = _({
24
24
  worker: !0,
25
25
  fontFallback: null,
26
26
  ...e.engineOptions
27
- }), [i] = c(() => {
27
+ }), [i] = d(() => {
28
28
  let { id: t, kind: n, ...r } = e.source;
29
29
  return [
30
- d(h, { initialDocuments: [{
30
+ m(v, { initialDocuments: [{
31
31
  ...r,
32
32
  documentId: t,
33
33
  autoActivate: !0
34
34
  }] }),
35
- d(g),
36
- d(_, { defaultPageGap: 20 }),
37
- d(y),
38
- d(w, {
35
+ m(y),
36
+ m(b, { defaultPageGap: 20 }),
37
+ m(S, { withAnnotations: !0 }),
38
+ m(a.ZoomPluginPackage, {
39
39
  defaultZoomLevel: 1,
40
40
  minZoom: e.initialZoom === "fit-width" ? .1 : .5,
41
41
  maxZoom: 3
42
42
  }),
43
- d(b),
44
- d(A, { exclusionRules: { dataAttributes: ["data-pdf-business-control"] } }),
45
- d(D),
46
- d(k, { marquee: { enabled: !1 } }),
47
- d(E, { width: 100 })
43
+ m(C),
44
+ m(O, { exclusionRules: { dataAttributes: ["data-pdf-business-control"] } }),
45
+ m(T),
46
+ m(E, { marquee: { enabled: !1 } }),
47
+ m(w, { width: 100 })
48
48
  ];
49
49
  });
50
- return r ? /* @__PURE__ */ u("div", {
50
+ return r ? /* @__PURE__ */ p("div", {
51
51
  role: "alert",
52
52
  children: ["PDF 引擎加载失败:", r.message]
53
- }) : n || !t ? /* @__PURE__ */ l("div", {
53
+ }) : n || !t ? /* @__PURE__ */ f("div", {
54
54
  role: "status",
55
55
  children: "正在加载 PDF 引擎…"
56
- }) : /* @__PURE__ */ l(f, {
56
+ }) : /* @__PURE__ */ f(h, {
57
57
  engine: t,
58
58
  plugins: i,
59
59
  onInitialized: async (t) => {
60
60
  e.onReady?.(t);
61
61
  },
62
- children: /* @__PURE__ */ l(M, { ...e })
62
+ children: /* @__PURE__ */ f(j, { ...e })
63
63
  });
64
64
  }
65
- function M(d) {
66
- let f = d.source.id, m = p(f), h = m?.document, { provides: g } = re(), _ = o(() => g?.forDocument(f), [g, f]), { provides: y, state: b } = ae(f), { provides: w } = te(), { provides: E } = ce(), { provides: D, rotation: k } = x(f), A = r(f), [j, M] = c(1), [N, P] = c(null), F = h?.pages.length ?? 0, I = Math.max(1, Math.min(F || 1, d.currentPage ?? j)), L = d.pageMode === "single", R = s(d);
67
- R.current = d;
68
- let z = m?.scale ?? 1, B = s(!1), V = s(d.currentPage ?? 1), H = s(!0), U = s(I), W = s(L), G = s(null);
69
- (U.current !== I || W.current !== L) && ((W.current !== L || I !== G.current) && (V.current = I), W.current !== L && (H.current = !0), U.current = I, W.current = L, G.current = null);
70
- let K = s(y);
71
- K.current = y, a(() => {
65
+ function j(m) {
66
+ let h = m.source.id, _ = g(h), v = _?.document, { provides: y } = re(), b = ee(() => y?.forDocument(h), [y, h]), { provides: S, state: C } = o(h), { provides: w } = ne(), { provides: T } = D(), { provides: E, rotation: O } = oe(h), A = r(h), [j, M] = d(1), [N, P] = d(null), F = v?.pages.length ?? 0, I = Math.max(1, Math.min(F || 1, m.currentPage ?? j)), L = m.pageMode === "single", R = u(m);
67
+ R.current = m;
68
+ let z = _?.scale ?? 1, B = u(!1), V = u(m.currentPage ?? 1), H = u(!0), U = u(I), W = u(L), G = u(null);
69
+ l(() => {
70
+ (U.current !== I || W.current !== L) && ((W.current !== L || I !== G.current) && (V.current = I), W.current !== L && (H.current = !0), U.current = I, W.current = L, G.current = null);
71
+ }, [I, L]);
72
+ let K = u(S);
73
+ K.current = S, c(() => {
72
74
  if (!w || !F) return;
73
75
  let e = () => {
74
- let e = w.forDocument(f).getMetrics();
75
- !B.current && e.clientWidth && e.clientHeight && K.current && (B.current = !0, K.current.requestZoom(R.current.zoom ?? (R.current.initialZoom === "fit-width" ? C.FitWidth : R.current.initialZoom ?? 1)));
76
+ let e = w.forDocument(h).getMetrics();
77
+ !B.current && e.clientWidth && e.clientHeight && K.current && (B.current = !0, K.current.requestZoom(R.current.zoom ?? (R.current.initialZoom === "fit-width" ? a.ZoomMode.FitWidth : R.current.initialZoom ?? 1)));
76
78
  }, t = w.onViewportResize((t) => {
77
- t.documentId === f && e();
79
+ t.documentId === h && e();
78
80
  });
79
81
  return e(), t;
80
82
  }, [
81
83
  w,
82
- f,
84
+ h,
83
85
  F
84
- ]), a(() => {
85
- if (_ && !L) return _.onPageChange((e) => {
86
- B.current && !H.current && (G.current = e.pageNumber, M(e.pageNumber), e.pageNumber !== R.current.currentPage && R.current.onCurrentPageChange?.(e.pageNumber));
86
+ ]), c(() => {
87
+ if (b && !L) return b.onPageChange((e) => {
88
+ B.current && !H.current && (R.current.currentPage === void 0 && M(e.pageNumber), e.pageNumber !== R.current.currentPage && (G.current = e.pageNumber, R.current.onCurrentPageChange?.(e.pageNumber)));
87
89
  });
88
- }, [_, L]), a(() => {
89
- if (!_ || L || !F) return;
90
+ }, [b, L]), c(() => {
91
+ if (!b || L || !F) return;
90
92
  let e = () => {
91
- V.current !== null && (H.current = !0, _.scrollToPage({
93
+ V.current !== null && (H.current = !0, b.scrollToPage({
92
94
  pageNumber: V.current,
93
95
  behavior: "instant",
94
96
  ...N?.page === V.current ? {
@@ -97,29 +99,29 @@ function M(d) {
97
99
  alignY: 40
98
100
  } : {}
99
101
  }));
100
- }, t = g?.onLayoutReady((t) => {
101
- t.documentId === f && e();
102
+ }, t = y?.onLayoutReady((t) => {
103
+ t.documentId === h && e();
102
104
  }), n = w?.onViewportResize((t) => {
103
- t.documentId === f && e();
105
+ t.documentId === h && e();
104
106
  }), r = requestAnimationFrame(e);
105
107
  return () => {
106
108
  cancelAnimationFrame(r), t?.(), n?.();
107
109
  };
108
110
  }, [
109
- _,
110
- g,
111
+ b,
112
+ y,
111
113
  w,
112
- f,
114
+ h,
113
115
  L,
114
116
  F,
115
117
  I,
116
118
  z,
117
- k,
119
+ O,
118
120
  N
119
- ]), a(() => {
121
+ ]), c(() => {
120
122
  if (!L || !N || !w) return;
121
- let e = () => ue(A.containerRef.current, N, w.forDocument(f)), t = w.onViewportResize((t) => {
122
- t.documentId === f && e();
123
+ let e = () => de(A.containerRef.current, N, w.forDocument(h)), t = w.onViewportResize((t) => {
124
+ t.documentId === h && e();
123
125
  }), n = requestAnimationFrame(e);
124
126
  return () => {
125
127
  cancelAnimationFrame(n), t();
@@ -128,39 +130,39 @@ function M(d) {
128
130
  L,
129
131
  N,
130
132
  w,
131
- f,
133
+ h,
132
134
  I,
133
135
  z,
134
- k
136
+ O
135
137
  ]);
136
- let q = s(d.zoom ?? null), J = s(d.rotation ?? null), Y = s(z), X = s(k);
137
- a(() => {
138
- d.zoom !== void 0 && y && F && Math.abs(d.zoom - z) > .001 && (q.current = d.zoom, y.requestZoom(d.zoom));
138
+ let q = u(m.zoom ?? null), J = u(m.rotation ?? null), Y = u(z), X = u(O);
139
+ c(() => {
140
+ m.zoom !== void 0 && S && F && Math.abs(m.zoom - z) > .001 && (q.current = m.zoom, S.requestZoom(m.zoom));
139
141
  }, [
140
- d.zoom,
141
- !!y,
142
+ m.zoom,
143
+ !!S,
142
144
  F
143
- ]), a(() => {
144
- d.rotation !== void 0 && D && F && d.rotation !== k * 90 && (J.current = d.rotation, D.setRotation((d.rotation / 90 % 4 + 4) % 4));
145
+ ]), c(() => {
146
+ m.rotation !== void 0 && E && F && m.rotation !== O * 90 && (J.current = m.rotation, E.setRotation((m.rotation / 90 % 4 + 4) % 4));
145
147
  }, [
146
- d.rotation,
147
- !!D,
148
+ m.rotation,
149
+ !!E,
148
150
  F
149
- ]), a(() => {
151
+ ]), c(() => {
150
152
  if (q.current !== null) {
151
153
  if (Math.abs(q.current - z) > .001) return;
152
154
  q.current = null;
153
155
  }
154
156
  Y.current !== z && R.current.onZoomChange?.(z), Y.current = z;
155
- }, [z]), a(() => {
157
+ }, [z]), c(() => {
156
158
  if (J.current !== null) {
157
- if (J.current !== k * 90) return;
159
+ if (J.current !== O * 90) return;
158
160
  J.current = null;
159
161
  }
160
- X.current !== k && R.current.onRotationChange?.(k * 90), X.current = k;
161
- }, [k]), a(() => {
162
- let e = d.focusTarget, t = e && h?.pages[e.page - 1];
163
- e && t && _ && !L && (H.current = !0, _.scrollToPage({
162
+ X.current !== O && R.current.onRotationChange?.(O * 90), X.current = O;
163
+ }, [O]), c(() => {
164
+ let e = m.focusTarget, t = e && v?.pages[e.page - 1];
165
+ e && t && b && !L && (H.current = !0, b.scrollToPage({
164
166
  pageNumber: e.page,
165
167
  pageCoordinates: {
166
168
  x: t.size.width / 2,
@@ -170,8 +172,8 @@ function M(d) {
170
172
  behavior: "instant"
171
173
  }));
172
174
  }, [
173
- d.focusTarget?.token,
174
- _,
175
+ m.focusTarget?.token,
176
+ b,
175
177
  F,
176
178
  L
177
179
  ]);
@@ -180,12 +182,12 @@ function M(d) {
180
182
  }, Q = (e) => {
181
183
  G.current = null;
182
184
  let t = Math.max(1, Math.min(F, e));
183
- d.currentPage === void 0 && M(t), d.onCurrentPageChange?.(t);
185
+ m.currentPage === void 0 && M(t), m.onCurrentPageChange?.(t);
184
186
  }, $ = (e) => {
185
- let t = h?.pages[e];
187
+ let t = v?.pages[e];
186
188
  if (!t) return null;
187
- let n = (t.rotation + k) % 4, { width: r, height: i } = t.size, a = {
188
- documentId: f,
189
+ let n = (t.rotation + O) % 4, { width: r, height: i } = t.size, a = {
190
+ documentId: h,
189
191
  page: e + 1,
190
192
  pageIndex: e,
191
193
  width: r,
@@ -193,7 +195,7 @@ function M(d) {
193
195
  zoom: z,
194
196
  rotation: n * 90
195
197
  }, o = n % 2 == 1;
196
- return /* @__PURE__ */ l("div", {
198
+ return /* @__PURE__ */ f("div", {
197
199
  className: "ui-v2-native-page",
198
200
  "data-page": e + 1,
199
201
  style: {
@@ -201,13 +203,13 @@ function M(d) {
201
203
  width: (o ? i : r) * z,
202
204
  height: (o ? r : i) * z
203
205
  },
204
- children: /* @__PURE__ */ l(le, {
205
- documentId: f,
206
+ children: /* @__PURE__ */ f(k, {
207
+ documentId: h,
206
208
  pageIndex: e,
207
209
  rotation: n,
208
210
  scale: z,
209
- children: /* @__PURE__ */ u(ie, {
210
- documentId: f,
211
+ children: /* @__PURE__ */ p(ae, {
212
+ documentId: h,
211
213
  pageIndex: e,
212
214
  rotation: n,
213
215
  style: {
@@ -215,23 +217,23 @@ function M(d) {
215
217
  height: i * z
216
218
  },
217
219
  children: [
218
- d.renderPage ? d.renderPage({
220
+ m.renderPage ? m.renderPage({
219
221
  page: e + 1,
220
222
  zoom: z,
221
223
  rotation: n * 90
222
- }) : /* @__PURE__ */ l(v, {
224
+ }) : /* @__PURE__ */ f(ie, {
223
225
  draggable: !1,
224
- documentId: f,
226
+ documentId: h,
225
227
  pageIndex: e,
226
228
  "aria-label": `第 ${e + 1} 页`
227
229
  }),
228
- d.features?.search !== !1 && /* @__PURE__ */ l(se, {
230
+ m.features?.search !== !1 && /* @__PURE__ */ f(le, {
229
231
  "data-ui-search-layer": !0,
230
- documentId: f,
232
+ documentId: h,
231
233
  pageIndex: e,
232
234
  scale: z
233
235
  }),
234
- N?.page === e + 1 && /* @__PURE__ */ l("span", {
236
+ N?.page === e + 1 && /* @__PURE__ */ f("span", {
235
237
  "data-ui-search-target": !0,
236
238
  style: {
237
239
  position: "absolute",
@@ -242,13 +244,13 @@ function M(d) {
242
244
  pointerEvents: "none"
243
245
  }
244
246
  }),
245
- d.features?.textSelection !== !1 && /* @__PURE__ */ l(O, {
246
- documentId: f,
247
+ m.features?.textSelection !== !1 && /* @__PURE__ */ f(ue, {
248
+ documentId: h,
247
249
  pageIndex: e,
248
250
  scale: z,
249
251
  rotation: 0
250
252
  }),
251
- d.renderPageOverlay && /* @__PURE__ */ l("div", {
253
+ m.renderPageOverlay && /* @__PURE__ */ f("div", {
252
254
  className: "ui-v2-page-overlay",
253
255
  style: {
254
256
  position: "absolute",
@@ -259,54 +261,54 @@ function M(d) {
259
261
  transformOrigin: "0 0",
260
262
  pointerEvents: "none"
261
263
  },
262
- children: d.renderPageOverlay(a)
264
+ children: m.renderPageOverlay(a)
263
265
  })
264
266
  ]
265
267
  })
266
268
  })
267
269
  });
268
270
  };
269
- return /* @__PURE__ */ u("section", {
271
+ return /* @__PURE__ */ p("section", {
270
272
  ref: A.containerRef,
271
- style: d.style,
273
+ style: m.style,
272
274
  onKeyDown: (e) => {
273
- if (d.features?.textSelection === !1 || !(e.ctrlKey || e.metaKey) || e.key.toLowerCase() !== "c" || e.target.closest("input, textarea, [contenteditable=\"true\"]")) return;
274
- let t = E?.forDocument(f);
275
+ if (m.features?.textSelection === !1 || !(e.ctrlKey || e.metaKey) || e.key.toLowerCase() !== "c" || e.target.closest("input, textarea, [contenteditable=\"true\"]")) return;
276
+ let t = T?.forDocument(h);
275
277
  t?.getState().selection && (e.preventDefault(), t.copyToClipboard());
276
278
  },
277
- "aria-label": d.ariaLabel ?? "PDF 文档查看器",
279
+ "aria-label": m.ariaLabel ?? "PDF 文档查看器",
278
280
  className: [
279
281
  "ui-document-viewer",
280
282
  "ui-document-viewer-v2-headless",
281
283
  A.fullscreen && "ui-viewer-fullscreen",
282
- d.className
284
+ m.className
283
285
  ].filter(Boolean).join(" "),
284
286
  children: [
285
- d.showToolbar !== !1 && /* @__PURE__ */ u("div", {
287
+ m.showToolbar !== !1 && /* @__PURE__ */ p("div", {
286
288
  className: "ui-viewer-toolbar",
287
289
  children: [
288
- d.title !== void 0 && /* @__PURE__ */ l("div", {
290
+ m.title !== void 0 && /* @__PURE__ */ f("div", {
289
291
  className: "ui-viewer-title",
290
- children: d.title
292
+ children: m.title
291
293
  }),
292
- d.toolbar,
293
- /* @__PURE__ */ l(n, {
294
- zoom: b.currentZoomLevel,
294
+ m.toolbar,
295
+ /* @__PURE__ */ f(n, {
296
+ zoom: C.currentZoomLevel,
295
297
  disabled: !F,
296
298
  fullscreen: A.fullscreen,
297
299
  canZoomIn: z < 3,
298
- canZoomOut: z > (d.initialZoom === "fit-width" ? .1 : .5),
299
- onZoomIn: () => y?.zoomIn(),
300
- onZoomOut: () => y?.zoomOut(),
301
- onRotate: () => D?.rotateForward(),
300
+ canZoomOut: z > (m.initialZoom === "fit-width" ? .1 : .5),
301
+ onZoomIn: () => S?.zoomIn(),
302
+ onZoomOut: () => S?.zoomOut(),
303
+ onRotate: () => E?.rotateForward(),
302
304
  onToggleFullscreen: A.toggleFullscreen
303
305
  })
304
306
  ]
305
307
  }),
306
- d.features?.search !== !1 && /* @__PURE__ */ l(i, {
308
+ m.features?.search !== !1 && /* @__PURE__ */ f(s, {
307
309
  onClear: () => P(null),
308
310
  enabled: !!F,
309
- documentId: f,
311
+ documentId: h,
310
312
  onPageChange: (e, t) => {
311
313
  V.current = e, P(t ? {
312
314
  page: e,
@@ -314,13 +316,14 @@ function M(d) {
314
316
  } : null), Q(e);
315
317
  }
316
318
  }),
317
- m?.status === "error" ? /* @__PURE__ */ u("div", {
319
+ _?.status === "error" ? /* @__PURE__ */ p("div", {
318
320
  role: "alert",
319
- children: ["PDF 加载失败:", m.error]
320
- }) : h ? /* @__PURE__ */ l(t, {
321
- rail: /* @__PURE__ */ l(oe, {
322
- documentId: f,
323
- children: (t) => /* @__PURE__ */ u(e, {
321
+ children: ["PDF 加载失败:", _.error]
322
+ }) : v ? /* @__PURE__ */ f(t, {
323
+ defaultRailCollapsed: m.defaultRailCollapsed,
324
+ rail: /* @__PURE__ */ f(ce, {
325
+ documentId: h,
326
+ children: (t) => /* @__PURE__ */ p(e, {
324
327
  variant: "ghost",
325
328
  className: "ui-v2-thumbnail",
326
329
  "aria-label": `第 ${t.pageIndex + 1} 页`,
@@ -333,19 +336,19 @@ function M(d) {
333
336
  height: t.wrapperHeight,
334
337
  display: "grid"
335
338
  },
336
- children: [/* @__PURE__ */ l(T, {
337
- documentId: f,
339
+ children: [/* @__PURE__ */ f(se, {
340
+ documentId: h,
338
341
  meta: t,
339
342
  className: "ui-v2-thumbnail-image",
340
343
  style: {
341
344
  width: t.width,
342
345
  height: t.height
343
346
  }
344
- }), /* @__PURE__ */ l("span", { children: t.pageIndex + 1 })]
347
+ }), /* @__PURE__ */ f("span", { children: t.pageIndex + 1 })]
345
348
  }, t.pageIndex)
346
349
  }),
347
- children: /* @__PURE__ */ l(ee, {
348
- documentId: f,
350
+ children: /* @__PURE__ */ f(te, {
351
+ documentId: h,
349
352
  className: "ui-v2-native-viewport",
350
353
  tabIndex: 0,
351
354
  "aria-label": "PDF 页面滚动区域",
@@ -358,33 +361,35 @@ function M(d) {
358
361
  onTouchMoveCapture: Z,
359
362
  onPointerDownCapture: Z,
360
363
  onKeyDownCapture: Z,
361
- children: /* @__PURE__ */ l(S, {
362
- documentId: f,
363
- enablePinch: d.features?.pinchZoom !== !1,
364
- children: L ? /* @__PURE__ */ l("div", {
364
+ children: /* @__PURE__ */ f(i, {
365
+ documentId: h,
366
+ enablePinch: m.features?.pinchZoom !== !1,
367
+ minZoom: m.initialZoom === "fit-width" ? .1 : .5,
368
+ maxZoom: 3,
369
+ children: L ? /* @__PURE__ */ f("div", {
365
370
  className: "ui-v2-native-single",
366
371
  children: $(I - 1)
367
- }) : /* @__PURE__ */ l(ne, {
368
- documentId: f,
372
+ }) : /* @__PURE__ */ f(x, {
373
+ documentId: h,
369
374
  renderPage: ({ pageIndex: e }) => $(e)
370
375
  })
371
376
  })
372
377
  })
373
- }) : /* @__PURE__ */ l("div", {
378
+ }) : /* @__PURE__ */ f("div", {
374
379
  role: "status",
375
380
  children: "正在加载 PDF 文档…"
376
381
  }),
377
- /* @__PURE__ */ u("div", {
382
+ /* @__PURE__ */ p("div", {
378
383
  className: "ui-viewer-footer",
379
384
  children: [
380
- /* @__PURE__ */ l(e, {
385
+ /* @__PURE__ */ f(e, {
381
386
  variant: "ghost",
382
387
  size: "compact",
383
388
  disabled: !F || I <= 1,
384
389
  onClick: () => Q(I - 1),
385
390
  children: "上一页"
386
391
  }),
387
- /* @__PURE__ */ u("span", {
392
+ /* @__PURE__ */ p("span", {
388
393
  "aria-live": "polite",
389
394
  children: [
390
395
  F ? I : 0,
@@ -392,20 +397,20 @@ function M(d) {
392
397
  F
393
398
  ]
394
399
  }),
395
- /* @__PURE__ */ l(e, {
400
+ /* @__PURE__ */ f(e, {
396
401
  variant: "ghost",
397
402
  size: "compact",
398
403
  disabled: !F || I >= F,
399
404
  onClick: () => Q(I + 1),
400
405
  children: "下一页"
401
406
  }),
402
- d.footer
407
+ m.footer
403
408
  ]
404
409
  })
405
410
  ]
406
411
  });
407
412
  }
408
- function ue(e, t, n) {
413
+ function de(e, t, n) {
409
414
  let r = e?.querySelector(`[data-page="${t.page}"] [data-ui-search-target]`), i = e?.querySelector(".ui-v2-native-viewport");
410
415
  if (!r || !i) return;
411
416
  let a = r.getBoundingClientRect(), o = i.getBoundingClientRect(), s = n.getMetrics();
@@ -417,4 +422,4 @@ function ue(e, t, n) {
417
422
  });
418
423
  }
419
424
  //#endregion
420
- export { j as default };
425
+ export { A as default };
@@ -0,0 +1,33 @@
1
+ import { useMemo as e } from "react";
2
+ //#region src/sortable-transfer-scope.ts
3
+ var t = Symbol("sortable-transfer");
4
+ function n(n) {
5
+ return e(() => ({
6
+ [t]: null,
7
+ targets: /* @__PURE__ */ new Map(),
8
+ mime: `application/x-ui-sortable-${Math.random().toString(36).slice(2)}`
9
+ }), [n]);
10
+ }
11
+ function r(e) {
12
+ return e?.[t];
13
+ }
14
+ function i(e, n) {
15
+ e && (e[t] = n);
16
+ }
17
+ function a(e, n) {
18
+ e?.[t]?.source === n && (e[t] = null);
19
+ }
20
+ function o(e, t, n) {
21
+ return e?.targets.set(t, n), () => {
22
+ e?.targets.delete(t);
23
+ };
24
+ }
25
+ function s(e, t, n, r) {
26
+ let i = [...e?.targets ?? []].filter(([e, r]) => e !== t && r.accepts(n));
27
+ i.length === 1 && i[0][1].commit(n, r);
28
+ }
29
+ function c(e) {
30
+ e?.[t] && (e[t].consumed = !0);
31
+ }
32
+ //#endregion
33
+ export { r as activeSortableTransfer, i as beginSortableTransfer, c as consumeSortableTransfer, a as endSortableTransfer, o as registerSortableTarget, s as routeSortableTarget, n as useSortableTransferScope };