@lemoncat7/dsh-knowledge 2.3.3 → 2.3.6
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/README.md +5 -3
- package/docs/architecture.md +2 -0
- package/docs/releases/2.3.5.md +26 -0
- package/docs/releases/2.3.6.md +17 -0
- package/docs/ui-maintenance.md +97 -0
- package/lib/api.d.ts.map +1 -1
- package/lib/api.js +20 -1
- package/lib/api.js.map +1 -1
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +357 -206
- package/lib/client.js.map +4 -4
- package/lib/design-tokens.d.ts +12 -0
- package/lib/design-tokens.d.ts.map +1 -0
- package/lib/design-tokens.js +58 -0
- package/lib/design-tokens.js.map +1 -0
- package/lib/extraction.d.ts.map +1 -1
- package/lib/extraction.js +2 -1
- package/lib/extraction.js.map +1 -1
- package/lib/knowledge-activity-controller.d.ts +3 -8
- package/lib/knowledge-activity-controller.d.ts.map +1 -1
- package/lib/knowledge-activity-controller.js +19 -7
- package/lib/knowledge-activity-controller.js.map +1 -1
- package/lib/knowledge-activity-notes.d.ts.map +1 -1
- package/lib/knowledge-activity-notes.js +19 -10
- package/lib/knowledge-activity-notes.js.map +1 -1
- package/lib/knowledge-activity-panel.d.ts.map +1 -1
- package/lib/knowledge-activity-panel.js +33 -21
- package/lib/knowledge-activity-panel.js.map +1 -1
- package/lib/knowledge-activity-presentation.d.ts +14 -0
- package/lib/knowledge-activity-presentation.d.ts.map +1 -0
- package/lib/knowledge-activity-presentation.js +77 -0
- package/lib/knowledge-activity-presentation.js.map +1 -0
- package/lib/knowledge-activity-state.d.ts +17 -0
- package/lib/knowledge-activity-state.d.ts.map +1 -0
- package/lib/knowledge-activity-state.js +14 -0
- package/lib/knowledge-activity-state.js.map +1 -0
- package/lib/latest-request.d.ts +7 -0
- package/lib/latest-request.d.ts.map +1 -0
- package/lib/latest-request.js +14 -0
- package/lib/latest-request.js.map +1 -0
- package/lib/local-provider.d.ts +0 -2
- package/lib/local-provider.d.ts.map +1 -1
- package/lib/local-provider.js +2 -323
- package/lib/local-provider.js.map +1 -1
- package/lib/notes/share-page-styles.d.ts +2 -0
- package/lib/notes/share-page-styles.d.ts.map +1 -0
- package/lib/notes/share-page-styles.js +11 -0
- package/lib/notes/share-page-styles.js.map +1 -0
- package/lib/notes/share-page.d.ts.map +1 -1
- package/lib/notes/share-page.js +1 -8
- package/lib/notes/share-page.js.map +1 -1
- package/lib/remote-provider.d.ts.map +1 -1
- package/lib/remote-provider.js +41 -6
- package/lib/remote-provider.js.map +1 -1
- package/lib/search-query.d.ts +2 -0
- package/lib/search-query.d.ts.map +1 -0
- package/lib/search-query.js +50 -0
- package/lib/search-query.js.map +1 -0
- package/lib/storage/migrations.d.ts +5 -0
- package/lib/storage/migrations.d.ts.map +1 -0
- package/lib/storage/migrations.js +325 -0
- package/lib/storage/migrations.js.map +1 -0
- package/lib/theme-bridge.d.ts +9 -7
- package/lib/theme-bridge.d.ts.map +1 -1
- package/lib/theme-bridge.js +3 -23
- package/lib/theme-bridge.js.map +1 -1
- package/lib/web-note-editor-selection.d.ts.map +1 -1
- package/lib/web-note-editor-selection.js +50 -15
- package/lib/web-note-editor-selection.js.map +1 -1
- package/lib/web-note-editor.d.ts.map +1 -1
- package/lib/web-note-editor.js +15 -1
- package/lib/web-note-editor.js.map +1 -1
- package/lib/web.d.ts.map +1 -1
- package/lib/web.js +4 -0
- package/lib/web.js.map +1 -1
- package/package.json +1 -1
- package/web/app.js +78 -176
- package/web/design-tokens.css +1 -0
- package/web/dialogs.js +94 -0
- package/web/document-actions.js +68 -0
- package/web/index.html +1 -0
- package/web/model-catalog.js +22 -0
- package/web/note-editor.js +57 -57
- package/web/select-control.js +193 -0
- package/web/styles.css +93 -185
- package/web/ui-primitives.js +5 -0
package/lib/client.js
CHANGED
|
@@ -25,7 +25,7 @@ __export(client_exports, {
|
|
|
25
25
|
inject: () => inject
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(client_exports);
|
|
28
|
-
var
|
|
28
|
+
var import_react4 = require("react");
|
|
29
29
|
|
|
30
30
|
// src/workspace-ownership.ts
|
|
31
31
|
var WORKSPACE_ACTIVATE_EVENT = "@lemoncat7/dsh-plugin-ui/workspace-activate";
|
|
@@ -46,11 +46,115 @@ function observePluginWorkspace(pluginId, close) {
|
|
|
46
46
|
// src/client.tsx
|
|
47
47
|
var import_dsh_client_ui_primitives3 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
48
48
|
|
|
49
|
+
// src/design-tokens.ts
|
|
50
|
+
var KNOWLEDGE_PALETTE = {
|
|
51
|
+
light: {
|
|
52
|
+
"--bg": "#ebebeb",
|
|
53
|
+
"--surface": "#f4f4f4",
|
|
54
|
+
"--surface-raised": "#fafafa",
|
|
55
|
+
"--surface-soft": "#eeeeef",
|
|
56
|
+
"--surface-hover": "rgb(118 118 128 / 9%)",
|
|
57
|
+
"--dialog-surface": "#f4f4f4",
|
|
58
|
+
"--menu-surface": "rgb(232 234 236 / 98%)",
|
|
59
|
+
"--menu-surface-solid": "#e8eaec",
|
|
60
|
+
"--document-surface": "rgb(218 222 226 / 32%)",
|
|
61
|
+
"--selection-background": "#b8c8d6",
|
|
62
|
+
"--selection-text": "#17212b",
|
|
63
|
+
"--activity-surface": "rgba(255, 255, 255, 0.14)",
|
|
64
|
+
"--text": "#1d1d1f",
|
|
65
|
+
"--text-secondary": "#515154",
|
|
66
|
+
"--text-tertiary": "#6e6e73",
|
|
67
|
+
"--border": "rgb(60 60 67 / 14%)",
|
|
68
|
+
"--border-strong": "rgb(60 60 67 / 24%)",
|
|
69
|
+
"--accent": "#3a3a3c",
|
|
70
|
+
"--accent-hover": "#1d1d1f",
|
|
71
|
+
"--accent-soft": "#e2e2e5",
|
|
72
|
+
"--on-accent": "#ffffff",
|
|
73
|
+
"--success": "#248a3d",
|
|
74
|
+
"--success-soft": "#e8f5eb",
|
|
75
|
+
"--warning": "#c93400",
|
|
76
|
+
"--warning-soft": "#fff1e8",
|
|
77
|
+
"--danger": "#d70015",
|
|
78
|
+
"--danger-soft": "#ffebed",
|
|
79
|
+
"--shadow": "0 24px 64px rgb(0 0 0 / 20%)"
|
|
80
|
+
},
|
|
81
|
+
dark: {
|
|
82
|
+
"--bg": "#101719",
|
|
83
|
+
"--surface": "#182022",
|
|
84
|
+
"--surface-raised": "#20292b",
|
|
85
|
+
"--surface-soft": "rgb(184 204 205 / 6%)",
|
|
86
|
+
"--surface-hover": "rgb(105 182 186 / 9%)",
|
|
87
|
+
"--dialog-surface": "#20292b",
|
|
88
|
+
"--menu-surface": "rgb(29 38 40 / 98%)",
|
|
89
|
+
"--menu-surface-solid": "#1d2628",
|
|
90
|
+
"--document-surface": "rgb(130 138 146 / 6%)",
|
|
91
|
+
"--selection-background": "#455b68",
|
|
92
|
+
"--selection-text": "#ffffff",
|
|
93
|
+
"--activity-surface": "rgb(29 36 38 / 24%)",
|
|
94
|
+
"--text": "#e3eaeb",
|
|
95
|
+
"--text-secondary": "#bbc9cc",
|
|
96
|
+
"--text-tertiary": "#95a7ab",
|
|
97
|
+
"--border": "rgb(184 204 205 / 10%)",
|
|
98
|
+
"--border-strong": "rgb(184 204 205 / 18%)",
|
|
99
|
+
"--accent": "#69b6ba",
|
|
100
|
+
"--accent-hover": "#8aced0",
|
|
101
|
+
"--accent-soft": "rgb(105 182 186 / 13%)",
|
|
102
|
+
"--on-accent": "#101819",
|
|
103
|
+
"--success": "#30d158",
|
|
104
|
+
"--success-soft": "rgb(48 209 88 / 13%)",
|
|
105
|
+
"--warning": "#ff9f0a",
|
|
106
|
+
"--warning-soft": "rgb(255 159 10 / 13%)",
|
|
107
|
+
"--danger": "#ff453a",
|
|
108
|
+
"--danger-soft": "rgb(255 69 58 / 14%)",
|
|
109
|
+
"--shadow": "0 28px 72px rgb(0 0 0 / 42%)"
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
var KNOWLEDGE_FONTS = {
|
|
113
|
+
"--font-ui": 'ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei UI", Arial, sans-serif',
|
|
114
|
+
"--font-reading": "var(--font-ui)",
|
|
115
|
+
"--font-mono": '"SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace'
|
|
116
|
+
};
|
|
117
|
+
var KNOWLEDGE_EMBEDDED_MATERIAL = {
|
|
118
|
+
light: {
|
|
119
|
+
"--knowledge-embedded-surface": "rgba(255, 255, 255, 0.08)",
|
|
120
|
+
"--knowledge-embedded-filter": "saturate(.65) contrast(1.015) blur(24px)",
|
|
121
|
+
"--knowledge-embedded-control": "rgba(255, 255, 255, 0.27)"
|
|
122
|
+
},
|
|
123
|
+
dark: {
|
|
124
|
+
"--knowledge-embedded-surface": "rgb(16 23 25 / 18%)",
|
|
125
|
+
"--knowledge-embedded-filter": "saturate(.55) contrast(1.02) blur(24px)",
|
|
126
|
+
"--knowledge-embedded-control": "rgb(39 50 53 / 72%)"
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
function declarations(tokens) {
|
|
130
|
+
return Object.entries(tokens).map(([name, value]) => name + ":" + value + ";").join("");
|
|
131
|
+
}
|
|
132
|
+
function knowledgeDesignCss(scope = ":root", dark = ':root[data-color-scheme="dark"]', systemMode = true) {
|
|
133
|
+
const themeTokens = (scheme) => declarations(KNOWLEDGE_PALETTE[scheme]) + declarations(KNOWLEDGE_EMBEDDED_MATERIAL[scheme]);
|
|
134
|
+
const base = scope + "{" + declarations(KNOWLEDGE_FONTS) + themeTokens("light") + "}";
|
|
135
|
+
const darkRule = dark + "{" + themeTokens("dark") + "}";
|
|
136
|
+
const automatic = systemMode ? "@media(prefers-color-scheme:dark){" + scope + ":not([data-color-scheme]){" + themeTokens("dark") + "}}" : "";
|
|
137
|
+
return base + automatic + darkRule;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// src/knowledge-activity-state.ts
|
|
141
|
+
function availableActivitySession(state) {
|
|
142
|
+
const current = state.current;
|
|
143
|
+
return current !== void 0 && state.byId[current]?.blank === false ? String(current) : void 0;
|
|
144
|
+
}
|
|
145
|
+
function mergeActivitySelection(previous, next) {
|
|
146
|
+
const merged = { ...previous, ...next };
|
|
147
|
+
if ("knowledgeBaseId" in next && next.knowledgeBaseId !== previous.knowledgeBaseId && !("documentId" in next)) {
|
|
148
|
+
merged.documentId = void 0;
|
|
149
|
+
}
|
|
150
|
+
return merged;
|
|
151
|
+
}
|
|
152
|
+
|
|
49
153
|
// src/client.css
|
|
50
|
-
var client_default = '.dsh-knowledge-trigger,\n.dsh-knowledge-activity-panel,\n.dsh-knowledge-workspace,\n.dsh-knowledge-settings-card,\n.dsh-knowledge-writeback-status {\n color-scheme: light;\n --knowledge-canvas: transparent;\n --knowledge-accent: #3a3a3c;\n --knowledge-on-accent: #fff;\n --knowledge-danger: #d70015;\n --knowledge-success: #248a3d;\n --knowledge-pane: rgba(255, 255, 255, 0.16);\n --knowledge-raised: rgba(255, 255, 255, 0.38);\n --knowledge-control: rgba(255, 255, 255, 0.27);\n --knowledge-border: rgb(60 60 67 / 14%);\n --knowledge-text: #1d1d1f;\n --knowledge-text-secondary: #515154;\n --knowledge-text-tertiary: #747478;\n --knowledge-hover: rgba(118, 118, 128, .1);\n --knowledge-glare-light: rgb(255 255 255 / 70%);\n --knowledge-glare-rim: rgb(60 60 67 / 11%);\n --knowledge-glass-filter: saturate(1.22) contrast(1.03) blur(32px);\n --knowledge-host-glass-filter: saturate(.18) contrast(1.015) blur(24px);\n --knowledge-glass-shadow: inset 0 1px 0 rgb(255 255 255 / 70%), inset 0 -1px 0 rgb(60 60 67 / 11%), 0 10px 28px rgb(31 31 35 / 8.5%);\n --knowledge-activity-surface: rgb(250 249 246 / 58%);\n --knowledge-font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;\n color: var(--knowledge-text);\n font-family: var(--knowledge-font-family);\n font-size: 13px;\n line-height: 1.5;\n}\n\nbody[data-ds-dark-theme] :is(\n .dsh-knowledge-trigger,\n .dsh-knowledge-activity-panel,\n .dsh-knowledge-workspace,\n .dsh-knowledge-settings-card,\n .dsh-knowledge-writeback-status\n) {\n color-scheme: dark;\n --knowledge-canvas: transparent;\n --knowledge-accent: #69b6ba;\n --knowledge-on-accent: #101819;\n --knowledge-danger: #ff453a;\n --knowledge-success: #30d158;\n --knowledge-pane: rgb(25 33 35 / 90%);\n --knowledge-raised: rgb(32 41 43 / 94%);\n --knowledge-control: rgb(39 50 53 / 92%);\n --knowledge-border: rgb(184 204 205 / 11%);\n --knowledge-text: #e3eaeb;\n --knowledge-text-secondary: #bbc9cc;\n --knowledge-text-tertiary: #95a7ab;\n --knowledge-hover: rgb(105 182 186 / 9%);\n --knowledge-glare-light: rgb(255 255 255 / 16%);\n --knowledge-glare-rim: rgb(0 0 0 / 30%);\n --knowledge-host-glass-filter: saturate(.45) contrast(1.02) blur(24px);\n --knowledge-glass-shadow: inset 0 1px 0 rgb(255 255 255 / 16%), inset 0 -1px 0 rgb(0 0 0 / 30%), 0 12px 32px rgb(0 0 0 / 30%);\n --knowledge-activity-surface: rgb(18 20 20 / 72%);\n}\n\n:is(\n .dsh-knowledge-trigger,\n .dsh-knowledge-activity-panel,\n .dsh-knowledge-workspace,\n .dsh-knowledge-settings-card,\n .dsh-knowledge-writeback-status\n),\n:is(\n .dsh-knowledge-trigger,\n .dsh-knowledge-activity-panel,\n .dsh-knowledge-workspace,\n .dsh-knowledge-settings-card,\n .dsh-knowledge-writeback-status\n) * {\n box-sizing: border-box;\n}\n\n:is(\n .dsh-knowledge-trigger,\n .dsh-knowledge-activity-panel,\n .dsh-knowledge-workspace,\n .dsh-knowledge-settings-card,\n .dsh-knowledge-writeback-status\n) :where(button, input, textarea, select) {\n margin: 0;\n color: inherit;\n font-family: var(--knowledge-font-family);\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n letter-spacing: inherit;\n}\n\n.dsh-knowledge-trigger,\n.dsh-knowledge-activity-panel button,\n.dsh-knowledge-activity-panel input,\n.dsh-knowledge-panel-state button,\n.dsh-knowledge-settings-card button,\n.dsh-knowledge-writeback-status button {\n -webkit-appearance: none;\n appearance: none;\n margin: 0;\n}\n\n.dsh-knowledge-trigger {\n position: relative;\n flex: none;\n min-width: 0;\n display: flex;\n align-items: center;\n gap: 8px;\n width: calc(100% + 4px);\n height: 42px;\n margin: 4px -2px;\n padding: 0 10px 0 8px;\n box-sizing: border-box;\n border: 0;\n border-radius: 8px;\n overflow: hidden;\n background: transparent;\n color: var(--knowledge-text);\n cursor: pointer;\n font: inherit;\n font-size: 14px;\n line-height: 22px;\n white-space: nowrap;\n isolation: isolate;\n transition:\n color 120ms ease,\n background-color 120ms ease,\n box-shadow 160ms ease;\n}\n\n.dsh-knowledge-trigger:hover {\n background: var(--knowledge-hover);\n}\n\n.dsh-knowledge-trigger:focus-visible,\n.dsh-knowledge-writeback-status button:focus-visible {\n outline: 2px solid var(--knowledge-accent);\n outline-offset: 2px;\n}\n\n.dsh-knowledge-trigger.is-active {\n background: var(--knowledge-control);\n color: var(--knowledge-text);\n box-shadow: 0 1px 2px rgb(0 0 0 / 7%), inset 0 1px 0 rgb(255 255 255 / 28%);\n}\n\n.dsh-knowledge-trigger--rail {\n width: 36px;\n height: 36px;\n margin: 8px 0 4px;\n padding: 0;\n justify-content: center;\n gap: 0;\n border-radius: 50%;\n}\n\n/* Rail (collapsed) mode: the host footer seat is a horizontal row sized for a\n single 36px circle per entry; with several entries it overflows the 56px\n rail and the circles drift off the settings axis. Stack the entries\n vertically, centered on the same axis as the settings circle. The --rail\n class on the knowledge trigger is the collapsed-mode signal, so wide mode\n is untouched. */\ndiv:has(> div[data-slot="sidebar.footer.action"] .dsh-knowledge-trigger--rail) {\n flex-direction: column;\n align-items: center;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .dsh-knowledge-trigger { transition: none; }\n}\n\n.dsh-knowledge-workspace {\n width: 100%;\n height: 100%;\n min-width: 0;\n min-height: 0;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n background: var(--knowledge-canvas);\n}\n\n.dsh-knowledge-workspace-header {\n position: relative;\n z-index: 2;\n flex: none;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n min-height: 52px;\n margin: 8px 10px 0;\n padding: 7px 14px;\n box-sizing: border-box;\n border: 1px solid var(--knowledge-border);\n border-radius: 14px 14px 11px 11px;\n background: transparent;\n box-shadow: var(--knowledge-glass-shadow);\n -webkit-backdrop-filter: var(--knowledge-host-glass-filter);\n backdrop-filter: var(--knowledge-host-glass-filter);\n}\n\n.dsh-knowledge-workspace-header > div {\n display: flex;\n align-items: center;\n gap: 10px;\n min-width: 0;\n}\n\n.dsh-knowledge-workspace-header [data-xiaohei-workspace-close] {\n -webkit-appearance: none;\n appearance: none;\n display: grid;\n place-items: center;\n box-sizing: border-box;\n flex: none;\n width: 30px;\n height: 30px;\n margin: 0;\n padding: 0;\n border: 1px solid transparent;\n border-radius: 9px;\n color: var(--knowledge-text-secondary);\n background: transparent;\n font: inherit;\n line-height: 1;\n -webkit-tap-highlight-color: transparent;\n cursor: pointer;\n transition: color 140ms ease, background 140ms ease, border-color 140ms ease, transform 140ms ease;\n}\n\n.dsh-knowledge-workspace-header [data-xiaohei-workspace-close]:hover {\n border-color: var(--knowledge-border);\n color: var(--knowledge-text);\n background: var(--knowledge-control);\n}\n\n.dsh-knowledge-workspace-header [data-xiaohei-workspace-close]:active { transform: scale(.96); }\n.dsh-knowledge-workspace-header [data-xiaohei-workspace-close]:focus-visible {\n outline: 2px solid var(--knowledge-accent);\n outline-offset: 2px;\n}\n.dsh-knowledge-workspace-header [data-xiaohei-workspace-close] > svg {\n display: block;\n pointer-events: none;\n}\n\n.dsh-knowledge-workspace-header > div > span {\n display: grid;\n min-width: 0;\n gap: 2px;\n}\n\n.dsh-knowledge-workspace-header h2,\n.dsh-knowledge-workspace-header p {\n margin: 0;\n}\n\n.dsh-knowledge-workspace-header h2 {\n color: var(--knowledge-text);\n font-size: 15px;\n line-height: 22px;\n font-weight: 600;\n}\n\n.dsh-knowledge-workspace-header p {\n color: var(--knowledge-text-secondary);\n font-size: 11px;\n line-height: 16px;\n}\n\n.dsh-knowledge-frame {\n flex: 1;\n display: block;\n width: 100%;\n min-height: 0;\n margin: 0;\n border: 0;\n border-radius: 0;\n background: transparent;\n box-shadow: none;\n -webkit-backdrop-filter: none;\n backdrop-filter: none;\n}\n\n.dsh-knowledge-panel-state {\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 16px;\n min-height: 0;\n margin: 8px 10px 10px;\n padding: 32px;\n box-sizing: border-box;\n border: 1px solid var(--knowledge-border);\n border-radius: 15px;\n background: var(--knowledge-pane);\n box-shadow: var(--knowledge-glass-shadow);\n -webkit-backdrop-filter: var(--knowledge-host-glass-filter);\n backdrop-filter: var(--knowledge-host-glass-filter);\n color: var(--knowledge-text);\n}\n\n.dsh-knowledge-panel-state-icon {\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 40px;\n height: 40px;\n border-radius: 12px;\n background: var(--knowledge-hover);\n color: var(--knowledge-text-secondary);\n font-size: 18px;\n font-weight: 600;\n}\n\n.dsh-knowledge-panel-state > div { max-width: 560px; }\n.dsh-knowledge-panel-state h3 { margin: 0 0 6px; font-size: 17px; line-height: 24px; font-weight: 600; }\n.dsh-knowledge-panel-state p { margin: 0; color: var(--knowledge-text-secondary); font-size: 13px; line-height: 20px; }\n.dsh-knowledge-panel-state button {\n min-width: 72px;\n min-height: 32px;\n margin-top: 16px;\n padding: 6px 14px;\n border: 0;\n border-radius: 10px;\n background: var(--knowledge-accent);\n color: var(--knowledge-on-accent);\n cursor: pointer;\n font: inherit;\n}\n.dsh-knowledge-panel-state button:focus-visible {\n outline: 2px solid var(--knowledge-accent);\n outline-offset: 2px;\n}\n\n.dsh-knowledge-settings-card {\n list-style: none;\n overflow: hidden;\n border: 1px solid var(--knowledge-border);\n border-radius: 14px;\n background:\n linear-gradient(145deg, color-mix(in srgb, var(--knowledge-glare-light) 16%, transparent), transparent 58%),\n var(--knowledge-pane);\n color: var(--knowledge-text);\n box-shadow: var(--knowledge-glass-shadow), 0 8px 24px rgb(0 0 0 / 5%);\n -webkit-backdrop-filter: var(--knowledge-glass-filter);\n backdrop-filter: var(--knowledge-glass-filter);\n transition: border-color .16s, background .16s, box-shadow .2s, transform .2s cubic-bezier(.22, 1, .36, 1);\n}\n.dsh-knowledge-settings-card:hover {\n border-color: color-mix(in srgb, var(--knowledge-border) 68%, var(--knowledge-text-secondary));\n box-shadow: var(--knowledge-glass-shadow), 0 12px 30px rgb(0 0 0 / 8%);\n transform: translateY(-1px);\n}\n.dsh-knowledge-settings-card--open {\n border-color: color-mix(in srgb, var(--knowledge-border) 68%, var(--knowledge-text-secondary));\n background: var(--knowledge-pane);\n}\n.dsh-knowledge-settings-header { display: flex; width: 100%; align-items: center; gap: 12px; padding: 14px 16px; border: 0; border-radius: 12px; background: transparent; color: inherit; text-align: left; cursor: pointer; font: inherit; }\n.dsh-knowledge-settings-header:focus-visible {\n outline: 2px solid var(--knowledge-accent);\n outline-offset: -2px;\n}\n.dsh-knowledge-settings-actions button:focus-visible,\n.dsh-knowledge-settings-load-error button:focus-visible {\n outline: 2px solid var(--knowledge-accent);\n outline-offset: 2px;\n}\n.dsh-knowledge-settings-header > span:first-child { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 4px; }\n.dsh-knowledge-settings-header strong { font-size: 15px; font-weight: 600; line-height: 1.4; }\n.dsh-knowledge-settings-header small { color: var(--knowledge-text-tertiary); font-size: 13px; line-height: 1.5; }\n.dsh-knowledge-source-picker small,\n.dsh-knowledge-remote-fields small { color: var(--knowledge-text-secondary); font-size: 12px; }\n.dsh-knowledge-settings-summary { display: flex; flex: none; align-items: center; gap: 10px; color: var(--knowledge-text-tertiary); font-size: 12px; }\n.dsh-knowledge-settings-summary i { width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform 160ms ease; }\n.dsh-knowledge-settings-card--open .dsh-knowledge-settings-summary i { transform: rotate(225deg); }\n\n.dsh-knowledge-settings-body {\n display: grid;\n gap: 18px;\n margin: 0 16px;\n padding-bottom: 8px;\n border-top: 1px solid var(--knowledge-border);\n}\n\n.dsh-knowledge-source-picker {\n min-width: 0;\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 10px;\n margin: 18px 0 0;\n padding: 0;\n border: 0;\n}\n\n.dsh-knowledge-source-picker legend { margin-bottom: 8px; padding: 0; color: inherit; font-size: 13px; font-weight: 600; }\n.dsh-knowledge-source-picker label {\n display: flex;\n gap: 10px;\n padding: 13px;\n border: 1px solid var(--knowledge-border);\n border-radius: 14px;\n cursor: pointer;\n}\n.dsh-knowledge-source-picker label.is-selected {\n border-color: var(--knowledge-accent);\n background: color-mix(in srgb, var(--knowledge-accent) 7%, transparent);\n}\n.dsh-knowledge-source-picker label.is-disabled {\n cursor: default;\n opacity: .55;\n}\n.dsh-knowledge-source-picker label:focus-within {\n outline: 2px solid var(--knowledge-accent);\n outline-offset: 2px;\n}\n.dsh-knowledge-source-picker input {\n -webkit-appearance: none;\n appearance: none;\n width: 16px;\n height: 16px;\n display: inline-grid;\n place-content: center;\n flex: none;\n margin: 2px 0 0;\n border: 1px solid var(--knowledge-border);\n border-radius: 50%;\n background: var(--knowledge-control);\n color: var(--knowledge-on-accent);\n cursor: pointer;\n transition: border-color .15s ease, background-color .15s ease;\n}\n.dsh-knowledge-source-picker input::before {\n content: "";\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: currentColor;\n opacity: 0;\n transform: scale(.55);\n transition: opacity .12s ease, transform .15s cubic-bezier(.2, .8, .2, 1);\n}\n.dsh-knowledge-source-picker input:checked { border-color: var(--knowledge-accent); background: var(--knowledge-accent); }\n.dsh-knowledge-source-picker input:checked::before { opacity: 1; transform: scale(1); }\n.dsh-knowledge-source-picker input:disabled { cursor: default; }\n.dsh-knowledge-source-picker span { display: grid; gap: 3px; }\n\n.dsh-knowledge-remote-fields { display: grid; grid-template-columns: 1.25fr 1fr; gap: 12px; }\n.dsh-knowledge-remote-fields label,\n.dsh-knowledge-timeout-field { display: grid; gap: 6px; color: var(--knowledge-text-secondary); font-size: 12px; }\n.dsh-knowledge-remote-fields input,\n.dsh-knowledge-timeout-field input {\n -webkit-appearance: none;\n appearance: none;\n min-height: 38px;\n box-sizing: border-box;\n padding: 8px 11px;\n border: 1px solid var(--knowledge-border);\n border-radius: 10px;\n outline: none;\n background: var(--knowledge-control);\n color: var(--knowledge-text);\n font: inherit;\n}\n.dsh-knowledge-remote-fields input:focus,\n.dsh-knowledge-timeout-field input:focus { border-color: var(--knowledge-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--knowledge-accent) 16%, transparent); }\n.dsh-knowledge-remote-fields input:-webkit-autofill,\n.dsh-knowledge-remote-fields input:-webkit-autofill:hover,\n.dsh-knowledge-remote-fields input:-webkit-autofill:focus {\n -webkit-text-fill-color: var(--knowledge-text);\n box-shadow: 0 0 0 1000px var(--knowledge-control) inset;\n caret-color: var(--knowledge-text);\n}\n.dsh-knowledge-timeout-field input::-webkit-inner-spin-button,\n.dsh-knowledge-timeout-field input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }\n.dsh-knowledge-timeout-field { max-width: 240px; }\n.dsh-knowledge-field-error { color: var(--knowledge-danger) !important; }\n\n.dsh-knowledge-settings-message,\n.dsh-knowledge-settings-note { margin: 0; color: var(--knowledge-text-secondary); font-size: 12px; }\n.dsh-knowledge-settings-message.is-success { color: var(--knowledge-success); }\n.dsh-knowledge-settings-message.is-error { color: var(--knowledge-danger); }\n.dsh-knowledge-settings-load-error {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n margin-top: 18px;\n padding: 12px 14px;\n border-radius: 12px;\n background: color-mix(in srgb, var(--knowledge-danger) 8%, transparent);\n color: var(--knowledge-danger);\n font-size: 13px;\n}\n.dsh-knowledge-settings-load-error p { margin: 0; }\n.dsh-knowledge-settings-load-error button {\n flex: none;\n min-height: 30px;\n padding: 5px 10px;\n border: 0;\n border-radius: 9px;\n background: var(--knowledge-control);\n color: var(--knowledge-text);\n cursor: pointer;\n font: inherit;\n}\n.dsh-knowledge-settings-actions { display: flex; justify-content: flex-end; gap: 8px; }\n.dsh-knowledge-settings-actions button {\n min-height: 34px;\n padding: 7px 13px;\n border: 0;\n border-radius: 10px;\n background: var(--knowledge-hover);\n color: var(--knowledge-text);\n cursor: pointer;\n font: inherit;\n font-size: 13px;\n}\n.dsh-knowledge-settings-actions button.is-primary { background: var(--knowledge-accent); color: var(--knowledge-on-accent); }\n.dsh-knowledge-settings-actions button:disabled { cursor: default; opacity: .45; }\n\n@media (max-width: 720px) {\n .dsh-knowledge-source-picker,\n .dsh-knowledge-remote-fields { grid-template-columns: 1fr; }\n .dsh-knowledge-settings-summary { font-size: 0; }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .dsh-knowledge-settings-card,\n .dsh-knowledge-settings-header,\n .dsh-knowledge-settings-summary i { transition: none; }\n}\n\n.dsh-knowledge-writeback-status {\n display: grid;\n gap: 5px;\n min-width: 0;\n color: var(--knowledge-text-tertiary);\n font-size: 12px;\n line-height: 1.5;\n}\n.dsh-knowledge-writeback-summary {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 8px;\n min-width: 0;\n}\n.dsh-knowledge-writeback-status strong {\n color: var(--knowledge-text-secondary);\n font-weight: 600;\n}\n.dsh-knowledge-writeback-status button {\n min-height: 24px;\n padding: 0 9px;\n border: 1px solid var(--knowledge-border);\n border-radius: 7px;\n color: var(--knowledge-text-secondary);\n background: var(--knowledge-control);\n cursor: pointer;\n font: inherit;\n}\n.dsh-knowledge-writeback-status button:disabled { cursor: default; opacity: .5; }\n.dsh-knowledge-writeback-destinations {\n display: flex;\n flex-wrap: wrap;\n gap: 2px 12px;\n min-width: 0;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.dsh-knowledge-writeback-destinations li {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n min-width: 0;\n max-width: 100%;\n padding: 0;\n border: 0;\n background: transparent;\n}\n.dsh-knowledge-writeback-base,\n.dsh-knowledge-writeback-separator {\n flex: none;\n}\n.dsh-knowledge-writeback-separator {\n color: var(--knowledge-text-tertiary);\n}\n.dsh-knowledge-writeback-destinations strong {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.dsh-knowledge-writeback-status .dsh-knowledge-writeback-document {\n display: inline-flex;\n align-items: center;\n min-width: 0;\n min-height: 24px;\n padding: 0 3px;\n border: 0;\n border-radius: 4px;\n background: transparent;\n color: var(--knowledge-text-secondary);\n text-decoration: underline;\n text-decoration-color: transparent;\n text-underline-offset: 3px;\n transition: color 120ms ease, background-color 120ms ease, text-decoration-color 120ms ease;\n}\n.dsh-knowledge-writeback-status .dsh-knowledge-writeback-document:hover {\n background: var(--knowledge-hover);\n color: var(--knowledge-text);\n text-decoration-color: currentColor;\n}\n.dsh-knowledge-writeback-document strong { color: inherit; }\n.dsh-knowledge-writeback-destinations small {\n flex: none;\n color: var(--knowledge-text-secondary);\n font: inherit;\n white-space: nowrap;\n}\n.dsh-knowledge-writeback-destinations small[data-disposition="written"] { color: var(--knowledge-success); }\n.dsh-knowledge-writeback-error {\n max-width: min(720px, 100%);\n margin: 0;\n color: var(--knowledge-danger);\n overflow-wrap: anywhere;\n}\n';
|
|
154
|
+
var client_default = '.dsh-knowledge-trigger,\n.dsh-knowledge-activity-panel,\n.dsh-knowledge-workspace,\n.dsh-knowledge-settings-card,\n.dsh-knowledge-writeback-notice {\n color-scheme: light;\n --knowledge-canvas: transparent;\n --knowledge-accent: var(--accent);\n --knowledge-on-accent: var(--on-accent);\n --knowledge-danger: var(--danger);\n --knowledge-success: var(--success);\n --knowledge-pane: rgba(255, 255, 255, 0.16);\n --knowledge-raised: rgba(255, 255, 255, 0.38);\n --knowledge-control: rgba(255, 255, 255, 0.27);\n --knowledge-border: var(--border);\n --knowledge-text: var(--text);\n --knowledge-text-secondary: var(--text-secondary);\n --knowledge-text-tertiary: var(--text-tertiary);\n --knowledge-hover: var(--surface-hover);\n --knowledge-glare-light: rgb(255 255 255 / 70%);\n --knowledge-glare-rim: rgb(60 60 67 / 11%);\n --knowledge-glass-filter: saturate(1.22) contrast(1.03) blur(32px);\n --knowledge-host-glass-filter: saturate(.18) contrast(1.015) blur(24px);\n --knowledge-glass-shadow: inset 0 1px 0 rgb(255 255 255 / 70%), inset 0 -1px 0 rgb(60 60 67 / 11%), 0 10px 28px rgb(31 31 35 / 8.5%);\n --knowledge-font-family: var(--font-ui);\n color: var(--knowledge-text);\n font-family: var(--knowledge-font-family);\n font-size: 13px;\n line-height: 1.5;\n}\n\nbody[data-ds-dark-theme] :is(\n .dsh-knowledge-trigger,\n .dsh-knowledge-activity-panel,\n .dsh-knowledge-workspace,\n .dsh-knowledge-settings-card,\n .dsh-knowledge-writeback-notice\n) {\n color-scheme: dark;\n --knowledge-canvas: transparent;\n --knowledge-accent: var(--accent);\n --knowledge-on-accent: var(--on-accent);\n --knowledge-danger: var(--danger);\n --knowledge-success: var(--success);\n --knowledge-pane: rgb(25 33 35 / 90%);\n --knowledge-raised: rgb(32 41 43 / 94%);\n --knowledge-control: rgb(39 50 53 / 92%);\n --knowledge-border: var(--border);\n --knowledge-text: var(--text);\n --knowledge-text-secondary: var(--text-secondary);\n --knowledge-text-tertiary: var(--text-tertiary);\n --knowledge-hover: var(--surface-hover);\n --knowledge-glare-light: rgb(255 255 255 / 16%);\n --knowledge-glare-rim: rgb(0 0 0 / 30%);\n --knowledge-host-glass-filter: saturate(.45) contrast(1.02) blur(24px);\n --knowledge-glass-shadow: inset 0 1px 0 rgb(255 255 255 / 16%), inset 0 -1px 0 rgb(0 0 0 / 30%), 0 12px 32px rgb(0 0 0 / 30%);\n}\n\n:is(\n .dsh-knowledge-trigger,\n .dsh-knowledge-activity-panel,\n .dsh-knowledge-workspace,\n .dsh-knowledge-settings-card,\n .dsh-knowledge-writeback-notice\n),\n:is(\n .dsh-knowledge-trigger,\n .dsh-knowledge-activity-panel,\n .dsh-knowledge-workspace,\n .dsh-knowledge-settings-card,\n .dsh-knowledge-writeback-notice\n) * {\n box-sizing: border-box;\n}\n\n:is(\n .dsh-knowledge-trigger,\n .dsh-knowledge-activity-panel,\n .dsh-knowledge-workspace,\n .dsh-knowledge-settings-card,\n .dsh-knowledge-writeback-notice\n) :where(button, input, textarea, select) {\n margin: 0;\n color: inherit;\n font-family: var(--knowledge-font-family);\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n letter-spacing: inherit;\n}\n\n.dsh-knowledge-trigger,\n.dsh-knowledge-activity-panel button,\n.dsh-knowledge-activity-panel input,\n.dsh-knowledge-panel-state button,\n.dsh-knowledge-settings-card button,\n.dsh-knowledge-writeback-notice button {\n -webkit-appearance: none;\n appearance: none;\n margin: 0;\n}\n\n.dsh-knowledge-trigger {\n position: relative;\n flex: none;\n min-width: 0;\n display: flex;\n align-items: center;\n gap: 8px;\n width: calc(100% + 8px);\n height: 34px;\n margin: 4px -4px;\n padding: 6px 2px 6px 10px;\n box-sizing: border-box;\n border: 0;\n border-radius: 12px;\n overflow: hidden;\n background: transparent;\n color: var(--knowledge-text);\n cursor: pointer;\n font: inherit;\n font-size: 14px;\n line-height: 22px;\n white-space: nowrap;\n isolation: isolate;\n transition:\n color 120ms ease,\n background-color 120ms ease,\n box-shadow 160ms ease;\n}\n\n.dsh-knowledge-trigger:hover {\n background: var(--knowledge-hover);\n}\n\n.dsh-knowledge-trigger:focus-visible,\n.dsh-knowledge-writeback-notice button:focus-visible {\n outline: 2px solid var(--knowledge-accent);\n outline-offset: 2px;\n}\n\n.dsh-knowledge-trigger.is-active {\n background: var(--knowledge-control);\n color: var(--knowledge-text);\n box-shadow: 0 1px 2px rgb(0 0 0 / 7%), inset 0 1px 0 rgb(255 255 255 / 28%);\n}\n\n.dsh-knowledge-trigger--rail {\n width: 36px;\n height: 36px;\n margin: 8px 0 10px;\n padding: 0;\n justify-content: center;\n gap: 0;\n border-radius: 50%;\n}\n\n.dsh-knowledge-trigger--rail { margin-inline: auto; }\n\n@media (prefers-reduced-motion: reduce) {\n .dsh-knowledge-trigger { transition: none; }\n}\n\n.dsh-knowledge-workspace {\n width: 100%;\n height: 100%;\n min-width: 0;\n min-height: 0;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n background: var(--knowledge-canvas);\n}\n\n.dsh-knowledge-workspace-header {\n position: relative;\n z-index: 2;\n flex: none;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n min-height: 52px;\n margin: 8px 10px 0;\n padding: 7px 14px;\n box-sizing: border-box;\n border: 1px solid var(--knowledge-border);\n border-radius: 14px 14px 11px 11px;\n background: transparent;\n box-shadow: var(--knowledge-glass-shadow);\n -webkit-backdrop-filter: var(--knowledge-host-glass-filter);\n backdrop-filter: var(--knowledge-host-glass-filter);\n}\n\n.dsh-knowledge-workspace-header > div {\n display: flex;\n align-items: center;\n gap: 10px;\n min-width: 0;\n}\n\n.dsh-knowledge-workspace-header [data-knowledge-workspace-close] {\n -webkit-appearance: none;\n appearance: none;\n display: grid;\n place-items: center;\n box-sizing: border-box;\n flex: none;\n width: 30px;\n height: 30px;\n margin: 0;\n padding: 0;\n border: 1px solid transparent;\n border-radius: 9px;\n color: var(--knowledge-text-secondary);\n background: transparent;\n font: inherit;\n line-height: 1;\n -webkit-tap-highlight-color: transparent;\n cursor: pointer;\n transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;\n}\n\n.dsh-knowledge-workspace-header [data-knowledge-workspace-close]:hover {\n border-color: var(--knowledge-border);\n color: var(--knowledge-text);\n background: var(--knowledge-control);\n}\n\n.dsh-knowledge-workspace-header [data-knowledge-workspace-close]:active { border-color: var(--knowledge-text-secondary); }\n.dsh-knowledge-workspace-header [data-knowledge-workspace-close]:focus-visible {\n outline: 2px solid var(--knowledge-accent);\n outline-offset: 2px;\n}\n.dsh-knowledge-workspace-header [data-knowledge-workspace-close] > svg {\n display: block;\n pointer-events: none;\n}\n\n.dsh-knowledge-workspace-header > div > span {\n display: grid;\n min-width: 0;\n gap: 2px;\n}\n\n.dsh-knowledge-workspace-header h2,\n.dsh-knowledge-workspace-header p {\n margin: 0;\n}\n\n.dsh-knowledge-workspace-header h2 {\n color: var(--knowledge-text);\n font-size: 15px;\n line-height: 22px;\n font-weight: 600;\n}\n\n.dsh-knowledge-workspace-header p {\n color: var(--knowledge-text-secondary);\n font-size: 11px;\n line-height: 16px;\n}\n\n.dsh-knowledge-frame {\n flex: 1;\n display: block;\n width: 100%;\n min-height: 0;\n margin: 0;\n border: 0;\n border-radius: 0;\n background: transparent;\n box-shadow: none;\n -webkit-backdrop-filter: none;\n backdrop-filter: none;\n}\n\n.dsh-knowledge-panel-state {\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 16px;\n min-height: 0;\n margin: 8px 10px 10px;\n padding: 32px;\n box-sizing: border-box;\n border: 1px solid var(--knowledge-border);\n border-radius: 15px;\n background: var(--knowledge-pane);\n box-shadow: var(--knowledge-glass-shadow);\n -webkit-backdrop-filter: var(--knowledge-host-glass-filter);\n backdrop-filter: var(--knowledge-host-glass-filter);\n color: var(--knowledge-text);\n}\n\n.dsh-knowledge-panel-state-icon {\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 40px;\n height: 40px;\n border-radius: 12px;\n background: var(--knowledge-hover);\n color: var(--knowledge-text-secondary);\n font-size: 18px;\n font-weight: 600;\n}\n\n.dsh-knowledge-panel-state > div { max-width: 560px; }\n.dsh-knowledge-panel-state h3 { margin: 0 0 6px; font-size: 17px; line-height: 24px; font-weight: 600; }\n.dsh-knowledge-panel-state p { margin: 0; color: var(--knowledge-text-secondary); font-size: 13px; line-height: 20px; }\n.dsh-knowledge-panel-state button {\n min-width: 72px;\n min-height: 32px;\n margin-top: 16px;\n padding: 6px 14px;\n border: 0;\n border-radius: 10px;\n background: var(--knowledge-accent);\n color: var(--knowledge-on-accent);\n cursor: pointer;\n font: inherit;\n}\n.dsh-knowledge-panel-state button:focus-visible {\n outline: 2px solid var(--knowledge-accent);\n outline-offset: 2px;\n}\n\n.dsh-knowledge-settings-card {\n list-style: none;\n overflow: hidden;\n border: 1px solid var(--knowledge-border);\n border-radius: 14px;\n background:\n linear-gradient(145deg, color-mix(in srgb, var(--knowledge-glare-light) 16%, transparent), transparent 58%),\n var(--knowledge-pane);\n color: var(--knowledge-text);\n box-shadow: var(--knowledge-glass-shadow), 0 8px 24px rgb(0 0 0 / 5%);\n -webkit-backdrop-filter: var(--knowledge-glass-filter);\n backdrop-filter: var(--knowledge-glass-filter);\n transition: border-color 120ms ease, background-color 120ms ease;\n}\n.dsh-knowledge-settings-card:hover {\n border-color: color-mix(in srgb, var(--knowledge-border) 68%, var(--knowledge-text-secondary));\n}\n.dsh-knowledge-settings-card--open {\n border-color: color-mix(in srgb, var(--knowledge-border) 68%, var(--knowledge-text-secondary));\n background: var(--knowledge-pane);\n}\n.dsh-knowledge-settings-header { display: flex; width: 100%; align-items: center; gap: 12px; padding: 14px 16px; border: 0; border-radius: 12px; background: transparent; color: inherit; text-align: left; cursor: pointer; font: inherit; }\n.dsh-knowledge-settings-header:focus-visible {\n outline: 2px solid var(--knowledge-accent);\n outline-offset: -2px;\n}\n.dsh-knowledge-settings-actions button:focus-visible,\n.dsh-knowledge-settings-load-error button:focus-visible {\n outline: 2px solid var(--knowledge-accent);\n outline-offset: 2px;\n}\n.dsh-knowledge-settings-header > span:first-child { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 4px; }\n.dsh-knowledge-settings-header strong { font-size: 15px; font-weight: 600; line-height: 1.4; }\n.dsh-knowledge-settings-header small { color: var(--knowledge-text-tertiary); font-size: 13px; line-height: 1.5; }\n.dsh-knowledge-source-picker small,\n.dsh-knowledge-remote-fields small { color: var(--knowledge-text-secondary); font-size: 12px; }\n.dsh-knowledge-settings-summary { display: flex; flex: none; align-items: center; gap: 10px; color: var(--knowledge-text-tertiary); font-size: 12px; }\n.dsh-knowledge-settings-summary i { width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform 160ms ease; }\n.dsh-knowledge-settings-card--open .dsh-knowledge-settings-summary i { transform: rotate(225deg); }\n\n.dsh-knowledge-settings-body {\n display: grid;\n gap: 18px;\n margin: 0 16px;\n padding-bottom: 8px;\n border-top: 1px solid var(--knowledge-border);\n}\n\n.dsh-knowledge-source-picker {\n min-width: 0;\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 10px;\n margin: 18px 0 0;\n padding: 0;\n border: 0;\n}\n\n.dsh-knowledge-source-picker legend { margin-bottom: 8px; padding: 0; color: inherit; font-size: 13px; font-weight: 600; }\n.dsh-knowledge-source-picker label {\n display: flex;\n gap: 10px;\n padding: 13px;\n border: 1px solid var(--knowledge-border);\n border-radius: 14px;\n cursor: pointer;\n}\n.dsh-knowledge-source-picker label.is-selected {\n border-color: var(--knowledge-accent);\n background: color-mix(in srgb, var(--knowledge-accent) 7%, transparent);\n}\n.dsh-knowledge-source-picker label.is-disabled {\n cursor: default;\n opacity: .55;\n}\n.dsh-knowledge-source-picker label:focus-within {\n outline: 2px solid var(--knowledge-accent);\n outline-offset: 2px;\n}\n.dsh-knowledge-source-picker input {\n -webkit-appearance: none;\n appearance: none;\n width: 16px;\n height: 16px;\n display: inline-grid;\n place-content: center;\n flex: none;\n margin: 2px 0 0;\n border: 1px solid var(--knowledge-border);\n border-radius: 50%;\n background: var(--knowledge-control);\n color: var(--knowledge-on-accent);\n cursor: pointer;\n transition: border-color .15s ease, background-color .15s ease;\n}\n.dsh-knowledge-source-picker input::before {\n content: "";\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: currentColor;\n opacity: 0;\n transform: scale(.55);\n transition: opacity .12s ease, transform .15s cubic-bezier(.2, .8, .2, 1);\n}\n.dsh-knowledge-source-picker input:checked { border-color: var(--knowledge-accent); background: var(--knowledge-accent); }\n.dsh-knowledge-source-picker input:checked::before { opacity: 1; transform: scale(1); }\n.dsh-knowledge-source-picker input:disabled { cursor: default; }\n.dsh-knowledge-source-picker span { display: grid; gap: 3px; }\n\n.dsh-knowledge-remote-fields { display: grid; grid-template-columns: 1.25fr 1fr; gap: 12px; }\n.dsh-knowledge-remote-fields label,\n.dsh-knowledge-timeout-field { display: grid; gap: 6px; color: var(--knowledge-text-secondary); font-size: 12px; }\n.dsh-knowledge-remote-fields input,\n.dsh-knowledge-timeout-field input {\n -webkit-appearance: none;\n appearance: none;\n min-height: 38px;\n box-sizing: border-box;\n padding: 8px 11px;\n border: 1px solid var(--knowledge-border);\n border-radius: 10px;\n outline: none;\n background: var(--knowledge-control);\n color: var(--knowledge-text);\n font: inherit;\n}\n.dsh-knowledge-remote-fields input:focus,\n.dsh-knowledge-timeout-field input:focus { border-color: var(--knowledge-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--knowledge-accent) 16%, transparent); }\n.dsh-knowledge-remote-fields input:-webkit-autofill,\n.dsh-knowledge-remote-fields input:-webkit-autofill:hover,\n.dsh-knowledge-remote-fields input:-webkit-autofill:focus {\n -webkit-text-fill-color: var(--knowledge-text);\n box-shadow: 0 0 0 1000px var(--knowledge-control) inset;\n caret-color: var(--knowledge-text);\n}\n.dsh-knowledge-timeout-field input::-webkit-inner-spin-button,\n.dsh-knowledge-timeout-field input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }\n.dsh-knowledge-timeout-field { max-width: 240px; }\n.dsh-knowledge-field-error { color: var(--knowledge-danger) !important; }\n\n.dsh-knowledge-settings-message,\n.dsh-knowledge-settings-note { margin: 0; color: var(--knowledge-text-secondary); font-size: 12px; }\n.dsh-knowledge-settings-message.is-success { color: var(--knowledge-success); }\n.dsh-knowledge-settings-message.is-error { color: var(--knowledge-danger); }\n.dsh-knowledge-settings-load-error {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n margin-top: 18px;\n padding: 12px 14px;\n border-radius: 12px;\n background: color-mix(in srgb, var(--knowledge-danger) 8%, transparent);\n color: var(--knowledge-danger);\n font-size: 13px;\n}\n.dsh-knowledge-settings-load-error p { margin: 0; }\n.dsh-knowledge-settings-load-error button {\n flex: none;\n min-height: 30px;\n padding: 5px 10px;\n border: 0;\n border-radius: 9px;\n background: var(--knowledge-control);\n color: var(--knowledge-text);\n cursor: pointer;\n font: inherit;\n}\n.dsh-knowledge-settings-actions { display: flex; justify-content: flex-end; gap: 8px; }\n.dsh-knowledge-settings-actions button {\n min-height: 34px;\n padding: 7px 13px;\n border: 0;\n border-radius: 10px;\n background: var(--knowledge-hover);\n color: var(--knowledge-text);\n cursor: pointer;\n font: inherit;\n font-size: 13px;\n}\n.dsh-knowledge-settings-actions button.is-primary { background: var(--knowledge-accent); color: var(--knowledge-on-accent); }\n.dsh-knowledge-settings-actions button:disabled { cursor: default; opacity: .45; }\n\n@media (max-width: 720px) {\n .dsh-knowledge-source-picker,\n .dsh-knowledge-remote-fields { grid-template-columns: 1fr; }\n .dsh-knowledge-settings-summary { font-size: 0; }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .dsh-knowledge-settings-card,\n .dsh-knowledge-settings-header,\n .dsh-knowledge-settings-summary i { transition: none; }\n}\n\n.dsh-knowledge-writeback-notice {\n display: grid;\n gap: 5px;\n min-width: 0;\n color: var(--knowledge-text-tertiary);\n font-size: 12px;\n line-height: 1.5;\n}\n.dsh-knowledge-writeback-summary {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 8px;\n min-width: 0;\n}\n.dsh-knowledge-writeback-notice strong {\n color: var(--knowledge-text-secondary);\n font-weight: 600;\n}\n.dsh-knowledge-writeback-notice button {\n min-height: 24px;\n padding: 0 9px;\n border: 1px solid var(--knowledge-border);\n border-radius: 7px;\n color: var(--knowledge-text-secondary);\n background: var(--knowledge-control);\n cursor: pointer;\n font: inherit;\n}\n.dsh-knowledge-writeback-notice button:disabled { cursor: default; opacity: .5; }\n.dsh-knowledge-writeback-destinations {\n display: flex;\n flex-wrap: wrap;\n gap: 2px 12px;\n min-width: 0;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.dsh-knowledge-writeback-destinations li {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n min-width: 0;\n max-width: 100%;\n padding: 0;\n border: 0;\n background: transparent;\n}\n.dsh-knowledge-writeback-base,\n.dsh-knowledge-writeback-separator {\n flex: none;\n}\n.dsh-knowledge-writeback-separator {\n color: var(--knowledge-text-tertiary);\n}\n.dsh-knowledge-writeback-destinations strong {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.dsh-knowledge-writeback-notice .dsh-knowledge-writeback-document {\n display: inline-flex;\n align-items: center;\n min-width: 0;\n min-height: 24px;\n padding: 0 3px;\n border: 0;\n border-radius: 4px;\n background: transparent;\n color: var(--knowledge-text-secondary);\n text-decoration: underline;\n text-decoration-color: transparent;\n text-underline-offset: 3px;\n transition: color 120ms ease, background-color 120ms ease, text-decoration-color 120ms ease;\n}\n.dsh-knowledge-writeback-notice .dsh-knowledge-writeback-document:hover {\n background: var(--knowledge-hover);\n color: var(--knowledge-text);\n text-decoration-color: currentColor;\n}\n.dsh-knowledge-writeback-document strong { color: inherit; }\n.dsh-knowledge-writeback-destinations small {\n flex: none;\n color: var(--knowledge-text-secondary);\n font: inherit;\n white-space: nowrap;\n}\n.dsh-knowledge-writeback-destinations small[data-disposition="written"] { color: var(--knowledge-success); }\n.dsh-knowledge-writeback-error {\n max-width: min(720px, 100%);\n margin: 0;\n color: var(--knowledge-danger);\n overflow-wrap: anywhere;\n}\n';
|
|
51
155
|
|
|
52
156
|
// src/knowledge-activity.css
|
|
53
|
-
var knowledge_activity_default = '.dsh-knowledge-activity-panel {\n display: flex;\n width: 100%;\n height: 100%;\n min-width: 0;\n min-height: 0;\n flex-direction: column;\n overflow: hidden;\n color: var(--knowledge-text);\n background: var(--knowledge-activity-surface);\n -webkit-backdrop-filter: var(--knowledge-host-glass-filter);\n backdrop-filter: var(--knowledge-host-glass-filter);\n box-shadow: inset 1px 0 0 var(--knowledge-border);\n font-family: var(--knowledge-font-family);\n font-size: 13px;\n line-height: 1.5;\n animation: dsh-knowledge-activity-enter 180ms cubic-bezier(.2, .8, .2, 1) both;\n}\n\n.dsh-knowledge-activity-panel *,\n.dsh-knowledge-activity-panel *::before,\n.dsh-knowledge-activity-panel *::after { box-sizing: border-box; }\n\n.dsh-knowledge-activity-panel :where(button, input) {\n -webkit-appearance: none;\n appearance: none;\n margin: 0;\n color: inherit;\n font: inherit;\n letter-spacing: inherit;\n}\n\n.dsh-knowledge-activity-header {\n display: flex;\n min-height: 58px;\n padding: 0 12px 0 15px;\n align-items: center;\n justify-content: space-between;\n gap: 10px;\n border-bottom: 1px solid var(--knowledge-border);\n background: color-mix(in srgb, var(--knowledge-raised) 54%, transparent);\n}\n\n.dsh-knowledge-activity-tabs {\n display: grid;\n min-height: 43px;\n flex: none;\n grid-template-columns: 1fr 1fr;\n gap: 4px;\n padding: 5px 10px;\n border-bottom: 1px solid var(--knowledge-border);\n background: color-mix(in srgb, var(--knowledge-raised) 30%, transparent);\n}\n.dsh-knowledge-activity-tabs button {\n display: inline-flex;\n min-width: 0;\n min-height: 32px;\n align-items: center;\n justify-content: center;\n gap: 6px;\n padding: 0 10px;\n border: 1px solid transparent;\n border-radius: 9px;\n color: var(--knowledge-text-tertiary);\n background: transparent;\n cursor: pointer;\n font-size: 12px;\n font-weight: 580;\n}\n.dsh-knowledge-activity-tabs button:hover { color: var(--knowledge-text); background: var(--knowledge-hover); }\n.dsh-knowledge-activity-tabs button.is-active {\n border-color: var(--knowledge-border);\n color: var(--knowledge-text);\n background: var(--knowledge-control);\n box-shadow: inset 0 1px 0 var(--knowledge-glare-light);\n}\n\n.dsh-knowledge-activity-title,\n.dsh-knowledge-activity-header-actions { display: flex; min-width: 0; align-items: center; gap: 9px; }\n.dsh-knowledge-activity-title > span:last-child { display: grid; min-width: 0; gap: 1px; }\n.dsh-knowledge-activity-title strong { overflow: hidden; font-size: 14px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-knowledge-activity-title small { overflow: hidden; color: var(--knowledge-text-tertiary); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }\n\n.dsh-knowledge-activity-mark,\n.dsh-knowledge-activity-document-icon,\n.dsh-knowledge-activity-row-icon {\n display: grid;\n flex: none;\n place-items: center;\n border: 1px solid color-mix(in srgb, var(--knowledge-accent) 18%, transparent);\n color: var(--knowledge-accent);\n background: color-mix(in srgb, var(--knowledge-accent) 6%, transparent);\n}\n\n.dsh-knowledge-activity-mark { width: 27px; height: 27px; border: 0; border-radius: 8px; background: transparent; }\n.dsh-knowledge-activity-icon-button {\n display: grid;\n width: 32px;\n height: 32px;\n flex: none;\n place-items: center;\n padding: 0;\n border: 1px solid transparent;\n border-radius: 9px;\n color: var(--knowledge-text-secondary);\n background: transparent;\n cursor: pointer;\n}\n.dsh-knowledge-activity-icon-button:hover { border-color: var(--knowledge-border); color: var(--knowledge-text); background: var(--knowledge-hover); }\n.dsh-knowledge-activity-icon-button:focus-visible,\n.dsh-knowledge-activity-panel button:focus-visible,\n.dsh-knowledge-activity-panel input:focus-visible { outline: 2px solid var(--knowledge-accent); outline-offset: 2px; }\n\n.dsh-knowledge-activity-browser,\n.dsh-knowledge-activity-reader {\n display: flex;\n min-height: 0;\n flex: 1;\n flex-direction: column;\n overflow: hidden;\n padding: 14px 14px 16px;\n}\n\n.dsh-knowledge-activity-search {\n display: flex;\n min-height: 40px;\n flex: none;\n align-items: center;\n gap: 8px;\n padding: 0 10px;\n border: 1px solid var(--knowledge-border);\n border-radius: 10px;\n color: var(--knowledge-text-tertiary);\n background: var(--knowledge-control);\n}\n.dsh-knowledge-activity-search:focus-within { border-color: color-mix(in srgb, var(--knowledge-accent) 50%, var(--knowledge-border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--knowledge-accent) 10%, transparent); }\n.dsh-knowledge-activity-search input { min-width: 0; height: 38px; flex: 1; padding: 0; border: 0; outline: 0 !important; color: var(--knowledge-text); background: transparent; box-shadow: none; }\n.dsh-knowledge-activity-search input::placeholder { color: var(--knowledge-text-tertiary); opacity: 1; }\n.dsh-knowledge-activity-search > button { display: grid; width: 28px; height: 28px; place-items: center; padding: 0; border: 0; border-radius: 8px; color: var(--knowledge-text-tertiary); background: transparent; cursor: pointer; }\n.dsh-knowledge-activity-search > button:hover { color: var(--knowledge-text); background: var(--knowledge-hover); }\n\n.dsh-knowledge-activity-scope { position: relative; z-index: 3; flex: none; margin-top: 10px; }\n.dsh-knowledge-activity-breadcrumbs {\n display: flex;\n min-height: 37px;\n flex: none;\n align-items: center;\n gap: 1px;\n overflow-x: auto;\n padding: 5px 1px 2px;\n color: var(--knowledge-text-tertiary);\n scrollbar-width: none;\n}\n.dsh-knowledge-activity-breadcrumbs::-webkit-scrollbar { display: none; }\n.dsh-knowledge-activity-breadcrumbs span { display: inline-flex; flex: none; align-items: center; gap: 1px; }\n.dsh-knowledge-activity-breadcrumbs button {\n max-width: 130px;\n min-height: 28px;\n overflow: hidden;\n padding: 0 7px;\n border: 0;\n border-radius: 7px;\n color: inherit;\n text-overflow: ellipsis;\n white-space: nowrap;\n background: transparent;\n cursor: pointer;\n font-size: 11px;\n}\n.dsh-knowledge-activity-breadcrumbs button:hover { color: var(--knowledge-text); background: var(--knowledge-hover); }\n.dsh-knowledge-activity-breadcrumbs button[aria-current="location"] { color: var(--knowledge-text-secondary); font-weight: 620; }\n.dsh-knowledge-activity-scope-trigger {\n display: grid;\n width: 100%;\n min-height: 48px;\n grid-template-columns: 30px minmax(0, 1fr) 20px;\n align-items: center;\n gap: 8px;\n padding: 5px 9px;\n border: 1px solid var(--knowledge-border);\n border-radius: 10px;\n text-align: left;\n background: color-mix(in srgb, var(--knowledge-control) 72%, transparent);\n cursor: pointer;\n}\n.dsh-knowledge-activity-scope-trigger:hover { background: var(--knowledge-control); }\n.dsh-knowledge-activity-scope-trigger > span:nth-child(2) { display: grid; min-width: 0; gap: 1px; }\n.dsh-knowledge-activity-scope-trigger small { color: var(--knowledge-text-tertiary); font-size: 10px; }\n.dsh-knowledge-activity-scope-trigger strong { overflow: hidden; font-size: 12px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-knowledge-activity-scope-trigger > svg { color: var(--knowledge-text-tertiary); transition: transform 140ms ease; }\n.dsh-knowledge-activity-scope-trigger > svg.is-open { transform: rotate(180deg); }\n.dsh-knowledge-activity-scope-icon { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; color: var(--knowledge-accent); background: color-mix(in srgb, var(--knowledge-accent) 8%, transparent); }\n.dsh-knowledge-activity-scope-menu {\n position: absolute;\n z-index: 6;\n top: calc(100% + 6px);\n right: 0;\n left: 0;\n max-height: min(320px, 44vh);\n overflow-y: auto;\n padding: 5px;\n border: 1px solid var(--knowledge-border);\n border-radius: 12px;\n background: var(--knowledge-activity-surface);\n box-shadow: 0 16px 38px rgb(24 30 32 / 18%), inset 0 1px 0 var(--knowledge-glare-light);\n -webkit-backdrop-filter: var(--knowledge-glass-filter);\n backdrop-filter: var(--knowledge-glass-filter);\n}\n.dsh-knowledge-activity-scope-menu button { display: flex; width: 100%; min-height: 46px; align-items: center; gap: 9px; padding: 6px 9px; border: 0; border-radius: 8px; text-align: left; background: transparent; cursor: pointer; }\n.dsh-knowledge-activity-scope-menu button:hover { background: var(--knowledge-hover); }\n.dsh-knowledge-activity-scope-menu button.is-active { background: var(--knowledge-control); }\n.dsh-knowledge-activity-scope-menu button > svg { flex: none; color: var(--knowledge-text-secondary); }\n.dsh-knowledge-activity-scope-menu button > span { display: grid; min-width: 0; gap: 1px; }\n.dsh-knowledge-activity-scope-menu button strong { overflow: hidden; font-size: 12px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-knowledge-activity-scope-menu button small { color: var(--knowledge-text-tertiary); font-size: 10px; }\n\n.dsh-knowledge-activity-list-heading {\n display: flex;\n min-height: 46px;\n flex: none;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n padding: 8px 2px 6px;\n border-bottom: 1px solid var(--knowledge-border);\n}\n.dsh-knowledge-activity-list-heading > span { display: grid; min-width: 0; }\n.dsh-knowledge-activity-list-heading strong { overflow: hidden; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-knowledge-activity-list-heading small { color: var(--knowledge-text-tertiary); font-size: 11px; }\n\n.dsh-knowledge-activity-list {\n min-height: 0;\n flex: 1;\n overflow-y: auto;\n overscroll-behavior: contain;\n padding: 0 0 20px;\n scrollbar-color: color-mix(in srgb, var(--knowledge-text-tertiary) 35%, transparent) transparent;\n scrollbar-width: thin;\n}\n.dsh-knowledge-activity-row {\n display: flex;\n width: 100%;\n min-height: 61px;\n align-items: center;\n gap: 9px;\n padding: 8px 6px;\n border: 0;\n border-bottom: 1px solid color-mix(in srgb, var(--knowledge-border) 72%, transparent);\n border-radius: 0;\n text-align: left;\n background: transparent;\n cursor: pointer;\n}\n.dsh-knowledge-activity-row:hover { border-radius: 8px; background: var(--knowledge-hover); }\n.dsh-knowledge-activity-row:disabled { cursor: default; opacity: .58; }\n.dsh-knowledge-activity-row:disabled:hover { border-radius: 0; background: transparent; }\n.dsh-knowledge-activity-row-icon { width: 27px; height: 27px; border: 0; border-radius: 0; background: transparent; }\n.dsh-knowledge-activity-row-copy { display: grid; min-width: 0; flex: 1; gap: 2px; }\n.dsh-knowledge-activity-row-copy strong,\n.dsh-knowledge-activity-row-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-knowledge-activity-row-copy strong { color: var(--knowledge-text); font-size: 13px; font-weight: 600; }\n.dsh-knowledge-activity-row-copy small { color: var(--knowledge-text-tertiary); font-size: 10px; }\n.dsh-knowledge-activity-row-meta { display: grid; flex: none; justify-items: end; align-items: center; gap: 3px; color: var(--knowledge-text-tertiary); font-size: 10px; }\n.dsh-knowledge-activity-row-meta em { padding: 1px 5px; border-radius: 999px; color: var(--knowledge-text-secondary); background: var(--knowledge-control); font-style: normal; }\n.dsh-knowledge-activity-load-more { display: block; min-height: 36px; margin: 8px auto 0; padding: 0 14px; border: 1px solid var(--knowledge-border); border-radius: 10px; color: var(--knowledge-text-secondary); background: var(--knowledge-control); cursor: pointer; }\n.dsh-knowledge-activity-load-more:hover:not(:disabled) { color: var(--knowledge-text); background: var(--knowledge-hover); }\n\n.dsh-knowledge-activity-reader-bar {\n display: flex;\n min-height: 38px;\n flex: none;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n border-bottom: 1px solid var(--knowledge-border);\n color: var(--knowledge-text-tertiary);\n font-size: 11px;\n}\n.dsh-knowledge-activity-back { display: inline-flex; min-height: 32px; align-items: center; gap: 4px; padding: 0 7px 0 4px; border: 0; border-radius: 8px; color: var(--knowledge-text-secondary); background: transparent; cursor: pointer; font-size: 12px !important; }\n.dsh-knowledge-activity-back:hover { color: var(--knowledge-text); background: var(--knowledge-hover); }\n.dsh-knowledge-activity-document-heading { display: flex; flex: none; align-items: center; gap: 10px; padding: 16px 4px 13px; }\n.dsh-knowledge-activity-document-icon { width: 36px; height: 36px; border-radius: 11px; }\n.dsh-knowledge-activity-document-heading > div { min-width: 0; }\n.dsh-knowledge-activity-document-heading h2 { overflow: hidden; margin: 0; font-size: 16px; line-height: 22px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-knowledge-activity-document-heading p { overflow: hidden; margin: 1px 0 0; color: var(--knowledge-text-tertiary); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }\n\n.dsh-knowledge-activity-markdown {\n min-height: 0;\n flex: 1;\n overflow-y: auto;\n padding: 0 5px 44px;\n color: var(--knowledge-text);\n font-size: 13px;\n line-height: 1.75;\n overflow-wrap: anywhere;\n scrollbar-color: color-mix(in srgb, var(--knowledge-text-tertiary) 35%, transparent) transparent;\n scrollbar-width: thin;\n}\n.dsh-knowledge-activity-markdown :where(h1, h2, h3, h4) { margin: 1.35em 0 .55em; color: var(--knowledge-text); line-height: 1.35; font-weight: 680; }\n.dsh-knowledge-activity-markdown h1 { font-size: 18px; }\n.dsh-knowledge-activity-markdown h2 { padding-bottom: .35em; border-bottom: 1px solid var(--knowledge-border); font-size: 16px; }\n.dsh-knowledge-activity-markdown h3 { font-size: 14px; }\n.dsh-knowledge-activity-markdown :where(p, ul, ol, blockquote, pre, table) { margin: .7em 0; }\n.dsh-knowledge-activity-markdown :where(ul, ol) { padding-left: 1.5em; }\n.dsh-knowledge-activity-markdown a { color: var(--knowledge-accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }\n.dsh-knowledge-activity-markdown blockquote { margin-left: 0; padding: .15em 0 .15em 12px; border-left: 3px solid color-mix(in srgb, var(--knowledge-accent) 40%, transparent); color: var(--knowledge-text-secondary); }\n.dsh-knowledge-activity-markdown :where(code, pre) { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }\n.dsh-knowledge-activity-markdown code { padding: .14em .32em; border-radius: 5px; background: var(--knowledge-control); font-size: .92em; }\n.dsh-knowledge-activity-markdown pre { overflow-x: auto; padding: 11px 12px; border: 1px solid var(--knowledge-border); border-radius: 10px; background: var(--knowledge-control); }\n.dsh-knowledge-activity-markdown pre code { padding: 0; background: transparent; }\n.dsh-knowledge-activity-markdown table { width: 100%; border-collapse: collapse; font-size: 12px; }\n.dsh-knowledge-activity-markdown :where(th, td) { padding: 6px 7px; border: 1px solid var(--knowledge-border); text-align: left; }\n.dsh-knowledge-activity-markdown img { display: block; max-width: 100%; height: auto; border-radius: 10px; }\n\n.dsh-knowledge-activity-state,\n.dsh-knowledge-activity-error,\n.dsh-knowledge-activity-empty { margin: auto; text-align: center; }\n.dsh-knowledge-activity-state { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 28px 10px; color: var(--knowledge-text-tertiary); }\n.dsh-knowledge-activity-state > span { width: 8px; height: 8px; border: 2px solid var(--knowledge-border); border-top-color: var(--knowledge-accent); border-radius: 50%; animation: dsh-knowledge-activity-spin .8s linear infinite; }\n.dsh-knowledge-activity-error,\n.dsh-knowledge-activity-empty { display: grid; max-width: 260px; justify-items: center; gap: 6px; padding: 32px 12px; }\n.dsh-knowledge-activity-error strong,\n.dsh-knowledge-activity-empty strong { font-size: 13px; font-weight: 650; }\n.dsh-knowledge-activity-error p,\n.dsh-knowledge-activity-empty p { margin: 0; color: var(--knowledge-text-tertiary); font-size: 11px; line-height: 1.65; }\n.dsh-knowledge-activity-empty > span { display: grid; width: 40px; height: 40px; margin-bottom: 3px; place-items: center; border-radius: 13px; color: var(--knowledge-text-secondary); background: var(--knowledge-control); }\n.dsh-knowledge-activity-error > button { min-height: 34px; margin-top: 6px; padding: 0 13px; border: 1px solid var(--knowledge-border); border-radius: 9px; background: var(--knowledge-control); cursor: pointer; }\n.dsh-knowledge-activity-error > button:hover { background: var(--knowledge-hover); }\n\n@keyframes dsh-knowledge-activity-enter { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: translateX(0); } }\n@keyframes dsh-knowledge-activity-spin { to { transform: rotate(360deg); } }\n\n@media (max-width: 460px) {\n .dsh-knowledge-activity-header { padding-inline: 10px; }\n .dsh-knowledge-activity-browser,\n .dsh-knowledge-activity-reader { padding: 10px 10px max(14px, env(safe-area-inset-bottom)); }\n .dsh-knowledge-activity-search input { font-size: 16px; }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .dsh-knowledge-activity-panel,\n .dsh-knowledge-activity-state > span { animation: none; transition: none; }\n}\n';
|
|
157
|
+
var knowledge_activity_default = '.dsh-knowledge-activity-viewport {\n width: 100%;\n height: 100%;\n min-width: 0;\n overflow: hidden;\n contain: layout paint;\n}\n\n.dsh-knowledge-activity-panel {\n display: flex;\n width: 100%;\n height: 100%;\n min-width: 0;\n min-height: 0;\n flex-direction: column;\n overflow: hidden;\n color: var(--knowledge-text);\n background: var(--activity-surface);\n -webkit-backdrop-filter: var(--knowledge-embedded-filter);\n backdrop-filter: var(--knowledge-embedded-filter);\n box-shadow: inset 1px 0 0 var(--knowledge-border);\n font-family: var(--knowledge-font-family);\n font-size: 13px;\n line-height: 1.5;\n}\n\n.dsh-knowledge-activity-panel *,\n.dsh-knowledge-activity-panel *::before,\n.dsh-knowledge-activity-panel *::after { box-sizing: border-box; }\n\n.dsh-knowledge-activity-panel ::selection { background: var(--selection-background); color: var(--selection-text); }\n\n.dsh-knowledge-activity-panel :where(button, input) {\n -webkit-appearance: none;\n appearance: none;\n margin: 0;\n color: inherit;\n font: inherit;\n letter-spacing: inherit;\n}\n\n.dsh-knowledge-activity-header {\n display: flex;\n min-height: 58px;\n padding: 0 12px 0 15px;\n align-items: center;\n justify-content: space-between;\n gap: 10px;\n border-bottom: 1px solid var(--knowledge-border);\n background: transparent;\n}\n\n.dsh-knowledge-activity-tabs {\n display: grid;\n min-height: 43px;\n flex: none;\n grid-template-columns: 1fr 1fr;\n gap: 4px;\n padding: 5px 10px;\n border-bottom: 1px solid var(--knowledge-border);\n background: transparent;\n}\n.dsh-knowledge-activity-tabs button {\n display: inline-flex;\n min-width: 0;\n min-height: 32px;\n align-items: center;\n justify-content: center;\n gap: 6px;\n padding: 0 10px;\n border: 1px solid transparent;\n border-radius: 9px;\n color: var(--knowledge-text-tertiary);\n background: transparent;\n cursor: pointer;\n font-size: 12px;\n font-weight: 580;\n}\n.dsh-knowledge-activity-tabs button:hover { color: var(--knowledge-text); background: var(--knowledge-hover); }\n.dsh-knowledge-activity-tabs button.is-active {\n border-color: var(--knowledge-border);\n color: var(--knowledge-text);\n background: var(--knowledge-embedded-control);\n box-shadow: inset 0 1px 0 var(--knowledge-glare-light);\n}\n\n.dsh-knowledge-activity-title,\n.dsh-knowledge-activity-header-actions { display: flex; min-width: 0; align-items: center; gap: 9px; }\n.dsh-knowledge-activity-title > span:last-child { display: grid; min-width: 0; gap: 1px; }\n.dsh-knowledge-activity-title strong { overflow: hidden; font-size: 14px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-knowledge-activity-title small { overflow: hidden; color: var(--knowledge-text-tertiary); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }\n\n.dsh-knowledge-activity-mark,\n.dsh-knowledge-activity-document-icon,\n.dsh-knowledge-activity-row-icon {\n display: grid;\n flex: none;\n place-items: center;\n border: 1px solid color-mix(in srgb, var(--knowledge-accent) 18%, transparent);\n color: var(--knowledge-accent);\n background: color-mix(in srgb, var(--knowledge-accent) 6%, transparent);\n}\n\n.dsh-knowledge-activity-mark { width: 27px; height: 27px; border: 0; border-radius: 8px; background: transparent; }\n.dsh-knowledge-activity-icon-button {\n display: grid;\n width: 32px;\n height: 32px;\n flex: none;\n place-items: center;\n padding: 0;\n border: 1px solid transparent;\n border-radius: 9px;\n color: var(--knowledge-text-secondary);\n background: transparent;\n cursor: pointer;\n}\n.dsh-knowledge-activity-icon-button:hover { border-color: var(--knowledge-border); color: var(--knowledge-text); background: var(--knowledge-hover); }\n.dsh-knowledge-activity-icon-button:focus-visible,\n.dsh-knowledge-activity-panel button:focus-visible,\n.dsh-knowledge-activity-panel input:focus-visible { outline: 2px solid var(--knowledge-accent); outline-offset: 2px; }\n\n.dsh-knowledge-activity-browser,\n.dsh-knowledge-activity-reader {\n display: flex;\n min-height: 0;\n flex: 1;\n flex-direction: column;\n overflow: hidden;\n padding: 14px 14px 16px;\n}\n\n.dsh-knowledge-activity-search {\n display: flex;\n min-height: 40px;\n flex: none;\n align-items: center;\n gap: 8px;\n padding: 0 10px;\n border: 1px solid var(--knowledge-border);\n border-radius: 10px;\n color: var(--knowledge-text-tertiary);\n background: var(--knowledge-embedded-control);\n}\n.dsh-knowledge-activity-search:focus-within { border-color: color-mix(in srgb, var(--knowledge-accent) 50%, var(--knowledge-border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--knowledge-accent) 10%, transparent); }\n.dsh-knowledge-activity-search input { min-width: 0; height: 38px; flex: 1; padding: 0; border: 0; outline: 0 !important; color: var(--knowledge-text); background: transparent; box-shadow: none; }\n.dsh-knowledge-activity-search input::placeholder { color: var(--knowledge-text-tertiary); opacity: 1; }\n.dsh-knowledge-activity-search > button { display: grid; width: 28px; height: 28px; place-items: center; padding: 0; border: 0; border-radius: 8px; color: var(--knowledge-text-tertiary); background: transparent; cursor: pointer; }\n.dsh-knowledge-activity-search > button:hover { color: var(--knowledge-text); background: var(--knowledge-hover); }\n\n.dsh-knowledge-activity-scope { position: relative; z-index: 3; flex: none; margin-top: 10px; }\n.dsh-knowledge-activity-breadcrumbs {\n display: flex;\n min-height: 37px;\n flex: none;\n align-items: center;\n gap: 1px;\n overflow-x: auto;\n padding: 5px 1px 2px;\n color: var(--knowledge-text-tertiary);\n scrollbar-width: none;\n}\n.dsh-knowledge-activity-breadcrumbs::-webkit-scrollbar { display: none; }\n.dsh-knowledge-activity-breadcrumbs span { display: inline-flex; flex: none; align-items: center; gap: 1px; }\n.dsh-knowledge-activity-breadcrumbs button {\n max-width: 130px;\n min-height: 28px;\n overflow: hidden;\n padding: 0 7px;\n border: 0;\n border-radius: 7px;\n color: inherit;\n text-overflow: ellipsis;\n white-space: nowrap;\n background: transparent;\n cursor: pointer;\n font-size: 11px;\n}\n.dsh-knowledge-activity-breadcrumbs button:hover { color: var(--knowledge-text); background: var(--knowledge-hover); }\n.dsh-knowledge-activity-breadcrumbs button[aria-current="location"] { color: var(--knowledge-text-secondary); font-weight: 620; }\n.dsh-knowledge-activity-scope-trigger {\n display: grid;\n width: 100%;\n min-height: 48px;\n grid-template-columns: 30px minmax(0, 1fr) 20px;\n align-items: center;\n gap: 8px;\n padding: 5px 9px;\n border: 1px solid var(--knowledge-border);\n border-radius: 10px;\n text-align: left;\n background: color-mix(in srgb, var(--knowledge-embedded-control) 72%, transparent);\n cursor: pointer;\n}\n.dsh-knowledge-activity-scope-trigger:hover { background: var(--knowledge-embedded-control); }\n.dsh-knowledge-activity-scope-trigger > span:nth-child(2) { display: grid; min-width: 0; gap: 1px; }\n.dsh-knowledge-activity-scope-trigger small { color: var(--knowledge-text-tertiary); font-size: 10px; }\n.dsh-knowledge-activity-scope-trigger strong { overflow: hidden; font-size: 12px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-knowledge-activity-scope-trigger > svg { color: var(--knowledge-text-tertiary); transition: transform 140ms ease; }\n.dsh-knowledge-activity-scope-trigger > svg.is-open { transform: rotate(180deg); }\n.dsh-knowledge-activity-scope-icon { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; color: var(--knowledge-accent); background: color-mix(in srgb, var(--knowledge-accent) 8%, transparent); }\n.dsh-knowledge-activity-scope-menu {\n position: absolute;\n z-index: 6;\n top: calc(100% + 6px);\n right: 0;\n left: 0;\n max-height: min(320px, 44vh);\n overflow-y: auto;\n padding: 5px;\n border: 1px solid var(--knowledge-border);\n border-radius: 12px;\n background: var(--dialog-surface);\n box-shadow: 0 16px 38px rgb(24 30 32 / 18%), inset 0 1px 0 var(--knowledge-glare-light);\n -webkit-backdrop-filter: none;\n backdrop-filter: none;\n}\n.dsh-knowledge-activity-scope-menu button { display: flex; width: 100%; min-height: 46px; align-items: center; gap: 9px; padding: 6px 9px; border: 0; border-radius: 8px; text-align: left; background: transparent; cursor: pointer; }\n.dsh-knowledge-activity-scope-menu button:hover { background: var(--knowledge-hover); }\n.dsh-knowledge-activity-scope-menu button.is-active { background: var(--knowledge-embedded-control); }\n.dsh-knowledge-activity-scope-menu button > svg { flex: none; color: var(--knowledge-text-secondary); }\n.dsh-knowledge-activity-scope-menu button > span { display: grid; min-width: 0; gap: 1px; }\n.dsh-knowledge-activity-scope-menu button strong { overflow: hidden; font-size: 12px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-knowledge-activity-scope-menu button small { color: var(--knowledge-text-tertiary); font-size: 10px; }\n\n.dsh-knowledge-activity-list-heading {\n display: flex;\n min-height: 46px;\n flex: none;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n padding: 8px 2px 6px;\n border-bottom: 1px solid var(--knowledge-border);\n}\n.dsh-knowledge-activity-list-heading > span { display: grid; min-width: 0; }\n.dsh-knowledge-activity-list-heading strong { overflow: hidden; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-knowledge-activity-list-heading small { color: var(--knowledge-text-tertiary); font-size: 11px; }\n\n.dsh-knowledge-activity-list {\n min-height: 0;\n flex: 1;\n overflow-y: auto;\n overscroll-behavior: contain;\n padding: 0 0 20px;\n scrollbar-color: color-mix(in srgb, var(--knowledge-text-tertiary) 35%, transparent) transparent;\n scrollbar-width: thin;\n}\n.dsh-knowledge-activity-row {\n display: flex;\n width: 100%;\n min-height: 61px;\n align-items: center;\n gap: 9px;\n padding: 8px 6px;\n border: 0;\n border-bottom: 1px solid color-mix(in srgb, var(--knowledge-border) 72%, transparent);\n border-radius: 0;\n text-align: left;\n background: transparent;\n cursor: pointer;\n}\n.dsh-knowledge-activity-row:hover { border-radius: 8px; background: var(--knowledge-hover); }\n.dsh-knowledge-activity-row:disabled { cursor: default; opacity: .58; }\n.dsh-knowledge-activity-row:disabled:hover { border-radius: 0; background: transparent; }\n.dsh-knowledge-activity-row-icon { width: 27px; height: 27px; border: 0; border-radius: 0; background: transparent; }\n.dsh-knowledge-activity-row-copy { display: grid; min-width: 0; flex: 1; gap: 2px; }\n.dsh-knowledge-activity-row-copy strong,\n.dsh-knowledge-activity-row-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-knowledge-activity-row-copy strong { color: var(--knowledge-text); font-size: 13px; font-weight: 600; }\n.dsh-knowledge-activity-row-copy small { color: var(--knowledge-text-tertiary); font-size: 10px; }\n.dsh-knowledge-activity-row-meta { display: grid; flex: none; justify-items: end; align-items: center; gap: 3px; color: var(--knowledge-text-tertiary); font-size: 10px; }\n.dsh-knowledge-activity-row-meta em { padding: 1px 5px; border-radius: 999px; color: var(--knowledge-text-secondary); background: var(--knowledge-embedded-control); font-style: normal; }\n.dsh-knowledge-activity-load-more { display: block; min-height: 36px; margin: 8px auto 0; padding: 0 14px; border: 1px solid var(--knowledge-border); border-radius: 10px; color: var(--knowledge-text-secondary); background: var(--knowledge-embedded-control); cursor: pointer; }\n.dsh-knowledge-activity-load-more:hover:not(:disabled) { color: var(--knowledge-text); background: var(--knowledge-hover); }\n\n.dsh-knowledge-activity-reader-bar {\n display: flex;\n min-height: 38px;\n flex: none;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n border-bottom: 1px solid var(--knowledge-border);\n color: var(--knowledge-text-tertiary);\n font-size: 11px;\n}\n.dsh-knowledge-activity-back { display: inline-flex; min-height: 32px; align-items: center; gap: 4px; padding: 0 7px 0 4px; border: 0; border-radius: 8px; color: var(--knowledge-text-secondary); background: transparent; cursor: pointer; font-size: 12px !important; }\n.dsh-knowledge-activity-back:hover { color: var(--knowledge-text); background: var(--knowledge-hover); }\n.dsh-knowledge-activity-document-heading { display: flex; flex: none; align-items: center; gap: 10px; padding: 16px 4px 13px; }\n.dsh-knowledge-activity-document-icon { width: 36px; height: 36px; border-radius: 11px; }\n.dsh-knowledge-activity-document-heading > div { min-width: 0; }\n.dsh-knowledge-activity-document-heading h2 { overflow: hidden; margin: 0; font-size: 16px; line-height: 22px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-knowledge-activity-document-heading p { overflow: hidden; margin: 1px 0 0; color: var(--knowledge-text-tertiary); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }\n\n.dsh-knowledge-activity-markdown {\n min-height: 0;\n flex: 1;\n overflow-y: auto;\n padding: 0 5px 44px;\n color: var(--knowledge-text);\n font-size: 13px;\n line-height: 1.75;\n overflow-wrap: anywhere;\n scrollbar-color: color-mix(in srgb, var(--knowledge-text-tertiary) 35%, transparent) transparent;\n scrollbar-width: thin;\n}\n.dsh-knowledge-activity-markdown :where(h1, h2, h3, h4, h5, h6) { margin: 1.35em 0 .55em; color: var(--knowledge-text); line-height: 1.35; font-weight: 650; }\n.dsh-knowledge-activity-markdown h1 { font-size: 18px; }\n.dsh-knowledge-activity-markdown h2 { padding-bottom: .35em; border-bottom: 1px solid var(--knowledge-border); font-size: 16px; }\n.dsh-knowledge-activity-markdown h3 { font-size: 14px; }\n.dsh-knowledge-activity-markdown :where(h4, h5, h6) { font-size: 13px; }\n.dsh-knowledge-activity-markdown hr { height: 1px; margin: 18px 0; border: 0; background: var(--knowledge-border); }\n.dsh-knowledge-activity-markdown summary { cursor: pointer; color: var(--knowledge-text); }\n.dsh-knowledge-activity-markdown :where(p, ul, ol, blockquote, pre, table) { margin: .7em 0; }\n.dsh-knowledge-activity-markdown :where(ul, ol) { padding-left: 1.5em; }\n.dsh-knowledge-activity-markdown a { color: var(--knowledge-accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }\n.dsh-knowledge-activity-markdown blockquote { margin-left: 0; padding: .15em 0 .15em 12px; border-left: 3px solid color-mix(in srgb, var(--knowledge-accent) 40%, transparent); color: var(--knowledge-text-secondary); }\n.dsh-knowledge-activity-markdown :where(code, pre) { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }\n.dsh-knowledge-activity-markdown code { padding: .14em .32em; border-radius: 5px; background: var(--knowledge-embedded-control); font-size: .92em; }\n.dsh-knowledge-activity-markdown pre { overflow-x: auto; padding: 11px 12px; border: 1px solid var(--knowledge-border); border-radius: 10px; background: var(--knowledge-embedded-control); }\n.dsh-knowledge-activity-markdown pre code { padding: 0; background: transparent; }\n.dsh-knowledge-activity-markdown table { width: 100%; border-collapse: collapse; font-size: 12px; }\n.dsh-knowledge-activity-markdown :where(th, td) { padding: 6px 7px; border: 1px solid var(--knowledge-border); text-align: left; }\n.dsh-knowledge-activity-markdown img { display: block; max-width: 100%; height: auto; border-radius: 10px; }\n\n.dsh-knowledge-activity-state,\n.dsh-knowledge-activity-error,\n.dsh-knowledge-activity-empty { margin: auto; text-align: center; }\n.dsh-knowledge-activity-state { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 28px 10px; color: var(--knowledge-text-tertiary); }\n.dsh-knowledge-activity-state > span { width: 8px; height: 8px; border: 2px solid var(--knowledge-border); border-top-color: var(--knowledge-accent); border-radius: 50%; animation: dsh-knowledge-activity-spin .8s linear infinite; }\n.dsh-knowledge-activity-error,\n.dsh-knowledge-activity-empty { display: grid; max-width: 260px; justify-items: center; gap: 6px; padding: 32px 12px; }\n.dsh-knowledge-activity-error strong,\n.dsh-knowledge-activity-empty strong { font-size: 13px; font-weight: 650; }\n.dsh-knowledge-activity-error p,\n.dsh-knowledge-activity-empty p { margin: 0; color: var(--knowledge-text-tertiary); font-size: 11px; line-height: 1.65; }\n.dsh-knowledge-activity-empty > span { display: grid; width: 40px; height: 40px; margin-bottom: 3px; place-items: center; border-radius: 13px; color: var(--knowledge-text-secondary); background: var(--knowledge-embedded-control); }\n.dsh-knowledge-activity-error > button { min-height: 34px; margin-top: 6px; padding: 0 13px; border: 1px solid var(--knowledge-border); border-radius: 9px; background: var(--knowledge-embedded-control); cursor: pointer; }\n.dsh-knowledge-activity-error > button:hover { background: var(--knowledge-hover); }\n\n@keyframes dsh-knowledge-activity-spin { to { transform: rotate(360deg); } }\n\n@media (max-width: 460px) {\n .dsh-knowledge-activity-header { padding-inline: 10px; }\n .dsh-knowledge-activity-browser,\n .dsh-knowledge-activity-reader { padding: 10px 10px max(14px, env(safe-area-inset-bottom)); }\n .dsh-knowledge-activity-search input { font-size: 16px; }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .dsh-knowledge-activity-panel,\n .dsh-knowledge-activity-state > span,\n .dsh-knowledge-activity-scope-trigger > svg { animation: none; transition: none; }\n}\n';
|
|
54
158
|
|
|
55
159
|
// src/knowledge-activity-panel.tsx
|
|
56
160
|
var import_react2 = require("react");
|
|
@@ -136,6 +240,20 @@ function isRecord(value) {
|
|
|
136
240
|
var import_react = require("react");
|
|
137
241
|
var import_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
138
242
|
|
|
243
|
+
// src/latest-request.ts
|
|
244
|
+
var LatestRequest = class {
|
|
245
|
+
current;
|
|
246
|
+
start() {
|
|
247
|
+
this.cancel();
|
|
248
|
+
this.current = new AbortController();
|
|
249
|
+
return this.current.signal;
|
|
250
|
+
}
|
|
251
|
+
cancel() {
|
|
252
|
+
this.current?.abort();
|
|
253
|
+
this.current = void 0;
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
|
|
139
257
|
// node_modules/dompurify/dist/purify.es.mjs
|
|
140
258
|
function _arrayLikeToArray(r, a) {
|
|
141
259
|
(null == a || a > r.length) && (a = r.length);
|
|
@@ -3008,7 +3126,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
3008
3126
|
function KnowledgeActivityNotes({ sessionId, projectId, controller }) {
|
|
3009
3127
|
const initial = controller.selection(sessionId);
|
|
3010
3128
|
const [folderId, setFolderId] = (0, import_react.useState)(initial.noteFolderId ?? null);
|
|
3011
|
-
const [crumbs, setCrumbs] = (0, import_react.useState)([{ id: null, name: "\u5168\u90E8\u7B14\u8BB0" }]);
|
|
3129
|
+
const [crumbs, setCrumbs] = (0, import_react.useState)(initial.noteCrumbs ?? [{ id: null, name: "\u5168\u90E8\u7B14\u8BB0" }]);
|
|
3012
3130
|
const [selectedId, setSelectedId] = (0, import_react.useState)(initial.noteDocumentId);
|
|
3013
3131
|
const [nodes, setNodes] = (0, import_react.useState)([]);
|
|
3014
3132
|
const [content, setContent] = (0, import_react.useState)();
|
|
@@ -3017,8 +3135,10 @@ function KnowledgeActivityNotes({ sessionId, projectId, controller }) {
|
|
|
3017
3135
|
const [listState, setListState] = (0, import_react.useState)("loading");
|
|
3018
3136
|
const [contentState, setContentState] = (0, import_react.useState)("idle");
|
|
3019
3137
|
const [error, setError] = (0, import_react.useState)("");
|
|
3138
|
+
const listRequest = (0, import_react.useRef)(new LatestRequest());
|
|
3020
3139
|
const [refresh, setRefresh] = (0, import_react.useState)(0);
|
|
3021
|
-
const loadNodes = (0, import_react.useCallback)(async (
|
|
3140
|
+
const loadNodes = (0, import_react.useCallback)(async () => {
|
|
3141
|
+
const signal = listRequest.current.start();
|
|
3022
3142
|
setListState("loading");
|
|
3023
3143
|
setError("");
|
|
3024
3144
|
try {
|
|
@@ -3029,6 +3149,7 @@ function KnowledgeActivityNotes({ sessionId, projectId, controller }) {
|
|
|
3029
3149
|
query,
|
|
3030
3150
|
...signal === void 0 ? {} : { signal }
|
|
3031
3151
|
});
|
|
3152
|
+
if (signal.aborted) return;
|
|
3032
3153
|
setNodes(value);
|
|
3033
3154
|
setListState("ready");
|
|
3034
3155
|
} catch (reason) {
|
|
@@ -3038,10 +3159,9 @@ function KnowledgeActivityNotes({ sessionId, projectId, controller }) {
|
|
|
3038
3159
|
}
|
|
3039
3160
|
}, [folderId, projectId, query, sessionId]);
|
|
3040
3161
|
(0, import_react.useEffect)(() => {
|
|
3041
|
-
|
|
3042
|
-
void loadNodes(abort.signal);
|
|
3162
|
+
void loadNodes();
|
|
3043
3163
|
return () => {
|
|
3044
|
-
|
|
3164
|
+
listRequest.current.cancel();
|
|
3045
3165
|
};
|
|
3046
3166
|
}, [loadNodes, refresh]);
|
|
3047
3167
|
(0, import_react.useEffect)(() => {
|
|
@@ -3059,6 +3179,7 @@ function KnowledgeActivityNotes({ sessionId, projectId, controller }) {
|
|
|
3059
3179
|
...projectId === void 0 ? {} : { projectId },
|
|
3060
3180
|
signal: abort.signal
|
|
3061
3181
|
}).then((value) => {
|
|
3182
|
+
if (abort.signal.aborted) return;
|
|
3062
3183
|
setContent(value);
|
|
3063
3184
|
setContentState("ready");
|
|
3064
3185
|
}).catch((reason) => {
|
|
@@ -3072,16 +3193,18 @@ function KnowledgeActivityNotes({ sessionId, projectId, controller }) {
|
|
|
3072
3193
|
}, [projectId, refresh, selectedId, sessionId]);
|
|
3073
3194
|
const openFolder = (node) => {
|
|
3074
3195
|
setFolderId(node.id);
|
|
3075
|
-
|
|
3196
|
+
const nextCrumbs = [...crumbs, { id: node.id, name: node.name }];
|
|
3197
|
+
setCrumbs(nextCrumbs);
|
|
3076
3198
|
setQuery("");
|
|
3077
3199
|
setQueryInput("");
|
|
3078
|
-
controller.select(sessionId, {
|
|
3200
|
+
controller.select(sessionId, { mode: "notes", noteFolderId: node.id, noteDocumentId: void 0, noteCrumbs: nextCrumbs });
|
|
3079
3201
|
};
|
|
3080
3202
|
const openCrumb = (crumb, index) => {
|
|
3081
3203
|
setFolderId(crumb.id);
|
|
3082
|
-
|
|
3204
|
+
const nextCrumbs = crumbs.slice(0, index + 1);
|
|
3205
|
+
setCrumbs(nextCrumbs);
|
|
3083
3206
|
setSelectedId(void 0);
|
|
3084
|
-
controller.select(sessionId, {
|
|
3207
|
+
controller.select(sessionId, { mode: "notes", noteFolderId: crumb.id, noteDocumentId: void 0, noteCrumbs: nextCrumbs });
|
|
3085
3208
|
};
|
|
3086
3209
|
const openNode = (node) => {
|
|
3087
3210
|
if (node.kind === "folder") return openFolder(node);
|
|
@@ -3098,6 +3221,7 @@ function KnowledgeActivityNotes({ sessionId, projectId, controller }) {
|
|
|
3098
3221
|
event.preventDefault();
|
|
3099
3222
|
setSelectedId(void 0);
|
|
3100
3223
|
setContent(void 0);
|
|
3224
|
+
controller.select(sessionId, { noteDocumentId: void 0 });
|
|
3101
3225
|
setQuery(queryInput.trim());
|
|
3102
3226
|
};
|
|
3103
3227
|
if (selectedId !== void 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -3209,7 +3333,7 @@ function message(reason) {
|
|
|
3209
3333
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
3210
3334
|
function KnowledgeActivityPanel(props) {
|
|
3211
3335
|
const sessionId = String(props.sessionId);
|
|
3212
|
-
const projectId = props.useSessions((state) => state.byId[sessionId]?.cwd);
|
|
3336
|
+
const projectId = props.useSessions((state) => state.byId[props.sessionId]?.cwd);
|
|
3213
3337
|
const initial = props.controller.selection(sessionId);
|
|
3214
3338
|
const [mode, setMode] = (0, import_react2.useState)(initial.mode ?? "knowledge");
|
|
3215
3339
|
const [mounts, setMounts] = (0, import_react2.useState)([]);
|
|
@@ -3226,6 +3350,8 @@ function KnowledgeActivityPanel(props) {
|
|
|
3226
3350
|
const [error, setError] = (0, import_react2.useState)("");
|
|
3227
3351
|
const [nextCursor, setNextCursor] = (0, import_react2.useState)();
|
|
3228
3352
|
const [baseMenuOpen, setBaseMenuOpen] = (0, import_react2.useState)(false);
|
|
3353
|
+
const indexRequest = (0, import_react2.useRef)(new LatestRequest());
|
|
3354
|
+
const mountRequest = (0, import_react2.useRef)(new LatestRequest());
|
|
3229
3355
|
const scopeRef = (0, import_react2.useRef)(null);
|
|
3230
3356
|
(0, import_react2.useEffect)(() => {
|
|
3231
3357
|
if (!baseMenuOpen) return;
|
|
@@ -3242,17 +3368,19 @@ function KnowledgeActivityPanel(props) {
|
|
|
3242
3368
|
document.removeEventListener("keydown", closeOnEscape);
|
|
3243
3369
|
};
|
|
3244
3370
|
}, [baseMenuOpen]);
|
|
3245
|
-
const refreshMounts = (0, import_react2.useCallback)(async (
|
|
3371
|
+
const refreshMounts = (0, import_react2.useCallback)(async () => {
|
|
3372
|
+
const signal = mountRequest.current.start();
|
|
3246
3373
|
setMountState("loading");
|
|
3247
3374
|
setError("");
|
|
3248
3375
|
try {
|
|
3249
3376
|
const next = await loadMountedKnowledge(sessionId, projectId, signal);
|
|
3377
|
+
if (signal.aborted) return;
|
|
3250
3378
|
setMounts(next);
|
|
3251
3379
|
const current = props.controller.selection(sessionId);
|
|
3252
3380
|
const selected = next.some((item) => item.knowledgeBaseId === current.knowledgeBaseId) ? current.knowledgeBaseId : next[0]?.knowledgeBaseId;
|
|
3253
3381
|
props.controller.select(sessionId, {
|
|
3254
|
-
|
|
3255
|
-
|
|
3382
|
+
knowledgeBaseId: selected,
|
|
3383
|
+
documentId: selected === current.knowledgeBaseId ? current.documentId : void 0
|
|
3256
3384
|
});
|
|
3257
3385
|
setSelectedBaseId(selected);
|
|
3258
3386
|
if (selected !== current.knowledgeBaseId) {
|
|
@@ -3267,13 +3395,13 @@ function KnowledgeActivityPanel(props) {
|
|
|
3267
3395
|
}
|
|
3268
3396
|
}, [projectId, props.controller, sessionId]);
|
|
3269
3397
|
(0, import_react2.useEffect)(() => {
|
|
3270
|
-
|
|
3271
|
-
void refreshMounts(controller.signal);
|
|
3398
|
+
void refreshMounts();
|
|
3272
3399
|
return () => {
|
|
3273
|
-
|
|
3400
|
+
mountRequest.current.cancel();
|
|
3274
3401
|
};
|
|
3275
3402
|
}, [refreshMounts]);
|
|
3276
|
-
const loadIndex = (0, import_react2.useCallback)(async (cursor, append = false
|
|
3403
|
+
const loadIndex = (0, import_react2.useCallback)(async (cursor, append = false) => {
|
|
3404
|
+
const signal = indexRequest.current.start();
|
|
3277
3405
|
if (mounts.length === 0 || query.length === 0 && selectedBaseId === void 0) {
|
|
3278
3406
|
setDocuments([]);
|
|
3279
3407
|
setNextCursor(void 0);
|
|
@@ -3291,6 +3419,7 @@ function KnowledgeActivityPanel(props) {
|
|
|
3291
3419
|
...cursor === void 0 ? {} : { cursor },
|
|
3292
3420
|
...signal === void 0 ? {} : { signal }
|
|
3293
3421
|
});
|
|
3422
|
+
if (signal.aborted) return;
|
|
3294
3423
|
setDocuments((current) => append ? [...current, ...result.items] : result.items);
|
|
3295
3424
|
setNextCursor(result.nextCursor);
|
|
3296
3425
|
setListState("ready");
|
|
@@ -3301,10 +3430,9 @@ function KnowledgeActivityPanel(props) {
|
|
|
3301
3430
|
}
|
|
3302
3431
|
}, [mounts, projectId, query, selectedBaseId, sessionId]);
|
|
3303
3432
|
(0, import_react2.useEffect)(() => {
|
|
3304
|
-
|
|
3305
|
-
void loadIndex(void 0, false, controller.signal);
|
|
3433
|
+
void loadIndex();
|
|
3306
3434
|
return () => {
|
|
3307
|
-
|
|
3435
|
+
indexRequest.current.cancel();
|
|
3308
3436
|
};
|
|
3309
3437
|
}, [loadIndex]);
|
|
3310
3438
|
(0, import_react2.useEffect)(() => {
|
|
@@ -3322,6 +3450,7 @@ function KnowledgeActivityPanel(props) {
|
|
|
3322
3450
|
...projectId === void 0 ? {} : { projectId },
|
|
3323
3451
|
signal: controller.signal
|
|
3324
3452
|
}).then((value) => {
|
|
3453
|
+
if (controller.signal.aborted) return;
|
|
3325
3454
|
setDocumentValue(value);
|
|
3326
3455
|
setDocumentState("ready");
|
|
3327
3456
|
}).catch((reason) => {
|
|
@@ -3340,7 +3469,7 @@ function KnowledgeActivityPanel(props) {
|
|
|
3340
3469
|
setDocumentValue(void 0);
|
|
3341
3470
|
setQueryInput("");
|
|
3342
3471
|
setQuery("");
|
|
3343
|
-
props.controller.select(sessionId, { mode: "knowledge", knowledgeBaseId });
|
|
3472
|
+
props.controller.select(sessionId, { mode: "knowledge", knowledgeBaseId, documentId: void 0 });
|
|
3344
3473
|
};
|
|
3345
3474
|
const selectDocument = (document2) => {
|
|
3346
3475
|
setSelectedBaseId(document2.knowledgeBaseId);
|
|
@@ -3356,6 +3485,7 @@ function KnowledgeActivityPanel(props) {
|
|
|
3356
3485
|
setDocumentValue(void 0);
|
|
3357
3486
|
props.controller.select(sessionId, {
|
|
3358
3487
|
mode: "knowledge",
|
|
3488
|
+
documentId: void 0,
|
|
3359
3489
|
...selectedBaseId === void 0 ? {} : { knowledgeBaseId: selectedBaseId }
|
|
3360
3490
|
});
|
|
3361
3491
|
};
|
|
@@ -3363,22 +3493,26 @@ function KnowledgeActivityPanel(props) {
|
|
|
3363
3493
|
event.preventDefault();
|
|
3364
3494
|
setSelectedDocumentId(void 0);
|
|
3365
3495
|
setDocumentValue(void 0);
|
|
3496
|
+
props.controller.select(sessionId, { documentId: void 0 });
|
|
3366
3497
|
setQuery(queryInput.trim());
|
|
3367
3498
|
};
|
|
3368
3499
|
const clearSearch = () => {
|
|
3369
3500
|
setQueryInput("");
|
|
3370
3501
|
setQuery("");
|
|
3371
3502
|
};
|
|
3372
|
-
const
|
|
3373
|
-
|
|
3374
|
-
|
|
3503
|
+
const openWorkspace = () => {
|
|
3504
|
+
const noteId = props.controller.selection(sessionId).noteDocumentId;
|
|
3505
|
+
props.controller.openWorkspace(mode === "notes" ? { view: "notes", ...noteId === void 0 ? {} : { noteId } } : documentValue === void 0 ? void 0 : {
|
|
3506
|
+
knowledgeBaseId: documentValue.knowledgeBaseId,
|
|
3507
|
+
documentId: documentValue.id
|
|
3508
|
+
});
|
|
3375
3509
|
};
|
|
3376
3510
|
const selectMode = (nextMode) => {
|
|
3377
3511
|
setMode(nextMode);
|
|
3378
3512
|
setBaseMenuOpen(false);
|
|
3379
3513
|
props.controller.select(sessionId, { ...props.controller.selection(sessionId), mode: nextMode });
|
|
3380
3514
|
};
|
|
3381
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("section", { className: "dsh-knowledge-activity-panel", "data-
|
|
3515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("section", { className: "dsh-knowledge-activity-panel", "data-knowledge-surface": "activity", "aria-label": "\u4F1A\u8BDD\u77E5\u8BC6\u5E93", children: [
|
|
3382
3516
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("header", { className: "dsh-knowledge-activity-header", children: [
|
|
3383
3517
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-knowledge-activity-title", children: [
|
|
3384
3518
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "dsh-knowledge-activity-mark", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.IconDatabaseOutline16, { size: 17 }) }),
|
|
@@ -3391,7 +3525,7 @@ function KnowledgeActivityPanel(props) {
|
|
|
3391
3525
|
] })
|
|
3392
3526
|
] }),
|
|
3393
3527
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-knowledge-activity-header-actions", children: [
|
|
3394
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: "dsh-knowledge-activity-icon-button", "aria-label": "\u5728\u5B8C\u6574\u5DE5\u4F5C\u533A\u4E2D\u6253\u5F00", title: "\u5B8C\u6574\u5DE5\u4F5C\u533A", onClick:
|
|
3528
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: "dsh-knowledge-activity-icon-button", "aria-label": "\u5728\u5B8C\u6574\u5DE5\u4F5C\u533A\u4E2D\u6253\u5F00", title: "\u5B8C\u6574\u5DE5\u4F5C\u533A", onClick: openWorkspace, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.IconFullscreenOutline16, { size: 16 }) }),
|
|
3395
3529
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { type: "button", className: "dsh-knowledge-activity-icon-button", "aria-label": "\u5173\u95ED\u4F1A\u8BDD\u77E5\u8BC6\u5E93", title: "\u5173\u95ED", onClick: () => props.controller.close(sessionId), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.IconCloseOutline16, { size: 16 }) })
|
|
3396
3530
|
] })
|
|
3397
3531
|
] }),
|
|
@@ -3554,8 +3688,69 @@ function message2(reason) {
|
|
|
3554
3688
|
return reason instanceof Error ? reason.message : String(reason);
|
|
3555
3689
|
}
|
|
3556
3690
|
|
|
3557
|
-
// src/knowledge-activity-
|
|
3691
|
+
// src/knowledge-activity-presentation.tsx
|
|
3692
|
+
var import_react3 = require("react");
|
|
3558
3693
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
3694
|
+
function KnowledgeActivityPresentation({ controller, sessionId, onClosed, children }) {
|
|
3695
|
+
const root = (0, import_react3.useRef)(null);
|
|
3696
|
+
const open = (0, import_react3.useSyncExternalStore)(controller.subscribe, () => controller.isOpen(sessionId));
|
|
3697
|
+
(0, import_react3.useLayoutEffect)(() => {
|
|
3698
|
+
const viewport = root.current;
|
|
3699
|
+
const panel = viewport?.firstElementChild;
|
|
3700
|
+
if (!viewport || !panel) return;
|
|
3701
|
+
let cancelled = false;
|
|
3702
|
+
let timeout;
|
|
3703
|
+
let reveal;
|
|
3704
|
+
const width = panel.getBoundingClientRect().width;
|
|
3705
|
+
panel.style.width = `${width > 1 ? width : 360}px`;
|
|
3706
|
+
viewport.toggleAttribute("inert", !open);
|
|
3707
|
+
const settle = () => {
|
|
3708
|
+
if (cancelled) return;
|
|
3709
|
+
cancelled = true;
|
|
3710
|
+
if (timeout !== void 0) clearTimeout(timeout);
|
|
3711
|
+
reveal?.cancel();
|
|
3712
|
+
panel.style.removeProperty("width");
|
|
3713
|
+
if (!open) onClosed();
|
|
3714
|
+
};
|
|
3715
|
+
const reducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
3716
|
+
if (!open && reducedMotion) {
|
|
3717
|
+
settle();
|
|
3718
|
+
return;
|
|
3719
|
+
}
|
|
3720
|
+
const frame = requestAnimationFrame(() => {
|
|
3721
|
+
const transitions = [];
|
|
3722
|
+
for (let parent = viewport.parentElement; parent; parent = parent.parentElement) {
|
|
3723
|
+
for (const animation of parent.getAnimations()) {
|
|
3724
|
+
if ("transitionProperty" in animation && animation.transitionProperty === "grid-template-columns") transitions.push(animation);
|
|
3725
|
+
}
|
|
3726
|
+
if (transitions.length > 0) break;
|
|
3727
|
+
}
|
|
3728
|
+
if (open && transitions.length > 0) {
|
|
3729
|
+
for (const transition of transitions) transition.finish();
|
|
3730
|
+
panel.style.removeProperty("width");
|
|
3731
|
+
if (!reducedMotion) {
|
|
3732
|
+
reveal = panel.animate([
|
|
3733
|
+
{ transform: "translateX(100%)" },
|
|
3734
|
+
{ transform: "translateX(0)" }
|
|
3735
|
+
], { duration: 180, easing: "cubic-bezier(.22, 1, .36, 1)" });
|
|
3736
|
+
}
|
|
3737
|
+
}
|
|
3738
|
+
timeout = setTimeout(settle, 1e3);
|
|
3739
|
+
void Promise.allSettled((reveal ? [reveal] : transitions).map((animation) => animation.finished)).then(settle);
|
|
3740
|
+
});
|
|
3741
|
+
return () => {
|
|
3742
|
+
cancelled = true;
|
|
3743
|
+
cancelAnimationFrame(frame);
|
|
3744
|
+
if (timeout !== void 0) clearTimeout(timeout);
|
|
3745
|
+
reveal?.cancel();
|
|
3746
|
+
panel.style.removeProperty("width");
|
|
3747
|
+
};
|
|
3748
|
+
}, [open, onClosed]);
|
|
3749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { ref: root, className: "dsh-knowledge-activity-viewport", "aria-hidden": !open || void 0, children });
|
|
3750
|
+
}
|
|
3751
|
+
|
|
3752
|
+
// src/knowledge-activity-controller.tsx
|
|
3753
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
3559
3754
|
function createKnowledgeActivityController(ctx, options) {
|
|
3560
3755
|
const runtime = ctx;
|
|
3561
3756
|
const listeners = /* @__PURE__ */ new Set();
|
|
@@ -3581,10 +3776,16 @@ function createKnowledgeActivityController(ctx, options) {
|
|
|
3581
3776
|
return true;
|
|
3582
3777
|
};
|
|
3583
3778
|
const mount = (sessionId, openDetails = true) => {
|
|
3584
|
-
if (mountedSessionId === sessionId && disposePanel !== void 0)
|
|
3779
|
+
if (mountedSessionId === sessionId && disposePanel !== void 0) {
|
|
3780
|
+
if (openDetails) ctx.layout.openDetails();
|
|
3781
|
+
return;
|
|
3782
|
+
}
|
|
3585
3783
|
unmount();
|
|
3586
3784
|
mountedSessionId = sessionId;
|
|
3587
|
-
|
|
3785
|
+
const onClosed = () => {
|
|
3786
|
+
if (mountedSessionId === sessionId && states.get(sessionId)?.open !== true) unmount();
|
|
3787
|
+
};
|
|
3788
|
+
disposePanel = ctx.slots.register({ name: "details", priority: -3 }, (props) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(KnowledgeActivityPresentation, { sessionId, controller, onClosed, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(KnowledgeActivityPanel, { ...props, controller }) }, sessionId));
|
|
3588
3789
|
if (openDetails) ctx.layout.openDetails();
|
|
3589
3790
|
};
|
|
3590
3791
|
const syncCurrentSession = () => {
|
|
@@ -3609,7 +3810,7 @@ function createKnowledgeActivityController(ctx, options) {
|
|
|
3609
3810
|
const controller = {
|
|
3610
3811
|
open(sessionId, selection) {
|
|
3611
3812
|
const previous = states.get(sessionId);
|
|
3612
|
-
states.set(sessionId, { ...previous,
|
|
3813
|
+
states.set(sessionId, { ...mergeActivitySelection(previous ?? {}, selection ?? {}), open: true });
|
|
3613
3814
|
options.beforeOpen();
|
|
3614
3815
|
if (sessionId === currentSessionId) {
|
|
3615
3816
|
cancelRestore();
|
|
@@ -3621,14 +3822,15 @@ function createKnowledgeActivityController(ctx, options) {
|
|
|
3621
3822
|
if (states.get(sessionId)?.open === true) controller.close(sessionId);
|
|
3622
3823
|
else controller.open(sessionId);
|
|
3623
3824
|
},
|
|
3624
|
-
close(sessionId) {
|
|
3825
|
+
close(sessionId, immediate = false) {
|
|
3625
3826
|
const target = sessionId ?? currentSessionId;
|
|
3626
3827
|
if (target === void 0) return;
|
|
3627
3828
|
const previous = states.get(target) ?? { open: false };
|
|
3628
3829
|
states.set(target, { ...previous, open: false });
|
|
3629
3830
|
if (target === currentSessionId) {
|
|
3630
3831
|
cancelRestore();
|
|
3631
|
-
if (
|
|
3832
|
+
if (mountedSessionId === target) ctx.layout.closeDetails();
|
|
3833
|
+
if (immediate) unmount();
|
|
3632
3834
|
}
|
|
3633
3835
|
notify();
|
|
3634
3836
|
},
|
|
@@ -3640,16 +3842,17 @@ function createKnowledgeActivityController(ctx, options) {
|
|
|
3640
3842
|
...state?.knowledgeBaseId === void 0 ? {} : { knowledgeBaseId: state.knowledgeBaseId },
|
|
3641
3843
|
...state?.documentId === void 0 ? {} : { documentId: state.documentId },
|
|
3642
3844
|
...state?.noteFolderId === void 0 ? {} : { noteFolderId: state.noteFolderId },
|
|
3643
|
-
...state?.noteDocumentId === void 0 ? {} : { noteDocumentId: state.noteDocumentId }
|
|
3845
|
+
...state?.noteDocumentId === void 0 ? {} : { noteDocumentId: state.noteDocumentId },
|
|
3846
|
+
...state?.noteCrumbs === void 0 ? {} : { noteCrumbs: state.noteCrumbs }
|
|
3644
3847
|
};
|
|
3645
3848
|
},
|
|
3646
3849
|
select(sessionId, selection) {
|
|
3647
3850
|
const previous = states.get(sessionId) ?? { open: true };
|
|
3648
|
-
states.set(sessionId, { ...previous,
|
|
3851
|
+
states.set(sessionId, { ...mergeActivitySelection(previous, selection), open: previous.open });
|
|
3649
3852
|
notify();
|
|
3650
3853
|
},
|
|
3651
3854
|
openWorkspace(target) {
|
|
3652
|
-
controller.close();
|
|
3855
|
+
controller.close(void 0, true);
|
|
3653
3856
|
options.openWorkspace(target);
|
|
3654
3857
|
},
|
|
3655
3858
|
subscribe(listener) {
|
|
@@ -3680,67 +3883,17 @@ var KNOWLEDGE_SETTINGS_NAMESPACE = "dsh-knowledge-connection";
|
|
|
3680
3883
|
var KNOWLEDGE_THEME_MESSAGE = "@lemoncat7/dsh-knowledge/host-theme";
|
|
3681
3884
|
var KNOWLEDGE_THEME_READY_MESSAGE = "@lemoncat7/dsh-knowledge/host-theme-ready";
|
|
3682
3885
|
var KNOWLEDGE_THEME_PROTOCOL_VERSION = 1;
|
|
3683
|
-
|
|
3684
|
-
light: {
|
|
3685
|
-
"--bg": "#ebebeb",
|
|
3686
|
-
"--surface": "#f4f4f4",
|
|
3687
|
-
"--surface-raised": "#fafafa",
|
|
3688
|
-
"--surface-soft": "#eeeeef",
|
|
3689
|
-
"--surface-hover": "rgb(118 118 128 / 9%)",
|
|
3690
|
-
"--dialog-surface": "#f4f4f4",
|
|
3691
|
-
"--text": "#1d1d1f",
|
|
3692
|
-
"--text-secondary": "#515154",
|
|
3693
|
-
"--text-tertiary": "#6e6e73",
|
|
3694
|
-
"--border": "rgb(60 60 67 / 14%)",
|
|
3695
|
-
"--border-strong": "rgb(60 60 67 / 24%)",
|
|
3696
|
-
"--accent": "#3a3a3c",
|
|
3697
|
-
"--accent-hover": "#1d1d1f",
|
|
3698
|
-
"--accent-soft": "#e2e2e5",
|
|
3699
|
-
"--on-accent": "#ffffff",
|
|
3700
|
-
"--success": "#248a3d",
|
|
3701
|
-
"--success-soft": "#e8f5eb",
|
|
3702
|
-
"--warning": "#c93400",
|
|
3703
|
-
"--warning-soft": "#fff1e8",
|
|
3704
|
-
"--danger": "#d70015",
|
|
3705
|
-
"--danger-soft": "#ffebed",
|
|
3706
|
-
"--shadow": "0 24px 64px rgb(0 0 0 / 20%)"
|
|
3707
|
-
},
|
|
3708
|
-
dark: {
|
|
3709
|
-
"--bg": "#101719",
|
|
3710
|
-
"--surface": "#182022",
|
|
3711
|
-
"--surface-raised": "#20292b",
|
|
3712
|
-
"--surface-soft": "rgb(184 204 205 / 6%)",
|
|
3713
|
-
"--surface-hover": "rgb(105 182 186 / 9%)",
|
|
3714
|
-
"--dialog-surface": "#20292b",
|
|
3715
|
-
"--text": "#e3eaeb",
|
|
3716
|
-
"--text-secondary": "#bbc9cc",
|
|
3717
|
-
"--text-tertiary": "#95a7ab",
|
|
3718
|
-
"--border": "rgb(184 204 205 / 10%)",
|
|
3719
|
-
"--border-strong": "rgb(184 204 205 / 18%)",
|
|
3720
|
-
"--accent": "#69b6ba",
|
|
3721
|
-
"--accent-hover": "#8aced0",
|
|
3722
|
-
"--accent-soft": "rgb(105 182 186 / 13%)",
|
|
3723
|
-
"--on-accent": "#101819",
|
|
3724
|
-
"--success": "#30d158",
|
|
3725
|
-
"--success-soft": "rgb(48 209 88 / 13%)",
|
|
3726
|
-
"--warning": "#ff9f0a",
|
|
3727
|
-
"--warning-soft": "rgb(255 159 10 / 13%)",
|
|
3728
|
-
"--danger": "#ff453a",
|
|
3729
|
-
"--danger-soft": "rgb(255 69 58 / 14%)",
|
|
3730
|
-
"--shadow": "0 28px 72px rgb(0 0 0 / 42%)"
|
|
3731
|
-
}
|
|
3732
|
-
};
|
|
3733
|
-
function createKnowledgeHostTheme(_computed, snapshot) {
|
|
3886
|
+
function createKnowledgeHostTheme(snapshot) {
|
|
3734
3887
|
return {
|
|
3735
3888
|
type: KNOWLEDGE_THEME_MESSAGE,
|
|
3736
3889
|
version: KNOWLEDGE_THEME_PROTOCOL_VERSION,
|
|
3737
3890
|
colorScheme: snapshot.active.colorScheme,
|
|
3738
|
-
tokens: { ...
|
|
3891
|
+
tokens: { ...KNOWLEDGE_PALETTE[snapshot.active.colorScheme] }
|
|
3739
3892
|
};
|
|
3740
3893
|
}
|
|
3741
3894
|
|
|
3742
3895
|
// src/client.tsx
|
|
3743
|
-
var
|
|
3896
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
3744
3897
|
var PLUGIN_ID = "@lemoncat7/dsh-knowledge";
|
|
3745
3898
|
var STYLE_ID = `${PLUGIN_ID}/client`;
|
|
3746
3899
|
var COMPACT_KNOWLEDGE_VIEWPORT = "(max-width: 1120px), (hover: none) and (pointer: coarse) and (max-width: 1400px)";
|
|
@@ -3750,7 +3903,7 @@ var inject = ["slots", "theme", "layout", "sessions"];
|
|
|
3750
3903
|
function apply2(ctx) {
|
|
3751
3904
|
ctx.effect(installStyles, "dsh-knowledge: client styles");
|
|
3752
3905
|
let activity;
|
|
3753
|
-
const workspace = createKnowledgeWorkspaceController(ctx, () => activity?.close());
|
|
3906
|
+
const workspace = createKnowledgeWorkspaceController(ctx, () => activity?.close(void 0, true));
|
|
3754
3907
|
activity = createKnowledgeActivityController(ctx, {
|
|
3755
3908
|
beforeOpen: () => {
|
|
3756
3909
|
workspace.close();
|
|
@@ -3763,7 +3916,7 @@ function apply2(ctx) {
|
|
|
3763
3916
|
});
|
|
3764
3917
|
ctx.effect(() => observePluginWorkspace(PLUGIN_ID, () => {
|
|
3765
3918
|
workspace.close();
|
|
3766
|
-
activity?.close();
|
|
3919
|
+
activity?.close(void 0, true);
|
|
3767
3920
|
}), "dsh-knowledge: exclusive workspace");
|
|
3768
3921
|
ctx.effect(() => () => {
|
|
3769
3922
|
workspace.close();
|
|
@@ -3773,7 +3926,7 @@ function apply2(ctx) {
|
|
|
3773
3926
|
name: "sidebar.footer.action",
|
|
3774
3927
|
id: "knowledge",
|
|
3775
3928
|
order: -10
|
|
3776
|
-
}, (props) => /* @__PURE__ */ (0,
|
|
3929
|
+
}, (props) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(KnowledgeLauncher, { ...props, workspace, activity })));
|
|
3777
3930
|
ctx.slots.inject("settings.plugin.item", () => ctx.slots.register({
|
|
3778
3931
|
name: "settings.plugin.item",
|
|
3779
3932
|
key: KNOWLEDGE_SETTINGS_NAMESPACE
|
|
@@ -3781,16 +3934,16 @@ function apply2(ctx) {
|
|
|
3781
3934
|
ctx.slots.inject("conversation.chat.turnTail", () => ctx.slots.register({
|
|
3782
3935
|
name: "conversation.chat.turnTail",
|
|
3783
3936
|
select: (owner) => ({ turn: owner.turn.turn })
|
|
3784
|
-
}, (props) => /* @__PURE__ */ (0,
|
|
3937
|
+
}, (props) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(KnowledgeWritebackStatus, { sessionId: String(props.sessionId), turn: props.matched.turn, workspace })));
|
|
3785
3938
|
}
|
|
3786
3939
|
function KnowledgeWritebackStatus({
|
|
3787
3940
|
sessionId,
|
|
3788
3941
|
turn,
|
|
3789
3942
|
workspace
|
|
3790
3943
|
}) {
|
|
3791
|
-
const [state, setState] = (0,
|
|
3792
|
-
const [retrying, setRetrying] = (0,
|
|
3793
|
-
(0,
|
|
3944
|
+
const [state, setState] = (0, import_react4.useState)();
|
|
3945
|
+
const [retrying, setRetrying] = (0, import_react4.useState)(false);
|
|
3946
|
+
(0, import_react4.useEffect)(() => {
|
|
3794
3947
|
const controller = new AbortController();
|
|
3795
3948
|
let timer;
|
|
3796
3949
|
let missingAttempts = 0;
|
|
@@ -3851,19 +4004,19 @@ function KnowledgeWritebackStatus({
|
|
|
3851
4004
|
};
|
|
3852
4005
|
const destinations = state.destinations ?? [];
|
|
3853
4006
|
const summary = state.summary.replace(/^知识库回写\s*·\s*/u, "");
|
|
3854
|
-
return /* @__PURE__ */ (0,
|
|
3855
|
-
/* @__PURE__ */ (0,
|
|
3856
|
-
/* @__PURE__ */ (0,
|
|
3857
|
-
/* @__PURE__ */ (0,
|
|
3858
|
-
/* @__PURE__ */ (0,
|
|
3859
|
-
state.status === "failed" && state.retryable && /* @__PURE__ */ (0,
|
|
4007
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsh-knowledge-writeback-notice", "data-status": state.status, children: [
|
|
4008
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsh-knowledge-writeback-summary", role: state.status === "running" ? "status" : void 0, "aria-atomic": "true", children: [
|
|
4009
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u77E5\u8BC6\u5E93\u56DE\u5199" }),
|
|
4010
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "@lemoncat7/dsh-knowledge" }),
|
|
4011
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { title: state.error, children: summary }),
|
|
4012
|
+
state.status === "failed" && state.retryable && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", disabled: retrying, onClick: () => {
|
|
3860
4013
|
void retry();
|
|
3861
4014
|
}, children: retrying ? "\u91CD\u8BD5\u4E2D\u2026" : "\u91CD\u8BD5" })
|
|
3862
4015
|
] }),
|
|
3863
|
-
destinations.length > 0 && /* @__PURE__ */ (0,
|
|
3864
|
-
/* @__PURE__ */ (0,
|
|
3865
|
-
/* @__PURE__ */ (0,
|
|
3866
|
-
destination.documentId ? /* @__PURE__ */ (0,
|
|
4016
|
+
destinations.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("ul", { className: "dsh-knowledge-writeback-destinations", "aria-label": "\u56DE\u5199\u76EE\u6807", children: destinations.map((destination, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("li", { children: [
|
|
4017
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "dsh-knowledge-writeback-base", children: destination.knowledgeBaseName }),
|
|
4018
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "dsh-knowledge-writeback-separator", "aria-hidden": "true", children: "/" }),
|
|
4019
|
+
destination.documentId ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
3867
4020
|
"button",
|
|
3868
4021
|
{
|
|
3869
4022
|
type: "button",
|
|
@@ -3873,12 +4026,12 @@ function KnowledgeWritebackStatus({
|
|
|
3873
4026
|
onClick: () => {
|
|
3874
4027
|
workspace.openDocument({ knowledgeBaseId: destination.knowledgeBaseId, documentId: destination.documentId });
|
|
3875
4028
|
},
|
|
3876
|
-
children: /* @__PURE__ */ (0,
|
|
4029
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: destination.documentPath ?? destination.documentTitle })
|
|
3877
4030
|
}
|
|
3878
|
-
) : /* @__PURE__ */ (0,
|
|
3879
|
-
/* @__PURE__ */ (0,
|
|
4031
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { title: destination.documentTitle, children: `\u62DF\u65B0\u5EFA\uFF1A${destination.documentTitle}` }),
|
|
4032
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("small", { "data-disposition": destination.disposition, children: destination.disposition === "written" ? "\u5DF2\u5199\u5165" : "\u5F85\u5BA1\u6838" })
|
|
3880
4033
|
] }, `${destination.knowledgeBaseId}:${destination.documentId ?? destination.documentTitle}:${index}`)) }),
|
|
3881
|
-
state.status === "failed" && state.error && /* @__PURE__ */ (0,
|
|
4034
|
+
state.status === "failed" && state.error && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsh-knowledge-writeback-error", role: "alert", children: state.error })
|
|
3882
4035
|
] });
|
|
3883
4036
|
}
|
|
3884
4037
|
function createKnowledgeWorkspaceController(client, beforeOpen) {
|
|
@@ -3900,7 +4053,7 @@ function createKnowledgeWorkspaceController(client, beforeOpen) {
|
|
|
3900
4053
|
if (disposeWorkspace !== void 0) return;
|
|
3901
4054
|
beforeOpen();
|
|
3902
4055
|
activatePluginWorkspace(PLUGIN_ID);
|
|
3903
|
-
disposeWorkspace = client.slots.register({ name: "conversation", priority: -1 }, (props) => /* @__PURE__ */ (0,
|
|
4056
|
+
disposeWorkspace = client.slots.register({ name: "conversation", priority: -1 }, (props) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(KnowledgeWorkspace, { ...props, client, workspace: controller }));
|
|
3904
4057
|
};
|
|
3905
4058
|
controller = {
|
|
3906
4059
|
isOpen: () => disposeWorkspace !== void 0,
|
|
@@ -3932,18 +4085,18 @@ function createKnowledgeWorkspaceController(client, beforeOpen) {
|
|
|
3932
4085
|
return controller;
|
|
3933
4086
|
}
|
|
3934
4087
|
function KnowledgeConnectionCard() {
|
|
3935
|
-
const [current, setCurrent] = (0,
|
|
3936
|
-
const [loadState, setLoadState] = (0,
|
|
3937
|
-
const [loadError, setLoadError] = (0,
|
|
3938
|
-
const [open, setOpen] = (0,
|
|
3939
|
-
const [backend, setBackend] = (0,
|
|
3940
|
-
const [remoteUrl, setRemoteUrl] = (0,
|
|
3941
|
-
const [remoteToken, setRemoteToken] = (0,
|
|
3942
|
-
const [timeout, setTimeoutValue] = (0,
|
|
3943
|
-
const [dirty, setDirty] = (0,
|
|
3944
|
-
const [saving, setSaving] = (0,
|
|
3945
|
-
const [message3, setMessage] = (0,
|
|
3946
|
-
const load = (0,
|
|
4088
|
+
const [current, setCurrent] = (0, import_react4.useState)();
|
|
4089
|
+
const [loadState, setLoadState] = (0, import_react4.useState)("loading");
|
|
4090
|
+
const [loadError, setLoadError] = (0, import_react4.useState)("");
|
|
4091
|
+
const [open, setOpen] = (0, import_react4.useState)(false);
|
|
4092
|
+
const [backend, setBackend] = (0, import_react4.useState)("local");
|
|
4093
|
+
const [remoteUrl, setRemoteUrl] = (0, import_react4.useState)("");
|
|
4094
|
+
const [remoteToken, setRemoteToken] = (0, import_react4.useState)("");
|
|
4095
|
+
const [timeout, setTimeoutValue] = (0, import_react4.useState)("10000");
|
|
4096
|
+
const [dirty, setDirty] = (0, import_react4.useState)(false);
|
|
4097
|
+
const [saving, setSaving] = (0, import_react4.useState)(false);
|
|
4098
|
+
const [message3, setMessage] = (0, import_react4.useState)();
|
|
4099
|
+
const load = (0, import_react4.useCallback)(async (signal) => {
|
|
3947
4100
|
setLoadState("loading");
|
|
3948
4101
|
setLoadError("");
|
|
3949
4102
|
try {
|
|
@@ -3956,14 +4109,14 @@ function KnowledgeConnectionCard() {
|
|
|
3956
4109
|
setLoadState("error");
|
|
3957
4110
|
}
|
|
3958
4111
|
}, []);
|
|
3959
|
-
(0,
|
|
4112
|
+
(0, import_react4.useEffect)(() => {
|
|
3960
4113
|
const controller = new AbortController();
|
|
3961
4114
|
void load(controller.signal);
|
|
3962
4115
|
return () => {
|
|
3963
4116
|
controller.abort();
|
|
3964
4117
|
};
|
|
3965
4118
|
}, [load]);
|
|
3966
|
-
(0,
|
|
4119
|
+
(0, import_react4.useEffect)(() => {
|
|
3967
4120
|
if (dirty || current === void 0) return;
|
|
3968
4121
|
setBackend(current.backend);
|
|
3969
4122
|
setRemoteUrl(current.remoteUrl ?? "");
|
|
@@ -4011,75 +4164,75 @@ function KnowledgeConnectionCard() {
|
|
|
4011
4164
|
setSaving(false);
|
|
4012
4165
|
}
|
|
4013
4166
|
};
|
|
4014
|
-
return /* @__PURE__ */ (0,
|
|
4015
|
-
/* @__PURE__ */ (0,
|
|
4167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("li", { className: `dsh-knowledge-settings-card${open ? " dsh-knowledge-settings-card--open" : ""}`, children: [
|
|
4168
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("button", { type: "button", className: "dsh-knowledge-settings-header", "aria-expanded": open, onClick: () => {
|
|
4016
4169
|
setOpen((value) => !value);
|
|
4017
4170
|
}, children: [
|
|
4018
|
-
/* @__PURE__ */ (0,
|
|
4019
|
-
/* @__PURE__ */ (0,
|
|
4020
|
-
/* @__PURE__ */ (0,
|
|
4171
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { children: [
|
|
4172
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "\u77E5\u8BC6\u5E93\u8FDE\u63A5" }),
|
|
4173
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("small", { children: "\u9009\u62E9\u672C\u673A\u77E5\u8BC6\u5E93\uFF0C\u6216\u8FDE\u63A5\u4E00\u53F0\u4E2D\u592E DSH \u77E5\u8BC6\u5E93" })
|
|
4021
4174
|
] }),
|
|
4022
|
-
/* @__PURE__ */ (0,
|
|
4175
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "dsh-knowledge-settings-summary", children: [
|
|
4023
4176
|
loadState === "loading" ? "\u8BFB\u53D6\u4E2D" : loadState === "error" ? "\u8FDE\u63A5\u5165\u53E3" : current?.backend === "remote" ? "\u8FDC\u7A0B" : "\u672C\u5730",
|
|
4024
|
-
/* @__PURE__ */ (0,
|
|
4177
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("i", { "aria-hidden": "true" })
|
|
4025
4178
|
] })
|
|
4026
4179
|
] }),
|
|
4027
|
-
open && /* @__PURE__ */ (0,
|
|
4028
|
-
/* @__PURE__ */ (0,
|
|
4029
|
-
/* @__PURE__ */ (0,
|
|
4180
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "dsh-knowledge-settings-body", children: loadState === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsh-knowledge-settings-note", role: "status", children: "\u6B63\u5728\u8BFB\u53D6\u8FDE\u63A5\u914D\u7F6E\u2026" }) : loadState === "error" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsh-knowledge-settings-load-error", role: "alert", children: [
|
|
4181
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: loadError }),
|
|
4182
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", onClick: () => {
|
|
4030
4183
|
void load();
|
|
4031
4184
|
}, children: "\u91CD\u65B0\u8BFB\u53D6" })
|
|
4032
|
-
] }) : /* @__PURE__ */ (0,
|
|
4033
|
-
/* @__PURE__ */ (0,
|
|
4034
|
-
/* @__PURE__ */ (0,
|
|
4035
|
-
/* @__PURE__ */ (0,
|
|
4036
|
-
/* @__PURE__ */ (0,
|
|
4185
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
4186
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("fieldset", { className: "dsh-knowledge-source-picker", children: [
|
|
4187
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("legend", { children: "\u77E5\u8BC6\u5E93\u6765\u6E90" }),
|
|
4188
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { className: backend === "local" ? "is-selected" : "", children: [
|
|
4189
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("input", { type: "radio", name: "dsh-knowledge-backend", checked: backend === "local", onChange: () => edit(() => {
|
|
4037
4190
|
setBackend("local");
|
|
4038
4191
|
}) }),
|
|
4039
|
-
/* @__PURE__ */ (0,
|
|
4040
|
-
/* @__PURE__ */ (0,
|
|
4041
|
-
/* @__PURE__ */ (0,
|
|
4192
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { children: [
|
|
4193
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "\u672C\u5730" }),
|
|
4194
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("small", { children: "\u6570\u636E\u4FDD\u5B58\u5728\u5F53\u524D DSH \u7684 SQLite \u4E2D" })
|
|
4042
4195
|
] })
|
|
4043
4196
|
] }),
|
|
4044
|
-
/* @__PURE__ */ (0,
|
|
4045
|
-
/* @__PURE__ */ (0,
|
|
4197
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { className: `${backend === "remote" ? "is-selected" : ""}${!current?.canSwitchRemote ? " is-disabled" : ""}`, children: [
|
|
4198
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("input", { type: "radio", name: "dsh-knowledge-backend", checked: backend === "remote", disabled: !current?.canSwitchRemote, onChange: () => edit(() => {
|
|
4046
4199
|
setBackend("remote");
|
|
4047
4200
|
}) }),
|
|
4048
|
-
/* @__PURE__ */ (0,
|
|
4049
|
-
/* @__PURE__ */ (0,
|
|
4050
|
-
/* @__PURE__ */ (0,
|
|
4201
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { children: [
|
|
4202
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "\u8FDC\u7A0B" }),
|
|
4203
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("small", { children: "\u53EC\u56DE\u548C\u56DE\u5199\u7EDF\u4E00\u4F7F\u7528\u4E2D\u592E\u77E5\u8BC6\u5E93" })
|
|
4051
4204
|
] })
|
|
4052
4205
|
] })
|
|
4053
4206
|
] }),
|
|
4054
|
-
!current?.canSwitchRemote && /* @__PURE__ */ (0,
|
|
4055
|
-
backend === "remote" && /* @__PURE__ */ (0,
|
|
4056
|
-
/* @__PURE__ */ (0,
|
|
4207
|
+
!current?.canSwitchRemote && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsh-knowledge-settings-note", children: "\u5F53\u524D\u5B9E\u4F8B\u662F\u4E2D\u592E\u77E5\u8BC6\u5E93\u670D\u52A1\uFF0C\u4E0D\u80FD\u518D\u5207\u6362\u5230\u53E6\u4E00\u53F0\u8FDC\u7A0B\u670D\u52A1\u3002" }),
|
|
4208
|
+
backend === "remote" && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsh-knowledge-remote-fields", children: [
|
|
4209
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { htmlFor: "dsh-knowledge-remote-url", children: [
|
|
4057
4210
|
"\u670D\u52A1\u5668\u5730\u5740",
|
|
4058
|
-
/* @__PURE__ */ (0,
|
|
4211
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("input", { id: "dsh-knowledge-remote-url", type: "url", value: remoteUrl, placeholder: "https://example.com/knowledge-api/v1", autoComplete: "url", onChange: (event) => edit(() => {
|
|
4059
4212
|
setRemoteUrl(event.target.value);
|
|
4060
4213
|
}), "aria-invalid": urlError !== void 0, "aria-describedby": urlError ? "dsh-knowledge-url-error" : void 0 }),
|
|
4061
|
-
urlError && /* @__PURE__ */ (0,
|
|
4214
|
+
urlError && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("small", { id: "dsh-knowledge-url-error", className: "dsh-knowledge-field-error", children: urlError })
|
|
4062
4215
|
] }),
|
|
4063
|
-
/* @__PURE__ */ (0,
|
|
4216
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { htmlFor: "dsh-knowledge-remote-token", children: [
|
|
4064
4217
|
"\u5BA2\u6237\u7AEF\u4EE4\u724C",
|
|
4065
|
-
/* @__PURE__ */ (0,
|
|
4218
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("input", { id: "dsh-knowledge-remote-token", type: "password", value: remoteToken, placeholder: current?.tokenConfigured ? "\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u5219\u4FDD\u6301\u4E0D\u53D8" : "\u7C98\u8D34\u5BA2\u6237\u7AEF\u4EE4\u724C", autoComplete: "new-password", onChange: (event) => edit(() => {
|
|
4066
4219
|
setRemoteToken(event.target.value);
|
|
4067
4220
|
}), "aria-invalid": tokenError !== void 0, "aria-describedby": "dsh-knowledge-token-help" }),
|
|
4068
|
-
/* @__PURE__ */ (0,
|
|
4221
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("small", { id: "dsh-knowledge-token-help", className: tokenError ? "dsh-knowledge-field-error" : void 0, children: tokenError ?? (current?.tokenConfigured ? "\u4EE4\u724C\u5DF2\u5B89\u5168\u4FDD\u5B58\uFF0C\u9875\u9762\u65E0\u6CD5\u8BFB\u53D6\uFF1B\u8F93\u5165\u65B0\u4EE4\u724C\u53EF\u8986\u76D6\u3002" : "\u4EE4\u724C\u4FDD\u5B58\u540E\u4E0D\u53EF\u8BFB\u53D6\uFF0C\u53EA\u80FD\u8986\u76D6\u3002") })
|
|
4069
4222
|
] })
|
|
4070
4223
|
] }),
|
|
4071
|
-
/* @__PURE__ */ (0,
|
|
4224
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { className: "dsh-knowledge-timeout-field", htmlFor: "dsh-knowledge-timeout", children: [
|
|
4072
4225
|
"\u8BF7\u6C42\u8D85\u65F6\uFF08\u6BEB\u79D2\uFF09",
|
|
4073
|
-
/* @__PURE__ */ (0,
|
|
4226
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("input", { id: "dsh-knowledge-timeout", type: "number", min: "100", max: "120000", step: "100", value: timeout, onChange: (event) => edit(() => {
|
|
4074
4227
|
setTimeoutValue(event.target.value);
|
|
4075
4228
|
}), "aria-invalid": timeoutError !== void 0 }),
|
|
4076
|
-
timeoutError && /* @__PURE__ */ (0,
|
|
4229
|
+
timeoutError && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("small", { className: "dsh-knowledge-field-error", children: timeoutError })
|
|
4077
4230
|
] }),
|
|
4078
|
-
!current?.writable && /* @__PURE__ */ (0,
|
|
4079
|
-
message3 && /* @__PURE__ */ (0,
|
|
4080
|
-
/* @__PURE__ */ (0,
|
|
4081
|
-
/* @__PURE__ */ (0,
|
|
4082
|
-
/* @__PURE__ */ (0,
|
|
4231
|
+
!current?.writable && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsh-knowledge-settings-note", children: "\u5F53\u524D\u63D2\u4EF6\u6CA1\u6709\u914D\u7F6E\u6301\u4E45\u5316\u8DEF\u5F84\uFF0C\u65E0\u6CD5\u4FDD\u5B58\u8FDE\u63A5\u3002" }),
|
|
4232
|
+
message3 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: `dsh-knowledge-settings-message is-${message3.kind}`, role: message3.kind === "error" ? "alert" : "status", "aria-live": "polite", children: message3.text }),
|
|
4233
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsh-knowledge-settings-actions", children: [
|
|
4234
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", onClick: reset, disabled: !dirty || saving, children: "\u653E\u5F03\u66F4\u6539" }),
|
|
4235
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", className: "is-primary", onClick: () => {
|
|
4083
4236
|
void save();
|
|
4084
4237
|
}, disabled: !dirty || invalid || saving || !current?.writable, children: saving ? "\u6B63\u5728\u9A8C\u8BC1\u2026" : "\u9A8C\u8BC1\u5E76\u8FDE\u63A5" })
|
|
4085
4238
|
] })
|
|
@@ -4126,22 +4279,21 @@ function isManagementPath(value) {
|
|
|
4126
4279
|
return typeof value === "string" && value.startsWith("/") && !value.startsWith("//");
|
|
4127
4280
|
}
|
|
4128
4281
|
function KnowledgeLauncher({ wide, useSessions, workspace, activity }) {
|
|
4129
|
-
const [open, setOpen] = (0,
|
|
4130
|
-
const
|
|
4131
|
-
const
|
|
4132
|
-
const [
|
|
4133
|
-
|
|
4134
|
-
(0, import_react3.useEffect)(() => workspace.subscribe(() => {
|
|
4282
|
+
const [open, setOpen] = (0, import_react4.useState)(workspace.isOpen());
|
|
4283
|
+
const currentSessionId = useSessions(availableActivitySession);
|
|
4284
|
+
const [activityOpen, setActivityOpen] = (0, import_react4.useState)(currentSessionId === void 0 ? false : activity.isOpen(currentSessionId));
|
|
4285
|
+
const [compactViewport, setCompactViewport] = (0, import_react4.useState)(() => window.matchMedia(COMPACT_KNOWLEDGE_VIEWPORT).matches);
|
|
4286
|
+
(0, import_react4.useEffect)(() => workspace.subscribe(() => {
|
|
4135
4287
|
setOpen(workspace.isOpen());
|
|
4136
4288
|
}), [workspace]);
|
|
4137
|
-
(0,
|
|
4289
|
+
(0, import_react4.useEffect)(() => {
|
|
4138
4290
|
const sync = () => {
|
|
4139
4291
|
setActivityOpen(currentSessionId === void 0 ? false : activity.isOpen(currentSessionId));
|
|
4140
4292
|
};
|
|
4141
4293
|
sync();
|
|
4142
4294
|
return activity.subscribe(sync);
|
|
4143
4295
|
}, [activity, currentSessionId]);
|
|
4144
|
-
(0,
|
|
4296
|
+
(0, import_react4.useEffect)(() => {
|
|
4145
4297
|
const query = window.matchMedia(COMPACT_KNOWLEDGE_VIEWPORT);
|
|
4146
4298
|
const sync = () => {
|
|
4147
4299
|
setCompactViewport(query.matches);
|
|
@@ -4158,7 +4310,7 @@ function KnowledgeLauncher({ wide, useSessions, workspace, activity }) {
|
|
|
4158
4310
|
if (compactViewport || currentSessionId === void 0) return workspace.open();
|
|
4159
4311
|
if (currentSessionId !== void 0) activity.toggle(currentSessionId);
|
|
4160
4312
|
};
|
|
4161
|
-
return /* @__PURE__ */ (0,
|
|
4313
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
4162
4314
|
"button",
|
|
4163
4315
|
{
|
|
4164
4316
|
type: "button",
|
|
@@ -4168,8 +4320,8 @@ function KnowledgeLauncher({ wide, useSessions, workspace, activity }) {
|
|
|
4168
4320
|
title: wide ? void 0 : active ? "\u8FD4\u56DE\u5BF9\u8BDD" : "\u77E5\u8BC6\u5E93",
|
|
4169
4321
|
onClick: activate,
|
|
4170
4322
|
children: [
|
|
4171
|
-
/* @__PURE__ */ (0,
|
|
4172
|
-
wide && /* @__PURE__ */ (0,
|
|
4323
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives3.IconDataOutline16, { size: wide ? 16 : 18 }),
|
|
4324
|
+
wide && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u77E5\u8BC6\u5E93" })
|
|
4173
4325
|
]
|
|
4174
4326
|
}
|
|
4175
4327
|
);
|
|
@@ -4181,15 +4333,15 @@ function KnowledgeWorkspace({
|
|
|
4181
4333
|
workspace
|
|
4182
4334
|
}) {
|
|
4183
4335
|
const cachedManagementPath = cachedConnectionView?.managementAvailable ? cachedConnectionView.managementPath : void 0;
|
|
4184
|
-
const [panelState, setPanelState] = (0,
|
|
4185
|
-
const [managementPath, setManagementPath] = (0,
|
|
4186
|
-
const [panelError, setPanelError] = (0,
|
|
4187
|
-
const [target, setTarget] = (0,
|
|
4336
|
+
const [panelState, setPanelState] = (0, import_react4.useState)(cachedConnectionView === void 0 ? "loading" : cachedManagementPath === void 0 ? "unavailable" : "ready");
|
|
4337
|
+
const [managementPath, setManagementPath] = (0, import_react4.useState)(cachedManagementPath);
|
|
4338
|
+
const [panelError, setPanelError] = (0, import_react4.useState)("");
|
|
4339
|
+
const [target, setTarget] = (0, import_react4.useState)(workspace.currentTarget());
|
|
4188
4340
|
const projectId = useSessions((state) => sessionId === void 0 ? void 0 : state.byId[sessionId]?.cwd);
|
|
4189
4341
|
const knowledgeUrl = managementPath === void 0 ? void 0 : knowledgePanelUrl(managementPath, sessionId, projectId, target);
|
|
4190
|
-
const frame = (0,
|
|
4191
|
-
const themeFrame = (0,
|
|
4192
|
-
const loadManagement = (0,
|
|
4342
|
+
const frame = (0, import_react4.useRef)(null);
|
|
4343
|
+
const themeFrame = (0, import_react4.useRef)(0);
|
|
4344
|
+
const loadManagement = (0, import_react4.useCallback)(async (background = false) => {
|
|
4193
4345
|
if (!background) setPanelState("loading");
|
|
4194
4346
|
setPanelError("");
|
|
4195
4347
|
try {
|
|
@@ -4207,31 +4359,30 @@ function KnowledgeWorkspace({
|
|
|
4207
4359
|
setPanelState("error");
|
|
4208
4360
|
}
|
|
4209
4361
|
}, []);
|
|
4210
|
-
(0,
|
|
4362
|
+
(0, import_react4.useEffect)(() => {
|
|
4211
4363
|
void loadManagement(cachedConnectionView !== void 0);
|
|
4212
4364
|
}, [loadManagement]);
|
|
4213
|
-
(0,
|
|
4365
|
+
(0, import_react4.useEffect)(() => workspace.subscribe(() => {
|
|
4214
4366
|
setTarget(workspace.currentTarget());
|
|
4215
4367
|
}), [workspace]);
|
|
4216
|
-
const sendTheme = (0,
|
|
4368
|
+
const sendTheme = (0, import_react4.useCallback)(() => {
|
|
4217
4369
|
const currentFrame = frame.current;
|
|
4218
4370
|
if (currentFrame === null) return;
|
|
4219
4371
|
const target2 = currentFrame.contentWindow;
|
|
4220
4372
|
if (target2 === null) return;
|
|
4221
|
-
const computed = getComputedStyle(document.body);
|
|
4222
4373
|
target2.postMessage(
|
|
4223
|
-
createKnowledgeHostTheme(
|
|
4374
|
+
createKnowledgeHostTheme(client.theme.getTheme()),
|
|
4224
4375
|
frameOrigin(currentFrame) ?? "*"
|
|
4225
4376
|
);
|
|
4226
4377
|
}, [client]);
|
|
4227
|
-
const scheduleTheme = (0,
|
|
4378
|
+
const scheduleTheme = (0, import_react4.useCallback)(() => {
|
|
4228
4379
|
if (themeFrame.current !== 0) window.cancelAnimationFrame(themeFrame.current);
|
|
4229
4380
|
themeFrame.current = window.requestAnimationFrame(() => {
|
|
4230
4381
|
themeFrame.current = 0;
|
|
4231
4382
|
sendTheme();
|
|
4232
4383
|
});
|
|
4233
4384
|
}, [sendTheme]);
|
|
4234
|
-
(0,
|
|
4385
|
+
(0, import_react4.useEffect)(() => {
|
|
4235
4386
|
const off = client.on("theme/change", scheduleTheme);
|
|
4236
4387
|
const onMessage = (event) => {
|
|
4237
4388
|
const currentFrame = frame.current;
|
|
@@ -4249,21 +4400,21 @@ function KnowledgeWorkspace({
|
|
|
4249
4400
|
if (themeFrame.current !== 0) window.cancelAnimationFrame(themeFrame.current);
|
|
4250
4401
|
};
|
|
4251
4402
|
}, [client, scheduleTheme, sendTheme]);
|
|
4252
|
-
return /* @__PURE__ */ (0,
|
|
4253
|
-
/* @__PURE__ */ (0,
|
|
4254
|
-
/* @__PURE__ */ (0,
|
|
4255
|
-
/* @__PURE__ */ (0,
|
|
4256
|
-
/* @__PURE__ */ (0,
|
|
4257
|
-
/* @__PURE__ */ (0,
|
|
4258
|
-
/* @__PURE__ */ (0,
|
|
4403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("section", { className: "dsh-knowledge-workspace", "data-knowledge-surface": "workspace", "aria-labelledby": "dsh-knowledge-workspace-title", children: [
|
|
4404
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("header", { className: "dsh-knowledge-workspace-header", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
|
|
4405
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", "data-knowledge-workspace-close": true, onClick: workspace.close, "aria-label": "\u8FD4\u56DE\u4F1A\u8BDD", title: "\u8FD4\u56DE\u4F1A\u8BDD", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives3.IconChevronLeftOutline14, { size: 15 }) }),
|
|
4406
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives3.IconDataOutline16, { size: 18 }),
|
|
4407
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { children: [
|
|
4408
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h2", { id: "dsh-knowledge-workspace-title", children: "\u77E5\u8BC6\u5E93" }),
|
|
4409
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: "\u6587\u6863\u3001\u5BA1\u6838\u3001\u6302\u8F7D\u4E0E\u8BBF\u95EE\u7BA1\u7406" })
|
|
4259
4410
|
] })
|
|
4260
4411
|
] }) }),
|
|
4261
|
-
panelState === "ready" && knowledgeUrl !== void 0 ? /* @__PURE__ */ (0,
|
|
4262
|
-
/* @__PURE__ */ (0,
|
|
4263
|
-
/* @__PURE__ */ (0,
|
|
4264
|
-
/* @__PURE__ */ (0,
|
|
4265
|
-
/* @__PURE__ */ (0,
|
|
4266
|
-
panelState === "error" && /* @__PURE__ */ (0,
|
|
4412
|
+
panelState === "ready" && knowledgeUrl !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("iframe", { ref: frame, className: "dsh-knowledge-frame", src: knowledgeUrl, title: "\u77E5\u8BC6\u5E93\u7BA1\u7406\u53F0", onLoad: sendTheme }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsh-knowledge-panel-state", role: panelState === "error" ? "alert" : "status", "aria-live": "polite", children: [
|
|
4413
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "dsh-knowledge-panel-state-icon", "aria-hidden": "true", children: panelState === "loading" ? "\xB7\xB7\xB7" : panelState === "error" ? "!" : "\u2014" }),
|
|
4414
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
|
|
4415
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h3", { children: panelState === "loading" ? "\u6B63\u5728\u6253\u5F00\u77E5\u8BC6\u5E93\u2026" : panelState === "error" ? "\u6682\u65F6\u65E0\u6CD5\u6253\u5F00\u77E5\u8BC6\u5E93" : "\u8FD9\u53F0 DSH \u672A\u542F\u7528\u77E5\u8BC6\u5E93\u7BA1\u7406\u53F0" }),
|
|
4416
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: panelState === "loading" ? "\u6B63\u5728\u786E\u8BA4\u5F53\u524D\u5B9E\u4F8B\u662F\u5426\u63D0\u4F9B\u7BA1\u7406\u9875\u9762\u3002" : panelState === "error" ? panelError : "\u672C\u5730\u53EC\u56DE\u548C\u56DE\u5199\u4ECD\u53EF\u4F7F\u7528\u3002\u5F53\u524D profile \u5DF2\u663E\u5F0F\u5173\u95ED exposeWeb\uFF1B\u91CD\u65B0\u542F\u7528\u540E\u5373\u53EF\u5728\u8FD9\u91CC\u7BA1\u7406\u3002\u4F7F\u7528\u8FDC\u7A0B\u77E5\u8BC6\u5E93\u65F6\uFF0C\u8BF7\u524D\u5F80\u4E2D\u592E DSH \u7684\u77E5\u8BC6\u5E93\u7BA1\u7406\u53F0\u3002" }),
|
|
4417
|
+
panelState === "error" && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", onClick: () => {
|
|
4267
4418
|
void loadManagement();
|
|
4268
4419
|
}, children: "\u91CD\u8BD5" })
|
|
4269
4420
|
] })
|
|
@@ -4300,8 +4451,8 @@ function installStyles() {
|
|
|
4300
4451
|
const style = document.createElement("style");
|
|
4301
4452
|
style.dataset.plugin = PLUGIN_ID;
|
|
4302
4453
|
style.dataset.pluginCss = STYLE_ID;
|
|
4303
|
-
|
|
4304
|
-
|
|
4454
|
+
const scope = ":is(.dsh-knowledge-trigger, .dsh-knowledge-activity-panel, .dsh-knowledge-workspace, .dsh-knowledge-settings-card, .dsh-knowledge-writeback-notice)";
|
|
4455
|
+
style.textContent = knowledgeDesignCss(scope, "body[data-ds-dark-theme] " + scope, false) + client_default + knowledge_activity_default;
|
|
4305
4456
|
document.head.appendChild(style);
|
|
4306
4457
|
return () => {
|
|
4307
4458
|
style.remove();
|