@lark-apaas/client-toolkit-lite 1.1.11-alpha.2 → 1.1.11-alpha.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 +260 -47
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +248 -35
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -76,7 +76,7 @@ __export(index_exports, {
|
|
|
76
76
|
module.exports = __toCommonJS(index_exports);
|
|
77
77
|
|
|
78
78
|
// src/components/AppContainer/index.tsx
|
|
79
|
-
var
|
|
79
|
+
var import_react10 = __toESM(require("react"), 1);
|
|
80
80
|
var import_miaoda_inspector = require("@lark-apaas/miaoda-inspector");
|
|
81
81
|
|
|
82
82
|
// src/runtime/react-devtools-hook.ts
|
|
@@ -2059,8 +2059,221 @@ var Safety = /* @__PURE__ */ __name(() => {
|
|
|
2059
2059
|
}, "Safety");
|
|
2060
2060
|
var safety_default = Safety;
|
|
2061
2061
|
|
|
2062
|
-
// src/components/
|
|
2062
|
+
// src/components/AppContainer/Watermark.tsx
|
|
2063
2063
|
var import_react6 = __toESM(require("react"), 1);
|
|
2064
|
+
var PopoverPrimitive2 = __toESM(require("@radix-ui/react-popover"), 1);
|
|
2065
|
+
|
|
2066
|
+
// src/components/AppContainer/doubao-watermark-asset.ts
|
|
2067
|
+
var CDN = "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/miaoda-ui";
|
|
2068
|
+
var DOUBAO_LOGO_SRC = `${CDN}/setting_voice.svg`;
|
|
2069
|
+
var DOUBAO_CLOSE_SRC = `${CDN}/icon_close_outlined.svg`;
|
|
2070
|
+
var DOUBAO_REPORT_SRC = `${CDN}/%5BDBX%5DDropdown.svg`;
|
|
2071
|
+
var DOUBAO_PILL_MOBILE_SRC = `${CDN}/Frame%202147223991%20(4).svg`;
|
|
2072
|
+
var DOUBAO_REPORT_ITEM_SRC = `${CDN}/_Dropdown-item.svg`;
|
|
2073
|
+
var DOUBAO_DONTSHOW_ITEM_SRC = `${CDN}/_Dropdown-item%20(1).svg`;
|
|
2074
|
+
|
|
2075
|
+
// src/components/AppContainer/Watermark.tsx
|
|
2076
|
+
var DOUBAO_SOURCE = "5";
|
|
2077
|
+
var REPORT_ENABLED = false;
|
|
2078
|
+
var reportDomainByEnv = /* @__PURE__ */ __name((env) => {
|
|
2079
|
+
if (env === "boe") return "tns.feishu-boe.cn";
|
|
2080
|
+
if (env === "pre") return "tns.feishu-pre.cn";
|
|
2081
|
+
return "tns.feishu.cn";
|
|
2082
|
+
}, "reportDomainByEnv");
|
|
2083
|
+
var openDoubaoReport = /* @__PURE__ */ __name(() => {
|
|
2084
|
+
const params = JSON.stringify({
|
|
2085
|
+
scene: "miaoda_app_report",
|
|
2086
|
+
entity_id: getAppId() ?? "",
|
|
2087
|
+
entity_type: "miaoda_app",
|
|
2088
|
+
extra: ""
|
|
2089
|
+
});
|
|
2090
|
+
const domain = reportDomainByEnv(process.env.FORCE_FRAMEWORK_ENVIRONMENT);
|
|
2091
|
+
const url = `https://${domain}/cust/lark_report/?type=common¶ms=${encodeURIComponent(params)}&lang=zh-CN`;
|
|
2092
|
+
window.open(url, "_blank", "noopener,noreferrer");
|
|
2093
|
+
}, "openDoubaoReport");
|
|
2094
|
+
var mobilePillWrapper = {
|
|
2095
|
+
position: "fixed",
|
|
2096
|
+
right: 12,
|
|
2097
|
+
bottom: 12,
|
|
2098
|
+
width: 85,
|
|
2099
|
+
height: 30,
|
|
2100
|
+
zIndex: 9999,
|
|
2101
|
+
cursor: "pointer"
|
|
2102
|
+
};
|
|
2103
|
+
var mobilePillImg = {
|
|
2104
|
+
position: "absolute",
|
|
2105
|
+
right: -12,
|
|
2106
|
+
bottom: -40,
|
|
2107
|
+
width: 129,
|
|
2108
|
+
height: 94,
|
|
2109
|
+
// 钉死尺寸:宿主页常带 Tailwind preflight 的 `img{max-width:100%;height:auto}`,
|
|
2110
|
+
// 会把这张 129x94 的图压进 85x30 包裹层导致缩水变形 + 负偏移对齐错位。
|
|
2111
|
+
// 内联 style 特异度高于 element 选择器,可盖过 preflight。
|
|
2112
|
+
maxWidth: "none",
|
|
2113
|
+
maxHeight: "none",
|
|
2114
|
+
display: "block",
|
|
2115
|
+
pointerEvents: "none"
|
|
2116
|
+
};
|
|
2117
|
+
var mobileMenu = {
|
|
2118
|
+
display: "flex",
|
|
2119
|
+
flexDirection: "column",
|
|
2120
|
+
background: "#fff",
|
|
2121
|
+
borderRadius: 12,
|
|
2122
|
+
padding: 4,
|
|
2123
|
+
boxShadow: "0px 6px 16px rgba(0,0,0,0.12)",
|
|
2124
|
+
zIndex: 1e4,
|
|
2125
|
+
// radix Content 打开时获取焦点,去掉浏览器默认 focus 描边(同 Safety sheetContent)
|
|
2126
|
+
outline: "none"
|
|
2127
|
+
};
|
|
2128
|
+
var mobileMenuItem = {
|
|
2129
|
+
display: "block",
|
|
2130
|
+
// 同药丸:钉死尺寸盖过宿主 Tailwind preflight 的 img{max-width:100%;height:auto}
|
|
2131
|
+
width: 132,
|
|
2132
|
+
height: 38,
|
|
2133
|
+
maxWidth: "none",
|
|
2134
|
+
maxHeight: "none",
|
|
2135
|
+
cursor: "pointer"
|
|
2136
|
+
};
|
|
2137
|
+
var MobileWatermark = /* @__PURE__ */ __name(({ onDontShow }) => {
|
|
2138
|
+
const [open, setOpen] = (0, import_react6.useState)(false);
|
|
2139
|
+
return /* @__PURE__ */ import_react6.default.createElement(PopoverPrimitive2.Root, {
|
|
2140
|
+
open,
|
|
2141
|
+
onOpenChange: setOpen
|
|
2142
|
+
}, /* @__PURE__ */ import_react6.default.createElement(PopoverPrimitive2.Trigger, {
|
|
2143
|
+
asChild: true
|
|
2144
|
+
}, /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
2145
|
+
"data-custom-element": "doubao-watermark-mobile",
|
|
2146
|
+
style: mobilePillWrapper
|
|
2147
|
+
}, /* @__PURE__ */ import_react6.default.createElement("img", {
|
|
2148
|
+
src: DOUBAO_PILL_MOBILE_SRC,
|
|
2149
|
+
width: 129,
|
|
2150
|
+
height: 94,
|
|
2151
|
+
alt: "\u8C46\u5305 AI \u751F\u6210",
|
|
2152
|
+
style: mobilePillImg
|
|
2153
|
+
}))), /* @__PURE__ */ import_react6.default.createElement(PopoverPrimitive2.Portal, null, /* @__PURE__ */ import_react6.default.createElement(PopoverPrimitive2.Content, {
|
|
2154
|
+
side: "top",
|
|
2155
|
+
align: "end",
|
|
2156
|
+
sideOffset: 8,
|
|
2157
|
+
style: mobileMenu
|
|
2158
|
+
}, /* @__PURE__ */ import_react6.default.createElement("img", {
|
|
2159
|
+
src: DOUBAO_REPORT_ITEM_SRC,
|
|
2160
|
+
width: 132,
|
|
2161
|
+
height: 38,
|
|
2162
|
+
alt: "\u6295\u8BC9\u4E0E\u4E3E\u62A5",
|
|
2163
|
+
style: mobileMenuItem
|
|
2164
|
+
}), /* @__PURE__ */ import_react6.default.createElement("img", {
|
|
2165
|
+
src: DOUBAO_DONTSHOW_ITEM_SRC,
|
|
2166
|
+
width: 132,
|
|
2167
|
+
height: 38,
|
|
2168
|
+
alt: "\u4E0D\u518D\u5C55\u793A",
|
|
2169
|
+
style: mobileMenuItem,
|
|
2170
|
+
onClick: /* @__PURE__ */ __name(() => {
|
|
2171
|
+
setOpen(false);
|
|
2172
|
+
onDontShow();
|
|
2173
|
+
}, "onClick")
|
|
2174
|
+
}))));
|
|
2175
|
+
}, "MobileWatermark");
|
|
2176
|
+
var Watermark = /* @__PURE__ */ __name(() => {
|
|
2177
|
+
const [closed, setClosed] = (0, import_react6.useState)(false);
|
|
2178
|
+
const [open, setOpen] = (0, import_react6.useState)(false);
|
|
2179
|
+
const timer = (0, import_react6.useRef)(null);
|
|
2180
|
+
const isMobile2 = useIsMobile();
|
|
2181
|
+
if (String(process.env.MIAODA_APP_SOURCE) !== DOUBAO_SOURCE) return null;
|
|
2182
|
+
if (closed) return null;
|
|
2183
|
+
if (isMobile2) {
|
|
2184
|
+
return /* @__PURE__ */ import_react6.default.createElement(MobileWatermark, {
|
|
2185
|
+
onDontShow: /* @__PURE__ */ __name(() => setClosed(true), "onDontShow")
|
|
2186
|
+
});
|
|
2187
|
+
}
|
|
2188
|
+
const enter = /* @__PURE__ */ __name(() => {
|
|
2189
|
+
if (timer.current) clearTimeout(timer.current);
|
|
2190
|
+
setOpen(true);
|
|
2191
|
+
}, "enter");
|
|
2192
|
+
const leave = /* @__PURE__ */ __name(() => {
|
|
2193
|
+
timer.current = setTimeout(() => setOpen(false), 100);
|
|
2194
|
+
}, "leave");
|
|
2195
|
+
return /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
2196
|
+
"data-custom-element": "doubao-watermark",
|
|
2197
|
+
onMouseEnter: enter,
|
|
2198
|
+
onMouseLeave: leave,
|
|
2199
|
+
style: {
|
|
2200
|
+
position: "fixed",
|
|
2201
|
+
right: 12,
|
|
2202
|
+
bottom: 12,
|
|
2203
|
+
zIndex: 9999,
|
|
2204
|
+
display: "flex",
|
|
2205
|
+
flexDirection: "column",
|
|
2206
|
+
alignItems: "flex-end"
|
|
2207
|
+
}
|
|
2208
|
+
}, REPORT_ENABLED && open && /* @__PURE__ */ import_react6.default.createElement("img", {
|
|
2209
|
+
src: DOUBAO_REPORT_SRC,
|
|
2210
|
+
width: 168,
|
|
2211
|
+
height: 78,
|
|
2212
|
+
alt: "\u6295\u8BC9\u4E0E\u4E3E\u62A5",
|
|
2213
|
+
onClick: openDoubaoReport,
|
|
2214
|
+
style: {
|
|
2215
|
+
display: "block",
|
|
2216
|
+
cursor: "pointer",
|
|
2217
|
+
marginBottom: -8,
|
|
2218
|
+
marginRight: -12
|
|
2219
|
+
}
|
|
2220
|
+
}), /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
2221
|
+
style: {
|
|
2222
|
+
boxSizing: "border-box",
|
|
2223
|
+
display: "inline-flex",
|
|
2224
|
+
alignItems: "center",
|
|
2225
|
+
gap: 4,
|
|
2226
|
+
padding: "6px 12px 6px 8px",
|
|
2227
|
+
background: "#363636",
|
|
2228
|
+
border: "0.5px solid rgba(255,255,255,0.1)",
|
|
2229
|
+
borderRadius: 100,
|
|
2230
|
+
boxShadow: "0px 2px 2px rgba(0,0,0,0.02), 0px 4px 8px rgba(0,0,0,0.04), 0px 8px 16px rgba(0,0,0,0.08)"
|
|
2231
|
+
}
|
|
2232
|
+
}, /* @__PURE__ */ import_react6.default.createElement("img", {
|
|
2233
|
+
src: DOUBAO_LOGO_SRC,
|
|
2234
|
+
width: 16,
|
|
2235
|
+
height: 16,
|
|
2236
|
+
alt: "",
|
|
2237
|
+
style: {
|
|
2238
|
+
borderRadius: 100,
|
|
2239
|
+
flexShrink: 0,
|
|
2240
|
+
display: "block"
|
|
2241
|
+
}
|
|
2242
|
+
}), /* @__PURE__ */ import_react6.default.createElement("span", {
|
|
2243
|
+
style: {
|
|
2244
|
+
fontFamily: "'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif",
|
|
2245
|
+
fontSize: 12,
|
|
2246
|
+
lineHeight: "18px",
|
|
2247
|
+
color: "rgba(255,255,255,0.85)",
|
|
2248
|
+
whiteSpace: "nowrap"
|
|
2249
|
+
}
|
|
2250
|
+
}, "\u7531 \u8C46\u5305AI \u751F\u6210"), /* @__PURE__ */ import_react6.default.createElement("span", {
|
|
2251
|
+
role: "button",
|
|
2252
|
+
"aria-label": "\u5173\u95ED",
|
|
2253
|
+
onClick: /* @__PURE__ */ __name((e) => {
|
|
2254
|
+
e.stopPropagation();
|
|
2255
|
+
setClosed(true);
|
|
2256
|
+
}, "onClick"),
|
|
2257
|
+
style: {
|
|
2258
|
+
display: "inline-flex",
|
|
2259
|
+
alignItems: "center",
|
|
2260
|
+
cursor: "pointer",
|
|
2261
|
+
flexShrink: 0
|
|
2262
|
+
}
|
|
2263
|
+
}, /* @__PURE__ */ import_react6.default.createElement("img", {
|
|
2264
|
+
src: DOUBAO_CLOSE_SRC,
|
|
2265
|
+
width: 10,
|
|
2266
|
+
height: 10,
|
|
2267
|
+
alt: "",
|
|
2268
|
+
style: {
|
|
2269
|
+
display: "block"
|
|
2270
|
+
}
|
|
2271
|
+
}))));
|
|
2272
|
+
}, "Watermark");
|
|
2273
|
+
var Watermark_default = Watermark;
|
|
2274
|
+
|
|
2275
|
+
// src/components/QueryProvider/index.tsx
|
|
2276
|
+
var import_react7 = __toESM(require("react"), 1);
|
|
2064
2277
|
var import_react_query = require("@tanstack/react-query");
|
|
2065
2278
|
var defaultQueryClient = null;
|
|
2066
2279
|
var getDefaultQueryClient = /* @__PURE__ */ __name(() => {
|
|
@@ -2081,20 +2294,20 @@ var getDefaultQueryClient = /* @__PURE__ */ __name(() => {
|
|
|
2081
2294
|
}, "getDefaultQueryClient");
|
|
2082
2295
|
var QueryProvider = /* @__PURE__ */ __name(({ children, client }) => {
|
|
2083
2296
|
const qc = client ?? getDefaultQueryClient();
|
|
2084
|
-
return /* @__PURE__ */
|
|
2297
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_react_query.QueryClientProvider, {
|
|
2085
2298
|
client: qc
|
|
2086
2299
|
}, children);
|
|
2087
2300
|
}, "QueryProvider");
|
|
2088
2301
|
var QueryProvider_default = QueryProvider;
|
|
2089
2302
|
|
|
2090
2303
|
// src/components/AppContainer/IframeBridge.tsx
|
|
2091
|
-
var
|
|
2304
|
+
var import_react9 = require("react");
|
|
2092
2305
|
var import_react_router_dom = require("react-router-dom");
|
|
2093
2306
|
|
|
2094
2307
|
// src/hooks/useUpdatingRef.ts
|
|
2095
|
-
var
|
|
2308
|
+
var import_react8 = require("react");
|
|
2096
2309
|
function useUpdatingRef(value) {
|
|
2097
|
-
const ref = (0,
|
|
2310
|
+
const ref = (0, import_react8.useRef)(value);
|
|
2098
2311
|
ref.current = value;
|
|
2099
2312
|
return ref;
|
|
2100
2313
|
}
|
|
@@ -2115,20 +2328,20 @@ function IframeBridge() {
|
|
|
2115
2328
|
const location = (0, import_react_router_dom.useLocation)();
|
|
2116
2329
|
const navigate = (0, import_react_router_dom.useNavigate)();
|
|
2117
2330
|
const navigateRef = useUpdatingRef(navigate);
|
|
2118
|
-
const isActive = (0,
|
|
2119
|
-
const historyBack = (0,
|
|
2331
|
+
const isActive = (0, import_react9.useRef)(false);
|
|
2332
|
+
const historyBack = (0, import_react9.useCallback)((_payload) => {
|
|
2120
2333
|
navigateRef.current(-1);
|
|
2121
2334
|
isActive.current = true;
|
|
2122
2335
|
}, [
|
|
2123
2336
|
navigateRef
|
|
2124
2337
|
]);
|
|
2125
|
-
const historyForward = (0,
|
|
2338
|
+
const historyForward = (0, import_react9.useCallback)((_payload) => {
|
|
2126
2339
|
navigateRef.current(1);
|
|
2127
2340
|
isActive.current = true;
|
|
2128
2341
|
}, [
|
|
2129
2342
|
navigateRef
|
|
2130
2343
|
]);
|
|
2131
|
-
const operatorMessage = (0,
|
|
2344
|
+
const operatorMessage = (0, import_react9.useMemo)(() => ({
|
|
2132
2345
|
["RouteBack"]: historyBack,
|
|
2133
2346
|
["RouteForward"]: historyForward,
|
|
2134
2347
|
["RouteChange"]: navigateRef.current
|
|
@@ -2137,7 +2350,7 @@ function IframeBridge() {
|
|
|
2137
2350
|
historyForward,
|
|
2138
2351
|
navigateRef
|
|
2139
2352
|
]);
|
|
2140
|
-
(0,
|
|
2353
|
+
(0, import_react9.useEffect)(() => {
|
|
2141
2354
|
if (isActive.current) {
|
|
2142
2355
|
isActive.current = false;
|
|
2143
2356
|
return;
|
|
@@ -2149,7 +2362,7 @@ function IframeBridge() {
|
|
|
2149
2362
|
}, [
|
|
2150
2363
|
location
|
|
2151
2364
|
]);
|
|
2152
|
-
const handleMessage = (0,
|
|
2365
|
+
const handleMessage = (0, import_react9.useCallback)((event) => {
|
|
2153
2366
|
const data = event.data ?? {};
|
|
2154
2367
|
if (typeof data.type === "string" && isRouteMessageType(data.type)) {
|
|
2155
2368
|
operatorMessage[data.type](data.data);
|
|
@@ -2157,7 +2370,7 @@ function IframeBridge() {
|
|
|
2157
2370
|
}, [
|
|
2158
2371
|
operatorMessage
|
|
2159
2372
|
]);
|
|
2160
|
-
(0,
|
|
2373
|
+
(0, import_react9.useEffect)(() => {
|
|
2161
2374
|
window.addEventListener("message", handleMessage);
|
|
2162
2375
|
return () => {
|
|
2163
2376
|
window.removeEventListener("message", handleMessage);
|
|
@@ -2165,7 +2378,7 @@ function IframeBridge() {
|
|
|
2165
2378
|
}, [
|
|
2166
2379
|
handleMessage
|
|
2167
2380
|
]);
|
|
2168
|
-
return /* @__PURE__ */ (0,
|
|
2381
|
+
return /* @__PURE__ */ (0, import_react9.createElement)("div", {
|
|
2169
2382
|
style: {
|
|
2170
2383
|
display: "none"
|
|
2171
2384
|
}
|
|
@@ -2293,7 +2506,7 @@ var TrackKey = /* @__PURE__ */ (function(TrackKey2) {
|
|
|
2293
2506
|
// src/components/AppContainer/index.tsx
|
|
2294
2507
|
var AppContainer = /* @__PURE__ */ __name(({ children }) => {
|
|
2295
2508
|
useAppInfo();
|
|
2296
|
-
(0,
|
|
2509
|
+
(0, import_react10.useEffect)(() => {
|
|
2297
2510
|
if (process.env.NODE_ENV === "production") {
|
|
2298
2511
|
reportTeaEvent({
|
|
2299
2512
|
trackKey: TrackKey.VIEW,
|
|
@@ -2305,14 +2518,14 @@ var AppContainer = /* @__PURE__ */ __name(({ children }) => {
|
|
|
2305
2518
|
});
|
|
2306
2519
|
}
|
|
2307
2520
|
}, []);
|
|
2308
|
-
return /* @__PURE__ */
|
|
2521
|
+
return /* @__PURE__ */ import_react10.default.createElement(import_react10.default.Fragment, null, String(process.env.MIAODA_APP_TYPE) !== "7" && /* @__PURE__ */ import_react10.default.createElement(safety_default, null), process.env.NODE_ENV !== "production" && /* @__PURE__ */ import_react10.default.createElement(import_miaoda_inspector.MiaodaInspector, null), process.env.NODE_ENV !== "production" && /* @__PURE__ */ import_react10.default.createElement(IframeBridge, null), /* @__PURE__ */ import_react10.default.createElement(Watermark_default, null), /* @__PURE__ */ import_react10.default.createElement(QueryProvider_default, null, children));
|
|
2309
2522
|
}, "AppContainer");
|
|
2310
2523
|
var AppContainer_default = AppContainer;
|
|
2311
2524
|
|
|
2312
2525
|
// src/components/Welcome/index.tsx
|
|
2313
|
-
var
|
|
2526
|
+
var import_react11 = __toESM(require("react"), 1);
|
|
2314
2527
|
var Welcome = /* @__PURE__ */ __name(({ title = "\u9875\u9762\u5F85\u5F00\u53D1", description = "\u9875\u9762\u6682\u672A\u5F00\u53D1\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5F85..." }) => {
|
|
2315
|
-
return /* @__PURE__ */
|
|
2528
|
+
return /* @__PURE__ */ import_react11.default.createElement("div", {
|
|
2316
2529
|
style: {
|
|
2317
2530
|
display: "flex",
|
|
2318
2531
|
flexDirection: "column",
|
|
@@ -2323,7 +2536,7 @@ var Welcome = /* @__PURE__ */ __name(({ title = "\u9875\u9762\u5F85\u5F00\u53D1"
|
|
|
2323
2536
|
padding: "0 24px",
|
|
2324
2537
|
textAlign: "center"
|
|
2325
2538
|
}
|
|
2326
|
-
}, /* @__PURE__ */
|
|
2539
|
+
}, /* @__PURE__ */ import_react11.default.createElement("img", {
|
|
2327
2540
|
style: {
|
|
2328
2541
|
borderRadius: 6,
|
|
2329
2542
|
marginBottom: 24
|
|
@@ -2332,7 +2545,7 @@ var Welcome = /* @__PURE__ */ __name(({ title = "\u9875\u9762\u5F85\u5F00\u53D1"
|
|
|
2332
2545
|
height: "200",
|
|
2333
2546
|
src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/miao/welcome.svg",
|
|
2334
2547
|
alt: "Welcome"
|
|
2335
|
-
}), /* @__PURE__ */
|
|
2548
|
+
}), /* @__PURE__ */ import_react11.default.createElement("div", {
|
|
2336
2549
|
style: {
|
|
2337
2550
|
fontSize: 16,
|
|
2338
2551
|
fontWeight: 500,
|
|
@@ -2340,7 +2553,7 @@ var Welcome = /* @__PURE__ */ __name(({ title = "\u9875\u9762\u5F85\u5F00\u53D1"
|
|
|
2340
2553
|
marginBottom: 4,
|
|
2341
2554
|
color: "#1f2329"
|
|
2342
2555
|
}
|
|
2343
|
-
}, title), /* @__PURE__ */
|
|
2556
|
+
}, title), /* @__PURE__ */ import_react11.default.createElement("div", {
|
|
2344
2557
|
style: {
|
|
2345
2558
|
fontSize: 16,
|
|
2346
2559
|
lineHeight: "24px",
|
|
@@ -2352,9 +2565,9 @@ var Welcome = /* @__PURE__ */ __name(({ title = "\u9875\u9762\u5F85\u5F00\u53D1"
|
|
|
2352
2565
|
var Welcome_default = Welcome;
|
|
2353
2566
|
|
|
2354
2567
|
// src/components/PagePlaceholder/index.tsx
|
|
2355
|
-
var
|
|
2568
|
+
var import_react12 = __toESM(require("react"), 1);
|
|
2356
2569
|
var PagePlaceholder = /* @__PURE__ */ __name(({ title = "\u9875\u9762\u5F85\u5F00\u53D1", description = "\u9875\u9762\u6682\u672A\u5F00\u53D1\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5F85..." }) => {
|
|
2357
|
-
return /* @__PURE__ */
|
|
2570
|
+
return /* @__PURE__ */ import_react12.default.createElement("div", {
|
|
2358
2571
|
style: {
|
|
2359
2572
|
display: "flex",
|
|
2360
2573
|
flexDirection: "column",
|
|
@@ -2365,7 +2578,7 @@ var PagePlaceholder = /* @__PURE__ */ __name(({ title = "\u9875\u9762\u5F85\u5F0
|
|
|
2365
2578
|
height: "calc(100vh - 64px)",
|
|
2366
2579
|
textAlign: "center"
|
|
2367
2580
|
}
|
|
2368
|
-
}, /* @__PURE__ */
|
|
2581
|
+
}, /* @__PURE__ */ import_react12.default.createElement("img", {
|
|
2369
2582
|
style: {
|
|
2370
2583
|
borderRadius: "6px",
|
|
2371
2584
|
marginBottom: "24px"
|
|
@@ -2374,14 +2587,14 @@ var PagePlaceholder = /* @__PURE__ */ __name(({ title = "\u9875\u9762\u5F85\u5F0
|
|
|
2374
2587
|
height: "200",
|
|
2375
2588
|
src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/miao/welcome.svg",
|
|
2376
2589
|
alt: "Welcome"
|
|
2377
|
-
}), /* @__PURE__ */
|
|
2590
|
+
}), /* @__PURE__ */ import_react12.default.createElement("div", {
|
|
2378
2591
|
style: {
|
|
2379
2592
|
fontSize: "16px",
|
|
2380
2593
|
fontWeight: 500,
|
|
2381
2594
|
marginBottom: "4px",
|
|
2382
2595
|
lineHeight: "24px"
|
|
2383
2596
|
}
|
|
2384
|
-
}, title), /* @__PURE__ */
|
|
2597
|
+
}, title), /* @__PURE__ */ import_react12.default.createElement("div", {
|
|
2385
2598
|
style: {
|
|
2386
2599
|
color: "#6b7280",
|
|
2387
2600
|
fontSize: "16px",
|
|
@@ -2397,10 +2610,10 @@ var PagePlaceholder = /* @__PURE__ */ __name(({ title = "\u9875\u9762\u5F85\u5F0
|
|
|
2397
2610
|
var PagePlaceholder_default = PagePlaceholder;
|
|
2398
2611
|
|
|
2399
2612
|
// src/components/ErrorRender/index.tsx
|
|
2400
|
-
var
|
|
2613
|
+
var import_react13 = __toESM(require("react"), 1);
|
|
2401
2614
|
var ErrorRender = /* @__PURE__ */ __name((props) => {
|
|
2402
2615
|
const { error, resetErrorBoundary } = props;
|
|
2403
|
-
(0,
|
|
2616
|
+
(0, import_react13.useEffect)(() => {
|
|
2404
2617
|
if (error) {
|
|
2405
2618
|
submitPostMessage({
|
|
2406
2619
|
type: "RenderError",
|
|
@@ -2421,7 +2634,7 @@ var ErrorRender = /* @__PURE__ */ __name((props) => {
|
|
|
2421
2634
|
}, [
|
|
2422
2635
|
error
|
|
2423
2636
|
]);
|
|
2424
|
-
(0,
|
|
2637
|
+
(0, import_react13.useEffect)(() => {
|
|
2425
2638
|
if (!resetErrorBoundary) return;
|
|
2426
2639
|
const hmr = getHmrApi();
|
|
2427
2640
|
if (!hmr) return;
|
|
@@ -2436,27 +2649,27 @@ var ErrorRender = /* @__PURE__ */ __name((props) => {
|
|
|
2436
2649
|
}, [
|
|
2437
2650
|
resetErrorBoundary
|
|
2438
2651
|
]);
|
|
2439
|
-
return /* @__PURE__ */
|
|
2652
|
+
return /* @__PURE__ */ import_react13.default.createElement("div", {
|
|
2440
2653
|
className: "min-h-screen flex items-center justify-center bg-white"
|
|
2441
|
-
}, /* @__PURE__ */
|
|
2654
|
+
}, /* @__PURE__ */ import_react13.default.createElement("div", {
|
|
2442
2655
|
className: "flex flex-col justify-center items-center text-center"
|
|
2443
|
-
}, /* @__PURE__ */
|
|
2656
|
+
}, /* @__PURE__ */ import_react13.default.createElement("img", {
|
|
2444
2657
|
src: "https://lf3-static.bytednsdoc.com/obj/eden-cn/ylcylz_fsph_ryhs/ljhwZthlaukjlkulzlp/feisuda/template/illustration_empty_negative_error.svg",
|
|
2445
2658
|
alt: "render error",
|
|
2446
2659
|
className: "mb-3 w-[100px]"
|
|
2447
|
-
}), /* @__PURE__ */
|
|
2660
|
+
}), /* @__PURE__ */ import_react13.default.createElement("p", {
|
|
2448
2661
|
className: "text-l/[22px] text-[14px] text-[#1F2329] font-medium"
|
|
2449
2662
|
}, "\u9875\u9762\u51FA\u9519\u4E86")));
|
|
2450
2663
|
}, "ErrorRender");
|
|
2451
2664
|
var ErrorRender_default = ErrorRender;
|
|
2452
2665
|
|
|
2453
2666
|
// src/route-components/ActiveLink.tsx
|
|
2454
|
-
var
|
|
2667
|
+
var import_react14 = __toESM(require("react"), 1);
|
|
2455
2668
|
var import_react_router_dom2 = require("react-router-dom");
|
|
2456
|
-
var ActiveLink = /* @__PURE__ */ (0,
|
|
2457
|
-
const [currentHash, setCurrentHash] = (0,
|
|
2669
|
+
var ActiveLink = /* @__PURE__ */ (0, import_react14.forwardRef)(({ to, onClick, className, style, children, ...rest }, ref) => {
|
|
2670
|
+
const [currentHash, setCurrentHash] = (0, import_react14.useState)(() => typeof window !== "undefined" ? window.location.hash : "");
|
|
2458
2671
|
const isHashRoute = typeof to === "string" && to.startsWith("#");
|
|
2459
|
-
(0,
|
|
2672
|
+
(0, import_react14.useEffect)(() => {
|
|
2460
2673
|
if (!isHashRoute) return;
|
|
2461
2674
|
const handleHashChange = /* @__PURE__ */ __name(() => {
|
|
2462
2675
|
setCurrentHash(window.location.hash);
|
|
@@ -2468,7 +2681,7 @@ var ActiveLink = /* @__PURE__ */ (0, import_react13.forwardRef)(({ to, onClick,
|
|
|
2468
2681
|
]);
|
|
2469
2682
|
const isActive = isHashRoute && currentHash === to;
|
|
2470
2683
|
if (!isHashRoute) {
|
|
2471
|
-
return /* @__PURE__ */
|
|
2684
|
+
return /* @__PURE__ */ import_react14.default.createElement(import_react_router_dom2.NavLink, {
|
|
2472
2685
|
ref,
|
|
2473
2686
|
to,
|
|
2474
2687
|
onClick,
|
|
@@ -2509,7 +2722,7 @@ var ActiveLink = /* @__PURE__ */ (0, import_react13.forwardRef)(({ to, onClick,
|
|
|
2509
2722
|
isPending: false,
|
|
2510
2723
|
isTransitioning: false
|
|
2511
2724
|
}) : children;
|
|
2512
|
-
return /* @__PURE__ */
|
|
2725
|
+
return /* @__PURE__ */ import_react14.default.createElement("a", {
|
|
2513
2726
|
ref,
|
|
2514
2727
|
href: to,
|
|
2515
2728
|
onClick: handleHashClick,
|
|
@@ -2521,9 +2734,9 @@ var ActiveLink = /* @__PURE__ */ (0, import_react13.forwardRef)(({ to, onClick,
|
|
|
2521
2734
|
ActiveLink.displayName = "ActiveLink";
|
|
2522
2735
|
|
|
2523
2736
|
// src/route-components/NavLink.tsx
|
|
2524
|
-
var
|
|
2737
|
+
var React10 = __toESM(require("react"), 1);
|
|
2525
2738
|
var import_react_router_dom3 = require("react-router-dom");
|
|
2526
|
-
var NavLink2 = /* @__PURE__ */
|
|
2739
|
+
var NavLink2 = /* @__PURE__ */ React10.forwardRef(({ to, children, className, style, ...props }, ref) => {
|
|
2527
2740
|
const isHashLink = typeof to === "string" && to.startsWith("#");
|
|
2528
2741
|
const location = (0, import_react_router_dom3.useLocation)();
|
|
2529
2742
|
const navigate = (0, import_react_router_dom3.useNavigate)();
|
|
@@ -2547,7 +2760,7 @@ var NavLink2 = /* @__PURE__ */ React9.forwardRef(({ to, children, className, sty
|
|
|
2547
2760
|
const resolvedClassName = typeof className === "function" ? className(renderProps) : className;
|
|
2548
2761
|
const resolvedStyle = typeof style === "function" ? style(renderProps) : style;
|
|
2549
2762
|
const { caseSensitive, end, replace, state, preventScrollReset, relative, viewTransition, ...restProps } = props;
|
|
2550
|
-
return /* @__PURE__ */
|
|
2763
|
+
return /* @__PURE__ */ React10.createElement("a", {
|
|
2551
2764
|
href: to,
|
|
2552
2765
|
onClick: handleClick,
|
|
2553
2766
|
ref,
|
|
@@ -2556,7 +2769,7 @@ var NavLink2 = /* @__PURE__ */ React9.forwardRef(({ to, children, className, sty
|
|
|
2556
2769
|
...restProps
|
|
2557
2770
|
}, typeof children === "function" ? children(renderProps) : children);
|
|
2558
2771
|
}
|
|
2559
|
-
return /* @__PURE__ */
|
|
2772
|
+
return /* @__PURE__ */ React10.createElement(import_react_router_dom3.NavLink, {
|
|
2560
2773
|
to,
|
|
2561
2774
|
ref,
|
|
2562
2775
|
className,
|
|
@@ -2571,7 +2784,7 @@ var NavLink2 = /* @__PURE__ */ React9.forwardRef(({ to, children, className, sty
|
|
|
2571
2784
|
NavLink2.displayName = "NavLink";
|
|
2572
2785
|
|
|
2573
2786
|
// src/route-components/UniversalLink.tsx
|
|
2574
|
-
var
|
|
2787
|
+
var import_react15 = __toESM(require("react"), 1);
|
|
2575
2788
|
var import_react_router_dom4 = require("react-router-dom");
|
|
2576
2789
|
function isInternalRoute(to) {
|
|
2577
2790
|
return !to.startsWith("#") && !to.startsWith("http://") && !to.startsWith("https://") && !to.startsWith("//");
|
|
@@ -2581,15 +2794,15 @@ function isExternalLink(to) {
|
|
|
2581
2794
|
return to.startsWith("http://") || to.startsWith("https://") || to.startsWith("//");
|
|
2582
2795
|
}
|
|
2583
2796
|
__name(isExternalLink, "isExternalLink");
|
|
2584
|
-
var UniversalLink = /* @__PURE__ */
|
|
2797
|
+
var UniversalLink = /* @__PURE__ */ import_react15.default.forwardRef(/* @__PURE__ */ __name(function UniversalLink2({ to, ...props }, ref) {
|
|
2585
2798
|
if (isInternalRoute(to)) {
|
|
2586
|
-
return /* @__PURE__ */
|
|
2799
|
+
return /* @__PURE__ */ import_react15.default.createElement(import_react_router_dom4.Link, {
|
|
2587
2800
|
to,
|
|
2588
2801
|
ref,
|
|
2589
2802
|
...props
|
|
2590
2803
|
});
|
|
2591
2804
|
}
|
|
2592
|
-
return /* @__PURE__ */
|
|
2805
|
+
return /* @__PURE__ */ import_react15.default.createElement("a", {
|
|
2593
2806
|
href: to,
|
|
2594
2807
|
ref,
|
|
2595
2808
|
...props,
|