@embedpdf/react 3.0.0-next.14 → 3.0.0-next.15

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 (232) hide show
  1. package/dist/AnnotationList-CkijRHet-HEFNUIZe.d.cts +877 -0
  2. package/dist/AnnotationList-CkijRHet-HEFNUIZe.d.ts +877 -0
  3. package/dist/actions.cjs +25 -5
  4. package/dist/actions.cjs.map +1 -1
  5. package/dist/actions.d.cts +18 -5
  6. package/dist/actions.d.ts +18 -5
  7. package/dist/actions.js +22 -6
  8. package/dist/actions.js.map +1 -1
  9. package/dist/anchored-DeX95xSd.d.ts +85 -0
  10. package/dist/anchored-DzN3JywS.d.cts +85 -0
  11. package/dist/anchored.cjs +71 -28
  12. package/dist/anchored.cjs.map +1 -1
  13. package/dist/anchored.d.cts +2 -45
  14. package/dist/anchored.d.ts +2 -45
  15. package/dist/anchored.js +56 -19
  16. package/dist/anchored.js.map +1 -1
  17. package/dist/annotation-B48UT2ln.d.ts +302 -0
  18. package/dist/annotation-C1ttM8Wj.js +708 -0
  19. package/dist/annotation-C1ttM8Wj.js.map +1 -0
  20. package/dist/annotation-C9dVwo9b.d.cts +302 -0
  21. package/dist/annotation-Dex5EBda.cjs +830 -0
  22. package/dist/annotation-Dex5EBda.cjs.map +1 -0
  23. package/dist/annotation.cjs +20 -784
  24. package/dist/annotation.d.cts +2 -2
  25. package/dist/annotation.d.ts +2 -2
  26. package/dist/annotation.js +2 -769
  27. package/dist/commands.cjs +68 -28
  28. package/dist/commands.cjs.map +1 -1
  29. package/dist/commands.d.cts +37 -10
  30. package/dist/commands.d.ts +37 -10
  31. package/dist/commands.js +68 -31
  32. package/dist/commands.js.map +1 -1
  33. package/dist/form-55izw0jS.js +511 -0
  34. package/dist/form-55izw0jS.js.map +1 -0
  35. package/dist/form-BNqQfGGH.cjs +548 -0
  36. package/dist/form-BNqQfGGH.cjs.map +1 -0
  37. package/dist/form.cjs +5 -5
  38. package/dist/form.d.cts +41 -2
  39. package/dist/form.d.ts +41 -2
  40. package/dist/form.js +2 -3
  41. package/dist/history.cjs +38 -0
  42. package/dist/history.cjs.map +1 -0
  43. package/dist/history.d.cts +27 -0
  44. package/dist/history.d.ts +27 -0
  45. package/dist/history.js +27 -0
  46. package/dist/history.js.map +1 -0
  47. package/dist/i18n.cjs +26 -30
  48. package/dist/i18n.cjs.map +1 -1
  49. package/dist/i18n.d.cts +24 -21
  50. package/dist/i18n.d.ts +24 -21
  51. package/dist/i18n.js +24 -31
  52. package/dist/i18n.js.map +1 -1
  53. package/dist/index.cjs +200 -57
  54. package/dist/index.d.cts +31 -32
  55. package/dist/index.d.ts +31 -32
  56. package/dist/index.js +32 -30
  57. package/dist/inert-CmBEbKCn.cjs +19 -0
  58. package/dist/inert-CmBEbKCn.cjs.map +1 -0
  59. package/dist/inert-D8fkennb.js +14 -0
  60. package/dist/inert-D8fkennb.js.map +1 -0
  61. package/dist/interaction.cjs +48 -102
  62. package/dist/interaction.cjs.map +1 -1
  63. package/dist/interaction.d.cts +23 -32
  64. package/dist/interaction.d.ts +23 -32
  65. package/dist/interaction.js +33 -102
  66. package/dist/interaction.js.map +1 -1
  67. package/dist/link.cjs +65 -104
  68. package/dist/link.cjs.map +1 -1
  69. package/dist/link.d.cts +21 -16
  70. package/dist/link.d.ts +22 -17
  71. package/dist/link.js +67 -107
  72. package/dist/link.js.map +1 -1
  73. package/dist/measurement.cjs +36 -11
  74. package/dist/measurement.cjs.map +1 -1
  75. package/dist/measurement.d.cts +33 -7
  76. package/dist/measurement.d.ts +33 -7
  77. package/dist/measurement.js +35 -14
  78. package/dist/measurement.js.map +1 -1
  79. package/dist/metadata.cjs +20 -7
  80. package/dist/metadata.cjs.map +1 -1
  81. package/dist/metadata.d.cts +22 -7
  82. package/dist/metadata.d.ts +22 -7
  83. package/dist/metadata.js +20 -10
  84. package/dist/metadata.js.map +1 -1
  85. package/dist/page-edit.cjs +7 -3
  86. package/dist/page-edit.cjs.map +1 -1
  87. package/dist/page-edit.d.cts +6 -2
  88. package/dist/page-edit.d.ts +6 -2
  89. package/dist/page-edit.js +7 -4
  90. package/dist/page-edit.js.map +1 -1
  91. package/dist/page-layers-Bkaaz8Zf.js +26 -0
  92. package/dist/page-layers-Bkaaz8Zf.js.map +1 -0
  93. package/dist/page-layers-BloZDoOV.cjs +37 -0
  94. package/dist/page-layers-BloZDoOV.cjs.map +1 -0
  95. package/dist/page-view.cjs +89 -82
  96. package/dist/page-view.cjs.map +1 -1
  97. package/dist/page-view.d.cts +14 -7
  98. package/dist/page-view.d.ts +18 -11
  99. package/dist/page-view.js +86 -81
  100. package/dist/page-view.js.map +1 -1
  101. package/dist/redaction.cjs +30 -15
  102. package/dist/redaction.cjs.map +1 -1
  103. package/dist/redaction.d.cts +27 -9
  104. package/dist/redaction.d.ts +27 -9
  105. package/dist/redaction.js +29 -18
  106. package/dist/redaction.js.map +1 -1
  107. package/dist/render.cjs +71 -46
  108. package/dist/render.cjs.map +1 -1
  109. package/dist/render.d.cts +17 -5
  110. package/dist/render.d.ts +17 -5
  111. package/dist/render.js +70 -49
  112. package/dist/render.js.map +1 -1
  113. package/dist/runtime-B6xcPsEb.js +398 -0
  114. package/dist/runtime-B6xcPsEb.js.map +1 -0
  115. package/dist/runtime-DBEBlpQV.d.cts +237 -0
  116. package/dist/runtime-V3MVMb91.d.ts +237 -0
  117. package/dist/runtime-fzpGv78v.cjs +555 -0
  118. package/dist/runtime-fzpGv78v.cjs.map +1 -0
  119. package/dist/runtime.cjs +45 -324
  120. package/dist/runtime.d.cts +2 -2
  121. package/dist/runtime.d.ts +2 -2
  122. package/dist/runtime.js +2 -306
  123. package/dist/search.cjs +81 -50
  124. package/dist/search.cjs.map +1 -1
  125. package/dist/search.d.cts +37 -24
  126. package/dist/search.d.ts +37 -24
  127. package/dist/search.js +81 -53
  128. package/dist/search.js.map +1 -1
  129. package/dist/selection.cjs +105 -108
  130. package/dist/selection.cjs.map +1 -1
  131. package/dist/selection.d.cts +54 -26
  132. package/dist/selection.d.ts +56 -28
  133. package/dist/selection.js +103 -110
  134. package/dist/selection.js.map +1 -1
  135. package/dist/shell.cjs +36 -21
  136. package/dist/shell.cjs.map +1 -1
  137. package/dist/shell.d.cts +32 -17
  138. package/dist/shell.d.ts +32 -17
  139. package/dist/shell.js +36 -24
  140. package/dist/shell.js.map +1 -1
  141. package/dist/signature.cjs +29 -48
  142. package/dist/signature.cjs.map +1 -1
  143. package/dist/signature.d.cts +26 -26
  144. package/dist/signature.d.ts +26 -26
  145. package/dist/signature.js +30 -48
  146. package/dist/signature.js.map +1 -1
  147. package/dist/stage-BIG6aeVd.cjs +369 -0
  148. package/dist/stage-BIG6aeVd.cjs.map +1 -0
  149. package/dist/stage-ByFPD-Fv.d.cts +117 -0
  150. package/dist/stage-DaboaheR.d.ts +117 -0
  151. package/dist/stage-DoVekb83.js +302 -0
  152. package/dist/stage-DoVekb83.js.map +1 -0
  153. package/dist/stage-scope-CQgCuf1w.cjs +46 -0
  154. package/dist/stage-scope-CQgCuf1w.cjs.map +1 -0
  155. package/dist/stage-scope-D7ZeNduT.js +23 -0
  156. package/dist/stage-scope-D7ZeNduT.js.map +1 -0
  157. package/dist/stage.cjs +12 -235
  158. package/dist/stage.d.cts +2 -116
  159. package/dist/stage.d.ts +2 -116
  160. package/dist/stage.js +3 -228
  161. package/dist/stamp.cjs +41 -35
  162. package/dist/stamp.cjs.map +1 -1
  163. package/dist/stamp.d.cts +25 -18
  164. package/dist/stamp.d.ts +25 -18
  165. package/dist/stamp.js +40 -37
  166. package/dist/stamp.js.map +1 -1
  167. package/dist/state-0K1I5cM4.d.cts +29 -0
  168. package/dist/state-0K1I5cM4.d.ts +29 -0
  169. package/dist/state-CbgxhwLA.js +62 -0
  170. package/dist/state-CbgxhwLA.js.map +1 -0
  171. package/dist/state-CsfZy_Eq.cjs +73 -0
  172. package/dist/state-CsfZy_Eq.cjs.map +1 -0
  173. package/dist/svg-shapes-Dm1yTR1b.js +40 -0
  174. package/dist/svg-shapes-Dm1yTR1b.js.map +1 -0
  175. package/dist/svg-shapes-zo0GNkc9.cjs +53 -0
  176. package/dist/svg-shapes-zo0GNkc9.cjs.map +1 -0
  177. package/dist/toolbar.cjs +297 -295
  178. package/dist/toolbar.cjs.map +1 -1
  179. package/dist/toolbar.d.cts +58 -68
  180. package/dist/toolbar.d.ts +67 -77
  181. package/dist/toolbar.js +271 -293
  182. package/dist/toolbar.js.map +1 -1
  183. package/dist/view-manager.cjs +34 -0
  184. package/dist/view-manager.cjs.map +1 -0
  185. package/dist/view-manager.d.cts +21 -0
  186. package/dist/view-manager.d.ts +21 -0
  187. package/dist/view-manager.js +23 -0
  188. package/dist/view-manager.js.map +1 -0
  189. package/package.json +37 -39
  190. package/dist/annotation-BCED_p9H.d.cts +0 -160
  191. package/dist/annotation-anchors-CetwM1g7.js +0 -15
  192. package/dist/annotation-anchors-CetwM1g7.js.map +0 -1
  193. package/dist/annotation-anchors-DuYRBJLl.cjs +0 -26
  194. package/dist/annotation-anchors-DuYRBJLl.cjs.map +0 -1
  195. package/dist/annotation-hooks-BB5ZhPpf.cjs +0 -16
  196. package/dist/annotation-hooks-BB5ZhPpf.cjs.map +0 -1
  197. package/dist/annotation-hooks-Df8EmzDO.js +0 -11
  198. package/dist/annotation-hooks-Df8EmzDO.js.map +0 -1
  199. package/dist/annotation-k38KDlIZ.d.ts +0 -160
  200. package/dist/annotation-menu.cjs +0 -64
  201. package/dist/annotation-menu.cjs.map +0 -1
  202. package/dist/annotation-menu.d.cts +0 -33
  203. package/dist/annotation-menu.d.ts +0 -33
  204. package/dist/annotation-menu.js +0 -48
  205. package/dist/annotation-menu.js.map +0 -1
  206. package/dist/annotation.cjs.map +0 -1
  207. package/dist/annotation.js.map +0 -1
  208. package/dist/form-BVumS7up.cjs +0 -926
  209. package/dist/form-BVumS7up.cjs.map +0 -1
  210. package/dist/form-Bdjk0Z3T.d.cts +0 -537
  211. package/dist/form-CK3mp99m.js +0 -895
  212. package/dist/form-CK3mp99m.js.map +0 -1
  213. package/dist/form-CYRYgthn.d.ts +0 -537
  214. package/dist/rolldown-runtime-BBjsoOtd.js +0 -27
  215. package/dist/runtime-DE76hlnl.d.ts +0 -216
  216. package/dist/runtime-umHA_xHt.d.cts +0 -216
  217. package/dist/runtime.cjs.map +0 -1
  218. package/dist/runtime.js.map +0 -1
  219. package/dist/scrollbar.cjs +0 -241
  220. package/dist/scrollbar.cjs.map +0 -1
  221. package/dist/scrollbar.d.cts +0 -42
  222. package/dist/scrollbar.d.ts +0 -42
  223. package/dist/scrollbar.js +0 -213
  224. package/dist/scrollbar.js.map +0 -1
  225. package/dist/stage.cjs.map +0 -1
  226. package/dist/stage.js.map +0 -1
  227. package/dist/views.cjs +0 -35
  228. package/dist/views.cjs.map +0 -1
  229. package/dist/views.d.cts +0 -21
  230. package/dist/views.d.ts +0 -21
  231. package/dist/views.js +0 -27
  232. package/dist/views.js.map +0 -1
package/dist/stage.cjs CHANGED
@@ -1,237 +1,16 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_rolldown_runtime = require("./rolldown-runtime-DDXJien1.cjs");
3
- const require_runtime = require("./runtime.cjs");
4
- const require_anchored = require("./anchored.cjs");
5
- let react_jsx_runtime = require("react/jsx-runtime");
6
- let react = require("react");
7
- react = require_rolldown_runtime.__toESM(react, 1);
8
- let _embedpdf_web = require("@embedpdf/web");
9
- let _embedpdf_plugin_stage = require("@embedpdf/plugin-stage");
10
- let _embedpdf_plugin_interaction_contract = require("@embedpdf/plugin-interaction/contract");
11
- //#region src/stage.tsx
12
- function PageSurface({ documentId, page, frame, stage, render, chrome }) {
13
- const ref = (0, react.useRef)(null);
14
- const t = page.transform;
15
- const rotation = page.rotation;
16
- const outerW = t.viewWidth + frame.left + frame.right;
17
- const outerH = t.viewHeight + frame.top + frame.bottom;
18
- const left = page.screenX - frame.left;
19
- const top = page.screenY - frame.top;
20
- const contentLeft = frame.left + (t.viewWidth - t.contentWidth) / 2;
21
- const contentTop = frame.top + (t.viewHeight - t.contentHeight) / 2;
22
- const ctx = (0, react.useMemo)(() => require_runtime.makePageContext(documentId, stage.lensId(), page.pon, page.pageIndex, frame, t, () => ref.current.getBoundingClientRect(), () => {
23
- const live = stage.visiblePages().find((p) => p.pon === page.pon);
24
- return live ? {
25
- desiredDeviceWidth: live.transform.deviceWidth,
26
- visibleRect: live.visibleRect
27
- } : {
28
- desiredDeviceWidth: t.deviceWidth,
29
- visibleRect: {
30
- x: 0,
31
- y: 0,
32
- width: 0,
33
- height: 0
34
- }
35
- };
36
- }), [
37
- documentId,
38
- page.pon,
39
- page.pageIndex,
40
- frame,
41
- t,
42
- stage
43
- ]);
44
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
45
- style: {
46
- position: "absolute",
47
- left,
48
- top,
49
- width: outerW,
50
- height: outerH
51
- },
52
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_runtime.PageProvider, {
53
- value: ctx,
54
- children: [
55
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { style: {
56
- position: "absolute",
57
- left: frame.left,
58
- top: frame.top,
59
- width: t.viewWidth,
60
- height: t.viewHeight,
61
- boxShadow: "var(--epdf-page-shadow, 0 6px 18px rgba(0,0,0,.18))"
62
- } }),
63
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
64
- ref,
65
- style: {
66
- position: "absolute",
67
- left: contentLeft,
68
- top: contentTop,
69
- width: t.contentWidth,
70
- height: t.contentHeight,
71
- background: "#fff",
72
- transform: rotation ? `rotate(${rotation}deg)` : void 0,
73
- userSelect: "none",
74
- WebkitUserSelect: "none"
75
- },
76
- children: render(ctx)
77
- }),
78
- chrome?.(ctx)
79
- ]
80
- })
81
- });
82
- }
83
- function Stage({ children, pageChrome, overlay, interaction = true, panFallback = true, zoomGestures = true, token = _embedpdf_plugin_stage.StageToken, className, style }) {
84
- const stage = require_runtime.useCapability(token);
85
- const ix = require_runtime.useOptionalCapability(_embedpdf_plugin_interaction_contract.InteractionToken);
86
- const useHub = interaction && !!ix;
87
- const hubCursor = require_runtime.useKernelValue(() => ix?.cursor() ?? "default");
88
- const ref = (0, react.useRef)(null);
89
- const docId = require_runtime.useDocumentId();
90
- const pages = require_runtime.useSelector(token, (c) => c.visiblePages());
91
- const frame = require_runtime.useSelector(token, (c) => c.pageFrame(), (a, b) => a.top === b.top && a.right === b.right && a.bottom === b.bottom && a.left === b.left);
92
- const projector = (0, react.useMemo)(() => ({
93
- space: "overlay",
94
- toScreen: (pon, rect) => stage.pageRectToScreen(pon, rect),
95
- toScreenPoint: (pon, at) => {
96
- const r = stage.pageRectToScreen(pon, {
97
- x: at.x,
98
- y: at.y,
99
- width: 0,
100
- height: 0
101
- });
102
- return r ? {
103
- x: r.x,
104
- y: r.y
105
- } : null;
106
- },
107
- viewEnv: (pon) => {
108
- const t = stage.pageRect(pon)?.transform;
109
- return t ? {
110
- scale: t.viewScale,
111
- rotation: t.rotation,
112
- zoom: t.zoom
113
- } : null;
114
- }
115
- }), [stage]);
116
- const projectorBinding = (0, react.useMemo)(() => ({
117
- projector,
118
- revision: pages
119
- }), [projector, pages]);
120
- (0, react.useLayoutEffect)(() => {
121
- const el = ref.current;
122
- const detachSurface = (0, _embedpdf_web.createStageSurface)(el, stage, {
123
- hub: useHub ? ix : null,
124
- source: stage.lensId(),
125
- zoomGestures
126
- });
127
- const offScroll = useHub && ix ? ix.registerHandler((0, _embedpdf_plugin_stage.createScrollHandler)(stage, ix, { panFallback }), { source: stage.lensId() }) : null;
128
- return () => {
129
- offScroll?.();
130
- detachSurface();
131
- };
132
- }, [
133
- stage,
134
- ix,
135
- useHub,
136
- zoomGestures,
137
- panFallback
138
- ]);
139
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
140
- ref,
141
- className,
142
- style: {
143
- position: "relative",
144
- overflow: "hidden",
145
- touchAction: "none",
146
- ...useHub ? { cursor: hubCursor } : null,
147
- ...style
148
- },
149
- children: [pages.map((p) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PageSurface, {
150
- documentId: docId ?? "",
151
- page: p,
152
- frame,
153
- stage,
154
- render: children,
155
- chrome: pageChrome
156
- }, p.pon)), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_anchored.ProjectorProvider, {
157
- value: projectorBinding,
158
- children: overlay
159
- })]
160
- });
161
- }
162
- function useStage(token = _embedpdf_plugin_stage.StageToken) {
163
- return require_runtime.useCapability(token);
164
- }
165
- function useZoom(token = _embedpdf_plugin_stage.StageToken) {
166
- const s = require_runtime.useCapability(token);
167
- return {
168
- zoom: require_runtime.useSelector(token, (c) => c.zoomLevel()),
169
- /** Active zoom intent: 'automatic' | 'fit-page' | 'fit-width' | 'fit-all' | 'custom'. */
170
- mode: require_runtime.useSelector(token, (c) => c.zoomMode()),
171
- zoomIn: s.zoomIn,
172
- zoomOut: s.zoomOut,
173
- fitWidth: s.fitWidth,
174
- fitPage: s.fitPage,
175
- fitAll: s.fitAll,
176
- automatic: s.automatic,
177
- zoomTo: s.zoomTo
178
- };
179
- }
180
- function usePages(token = _embedpdf_plugin_stage.StageToken) {
181
- const s = require_runtime.useCapability(token);
182
- return {
183
- currentPage: require_runtime.useSelector(token, (c) => c.currentPage()),
184
- pageCount: require_runtime.useSelector(token, (c) => c.pageCount()),
185
- goToPage: s.goToPage,
186
- next: s.next,
187
- prev: s.prev,
188
- reveal: s.reveal
189
- };
190
- }
191
- function useLayout(token = _embedpdf_plugin_stage.StageToken) {
192
- const s = require_runtime.useCapability(token);
193
- return {
194
- flow: require_runtime.useSelector(token, (c) => c.flow()),
195
- layout: require_runtime.useSelector(token, (c) => c.layout()),
196
- spread: require_runtime.useSelector(token, (c) => c.spread()),
197
- sizing: require_runtime.useSelector(token, (c) => c.sizing()),
198
- bounded: require_runtime.useSelector(token, (c) => c.bounded()),
199
- setFlow: s.setFlow,
200
- setLayout: s.setLayout,
201
- setSpread: s.setSpread,
202
- setSizing: s.setSizing,
203
- setBounded: s.setBounded
204
- };
205
- }
206
- /** The document's page list (with PDF labels) + the current item's pages — the
207
- * data for page thumbnails / worksheet-style page tabs. */
208
- function usePageList(token = _embedpdf_plugin_stage.StageToken) {
209
- return {
210
- pages: require_runtime.useSelector(token, (c) => c.pages(), (a, b) => a.length === b.length && a.every((p, i) => p.pon === b[i].pon && p.label === b[i].label)),
211
- currentItemPages: require_runtime.useSelector(token, (c) => c.currentItemPages(), (a, b) => a.length === b.length && a.every((x, i) => x === b[i]))
212
- };
213
- }
214
- /**
215
- * All Stage settings + the batch `update`. This is the seam for "presets are a
216
- * customer concern": keep your own `Partial<StageSettings>` objects and apply them
217
- * with `update(preset)` (one anchor-preserving change).
218
- */
219
- function useStageSettings(token = _embedpdf_plugin_stage.StageToken) {
220
- const s = require_runtime.useCapability(token);
221
- return {
222
- settings: require_runtime.useSelector(token, (c) => c.settings(), _embedpdf_plugin_stage.settingsEqual),
223
- update: s.update,
224
- reset: s.resetView
225
- };
226
- }
227
- //#endregion
228
- exports.Stage = Stage;
229
- exports.useLayout = useLayout;
230
- exports.usePageList = usePageList;
231
- exports.usePages = usePages;
232
- exports.useStage = useStage;
233
- exports.useStageSettings = useStageSettings;
234
- exports.useZoom = useZoom;
2
+ const require_stage_scope = require("./stage-scope-CQgCuf1w.cjs");
3
+ const require_stage = require("./stage-BIG6aeVd.cjs");
4
+ exports.Scrollbar = require_stage.Scrollbar;
5
+ exports.Stage = require_stage.Stage;
6
+ exports.StageScope = require_stage_scope.StageScope;
7
+ exports.useScrollMetrics = require_stage.useScrollMetrics;
8
+ exports.useStage = require_stage.useStage;
9
+ exports.useStageEvent = require_stage.useStageEvent;
10
+ exports.useStageSettings = require_stage.useStageSettings;
11
+ exports.useStageState = require_stage.useStageState;
12
+ exports.useStageToken = require_stage_scope.useStageToken;
13
+ var _embedpdf_plugin_stage = require("@embedpdf/plugin-stage");
235
14
  Object.keys(_embedpdf_plugin_stage).forEach(function(k) {
236
15
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
237
16
  enumerable: true,
@@ -240,5 +19,3 @@ Object.keys(_embedpdf_plugin_stage).forEach(function(k) {
240
19
  }
241
20
  });
242
21
  });
243
-
244
- //# sourceMappingURL=stage.cjs.map
package/dist/stage.d.cts CHANGED
@@ -1,117 +1,3 @@
1
- import { o as PageContextValue } from "./runtime-umHA_xHt.cjs";
2
- import * as React from "react";
3
- import { CapabilityToken } from "@embedpdf/core";
4
- import { StageCapability } from "@embedpdf/plugin-stage";
1
+ import { a as useStageSettings, c as ScrollbarAxis, d as StageScope, f as StageScopeProps, i as useStageEvent, l as ScrollbarProps, m as useStageToken, n as StageProps, o as useStageState, p as StageTokenProp, r as useStage, s as Scrollbar, t as Stage, u as useScrollMetrics } from "./stage-ByFPD-Fv.cjs";
5
2
  export * from "@embedpdf/plugin-stage";
6
- //#region src/stage.d.ts
7
- /** Which stage lens to bind to. Defaults to the main StageToken — pass a custom
8
- * token to drive an additional lens (e.g. a wrapped thumbnail sidebar). */
9
- type StageTokenProp = CapabilityToken<StageCapability>;
10
- interface StageProps {
11
- /**
12
- * PAGE-SPACE content for each visible page (RenderLayer, annotations,
13
- * markers). Rendered inside the page's content frame, so it ROTATES with the
14
- * page's display rotation — coordinates are plain PDF points.
15
- */
16
- children: (page: PageContextValue) => React.ReactNode;
17
- /**
18
- * BOX-SPACE chrome for each visible page (page-number label, selection
19
- * border, a per-page rotate/delete button). Rendered into the OUTER box
20
- * (content + reserved `pageFrame`), so it does NOT rotate and the reserved
21
- * bands are plain regions (`bottom:0; height: page.frame.bottom`). The three
22
- * coordinate spaces: `children` (page content), `pageChrome` (page box +
23
- * frame), `overlay` (viewport).
24
- */
25
- pageChrome?: (page: PageContextValue) => React.ReactNode;
26
- /** Viewport-space UI (menus, controls) rendered above the pages. */
27
- overlay?: React.ReactNode;
28
- /**
29
- * Route this Stage's pointer events to the interaction hub (page-resolved via
30
- * `pageAt`) — AND register this lens's tool-gated pan-scroll handler with it
31
- * (lens-scoped, so multiple stages on one document never pan each other).
32
- * Pan is then the `pan` tool's job and dragging in `pointer` mode selects
33
- * text (incl. across pages).
34
- *
35
- * Default TRUE: registering `interactionPlugin()` is the one opt-in — tools
36
- * just work; without the hub this is inert and the stage falls back to
37
- * built-in drag-to-pan, so a hub-less setup costs nothing. Set `false` on
38
- * SECONDARY lenses (a thumbnail rail) that should stay click-to-navigate
39
- * instead of feeding the document's tools.
40
- */
41
- interaction?: boolean;
42
- /**
43
- * With {@link interaction}: let drags over page GAPS pan regardless of the
44
- * active tool (and show a grab cursor there) — the gutter always pans; there
45
- * is nothing to draw/select outside a page. Default true.
46
- */
47
- panFallback?: boolean;
48
- /**
49
- * Ambient ZOOM gestures on this stage: ctrl/cmd+wheel and trackpad pinch
50
- * (Safari gesture events included). Default true. Turn OFF for follower
51
- * lenses with a fixed magnification — a thumbnail rail should scroll under
52
- * cmd+wheel, not zoom — so a zoom-wheel falls through to ordinary wheel
53
- * pan, and pinches are still swallowed (they never page-zoom the browser).
54
- */
55
- zoomGestures?: boolean;
56
- /** The stage lens to drive (default: the main StageToken). */
57
- token?: StageTokenProp;
58
- className?: string;
59
- style?: React.CSSProperties;
60
- }
61
- declare function Stage({ children, pageChrome, overlay, interaction, panFallback, zoomGestures, token, className, style }: StageProps): import("react/jsx-runtime").JSX.Element;
62
- declare function useStage(token?: StageTokenProp): StageCapability;
63
- declare function useZoom(token?: StageTokenProp): {
64
- zoom: number;
65
- /** Active zoom intent: 'automatic' | 'fit-page' | 'fit-width' | 'fit-all' | 'custom'. */
66
- mode: import("@embedpdf/core-stage").ZoomModeValue | "custom";
67
- zoomIn: () => void;
68
- zoomOut: () => void;
69
- fitWidth: () => void;
70
- fitPage: () => void;
71
- fitAll: () => void;
72
- automatic: () => void;
73
- zoomTo: (spec: import("@embedpdf/core-stage").ZoomSpec) => void;
74
- };
75
- declare function usePages(token?: StageTokenProp): {
76
- currentPage: number;
77
- pageCount: number;
78
- goToPage: (pageIndex: number, opts?: import("@embedpdf/plugin-stage").GoToOptions) => void;
79
- next: (opts?: import("@embedpdf/plugin-stage").GoToOptions) => void;
80
- prev: (opts?: import("@embedpdf/plugin-stage").GoToOptions) => void;
81
- reveal: (pageIndex: number, opts?: import("@embedpdf/plugin-stage").RevealOptions) => void;
82
- };
83
- declare function useLayout(token?: StageTokenProp): {
84
- flow: import("@embedpdf/plugin-stage").FlowMode;
85
- layout: import("@embedpdf/plugin-stage").LayoutKind;
86
- spread: import("@embedpdf/core-stage").SpreadMode;
87
- sizing: import("@embedpdf/core-stage").SizingMode;
88
- bounded: boolean;
89
- setFlow: (flow: import("@embedpdf/plugin-stage").FlowMode) => void;
90
- setLayout: (layout: import("@embedpdf/plugin-stage").LayoutKind) => void;
91
- setSpread: (spread: import("@embedpdf/core-stage").SpreadMode) => void;
92
- setSizing: (sizing: import("@embedpdf/core-stage").SizingMode) => void;
93
- setBounded: (bounded: boolean) => void;
94
- };
95
- /** The document's page list (with PDF labels) + the current item's pages — the
96
- * data for page thumbnails / worksheet-style page tabs. */
97
- declare function usePageList(token?: StageTokenProp): {
98
- pages: {
99
- index: number;
100
- pon: import("@embedpdf/core").PageObjectNumber;
101
- label: string | null;
102
- }[];
103
- currentItemPages: number[];
104
- };
105
- /**
106
- * All Stage settings + the batch `update`. This is the seam for "presets are a
107
- * customer concern": keep your own `Partial<StageSettings>` objects and apply them
108
- * with `update(preset)` (one anchor-preserving change).
109
- */
110
- declare function useStageSettings(token?: StageTokenProp): {
111
- settings: import("@embedpdf/plugin-stage").StageSettings;
112
- update: (patch: Partial<import("@embedpdf/plugin-stage").StageSettings>) => void;
113
- reset: () => void;
114
- };
115
- //#endregion
116
- export { Stage, StageProps, StageTokenProp, useLayout, usePageList, usePages, useStage, useStageSettings, useZoom };
117
- //# sourceMappingURL=stage.d.cts.map
3
+ export { Scrollbar, type ScrollbarAxis, type ScrollbarProps, Stage, StageProps, StageScope, type StageScopeProps, type StageTokenProp, useScrollMetrics, useStage, useStageEvent, useStageSettings, useStageState, useStageToken };
package/dist/stage.d.ts CHANGED
@@ -1,117 +1,3 @@
1
- import { o as PageContextValue } from "./runtime-DE76hlnl.js";
2
- import { CapabilityToken } from "@embedpdf/core";
3
- import * as React from "react";
4
- import { StageCapability } from "@embedpdf/plugin-stage";
1
+ import { a as useStageSettings, c as ScrollbarAxis, d as StageScope, f as StageScopeProps, i as useStageEvent, l as ScrollbarProps, m as useStageToken, n as StageProps, o as useStageState, p as StageTokenProp, r as useStage, s as Scrollbar, t as Stage, u as useScrollMetrics } from "./stage-DaboaheR.js";
5
2
  export * from "@embedpdf/plugin-stage";
6
- //#region src/stage.d.ts
7
- /** Which stage lens to bind to. Defaults to the main StageToken — pass a custom
8
- * token to drive an additional lens (e.g. a wrapped thumbnail sidebar). */
9
- type StageTokenProp = CapabilityToken<StageCapability>;
10
- interface StageProps {
11
- /**
12
- * PAGE-SPACE content for each visible page (RenderLayer, annotations,
13
- * markers). Rendered inside the page's content frame, so it ROTATES with the
14
- * page's display rotation — coordinates are plain PDF points.
15
- */
16
- children: (page: PageContextValue) => React.ReactNode;
17
- /**
18
- * BOX-SPACE chrome for each visible page (page-number label, selection
19
- * border, a per-page rotate/delete button). Rendered into the OUTER box
20
- * (content + reserved `pageFrame`), so it does NOT rotate and the reserved
21
- * bands are plain regions (`bottom:0; height: page.frame.bottom`). The three
22
- * coordinate spaces: `children` (page content), `pageChrome` (page box +
23
- * frame), `overlay` (viewport).
24
- */
25
- pageChrome?: (page: PageContextValue) => React.ReactNode;
26
- /** Viewport-space UI (menus, controls) rendered above the pages. */
27
- overlay?: React.ReactNode;
28
- /**
29
- * Route this Stage's pointer events to the interaction hub (page-resolved via
30
- * `pageAt`) — AND register this lens's tool-gated pan-scroll handler with it
31
- * (lens-scoped, so multiple stages on one document never pan each other).
32
- * Pan is then the `pan` tool's job and dragging in `pointer` mode selects
33
- * text (incl. across pages).
34
- *
35
- * Default TRUE: registering `interactionPlugin()` is the one opt-in — tools
36
- * just work; without the hub this is inert and the stage falls back to
37
- * built-in drag-to-pan, so a hub-less setup costs nothing. Set `false` on
38
- * SECONDARY lenses (a thumbnail rail) that should stay click-to-navigate
39
- * instead of feeding the document's tools.
40
- */
41
- interaction?: boolean;
42
- /**
43
- * With {@link interaction}: let drags over page GAPS pan regardless of the
44
- * active tool (and show a grab cursor there) — the gutter always pans; there
45
- * is nothing to draw/select outside a page. Default true.
46
- */
47
- panFallback?: boolean;
48
- /**
49
- * Ambient ZOOM gestures on this stage: ctrl/cmd+wheel and trackpad pinch
50
- * (Safari gesture events included). Default true. Turn OFF for follower
51
- * lenses with a fixed magnification — a thumbnail rail should scroll under
52
- * cmd+wheel, not zoom — so a zoom-wheel falls through to ordinary wheel
53
- * pan, and pinches are still swallowed (they never page-zoom the browser).
54
- */
55
- zoomGestures?: boolean;
56
- /** The stage lens to drive (default: the main StageToken). */
57
- token?: StageTokenProp;
58
- className?: string;
59
- style?: React.CSSProperties;
60
- }
61
- declare function Stage({ children, pageChrome, overlay, interaction, panFallback, zoomGestures, token, className, style }: StageProps): import("react/jsx-runtime").JSX.Element;
62
- declare function useStage(token?: StageTokenProp): StageCapability;
63
- declare function useZoom(token?: StageTokenProp): {
64
- zoom: number;
65
- /** Active zoom intent: 'automatic' | 'fit-page' | 'fit-width' | 'fit-all' | 'custom'. */
66
- mode: import("@embedpdf/core-stage").ZoomModeValue | "custom";
67
- zoomIn: () => void;
68
- zoomOut: () => void;
69
- fitWidth: () => void;
70
- fitPage: () => void;
71
- fitAll: () => void;
72
- automatic: () => void;
73
- zoomTo: (spec: import("@embedpdf/core-stage").ZoomSpec) => void;
74
- };
75
- declare function usePages(token?: StageTokenProp): {
76
- currentPage: number;
77
- pageCount: number;
78
- goToPage: (pageIndex: number, opts?: import("@embedpdf/plugin-stage").GoToOptions) => void;
79
- next: (opts?: import("@embedpdf/plugin-stage").GoToOptions) => void;
80
- prev: (opts?: import("@embedpdf/plugin-stage").GoToOptions) => void;
81
- reveal: (pageIndex: number, opts?: import("@embedpdf/plugin-stage").RevealOptions) => void;
82
- };
83
- declare function useLayout(token?: StageTokenProp): {
84
- flow: import("@embedpdf/plugin-stage").FlowMode;
85
- layout: import("@embedpdf/plugin-stage").LayoutKind;
86
- spread: import("@embedpdf/core-stage").SpreadMode;
87
- sizing: import("@embedpdf/core-stage").SizingMode;
88
- bounded: boolean;
89
- setFlow: (flow: import("@embedpdf/plugin-stage").FlowMode) => void;
90
- setLayout: (layout: import("@embedpdf/plugin-stage").LayoutKind) => void;
91
- setSpread: (spread: import("@embedpdf/core-stage").SpreadMode) => void;
92
- setSizing: (sizing: import("@embedpdf/core-stage").SizingMode) => void;
93
- setBounded: (bounded: boolean) => void;
94
- };
95
- /** The document's page list (with PDF labels) + the current item's pages — the
96
- * data for page thumbnails / worksheet-style page tabs. */
97
- declare function usePageList(token?: StageTokenProp): {
98
- pages: {
99
- index: number;
100
- pon: import("@embedpdf/core").PageObjectNumber;
101
- label: string | null;
102
- }[];
103
- currentItemPages: number[];
104
- };
105
- /**
106
- * All Stage settings + the batch `update`. This is the seam for "presets are a
107
- * customer concern": keep your own `Partial<StageSettings>` objects and apply them
108
- * with `update(preset)` (one anchor-preserving change).
109
- */
110
- declare function useStageSettings(token?: StageTokenProp): {
111
- settings: import("@embedpdf/plugin-stage").StageSettings;
112
- update: (patch: Partial<import("@embedpdf/plugin-stage").StageSettings>) => void;
113
- reset: () => void;
114
- };
115
- //#endregion
116
- export { Stage, StageProps, StageTokenProp, useLayout, usePageList, usePages, useStage, useStageSettings, useZoom };
117
- //# sourceMappingURL=stage.d.ts.map
3
+ export { Scrollbar, type ScrollbarAxis, type ScrollbarProps, Stage, StageProps, StageScope, type StageScopeProps, type StageTokenProp, useScrollMetrics, useStage, useStageEvent, useStageSettings, useStageState, useStageToken };