@stll/folio-react 0.15.4 → 0.15.6
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/dist/{CommentsSidebar-B5gSLzkb.js → CommentsSidebar-DgBwgBmQ.js} +1 -1
- package/dist/TablePropertiesDialog-BW4RRZLZ.js +462 -0
- package/dist/compat/eigenpal.js +1 -1
- package/dist/{dialogs-lCOx21mG.d.ts → dialogs-DZz6gVev.d.ts} +3 -13
- package/dist/dialogs.d.ts +1 -1
- package/dist/dialogs.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/{renderAsync-BZaGAQJ8.js → renderAsync-C8PNMI0-.js} +12 -9
- package/package.json +2 -2
- package/dist/TablePropertiesDialog-B_AGrPR8.js +0 -434
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as containedHandler } from "./renderAsync-
|
|
1
|
+
import { d as containedHandler } from "./renderAsync-C8PNMI0-.js";
|
|
2
2
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { CheckIcon, MoreVerticalIcon } from "lucide-react";
|
|
4
4
|
import { useLocale, useTranslations } from "use-intl";
|
|
@@ -0,0 +1,462 @@
|
|
|
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 { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/dialogs/TablePropertiesDialog.tsx
|
|
9
|
+
/**
|
|
10
|
+
* Table Properties Dialog — width type, width value, alignment.
|
|
11
|
+
*/
|
|
12
|
+
var TablePropertiesDialog_exports = /* @__PURE__ */ __exportAll({ TablePropertiesDialog: () => TablePropertiesDialog });
|
|
13
|
+
const editableWidthType = (value) => {
|
|
14
|
+
switch (value) {
|
|
15
|
+
case "dxa":
|
|
16
|
+
case "pct": return value;
|
|
17
|
+
default: return "auto";
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const editableJustification = (value) => {
|
|
21
|
+
switch (value) {
|
|
22
|
+
case "center":
|
|
23
|
+
case "right": return value;
|
|
24
|
+
default: return "left";
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
function TablePropertiesDialog(t0) {
|
|
28
|
+
const $ = c(119);
|
|
29
|
+
const { isOpen, onClose, onApply, currentProps } = t0;
|
|
30
|
+
const { Root: Dialog, Portal: DialogPortal, Backdrop: DialogBackdrop, Popup: DialogPopup, Title: DialogTitle, Close: DialogClose } = useFolioUI().Dialog;
|
|
31
|
+
const handleOpenChange = useCloseOnDialogOpenChange(onClose);
|
|
32
|
+
const t = useTranslations("folio");
|
|
33
|
+
const id = useId();
|
|
34
|
+
const [width, setWidth] = useState(currentProps?.width ?? 0);
|
|
35
|
+
const t1 = currentProps?.widthType ?? "auto";
|
|
36
|
+
let t2;
|
|
37
|
+
if ($[0] !== t1) {
|
|
38
|
+
t2 = editableWidthType(t1);
|
|
39
|
+
$[0] = t1;
|
|
40
|
+
$[1] = t2;
|
|
41
|
+
} else t2 = $[1];
|
|
42
|
+
const [widthType, setWidthType] = useState(t2);
|
|
43
|
+
const t3 = currentProps?.justification ?? "left";
|
|
44
|
+
let t4;
|
|
45
|
+
if ($[2] !== t3) {
|
|
46
|
+
t4 = editableJustification(t3);
|
|
47
|
+
$[2] = t3;
|
|
48
|
+
$[3] = t4;
|
|
49
|
+
} else t4 = $[3];
|
|
50
|
+
const [justification, setJustification] = useState(t4);
|
|
51
|
+
let t5;
|
|
52
|
+
if ($[4] !== currentProps?.justification || $[5] !== currentProps?.width || $[6] !== currentProps?.widthType || $[7] !== isOpen) {
|
|
53
|
+
t5 = () => {
|
|
54
|
+
if (isOpen) {
|
|
55
|
+
setWidth(currentProps?.width ?? 0);
|
|
56
|
+
setWidthType(editableWidthType(currentProps?.widthType ?? "auto"));
|
|
57
|
+
setJustification(editableJustification(currentProps?.justification ?? "left"));
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
$[4] = currentProps?.justification;
|
|
61
|
+
$[5] = currentProps?.width;
|
|
62
|
+
$[6] = currentProps?.widthType;
|
|
63
|
+
$[7] = isOpen;
|
|
64
|
+
$[8] = t5;
|
|
65
|
+
} else t5 = $[8];
|
|
66
|
+
let t6;
|
|
67
|
+
if ($[9] !== currentProps || $[10] !== isOpen) {
|
|
68
|
+
t6 = [isOpen, currentProps];
|
|
69
|
+
$[9] = currentProps;
|
|
70
|
+
$[10] = isOpen;
|
|
71
|
+
$[11] = t6;
|
|
72
|
+
} else t6 = $[11];
|
|
73
|
+
useEffect(t5, t6);
|
|
74
|
+
let t7;
|
|
75
|
+
if ($[12] !== justification || $[13] !== onApply || $[14] !== onClose || $[15] !== width || $[16] !== widthType) {
|
|
76
|
+
t7 = () => {
|
|
77
|
+
const props = { justification: justification === "left" || justification === "center" || justification === "right" ? justification : "left" };
|
|
78
|
+
if (widthType === "auto") {
|
|
79
|
+
props.width = null;
|
|
80
|
+
props.widthType = "auto";
|
|
81
|
+
} else {
|
|
82
|
+
props.width = width;
|
|
83
|
+
props.widthType = widthType;
|
|
84
|
+
}
|
|
85
|
+
onApply(props);
|
|
86
|
+
onClose();
|
|
87
|
+
};
|
|
88
|
+
$[12] = justification;
|
|
89
|
+
$[13] = onApply;
|
|
90
|
+
$[14] = onClose;
|
|
91
|
+
$[15] = width;
|
|
92
|
+
$[16] = widthType;
|
|
93
|
+
$[17] = t7;
|
|
94
|
+
} else t7 = $[17];
|
|
95
|
+
const handleApply = t7;
|
|
96
|
+
const t8 = `${id}-tp-width-type`;
|
|
97
|
+
const t9 = `${id}-tp-width`;
|
|
98
|
+
const t10 = `${id}-tp-align`;
|
|
99
|
+
let t11;
|
|
100
|
+
if ($[18] !== t10 || $[19] !== t8 || $[20] !== t9) {
|
|
101
|
+
t11 = {
|
|
102
|
+
widthType: t8,
|
|
103
|
+
width: t9,
|
|
104
|
+
align: t10
|
|
105
|
+
};
|
|
106
|
+
$[18] = t10;
|
|
107
|
+
$[19] = t8;
|
|
108
|
+
$[20] = t9;
|
|
109
|
+
$[21] = t11;
|
|
110
|
+
} else t11 = $[21];
|
|
111
|
+
const fieldIds = t11;
|
|
112
|
+
let t12;
|
|
113
|
+
if ($[22] !== DialogBackdrop) {
|
|
114
|
+
t12 = /* @__PURE__ */ jsx(DialogBackdrop, { className: "fixed inset-0 z-[10000] bg-black/50" });
|
|
115
|
+
$[22] = DialogBackdrop;
|
|
116
|
+
$[23] = t12;
|
|
117
|
+
} else t12 = $[23];
|
|
118
|
+
let t13;
|
|
119
|
+
if ($[24] !== t) {
|
|
120
|
+
t13 = t("dialogs.tableProperties.title");
|
|
121
|
+
$[24] = t;
|
|
122
|
+
$[25] = t13;
|
|
123
|
+
} else t13 = $[25];
|
|
124
|
+
let t14;
|
|
125
|
+
if ($[26] !== DialogTitle || $[27] !== t13) {
|
|
126
|
+
t14 = /* @__PURE__ */ jsx(DialogTitle, {
|
|
127
|
+
className: "border-b px-5 py-3 text-base font-semibold",
|
|
128
|
+
children: t13
|
|
129
|
+
});
|
|
130
|
+
$[26] = DialogTitle;
|
|
131
|
+
$[27] = t13;
|
|
132
|
+
$[28] = t14;
|
|
133
|
+
} else t14 = $[28];
|
|
134
|
+
const t15 = fieldIds.widthType;
|
|
135
|
+
let t16;
|
|
136
|
+
if ($[29] !== t) {
|
|
137
|
+
t16 = t("dialogs.tableProperties.widthType");
|
|
138
|
+
$[29] = t;
|
|
139
|
+
$[30] = t16;
|
|
140
|
+
} else t16 = $[30];
|
|
141
|
+
let t17;
|
|
142
|
+
if ($[31] !== fieldIds.widthType || $[32] !== t16) {
|
|
143
|
+
t17 = /* @__PURE__ */ jsx("label", {
|
|
144
|
+
className: "w-20 text-muted-foreground text-[13px]",
|
|
145
|
+
htmlFor: t15,
|
|
146
|
+
children: t16
|
|
147
|
+
});
|
|
148
|
+
$[31] = fieldIds.widthType;
|
|
149
|
+
$[32] = t16;
|
|
150
|
+
$[33] = t17;
|
|
151
|
+
} else t17 = $[33];
|
|
152
|
+
const t18 = fieldIds.widthType;
|
|
153
|
+
let t19;
|
|
154
|
+
if ($[34] === Symbol.for("react.memo_cache_sentinel")) {
|
|
155
|
+
t19 = (e) => setWidthType(editableWidthType(e.target.value));
|
|
156
|
+
$[34] = t19;
|
|
157
|
+
} else t19 = $[34];
|
|
158
|
+
let t20;
|
|
159
|
+
if ($[35] !== t) {
|
|
160
|
+
t20 = t("dialogs.tableProperties.widthTypes.auto");
|
|
161
|
+
$[35] = t;
|
|
162
|
+
$[36] = t20;
|
|
163
|
+
} else t20 = $[36];
|
|
164
|
+
let t21;
|
|
165
|
+
if ($[37] !== t20) {
|
|
166
|
+
t21 = /* @__PURE__ */ jsx("option", {
|
|
167
|
+
value: "auto",
|
|
168
|
+
children: t20
|
|
169
|
+
});
|
|
170
|
+
$[37] = t20;
|
|
171
|
+
$[38] = t21;
|
|
172
|
+
} else t21 = $[38];
|
|
173
|
+
let t22;
|
|
174
|
+
if ($[39] !== t) {
|
|
175
|
+
t22 = t("dialogs.tableProperties.widthTypes.fixed");
|
|
176
|
+
$[39] = t;
|
|
177
|
+
$[40] = t22;
|
|
178
|
+
} else t22 = $[40];
|
|
179
|
+
let t23;
|
|
180
|
+
if ($[41] !== t22) {
|
|
181
|
+
t23 = /* @__PURE__ */ jsx("option", {
|
|
182
|
+
value: "dxa",
|
|
183
|
+
children: t22
|
|
184
|
+
});
|
|
185
|
+
$[41] = t22;
|
|
186
|
+
$[42] = t23;
|
|
187
|
+
} else t23 = $[42];
|
|
188
|
+
let t24;
|
|
189
|
+
if ($[43] !== t) {
|
|
190
|
+
t24 = t("dialogs.tableProperties.widthTypes.percentage");
|
|
191
|
+
$[43] = t;
|
|
192
|
+
$[44] = t24;
|
|
193
|
+
} else t24 = $[44];
|
|
194
|
+
let t25;
|
|
195
|
+
if ($[45] !== t24) {
|
|
196
|
+
t25 = /* @__PURE__ */ jsx("option", {
|
|
197
|
+
value: "pct",
|
|
198
|
+
children: t24
|
|
199
|
+
});
|
|
200
|
+
$[45] = t24;
|
|
201
|
+
$[46] = t25;
|
|
202
|
+
} else t25 = $[46];
|
|
203
|
+
let t26;
|
|
204
|
+
if ($[47] !== fieldIds.widthType || $[48] !== t21 || $[49] !== t23 || $[50] !== t25 || $[51] !== widthType) {
|
|
205
|
+
t26 = /* @__PURE__ */ jsxs("select", {
|
|
206
|
+
className: "border-input bg-background text-foreground flex-1 rounded border px-2 py-1.5 text-[13px] outline-none",
|
|
207
|
+
id: t18,
|
|
208
|
+
onChange: t19,
|
|
209
|
+
value: widthType,
|
|
210
|
+
children: [
|
|
211
|
+
t21,
|
|
212
|
+
t23,
|
|
213
|
+
t25
|
|
214
|
+
]
|
|
215
|
+
});
|
|
216
|
+
$[47] = fieldIds.widthType;
|
|
217
|
+
$[48] = t21;
|
|
218
|
+
$[49] = t23;
|
|
219
|
+
$[50] = t25;
|
|
220
|
+
$[51] = widthType;
|
|
221
|
+
$[52] = t26;
|
|
222
|
+
} else t26 = $[52];
|
|
223
|
+
let t27;
|
|
224
|
+
if ($[53] !== t17 || $[54] !== t26) {
|
|
225
|
+
t27 = /* @__PURE__ */ jsxs("div", {
|
|
226
|
+
className: "flex items-center gap-3",
|
|
227
|
+
children: [t17, t26]
|
|
228
|
+
});
|
|
229
|
+
$[53] = t17;
|
|
230
|
+
$[54] = t26;
|
|
231
|
+
$[55] = t27;
|
|
232
|
+
} else t27 = $[55];
|
|
233
|
+
let t28;
|
|
234
|
+
if ($[56] !== fieldIds.width || $[57] !== t || $[58] !== width || $[59] !== widthType) {
|
|
235
|
+
t28 = widthType !== "auto" && /* @__PURE__ */ jsxs("div", {
|
|
236
|
+
className: "flex items-center gap-3",
|
|
237
|
+
children: [
|
|
238
|
+
/* @__PURE__ */ jsx("label", {
|
|
239
|
+
className: "w-20 text-muted-foreground text-[13px]",
|
|
240
|
+
htmlFor: fieldIds.width,
|
|
241
|
+
children: t("dialogs.tableProperties.widthLabel")
|
|
242
|
+
}),
|
|
243
|
+
/* @__PURE__ */ jsx("input", {
|
|
244
|
+
className: "border-input bg-background text-foreground flex-1 rounded border px-2 py-1.5 text-[13px] outline-none",
|
|
245
|
+
id: fieldIds.width,
|
|
246
|
+
min: 0,
|
|
247
|
+
onChange: (e_0) => setWidth(Number(e_0.target.value) || 0),
|
|
248
|
+
step: widthType === "pct" ? 5 : 100,
|
|
249
|
+
type: "number",
|
|
250
|
+
value: width
|
|
251
|
+
}),
|
|
252
|
+
/* @__PURE__ */ jsx("span", {
|
|
253
|
+
className: "text-muted-foreground text-[11px]",
|
|
254
|
+
children: widthType === "pct" ? t("dialogs.tableProperties.units.fiftiethsPercent") : t("dialogs.tableProperties.units.twips")
|
|
255
|
+
})
|
|
256
|
+
]
|
|
257
|
+
});
|
|
258
|
+
$[56] = fieldIds.width;
|
|
259
|
+
$[57] = t;
|
|
260
|
+
$[58] = width;
|
|
261
|
+
$[59] = widthType;
|
|
262
|
+
$[60] = t28;
|
|
263
|
+
} else t28 = $[60];
|
|
264
|
+
const t29 = fieldIds.align;
|
|
265
|
+
let t30;
|
|
266
|
+
if ($[61] !== t) {
|
|
267
|
+
t30 = t("dialogs.tableProperties.alignmentLabel");
|
|
268
|
+
$[61] = t;
|
|
269
|
+
$[62] = t30;
|
|
270
|
+
} else t30 = $[62];
|
|
271
|
+
let t31;
|
|
272
|
+
if ($[63] !== fieldIds.align || $[64] !== t30) {
|
|
273
|
+
t31 = /* @__PURE__ */ jsx("label", {
|
|
274
|
+
className: "w-20 text-muted-foreground text-[13px]",
|
|
275
|
+
htmlFor: t29,
|
|
276
|
+
children: t30
|
|
277
|
+
});
|
|
278
|
+
$[63] = fieldIds.align;
|
|
279
|
+
$[64] = t30;
|
|
280
|
+
$[65] = t31;
|
|
281
|
+
} else t31 = $[65];
|
|
282
|
+
const t32 = fieldIds.align;
|
|
283
|
+
let t33;
|
|
284
|
+
if ($[66] === Symbol.for("react.memo_cache_sentinel")) {
|
|
285
|
+
t33 = (e_1) => setJustification(editableJustification(e_1.target.value));
|
|
286
|
+
$[66] = t33;
|
|
287
|
+
} else t33 = $[66];
|
|
288
|
+
let t34;
|
|
289
|
+
if ($[67] !== t) {
|
|
290
|
+
t34 = t("dialogs.tableProperties.alignOptions.left");
|
|
291
|
+
$[67] = t;
|
|
292
|
+
$[68] = t34;
|
|
293
|
+
} else t34 = $[68];
|
|
294
|
+
let t35;
|
|
295
|
+
if ($[69] !== t34) {
|
|
296
|
+
t35 = /* @__PURE__ */ jsx("option", {
|
|
297
|
+
value: "left",
|
|
298
|
+
children: t34
|
|
299
|
+
});
|
|
300
|
+
$[69] = t34;
|
|
301
|
+
$[70] = t35;
|
|
302
|
+
} else t35 = $[70];
|
|
303
|
+
let t36;
|
|
304
|
+
if ($[71] !== t) {
|
|
305
|
+
t36 = t("dialogs.tableProperties.alignOptions.center");
|
|
306
|
+
$[71] = t;
|
|
307
|
+
$[72] = t36;
|
|
308
|
+
} else t36 = $[72];
|
|
309
|
+
let t37;
|
|
310
|
+
if ($[73] !== t36) {
|
|
311
|
+
t37 = /* @__PURE__ */ jsx("option", {
|
|
312
|
+
value: "center",
|
|
313
|
+
children: t36
|
|
314
|
+
});
|
|
315
|
+
$[73] = t36;
|
|
316
|
+
$[74] = t37;
|
|
317
|
+
} else t37 = $[74];
|
|
318
|
+
let t38;
|
|
319
|
+
if ($[75] !== t) {
|
|
320
|
+
t38 = t("dialogs.tableProperties.alignOptions.right");
|
|
321
|
+
$[75] = t;
|
|
322
|
+
$[76] = t38;
|
|
323
|
+
} else t38 = $[76];
|
|
324
|
+
let t39;
|
|
325
|
+
if ($[77] !== t38) {
|
|
326
|
+
t39 = /* @__PURE__ */ jsx("option", {
|
|
327
|
+
value: "right",
|
|
328
|
+
children: t38
|
|
329
|
+
});
|
|
330
|
+
$[77] = t38;
|
|
331
|
+
$[78] = t39;
|
|
332
|
+
} else t39 = $[78];
|
|
333
|
+
let t40;
|
|
334
|
+
if ($[79] !== fieldIds.align || $[80] !== justification || $[81] !== t35 || $[82] !== t37 || $[83] !== t39) {
|
|
335
|
+
t40 = /* @__PURE__ */ jsxs("select", {
|
|
336
|
+
className: "border-input bg-background text-foreground flex-1 rounded border px-2 py-1.5 text-[13px] outline-none",
|
|
337
|
+
id: t32,
|
|
338
|
+
onChange: t33,
|
|
339
|
+
value: justification,
|
|
340
|
+
children: [
|
|
341
|
+
t35,
|
|
342
|
+
t37,
|
|
343
|
+
t39
|
|
344
|
+
]
|
|
345
|
+
});
|
|
346
|
+
$[79] = fieldIds.align;
|
|
347
|
+
$[80] = justification;
|
|
348
|
+
$[81] = t35;
|
|
349
|
+
$[82] = t37;
|
|
350
|
+
$[83] = t39;
|
|
351
|
+
$[84] = t40;
|
|
352
|
+
} else t40 = $[84];
|
|
353
|
+
let t41;
|
|
354
|
+
if ($[85] !== t31 || $[86] !== t40) {
|
|
355
|
+
t41 = /* @__PURE__ */ jsxs("div", {
|
|
356
|
+
className: "flex items-center gap-3",
|
|
357
|
+
children: [t31, t40]
|
|
358
|
+
});
|
|
359
|
+
$[85] = t31;
|
|
360
|
+
$[86] = t40;
|
|
361
|
+
$[87] = t41;
|
|
362
|
+
} else t41 = $[87];
|
|
363
|
+
let t42;
|
|
364
|
+
if ($[88] !== t27 || $[89] !== t28 || $[90] !== t41) {
|
|
365
|
+
t42 = /* @__PURE__ */ jsxs("div", {
|
|
366
|
+
className: "flex flex-col gap-3 px-5 py-4",
|
|
367
|
+
children: [
|
|
368
|
+
t27,
|
|
369
|
+
t28,
|
|
370
|
+
t41
|
|
371
|
+
]
|
|
372
|
+
});
|
|
373
|
+
$[88] = t27;
|
|
374
|
+
$[89] = t28;
|
|
375
|
+
$[90] = t41;
|
|
376
|
+
$[91] = t42;
|
|
377
|
+
} else t42 = $[91];
|
|
378
|
+
let t43;
|
|
379
|
+
if ($[92] !== t) {
|
|
380
|
+
t43 = t("common.cancel");
|
|
381
|
+
$[92] = t;
|
|
382
|
+
$[93] = t43;
|
|
383
|
+
} else t43 = $[93];
|
|
384
|
+
let t44;
|
|
385
|
+
if ($[94] !== DialogClose || $[95] !== t43) {
|
|
386
|
+
t44 = /* @__PURE__ */ jsx(DialogClose, {
|
|
387
|
+
className: "border-input rounded border px-4 py-1.5 text-[13px]",
|
|
388
|
+
children: t43
|
|
389
|
+
});
|
|
390
|
+
$[94] = DialogClose;
|
|
391
|
+
$[95] = t43;
|
|
392
|
+
$[96] = t44;
|
|
393
|
+
} else t44 = $[96];
|
|
394
|
+
let t45;
|
|
395
|
+
if ($[97] !== t) {
|
|
396
|
+
t45 = t("common.apply");
|
|
397
|
+
$[97] = t;
|
|
398
|
+
$[98] = t45;
|
|
399
|
+
} else t45 = $[98];
|
|
400
|
+
let t46;
|
|
401
|
+
if ($[99] !== handleApply || $[100] !== t45) {
|
|
402
|
+
t46 = /* @__PURE__ */ jsx("button", {
|
|
403
|
+
className: "bg-primary text-primary-foreground rounded px-4 py-1.5 text-[13px] font-medium",
|
|
404
|
+
onClick: handleApply,
|
|
405
|
+
type: "button",
|
|
406
|
+
children: t45
|
|
407
|
+
});
|
|
408
|
+
$[99] = handleApply;
|
|
409
|
+
$[100] = t45;
|
|
410
|
+
$[101] = t46;
|
|
411
|
+
} else t46 = $[101];
|
|
412
|
+
let t47;
|
|
413
|
+
if ($[102] !== t44 || $[103] !== t46) {
|
|
414
|
+
t47 = /* @__PURE__ */ jsxs("div", {
|
|
415
|
+
className: "flex justify-end gap-2 border-t px-5 py-3",
|
|
416
|
+
children: [t44, t46]
|
|
417
|
+
});
|
|
418
|
+
$[102] = t44;
|
|
419
|
+
$[103] = t46;
|
|
420
|
+
$[104] = t47;
|
|
421
|
+
} else t47 = $[104];
|
|
422
|
+
let t48;
|
|
423
|
+
if ($[105] !== DialogPopup || $[106] !== t14 || $[107] !== t42 || $[108] !== t47) {
|
|
424
|
+
t48 = /* @__PURE__ */ jsxs(DialogPopup, {
|
|
425
|
+
className: "bg-popover fixed start-1/2 top-1/2 z-[10001] w-full max-w-[440px] min-w-[360px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-xl",
|
|
426
|
+
children: [
|
|
427
|
+
t14,
|
|
428
|
+
t42,
|
|
429
|
+
t47
|
|
430
|
+
]
|
|
431
|
+
});
|
|
432
|
+
$[105] = DialogPopup;
|
|
433
|
+
$[106] = t14;
|
|
434
|
+
$[107] = t42;
|
|
435
|
+
$[108] = t47;
|
|
436
|
+
$[109] = t48;
|
|
437
|
+
} else t48 = $[109];
|
|
438
|
+
let t49;
|
|
439
|
+
if ($[110] !== DialogPortal || $[111] !== t12 || $[112] !== t48) {
|
|
440
|
+
t49 = /* @__PURE__ */ jsxs(DialogPortal, { children: [t12, t48] });
|
|
441
|
+
$[110] = DialogPortal;
|
|
442
|
+
$[111] = t12;
|
|
443
|
+
$[112] = t48;
|
|
444
|
+
$[113] = t49;
|
|
445
|
+
} else t49 = $[113];
|
|
446
|
+
let t50;
|
|
447
|
+
if ($[114] !== Dialog || $[115] !== handleOpenChange || $[116] !== isOpen || $[117] !== t49) {
|
|
448
|
+
t50 = /* @__PURE__ */ jsx(Dialog, {
|
|
449
|
+
open: isOpen,
|
|
450
|
+
onOpenChange: handleOpenChange,
|
|
451
|
+
children: t49
|
|
452
|
+
});
|
|
453
|
+
$[114] = Dialog;
|
|
454
|
+
$[115] = handleOpenChange;
|
|
455
|
+
$[116] = isOpen;
|
|
456
|
+
$[117] = t49;
|
|
457
|
+
$[118] = t50;
|
|
458
|
+
} else t50 = $[118];
|
|
459
|
+
return t50;
|
|
460
|
+
}
|
|
461
|
+
//#endregion
|
|
462
|
+
export { TablePropertiesDialog_exports as n, TablePropertiesDialog as t };
|
package/dist/compat/eigenpal.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as DocxEditor$1, t as renderAsync } from "../renderAsync-
|
|
1
|
+
import { n as DocxEditor$1, t as renderAsync } from "../renderAsync-C8PNMI0-.js";
|
|
2
2
|
import { t as messages_exports } from "../messages.js";
|
|
3
3
|
import { c } from "react-compiler-runtime";
|
|
4
4
|
import { forwardRef } from "react";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { CSSProperties } from "react";
|
|
2
2
|
import { EndnoteProperties, FootnoteProperties, SectionProperties } from "@stll/folio-core/types/document";
|
|
3
|
+
import { TablePropertiesCommand } from "@stll/folio-core/utils/tableOperations";
|
|
3
4
|
import { FindMatch, FindOptions, FindResult } from "@stll/folio-core/utils/findReplace";
|
|
4
5
|
import { Watermark } from "@stll/folio-core/watermark";
|
|
5
6
|
//#region src/components/dialogs/FindReplaceDialog.d.ts
|
|
@@ -206,23 +207,12 @@ type SplitCellDialogProps = {
|
|
|
206
207
|
declare function SplitCellDialog({ isOpen, onClose, onSplit, defaultRows, defaultColumns }: SplitCellDialogProps): import("react").JSX.Element;
|
|
207
208
|
//#endregion
|
|
208
209
|
//#region src/components/dialogs/TablePropertiesDialog.d.ts
|
|
209
|
-
|
|
210
|
-
* Table Properties Dialog — width type, width value, alignment.
|
|
211
|
-
*/
|
|
212
|
-
type TableProperties = {
|
|
213
|
-
width?: number | null;
|
|
214
|
-
widthType?: string | null;
|
|
215
|
-
justification?: "left" | "center" | "right" | null;
|
|
216
|
-
};
|
|
210
|
+
type TableProperties = TablePropertiesCommand;
|
|
217
211
|
type TablePropertiesDialogProps = {
|
|
218
212
|
isOpen: boolean;
|
|
219
213
|
onClose: () => void;
|
|
220
214
|
onApply: (props: TableProperties) => void;
|
|
221
|
-
currentProps?:
|
|
222
|
-
width?: number;
|
|
223
|
-
widthType?: string;
|
|
224
|
-
justification?: string;
|
|
225
|
-
};
|
|
215
|
+
currentProps?: TableProperties;
|
|
226
216
|
};
|
|
227
217
|
declare function TablePropertiesDialog({ isOpen, onClose, onApply, currentProps }: TablePropertiesDialogProps): import("react").JSX.Element;
|
|
228
218
|
//#endregion
|
package/dist/dialogs.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as HyperlinkDialog, C as ImagePropertiesData, D as ImagePositionDialog, E as ImagePositionData, F as FindReplaceDialog, I as FindReplaceDialogProps, M as HyperlinkDialogProps, N as FootnotePropertiesDialog, O as ImagePositionDialogProps, P as FootnotePropertiesDialogProps, S as InsertImageDialogProps, T as ImagePropertiesDialogProps, _ as InsertTableStyleOption, a as TablePropertiesDialogProps, b as InsertImageDialog, c as SplitCellDialogProps, d as PasteSpecialMode, f as PageSetupDialog, g as InsertTableDialogProps, h as InsertTableDialogData, i as TablePropertiesDialog, j as HyperlinkDialogData, k as HyperlinkBookmarkOption, l as PasteSpecialDialog, m as InsertTableDialog, n as WatermarkDialogProps, o as SplitCellDialog, p as PageSetupDialogProps, r as TableProperties, s as SplitCellDialogData, t as WatermarkDialog, u as PasteSpecialDialogProps, v as InsertSymbolDialog, w as ImagePropertiesDialog, x as InsertImageDialogData, y as InsertSymbolDialogProps } from "./dialogs-
|
|
1
|
+
import { A as HyperlinkDialog, C as ImagePropertiesData, D as ImagePositionDialog, E as ImagePositionData, F as FindReplaceDialog, I as FindReplaceDialogProps, M as HyperlinkDialogProps, N as FootnotePropertiesDialog, O as ImagePositionDialogProps, P as FootnotePropertiesDialogProps, S as InsertImageDialogProps, T as ImagePropertiesDialogProps, _ as InsertTableStyleOption, a as TablePropertiesDialogProps, b as InsertImageDialog, c as SplitCellDialogProps, d as PasteSpecialMode, f as PageSetupDialog, g as InsertTableDialogProps, h as InsertTableDialogData, i as TablePropertiesDialog, j as HyperlinkDialogData, k as HyperlinkBookmarkOption, l as PasteSpecialDialog, m as InsertTableDialog, n as WatermarkDialogProps, o as SplitCellDialog, p as PageSetupDialogProps, r as TableProperties, s as SplitCellDialogData, t as WatermarkDialog, u as PasteSpecialDialogProps, v as InsertSymbolDialog, w as ImagePropertiesDialog, x as InsertImageDialogData, y as InsertSymbolDialogProps } from "./dialogs-DZz6gVev.js";
|
|
2
2
|
export { FindReplaceDialog, type FindReplaceDialogProps, FootnotePropertiesDialog, type FootnotePropertiesDialogProps, type HyperlinkBookmarkOption, HyperlinkDialog, type HyperlinkDialogData, type HyperlinkDialogProps, type ImagePositionData, ImagePositionDialog, type ImagePositionDialogProps, type ImagePropertiesData, ImagePropertiesDialog, type ImagePropertiesDialogProps, InsertImageDialog, type InsertImageDialogData, type InsertImageDialogProps, InsertSymbolDialog, type InsertSymbolDialogProps, InsertTableDialog, type InsertTableDialogData, type InsertTableDialogProps, type InsertTableStyleOption, PageSetupDialog, type PageSetupDialogProps, PasteSpecialDialog, type PasteSpecialDialogProps, type PasteSpecialMode, SplitCellDialog, type SplitCellDialogData, type SplitCellDialogProps, type TableProperties, TablePropertiesDialog, type TablePropertiesDialogProps, WatermarkDialog, type WatermarkDialogProps };
|
package/dist/dialogs.js
CHANGED
|
@@ -5,5 +5,5 @@ import { t as ImagePositionDialog } from "./ImagePositionDialog-DNodkoI2.js";
|
|
|
5
5
|
import { t as ImagePropertiesDialog } from "./ImagePropertiesDialog-CLsDIUWb.js";
|
|
6
6
|
import { t as InsertSymbolDialog } from "./InsertSymbolDialog-DCFLmfzn.js";
|
|
7
7
|
import { t as PageSetupDialog } from "./PageSetupDialog-COkgeOQn.js";
|
|
8
|
-
import { t as TablePropertiesDialog } from "./TablePropertiesDialog-
|
|
8
|
+
import { t as TablePropertiesDialog } from "./TablePropertiesDialog-BW4RRZLZ.js";
|
|
9
9
|
export { FindReplaceDialog, FootnotePropertiesDialog, HyperlinkDialog, ImagePositionDialog, ImagePropertiesDialog, InsertImageDialog, InsertSymbolDialog, InsertTableDialog, PageSetupDialog, PasteSpecialDialog, SplitCellDialog, TablePropertiesDialog, WatermarkDialog };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as FolioUIProvider, a as DocxEditorApplyDocumentOperationsOptions, c as DocxEditorRef, d as ToolbarProps, f as EditorMode, g as FolioUIComponents, h as FolioButtonProps, i as renderAsync, l as HighlightPassageOptions, m as ColorPreset, n as EditorHandle, o as DocxEditorCollaboration, p as FontOption, r as RenderAsyncOptions, s as DocxEditorProps, t as DocxEditorHandle, u as HighlightPassageResult, v as OutlineItem, y as FontDefinition } from "./renderAsync-DD_yAlp1.js";
|
|
2
|
-
import { A as HyperlinkDialog, C as ImagePropertiesData, D as ImagePositionDialog, E as ImagePositionData, F as FindReplaceDialog, I as FindReplaceDialogProps, M as HyperlinkDialogProps, N as FootnotePropertiesDialog, O as ImagePositionDialogProps, P as FootnotePropertiesDialogProps, S as InsertImageDialogProps, T as ImagePropertiesDialogProps, _ as InsertTableStyleOption, a as TablePropertiesDialogProps, b as InsertImageDialog, c as SplitCellDialogProps, d as PasteSpecialMode, f as PageSetupDialog, g as InsertTableDialogProps, h as InsertTableDialogData, i as TablePropertiesDialog, j as HyperlinkDialogData, k as HyperlinkBookmarkOption, l as PasteSpecialDialog, m as InsertTableDialog, n as WatermarkDialogProps, o as SplitCellDialog, p as PageSetupDialogProps, r as TableProperties, s as SplitCellDialogData, t as WatermarkDialog, u as PasteSpecialDialogProps, v as InsertSymbolDialog, w as ImagePropertiesDialog, x as InsertImageDialogData, y as InsertSymbolDialogProps } from "./dialogs-
|
|
2
|
+
import { A as HyperlinkDialog, C as ImagePropertiesData, D as ImagePositionDialog, E as ImagePositionData, F as FindReplaceDialog, I as FindReplaceDialogProps, M as HyperlinkDialogProps, N as FootnotePropertiesDialog, O as ImagePositionDialogProps, P as FootnotePropertiesDialogProps, S as InsertImageDialogProps, T as ImagePropertiesDialogProps, _ as InsertTableStyleOption, a as TablePropertiesDialogProps, b as InsertImageDialog, c as SplitCellDialogProps, d as PasteSpecialMode, f as PageSetupDialog, g as InsertTableDialogProps, h as InsertTableDialogData, i as TablePropertiesDialog, j as HyperlinkDialogData, k as HyperlinkBookmarkOption, l as PasteSpecialDialog, m as InsertTableDialog, n as WatermarkDialogProps, o as SplitCellDialog, p as PageSetupDialogProps, r as TableProperties, s as SplitCellDialogData, t as WatermarkDialog, u as PasteSpecialDialogProps, v as InsertSymbolDialog, w as ImagePropertiesDialog, x as InsertImageDialogData, y as InsertSymbolDialogProps } from "./dialogs-DZz6gVev.js";
|
|
3
3
|
import React, { CSSProperties, ReactNode, RefObject } from "react";
|
|
4
4
|
import { CreateEmptyDocumentOptions, createEmptyDocument } from "@stll/folio-core/utils/createDocument";
|
|
5
5
|
import { FolioAIBlock, FolioAIBlockAnchor, FolioAIBlockKind, FolioAIBlockPreviewRun, FolioAIComment, FolioAIEditAppliedOperation, FolioAIEditApplyMode, FolioAIEditApplyResult, FolioAIEditOperation, FolioAIEditReviewMeta, FolioAIEditSeverity, FolioAIEditSkipReason, FolioAIEditSkippedOperation, FolioAIEditSnapshot, FolioAISignatureParty, WordDiffSegment, applyFolioAIEditOperations, createFolioAIEditSnapshot, diffWordSegments, hashFolioAIBlockText, normalizeFolioAIBlockText } from "@stll/folio-core/ai-edits";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as formatZoom, c as FormattingBar, i as clampZoom, l as ZoomControl, n as DocxEditor, o as parseZoom, r as ZOOM_PRESETS, s as useWheelZoom, t as renderAsync, u as AutocompleteCaretOverlay } from "./renderAsync-
|
|
1
|
+
import { a as formatZoom, c as FormattingBar, i as clampZoom, l as ZoomControl, n as DocxEditor, o as parseZoom, r as ZOOM_PRESETS, s as useWheelZoom, t as renderAsync, u as AutocompleteCaretOverlay } from "./renderAsync-C8PNMI0-.js";
|
|
2
2
|
import { n as FolioUIProvider } from "./folio-ui-BgDDRsUX.js";
|
|
3
3
|
import { t as FindReplaceDialog } from "./FindReplaceDialog-CqKK82nE.js";
|
|
4
4
|
import { t as FootnotePropertiesDialog } from "./FootnotePropertiesDialog-CixRdIiT.js";
|
|
@@ -7,7 +7,7 @@ import { t as ImagePositionDialog } from "./ImagePositionDialog-DNodkoI2.js";
|
|
|
7
7
|
import { t as ImagePropertiesDialog } from "./ImagePropertiesDialog-CLsDIUWb.js";
|
|
8
8
|
import { t as InsertSymbolDialog } from "./InsertSymbolDialog-DCFLmfzn.js";
|
|
9
9
|
import { t as PageSetupDialog } from "./PageSetupDialog-COkgeOQn.js";
|
|
10
|
-
import { t as TablePropertiesDialog } from "./TablePropertiesDialog-
|
|
10
|
+
import { t as TablePropertiesDialog } from "./TablePropertiesDialog-BW4RRZLZ.js";
|
|
11
11
|
import { applyFolioAIEditOperations, createFolioAIEditSnapshot, diffWordSegments, hashFolioAIBlockText, normalizeFolioAIBlockText } from "@stll/folio-core/ai-edits";
|
|
12
12
|
import { insertImageFromFile, insertPageBreakInView, insertTableInView, insertTableOfContentsInView } from "@stll/folio-core/prosemirror";
|
|
13
13
|
import { createAICitationDecorationsPlugin, setAICitationsMeta, setActiveCitationMeta } from "@stll/folio-core/prosemirror/plugins/aiCitationDecorations";
|
|
@@ -24,6 +24,7 @@ import { resolveFindMatchRange } from "@stll/folio-core/prosemirror/findReplaceS
|
|
|
24
24
|
import { createAICitationDecorationsPlugin } from "@stll/folio-core/prosemirror/plugins/aiCitationDecorations";
|
|
25
25
|
import { AI_SUGGESTION_SEVERITY_CLASS, aiSuggestionDecorationsKey, createAISuggestionDecorationsPlugin } from "@stll/folio-core/prosemirror/plugins/aiSuggestionDecorations";
|
|
26
26
|
import { anonymizationDecorationsKey, createAnonymizationDecorationsPlugin, slugAnonymizationLabel } from "@stll/folio-core/prosemirror/plugins/anonymizationDecorations";
|
|
27
|
+
import { expectImageAttrs, expectTableAttrs, expectTableCellAttrs, mergeImageAttrs, mergeTableAttrs, mergeTableCellAttrs, mergeTableRowAttrs } from "@stll/folio-core/prosemirror/attrs";
|
|
27
28
|
import { autocompleteSuggestionKey, autocompleteSuggestionPlugin } from "@stll/folio-core/prosemirror/plugins/autocompleteSuggestion";
|
|
28
29
|
import { createSuggestionModePlugin, setSuggestionMode, suggestionModeKey } from "@stll/folio-core/prosemirror/plugins/suggestionMode";
|
|
29
30
|
import { createTemplateDirectivesPlugin, templateDirectivesKey } from "@stll/folio-core/prosemirror/plugins/templateDirectives";
|
|
@@ -76,7 +77,6 @@ import { resizeColumnPair } from "@stll/folio-core/paged-layout/tableColumnResiz
|
|
|
76
77
|
import { tableInsertButtonOffset } from "@stll/folio-core/paged-layout/tableInsertButtonGeometry";
|
|
77
78
|
import { getTransactionDirtyRange } from "@stll/folio-core/paged-layout/transactionDirtyRange";
|
|
78
79
|
import { findStartPosForParaId } from "@stll/folio-core/prosemirror/utils/findParagraphByParaId";
|
|
79
|
-
import { expectImageAttrs, expectTableAttrs, expectTableCellAttrs, mergeImageAttrs, mergeTableAttrs, mergeTableCellAttrs, mergeTableRowAttrs } from "@stll/folio-core/prosemirror/attrs";
|
|
80
80
|
import { buildEmbeddedFontFamilyMap, extractEmbeddedFonts } from "@stll/folio-core/fonts/embeddedFonts";
|
|
81
81
|
import { panic } from "better-result";
|
|
82
82
|
import { collectRemoteSelections, createHiddenEditorManager, createHiddenEditorState } from "@stll/folio-core/controller/hiddenEditorManager";
|
|
@@ -7931,7 +7931,7 @@ function _temp2$3(a, b) {
|
|
|
7931
7931
|
//#endregion
|
|
7932
7932
|
//#region src/components/DocxEditorDialogs.tsx
|
|
7933
7933
|
const FindReplaceDialog = lazy(() => import("./FindReplaceDialog-CqKK82nE.js").then((n) => n.n).then((m) => ({ default: m.FindReplaceDialog })));
|
|
7934
|
-
const TablePropertiesDialog = lazy(() => import("./TablePropertiesDialog-
|
|
7934
|
+
const TablePropertiesDialog = lazy(() => import("./TablePropertiesDialog-BW4RRZLZ.js").then((n) => n.n).then((m) => ({ default: m.TablePropertiesDialog })));
|
|
7935
7935
|
const ImagePositionDialog = lazy(() => import("./ImagePositionDialog-DNodkoI2.js").then((n) => n.n).then((m) => ({ default: m.ImagePositionDialog })));
|
|
7936
7936
|
const ImagePropertiesDialog = lazy(() => import("./ImagePropertiesDialog-CLsDIUWb.js").then((n) => n.n).then((m) => ({ default: m.ImagePropertiesDialog })));
|
|
7937
7937
|
const FootnotePropertiesDialog = lazy(() => import("./FootnotePropertiesDialog-CixRdIiT.js").then((n) => n.n).then((m) => ({ default: m.FootnotePropertiesDialog })));
|
|
@@ -12603,7 +12603,7 @@ function useFolioComments({ doc, autoOpenReviewSidebar, anchorPositions, editorC
|
|
|
12603
12603
|
* - Error boundary
|
|
12604
12604
|
* - Loading states
|
|
12605
12605
|
*/
|
|
12606
|
-
const CommentsSidebar = lazy(() => import("./CommentsSidebar-
|
|
12606
|
+
const CommentsSidebar = lazy(() => import("./CommentsSidebar-DgBwgBmQ.js").then((m) => ({ default: m.CommentsSidebar })));
|
|
12607
12607
|
const TextContextMenu = lazy(() => import("./TextContextMenu-Ci7-M4oU.js").then((m) => ({ default: m.TextContextMenu })));
|
|
12608
12608
|
const loadAttemptSelectiveSave = async () => {
|
|
12609
12609
|
const { attemptSelectiveSave } = await import("@stll/folio-core/docx/selectiveSave");
|
|
@@ -15022,12 +15022,15 @@ const DocxEditor = forwardRef(function DocxEditor({ documentBuffer, password, do
|
|
|
15022
15022
|
handleReplace,
|
|
15023
15023
|
handleReplaceAll
|
|
15024
15024
|
]);
|
|
15025
|
-
const tablePropertiesDialog = useMemo(() =>
|
|
15026
|
-
|
|
15027
|
-
|
|
15028
|
-
|
|
15029
|
-
|
|
15030
|
-
|
|
15025
|
+
const tablePropertiesDialog = useMemo(() => {
|
|
15026
|
+
const table = state.pmTableContext?.table;
|
|
15027
|
+
return {
|
|
15028
|
+
isOpen: tablePropsOpen,
|
|
15029
|
+
onClose: closeTableProperties,
|
|
15030
|
+
onApply: applyTableProperties,
|
|
15031
|
+
currentProps: table ? expectTableAttrs(table) : void 0
|
|
15032
|
+
};
|
|
15033
|
+
}, [
|
|
15031
15034
|
applyTableProperties,
|
|
15032
15035
|
closeTableProperties,
|
|
15033
15036
|
state.pmTableContext,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stll/folio-react",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.6",
|
|
4
4
|
"description": "React editor for folio: a Word-document (.docx) editor for the browser, built on @stll/folio-core and ProseMirror.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"document-editor",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@fontsource/noto-sans-arabic": "^5.2.7",
|
|
69
69
|
"@fontsource/source-sans-3": "^5.2.9",
|
|
70
70
|
"@fontsource/tinos": "^5.2.7",
|
|
71
|
-
"@stll/folio-core": "^0.
|
|
71
|
+
"@stll/folio-core": "^0.24.0",
|
|
72
72
|
"better-result": "3.0.1",
|
|
73
73
|
"lucide-react": "1.24.0",
|
|
74
74
|
"prosemirror-history": "^1.5.0",
|
|
@@ -1,434 +0,0 @@
|
|
|
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 { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
-
//#region src/components/dialogs/TablePropertiesDialog.tsx
|
|
9
|
-
/**
|
|
10
|
-
* Table Properties Dialog — width type, width value, alignment.
|
|
11
|
-
*/
|
|
12
|
-
var TablePropertiesDialog_exports = /* @__PURE__ */ __exportAll({ TablePropertiesDialog: () => TablePropertiesDialog });
|
|
13
|
-
function TablePropertiesDialog(t0) {
|
|
14
|
-
const $ = c(115);
|
|
15
|
-
const { isOpen, onClose, onApply, currentProps } = t0;
|
|
16
|
-
const { Root: Dialog, Portal: DialogPortal, Backdrop: DialogBackdrop, Popup: DialogPopup, Title: DialogTitle, Close: DialogClose } = useFolioUI().Dialog;
|
|
17
|
-
const handleOpenChange = useCloseOnDialogOpenChange(onClose);
|
|
18
|
-
const t = useTranslations("folio");
|
|
19
|
-
const id = useId();
|
|
20
|
-
const [width, setWidth] = useState(currentProps?.width ?? 0);
|
|
21
|
-
const [widthType, setWidthType] = useState(currentProps?.widthType ?? "auto");
|
|
22
|
-
const [justification, setJustification] = useState(currentProps?.justification ?? "left");
|
|
23
|
-
let t1;
|
|
24
|
-
if ($[0] !== currentProps?.justification || $[1] !== currentProps?.width || $[2] !== currentProps?.widthType || $[3] !== isOpen) {
|
|
25
|
-
t1 = () => {
|
|
26
|
-
if (isOpen) {
|
|
27
|
-
setWidth(currentProps?.width ?? 0);
|
|
28
|
-
setWidthType(currentProps?.widthType ?? "auto");
|
|
29
|
-
setJustification(currentProps?.justification ?? "left");
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
$[0] = currentProps?.justification;
|
|
33
|
-
$[1] = currentProps?.width;
|
|
34
|
-
$[2] = currentProps?.widthType;
|
|
35
|
-
$[3] = isOpen;
|
|
36
|
-
$[4] = t1;
|
|
37
|
-
} else t1 = $[4];
|
|
38
|
-
let t2;
|
|
39
|
-
if ($[5] !== currentProps || $[6] !== isOpen) {
|
|
40
|
-
t2 = [isOpen, currentProps];
|
|
41
|
-
$[5] = currentProps;
|
|
42
|
-
$[6] = isOpen;
|
|
43
|
-
$[7] = t2;
|
|
44
|
-
} else t2 = $[7];
|
|
45
|
-
useEffect(t1, t2);
|
|
46
|
-
let t3;
|
|
47
|
-
if ($[8] !== justification || $[9] !== onApply || $[10] !== onClose || $[11] !== width || $[12] !== widthType) {
|
|
48
|
-
t3 = () => {
|
|
49
|
-
const props = { justification: justification === "left" || justification === "center" || justification === "right" ? justification : "left" };
|
|
50
|
-
if (widthType === "auto") {
|
|
51
|
-
props.width = null;
|
|
52
|
-
props.widthType = "auto";
|
|
53
|
-
} else {
|
|
54
|
-
props.width = width;
|
|
55
|
-
props.widthType = widthType;
|
|
56
|
-
}
|
|
57
|
-
onApply(props);
|
|
58
|
-
onClose();
|
|
59
|
-
};
|
|
60
|
-
$[8] = justification;
|
|
61
|
-
$[9] = onApply;
|
|
62
|
-
$[10] = onClose;
|
|
63
|
-
$[11] = width;
|
|
64
|
-
$[12] = widthType;
|
|
65
|
-
$[13] = t3;
|
|
66
|
-
} else t3 = $[13];
|
|
67
|
-
const handleApply = t3;
|
|
68
|
-
const t4 = `${id}-tp-width-type`;
|
|
69
|
-
const t5 = `${id}-tp-width`;
|
|
70
|
-
const t6 = `${id}-tp-align`;
|
|
71
|
-
let t7;
|
|
72
|
-
if ($[14] !== t4 || $[15] !== t5 || $[16] !== t6) {
|
|
73
|
-
t7 = {
|
|
74
|
-
widthType: t4,
|
|
75
|
-
width: t5,
|
|
76
|
-
align: t6
|
|
77
|
-
};
|
|
78
|
-
$[14] = t4;
|
|
79
|
-
$[15] = t5;
|
|
80
|
-
$[16] = t6;
|
|
81
|
-
$[17] = t7;
|
|
82
|
-
} else t7 = $[17];
|
|
83
|
-
const fieldIds = t7;
|
|
84
|
-
let t8;
|
|
85
|
-
if ($[18] !== DialogBackdrop) {
|
|
86
|
-
t8 = /* @__PURE__ */ jsx(DialogBackdrop, { className: "fixed inset-0 z-[10000] bg-black/50" });
|
|
87
|
-
$[18] = DialogBackdrop;
|
|
88
|
-
$[19] = t8;
|
|
89
|
-
} else t8 = $[19];
|
|
90
|
-
let t9;
|
|
91
|
-
if ($[20] !== t) {
|
|
92
|
-
t9 = t("dialogs.tableProperties.title");
|
|
93
|
-
$[20] = t;
|
|
94
|
-
$[21] = t9;
|
|
95
|
-
} else t9 = $[21];
|
|
96
|
-
let t10;
|
|
97
|
-
if ($[22] !== DialogTitle || $[23] !== t9) {
|
|
98
|
-
t10 = /* @__PURE__ */ jsx(DialogTitle, {
|
|
99
|
-
className: "border-b px-5 py-3 text-base font-semibold",
|
|
100
|
-
children: t9
|
|
101
|
-
});
|
|
102
|
-
$[22] = DialogTitle;
|
|
103
|
-
$[23] = t9;
|
|
104
|
-
$[24] = t10;
|
|
105
|
-
} else t10 = $[24];
|
|
106
|
-
const t11 = fieldIds.widthType;
|
|
107
|
-
let t12;
|
|
108
|
-
if ($[25] !== t) {
|
|
109
|
-
t12 = t("dialogs.tableProperties.widthType");
|
|
110
|
-
$[25] = t;
|
|
111
|
-
$[26] = t12;
|
|
112
|
-
} else t12 = $[26];
|
|
113
|
-
let t13;
|
|
114
|
-
if ($[27] !== fieldIds.widthType || $[28] !== t12) {
|
|
115
|
-
t13 = /* @__PURE__ */ jsx("label", {
|
|
116
|
-
className: "w-20 text-muted-foreground text-[13px]",
|
|
117
|
-
htmlFor: t11,
|
|
118
|
-
children: t12
|
|
119
|
-
});
|
|
120
|
-
$[27] = fieldIds.widthType;
|
|
121
|
-
$[28] = t12;
|
|
122
|
-
$[29] = t13;
|
|
123
|
-
} else t13 = $[29];
|
|
124
|
-
const t14 = fieldIds.widthType;
|
|
125
|
-
let t15;
|
|
126
|
-
if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
|
|
127
|
-
t15 = (e) => setWidthType(e.target.value);
|
|
128
|
-
$[30] = t15;
|
|
129
|
-
} else t15 = $[30];
|
|
130
|
-
let t16;
|
|
131
|
-
if ($[31] !== t) {
|
|
132
|
-
t16 = t("dialogs.tableProperties.widthTypes.auto");
|
|
133
|
-
$[31] = t;
|
|
134
|
-
$[32] = t16;
|
|
135
|
-
} else t16 = $[32];
|
|
136
|
-
let t17;
|
|
137
|
-
if ($[33] !== t16) {
|
|
138
|
-
t17 = /* @__PURE__ */ jsx("option", {
|
|
139
|
-
value: "auto",
|
|
140
|
-
children: t16
|
|
141
|
-
});
|
|
142
|
-
$[33] = t16;
|
|
143
|
-
$[34] = t17;
|
|
144
|
-
} else t17 = $[34];
|
|
145
|
-
let t18;
|
|
146
|
-
if ($[35] !== t) {
|
|
147
|
-
t18 = t("dialogs.tableProperties.widthTypes.fixed");
|
|
148
|
-
$[35] = t;
|
|
149
|
-
$[36] = t18;
|
|
150
|
-
} else t18 = $[36];
|
|
151
|
-
let t19;
|
|
152
|
-
if ($[37] !== t18) {
|
|
153
|
-
t19 = /* @__PURE__ */ jsx("option", {
|
|
154
|
-
value: "dxa",
|
|
155
|
-
children: t18
|
|
156
|
-
});
|
|
157
|
-
$[37] = t18;
|
|
158
|
-
$[38] = t19;
|
|
159
|
-
} else t19 = $[38];
|
|
160
|
-
let t20;
|
|
161
|
-
if ($[39] !== t) {
|
|
162
|
-
t20 = t("dialogs.tableProperties.widthTypes.percentage");
|
|
163
|
-
$[39] = t;
|
|
164
|
-
$[40] = t20;
|
|
165
|
-
} else t20 = $[40];
|
|
166
|
-
let t21;
|
|
167
|
-
if ($[41] !== t20) {
|
|
168
|
-
t21 = /* @__PURE__ */ jsx("option", {
|
|
169
|
-
value: "pct",
|
|
170
|
-
children: t20
|
|
171
|
-
});
|
|
172
|
-
$[41] = t20;
|
|
173
|
-
$[42] = t21;
|
|
174
|
-
} else t21 = $[42];
|
|
175
|
-
let t22;
|
|
176
|
-
if ($[43] !== fieldIds.widthType || $[44] !== t17 || $[45] !== t19 || $[46] !== t21 || $[47] !== widthType) {
|
|
177
|
-
t22 = /* @__PURE__ */ jsxs("select", {
|
|
178
|
-
className: "border-input bg-background text-foreground flex-1 rounded border px-2 py-1.5 text-[13px] outline-none",
|
|
179
|
-
id: t14,
|
|
180
|
-
onChange: t15,
|
|
181
|
-
value: widthType,
|
|
182
|
-
children: [
|
|
183
|
-
t17,
|
|
184
|
-
t19,
|
|
185
|
-
t21
|
|
186
|
-
]
|
|
187
|
-
});
|
|
188
|
-
$[43] = fieldIds.widthType;
|
|
189
|
-
$[44] = t17;
|
|
190
|
-
$[45] = t19;
|
|
191
|
-
$[46] = t21;
|
|
192
|
-
$[47] = widthType;
|
|
193
|
-
$[48] = t22;
|
|
194
|
-
} else t22 = $[48];
|
|
195
|
-
let t23;
|
|
196
|
-
if ($[49] !== t13 || $[50] !== t22) {
|
|
197
|
-
t23 = /* @__PURE__ */ jsxs("div", {
|
|
198
|
-
className: "flex items-center gap-3",
|
|
199
|
-
children: [t13, t22]
|
|
200
|
-
});
|
|
201
|
-
$[49] = t13;
|
|
202
|
-
$[50] = t22;
|
|
203
|
-
$[51] = t23;
|
|
204
|
-
} else t23 = $[51];
|
|
205
|
-
let t24;
|
|
206
|
-
if ($[52] !== fieldIds.width || $[53] !== t || $[54] !== width || $[55] !== widthType) {
|
|
207
|
-
t24 = widthType !== "auto" && /* @__PURE__ */ jsxs("div", {
|
|
208
|
-
className: "flex items-center gap-3",
|
|
209
|
-
children: [
|
|
210
|
-
/* @__PURE__ */ jsx("label", {
|
|
211
|
-
className: "w-20 text-muted-foreground text-[13px]",
|
|
212
|
-
htmlFor: fieldIds.width,
|
|
213
|
-
children: t("dialogs.tableProperties.widthLabel")
|
|
214
|
-
}),
|
|
215
|
-
/* @__PURE__ */ jsx("input", {
|
|
216
|
-
className: "border-input bg-background text-foreground flex-1 rounded border px-2 py-1.5 text-[13px] outline-none",
|
|
217
|
-
id: fieldIds.width,
|
|
218
|
-
min: 0,
|
|
219
|
-
onChange: (e_0) => setWidth(Number(e_0.target.value) || 0),
|
|
220
|
-
step: widthType === "pct" ? 5 : 100,
|
|
221
|
-
type: "number",
|
|
222
|
-
value: width
|
|
223
|
-
}),
|
|
224
|
-
/* @__PURE__ */ jsx("span", {
|
|
225
|
-
className: "text-muted-foreground text-[11px]",
|
|
226
|
-
children: widthType === "pct" ? t("dialogs.tableProperties.units.fiftiethsPercent") : t("dialogs.tableProperties.units.twips")
|
|
227
|
-
})
|
|
228
|
-
]
|
|
229
|
-
});
|
|
230
|
-
$[52] = fieldIds.width;
|
|
231
|
-
$[53] = t;
|
|
232
|
-
$[54] = width;
|
|
233
|
-
$[55] = widthType;
|
|
234
|
-
$[56] = t24;
|
|
235
|
-
} else t24 = $[56];
|
|
236
|
-
const t25 = fieldIds.align;
|
|
237
|
-
let t26;
|
|
238
|
-
if ($[57] !== t) {
|
|
239
|
-
t26 = t("dialogs.tableProperties.alignmentLabel");
|
|
240
|
-
$[57] = t;
|
|
241
|
-
$[58] = t26;
|
|
242
|
-
} else t26 = $[58];
|
|
243
|
-
let t27;
|
|
244
|
-
if ($[59] !== fieldIds.align || $[60] !== t26) {
|
|
245
|
-
t27 = /* @__PURE__ */ jsx("label", {
|
|
246
|
-
className: "w-20 text-muted-foreground text-[13px]",
|
|
247
|
-
htmlFor: t25,
|
|
248
|
-
children: t26
|
|
249
|
-
});
|
|
250
|
-
$[59] = fieldIds.align;
|
|
251
|
-
$[60] = t26;
|
|
252
|
-
$[61] = t27;
|
|
253
|
-
} else t27 = $[61];
|
|
254
|
-
const t28 = fieldIds.align;
|
|
255
|
-
let t29;
|
|
256
|
-
if ($[62] === Symbol.for("react.memo_cache_sentinel")) {
|
|
257
|
-
t29 = (e_1) => setJustification(e_1.target.value);
|
|
258
|
-
$[62] = t29;
|
|
259
|
-
} else t29 = $[62];
|
|
260
|
-
let t30;
|
|
261
|
-
if ($[63] !== t) {
|
|
262
|
-
t30 = t("dialogs.tableProperties.alignOptions.left");
|
|
263
|
-
$[63] = t;
|
|
264
|
-
$[64] = t30;
|
|
265
|
-
} else t30 = $[64];
|
|
266
|
-
let t31;
|
|
267
|
-
if ($[65] !== t30) {
|
|
268
|
-
t31 = /* @__PURE__ */ jsx("option", {
|
|
269
|
-
value: "left",
|
|
270
|
-
children: t30
|
|
271
|
-
});
|
|
272
|
-
$[65] = t30;
|
|
273
|
-
$[66] = t31;
|
|
274
|
-
} else t31 = $[66];
|
|
275
|
-
let t32;
|
|
276
|
-
if ($[67] !== t) {
|
|
277
|
-
t32 = t("dialogs.tableProperties.alignOptions.center");
|
|
278
|
-
$[67] = t;
|
|
279
|
-
$[68] = t32;
|
|
280
|
-
} else t32 = $[68];
|
|
281
|
-
let t33;
|
|
282
|
-
if ($[69] !== t32) {
|
|
283
|
-
t33 = /* @__PURE__ */ jsx("option", {
|
|
284
|
-
value: "center",
|
|
285
|
-
children: t32
|
|
286
|
-
});
|
|
287
|
-
$[69] = t32;
|
|
288
|
-
$[70] = t33;
|
|
289
|
-
} else t33 = $[70];
|
|
290
|
-
let t34;
|
|
291
|
-
if ($[71] !== t) {
|
|
292
|
-
t34 = t("dialogs.tableProperties.alignOptions.right");
|
|
293
|
-
$[71] = t;
|
|
294
|
-
$[72] = t34;
|
|
295
|
-
} else t34 = $[72];
|
|
296
|
-
let t35;
|
|
297
|
-
if ($[73] !== t34) {
|
|
298
|
-
t35 = /* @__PURE__ */ jsx("option", {
|
|
299
|
-
value: "right",
|
|
300
|
-
children: t34
|
|
301
|
-
});
|
|
302
|
-
$[73] = t34;
|
|
303
|
-
$[74] = t35;
|
|
304
|
-
} else t35 = $[74];
|
|
305
|
-
let t36;
|
|
306
|
-
if ($[75] !== fieldIds.align || $[76] !== justification || $[77] !== t31 || $[78] !== t33 || $[79] !== t35) {
|
|
307
|
-
t36 = /* @__PURE__ */ jsxs("select", {
|
|
308
|
-
className: "border-input bg-background text-foreground flex-1 rounded border px-2 py-1.5 text-[13px] outline-none",
|
|
309
|
-
id: t28,
|
|
310
|
-
onChange: t29,
|
|
311
|
-
value: justification,
|
|
312
|
-
children: [
|
|
313
|
-
t31,
|
|
314
|
-
t33,
|
|
315
|
-
t35
|
|
316
|
-
]
|
|
317
|
-
});
|
|
318
|
-
$[75] = fieldIds.align;
|
|
319
|
-
$[76] = justification;
|
|
320
|
-
$[77] = t31;
|
|
321
|
-
$[78] = t33;
|
|
322
|
-
$[79] = t35;
|
|
323
|
-
$[80] = t36;
|
|
324
|
-
} else t36 = $[80];
|
|
325
|
-
let t37;
|
|
326
|
-
if ($[81] !== t27 || $[82] !== t36) {
|
|
327
|
-
t37 = /* @__PURE__ */ jsxs("div", {
|
|
328
|
-
className: "flex items-center gap-3",
|
|
329
|
-
children: [t27, t36]
|
|
330
|
-
});
|
|
331
|
-
$[81] = t27;
|
|
332
|
-
$[82] = t36;
|
|
333
|
-
$[83] = t37;
|
|
334
|
-
} else t37 = $[83];
|
|
335
|
-
let t38;
|
|
336
|
-
if ($[84] !== t23 || $[85] !== t24 || $[86] !== t37) {
|
|
337
|
-
t38 = /* @__PURE__ */ jsxs("div", {
|
|
338
|
-
className: "flex flex-col gap-3 px-5 py-4",
|
|
339
|
-
children: [
|
|
340
|
-
t23,
|
|
341
|
-
t24,
|
|
342
|
-
t37
|
|
343
|
-
]
|
|
344
|
-
});
|
|
345
|
-
$[84] = t23;
|
|
346
|
-
$[85] = t24;
|
|
347
|
-
$[86] = t37;
|
|
348
|
-
$[87] = t38;
|
|
349
|
-
} else t38 = $[87];
|
|
350
|
-
let t39;
|
|
351
|
-
if ($[88] !== t) {
|
|
352
|
-
t39 = t("common.cancel");
|
|
353
|
-
$[88] = t;
|
|
354
|
-
$[89] = t39;
|
|
355
|
-
} else t39 = $[89];
|
|
356
|
-
let t40;
|
|
357
|
-
if ($[90] !== DialogClose || $[91] !== t39) {
|
|
358
|
-
t40 = /* @__PURE__ */ jsx(DialogClose, {
|
|
359
|
-
className: "border-input rounded border px-4 py-1.5 text-[13px]",
|
|
360
|
-
children: t39
|
|
361
|
-
});
|
|
362
|
-
$[90] = DialogClose;
|
|
363
|
-
$[91] = t39;
|
|
364
|
-
$[92] = t40;
|
|
365
|
-
} else t40 = $[92];
|
|
366
|
-
let t41;
|
|
367
|
-
if ($[93] !== t) {
|
|
368
|
-
t41 = t("common.apply");
|
|
369
|
-
$[93] = t;
|
|
370
|
-
$[94] = t41;
|
|
371
|
-
} else t41 = $[94];
|
|
372
|
-
let t42;
|
|
373
|
-
if ($[95] !== handleApply || $[96] !== t41) {
|
|
374
|
-
t42 = /* @__PURE__ */ jsx("button", {
|
|
375
|
-
className: "bg-primary text-primary-foreground rounded px-4 py-1.5 text-[13px] font-medium",
|
|
376
|
-
onClick: handleApply,
|
|
377
|
-
type: "button",
|
|
378
|
-
children: t41
|
|
379
|
-
});
|
|
380
|
-
$[95] = handleApply;
|
|
381
|
-
$[96] = t41;
|
|
382
|
-
$[97] = t42;
|
|
383
|
-
} else t42 = $[97];
|
|
384
|
-
let t43;
|
|
385
|
-
if ($[98] !== t40 || $[99] !== t42) {
|
|
386
|
-
t43 = /* @__PURE__ */ jsxs("div", {
|
|
387
|
-
className: "flex justify-end gap-2 border-t px-5 py-3",
|
|
388
|
-
children: [t40, t42]
|
|
389
|
-
});
|
|
390
|
-
$[98] = t40;
|
|
391
|
-
$[99] = t42;
|
|
392
|
-
$[100] = t43;
|
|
393
|
-
} else t43 = $[100];
|
|
394
|
-
let t44;
|
|
395
|
-
if ($[101] !== DialogPopup || $[102] !== t10 || $[103] !== t38 || $[104] !== t43) {
|
|
396
|
-
t44 = /* @__PURE__ */ jsxs(DialogPopup, {
|
|
397
|
-
className: "bg-popover fixed start-1/2 top-1/2 z-[10001] w-full max-w-[440px] min-w-[360px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-xl",
|
|
398
|
-
children: [
|
|
399
|
-
t10,
|
|
400
|
-
t38,
|
|
401
|
-
t43
|
|
402
|
-
]
|
|
403
|
-
});
|
|
404
|
-
$[101] = DialogPopup;
|
|
405
|
-
$[102] = t10;
|
|
406
|
-
$[103] = t38;
|
|
407
|
-
$[104] = t43;
|
|
408
|
-
$[105] = t44;
|
|
409
|
-
} else t44 = $[105];
|
|
410
|
-
let t45;
|
|
411
|
-
if ($[106] !== DialogPortal || $[107] !== t44 || $[108] !== t8) {
|
|
412
|
-
t45 = /* @__PURE__ */ jsxs(DialogPortal, { children: [t8, t44] });
|
|
413
|
-
$[106] = DialogPortal;
|
|
414
|
-
$[107] = t44;
|
|
415
|
-
$[108] = t8;
|
|
416
|
-
$[109] = t45;
|
|
417
|
-
} else t45 = $[109];
|
|
418
|
-
let t46;
|
|
419
|
-
if ($[110] !== Dialog || $[111] !== handleOpenChange || $[112] !== isOpen || $[113] !== t45) {
|
|
420
|
-
t46 = /* @__PURE__ */ jsx(Dialog, {
|
|
421
|
-
open: isOpen,
|
|
422
|
-
onOpenChange: handleOpenChange,
|
|
423
|
-
children: t45
|
|
424
|
-
});
|
|
425
|
-
$[110] = Dialog;
|
|
426
|
-
$[111] = handleOpenChange;
|
|
427
|
-
$[112] = isOpen;
|
|
428
|
-
$[113] = t45;
|
|
429
|
-
$[114] = t46;
|
|
430
|
-
} else t46 = $[114];
|
|
431
|
-
return t46;
|
|
432
|
-
}
|
|
433
|
-
//#endregion
|
|
434
|
-
export { TablePropertiesDialog_exports as n, TablePropertiesDialog as t };
|