@stll/folio-react 0.6.0 → 0.8.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.
Files changed (30) hide show
  1. package/dist/{CommentsSidebar-_utmEkA9.js → CommentsSidebar-Byn5lyrt.js} +127 -130
  2. package/dist/{FindReplaceDialog-DLdBekSR.js → FindReplaceDialog-CqKK82nE.js} +23 -18
  3. package/dist/FootnotePropertiesDialog-CixRdIiT.js +822 -0
  4. package/dist/ImagePositionDialog-DNodkoI2.js +1065 -0
  5. package/dist/ImagePropertiesDialog-CLsDIUWb.js +613 -0
  6. package/dist/InsertSymbolDialog-DCFLmfzn.js +376 -0
  7. package/dist/PageSetupDialog-COkgeOQn.js +820 -0
  8. package/dist/TablePropertiesDialog-B_AGrPR8.js +434 -0
  9. package/dist/{TextContextMenu-CG0V37wi.js → TextContextMenu-Ci7-M4oU.js} +199 -79
  10. package/dist/compat/eigenpal.d.ts +1 -1
  11. package/dist/compat/eigenpal.js +89 -17
  12. package/dist/dialogChrome-BoGYPgeu.js +26 -0
  13. package/dist/{dialogs-CzvXYJyG.js → dialogs-Bj2PdycR.js} +608 -352
  14. package/dist/{dialogs-j7qyw17x.d.ts → dialogs-DK8OVUT_.d.ts} +13 -1
  15. package/dist/dialogs.d.ts +2 -2
  16. package/dist/dialogs.js +9 -8
  17. package/dist/editor.css +1 -1
  18. package/dist/folio-ui-BgDDRsUX.js +1013 -0
  19. package/dist/index.d.ts +5 -4
  20. package/dist/index.js +12 -11
  21. package/dist/{renderAsync-B7UJsZye.d.ts → renderAsync-BmxQE7iO.d.ts} +12 -3
  22. package/dist/{renderAsync-CwHTsxBN.js → renderAsync-BtWYvQMT.js} +5717 -3275
  23. package/dist/standalone.css +1 -1
  24. package/package.json +8 -6
  25. package/dist/FootnotePropertiesDialog-CUjq9c6H.js +0 -267
  26. package/dist/ImagePositionDialog-BMuO9rLT.js +0 -395
  27. package/dist/ImagePropertiesDialog-C8iEgdmN.js +0 -198
  28. package/dist/PageSetupDialog-BKsSMCGb.js +0 -312
  29. package/dist/TablePropertiesDialog-Dw8gvL78.js +0 -159
  30. package/dist/useFindReplace-BPBpMWS9.js +0 -842
@@ -0,0 +1,820 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-BBjsoOtd.js";
2
+ import { r as useFolioUI } from "./folio-ui-BgDDRsUX.js";
3
+ import { u as useCloseOnDialogOpenChange } from "./dialogChrome-BoGYPgeu.js";
4
+ import { c } from "react-compiler-runtime";
5
+ import { useEffect, useId, useState } from "react";
6
+ import { useTranslations } from "use-intl";
7
+ import { TWIPS_PER_INCH } from "@stll/folio-core/utils/units";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ //#region src/components/dialogs/PageSetupDialog.tsx
10
+ /**
11
+ * Page Setup Dialog
12
+ *
13
+ * Modal for editing page layout properties:
14
+ * - Page size (Letter, A4, Legal, etc.)
15
+ * - Orientation (portrait/landscape)
16
+ * - Margins (top, bottom, left, right) in inches
17
+ */
18
+ var PageSetupDialog_exports = /* @__PURE__ */ __exportAll({ PageSetupDialog: () => PageSetupDialog });
19
+ /** Common page sizes in twips (width x height in portrait orientation) */
20
+ const PAGE_SIZES = [
21
+ {
22
+ label: "Letter (8.5\" × 11\")",
23
+ width: 12240,
24
+ height: 15840
25
+ },
26
+ {
27
+ label: "A4 (8.27\" × 11.69\")",
28
+ width: 11906,
29
+ height: 16838
30
+ },
31
+ {
32
+ label: "Legal (8.5\" × 14\")",
33
+ width: 12240,
34
+ height: 20160
35
+ },
36
+ {
37
+ label: "A3 (11.69\" × 16.54\")",
38
+ width: 16838,
39
+ height: 23811
40
+ },
41
+ {
42
+ label: "A5 (5.83\" × 8.27\")",
43
+ width: 8391,
44
+ height: 11906
45
+ },
46
+ {
47
+ label: "B5 (6.93\" × 9.84\")",
48
+ width: 9979,
49
+ height: 14175
50
+ },
51
+ {
52
+ label: "Executive (7.25\" × 10.5\")",
53
+ width: 10440,
54
+ height: 15120
55
+ }
56
+ ];
57
+ function twipsToInches(twips) {
58
+ return Math.round(twips / TWIPS_PER_INCH * 100) / 100;
59
+ }
60
+ function inchesToTwips(inches) {
61
+ return Math.round(inches * TWIPS_PER_INCH);
62
+ }
63
+ /** Find matching page size preset, ignoring orientation */
64
+ function findPageSizeIndex(w, h) {
65
+ const pw = Math.min(w, h);
66
+ const ph = Math.max(w, h);
67
+ return PAGE_SIZES.findIndex((s) => Math.abs(s.width - pw) < 20 && Math.abs(s.height - ph) < 20);
68
+ }
69
+ const DEFAULT_WIDTH = 12240;
70
+ const DEFAULT_HEIGHT = 15840;
71
+ const DEFAULT_MARGIN = 1440;
72
+ function PageSetupDialog(t0) {
73
+ const $ = c(205);
74
+ const { isOpen, onClose, onApply, currentProps } = t0;
75
+ const { Root: Dialog, Portal: DialogPortal, Backdrop: DialogBackdrop, Popup: DialogPopup, Title: DialogTitle, Close: DialogClose } = useFolioUI().Dialog;
76
+ const handleOpenChange = useCloseOnDialogOpenChange(onClose);
77
+ const t = useTranslations("folio");
78
+ const id = useId();
79
+ const [pageWidth, setPageWidth] = useState(DEFAULT_WIDTH);
80
+ const [pageHeight, setPageHeight] = useState(DEFAULT_HEIGHT);
81
+ const [orientation, setOrientation] = useState("portrait");
82
+ const [marginTop, setMarginTop] = useState(DEFAULT_MARGIN);
83
+ const [marginBottom, setMarginBottom] = useState(DEFAULT_MARGIN);
84
+ const [marginLeft, setMarginLeft] = useState(DEFAULT_MARGIN);
85
+ const [marginRight, setMarginRight] = useState(DEFAULT_MARGIN);
86
+ let t1;
87
+ if ($[0] !== currentProps?.marginBottom || $[1] !== currentProps?.marginLeft || $[2] !== currentProps?.marginRight || $[3] !== currentProps?.marginTop || $[4] !== currentProps?.orientation || $[5] !== currentProps?.pageHeight || $[6] !== currentProps?.pageWidth || $[7] !== isOpen) {
88
+ t1 = () => {
89
+ if (!isOpen) return;
90
+ const w = currentProps?.pageWidth || DEFAULT_WIDTH;
91
+ const h = currentProps?.pageHeight || DEFAULT_HEIGHT;
92
+ const orient = currentProps?.orientation || (w > h ? "landscape" : "portrait");
93
+ setPageWidth(w);
94
+ setPageHeight(h);
95
+ setOrientation(orient);
96
+ setMarginTop(currentProps?.marginTop ?? DEFAULT_MARGIN);
97
+ setMarginBottom(currentProps?.marginBottom ?? DEFAULT_MARGIN);
98
+ setMarginLeft(currentProps?.marginLeft ?? DEFAULT_MARGIN);
99
+ setMarginRight(currentProps?.marginRight ?? DEFAULT_MARGIN);
100
+ };
101
+ $[0] = currentProps?.marginBottom;
102
+ $[1] = currentProps?.marginLeft;
103
+ $[2] = currentProps?.marginRight;
104
+ $[3] = currentProps?.marginTop;
105
+ $[4] = currentProps?.orientation;
106
+ $[5] = currentProps?.pageHeight;
107
+ $[6] = currentProps?.pageWidth;
108
+ $[7] = isOpen;
109
+ $[8] = t1;
110
+ } else t1 = $[8];
111
+ let t2;
112
+ if ($[9] !== currentProps || $[10] !== isOpen) {
113
+ t2 = [isOpen, currentProps];
114
+ $[9] = currentProps;
115
+ $[10] = isOpen;
116
+ $[11] = t2;
117
+ } else t2 = $[11];
118
+ useEffect(t1, t2);
119
+ let t3;
120
+ if ($[12] !== orientation) {
121
+ t3 = (index) => {
122
+ if (index < 0) return;
123
+ const size = PAGE_SIZES[index];
124
+ if (!size) return;
125
+ if (orientation === "landscape") {
126
+ setPageWidth(size.height);
127
+ setPageHeight(size.width);
128
+ } else {
129
+ setPageWidth(size.width);
130
+ setPageHeight(size.height);
131
+ }
132
+ };
133
+ $[12] = orientation;
134
+ $[13] = t3;
135
+ } else t3 = $[13];
136
+ const handlePageSizeChange = t3;
137
+ let t4;
138
+ if ($[14] !== orientation || $[15] !== pageHeight || $[16] !== pageWidth) {
139
+ t4 = (newOrientation) => {
140
+ if (newOrientation === orientation) return;
141
+ setOrientation(newOrientation);
142
+ setPageWidth(pageHeight);
143
+ setPageHeight(pageWidth);
144
+ };
145
+ $[14] = orientation;
146
+ $[15] = pageHeight;
147
+ $[16] = pageWidth;
148
+ $[17] = t4;
149
+ } else t4 = $[17];
150
+ const handleOrientationChange = t4;
151
+ let t5;
152
+ if ($[18] !== marginBottom || $[19] !== marginLeft || $[20] !== marginRight || $[21] !== marginTop || $[22] !== onApply || $[23] !== onClose || $[24] !== orientation || $[25] !== pageHeight || $[26] !== pageWidth) {
153
+ t5 = () => {
154
+ onApply({
155
+ pageWidth,
156
+ pageHeight,
157
+ orientation,
158
+ marginTop,
159
+ marginBottom,
160
+ marginLeft,
161
+ marginRight
162
+ });
163
+ onClose();
164
+ };
165
+ $[18] = marginBottom;
166
+ $[19] = marginLeft;
167
+ $[20] = marginRight;
168
+ $[21] = marginTop;
169
+ $[22] = onApply;
170
+ $[23] = onClose;
171
+ $[24] = orientation;
172
+ $[25] = pageHeight;
173
+ $[26] = pageWidth;
174
+ $[27] = t5;
175
+ } else t5 = $[27];
176
+ const handleApply = t5;
177
+ const sizeIndex = findPageSizeIndex(pageWidth, pageHeight);
178
+ const t6 = `${id}-ps-size`;
179
+ const t7 = `${id}-ps-orientation`;
180
+ const t8 = `${id}-ps-margin-top`;
181
+ const t9 = `${id}-ps-margin-bottom`;
182
+ const t10 = `${id}-ps-margin-left`;
183
+ const t11 = `${id}-ps-margin-right`;
184
+ let t12;
185
+ if ($[28] !== t10 || $[29] !== t11 || $[30] !== t6 || $[31] !== t7 || $[32] !== t8 || $[33] !== t9) {
186
+ t12 = {
187
+ size: t6,
188
+ orientation: t7,
189
+ marginTop: t8,
190
+ marginBottom: t9,
191
+ marginLeft: t10,
192
+ marginRight: t11
193
+ };
194
+ $[28] = t10;
195
+ $[29] = t11;
196
+ $[30] = t6;
197
+ $[31] = t7;
198
+ $[32] = t8;
199
+ $[33] = t9;
200
+ $[34] = t12;
201
+ } else t12 = $[34];
202
+ const fieldIds = t12;
203
+ let t13;
204
+ if ($[35] !== DialogBackdrop) {
205
+ t13 = /* @__PURE__ */ jsx(DialogBackdrop, { className: "fixed inset-0 z-[10000] bg-black/50" });
206
+ $[35] = DialogBackdrop;
207
+ $[36] = t13;
208
+ } else t13 = $[36];
209
+ let t14;
210
+ if ($[37] !== t) {
211
+ t14 = t("dialogs.pageSetup.title");
212
+ $[37] = t;
213
+ $[38] = t14;
214
+ } else t14 = $[38];
215
+ let t15;
216
+ if ($[39] !== DialogTitle || $[40] !== t14) {
217
+ t15 = /* @__PURE__ */ jsx(DialogTitle, {
218
+ className: "border-b px-5 py-3 text-base font-semibold",
219
+ children: t14
220
+ });
221
+ $[39] = DialogTitle;
222
+ $[40] = t14;
223
+ $[41] = t15;
224
+ } else t15 = $[41];
225
+ let t16;
226
+ if ($[42] !== t) {
227
+ t16 = t("dialogs.pageSetup.pageSize");
228
+ $[42] = t;
229
+ $[43] = t16;
230
+ } else t16 = $[43];
231
+ let t17;
232
+ if ($[44] !== t16) {
233
+ t17 = /* @__PURE__ */ jsx("div", {
234
+ className: "text-muted-foreground text-xs font-semibold uppercase tracking-wide",
235
+ children: t16
236
+ });
237
+ $[44] = t16;
238
+ $[45] = t17;
239
+ } else t17 = $[45];
240
+ const t18 = fieldIds.size;
241
+ let t19;
242
+ if ($[46] !== t) {
243
+ t19 = t("dialogs.pageSetup.sizeLabel");
244
+ $[46] = t;
245
+ $[47] = t19;
246
+ } else t19 = $[47];
247
+ let t20;
248
+ if ($[48] !== fieldIds.size || $[49] !== t19) {
249
+ t20 = /* @__PURE__ */ jsx("label", {
250
+ htmlFor: t18,
251
+ className: "w-20 text-muted-foreground text-[13px]",
252
+ children: t19
253
+ });
254
+ $[48] = fieldIds.size;
255
+ $[49] = t19;
256
+ $[50] = t20;
257
+ } else t20 = $[50];
258
+ const t21 = fieldIds.size;
259
+ let t22;
260
+ if ($[51] !== handlePageSizeChange) {
261
+ t22 = (e) => handlePageSizeChange(Number(e.target.value));
262
+ $[51] = handlePageSizeChange;
263
+ $[52] = t22;
264
+ } else t22 = $[52];
265
+ let t23;
266
+ if ($[53] === Symbol.for("react.memo_cache_sentinel")) {
267
+ t23 = PAGE_SIZES.map(_temp);
268
+ $[53] = t23;
269
+ } else t23 = $[53];
270
+ let t24;
271
+ if ($[54] !== sizeIndex || $[55] !== t) {
272
+ t24 = sizeIndex < 0 && /* @__PURE__ */ jsx("option", {
273
+ value: -1,
274
+ children: t("dialogs.pageSetup.custom")
275
+ });
276
+ $[54] = sizeIndex;
277
+ $[55] = t;
278
+ $[56] = t24;
279
+ } else t24 = $[56];
280
+ let t25;
281
+ if ($[57] !== fieldIds.size || $[58] !== sizeIndex || $[59] !== t22 || $[60] !== t24) {
282
+ t25 = /* @__PURE__ */ jsxs("select", {
283
+ id: t21,
284
+ className: "border-input bg-background text-foreground flex-1 rounded border px-2 py-1.5 text-[13px] outline-none",
285
+ value: sizeIndex,
286
+ onChange: t22,
287
+ children: [t23, t24]
288
+ });
289
+ $[57] = fieldIds.size;
290
+ $[58] = sizeIndex;
291
+ $[59] = t22;
292
+ $[60] = t24;
293
+ $[61] = t25;
294
+ } else t25 = $[61];
295
+ let t26;
296
+ if ($[62] !== t20 || $[63] !== t25) {
297
+ t26 = /* @__PURE__ */ jsxs("div", {
298
+ className: "flex items-center gap-3",
299
+ children: [t20, t25]
300
+ });
301
+ $[62] = t20;
302
+ $[63] = t25;
303
+ $[64] = t26;
304
+ } else t26 = $[64];
305
+ const t27 = fieldIds.orientation;
306
+ let t28;
307
+ if ($[65] !== t) {
308
+ t28 = t("dialogs.pageSetup.orientation");
309
+ $[65] = t;
310
+ $[66] = t28;
311
+ } else t28 = $[66];
312
+ let t29;
313
+ if ($[67] !== fieldIds.orientation || $[68] !== t28) {
314
+ t29 = /* @__PURE__ */ jsx("label", {
315
+ htmlFor: t27,
316
+ className: "w-20 text-muted-foreground text-[13px]",
317
+ children: t28
318
+ });
319
+ $[67] = fieldIds.orientation;
320
+ $[68] = t28;
321
+ $[69] = t29;
322
+ } else t29 = $[69];
323
+ const t30 = fieldIds.orientation;
324
+ let t31;
325
+ if ($[70] !== handleOrientationChange) {
326
+ t31 = (e_0) => handleOrientationChange(e_0.target.value);
327
+ $[70] = handleOrientationChange;
328
+ $[71] = t31;
329
+ } else t31 = $[71];
330
+ let t32;
331
+ if ($[72] !== t) {
332
+ t32 = t("dialogs.pageSetup.portrait");
333
+ $[72] = t;
334
+ $[73] = t32;
335
+ } else t32 = $[73];
336
+ let t33;
337
+ if ($[74] !== t32) {
338
+ t33 = /* @__PURE__ */ jsx("option", {
339
+ value: "portrait",
340
+ children: t32
341
+ });
342
+ $[74] = t32;
343
+ $[75] = t33;
344
+ } else t33 = $[75];
345
+ let t34;
346
+ if ($[76] !== t) {
347
+ t34 = t("dialogs.pageSetup.landscape");
348
+ $[76] = t;
349
+ $[77] = t34;
350
+ } else t34 = $[77];
351
+ let t35;
352
+ if ($[78] !== t34) {
353
+ t35 = /* @__PURE__ */ jsx("option", {
354
+ value: "landscape",
355
+ children: t34
356
+ });
357
+ $[78] = t34;
358
+ $[79] = t35;
359
+ } else t35 = $[79];
360
+ let t36;
361
+ if ($[80] !== fieldIds.orientation || $[81] !== orientation || $[82] !== t31 || $[83] !== t33 || $[84] !== t35) {
362
+ t36 = /* @__PURE__ */ jsxs("select", {
363
+ id: t30,
364
+ className: "border-input bg-background text-foreground flex-1 rounded border px-2 py-1.5 text-[13px] outline-none",
365
+ value: orientation,
366
+ onChange: t31,
367
+ children: [t33, t35]
368
+ });
369
+ $[80] = fieldIds.orientation;
370
+ $[81] = orientation;
371
+ $[82] = t31;
372
+ $[83] = t33;
373
+ $[84] = t35;
374
+ $[85] = t36;
375
+ } else t36 = $[85];
376
+ let t37;
377
+ if ($[86] !== t29 || $[87] !== t36) {
378
+ t37 = /* @__PURE__ */ jsxs("div", {
379
+ className: "flex items-center gap-3",
380
+ children: [t29, t36]
381
+ });
382
+ $[86] = t29;
383
+ $[87] = t36;
384
+ $[88] = t37;
385
+ } else t37 = $[88];
386
+ let t38;
387
+ if ($[89] !== t) {
388
+ t38 = t("dialogs.pageSetup.margins");
389
+ $[89] = t;
390
+ $[90] = t38;
391
+ } else t38 = $[90];
392
+ let t39;
393
+ if ($[91] !== t38) {
394
+ t39 = /* @__PURE__ */ jsx("div", {
395
+ className: "text-muted-foreground text-xs font-semibold uppercase tracking-wide mt-1",
396
+ children: t38
397
+ });
398
+ $[91] = t38;
399
+ $[92] = t39;
400
+ } else t39 = $[92];
401
+ const t40 = fieldIds.marginTop;
402
+ let t41;
403
+ if ($[93] !== t) {
404
+ t41 = t("dialogs.pageSetup.top");
405
+ $[93] = t;
406
+ $[94] = t41;
407
+ } else t41 = $[94];
408
+ let t42;
409
+ if ($[95] !== fieldIds.marginTop || $[96] !== t41) {
410
+ t42 = /* @__PURE__ */ jsx("label", {
411
+ htmlFor: t40,
412
+ className: "w-20 text-muted-foreground text-[13px]",
413
+ children: t41
414
+ });
415
+ $[95] = fieldIds.marginTop;
416
+ $[96] = t41;
417
+ $[97] = t42;
418
+ } else t42 = $[97];
419
+ const t43 = fieldIds.marginTop;
420
+ let t44;
421
+ if ($[98] !== marginTop) {
422
+ t44 = twipsToInches(marginTop);
423
+ $[98] = marginTop;
424
+ $[99] = t44;
425
+ } else t44 = $[99];
426
+ let t45;
427
+ if ($[100] === Symbol.for("react.memo_cache_sentinel")) {
428
+ t45 = (e_1) => setMarginTop(inchesToTwips(Number(e_1.target.value) || 0));
429
+ $[100] = t45;
430
+ } else t45 = $[100];
431
+ let t46;
432
+ if ($[101] !== fieldIds.marginTop || $[102] !== t44) {
433
+ t46 = /* @__PURE__ */ jsx("input", {
434
+ id: t43,
435
+ type: "number",
436
+ className: "border-input bg-background text-foreground flex-1 rounded border px-2 py-1.5 text-[13px] outline-none",
437
+ min: 0,
438
+ max: 10,
439
+ step: .1,
440
+ value: t44,
441
+ onChange: t45
442
+ });
443
+ $[101] = fieldIds.marginTop;
444
+ $[102] = t44;
445
+ $[103] = t46;
446
+ } else t46 = $[103];
447
+ let t47;
448
+ if ($[104] !== t) {
449
+ t47 = t("dialogs.pageSetup.unitInches");
450
+ $[104] = t;
451
+ $[105] = t47;
452
+ } else t47 = $[105];
453
+ let t48;
454
+ if ($[106] !== t47) {
455
+ t48 = /* @__PURE__ */ jsx("span", {
456
+ className: "text-muted-foreground w-4 text-[11px]",
457
+ children: t47
458
+ });
459
+ $[106] = t47;
460
+ $[107] = t48;
461
+ } else t48 = $[107];
462
+ let t49;
463
+ if ($[108] !== t42 || $[109] !== t46 || $[110] !== t48) {
464
+ t49 = /* @__PURE__ */ jsxs("div", {
465
+ className: "flex items-center gap-3",
466
+ children: [
467
+ t42,
468
+ t46,
469
+ t48
470
+ ]
471
+ });
472
+ $[108] = t42;
473
+ $[109] = t46;
474
+ $[110] = t48;
475
+ $[111] = t49;
476
+ } else t49 = $[111];
477
+ const t50 = fieldIds.marginBottom;
478
+ let t51;
479
+ if ($[112] !== t) {
480
+ t51 = t("dialogs.pageSetup.bottom");
481
+ $[112] = t;
482
+ $[113] = t51;
483
+ } else t51 = $[113];
484
+ let t52;
485
+ if ($[114] !== fieldIds.marginBottom || $[115] !== t51) {
486
+ t52 = /* @__PURE__ */ jsx("label", {
487
+ htmlFor: t50,
488
+ className: "w-20 text-muted-foreground text-[13px]",
489
+ children: t51
490
+ });
491
+ $[114] = fieldIds.marginBottom;
492
+ $[115] = t51;
493
+ $[116] = t52;
494
+ } else t52 = $[116];
495
+ const t53 = fieldIds.marginBottom;
496
+ let t54;
497
+ if ($[117] !== marginBottom) {
498
+ t54 = twipsToInches(marginBottom);
499
+ $[117] = marginBottom;
500
+ $[118] = t54;
501
+ } else t54 = $[118];
502
+ let t55;
503
+ if ($[119] === Symbol.for("react.memo_cache_sentinel")) {
504
+ t55 = (e_2) => setMarginBottom(inchesToTwips(Number(e_2.target.value) || 0));
505
+ $[119] = t55;
506
+ } else t55 = $[119];
507
+ let t56;
508
+ if ($[120] !== fieldIds.marginBottom || $[121] !== t54) {
509
+ t56 = /* @__PURE__ */ jsx("input", {
510
+ id: t53,
511
+ type: "number",
512
+ className: "border-input bg-background text-foreground flex-1 rounded border px-2 py-1.5 text-[13px] outline-none",
513
+ min: 0,
514
+ max: 10,
515
+ step: .1,
516
+ value: t54,
517
+ onChange: t55
518
+ });
519
+ $[120] = fieldIds.marginBottom;
520
+ $[121] = t54;
521
+ $[122] = t56;
522
+ } else t56 = $[122];
523
+ let t57;
524
+ if ($[123] !== t) {
525
+ t57 = t("dialogs.pageSetup.unitInches");
526
+ $[123] = t;
527
+ $[124] = t57;
528
+ } else t57 = $[124];
529
+ let t58;
530
+ if ($[125] !== t57) {
531
+ t58 = /* @__PURE__ */ jsx("span", {
532
+ className: "text-muted-foreground w-4 text-[11px]",
533
+ children: t57
534
+ });
535
+ $[125] = t57;
536
+ $[126] = t58;
537
+ } else t58 = $[126];
538
+ let t59;
539
+ if ($[127] !== t52 || $[128] !== t56 || $[129] !== t58) {
540
+ t59 = /* @__PURE__ */ jsxs("div", {
541
+ className: "flex items-center gap-3",
542
+ children: [
543
+ t52,
544
+ t56,
545
+ t58
546
+ ]
547
+ });
548
+ $[127] = t52;
549
+ $[128] = t56;
550
+ $[129] = t58;
551
+ $[130] = t59;
552
+ } else t59 = $[130];
553
+ const t60 = fieldIds.marginLeft;
554
+ let t61;
555
+ if ($[131] !== t) {
556
+ t61 = t("dialogs.pageSetup.left");
557
+ $[131] = t;
558
+ $[132] = t61;
559
+ } else t61 = $[132];
560
+ let t62;
561
+ if ($[133] !== fieldIds.marginLeft || $[134] !== t61) {
562
+ t62 = /* @__PURE__ */ jsx("label", {
563
+ htmlFor: t60,
564
+ className: "w-20 text-muted-foreground text-[13px]",
565
+ children: t61
566
+ });
567
+ $[133] = fieldIds.marginLeft;
568
+ $[134] = t61;
569
+ $[135] = t62;
570
+ } else t62 = $[135];
571
+ const t63 = fieldIds.marginLeft;
572
+ let t64;
573
+ if ($[136] !== marginLeft) {
574
+ t64 = twipsToInches(marginLeft);
575
+ $[136] = marginLeft;
576
+ $[137] = t64;
577
+ } else t64 = $[137];
578
+ let t65;
579
+ if ($[138] === Symbol.for("react.memo_cache_sentinel")) {
580
+ t65 = (e_3) => setMarginLeft(inchesToTwips(Number(e_3.target.value) || 0));
581
+ $[138] = t65;
582
+ } else t65 = $[138];
583
+ let t66;
584
+ if ($[139] !== fieldIds.marginLeft || $[140] !== t64) {
585
+ t66 = /* @__PURE__ */ jsx("input", {
586
+ id: t63,
587
+ type: "number",
588
+ className: "border-input bg-background text-foreground flex-1 rounded border px-2 py-1.5 text-[13px] outline-none",
589
+ min: 0,
590
+ max: 10,
591
+ step: .1,
592
+ value: t64,
593
+ onChange: t65
594
+ });
595
+ $[139] = fieldIds.marginLeft;
596
+ $[140] = t64;
597
+ $[141] = t66;
598
+ } else t66 = $[141];
599
+ let t67;
600
+ if ($[142] !== t) {
601
+ t67 = t("dialogs.pageSetup.unitInches");
602
+ $[142] = t;
603
+ $[143] = t67;
604
+ } else t67 = $[143];
605
+ let t68;
606
+ if ($[144] !== t67) {
607
+ t68 = /* @__PURE__ */ jsx("span", {
608
+ className: "text-muted-foreground w-4 text-[11px]",
609
+ children: t67
610
+ });
611
+ $[144] = t67;
612
+ $[145] = t68;
613
+ } else t68 = $[145];
614
+ let t69;
615
+ if ($[146] !== t62 || $[147] !== t66 || $[148] !== t68) {
616
+ t69 = /* @__PURE__ */ jsxs("div", {
617
+ className: "flex items-center gap-3",
618
+ children: [
619
+ t62,
620
+ t66,
621
+ t68
622
+ ]
623
+ });
624
+ $[146] = t62;
625
+ $[147] = t66;
626
+ $[148] = t68;
627
+ $[149] = t69;
628
+ } else t69 = $[149];
629
+ const t70 = fieldIds.marginRight;
630
+ let t71;
631
+ if ($[150] !== t) {
632
+ t71 = t("dialogs.pageSetup.right");
633
+ $[150] = t;
634
+ $[151] = t71;
635
+ } else t71 = $[151];
636
+ let t72;
637
+ if ($[152] !== fieldIds.marginRight || $[153] !== t71) {
638
+ t72 = /* @__PURE__ */ jsx("label", {
639
+ htmlFor: t70,
640
+ className: "w-20 text-muted-foreground text-[13px]",
641
+ children: t71
642
+ });
643
+ $[152] = fieldIds.marginRight;
644
+ $[153] = t71;
645
+ $[154] = t72;
646
+ } else t72 = $[154];
647
+ const t73 = fieldIds.marginRight;
648
+ let t74;
649
+ if ($[155] !== marginRight) {
650
+ t74 = twipsToInches(marginRight);
651
+ $[155] = marginRight;
652
+ $[156] = t74;
653
+ } else t74 = $[156];
654
+ let t75;
655
+ if ($[157] === Symbol.for("react.memo_cache_sentinel")) {
656
+ t75 = (e_4) => setMarginRight(inchesToTwips(Number(e_4.target.value) || 0));
657
+ $[157] = t75;
658
+ } else t75 = $[157];
659
+ let t76;
660
+ if ($[158] !== fieldIds.marginRight || $[159] !== t74) {
661
+ t76 = /* @__PURE__ */ jsx("input", {
662
+ id: t73,
663
+ type: "number",
664
+ className: "border-input bg-background text-foreground flex-1 rounded border px-2 py-1.5 text-[13px] outline-none",
665
+ min: 0,
666
+ max: 10,
667
+ step: .1,
668
+ value: t74,
669
+ onChange: t75
670
+ });
671
+ $[158] = fieldIds.marginRight;
672
+ $[159] = t74;
673
+ $[160] = t76;
674
+ } else t76 = $[160];
675
+ let t77;
676
+ if ($[161] !== t) {
677
+ t77 = t("dialogs.pageSetup.unitInches");
678
+ $[161] = t;
679
+ $[162] = t77;
680
+ } else t77 = $[162];
681
+ let t78;
682
+ if ($[163] !== t77) {
683
+ t78 = /* @__PURE__ */ jsx("span", {
684
+ className: "text-muted-foreground w-4 text-[11px]",
685
+ children: t77
686
+ });
687
+ $[163] = t77;
688
+ $[164] = t78;
689
+ } else t78 = $[164];
690
+ let t79;
691
+ if ($[165] !== t72 || $[166] !== t76 || $[167] !== t78) {
692
+ t79 = /* @__PURE__ */ jsxs("div", {
693
+ className: "flex items-center gap-3",
694
+ children: [
695
+ t72,
696
+ t76,
697
+ t78
698
+ ]
699
+ });
700
+ $[165] = t72;
701
+ $[166] = t76;
702
+ $[167] = t78;
703
+ $[168] = t79;
704
+ } else t79 = $[168];
705
+ let t80;
706
+ if ($[169] !== t17 || $[170] !== t26 || $[171] !== t37 || $[172] !== t39 || $[173] !== t49 || $[174] !== t59 || $[175] !== t69 || $[176] !== t79) {
707
+ t80 = /* @__PURE__ */ jsxs("div", {
708
+ className: "flex flex-col gap-3.5 px-5 py-4",
709
+ children: [
710
+ t17,
711
+ t26,
712
+ t37,
713
+ t39,
714
+ t49,
715
+ t59,
716
+ t69,
717
+ t79
718
+ ]
719
+ });
720
+ $[169] = t17;
721
+ $[170] = t26;
722
+ $[171] = t37;
723
+ $[172] = t39;
724
+ $[173] = t49;
725
+ $[174] = t59;
726
+ $[175] = t69;
727
+ $[176] = t79;
728
+ $[177] = t80;
729
+ } else t80 = $[177];
730
+ let t81;
731
+ if ($[178] !== t) {
732
+ t81 = t("common.cancel");
733
+ $[178] = t;
734
+ $[179] = t81;
735
+ } else t81 = $[179];
736
+ let t82;
737
+ if ($[180] !== DialogClose || $[181] !== t81) {
738
+ t82 = /* @__PURE__ */ jsx(DialogClose, {
739
+ className: "border-input rounded border px-4 py-1.5 text-[13px]",
740
+ children: t81
741
+ });
742
+ $[180] = DialogClose;
743
+ $[181] = t81;
744
+ $[182] = t82;
745
+ } else t82 = $[182];
746
+ let t83;
747
+ if ($[183] !== t) {
748
+ t83 = t("common.apply");
749
+ $[183] = t;
750
+ $[184] = t83;
751
+ } else t83 = $[184];
752
+ let t84;
753
+ if ($[185] !== handleApply || $[186] !== t83) {
754
+ t84 = /* @__PURE__ */ jsx("button", {
755
+ className: "bg-primary text-primary-foreground rounded px-4 py-1.5 text-[13px] font-medium",
756
+ onClick: handleApply,
757
+ type: "button",
758
+ children: t83
759
+ });
760
+ $[185] = handleApply;
761
+ $[186] = t83;
762
+ $[187] = t84;
763
+ } else t84 = $[187];
764
+ let t85;
765
+ if ($[188] !== t82 || $[189] !== t84) {
766
+ t85 = /* @__PURE__ */ jsxs("div", {
767
+ className: "flex justify-end gap-2 border-t px-5 py-3",
768
+ children: [t82, t84]
769
+ });
770
+ $[188] = t82;
771
+ $[189] = t84;
772
+ $[190] = t85;
773
+ } else t85 = $[190];
774
+ let t86;
775
+ if ($[191] !== DialogPopup || $[192] !== t15 || $[193] !== t80 || $[194] !== t85) {
776
+ t86 = /* @__PURE__ */ jsxs(DialogPopup, {
777
+ className: "bg-popover fixed start-1/2 top-1/2 z-[10001] w-full max-w-[480px] min-w-[400px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-xl",
778
+ children: [
779
+ t15,
780
+ t80,
781
+ t85
782
+ ]
783
+ });
784
+ $[191] = DialogPopup;
785
+ $[192] = t15;
786
+ $[193] = t80;
787
+ $[194] = t85;
788
+ $[195] = t86;
789
+ } else t86 = $[195];
790
+ let t87;
791
+ if ($[196] !== DialogPortal || $[197] !== t13 || $[198] !== t86) {
792
+ t87 = /* @__PURE__ */ jsxs(DialogPortal, { children: [t13, t86] });
793
+ $[196] = DialogPortal;
794
+ $[197] = t13;
795
+ $[198] = t86;
796
+ $[199] = t87;
797
+ } else t87 = $[199];
798
+ let t88;
799
+ if ($[200] !== Dialog || $[201] !== handleOpenChange || $[202] !== isOpen || $[203] !== t87) {
800
+ t88 = /* @__PURE__ */ jsx(Dialog, {
801
+ open: isOpen,
802
+ onOpenChange: handleOpenChange,
803
+ children: t87
804
+ });
805
+ $[200] = Dialog;
806
+ $[201] = handleOpenChange;
807
+ $[202] = isOpen;
808
+ $[203] = t87;
809
+ $[204] = t88;
810
+ } else t88 = $[204];
811
+ return t88;
812
+ }
813
+ function _temp(size_0, i) {
814
+ return /* @__PURE__ */ jsx("option", {
815
+ value: i,
816
+ children: size_0.label
817
+ }, size_0.label);
818
+ }
819
+ //#endregion
820
+ export { PageSetupDialog_exports as n, PageSetupDialog as t };