@michengai/dsh-codex-ui 1.1.16 → 1.1.17
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 +26 -0
- package/CHANGELOG.zh-CN.md +26 -0
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/lib/client.js +150 -327
- package/lib/index.mjs +3 -57
- package/lib/session-title-plugin.mjs +0 -14
- package/package.json +44 -39
- package/assets/usage-frame.html +0 -1
- package/lib/usage-frame.css +0 -1
- package/lib/usage-frame.js +0 -496
package/lib/client.js
CHANGED
|
@@ -4,9 +4,32 @@ window.__ModuleLoader__.load({
|
|
|
4
4
|
var module = { exports: {} };
|
|
5
5
|
var exports = module.exports;
|
|
6
6
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
|
+
//#region \0rolldown/runtime.js
|
|
8
|
+
var __create = Object.create;
|
|
9
|
+
var __defProp = Object.defineProperty;
|
|
10
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
11
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
12
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
16
|
+
key = keys[i];
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
18
|
+
get: ((k) => from[k]).bind(null, key),
|
|
19
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
25
|
+
value: mod,
|
|
26
|
+
enumerable: true
|
|
27
|
+
}) : target, mod));
|
|
28
|
+
//#endregion
|
|
7
29
|
let react = require("react");
|
|
8
30
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
31
|
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
32
|
+
_deepseek_ai_dsh_client_ui_primitives = __toESM(_deepseek_ai_dsh_client_ui_primitives, 1);
|
|
10
33
|
let react_dom = require("react-dom");
|
|
11
34
|
//#region src/client/session-host.ts
|
|
12
35
|
var UnknownSessionError = class extends Error {
|
|
@@ -412,30 +435,6 @@ window.__ModuleLoader__.load({
|
|
|
412
435
|
* This source code is licensed under the ISC license.
|
|
413
436
|
* See the LICENSE file in the root directory of this source tree.
|
|
414
437
|
*/
|
|
415
|
-
const ChartColumn = createLucideIcon("chart-column", [
|
|
416
|
-
["path", {
|
|
417
|
-
d: "M3 3v16a2 2 0 0 0 2 2h16",
|
|
418
|
-
key: "c24i48"
|
|
419
|
-
}],
|
|
420
|
-
["path", {
|
|
421
|
-
d: "M18 17V9",
|
|
422
|
-
key: "2bz60n"
|
|
423
|
-
}],
|
|
424
|
-
["path", {
|
|
425
|
-
d: "M13 17V5",
|
|
426
|
-
key: "1frdt8"
|
|
427
|
-
}],
|
|
428
|
-
["path", {
|
|
429
|
-
d: "M8 17v-3",
|
|
430
|
-
key: "17ska0"
|
|
431
|
-
}]
|
|
432
|
-
]);
|
|
433
|
-
/**
|
|
434
|
-
* @license lucide-react v1.39.0 - ISC
|
|
435
|
-
*
|
|
436
|
-
* This source code is licensed under the ISC license.
|
|
437
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
438
|
-
*/
|
|
439
438
|
const CircleQuestionMark = createLucideIcon("circle-question-mark", [
|
|
440
439
|
["circle", {
|
|
441
440
|
cx: "12",
|
|
@@ -1158,6 +1157,45 @@ window.__ModuleLoader__.load({
|
|
|
1158
1157
|
} catch {}
|
|
1159
1158
|
}
|
|
1160
1159
|
//#endregion
|
|
1160
|
+
//#region src/client/host-icons.ts
|
|
1161
|
+
/**
|
|
1162
|
+
* 优先使用 0.1.7 的 Medium 导出名,0.1.5 只有旧尺寸名时回退。
|
|
1163
|
+
* 必须动态读取,不能写成静态属性访问,否则旧宿主一加载客户端就会拿到 undefined。
|
|
1164
|
+
*/
|
|
1165
|
+
function resolveHostIcon(icons, modern, legacy) {
|
|
1166
|
+
const icon = icons[modern] ?? icons[legacy];
|
|
1167
|
+
if (!icon) throw new Error(`宿主缺少图标 ${modern}`);
|
|
1168
|
+
return icon;
|
|
1169
|
+
}
|
|
1170
|
+
function hostIcon(modern, legacy) {
|
|
1171
|
+
return resolveHostIcon(_deepseek_ai_dsh_client_ui_primitives, modern, legacy);
|
|
1172
|
+
}
|
|
1173
|
+
const IconArchiveOutlineMedium = hostIcon("IconArchiveOutlineMedium", "IconArchiveOutline20");
|
|
1174
|
+
const IconBranchOutlineMedium = hostIcon("IconBranchOutlineMedium", "IconBranchOutline16");
|
|
1175
|
+
const IconCheckOutlineMedium = hostIcon("IconCheckOutlineMedium", "IconCheckOutline16");
|
|
1176
|
+
hostIcon("IconChevronDownOutlineMedium", "IconChevronDownOutline14");
|
|
1177
|
+
const IconChevronRightOutlineMedium = hostIcon("IconChevronRightOutlineMedium", "IconChevronRightOutline14");
|
|
1178
|
+
const IconCopyOutlineMedium = hostIcon("IconCopyOutlineMedium", "IconCopyOutline16");
|
|
1179
|
+
const IconDownloadOutlineMedium = hostIcon("IconDownloadOutlineMedium", "IconDownloadOutline16");
|
|
1180
|
+
const IconEditOutlineMedium = hostIcon("IconEditOutlineMedium", "IconEditOutline16");
|
|
1181
|
+
const IconEllipsisOutlineMedium = hostIcon("IconEllipsisOutlineMedium", "IconEllipsisOutline16");
|
|
1182
|
+
const IconEnhanceOutlineMedium = hostIcon("IconEnhanceOutlineMedium", "IconEnhanceOutline16");
|
|
1183
|
+
const IconFolderCloseMedium = hostIcon("IconFolderCloseMedium", "IconFolderClose16");
|
|
1184
|
+
const IconFolderOpenMedium = hostIcon("IconFolderOpenMedium", "IconFolderOpen16");
|
|
1185
|
+
const IconFolderOpenOutlineMedium = hostIcon("IconFolderOpenOutlineMedium", "IconFolderOpenOutline16");
|
|
1186
|
+
const IconLinkOutlineMedium = hostIcon("IconLinkOutlineMedium", "IconLinkOutline16");
|
|
1187
|
+
const IconListPenOutlineMedium = hostIcon("IconListPenOutlineMedium", "IconListPenOutline16");
|
|
1188
|
+
const IconLoadingOutlineMedium = hostIcon("IconLoadingOutlineMedium", "IconLoadingOutline16");
|
|
1189
|
+
const IconNewChatOutlineMedium = hostIcon("IconNewChatOutlineMedium", "IconNewChatOutline16");
|
|
1190
|
+
const IconPanelLeftOutlineMedium = hostIcon("IconPanelLeftOutlineMedium", "IconPanelLeftOutline16");
|
|
1191
|
+
const IconPersonalizationOutlineMedium = hostIcon("IconPersonalizationOutlineMedium", "IconPersonalizationOutline16");
|
|
1192
|
+
const IconProjectAddOutlineMedium = hostIcon("IconProjectAddOutlineMedium", "IconProjectAddOutline16");
|
|
1193
|
+
const IconSearchOutlineMedium = hostIcon("IconSearchOutlineMedium", "IconSearchOutline16");
|
|
1194
|
+
const IconSettingsOutlineMedium = hostIcon("IconSettingsOutlineMedium", "IconSettingsOutline16");
|
|
1195
|
+
const IconSkillOutlineMedium = hostIcon("IconSkillOutlineMedium", "IconSkillOutline16");
|
|
1196
|
+
const IconTrashOutlineMedium = hostIcon("IconTrashOutlineMedium", "IconTrashOutline16");
|
|
1197
|
+
const IconUserOutlineMedium = hostIcon("IconUserOutlineMedium", "IconUserOutline16");
|
|
1198
|
+
//#endregion
|
|
1161
1199
|
//#region src/client/sidebar-search.ts
|
|
1162
1200
|
/** 按用户可见名称和辅助关键词筛选侧栏搜索结果。 */
|
|
1163
1201
|
function filterSidebarSearchItems(items, query) {
|
|
@@ -1463,14 +1501,14 @@ window.__ModuleLoader__.load({
|
|
|
1463
1501
|
className: "dcu-wb-tip-row",
|
|
1464
1502
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1465
1503
|
className: "dcu-wb-folder",
|
|
1466
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1504
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconFolderCloseMedium, { size: 16 })
|
|
1467
1505
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: tip.project })]
|
|
1468
1506
|
}),
|
|
1469
1507
|
tip.branch !== void 0 && tip.branch !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1470
1508
|
className: "dcu-wb-tip-row",
|
|
1471
1509
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1472
1510
|
className: "dcu-wb-folder",
|
|
1473
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1511
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconBranchOutlineMedium, { size: 16 })
|
|
1474
1512
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: tip.branch })]
|
|
1475
1513
|
})
|
|
1476
1514
|
]
|
|
@@ -1481,7 +1519,7 @@ window.__ModuleLoader__.load({
|
|
|
1481
1519
|
{
|
|
1482
1520
|
id: "rename",
|
|
1483
1521
|
label: t("sessions.rename"),
|
|
1484
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1522
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconEditOutlineMedium, { size: 16 })
|
|
1485
1523
|
},
|
|
1486
1524
|
{
|
|
1487
1525
|
id: "unread",
|
|
@@ -1499,7 +1537,7 @@ window.__ModuleLoader__.load({
|
|
|
1499
1537
|
{
|
|
1500
1538
|
id: "archive",
|
|
1501
1539
|
label: t("sessions.archive"),
|
|
1502
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1540
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconArchiveOutlineMedium, { size: 16 })
|
|
1503
1541
|
},
|
|
1504
1542
|
{
|
|
1505
1543
|
type: "separator",
|
|
@@ -1508,24 +1546,24 @@ window.__ModuleLoader__.load({
|
|
|
1508
1546
|
{
|
|
1509
1547
|
id: "fork",
|
|
1510
1548
|
label: t("sessions.fork"),
|
|
1511
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1549
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconBranchOutlineMedium, { size: 16 })
|
|
1512
1550
|
}
|
|
1513
1551
|
];
|
|
1514
1552
|
if (options.includePath === true) items.push({
|
|
1515
1553
|
id: "openPath",
|
|
1516
1554
|
label: t("sessions.openPath"),
|
|
1517
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1555
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconFolderOpenOutlineMedium, { size: 16 }),
|
|
1518
1556
|
disabled: options.path === void 0
|
|
1519
1557
|
});
|
|
1520
1558
|
if (options.moveTargets !== void 0) items.push({
|
|
1521
1559
|
id: "moveWorkspace",
|
|
1522
1560
|
label: t("sessions.moveWorkspace"),
|
|
1523
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1561
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconFolderCloseMedium, { size: 16 }),
|
|
1524
1562
|
disabled: options.moveTargets.length === 0,
|
|
1525
1563
|
submenu: options.moveTargets.map((target) => ({
|
|
1526
1564
|
id: target.id,
|
|
1527
1565
|
label: target.label,
|
|
1528
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1566
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconFolderCloseMedium, { size: 16 })
|
|
1529
1567
|
}))
|
|
1530
1568
|
});
|
|
1531
1569
|
items.push({
|
|
@@ -1534,15 +1572,15 @@ window.__ModuleLoader__.load({
|
|
|
1534
1572
|
}, {
|
|
1535
1573
|
id: "copyId",
|
|
1536
1574
|
label: t("sessions.copyId"),
|
|
1537
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1575
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconLinkOutlineMedium, { size: 16 })
|
|
1538
1576
|
}, {
|
|
1539
1577
|
id: "copyTitle",
|
|
1540
1578
|
label: t("sessions.copyTitle"),
|
|
1541
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1579
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCopyOutlineMedium, { size: 16 })
|
|
1542
1580
|
}, ...options.includePath === true ? [{
|
|
1543
1581
|
id: "copyPath",
|
|
1544
1582
|
label: t("sessions.copyPath"),
|
|
1545
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1583
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCopyOutlineMedium, { size: 16 }),
|
|
1546
1584
|
disabled: options.path === void 0
|
|
1547
1585
|
}] : []);
|
|
1548
1586
|
if (options.canDelete !== false) items.push({
|
|
@@ -1551,7 +1589,7 @@ window.__ModuleLoader__.load({
|
|
|
1551
1589
|
}, {
|
|
1552
1590
|
id: "delete",
|
|
1553
1591
|
label: t("sessions.delete"),
|
|
1554
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1592
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconTrashOutlineMedium, { size: 16 }),
|
|
1555
1593
|
danger: true
|
|
1556
1594
|
});
|
|
1557
1595
|
return items;
|
|
@@ -1709,7 +1747,7 @@ window.__ModuleLoader__.load({
|
|
|
1709
1747
|
event.stopPropagation();
|
|
1710
1748
|
onMenuChange(!menuOpen);
|
|
1711
1749
|
},
|
|
1712
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
1750
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconEllipsisOutlineMedium, { size: 16 })
|
|
1713
1751
|
})
|
|
1714
1752
|
})
|
|
1715
1753
|
})
|
|
@@ -2604,7 +2642,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
2604
2642
|
children: [
|
|
2605
2643
|
workspace && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2606
2644
|
className: "dcu-wb-folder",
|
|
2607
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2645
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconFolderCloseMedium, { size: 16 })
|
|
2608
2646
|
}),
|
|
2609
2647
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2610
2648
|
className: "dcu-wb-tip-title-main",
|
|
@@ -2637,7 +2675,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
2637
2675
|
className: "dcu-wb-tip-row dcu-wb-tip-path",
|
|
2638
2676
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2639
2677
|
className: "dcu-wb-folder",
|
|
2640
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2678
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconFolderCloseMedium, { size: 16 })
|
|
2641
2679
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2642
2680
|
className: "dcu-wb-tip-path-copy",
|
|
2643
2681
|
children: hoverTip.path
|
|
@@ -2647,14 +2685,14 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
2647
2685
|
className: "dcu-wb-tip-row",
|
|
2648
2686
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2649
2687
|
className: "dcu-wb-folder",
|
|
2650
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2688
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconFolderCloseMedium, { size: 16 })
|
|
2651
2689
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: hoverTip.project })]
|
|
2652
2690
|
}),
|
|
2653
2691
|
!workspace && hoverTip.branch !== void 0 && hoverTip.branch !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2654
2692
|
className: "dcu-wb-tip-row",
|
|
2655
2693
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2656
2694
|
className: "dcu-wb-folder",
|
|
2657
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2695
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconBranchOutlineMedium, { size: 16 })
|
|
2658
2696
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: hoverTip.branch })]
|
|
2659
2697
|
}),
|
|
2660
2698
|
workspaceId !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: "dcu-wb-tip-sep" }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
@@ -2664,7 +2702,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
2664
2702
|
onEditWorkspace(workspaceId, hoverTip.title);
|
|
2665
2703
|
dismissTip();
|
|
2666
2704
|
},
|
|
2667
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2705
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconSettingsOutlineMedium, { size: 16 }), t("workspace.edit")]
|
|
2668
2706
|
})] })
|
|
2669
2707
|
]
|
|
2670
2708
|
});
|
|
@@ -3260,7 +3298,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
3260
3298
|
});
|
|
3261
3299
|
}
|
|
3262
3300
|
function CreateGroupIcon() {
|
|
3263
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3301
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconProjectAddOutlineMedium, { size: 16 });
|
|
3264
3302
|
}
|
|
3265
3303
|
/** 使用独立节点生成稳定的拖拽预览,避免浏览器把目标高亮和操作按钮截入默认快照。 */
|
|
3266
3304
|
function setDragPreview(dataTransfer, title, icon) {
|
|
@@ -3897,7 +3935,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
3897
3935
|
const moveTargets = workspaceGroupMoveTargets(workspaceGroups, workspaceId).map((target) => ({
|
|
3898
3936
|
id: workspaceGroupMoveActionId(target.groupId),
|
|
3899
3937
|
label: target.title ?? t("workspace.removeFromGroup"),
|
|
3900
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3938
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconFolderCloseMedium, { size: 16 })
|
|
3901
3939
|
}));
|
|
3902
3940
|
return [
|
|
3903
3941
|
{
|
|
@@ -3908,7 +3946,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
3908
3946
|
{
|
|
3909
3947
|
id: "rename",
|
|
3910
3948
|
label: t("workspace.rename"),
|
|
3911
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3949
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconEditOutlineMedium, { size: 16 })
|
|
3912
3950
|
},
|
|
3913
3951
|
{
|
|
3914
3952
|
type: "separator",
|
|
@@ -3917,14 +3955,14 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
3917
3955
|
{
|
|
3918
3956
|
id: "moveToGroup",
|
|
3919
3957
|
label: t("workspace.moveToGroup"),
|
|
3920
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3958
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconFolderCloseMedium, { size: 16 }),
|
|
3921
3959
|
disabled: moveTargets.length === 0,
|
|
3922
3960
|
submenu: moveTargets
|
|
3923
3961
|
},
|
|
3924
3962
|
{
|
|
3925
3963
|
id: "openPath",
|
|
3926
3964
|
label: t("workspace.openPath"),
|
|
3927
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3965
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconFolderOpenOutlineMedium, { size: 16 })
|
|
3928
3966
|
},
|
|
3929
3967
|
{
|
|
3930
3968
|
type: "separator",
|
|
@@ -3933,7 +3971,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
3933
3971
|
{
|
|
3934
3972
|
id: "archiveWorkspace",
|
|
3935
3973
|
label: t("workspace.archive"),
|
|
3936
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3974
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconArchiveOutlineMedium, { size: 16 }),
|
|
3937
3975
|
disabled: workspace.visibleIds.length === 0
|
|
3938
3976
|
},
|
|
3939
3977
|
{
|
|
@@ -3943,7 +3981,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
3943
3981
|
{
|
|
3944
3982
|
id: "delete",
|
|
3945
3983
|
label: t("workspace.delete"),
|
|
3946
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
3984
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconTrashOutlineMedium, { size: 16 }),
|
|
3947
3985
|
danger: true
|
|
3948
3986
|
}
|
|
3949
3987
|
];
|
|
@@ -4208,7 +4246,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
4208
4246
|
top: box.top
|
|
4209
4247
|
}, { immediate: true });
|
|
4210
4248
|
},
|
|
4211
|
-
children: folder.open ? folder.current ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4249
|
+
children: folder.open ? folder.current ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconFolderOpenMedium, { size: 16 }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconFolderOpenOutlineMedium, { size: 16 }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconFolderCloseMedium, { size: 16 })
|
|
4212
4250
|
}),
|
|
4213
4251
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4214
4252
|
className: "dcu-wb-project-title",
|
|
@@ -4241,7 +4279,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
4241
4279
|
type: "workspace"
|
|
4242
4280
|
});
|
|
4243
4281
|
},
|
|
4244
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4282
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconEllipsisOutlineMedium, { size: 16 })
|
|
4245
4283
|
})
|
|
4246
4284
|
})
|
|
4247
4285
|
}),
|
|
@@ -4431,7 +4469,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
4431
4469
|
type: "session"
|
|
4432
4470
|
});
|
|
4433
4471
|
},
|
|
4434
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4472
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconEllipsisOutlineMedium, { size: 16 })
|
|
4435
4473
|
})
|
|
4436
4474
|
})
|
|
4437
4475
|
})
|
|
@@ -4596,7 +4634,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
4596
4634
|
{
|
|
4597
4635
|
id: "rename",
|
|
4598
4636
|
label: t("workspace.renameGroup"),
|
|
4599
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4637
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconEditOutlineMedium, { size: 16 })
|
|
4600
4638
|
},
|
|
4601
4639
|
{
|
|
4602
4640
|
type: "separator",
|
|
@@ -4605,7 +4643,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
4605
4643
|
{
|
|
4606
4644
|
id: "delete",
|
|
4607
4645
|
label: t("workspace.deleteGroupAction"),
|
|
4608
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4646
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconTrashOutlineMedium, { size: 16 }),
|
|
4609
4647
|
danger: true
|
|
4610
4648
|
}
|
|
4611
4649
|
],
|
|
@@ -4633,7 +4671,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
4633
4671
|
groupActionTriggerRef.current = event.currentTarget;
|
|
4634
4672
|
setGroupMenuId((current) => current === groupId ? void 0 : groupId);
|
|
4635
4673
|
},
|
|
4636
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4674
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconEllipsisOutlineMedium, { size: 16 })
|
|
4637
4675
|
})
|
|
4638
4676
|
})
|
|
4639
4677
|
})]
|
|
@@ -5521,7 +5559,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
5521
5559
|
children: [
|
|
5522
5560
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5523
5561
|
className: "dcu-wb-move-target",
|
|
5524
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
5562
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconFolderCloseMedium, { size: 16 }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5525
5563
|
className: "dcu-wb-move-target-copy",
|
|
5526
5564
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5527
5565
|
className: "dcu-wb-move-project",
|
|
@@ -6140,7 +6178,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
6140
6178
|
{
|
|
6141
6179
|
id: "task-settings",
|
|
6142
6180
|
label: t("schedule.taskSettings"),
|
|
6143
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
6181
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconSettingsOutlineMedium, { size: 16 })
|
|
6144
6182
|
},
|
|
6145
6183
|
{
|
|
6146
6184
|
type: "separator",
|
|
@@ -6149,7 +6187,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
6149
6187
|
{
|
|
6150
6188
|
id: "archive-group",
|
|
6151
6189
|
label: t("schedule.archiveGroup"),
|
|
6152
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
6190
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconArchiveOutlineMedium, { size: 16 }),
|
|
6153
6191
|
danger: true
|
|
6154
6192
|
}
|
|
6155
6193
|
];
|
|
@@ -6243,7 +6281,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
6243
6281
|
setMenu(void 0);
|
|
6244
6282
|
setGroupMenu((current) => current === group.id ? void 0 : group.id);
|
|
6245
6283
|
},
|
|
6246
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
6284
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconEllipsisOutlineMedium, { size: 16 })
|
|
6247
6285
|
})
|
|
6248
6286
|
})
|
|
6249
6287
|
}), isExpanded && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -6407,12 +6445,12 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
6407
6445
|
const visibleSidebarWidths = /* @__PURE__ */ new WeakMap();
|
|
6408
6446
|
/** 解析宿主 AppFrame 的 grid-template-columns。 */
|
|
6409
6447
|
function parseSidebarGrid(value) {
|
|
6410
|
-
const match = /^(\d+(?:\.\d+)?)px\s+(minmax\(
|
|
6448
|
+
const match = /^(\d+(?:\.\d+)?)px\s+(minmax\(\d+(?:px)?,\s*1fr\))\s+(minmax\(0(?:px)?,\s*\d+(?:\.\d+)?px\)|\d+(?:\.\d+)?px)$/.exec(value.trim());
|
|
6411
6449
|
if (match === null) return void 0;
|
|
6412
6450
|
return {
|
|
6413
6451
|
sidebar: Number(match[1]),
|
|
6414
6452
|
middle: match[2],
|
|
6415
|
-
details:
|
|
6453
|
+
details: match[3]
|
|
6416
6454
|
};
|
|
6417
6455
|
}
|
|
6418
6456
|
function findSidebarFrame(root) {
|
|
@@ -6425,7 +6463,7 @@ header [data-dcu-title-folder] svg,header [data-dcu-title-more] svg{display:bloc
|
|
|
6425
6463
|
const tracks = parseSidebarGrid(frame.style.gridTemplateColumns);
|
|
6426
6464
|
if (tracks === void 0 || frame.hasAttribute("data-sidebar-collapsed")) return false;
|
|
6427
6465
|
visibleSidebarWidths.set(frame, width);
|
|
6428
|
-
const next = `${width}px ${tracks.middle} ${tracks.details}
|
|
6466
|
+
const next = `${width}px ${tracks.middle} ${tracks.details}`;
|
|
6429
6467
|
const changed = frame.style.gridTemplateColumns !== next;
|
|
6430
6468
|
if (changed) frame.style.gridTemplateColumns = next;
|
|
6431
6469
|
const contentWidth = `${width}px`;
|
|
@@ -6990,7 +7028,8 @@ body[data-ds-dark-theme] [data-conversation-scroll]{--dcu-composer-bg:var(--dsw-
|
|
|
6990
7028
|
@media(max-width:639px){[data-conversation-scroll]{--dcu-composer-shadow:0 0 0 1px #0000000a,0 2px 8px #0000000a,0 4px 40px 8px #00000006}}
|
|
6991
7029
|
@media(forced-colors:active){[data-conversation-scroll] [data-composer-card]{outline:1px solid CanvasText}}
|
|
6992
7030
|
html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:has([data-dcu-official-turn-navigator]) .dcu-turn-navigator{display:none}
|
|
6993
|
-
|
|
7031
|
+
/* 输入区把 clearance 设成 24px 后,旧镜像公式会变成 -28px,整条导航滑进侧栏。至少留 12px,贴在会话列内侧。 */
|
|
7032
|
+
[data-dcu-official-turn-navigator]{right:auto!important;left:max(12px,calc(12px - (var(--dsh-composer-side-clearance) + 16px)))!important}
|
|
6994
7033
|
/* 左移后的预览朝聊天内容区展开,外观和动画继续使用宿主规则。 */
|
|
6995
7034
|
[data-dcu-official-turn-navigator] [role=tooltip]{right:auto!important;left:calc(100% + 10px)!important}
|
|
6996
7035
|
`;
|
|
@@ -7262,7 +7301,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
7262
7301
|
className: "dcu-search-input",
|
|
7263
7302
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
7264
7303
|
autoFocus: true,
|
|
7265
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
7304
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconSearchOutlineMedium, { size: 16 }),
|
|
7266
7305
|
value: query,
|
|
7267
7306
|
placeholder: t("search.placeholder"),
|
|
7268
7307
|
onChange: (event) => {
|
|
@@ -7535,7 +7574,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
7535
7574
|
className: "dcu-icon",
|
|
7536
7575
|
"aria-label": t("sidebar.collapse"),
|
|
7537
7576
|
onClick: toggleSidebar,
|
|
7538
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
7577
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconPanelLeftOutlineMedium, { size: 16 })
|
|
7539
7578
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
7540
7579
|
type: "button",
|
|
7541
7580
|
className: "dcu-icon",
|
|
@@ -7543,7 +7582,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
7543
7582
|
onClick: () => {
|
|
7544
7583
|
search.current?.open();
|
|
7545
7584
|
},
|
|
7546
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
7585
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconSearchOutlineMedium, { size: 16 })
|
|
7547
7586
|
})]
|
|
7548
7587
|
})]
|
|
7549
7588
|
}),
|
|
@@ -7557,7 +7596,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
7557
7596
|
onClick: () => {
|
|
7558
7597
|
startSession();
|
|
7559
7598
|
},
|
|
7560
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MenuIcon, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
7599
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MenuIcon, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconNewChatOutlineMedium, { size: 16 }) }), t("sidebar.newTask")]
|
|
7561
7600
|
}),
|
|
7562
7601
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
7563
7602
|
className: "dcu-extensions-group",
|
|
@@ -7575,10 +7614,10 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
7575
7614
|
},
|
|
7576
7615
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MenuIcon, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
7577
7616
|
className: "dcu-extension-leading",
|
|
7578
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
7617
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconEnhanceOutlineMedium, {
|
|
7579
7618
|
className: "dcu-extension-default-icon",
|
|
7580
7619
|
size: 16
|
|
7581
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
7620
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconChevronRightOutlineMedium, { className: "dcu-extension-state-arrow" })]
|
|
7582
7621
|
}) }), t("sidebar.extensions")]
|
|
7583
7622
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
7584
7623
|
id: "dcu-extension-items",
|
|
@@ -7596,7 +7635,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
7596
7635
|
onClick: () => {
|
|
7597
7636
|
selectExternalSection(t("sidebar.experts"));
|
|
7598
7637
|
},
|
|
7599
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MenuIcon, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
7638
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MenuIcon, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconUserOutlineMedium, { size: 16 }) }), t("sidebar.experts")]
|
|
7600
7639
|
}),
|
|
7601
7640
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
7602
7641
|
type: "button",
|
|
@@ -7604,7 +7643,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
7604
7643
|
onClick: () => {
|
|
7605
7644
|
selectExternalSection(t("sidebar.skills"));
|
|
7606
7645
|
},
|
|
7607
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MenuIcon, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
7646
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MenuIcon, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconSkillOutlineMedium, { size: 16 }) }), t("sidebar.skills")]
|
|
7608
7647
|
}),
|
|
7609
7648
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
7610
7649
|
type: "button",
|
|
@@ -7612,7 +7651,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
7612
7651
|
onClick: () => {
|
|
7613
7652
|
openPlugins();
|
|
7614
7653
|
},
|
|
7615
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MenuIcon, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
7654
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MenuIcon, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconPersonalizationOutlineMedium, { size: 16 }) }), t("sidebar.plugins")]
|
|
7616
7655
|
}),
|
|
7617
7656
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
7618
7657
|
type: "button",
|
|
@@ -7620,7 +7659,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
7620
7659
|
onClick: () => {
|
|
7621
7660
|
selectSection(t("sidebar.connectors"));
|
|
7622
7661
|
},
|
|
7623
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MenuIcon, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
7662
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MenuIcon, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconLinkOutlineMedium, { size: 16 }) }), t("sidebar.connectors")]
|
|
7624
7663
|
})
|
|
7625
7664
|
]
|
|
7626
7665
|
})
|
|
@@ -7731,7 +7770,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
7731
7770
|
className: "dcu-icon",
|
|
7732
7771
|
"aria-label": t("sidebar.expand"),
|
|
7733
7772
|
onClick: toggleSidebar,
|
|
7734
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
7773
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconPanelLeftOutlineMedium, { size: 16 })
|
|
7735
7774
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("nav", {
|
|
7736
7775
|
className: "dcu-compact-nav",
|
|
7737
7776
|
"aria-label": t("sidebar.mainMenu"),
|
|
@@ -7744,7 +7783,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
7744
7783
|
onClick: () => {
|
|
7745
7784
|
startSession();
|
|
7746
7785
|
},
|
|
7747
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
7786
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconNewChatOutlineMedium, { size: 16 })
|
|
7748
7787
|
}),
|
|
7749
7788
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
7750
7789
|
type: "button",
|
|
@@ -7753,7 +7792,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
7753
7792
|
onClick: () => {
|
|
7754
7793
|
search.current?.open();
|
|
7755
7794
|
},
|
|
7756
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
7795
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconSearchOutlineMedium, { size: 16 })
|
|
7757
7796
|
}),
|
|
7758
7797
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
7759
7798
|
type: "button",
|
|
@@ -7762,7 +7801,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
7762
7801
|
onClick: () => {
|
|
7763
7802
|
selectExternalSection(t("sidebar.experts"));
|
|
7764
7803
|
},
|
|
7765
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
7804
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconUserOutlineMedium, { size: 16 })
|
|
7766
7805
|
}),
|
|
7767
7806
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
7768
7807
|
type: "button",
|
|
@@ -7771,7 +7810,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
7771
7810
|
onClick: () => {
|
|
7772
7811
|
selectExternalSection(t("sidebar.skills"));
|
|
7773
7812
|
},
|
|
7774
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
7813
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconSkillOutlineMedium, { size: 16 })
|
|
7775
7814
|
}),
|
|
7776
7815
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
7777
7816
|
type: "button",
|
|
@@ -7780,7 +7819,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
7780
7819
|
onClick: () => {
|
|
7781
7820
|
openPlugins();
|
|
7782
7821
|
},
|
|
7783
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
7822
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconPersonalizationOutlineMedium, { size: 16 })
|
|
7784
7823
|
}),
|
|
7785
7824
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
7786
7825
|
type: "button",
|
|
@@ -7789,7 +7828,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
7789
7828
|
onClick: () => {
|
|
7790
7829
|
selectSection(t("sidebar.connectors"));
|
|
7791
7830
|
},
|
|
7792
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
7831
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconLinkOutlineMedium, { size: 16 })
|
|
7793
7832
|
}),
|
|
7794
7833
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
7795
7834
|
type: "button",
|
|
@@ -8134,7 +8173,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
8134
8173
|
target: "_blank",
|
|
8135
8174
|
rel: "noreferrer",
|
|
8136
8175
|
"aria-label": t("about.feedback"),
|
|
8137
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
8176
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconListPenOutlineMedium, {}), t("about.feedback")]
|
|
8138
8177
|
})]
|
|
8139
8178
|
})]
|
|
8140
8179
|
}),
|
|
@@ -8164,7 +8203,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
8164
8203
|
onClick: () => {
|
|
8165
8204
|
updateAll();
|
|
8166
8205
|
},
|
|
8167
|
-
children: [installing === "all" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
8206
|
+
children: [installing === "all" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconLoadingOutlineMedium, { size: 14 }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconDownloadOutlineMedium, { size: 14 }), installing === "all" ? t("about.updatingAll") : t("about.updateAll")]
|
|
8168
8207
|
})]
|
|
8169
8208
|
}),
|
|
8170
8209
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
@@ -8203,7 +8242,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
8203
8242
|
rel: "noreferrer",
|
|
8204
8243
|
title: t("about.downloadsSource"),
|
|
8205
8244
|
"aria-label": `${dependency.packageName} · ${t("about.totalDownloads")} · ${typeof dependency.totalDownloads === "number" && Number.isSafeInteger(dependency.totalDownloads) && dependency.totalDownloads >= 0 ? dependency.totalDownloads.toLocaleString() : t("about.downloadsUnavailable")}`,
|
|
8206
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
8245
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconDownloadOutlineMedium, {
|
|
8207
8246
|
size: 12,
|
|
8208
8247
|
"aria-hidden": "true"
|
|
8209
8248
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
@@ -8231,7 +8270,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
8231
8270
|
className: "dcu-about-status",
|
|
8232
8271
|
"data-installed": dependency.installed,
|
|
8233
8272
|
"data-update": dependency.updateAvailable,
|
|
8234
|
-
children: [dependency.installed && !dependency.updateAvailable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
8273
|
+
children: [dependency.installed && !dependency.updateAvailable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconCheckOutlineMedium, { size: 14 }), dependency.updateAvailable ? t("about.updateAvailable") : dependency.installed ? t("about.installed") : t("about.missing")]
|
|
8235
8274
|
}),
|
|
8236
8275
|
(!dependency.installed || dependency.updateAvailable) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
8237
8276
|
className: "dcu-about-install",
|
|
@@ -8240,7 +8279,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
8240
8279
|
onClick: () => {
|
|
8241
8280
|
install(dependency.id);
|
|
8242
8281
|
},
|
|
8243
|
-
children: [installing === dependency.id ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
8282
|
+
children: [installing === dependency.id ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconLoadingOutlineMedium, { size: 14 }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconDownloadOutlineMedium, { size: 14 }), installing === dependency.id ? t("about.installing") : dependency.updateAvailable ? t("about.update") : t("about.install")]
|
|
8244
8283
|
})
|
|
8245
8284
|
]
|
|
8246
8285
|
}, dependency.id))
|
|
@@ -8249,7 +8288,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
8249
8288
|
className: "dcu-about-progress",
|
|
8250
8289
|
role: "status",
|
|
8251
8290
|
children: [
|
|
8252
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
8291
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconLoadingOutlineMedium, { size: 14 }) }),
|
|
8253
8292
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", { children: progress === void 0 ? t("about.progressHint") : progressLabel(progress, t) }),
|
|
8254
8293
|
progress?.percent !== null && progress?.percent !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
8255
8294
|
className: "dcu-about-progress-pct",
|
|
@@ -8413,7 +8452,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
8413
8452
|
children: [
|
|
8414
8453
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
8415
8454
|
className: "dcu-connector-head",
|
|
8416
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
8455
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconLinkOutlineMedium, { size: 16 }), connector.name]
|
|
8417
8456
|
}),
|
|
8418
8457
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
8419
8458
|
className: "dcu-connector-meta",
|
|
@@ -8500,13 +8539,6 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
8500
8539
|
"home.fix.prompt1": "我遇到了一个问题。先问我复现步骤、预期和实际表现,再定位根因并修复。",
|
|
8501
8540
|
"home.fix.task2": "修复失败的测试",
|
|
8502
8541
|
"home.fix.prompt2": "请运行当前项目适用的测试,定位失败根因并做最小修复,保留有效的回归覆盖。",
|
|
8503
|
-
"usage.title": "使用统计",
|
|
8504
|
-
"usage.loading": "正在加载费用面板…",
|
|
8505
|
-
"usage.failed": "费用面板暂时无法嵌入,可重试或打开原弹窗。",
|
|
8506
|
-
"usage.closed": "费用面板已关闭。",
|
|
8507
|
-
"usage.reopen": "重新打开费用面板",
|
|
8508
|
-
"usage.retry": "重试",
|
|
8509
|
-
"usage.original": "打开原弹窗",
|
|
8510
8542
|
"settings.title": "设置",
|
|
8511
8543
|
"settings.back": "返回应用",
|
|
8512
8544
|
"settings.openDocument": "打开配置文件",
|
|
@@ -8791,13 +8823,6 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
8791
8823
|
"home.fix.prompt1": "Help me fix a bug. First ask for reproduction steps, expected behavior, and actual behavior.",
|
|
8792
8824
|
"home.fix.task2": "Fix failing tests",
|
|
8793
8825
|
"home.fix.prompt2": "Run the applicable project tests, identify failure causes, and make minimal fixes with meaningful regression coverage.",
|
|
8794
|
-
"usage.title": "Usage statistics",
|
|
8795
|
-
"usage.loading": "Loading billing dashboard…",
|
|
8796
|
-
"usage.failed": "The embedded dashboard is unavailable. Retry or open the original dialog.",
|
|
8797
|
-
"usage.closed": "The billing dashboard is closed.",
|
|
8798
|
-
"usage.reopen": "Reopen billing dashboard",
|
|
8799
|
-
"usage.retry": "Retry",
|
|
8800
|
-
"usage.original": "Open original dialog",
|
|
8801
8826
|
"settings.title": "Settings",
|
|
8802
8827
|
"settings.back": "Back to app",
|
|
8803
8828
|
"settings.openDocument": "Open configuration file",
|
|
@@ -9223,213 +9248,6 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
9223
9248
|
};
|
|
9224
9249
|
}
|
|
9225
9250
|
//#endregion
|
|
9226
|
-
//#region src/usage-frame/contract.ts
|
|
9227
|
-
/** 同源费用承载页与宿主之间的最小能力桥;不暴露 Context 或远程服务全集。 */
|
|
9228
|
-
const USAGE_FRAME_PATH = "/api/dsh-codex-ui/usage/frame";
|
|
9229
|
-
const BILLING_ENTRY_ID = "usage-billing";
|
|
9230
|
-
//#endregion
|
|
9231
|
-
//#region src/client/UsageStatisticsSection.tsx
|
|
9232
|
-
/** 设置中的费用原面板承载区;不重建图表、计费或原面板的业务逻辑。 */
|
|
9233
|
-
function UsageStatisticsSection({ useStore, actions, billing, close, openOriginal, t }) {
|
|
9234
|
-
const snapshot = useStore((state) => state);
|
|
9235
|
-
const latest = (0, react.useRef)(snapshot);
|
|
9236
|
-
const listeners = (0, react.useRef)(/* @__PURE__ */ new Set());
|
|
9237
|
-
const frame = (0, react.useRef)(null);
|
|
9238
|
-
const [attempt, setAttempt] = (0, react.useState)(0);
|
|
9239
|
-
const [state, setState] = (0, react.useState)("loading");
|
|
9240
|
-
const disposeTheme = (0, react.useRef)(() => {});
|
|
9241
|
-
const timer = (0, react.useRef)(void 0);
|
|
9242
|
-
(0, react.useEffect)(() => {
|
|
9243
|
-
latest.current = snapshot;
|
|
9244
|
-
listeners.current.forEach((listener) => listener());
|
|
9245
|
-
}, [snapshot]);
|
|
9246
|
-
(0, react.useEffect)(() => {
|
|
9247
|
-
setState("loading");
|
|
9248
|
-
timer.current = setTimeout(() => {
|
|
9249
|
-
setState("failed");
|
|
9250
|
-
}, 15e3);
|
|
9251
|
-
return () => {
|
|
9252
|
-
clearTimeout(timer.current);
|
|
9253
|
-
disposeTheme.current();
|
|
9254
|
-
listeners.current.clear();
|
|
9255
|
-
};
|
|
9256
|
-
}, [attempt]);
|
|
9257
|
-
(0, react.useEffect)(() => {
|
|
9258
|
-
if ((state === "closed" || state === "failed") && document.activeElement === frame.current) frame.current?.parentElement?.querySelector("button")?.focus();
|
|
9259
|
-
}, [state]);
|
|
9260
|
-
const connect = () => {
|
|
9261
|
-
const target = frame.current?.contentWindow;
|
|
9262
|
-
if (!target) return;
|
|
9263
|
-
try {
|
|
9264
|
-
if (target.location.origin !== location.origin || target.location.pathname !== "/api/dsh-codex-ui/usage/frame") throw new Error("费用承载页地址不匹配");
|
|
9265
|
-
const document = target.document;
|
|
9266
|
-
if (!target.dcuUsageRuntimeReady || !document.getElementById("billing-root")) throw new Error("费用承载页未正确加载");
|
|
9267
|
-
const sync = () => {
|
|
9268
|
-
document.body.toggleAttribute("data-ds-dark-theme", window.document.body.hasAttribute("data-ds-dark-theme"));
|
|
9269
|
-
document.documentElement.lang = window.document.documentElement.lang;
|
|
9270
|
-
const tokens = getComputedStyle(window.document.body);
|
|
9271
|
-
for (const key of tokens) if (key.startsWith("--dsw-")) document.body.style.setProperty(key, tokens.getPropertyValue(key));
|
|
9272
|
-
};
|
|
9273
|
-
sync();
|
|
9274
|
-
disposeTheme.current();
|
|
9275
|
-
const observer = new MutationObserver(sync);
|
|
9276
|
-
observer.observe(window.document.body, {
|
|
9277
|
-
attributes: true,
|
|
9278
|
-
attributeFilter: [
|
|
9279
|
-
"data-ds-dark-theme",
|
|
9280
|
-
"class",
|
|
9281
|
-
"style"
|
|
9282
|
-
]
|
|
9283
|
-
});
|
|
9284
|
-
disposeTheme.current = () => observer.disconnect();
|
|
9285
|
-
target.dcuUsageHost = {
|
|
9286
|
-
getSnapshot: () => latest.current,
|
|
9287
|
-
subscribe: (listener) => {
|
|
9288
|
-
listeners.current.add(listener);
|
|
9289
|
-
return () => {
|
|
9290
|
-
listeners.current.delete(listener);
|
|
9291
|
-
};
|
|
9292
|
-
},
|
|
9293
|
-
actions,
|
|
9294
|
-
...billing,
|
|
9295
|
-
close,
|
|
9296
|
-
dismissed: () => {
|
|
9297
|
-
clearTimeout(timer.current);
|
|
9298
|
-
setState((current) => current === "failed" ? current : "closed");
|
|
9299
|
-
},
|
|
9300
|
-
focusOutside: (backward) => {
|
|
9301
|
-
const page = frame.current?.closest("[data-dcu-settings-page]");
|
|
9302
|
-
if (!page || !frame.current) return;
|
|
9303
|
-
const controls = [...page.querySelectorAll("button,input,select,textarea,a[href],[tabindex]")].filter((element) => element.tabIndex >= 0 && !element.matches(":disabled") && !element.closest("[inert]") && element.getClientRects().length > 0);
|
|
9304
|
-
controls[(controls.indexOf(frame.current) + (backward ? -1 : 1) + controls.length) % controls.length]?.focus();
|
|
9305
|
-
},
|
|
9306
|
-
ready: () => {
|
|
9307
|
-
clearTimeout(timer.current);
|
|
9308
|
-
setState((current) => current === "failed" ? current : "ready");
|
|
9309
|
-
},
|
|
9310
|
-
failed: (message) => {
|
|
9311
|
-
console.warn("[michengai-codex-ui] 费用承载失败:%s", message);
|
|
9312
|
-
clearTimeout(timer.current);
|
|
9313
|
-
setState("failed");
|
|
9314
|
-
}
|
|
9315
|
-
};
|
|
9316
|
-
target.postMessage({ type: "dcu-usage-init" }, location.origin);
|
|
9317
|
-
} catch (error) {
|
|
9318
|
-
console.warn("[michengai-codex-ui] 无法连接费用承载页", error);
|
|
9319
|
-
clearTimeout(timer.current);
|
|
9320
|
-
setState("failed");
|
|
9321
|
-
}
|
|
9322
|
-
};
|
|
9323
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
9324
|
-
className: "dcu-usage-section",
|
|
9325
|
-
"aria-label": t("usage.title"),
|
|
9326
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", { children: t("usage.title") }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
9327
|
-
className: "dcu-usage-stage",
|
|
9328
|
-
"aria-busy": state === "loading",
|
|
9329
|
-
children: [
|
|
9330
|
-
state === "loading" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
9331
|
-
className: "dcu-usage-loading",
|
|
9332
|
-
role: "status",
|
|
9333
|
-
children: t("usage.loading")
|
|
9334
|
-
}),
|
|
9335
|
-
state === "closed" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
9336
|
-
role: "status",
|
|
9337
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: t("usage.closed") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
9338
|
-
onClick: () => setAttempt((value) => value + 1),
|
|
9339
|
-
children: t("usage.reopen")
|
|
9340
|
-
})]
|
|
9341
|
-
}),
|
|
9342
|
-
state === "failed" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
9343
|
-
role: "alert",
|
|
9344
|
-
children: [
|
|
9345
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: t("usage.failed") }),
|
|
9346
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
9347
|
-
onClick: () => {
|
|
9348
|
-
setAttempt((value) => value + 1);
|
|
9349
|
-
},
|
|
9350
|
-
children: t("usage.retry")
|
|
9351
|
-
}),
|
|
9352
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
9353
|
-
onClick: () => {
|
|
9354
|
-
close();
|
|
9355
|
-
requestAnimationFrame(openOriginal);
|
|
9356
|
-
},
|
|
9357
|
-
children: t("usage.original")
|
|
9358
|
-
})
|
|
9359
|
-
]
|
|
9360
|
-
}),
|
|
9361
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("iframe", {
|
|
9362
|
-
ref: frame,
|
|
9363
|
-
title: t("usage.title"),
|
|
9364
|
-
src: USAGE_FRAME_PATH,
|
|
9365
|
-
onLoad: connect,
|
|
9366
|
-
"aria-hidden": state !== "ready",
|
|
9367
|
-
tabIndex: state === "ready" ? 0 : -1,
|
|
9368
|
-
style: { visibility: state === "ready" ? "visible" : "hidden" },
|
|
9369
|
-
className: "dcu-usage-frame"
|
|
9370
|
-
}, attempt)
|
|
9371
|
-
]
|
|
9372
|
-
})]
|
|
9373
|
-
});
|
|
9374
|
-
}
|
|
9375
|
-
//#endregion
|
|
9376
|
-
//#region src/client/usage-statistics.ts
|
|
9377
|
-
function registerUsageStatistics(ctx) {
|
|
9378
|
-
const t = ctx.locale.bind(NS);
|
|
9379
|
-
ctx.slots.inject("settings.section", () => {
|
|
9380
|
-
let current;
|
|
9381
|
-
let remove;
|
|
9382
|
-
const refresh = () => {
|
|
9383
|
-
const entry = ctx.slots.entriesOfSlot("sidebar.footer.action").find((item) => item.options.id === BILLING_ENTRY_ID);
|
|
9384
|
-
if (entry === current) return;
|
|
9385
|
-
remove?.();
|
|
9386
|
-
remove = void 0;
|
|
9387
|
-
current = entry;
|
|
9388
|
-
if (!entry?.store || typeof entry.store === "function" || !entry.locale || !entry.inject) return;
|
|
9389
|
-
const face = entry.inject();
|
|
9390
|
-
if (typeof face.checkModels !== "function" || typeof face.publishCosts !== "function") return;
|
|
9391
|
-
const billing = {
|
|
9392
|
-
translate: ctx.locale.bind(entry.locale),
|
|
9393
|
-
checkModels: face.checkModels,
|
|
9394
|
-
publishCosts: face.publishCosts
|
|
9395
|
-
};
|
|
9396
|
-
remove = ctx.slots.register({
|
|
9397
|
-
name: "settings.section",
|
|
9398
|
-
id: "usage-statistics",
|
|
9399
|
-
order: 90,
|
|
9400
|
-
label: () => t("usage.title"),
|
|
9401
|
-
locale: NS,
|
|
9402
|
-
store: entry.store,
|
|
9403
|
-
inject: () => ({
|
|
9404
|
-
billing,
|
|
9405
|
-
openOriginal: () => {
|
|
9406
|
-
ctx.get("billingMetrics")?.openDashboard?.();
|
|
9407
|
-
}
|
|
9408
|
-
})
|
|
9409
|
-
}, UsageStatisticsSection);
|
|
9410
|
-
};
|
|
9411
|
-
const unsubscribe = ctx.slots.subscribe("sidebar.footer.action", refresh);
|
|
9412
|
-
refresh();
|
|
9413
|
-
return () => {
|
|
9414
|
-
unsubscribe();
|
|
9415
|
-
remove?.();
|
|
9416
|
-
};
|
|
9417
|
-
});
|
|
9418
|
-
ctx.effect(() => {
|
|
9419
|
-
const onClick = (event) => {
|
|
9420
|
-
if (!(event.target instanceof Element) || !event.target.closest(".dcu-footer-actions [data-testid=\"billing-trigger\"],.dcu-footer-actions [data-testid=\"billing-rail-button\"]")) return;
|
|
9421
|
-
if (!ctx.slots.entriesOfSlot("settings.section").some((entry) => entry.options.id === "usage-statistics")) return;
|
|
9422
|
-
const seat = document.querySelector(".dcu-settings-seat");
|
|
9423
|
-
if (!seat?.querySelector("[data-dcu-settings-trigger]")) return;
|
|
9424
|
-
event.preventDefault();
|
|
9425
|
-
event.stopPropagation();
|
|
9426
|
-
openSettingsSection(seat, t("usage.title"));
|
|
9427
|
-
};
|
|
9428
|
-
document.addEventListener("click", onClick, true);
|
|
9429
|
-
return () => document.removeEventListener("click", onClick, true);
|
|
9430
|
-
}, "michengai-codex-ui: usage navigation");
|
|
9431
|
-
}
|
|
9432
|
-
//#endregion
|
|
9433
9251
|
//#region src/client/PluginConfigSection.tsx
|
|
9434
9252
|
function bindPluginConfigLocale(bind) {
|
|
9435
9253
|
const cache = /* @__PURE__ */ new Map();
|
|
@@ -9586,7 +9404,7 @@ html[data-dcu-official-turn-navigator-supported=true] .dcu-turn-navigator,html:h
|
|
|
9586
9404
|
//#endregion
|
|
9587
9405
|
//#region src/client/settings-page-model.ts
|
|
9588
9406
|
function settingsGroup(id) {
|
|
9589
|
-
if (/archive|about
|
|
9407
|
+
if (/archive|about/.test(id)) return "records";
|
|
9590
9408
|
if (/^(general|appearance|theme|language|shortcuts|voice|account)$/.test(id)) return "personal";
|
|
9591
9409
|
return "integrations";
|
|
9592
9410
|
}
|
|
@@ -9683,19 +9501,10 @@ body:has(.dcu-settings-page) :is([data-dcu-settings-isolated],[data-dcu-settings
|
|
|
9683
9501
|
body:has(.dcu-settings-page) > [role=alert]{visibility:visible!important}
|
|
9684
9502
|
html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-backdrop=mica] body:has(.dcu-settings-page) .dcu-root{background:transparent}
|
|
9685
9503
|
|
|
9686
|
-
.dcu-settings-inner:has(.dcu-usage-section){height:100%;display:flex;flex-direction:column;padding-bottom:0}
|
|
9687
|
-
.dcu-settings-inner:has(.dcu-usage-section)>.dcu-settings-heading{display:none}
|
|
9688
|
-
.dcu-settings-inner:has(.dcu-usage-section)>[data-slot="settings.section"]{display:flex;flex:1;min-height:0;flex-direction:column}
|
|
9689
9504
|
.dcu-plugin-config [data-plugin-panel]{height:auto;padding:0;overflow:visible;align-items:stretch;gap:24px}
|
|
9690
9505
|
.dcu-plugin-config [data-plugin-panel]>*{max-width:none}
|
|
9691
9506
|
.dcu-plugin-config [data-plugin-panel]>header :is(h1,p){display:none}
|
|
9692
9507
|
.dcu-plugin-config [data-plugin-panel]>header{justify-content:flex-end}
|
|
9693
|
-
.dcu-usage-section{display:flex;flex-direction:column;flex:1;min-height:0;gap:16px}
|
|
9694
|
-
.dcu-usage-section h1{font-size:24px;font-weight:500;margin:0}
|
|
9695
|
-
.dcu-usage-section p{color:var(--sp-muted)}
|
|
9696
|
-
.dcu-usage-stage{position:relative;flex:1;min-height:420px;background:var(--sp-bg)}
|
|
9697
|
-
.dcu-usage-loading{position:absolute;inset:0;display:grid;place-items:center;margin:0}
|
|
9698
|
-
.dcu-usage-frame{position:absolute;inset:0;display:block;width:100%;height:100%;border:0;background:var(--sp-bg)}
|
|
9699
9508
|
@media(prefers-reduced-motion:reduce){.dcu-settings-trigger,.dcu-settings-trigger-content svg,.dcu-settings-back,.dcu-settings-link{transition:none}.dcu-settings-trigger:hover svg,.dcu-settings-trigger:active{transform:none}.dcu-settings-page,.dcu-settings-nav,.dcu-settings-inner{animation:none}}
|
|
9700
9509
|
.dcu-settings-page [data-slot="settings.section"]{min-width:0}
|
|
9701
9510
|
.dcu-settings-inner:has(.dcu-connector-frame){height:100%;display:flex;flex-direction:column}
|
|
@@ -9730,7 +9539,6 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
9730
9539
|
editor: "settings.editor"
|
|
9731
9540
|
};
|
|
9732
9541
|
function sectionIcon(id) {
|
|
9733
|
-
if (id === "usage-statistics") return ChartColumn;
|
|
9734
9542
|
if (id === "market" || id === "plugin-marketplace") return Store;
|
|
9735
9543
|
if (id === "better-sidebar" || id === "sidebar-cards") return PanelRight;
|
|
9736
9544
|
if (/model/.test(id)) return Cpu;
|
|
@@ -9765,7 +9573,7 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
9765
9573
|
const wasOpen = (0, react.useRef)(false);
|
|
9766
9574
|
const exitAnimation = (0, react.useRef)(null);
|
|
9767
9575
|
const active = rows.find((row) => row.id === activeId) ?? rows[0];
|
|
9768
|
-
const step = onboardingActive ? steps.find((item) => !completed.has(item.id)) : void 0;
|
|
9576
|
+
const step = onboardingActive ? steps.find((item) => item.id !== "welcome-notice" && !completed.has(item.id)) : void 0;
|
|
9769
9577
|
const close = (0, react.useCallback)(() => {
|
|
9770
9578
|
if (exitAnimation.current !== null) return;
|
|
9771
9579
|
const finish = () => {
|
|
@@ -10132,7 +9940,8 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
10132
9940
|
//#region src/client/settings-page-registration.ts
|
|
10133
9941
|
/** 用公开插槽替换设置壳,保留宿主的设置写入、连接恢复和首次使用引导。 */
|
|
10134
9942
|
function registerSettingsPage(ctx) {
|
|
10135
|
-
const
|
|
9943
|
+
const shellSlots = [
|
|
9944
|
+
"settings.launcher",
|
|
10136
9945
|
"settings.trigger",
|
|
10137
9946
|
"settings.header",
|
|
10138
9947
|
"settings.action",
|
|
@@ -10141,7 +9950,7 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
10141
9950
|
"settings.onboarding",
|
|
10142
9951
|
"settings.general.item"
|
|
10143
9952
|
];
|
|
10144
|
-
const occupied = () => ctx.slots.entriesOfSlot("sidebar.settings").length > 0 ||
|
|
9953
|
+
const occupied = () => ctx.slots.entriesOfSlot("sidebar.settings").length > 0 || shellSlots.some((name) => ctx.slots.snapshot(name).length > 0);
|
|
10145
9954
|
const warn = () => console.warn("[michengai-codex-ui] 已存在设置外壳,保留宿主设置;独立设置页需要 bundle patch 停用 ui-settings-general。");
|
|
10146
9955
|
if (occupied()) {
|
|
10147
9956
|
warn();
|
|
@@ -10190,11 +9999,14 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
10190
9999
|
name: "settings.close",
|
|
10191
10000
|
locale: NS
|
|
10192
10001
|
}, () => t("settings.back")));
|
|
10193
|
-
|
|
10002
|
+
let documentBound = false;
|
|
10003
|
+
const bindSettingsDocument = (settingsCtx, forms) => {
|
|
10004
|
+
if (documentBound) return;
|
|
10194
10005
|
const remote = settingsCtx.get("remote");
|
|
10195
10006
|
if (!remote.$host.isLoopback) return;
|
|
10196
|
-
|
|
10197
|
-
|
|
10007
|
+
documentBound = true;
|
|
10008
|
+
const describe = forms.describe();
|
|
10009
|
+
const remove = settingsCtx.slots.inject("settings.general.footer", () => !owned ? () => {} : settingsCtx.slots.register({
|
|
10198
10010
|
name: "settings.general.footer",
|
|
10199
10011
|
id: "open-document",
|
|
10200
10012
|
locale: NS,
|
|
@@ -10203,6 +10015,16 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
10203
10015
|
openDocument: () => remote.settings.openSettingsDocument()
|
|
10204
10016
|
})
|
|
10205
10017
|
}, SettingsDocumentAction));
|
|
10018
|
+
return () => {
|
|
10019
|
+
documentBound = false;
|
|
10020
|
+
remove();
|
|
10021
|
+
};
|
|
10022
|
+
};
|
|
10023
|
+
ctx.inject(["configForms", "remote.settings"], (settingsCtx) => {
|
|
10024
|
+
return bindSettingsDocument(settingsCtx, settingsCtx.configForms);
|
|
10025
|
+
});
|
|
10026
|
+
ctx.inject(["settingsScope", "remote.settings"], (settingsCtx) => {
|
|
10027
|
+
return bindSettingsDocument(settingsCtx, settingsCtx.settingsScope);
|
|
10206
10028
|
});
|
|
10207
10029
|
ctx.slots.inject("sidebar.settings", () => {
|
|
10208
10030
|
if (occupied()) {
|
|
@@ -10282,7 +10104,9 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
10282
10104
|
const OFFICIAL_TURN_NAVIGATOR_SUPPORTED_ATTRIBUTE = "data-dcu-official-turn-navigator-supported";
|
|
10283
10105
|
const CAPABILITIES_ENDPOINT = `${CODEX_UI_API_ENDPOINTS.dependencies}?action=capabilities`;
|
|
10284
10106
|
function isOfficialTurnNavigator(element) {
|
|
10285
|
-
|
|
10107
|
+
if (!(element instanceof HTMLElement) || element.tagName !== "NAV") return false;
|
|
10108
|
+
if (element.querySelector("button[type=\"button\"][aria-label]") === null) return false;
|
|
10109
|
+
return element.style.getPropertyValue("--turn-natural-height") !== "" || element.querySelector("button[type=\"button\"][data-index][aria-label]") !== null;
|
|
10286
10110
|
}
|
|
10287
10111
|
/** 标记实际挂载的官方轮次导航,避免依赖宿主样式文件名或会话 DOM 层级。 */
|
|
10288
10112
|
function markOfficialTurnNavigators(root = document) {
|
|
@@ -10973,7 +10797,6 @@ html[data-dsh-native-backdrop=mica] .dcu-settings-page,html[data-dsh-native-back
|
|
|
10973
10797
|
ctx.effect(() => observeHeroWidthHandles(t("home.resizeInput")), "michengai-codex-ui: hero width handles");
|
|
10974
10798
|
registerInputHistory(ctx);
|
|
10975
10799
|
registerSettingsPage(ctx);
|
|
10976
|
-
registerUsageStatistics(ctx);
|
|
10977
10800
|
registerPluginConfigSection(ctx);
|
|
10978
10801
|
const connection = ctx.get("connection");
|
|
10979
10802
|
const openPath = (path) => openPathInHost(connection, path);
|