@lark-apaas/client-toolkit-lite 1.1.3 → 1.1.4
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 +61 -14
- 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 +57 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -34,6 +34,7 @@ __export(index_exports, {
|
|
|
34
34
|
ActiveLink: () => ActiveLink,
|
|
35
35
|
AppContainer: () => AppContainer_default,
|
|
36
36
|
NavLink: () => NavLink2,
|
|
37
|
+
PagePlaceholder: () => PagePlaceholder_default,
|
|
37
38
|
QueryProvider: () => QueryProvider_default,
|
|
38
39
|
TrackKey: () => TrackKey,
|
|
39
40
|
UniversalLink: () => UniversalLink,
|
|
@@ -1278,13 +1279,58 @@ var Welcome = /* @__PURE__ */ __name(({ title = "\u9875\u9762\u5F85\u5F00\u53D1"
|
|
|
1278
1279
|
}, "Welcome");
|
|
1279
1280
|
var Welcome_default = Welcome;
|
|
1280
1281
|
|
|
1281
|
-
// src/
|
|
1282
|
+
// src/components/PagePlaceholder/index.tsx
|
|
1282
1283
|
var import_react9 = __toESM(require("react"), 1);
|
|
1284
|
+
var PagePlaceholder = /* @__PURE__ */ __name(({ title = "\u9875\u9762\u5F85\u5F00\u53D1", description = "\u9875\u9762\u6682\u672A\u5F00\u53D1\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5F85..." }) => {
|
|
1285
|
+
return /* @__PURE__ */ import_react9.default.createElement("div", {
|
|
1286
|
+
style: {
|
|
1287
|
+
display: "flex",
|
|
1288
|
+
flexDirection: "column",
|
|
1289
|
+
alignItems: "center",
|
|
1290
|
+
justifyContent: "center",
|
|
1291
|
+
padding: "0 24px",
|
|
1292
|
+
width: "100%",
|
|
1293
|
+
height: "calc(100vh - 64px)",
|
|
1294
|
+
textAlign: "center"
|
|
1295
|
+
}
|
|
1296
|
+
}, /* @__PURE__ */ import_react9.default.createElement("img", {
|
|
1297
|
+
style: {
|
|
1298
|
+
borderRadius: "6px",
|
|
1299
|
+
marginBottom: "24px"
|
|
1300
|
+
},
|
|
1301
|
+
width: "320",
|
|
1302
|
+
height: "200",
|
|
1303
|
+
src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/miao/welcome.svg",
|
|
1304
|
+
alt: "Welcome"
|
|
1305
|
+
}), /* @__PURE__ */ import_react9.default.createElement("div", {
|
|
1306
|
+
style: {
|
|
1307
|
+
fontSize: "16px",
|
|
1308
|
+
fontWeight: 500,
|
|
1309
|
+
marginBottom: "4px",
|
|
1310
|
+
lineHeight: "24px"
|
|
1311
|
+
}
|
|
1312
|
+
}, title), /* @__PURE__ */ import_react9.default.createElement("div", {
|
|
1313
|
+
style: {
|
|
1314
|
+
color: "#6b7280",
|
|
1315
|
+
fontSize: "16px",
|
|
1316
|
+
lineHeight: "24px",
|
|
1317
|
+
maxWidth: "480px",
|
|
1318
|
+
overflow: "hidden",
|
|
1319
|
+
display: "-webkit-box",
|
|
1320
|
+
WebkitLineClamp: 2,
|
|
1321
|
+
WebkitBoxOrient: "vertical"
|
|
1322
|
+
}
|
|
1323
|
+
}, description));
|
|
1324
|
+
}, "PagePlaceholder");
|
|
1325
|
+
var PagePlaceholder_default = PagePlaceholder;
|
|
1326
|
+
|
|
1327
|
+
// src/route-components/ActiveLink.tsx
|
|
1328
|
+
var import_react10 = __toESM(require("react"), 1);
|
|
1283
1329
|
var import_react_router_dom = require("react-router-dom");
|
|
1284
|
-
var ActiveLink = /* @__PURE__ */ (0,
|
|
1285
|
-
const [currentHash, setCurrentHash] = (0,
|
|
1330
|
+
var ActiveLink = /* @__PURE__ */ (0, import_react10.forwardRef)(({ to, onClick, className, style, children, ...rest }, ref) => {
|
|
1331
|
+
const [currentHash, setCurrentHash] = (0, import_react10.useState)(() => typeof window !== "undefined" ? window.location.hash : "");
|
|
1286
1332
|
const isHashRoute = typeof to === "string" && to.startsWith("#");
|
|
1287
|
-
(0,
|
|
1333
|
+
(0, import_react10.useEffect)(() => {
|
|
1288
1334
|
if (!isHashRoute) return;
|
|
1289
1335
|
const handleHashChange = /* @__PURE__ */ __name(() => {
|
|
1290
1336
|
setCurrentHash(window.location.hash);
|
|
@@ -1296,7 +1342,7 @@ var ActiveLink = /* @__PURE__ */ (0, import_react9.forwardRef)(({ to, onClick, c
|
|
|
1296
1342
|
]);
|
|
1297
1343
|
const isActive = isHashRoute && currentHash === to;
|
|
1298
1344
|
if (!isHashRoute) {
|
|
1299
|
-
return /* @__PURE__ */
|
|
1345
|
+
return /* @__PURE__ */ import_react10.default.createElement(import_react_router_dom.NavLink, {
|
|
1300
1346
|
ref,
|
|
1301
1347
|
to,
|
|
1302
1348
|
onClick,
|
|
@@ -1337,7 +1383,7 @@ var ActiveLink = /* @__PURE__ */ (0, import_react9.forwardRef)(({ to, onClick, c
|
|
|
1337
1383
|
isPending: false,
|
|
1338
1384
|
isTransitioning: false
|
|
1339
1385
|
}) : children;
|
|
1340
|
-
return /* @__PURE__ */
|
|
1386
|
+
return /* @__PURE__ */ import_react10.default.createElement("a", {
|
|
1341
1387
|
ref,
|
|
1342
1388
|
href: to,
|
|
1343
1389
|
onClick: handleHashClick,
|
|
@@ -1349,9 +1395,9 @@ var ActiveLink = /* @__PURE__ */ (0, import_react9.forwardRef)(({ to, onClick, c
|
|
|
1349
1395
|
ActiveLink.displayName = "ActiveLink";
|
|
1350
1396
|
|
|
1351
1397
|
// src/route-components/NavLink.tsx
|
|
1352
|
-
var
|
|
1398
|
+
var React8 = __toESM(require("react"), 1);
|
|
1353
1399
|
var import_react_router_dom2 = require("react-router-dom");
|
|
1354
|
-
var NavLink2 = /* @__PURE__ */
|
|
1400
|
+
var NavLink2 = /* @__PURE__ */ React8.forwardRef(({ to, children, className, style, ...props }, ref) => {
|
|
1355
1401
|
const isHashLink = typeof to === "string" && to.startsWith("#");
|
|
1356
1402
|
const location = (0, import_react_router_dom2.useLocation)();
|
|
1357
1403
|
const navigate = (0, import_react_router_dom2.useNavigate)();
|
|
@@ -1375,7 +1421,7 @@ var NavLink2 = /* @__PURE__ */ React7.forwardRef(({ to, children, className, sty
|
|
|
1375
1421
|
const resolvedClassName = typeof className === "function" ? className(renderProps) : className;
|
|
1376
1422
|
const resolvedStyle = typeof style === "function" ? style(renderProps) : style;
|
|
1377
1423
|
const { caseSensitive, end, replace, state, preventScrollReset, relative, viewTransition, ...restProps } = props;
|
|
1378
|
-
return /* @__PURE__ */
|
|
1424
|
+
return /* @__PURE__ */ React8.createElement("a", {
|
|
1379
1425
|
href: to,
|
|
1380
1426
|
onClick: handleClick,
|
|
1381
1427
|
ref,
|
|
@@ -1384,7 +1430,7 @@ var NavLink2 = /* @__PURE__ */ React7.forwardRef(({ to, children, className, sty
|
|
|
1384
1430
|
...restProps
|
|
1385
1431
|
}, typeof children === "function" ? children(renderProps) : children);
|
|
1386
1432
|
}
|
|
1387
|
-
return /* @__PURE__ */
|
|
1433
|
+
return /* @__PURE__ */ React8.createElement(import_react_router_dom2.NavLink, {
|
|
1388
1434
|
to,
|
|
1389
1435
|
ref,
|
|
1390
1436
|
className,
|
|
@@ -1399,7 +1445,7 @@ var NavLink2 = /* @__PURE__ */ React7.forwardRef(({ to, children, className, sty
|
|
|
1399
1445
|
NavLink2.displayName = "NavLink";
|
|
1400
1446
|
|
|
1401
1447
|
// src/route-components/UniversalLink.tsx
|
|
1402
|
-
var
|
|
1448
|
+
var import_react11 = __toESM(require("react"), 1);
|
|
1403
1449
|
var import_react_router_dom3 = require("react-router-dom");
|
|
1404
1450
|
function isInternalRoute(to) {
|
|
1405
1451
|
return !to.startsWith("#") && !to.startsWith("http://") && !to.startsWith("https://") && !to.startsWith("//");
|
|
@@ -1409,15 +1455,15 @@ function isExternalLink(to) {
|
|
|
1409
1455
|
return to.startsWith("http://") || to.startsWith("https://") || to.startsWith("//");
|
|
1410
1456
|
}
|
|
1411
1457
|
__name(isExternalLink, "isExternalLink");
|
|
1412
|
-
var UniversalLink = /* @__PURE__ */
|
|
1458
|
+
var UniversalLink = /* @__PURE__ */ import_react11.default.forwardRef(/* @__PURE__ */ __name(function UniversalLink2({ to, ...props }, ref) {
|
|
1413
1459
|
if (isInternalRoute(to)) {
|
|
1414
|
-
return /* @__PURE__ */
|
|
1460
|
+
return /* @__PURE__ */ import_react11.default.createElement(import_react_router_dom3.Link, {
|
|
1415
1461
|
to,
|
|
1416
1462
|
ref,
|
|
1417
1463
|
...props
|
|
1418
1464
|
});
|
|
1419
1465
|
}
|
|
1420
|
-
return /* @__PURE__ */
|
|
1466
|
+
return /* @__PURE__ */ import_react11.default.createElement("a", {
|
|
1421
1467
|
href: to,
|
|
1422
1468
|
ref,
|
|
1423
1469
|
...props,
|
|
@@ -1842,6 +1888,7 @@ var abstractArt3dRenderingCoverImg6 = "https://lf3-static.bytednsdoc.com/obj/ede
|
|
|
1842
1888
|
ActiveLink,
|
|
1843
1889
|
AppContainer,
|
|
1844
1890
|
NavLink,
|
|
1891
|
+
PagePlaceholder,
|
|
1845
1892
|
QueryProvider,
|
|
1846
1893
|
TrackKey,
|
|
1847
1894
|
UniversalLink,
|