@klarkxy/dsh-git-commit 0.3.0 → 0.3.1
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 +4 -4
- package/docs/README.zh-CN.md +3 -3
- package/lib/client.inner.cjs +62 -27
- package/lib/client.inner.cjs.map +1 -1
- package/lib/client.js +62 -27
- package/package.json +4 -4
package/lib/client.js
CHANGED
|
@@ -268,7 +268,14 @@ function useModelCatalog(load, options = {}) {
|
|
|
268
268
|
refresh
|
|
269
269
|
};
|
|
270
270
|
}
|
|
271
|
-
/**
|
|
271
|
+
/**
|
|
272
|
+
* Also accepts a mapped state from a caller that owns broader async orchestration.
|
|
273
|
+
*
|
|
274
|
+
* The dsh-ui-* classes carry the styling and resolve through the consuming
|
|
275
|
+
* plugin's own officialUiCss scope (every consumer mounts its root class, so
|
|
276
|
+
* e.g. `.dsh-model-hub .dsh-ui-loading` paints this); dsh-model-catalog-status
|
|
277
|
+
* stays as a structural hook for tests and layout, never a colour source.
|
|
278
|
+
*/
|
|
272
279
|
function ModelCatalogStatus({ state, locale }) {
|
|
273
280
|
const zh = locale?.toLowerCase().startsWith("zh") === true;
|
|
274
281
|
const copy = zh ? {
|
|
@@ -284,15 +291,17 @@ function ModelCatalogStatus({ state, locale }) {
|
|
|
284
291
|
};
|
|
285
292
|
if (!state.loading && !state.error && state.failures.length === 0) return null;
|
|
286
293
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
287
|
-
className: "dsh-model-catalog-status",
|
|
294
|
+
className: "dsh-model-catalog-status dsh-ui-stack",
|
|
288
295
|
lang: zh ? "zh" : "en",
|
|
289
296
|
children: [
|
|
290
297
|
state.loading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
291
298
|
role: "status",
|
|
299
|
+
className: "dsh-ui-loading",
|
|
292
300
|
children: copy.loading
|
|
293
301
|
}) : null,
|
|
294
302
|
state.error ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
|
|
295
303
|
role: "alert",
|
|
304
|
+
className: "dsh-ui-error dsh-ui-wrap",
|
|
296
305
|
children: [
|
|
297
306
|
copy.error,
|
|
298
307
|
": ",
|
|
@@ -301,20 +310,27 @@ function ModelCatalogStatus({ state, locale }) {
|
|
|
301
310
|
}) : null,
|
|
302
311
|
state.failures.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
303
312
|
role: "status",
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
failure.
|
|
308
|
-
|
|
313
|
+
className: "dsh-ui-meta",
|
|
314
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: copy.partial }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
315
|
+
className: "dsh-ui-list",
|
|
316
|
+
children: state.failures.map((failure, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", { children: [
|
|
317
|
+
failure.name || failure.id,
|
|
318
|
+
": ",
|
|
319
|
+
failure.message
|
|
320
|
+
] }, `${failure.id}:${index}`))
|
|
321
|
+
})]
|
|
309
322
|
}) : null,
|
|
310
|
-
state.error || state.failures.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
state.
|
|
316
|
-
|
|
317
|
-
|
|
323
|
+
state.error || state.failures.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
324
|
+
className: "dsh-ui-actions",
|
|
325
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
326
|
+
type: "button",
|
|
327
|
+
size: "sm",
|
|
328
|
+
disabled: state.loading,
|
|
329
|
+
onClick: () => {
|
|
330
|
+
state.refresh();
|
|
331
|
+
},
|
|
332
|
+
children: copy.retry
|
|
333
|
+
})
|
|
318
334
|
}) : null
|
|
319
335
|
]
|
|
320
336
|
});
|
|
@@ -334,7 +350,8 @@ function ModelCatalogStatus({ state, locale }) {
|
|
|
334
350
|
* Sticky group headings, subsequence ranking, highlight walking and focus
|
|
335
351
|
* hand-back all match the host. SYNC POINT: when the host's ModelSelect or
|
|
336
352
|
* ModelSelect.module.css changes, this copy must be re-transcribed; styles
|
|
337
|
-
* below may only reference
|
|
353
|
+
* below may only reference allowlisted theme tokens (the --dsw-* set plus the
|
|
354
|
+
* host's --ds-* motion tokens), never literal colors.
|
|
338
355
|
*
|
|
339
356
|
* It statically imports the primitives, so only browser clients should load
|
|
340
357
|
* this entry; host code and node tests use the core entry (`./index.ts`).
|
|
@@ -842,7 +859,8 @@ function ModelMenu(props) {
|
|
|
842
859
|
* sticky group headings (MenuGroup's own CSS), and the l1-stroke prominent
|
|
843
860
|
* elevation at portal z-index 1100. The trigger mirrors the composer's 28px
|
|
844
861
|
* model pill, chevron rotating open. MenuSurface paints fill and backdrop.
|
|
845
|
-
* Only --dsw
|
|
862
|
+
* Only allowlisted --dsw- and --ds- theme tokens may appear here — a literal
|
|
863
|
+
* color is a bug.
|
|
846
864
|
*/
|
|
847
865
|
const modelMenuCss = `
|
|
848
866
|
.dsh-model-menu-root { min-width: 0; position: relative; display: inline-flex; }
|
|
@@ -865,12 +883,14 @@ const modelMenuCss = `
|
|
|
865
883
|
display: flex;
|
|
866
884
|
}
|
|
867
885
|
.dsh-model-menu-trigger:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover); }
|
|
868
|
-
.dsh-model-menu-trigger:focus-visible:not([data-selection-focus]) { box-shadow: 0 0 0
|
|
886
|
+
.dsh-model-menu-trigger:focus-visible:not([data-selection-focus]) { box-shadow: 0 0 0 var(--dsw-focus-ring-width) var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary)); }
|
|
869
887
|
.dsh-model-menu-trigger:disabled { color: var(--dsw-alias-label-dimmed); cursor: default; }
|
|
870
888
|
.dsh-model-menu-triggerLabel { text-overflow: ellipsis; white-space: nowrap; min-width: 0; overflow: hidden; }
|
|
871
889
|
.dsh-model-menu-triggerEffort { text-overflow: ellipsis; white-space: nowrap; min-width: 0; color: var(--dsw-alias-label-caption); flex-shrink: 1000; overflow: hidden; }
|
|
872
|
-
.dsh-model-menu-chevron { color: var(--dsw-alias-label-caption); flex: none; transition: transform
|
|
890
|
+
.dsh-model-menu-chevron { color: var(--dsw-alias-label-caption); flex: none; transition: transform var(--ds-transition-duration) var(--ds-ease-in-out); }
|
|
873
891
|
.dsh-model-menu-chevronOpen { transform: rotate(180deg); }
|
|
892
|
+
/* Portal overlay: the host publishes no z-index token, so the card keeps the
|
|
893
|
+
* native menu layer's 1100 verbatim. */
|
|
874
894
|
.dsh-model-menu-menu {
|
|
875
895
|
z-index: 1100;
|
|
876
896
|
--dsw-elevation-stroke-color: var(--dsw-alias-border-l1);
|
|
@@ -896,6 +916,8 @@ const modelMenuCss = `
|
|
|
896
916
|
.dsh-model-menu-searchWithQuery { padding-right: 34px; }
|
|
897
917
|
.dsh-model-menu-searchRow .dsh-model-menu-search input { padding: 0; font-size: 12px; line-height: normal; }
|
|
898
918
|
.dsh-model-menu-searchRow .dsh-model-menu-search input::placeholder { color: var(--dsw-alias-label-caption); }
|
|
919
|
+
/* The clear button is a circle by geometry (border-radius: 50%), a shape the
|
|
920
|
+
* radius token scale does not describe. */
|
|
899
921
|
.dsh-model-menu-searchClear {
|
|
900
922
|
width: 24px;
|
|
901
923
|
height: 24px;
|
|
@@ -1143,6 +1165,17 @@ ${scope} {
|
|
|
1143
1165
|
/* --- Layout scaffolding. --- */
|
|
1144
1166
|
& .dsh-ui-stack { display: flex; flex-direction: column; gap: 12px; }
|
|
1145
1167
|
& .dsh-ui-stack-lg { display: flex; flex-direction: column; gap: 20px; }
|
|
1168
|
+
/* Plugin detail pages share one reading column. These are layout recipes;
|
|
1169
|
+
* controls keep their own primitive styles. Form spacing follows the host's
|
|
1170
|
+
* settings-form/fields.module.css and SettingsForm.module.css. */
|
|
1171
|
+
& .dsh-ui-page { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 760px; min-width: 0; }
|
|
1172
|
+
& .dsh-ui-form { display: flex; flex-direction: column; gap: 0; min-width: 0; }
|
|
1173
|
+
&.dsh-ui-form > .dsh-ui-field, & .dsh-ui-form > .dsh-ui-field { padding: 12px 0; }
|
|
1174
|
+
& .dsh-ui-form-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 16px; min-width: 0; }
|
|
1175
|
+
& .dsh-ui-fields-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; min-width: 0; margin: 0; padding: 0; border: 0; }
|
|
1176
|
+
@media (max-width: 560px) {
|
|
1177
|
+
& .dsh-ui-fields-grid { grid-template-columns: minmax(0, 1fr); }
|
|
1178
|
+
}
|
|
1146
1179
|
& .dsh-ui-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
|
|
1147
1180
|
& .dsh-ui-row-wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
|
|
1148
1181
|
& .dsh-ui-spacer { flex: 1; min-width: 0; }
|
|
@@ -1170,6 +1203,9 @@ ${scope} {
|
|
|
1170
1203
|
* official primitive, so this only owns the vertical rhythm. --- */
|
|
1171
1204
|
& .dsh-ui-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
|
|
1172
1205
|
& .dsh-ui-field + .dsh-ui-field { border-top: 0.5px solid var(--dsw-alias-border-l2); padding-top: 12px; }
|
|
1206
|
+
/* Grid fields share a row, so the stacked-field divider must not win later in
|
|
1207
|
+
* the cascade. Reset it here, after the field recipe. */
|
|
1208
|
+
& .dsh-ui-fields-grid > .dsh-ui-field { padding: 0; border: 0; }
|
|
1173
1209
|
& .dsh-ui-label { display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 20px; font-weight: 500; color: var(--dsw-alias-label-primary); }
|
|
1174
1210
|
& .dsh-ui-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
|
|
1175
1211
|
& .dsh-ui-help { font-size: 12px; line-height: 1.6; color: var(--dsw-alias-label-secondary); }
|
|
@@ -1360,7 +1396,7 @@ ${scope} {
|
|
|
1360
1396
|
& *, & *::before, & *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
|
|
1361
1397
|
}
|
|
1362
1398
|
}
|
|
1363
|
-
`.replace(/^& (\.dsh-ui-[a-z0-9-]+)(
|
|
1399
|
+
`.replace(/^& (\.dsh-ui-[a-z0-9-]+)(?=\s*\{)/gm, (_match, className) => `&${className}, & ${className}`);
|
|
1364
1400
|
}
|
|
1365
1401
|
//#endregion
|
|
1366
1402
|
//#region ../dsh-plugin-kit/src/contracts.ts
|
|
@@ -2045,11 +2081,10 @@ const clientCss = `${officialUiCss("gcm-root")}${modelMenuCss}
|
|
|
2045
2081
|
* of at the trigger. Naming both classes puts this rule at the same weight,
|
|
2046
2082
|
* later in the sheet, so it wins. */
|
|
2047
2083
|
.gcm-root.gcm-panel { position: fixed; width: min(360px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 32px)); overflow: auto; }
|
|
2048
|
-
.gcm-model { display: flex; align-items: center; gap: 6px; min-width: 0; margin: 0; font-size: 12px; line-height: 18px; color: var(--dsw-alias-label-primary); }
|
|
2049
|
-
.gcm-commits { margin: 0; padding-inline-start: 18px; display: grid; gap: 2px; font-size: 12px; line-height: 18px; overflow-wrap: anywhere; }
|
|
2050
|
-
.gcm-commits code { font-size: 12px; background: var(--dsw-alias-bg-layer-2); padding: 0 4px; border-radius: var(--dsw-radius-sm); }
|
|
2051
|
-
.gcm-settings { display: flex; flex-direction: column; gap:
|
|
2052
|
-
.gcm-settings-status { display: flex; flex-direction: column; gap: 4px; }
|
|
2084
|
+
.gcm-root .gcm-model { display: flex; align-items: center; gap: 6px; min-width: 0; margin: 0; font-size: 12px; line-height: 18px; color: var(--dsw-alias-label-primary); }
|
|
2085
|
+
.gcm-root .gcm-commits { margin: 0; padding-inline-start: 18px; display: grid; gap: 2px; font-size: 12px; line-height: 18px; overflow-wrap: anywhere; }
|
|
2086
|
+
.gcm-root .gcm-commits code { font-size: 12px; background: var(--dsw-alias-bg-layer-2); padding: 0 4px; border-radius: var(--dsw-radius-sm); }
|
|
2087
|
+
.gcm-root .gcm-settings-status { display: flex; flex-direction: column; gap: 4px; }
|
|
2053
2088
|
`;
|
|
2054
2089
|
/** Host UI language, following live switches with the host's English fallback. */
|
|
2055
2090
|
function useHostLocale(client) {
|
|
@@ -2211,7 +2246,7 @@ function GitCommitSettingsPanel(props) {
|
|
|
2211
2246
|
text.stale
|
|
2212
2247
|
]);
|
|
2213
2248
|
if (!settings) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
2214
|
-
className: "gcm-root gcm-settings",
|
|
2249
|
+
className: "gcm-root gcm-settings dsh-ui-page",
|
|
2215
2250
|
children: [
|
|
2216
2251
|
error ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2217
2252
|
role: "alert",
|
|
@@ -2244,7 +2279,7 @@ function GitCommitSettingsPanel(props) {
|
|
|
2244
2279
|
const selectedEffort = efforts.find((item) => item.id === (current.reasoningEffort || ""));
|
|
2245
2280
|
const effortName = selectedEffort ? modelMenuEffortLabel(selectedEffort, language) : void 0;
|
|
2246
2281
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
2247
|
-
className: "gcm-root gcm-settings",
|
|
2282
|
+
className: "gcm-root gcm-settings dsh-ui-page",
|
|
2248
2283
|
"data-testid": "git-commit-settings",
|
|
2249
2284
|
children: [
|
|
2250
2285
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@klarkxy/dsh-git-commit",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Git Commit: commit workspace changes from the conversation header, with model-planned commit groups.",
|
|
5
5
|
"icon": "./icon.svg",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"test": "vitest run --root ../.. --config vitest.editor-plugins.config.ts --maxWorkers=2 plugins/dsh-git-commit/src"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@klarkxy/dsh-model-route": "0.2.
|
|
78
|
-
"@klarkxy/dsh-plugin-kit": "0.
|
|
77
|
+
"@klarkxy/dsh-model-route": "0.2.6",
|
|
78
|
+
"@klarkxy/dsh-plugin-kit": "0.5.0",
|
|
79
79
|
"zod": "^4.1.5"
|
|
80
80
|
},
|
|
81
81
|
"peerDependencies": {
|
|
@@ -134,6 +134,6 @@
|
|
|
134
134
|
"registry": "https://registry.npmjs.org/"
|
|
135
135
|
},
|
|
136
136
|
"dshRelease": {
|
|
137
|
-
"contentHash": "
|
|
137
|
+
"contentHash": "3f83b7742c2c11ddbc2d03595c4338fb8f5ebd60f427ef911617f192ee34e48e"
|
|
138
138
|
}
|
|
139
139
|
}
|