@stll/folio-react 0.11.0 → 0.12.1
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-ml91aGZ1.js → CommentsSidebar-mwa9JsIj.js} +2 -2
- package/dist/compat/eigenpal.d.ts +1 -1
- package/dist/compat/eigenpal.js +1 -1
- package/dist/{dialogs-Bj2PdycR.js → dialogs-CB49Gr8j.js} +270 -244
- package/dist/dialogs.js +1 -1
- package/dist/editor.css +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -2
- package/dist/{renderAsync-CDdppueC.d.ts → renderAsync-D2OJupOm.d.ts} +33 -0
- package/dist/{renderAsync-BjqXaR0h.js → renderAsync-DFwDFNB9.js} +200 -100
- package/dist/standalone.css +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as containedHandler } from "./renderAsync-
|
|
1
|
+
import { d as containedHandler } from "./renderAsync-DFwDFNB9.js";
|
|
2
2
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { CheckIcon, MoreVerticalIcon } from "lucide-react";
|
|
4
4
|
import { useLocale, useTranslations } from "use-intl";
|
|
@@ -174,7 +174,7 @@ const CommentsSidebar = ({ comments, onCommentClick, activeCommentId = null, onC
|
|
|
174
174
|
};
|
|
175
175
|
for (const comment of visibleComments) {
|
|
176
176
|
const cardId = `comment-${comment.id}`;
|
|
177
|
-
const el = pagesEl.querySelector(`[data-comment-id="${comment.id}"]`);
|
|
177
|
+
const el = pagesEl.querySelector(`[data-comment-id="${CSS.escape(String(comment.id))}"]`);
|
|
178
178
|
if (el) {
|
|
179
179
|
pushPosition(cardId, el.getBoundingClientRect().top - containerRect.top + scrollTop, cardRefs.current.get(cardId)?.offsetHeight || DEFAULT_CARD_HEIGHT);
|
|
180
180
|
continue;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as DocxEditorRef, i as renderAsync, n as EditorHandle, r as RenderAsyncOptions, s as DocxEditorProps, t as DocxEditorHandle } from "../renderAsync-
|
|
1
|
+
import { c as DocxEditorRef, i as renderAsync, n as EditorHandle, r as RenderAsyncOptions, s as DocxEditorProps, t as DocxEditorHandle } from "../renderAsync-D2OJupOm.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
import { CreateEmptyDocumentOptions, createDocumentWithText, createEmptyDocument } from "@stll/folio-core/utils/createDocument";
|
|
4
4
|
|
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-DFwDFNB9.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";
|
|
@@ -4,6 +4,7 @@ import { c } from "react-compiler-runtime";
|
|
|
4
4
|
import { useEffect, useId, useState } from "react";
|
|
5
5
|
import { useTranslations } from "use-intl";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { isAllowedExternalWatermarkImageUrl } from "@stll/folio-core/watermark";
|
|
7
8
|
//#region src/components/dialogs/HyperlinkDialog.tsx
|
|
8
9
|
function HyperlinkDialog({ isOpen, onClose, onSubmit, onRemove, currentData, selectedText, bookmarks = [] }) {
|
|
9
10
|
const { Root: Dialog, Portal: DialogPortal, Backdrop: DialogBackdrop, Popup: DialogPopup, Title: DialogTitle, Close: DialogClose } = useFolioUI().Dialog;
|
|
@@ -754,7 +755,7 @@ function clampInteger(value) {
|
|
|
754
755
|
//#region src/components/dialogs/WatermarkDialog.tsx
|
|
755
756
|
const DEFAULT_TEXT_COLOR = "#C0C0C0";
|
|
756
757
|
function WatermarkDialog(t0) {
|
|
757
|
-
const $ = c(
|
|
758
|
+
const $ = c(133);
|
|
758
759
|
const { isOpen, onClose, onApply, currentWatermark } = t0;
|
|
759
760
|
const { Root: Dialog, Portal: DialogPortal, Backdrop: DialogBackdrop, Popup: DialogPopup, Title: DialogTitle, Close: DialogClose } = useFolioUI().Dialog;
|
|
760
761
|
const handleOpenChange = useCloseOnDialogOpenChange(onClose);
|
|
@@ -856,17 +857,27 @@ function WatermarkDialog(t0) {
|
|
|
856
857
|
} else t14 = $[15];
|
|
857
858
|
const fieldIds = t14;
|
|
858
859
|
let t15;
|
|
859
|
-
if ($[16] !==
|
|
860
|
-
t15 = mode === "
|
|
861
|
-
$[16] =
|
|
862
|
-
$[17] =
|
|
863
|
-
$[18] =
|
|
860
|
+
if ($[16] !== imageTarget || $[17] !== imageTargetExternal || $[18] !== mode) {
|
|
861
|
+
t15 = mode === "picture" && imageTargetExternal && imageTarget.trim().length > 0 ? getExternalImageTargetError(imageTarget.trim()) : "";
|
|
862
|
+
$[16] = imageTarget;
|
|
863
|
+
$[17] = imageTargetExternal;
|
|
864
|
+
$[18] = mode;
|
|
864
865
|
$[19] = t15;
|
|
865
866
|
} else t15 = $[19];
|
|
866
|
-
const
|
|
867
|
+
const imageTargetError = t15;
|
|
867
868
|
let t16;
|
|
868
|
-
if ($[20] !==
|
|
869
|
-
t16 = ()
|
|
869
|
+
if ($[20] !== imageRId || $[21] !== imageTargetError || $[22] !== mode || $[23] !== text) {
|
|
870
|
+
t16 = mode === "none" || mode === "text" && text.trim().length > 0 || mode === "picture" && imageRId.trim().length > 0 && imageTargetError.length === 0;
|
|
871
|
+
$[20] = imageRId;
|
|
872
|
+
$[21] = imageTargetError;
|
|
873
|
+
$[22] = mode;
|
|
874
|
+
$[23] = text;
|
|
875
|
+
$[24] = t16;
|
|
876
|
+
} else t16 = $[24];
|
|
877
|
+
const canApply = t16;
|
|
878
|
+
let t17;
|
|
879
|
+
if ($[25] !== canApply || $[26] !== color || $[27] !== diagonal || $[28] !== font || $[29] !== imageRId || $[30] !== imageTarget || $[31] !== imageTargetExternal || $[32] !== mode || $[33] !== onApply || $[34] !== onClose || $[35] !== opacityPercent || $[36] !== scalePercent || $[37] !== text || $[38] !== washout) {
|
|
880
|
+
t17 = () => {
|
|
870
881
|
if (!canApply) return;
|
|
871
882
|
if (mode === "none") {
|
|
872
883
|
onApply(void 0);
|
|
@@ -895,147 +906,147 @@ function WatermarkDialog(t0) {
|
|
|
895
906
|
});
|
|
896
907
|
onClose();
|
|
897
908
|
};
|
|
898
|
-
$[
|
|
899
|
-
$[
|
|
900
|
-
$[
|
|
901
|
-
$[
|
|
902
|
-
$[
|
|
903
|
-
$[
|
|
904
|
-
$[
|
|
905
|
-
$[
|
|
906
|
-
$[
|
|
907
|
-
$[
|
|
908
|
-
$[
|
|
909
|
-
$[
|
|
910
|
-
$[
|
|
911
|
-
$[
|
|
912
|
-
$[
|
|
913
|
-
} else
|
|
914
|
-
const handleApply =
|
|
915
|
-
let t17;
|
|
916
|
-
if ($[35] !== DialogBackdrop) {
|
|
917
|
-
t17 = /* @__PURE__ */ jsx(DialogBackdrop, { className: DIALOG_BACKDROP_CLASS });
|
|
918
|
-
$[35] = DialogBackdrop;
|
|
919
|
-
$[36] = t17;
|
|
920
|
-
} else t17 = $[36];
|
|
909
|
+
$[25] = canApply;
|
|
910
|
+
$[26] = color;
|
|
911
|
+
$[27] = diagonal;
|
|
912
|
+
$[28] = font;
|
|
913
|
+
$[29] = imageRId;
|
|
914
|
+
$[30] = imageTarget;
|
|
915
|
+
$[31] = imageTargetExternal;
|
|
916
|
+
$[32] = mode;
|
|
917
|
+
$[33] = onApply;
|
|
918
|
+
$[34] = onClose;
|
|
919
|
+
$[35] = opacityPercent;
|
|
920
|
+
$[36] = scalePercent;
|
|
921
|
+
$[37] = text;
|
|
922
|
+
$[38] = washout;
|
|
923
|
+
$[39] = t17;
|
|
924
|
+
} else t17 = $[39];
|
|
925
|
+
const handleApply = t17;
|
|
921
926
|
let t18;
|
|
922
|
-
if ($[
|
|
923
|
-
t18 =
|
|
924
|
-
$[
|
|
925
|
-
$[
|
|
926
|
-
} else t18 = $[
|
|
927
|
+
if ($[40] !== DialogBackdrop) {
|
|
928
|
+
t18 = /* @__PURE__ */ jsx(DialogBackdrop, { className: DIALOG_BACKDROP_CLASS });
|
|
929
|
+
$[40] = DialogBackdrop;
|
|
930
|
+
$[41] = t18;
|
|
931
|
+
} else t18 = $[41];
|
|
927
932
|
let t19;
|
|
928
|
-
if ($[39] !== DialogTitle || $[40] !== t18) {
|
|
929
|
-
t19 = /* @__PURE__ */ jsx(DialogTitle, {
|
|
930
|
-
className: DIALOG_TITLE_CLASS,
|
|
931
|
-
children: t18
|
|
932
|
-
});
|
|
933
|
-
$[39] = DialogTitle;
|
|
934
|
-
$[40] = t18;
|
|
935
|
-
$[41] = t19;
|
|
936
|
-
} else t19 = $[41];
|
|
937
|
-
const t20 = fieldIds.mode;
|
|
938
|
-
let t21;
|
|
939
933
|
if ($[42] !== t) {
|
|
940
|
-
|
|
934
|
+
t19 = t("dialogs.watermark.title");
|
|
941
935
|
$[42] = t;
|
|
942
|
-
$[43] =
|
|
943
|
-
} else
|
|
936
|
+
$[43] = t19;
|
|
937
|
+
} else t19 = $[43];
|
|
938
|
+
let t20;
|
|
939
|
+
if ($[44] !== DialogTitle || $[45] !== t19) {
|
|
940
|
+
t20 = /* @__PURE__ */ jsx(DialogTitle, {
|
|
941
|
+
className: DIALOG_TITLE_CLASS,
|
|
942
|
+
children: t19
|
|
943
|
+
});
|
|
944
|
+
$[44] = DialogTitle;
|
|
945
|
+
$[45] = t19;
|
|
946
|
+
$[46] = t20;
|
|
947
|
+
} else t20 = $[46];
|
|
948
|
+
const t21 = fieldIds.mode;
|
|
944
949
|
let t22;
|
|
945
|
-
if ($[
|
|
946
|
-
t22 =
|
|
950
|
+
if ($[47] !== t) {
|
|
951
|
+
t22 = t("dialogs.watermark.type");
|
|
952
|
+
$[47] = t;
|
|
953
|
+
$[48] = t22;
|
|
954
|
+
} else t22 = $[48];
|
|
955
|
+
let t23;
|
|
956
|
+
if ($[49] !== t22) {
|
|
957
|
+
t23 = /* @__PURE__ */ jsx("span", {
|
|
947
958
|
className: DIALOG_LABEL_CLASS,
|
|
948
|
-
children:
|
|
959
|
+
children: t22
|
|
949
960
|
});
|
|
950
|
-
$[
|
|
951
|
-
$[
|
|
952
|
-
} else
|
|
953
|
-
const
|
|
954
|
-
let t24;
|
|
955
|
-
if ($[46] === Symbol.for("react.memo_cache_sentinel")) {
|
|
956
|
-
t24 = (e) => setMode(toWatermarkMode(e.target.value));
|
|
957
|
-
$[46] = t24;
|
|
958
|
-
} else t24 = $[46];
|
|
961
|
+
$[49] = t22;
|
|
962
|
+
$[50] = t23;
|
|
963
|
+
} else t23 = $[50];
|
|
964
|
+
const t24 = fieldIds.mode;
|
|
959
965
|
let t25;
|
|
960
|
-
if ($[
|
|
961
|
-
t25 =
|
|
962
|
-
$[
|
|
963
|
-
|
|
964
|
-
} else t25 = $[48];
|
|
966
|
+
if ($[51] === Symbol.for("react.memo_cache_sentinel")) {
|
|
967
|
+
t25 = (e) => setMode(toWatermarkMode(e.target.value));
|
|
968
|
+
$[51] = t25;
|
|
969
|
+
} else t25 = $[51];
|
|
965
970
|
let t26;
|
|
966
|
-
if ($[
|
|
967
|
-
t26 =
|
|
971
|
+
if ($[52] !== t) {
|
|
972
|
+
t26 = t("dialogs.watermark.textWatermark");
|
|
973
|
+
$[52] = t;
|
|
974
|
+
$[53] = t26;
|
|
975
|
+
} else t26 = $[53];
|
|
976
|
+
let t27;
|
|
977
|
+
if ($[54] !== t26) {
|
|
978
|
+
t27 = /* @__PURE__ */ jsx("option", {
|
|
968
979
|
value: "text",
|
|
969
|
-
children:
|
|
980
|
+
children: t26
|
|
970
981
|
});
|
|
971
|
-
$[
|
|
972
|
-
$[
|
|
973
|
-
} else
|
|
974
|
-
let t27;
|
|
975
|
-
if ($[51] !== t) {
|
|
976
|
-
t27 = t("dialogs.watermark.pictureWatermark");
|
|
977
|
-
$[51] = t;
|
|
978
|
-
$[52] = t27;
|
|
979
|
-
} else t27 = $[52];
|
|
982
|
+
$[54] = t26;
|
|
983
|
+
$[55] = t27;
|
|
984
|
+
} else t27 = $[55];
|
|
980
985
|
let t28;
|
|
981
|
-
if ($[
|
|
982
|
-
t28 =
|
|
986
|
+
if ($[56] !== t) {
|
|
987
|
+
t28 = t("dialogs.watermark.pictureWatermark");
|
|
988
|
+
$[56] = t;
|
|
989
|
+
$[57] = t28;
|
|
990
|
+
} else t28 = $[57];
|
|
991
|
+
let t29;
|
|
992
|
+
if ($[58] !== t28) {
|
|
993
|
+
t29 = /* @__PURE__ */ jsx("option", {
|
|
983
994
|
value: "picture",
|
|
984
|
-
children:
|
|
995
|
+
children: t28
|
|
985
996
|
});
|
|
986
|
-
$[
|
|
987
|
-
$[
|
|
988
|
-
} else
|
|
989
|
-
let t29;
|
|
990
|
-
if ($[55] !== t) {
|
|
991
|
-
t29 = t("dialogs.watermark.noWatermark");
|
|
992
|
-
$[55] = t;
|
|
993
|
-
$[56] = t29;
|
|
994
|
-
} else t29 = $[56];
|
|
997
|
+
$[58] = t28;
|
|
998
|
+
$[59] = t29;
|
|
999
|
+
} else t29 = $[59];
|
|
995
1000
|
let t30;
|
|
996
|
-
if ($[
|
|
997
|
-
t30 =
|
|
1001
|
+
if ($[60] !== t) {
|
|
1002
|
+
t30 = t("dialogs.watermark.noWatermark");
|
|
1003
|
+
$[60] = t;
|
|
1004
|
+
$[61] = t30;
|
|
1005
|
+
} else t30 = $[61];
|
|
1006
|
+
let t31;
|
|
1007
|
+
if ($[62] !== t30) {
|
|
1008
|
+
t31 = /* @__PURE__ */ jsx("option", {
|
|
998
1009
|
value: "none",
|
|
999
|
-
children:
|
|
1010
|
+
children: t30
|
|
1000
1011
|
});
|
|
1001
|
-
$[
|
|
1002
|
-
$[
|
|
1003
|
-
} else
|
|
1004
|
-
let
|
|
1005
|
-
if ($[
|
|
1006
|
-
|
|
1012
|
+
$[62] = t30;
|
|
1013
|
+
$[63] = t31;
|
|
1014
|
+
} else t31 = $[63];
|
|
1015
|
+
let t32;
|
|
1016
|
+
if ($[64] !== fieldIds.mode || $[65] !== mode || $[66] !== t27 || $[67] !== t29 || $[68] !== t31) {
|
|
1017
|
+
t32 = /* @__PURE__ */ jsxs("select", {
|
|
1007
1018
|
className: DIALOG_INPUT_CLASS,
|
|
1008
|
-
id:
|
|
1009
|
-
onChange:
|
|
1019
|
+
id: t24,
|
|
1020
|
+
onChange: t25,
|
|
1010
1021
|
value: mode,
|
|
1011
1022
|
children: [
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1023
|
+
t27,
|
|
1024
|
+
t29,
|
|
1025
|
+
t31
|
|
1015
1026
|
]
|
|
1016
1027
|
});
|
|
1017
|
-
$[
|
|
1018
|
-
$[
|
|
1019
|
-
$[
|
|
1020
|
-
$[
|
|
1021
|
-
$[
|
|
1022
|
-
$[
|
|
1023
|
-
} else
|
|
1024
|
-
let
|
|
1025
|
-
if ($[
|
|
1026
|
-
|
|
1028
|
+
$[64] = fieldIds.mode;
|
|
1029
|
+
$[65] = mode;
|
|
1030
|
+
$[66] = t27;
|
|
1031
|
+
$[67] = t29;
|
|
1032
|
+
$[68] = t31;
|
|
1033
|
+
$[69] = t32;
|
|
1034
|
+
} else t32 = $[69];
|
|
1035
|
+
let t33;
|
|
1036
|
+
if ($[70] !== fieldIds.mode || $[71] !== t23 || $[72] !== t32) {
|
|
1037
|
+
t33 = /* @__PURE__ */ jsxs("label", {
|
|
1027
1038
|
className: "flex flex-col gap-1",
|
|
1028
|
-
htmlFor:
|
|
1029
|
-
children: [
|
|
1039
|
+
htmlFor: t21,
|
|
1040
|
+
children: [t23, t32]
|
|
1030
1041
|
});
|
|
1031
|
-
$[
|
|
1032
|
-
$[
|
|
1033
|
-
$[
|
|
1034
|
-
$[
|
|
1035
|
-
} else
|
|
1036
|
-
let
|
|
1037
|
-
if ($[
|
|
1038
|
-
|
|
1042
|
+
$[70] = fieldIds.mode;
|
|
1043
|
+
$[71] = t23;
|
|
1044
|
+
$[72] = t32;
|
|
1045
|
+
$[73] = t33;
|
|
1046
|
+
} else t33 = $[73];
|
|
1047
|
+
let t34;
|
|
1048
|
+
if ($[74] !== color || $[75] !== diagonal || $[76] !== fieldIds.color || $[77] !== fieldIds.diagonal || $[78] !== fieldIds.font || $[79] !== fieldIds.opacity || $[80] !== fieldIds.text || $[81] !== font || $[82] !== mode || $[83] !== opacityPercent || $[84] !== t || $[85] !== text) {
|
|
1049
|
+
t34 = mode === "text" && /* @__PURE__ */ jsxs("div", {
|
|
1039
1050
|
className: "grid grid-cols-2 gap-3",
|
|
1040
1051
|
children: [
|
|
1041
1052
|
/* @__PURE__ */ jsxs("label", {
|
|
@@ -1109,23 +1120,23 @@ function WatermarkDialog(t0) {
|
|
|
1109
1120
|
})
|
|
1110
1121
|
]
|
|
1111
1122
|
});
|
|
1112
|
-
$[
|
|
1113
|
-
$[
|
|
1114
|
-
$[
|
|
1115
|
-
$[
|
|
1116
|
-
$[
|
|
1117
|
-
$[
|
|
1118
|
-
$[
|
|
1119
|
-
$[
|
|
1120
|
-
$[
|
|
1121
|
-
$[
|
|
1122
|
-
$[
|
|
1123
|
-
$[
|
|
1124
|
-
$[
|
|
1125
|
-
} else
|
|
1126
|
-
let
|
|
1127
|
-
if ($[
|
|
1128
|
-
|
|
1123
|
+
$[74] = color;
|
|
1124
|
+
$[75] = diagonal;
|
|
1125
|
+
$[76] = fieldIds.color;
|
|
1126
|
+
$[77] = fieldIds.diagonal;
|
|
1127
|
+
$[78] = fieldIds.font;
|
|
1128
|
+
$[79] = fieldIds.opacity;
|
|
1129
|
+
$[80] = fieldIds.text;
|
|
1130
|
+
$[81] = font;
|
|
1131
|
+
$[82] = mode;
|
|
1132
|
+
$[83] = opacityPercent;
|
|
1133
|
+
$[84] = t;
|
|
1134
|
+
$[85] = text;
|
|
1135
|
+
$[86] = t34;
|
|
1136
|
+
} else t34 = $[86];
|
|
1137
|
+
let t35;
|
|
1138
|
+
if ($[87] !== fieldIds.imageRId || $[88] !== fieldIds.imageTarget || $[89] !== fieldIds.imageTargetExternal || $[90] !== fieldIds.scale || $[91] !== fieldIds.washout || $[92] !== imageRId || $[93] !== imageTarget || $[94] !== imageTargetError || $[95] !== imageTargetExternal || $[96] !== mode || $[97] !== scalePercent || $[98] !== t || $[99] !== washout) {
|
|
1139
|
+
t35 = mode === "picture" && /* @__PURE__ */ jsxs("div", {
|
|
1129
1140
|
className: "grid grid-cols-2 gap-3",
|
|
1130
1141
|
children: [
|
|
1131
1142
|
/* @__PURE__ */ jsxs("label", {
|
|
@@ -1145,16 +1156,24 @@ function WatermarkDialog(t0) {
|
|
|
1145
1156
|
/* @__PURE__ */ jsxs("label", {
|
|
1146
1157
|
className: "col-span-2 flex flex-col gap-1",
|
|
1147
1158
|
htmlFor: fieldIds.imageTarget,
|
|
1148
|
-
children: [
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1159
|
+
children: [
|
|
1160
|
+
/* @__PURE__ */ jsx("span", {
|
|
1161
|
+
className: "text-muted-foreground text-[13px]",
|
|
1162
|
+
children: t("dialogs.watermark.imageTarget")
|
|
1163
|
+
}),
|
|
1164
|
+
/* @__PURE__ */ jsx("input", {
|
|
1165
|
+
"aria-invalid": imageTargetError.length > 0,
|
|
1166
|
+
className: "border-input bg-background text-foreground rounded border px-2 py-1.5 text-[13px] outline-none",
|
|
1167
|
+
id: fieldIds.imageTarget,
|
|
1168
|
+
onChange: (e_6) => setImageTarget(e_6.target.value),
|
|
1169
|
+
placeholder: "word/media/image1.png",
|
|
1170
|
+
value: imageTarget
|
|
1171
|
+
}),
|
|
1172
|
+
imageTargetError.length > 0 && /* @__PURE__ */ jsx("span", {
|
|
1173
|
+
className: "text-destructive text-xs",
|
|
1174
|
+
children: imageTargetError
|
|
1175
|
+
})
|
|
1176
|
+
]
|
|
1158
1177
|
}),
|
|
1159
1178
|
/* @__PURE__ */ jsxs("label", {
|
|
1160
1179
|
className: "flex flex-col gap-1",
|
|
@@ -1200,120 +1219,121 @@ function WatermarkDialog(t0) {
|
|
|
1200
1219
|
})
|
|
1201
1220
|
]
|
|
1202
1221
|
});
|
|
1203
|
-
$[
|
|
1204
|
-
$[
|
|
1205
|
-
$[
|
|
1206
|
-
$[
|
|
1207
|
-
$[
|
|
1208
|
-
$[
|
|
1209
|
-
$[
|
|
1210
|
-
$[
|
|
1211
|
-
$[
|
|
1212
|
-
$[
|
|
1213
|
-
$[
|
|
1214
|
-
$[
|
|
1215
|
-
$[
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1222
|
+
$[87] = fieldIds.imageRId;
|
|
1223
|
+
$[88] = fieldIds.imageTarget;
|
|
1224
|
+
$[89] = fieldIds.imageTargetExternal;
|
|
1225
|
+
$[90] = fieldIds.scale;
|
|
1226
|
+
$[91] = fieldIds.washout;
|
|
1227
|
+
$[92] = imageRId;
|
|
1228
|
+
$[93] = imageTarget;
|
|
1229
|
+
$[94] = imageTargetError;
|
|
1230
|
+
$[95] = imageTargetExternal;
|
|
1231
|
+
$[96] = mode;
|
|
1232
|
+
$[97] = scalePercent;
|
|
1233
|
+
$[98] = t;
|
|
1234
|
+
$[99] = washout;
|
|
1235
|
+
$[100] = t35;
|
|
1236
|
+
} else t35 = $[100];
|
|
1237
|
+
let t36;
|
|
1238
|
+
if ($[101] !== t33 || $[102] !== t34 || $[103] !== t35) {
|
|
1239
|
+
t36 = /* @__PURE__ */ jsxs("div", {
|
|
1220
1240
|
className: DIALOG_BODY_CLASS,
|
|
1221
1241
|
children: [
|
|
1222
|
-
t32,
|
|
1223
1242
|
t33,
|
|
1224
|
-
t34
|
|
1243
|
+
t34,
|
|
1244
|
+
t35
|
|
1225
1245
|
]
|
|
1226
1246
|
});
|
|
1227
|
-
$[
|
|
1228
|
-
$[
|
|
1229
|
-
$[
|
|
1230
|
-
$[
|
|
1231
|
-
} else
|
|
1232
|
-
let t36;
|
|
1233
|
-
if ($[99] !== t) {
|
|
1234
|
-
t36 = t("common.cancel");
|
|
1235
|
-
$[99] = t;
|
|
1236
|
-
$[100] = t36;
|
|
1237
|
-
} else t36 = $[100];
|
|
1247
|
+
$[101] = t33;
|
|
1248
|
+
$[102] = t34;
|
|
1249
|
+
$[103] = t35;
|
|
1250
|
+
$[104] = t36;
|
|
1251
|
+
} else t36 = $[104];
|
|
1238
1252
|
let t37;
|
|
1239
|
-
if ($[
|
|
1240
|
-
t37 =
|
|
1253
|
+
if ($[105] !== t) {
|
|
1254
|
+
t37 = t("common.cancel");
|
|
1255
|
+
$[105] = t;
|
|
1256
|
+
$[106] = t37;
|
|
1257
|
+
} else t37 = $[106];
|
|
1258
|
+
let t38;
|
|
1259
|
+
if ($[107] !== DialogClose || $[108] !== t37) {
|
|
1260
|
+
t38 = /* @__PURE__ */ jsx(DialogClose, {
|
|
1241
1261
|
className: DIALOG_SECONDARY_BUTTON_CLASS,
|
|
1242
|
-
children:
|
|
1262
|
+
children: t37
|
|
1243
1263
|
});
|
|
1244
|
-
$[
|
|
1245
|
-
$[
|
|
1246
|
-
$[
|
|
1247
|
-
} else
|
|
1248
|
-
const
|
|
1249
|
-
let t39;
|
|
1250
|
-
if ($[104] !== t) {
|
|
1251
|
-
t39 = t("common.apply");
|
|
1252
|
-
$[104] = t;
|
|
1253
|
-
$[105] = t39;
|
|
1254
|
-
} else t39 = $[105];
|
|
1264
|
+
$[107] = DialogClose;
|
|
1265
|
+
$[108] = t37;
|
|
1266
|
+
$[109] = t38;
|
|
1267
|
+
} else t38 = $[109];
|
|
1268
|
+
const t39 = !canApply;
|
|
1255
1269
|
let t40;
|
|
1256
|
-
if ($[
|
|
1257
|
-
t40 =
|
|
1270
|
+
if ($[110] !== t) {
|
|
1271
|
+
t40 = t("common.apply");
|
|
1272
|
+
$[110] = t;
|
|
1273
|
+
$[111] = t40;
|
|
1274
|
+
} else t40 = $[111];
|
|
1275
|
+
let t41;
|
|
1276
|
+
if ($[112] !== handleApply || $[113] !== t39 || $[114] !== t40) {
|
|
1277
|
+
t41 = /* @__PURE__ */ jsx("button", {
|
|
1258
1278
|
className: DIALOG_PRIMARY_BUTTON_CLASS,
|
|
1259
|
-
disabled:
|
|
1279
|
+
disabled: t39,
|
|
1260
1280
|
onClick: handleApply,
|
|
1261
1281
|
type: "button",
|
|
1262
|
-
children:
|
|
1282
|
+
children: t40
|
|
1263
1283
|
});
|
|
1264
|
-
$[
|
|
1265
|
-
$[
|
|
1266
|
-
$[
|
|
1267
|
-
$[
|
|
1268
|
-
} else
|
|
1269
|
-
let
|
|
1270
|
-
if ($[
|
|
1271
|
-
|
|
1284
|
+
$[112] = handleApply;
|
|
1285
|
+
$[113] = t39;
|
|
1286
|
+
$[114] = t40;
|
|
1287
|
+
$[115] = t41;
|
|
1288
|
+
} else t41 = $[115];
|
|
1289
|
+
let t42;
|
|
1290
|
+
if ($[116] !== t38 || $[117] !== t41) {
|
|
1291
|
+
t42 = /* @__PURE__ */ jsxs("div", {
|
|
1272
1292
|
className: DIALOG_FOOTER_CLASS,
|
|
1273
|
-
children: [
|
|
1293
|
+
children: [t38, t41]
|
|
1274
1294
|
});
|
|
1275
|
-
$[
|
|
1276
|
-
$[
|
|
1277
|
-
$[
|
|
1278
|
-
} else
|
|
1279
|
-
let
|
|
1280
|
-
if ($[
|
|
1281
|
-
|
|
1295
|
+
$[116] = t38;
|
|
1296
|
+
$[117] = t41;
|
|
1297
|
+
$[118] = t42;
|
|
1298
|
+
} else t42 = $[118];
|
|
1299
|
+
let t43;
|
|
1300
|
+
if ($[119] !== DialogPopup || $[120] !== t20 || $[121] !== t36 || $[122] !== t42) {
|
|
1301
|
+
t43 = /* @__PURE__ */ jsxs(DialogPopup, {
|
|
1282
1302
|
className: DIALOG_POPUP_CLASS,
|
|
1283
1303
|
children: [
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1304
|
+
t20,
|
|
1305
|
+
t36,
|
|
1306
|
+
t42
|
|
1287
1307
|
]
|
|
1288
1308
|
});
|
|
1289
|
-
$[
|
|
1290
|
-
$[
|
|
1291
|
-
$[
|
|
1292
|
-
$[
|
|
1293
|
-
$[
|
|
1294
|
-
} else
|
|
1295
|
-
let t43;
|
|
1296
|
-
if ($[118] !== DialogPortal || $[119] !== t17 || $[120] !== t42) {
|
|
1297
|
-
t43 = /* @__PURE__ */ jsxs(DialogPortal, { children: [t17, t42] });
|
|
1298
|
-
$[118] = DialogPortal;
|
|
1299
|
-
$[119] = t17;
|
|
1300
|
-
$[120] = t42;
|
|
1301
|
-
$[121] = t43;
|
|
1302
|
-
} else t43 = $[121];
|
|
1309
|
+
$[119] = DialogPopup;
|
|
1310
|
+
$[120] = t20;
|
|
1311
|
+
$[121] = t36;
|
|
1312
|
+
$[122] = t42;
|
|
1313
|
+
$[123] = t43;
|
|
1314
|
+
} else t43 = $[123];
|
|
1303
1315
|
let t44;
|
|
1304
|
-
if ($[
|
|
1305
|
-
t44 = /* @__PURE__ */
|
|
1316
|
+
if ($[124] !== DialogPortal || $[125] !== t18 || $[126] !== t43) {
|
|
1317
|
+
t44 = /* @__PURE__ */ jsxs(DialogPortal, { children: [t18, t43] });
|
|
1318
|
+
$[124] = DialogPortal;
|
|
1319
|
+
$[125] = t18;
|
|
1320
|
+
$[126] = t43;
|
|
1321
|
+
$[127] = t44;
|
|
1322
|
+
} else t44 = $[127];
|
|
1323
|
+
let t45;
|
|
1324
|
+
if ($[128] !== Dialog || $[129] !== handleOpenChange || $[130] !== isOpen || $[131] !== t44) {
|
|
1325
|
+
t45 = /* @__PURE__ */ jsx(Dialog, {
|
|
1306
1326
|
open: isOpen,
|
|
1307
1327
|
onOpenChange: handleOpenChange,
|
|
1308
|
-
children:
|
|
1328
|
+
children: t44
|
|
1309
1329
|
});
|
|
1310
|
-
$[
|
|
1311
|
-
$[
|
|
1312
|
-
$[
|
|
1313
|
-
$[
|
|
1314
|
-
$[
|
|
1315
|
-
} else
|
|
1316
|
-
return
|
|
1330
|
+
$[128] = Dialog;
|
|
1331
|
+
$[129] = handleOpenChange;
|
|
1332
|
+
$[130] = isOpen;
|
|
1333
|
+
$[131] = t44;
|
|
1334
|
+
$[132] = t45;
|
|
1335
|
+
} else t45 = $[132];
|
|
1336
|
+
return t45;
|
|
1317
1337
|
}
|
|
1318
1338
|
function toWatermarkMode(value) {
|
|
1319
1339
|
if (value === "none" || value === "picture" || value === "text") return value;
|
|
@@ -1328,6 +1348,12 @@ function clampScalePercent(value) {
|
|
|
1328
1348
|
function stripHash(value) {
|
|
1329
1349
|
return value.startsWith("#") ? value.slice(1) : value;
|
|
1330
1350
|
}
|
|
1351
|
+
/** Mirrors `HyperlinkDialog.tsx`'s `getUrlError` — a plain-English, untranslated
|
|
1352
|
+
* field-level validation message (existing convention for this kind of inline
|
|
1353
|
+
* error in this dialog family). */
|
|
1354
|
+
function getExternalImageTargetError(value) {
|
|
1355
|
+
return isAllowedExternalWatermarkImageUrl(value) ? "" : "Use a web address (http/https).";
|
|
1356
|
+
}
|
|
1331
1357
|
function toColorInputValue(value) {
|
|
1332
1358
|
if (!value || value === "auto") return DEFAULT_TEXT_COLOR;
|
|
1333
1359
|
return value.startsWith("#") ? value : `#${value}`;
|
package/dist/dialogs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as FindReplaceDialog } from "./FindReplaceDialog-CqKK82nE.js";
|
|
2
2
|
import { t as FootnotePropertiesDialog } from "./FootnotePropertiesDialog-CixRdIiT.js";
|
|
3
|
-
import { a as InsertImageDialog, i as InsertTableDialog, n as SplitCellDialog, o as HyperlinkDialog, r as PasteSpecialDialog, t as WatermarkDialog } from "./dialogs-
|
|
3
|
+
import { a as InsertImageDialog, i as InsertTableDialog, n as SplitCellDialog, o as HyperlinkDialog, r as PasteSpecialDialog, t as WatermarkDialog } from "./dialogs-CB49Gr8j.js";
|
|
4
4
|
import { t as ImagePositionDialog } from "./ImagePositionDialog-DNodkoI2.js";
|
|
5
5
|
import { t as ImagePropertiesDialog } from "./ImagePropertiesDialog-CLsDIUWb.js";
|
|
6
6
|
import { t as InsertSymbolDialog } from "./InsertSymbolDialog-DCFLmfzn.js";
|