@stll/folio-react 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/{CommentsSidebar-_utmEkA9.js → CommentsSidebar-Byn5lyrt.js} +127 -130
  2. package/dist/{FindReplaceDialog-DLdBekSR.js → FindReplaceDialog-CqKK82nE.js} +23 -18
  3. package/dist/FootnotePropertiesDialog-CixRdIiT.js +822 -0
  4. package/dist/ImagePositionDialog-DNodkoI2.js +1065 -0
  5. package/dist/ImagePropertiesDialog-CLsDIUWb.js +613 -0
  6. package/dist/InsertSymbolDialog-DCFLmfzn.js +376 -0
  7. package/dist/PageSetupDialog-COkgeOQn.js +820 -0
  8. package/dist/TablePropertiesDialog-B_AGrPR8.js +434 -0
  9. package/dist/{TextContextMenu-CG0V37wi.js → TextContextMenu-Ci7-M4oU.js} +199 -79
  10. package/dist/compat/eigenpal.d.ts +1 -1
  11. package/dist/compat/eigenpal.js +89 -17
  12. package/dist/dialogChrome-BoGYPgeu.js +26 -0
  13. package/dist/{dialogs-CzvXYJyG.js → dialogs-Bj2PdycR.js} +608 -352
  14. package/dist/{dialogs-j7qyw17x.d.ts → dialogs-DK8OVUT_.d.ts} +13 -1
  15. package/dist/dialogs.d.ts +2 -2
  16. package/dist/dialogs.js +9 -8
  17. package/dist/editor.css +1 -1
  18. package/dist/folio-ui-BgDDRsUX.js +1013 -0
  19. package/dist/index.d.ts +5 -4
  20. package/dist/index.js +12 -11
  21. package/dist/{renderAsync-B7UJsZye.d.ts → renderAsync-BmxQE7iO.d.ts} +12 -3
  22. package/dist/{renderAsync-CwHTsxBN.js → renderAsync-BtWYvQMT.js} +5717 -3275
  23. package/dist/standalone.css +1 -1
  24. package/package.json +8 -6
  25. package/dist/FootnotePropertiesDialog-CUjq9c6H.js +0 -267
  26. package/dist/ImagePositionDialog-BMuO9rLT.js +0 -395
  27. package/dist/ImagePropertiesDialog-C8iEgdmN.js +0 -198
  28. package/dist/PageSetupDialog-BKsSMCGb.js +0 -312
  29. package/dist/TablePropertiesDialog-Dw8gvL78.js +0 -159
  30. package/dist/useFindReplace-BPBpMWS9.js +0 -842
@@ -1,267 +0,0 @@
1
- import { t as __exportAll } from "./rolldown-runtime-BBjsoOtd.js";
2
- import { o as useFolioUI } from "./useFindReplace-BPBpMWS9.js";
3
- import { useId, useState } from "react";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
- //#region src/components/dialogs/FootnotePropertiesDialog.tsx
6
- /**
7
- * Footnote & Endnote Properties Dialog
8
- *
9
- * Edits position, numbering format, start number, and restart rules.
10
- */
11
- var FootnotePropertiesDialog_exports = /* @__PURE__ */ __exportAll({ FootnotePropertiesDialog: () => FootnotePropertiesDialog });
12
- const numberFormatOptions = [
13
- {
14
- value: "decimal",
15
- label: "1, 2, 3, ..."
16
- },
17
- {
18
- value: "lowerRoman",
19
- label: "i, ii, iii, ..."
20
- },
21
- {
22
- value: "upperRoman",
23
- label: "I, II, III, ..."
24
- },
25
- {
26
- value: "lowerLetter",
27
- label: "a, b, c, ..."
28
- },
29
- {
30
- value: "upperLetter",
31
- label: "A, B, C, ..."
32
- },
33
- {
34
- value: "chicago",
35
- label: "*, †, ‡, ..."
36
- }
37
- ];
38
- function FootnotePropertiesDialog({ isOpen, onClose, onApply, footnotePr, endnotePr }) {
39
- const { Root: Dialog, Portal: DialogPortal, Backdrop: DialogBackdrop, Popup: DialogPopup, Title: DialogTitle, Close: DialogClose } = useFolioUI().Dialog;
40
- const id = useId();
41
- const [fnPosition, setFnPosition] = useState(footnotePr?.position ?? "pageBottom");
42
- const [fnNumFmt, setFnNumFmt] = useState(footnotePr?.numFmt ?? "decimal");
43
- const [fnNumStart, setFnNumStart] = useState(footnotePr?.numStart ?? 1);
44
- const [fnRestart, setFnRestart] = useState(footnotePr?.numRestart ?? "continuous");
45
- const [enPosition, setEnPosition] = useState(endnotePr?.position ?? "docEnd");
46
- const [enNumFmt, setEnNumFmt] = useState(endnotePr?.numFmt ?? "lowerRoman");
47
- const [enNumStart, setEnNumStart] = useState(endnotePr?.numStart ?? 1);
48
- const [enRestart, setEnRestart] = useState(endnotePr?.numRestart ?? "continuous");
49
- const handleApply = () => {
50
- onApply({
51
- position: fnPosition,
52
- numFmt: fnNumFmt,
53
- numStart: fnNumStart,
54
- numRestart: fnRestart
55
- }, {
56
- position: enPosition,
57
- numFmt: enNumFmt,
58
- numStart: enNumStart,
59
- numRestart: enRestart
60
- });
61
- onClose();
62
- };
63
- const labelCls = "block text-muted-foreground mb-1 text-xs";
64
- const selectCls = "border-input bg-background text-foreground mb-2 w-full rounded border px-2 py-1 text-[13px] outline-none";
65
- const inputCls = "border-input bg-background text-foreground w-[60px] rounded border px-2 py-1 text-[13px] outline-none";
66
- const sectionCls = "mb-4 rounded border p-3";
67
- const fieldIds = {
68
- fnPosition: `${id}-fn-position`,
69
- fnNumFmt: `${id}-fn-num-fmt`,
70
- fnStartAt: `${id}-fn-start-at`,
71
- fnNumbering: `${id}-fn-numbering`,
72
- enPosition: `${id}-en-position`,
73
- enNumFmt: `${id}-en-num-fmt`,
74
- enStartAt: `${id}-en-start-at`,
75
- enNumbering: `${id}-en-numbering`
76
- };
77
- return /* @__PURE__ */ jsx(Dialog, {
78
- open: isOpen,
79
- onOpenChange: (open) => {
80
- if (!open) onClose();
81
- },
82
- children: /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogBackdrop, { className: "fixed inset-0 z-[10000] bg-black/50" }), /* @__PURE__ */ jsxs(DialogPopup, {
83
- className: "bg-popover fixed start-1/2 top-1/2 z-[10001] w-full max-w-[500px] min-w-[400px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-xl",
84
- children: [
85
- /* @__PURE__ */ jsx(DialogTitle, {
86
- className: "border-b px-5 py-3 text-base font-semibold",
87
- children: "Footnote & Endnote Properties"
88
- }),
89
- /* @__PURE__ */ jsxs("div", {
90
- className: "flex flex-col gap-3 px-5 py-4",
91
- children: [/* @__PURE__ */ jsxs("div", {
92
- className: sectionCls,
93
- children: [
94
- /* @__PURE__ */ jsx("h4", {
95
- className: "mb-2 text-sm font-semibold",
96
- children: "Footnotes"
97
- }),
98
- /* @__PURE__ */ jsx("label", {
99
- htmlFor: fieldIds.fnPosition,
100
- className: labelCls,
101
- children: "Position"
102
- }),
103
- /* @__PURE__ */ jsxs("select", {
104
- id: fieldIds.fnPosition,
105
- className: selectCls,
106
- value: fnPosition,
107
- onChange: (e) => setFnPosition(e.target.value),
108
- children: [/* @__PURE__ */ jsx("option", {
109
- value: "pageBottom",
110
- children: "Bottom of page"
111
- }), /* @__PURE__ */ jsx("option", {
112
- value: "beneathText",
113
- children: "Below text"
114
- })]
115
- }),
116
- /* @__PURE__ */ jsx("label", {
117
- htmlFor: fieldIds.fnNumFmt,
118
- className: labelCls,
119
- children: "Number format"
120
- }),
121
- /* @__PURE__ */ jsx("select", {
122
- id: fieldIds.fnNumFmt,
123
- className: selectCls,
124
- value: fnNumFmt,
125
- onChange: (e) => setFnNumFmt(e.target.value),
126
- children: numberFormatOptions.map((o) => /* @__PURE__ */ jsx("option", {
127
- value: o.value,
128
- children: o.label
129
- }, o.value))
130
- }),
131
- /* @__PURE__ */ jsxs("div", {
132
- className: "flex items-center gap-3",
133
- children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
134
- htmlFor: fieldIds.fnStartAt,
135
- className: labelCls,
136
- children: "Start at"
137
- }), /* @__PURE__ */ jsx("input", {
138
- id: fieldIds.fnStartAt,
139
- type: "number",
140
- min: 1,
141
- className: inputCls,
142
- value: fnNumStart,
143
- onChange: (e) => setFnNumStart(Number.parseInt(e.target.value, 10) || 1)
144
- })] }), /* @__PURE__ */ jsxs("div", {
145
- className: "flex-1",
146
- children: [/* @__PURE__ */ jsx("label", {
147
- htmlFor: fieldIds.fnNumbering,
148
- className: labelCls,
149
- children: "Numbering"
150
- }), /* @__PURE__ */ jsxs("select", {
151
- id: fieldIds.fnNumbering,
152
- className: selectCls,
153
- value: fnRestart,
154
- onChange: (e) => setFnRestart(e.target.value),
155
- children: [
156
- /* @__PURE__ */ jsx("option", {
157
- value: "continuous",
158
- children: "Continuous"
159
- }),
160
- /* @__PURE__ */ jsx("option", {
161
- value: "eachSect",
162
- children: "Restart each section"
163
- }),
164
- /* @__PURE__ */ jsx("option", {
165
- value: "eachPage",
166
- children: "Restart each page"
167
- })
168
- ]
169
- })]
170
- })]
171
- })
172
- ]
173
- }), /* @__PURE__ */ jsxs("div", {
174
- className: sectionCls,
175
- children: [
176
- /* @__PURE__ */ jsx("h4", {
177
- className: "mb-2 text-sm font-semibold",
178
- children: "Endnotes"
179
- }),
180
- /* @__PURE__ */ jsx("label", {
181
- htmlFor: fieldIds.enPosition,
182
- className: labelCls,
183
- children: "Position"
184
- }),
185
- /* @__PURE__ */ jsxs("select", {
186
- id: fieldIds.enPosition,
187
- className: selectCls,
188
- value: enPosition,
189
- onChange: (e) => setEnPosition(e.target.value),
190
- children: [/* @__PURE__ */ jsx("option", {
191
- value: "docEnd",
192
- children: "End of document"
193
- }), /* @__PURE__ */ jsx("option", {
194
- value: "sectEnd",
195
- children: "End of section"
196
- })]
197
- }),
198
- /* @__PURE__ */ jsx("label", {
199
- htmlFor: fieldIds.enNumFmt,
200
- className: labelCls,
201
- children: "Number format"
202
- }),
203
- /* @__PURE__ */ jsx("select", {
204
- id: fieldIds.enNumFmt,
205
- className: selectCls,
206
- value: enNumFmt,
207
- onChange: (e) => setEnNumFmt(e.target.value),
208
- children: numberFormatOptions.map((o) => /* @__PURE__ */ jsx("option", {
209
- value: o.value,
210
- children: o.label
211
- }, o.value))
212
- }),
213
- /* @__PURE__ */ jsxs("div", {
214
- className: "flex items-center gap-3",
215
- children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
216
- htmlFor: fieldIds.enStartAt,
217
- className: labelCls,
218
- children: "Start at"
219
- }), /* @__PURE__ */ jsx("input", {
220
- id: fieldIds.enStartAt,
221
- type: "number",
222
- min: 1,
223
- className: inputCls,
224
- value: enNumStart,
225
- onChange: (e) => setEnNumStart(Number.parseInt(e.target.value, 10) || 1)
226
- })] }), /* @__PURE__ */ jsxs("div", {
227
- className: "flex-1",
228
- children: [/* @__PURE__ */ jsx("label", {
229
- htmlFor: fieldIds.enNumbering,
230
- className: labelCls,
231
- children: "Numbering"
232
- }), /* @__PURE__ */ jsxs("select", {
233
- id: fieldIds.enNumbering,
234
- className: selectCls,
235
- value: enRestart,
236
- onChange: (e) => setEnRestart(e.target.value),
237
- children: [/* @__PURE__ */ jsx("option", {
238
- value: "continuous",
239
- children: "Continuous"
240
- }), /* @__PURE__ */ jsx("option", {
241
- value: "eachSect",
242
- children: "Restart each section"
243
- })]
244
- })]
245
- })]
246
- })
247
- ]
248
- })]
249
- }),
250
- /* @__PURE__ */ jsxs("div", {
251
- className: "flex justify-end gap-2 border-t px-5 py-3",
252
- children: [/* @__PURE__ */ jsx(DialogClose, {
253
- className: "border-input rounded border px-4 py-1.5 text-[13px]",
254
- children: "Cancel"
255
- }), /* @__PURE__ */ jsx("button", {
256
- className: "bg-primary text-primary-foreground rounded px-4 py-1.5 text-[13px] font-medium",
257
- onClick: handleApply,
258
- type: "button",
259
- children: "Apply"
260
- })]
261
- })
262
- ]
263
- })] })
264
- });
265
- }
266
- //#endregion
267
- export { FootnotePropertiesDialog_exports as n, FootnotePropertiesDialog as t };
@@ -1,395 +0,0 @@
1
- import { t as __exportAll } from "./rolldown-runtime-BBjsoOtd.js";
2
- import { o as useFolioUI } from "./useFindReplace-BPBpMWS9.js";
3
- import { useEffect, useId, useState } from "react";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
- //#region src/components/dialogs/ImagePositionDialog.tsx
6
- /**
7
- * Image Position Dialog
8
- *
9
- * Modal for editing image positioning settings:
10
- * - Horizontal: alignment or offset, relative to page/column/margin/paragraph
11
- * - Vertical: alignment or offset, relative to page/margin/paragraph/line
12
- * - Distance from text (top/bottom/left/right)
13
- */
14
- var ImagePositionDialog_exports = /* @__PURE__ */ __exportAll({ ImagePositionDialog: () => ImagePositionDialog });
15
- function ImagePositionDialog({ isOpen, onClose, onApply, currentData }) {
16
- const { Root: Dialog, Portal: DialogPortal, Backdrop: DialogBackdrop, Popup: DialogPopup, Title: DialogTitle, Close: DialogClose } = useFolioUI().Dialog;
17
- const id = useId();
18
- const [hMode, setHMode] = useState("align");
19
- const [hAlign, setHAlign] = useState("center");
20
- const [hRelativeTo, setHRelativeTo] = useState("column");
21
- const [hOffset, setHOffset] = useState(0);
22
- const [vMode, setVMode] = useState("align");
23
- const [vAlign, setVAlign] = useState("top");
24
- const [vRelativeTo, setVRelativeTo] = useState("paragraph");
25
- const [vOffset, setVOffset] = useState(0);
26
- const [distTop, setDistTop] = useState(0);
27
- const [distBottom, setDistBottom] = useState(0);
28
- const [distLeft, setDistLeft] = useState(0);
29
- const [distRight, setDistRight] = useState(0);
30
- useEffect(() => {
31
- if (!isOpen) return;
32
- const h = currentData?.horizontal;
33
- const v = currentData?.vertical;
34
- if (h?.align) {
35
- setHMode("align");
36
- setHAlign(h.align);
37
- } else if (h?.posOffset !== void 0) {
38
- setHMode("offset");
39
- setHOffset(h.posOffset);
40
- }
41
- if (h?.relativeTo) setHRelativeTo(h.relativeTo);
42
- if (v?.align) {
43
- setVMode("align");
44
- setVAlign(v.align);
45
- } else if (v?.posOffset !== void 0) {
46
- setVMode("offset");
47
- setVOffset(v.posOffset);
48
- }
49
- if (v?.relativeTo) setVRelativeTo(v.relativeTo);
50
- setDistTop(currentData?.distTop ?? 0);
51
- setDistBottom(currentData?.distBottom ?? 0);
52
- setDistLeft(currentData?.distLeft ?? 0);
53
- setDistRight(currentData?.distRight ?? 0);
54
- }, [isOpen, currentData]);
55
- const handleApply = () => {
56
- const data = {};
57
- data.horizontal = {
58
- relativeTo: hRelativeTo,
59
- ...hMode === "align" ? { align: hAlign } : { posOffset: hOffset }
60
- };
61
- data.vertical = {
62
- relativeTo: vRelativeTo,
63
- ...vMode === "align" ? { align: vAlign } : { posOffset: vOffset }
64
- };
65
- data.distTop = distTop;
66
- data.distBottom = distBottom;
67
- data.distLeft = distLeft;
68
- data.distRight = distRight;
69
- onApply(data);
70
- onClose();
71
- };
72
- const labelCls = "w-[75px] text-muted-foreground text-xs";
73
- const inputCls = "border-input bg-background text-foreground flex-1 rounded border px-1.5 py-1 text-xs outline-none";
74
- const sectionLabelCls = "text-foreground text-[13px] font-semibold";
75
- const distLabelCls = "w-[45px] text-muted-foreground text-xs";
76
- const fieldIds = {
77
- hMode: `${id}-img-pos-h-mode`,
78
- hAlign: `${id}-img-pos-h-align`,
79
- hOffset: `${id}-img-pos-h-offset`,
80
- hRelativeTo: `${id}-img-pos-h-rel`,
81
- vMode: `${id}-img-pos-v-mode`,
82
- vAlign: `${id}-img-pos-v-align`,
83
- vOffset: `${id}-img-pos-v-offset`,
84
- vRelativeTo: `${id}-img-pos-v-rel`,
85
- distTop: `${id}-img-pos-dist-top`,
86
- distBottom: `${id}-img-pos-dist-bottom`,
87
- distLeft: `${id}-img-pos-dist-left`,
88
- distRight: `${id}-img-pos-dist-right`
89
- };
90
- return /* @__PURE__ */ jsx(Dialog, {
91
- open: isOpen,
92
- onOpenChange: (open) => {
93
- if (!open) onClose();
94
- },
95
- children: /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogBackdrop, { className: "fixed inset-0 z-[10000] bg-black/50" }), /* @__PURE__ */ jsxs(DialogPopup, {
96
- 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",
97
- children: [
98
- /* @__PURE__ */ jsx(DialogTitle, {
99
- className: "border-b px-5 py-3 text-base font-semibold",
100
- children: "Image Position"
101
- }),
102
- /* @__PURE__ */ jsxs("div", {
103
- className: "flex flex-col gap-4 px-5 py-4",
104
- children: [
105
- /* @__PURE__ */ jsxs("div", {
106
- className: "flex flex-col gap-2",
107
- children: [
108
- /* @__PURE__ */ jsx("div", {
109
- className: sectionLabelCls,
110
- children: "Horizontal"
111
- }),
112
- /* @__PURE__ */ jsxs("div", {
113
- className: "flex items-center gap-2",
114
- children: [/* @__PURE__ */ jsx("label", {
115
- className: labelCls,
116
- htmlFor: fieldIds.hMode,
117
- children: "Position"
118
- }), /* @__PURE__ */ jsxs("select", {
119
- className: inputCls,
120
- id: fieldIds.hMode,
121
- value: hMode,
122
- onChange: (e) => setHMode(e.target.value),
123
- children: [/* @__PURE__ */ jsx("option", {
124
- value: "align",
125
- children: "Alignment"
126
- }), /* @__PURE__ */ jsx("option", {
127
- value: "offset",
128
- children: "Offset"
129
- })]
130
- })]
131
- }),
132
- hMode === "align" ? /* @__PURE__ */ jsxs("div", {
133
- className: "flex items-center gap-2",
134
- children: [/* @__PURE__ */ jsx("label", {
135
- className: labelCls,
136
- htmlFor: fieldIds.hAlign,
137
- children: "Align"
138
- }), /* @__PURE__ */ jsxs("select", {
139
- className: inputCls,
140
- id: fieldIds.hAlign,
141
- value: hAlign,
142
- onChange: (e) => setHAlign(e.target.value),
143
- children: [
144
- /* @__PURE__ */ jsx("option", {
145
- value: "left",
146
- children: "Left"
147
- }),
148
- /* @__PURE__ */ jsx("option", {
149
- value: "center",
150
- children: "Center"
151
- }),
152
- /* @__PURE__ */ jsx("option", {
153
- value: "right",
154
- children: "Right"
155
- })
156
- ]
157
- })]
158
- }) : /* @__PURE__ */ jsxs("div", {
159
- className: "flex items-center gap-2",
160
- children: [/* @__PURE__ */ jsx("label", {
161
- className: labelCls,
162
- htmlFor: fieldIds.hOffset,
163
- children: "Offset (px)"
164
- }), /* @__PURE__ */ jsx("input", {
165
- className: inputCls,
166
- id: fieldIds.hOffset,
167
- type: "number",
168
- value: hOffset,
169
- onChange: (e) => setHOffset(Number(e.target.value) || 0)
170
- })]
171
- }),
172
- /* @__PURE__ */ jsxs("div", {
173
- className: "flex items-center gap-2",
174
- children: [/* @__PURE__ */ jsx("label", {
175
- className: labelCls,
176
- htmlFor: fieldIds.hRelativeTo,
177
- children: "Relative to"
178
- }), /* @__PURE__ */ jsxs("select", {
179
- className: inputCls,
180
- id: fieldIds.hRelativeTo,
181
- value: hRelativeTo,
182
- onChange: (e) => setHRelativeTo(e.target.value),
183
- children: [
184
- /* @__PURE__ */ jsx("option", {
185
- value: "page",
186
- children: "Page"
187
- }),
188
- /* @__PURE__ */ jsx("option", {
189
- value: "column",
190
- children: "Column"
191
- }),
192
- /* @__PURE__ */ jsx("option", {
193
- value: "margin",
194
- children: "Margin"
195
- }),
196
- /* @__PURE__ */ jsx("option", {
197
- value: "character",
198
- children: "Character"
199
- })
200
- ]
201
- })]
202
- })
203
- ]
204
- }),
205
- /* @__PURE__ */ jsxs("div", {
206
- className: "flex flex-col gap-2",
207
- children: [
208
- /* @__PURE__ */ jsx("div", {
209
- className: sectionLabelCls,
210
- children: "Vertical"
211
- }),
212
- /* @__PURE__ */ jsxs("div", {
213
- className: "flex items-center gap-2",
214
- children: [/* @__PURE__ */ jsx("label", {
215
- className: labelCls,
216
- htmlFor: fieldIds.vMode,
217
- children: "Position"
218
- }), /* @__PURE__ */ jsxs("select", {
219
- className: inputCls,
220
- id: fieldIds.vMode,
221
- value: vMode,
222
- onChange: (e) => setVMode(e.target.value),
223
- children: [/* @__PURE__ */ jsx("option", {
224
- value: "align",
225
- children: "Alignment"
226
- }), /* @__PURE__ */ jsx("option", {
227
- value: "offset",
228
- children: "Offset"
229
- })]
230
- })]
231
- }),
232
- vMode === "align" ? /* @__PURE__ */ jsxs("div", {
233
- className: "flex items-center gap-2",
234
- children: [/* @__PURE__ */ jsx("label", {
235
- className: labelCls,
236
- htmlFor: fieldIds.vAlign,
237
- children: "Align"
238
- }), /* @__PURE__ */ jsxs("select", {
239
- className: inputCls,
240
- id: fieldIds.vAlign,
241
- value: vAlign,
242
- onChange: (e) => setVAlign(e.target.value),
243
- children: [
244
- /* @__PURE__ */ jsx("option", {
245
- value: "top",
246
- children: "Top"
247
- }),
248
- /* @__PURE__ */ jsx("option", {
249
- value: "center",
250
- children: "Center"
251
- }),
252
- /* @__PURE__ */ jsx("option", {
253
- value: "bottom",
254
- children: "Bottom"
255
- })
256
- ]
257
- })]
258
- }) : /* @__PURE__ */ jsxs("div", {
259
- className: "flex items-center gap-2",
260
- children: [/* @__PURE__ */ jsx("label", {
261
- className: labelCls,
262
- htmlFor: fieldIds.vOffset,
263
- children: "Offset (px)"
264
- }), /* @__PURE__ */ jsx("input", {
265
- className: inputCls,
266
- id: fieldIds.vOffset,
267
- type: "number",
268
- value: vOffset,
269
- onChange: (e) => setVOffset(Number(e.target.value) || 0)
270
- })]
271
- }),
272
- /* @__PURE__ */ jsxs("div", {
273
- className: "flex items-center gap-2",
274
- children: [/* @__PURE__ */ jsx("label", {
275
- className: labelCls,
276
- htmlFor: fieldIds.vRelativeTo,
277
- children: "Relative to"
278
- }), /* @__PURE__ */ jsxs("select", {
279
- className: inputCls,
280
- id: fieldIds.vRelativeTo,
281
- value: vRelativeTo,
282
- onChange: (e) => setVRelativeTo(e.target.value),
283
- children: [
284
- /* @__PURE__ */ jsx("option", {
285
- value: "page",
286
- children: "Page"
287
- }),
288
- /* @__PURE__ */ jsx("option", {
289
- value: "margin",
290
- children: "Margin"
291
- }),
292
- /* @__PURE__ */ jsx("option", {
293
- value: "paragraph",
294
- children: "Paragraph"
295
- }),
296
- /* @__PURE__ */ jsx("option", {
297
- value: "line",
298
- children: "Line"
299
- })
300
- ]
301
- })]
302
- })
303
- ]
304
- }),
305
- /* @__PURE__ */ jsxs("div", {
306
- className: "flex flex-col gap-2",
307
- children: [/* @__PURE__ */ jsx("div", {
308
- className: sectionLabelCls,
309
- children: "Distance from text (px)"
310
- }), /* @__PURE__ */ jsxs("div", {
311
- className: "grid grid-cols-2 gap-2",
312
- children: [
313
- /* @__PURE__ */ jsxs("div", {
314
- className: "flex items-center gap-2",
315
- children: [/* @__PURE__ */ jsx("label", {
316
- className: distLabelCls,
317
- htmlFor: fieldIds.distTop,
318
- children: "Top"
319
- }), /* @__PURE__ */ jsx("input", {
320
- className: inputCls,
321
- id: fieldIds.distTop,
322
- min: 0,
323
- type: "number",
324
- value: distTop,
325
- onChange: (e) => setDistTop(Number(e.target.value) || 0)
326
- })]
327
- }),
328
- /* @__PURE__ */ jsxs("div", {
329
- className: "flex items-center gap-2",
330
- children: [/* @__PURE__ */ jsx("label", {
331
- className: distLabelCls,
332
- htmlFor: fieldIds.distBottom,
333
- children: "Bottom"
334
- }), /* @__PURE__ */ jsx("input", {
335
- className: inputCls,
336
- id: fieldIds.distBottom,
337
- min: 0,
338
- type: "number",
339
- value: distBottom,
340
- onChange: (e) => setDistBottom(Number(e.target.value) || 0)
341
- })]
342
- }),
343
- /* @__PURE__ */ jsxs("div", {
344
- className: "flex items-center gap-2",
345
- children: [/* @__PURE__ */ jsx("label", {
346
- className: distLabelCls,
347
- htmlFor: fieldIds.distLeft,
348
- children: "Left"
349
- }), /* @__PURE__ */ jsx("input", {
350
- className: inputCls,
351
- id: fieldIds.distLeft,
352
- min: 0,
353
- type: "number",
354
- value: distLeft,
355
- onChange: (e) => setDistLeft(Number(e.target.value) || 0)
356
- })]
357
- }),
358
- /* @__PURE__ */ jsxs("div", {
359
- className: "flex items-center gap-2",
360
- children: [/* @__PURE__ */ jsx("label", {
361
- className: distLabelCls,
362
- htmlFor: fieldIds.distRight,
363
- children: "Right"
364
- }), /* @__PURE__ */ jsx("input", {
365
- className: inputCls,
366
- id: fieldIds.distRight,
367
- min: 0,
368
- type: "number",
369
- value: distRight,
370
- onChange: (e) => setDistRight(Number(e.target.value) || 0)
371
- })]
372
- })
373
- ]
374
- })]
375
- })
376
- ]
377
- }),
378
- /* @__PURE__ */ jsxs("div", {
379
- className: "flex justify-end gap-2 border-t px-5 py-3",
380
- children: [/* @__PURE__ */ jsx(DialogClose, {
381
- className: "border-input rounded border px-4 py-1.5 text-[13px]",
382
- children: "Cancel"
383
- }), /* @__PURE__ */ jsx("button", {
384
- className: "bg-primary text-primary-foreground rounded px-4 py-1.5 text-[13px] font-medium",
385
- onClick: handleApply,
386
- type: "button",
387
- children: "Apply"
388
- })]
389
- })
390
- ]
391
- })] })
392
- });
393
- }
394
- //#endregion
395
- export { ImagePositionDialog_exports as n, ImagePositionDialog as t };