@24city/web-console 0.3.12 → 0.3.13
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/CHANGELOG.md +17 -0
- package/README.md +13 -1
- package/dist/account/account-api.d.ts +22 -1
- package/dist/account/index.js +76 -72
- package/dist/account/use-track.d.ts +32 -5
- package/dist/chunks/{auth-provider-Cwib6lRM.js → auth-provider-DAxku5aX.js} +1 -1
- package/dist/chunks/{console-layout-BhmLHO5v.js → console-layout-aa4l4x0s.js} +20 -20
- package/dist/chunks/{logout-signal-qvHorCCF.js → logout-signal-XyvlxcEc.js} +166 -163
- package/dist/chunks/{stale-build-CJ5c5sRp.js → stale-build-4Zf1W-0Q.js} +2 -2
- package/dist/chunks/{use-show-once-Cwj5z_Lo.js → use-show-once-DQHhTzlT.js} +140 -140
- package/dist/chunks/wallet-badge-DIJeoyjn.js +700 -0
- package/dist/index.js +198 -194
- package/dist/layout/index.js +1 -1
- package/dist/runtime/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunks/wallet-badge-DnWl21es.js +0 -629
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.13
|
|
4
|
+
|
|
5
|
+
**新增:没登录访客的来访**(`@24city/web-console/account`,统一账号中心 API 1.27.0;运营在统一中心「访客运营」里看产品站点
|
|
6
|
+
的访客从哪来、在哪一步流失,在产品里注册的账号也能对上来源渠道,统一中心 `docs/访客运营.md`)
|
|
7
|
+
|
|
8
|
+
- `useTrack()` 在确认没登录后不再把页面浏览丢掉:`page.viewed` 转为访客的来访,经产品自己的 `POST /api/account/visits`
|
|
9
|
+
(account-client 0.10.0 起由 ginaccount 提供)上报;其他事件仍只记已登录用户。会话恢复前记下的页面浏览,确认没登录后一并转过去。
|
|
10
|
+
- 这次打开网页的来源(链接上的 `utm_source` / `utm_medium` / `utm_campaign` 和外部来源网站的域名)在包加载时读一次,
|
|
11
|
+
只随第一页上报;路径用路由模板,不带真实 ID。访客是谁由服务端读统一中心共用的访客 Cookie,浏览器不传。
|
|
12
|
+
- 新增 `useTrackPageView()`:产品自己的公开页面(价格页、文档页等)调用一次即可记浏览;`ConsoleLayout` 和 `@24city/web-home`
|
|
13
|
+
的首页已自动记。
|
|
14
|
+
- `AccountApi.reportVisits`(可选方法,自己实现 AccountApi 的产品不写也能编译)、`VisitorPageViewInput`、
|
|
15
|
+
`createVisitorTracker`、`readVisitorLanding`、`PAGE_VIEWED`。
|
|
16
|
+
- `AccountApi.startLogin(returnPath, appBasePath, options?)` 新增可选的 `options.entry`(小写字母开头,如 `hero`),
|
|
17
|
+
`LoginPage` 把地址上的 `?entry=` 转给它:统一中心按它统计是哪个按钮带来了登录和注册。
|
|
18
|
+
- 2 秒或 20 条一批,失败不提示;产品后端还没有这个接口(404)时本次会话不再上报,所以先升级本包、后升级 account-client 也不会出错。
|
|
19
|
+
|
|
3
20
|
## 0.3.12
|
|
4
21
|
|
|
5
22
|
**修复:发布期间恢复会话停在不可用页**(`AuthProvider`、`RouteGuard`、`LoginPage`)
|
package/README.md
CHANGED
|
@@ -179,7 +179,19 @@ const customization: ConsoleCustomization = {
|
|
|
179
179
|
生成完成这类关键动作以服务端为准,用 account-client 的 `Account.Track` 在业务成功后记。
|
|
180
180
|
|
|
181
181
|
上报经产品自己的 `POST /api/account/events`(account-client 0.9.0 起由 ginaccount 提供,用户与空间按会话补上),
|
|
182
|
-
2 秒或 20
|
|
182
|
+
2 秒或 20 条一批;会话恢复前先排队,确认已登录才发;失败不提示,后端还没有这个接口(404)时本次会话不再上报。
|
|
183
|
+
|
|
184
|
+
### 访客来访
|
|
185
|
+
|
|
186
|
+
没登录的访客只记页面浏览,算统一中心「访客运营」里的来访(统一中心 `docs/访客运营.md`):运营能看到产品站点的访客从哪来、
|
|
187
|
+
点了哪个登录按钮、最后有没有注册,在产品里注册的账号也能对上来源渠道。
|
|
188
|
+
|
|
189
|
+
- 确认没登录后,`page.viewed` 经产品自己的 `POST /api/account/visits`(account-client 0.10.0 起)上报,其他事件不记;
|
|
190
|
+
- 这次打开网页的来源(`utm_source` / `utm_medium` / `utm_campaign` 和外部来源网站)只随第一页上报一次;
|
|
191
|
+
- 访客是谁由产品服务端读统一中心共用的访客 Cookie(`.24.city` 下的 `gg_vid`),浏览器不传,也不存在本地;
|
|
192
|
+
- `ConsoleLayout` 和 `@24city/web-home` 的首页已自动记,产品自己的公开页面调用一次 `useTrackPageView()`;
|
|
193
|
+
- 自己做的首页按钮去登录时带上位置:跳到登录页并加上 `entry`(如 `/login?returnPath=/app&entry=hero`),`LoginPage` 会把它
|
|
194
|
+
交给 `startLogin`。
|
|
183
195
|
|
|
184
196
|
### 退出登录
|
|
185
197
|
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import type { AxiosInstance } from 'axios';
|
|
2
2
|
import type { ProductEntitlement, ProductIdentityContext, ProductPlan, ProductProfile, ProductSession, ProductSpacesResponse, ProductSubscription, ProductWallet } from './types';
|
|
3
3
|
export type BehaviorPropValue = string | number | boolean;
|
|
4
|
+
/**
|
|
5
|
+
* 没登录访客看过的一页(统一中心 docs/访客运营.md):路径用路由模板;来源网站和推广参数只在这次打开网页的第一页带。
|
|
6
|
+
* 访客是谁由产品服务端读统一中心共用的访客 Cookie,浏览器不传。
|
|
7
|
+
*/
|
|
8
|
+
export interface VisitorPageViewInput {
|
|
9
|
+
path: string;
|
|
10
|
+
referrerHost?: string;
|
|
11
|
+
utmSource?: string;
|
|
12
|
+
utmMedium?: string;
|
|
13
|
+
utmCampaign?: string;
|
|
14
|
+
occurredAt: string;
|
|
15
|
+
}
|
|
16
|
+
/** 发起登录的附加信息。entry 是点的哪个按钮(如 hero),统一中心按它统计登录入口。 */
|
|
17
|
+
export interface StartLoginOptions {
|
|
18
|
+
entry?: string;
|
|
19
|
+
}
|
|
4
20
|
/** 浏览器上报的一条行为事件;用户与空间由产品服务端按会话补上(统一中心 docs/用户行为事件.md)。 */
|
|
5
21
|
export interface BehaviorEventInput {
|
|
6
22
|
eventId: string;
|
|
@@ -11,7 +27,7 @@ export interface BehaviorEventInput {
|
|
|
11
27
|
}
|
|
12
28
|
/** 产品服务端账号接入模块(STD-ACCOUNT-001 `/api/account/*`)在浏览器侧的客户端。 */
|
|
13
29
|
export interface AccountApi {
|
|
14
|
-
startLogin: (returnPath: string, appBasePath: string) => string;
|
|
30
|
+
startLogin: (returnPath: string, appBasePath: string, options?: StartLoginOptions) => string;
|
|
15
31
|
getSession: () => Promise<ProductSession>;
|
|
16
32
|
getSpaces: () => Promise<ProductSpacesResponse>;
|
|
17
33
|
switchSpace: (spaceId: string) => Promise<ProductSession>;
|
|
@@ -39,6 +55,11 @@ export interface AccountApi {
|
|
|
39
55
|
* 自己实现 AccountApi 的产品不写也能编译,只是 `useTrack` 不上报。
|
|
40
56
|
*/
|
|
41
57
|
reportBehaviorEvents?: (events: BehaviorEventInput[]) => Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* 上报没登录访客看过的页面(`POST /api/account/visits`,account-client 0.10.0 起由 ginaccount 提供)。可选:
|
|
60
|
+
* 自己实现 AccountApi 的产品不写也能编译,只是没登录的浏览不记。
|
|
61
|
+
*/
|
|
62
|
+
reportVisits?: (pageViews: VisitorPageViewInput[]) => Promise<void>;
|
|
42
63
|
}
|
|
43
64
|
export declare const createAccountApi: (client: AxiosInstance, apiBaseUrl: string) => AccountApi;
|
|
44
65
|
/** 会话与空间列表一起读;两边的当前空间不一致时重读一次会话,仍不一致则视为服务端状态异常。 */
|
package/dist/account/index.js
CHANGED
|
@@ -1,92 +1,96 @@
|
|
|
1
|
-
import { A as s, a as
|
|
2
|
-
import { A as
|
|
3
|
-
import { A as
|
|
4
|
-
import { A as
|
|
5
|
-
import { notifyCustomerSessionChanged as
|
|
1
|
+
import { A as s, a as t, c as o, b as r, i as n, d as i, l as u, n as c, r as l, e as g, f as p, u as A, g as S, w as P } from "../chunks/logout-signal-XyvlxcEc.js";
|
|
2
|
+
import { A as d, a as C, C as h, L as f, P as m, b as T, c as y, Q as E, R as N, S as O, d as b, T as w, U, e as _, p as v, f as F, g as R, h as x, u as B, y as I } from "../chunks/use-show-once-DQHhTzlT.js";
|
|
3
|
+
import { A as D, a as M, b as V, E as q, F as K, P as Q, c as G, d as H, e as W, U as Y, f as X, W as j, g as z, h as J, i as Z, j as $, k as aa, l as ea, m as sa, n as ta, o as oa, p as ra, q as na, r as ia, s as ua, t as ca, u as la, v as ga, w as pa, x as Aa, y as Sa, z as Pa, B as La, C as da, D as Ca, G as ha, H as fa, I as ma, J as Ta, K as ya, L as Ea, M as Na, N as Oa, O as ba, Q as wa, R as Ua, S as _a, T as va, V as Fa, X as Ra, Y as xa, Z as Ba } from "../chunks/wallet-badge-DIJeoyjn.js";
|
|
4
|
+
import { A as ka } from "../chunks/auth-provider-DAxku5aX.js";
|
|
5
|
+
import { notifyCustomerSessionChanged as Ma, subscribeCustomerSessionChanges as Va } from "@24city/web-runtime/session-sync";
|
|
6
6
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
D as ACCOUNT_SECTIONS,
|
|
8
|
+
M as AccountAvatar,
|
|
9
|
+
d as AccountCenterPage,
|
|
10
|
+
V as AccountMenu,
|
|
11
|
+
C as AllowanceMeter,
|
|
12
|
+
ka as AuthProvider,
|
|
13
13
|
s as AuthStoreProvider,
|
|
14
14
|
h as CenterLinkButton,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
q as EXPIRING_SOON_DAYS,
|
|
16
|
+
K as FALLBACK_ACCOUNT_LABEL,
|
|
17
17
|
f as LoginPage,
|
|
18
|
+
Q as PAGE_VIEWED,
|
|
18
19
|
G as PERSONAL_NAV_KEYS,
|
|
19
20
|
H as PERSONAL_SPACE_LABEL,
|
|
20
21
|
m as PlanCards,
|
|
21
22
|
W as PlanPanel,
|
|
22
23
|
T as PointsSection,
|
|
23
24
|
y as ProfileSection,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
E as QuotaPill,
|
|
26
|
+
N as RouteGuard,
|
|
27
|
+
O as SettingRow,
|
|
28
|
+
b as SubscriptionSection,
|
|
29
|
+
w as TeamPromo,
|
|
29
30
|
Y as UNLIMITED_QUOTA,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
oa as
|
|
46
|
-
|
|
47
|
-
na as
|
|
48
|
-
|
|
49
|
-
ua as
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
31
|
+
X as UpgradeEntry,
|
|
32
|
+
U as UpgradeModal,
|
|
33
|
+
j as WalletBadge,
|
|
34
|
+
_ as accountCenterPageUrl,
|
|
35
|
+
z as accountQueryKeys,
|
|
36
|
+
J as accountSectionPath,
|
|
37
|
+
t as announceLogout,
|
|
38
|
+
Z as behaviorRouteTemplate,
|
|
39
|
+
$ as buildPersonalNavigation,
|
|
40
|
+
aa as canBuyForSpace,
|
|
41
|
+
ea as catalogPlanOf,
|
|
42
|
+
o as createAccountApi,
|
|
43
|
+
r as createAuthStore,
|
|
44
|
+
sa as createBehaviorTracker,
|
|
45
|
+
ta as createVisitorTracker,
|
|
46
|
+
oa as entryTeamPlan,
|
|
47
|
+
ra as featureLines,
|
|
48
|
+
na as formatPlanAmount,
|
|
49
|
+
ia as formatPlanPrice,
|
|
50
|
+
ua as isAccountCenterPath,
|
|
51
|
+
ca as isAccountSection,
|
|
52
|
+
n as isLeavingForLogout,
|
|
53
|
+
i as isLoggedOutElsewhere,
|
|
54
|
+
la as isTeamSpace,
|
|
55
|
+
ga as isTeamSubscriptionRequired,
|
|
56
|
+
pa as isUnlimited,
|
|
57
|
+
u as leaveForLogout,
|
|
56
58
|
c as noteLogoutElsewhere,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
59
|
+
Ma as notifySessionChanged,
|
|
60
|
+
Aa as offerHighlights,
|
|
61
|
+
Sa as personalNavKey,
|
|
62
|
+
v as planBenefitLines,
|
|
63
|
+
F as planCopy,
|
|
64
|
+
Pa as planDaysLeft,
|
|
65
|
+
La as planFocusOf,
|
|
66
|
+
da as planFocusState,
|
|
67
|
+
Ca as planPeriodText,
|
|
68
|
+
ha as planTitle,
|
|
69
|
+
R as plansUrl,
|
|
68
70
|
x as priceFor,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
fa as productAccountSections,
|
|
72
|
+
ma as quotaCopy,
|
|
73
|
+
Ta as quotaFull,
|
|
74
|
+
ya as quotaText,
|
|
75
|
+
Ea as readVisitorLanding,
|
|
73
76
|
l as releaseLogoutHold,
|
|
74
77
|
g as resetLogoutSignalForTest,
|
|
75
78
|
p as restoreIdentityContext,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
79
|
+
Na as spaceDisplayName,
|
|
80
|
+
Oa as spaceRoleLabel,
|
|
81
|
+
ba as startingPrice,
|
|
82
|
+
Va as subscribeSessionChanged,
|
|
83
|
+
wa as upgradeOffer,
|
|
84
|
+
Ua as useAccountCenter,
|
|
85
|
+
A as useAuthState,
|
|
86
|
+
S as useAuthStore,
|
|
87
|
+
_a as useLogout,
|
|
88
|
+
va as useMembership,
|
|
89
|
+
Fa as usePlanCatalog,
|
|
87
90
|
B as useShowOnce,
|
|
88
|
-
|
|
89
|
-
|
|
91
|
+
Ra as useSpaceSwitch,
|
|
92
|
+
xa as useTrack,
|
|
93
|
+
Ba as useTrackPageView,
|
|
90
94
|
P as withdrawLogout,
|
|
91
95
|
I as yearlyNote
|
|
92
96
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BehaviorEventInput, BehaviorPropValue } from './account-api';
|
|
1
|
+
import type { BehaviorEventInput, BehaviorPropValue, VisitorPageViewInput } from './account-api';
|
|
2
2
|
export interface TrackOptions {
|
|
3
3
|
/** 低基数的作用对象:页面路由模板、套餐编码、弹窗名等;不放用户输入和真实 ID。 */
|
|
4
4
|
target?: string;
|
|
@@ -7,23 +7,50 @@ export interface TrackOptions {
|
|
|
7
7
|
}
|
|
8
8
|
/** `track('works.exported', { target: '/works/:id', props: { format: 'mp4' } })`;事件名为「对象.过去式动作」。 */
|
|
9
9
|
export type Track = (name: string, options?: TrackOptions) => void;
|
|
10
|
+
/** 页面浏览的事件名:登录用户记为行为事件,没登录的访客记为来访。 */
|
|
11
|
+
export declare const PAGE_VIEWED = "page.viewed";
|
|
10
12
|
interface Tracker {
|
|
11
13
|
track: Track;
|
|
12
14
|
flush: () => Promise<void>;
|
|
13
|
-
/**
|
|
15
|
+
/** 登录状态:未知时事件先排队不发;确认已登录后照常发送,确认未登录则页面浏览转给访客队列、其他事件丢掉。 */
|
|
14
16
|
setSignedIn: (signedIn: boolean | undefined) => void;
|
|
15
17
|
}
|
|
18
|
+
/** 没登录访客的页面浏览队列。 */
|
|
19
|
+
export interface VisitorTracker {
|
|
20
|
+
pageView: (path: string, occurredAt?: string) => void;
|
|
21
|
+
flush: () => Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
/** 这次打开网页时的来源:外部来源网站和推广参数。 */
|
|
24
|
+
export type VisitorLanding = Omit<VisitorPageViewInput, 'path' | 'occurredAt'>;
|
|
25
|
+
/**
|
|
26
|
+
* 读这次打开网页时的来源:链接上的 utm_source / utm_medium / utm_campaign 和外部来源网站的域名。只取一次,
|
|
27
|
+
* 在模块加载时读,前端路由还没改写地址;同站内跳转不算来源。
|
|
28
|
+
*/
|
|
29
|
+
export declare const readVisitorLanding: (href: string, referrer: string) => VisitorLanding | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* 没登录访客的页面浏览:2 秒或满 20 条发一次;这次打开网页的第一页带上来源;产品后端还没有转发接口(404)时
|
|
32
|
+
* 本次会话不再上报。
|
|
33
|
+
*/
|
|
34
|
+
export declare const createVisitorTracker: (report: (pageViews: VisitorPageViewInput[]) => Promise<void>,
|
|
35
|
+
/** 第一页带的来源;不传时用这次打开网页时读到的,传 null 表示没有。 */
|
|
36
|
+
landing?: VisitorLanding | null) => VisitorTracker;
|
|
16
37
|
/**
|
|
17
38
|
* 一个账号接口一份队列:2 秒或满 20 条发一次;产品后端没有转发接口(404)时本次会话不再上报。
|
|
18
|
-
* 不传 signedIn 时视为已登录(直接用队列的场景);useTrack
|
|
39
|
+
* 不传 signedIn 时视为已登录(直接用队列的场景);useTrack 按会话恢复的结果设置。没登录时页面浏览交给 visitor。
|
|
19
40
|
*/
|
|
20
|
-
export declare const createBehaviorTracker: (report: (events: BehaviorEventInput[]) => Promise<void>, signedIn?: boolean | undefined) => Tracker;
|
|
41
|
+
export declare const createBehaviorTracker: (report: (events: BehaviorEventInput[]) => Promise<void>, signedIn?: boolean | undefined, visitor?: VisitorTracker) => Tracker;
|
|
21
42
|
/**
|
|
22
|
-
*
|
|
43
|
+
* 记录当前用户的行为。已登录时上报行为事件;没登录时只记页面浏览,算访客的来访。自己实现 AccountApi 且没有
|
|
44
|
+
* `reportBehaviorEvents`、`reportVisits` 的产品什么也不发。
|
|
23
45
|
* 关键动作(导出成功、生成完成)以服务端为准,用 account-client 的 `Account.Track` 在业务成功后记;
|
|
24
46
|
* 这里记页面和点击这类只有前端知道的事。
|
|
25
47
|
*/
|
|
26
48
|
export declare const useTrack: () => Track;
|
|
49
|
+
/**
|
|
50
|
+
* 记录当前页面的浏览:登录用户记为行为事件,没登录的访客记为来访。工作台布局(ConsoleLayout)和产品首页
|
|
51
|
+
* (@24city/web-home)已经自动记;产品自己的公开页面(价格页、文档页等)在页面组件里调用一次即可。
|
|
52
|
+
*/
|
|
53
|
+
export declare const useTrackPageView: () => void;
|
|
27
54
|
/**
|
|
28
55
|
* 页面的路由模板:像 ID 的路径段(数字、UUID、长十六进制、16 位以上含数字的串)和含其他字符的段(中文、编码后的关键词)
|
|
29
56
|
* 都换成 `:id`,去掉末尾斜杠。
|
|
@@ -2,7 +2,7 @@ import { jsx as U, Fragment as L } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect as T } from "react";
|
|
3
3
|
import { useQueryClient as I } from "@tanstack/react-query";
|
|
4
4
|
import { b as R } from "./context-CaVim6ZO.js";
|
|
5
|
-
import { g as A, n as y, i as c, v as k, f as S, r as x, y as P, t as h } from "./logout-signal-
|
|
5
|
+
import { g as A, n as y, i as c, v as k, f as S, r as x, y as P, t as h } from "./logout-signal-XyvlxcEc.js";
|
|
6
6
|
import { subscribeCustomerSessionChanges as _ } from "@24city/web-runtime/session-sync";
|
|
7
7
|
const z = (e) => !h(e, 401) && !h(e, 403) && !h(e, 404), F = (e, i) => (e == null ? void 0 : e.purpose) === i.purpose && e.globalUserId === i.globalUserId && e.activeSpaceId === i.activeSpaceId, H = [1e3, 2e3, 4e3], Q = 15e3, B = (e) => new Promise((i) => setTimeout(i, e)), D = ({ children: e }) => {
|
|
8
8
|
const i = I(), o = A(), { accountApi: f, config: r, http: d } = R();
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as t, jsxs as c, Fragment as O } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect as z, useState as b } from "react";
|
|
3
|
-
import { Layout as v, Button as f, Typography as
|
|
3
|
+
import { Layout as v, Button as f, Typography as Y, Space as F, Nav as $ } from "@douyinfe/semi-ui";
|
|
4
4
|
import { IconSidebar as P } from "@douyinfe/semi-icons";
|
|
5
|
-
import { useLocation as
|
|
6
|
-
import {
|
|
5
|
+
import { useLocation as Q, useNavigate as q, Outlet as D } from "react-router";
|
|
6
|
+
import { Y as J, i as V, j as X, H as Z, s as ee, f as te, W as ne, b as ae } from "./wallet-badge-DIJeoyjn.js";
|
|
7
7
|
import { u as R, b as oe, a as se } from "./context-CaVim6ZO.js";
|
|
8
8
|
import { u as le } from "./use-media-query-DvyinWNg.js";
|
|
9
9
|
import { a as re } from "./scale-smFifpMm.js";
|
|
10
|
-
const ce = "_layout_1vz0g_6", ie = "_header_1vz0g_13", de = "_headerLeft_1vz0g_34", ue = "_logo_1vz0g_43", me = "_logoMark_1vz0g_58", pe = "_logoText_1vz0g_65", _e = "_modules_1vz0g_75", he = "_module_1vz0g_75", ge = "_moduleText_1vz0g_123", ve = "_moduleIcon_1vz0g_143", fe = "_moduleInk_1vz0g_147", ke = "_headerRight_1vz0g_167", ye = "_walletSlot_1vz0g_172", Ne = "_body_1vz0g_180", ze = "_sider_1vz0g_186", be = "_siderInner_1vz0g_200", Ie = "_panel_1vz0g_207", we = "_expandButton_1vz0g_244", xe = "_menu_1vz0g_260", Ce = "_menuGroup_1vz0g_271", Me = "_menuGroupPlain_1vz0g_280",
|
|
10
|
+
const ce = "_layout_1vz0g_6", ie = "_header_1vz0g_13", de = "_headerLeft_1vz0g_34", ue = "_logo_1vz0g_43", me = "_logoMark_1vz0g_58", pe = "_logoText_1vz0g_65", _e = "_modules_1vz0g_75", he = "_module_1vz0g_75", ge = "_moduleText_1vz0g_123", ve = "_moduleIcon_1vz0g_143", fe = "_moduleInk_1vz0g_147", ke = "_headerRight_1vz0g_167", ye = "_walletSlot_1vz0g_172", Ne = "_body_1vz0g_180", ze = "_sider_1vz0g_186", be = "_siderInner_1vz0g_200", Ie = "_panel_1vz0g_207", we = "_expandButton_1vz0g_244", xe = "_menu_1vz0g_260", Ce = "_menuGroup_1vz0g_271", Me = "_menuGroupPlain_1vz0g_280", Be = "_menuGroupTitle_1vz0g_285", Le = "_menuList_1vz0g_296", Te = "_collapseButton_1vz0g_419", Ge = "_mask_1vz0g_440", Se = "_content_1vz0g_449", $e = "_contentCentered_1vz0g_455", Pe = "_contentInner_1vz0g_467", Re = "_letterMark_1vz0g_520", e = {
|
|
11
11
|
layout: ce,
|
|
12
12
|
header: ie,
|
|
13
13
|
headerLeft: de,
|
|
@@ -29,9 +29,9 @@ const ce = "_layout_1vz0g_6", ie = "_header_1vz0g_13", de = "_headerLeft_1vz0g_3
|
|
|
29
29
|
menu: xe,
|
|
30
30
|
menuGroup: Ce,
|
|
31
31
|
menuGroupPlain: Me,
|
|
32
|
-
menuGroupTitle:
|
|
33
|
-
menuList:
|
|
34
|
-
collapseButton:
|
|
32
|
+
menuGroupTitle: Be,
|
|
33
|
+
menuList: Le,
|
|
34
|
+
collapseButton: Te,
|
|
35
35
|
mask: Ge,
|
|
36
36
|
content: Se,
|
|
37
37
|
contentCentered: $e,
|
|
@@ -46,7 +46,7 @@ const ce = "_layout_1vz0g_6", ie = "_header_1vz0g_13", de = "_headerLeft_1vz0g_3
|
|
|
46
46
|
const o = () => l(window.scrollY > 0);
|
|
47
47
|
return o(), window.addEventListener("scroll", o, { passive: !0 }), () => window.removeEventListener("scroll", o);
|
|
48
48
|
}, []), a;
|
|
49
|
-
},
|
|
49
|
+
}, je = ({ size: a = 30, className: l }) => {
|
|
50
50
|
const o = R(), r = (u) => l ? `${u} ${l}` : u;
|
|
51
51
|
return o.markUrl ? /* @__PURE__ */ t(
|
|
52
52
|
"span",
|
|
@@ -69,11 +69,11 @@ const ce = "_layout_1vz0g_6", ie = "_header_1vz0g_13", de = "_headerLeft_1vz0g_3
|
|
|
69
69
|
extra: K
|
|
70
70
|
}) => {
|
|
71
71
|
var S;
|
|
72
|
-
const { config: w } = oe(), x = R(), p =
|
|
72
|
+
const { config: w } = oe(), x = R(), p = Q(), C = J();
|
|
73
73
|
z(() => {
|
|
74
74
|
C("page.viewed", { target: V(p.pathname) });
|
|
75
75
|
}, [p.pathname, C]);
|
|
76
|
-
const k =
|
|
76
|
+
const k = q(), M = w.routes.app, h = X(M, Z(se())), B = ee(M, p.pathname), g = B ? [] : r ?? [], L = g.length > 0, j = l ?? ((S = Ee(a, p.pathname)) == null ? void 0 : S.key), m = Ae([...g, h], p.pathname), T = u ?? (m == null ? void 0 : m.key), i = le(re("desktop")), W = Ke(), [_, y] = b(!i), [N, d] = b(!1), H = new Map([...g, h].flatMap((n) => n.items.map((s) => [s.key, s])));
|
|
77
77
|
z(() => {
|
|
78
78
|
y(!i), d(!1);
|
|
79
79
|
}, [i]);
|
|
@@ -82,7 +82,7 @@ const ce = "_layout_1vz0g_6", ie = "_header_1vz0g_13", de = "_headerLeft_1vz0g_3
|
|
|
82
82
|
s && k(s.to), d(!1);
|
|
83
83
|
};
|
|
84
84
|
return /* @__PURE__ */ c(v, { className: e.layout, children: [
|
|
85
|
-
/* @__PURE__ */ c(v.Header, { className: e.header, "data-scrolled":
|
|
85
|
+
/* @__PURE__ */ c(v.Header, { className: e.header, "data-scrolled": W ? "true" : "false", children: [
|
|
86
86
|
/* @__PURE__ */ c("div", { className: e.headerLeft, children: [
|
|
87
87
|
/* @__PURE__ */ c(
|
|
88
88
|
f,
|
|
@@ -93,8 +93,8 @@ const ce = "_layout_1vz0g_6", ie = "_header_1vz0g_13", de = "_headerLeft_1vz0g_3
|
|
|
93
93
|
"aria-label": `${x.shortName} 首页`,
|
|
94
94
|
onClick: () => k(w.routes.publicHome),
|
|
95
95
|
children: [
|
|
96
|
-
/* @__PURE__ */ t(
|
|
97
|
-
/* @__PURE__ */ t(
|
|
96
|
+
/* @__PURE__ */ t(je, {}),
|
|
97
|
+
/* @__PURE__ */ t(Y.Text, { className: e.logoText, children: x.shortName })
|
|
98
98
|
]
|
|
99
99
|
}
|
|
100
100
|
),
|
|
@@ -104,7 +104,7 @@ const ce = "_layout_1vz0g_6", ie = "_header_1vz0g_13", de = "_headerLeft_1vz0g_3
|
|
|
104
104
|
theme: "borderless",
|
|
105
105
|
type: "tertiary",
|
|
106
106
|
className: e.module,
|
|
107
|
-
"aria-current":
|
|
107
|
+
"aria-current": j === n.key ? "page" : void 0,
|
|
108
108
|
onClick: () => k(o ? o(n) : n.to),
|
|
109
109
|
children: [
|
|
110
110
|
/* @__PURE__ */ c("span", { className: e.moduleText, children: [
|
|
@@ -117,14 +117,14 @@ const ce = "_layout_1vz0g_6", ie = "_header_1vz0g_13", de = "_headerLeft_1vz0g_3
|
|
|
117
117
|
n.key
|
|
118
118
|
)) }) : null
|
|
119
119
|
] }),
|
|
120
|
-
/* @__PURE__ */ t(
|
|
120
|
+
/* @__PURE__ */ t(F, { spacing: 10, className: e.headerRight, children: U ?? /* @__PURE__ */ c(O, { children: [
|
|
121
121
|
/* @__PURE__ */ t(te, {}),
|
|
122
122
|
/* @__PURE__ */ t("span", { className: e.walletSlot, children: /* @__PURE__ */ t(ne, {}) }),
|
|
123
123
|
/* @__PURE__ */ t(ae, { personal: h, selectedKey: m && h.items.includes(m) ? m.key : void 0, onOpen: G })
|
|
124
124
|
] }) })
|
|
125
125
|
] }),
|
|
126
126
|
/* @__PURE__ */ c(v, { className: e.body, children: [
|
|
127
|
-
|
|
127
|
+
L ? /* @__PURE__ */ t("aside", { className: e.sider, "data-collapsed": _ ? "true" : "false", children: /* @__PURE__ */ c(
|
|
128
128
|
"div",
|
|
129
129
|
{
|
|
130
130
|
className: e.siderInner,
|
|
@@ -165,7 +165,7 @@ const ce = "_layout_1vz0g_6", ie = "_header_1vz0g_13", de = "_headerLeft_1vz0g_3
|
|
|
165
165
|
{
|
|
166
166
|
mode: "vertical",
|
|
167
167
|
className: e.menuList,
|
|
168
|
-
selectedKeys:
|
|
168
|
+
selectedKeys: T ? [T] : [],
|
|
169
169
|
onSelect: ({ itemKey: s }) => G(String(s)),
|
|
170
170
|
children: n.items.map((s) => /* @__PURE__ */ t(
|
|
171
171
|
$.Item,
|
|
@@ -199,14 +199,14 @@ const ce = "_layout_1vz0g_6", ie = "_header_1vz0g_13", de = "_headerLeft_1vz0g_3
|
|
|
199
199
|
]
|
|
200
200
|
}
|
|
201
201
|
) }) : null,
|
|
202
|
-
N && !i &&
|
|
203
|
-
/* @__PURE__ */ t(v.Content, { className:
|
|
202
|
+
N && !i && L ? /* @__PURE__ */ t("div", { className: e.mask, "aria-hidden": "true", onClick: () => d(!1) }) : null,
|
|
203
|
+
/* @__PURE__ */ t(v.Content, { className: B ? `${e.content} ${e.contentCentered}` : e.content, children: /* @__PURE__ */ t("div", { className: e.contentInner, children: E ?? /* @__PURE__ */ t(D, {}) }) })
|
|
204
204
|
] }),
|
|
205
205
|
K
|
|
206
206
|
] });
|
|
207
207
|
};
|
|
208
208
|
export {
|
|
209
|
-
|
|
209
|
+
je as B,
|
|
210
210
|
Ve as C,
|
|
211
211
|
Ae as a,
|
|
212
212
|
Ee as f,
|