@lark-apaas/client-toolkit-lite 1.1.0 → 1.1.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/index.cjs +79 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +79 -16
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -467,6 +467,65 @@ function useLogout() {
|
|
|
467
467
|
}
|
|
468
468
|
__name(useLogout, "useLogout");
|
|
469
469
|
|
|
470
|
+
// src/locales/messages.ts
|
|
471
|
+
var messages = {
|
|
472
|
+
// ── Safety 组件 ──────────────────────────────────────────────
|
|
473
|
+
"safety.badge.label": {
|
|
474
|
+
zh: "\u5999\u642D",
|
|
475
|
+
en: "Spark"
|
|
476
|
+
},
|
|
477
|
+
"safety.badge.builtWith": {
|
|
478
|
+
zh: "\u7531\u5999\u642D\u642D\u5EFA",
|
|
479
|
+
en: "Built with Spark"
|
|
480
|
+
},
|
|
481
|
+
"safety.ai.disclaimer": {
|
|
482
|
+
zh: "\u5305\u542B AI \u751F\u6210\u5185\u5BB9\uFF0C\u8BF7\u6CE8\u610F\u7504\u522B",
|
|
483
|
+
en: "AI-generated content. Use with care."
|
|
484
|
+
},
|
|
485
|
+
"safety.tenant.operated": {
|
|
486
|
+
zh: "{name}\u8FD0\u8425",
|
|
487
|
+
en: "Operated by {name}"
|
|
488
|
+
},
|
|
489
|
+
"safety.button.dontShowAgain": {
|
|
490
|
+
zh: "\u4E0D\u518D\u5C55\u793A",
|
|
491
|
+
en: "Don't show again"
|
|
492
|
+
},
|
|
493
|
+
"safety.button.learnMore": {
|
|
494
|
+
zh: "\u4E86\u89E3\u66F4\u591A",
|
|
495
|
+
en: "Learn more"
|
|
496
|
+
},
|
|
497
|
+
"safety.cover.pc": {
|
|
498
|
+
zh: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/miaodacover.png",
|
|
499
|
+
en: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/miaodacover-pcen.png"
|
|
500
|
+
},
|
|
501
|
+
"safety.cover.mobile": {
|
|
502
|
+
zh: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/miaodacover-mobile.png",
|
|
503
|
+
en: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/miaodacover-weben.png"
|
|
504
|
+
}
|
|
505
|
+
};
|
|
506
|
+
var messages_default = messages;
|
|
507
|
+
|
|
508
|
+
// src/utils/locale.ts
|
|
509
|
+
function getLocale() {
|
|
510
|
+
const lang = navigator.language || "zh";
|
|
511
|
+
return lang.startsWith("zh") ? "zh" : "en";
|
|
512
|
+
}
|
|
513
|
+
__name(getLocale, "getLocale");
|
|
514
|
+
|
|
515
|
+
// src/locales/index.ts
|
|
516
|
+
function t(key, params) {
|
|
517
|
+
const locale = getLocale();
|
|
518
|
+
const entry = messages_default[key];
|
|
519
|
+
let text = entry?.[locale] ?? entry?.zh ?? key;
|
|
520
|
+
if (params) {
|
|
521
|
+
for (const [k, v] of Object.entries(params)) {
|
|
522
|
+
text = text.replace(`{${k}}`, v);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
return text;
|
|
526
|
+
}
|
|
527
|
+
__name(t, "t");
|
|
528
|
+
|
|
470
529
|
// src/components/AppContainer/safety.tsx
|
|
471
530
|
var resetBase = {
|
|
472
531
|
boxSizing: "border-box",
|
|
@@ -489,8 +548,8 @@ var FONT_FAMILY = "'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI',
|
|
|
489
548
|
var Z_BADGE = 1e7;
|
|
490
549
|
var Z_OVERLAY = 10000001;
|
|
491
550
|
var LOGO_URL = "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/miaodalogo.svg";
|
|
492
|
-
var
|
|
493
|
-
var
|
|
551
|
+
var getCoverUrl = /* @__PURE__ */ __name(() => t("safety.cover.pc"), "getCoverUrl");
|
|
552
|
+
var getCoverMobileUrl = /* @__PURE__ */ __name(() => t("safety.cover.mobile"), "getCoverMobileUrl");
|
|
494
553
|
var ICON_COMPANY_URL = "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/icon/icon_company_outlined.svg";
|
|
495
554
|
var ICON_AI_URL = "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/icon/icon_efficiency-ai_outlined.svg";
|
|
496
555
|
var LANDING_URL = "https://miaoda.feishu.cn/landing";
|
|
@@ -776,7 +835,7 @@ var Safety = /* @__PURE__ */ __name(() => {
|
|
|
776
835
|
const link = document.createElement("link");
|
|
777
836
|
link.rel = "preload";
|
|
778
837
|
link.as = "image";
|
|
779
|
-
link.href =
|
|
838
|
+
link.href = getCoverMobileUrl();
|
|
780
839
|
document.head.appendChild(link);
|
|
781
840
|
}
|
|
782
841
|
}, [
|
|
@@ -803,7 +862,7 @@ var Safety = /* @__PURE__ */ __name(() => {
|
|
|
803
862
|
...badgeTextStyle,
|
|
804
863
|
minWidth: 28
|
|
805
864
|
}
|
|
806
|
-
}, "
|
|
865
|
+
}, t("safety.badge.label")))), /* @__PURE__ */ React2.createElement(DialogPrimitive.Portal, null, /* @__PURE__ */ React2.createElement(DialogPrimitive.Overlay, {
|
|
807
866
|
style: overlayStyle
|
|
808
867
|
}), /* @__PURE__ */ React2.createElement(DialogPrimitive.Content, {
|
|
809
868
|
style: sheetContent,
|
|
@@ -813,13 +872,13 @@ var Safety = /* @__PURE__ */ __name(() => {
|
|
|
813
872
|
position: "absolute",
|
|
814
873
|
clip: "rect(0 0 0 0)"
|
|
815
874
|
}
|
|
816
|
-
}, "
|
|
875
|
+
}, t("safety.badge.builtWith")), /* @__PURE__ */ React2.createElement("div", {
|
|
817
876
|
style: sheetInner
|
|
818
877
|
}, /* @__PURE__ */ React2.createElement(XIcon, {
|
|
819
878
|
style: sheetCloseBtn,
|
|
820
879
|
onClick: /* @__PURE__ */ __name(() => setOpen(false), "onClick")
|
|
821
880
|
}), /* @__PURE__ */ React2.createElement("img", {
|
|
822
|
-
src:
|
|
881
|
+
src: getCoverMobileUrl(),
|
|
823
882
|
alt: "",
|
|
824
883
|
style: sheetCover,
|
|
825
884
|
onClick: /* @__PURE__ */ __name(() => window.open(LANDING_URL, "_blank"), "onClick")
|
|
@@ -839,14 +898,16 @@ var Safety = /* @__PURE__ */ __name(() => {
|
|
|
839
898
|
style: infoIconMobile
|
|
840
899
|
}), /* @__PURE__ */ React2.createElement("p", {
|
|
841
900
|
style: sheetInfoText
|
|
842
|
-
},
|
|
901
|
+
}, t("safety.tenant.operated", {
|
|
902
|
+
name: userinfo?.name ?? ""
|
|
903
|
+
}))), /* @__PURE__ */ React2.createElement("div", {
|
|
843
904
|
style: infoRow
|
|
844
905
|
}, /* @__PURE__ */ React2.createElement("img", {
|
|
845
906
|
src: ICON_AI_URL,
|
|
846
907
|
style: infoIconMobile
|
|
847
908
|
}), /* @__PURE__ */ React2.createElement("p", {
|
|
848
909
|
style: sheetInfoText
|
|
849
|
-
}, "
|
|
910
|
+
}, t("safety.ai.disclaimer")))), /* @__PURE__ */ React2.createElement("div", {
|
|
850
911
|
style: mobileBtnRow
|
|
851
912
|
}, /* @__PURE__ */ React2.createElement("div", {
|
|
852
913
|
style: mobileBtnOutline,
|
|
@@ -857,10 +918,10 @@ var Safety = /* @__PURE__ */ __name(() => {
|
|
|
857
918
|
setTimeout(() => setVisible(false), 200);
|
|
858
919
|
window.localStorage?.setItem(HasClosedKey, "true");
|
|
859
920
|
}, "onClick")
|
|
860
|
-
}, "
|
|
921
|
+
}, t("safety.button.dontShowAgain")), /* @__PURE__ */ React2.createElement("div", {
|
|
861
922
|
style: mobileBtnFilled,
|
|
862
923
|
onClick: /* @__PURE__ */ __name(() => window.open(LANDING_URL, "_blank"), "onClick")
|
|
863
|
-
}, "
|
|
924
|
+
}, t("safety.button.learnMore"))))))));
|
|
864
925
|
}
|
|
865
926
|
return /* @__PURE__ */ React2.createElement(PopoverPrimitive.Root, {
|
|
866
927
|
open,
|
|
@@ -884,7 +945,7 @@ var Safety = /* @__PURE__ */ __name(() => {
|
|
|
884
945
|
...badgeTextStyle,
|
|
885
946
|
minWidth: 60
|
|
886
947
|
}
|
|
887
|
-
}, "
|
|
948
|
+
}, t("safety.badge.builtWith")))), /* @__PURE__ */ React2.createElement(PopoverPrimitive.Portal, null, /* @__PURE__ */ React2.createElement(PopoverPrimitive.Content, {
|
|
888
949
|
style: popoverContent,
|
|
889
950
|
side: "top",
|
|
890
951
|
align: "end",
|
|
@@ -899,7 +960,7 @@ var Safety = /* @__PURE__ */ __name(() => {
|
|
|
899
960
|
}, /* @__PURE__ */ React2.createElement("div", {
|
|
900
961
|
style: popoverInner
|
|
901
962
|
}, /* @__PURE__ */ React2.createElement("img", {
|
|
902
|
-
src:
|
|
963
|
+
src: getCoverUrl(),
|
|
903
964
|
alt: "",
|
|
904
965
|
style: popoverCover,
|
|
905
966
|
onClick: /* @__PURE__ */ __name(() => window.open(LANDING_URL, "_blank"), "onClick")
|
|
@@ -919,14 +980,16 @@ var Safety = /* @__PURE__ */ __name(() => {
|
|
|
919
980
|
style: infoIcon
|
|
920
981
|
}), /* @__PURE__ */ React2.createElement("p", {
|
|
921
982
|
style: infoText
|
|
922
|
-
},
|
|
983
|
+
}, t("safety.tenant.operated", {
|
|
984
|
+
name: userinfo?.name ?? ""
|
|
985
|
+
}))), /* @__PURE__ */ React2.createElement("div", {
|
|
923
986
|
style: infoRow
|
|
924
987
|
}, /* @__PURE__ */ React2.createElement("img", {
|
|
925
988
|
src: ICON_AI_URL,
|
|
926
989
|
style: infoIcon
|
|
927
990
|
}), /* @__PURE__ */ React2.createElement("p", {
|
|
928
991
|
style: infoText
|
|
929
|
-
}, "
|
|
992
|
+
}, t("safety.ai.disclaimer")))), /* @__PURE__ */ React2.createElement("div", {
|
|
930
993
|
style: btnRow
|
|
931
994
|
}, /* @__PURE__ */ React2.createElement(HoverButton, {
|
|
932
995
|
style: btnBase,
|
|
@@ -937,11 +1000,11 @@ var Safety = /* @__PURE__ */ __name(() => {
|
|
|
937
1000
|
setVisible(false);
|
|
938
1001
|
window.localStorage?.setItem(HasClosedKey, "true");
|
|
939
1002
|
}, "onClick")
|
|
940
|
-
}, "
|
|
1003
|
+
}, t("safety.button.dontShowAgain")), /* @__PURE__ */ React2.createElement(HoverButton, {
|
|
941
1004
|
style: btnBase,
|
|
942
1005
|
"data-custom-element": "safety-more",
|
|
943
1006
|
onClick: /* @__PURE__ */ __name(() => window.open(LANDING_URL, "_blank"), "onClick")
|
|
944
|
-
}, "
|
|
1007
|
+
}, t("safety.button.learnMore"))))))));
|
|
945
1008
|
}, "Safety");
|
|
946
1009
|
var safety_default = Safety;
|
|
947
1010
|
|