@paprize/react 0.0.11 → 0.1.0

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.
@@ -1,430 +1,382 @@
1
- import { jsx as r, Fragment as p, jsxs as R } from "react/jsx-runtime";
2
- import { previewClassName as _, ReportBuilder as A, reportStyles as c, pageClassName as M, pageMargin as D, adjustPageSize as J, logger as V, sectionClassName as q, pageBreakAttributeName as G, layoutOptionsToAttributes as K } from "@paprize/core";
3
- import { createContext as I, useContext as g, useMemo as a, useEffect as d, useRef as u, Children as Q, isValidElement as U, useState as W, useSyncExternalStore as b } from "react";
4
- import { createPortal as X } from "react-dom";
5
- function le({ children: e }) {
6
- return /* @__PURE__ */ r("div", { className: _, children: e });
1
+ import { ReportBuilder as e, adjustPageSize as t, layoutOptionsToAttributes as n, logger as r, pageBreakAttributeName as i, pageClassName as a, pageMargin as o, previewClassName as s, reportStyles as c, sectionClassName as l } from "@paprize/core";
2
+ import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
3
+ import { Children as p, createContext as m, isValidElement as h, useContext as g, useEffect as _, useMemo as v, useRef as y, useState as b, useSyncExternalStore as x } from "react";
4
+ import { createPortal as S } from "react-dom";
5
+ //#region src/components/ReportPreview.tsx
6
+ function C({ children: e }) {
7
+ return /* @__PURE__ */ d("div", {
8
+ className: s,
9
+ children: e
10
+ });
7
11
  }
8
- const F = I(null);
9
- function m() {
10
- const e = g(F);
11
- if (!e)
12
- throw new Error(
13
- "ReportRoot is missing. Please wrap your component tree with ReportRoot component."
14
- );
15
- return e;
12
+ //#endregion
13
+ //#region src/internal/useReportBuilder.ts
14
+ var w = m(null);
15
+ function T() {
16
+ let e = g(w);
17
+ if (!e) throw Error("ReportRoot is missing. Please wrap your component tree with ReportRoot component.");
18
+ return e;
16
19
  }
17
- function de({ children: e }) {
18
- const t = a(() => new A(), []);
19
- return d(() => {
20
- t.schedulePagination();
21
- }, [t]), /* @__PURE__ */ r(F, { value: t, children: e });
20
+ //#endregion
21
+ //#region src/components/ReportRoot.tsx
22
+ function E({ children: t }) {
23
+ let n = v(() => new e(), []);
24
+ return _(() => {
25
+ n.schedulePagination();
26
+ }, [n]), /* @__PURE__ */ d(w, {
27
+ value: n,
28
+ children: t
29
+ });
22
30
  }
23
- function B({ children: e }) {
24
- const t = m(), o = u(!1);
25
- return d(() => {
26
- const n = t.monitor.addEventListener(
27
- "paginationCycleCompleted",
28
- () => {
29
- o.current = !0;
30
- }
31
- );
32
- return () => n();
33
- }, [t.monitor]), d(() => {
34
- o.current && t.schedulePagination();
35
- }, [e, t]), /* @__PURE__ */ r(p, { children: e });
31
+ //#endregion
32
+ //#region src/components/PageContent.tsx
33
+ function D({ children: e }) {
34
+ let t = T(), n = y(!1);
35
+ return _(() => {
36
+ let e = t.monitor.addEventListener("paginationCycleCompleted", () => {
37
+ n.current = !0;
38
+ });
39
+ return () => e();
40
+ }, [t.monitor]), _(() => {
41
+ n.current && t.schedulePagination();
42
+ }, [e, t]), /* @__PURE__ */ d(u, { children: e });
36
43
  }
37
- function H({ children: e }) {
38
- return /* @__PURE__ */ r(p, { children: e });
44
+ //#endregion
45
+ //#region src/components/PageFooter.tsx
46
+ function O({ children: e }) {
47
+ return /* @__PURE__ */ d(u, { children: e });
39
48
  }
49
+ //#endregion
50
+ //#region src/components/PageHeader.tsx
40
51
  function k({ children: e }) {
41
- return /* @__PURE__ */ r(p, { children: e });
52
+ return /* @__PURE__ */ d(u, { children: e });
42
53
  }
43
- function N({ children: e }) {
44
- return /* @__PURE__ */ r(p, { children: e });
54
+ //#endregion
55
+ //#region src/components/SectionFooter.tsx
56
+ function A({ children: e }) {
57
+ return /* @__PURE__ */ d(u, { children: e });
45
58
  }
46
- function z({ children: e }) {
47
- return /* @__PURE__ */ r(p, { children: e });
59
+ //#endregion
60
+ //#region src/components/SectionHeader.tsx
61
+ function j({ children: e }) {
62
+ return /* @__PURE__ */ d(u, { children: e });
48
63
  }
49
- function L({ children: e }) {
50
- return /* @__PURE__ */ r(p, { children: e });
64
+ //#endregion
65
+ //#region src/components/PageOverlay.tsx
66
+ function M({ children: e }) {
67
+ return /* @__PURE__ */ d(u, { children: e });
51
68
  }
52
- const w = [
53
- B,
54
- k,
55
- H,
56
- L,
57
- z,
58
- N
69
+ //#endregion
70
+ //#region src/internal/parseSectionChildren.ts
71
+ var N = [
72
+ D,
73
+ k,
74
+ O,
75
+ M,
76
+ j,
77
+ A
59
78
  ];
60
- function Y(e) {
61
- let t = null;
62
- const o = {};
63
- if (Q.forEach(e, (n) => {
64
- if (!U(n))
65
- throw new Error(
66
- `Invalid React element found in children: ${n}`,
67
- {
68
- cause: { child: n }
69
- }
70
- );
71
- const s = w.find((i) => i === n.type);
72
- if (!s)
73
- throw Error(
74
- `Component "${n.type}" is not valid as a child for Section, Expected one of: ${w.map((i) => i.name).join(",")}`
75
- );
76
- switch (s) {
77
- case z:
78
- o.sectionHeader = n;
79
- break;
80
- case N:
81
- o.sectionFooter = n;
82
- break;
83
- case B:
84
- t = n;
85
- break;
86
- case k:
87
- o.header = n;
88
- break;
89
- case H:
90
- o.footer = n;
91
- break;
92
- case L:
93
- o.overlay = n;
94
- break;
95
- }
96
- }), !t)
97
- throw Error("PageContent component is a required child for Section");
98
- return { ...o, content: t };
79
+ function P(e) {
80
+ let t = null, n = {};
81
+ if (p.forEach(e, (e) => {
82
+ if (!h(e)) throw Error(`Invalid React element found in children: ${e}`, { cause: { child: e } });
83
+ let r = N.find((t) => t === e.type);
84
+ if (!r) throw Error(`Component "${e.type}" is not valid as a child for Section, Expected one of: ${N.map((e) => e.name).join(",")}`);
85
+ switch (r) {
86
+ case j:
87
+ n.sectionHeader = e;
88
+ break;
89
+ case A:
90
+ n.sectionFooter = e;
91
+ break;
92
+ case D:
93
+ t = e;
94
+ break;
95
+ case k:
96
+ n.header = e;
97
+ break;
98
+ case O:
99
+ n.footer = e;
100
+ break;
101
+ case M:
102
+ n.overlay = e;
103
+ break;
104
+ }
105
+ }), !t) throw Error("PageContent component is a required child for Section");
106
+ return {
107
+ ...n,
108
+ content: t
109
+ };
99
110
  }
100
- const h = I(""), T = I({
101
- pageIndex: 0,
102
- totalPages: 0
111
+ //#endregion
112
+ //#region src/internal/SectionIdContext.ts
113
+ var F = m(""), I = m({
114
+ pageIndex: 0,
115
+ totalPages: 0
103
116
  });
104
- function E({
105
- elements: e,
106
- size: t,
107
- margin: o,
108
- pageIndex: n,
109
- totalPages: s,
110
- ref: i,
111
- sectionHeaderRef: x,
112
- sectionFooterRef: S,
113
- pageHeaderRef: P,
114
- pageFooterRef: y,
115
- contentRef: v
116
- }) {
117
- const f = g(h), C = a(
118
- () => ({ pageIndex: n, totalPages: s }),
119
- [n, s]
120
- );
121
- return /* @__PURE__ */ r(T, { value: C, children: /* @__PURE__ */ R(
122
- "div",
123
- {
124
- id: `${f}-${n}`,
125
- className: M,
126
- ref: i,
127
- style: c.page(t, o ?? D.None),
128
- children: [
129
- e.sectionHeader && n === 0 && /* @__PURE__ */ r("div", { style: c.component, ref: x, children: e.sectionHeader }),
130
- e.header && /* @__PURE__ */ r("div", { style: c.component, ref: P, children: e.header }),
131
- /* @__PURE__ */ r("div", { style: c.pageContent, ref: v, children: e.content }),
132
- e.overlay && /* @__PURE__ */ r("div", { style: c.overlay, children: e.overlay }),
133
- (e.footer || e.sectionFooter) && /* @__PURE__ */ R(
134
- "div",
135
- {
136
- style: { ...c.component, marginTop: "auto" },
137
- children: [
138
- e.footer && /* @__PURE__ */ r(
139
- "div",
140
- {
141
- style: c.component,
142
- ref: y,
143
- children: e.footer
144
- }
145
- ),
146
- e.sectionFooter && n === s - 1 && /* @__PURE__ */ r(
147
- "div",
148
- {
149
- style: c.component,
150
- ref: S,
151
- children: e.sectionFooter
152
- }
153
- )
154
- ]
155
- }
156
- )
157
- ]
158
- }
159
- ) });
117
+ //#endregion
118
+ //#region src/components/Page.tsx
119
+ function L({ elements: e, size: t, margin: n, pageIndex: r, totalPages: i, ref: s, sectionHeaderRef: l, sectionFooterRef: u, pageHeaderRef: p, pageFooterRef: m, contentRef: h }) {
120
+ let _ = g(F);
121
+ return /* @__PURE__ */ d(I, {
122
+ value: v(() => ({
123
+ pageIndex: r,
124
+ totalPages: i
125
+ }), [r, i]),
126
+ children: /* @__PURE__ */ f("div", {
127
+ id: `${_}-${r}`,
128
+ className: a,
129
+ ref: s,
130
+ style: c.page(t, n ?? o.None),
131
+ children: [
132
+ e.sectionHeader && r === 0 && /* @__PURE__ */ d("div", {
133
+ style: c.component,
134
+ ref: l,
135
+ children: e.sectionHeader
136
+ }),
137
+ e.header && /* @__PURE__ */ d("div", {
138
+ style: c.component,
139
+ ref: p,
140
+ children: e.header
141
+ }),
142
+ /* @__PURE__ */ d("div", {
143
+ style: c.pageContent,
144
+ ref: h,
145
+ children: e.content
146
+ }),
147
+ e.overlay && /* @__PURE__ */ d("div", {
148
+ style: c.overlay,
149
+ children: e.overlay
150
+ }),
151
+ (e.footer || e.sectionFooter) && /* @__PURE__ */ f("div", {
152
+ style: {
153
+ ...c.component,
154
+ marginTop: "auto"
155
+ },
156
+ children: [e.footer && /* @__PURE__ */ d("div", {
157
+ style: c.component,
158
+ ref: m,
159
+ children: e.footer
160
+ }), e.sectionFooter && r === i - 1 && /* @__PURE__ */ d("div", {
161
+ style: c.component,
162
+ ref: u,
163
+ children: e.sectionFooter
164
+ })]
165
+ })
166
+ ]
167
+ })
168
+ });
160
169
  }
161
- const $ = I({
162
- addPlugin: () => {
163
- throw new Error("addPlugin must be used within a Section");
164
- },
165
- addSuspense: () => {
166
- throw new Error("addSuspense must be used within a Section");
167
- }
170
+ //#endregion
171
+ //#region src/internal/SectionControllerContext.ts
172
+ var R = m({
173
+ addPlugin: () => {
174
+ throw Error("addPlugin must be used within a Section");
175
+ },
176
+ addSuspense: () => {
177
+ throw Error("addSuspense must be used within a Section");
178
+ }
168
179
  });
169
- function Z(e) {
170
- const t = a(
171
- () => ({
172
- plugins: e ?? [],
173
- suspense: []
174
- }),
175
- [e]
176
- ), o = a(
177
- () => ({
178
- addPlugin: (n) => {
179
- t.plugins.push(n);
180
- },
181
- addSuspense: (n) => {
182
- t.suspense.push(n);
183
- }
184
- }),
185
- [t]
186
- );
187
- return {
188
- controllerState: t,
189
- controllerValue: o
190
- };
180
+ //#endregion
181
+ //#region src/internal/useSectionControllerState.tsx
182
+ function z(e) {
183
+ let t = v(() => ({
184
+ plugins: e ?? [],
185
+ suspense: []
186
+ }), [e]);
187
+ return {
188
+ controllerState: t,
189
+ controllerValue: v(() => ({
190
+ addPlugin: (e) => {
191
+ t.plugins.push(e);
192
+ },
193
+ addSuspense: (e) => {
194
+ t.suspense.push(e);
195
+ }
196
+ }), [t])
197
+ };
191
198
  }
192
- function ee({ elements: e, options: t }) {
193
- const o = g(h), { controllerState: n, controllerValue: s } = Z(
194
- t?.plugins
195
- ), i = m(), x = u(null), S = u(null), P = u(null), y = u(null), v = u(null), f = u(null), C = a(
196
- () => J(t.size, t.orientation),
197
- [t.orientation, t.size]
198
- ), [j, O] = W(
199
- null
200
- );
201
- return d(() => {
202
- if (f.current)
203
- return i.tryAddSection(
204
- {
205
- ...t,
206
- id: o,
207
- plugins: n.plugins,
208
- suspense: n.suspense
209
- },
210
- {
211
- pageContent: f.current,
212
- sectionHeader: S.current,
213
- sectionFooter: P.current,
214
- pageFooter: v.current,
215
- pageHeader: y.current
216
- },
217
- (l) => {
218
- O(l.pages);
219
- }
220
- ).catch((l) => V.error(l)), () => {
221
- i.removeSection(o);
222
- };
223
- }, [
224
- n.plugins,
225
- n.suspense,
226
- t,
227
- i,
228
- o
229
- ]), /* @__PURE__ */ R($, { value: s, children: [
230
- j?.map((l) => /* @__PURE__ */ r(
231
- E,
232
- {
233
- elements: {
234
- ...e,
235
- content: /* @__PURE__ */ r(
236
- "div",
237
- {
238
- style: { display: "contents" },
239
- dangerouslySetInnerHTML: {
240
- __html: l.pageContentHtml
241
- }
242
- }
243
- )
244
- },
245
- size: C,
246
- margin: t.margin,
247
- pageIndex: l.pageIndex,
248
- totalPages: l.totalPages
249
- },
250
- l.pageIndex
251
- )),
252
- X(
253
- /* @__PURE__ */ r("div", { style: c.outOfScreen, children: /* @__PURE__ */ r(
254
- E,
255
- {
256
- elements: e,
257
- size: C,
258
- margin: t.margin,
259
- pageIndex: 0,
260
- totalPages: 1,
261
- ref: x,
262
- sectionHeaderRef: S,
263
- sectionFooterRef: P,
264
- pageHeaderRef: y,
265
- pageFooterRef: v,
266
- contentRef: f
267
- }
268
- ) }),
269
- document.body
270
- )
271
- ] });
199
+ //#endregion
200
+ //#region src/internal/SectionLayout.tsx
201
+ function B({ elements: e, options: n }) {
202
+ let i = g(F), { controllerState: a, controllerValue: o } = z(n?.plugins), s = T(), l = y(null), u = y(null), p = y(null), m = y(null), h = y(null), x = y(null), C = v(() => t(n.size, n.orientation), [n.orientation, n.size]), [w, E] = b(null);
203
+ return _(() => {
204
+ if (x.current) return s.tryAddSection({
205
+ ...n,
206
+ id: i,
207
+ plugins: a.plugins,
208
+ suspense: a.suspense
209
+ }, {
210
+ pageContent: x.current,
211
+ sectionHeader: u.current,
212
+ sectionFooter: p.current,
213
+ pageFooter: h.current,
214
+ pageHeader: m.current
215
+ }, (e) => {
216
+ E(e.pages);
217
+ }).catch((e) => r.error(e)), () => {
218
+ s.removeSection(i);
219
+ };
220
+ }, [
221
+ a.plugins,
222
+ a.suspense,
223
+ n,
224
+ s,
225
+ i
226
+ ]), /* @__PURE__ */ f(R, {
227
+ value: o,
228
+ children: [w?.map((t) => /* @__PURE__ */ d(L, {
229
+ elements: {
230
+ ...e,
231
+ content: /* @__PURE__ */ d("div", {
232
+ style: { display: "contents" },
233
+ dangerouslySetInnerHTML: { __html: t.pageContentHtml }
234
+ })
235
+ },
236
+ size: C,
237
+ margin: n.margin,
238
+ pageIndex: t.pageIndex,
239
+ totalPages: t.totalPages
240
+ }, t.pageIndex)), S(/* @__PURE__ */ d("div", {
241
+ style: c.outOfScreen,
242
+ children: /* @__PURE__ */ d(L, {
243
+ elements: e,
244
+ size: C,
245
+ margin: n.margin,
246
+ pageIndex: 0,
247
+ totalPages: 1,
248
+ ref: l,
249
+ sectionHeaderRef: u,
250
+ sectionFooterRef: p,
251
+ pageHeaderRef: m,
252
+ pageFooterRef: h,
253
+ contentRef: x
254
+ })
255
+ }), document.body)]
256
+ });
272
257
  }
273
- let te = 1;
274
- function pe({ children: e, id: t, ...o }) {
275
- const n = a(() => t ?? `__000${te++}`, [t]), s = a(() => Y(e), [e]), i = a(
276
- () => ({
277
- ...o,
278
- id: n
279
- }),
280
- [o, n]
281
- );
282
- return /* @__PURE__ */ r(
283
- "section",
284
- {
285
- className: q,
286
- id: n,
287
- style: c.section(n),
288
- children: /* @__PURE__ */ r(h, { value: n, children: /* @__PURE__ */ r(ee, { elements: s, options: i }) })
289
- }
290
- );
258
+ //#endregion
259
+ //#region src/components/Section.tsx
260
+ var V = 1;
261
+ function H({ children: e, id: t, ...n }) {
262
+ let r = v(() => t ?? `__000${V++}`, [t]), i = v(() => P(e), [e]), a = v(() => ({
263
+ ...n,
264
+ id: r
265
+ }), [n, r]);
266
+ return /* @__PURE__ */ d("section", {
267
+ className: l,
268
+ id: r,
269
+ style: c.section(r),
270
+ children: /* @__PURE__ */ d(F, {
271
+ value: r,
272
+ children: /* @__PURE__ */ d(B, {
273
+ elements: i,
274
+ options: a
275
+ })
276
+ })
277
+ });
291
278
  }
292
- function ge() {
293
- return /* @__PURE__ */ r("span", { [G]: "true" });
279
+ //#endregion
280
+ //#region src/components/PageBreak.tsx
281
+ function U() {
282
+ return /* @__PURE__ */ d("span", { [i]: "true" });
294
283
  }
295
- function fe({ children: e, ...t }) {
296
- return /* @__PURE__ */ r(
297
- "div",
298
- {
299
- style: { display: "contents" },
300
- ...K(t),
301
- children: e
302
- }
303
- );
284
+ //#endregion
285
+ //#region src/components/Layout.tsx
286
+ function W({ children: e, ...t }) {
287
+ return /* @__PURE__ */ d("div", {
288
+ style: { display: "contents" },
289
+ ...n(t),
290
+ children: e
291
+ });
304
292
  }
305
- const me = () => {
306
- const e = g(T);
307
- return {
308
- pageIndex: e.pageIndex,
309
- totalPages: e.totalPages
310
- };
311
- }, Se = () => {
312
- const e = g(h), t = m(), o = u({
313
- pages: [],
314
- isPaginated: !1,
315
- isSuspended: !1,
316
- sectionIndex: -1,
317
- sectionId: e
318
- }), n = b(
319
- (s) => t.monitor.addEventListener(
320
- "sectionCompleted",
321
- (i) => {
322
- i.sectionId === e && (o.current = i, s());
323
- }
324
- ),
325
- () => o.current
326
- );
327
- return {
328
- sectionId: e,
329
- sectionIndex: n.sectionIndex,
330
- isSuspended: n.isSuspended,
331
- isPaginated: n.isPaginated,
332
- pages: n.pages.map((s) => ({
333
- pageIndex: s.pageIndex,
334
- totalPages: s.totalPages
335
- }))
336
- };
293
+ //#endregion
294
+ //#region src/components/usePageInfo.ts
295
+ var G = () => {
296
+ let e = g(I);
297
+ return {
298
+ pageIndex: e.pageIndex,
299
+ totalPages: e.totalPages
300
+ };
301
+ }, K = () => {
302
+ let e = g(F), t = T(), n = y({
303
+ pages: [],
304
+ isPaginated: !1,
305
+ isSuspended: !1,
306
+ sectionIndex: -1,
307
+ sectionId: e
308
+ }), r = x((r) => t.monitor.addEventListener("sectionCompleted", (t) => {
309
+ t.sectionId === e && (n.current = t, r());
310
+ }), () => n.current);
311
+ return {
312
+ sectionId: e,
313
+ sectionIndex: r.sectionIndex,
314
+ isSuspended: r.isSuspended,
315
+ isPaginated: r.isPaginated,
316
+ pages: r.pages.map((e) => ({
317
+ pageIndex: e.pageIndex,
318
+ totalPages: e.totalPages
319
+ }))
320
+ };
337
321
  };
338
- function ne(e) {
339
- return {
340
- pageIndex: e.pageIndex,
341
- totalPages: e.totalPages
342
- };
322
+ //#endregion
323
+ //#region src/internal/eventHelper.ts
324
+ function q(e) {
325
+ return {
326
+ pageIndex: e.pageIndex,
327
+ totalPages: e.totalPages
328
+ };
343
329
  }
344
- function oe(e) {
345
- return {
346
- sectionId: e.sectionId,
347
- sectionIndex: e.sectionIndex,
348
- isPaginated: e.isPaginated,
349
- isSuspended: e.isSuspended,
350
- pages: e.pages.map(ne)
351
- };
330
+ function J(e) {
331
+ return {
332
+ sectionId: e.sectionId,
333
+ sectionIndex: e.sectionIndex,
334
+ isPaginated: e.isPaginated,
335
+ isSuspended: e.isSuspended,
336
+ pages: e.pages.map(q)
337
+ };
352
338
  }
353
- function re(e) {
354
- return {
355
- sections: e.sections.map(oe)
356
- };
339
+ function Y(e) {
340
+ return { sections: e.sections.map(J) };
357
341
  }
358
- function Pe() {
359
- const e = m(), t = u({
360
- sections: []
361
- }), o = b(
362
- (n) => e.monitor.addEventListener(
363
- "paginationCycleCompleted",
364
- (s) => {
365
- t.current = s, n();
366
- }
367
- ),
368
- () => t.current
369
- );
370
- return re(o);
342
+ //#endregion
343
+ //#region src/components/useReportInfo.ts
344
+ function X() {
345
+ let e = T(), t = y({ sections: [] });
346
+ return Y(x((n) => e.monitor.addEventListener("paginationCycleCompleted", (e) => {
347
+ t.current = e, n();
348
+ }), () => t.current));
371
349
  }
372
- function se(e) {
373
- const t = u(null), { addSuspense: o } = g($);
374
- return d(() => {
375
- if (t.current)
376
- return;
377
- const n = e ?? new Promise((s) => {
378
- t.current = s;
379
- });
380
- t.current ||= () => {
381
- }, o(n);
382
- }, [o, e]), a(
383
- () => ({
384
- reset: () => {
385
- t.current || o(
386
- new Promise((n) => {
387
- t.current = n;
388
- })
389
- );
390
- },
391
- release: () => {
392
- t.current?.(), t.current = null;
393
- }
394
- }),
395
- [o]
396
- );
350
+ //#endregion
351
+ //#region src/components/useSectionSuspension.ts
352
+ function Z(e) {
353
+ let t = y(null), { addSuspense: n } = g(R);
354
+ return _(() => {
355
+ if (t.current) return;
356
+ let r = e ?? new Promise((e) => {
357
+ t.current = e;
358
+ });
359
+ t.current ||= () => {}, n(r);
360
+ }, [n, e]), v(() => ({
361
+ reset: () => {
362
+ t.current || n(new Promise((e) => {
363
+ t.current = e;
364
+ }));
365
+ },
366
+ release: () => {
367
+ t.current?.(), t.current = null;
368
+ }
369
+ }), [n]);
397
370
  }
398
- function ye(e) {
399
- const t = m(), o = a(
400
- () => ({
401
- current: null
402
- }),
403
- []
404
- ), n = a(
405
- () => t.getJsonData(e),
406
- [e, t]
407
- );
408
- return se(n), d(() => {
409
- n.then((s) => o.current = s);
410
- }, [n, o]), o.current ?? e ?? null;
371
+ //#endregion
372
+ //#region src/components/useJsonData.ts
373
+ function Q(e) {
374
+ let t = T(), n = v(() => ({ current: null }), []), r = v(() => t.getJsonData(e), [e, t]);
375
+ return Z(r), _(() => {
376
+ r.then((e) => n.current = e);
377
+ }, [r, n]), n.current ?? e ?? null;
411
378
  }
412
- export {
413
- fe as Layout,
414
- ge as PageBreak,
415
- B as PageContent,
416
- H as PageFooter,
417
- k as PageHeader,
418
- L as PageOverlay,
419
- le as ReportPreview,
420
- de as ReportRoot,
421
- pe as Section,
422
- N as SectionFooter,
423
- z as SectionHeader,
424
- ye as useJsonData,
425
- me as usePageInfo,
426
- Pe as useReportInfo,
427
- Se as useSectionInfo,
428
- se as useSectionSuspension
429
- };
430
- //# sourceMappingURL=paprize-react.js.map
379
+ //#endregion
380
+ export { W as Layout, U as PageBreak, D as PageContent, O as PageFooter, k as PageHeader, M as PageOverlay, C as ReportPreview, E as ReportRoot, H as Section, A as SectionFooter, j as SectionHeader, Q as useJsonData, G as usePageInfo, X as useReportInfo, K as useSectionInfo, Z as useSectionSuspension };
381
+
382
+ //# sourceMappingURL=paprize-react.js.map