@dimina-kit/devtools 0.4.0-dev.20260711141929 → 0.4.0-dev.20260716163758
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/main/app/app.js +39 -10
- package/dist/main/app/native-overview.d.ts +1 -1
- package/dist/main/index.bundle.js +189 -172
- package/dist/main/services/simulator-appdata/index.js +1 -1
- package/dist/main/services/views/native-simulator-view.d.ts +6 -0
- package/dist/main/services/views/native-simulator-view.js +16 -0
- package/dist/main/services/views/refresh-styles.d.ts +10 -0
- package/dist/main/services/views/refresh-styles.js +57 -0
- package/dist/main/services/views/view-manager.d.ts +26 -1
- package/dist/main/services/views/view-manager.js +7 -0
- package/dist/main/services/views/workbench-view.d.ts +2 -0
- package/dist/main/services/views/workbench-view.js +87 -7
- package/dist/main/services/workspace/open-project-guards.d.ts +16 -0
- package/dist/main/services/workspace/open-project-guards.js +42 -0
- package/dist/main/services/workspace/rebuild-status.d.ts +24 -0
- package/dist/main/services/workspace/rebuild-status.js +20 -0
- package/dist/main/services/workspace/workspace-lifecycle-race.testutil.d.ts +2 -0
- package/dist/main/services/workspace/workspace-lifecycle-race.testutil.js +4 -0
- package/dist/main/services/workspace/workspace-service.js +21 -36
- package/dist/native-host/common/common.js +1 -1
- package/dist/native-host/render/render.js +49 -34
- package/dist/native-host/service/service.js +2 -2
- package/dist/preload/instrumentation/app-data.d.ts +2 -2
- package/dist/preload/instrumentation/app-data.js +1 -1
- package/dist/preload/windows/host-toolbar-runtime.cjs.map +1 -1
- package/dist/preload/windows/main.cjs +96 -0
- package/dist/preload/windows/main.cjs.map +2 -2
- package/dist/preload/windows/simulator.cjs +162 -140
- package/dist/preload/windows/simulator.cjs.map +3 -3
- package/dist/preload/windows/simulator.js +162 -140
- package/dist/render-host/render-inspect.js +15 -47
- package/dist/renderer/assets/index-DQnIsRhp.js +49 -0
- package/dist/renderer/assets/{input-COtRON-n.js → input-7P0WbXyg.js} +2 -2
- package/dist/renderer/assets/ipc-transport-BGtDnv6p.css +1 -0
- package/dist/renderer/assets/{ipc-transport-SuI2rOB_.js → ipc-transport-DTEmLpxx.js} +2 -2
- package/dist/renderer/assets/popover-DsOcyIS6.js +2 -0
- package/dist/renderer/assets/{select-Bwb8O0Mf.js → select-Bzbhbg9Z.js} +2 -2
- package/dist/renderer/assets/{settings-BispnvJU.js → settings-CR1TyBWu.js} +2 -2
- package/dist/renderer/assets/{settings-api-HIBz8BFz.js → settings-api-B1wVFAPB.js} +2 -2
- package/dist/renderer/assets/workbenchSettings-CFbToT4Q.js +8 -0
- package/dist/renderer/entries/main/index.html +6 -6
- package/dist/renderer/entries/popover/index.html +5 -5
- package/dist/renderer/entries/settings/index.html +5 -5
- package/dist/renderer/entries/workbench-settings/index.html +4 -4
- package/dist/shared/ipc-channels.d.ts +1 -0
- package/dist/shared/ipc-channels.js +7 -0
- package/dist/simulator/assets/device-shell-C-HZY3bL.css +1 -0
- package/dist/simulator/assets/device-shell-Cu1ZPLfe.js +2 -0
- package/dist/simulator/assets/{simulator-A1vGZVBM.js → simulator-Cy8c-eA2.js} +5 -5
- package/dist/simulator/simulator.html +1 -1
- package/package.json +7 -7
- package/dist/renderer/assets/index-WbvXdhWQ.js +0 -49
- package/dist/renderer/assets/ipc-transport-CNvORIEX.css +0 -1
- package/dist/renderer/assets/popover-B73T3z-m.js +0 -2
- package/dist/renderer/assets/workbenchSettings-CtRBr7gS.js +0 -8
- package/dist/shared/appdata-accumulator.d.ts +0 -95
- package/dist/shared/appdata-accumulator.js +0 -218
- package/dist/simulator/assets/device-shell-C-wcFq3Z.js +0 -2
- package/dist/simulator/assets/device-shell-CS1rqAQz.css +0 -1
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
<style>
|
|
9
9
|
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: transparent !important; }
|
|
10
10
|
</style>
|
|
11
|
-
<script type="module" crossorigin src="../../assets/popover-
|
|
12
|
-
<link rel="modulepreload" crossorigin href="../../assets/ipc-transport-
|
|
13
|
-
<link rel="modulepreload" crossorigin href="../../assets/input-
|
|
14
|
-
<link rel="modulepreload" crossorigin href="../../assets/select-
|
|
11
|
+
<script type="module" crossorigin src="../../assets/popover-DsOcyIS6.js"></script>
|
|
12
|
+
<link rel="modulepreload" crossorigin href="../../assets/ipc-transport-DTEmLpxx.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="../../assets/input-7P0WbXyg.js">
|
|
14
|
+
<link rel="modulepreload" crossorigin href="../../assets/select-Bzbhbg9Z.js">
|
|
15
15
|
<link rel="modulepreload" crossorigin href="../../assets/constants-EAMiwL9_.js">
|
|
16
|
-
<link rel="stylesheet" crossorigin href="../../assets/ipc-transport-
|
|
16
|
+
<link rel="stylesheet" crossorigin href="../../assets/ipc-transport-BGtDnv6p.css">
|
|
17
17
|
</head>
|
|
18
18
|
<body>
|
|
19
19
|
<div id="root"></div>
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
closes the overlay — mirrors the popover entry. */
|
|
12
12
|
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: transparent !important; }
|
|
13
13
|
</style>
|
|
14
|
-
<script type="module" crossorigin src="../../assets/settings-
|
|
15
|
-
<link rel="modulepreload" crossorigin href="../../assets/ipc-transport-
|
|
16
|
-
<link rel="modulepreload" crossorigin href="../../assets/input-
|
|
17
|
-
<link rel="modulepreload" crossorigin href="../../assets/settings-api-
|
|
18
|
-
<link rel="stylesheet" crossorigin href="../../assets/ipc-transport-
|
|
14
|
+
<script type="module" crossorigin src="../../assets/settings-CR1TyBWu.js"></script>
|
|
15
|
+
<link rel="modulepreload" crossorigin href="../../assets/ipc-transport-DTEmLpxx.js">
|
|
16
|
+
<link rel="modulepreload" crossorigin href="../../assets/input-7P0WbXyg.js">
|
|
17
|
+
<link rel="modulepreload" crossorigin href="../../assets/settings-api-B1wVFAPB.js">
|
|
18
|
+
<link rel="stylesheet" crossorigin href="../../assets/ipc-transport-BGtDnv6p.css">
|
|
19
19
|
</head>
|
|
20
20
|
<body>
|
|
21
21
|
<div id="root"></div>
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
<!-- See entries/main/index.html for CSP rationale. -->
|
|
7
7
|
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: http: https:; font-src 'self' data:; media-src 'self' blob: http: https:; connect-src 'self' http: https: ws: wss:;" />
|
|
8
8
|
<title>开发工具设置</title>
|
|
9
|
-
<script type="module" crossorigin src="../../assets/workbenchSettings-
|
|
10
|
-
<link rel="modulepreload" crossorigin href="../../assets/ipc-transport-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="../../assets/settings-api-
|
|
9
|
+
<script type="module" crossorigin src="../../assets/workbenchSettings-CFbToT4Q.js"></script>
|
|
10
|
+
<link rel="modulepreload" crossorigin href="../../assets/ipc-transport-DTEmLpxx.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="../../assets/settings-api-B1wVFAPB.js">
|
|
12
12
|
<link rel="modulepreload" crossorigin href="../../assets/constants-EAMiwL9_.js">
|
|
13
|
-
<link rel="stylesheet" crossorigin href="../../assets/ipc-transport-
|
|
13
|
+
<link rel="stylesheet" crossorigin href="../../assets/ipc-transport-BGtDnv6p.css">
|
|
14
14
|
</head>
|
|
15
15
|
<body>
|
|
16
16
|
<div id="root"></div>
|
|
@@ -230,6 +230,7 @@ export declare const PopoverChannel: {
|
|
|
230
230
|
};
|
|
231
231
|
export declare const WindowChannel: {
|
|
232
232
|
readonly NavigateBack: "window:navigateBack";
|
|
233
|
+
readonly ScreenState: "window:screenState";
|
|
233
234
|
};
|
|
234
235
|
export declare const AppChannel: {
|
|
235
236
|
readonly GetBranding: "app:getBranding";
|
|
@@ -254,6 +254,13 @@ export const PopoverChannel = {
|
|
|
254
254
|
// ── Window ───────────────────────────────────────────────────────────────
|
|
255
255
|
export const WindowChannel = {
|
|
256
256
|
NavigateBack: 'window:navigateBack',
|
|
257
|
+
// Renderer → main: the renderer's current top-level screen ('project' when
|
|
258
|
+
// inside a project screen, 'list' on the project list / landing). The
|
|
259
|
+
// renderer pushes this on every screen change, including the moment it enters
|
|
260
|
+
// a project — BEFORE the open resolves — so a FAILED open (no session) still
|
|
261
|
+
// leaves main's mirror = 'project'. The window-close decision reads it so
|
|
262
|
+
// closing a stuck/failed project returns to the list instead of quitting.
|
|
263
|
+
ScreenState: 'window:screenState',
|
|
257
264
|
};
|
|
258
265
|
// ── App ──────────────────────────────────────────────────────────────────
|
|
259
266
|
export const AppChannel = {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.menu-capsule{-webkit-backdrop-filter:blur(4px);box-sizing:border-box;pointer-events:none;background:#fff9;border:.5px solid #00000014;border-radius:16px;align-items:center;display:flex;position:absolute;overflow:hidden}.menu-capsule--white{color:#fff;background:#ffffff26;border-color:#fff6}.menu-capsule--black{color:#000;background:#ffffffd9;border-color:#00000014}.menu-capsule__more,.menu-capsule__close{flex:1;justify-content:center;align-items:center;display:flex}.menu-capsule__more{pointer-events:auto;cursor:pointer;gap:3px}.menu-capsule__more span{background:currentColor;border-radius:50%;width:4px;height:4px}.menu-capsule__divider{opacity:.4;background:currentColor;width:.5px;height:16px}.menu-capsule__close svg{color:currentColor}.nav-bar{box-sizing:border-box;flex-direction:column;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,PingFang SC,sans-serif;display:flex;position:relative}.nav-bar--custom{z-index:200;pointer-events:none;position:absolute;top:0;left:0;right:0;background-color:#0000!important}.nav-bar--custom .menu-capsule{pointer-events:auto}.nav-bar__row{align-items:center;padding:0 12px;display:flex;position:relative}.nav-bar__leading{z-index:1;align-items:center;gap:6px;display:flex;position:absolute;top:0;bottom:0;left:8px}.nav-bar__back,.nav-bar__home{cursor:pointer;width:32px;height:32px;color:inherit;background:0 0;border:0;justify-content:center;align-items:center;padding:0;display:flex}.nav-bar__title{flex:1;align-items:center;gap:6px;min-width:0;font-size:17px;font-weight:500;display:flex}.nav-bar__title--center{justify-content:center}.nav-bar__title--left{justify-content:flex-start;padding-left:48px}.nav-bar__title-text{text-overflow:ellipsis;white-space:nowrap;max-width:60%;overflow:hidden}.nav-bar__spinner{border:2px solid;border-right-color:#0000;border-radius:50%;width:14px;height:14px;animation:.8s linear infinite nav-bar-spin}@keyframes nav-bar-spin{to{transform:rotate(360deg)}}.device-statusbar{z-index:300;box-sizing:border-box;pointer-events:none;letter-spacing:.2px;justify-content:space-between;align-items:center;padding:0 28px;font:600 14px/1 -apple-system,BlinkMacSystemFont,SF Pro Text,Segoe UI,sans-serif;display:flex;position:absolute;top:0;left:0;right:0}.device-statusbar__time{font-variant-numeric:tabular-nums}.device-statusbar__notch{background:#000;position:absolute;left:50%;transform:translate(-50%)}.device-statusbar__icons{align-items:center;gap:6px;display:inline-flex}.device-statusbar__signal,.device-statusbar__wifi,.device-statusbar__battery{background:currentColor;display:block}.device-statusbar__signal{width:17px;height:11px;-webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 11'><rect x='0' y='8' width='3' height='3' rx='1'/><rect x='4.5' y='6' width='3' height='5' rx='1'/><rect x='9' y='3' width='3' height='8' rx='1'/><rect x='13.5' y='0' width='3' height='11' rx='1'/></svg>") 50%/contain no-repeat;mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 11'><rect x='0' y='8' width='3' height='3' rx='1'/><rect x='4.5' y='6' width='3' height='5' rx='1'/><rect x='9' y='3' width='3' height='8' rx='1'/><rect x='13.5' y='0' width='3' height='11' rx='1'/></svg>") 50%/contain no-repeat}.device-statusbar__wifi{border-radius:1px;width:16px;height:11px;-webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 11'><path d='M8 2.2c2.3 0 4.4.9 6 2.4l-1.4 1.5C11.4 4.9 9.8 4.2 8 4.2S4.6 4.9 3.4 6.1L2 4.6C3.6 3.1 5.7 2.2 8 2.2zm0 3.5c1.3 0 2.5.5 3.4 1.4L10 8.6c-.5-.5-1.2-.8-2-.8s-1.5.3-2 .8L4.6 7.1C5.5 6.2 6.7 5.7 8 5.7zm0 3.3l1.4 1.4c-.4.4-.9.6-1.4.6s-1-.2-1.4-.6L8 9z'/></svg>") 50%/contain no-repeat;mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 11'><path d='M8 2.2c2.3 0 4.4.9 6 2.4l-1.4 1.5C11.4 4.9 9.8 4.2 8 4.2S4.6 4.9 3.4 6.1L2 4.6C3.6 3.1 5.7 2.2 8 2.2zm0 3.5c1.3 0 2.5.5 3.4 1.4L10 8.6c-.5-.5-1.2-.8-2-.8s-1.5.3-2 .8L4.6 7.1C5.5 6.2 6.7 5.7 8 5.7zm0 3.3l1.4 1.4c-.4.4-.9.6-1.4.6s-1-.2-1.4-.6L8 9z'/></svg>") 50%/contain no-repeat}.device-statusbar__battery{background:0 0;border:1px solid;border-radius:3px;width:25px;height:12px;position:relative}.device-statusbar__battery:before{content:"";background:currentColor;border-radius:1px;position:absolute;inset:2px 8px 2px 2px}.device-statusbar__battery:after{content:"";background:currentColor;border-radius:0 1px 1px 0;width:2px;position:absolute;top:3px;bottom:3px;right:-3px}.dmb-tab-bar{box-sizing:content-box;z-index:9;border-top:1px solid #e0e0e0;flex-shrink:0;justify-content:space-around;align-items:stretch;width:100%;height:50px;display:flex}.dmb-tab-bar__item{cursor:pointer;font:inherit;color:inherit;background:0 0;border:0;outline:none;flex-direction:column;flex:1;justify-content:center;align-items:center;padding:4px 0 2px;display:flex;position:relative}.dmb-tab-bar__item:focus-visible{outline-offset:-2px;outline:2px solid #1890ff}.dmb-tab-bar__icon-slot{justify-content:center;align-items:center;width:24px;height:24px;margin-bottom:2px;display:flex}.dmb-tab-bar__icon{-o-object-fit:contain;object-fit:contain;max-width:100%;max-height:100%}.dmb-tab-bar__text{-webkit-user-select:none;user-select:none;font-size:11px;line-height:1}.dmb-tab-bar__badge{color:#fff;text-align:center;background:#f43f5e;border-radius:8px;min-width:16px;height:16px;padding:0 4px;font-size:10px;line-height:16px;position:absolute;top:0;right:calc(50% - 22px)}.dmb-tab-bar__red-dot{background:#f43f5e;border-radius:50%;width:8px;height:8px;position:absolute;top:4px;right:calc(50% - 16px)}.dmui-publish{z-index:300;pointer-events:auto;background:#fff;flex-direction:column;display:flex;position:absolute;inset:0}.dmui-publish__nav{border-bottom:.5px solid #f2f2f2;flex-shrink:0;align-items:center;height:44px;padding:0 12px;display:flex}.dmui-publish__back{cursor:pointer;color:#333;background:0 0;border:0;flex-shrink:0;justify-content:center;align-items:center;width:32px;height:32px;padding:0;display:flex}.dmui-publish__island-chip{flex:1;justify-content:center;align-items:center;gap:4px;min-width:0;display:flex}.dmui-publish__chip-avatar{-o-object-fit:cover;object-fit:cover;border-radius:4px;flex-shrink:0;width:16px;height:16px}.dmui-publish__chip-avatar--placeholder{background:#e5e7eb}.dmui-publish__chip-name{color:#333;text-overflow:ellipsis;white-space:nowrap;max-width:100px;font:500 14px/1 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;overflow:hidden}.dmui-publish__chip-tag{color:#999;border:.5px solid #ddd;border-radius:2px;flex-shrink:0;padding:1px 4px;font:400 10px/1 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-publish__submit{color:#fff;cursor:pointer;background:#222;border:0;border-radius:14px;flex-shrink:0;height:28px;padding:0 16px;font:500 13px/28px system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-publish__submit--disabled{cursor:default;background:#ccc}.dmui-publish__body{flex:1;padding:16px;overflow-y:auto}.dmui-publish__images{gap:8px;margin-bottom:16px;display:flex;overflow-x:auto}.dmui-publish__image-add{cursor:pointer;background:#fafafa;border:1px dashed #ddd;border-radius:8px;flex-shrink:0;justify-content:center;align-items:center;width:72px;height:72px;display:flex}.dmui-publish__title{color:#333;box-sizing:border-box;border:0;border-bottom:.5px solid #f2f2f2;outline:none;width:100%;padding:12px 0;font:500 16px/1.4 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;display:block}.dmui-publish__title::placeholder{color:#ccc;font-weight:400}.dmui-publish__content{color:#333;resize:none;box-sizing:border-box;border:0;outline:none;width:100%;min-height:180px;padding:12px 0;font:400 15px/1.6 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;display:block}.dmui-publish__content::placeholder{color:#ccc}.dmui-publish__toolbar{border-top:.5px solid #f2f2f2;flex-shrink:0;justify-content:space-between;align-items:center;padding:8px 16px;display:flex}.dmui-publish__count{color:#999;font:400 12px/1 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-publish__privacy{color:#666;cursor:pointer;background:0 0;border:0;padding:4px 8px;font:400 12px/1 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-overlay{z-index:300;pointer-events:none;justify-content:center;align-items:center;display:flex;position:absolute;inset:0}.dmui-mask{pointer-events:auto;background:#00000080;position:absolute;inset:0}.dmui-mask--transparent{background:0 0}.dmui-toast{color:#fff;pointer-events:none;box-sizing:border-box;background:#000000bf;border-radius:10px;flex-direction:column;justify-content:center;align-items:center;gap:12px;min-width:120px;max-width:70%;padding:20px;display:flex;position:relative}.dmui-toast--text{border-radius:8px;min-width:0;padding:12px 18px}.dmui-toast__title{text-align:center;word-break:break-word;font:400 14px/1.4 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-toast__icon{fill:none;stroke:#fff;stroke-width:2.4px;stroke-linecap:round;stroke-linejoin:round;width:40px;height:40px}.dmui-toast__image{-o-object-fit:contain;object-fit:contain;width:40px;height:40px}.dmui-toast__spinner{border:3px solid #ffffff4d;border-top-color:#fff;border-radius:50%;width:36px;height:36px;animation:.8s linear infinite dmui-spin}@keyframes dmui-spin{to{transform:rotate(360deg)}}.dmui-modal{pointer-events:auto;box-sizing:border-box;background:#fff;border-radius:12px;width:280px;max-width:80%;padding-top:24px;position:relative;overflow:hidden}.dmui-modal__title{color:#111827;text-align:center;padding:0 24px;font:600 17px/1.4 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-modal__content{color:#6b7280;text-align:center;max-height:200px;padding:8px 24px 20px;font:400 15px/1.5 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;overflow-y:auto}.dmui-modal__input{box-sizing:border-box;border:1px solid #e5e7eb;border-radius:4px;width:calc(100% - 48px);margin:16px 24px 20px;padding:6px 8px;font-size:15px;display:block}.dmui-modal__actions{border-top:1px solid #e5e7eb;display:flex}.dmui-modal__button{cursor:pointer;background:0 0;border:0;flex:1;padding:14px 0;font:400 17px/1 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-modal__button+.dmui-modal__button{border-left:1px solid #e5e7eb}.dmui-overlay:has(.dmui-action-sheet){align-items:flex-end}.dmui-action-sheet{pointer-events:auto;box-sizing:border-box;width:100%;padding:8px;position:relative}.dmui-action-sheet__items{background:#fff;border-radius:12px;overflow:hidden}.dmui-action-sheet__item{text-align:center;cursor:pointer;background:0 0;border:0;width:100%;padding:16px 0;font:400 17px/1 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;display:block}.dmui-action-sheet__item+.dmui-action-sheet__item{border-top:1px solid #ececec}.dmui-action-sheet__cancel{color:#111827;cursor:pointer;background:#fff;border:0;border-radius:12px;width:100%;margin-top:8px;padding:16px 0;font:600 17px/1 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;display:block}.dmui-overlay:has(.dmui-half-sheet){align-items:flex-end}.dmui-half-sheet{pointer-events:auto;background:#fff;border-radius:12px 12px 0 0;flex-direction:column;width:100%;animation:.3s ease-out dmui-slide-up;display:flex;position:relative}@keyframes dmui-slide-up{0%{transform:translateY(100%)}to{transform:translateY(0)}}.dmui-half-sheet__title{color:#202020;text-align:center;padding:20px 20px 16px;font:400 16px/1.4 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-half-sheet__divider{background:#f2f2f2;height:.5px}.dmui-half-sheet__row{align-items:center;padding:16px 20px;display:flex}.dmui-half-sheet__avatar{-o-object-fit:cover;object-fit:cover;border-radius:8px;flex-shrink:0;width:44px;height:44px}.dmui-half-sheet__info{flex:1;min-width:0;margin-left:12px}.dmui-half-sheet__name{color:#202020;text-overflow:ellipsis;white-space:nowrap;font:500 16px/1.4 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;overflow:hidden}.dmui-half-sheet__members{color:#999;margin-top:4px;font:400 12px/1.4 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-half-sheet__join{color:#fff;cursor:pointer;background:#222;border:0;border-radius:18px;flex-shrink:0;height:36px;padding:0 20px;font:400 14px/36px system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-half-sheet__cancel{color:#999;text-align:center;cursor:pointer;background:0 0;border:0;padding:16px 0;font:400 16px/1 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-overlay:has(.dmui-bottom-sheet){align-items:flex-end}.dmui-bottom-sheet{pointer-events:auto;background:#fff;border-radius:16px 16px 0 0;flex-direction:column;width:100%;animation:.3s ease-out dmui-slide-up;display:flex;position:relative}.dmui-bottom-sheet__title{color:#202020;text-align:center;padding:20px 20px 16px;font:400 16px/1.4 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-bottom-sheet__divider{background:#f2f2f2;height:.5px}.dmui-bottom-sheet__grid{flex-wrap:wrap;gap:16px;padding:16px 20px;display:flex}.dmui-bottom-sheet__grid-item{cursor:pointer;background:0 0;border:0;flex-direction:column;align-items:center;gap:8px;min-width:56px;padding:0;display:flex}.dmui-bottom-sheet__icon-circle{background:#f5f5f5;border-radius:50%;justify-content:center;align-items:center;width:50px;height:50px;font-size:22px;display:flex}.dmui-bottom-sheet__icon-img{width:32px;height:32px}.dmui-bottom-sheet__item-label{color:#333;font:400 12px/1.4 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-bottom-sheet__cancel{color:#999;text-align:center;cursor:pointer;background:0 0;border:0;padding:16px 0;font:400 16px/1 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-capsule-menu__header{align-items:center;padding:20px 20px 16px;display:flex}.dmui-capsule-menu__avatar{-o-object-fit:cover;object-fit:cover;border-radius:10px;flex-shrink:0;width:48px;height:48px}.dmui-capsule-menu__avatar--placeholder{background:#e5e7eb}.dmui-capsule-menu__app-info{flex:1;min-width:0;margin-left:12px}.dmui-capsule-menu__app-name{color:#202020;text-overflow:ellipsis;white-space:nowrap;font:500 16px/1.4 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;overflow:hidden}.dmui-capsule-menu__app-version{color:#999;margin-top:4px;font:400 12px/1.4 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.device-shell-root{color:#101418;box-sizing:border-box;background:#121212;width:100%;height:100vh;padding:24px;display:flex;overflow:auto}@media (prefers-color-scheme:light){.device-shell-root{background:#e8e8e8}}.device-shell{background:#f8fafc;border:1px solid #1014182e;border-radius:38px;flex-direction:column;flex:none;min-height:0;margin:auto;display:flex;position:relative;overflow:hidden;box-shadow:0 18px 50px #10141838}.device-shell__status-bar{letter-spacing:0;color:#111827;background:#f8fafc;flex:0 0 42px;justify-content:space-between;align-items:center;padding:0 28px;font:600 13px/1 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;display:flex}.device-shell__status-icons{align-items:center;gap:5px;display:inline-flex}.device-shell__status-icons span{background:#111827;display:block}.device-shell__status-icons span:first-child{border-radius:2px;width:16px;height:10px}.device-shell__status-icons span:nth-child(2){border-radius:50%;width:12px;height:12px}.device-shell__status-icons span:nth-child(3){border-radius:3px;width:20px;height:10px}.device-shell__viewport{background:#fff;flex:auto;min-height:0;position:relative}.device-shell__webview{background:#fff;border:0;width:100%;height:100%;display:block;position:absolute;inset:0}.device-shell__home-indicator{pointer-events:none;z-index:200;position:absolute;bottom:0;left:0;right:0}.device-shell__home-indicator:before{content:"";background:#111827;border-radius:999px;width:118px;height:4px;position:absolute;bottom:8px;left:50%;transform:translate(-50%)}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e,n as t,t as n}from"./jsx-runtime-BDTY6fEq.js";import{t as r}from"./bridge-channels-zhsumfky.js";var i=e(),a=new Set([`audioListen`]);function o(e){return a.has(e)}function s(e,t,n,r){let i=e.apiRegistry[t];if(!i)return r({ok:!1,errMsg:`${t}:fail no handler`}),Promise.resolve();let a=o(t)||(n&&typeof n==`object`&&!Array.isArray(n)?n.keep===!0:!1);return new Promise(o=>{let s=!1,c=e=>{if(s){a&&e.ok&&r({...e,keep:!0});return}s=!0,r(a&&e.ok?{...e,keep:!0}:e),o()},l=Symbol(`sim-cb-success`),u=Symbol(`sim-cb-fail`),d=Symbol(`sim-cb-complete`),f=!1,p=Object.create(e);p.createCallbackFunction=e=>{if(e!=null)return(e===l||e===u)&&(f=!0),(...n)=>{let r=n[0];e===l?c({ok:!0,result:r}):e===u?c({ok:!1,errMsg:r&&typeof r==`object`&&`errMsg`in r?String(r.errMsg):`${t}:fail`,result:r}):e===d&&!a&&c({ok:!0,result:r})}};let m=n&&typeof n==`object`&&!Array.isArray(n)?{...n}:{};m.success=l,m.fail=u,m.complete=d;try{let e=i.call(p,m);if(e&&typeof e.then==`function`){Promise.resolve(e).then(e=>c({ok:!0,result:e}),e=>{c({ok:!1,errMsg:`${t}:fail ${e instanceof Error?e.message:String(e)}`})});return}if(s)return;if(a){o();return}if(f){o();return}c({ok:!0,result:e})}catch(e){c({ok:!1,errMsg:`${t}:fail ${e instanceof Error?e.message:String(e)}`})}})}var c=n();function l({platform:e,statusBarHeight:t,textStyle:n,onMoreClick:r}){let i=e===`ios`?87:95,a=t+(e===`ios`?4:6),o=e===`ios`?7:10;return(0,c.jsxs)(`div`,{className:`menu-capsule menu-capsule--${n}`,style:{width:i,height:32,top:a,right:o},"aria-hidden":`true`,children:[(0,c.jsxs)(`div`,{className:`menu-capsule__more`,onClick:r,children:[(0,c.jsx)(`span`,{}),(0,c.jsx)(`span`,{}),(0,c.jsx)(`span`,{})]}),(0,c.jsx)(`div`,{className:`menu-capsule__divider`}),(0,c.jsx)(`div`,{className:`menu-capsule__close`,children:(0,c.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`12`,height:`12`,"aria-hidden":`true`,children:(0,c.jsx)(`path`,{d:`M4 4l8 8M12 4l-8 8`,stroke:`currentColor`,strokeWidth:`1.5`,fill:`none`,strokeLinecap:`round`})})})]})}var u={linear:`linear`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`};function d({state:e,stackDepth:t,platform:n,statusBarHeight:r,navBarHeight:a,onBack:o,onHome:s,onMoreClick:d}){let f=(0,i.useMemo)(()=>{if(!e.colorAnimation||e.colorAnimation.durationMs<=0)return;let t=u[e.colorAnimation.timingFunc]??`linear`;return`background-color ${e.colorAnimation.durationMs}ms ${t}, color ${e.colorAnimation.durationMs}ms ${t}`},[e.colorAnimation]),p=e.style===`custom`,m=t>1,h=!m&&e.homeButtonVisible,g=n===`ios`?`center`:`left`,_={backgroundColor:e.backgroundColor,color:e.textStyle===`white`?`#ffffff`:`#000000`,height:r+a,paddingTop:r,transition:f};return(0,c.jsxs)(`header`,{className:`nav-bar nav-bar--${n} nav-bar--${e.textStyle}${p?` nav-bar--custom`:``}`,style:_,"aria-hidden":p,children:[!p&&(0,c.jsxs)(`div`,{className:`nav-bar__row`,style:{height:a,justifyContent:g===`center`?`center`:`flex-start`},children:[(m||h)&&(0,c.jsxs)(`div`,{className:`nav-bar__leading`,children:[m&&(0,c.jsx)(`button`,{type:`button`,className:`nav-bar__back`,"aria-label":`Back`,onClick:o,children:(0,c.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`24`,height:`24`,"aria-hidden":`true`,children:(0,c.jsx)(`path`,{d:`M15 18l-6-6 6-6`,stroke:`currentColor`,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),h&&(0,c.jsx)(`button`,{type:`button`,className:`nav-bar__home`,"aria-label":`Home`,onClick:s,children:(0,c.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`22`,height:`22`,"aria-hidden":`true`,children:(0,c.jsx)(`path`,{d:`M3 12l9-9 9 9M5 10v10h14V10`,stroke:`currentColor`,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`})})})]}),(0,c.jsxs)(`div`,{className:`nav-bar__title nav-bar__title--${g}`,style:{color:e.textStyle===`white`?`#ffffff`:`#000000`},children:[e.loading&&(0,c.jsx)(`span`,{className:`nav-bar__spinner`,"aria-hidden":`true`}),(0,c.jsx)(`span`,{className:`nav-bar__title-text`,children:e.title})]})]}),(0,c.jsx)(l,{platform:n,statusBarHeight:r,textStyle:e.textStyle,onMoreClick:d})]})}function f(e){return{title:e?.title??``,backgroundColor:e?.backgroundColor??`#000000`,textStyle:e?.textStyle??`white`,style:e?.style??`default`,loading:e?.loading??!1,homeButtonVisible:e?.homeButtonVisible??!1,colorAnimation:e?.colorAnimation}}function p(e){switch(e){case`notch`:return{width:164,height:30,top:0,bottomOnly:!0};case`dynamic-island`:return{width:124,height:36,top:11,bottomOnly:!1};default:return null}}function m({height:e,notchType:t,textStyle:n}){let r=p(t);return(0,c.jsxs)(`div`,{className:`device-statusbar`,style:{height:e,color:n===`black`?`#000000`:`#ffffff`},"aria-hidden":`true`,children:[(0,c.jsx)(`span`,{className:`device-statusbar__time`,children:`9:41`}),r&&(0,c.jsx)(`div`,{className:`device-statusbar__notch`,style:{width:r.width,height:r.height,top:r.top,borderRadius:r.bottomOnly?`0 0 ${Math.round(r.height*.6)}px ${Math.round(r.height*.6)}px`:`${r.height/2}px`}}),(0,c.jsxs)(`div`,{className:`device-statusbar__icons`,children:[(0,c.jsx)(`span`,{className:`device-statusbar__signal`}),(0,c.jsx)(`span`,{className:`device-statusbar__wifi`}),(0,c.jsx)(`span`,{className:`device-statusbar__battery`})]})]})}function h({state:e,currentPath:t,resourceBaseUrl:n,appId:r,onSwitch:i,bottomInset:a=0}){if(!e.config||!e.visible)return null;let{color:o,selectedColor:s,backgroundColor:l,borderStyle:u,list:d}=e.config,f=o||`#999999`,p=s||`#1890ff`;return(0,c.jsx)(`div`,{className:`dmb-tab-bar`,style:{backgroundColor:l||`#ffffff`,borderTopColor:u===`white`?`#ffffff`:`#e0e0e0`,paddingBottom:a},role:`tablist`,"aria-label":`TabBar`,children:d.map((a,o)=>{let s=g(a.pagePath),l=s===t,u=_(l?a.selectedIconPath??a.iconPath:a.iconPath,n,r),d=e.badges[o]??``,m=e.redDots[o]??!1;return(0,c.jsxs)(`button`,{type:`button`,className:`dmb-tab-bar__item${l?` is-selected`:``}`,role:`tab`,"aria-selected":l,onClick:()=>i(s),children:[u&&(0,c.jsx)(`span`,{className:`dmb-tab-bar__icon-slot`,children:(0,c.jsx)(`img`,{className:`dmb-tab-bar__icon`,src:u,alt:``,onError:e=>{e.currentTarget.style.display=`none`}})}),(0,c.jsx)(`span`,{className:`dmb-tab-bar__text`,style:{color:l?p:f},children:a.text||``}),d&&(0,c.jsx)(`span`,{className:`dmb-tab-bar__badge`,children:d}),!d&&m&&(0,c.jsx)(`span`,{className:`dmb-tab-bar__red-dot`})]},`${s}-${o}`)})})}function g(e){return e?e.replace(/^\/+/,``):``}function _(e,t,n){if(!e)return null;let r=e.trim();if(!r)return null;if(/^(?:data:|blob:|https?:|\/\/)/i.test(r))return r;if(!t)return null;let i=r.replace(/^\/+/,``).replace(/^\.\//,``);return i.startsWith(`${n}/`)?v(t,i):v(t,`${n}/main/${i}`)}function v(e,t){return`${e.endsWith(`/`)?e:`${e}/`}${t.replace(/^\/+/,``)}`}var y=`data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M23.1221%2013.3855C23.1221%2018.5302%2018.2862%2022.7007%2012.321%2022.7007C10.9486%2022.7007%209.63581%2022.48%208.42807%2022.0774C7.60996%2022.48%204.89408%2023.8264%204.89408%2023.8264C4.89408%2023.8264%205.25692%2022.0774%205.51715%2020.6206C3.07834%2018.9126%201.52002%2016.306%201.52002%2013.3855C1.52002%208.241%206.35572%204.07031%2012.321%204.07031C18.2862%204.07031%2023.1221%208.241%2023.1221%2013.3855Z'%20fill='url(%23paint0_radial_87227_8743)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.2446%2019.4912C12.2446%2023.6844%2016.326%2027.0838%2021.3605%2027.0838C22.5189%2027.0838%2023.6267%2026.9038%2024.646%2026.5756C25.4567%2026.9038%2027.6286%2028.0012%2027.6286%2028.0012C27.6286%2028.0012%2027.3134%2026.3862%2027.103%2025.3882C29.1612%2023.9961%2030.4764%2021.8715%2030.4764%2019.4912C30.4764%2015.2977%2026.3951%2011.8984%2021.3605%2011.8984C16.326%2011.8984%2012.2446%2015.2977%2012.2446%2019.4912Z'%20fill='url(%23paint1_radial_87227_8743)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.45121%208.49023C9.2684%208.49023%209.93086%209.14537%209.93086%209.95365C9.93086%2010.7618%209.2684%2011.4171%208.45121%2011.4171C7.63403%2011.4171%206.97168%2010.7618%206.97168%209.95365C6.97168%209.14537%207.63403%208.49023%208.45121%208.49023Z'%20fill='url(%23paint2_linear_87227_8743)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16.2077%208.49023C17.0247%208.49023%2017.6872%209.14537%2017.6872%209.95365C17.6872%2010.7618%2017.0247%2011.4171%2016.2077%2011.4171C15.3905%2011.4171%2014.728%2010.7618%2014.728%209.95365C14.728%209.14537%2015.3905%208.49023%2016.2077%208.49023Z'%20fill='url(%23paint3_linear_87227_8743)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M19.402%2016.9363C19.402%2017.6636%2018.8059%2018.2533%2018.0704%2018.2533C17.3349%2018.2533%2016.7388%2017.6636%2016.7388%2016.9363C16.7388%2016.2089%2017.3349%2015.6191%2018.0704%2015.6191C18.8059%2015.6191%2019.402%2016.2089%2019.402%2016.9363Z'%20fill='url(%23paint4_linear_87227_8743)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M24.6296%2015.6191C25.3649%2015.6191%2025.9611%2016.2089%2025.9611%2016.9363C25.9611%2017.6636%2025.3649%2018.2533%2024.6296%2018.2533C23.8942%2018.2533%2023.2979%2017.6636%2023.2979%2016.9363C23.2979%2016.2089%2023.8942%2015.6191%2024.6296%2015.6191Z'%20fill='url(%23paint5_linear_87227_8743)'/%3e%3cdefs%3e%3cradialGradient%20id='paint0_radial_87227_8743'%20cx='0'%20cy='0'%20r='1'%20gradientUnits='userSpaceOnUse'%20gradientTransform='translate(12.321%204.07031)%20rotate(90)%20scale(25.1081%2027.4541)'%3e%3cstop%20stop-color='%2395FF00'/%3e%3cstop%20offset='1'%20stop-color='%2369CC15'/%3e%3c/radialGradient%3e%3cradialGradient%20id='paint1_radial_87227_8743'%20cx='0'%20cy='0'%20r='1'%20gradientUnits='userSpaceOnUse'%20gradientTransform='translate(21.3441%2011.8984)%20rotate(90)%20scale(15.2975%2017.2945)'%3e%3cstop%20stop-color='white'/%3e%3cstop%20offset='1'%20stop-color='%23DFEAEB'/%3e%3c/radialGradient%3e%3clinearGradient%20id='paint2_linear_87227_8743'%20x1='6.97168'%20y1='8.49023'%20x2='6.97168'%20y2='11.4171'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%231F9E47'/%3e%3cstop%20offset='1'%20stop-color='%230C7B2F'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_87227_8743'%20x1='14.728'%20y1='8.49023'%20x2='14.728'%20y2='11.4171'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%231F9E47'/%3e%3cstop%20offset='1'%20stop-color='%230C7B2F'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_87227_8743'%20x1='16.7388'%20y1='15.6191'%20x2='16.7388'%20y2='18.2533'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%235C7564'/%3e%3cstop%20offset='1'%20stop-color='%23495E4F'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint5_linear_87227_8743'%20x1='23.2979'%20y1='15.6191'%20x2='23.2979'%20y2='18.2533'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23607B68'/%3e%3cstop%20offset='1'%20stop-color='%23495E4F'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e`,b=`data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16%203C23.1797%203%2029%208.82027%2029%2016C29%2023.1796%2023.1797%2029%2016%2029C8.82027%2029%203%2023.1796%203%2016C3%208.82027%208.82027%203%2016%203ZM16.1243%2011.9418C18.3423%2011.9418%2020.1402%2013.7398%2020.1402%2015.9578C20.1402%2018.1756%2018.3423%2019.9737%2016.1243%2019.9737C13.9064%2019.9737%2012.1084%2018.1756%2012.1084%2015.9578C12.1084%2013.7398%2013.9064%2011.9418%2016.1243%2011.9418Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M27.2082%2011.9995L19%2019.9898L27.3144%2019.9995C27.3144%2019.9995%2028.9256%2016.3089%2027.2082%2011.9995Z'%20fill='%235E9FF1'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M27%2020.9995H15L21.0382%2026.9995C21.0382%2026.9995%2025.0194%2025.4292%2027%2020.9995Z'%20fill='%2367E4EE'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M20%2027.1955L12.0097%2018.9995L12%2027.349C12%2027.349%2015.6906%2028.9102%2020%2027.1955Z'%20fill='%236DEE63'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11%2026.9995V14.9995L5%2021.1662C5%2021.1662%206.63005%2025.0188%2011%2026.9995Z'%20fill='%23BEEE65'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4.81275%2019.9995L13%2012.0092L4.62657%2011.9995C4.62657%2011.9995%203.09985%2015.6901%204.81275%2019.9995Z'%20fill='%23F0DC63'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5%2010.9995H17L10.7953%204.99951C10.7953%204.99951%206.98064%206.62957%205%2010.9995Z'%20fill='%23EDB262'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%204.80358L19.9903%2012.9995L20%204.65008C20%204.65008%2016.3094%203.08878%2012%204.80358Z'%20fill='%23F1775B'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M21%204.99951V16.9995L27%2010.9995C27%2010.9995%2025.4298%206.9801%2021%204.99951Z'%20fill='%236961EC'/%3e%3c/svg%3e`,x=`data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.3485%202.17401C19.7864%200.611917%2017.2537%200.611917%2015.6916%202.17401L11.2336%206.63201L12.6478%208.04622L17.1058%203.58823C17.8869%202.80718%2019.1532%202.80718%2019.9343%203.58823L20.412%204.06598C21.1931%204.84703%2021.1931%206.11336%2020.412%206.89441L14.4202%2012.8863C13.6391%2013.6673%2012.3728%2013.6673%2011.5917%2012.8863L10.7628%2012.0573L9.3486%2013.4715L10.1775%2014.3005C11.7396%2015.8626%2014.2723%2015.8626%2015.8344%2014.3005L21.8262%208.30862C23.3883%206.74652%2023.3883%204.21386%2021.8262%202.65177L21.3485%202.17401ZM2.77902%2021.8258C4.34112%2023.3879%206.87378%2023.3879%208.43588%2021.8258L12.8913%2017.3704L11.4771%2015.9562L7.02166%2020.4116C6.24062%2021.1926%204.97429%2021.1926%204.19324%2020.4116L3.58798%2019.8063C2.80694%2019.0253%202.80694%2017.759%203.58798%2016.9779L9.57583%2010.9901C10.3569%2010.209%2011.6232%2010.209%2012.4043%2010.9901L13.3129%2011.8987L14.7271%2010.4845L13.8185%209.57586C12.2564%208.01376%209.72372%208.01376%208.16162%209.57586L2.17377%2015.5637C0.611673%2017.1258%200.611673%2019.6585%202.17377%2021.2206L2.77902%2021.8258Z'%20fill='%232B263B'/%3e%3c/svg%3e`,S=`data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12%201H11V2V14.5858L5.70719%209.2929L4.29297%2010.7071L11.2223%2017.6365C11.6518%2018.066%2012.3483%2018.066%2012.7779%2017.6365L19.7072%2010.7071L18.293%209.2929L13%2014.5859V2V1H12ZM3.5%2020.5001V16.7501H1.5V20.5001C1.5%2021.6047%202.39543%2022.5001%203.5%2022.5001H20.5C21.6046%2022.5001%2022.5%2021.6047%2022.5%2020.5001V16.7501H20.5V20.5001H3.5Z'%20fill='%232B263B'/%3e%3c/svg%3e`,C=50,w=3e3;function T({dialog:e}){let[t,n]=(0,i.useState)(``),[r,a]=(0,i.useState)(``),[o,s]=(0,i.useState)(!0),l=r.trim().length>0;return(0,c.jsxs)(`div`,{className:`dmui-publish`,children:[(0,c.jsxs)(`div`,{className:`dmui-publish__nav`,children:[(0,c.jsx)(`button`,{type:`button`,className:`dmui-publish__back`,onClick:()=>e.onResult(!1),children:(0,c.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`20`,height:`20`,children:(0,c.jsx)(`path`,{d:`M15 19l-7-7 7-7`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),(0,c.jsxs)(`div`,{className:`dmui-publish__island-chip`,children:[e.islandImage?(0,c.jsx)(`img`,{className:`dmui-publish__chip-avatar`,src:e.islandImage,alt:``}):(0,c.jsx)(`div`,{className:`dmui-publish__chip-avatar dmui-publish__chip-avatar--placeholder`}),(0,c.jsx)(`span`,{className:`dmui-publish__chip-name`,children:e.islandName||`未命名岛`}),(0,c.jsx)(`span`,{className:`dmui-publish__chip-tag`,children:`岛`})]}),(0,c.jsx)(`button`,{type:`button`,className:`dmui-publish__submit${l?``:` dmui-publish__submit--disabled`}`,disabled:!l,onClick:()=>e.onResult(!0),children:`发布`})]}),(0,c.jsxs)(`div`,{className:`dmui-publish__body`,children:[(0,c.jsx)(`div`,{className:`dmui-publish__images`,children:(0,c.jsx)(`div`,{className:`dmui-publish__image-add`,children:(0,c.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`24`,height:`24`,children:(0,c.jsx)(`path`,{d:`M12 5v14M5 12h14`,fill:`none`,stroke:`#999`,strokeWidth:`2`,strokeLinecap:`round`})})})}),(0,c.jsx)(`input`,{className:`dmui-publish__title`,placeholder:`标题 (50字以内)`,value:t,maxLength:C,onChange:e=>n(e.target.value)}),(0,c.jsx)(`textarea`,{className:`dmui-publish__content`,placeholder:`写下你的想法...`,value:r,maxLength:w,onChange:e=>a(e.target.value)})]}),(0,c.jsxs)(`div`,{className:`dmui-publish__toolbar`,children:[(0,c.jsxs)(`span`,{className:`dmui-publish__count`,children:[r.length,`/`,w]}),(0,c.jsx)(`button`,{type:`button`,className:`dmui-publish__privacy`,onClick:()=>s(!o),children:o?`公开`:`私密`})]})]})}function E(){let[{toast:e,dialog:n},r]=(0,i.useState)(()=>t.getState());return(0,i.useEffect)(()=>t.subscribe(r),[]),(0,c.jsxs)(c.Fragment,{children:[e&&(0,c.jsx)(D,{toast:e}),n?.kind===`modal`&&(0,c.jsx)(k,{dialog:n}),n?.kind===`actionSheet`&&(0,c.jsx)(ee,{dialog:n}),n?.kind===`halfSheet`&&(0,c.jsx)(A,{dialog:n}),n?.kind===`capsuleMenu`&&(0,c.jsx)(j,{dialog:n}),n?.kind===`share`&&(0,c.jsx)(N,{dialog:n}),n?.kind===`openPost`&&(0,c.jsx)(T,{dialog:n})]})}function D({toast:e}){(0,i.useEffect)(()=>{if(!Number.isFinite(e.duration))return;let n=window.setTimeout(()=>t.dismissToast(e),e.duration);return()=>window.clearTimeout(n)},[e]);let n=e.icon!==`none`||!!e.image;return(0,c.jsxs)(`div`,{className:`dmui-overlay`,"aria-live":`polite`,children:[e.mask&&(0,c.jsx)(`div`,{className:`dmui-mask dmui-mask--transparent`}),(0,c.jsxs)(`div`,{className:`dmui-toast${n?``:` dmui-toast--text`}`,role:`alert`,children:[e.image?(0,c.jsx)(`img`,{className:`dmui-toast__image`,src:e.image,alt:``}):(0,c.jsx)(O,{icon:e.icon}),e.title&&(0,c.jsx)(`div`,{className:`dmui-toast__title`,children:e.title})]})]})}function O({icon:e}){return e===`success`?(0,c.jsx)(`svg`,{className:`dmui-toast__icon`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,c.jsx)(`path`,{d:`M5 13l4 4L19 7`})}):e===`error`?(0,c.jsx)(`svg`,{className:`dmui-toast__icon`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,c.jsx)(`path`,{d:`M6 6l12 12M18 6L6 18`})}):e===`loading`?(0,c.jsx)(`span`,{className:`dmui-toast__spinner`,"aria-hidden":`true`}):null}function k({dialog:e}){let[t,n]=(0,i.useState)(``),r=(0,i.useRef)(null);return(0,i.useEffect)(()=>{e.editable&&r.current?.focus()},[e.editable]),(0,c.jsxs)(`div`,{className:`dmui-overlay`,children:[(0,c.jsx)(`div`,{className:`dmui-mask`}),(0,c.jsxs)(`div`,{className:`dmui-modal`,role:`dialog`,"aria-modal":`true`,children:[e.title&&(0,c.jsx)(`div`,{className:`dmui-modal__title`,children:e.title}),e.editable?(0,c.jsx)(`input`,{ref:r,className:`dmui-modal__input`,value:t,placeholder:e.placeholderText,onChange:e=>n(e.target.value)}):e.content&&(0,c.jsx)(`div`,{className:`dmui-modal__content`,children:e.content}),(0,c.jsxs)(`div`,{className:`dmui-modal__actions`,children:[e.showCancel&&(0,c.jsx)(`button`,{type:`button`,className:`dmui-modal__button`,style:{color:e.cancelColor},onClick:()=>e.onResult(!1),children:e.cancelText}),(0,c.jsx)(`button`,{type:`button`,className:`dmui-modal__button`,style:{color:e.confirmColor},onClick:()=>e.onResult(!0,t),children:e.confirmText})]})]})]})}function ee({dialog:e}){return(0,c.jsxs)(`div`,{className:`dmui-overlay`,children:[(0,c.jsx)(`div`,{className:`dmui-mask`,onClick:()=>e.onSelect(-1)}),(0,c.jsxs)(`div`,{className:`dmui-action-sheet`,role:`menu`,children:[(0,c.jsx)(`div`,{className:`dmui-action-sheet__items`,children:e.itemList.map((t,n)=>(0,c.jsx)(`button`,{type:`button`,className:`dmui-action-sheet__item`,style:{color:e.itemColor},onClick:()=>e.onSelect(n),children:t},n))}),(0,c.jsx)(`button`,{type:`button`,className:`dmui-action-sheet__cancel`,onClick:()=>e.onSelect(-1),children:`取消`})]})]})}function A({dialog:e}){return(0,c.jsxs)(`div`,{className:`dmui-overlay`,children:[(0,c.jsx)(`div`,{className:`dmui-mask`,onClick:()=>e.onResult(!1)}),(0,c.jsxs)(`div`,{className:`dmui-half-sheet`,role:`dialog`,"aria-modal":`true`,children:[(0,c.jsx)(`div`,{className:`dmui-half-sheet__title`,children:`加入岛即可发布讨论`}),(0,c.jsx)(`div`,{className:`dmui-half-sheet__divider`}),(0,c.jsxs)(`div`,{className:`dmui-half-sheet__row`,children:[e.islandAvatar&&(0,c.jsx)(`img`,{className:`dmui-half-sheet__avatar`,src:e.islandAvatar,alt:``}),(0,c.jsxs)(`div`,{className:`dmui-half-sheet__info`,children:[(0,c.jsx)(`div`,{className:`dmui-half-sheet__name`,children:e.islandName}),(0,c.jsxs)(`div`,{className:`dmui-half-sheet__members`,children:[e.memberCount,`人加入`]})]}),(0,c.jsx)(`button`,{type:`button`,className:`dmui-half-sheet__join`,onClick:()=>e.onResult(!0),children:`加入`})]}),(0,c.jsx)(`div`,{className:`dmui-half-sheet__divider`}),(0,c.jsx)(`button`,{type:`button`,className:`dmui-half-sheet__cancel`,onClick:()=>e.onResult(!1),children:`取消`})]})]})}function j({dialog:e}){return(0,c.jsxs)(`div`,{className:`dmui-overlay`,children:[(0,c.jsx)(`div`,{className:`dmui-mask`,onClick:()=>e.onSelect(-1)}),(0,c.jsxs)(`div`,{className:`dmui-bottom-sheet`,role:`dialog`,"aria-modal":`true`,children:[(0,c.jsxs)(`div`,{className:`dmui-capsule-menu__header`,children:[e.appAvatar?(0,c.jsx)(`img`,{className:`dmui-capsule-menu__avatar`,src:e.appAvatar,alt:``}):(0,c.jsx)(`div`,{className:`dmui-capsule-menu__avatar dmui-capsule-menu__avatar--placeholder`}),(0,c.jsxs)(`div`,{className:`dmui-capsule-menu__app-info`,children:[(0,c.jsx)(`div`,{className:`dmui-capsule-menu__app-name`,children:e.appName}),(0,c.jsxs)(`div`,{className:`dmui-capsule-menu__app-version`,children:[`V`,e.appVersion]})]})]}),(0,c.jsx)(`div`,{className:`dmui-bottom-sheet__divider`}),(0,c.jsx)(`div`,{className:`dmui-bottom-sheet__grid`,children:e.items.map((t,n)=>(0,c.jsxs)(`button`,{type:`button`,className:`dmui-bottom-sheet__grid-item`,onClick:()=>e.onSelect(n),children:[(0,c.jsx)(`div`,{className:`dmui-bottom-sheet__icon-circle`,children:t.icon}),(0,c.jsx)(`div`,{className:`dmui-bottom-sheet__item-label`,children:t.label})]},n))}),(0,c.jsx)(`div`,{className:`dmui-bottom-sheet__divider`}),(0,c.jsx)(`button`,{type:`button`,className:`dmui-bottom-sheet__cancel`,onClick:()=>e.onSelect(-1),children:`取消`})]})]})}var M=[{label:`微信`,icon:y},{label:`朋友圈`,icon:b}];function N({dialog:e}){let t=e.type===`image`?{label:`保存图片`,icon:S}:{label:`复制链接`,icon:x};return(0,c.jsxs)(`div`,{className:`dmui-overlay`,children:[(0,c.jsx)(`div`,{className:`dmui-mask`,onClick:()=>e.onSelect(-1)}),(0,c.jsxs)(`div`,{className:`dmui-bottom-sheet`,role:`dialog`,"aria-modal":`true`,children:[(0,c.jsx)(`div`,{className:`dmui-bottom-sheet__title`,children:`分享到`}),(0,c.jsx)(`div`,{className:`dmui-bottom-sheet__divider`}),(0,c.jsxs)(`div`,{className:`dmui-bottom-sheet__grid`,children:[M.map((t,n)=>(0,c.jsxs)(`button`,{type:`button`,className:`dmui-bottom-sheet__grid-item`,onClick:()=>e.onSelect(n),children:[(0,c.jsx)(`div`,{className:`dmui-bottom-sheet__icon-circle`,children:(0,c.jsx)(`img`,{className:`dmui-bottom-sheet__icon-img`,src:t.icon,alt:t.label})}),(0,c.jsx)(`div`,{className:`dmui-bottom-sheet__item-label`,children:t.label})]},n)),(0,c.jsxs)(`button`,{type:`button`,className:`dmui-bottom-sheet__grid-item`,onClick:()=>e.onSelect(M.length),children:[(0,c.jsx)(`div`,{className:`dmui-bottom-sheet__icon-circle`,children:(0,c.jsx)(`img`,{className:`dmui-bottom-sheet__icon-img`,src:t.icon,alt:t.label})}),(0,c.jsx)(`div`,{className:`dmui-bottom-sheet__item-label`,children:t.label})]})]}),(0,c.jsx)(`div`,{className:`dmui-bottom-sheet__divider`}),(0,c.jsx)(`button`,{type:`button`,className:`dmui-bottom-sheet__cancel`,onClick:()=>e.onSelect(-1),children:`取消`})]})]})}function te(e,n){let r={kind:`capsuleMenu`,appName:n||`小程序`,appAvatar:``,appVersion:`1.0.0`,items:[{label:`复制链接`,icon:`🔗`}],onSelect(n){n===0&&navigator.clipboard.writeText(`https://qiandao.com/miniapp?appId=${e}`),t.hideDialog()}};t.showDialog(r)}function P(e){if(!e)return{config:null,visible:!1,badges:[],redDots:[]};let t=e.list.length;return{config:F(e),visible:!0,badges:Array.from({length:t},()=>``),redDots:Array.from({length:t},()=>!1)}}function F(e){return{...e,list:e.list.map(e=>({...e}))}}function I(e,t){switch(t.kind){case`reset`:return{state:P(t.config),ok:!0,errMsg:`reset:ok`};case`visibility`:return{state:{...e,visible:t.visible},ok:!0,errMsg:t.visible?`showTabBar:ok`:`hideTabBar:ok`};case`apply`:return L(e,t.name,t.params)}}function L(e,t,n){if(!e.config)return{state:e,ok:!1,errMsg:`${t}:fail tabBar not configured`};switch(t){case`setTabBarStyle`:return R(e,n);case`setTabBarItem`:return z(e,n);case`showTabBar`:return{state:{...e,visible:!0},ok:!0,errMsg:`showTabBar:ok`};case`hideTabBar`:return{state:{...e,visible:!1},ok:!0,errMsg:`hideTabBar:ok`};case`setTabBarBadge`:return B(e,n);case`removeTabBarBadge`:return V(e,n);case`showTabBarRedDot`:return H(e,n,!0);case`hideTabBarRedDot`:return H(e,n,!1)}}function R(e,t){if(!e.config)return{state:e,ok:!1,errMsg:`setTabBarStyle:fail tabBar not configured`};let n={...e.config},r=(e,t)=>{let r=W(t);r&&(n[e]=r)};return r(`color`,t.color),r(`selectedColor`,t.selectedColor),r(`backgroundColor`,t.backgroundColor),(t.borderStyle===`black`||t.borderStyle===`white`)&&(n.borderStyle=t.borderStyle),{state:{...e,config:n},ok:!0,errMsg:`setTabBarStyle:ok`}}function z(e,t){let n=U(e,t);if(n.err)return{state:e,ok:!1,errMsg:`setTabBarItem:fail ${n.err}`};if(!e.config)return{state:e,ok:!1,errMsg:`setTabBarItem:fail tabBar not configured`};let r=e.config.list[n.index],i={...r,text:typeof t.text==`string`?t.text:r.text,iconPath:typeof t.iconPath==`string`?t.iconPath:r.iconPath,selectedIconPath:typeof t.selectedIconPath==`string`?t.selectedIconPath:r.selectedIconPath},a=[...e.config.list];return a[n.index]=i,{state:{...e,config:{...e.config,list:a}},ok:!0,errMsg:`setTabBarItem:ok`}}function B(e,t){let n=U(e,t);if(n.err)return{state:e,ok:!1,errMsg:`setTabBarBadge:fail ${n.err}`};let r=[...e.badges];r[n.index]=String(t.text??``);let i=[...e.redDots];return i[n.index]=!1,{state:{...e,badges:r,redDots:i},ok:!0,errMsg:`setTabBarBadge:ok`}}function V(e,t){let n=U(e,t);if(n.err)return{state:e,ok:!1,errMsg:`removeTabBarBadge:fail ${n.err}`};let r=[...e.badges];return r[n.index]=``,{state:{...e,badges:r},ok:!0,errMsg:`removeTabBarBadge:ok`}}function H(e,t,n){let r=U(e,t);if(r.err)return{state:e,ok:!1,errMsg:`${n?`showTabBarRedDot`:`hideTabBarRedDot`}:fail ${r.err}`};let i=[...e.redDots];i[r.index]=n;let a=[...e.badges];return n&&(a[r.index]=``),{state:{...e,redDots:i,badges:a},ok:!0,errMsg:`${n?`showTabBarRedDot`:`hideTabBarRedDot`}:ok`}}function U(e,t){let n=e.config?.list??[],r=t.index,i=Number(r);return n.length?r==null||!Number.isInteger(i)||i<0||i>=n.length?{index:-1,err:`invalid index ${r}`}:{index:i,err:null}:{index:-1,err:`tabBar not configured`}}function W(e){if(typeof e!=`string`)return null;let t=e.trim();return!t||t.length>64?null:/[<>"';{}()\\]/.test(t)?/^(?:rgb|rgba|hsl|hsla)\(\s*[\d.,%\s/-]+\)$/i.test(t)?t:null:t}function G(e){return e?e.replace(/^\/+/,``):``}function K(e){if(!e)return null;let t=e.indexOf(`=`),n=t>=0?e.slice(0,t):e,r=t>=0?e.slice(t+1):``;return n?[decodeURIComponent(n),decodeURIComponent(r)]:null}function q(e){let t={};for(let n of e.split(`&`)){let e=K(n);e&&(t[e[0]]=e[1])}return t}function J(e){let[t,n]=(typeof e==`string`?e:``).split(`?`);return{pagePath:G(t),query:n?q(n):{}}}function Y(e){let t={};return e.isTab&&(t[e.pagePath]=[e]),{stack:[e],tabStacks:t,currentTabPath:e.isTab?e.pagePath:null}}function X(e){return e.currentTabPath?{...e.tabStacks,[e.currentTabPath]:[...e.stack]}:e.tabStacks}function ne(e,t){let n=e.stack[e.stack.length-1],r=[...e.stack,t];return{next:{...e,stack:r,tabStacks:e.currentTabPath?{...e.tabStacks,[e.currentTabPath]:r}:e.tabStacks},effects:n?[{kind:`lifecycle`,bridgeId:n.bridgeId,event:`pageHide`}]:[]}}function Z(e,t){if(e.stack.length<=1)return{error:`no page to back`};let n=Math.min(Math.max(1,Number.isFinite(t)?t:1),e.stack.length-1),r=e.stack.slice(e.stack.length-n),i=e.stack.slice(0,e.stack.length-n),a=i[i.length-1],o={...e,stack:i,tabStacks:e.currentTabPath?{...e.tabStacks,[e.currentTabPath]:i}:e.tabStacks,currentTabPath:a.isTab?a.pagePath:e.currentTabPath},s=[];for(let e of r)s.push({kind:`lifecycle`,bridgeId:e.bridgeId,event:`pageUnload`}),s.push({kind:`closePage`,bridgeId:e.bridgeId});return s.push({kind:`lifecycle`,bridgeId:a.bridgeId,event:`pageShow`}),{next:o,effects:s}}function re(e,t){let n=e.stack[e.stack.length-1],r=[...e.stack.slice(0,e.stack.length-1),t],i={...e,stack:r,tabStacks:e.currentTabPath?{...e.tabStacks,[e.currentTabPath]:r}:e.tabStacks},a=[];return n&&(a.push({kind:`lifecycle`,bridgeId:n.bridgeId,event:`pageUnload`}),a.push({kind:`closePage`,bridgeId:n.bridgeId})),{next:i,effects:a}}function ie(e,t){let n=new Set;for(let t of e.stack)n.add(t.bridgeId);for(let t of Object.values(e.tabStacks))for(let e of t)n.add(e.bridgeId);n.delete(t.bridgeId);let r=t.isTab?{[t.pagePath]:[t]}:{},i={stack:[t],tabStacks:r,currentTabPath:t.isTab?t.pagePath:null},a=[];for(let e of n)a.push({kind:`lifecycle`,bridgeId:e,event:`pageUnload`}),a.push({kind:`closePage`,bridgeId:e});return{next:i,effects:a}}function ae(e,t,n){let r=e.stack[e.stack.length-1],i=X(e),a,o=i[t];if(o&&o.length>0)a=o;else if(n)a=[n];else throw Error(`[page-stack] switchTab to ${t} requires either a cached substack or a freshly-opened entry`);let s={...e,stack:a,tabStacks:{...i,[t]:a},currentTabPath:t},c=a[a.length-1],l=[];return r&&r.bridgeId!==c.bridgeId&&l.push({kind:`lifecycle`,bridgeId:r.bridgeId,event:`pageHide`}),n||l.push({kind:`lifecycle`,bridgeId:c.bridgeId,event:`pageShow`}),{next:s,effects:l}}function oe(e){let t=new Map,n=e.stack[e.stack.length-1]?.bridgeId,r=e=>{t.has(e.bridgeId)||t.set(e.bridgeId,{entry:e,visible:e.bridgeId===n})};for(let t of Object.values(e.tabStacks))for(let e of t)r(e);for(let t of e.stack)r(t);return Array.from(t.values())}function Q(e,t){let n=e.navigationBarBackgroundColor??`#ffffff`,r=e.navigationBarTextStyle??`black`,i=e.navigationStyle??`default`;return f({title:e.navigationBarTitleText??t,backgroundColor:n,textStyle:r,style:i,homeButtonVisible:e.homeButton===!0})}function se(e,t,n){switch(t){case`setNavigationBarTitle`:return{...e,title:typeof n.title==`string`?n.title:e.title};case`setNavigationBarColor`:return le(e,n);case`showNavigationBarLoading`:return{...e,loading:!0};case`hideNavigationBarLoading`:return{...e,loading:!1};case`hideHomeButton`:return{...e,homeButtonVisible:!1};default:return e}}var ce=[`linear`,`easeIn`,`easeOut`,`easeInOut`];function le(e,t){let n=typeof t.frontColor==`string`?t.frontColor.toLowerCase():void 0,r=n===`#ffffff`?`white`:n===`#000000`?`black`:e.textStyle,i=typeof t.backgroundColor==`string`?t.backgroundColor:e.backgroundColor,a=(()=>{let e=t.animation;if(!e||typeof e!=`object`)return;let n=e,r=typeof n.duration==`number`&&Number.isFinite(n.duration)?Math.max(0,n.duration):0,i=typeof n.timingFunc==`string`?n.timingFunc:`linear`;return{durationMs:r,timingFunc:ce.includes(i)?i:`linear`}})();return{...e,textStyle:r,backgroundColor:i,colorAnimation:a}}function ue(e,t,n){let r=e=>e.bridgeId===t?{...e,navBar:n(e.navBar)}:e,i=e.stack.map(r),a={};for(let[t,n]of Object.entries(e.tabStacks))a[t]=n.map(r);return{...e,stack:i,tabStacks:a}}var de=44,fe=24,pe=44;function $({miniApp:e,bridgeId:t,platform:n=`ios`}){let[a,o]=(0,i.useState)(()=>e.getInitialDevice());(0,i.useEffect)(()=>e.onSimulatorEvent(r.DEVICE_CHANGE,o),[e]);let l=a?.safeAreaInsets.top??(n===`ios`?de:fe),u=a?.safeAreaInsets.bottom??0,f=a?.notchType??`none`,p=(0,i.useMemo)(()=>e.getRenderPreloadUrl(),[e]),g=(0,i.useMemo)(()=>e.getTabBarConfig(),[e]),_=(0,i.useMemo)(()=>({bridgeId:t,pagePath:G(e.pagePath),query:{...e.query},isTab:!!e.getTabBarConfig()?.list.some(t=>G(t.pagePath)===G(e.pagePath)),windowConfig:e.rootWindowConfig??{},navBar:Q(e.rootWindowConfig??{},e.appId)}),[e,t]),[{shell:v,tabBar:y},b]=(0,i.useState)(()=>({shell:Y(_),tabBar:P(g)})),x=(0,i.useRef)({shell:v,tabBar:y});(0,i.useEffect)(()=>{x.current={shell:v,tabBar:y}},[v,y]);let S=(0,i.useCallback)(t=>{for(let n of t)n.kind===`lifecycle`?e.notifyLifecycle(n.bridgeId,n.event):n.kind===`closePage`&&e.closePage(n.bridgeId)},[e]);(0,i.useEffect)(()=>e.onSimulatorEvent(r.NAV_BAR,e=>{b(t=>({...t,shell:ue(t.shell,e.bridgeId,t=>se(t,e.name,e.params))}))}),[e]),(0,i.useEffect)(()=>e.onSessionEvent(r.TAB_ACTION,t=>{let n=I(x.current.tabBar,{kind:`apply`,name:t.name,params:t.params});b(e=>({...e,tabBar:n.state})),e.notifyNavCallback({ok:n.ok,errMsg:n.errMsg,callbacks:t.callbacks})}),[e]);let C=(0,i.useCallback)(async t=>{let n=(n,r)=>e.notifyNavCallback({ok:n,errMsg:r,callbacks:t.callbacks});try{switch(t.name){case`navigateTo`:await me(e,x,b,S,t,n);break;case`navigateBack`:he(x,b,S,t,n);break;case`redirectTo`:await ge(e,x,b,S,t,n);break;case`reLaunch`:await _e(e,x,b,S,t,n);break;case`switchTab`:await ve(e,x,b,S,t,n);break}}catch(e){n(!1,`${t.name}:fail ${e instanceof Error?e.message:String(e)}`)}},[e,S]);(0,i.useEffect)(()=>e.onSessionEvent(r.NAV_ACTION,e=>{C(e)}),[C,e]),(0,i.useEffect)(()=>e.onSessionEvent(r.API_CALL,t=>{s(e,t.name,t.params,n=>{e.notifyApiResponse({requestId:t.requestId,ok:n.ok,result:n.result,errMsg:n.errMsg,keep:n.keep})})}),[e]);let w=(0,i.useCallback)(()=>{if(x.current.shell.stack.length<=1)return;let t=x.current.shell.stack;C({appSessionId:e.appSessionId??``,bridgeId:t[t.length-1].bridgeId,name:`navigateBack`,params:{delta:1},callbacks:{}})},[e,C]),T=(0,i.useCallback)(t=>{let n=x.current.shell;t===n.currentTabPath&&n.stack.length===1||C({appSessionId:e.appSessionId??``,bridgeId:n.stack[n.stack.length-1].bridgeId,name:`switchTab`,params:{url:`/${t}`},callbacks:{}})},[e,C]),D=(0,i.useCallback)(()=>{let t=x.current.shell.stack;te(e.appId,t[t.length-1].navBar.title)},[e]),O=v.stack[v.stack.length-1],k=oe(v);return(0,i.useEffect)(()=>{e.notifyActivePage(O.bridgeId)},[e,O.bridgeId]),(0,i.useEffect)(()=>{e.notifyPageStack(v.stack.map(e=>({pagePath:e.pagePath,query:e.query})))},[e,v.stack]),(0,c.jsx)(`main`,{className:`device-shell-root`,children:(0,c.jsxs)(`section`,{className:`device-shell`,"aria-label":`Dimina simulator`,style:a?{width:a.screenWidth,height:a.screenHeight}:void 0,children:[(0,c.jsx)(m,{height:l,notchType:f,textStyle:O.navBar.textStyle}),(0,c.jsx)(d,{state:O.navBar,stackDepth:v.stack.length,platform:n,statusBarHeight:l,navBarHeight:pe,onBack:w,onMoreClick:D}),(0,c.jsx)(`div`,{className:`device-shell__viewport`,children:k.map(({entry:t,visible:n})=>(0,c.jsx)(`webview`,{className:`device-shell__webview`,src:e.createRenderHostUrl(t.bridgeId,t.pagePath,t.isTab),preload:p,allowpopups:`true`,style:{display:n?`flex`:`none`,zIndex:n?100:1}},t.bridgeId))}),O.isTab&&(0,c.jsx)(h,{state:y,currentPath:v.currentTabPath,resourceBaseUrl:e.resourceBaseUrl,appId:e.appId,onSwitch:T,bottomInset:u}),(0,c.jsx)(E,{}),u>0&&(0,c.jsx)(`div`,{className:`device-shell__home-indicator`,style:{height:u},"aria-hidden":`true`})]})})}async function me(e,t,n,r,i,a){let{pagePath:o,query:s}=J(i.params.url);if(!o){a(!1,`navigateTo:fail invalid url`);return}if(e.getTabBarConfig()?.list.some(e=>G(e.pagePath)===o)){a(!1,`navigateTo:fail can not navigateTo a tabbar page`);return}let c=await e.openPage(o,s),l={bridgeId:c.bridgeId,pagePath:c.pagePath,query:s,isTab:c.isTab,windowConfig:c.windowConfig,navBar:Q(c.windowConfig,e.appId)},{next:u,effects:d}=ne(t.current.shell,l);n(e=>({...e,shell:u})),r(d),a(!0,`navigateTo:ok`)}function he(e,t,n,r,i){let a=r.params.delta,o=Number.isFinite(Number(a))?Number(a):1,s=Z(e.current.shell,o);if(`error`in s){i(!1,`navigateBack:fail ${s.error}`);return}t(e=>({...e,shell:s.next})),n(s.effects),i(!0,`navigateBack:ok`)}async function ge(e,t,n,r,i,a){let{pagePath:o,query:s}=J(i.params.url);if(!o){a(!1,`redirectTo:fail invalid url`);return}if(e.getTabBarConfig()?.list.some(e=>G(e.pagePath)===o)){a(!1,`redirectTo:fail can not redirectTo a tabbar page`);return}let c=await e.openPage(o,s),l={bridgeId:c.bridgeId,pagePath:c.pagePath,query:s,isTab:c.isTab,windowConfig:c.windowConfig,navBar:Q(c.windowConfig,e.appId)},{next:u,effects:d}=re(t.current.shell,l);n(e=>({...e,shell:u})),r(d),a(!0,`redirectTo:ok`)}async function _e(e,t,n,r,i,a){let{pagePath:o,query:s}=J(i.params.url);if(!o){a(!1,`reLaunch:fail invalid url`);return}let c=await e.openPage(o,s),l={bridgeId:c.bridgeId,pagePath:c.pagePath,query:s,isTab:c.isTab,windowConfig:c.windowConfig,navBar:Q(c.windowConfig,e.appId)},{next:u,effects:d}=ie(t.current.shell,l);n(e=>({...e,shell:u})),r(d),a(!0,`reLaunch:ok`)}async function ve(e,t,n,r,i,a){let{pagePath:o}=J(i.params.url);if(!o){a(!1,`switchTab:fail invalid url`);return}if(!e.getTabBarConfig()?.list.some(e=>G(e.pagePath)===o)){a(!1,`switchTab:fail not a tabBar page: ${o}`);return}let s=t.current.shell.tabStacks[o],c=null;if(!s||s.length===0){let t=await e.openPage(o,{});c={bridgeId:t.bridgeId,pagePath:t.pagePath,query:{},isTab:!0,windowConfig:t.windowConfig,navBar:Q(t.windowConfig,e.appId)}}let{next:l,effects:u}=ae(t.current.shell,o,c);n(e=>({...e,shell:l})),r(u),a(!0,`switchTab:ok`)}export{$ as DeviceShell};
|
|
2
|
+
//# sourceMappingURL=device-shell-Cu1ZPLfe.js.map
|