@lark-apaas/client-toolkit-lite 1.1.1-alpha.1 → 1.1.1-alpha.10

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 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,
@@ -373,26 +374,18 @@ function splitWorkspaceUrl(fullUrl) {
373
374
  __name(splitWorkspaceUrl, "splitWorkspaceUrl");
374
375
 
375
376
  // src/integrations/dataloom.ts
376
- var import_js = require("@data-loom/js");
377
+ var import_dataloom = require("@lark-apaas/dataloom");
377
378
  var createDataLoomClient = /* @__PURE__ */ __name((url, pat) => {
378
- const { baseUrl, workspace } = url ? splitWorkspaceUrl(url) : {
379
- baseUrl: "",
380
- workspace: ""
379
+ const { baseUrl } = url ? splitWorkspaceUrl(url) : {
380
+ baseUrl: ""
381
381
  };
382
382
  const appId = getAppId() ?? "";
383
- return (0, import_js.createClient)(baseUrl, pat ?? "", workspace, {
383
+ return (0, import_dataloom.createClient)(baseUrl, pat ?? "", {
384
384
  global: {
385
385
  enableDataloomLog: process.env.NODE_ENV !== "production",
386
386
  requestRateLimit: process.env.NODE_ENV !== "production" ? 100 : void 0,
387
387
  brandName: "miaoda",
388
- appId,
389
- onError: /* @__PURE__ */ __name((error, dataloomInstance) => {
390
- if (error?.status === 401) {
391
- if (error?.code === "k_ident_013001") {
392
- dataloomInstance.service.session.redirectToLogin();
393
- }
394
- }
395
- }, "onError")
388
+ appId
396
389
  }
397
390
  });
398
391
  }, "createDataLoomClient");
@@ -1240,28 +1233,96 @@ var AppContainer_default = AppContainer;
1240
1233
  var import_react8 = __toESM(require("react"), 1);
1241
1234
  var Welcome = /* @__PURE__ */ __name(({ title = "\u9875\u9762\u5F85\u5F00\u53D1", description = "\u9875\u9762\u6682\u672A\u5F00\u53D1\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5F85..." }) => {
1242
1235
  return /* @__PURE__ */ import_react8.default.createElement("div", {
1243
- className: "flex flex-col items-center justify-center px-6 w-full h-[calc(100vh-64px)] text-center"
1236
+ style: {
1237
+ display: "flex",
1238
+ flexDirection: "column",
1239
+ alignItems: "center",
1240
+ justifyContent: "center",
1241
+ width: "100%",
1242
+ height: "calc(100vh - 64px)",
1243
+ padding: "0 24px",
1244
+ textAlign: "center"
1245
+ }
1244
1246
  }, /* @__PURE__ */ import_react8.default.createElement("img", {
1245
- className: "rounded-md mb-6",
1247
+ style: {
1248
+ borderRadius: 6,
1249
+ marginBottom: 24
1250
+ },
1246
1251
  width: "320",
1247
1252
  height: "200",
1248
1253
  src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/miao/welcome.svg",
1249
1254
  alt: "Welcome"
1250
1255
  }), /* @__PURE__ */ import_react8.default.createElement("div", {
1251
- className: "text-center text-foreground text-base font-medium mb-1 leading-6"
1256
+ style: {
1257
+ fontSize: 16,
1258
+ fontWeight: 500,
1259
+ lineHeight: "24px",
1260
+ marginBottom: 4,
1261
+ color: "#1f2329"
1262
+ }
1252
1263
  }, title), /* @__PURE__ */ import_react8.default.createElement("div", {
1253
- className: "text-center text-muted-foreground text-base leading-6 line-clamp-2 sm:max-w-[480px]"
1264
+ style: {
1265
+ fontSize: 16,
1266
+ lineHeight: "24px",
1267
+ color: "#8f959e",
1268
+ maxWidth: 480
1269
+ }
1254
1270
  }, description));
1255
1271
  }, "Welcome");
1256
1272
  var Welcome_default = Welcome;
1257
1273
 
1258
- // src/route-components/ActiveLink.tsx
1274
+ // src/components/PagePlaceholder/index.tsx
1259
1275
  var import_react9 = __toESM(require("react"), 1);
1276
+ var PagePlaceholder = /* @__PURE__ */ __name(({ title = "\u9875\u9762\u5F85\u5F00\u53D1", description = "\u9875\u9762\u6682\u672A\u5F00\u53D1\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5F85..." }) => {
1277
+ return /* @__PURE__ */ import_react9.default.createElement("div", {
1278
+ style: {
1279
+ display: "flex",
1280
+ flexDirection: "column",
1281
+ alignItems: "center",
1282
+ justifyContent: "center",
1283
+ padding: "0 24px",
1284
+ width: "100%",
1285
+ height: "calc(100vh - 64px)",
1286
+ textAlign: "center"
1287
+ }
1288
+ }, /* @__PURE__ */ import_react9.default.createElement("img", {
1289
+ style: {
1290
+ borderRadius: "6px",
1291
+ marginBottom: "24px"
1292
+ },
1293
+ width: "320",
1294
+ height: "200",
1295
+ src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/miao/welcome.svg",
1296
+ alt: "Welcome"
1297
+ }), /* @__PURE__ */ import_react9.default.createElement("div", {
1298
+ style: {
1299
+ fontSize: "16px",
1300
+ fontWeight: 500,
1301
+ marginBottom: "4px",
1302
+ lineHeight: "24px"
1303
+ }
1304
+ }, title), /* @__PURE__ */ import_react9.default.createElement("div", {
1305
+ style: {
1306
+ color: "#6b7280",
1307
+ fontSize: "16px",
1308
+ lineHeight: "24px",
1309
+ maxWidth: "480px",
1310
+ overflow: "hidden",
1311
+ display: "-webkit-box",
1312
+ WebkitLineClamp: 2,
1313
+ WebkitBoxOrient: "vertical"
1314
+ }
1315
+ }, description));
1316
+ }, "PagePlaceholder");
1317
+ var PagePlaceholder_default = PagePlaceholder;
1318
+
1319
+ // src/route-components/ActiveLink.tsx
1320
+ var import_react10 = __toESM(require("react"), 1);
1260
1321
  var import_react_router_dom = require("react-router-dom");
1261
- var ActiveLink = /* @__PURE__ */ (0, import_react9.forwardRef)(({ to, onClick, className, style, children, ...rest }, ref) => {
1262
- const [currentHash, setCurrentHash] = (0, import_react9.useState)(() => typeof window !== "undefined" ? window.location.hash : "");
1322
+ var ActiveLink = /* @__PURE__ */ (0, import_react10.forwardRef)(({ to, onClick, className, style, children, ...rest }, ref) => {
1323
+ const [currentHash, setCurrentHash] = (0, import_react10.useState)(() => typeof window !== "undefined" ? window.location.hash : "");
1263
1324
  const isHashRoute = typeof to === "string" && to.startsWith("#");
1264
- (0, import_react9.useEffect)(() => {
1325
+ (0, import_react10.useEffect)(() => {
1265
1326
  if (!isHashRoute) return;
1266
1327
  const handleHashChange = /* @__PURE__ */ __name(() => {
1267
1328
  setCurrentHash(window.location.hash);
@@ -1273,7 +1334,7 @@ var ActiveLink = /* @__PURE__ */ (0, import_react9.forwardRef)(({ to, onClick, c
1273
1334
  ]);
1274
1335
  const isActive = isHashRoute && currentHash === to;
1275
1336
  if (!isHashRoute) {
1276
- return /* @__PURE__ */ import_react9.default.createElement(import_react_router_dom.NavLink, {
1337
+ return /* @__PURE__ */ import_react10.default.createElement(import_react_router_dom.NavLink, {
1277
1338
  ref,
1278
1339
  to,
1279
1340
  onClick,
@@ -1314,7 +1375,7 @@ var ActiveLink = /* @__PURE__ */ (0, import_react9.forwardRef)(({ to, onClick, c
1314
1375
  isPending: false,
1315
1376
  isTransitioning: false
1316
1377
  }) : children;
1317
- return /* @__PURE__ */ import_react9.default.createElement("a", {
1378
+ return /* @__PURE__ */ import_react10.default.createElement("a", {
1318
1379
  ref,
1319
1380
  href: to,
1320
1381
  onClick: handleHashClick,
@@ -1326,9 +1387,9 @@ var ActiveLink = /* @__PURE__ */ (0, import_react9.forwardRef)(({ to, onClick, c
1326
1387
  ActiveLink.displayName = "ActiveLink";
1327
1388
 
1328
1389
  // src/route-components/NavLink.tsx
1329
- var React7 = __toESM(require("react"), 1);
1390
+ var React8 = __toESM(require("react"), 1);
1330
1391
  var import_react_router_dom2 = require("react-router-dom");
1331
- var NavLink2 = /* @__PURE__ */ React7.forwardRef(({ to, children, className, style, ...props }, ref) => {
1392
+ var NavLink2 = /* @__PURE__ */ React8.forwardRef(({ to, children, className, style, ...props }, ref) => {
1332
1393
  const isHashLink = typeof to === "string" && to.startsWith("#");
1333
1394
  const location = (0, import_react_router_dom2.useLocation)();
1334
1395
  const navigate = (0, import_react_router_dom2.useNavigate)();
@@ -1352,7 +1413,7 @@ var NavLink2 = /* @__PURE__ */ React7.forwardRef(({ to, children, className, sty
1352
1413
  const resolvedClassName = typeof className === "function" ? className(renderProps) : className;
1353
1414
  const resolvedStyle = typeof style === "function" ? style(renderProps) : style;
1354
1415
  const { caseSensitive, end, replace, state, preventScrollReset, relative, viewTransition, ...restProps } = props;
1355
- return /* @__PURE__ */ React7.createElement("a", {
1416
+ return /* @__PURE__ */ React8.createElement("a", {
1356
1417
  href: to,
1357
1418
  onClick: handleClick,
1358
1419
  ref,
@@ -1361,7 +1422,7 @@ var NavLink2 = /* @__PURE__ */ React7.forwardRef(({ to, children, className, sty
1361
1422
  ...restProps
1362
1423
  }, typeof children === "function" ? children(renderProps) : children);
1363
1424
  }
1364
- return /* @__PURE__ */ React7.createElement(import_react_router_dom2.NavLink, {
1425
+ return /* @__PURE__ */ React8.createElement(import_react_router_dom2.NavLink, {
1365
1426
  to,
1366
1427
  ref,
1367
1428
  className,
@@ -1376,7 +1437,7 @@ var NavLink2 = /* @__PURE__ */ React7.forwardRef(({ to, children, className, sty
1376
1437
  NavLink2.displayName = "NavLink";
1377
1438
 
1378
1439
  // src/route-components/UniversalLink.tsx
1379
- var import_react10 = __toESM(require("react"), 1);
1440
+ var import_react11 = __toESM(require("react"), 1);
1380
1441
  var import_react_router_dom3 = require("react-router-dom");
1381
1442
  function isInternalRoute(to) {
1382
1443
  return !to.startsWith("#") && !to.startsWith("http://") && !to.startsWith("https://") && !to.startsWith("//");
@@ -1386,15 +1447,15 @@ function isExternalLink(to) {
1386
1447
  return to.startsWith("http://") || to.startsWith("https://") || to.startsWith("//");
1387
1448
  }
1388
1449
  __name(isExternalLink, "isExternalLink");
1389
- var UniversalLink = /* @__PURE__ */ import_react10.default.forwardRef(/* @__PURE__ */ __name(function UniversalLink2({ to, ...props }, ref) {
1450
+ var UniversalLink = /* @__PURE__ */ import_react11.default.forwardRef(/* @__PURE__ */ __name(function UniversalLink2({ to, ...props }, ref) {
1390
1451
  if (isInternalRoute(to)) {
1391
- return /* @__PURE__ */ import_react10.default.createElement(import_react_router_dom3.Link, {
1452
+ return /* @__PURE__ */ import_react11.default.createElement(import_react_router_dom3.Link, {
1392
1453
  to,
1393
1454
  ref,
1394
1455
  ...props
1395
1456
  });
1396
1457
  }
1397
- return /* @__PURE__ */ import_react10.default.createElement("a", {
1458
+ return /* @__PURE__ */ import_react11.default.createElement("a", {
1398
1459
  href: to,
1399
1460
  ref,
1400
1461
  ...props,
@@ -1819,6 +1880,7 @@ var abstractArt3dRenderingCoverImg6 = "https://lf3-static.bytednsdoc.com/obj/ede
1819
1880
  ActiveLink,
1820
1881
  AppContainer,
1821
1882
  NavLink,
1883
+ PagePlaceholder,
1822
1884
  QueryProvider,
1823
1885
  TrackKey,
1824
1886
  UniversalLink,