@stll/folio-react 0.6.0 → 0.7.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/dist/{CommentsSidebar-_utmEkA9.js → CommentsSidebar-B8X5a8JW.js} +126 -129
- package/dist/{FindReplaceDialog-DLdBekSR.js → FindReplaceDialog-Bx7QaFQ_.js} +23 -18
- package/dist/FootnotePropertiesDialog-2lmpg9m8.js +646 -0
- package/dist/ImagePositionDialog-D3MileYL.js +842 -0
- package/dist/ImagePropertiesDialog-CzK8HCaW.js +465 -0
- package/dist/InsertSymbolDialog-Df9dyLvn.js +376 -0
- package/dist/PageSetupDialog-PSs9YdPb.js +684 -0
- package/dist/TablePropertiesDialog-PQxKKM0Y.js +344 -0
- package/dist/{TextContextMenu-CG0V37wi.js → TextContextMenu-Ci7-M4oU.js} +199 -79
- package/dist/compat/eigenpal.d.ts +1 -1
- package/dist/compat/eigenpal.js +89 -17
- package/dist/dialogChrome-BoGYPgeu.js +26 -0
- package/dist/{dialogs-j7qyw17x.d.ts → dialogs-DK8OVUT_.d.ts} +13 -1
- package/dist/{dialogs-CzvXYJyG.js → dialogs-DsHnfN0g.js} +508 -316
- package/dist/dialogs.d.ts +2 -2
- package/dist/dialogs.js +9 -8
- package/dist/editor.css +1 -1
- package/dist/folio-ui-C-85DSuK.js +1011 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +12 -11
- package/dist/{renderAsync-B7UJsZye.d.ts → renderAsync-ChQI9UJG.d.ts} +11 -3
- package/dist/{renderAsync-CwHTsxBN.js → renderAsync-evdyE_GW.js} +5593 -3256
- package/dist/standalone.css +1 -1
- package/package.json +8 -6
- package/dist/FootnotePropertiesDialog-CUjq9c6H.js +0 -267
- package/dist/ImagePositionDialog-BMuO9rLT.js +0 -395
- package/dist/ImagePropertiesDialog-C8iEgdmN.js +0 -198
- package/dist/PageSetupDialog-BKsSMCGb.js +0 -312
- package/dist/TablePropertiesDialog-Dw8gvL78.js +0 -159
- package/dist/useFindReplace-BPBpMWS9.js +0 -842
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as useFolioUI } from "./folio-ui-C-85DSuK.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";
|
|
2
4
|
import { useEffect, useId, useState } from "react";
|
|
3
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
//#region src/components/dialogs/dialogChrome.ts
|
|
5
|
-
const DIALOG_BACKDROP_CLASS = "fixed inset-0 z-[10000] bg-black/50";
|
|
6
|
-
const DIALOG_POPUP_CLASS = "bg-popover fixed start-1/2 top-1/2 z-[10001] w-full max-w-[520px] min-w-[360px] -translate-x-1/2 -translate-y-1/2 rounded-lg border shadow-xl";
|
|
7
|
-
const DIALOG_TITLE_CLASS = "border-b px-5 py-3 text-base font-semibold";
|
|
8
|
-
const DIALOG_BODY_CLASS = "flex flex-col gap-4 px-5 py-4";
|
|
9
|
-
const DIALOG_FOOTER_CLASS = "flex justify-end gap-2 border-t px-5 py-3";
|
|
10
|
-
const DIALOG_LABEL_CLASS = "text-muted-foreground text-[13px]";
|
|
11
|
-
const DIALOG_INPUT_CLASS = "border-input bg-background text-foreground rounded border px-2 py-1.5 text-[13px] outline-none";
|
|
12
|
-
const DIALOG_SECONDARY_BUTTON_CLASS = "border-input rounded border px-4 py-1.5 text-[13px]";
|
|
13
|
-
const DIALOG_PRIMARY_BUTTON_CLASS = "bg-primary text-primary-foreground rounded px-4 py-1.5 text-[13px] font-medium disabled:cursor-not-allowed disabled:opacity-50";
|
|
14
|
-
//#endregion
|
|
15
6
|
//#region src/components/dialogs/HyperlinkDialog.tsx
|
|
16
7
|
function HyperlinkDialog({ isOpen, onClose, onSubmit, onRemove, currentData, selectedText, bookmarks = [] }) {
|
|
17
8
|
const { Root: Dialog, Portal: DialogPortal, Backdrop: DialogBackdrop, Popup: DialogPopup, Title: DialogTitle, Close: DialogClose } = useFolioUI().Dialog;
|
|
9
|
+
const handleOpenChange = useCloseOnDialogOpenChange(onClose);
|
|
18
10
|
const id = useId();
|
|
19
11
|
const [targetType, setTargetType] = useState("url");
|
|
20
12
|
const [url, setUrl] = useState("");
|
|
@@ -57,10 +49,10 @@ function HyperlinkDialog({ isOpen, onClose, onSubmit, onRemove, currentData, sel
|
|
|
57
49
|
const handleSubmit = () => {
|
|
58
50
|
setTouched(true);
|
|
59
51
|
if (!canSubmit) return;
|
|
60
|
-
const
|
|
52
|
+
const href_0 = targetType === "bookmark" ? `#${bookmark.trim()}` : normalizeUrl(url);
|
|
61
53
|
onSubmit({
|
|
62
|
-
href,
|
|
63
|
-
displayText: displayText.trim() ||
|
|
54
|
+
href: href_0,
|
|
55
|
+
displayText: displayText.trim() || href_0,
|
|
64
56
|
...tooltip.trim() ? { tooltip: tooltip.trim() } : {}
|
|
65
57
|
});
|
|
66
58
|
onClose();
|
|
@@ -71,9 +63,7 @@ function HyperlinkDialog({ isOpen, onClose, onSubmit, onRemove, currentData, sel
|
|
|
71
63
|
};
|
|
72
64
|
return /* @__PURE__ */ jsx(Dialog, {
|
|
73
65
|
open: isOpen,
|
|
74
|
-
onOpenChange:
|
|
75
|
-
if (!open) onClose();
|
|
76
|
-
},
|
|
66
|
+
onOpenChange: handleOpenChange,
|
|
77
67
|
children: /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogBackdrop, { className: DIALOG_BACKDROP_CLASS }), /* @__PURE__ */ jsxs(DialogPopup, {
|
|
78
68
|
className: DIALOG_POPUP_CLASS,
|
|
79
69
|
children: [
|
|
@@ -117,7 +107,7 @@ function HyperlinkDialog({ isOpen, onClose, onSubmit, onRemove, currentData, sel
|
|
|
117
107
|
className: "border-input bg-background text-foreground rounded border px-2 py-1.5 text-[13px] outline-none",
|
|
118
108
|
id: fieldIds.url,
|
|
119
109
|
onBlur: () => setTouched(true),
|
|
120
|
-
onChange: (
|
|
110
|
+
onChange: (e_0) => setUrl(e_0.target.value),
|
|
121
111
|
placeholder: "https://example.com",
|
|
122
112
|
value: url
|
|
123
113
|
}),
|
|
@@ -136,7 +126,7 @@ function HyperlinkDialog({ isOpen, onClose, onSubmit, onRemove, currentData, sel
|
|
|
136
126
|
}), /* @__PURE__ */ jsxs("select", {
|
|
137
127
|
className: "border-input bg-background text-foreground rounded border px-2 py-1.5 text-[13px] outline-none",
|
|
138
128
|
id: fieldIds.bookmark,
|
|
139
|
-
onChange: (
|
|
129
|
+
onChange: (e_1) => setBookmark(e_1.target.value),
|
|
140
130
|
value: bookmark,
|
|
141
131
|
children: [/* @__PURE__ */ jsx("option", {
|
|
142
132
|
value: "",
|
|
@@ -156,7 +146,7 @@ function HyperlinkDialog({ isOpen, onClose, onSubmit, onRemove, currentData, sel
|
|
|
156
146
|
}), /* @__PURE__ */ jsx("input", {
|
|
157
147
|
className: DIALOG_INPUT_CLASS,
|
|
158
148
|
id: fieldIds.displayText,
|
|
159
|
-
onChange: (
|
|
149
|
+
onChange: (e_2) => setDisplayText(e_2.target.value),
|
|
160
150
|
value: displayText
|
|
161
151
|
})]
|
|
162
152
|
}),
|
|
@@ -169,7 +159,7 @@ function HyperlinkDialog({ isOpen, onClose, onSubmit, onRemove, currentData, sel
|
|
|
169
159
|
}), /* @__PURE__ */ jsx("input", {
|
|
170
160
|
className: DIALOG_INPUT_CLASS,
|
|
171
161
|
id: fieldIds.tooltip,
|
|
172
|
-
onChange: (
|
|
162
|
+
onChange: (e_3) => setTooltip(e_3.target.value),
|
|
173
163
|
value: tooltip
|
|
174
164
|
})]
|
|
175
165
|
})
|
|
@@ -225,6 +215,7 @@ function normalizeUrl(value) {
|
|
|
225
215
|
//#region src/components/dialogs/InsertImageDialog.tsx
|
|
226
216
|
function InsertImageDialog({ isOpen, onClose, onInsert, accept = "image/png,image/jpeg,image/gif,image/webp" }) {
|
|
227
217
|
const { Root: Dialog, Portal: DialogPortal, Backdrop: DialogBackdrop, Popup: DialogPopup, Title: DialogTitle, Close: DialogClose } = useFolioUI().Dialog;
|
|
218
|
+
const handleOpenChange = useCloseOnDialogOpenChange(onClose);
|
|
228
219
|
const id = useId();
|
|
229
220
|
const [file, setFile] = useState(null);
|
|
230
221
|
const [alt, setAlt] = useState("");
|
|
@@ -257,9 +248,7 @@ function InsertImageDialog({ isOpen, onClose, onInsert, accept = "image/png,imag
|
|
|
257
248
|
};
|
|
258
249
|
return /* @__PURE__ */ jsx(Dialog, {
|
|
259
250
|
open: isOpen,
|
|
260
|
-
onOpenChange:
|
|
261
|
-
if (!open) onClose();
|
|
262
|
-
},
|
|
251
|
+
onOpenChange: handleOpenChange,
|
|
263
252
|
children: /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogBackdrop, { className: DIALOG_BACKDROP_CLASS }), /* @__PURE__ */ jsxs(DialogPopup, {
|
|
264
253
|
className: DIALOG_POPUP_CLASS,
|
|
265
254
|
children: [
|
|
@@ -293,7 +282,7 @@ function InsertImageDialog({ isOpen, onClose, onInsert, accept = "image/png,imag
|
|
|
293
282
|
}), /* @__PURE__ */ jsx("input", {
|
|
294
283
|
className: DIALOG_INPUT_CLASS,
|
|
295
284
|
id: fieldIds.alt,
|
|
296
|
-
onChange: (
|
|
285
|
+
onChange: (e_0) => setAlt(e_0.target.value),
|
|
297
286
|
placeholder: file?.name ?? "",
|
|
298
287
|
value: alt
|
|
299
288
|
})]
|
|
@@ -310,7 +299,7 @@ function InsertImageDialog({ isOpen, onClose, onInsert, accept = "image/png,imag
|
|
|
310
299
|
className: DIALOG_INPUT_CLASS,
|
|
311
300
|
id: fieldIds.width,
|
|
312
301
|
min: 1,
|
|
313
|
-
onChange: (
|
|
302
|
+
onChange: (e_1) => setWidth(e_1.target.value),
|
|
314
303
|
placeholder: "Auto",
|
|
315
304
|
type: "number",
|
|
316
305
|
value: width
|
|
@@ -325,7 +314,7 @@ function InsertImageDialog({ isOpen, onClose, onInsert, accept = "image/png,imag
|
|
|
325
314
|
className: DIALOG_INPUT_CLASS,
|
|
326
315
|
id: fieldIds.height,
|
|
327
316
|
min: 1,
|
|
328
|
-
onChange: (
|
|
317
|
+
onChange: (e_2) => setHeight(e_2.target.value),
|
|
329
318
|
placeholder: "Auto",
|
|
330
319
|
type: "number",
|
|
331
320
|
value: height
|
|
@@ -379,6 +368,7 @@ const DEFAULT_STYLE_OPTIONS = [
|
|
|
379
368
|
];
|
|
380
369
|
function InsertTableDialog({ isOpen, onClose, onInsert, defaultRows = 3, defaultColumns = 3, styleOptions = DEFAULT_STYLE_OPTIONS }) {
|
|
381
370
|
const { Root: Dialog, Portal: DialogPortal, Backdrop: DialogBackdrop, Popup: DialogPopup, Title: DialogTitle, Close: DialogClose } = useFolioUI().Dialog;
|
|
371
|
+
const handleOpenChange = useCloseOnDialogOpenChange(onClose);
|
|
382
372
|
const id = useId();
|
|
383
373
|
const [rows, setRows] = useState(defaultRows);
|
|
384
374
|
const [columns, setColumns] = useState(defaultColumns);
|
|
@@ -420,9 +410,7 @@ function InsertTableDialog({ isOpen, onClose, onInsert, defaultRows = 3, default
|
|
|
420
410
|
};
|
|
421
411
|
return /* @__PURE__ */ jsx(Dialog, {
|
|
422
412
|
open: isOpen,
|
|
423
|
-
onOpenChange:
|
|
424
|
-
if (!open) onClose();
|
|
425
|
-
},
|
|
413
|
+
onOpenChange: handleOpenChange,
|
|
426
414
|
children: /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogBackdrop, { className: DIALOG_BACKDROP_CLASS }), /* @__PURE__ */ jsxs(DialogPopup, {
|
|
427
415
|
className: DIALOG_POPUP_CLASS,
|
|
428
416
|
children: [
|
|
@@ -490,7 +478,7 @@ function InsertTableDialog({ isOpen, onClose, onInsert, defaultRows = 3, default
|
|
|
490
478
|
id: fieldIds.columns,
|
|
491
479
|
max: MAX_COLUMNS,
|
|
492
480
|
min: MIN_COLUMNS,
|
|
493
|
-
onChange: (
|
|
481
|
+
onChange: (e_0) => setColumns(Number(e_0.target.value) || MIN_COLUMNS),
|
|
494
482
|
type: "number",
|
|
495
483
|
value: columns
|
|
496
484
|
})]
|
|
@@ -502,7 +490,7 @@ function InsertTableDialog({ isOpen, onClose, onInsert, defaultRows = 3, default
|
|
|
502
490
|
children: [/* @__PURE__ */ jsx("input", {
|
|
503
491
|
checked: autofit,
|
|
504
492
|
id: fieldIds.autofit,
|
|
505
|
-
onChange: (
|
|
493
|
+
onChange: (e_1) => setAutofit(e_1.target.checked),
|
|
506
494
|
type: "checkbox"
|
|
507
495
|
}), /* @__PURE__ */ jsx("span", {
|
|
508
496
|
className: DIALOG_LABEL_CLASS,
|
|
@@ -518,7 +506,7 @@ function InsertTableDialog({ isOpen, onClose, onInsert, defaultRows = 3, default
|
|
|
518
506
|
}), /* @__PURE__ */ jsxs("select", {
|
|
519
507
|
className: "border-input bg-background text-foreground rounded border px-2 py-1.5 text-[13px] outline-none",
|
|
520
508
|
id: fieldIds.style,
|
|
521
|
-
onChange: (
|
|
509
|
+
onChange: (e_2) => setStyleId(e_2.target.value),
|
|
522
510
|
value: styleId,
|
|
523
511
|
children: [/* @__PURE__ */ jsx("option", {
|
|
524
512
|
value: "",
|
|
@@ -572,6 +560,7 @@ const PASTE_MODES = [
|
|
|
572
560
|
];
|
|
573
561
|
function PasteSpecialDialog({ isOpen, onClose, onPaste, defaultMode = "plainText" }) {
|
|
574
562
|
const { Root: Dialog, Portal: DialogPortal, Backdrop: DialogBackdrop, Popup: DialogPopup, Title: DialogTitle, Close: DialogClose } = useFolioUI().Dialog;
|
|
563
|
+
const handleOpenChange = useCloseOnDialogOpenChange(onClose);
|
|
575
564
|
const id = useId();
|
|
576
565
|
const [mode, setMode] = useState(defaultMode);
|
|
577
566
|
useEffect(() => {
|
|
@@ -583,9 +572,7 @@ function PasteSpecialDialog({ isOpen, onClose, onPaste, defaultMode = "plainText
|
|
|
583
572
|
};
|
|
584
573
|
return /* @__PURE__ */ jsx(Dialog, {
|
|
585
574
|
open: isOpen,
|
|
586
|
-
onOpenChange:
|
|
587
|
-
if (!open) onClose();
|
|
588
|
-
},
|
|
575
|
+
onOpenChange: handleOpenChange,
|
|
589
576
|
children: /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogBackdrop, { className: DIALOG_BACKDROP_CLASS }), /* @__PURE__ */ jsxs(DialogPopup, {
|
|
590
577
|
className: DIALOG_POPUP_CLASS,
|
|
591
578
|
children: [
|
|
@@ -646,6 +633,7 @@ const MIN_PARTS = 1;
|
|
|
646
633
|
const MAX_PARTS = 63;
|
|
647
634
|
function SplitCellDialog({ isOpen, onClose, onSplit, defaultRows = 1, defaultColumns = 2 }) {
|
|
648
635
|
const { Root: Dialog, Portal: DialogPortal, Backdrop: DialogBackdrop, Popup: DialogPopup, Title: DialogTitle, Close: DialogClose } = useFolioUI().Dialog;
|
|
636
|
+
const handleOpenChange = useCloseOnDialogOpenChange(onClose);
|
|
649
637
|
const id = useId();
|
|
650
638
|
const [rows, setRows] = useState(defaultRows);
|
|
651
639
|
const [columns, setColumns] = useState(defaultColumns);
|
|
@@ -679,9 +667,7 @@ function SplitCellDialog({ isOpen, onClose, onSplit, defaultRows = 1, defaultCol
|
|
|
679
667
|
};
|
|
680
668
|
return /* @__PURE__ */ jsx(Dialog, {
|
|
681
669
|
open: isOpen,
|
|
682
|
-
onOpenChange:
|
|
683
|
-
if (!open) onClose();
|
|
684
|
-
},
|
|
670
|
+
onOpenChange: handleOpenChange,
|
|
685
671
|
children: /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogBackdrop, { className: DIALOG_BACKDROP_CLASS }), /* @__PURE__ */ jsxs(DialogPopup, {
|
|
686
672
|
className: DIALOG_POPUP_CLASS,
|
|
687
673
|
children: [
|
|
@@ -719,7 +705,7 @@ function SplitCellDialog({ isOpen, onClose, onSplit, defaultRows = 1, defaultCol
|
|
|
719
705
|
id: fieldIds.rows,
|
|
720
706
|
max: MAX_PARTS,
|
|
721
707
|
min: MIN_PARTS,
|
|
722
|
-
onChange: (
|
|
708
|
+
onChange: (e_0) => setRows(Number(e_0.target.value) || MIN_PARTS),
|
|
723
709
|
type: "number",
|
|
724
710
|
value: rows
|
|
725
711
|
})]
|
|
@@ -730,7 +716,7 @@ function SplitCellDialog({ isOpen, onClose, onSplit, defaultRows = 1, defaultCol
|
|
|
730
716
|
children: [/* @__PURE__ */ jsx("input", {
|
|
731
717
|
checked: mergeBeforeSplit,
|
|
732
718
|
id: fieldIds.mergeBeforeSplit,
|
|
733
|
-
onChange: (
|
|
719
|
+
onChange: (e_1) => setMergeBeforeSplit(e_1.target.checked),
|
|
734
720
|
type: "checkbox"
|
|
735
721
|
}), /* @__PURE__ */ jsx("span", {
|
|
736
722
|
className: DIALOG_LABEL_CLASS,
|
|
@@ -761,8 +747,11 @@ function clampInteger(value) {
|
|
|
761
747
|
//#endregion
|
|
762
748
|
//#region src/components/dialogs/WatermarkDialog.tsx
|
|
763
749
|
const DEFAULT_TEXT_COLOR = "#C0C0C0";
|
|
764
|
-
function WatermarkDialog(
|
|
750
|
+
function WatermarkDialog(t0) {
|
|
751
|
+
const $ = c(100);
|
|
752
|
+
const { isOpen, onClose, onApply, currentWatermark } = t0;
|
|
765
753
|
const { Root: Dialog, Portal: DialogPortal, Backdrop: DialogBackdrop, Popup: DialogPopup, Title: DialogTitle, Close: DialogClose } = useFolioUI().Dialog;
|
|
754
|
+
const handleOpenChange = useCloseOnDialogOpenChange(onClose);
|
|
766
755
|
const id = useId();
|
|
767
756
|
const [mode, setMode] = useState("text");
|
|
768
757
|
const [text, setText] = useState("CONFIDENTIAL");
|
|
@@ -775,289 +764,492 @@ function WatermarkDialog({ isOpen, onClose, onApply, currentWatermark }) {
|
|
|
775
764
|
const [imageTargetExternal, setImageTargetExternal] = useState(false);
|
|
776
765
|
const [scalePercent, setScalePercent] = useState(100);
|
|
777
766
|
const [washout, setWashout] = useState(true);
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
const
|
|
823
|
-
const
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
767
|
+
let t1;
|
|
768
|
+
let t2;
|
|
769
|
+
if ($[0] !== currentWatermark || $[1] !== isOpen) {
|
|
770
|
+
t1 = () => {
|
|
771
|
+
if (!isOpen) return;
|
|
772
|
+
if (!currentWatermark) {
|
|
773
|
+
setMode("text");
|
|
774
|
+
setText("CONFIDENTIAL");
|
|
775
|
+
setFont("Calibri");
|
|
776
|
+
setColor(DEFAULT_TEXT_COLOR);
|
|
777
|
+
setDiagonal(true);
|
|
778
|
+
setOpacityPercent(50);
|
|
779
|
+
setImageRId("");
|
|
780
|
+
setImageTarget("");
|
|
781
|
+
setImageTargetExternal(false);
|
|
782
|
+
setScalePercent(100);
|
|
783
|
+
setWashout(true);
|
|
784
|
+
return;
|
|
785
|
+
}
|
|
786
|
+
setMode(currentWatermark.kind);
|
|
787
|
+
if (currentWatermark.kind === "text") {
|
|
788
|
+
setText(currentWatermark.text);
|
|
789
|
+
setFont(currentWatermark.font ?? "Calibri");
|
|
790
|
+
setColor(toColorInputValue(currentWatermark.color));
|
|
791
|
+
setDiagonal(currentWatermark.diagonal ?? true);
|
|
792
|
+
setOpacityPercent(Math.round((currentWatermark.opacity ?? .5) * 100));
|
|
793
|
+
return;
|
|
794
|
+
}
|
|
795
|
+
setImageRId(currentWatermark.imageRId);
|
|
796
|
+
setImageTarget(currentWatermark.imageTarget ?? "");
|
|
797
|
+
setImageTargetExternal(currentWatermark.imageTargetExternal ?? false);
|
|
798
|
+
setScalePercent(Math.round((currentWatermark.scale ?? 1) * 100));
|
|
799
|
+
setWashout(currentWatermark.washout ?? true);
|
|
800
|
+
};
|
|
801
|
+
t2 = [isOpen, currentWatermark];
|
|
802
|
+
$[0] = currentWatermark;
|
|
803
|
+
$[1] = isOpen;
|
|
804
|
+
$[2] = t1;
|
|
805
|
+
$[3] = t2;
|
|
806
|
+
} else {
|
|
807
|
+
t1 = $[2];
|
|
808
|
+
t2 = $[3];
|
|
809
|
+
}
|
|
810
|
+
useEffect(t1, t2);
|
|
811
|
+
const t3 = `${id}-watermark-mode`;
|
|
812
|
+
const t4 = `${id}-watermark-text`;
|
|
813
|
+
const t5 = `${id}-watermark-font`;
|
|
814
|
+
const t6 = `${id}-watermark-color`;
|
|
815
|
+
const t7 = `${id}-watermark-diagonal`;
|
|
816
|
+
const t8 = `${id}-watermark-opacity`;
|
|
817
|
+
const t9 = `${id}-watermark-image-rid`;
|
|
818
|
+
const t10 = `${id}-watermark-image-target`;
|
|
819
|
+
const t11 = `${id}-watermark-image-external`;
|
|
820
|
+
const t12 = `${id}-watermark-scale`;
|
|
821
|
+
const t13 = `${id}-watermark-washout`;
|
|
822
|
+
let t14;
|
|
823
|
+
if ($[4] !== t10 || $[5] !== t11 || $[6] !== t12 || $[7] !== t13 || $[8] !== t3 || $[9] !== t4 || $[10] !== t5 || $[11] !== t6 || $[12] !== t7 || $[13] !== t8 || $[14] !== t9) {
|
|
824
|
+
t14 = {
|
|
825
|
+
mode: t3,
|
|
826
|
+
text: t4,
|
|
827
|
+
font: t5,
|
|
828
|
+
color: t6,
|
|
829
|
+
diagonal: t7,
|
|
830
|
+
opacity: t8,
|
|
831
|
+
imageRId: t9,
|
|
832
|
+
imageTarget: t10,
|
|
833
|
+
imageTargetExternal: t11,
|
|
834
|
+
scale: t12,
|
|
835
|
+
washout: t13
|
|
836
|
+
};
|
|
837
|
+
$[4] = t10;
|
|
838
|
+
$[5] = t11;
|
|
839
|
+
$[6] = t12;
|
|
840
|
+
$[7] = t13;
|
|
841
|
+
$[8] = t3;
|
|
842
|
+
$[9] = t4;
|
|
843
|
+
$[10] = t5;
|
|
844
|
+
$[11] = t6;
|
|
845
|
+
$[12] = t7;
|
|
846
|
+
$[13] = t8;
|
|
847
|
+
$[14] = t9;
|
|
848
|
+
$[15] = t14;
|
|
849
|
+
} else t14 = $[15];
|
|
850
|
+
const fieldIds = t14;
|
|
851
|
+
let t15;
|
|
852
|
+
if ($[16] !== imageRId || $[17] !== mode || $[18] !== text) {
|
|
853
|
+
t15 = mode === "none" || mode === "text" && text.trim().length > 0 || mode === "picture" && imageRId.trim().length > 0;
|
|
854
|
+
$[16] = imageRId;
|
|
855
|
+
$[17] = mode;
|
|
856
|
+
$[18] = text;
|
|
857
|
+
$[19] = t15;
|
|
858
|
+
} else t15 = $[19];
|
|
859
|
+
const canApply = t15;
|
|
860
|
+
let t16;
|
|
861
|
+
if ($[20] !== canApply || $[21] !== color || $[22] !== diagonal || $[23] !== font || $[24] !== imageRId || $[25] !== imageTarget || $[26] !== imageTargetExternal || $[27] !== mode || $[28] !== onApply || $[29] !== onClose || $[30] !== opacityPercent || $[31] !== scalePercent || $[32] !== text || $[33] !== washout) {
|
|
862
|
+
t16 = () => {
|
|
863
|
+
if (!canApply) return;
|
|
864
|
+
if (mode === "none") {
|
|
865
|
+
onApply(void 0);
|
|
866
|
+
onClose();
|
|
867
|
+
return;
|
|
868
|
+
}
|
|
869
|
+
if (mode === "text") {
|
|
870
|
+
onApply({
|
|
871
|
+
kind: "text",
|
|
872
|
+
text: text.trim(),
|
|
873
|
+
...font.trim() ? { font: font.trim() } : {},
|
|
874
|
+
color: stripHash(color),
|
|
875
|
+
diagonal,
|
|
876
|
+
opacity: clampPercent(opacityPercent) / 100
|
|
877
|
+
});
|
|
878
|
+
onClose();
|
|
879
|
+
return;
|
|
880
|
+
}
|
|
831
881
|
onApply({
|
|
832
|
-
kind: "
|
|
833
|
-
|
|
834
|
-
...
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
882
|
+
kind: "picture",
|
|
883
|
+
imageRId: imageRId.trim(),
|
|
884
|
+
...imageTarget.trim() ? { imageTarget: imageTarget.trim() } : {},
|
|
885
|
+
...imageTarget.trim() ? { imageTargetExternal } : {},
|
|
886
|
+
scale: clampScalePercent(scalePercent) / 100,
|
|
887
|
+
washout
|
|
838
888
|
});
|
|
839
889
|
onClose();
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
890
|
+
};
|
|
891
|
+
$[20] = canApply;
|
|
892
|
+
$[21] = color;
|
|
893
|
+
$[22] = diagonal;
|
|
894
|
+
$[23] = font;
|
|
895
|
+
$[24] = imageRId;
|
|
896
|
+
$[25] = imageTarget;
|
|
897
|
+
$[26] = imageTargetExternal;
|
|
898
|
+
$[27] = mode;
|
|
899
|
+
$[28] = onApply;
|
|
900
|
+
$[29] = onClose;
|
|
901
|
+
$[30] = opacityPercent;
|
|
902
|
+
$[31] = scalePercent;
|
|
903
|
+
$[32] = text;
|
|
904
|
+
$[33] = washout;
|
|
905
|
+
$[34] = t16;
|
|
906
|
+
} else t16 = $[34];
|
|
907
|
+
const handleApply = t16;
|
|
908
|
+
let t17;
|
|
909
|
+
if ($[35] !== DialogBackdrop) {
|
|
910
|
+
t17 = /* @__PURE__ */ jsx(DialogBackdrop, { className: DIALOG_BACKDROP_CLASS });
|
|
911
|
+
$[35] = DialogBackdrop;
|
|
912
|
+
$[36] = t17;
|
|
913
|
+
} else t17 = $[36];
|
|
914
|
+
let t18;
|
|
915
|
+
if ($[37] !== DialogTitle) {
|
|
916
|
+
t18 = /* @__PURE__ */ jsx(DialogTitle, {
|
|
917
|
+
className: DIALOG_TITLE_CLASS,
|
|
918
|
+
children: "Watermark"
|
|
849
919
|
});
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
920
|
+
$[37] = DialogTitle;
|
|
921
|
+
$[38] = t18;
|
|
922
|
+
} else t18 = $[38];
|
|
923
|
+
let t19;
|
|
924
|
+
if ($[39] === Symbol.for("react.memo_cache_sentinel")) {
|
|
925
|
+
t19 = /* @__PURE__ */ jsx("span", {
|
|
926
|
+
className: DIALOG_LABEL_CLASS,
|
|
927
|
+
children: "Type"
|
|
928
|
+
});
|
|
929
|
+
$[39] = t19;
|
|
930
|
+
} else t19 = $[39];
|
|
931
|
+
let t20;
|
|
932
|
+
if ($[40] === Symbol.for("react.memo_cache_sentinel")) {
|
|
933
|
+
t20 = (e) => setMode(toWatermarkMode(e.target.value));
|
|
934
|
+
$[40] = t20;
|
|
935
|
+
} else t20 = $[40];
|
|
936
|
+
let t21;
|
|
937
|
+
let t22;
|
|
938
|
+
let t23;
|
|
939
|
+
if ($[41] === Symbol.for("react.memo_cache_sentinel")) {
|
|
940
|
+
t21 = /* @__PURE__ */ jsx("option", {
|
|
941
|
+
value: "text",
|
|
942
|
+
children: "Text watermark"
|
|
943
|
+
});
|
|
944
|
+
t22 = /* @__PURE__ */ jsx("option", {
|
|
945
|
+
value: "picture",
|
|
946
|
+
children: "Picture watermark"
|
|
947
|
+
});
|
|
948
|
+
t23 = /* @__PURE__ */ jsx("option", {
|
|
949
|
+
value: "none",
|
|
950
|
+
children: "No watermark"
|
|
951
|
+
});
|
|
952
|
+
$[41] = t21;
|
|
953
|
+
$[42] = t22;
|
|
954
|
+
$[43] = t23;
|
|
955
|
+
} else {
|
|
956
|
+
t21 = $[41];
|
|
957
|
+
t22 = $[42];
|
|
958
|
+
t23 = $[43];
|
|
959
|
+
}
|
|
960
|
+
let t24;
|
|
961
|
+
if ($[44] !== fieldIds.mode || $[45] !== mode) {
|
|
962
|
+
t24 = /* @__PURE__ */ jsxs("select", {
|
|
963
|
+
className: DIALOG_INPUT_CLASS,
|
|
964
|
+
id: fieldIds.mode,
|
|
965
|
+
onChange: t20,
|
|
966
|
+
value: mode,
|
|
859
967
|
children: [
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
968
|
+
t21,
|
|
969
|
+
t22,
|
|
970
|
+
t23
|
|
971
|
+
]
|
|
972
|
+
});
|
|
973
|
+
$[44] = fieldIds.mode;
|
|
974
|
+
$[45] = mode;
|
|
975
|
+
$[46] = t24;
|
|
976
|
+
} else t24 = $[46];
|
|
977
|
+
let t25;
|
|
978
|
+
if ($[47] !== fieldIds.mode || $[48] !== t24) {
|
|
979
|
+
t25 = /* @__PURE__ */ jsxs("label", {
|
|
980
|
+
className: "flex flex-col gap-1",
|
|
981
|
+
htmlFor: fieldIds.mode,
|
|
982
|
+
children: [t19, t24]
|
|
983
|
+
});
|
|
984
|
+
$[47] = fieldIds.mode;
|
|
985
|
+
$[48] = t24;
|
|
986
|
+
$[49] = t25;
|
|
987
|
+
} else t25 = $[49];
|
|
988
|
+
let t26;
|
|
989
|
+
if ($[50] !== color || $[51] !== diagonal || $[52] !== fieldIds.color || $[53] !== fieldIds.diagonal || $[54] !== fieldIds.font || $[55] !== fieldIds.opacity || $[56] !== fieldIds.text || $[57] !== font || $[58] !== mode || $[59] !== opacityPercent || $[60] !== text) {
|
|
990
|
+
t26 = mode === "text" && /* @__PURE__ */ jsxs("div", {
|
|
991
|
+
className: "grid grid-cols-2 gap-3",
|
|
992
|
+
children: [
|
|
993
|
+
/* @__PURE__ */ jsxs("label", {
|
|
994
|
+
className: "col-span-2 flex flex-col gap-1",
|
|
995
|
+
htmlFor: fieldIds.text,
|
|
996
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
997
|
+
className: "text-muted-foreground text-[13px]",
|
|
998
|
+
children: "Text"
|
|
999
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
1000
|
+
className: "border-input bg-background text-foreground rounded border px-2 py-1.5 text-[13px] outline-none",
|
|
1001
|
+
id: fieldIds.text,
|
|
1002
|
+
onChange: (e_0) => setText(e_0.target.value),
|
|
1003
|
+
value: text
|
|
1004
|
+
})]
|
|
863
1005
|
}),
|
|
864
|
-
/* @__PURE__ */ jsxs("
|
|
865
|
-
className:
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
onChange: (e) => setMode(toWatermarkMode(e.target.value)),
|
|
877
|
-
value: mode,
|
|
878
|
-
children: [
|
|
879
|
-
/* @__PURE__ */ jsx("option", {
|
|
880
|
-
value: "text",
|
|
881
|
-
children: "Text watermark"
|
|
882
|
-
}),
|
|
883
|
-
/* @__PURE__ */ jsx("option", {
|
|
884
|
-
value: "picture",
|
|
885
|
-
children: "Picture watermark"
|
|
886
|
-
}),
|
|
887
|
-
/* @__PURE__ */ jsx("option", {
|
|
888
|
-
value: "none",
|
|
889
|
-
children: "No watermark"
|
|
890
|
-
})
|
|
891
|
-
]
|
|
892
|
-
})]
|
|
893
|
-
}),
|
|
894
|
-
mode === "text" && /* @__PURE__ */ jsxs("div", {
|
|
895
|
-
className: "grid grid-cols-2 gap-3",
|
|
896
|
-
children: [
|
|
897
|
-
/* @__PURE__ */ jsxs("label", {
|
|
898
|
-
className: "col-span-2 flex flex-col gap-1",
|
|
899
|
-
htmlFor: fieldIds.text,
|
|
900
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
901
|
-
className: "text-muted-foreground text-[13px]",
|
|
902
|
-
children: "Text"
|
|
903
|
-
}), /* @__PURE__ */ jsx("input", {
|
|
904
|
-
className: "border-input bg-background text-foreground rounded border px-2 py-1.5 text-[13px] outline-none",
|
|
905
|
-
id: fieldIds.text,
|
|
906
|
-
onChange: (e) => setText(e.target.value),
|
|
907
|
-
value: text
|
|
908
|
-
})]
|
|
909
|
-
}),
|
|
910
|
-
/* @__PURE__ */ jsxs("label", {
|
|
911
|
-
className: "flex flex-col gap-1",
|
|
912
|
-
htmlFor: fieldIds.font,
|
|
913
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
914
|
-
className: "text-muted-foreground text-[13px]",
|
|
915
|
-
children: "Font"
|
|
916
|
-
}), /* @__PURE__ */ jsx("input", {
|
|
917
|
-
className: "border-input bg-background text-foreground rounded border px-2 py-1.5 text-[13px] outline-none",
|
|
918
|
-
id: fieldIds.font,
|
|
919
|
-
onChange: (e) => setFont(e.target.value),
|
|
920
|
-
value: font
|
|
921
|
-
})]
|
|
922
|
-
}),
|
|
923
|
-
/* @__PURE__ */ jsxs("label", {
|
|
924
|
-
className: "flex flex-col gap-1",
|
|
925
|
-
htmlFor: fieldIds.color,
|
|
926
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
927
|
-
className: "text-muted-foreground text-[13px]",
|
|
928
|
-
children: "Color"
|
|
929
|
-
}), /* @__PURE__ */ jsx("input", {
|
|
930
|
-
className: `border-input bg-background text-foreground rounded border px-2 py-1.5 text-[13px] outline-none h-[34px]`,
|
|
931
|
-
id: fieldIds.color,
|
|
932
|
-
onChange: (e) => setColor(e.target.value),
|
|
933
|
-
type: "color",
|
|
934
|
-
value: color
|
|
935
|
-
})]
|
|
936
|
-
}),
|
|
937
|
-
/* @__PURE__ */ jsxs("label", {
|
|
938
|
-
className: "flex flex-col gap-1",
|
|
939
|
-
htmlFor: fieldIds.opacity,
|
|
940
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
941
|
-
className: "text-muted-foreground text-[13px]",
|
|
942
|
-
children: "Opacity"
|
|
943
|
-
}), /* @__PURE__ */ jsx("input", {
|
|
944
|
-
className: "border-input bg-background text-foreground rounded border px-2 py-1.5 text-[13px] outline-none",
|
|
945
|
-
id: fieldIds.opacity,
|
|
946
|
-
max: 100,
|
|
947
|
-
min: 0,
|
|
948
|
-
onChange: (e) => setOpacityPercent(Number(e.target.value) || 0),
|
|
949
|
-
type: "number",
|
|
950
|
-
value: opacityPercent
|
|
951
|
-
})]
|
|
952
|
-
}),
|
|
953
|
-
/* @__PURE__ */ jsxs("label", {
|
|
954
|
-
className: "flex items-center gap-2 pt-6",
|
|
955
|
-
htmlFor: fieldIds.diagonal,
|
|
956
|
-
children: [/* @__PURE__ */ jsx("input", {
|
|
957
|
-
checked: diagonal,
|
|
958
|
-
id: fieldIds.diagonal,
|
|
959
|
-
onChange: (e) => setDiagonal(e.target.checked),
|
|
960
|
-
type: "checkbox"
|
|
961
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
962
|
-
className: "text-muted-foreground text-[13px]",
|
|
963
|
-
children: "Diagonal"
|
|
964
|
-
})]
|
|
965
|
-
})
|
|
966
|
-
]
|
|
967
|
-
}),
|
|
968
|
-
mode === "picture" && /* @__PURE__ */ jsxs("div", {
|
|
969
|
-
className: "grid grid-cols-2 gap-3",
|
|
970
|
-
children: [
|
|
971
|
-
/* @__PURE__ */ jsxs("label", {
|
|
972
|
-
className: "col-span-2 flex flex-col gap-1",
|
|
973
|
-
htmlFor: fieldIds.imageRId,
|
|
974
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
975
|
-
className: "text-muted-foreground text-[13px]",
|
|
976
|
-
children: "Header image relationship id"
|
|
977
|
-
}), /* @__PURE__ */ jsx("input", {
|
|
978
|
-
className: "border-input bg-background text-foreground rounded border px-2 py-1.5 text-[13px] outline-none",
|
|
979
|
-
id: fieldIds.imageRId,
|
|
980
|
-
onChange: (e) => setImageRId(e.target.value),
|
|
981
|
-
placeholder: "rId12",
|
|
982
|
-
value: imageRId
|
|
983
|
-
})]
|
|
984
|
-
}),
|
|
985
|
-
/* @__PURE__ */ jsxs("label", {
|
|
986
|
-
className: "col-span-2 flex flex-col gap-1",
|
|
987
|
-
htmlFor: fieldIds.imageTarget,
|
|
988
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
989
|
-
className: "text-muted-foreground text-[13px]",
|
|
990
|
-
children: "Image target"
|
|
991
|
-
}), /* @__PURE__ */ jsx("input", {
|
|
992
|
-
className: "border-input bg-background text-foreground rounded border px-2 py-1.5 text-[13px] outline-none",
|
|
993
|
-
id: fieldIds.imageTarget,
|
|
994
|
-
onChange: (e) => setImageTarget(e.target.value),
|
|
995
|
-
placeholder: "word/media/image1.png",
|
|
996
|
-
value: imageTarget
|
|
997
|
-
})]
|
|
998
|
-
}),
|
|
999
|
-
/* @__PURE__ */ jsxs("label", {
|
|
1000
|
-
className: "flex flex-col gap-1",
|
|
1001
|
-
htmlFor: fieldIds.scale,
|
|
1002
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
1003
|
-
className: "text-muted-foreground text-[13px]",
|
|
1004
|
-
children: "Scale"
|
|
1005
|
-
}), /* @__PURE__ */ jsx("input", {
|
|
1006
|
-
className: "border-input bg-background text-foreground rounded border px-2 py-1.5 text-[13px] outline-none",
|
|
1007
|
-
id: fieldIds.scale,
|
|
1008
|
-
max: 300,
|
|
1009
|
-
min: 1,
|
|
1010
|
-
onChange: (e) => setScalePercent(Number(e.target.value) || 1),
|
|
1011
|
-
type: "number",
|
|
1012
|
-
value: scalePercent
|
|
1013
|
-
})]
|
|
1014
|
-
}),
|
|
1015
|
-
/* @__PURE__ */ jsxs("label", {
|
|
1016
|
-
className: "flex items-center gap-2 pt-6",
|
|
1017
|
-
htmlFor: fieldIds.washout,
|
|
1018
|
-
children: [/* @__PURE__ */ jsx("input", {
|
|
1019
|
-
checked: washout,
|
|
1020
|
-
id: fieldIds.washout,
|
|
1021
|
-
onChange: (e) => setWashout(e.target.checked),
|
|
1022
|
-
type: "checkbox"
|
|
1023
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
1024
|
-
className: "text-muted-foreground text-[13px]",
|
|
1025
|
-
children: "Washout"
|
|
1026
|
-
})]
|
|
1027
|
-
}),
|
|
1028
|
-
/* @__PURE__ */ jsxs("label", {
|
|
1029
|
-
className: "col-span-2 flex items-center gap-2",
|
|
1030
|
-
htmlFor: fieldIds.imageTargetExternal,
|
|
1031
|
-
children: [/* @__PURE__ */ jsx("input", {
|
|
1032
|
-
checked: imageTargetExternal,
|
|
1033
|
-
id: fieldIds.imageTargetExternal,
|
|
1034
|
-
onChange: (e) => setImageTargetExternal(e.target.checked),
|
|
1035
|
-
type: "checkbox"
|
|
1036
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
1037
|
-
className: "text-muted-foreground text-[13px]",
|
|
1038
|
-
children: "Target is an external URL"
|
|
1039
|
-
})]
|
|
1040
|
-
})
|
|
1041
|
-
]
|
|
1042
|
-
})
|
|
1043
|
-
]
|
|
1006
|
+
/* @__PURE__ */ jsxs("label", {
|
|
1007
|
+
className: "flex flex-col gap-1",
|
|
1008
|
+
htmlFor: fieldIds.font,
|
|
1009
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
1010
|
+
className: "text-muted-foreground text-[13px]",
|
|
1011
|
+
children: "Font"
|
|
1012
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
1013
|
+
className: "border-input bg-background text-foreground rounded border px-2 py-1.5 text-[13px] outline-none",
|
|
1014
|
+
id: fieldIds.font,
|
|
1015
|
+
onChange: (e_1) => setFont(e_1.target.value),
|
|
1016
|
+
value: font
|
|
1017
|
+
})]
|
|
1044
1018
|
}),
|
|
1045
|
-
/* @__PURE__ */ jsxs("
|
|
1046
|
-
className:
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1019
|
+
/* @__PURE__ */ jsxs("label", {
|
|
1020
|
+
className: "flex flex-col gap-1",
|
|
1021
|
+
htmlFor: fieldIds.color,
|
|
1022
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
1023
|
+
className: "text-muted-foreground text-[13px]",
|
|
1024
|
+
children: "Color"
|
|
1025
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
1026
|
+
className: `border-input bg-background text-foreground rounded border px-2 py-1.5 text-[13px] outline-none h-[34px]`,
|
|
1027
|
+
id: fieldIds.color,
|
|
1028
|
+
onChange: (e_2) => setColor(e_2.target.value),
|
|
1029
|
+
type: "color",
|
|
1030
|
+
value: color
|
|
1031
|
+
})]
|
|
1032
|
+
}),
|
|
1033
|
+
/* @__PURE__ */ jsxs("label", {
|
|
1034
|
+
className: "flex flex-col gap-1",
|
|
1035
|
+
htmlFor: fieldIds.opacity,
|
|
1036
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
1037
|
+
className: "text-muted-foreground text-[13px]",
|
|
1038
|
+
children: "Opacity"
|
|
1039
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
1040
|
+
className: "border-input bg-background text-foreground rounded border px-2 py-1.5 text-[13px] outline-none",
|
|
1041
|
+
id: fieldIds.opacity,
|
|
1042
|
+
max: 100,
|
|
1043
|
+
min: 0,
|
|
1044
|
+
onChange: (e_3) => setOpacityPercent(Number(e_3.target.value) || 0),
|
|
1045
|
+
type: "number",
|
|
1046
|
+
value: opacityPercent
|
|
1047
|
+
})]
|
|
1048
|
+
}),
|
|
1049
|
+
/* @__PURE__ */ jsxs("label", {
|
|
1050
|
+
className: "flex items-center gap-2 pt-6",
|
|
1051
|
+
htmlFor: fieldIds.diagonal,
|
|
1052
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
1053
|
+
checked: diagonal,
|
|
1054
|
+
id: fieldIds.diagonal,
|
|
1055
|
+
onChange: (e_4) => setDiagonal(e_4.target.checked),
|
|
1056
|
+
type: "checkbox"
|
|
1057
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
1058
|
+
className: "text-muted-foreground text-[13px]",
|
|
1059
|
+
children: "Diagonal"
|
|
1056
1060
|
})]
|
|
1057
1061
|
})
|
|
1058
1062
|
]
|
|
1059
|
-
})
|
|
1060
|
-
|
|
1063
|
+
});
|
|
1064
|
+
$[50] = color;
|
|
1065
|
+
$[51] = diagonal;
|
|
1066
|
+
$[52] = fieldIds.color;
|
|
1067
|
+
$[53] = fieldIds.diagonal;
|
|
1068
|
+
$[54] = fieldIds.font;
|
|
1069
|
+
$[55] = fieldIds.opacity;
|
|
1070
|
+
$[56] = fieldIds.text;
|
|
1071
|
+
$[57] = font;
|
|
1072
|
+
$[58] = mode;
|
|
1073
|
+
$[59] = opacityPercent;
|
|
1074
|
+
$[60] = text;
|
|
1075
|
+
$[61] = t26;
|
|
1076
|
+
} else t26 = $[61];
|
|
1077
|
+
let t27;
|
|
1078
|
+
if ($[62] !== fieldIds.imageRId || $[63] !== fieldIds.imageTarget || $[64] !== fieldIds.imageTargetExternal || $[65] !== fieldIds.scale || $[66] !== fieldIds.washout || $[67] !== imageRId || $[68] !== imageTarget || $[69] !== imageTargetExternal || $[70] !== mode || $[71] !== scalePercent || $[72] !== washout) {
|
|
1079
|
+
t27 = mode === "picture" && /* @__PURE__ */ jsxs("div", {
|
|
1080
|
+
className: "grid grid-cols-2 gap-3",
|
|
1081
|
+
children: [
|
|
1082
|
+
/* @__PURE__ */ jsxs("label", {
|
|
1083
|
+
className: "col-span-2 flex flex-col gap-1",
|
|
1084
|
+
htmlFor: fieldIds.imageRId,
|
|
1085
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
1086
|
+
className: "text-muted-foreground text-[13px]",
|
|
1087
|
+
children: "Header image relationship id"
|
|
1088
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
1089
|
+
className: "border-input bg-background text-foreground rounded border px-2 py-1.5 text-[13px] outline-none",
|
|
1090
|
+
id: fieldIds.imageRId,
|
|
1091
|
+
onChange: (e_5) => setImageRId(e_5.target.value),
|
|
1092
|
+
placeholder: "rId12",
|
|
1093
|
+
value: imageRId
|
|
1094
|
+
})]
|
|
1095
|
+
}),
|
|
1096
|
+
/* @__PURE__ */ jsxs("label", {
|
|
1097
|
+
className: "col-span-2 flex flex-col gap-1",
|
|
1098
|
+
htmlFor: fieldIds.imageTarget,
|
|
1099
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
1100
|
+
className: "text-muted-foreground text-[13px]",
|
|
1101
|
+
children: "Image target"
|
|
1102
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
1103
|
+
className: "border-input bg-background text-foreground rounded border px-2 py-1.5 text-[13px] outline-none",
|
|
1104
|
+
id: fieldIds.imageTarget,
|
|
1105
|
+
onChange: (e_6) => setImageTarget(e_6.target.value),
|
|
1106
|
+
placeholder: "word/media/image1.png",
|
|
1107
|
+
value: imageTarget
|
|
1108
|
+
})]
|
|
1109
|
+
}),
|
|
1110
|
+
/* @__PURE__ */ jsxs("label", {
|
|
1111
|
+
className: "flex flex-col gap-1",
|
|
1112
|
+
htmlFor: fieldIds.scale,
|
|
1113
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
1114
|
+
className: "text-muted-foreground text-[13px]",
|
|
1115
|
+
children: "Scale"
|
|
1116
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
1117
|
+
className: "border-input bg-background text-foreground rounded border px-2 py-1.5 text-[13px] outline-none",
|
|
1118
|
+
id: fieldIds.scale,
|
|
1119
|
+
max: 300,
|
|
1120
|
+
min: 1,
|
|
1121
|
+
onChange: (e_7) => setScalePercent(Number(e_7.target.value) || 1),
|
|
1122
|
+
type: "number",
|
|
1123
|
+
value: scalePercent
|
|
1124
|
+
})]
|
|
1125
|
+
}),
|
|
1126
|
+
/* @__PURE__ */ jsxs("label", {
|
|
1127
|
+
className: "flex items-center gap-2 pt-6",
|
|
1128
|
+
htmlFor: fieldIds.washout,
|
|
1129
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
1130
|
+
checked: washout,
|
|
1131
|
+
id: fieldIds.washout,
|
|
1132
|
+
onChange: (e_8) => setWashout(e_8.target.checked),
|
|
1133
|
+
type: "checkbox"
|
|
1134
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
1135
|
+
className: "text-muted-foreground text-[13px]",
|
|
1136
|
+
children: "Washout"
|
|
1137
|
+
})]
|
|
1138
|
+
}),
|
|
1139
|
+
/* @__PURE__ */ jsxs("label", {
|
|
1140
|
+
className: "col-span-2 flex items-center gap-2",
|
|
1141
|
+
htmlFor: fieldIds.imageTargetExternal,
|
|
1142
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
1143
|
+
checked: imageTargetExternal,
|
|
1144
|
+
id: fieldIds.imageTargetExternal,
|
|
1145
|
+
onChange: (e_9) => setImageTargetExternal(e_9.target.checked),
|
|
1146
|
+
type: "checkbox"
|
|
1147
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
1148
|
+
className: "text-muted-foreground text-[13px]",
|
|
1149
|
+
children: "Target is an external URL"
|
|
1150
|
+
})]
|
|
1151
|
+
})
|
|
1152
|
+
]
|
|
1153
|
+
});
|
|
1154
|
+
$[62] = fieldIds.imageRId;
|
|
1155
|
+
$[63] = fieldIds.imageTarget;
|
|
1156
|
+
$[64] = fieldIds.imageTargetExternal;
|
|
1157
|
+
$[65] = fieldIds.scale;
|
|
1158
|
+
$[66] = fieldIds.washout;
|
|
1159
|
+
$[67] = imageRId;
|
|
1160
|
+
$[68] = imageTarget;
|
|
1161
|
+
$[69] = imageTargetExternal;
|
|
1162
|
+
$[70] = mode;
|
|
1163
|
+
$[71] = scalePercent;
|
|
1164
|
+
$[72] = washout;
|
|
1165
|
+
$[73] = t27;
|
|
1166
|
+
} else t27 = $[73];
|
|
1167
|
+
let t28;
|
|
1168
|
+
if ($[74] !== t25 || $[75] !== t26 || $[76] !== t27) {
|
|
1169
|
+
t28 = /* @__PURE__ */ jsxs("div", {
|
|
1170
|
+
className: DIALOG_BODY_CLASS,
|
|
1171
|
+
children: [
|
|
1172
|
+
t25,
|
|
1173
|
+
t26,
|
|
1174
|
+
t27
|
|
1175
|
+
]
|
|
1176
|
+
});
|
|
1177
|
+
$[74] = t25;
|
|
1178
|
+
$[75] = t26;
|
|
1179
|
+
$[76] = t27;
|
|
1180
|
+
$[77] = t28;
|
|
1181
|
+
} else t28 = $[77];
|
|
1182
|
+
let t29;
|
|
1183
|
+
if ($[78] !== DialogClose) {
|
|
1184
|
+
t29 = /* @__PURE__ */ jsx(DialogClose, {
|
|
1185
|
+
className: DIALOG_SECONDARY_BUTTON_CLASS,
|
|
1186
|
+
children: "Cancel"
|
|
1187
|
+
});
|
|
1188
|
+
$[78] = DialogClose;
|
|
1189
|
+
$[79] = t29;
|
|
1190
|
+
} else t29 = $[79];
|
|
1191
|
+
const t30 = !canApply;
|
|
1192
|
+
let t31;
|
|
1193
|
+
if ($[80] !== handleApply || $[81] !== t30) {
|
|
1194
|
+
t31 = /* @__PURE__ */ jsx("button", {
|
|
1195
|
+
className: DIALOG_PRIMARY_BUTTON_CLASS,
|
|
1196
|
+
disabled: t30,
|
|
1197
|
+
onClick: handleApply,
|
|
1198
|
+
type: "button",
|
|
1199
|
+
children: "Apply"
|
|
1200
|
+
});
|
|
1201
|
+
$[80] = handleApply;
|
|
1202
|
+
$[81] = t30;
|
|
1203
|
+
$[82] = t31;
|
|
1204
|
+
} else t31 = $[82];
|
|
1205
|
+
let t32;
|
|
1206
|
+
if ($[83] !== t29 || $[84] !== t31) {
|
|
1207
|
+
t32 = /* @__PURE__ */ jsxs("div", {
|
|
1208
|
+
className: DIALOG_FOOTER_CLASS,
|
|
1209
|
+
children: [t29, t31]
|
|
1210
|
+
});
|
|
1211
|
+
$[83] = t29;
|
|
1212
|
+
$[84] = t31;
|
|
1213
|
+
$[85] = t32;
|
|
1214
|
+
} else t32 = $[85];
|
|
1215
|
+
let t33;
|
|
1216
|
+
if ($[86] !== DialogPopup || $[87] !== t18 || $[88] !== t28 || $[89] !== t32) {
|
|
1217
|
+
t33 = /* @__PURE__ */ jsxs(DialogPopup, {
|
|
1218
|
+
className: DIALOG_POPUP_CLASS,
|
|
1219
|
+
children: [
|
|
1220
|
+
t18,
|
|
1221
|
+
t28,
|
|
1222
|
+
t32
|
|
1223
|
+
]
|
|
1224
|
+
});
|
|
1225
|
+
$[86] = DialogPopup;
|
|
1226
|
+
$[87] = t18;
|
|
1227
|
+
$[88] = t28;
|
|
1228
|
+
$[89] = t32;
|
|
1229
|
+
$[90] = t33;
|
|
1230
|
+
} else t33 = $[90];
|
|
1231
|
+
let t34;
|
|
1232
|
+
if ($[91] !== DialogPortal || $[92] !== t17 || $[93] !== t33) {
|
|
1233
|
+
t34 = /* @__PURE__ */ jsxs(DialogPortal, { children: [t17, t33] });
|
|
1234
|
+
$[91] = DialogPortal;
|
|
1235
|
+
$[92] = t17;
|
|
1236
|
+
$[93] = t33;
|
|
1237
|
+
$[94] = t34;
|
|
1238
|
+
} else t34 = $[94];
|
|
1239
|
+
let t35;
|
|
1240
|
+
if ($[95] !== Dialog || $[96] !== handleOpenChange || $[97] !== isOpen || $[98] !== t34) {
|
|
1241
|
+
t35 = /* @__PURE__ */ jsx(Dialog, {
|
|
1242
|
+
open: isOpen,
|
|
1243
|
+
onOpenChange: handleOpenChange,
|
|
1244
|
+
children: t34
|
|
1245
|
+
});
|
|
1246
|
+
$[95] = Dialog;
|
|
1247
|
+
$[96] = handleOpenChange;
|
|
1248
|
+
$[97] = isOpen;
|
|
1249
|
+
$[98] = t34;
|
|
1250
|
+
$[99] = t35;
|
|
1251
|
+
} else t35 = $[99];
|
|
1252
|
+
return t35;
|
|
1061
1253
|
}
|
|
1062
1254
|
function toWatermarkMode(value) {
|
|
1063
1255
|
if (value === "none" || value === "picture" || value === "text") return value;
|