@stll/folio-react 0.25.3 → 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,233 @@
|
|
|
1
|
+
import { r as useFolioUI } from "./folio-ui-rCHqCEG6.js";
|
|
2
|
+
import { a as DIALOG_LABEL_CLASS, c as DIALOG_SECONDARY_BUTTON_CLASS, i as DIALOG_INPUT_CLASS, l as DIALOG_TITLE_CLASS, n as DIALOG_BODY_CLASS, o as DIALOG_POPUP_CLASS, r as DIALOG_FOOTER_CLASS, s as DIALOG_PRIMARY_BUTTON_CLASS, t as DIALOG_BACKDROP_CLASS, u as useCloseOnDialogOpenChange } from "./dialogChrome-BoGYPgeu.js";
|
|
3
|
+
import { c } from "react-compiler-runtime";
|
|
4
|
+
import { useId, useState } from "react";
|
|
5
|
+
import { useTranslations } from "use-intl";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/dialogs/SetNumberingValueDialog.tsx
|
|
8
|
+
/** `w:startOverride` is a non-negative decimal; the input stops far below its limit. */
|
|
9
|
+
const MIN_VALUE = 0;
|
|
10
|
+
const MAX_VALUE = 32767;
|
|
11
|
+
const DEFAULT_VALUE = 1;
|
|
12
|
+
/** *Set Numbering Value*: start the selected item's list over at a value. */
|
|
13
|
+
function SetNumberingValueDialog(props) {
|
|
14
|
+
const $ = c(2);
|
|
15
|
+
if (!props.isOpen) return null;
|
|
16
|
+
let t0;
|
|
17
|
+
if ($[0] !== props) {
|
|
18
|
+
t0 = /* @__PURE__ */ jsx(SetNumberingValueDialogForm, { ...props });
|
|
19
|
+
$[0] = props;
|
|
20
|
+
$[1] = t0;
|
|
21
|
+
} else t0 = $[1];
|
|
22
|
+
return t0;
|
|
23
|
+
}
|
|
24
|
+
function SetNumberingValueDialogForm(t0) {
|
|
25
|
+
const $ = c(59);
|
|
26
|
+
const { isOpen, onClose, onApply } = t0;
|
|
27
|
+
const { Root: Dialog, Portal: DialogPortal, Backdrop: DialogBackdrop, Popup: DialogPopup, Title: DialogTitle, Close: DialogClose } = useFolioUI().Dialog;
|
|
28
|
+
const handleOpenChange = useCloseOnDialogOpenChange(onClose);
|
|
29
|
+
const t = useTranslations("folio");
|
|
30
|
+
const id = useId();
|
|
31
|
+
const [text, setText] = useState(String(DEFAULT_VALUE));
|
|
32
|
+
const inputId = `${id}-numbering-value`;
|
|
33
|
+
let t1;
|
|
34
|
+
if ($[0] !== text) {
|
|
35
|
+
t1 = text.trim() === "" ? NaN : Number(text);
|
|
36
|
+
$[0] = text;
|
|
37
|
+
$[1] = t1;
|
|
38
|
+
} else t1 = $[1];
|
|
39
|
+
const parsed = t1;
|
|
40
|
+
let t2;
|
|
41
|
+
if ($[2] !== parsed) {
|
|
42
|
+
t2 = Number.isFinite(parsed);
|
|
43
|
+
$[2] = parsed;
|
|
44
|
+
$[3] = t2;
|
|
45
|
+
} else t2 = $[3];
|
|
46
|
+
const valid = t2;
|
|
47
|
+
let t3;
|
|
48
|
+
if ($[4] !== onApply || $[5] !== onClose || $[6] !== parsed || $[7] !== valid) {
|
|
49
|
+
t3 = () => {
|
|
50
|
+
if (!valid) return;
|
|
51
|
+
onApply(Math.min(MAX_VALUE, Math.max(MIN_VALUE, Math.trunc(parsed))));
|
|
52
|
+
onClose();
|
|
53
|
+
};
|
|
54
|
+
$[4] = onApply;
|
|
55
|
+
$[5] = onClose;
|
|
56
|
+
$[6] = parsed;
|
|
57
|
+
$[7] = valid;
|
|
58
|
+
$[8] = t3;
|
|
59
|
+
} else t3 = $[8];
|
|
60
|
+
const apply = t3;
|
|
61
|
+
let t4;
|
|
62
|
+
if ($[9] !== DialogBackdrop) {
|
|
63
|
+
t4 = /* @__PURE__ */ jsx(DialogBackdrop, { className: DIALOG_BACKDROP_CLASS });
|
|
64
|
+
$[9] = DialogBackdrop;
|
|
65
|
+
$[10] = t4;
|
|
66
|
+
} else t4 = $[10];
|
|
67
|
+
let t5;
|
|
68
|
+
if ($[11] !== t) {
|
|
69
|
+
t5 = t("dialogs.setNumberingValue.title");
|
|
70
|
+
$[11] = t;
|
|
71
|
+
$[12] = t5;
|
|
72
|
+
} else t5 = $[12];
|
|
73
|
+
let t6;
|
|
74
|
+
if ($[13] !== DialogTitle || $[14] !== t5) {
|
|
75
|
+
t6 = /* @__PURE__ */ jsx(DialogTitle, {
|
|
76
|
+
className: DIALOG_TITLE_CLASS,
|
|
77
|
+
children: t5
|
|
78
|
+
});
|
|
79
|
+
$[13] = DialogTitle;
|
|
80
|
+
$[14] = t5;
|
|
81
|
+
$[15] = t6;
|
|
82
|
+
} else t6 = $[15];
|
|
83
|
+
let t7;
|
|
84
|
+
if ($[16] !== t) {
|
|
85
|
+
t7 = t("dialogs.setNumberingValue.valueLabel");
|
|
86
|
+
$[16] = t;
|
|
87
|
+
$[17] = t7;
|
|
88
|
+
} else t7 = $[17];
|
|
89
|
+
let t8;
|
|
90
|
+
if ($[18] !== t7) {
|
|
91
|
+
t8 = /* @__PURE__ */ jsx("span", {
|
|
92
|
+
className: DIALOG_LABEL_CLASS,
|
|
93
|
+
children: t7
|
|
94
|
+
});
|
|
95
|
+
$[18] = t7;
|
|
96
|
+
$[19] = t8;
|
|
97
|
+
} else t8 = $[19];
|
|
98
|
+
let t9;
|
|
99
|
+
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
100
|
+
t9 = (event) => setText(event.target.value);
|
|
101
|
+
$[20] = t9;
|
|
102
|
+
} else t9 = $[20];
|
|
103
|
+
let t10;
|
|
104
|
+
if ($[21] !== apply) {
|
|
105
|
+
t10 = (event_0) => {
|
|
106
|
+
if (event_0.key === "Enter") {
|
|
107
|
+
event_0.preventDefault();
|
|
108
|
+
apply();
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
$[21] = apply;
|
|
112
|
+
$[22] = t10;
|
|
113
|
+
} else t10 = $[22];
|
|
114
|
+
let t11;
|
|
115
|
+
if ($[23] !== inputId || $[24] !== t10 || $[25] !== text) {
|
|
116
|
+
t11 = /* @__PURE__ */ jsx("input", {
|
|
117
|
+
className: DIALOG_INPUT_CLASS,
|
|
118
|
+
id: inputId,
|
|
119
|
+
max: MAX_VALUE,
|
|
120
|
+
min: MIN_VALUE,
|
|
121
|
+
onChange: t9,
|
|
122
|
+
onKeyDown: t10,
|
|
123
|
+
type: "number",
|
|
124
|
+
value: text
|
|
125
|
+
});
|
|
126
|
+
$[23] = inputId;
|
|
127
|
+
$[24] = t10;
|
|
128
|
+
$[25] = text;
|
|
129
|
+
$[26] = t11;
|
|
130
|
+
} else t11 = $[26];
|
|
131
|
+
let t12;
|
|
132
|
+
if ($[27] !== inputId || $[28] !== t11 || $[29] !== t8) {
|
|
133
|
+
t12 = /* @__PURE__ */ jsx("div", {
|
|
134
|
+
className: DIALOG_BODY_CLASS,
|
|
135
|
+
children: /* @__PURE__ */ jsxs("label", {
|
|
136
|
+
className: "flex flex-col gap-1",
|
|
137
|
+
htmlFor: inputId,
|
|
138
|
+
children: [t8, t11]
|
|
139
|
+
})
|
|
140
|
+
});
|
|
141
|
+
$[27] = inputId;
|
|
142
|
+
$[28] = t11;
|
|
143
|
+
$[29] = t8;
|
|
144
|
+
$[30] = t12;
|
|
145
|
+
} else t12 = $[30];
|
|
146
|
+
let t13;
|
|
147
|
+
if ($[31] !== t) {
|
|
148
|
+
t13 = t("common.cancel");
|
|
149
|
+
$[31] = t;
|
|
150
|
+
$[32] = t13;
|
|
151
|
+
} else t13 = $[32];
|
|
152
|
+
let t14;
|
|
153
|
+
if ($[33] !== DialogClose || $[34] !== t13) {
|
|
154
|
+
t14 = /* @__PURE__ */ jsx(DialogClose, {
|
|
155
|
+
className: DIALOG_SECONDARY_BUTTON_CLASS,
|
|
156
|
+
children: t13
|
|
157
|
+
});
|
|
158
|
+
$[33] = DialogClose;
|
|
159
|
+
$[34] = t13;
|
|
160
|
+
$[35] = t14;
|
|
161
|
+
} else t14 = $[35];
|
|
162
|
+
const t15 = !valid;
|
|
163
|
+
let t16;
|
|
164
|
+
if ($[36] !== t) {
|
|
165
|
+
t16 = t("common.apply");
|
|
166
|
+
$[36] = t;
|
|
167
|
+
$[37] = t16;
|
|
168
|
+
} else t16 = $[37];
|
|
169
|
+
let t17;
|
|
170
|
+
if ($[38] !== apply || $[39] !== t15 || $[40] !== t16) {
|
|
171
|
+
t17 = /* @__PURE__ */ jsx("button", {
|
|
172
|
+
className: DIALOG_PRIMARY_BUTTON_CLASS,
|
|
173
|
+
disabled: t15,
|
|
174
|
+
onClick: apply,
|
|
175
|
+
type: "button",
|
|
176
|
+
children: t16
|
|
177
|
+
});
|
|
178
|
+
$[38] = apply;
|
|
179
|
+
$[39] = t15;
|
|
180
|
+
$[40] = t16;
|
|
181
|
+
$[41] = t17;
|
|
182
|
+
} else t17 = $[41];
|
|
183
|
+
let t18;
|
|
184
|
+
if ($[42] !== t14 || $[43] !== t17) {
|
|
185
|
+
t18 = /* @__PURE__ */ jsxs("div", {
|
|
186
|
+
className: DIALOG_FOOTER_CLASS,
|
|
187
|
+
children: [t14, t17]
|
|
188
|
+
});
|
|
189
|
+
$[42] = t14;
|
|
190
|
+
$[43] = t17;
|
|
191
|
+
$[44] = t18;
|
|
192
|
+
} else t18 = $[44];
|
|
193
|
+
let t19;
|
|
194
|
+
if ($[45] !== DialogPopup || $[46] !== t12 || $[47] !== t18 || $[48] !== t6) {
|
|
195
|
+
t19 = /* @__PURE__ */ jsxs(DialogPopup, {
|
|
196
|
+
className: DIALOG_POPUP_CLASS,
|
|
197
|
+
children: [
|
|
198
|
+
t6,
|
|
199
|
+
t12,
|
|
200
|
+
t18
|
|
201
|
+
]
|
|
202
|
+
});
|
|
203
|
+
$[45] = DialogPopup;
|
|
204
|
+
$[46] = t12;
|
|
205
|
+
$[47] = t18;
|
|
206
|
+
$[48] = t6;
|
|
207
|
+
$[49] = t19;
|
|
208
|
+
} else t19 = $[49];
|
|
209
|
+
let t20;
|
|
210
|
+
if ($[50] !== DialogPortal || $[51] !== t19 || $[52] !== t4) {
|
|
211
|
+
t20 = /* @__PURE__ */ jsxs(DialogPortal, { children: [t4, t19] });
|
|
212
|
+
$[50] = DialogPortal;
|
|
213
|
+
$[51] = t19;
|
|
214
|
+
$[52] = t4;
|
|
215
|
+
$[53] = t20;
|
|
216
|
+
} else t20 = $[53];
|
|
217
|
+
let t21;
|
|
218
|
+
if ($[54] !== Dialog || $[55] !== handleOpenChange || $[56] !== isOpen || $[57] !== t20) {
|
|
219
|
+
t21 = /* @__PURE__ */ jsx(Dialog, {
|
|
220
|
+
open: isOpen,
|
|
221
|
+
onOpenChange: handleOpenChange,
|
|
222
|
+
children: t20
|
|
223
|
+
});
|
|
224
|
+
$[54] = Dialog;
|
|
225
|
+
$[55] = handleOpenChange;
|
|
226
|
+
$[56] = isOpen;
|
|
227
|
+
$[57] = t20;
|
|
228
|
+
$[58] = t21;
|
|
229
|
+
} else t21 = $[58];
|
|
230
|
+
return t21;
|
|
231
|
+
}
|
|
232
|
+
//#endregion
|
|
233
|
+
export { SetNumberingValueDialog };
|
|
@@ -0,0 +1,416 @@
|
|
|
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 { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { TABLE_PROPERTY_JUSTIFICATIONS, toTablePropertyJustification } from "@stll/folio-core/utils/tableOperations";
|
|
9
|
+
//#region src/components/dialogs/TablePropertiesDialog.tsx
|
|
10
|
+
/**
|
|
11
|
+
* Table Properties Dialog — width type, width value, alignment.
|
|
12
|
+
*/
|
|
13
|
+
var TablePropertiesDialog_exports = /* @__PURE__ */ __exportAll({ TablePropertiesDialog: () => TablePropertiesDialog });
|
|
14
|
+
const editableWidthType = (value) => {
|
|
15
|
+
switch (value) {
|
|
16
|
+
case "dxa":
|
|
17
|
+
case "pct": return value;
|
|
18
|
+
default: return "auto";
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const TABLE_JUSTIFICATION_LABEL_KEYS = {
|
|
22
|
+
center: "dialogs.tableProperties.alignOptions.center",
|
|
23
|
+
end: "dialogs.tableProperties.alignOptions.end",
|
|
24
|
+
left: "dialogs.tableProperties.alignOptions.left",
|
|
25
|
+
right: "dialogs.tableProperties.alignOptions.right",
|
|
26
|
+
start: "dialogs.tableProperties.alignOptions.start"
|
|
27
|
+
};
|
|
28
|
+
function TablePropertiesDialog(props) {
|
|
29
|
+
const $ = c(5);
|
|
30
|
+
if (!props.isOpen) return null;
|
|
31
|
+
let t0;
|
|
32
|
+
if ($[0] !== props.currentProps) {
|
|
33
|
+
t0 = JSON.stringify(props.currentProps);
|
|
34
|
+
$[0] = props.currentProps;
|
|
35
|
+
$[1] = t0;
|
|
36
|
+
} else t0 = $[1];
|
|
37
|
+
let t1;
|
|
38
|
+
if ($[2] !== props || $[3] !== t0) {
|
|
39
|
+
t1 = /* @__PURE__ */ jsx(TablePropertiesDialogForm, { ...props }, t0);
|
|
40
|
+
$[2] = props;
|
|
41
|
+
$[3] = t0;
|
|
42
|
+
$[4] = t1;
|
|
43
|
+
} else t1 = $[4];
|
|
44
|
+
return t1;
|
|
45
|
+
}
|
|
46
|
+
function TablePropertiesDialogForm(t0) {
|
|
47
|
+
const $ = c(99);
|
|
48
|
+
const { isOpen, onClose, onApply, currentProps } = t0;
|
|
49
|
+
const { Root: Dialog, Portal: DialogPortal, Backdrop: DialogBackdrop, Popup: DialogPopup, Title: DialogTitle, Close: DialogClose } = useFolioUI().Dialog;
|
|
50
|
+
const handleOpenChange = useCloseOnDialogOpenChange(onClose);
|
|
51
|
+
const t = useTranslations("folio");
|
|
52
|
+
const id = useId();
|
|
53
|
+
const [width, setWidth] = useState(currentProps?.width ?? 0);
|
|
54
|
+
const t1 = currentProps?.widthType ?? "auto";
|
|
55
|
+
let t2;
|
|
56
|
+
if ($[0] !== t1) {
|
|
57
|
+
t2 = editableWidthType(t1);
|
|
58
|
+
$[0] = t1;
|
|
59
|
+
$[1] = t2;
|
|
60
|
+
} else t2 = $[1];
|
|
61
|
+
const [widthType, setWidthType] = useState(t2);
|
|
62
|
+
const t3 = currentProps?.justification;
|
|
63
|
+
let t4;
|
|
64
|
+
if ($[2] !== t3) {
|
|
65
|
+
t4 = toTablePropertyJustification(t3);
|
|
66
|
+
$[2] = t3;
|
|
67
|
+
$[3] = t4;
|
|
68
|
+
} else t4 = $[3];
|
|
69
|
+
const [justification, setJustification] = useState(t4);
|
|
70
|
+
let t5;
|
|
71
|
+
if ($[4] !== justification || $[5] !== onApply || $[6] !== onClose || $[7] !== width || $[8] !== widthType) {
|
|
72
|
+
t5 = () => {
|
|
73
|
+
const props = { justification };
|
|
74
|
+
if (widthType === "auto") {
|
|
75
|
+
props.width = null;
|
|
76
|
+
props.widthType = "auto";
|
|
77
|
+
} else {
|
|
78
|
+
props.width = width;
|
|
79
|
+
props.widthType = widthType;
|
|
80
|
+
}
|
|
81
|
+
onApply(props);
|
|
82
|
+
onClose();
|
|
83
|
+
};
|
|
84
|
+
$[4] = justification;
|
|
85
|
+
$[5] = onApply;
|
|
86
|
+
$[6] = onClose;
|
|
87
|
+
$[7] = width;
|
|
88
|
+
$[8] = widthType;
|
|
89
|
+
$[9] = t5;
|
|
90
|
+
} else t5 = $[9];
|
|
91
|
+
const handleApply = t5;
|
|
92
|
+
const t6 = `${id}-tp-width-type`;
|
|
93
|
+
const t7 = `${id}-tp-width`;
|
|
94
|
+
const t8 = `${id}-tp-align`;
|
|
95
|
+
let t9;
|
|
96
|
+
if ($[10] !== t6 || $[11] !== t7 || $[12] !== t8) {
|
|
97
|
+
t9 = {
|
|
98
|
+
widthType: t6,
|
|
99
|
+
width: t7,
|
|
100
|
+
align: t8
|
|
101
|
+
};
|
|
102
|
+
$[10] = t6;
|
|
103
|
+
$[11] = t7;
|
|
104
|
+
$[12] = t8;
|
|
105
|
+
$[13] = t9;
|
|
106
|
+
} else t9 = $[13];
|
|
107
|
+
const fieldIds = t9;
|
|
108
|
+
let t10;
|
|
109
|
+
if ($[14] !== DialogBackdrop) {
|
|
110
|
+
t10 = /* @__PURE__ */ jsx(DialogBackdrop, { className: "fixed inset-0 z-[10000] bg-black/50" });
|
|
111
|
+
$[14] = DialogBackdrop;
|
|
112
|
+
$[15] = t10;
|
|
113
|
+
} else t10 = $[15];
|
|
114
|
+
let t11;
|
|
115
|
+
if ($[16] !== t) {
|
|
116
|
+
t11 = t("dialogs.tableProperties.title");
|
|
117
|
+
$[16] = t;
|
|
118
|
+
$[17] = t11;
|
|
119
|
+
} else t11 = $[17];
|
|
120
|
+
let t12;
|
|
121
|
+
if ($[18] !== DialogTitle || $[19] !== t11) {
|
|
122
|
+
t12 = /* @__PURE__ */ jsx(DialogTitle, {
|
|
123
|
+
className: "border-b px-5 py-3 text-base font-semibold",
|
|
124
|
+
children: t11
|
|
125
|
+
});
|
|
126
|
+
$[18] = DialogTitle;
|
|
127
|
+
$[19] = t11;
|
|
128
|
+
$[20] = t12;
|
|
129
|
+
} else t12 = $[20];
|
|
130
|
+
const t13 = fieldIds.widthType;
|
|
131
|
+
let t14;
|
|
132
|
+
if ($[21] !== t) {
|
|
133
|
+
t14 = t("dialogs.tableProperties.widthType");
|
|
134
|
+
$[21] = t;
|
|
135
|
+
$[22] = t14;
|
|
136
|
+
} else t14 = $[22];
|
|
137
|
+
let t15;
|
|
138
|
+
if ($[23] !== fieldIds.widthType || $[24] !== t14) {
|
|
139
|
+
t15 = /* @__PURE__ */ jsx("label", {
|
|
140
|
+
className: "w-20 text-muted-foreground text-[13px]",
|
|
141
|
+
htmlFor: t13,
|
|
142
|
+
children: t14
|
|
143
|
+
});
|
|
144
|
+
$[23] = fieldIds.widthType;
|
|
145
|
+
$[24] = t14;
|
|
146
|
+
$[25] = t15;
|
|
147
|
+
} else t15 = $[25];
|
|
148
|
+
const t16 = fieldIds.widthType;
|
|
149
|
+
let t17;
|
|
150
|
+
if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
|
|
151
|
+
t17 = (e) => setWidthType(editableWidthType(e.target.value));
|
|
152
|
+
$[26] = t17;
|
|
153
|
+
} else t17 = $[26];
|
|
154
|
+
let t18;
|
|
155
|
+
if ($[27] !== t) {
|
|
156
|
+
t18 = t("dialogs.tableProperties.widthTypes.auto");
|
|
157
|
+
$[27] = t;
|
|
158
|
+
$[28] = t18;
|
|
159
|
+
} else t18 = $[28];
|
|
160
|
+
let t19;
|
|
161
|
+
if ($[29] !== t18) {
|
|
162
|
+
t19 = /* @__PURE__ */ jsx("option", {
|
|
163
|
+
value: "auto",
|
|
164
|
+
children: t18
|
|
165
|
+
});
|
|
166
|
+
$[29] = t18;
|
|
167
|
+
$[30] = t19;
|
|
168
|
+
} else t19 = $[30];
|
|
169
|
+
let t20;
|
|
170
|
+
if ($[31] !== t) {
|
|
171
|
+
t20 = t("dialogs.tableProperties.widthTypes.fixed");
|
|
172
|
+
$[31] = t;
|
|
173
|
+
$[32] = t20;
|
|
174
|
+
} else t20 = $[32];
|
|
175
|
+
let t21;
|
|
176
|
+
if ($[33] !== t20) {
|
|
177
|
+
t21 = /* @__PURE__ */ jsx("option", {
|
|
178
|
+
value: "dxa",
|
|
179
|
+
children: t20
|
|
180
|
+
});
|
|
181
|
+
$[33] = t20;
|
|
182
|
+
$[34] = t21;
|
|
183
|
+
} else t21 = $[34];
|
|
184
|
+
let t22;
|
|
185
|
+
if ($[35] !== t) {
|
|
186
|
+
t22 = t("dialogs.tableProperties.widthTypes.percentage");
|
|
187
|
+
$[35] = t;
|
|
188
|
+
$[36] = t22;
|
|
189
|
+
} else t22 = $[36];
|
|
190
|
+
let t23;
|
|
191
|
+
if ($[37] !== t22) {
|
|
192
|
+
t23 = /* @__PURE__ */ jsx("option", {
|
|
193
|
+
value: "pct",
|
|
194
|
+
children: t22
|
|
195
|
+
});
|
|
196
|
+
$[37] = t22;
|
|
197
|
+
$[38] = t23;
|
|
198
|
+
} else t23 = $[38];
|
|
199
|
+
let t24;
|
|
200
|
+
if ($[39] !== fieldIds.widthType || $[40] !== t19 || $[41] !== t21 || $[42] !== t23 || $[43] !== widthType) {
|
|
201
|
+
t24 = /* @__PURE__ */ jsxs("select", {
|
|
202
|
+
className: "border-input bg-background text-foreground flex-1 rounded border px-2 py-1.5 text-[13px] outline-none",
|
|
203
|
+
id: t16,
|
|
204
|
+
onChange: t17,
|
|
205
|
+
value: widthType,
|
|
206
|
+
children: [
|
|
207
|
+
t19,
|
|
208
|
+
t21,
|
|
209
|
+
t23
|
|
210
|
+
]
|
|
211
|
+
});
|
|
212
|
+
$[39] = fieldIds.widthType;
|
|
213
|
+
$[40] = t19;
|
|
214
|
+
$[41] = t21;
|
|
215
|
+
$[42] = t23;
|
|
216
|
+
$[43] = widthType;
|
|
217
|
+
$[44] = t24;
|
|
218
|
+
} else t24 = $[44];
|
|
219
|
+
let t25;
|
|
220
|
+
if ($[45] !== t15 || $[46] !== t24) {
|
|
221
|
+
t25 = /* @__PURE__ */ jsxs("div", {
|
|
222
|
+
className: "flex items-center gap-3",
|
|
223
|
+
children: [t15, t24]
|
|
224
|
+
});
|
|
225
|
+
$[45] = t15;
|
|
226
|
+
$[46] = t24;
|
|
227
|
+
$[47] = t25;
|
|
228
|
+
} else t25 = $[47];
|
|
229
|
+
let t26;
|
|
230
|
+
if ($[48] !== fieldIds.width || $[49] !== t || $[50] !== width || $[51] !== widthType) {
|
|
231
|
+
t26 = widthType !== "auto" && /* @__PURE__ */ jsxs("div", {
|
|
232
|
+
className: "flex items-center gap-3",
|
|
233
|
+
children: [
|
|
234
|
+
/* @__PURE__ */ jsx("label", {
|
|
235
|
+
className: "w-20 text-muted-foreground text-[13px]",
|
|
236
|
+
htmlFor: fieldIds.width,
|
|
237
|
+
children: t("dialogs.tableProperties.widthLabel")
|
|
238
|
+
}),
|
|
239
|
+
/* @__PURE__ */ jsx("input", {
|
|
240
|
+
className: "border-input bg-background text-foreground flex-1 rounded border px-2 py-1.5 text-[13px] outline-none",
|
|
241
|
+
id: fieldIds.width,
|
|
242
|
+
min: 0,
|
|
243
|
+
onChange: (e_0) => setWidth(Number(e_0.target.value) || 0),
|
|
244
|
+
step: widthType === "pct" ? 5 : 100,
|
|
245
|
+
type: "number",
|
|
246
|
+
value: width
|
|
247
|
+
}),
|
|
248
|
+
/* @__PURE__ */ jsx("span", {
|
|
249
|
+
className: "text-muted-foreground text-[11px]",
|
|
250
|
+
children: widthType === "pct" ? t("dialogs.tableProperties.units.fiftiethsPercent") : t("dialogs.tableProperties.units.twips")
|
|
251
|
+
})
|
|
252
|
+
]
|
|
253
|
+
});
|
|
254
|
+
$[48] = fieldIds.width;
|
|
255
|
+
$[49] = t;
|
|
256
|
+
$[50] = width;
|
|
257
|
+
$[51] = widthType;
|
|
258
|
+
$[52] = t26;
|
|
259
|
+
} else t26 = $[52];
|
|
260
|
+
const t27 = fieldIds.align;
|
|
261
|
+
let t28;
|
|
262
|
+
if ($[53] !== t) {
|
|
263
|
+
t28 = t("dialogs.tableProperties.alignmentLabel");
|
|
264
|
+
$[53] = t;
|
|
265
|
+
$[54] = t28;
|
|
266
|
+
} else t28 = $[54];
|
|
267
|
+
let t29;
|
|
268
|
+
if ($[55] !== fieldIds.align || $[56] !== t28) {
|
|
269
|
+
t29 = /* @__PURE__ */ jsx("label", {
|
|
270
|
+
className: "w-20 text-muted-foreground text-[13px]",
|
|
271
|
+
htmlFor: t27,
|
|
272
|
+
children: t28
|
|
273
|
+
});
|
|
274
|
+
$[55] = fieldIds.align;
|
|
275
|
+
$[56] = t28;
|
|
276
|
+
$[57] = t29;
|
|
277
|
+
} else t29 = $[57];
|
|
278
|
+
const t30 = fieldIds.align;
|
|
279
|
+
let t31;
|
|
280
|
+
if ($[58] === Symbol.for("react.memo_cache_sentinel")) {
|
|
281
|
+
t31 = (e_1) => setJustification(toTablePropertyJustification(e_1.target.value));
|
|
282
|
+
$[58] = t31;
|
|
283
|
+
} else t31 = $[58];
|
|
284
|
+
let t32;
|
|
285
|
+
if ($[59] !== t) {
|
|
286
|
+
t32 = TABLE_PROPERTY_JUSTIFICATIONS.map((value) => /* @__PURE__ */ jsx("option", {
|
|
287
|
+
value,
|
|
288
|
+
children: t(TABLE_JUSTIFICATION_LABEL_KEYS[value])
|
|
289
|
+
}, value));
|
|
290
|
+
$[59] = t;
|
|
291
|
+
$[60] = t32;
|
|
292
|
+
} else t32 = $[60];
|
|
293
|
+
let t33;
|
|
294
|
+
if ($[61] !== fieldIds.align || $[62] !== justification || $[63] !== t32) {
|
|
295
|
+
t33 = /* @__PURE__ */ jsx("select", {
|
|
296
|
+
className: "border-input bg-background text-foreground flex-1 rounded border px-2 py-1.5 text-[13px] outline-none",
|
|
297
|
+
id: t30,
|
|
298
|
+
onChange: t31,
|
|
299
|
+
value: justification,
|
|
300
|
+
children: t32
|
|
301
|
+
});
|
|
302
|
+
$[61] = fieldIds.align;
|
|
303
|
+
$[62] = justification;
|
|
304
|
+
$[63] = t32;
|
|
305
|
+
$[64] = t33;
|
|
306
|
+
} else t33 = $[64];
|
|
307
|
+
let t34;
|
|
308
|
+
if ($[65] !== t29 || $[66] !== t33) {
|
|
309
|
+
t34 = /* @__PURE__ */ jsxs("div", {
|
|
310
|
+
className: "flex items-center gap-3",
|
|
311
|
+
children: [t29, t33]
|
|
312
|
+
});
|
|
313
|
+
$[65] = t29;
|
|
314
|
+
$[66] = t33;
|
|
315
|
+
$[67] = t34;
|
|
316
|
+
} else t34 = $[67];
|
|
317
|
+
let t35;
|
|
318
|
+
if ($[68] !== t25 || $[69] !== t26 || $[70] !== t34) {
|
|
319
|
+
t35 = /* @__PURE__ */ jsxs("div", {
|
|
320
|
+
className: "flex flex-col gap-3 px-5 py-4",
|
|
321
|
+
children: [
|
|
322
|
+
t25,
|
|
323
|
+
t26,
|
|
324
|
+
t34
|
|
325
|
+
]
|
|
326
|
+
});
|
|
327
|
+
$[68] = t25;
|
|
328
|
+
$[69] = t26;
|
|
329
|
+
$[70] = t34;
|
|
330
|
+
$[71] = t35;
|
|
331
|
+
} else t35 = $[71];
|
|
332
|
+
let t36;
|
|
333
|
+
if ($[72] !== t) {
|
|
334
|
+
t36 = t("common.cancel");
|
|
335
|
+
$[72] = t;
|
|
336
|
+
$[73] = t36;
|
|
337
|
+
} else t36 = $[73];
|
|
338
|
+
let t37;
|
|
339
|
+
if ($[74] !== DialogClose || $[75] !== t36) {
|
|
340
|
+
t37 = /* @__PURE__ */ jsx(DialogClose, {
|
|
341
|
+
className: "border-input rounded border px-4 py-1.5 text-[13px]",
|
|
342
|
+
children: t36
|
|
343
|
+
});
|
|
344
|
+
$[74] = DialogClose;
|
|
345
|
+
$[75] = t36;
|
|
346
|
+
$[76] = t37;
|
|
347
|
+
} else t37 = $[76];
|
|
348
|
+
let t38;
|
|
349
|
+
if ($[77] !== t) {
|
|
350
|
+
t38 = t("common.apply");
|
|
351
|
+
$[77] = t;
|
|
352
|
+
$[78] = t38;
|
|
353
|
+
} else t38 = $[78];
|
|
354
|
+
let t39;
|
|
355
|
+
if ($[79] !== handleApply || $[80] !== t38) {
|
|
356
|
+
t39 = /* @__PURE__ */ jsx("button", {
|
|
357
|
+
className: "bg-primary text-primary-foreground rounded px-4 py-1.5 text-[13px] font-medium",
|
|
358
|
+
onClick: handleApply,
|
|
359
|
+
type: "button",
|
|
360
|
+
children: t38
|
|
361
|
+
});
|
|
362
|
+
$[79] = handleApply;
|
|
363
|
+
$[80] = t38;
|
|
364
|
+
$[81] = t39;
|
|
365
|
+
} else t39 = $[81];
|
|
366
|
+
let t40;
|
|
367
|
+
if ($[82] !== t37 || $[83] !== t39) {
|
|
368
|
+
t40 = /* @__PURE__ */ jsxs("div", {
|
|
369
|
+
className: "flex justify-end gap-2 border-t px-5 py-3",
|
|
370
|
+
children: [t37, t39]
|
|
371
|
+
});
|
|
372
|
+
$[82] = t37;
|
|
373
|
+
$[83] = t39;
|
|
374
|
+
$[84] = t40;
|
|
375
|
+
} else t40 = $[84];
|
|
376
|
+
let t41;
|
|
377
|
+
if ($[85] !== DialogPopup || $[86] !== t12 || $[87] !== t35 || $[88] !== t40) {
|
|
378
|
+
t41 = /* @__PURE__ */ jsxs(DialogPopup, {
|
|
379
|
+
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",
|
|
380
|
+
children: [
|
|
381
|
+
t12,
|
|
382
|
+
t35,
|
|
383
|
+
t40
|
|
384
|
+
]
|
|
385
|
+
});
|
|
386
|
+
$[85] = DialogPopup;
|
|
387
|
+
$[86] = t12;
|
|
388
|
+
$[87] = t35;
|
|
389
|
+
$[88] = t40;
|
|
390
|
+
$[89] = t41;
|
|
391
|
+
} else t41 = $[89];
|
|
392
|
+
let t42;
|
|
393
|
+
if ($[90] !== DialogPortal || $[91] !== t10 || $[92] !== t41) {
|
|
394
|
+
t42 = /* @__PURE__ */ jsxs(DialogPortal, { children: [t10, t41] });
|
|
395
|
+
$[90] = DialogPortal;
|
|
396
|
+
$[91] = t10;
|
|
397
|
+
$[92] = t41;
|
|
398
|
+
$[93] = t42;
|
|
399
|
+
} else t42 = $[93];
|
|
400
|
+
let t43;
|
|
401
|
+
if ($[94] !== Dialog || $[95] !== handleOpenChange || $[96] !== isOpen || $[97] !== t42) {
|
|
402
|
+
t43 = /* @__PURE__ */ jsx(Dialog, {
|
|
403
|
+
open: isOpen,
|
|
404
|
+
onOpenChange: handleOpenChange,
|
|
405
|
+
children: t42
|
|
406
|
+
});
|
|
407
|
+
$[94] = Dialog;
|
|
408
|
+
$[95] = handleOpenChange;
|
|
409
|
+
$[96] = isOpen;
|
|
410
|
+
$[97] = t42;
|
|
411
|
+
$[98] = t43;
|
|
412
|
+
} else t43 = $[98];
|
|
413
|
+
return t43;
|
|
414
|
+
}
|
|
415
|
+
//#endregion
|
|
416
|
+
export { TablePropertiesDialog_exports as n, TablePropertiesDialog as t };
|
|
@@ -379,9 +379,11 @@ const TextContextMenu = ({ isOpen, position, hasSelection, isEditable, hasClipbo
|
|
|
379
379
|
onAction,
|
|
380
380
|
onClose
|
|
381
381
|
]);
|
|
382
|
-
|
|
382
|
+
const [previousOpen, setPreviousOpen] = useState(isOpen);
|
|
383
|
+
if (previousOpen !== isOpen) {
|
|
384
|
+
setPreviousOpen(isOpen);
|
|
383
385
|
if (isOpen) setHighlightedIndex(0);
|
|
384
|
-
}
|
|
386
|
+
}
|
|
385
387
|
const getMenuStyle = useCallback(() => {
|
|
386
388
|
const menuWidth = 220;
|
|
387
389
|
const menuHeight = menuItems.length * 36 + 16;
|
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-T2p_qqNU.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";
|