@lark-apaas/client-toolkit-lite 1.1.0-alpha.8 → 1.1.1-alpha.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/index.cjs +51 -93
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +47 -90
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -37,6 +37,7 @@ __export(index_exports, {
|
|
|
37
37
|
QueryProvider: () => QueryProvider_default,
|
|
38
38
|
TrackKey: () => TrackKey,
|
|
39
39
|
UniversalLink: () => UniversalLink,
|
|
40
|
+
Welcome: () => Welcome_default,
|
|
40
41
|
avatarImages: () => avatar_exports,
|
|
41
42
|
axiosForBackend: () => axiosForBackend,
|
|
42
43
|
bannerImages: () => banner_exports,
|
|
@@ -530,65 +531,6 @@ function useLogout() {
|
|
|
530
531
|
}
|
|
531
532
|
__name(useLogout, "useLogout");
|
|
532
533
|
|
|
533
|
-
// src/locales/messages.ts
|
|
534
|
-
var messages = {
|
|
535
|
-
// ── Safety 组件 ──────────────────────────────────────────────
|
|
536
|
-
"safety.badge.label": {
|
|
537
|
-
zh: "\u5999\u642D",
|
|
538
|
-
en: "Spark"
|
|
539
|
-
},
|
|
540
|
-
"safety.badge.builtWith": {
|
|
541
|
-
zh: "\u7531\u5999\u642D\u642D\u5EFA",
|
|
542
|
-
en: "Built with Spark"
|
|
543
|
-
},
|
|
544
|
-
"safety.ai.disclaimer": {
|
|
545
|
-
zh: "\u5305\u542B AI \u751F\u6210\u5185\u5BB9\uFF0C\u8BF7\u6CE8\u610F\u7504\u522B",
|
|
546
|
-
en: "AI-generated content. Use with care."
|
|
547
|
-
},
|
|
548
|
-
"safety.tenant.operated": {
|
|
549
|
-
zh: "{name}\u8FD0\u8425",
|
|
550
|
-
en: "Operated by {name}"
|
|
551
|
-
},
|
|
552
|
-
"safety.button.dontShowAgain": {
|
|
553
|
-
zh: "\u4E0D\u518D\u5C55\u793A",
|
|
554
|
-
en: "Don't show again"
|
|
555
|
-
},
|
|
556
|
-
"safety.button.learnMore": {
|
|
557
|
-
zh: "\u4E86\u89E3\u66F4\u591A",
|
|
558
|
-
en: "Learn more"
|
|
559
|
-
},
|
|
560
|
-
"safety.cover.pc": {
|
|
561
|
-
zh: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/miaodacover.png",
|
|
562
|
-
en: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/miaodacover-pcen.png"
|
|
563
|
-
},
|
|
564
|
-
"safety.cover.mobile": {
|
|
565
|
-
zh: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/miaodacover-mobile.png",
|
|
566
|
-
en: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/miaodacover-weben.png"
|
|
567
|
-
}
|
|
568
|
-
};
|
|
569
|
-
var messages_default = messages;
|
|
570
|
-
|
|
571
|
-
// src/utils/locale.ts
|
|
572
|
-
function getLocale() {
|
|
573
|
-
const lang = navigator.language || "zh";
|
|
574
|
-
return lang.startsWith("zh") ? "zh" : "en";
|
|
575
|
-
}
|
|
576
|
-
__name(getLocale, "getLocale");
|
|
577
|
-
|
|
578
|
-
// src/locales/index.ts
|
|
579
|
-
function t(key, params) {
|
|
580
|
-
const locale = getLocale();
|
|
581
|
-
const entry = messages_default[key];
|
|
582
|
-
let text = entry?.[locale] ?? entry?.zh ?? key;
|
|
583
|
-
if (params) {
|
|
584
|
-
for (const [k, v] of Object.entries(params)) {
|
|
585
|
-
text = text.replace(`{${k}}`, v);
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
return text;
|
|
589
|
-
}
|
|
590
|
-
__name(t, "t");
|
|
591
|
-
|
|
592
534
|
// src/components/AppContainer/safety.tsx
|
|
593
535
|
var resetBase = {
|
|
594
536
|
boxSizing: "border-box",
|
|
@@ -611,8 +553,8 @@ var FONT_FAMILY = "'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI',
|
|
|
611
553
|
var Z_BADGE = 1e7;
|
|
612
554
|
var Z_OVERLAY = 10000001;
|
|
613
555
|
var LOGO_URL = "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/miaodalogo.svg";
|
|
614
|
-
var
|
|
615
|
-
var
|
|
556
|
+
var COVER_URL = "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/miaodacover.png";
|
|
557
|
+
var COVER_MOBILE_URL = "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/logo/miaodacover-mobile.png";
|
|
616
558
|
var ICON_COMPANY_URL = "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/icon/icon_company_outlined.svg";
|
|
617
559
|
var ICON_AI_URL = "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/icon/icon_efficiency-ai_outlined.svg";
|
|
618
560
|
var LANDING_URL = "https://miaoda.feishu.cn/landing";
|
|
@@ -898,7 +840,7 @@ var Safety = /* @__PURE__ */ __name(() => {
|
|
|
898
840
|
const link = document.createElement("link");
|
|
899
841
|
link.rel = "preload";
|
|
900
842
|
link.as = "image";
|
|
901
|
-
link.href =
|
|
843
|
+
link.href = COVER_MOBILE_URL;
|
|
902
844
|
document.head.appendChild(link);
|
|
903
845
|
}
|
|
904
846
|
}, [
|
|
@@ -925,7 +867,7 @@ var Safety = /* @__PURE__ */ __name(() => {
|
|
|
925
867
|
...badgeTextStyle,
|
|
926
868
|
minWidth: 28
|
|
927
869
|
}
|
|
928
|
-
},
|
|
870
|
+
}, "\u5999\u642D"))), /* @__PURE__ */ import_react5.default.createElement(DialogPrimitive.Portal, null, /* @__PURE__ */ import_react5.default.createElement(DialogPrimitive.Overlay, {
|
|
929
871
|
style: overlayStyle
|
|
930
872
|
}), /* @__PURE__ */ import_react5.default.createElement(DialogPrimitive.Content, {
|
|
931
873
|
style: sheetContent,
|
|
@@ -935,13 +877,13 @@ var Safety = /* @__PURE__ */ __name(() => {
|
|
|
935
877
|
position: "absolute",
|
|
936
878
|
clip: "rect(0 0 0 0)"
|
|
937
879
|
}
|
|
938
|
-
},
|
|
880
|
+
}, "\u5999\u642D\u54C1\u724C\u4FE1\u606F"), /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
939
881
|
style: sheetInner
|
|
940
882
|
}, /* @__PURE__ */ import_react5.default.createElement(XIcon, {
|
|
941
883
|
style: sheetCloseBtn,
|
|
942
884
|
onClick: /* @__PURE__ */ __name(() => setOpen(false), "onClick")
|
|
943
885
|
}), /* @__PURE__ */ import_react5.default.createElement("img", {
|
|
944
|
-
src:
|
|
886
|
+
src: COVER_MOBILE_URL,
|
|
945
887
|
alt: "",
|
|
946
888
|
style: sheetCover,
|
|
947
889
|
onClick: /* @__PURE__ */ __name(() => window.open(LANDING_URL, "_blank"), "onClick")
|
|
@@ -961,16 +903,14 @@ var Safety = /* @__PURE__ */ __name(() => {
|
|
|
961
903
|
style: infoIconMobile
|
|
962
904
|
}), /* @__PURE__ */ import_react5.default.createElement("p", {
|
|
963
905
|
style: sheetInfoText
|
|
964
|
-
},
|
|
965
|
-
name: userinfo?.name ?? ""
|
|
966
|
-
}))), /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
906
|
+
}, userinfo?.name, "\u8FD0\u8425")), /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
967
907
|
style: infoRow
|
|
968
908
|
}, /* @__PURE__ */ import_react5.default.createElement("img", {
|
|
969
909
|
src: ICON_AI_URL,
|
|
970
910
|
style: infoIconMobile
|
|
971
911
|
}), /* @__PURE__ */ import_react5.default.createElement("p", {
|
|
972
912
|
style: sheetInfoText
|
|
973
|
-
},
|
|
913
|
+
}, "\u5305\u542B AI \u751F\u6210\u5185\u5BB9\uFF0C\u8BF7\u6CE8\u610F\u7504\u522B"))), /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
974
914
|
style: mobileBtnRow
|
|
975
915
|
}, /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
976
916
|
style: mobileBtnOutline,
|
|
@@ -981,10 +921,10 @@ var Safety = /* @__PURE__ */ __name(() => {
|
|
|
981
921
|
setTimeout(() => setVisible(false), 200);
|
|
982
922
|
window.localStorage?.setItem(HasClosedKey, "true");
|
|
983
923
|
}, "onClick")
|
|
984
|
-
},
|
|
924
|
+
}, "\u4E0D\u518D\u5C55\u793A"), /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
985
925
|
style: mobileBtnFilled,
|
|
986
926
|
onClick: /* @__PURE__ */ __name(() => window.open(LANDING_URL, "_blank"), "onClick")
|
|
987
|
-
},
|
|
927
|
+
}, "\u4E86\u89E3\u66F4\u591A")))))));
|
|
988
928
|
}
|
|
989
929
|
return /* @__PURE__ */ import_react5.default.createElement(PopoverPrimitive.Root, {
|
|
990
930
|
open,
|
|
@@ -1008,7 +948,7 @@ var Safety = /* @__PURE__ */ __name(() => {
|
|
|
1008
948
|
...badgeTextStyle,
|
|
1009
949
|
minWidth: 60
|
|
1010
950
|
}
|
|
1011
|
-
},
|
|
951
|
+
}, "\u7531\u5999\u642D\u642D\u5EFA"))), /* @__PURE__ */ import_react5.default.createElement(PopoverPrimitive.Portal, null, /* @__PURE__ */ import_react5.default.createElement(PopoverPrimitive.Content, {
|
|
1012
952
|
style: popoverContent,
|
|
1013
953
|
side: "top",
|
|
1014
954
|
align: "end",
|
|
@@ -1023,7 +963,7 @@ var Safety = /* @__PURE__ */ __name(() => {
|
|
|
1023
963
|
}, /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
1024
964
|
style: popoverInner
|
|
1025
965
|
}, /* @__PURE__ */ import_react5.default.createElement("img", {
|
|
1026
|
-
src:
|
|
966
|
+
src: COVER_URL,
|
|
1027
967
|
alt: "",
|
|
1028
968
|
style: popoverCover,
|
|
1029
969
|
onClick: /* @__PURE__ */ __name(() => window.open(LANDING_URL, "_blank"), "onClick")
|
|
@@ -1043,16 +983,14 @@ var Safety = /* @__PURE__ */ __name(() => {
|
|
|
1043
983
|
style: infoIcon
|
|
1044
984
|
}), /* @__PURE__ */ import_react5.default.createElement("p", {
|
|
1045
985
|
style: infoText
|
|
1046
|
-
},
|
|
1047
|
-
name: userinfo?.name ?? ""
|
|
1048
|
-
}))), /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
986
|
+
}, userinfo?.name, "\u8FD0\u8425")), /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
1049
987
|
style: infoRow
|
|
1050
988
|
}, /* @__PURE__ */ import_react5.default.createElement("img", {
|
|
1051
989
|
src: ICON_AI_URL,
|
|
1052
990
|
style: infoIcon
|
|
1053
991
|
}), /* @__PURE__ */ import_react5.default.createElement("p", {
|
|
1054
992
|
style: infoText
|
|
1055
|
-
},
|
|
993
|
+
}, "\u5305\u542B AI \u751F\u6210\u5185\u5BB9\uFF0C\u8BF7\u6CE8\u610F\u7504\u522B"))), /* @__PURE__ */ import_react5.default.createElement("div", {
|
|
1056
994
|
style: btnRow
|
|
1057
995
|
}, /* @__PURE__ */ import_react5.default.createElement(HoverButton, {
|
|
1058
996
|
style: btnBase,
|
|
@@ -1063,11 +1001,11 @@ var Safety = /* @__PURE__ */ __name(() => {
|
|
|
1063
1001
|
setVisible(false);
|
|
1064
1002
|
window.localStorage?.setItem(HasClosedKey, "true");
|
|
1065
1003
|
}, "onClick")
|
|
1066
|
-
},
|
|
1004
|
+
}, "\u4E0D\u518D\u5C55\u793A"), /* @__PURE__ */ import_react5.default.createElement(HoverButton, {
|
|
1067
1005
|
style: btnBase,
|
|
1068
1006
|
"data-custom-element": "safety-more",
|
|
1069
1007
|
onClick: /* @__PURE__ */ __name(() => window.open(LANDING_URL, "_blank"), "onClick")
|
|
1070
|
-
},
|
|
1008
|
+
}, "\u4E86\u89E3\u66F4\u591A")))))));
|
|
1071
1009
|
}, "Safety");
|
|
1072
1010
|
var safety_default = Safety;
|
|
1073
1011
|
|
|
@@ -1235,13 +1173,32 @@ var AppContainer = /* @__PURE__ */ __name(({ children }) => {
|
|
|
1235
1173
|
}, "AppContainer");
|
|
1236
1174
|
var AppContainer_default = AppContainer;
|
|
1237
1175
|
|
|
1238
|
-
// src/
|
|
1176
|
+
// src/components/Welcome/index.tsx
|
|
1239
1177
|
var import_react8 = __toESM(require("react"), 1);
|
|
1178
|
+
var Welcome = /* @__PURE__ */ __name(({ title = "\u9875\u9762\u5F85\u5F00\u53D1", description = "\u9875\u9762\u6682\u672A\u5F00\u53D1\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5F85..." }) => {
|
|
1179
|
+
return /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
1180
|
+
className: "flex flex-col items-center justify-center px-6 w-full h-[calc(100vh-64px)] text-center"
|
|
1181
|
+
}, /* @__PURE__ */ import_react8.default.createElement("img", {
|
|
1182
|
+
className: "rounded-md mb-6",
|
|
1183
|
+
width: "320",
|
|
1184
|
+
height: "200",
|
|
1185
|
+
src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/miao/welcome.svg",
|
|
1186
|
+
alt: "Welcome"
|
|
1187
|
+
}), /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
1188
|
+
className: "text-center text-foreground text-base font-medium mb-1 leading-6"
|
|
1189
|
+
}, title), /* @__PURE__ */ import_react8.default.createElement("div", {
|
|
1190
|
+
className: "text-center text-muted-foreground text-base leading-6 line-clamp-2 sm:max-w-[480px]"
|
|
1191
|
+
}, description));
|
|
1192
|
+
}, "Welcome");
|
|
1193
|
+
var Welcome_default = Welcome;
|
|
1194
|
+
|
|
1195
|
+
// src/route-components/ActiveLink.tsx
|
|
1196
|
+
var import_react9 = __toESM(require("react"), 1);
|
|
1240
1197
|
var import_react_router_dom = require("react-router-dom");
|
|
1241
|
-
var ActiveLink = /* @__PURE__ */ (0,
|
|
1242
|
-
const [currentHash, setCurrentHash] = (0,
|
|
1198
|
+
var ActiveLink = /* @__PURE__ */ (0, import_react9.forwardRef)(({ to, onClick, className, style, children, ...rest }, ref) => {
|
|
1199
|
+
const [currentHash, setCurrentHash] = (0, import_react9.useState)(() => typeof window !== "undefined" ? window.location.hash : "");
|
|
1243
1200
|
const isHashRoute = typeof to === "string" && to.startsWith("#");
|
|
1244
|
-
(0,
|
|
1201
|
+
(0, import_react9.useEffect)(() => {
|
|
1245
1202
|
if (!isHashRoute) return;
|
|
1246
1203
|
const handleHashChange = /* @__PURE__ */ __name(() => {
|
|
1247
1204
|
setCurrentHash(window.location.hash);
|
|
@@ -1253,7 +1210,7 @@ var ActiveLink = /* @__PURE__ */ (0, import_react8.forwardRef)(({ to, onClick, c
|
|
|
1253
1210
|
]);
|
|
1254
1211
|
const isActive = isHashRoute && currentHash === to;
|
|
1255
1212
|
if (!isHashRoute) {
|
|
1256
|
-
return /* @__PURE__ */
|
|
1213
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_react_router_dom.NavLink, {
|
|
1257
1214
|
ref,
|
|
1258
1215
|
to,
|
|
1259
1216
|
onClick,
|
|
@@ -1294,7 +1251,7 @@ var ActiveLink = /* @__PURE__ */ (0, import_react8.forwardRef)(({ to, onClick, c
|
|
|
1294
1251
|
isPending: false,
|
|
1295
1252
|
isTransitioning: false
|
|
1296
1253
|
}) : children;
|
|
1297
|
-
return /* @__PURE__ */
|
|
1254
|
+
return /* @__PURE__ */ import_react9.default.createElement("a", {
|
|
1298
1255
|
ref,
|
|
1299
1256
|
href: to,
|
|
1300
1257
|
onClick: handleHashClick,
|
|
@@ -1306,9 +1263,9 @@ var ActiveLink = /* @__PURE__ */ (0, import_react8.forwardRef)(({ to, onClick, c
|
|
|
1306
1263
|
ActiveLink.displayName = "ActiveLink";
|
|
1307
1264
|
|
|
1308
1265
|
// src/route-components/NavLink.tsx
|
|
1309
|
-
var
|
|
1266
|
+
var React7 = __toESM(require("react"), 1);
|
|
1310
1267
|
var import_react_router_dom2 = require("react-router-dom");
|
|
1311
|
-
var NavLink2 = /* @__PURE__ */
|
|
1268
|
+
var NavLink2 = /* @__PURE__ */ React7.forwardRef(({ to, children, className, style, ...props }, ref) => {
|
|
1312
1269
|
const isHashLink = typeof to === "string" && to.startsWith("#");
|
|
1313
1270
|
const location = (0, import_react_router_dom2.useLocation)();
|
|
1314
1271
|
const navigate = (0, import_react_router_dom2.useNavigate)();
|
|
@@ -1332,7 +1289,7 @@ var NavLink2 = /* @__PURE__ */ React6.forwardRef(({ to, children, className, sty
|
|
|
1332
1289
|
const resolvedClassName = typeof className === "function" ? className(renderProps) : className;
|
|
1333
1290
|
const resolvedStyle = typeof style === "function" ? style(renderProps) : style;
|
|
1334
1291
|
const { caseSensitive, end, replace, state, preventScrollReset, relative, viewTransition, ...restProps } = props;
|
|
1335
|
-
return /* @__PURE__ */
|
|
1292
|
+
return /* @__PURE__ */ React7.createElement("a", {
|
|
1336
1293
|
href: to,
|
|
1337
1294
|
onClick: handleClick,
|
|
1338
1295
|
ref,
|
|
@@ -1341,7 +1298,7 @@ var NavLink2 = /* @__PURE__ */ React6.forwardRef(({ to, children, className, sty
|
|
|
1341
1298
|
...restProps
|
|
1342
1299
|
}, typeof children === "function" ? children(renderProps) : children);
|
|
1343
1300
|
}
|
|
1344
|
-
return /* @__PURE__ */
|
|
1301
|
+
return /* @__PURE__ */ React7.createElement(import_react_router_dom2.NavLink, {
|
|
1345
1302
|
to,
|
|
1346
1303
|
ref,
|
|
1347
1304
|
className,
|
|
@@ -1356,7 +1313,7 @@ var NavLink2 = /* @__PURE__ */ React6.forwardRef(({ to, children, className, sty
|
|
|
1356
1313
|
NavLink2.displayName = "NavLink";
|
|
1357
1314
|
|
|
1358
1315
|
// src/route-components/UniversalLink.tsx
|
|
1359
|
-
var
|
|
1316
|
+
var import_react10 = __toESM(require("react"), 1);
|
|
1360
1317
|
var import_react_router_dom3 = require("react-router-dom");
|
|
1361
1318
|
function isInternalRoute(to) {
|
|
1362
1319
|
return !to.startsWith("#") && !to.startsWith("http://") && !to.startsWith("https://") && !to.startsWith("//");
|
|
@@ -1366,15 +1323,15 @@ function isExternalLink(to) {
|
|
|
1366
1323
|
return to.startsWith("http://") || to.startsWith("https://") || to.startsWith("//");
|
|
1367
1324
|
}
|
|
1368
1325
|
__name(isExternalLink, "isExternalLink");
|
|
1369
|
-
var UniversalLink = /* @__PURE__ */
|
|
1326
|
+
var UniversalLink = /* @__PURE__ */ import_react10.default.forwardRef(/* @__PURE__ */ __name(function UniversalLink2({ to, ...props }, ref) {
|
|
1370
1327
|
if (isInternalRoute(to)) {
|
|
1371
|
-
return /* @__PURE__ */
|
|
1328
|
+
return /* @__PURE__ */ import_react10.default.createElement(import_react_router_dom3.Link, {
|
|
1372
1329
|
to,
|
|
1373
1330
|
ref,
|
|
1374
1331
|
...props
|
|
1375
1332
|
});
|
|
1376
1333
|
}
|
|
1377
|
-
return /* @__PURE__ */
|
|
1334
|
+
return /* @__PURE__ */ import_react10.default.createElement("a", {
|
|
1378
1335
|
href: to,
|
|
1379
1336
|
ref,
|
|
1380
1337
|
...props,
|
|
@@ -1802,6 +1759,7 @@ var abstractArt3dRenderingCoverImg6 = "https://lf3-static.bytednsdoc.com/obj/ede
|
|
|
1802
1759
|
QueryProvider,
|
|
1803
1760
|
TrackKey,
|
|
1804
1761
|
UniversalLink,
|
|
1762
|
+
Welcome,
|
|
1805
1763
|
avatarImages,
|
|
1806
1764
|
axiosForBackend,
|
|
1807
1765
|
bannerImages,
|