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