@klarkxy/dsh-current-title 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/lib/client.js CHANGED
@@ -298,6 +298,17 @@ ${scope} {
298
298
  /* --- Layout scaffolding. --- */
299
299
  & .dsh-ui-stack { display: flex; flex-direction: column; gap: 12px; }
300
300
  & .dsh-ui-stack-lg { display: flex; flex-direction: column; gap: 20px; }
301
+ /* Plugin detail pages share one reading column. These are layout recipes;
302
+ * controls keep their own primitive styles. Form spacing follows the host's
303
+ * settings-form/fields.module.css and SettingsForm.module.css. */
304
+ & .dsh-ui-page { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 760px; min-width: 0; }
305
+ & .dsh-ui-form { display: flex; flex-direction: column; gap: 0; min-width: 0; }
306
+ &.dsh-ui-form > .dsh-ui-field, & .dsh-ui-form > .dsh-ui-field { padding: 12px 0; }
307
+ & .dsh-ui-form-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 16px; min-width: 0; }
308
+ & .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; }
309
+ @media (max-width: 560px) {
310
+ & .dsh-ui-fields-grid { grid-template-columns: minmax(0, 1fr); }
311
+ }
301
312
  & .dsh-ui-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
302
313
  & .dsh-ui-row-wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
303
314
  & .dsh-ui-spacer { flex: 1; min-width: 0; }
@@ -325,6 +336,9 @@ ${scope} {
325
336
  * official primitive, so this only owns the vertical rhythm. --- */
326
337
  & .dsh-ui-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
327
338
  & .dsh-ui-field + .dsh-ui-field { border-top: 0.5px solid var(--dsw-alias-border-l2); padding-top: 12px; }
339
+ /* Grid fields share a row, so the stacked-field divider must not win later in
340
+ * the cascade. Reset it here, after the field recipe. */
341
+ & .dsh-ui-fields-grid > .dsh-ui-field { padding: 0; border: 0; }
328
342
  & .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); }
329
343
  & .dsh-ui-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
330
344
  & .dsh-ui-help { font-size: 12px; line-height: 1.6; color: var(--dsw-alias-label-secondary); }
@@ -515,7 +529,7 @@ ${scope} {
515
529
  & *, & *::before, & *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
516
530
  }
517
531
  }
518
- `.replace(/^& (\.dsh-ui-[a-z0-9-]+)(?![+>~])/gm, (_match, className) => `&${className}, & ${className}`);
532
+ `.replace(/^& (\.dsh-ui-[a-z0-9-]+)(?=\s*\{)/gm, (_match, className) => `&${className}, & ${className}`);
519
533
  }
520
534
  //#endregion
521
535
  //#region ../dsh-plugin-kit/src/contracts.ts
@@ -959,7 +973,14 @@ function useModelCatalog(load, options = {}) {
959
973
  refresh
960
974
  };
961
975
  }
962
- /** Also accepts a mapped state from a caller that owns broader async orchestration. */
976
+ /**
977
+ * Also accepts a mapped state from a caller that owns broader async orchestration.
978
+ *
979
+ * The dsh-ui-* classes carry the styling and resolve through the consuming
980
+ * plugin's own officialUiCss scope (every consumer mounts its root class, so
981
+ * e.g. `.dsh-model-hub .dsh-ui-loading` paints this); dsh-model-catalog-status
982
+ * stays as a structural hook for tests and layout, never a colour source.
983
+ */
963
984
  function ModelCatalogStatus({ state, locale }) {
964
985
  const zh = locale?.toLowerCase().startsWith("zh") === true;
965
986
  const copy = zh ? {
@@ -975,15 +996,17 @@ function ModelCatalogStatus({ state, locale }) {
975
996
  };
976
997
  if (!state.loading && !state.error && state.failures.length === 0) return null;
977
998
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
978
- className: "dsh-model-catalog-status",
999
+ className: "dsh-model-catalog-status dsh-ui-stack",
979
1000
  lang: zh ? "zh" : "en",
980
1001
  children: [
981
1002
  state.loading ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
982
1003
  role: "status",
1004
+ className: "dsh-ui-loading",
983
1005
  children: copy.loading
984
1006
  }) : null,
985
1007
  state.error ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
986
1008
  role: "alert",
1009
+ className: "dsh-ui-error dsh-ui-wrap",
987
1010
  children: [
988
1011
  copy.error,
989
1012
  ": ",
@@ -992,20 +1015,27 @@ function ModelCatalogStatus({ state, locale }) {
992
1015
  }) : null,
993
1016
  state.failures.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
994
1017
  role: "status",
995
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: copy.partial }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", { children: state.failures.map((failure, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", { children: [
996
- failure.name || failure.id,
997
- ": ",
998
- failure.message
999
- ] }, `${failure.id}:${index}`)) })]
1018
+ className: "dsh-ui-meta",
1019
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: copy.partial }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
1020
+ className: "dsh-ui-list",
1021
+ children: state.failures.map((failure, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", { children: [
1022
+ failure.name || failure.id,
1023
+ ": ",
1024
+ failure.message
1025
+ ] }, `${failure.id}:${index}`))
1026
+ })]
1000
1027
  }) : null,
1001
- state.error || state.failures.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1002
- type: "button",
1003
- size: "sm",
1004
- disabled: state.loading,
1005
- onClick: () => {
1006
- state.refresh();
1007
- },
1008
- children: copy.retry
1028
+ state.error || state.failures.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1029
+ className: "dsh-ui-actions",
1030
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1031
+ type: "button",
1032
+ size: "sm",
1033
+ disabled: state.loading,
1034
+ onClick: () => {
1035
+ state.refresh();
1036
+ },
1037
+ children: copy.retry
1038
+ })
1009
1039
  }) : null
1010
1040
  ]
1011
1041
  });
@@ -1025,7 +1055,8 @@ function ModelCatalogStatus({ state, locale }) {
1025
1055
  * Sticky group headings, subsequence ranking, highlight walking and focus
1026
1056
  * hand-back all match the host. SYNC POINT: when the host's ModelSelect or
1027
1057
  * ModelSelect.module.css changes, this copy must be re-transcribed; styles
1028
- * below may only reference --dsw-* theme tokens, never literal colors.
1058
+ * below may only reference allowlisted theme tokens (the --dsw-* set plus the
1059
+ * host's --ds-* motion tokens), never literal colors.
1029
1060
  *
1030
1061
  * It statically imports the primitives, so only browser clients should load
1031
1062
  * this entry; host code and node tests use the core entry (`./index.ts`).
@@ -1533,7 +1564,8 @@ function ModelMenu(props) {
1533
1564
  * sticky group headings (MenuGroup's own CSS), and the l1-stroke prominent
1534
1565
  * elevation at portal z-index 1100. The trigger mirrors the composer's 28px
1535
1566
  * model pill, chevron rotating open. MenuSurface paints fill and backdrop.
1536
- * Only --dsw-* theme tokens may appear here — a literal color is a bug.
1567
+ * Only allowlisted --dsw- and --ds- theme tokens may appear here — a literal
1568
+ * color is a bug.
1537
1569
  */
1538
1570
  const modelMenuCss = `
1539
1571
  .dsh-model-menu-root { min-width: 0; position: relative; display: inline-flex; }
@@ -1556,12 +1588,14 @@ const modelMenuCss = `
1556
1588
  display: flex;
1557
1589
  }
1558
1590
  .dsh-model-menu-trigger:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover); }
1559
- .dsh-model-menu-trigger:focus-visible:not([data-selection-focus]) { box-shadow: 0 0 0 2px var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary)); }
1591
+ .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)); }
1560
1592
  .dsh-model-menu-trigger:disabled { color: var(--dsw-alias-label-dimmed); cursor: default; }
1561
1593
  .dsh-model-menu-triggerLabel { text-overflow: ellipsis; white-space: nowrap; min-width: 0; overflow: hidden; }
1562
1594
  .dsh-model-menu-triggerEffort { text-overflow: ellipsis; white-space: nowrap; min-width: 0; color: var(--dsw-alias-label-caption); flex-shrink: 1000; overflow: hidden; }
1563
- .dsh-model-menu-chevron { color: var(--dsw-alias-label-caption); flex: none; transition: transform 0.12s; }
1595
+ .dsh-model-menu-chevron { color: var(--dsw-alias-label-caption); flex: none; transition: transform var(--ds-transition-duration) var(--ds-ease-in-out); }
1564
1596
  .dsh-model-menu-chevronOpen { transform: rotate(180deg); }
1597
+ /* Portal overlay: the host publishes no z-index token, so the card keeps the
1598
+ * native menu layer's 1100 verbatim. */
1565
1599
  .dsh-model-menu-menu {
1566
1600
  z-index: 1100;
1567
1601
  --dsw-elevation-stroke-color: var(--dsw-alias-border-l1);
@@ -1587,6 +1621,8 @@ const modelMenuCss = `
1587
1621
  .dsh-model-menu-searchWithQuery { padding-right: 34px; }
1588
1622
  .dsh-model-menu-searchRow .dsh-model-menu-search input { padding: 0; font-size: 12px; line-height: normal; }
1589
1623
  .dsh-model-menu-searchRow .dsh-model-menu-search input::placeholder { color: var(--dsw-alias-label-caption); }
1624
+ /* The clear button is a circle by geometry (border-radius: 50%), a shape the
1625
+ * radius token scale does not describe. */
1590
1626
  .dsh-model-menu-searchClear {
1591
1627
  width: 24px;
1592
1628
  height: 24px;
@@ -2081,7 +2117,7 @@ function TitleSettings(props) {
2081
2117
  });
2082
2118
  }
2083
2119
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
2084
- className: "current-title-settings ct-root dsh-ui-panel",
2120
+ className: "current-title-settings ct-root dsh-ui-page",
2085
2121
  lang: seat.locale,
2086
2122
  "data-testid": "current-title-settings",
2087
2123
  children: [
@@ -2347,10 +2383,11 @@ function TitleSettings(props) {
2347
2383
  ]
2348
2384
  });
2349
2385
  }
2350
- const styles = `${officialUiCss("ct-root")}${modelMenuCss}
2351
- .ct-root { max-width: 760px; }
2352
- .ct-prompt { min-height: 96px; }
2386
+ const currentTitleOwnCss = `
2387
+ .ct-root .ct-prompt { min-height: 96px; }
2353
2388
  `;
2389
+ const currentTitleStyles = `${officialUiCss("ct-root")}${modelMenuCss}${currentTitleOwnCss}`;
2390
+ const styles = currentTitleStyles;
2354
2391
  function apply(ctx) {
2355
2392
  const client = ctx;
2356
2393
  const packageName = "@klarkxy/dsh-current-title";
@@ -2395,6 +2432,8 @@ exports.TitleSettings = TitleSettings;
2395
2432
  exports.apply = apply;
2396
2433
  exports.applyMarkerFromStatus = applyMarkerFromStatus;
2397
2434
  exports.createTitleClientMarker = createTitleClientMarker;
2435
+ exports.currentTitleOwnCss = currentTitleOwnCss;
2436
+ exports.currentTitleStyles = currentTitleStyles;
2398
2437
  exports.disposeTitleClientMarker = disposeTitleClientMarker;
2399
2438
  exports.inject = inject;
2400
2439
  exports.name = name;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@klarkxy/dsh-current-title",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Auto Title: keep session titles following the latest task; names you set by hand stay put.",
5
5
  "icon": "./icon.svg",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -73,8 +73,8 @@
73
73
  "test": "vitest run --root ../.. --config vitest.editor-plugins.config.ts --maxWorkers=2 plugins/dsh-current-title/src"
74
74
  },
75
75
  "dependencies": {
76
- "@klarkxy/dsh-model-route": "0.2.5",
77
- "@klarkxy/dsh-plugin-kit": "0.4.0",
76
+ "@klarkxy/dsh-model-route": "0.2.6",
77
+ "@klarkxy/dsh-plugin-kit": "0.5.0",
78
78
  "zod": "^4.1.5"
79
79
  },
80
80
  "peerDependencies": {
@@ -130,6 +130,6 @@
130
130
  "registry": "https://registry.npmjs.org/"
131
131
  },
132
132
  "dshRelease": {
133
- "contentHash": "78d312909be56db8dc739669b09738192a57dc678f0453fce7e4b75557f14abd"
133
+ "contentHash": "afd30e099c63e4774f50d1dbe242b28230fa5fa3adc446208965f69576ba6104"
134
134
  }
135
135
  }