dsh-plugin-core-demo 0.35.30 → 0.35.31

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.
Files changed (2) hide show
  1. package/dist/client.js +50 -9
  2. package/package.json +1 -1
package/dist/client.js CHANGED
@@ -5152,6 +5152,8 @@ var PICKER_CSS = `
5152
5152
  .dshpc-picker__trigger:disabled{color:var(--dshpc-fg-dim);cursor:not-allowed;opacity:.7}
5153
5153
  /* \u805A\u7126\uFF08\u952E\u76D8\u6216\u70B9\u51FB\u9009\u4E2D\uFF09\u65F6\u4E0E\u5168\u7AD9\u4E00\u81F4\u7684\u84DD\u8272\u63CF\u8FB9\uFF1B\u83DC\u5355\u6253\u5F00\u540E\u7126\u70B9\u4F1A\u8FDB\u53BB\uFF0C\u89E6\u53D1\u5668\u81EA\u7136\u5931\u53BB\u7126\u70B9\u3002 */
5154
5154
  .dshpc-picker__trigger:focus-visible{outline:2px solid var(--dshpc-focus);outline-offset:1px}
5155
+ /* \u6821\u9A8C\u4E0D\u901A\u8FC7\uFF1A\u4E0E Input / Textarea \u540C\u53E3\u5F84\uFF0C\u53EA\u63CF\u8FB9\u6846\uFF082026-11-15\uFF09\u3002hint \u6001\u4E0B\u89E6\u53D1\u5668\u5728 fieldwrap \u91CC\uFF0C\u6545\u4E0D\u9650\u5B9A\u76F4\u63A5\u5B50\u7EA7\u3002 */
5156
+ .dshpc-picker--error .dshpc-picker__trigger{border-color:var(--dshpc-danger)}
5155
5157
  /* \u6587\u5B57\u9ED8\u8BA4\u9760\u5DE6\uFF08\u5403\u6389\u5269\u4F59\u5BBD\u5EA6\uFF09\uFF0C\u4E0D\u7ED9 space-between \u628A\u77ED\u6587\u6848\u63A8\u5230\u4E2D\u95F4\u7684\u673A\u4F1A\uFF1B
5156
5158
  \u786E\u5B9E\u8981\u5C45\u4E2D\u5C31\u663E\u5F0F\u4F20 align="center"\u3002 */
5157
5159
  .dshpc-picker__label{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left}
@@ -5509,7 +5511,7 @@ function Picker(props) {
5509
5511
  );
5510
5512
  const triggerRow = props.hint === void 0 ? trigger : (0, import_react12.createElement)("span", { className: "dshpc-fieldwrap dshpc-fieldwrap--inline" }, trigger, (0, import_react12.createElement)(FieldHint, { text: props.hint }));
5511
5513
  return (0, import_react12.createElement)("div", {
5512
- className: `dshpc-picker${props.className === void 0 ? "" : ` ${props.className}`}`,
5514
+ className: `dshpc-picker${props.error === true ? " dshpc-picker--error" : ""}${props.className === void 0 ? "" : ` ${props.className}`}`,
5513
5515
  style: controlStyle,
5514
5516
  ref: rootRef,
5515
5517
  onKeyDown
@@ -6899,6 +6901,7 @@ function WorkspacePicker(props) {
6899
6901
  const items = (0, import_react20.useSyncExternalStore)(workspaceList.subscribe, workspaceList.getSnapshot, workspaceList.getSnapshot);
6900
6902
  const valueKey = props.valueKey ?? "id";
6901
6903
  const options = workspaceOptionsOf(items, valueKey);
6904
+ const empty2 = items.length === 0;
6902
6905
  const allOption = props.allowDefault !== false && props.mode !== "multiple" ? { value: "", label: props.defaultLabel ?? tt("workspaceAll") } : void 0;
6903
6906
  const { onChange } = props;
6904
6907
  const emit = onChange === void 0 ? void 0 : (value) => {
@@ -6920,8 +6923,10 @@ function WorkspacePicker(props) {
6920
6923
  searchSizing: props.searchSizing,
6921
6924
  hint: props.hint,
6922
6925
  icon: props.icon === void 0 ? folderIcon() : props.icon ?? void 0,
6923
- placeholder: props.placeholder ?? tt("explorerRoot"),
6924
- disabled: props.disabled,
6926
+ placeholder: props.placeholder ?? (empty2 ? props.emptyLabel ?? tt("pickerEmpty") : tt("explorerRoot")),
6927
+ disabled: props.disabled === true || empty2,
6928
+ ariaLabel: props.ariaLabel,
6929
+ error: props.error,
6925
6930
  size: props.size,
6926
6931
  placement: props.placement,
6927
6932
  className: props.className,
@@ -66793,6 +66798,15 @@ var docData = {
66793
66798
  "en": "Candidates may be incomplete \u21D2 honest top hint, no fabrication"
66794
66799
  }
66795
66800
  },
66801
+ {
66802
+ "name": "error",
66803
+ "type": "boolean",
66804
+ "def": "'false'",
66805
+ "desc": {
66806
+ "zh": "\u6821\u9A8C\u4E0D\u901A\u8FC7\uFF1A\u89E6\u53D1\u5668\u63CF\u7EA2\uFF08\u4E0E Input / Textarea \u540C\u53E3\u5F84\uFF0C\u53EA\u63CF\u8FB9\u6846\uFF09",
66807
+ "en": "Validation failed: red trigger border (same treatment as Input / Textarea)"
66808
+ }
66809
+ },
66796
66810
  {
66797
66811
  "name": "size",
66798
66812
  "type": "'sm' | 'md' | 'lg'",
@@ -66960,6 +66974,33 @@ var docData = {
66960
66974
  "en": 'Pass it if you want "\u9009\u62E9\u5DE5\u4F5C\u533A"'
66961
66975
  }
66962
66976
  },
66977
+ {
66978
+ "name": "ariaLabel",
66979
+ "type": "string",
66980
+ "def": "\u2014",
66981
+ "desc": {
66982
+ "zh": "\u65E0\u969C\u788D\u540D\uFF08\u4E0B\u62C9\u81EA\u5DF1\u6CA1\u6709\u53EF\u89C1\u6807\u7B7E\u65F6\u4F20\u5B83\uFF09",
66983
+ "en": "Accessible name when the dropdown has no visible label"
66984
+ }
66985
+ },
66986
+ {
66987
+ "name": "error",
66988
+ "type": "boolean",
66989
+ "def": "'false'",
66990
+ "desc": {
66991
+ "zh": "\u6821\u9A8C\u4E0D\u901A\u8FC7\uFF1A\u63CF\u7EA2\uFF08\u4E0E Picker / Input \u540C\u53E3\u5F84\uFF09",
66992
+ "en": "Validation failed: red border, same as Picker / Input"
66993
+ }
66994
+ },
66995
+ {
66996
+ "name": "emptyLabel",
66997
+ "type": "string",
66998
+ "def": "\u5185\u7F6E\u300C\u6682\u65E0\u53EF\u9009\u300D",
66999
+ "desc": {
67000
+ "zh": "\u5BBF\u4E3B\u4E00\u4E2A\u5DE5\u4F5C\u533A\u90FD\u6CA1\u6709\u65F6\u7684\u89E6\u53D1\u5668\u6587\u6848\uFF1B\u6B64\u65F6\u63A7\u4EF6\u81EA\u52A8\u7981\u7528\uFF08\u6D88\u8D39\u65B9\u62FF\u4E0D\u5230\u5019\u9009\u6570\u7EC4\uFF0C\u5224\u4E0D\u4E86\u7A7A\uFF09",
67001
+ "en": "Trigger text when the host has no workspace; the control is disabled automatically since callers cannot see the candidate array"
67002
+ }
67003
+ },
66963
67004
  {
66964
67005
  "name": "icon",
66965
67006
  "type": "ReactNode",
@@ -74626,9 +74667,9 @@ function ReferencePage() {
74626
74667
  "tbody",
74627
74668
  null,
74628
74669
  [
74629
- [t3("buildCore"), `v${"0.35.30"}`],
74630
- [t3("buildDemo"), `v${"0.35.30"}`],
74631
- [t3("buildStamp"), "261114-173320-937"]
74670
+ [t3("buildCore"), `v${"0.35.31"}`],
74671
+ [t3("buildDemo"), `v${"0.35.31"}`],
74672
+ [t3("buildStamp"), "261114-175423-667"]
74632
74673
  ].map(
74633
74674
  ([label, value]) => (0, import_react107.createElement)(
74634
74675
  "tr",
@@ -74946,9 +74987,9 @@ function DemoPage() {
74946
74987
  lineHeight: "14px"
74947
74988
  }
74948
74989
  },
74949
- (0, import_react109.createElement)("span", null, `core v${"0.35.30"}`),
74950
- (0, import_react109.createElement)("span", null, `demo v${"0.35.30"}`),
74951
- (0, import_react109.createElement)("span", { style: { marginTop: "4px", fontSize: "9px" } }, "261114-173320-937")
74990
+ (0, import_react109.createElement)("span", null, `core v${"0.35.31"}`),
74991
+ (0, import_react109.createElement)("span", null, `demo v${"0.35.31"}`),
74992
+ (0, import_react109.createElement)("span", { style: { marginTop: "4px", fontSize: "9px" } }, "261114-175423-667")
74952
74993
  )
74953
74994
  )
74954
74995
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-core-demo",
3
- "version": "0.35.30",
3
+ "version": "0.35.31",
4
4
  "description": "The shared UI foundation for DSH plugins, with a live component preview: design tokens, common controls, workspace browsing and notifications maintained in one place — install it to preview every component in a real host.",
5
5
  "icon": "./assets/icon-components.svg",
6
6
  "keywords": [