@morlay/dsh-client-ui-primitives 0.0.2-alpha.7 → 0.0.2-alpha.9

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 (35) hide show
  1. package/README.md +275 -13
  2. package/dist/client.cjs +4959 -1057
  3. package/dist/client.d.cts +1366 -16
  4. package/dist/client.d.mts +1365 -16
  5. package/dist/rolldown-runtime-EAsCxrDo.mjs +14 -0
  6. package/locale/en.json +1 -1
  7. package/locale/zh.json +1 -1
  8. package/package.json +28 -11
  9. package/src/client/index.ts +41 -2
  10. package/src/client/schema-form/Editor.tsx +777 -0
  11. package/src/client/schema-form/SchemaForm.tsx +77 -0
  12. package/src/client/schema-form/controller.ts +457 -0
  13. package/src/client/schema-form/draft.ts +487 -0
  14. package/src/client/schema-form/fields.tsx +100 -0
  15. package/src/client/schema-form/hints.ts +286 -0
  16. package/src/client/schema-form/index.ts +188 -0
  17. package/src/client/schema-form/labels.ts +30 -0
  18. package/src/client/schema-form/lines.ts +334 -0
  19. package/src/client/schema-form/locales.ts +128 -0
  20. package/src/client/schema-form/rows.ts +153 -0
  21. package/src/client/schema-form/schema-node.ts +812 -0
  22. package/src/client/schema-form/slot-contract.ts +156 -0
  23. package/src/client/schema-form/styles.ts +310 -0
  24. package/src/client/schema-form/testing/fake-describe.ts +45 -0
  25. package/src/client/schema-form/testing/fake-scope.ts +97 -0
  26. package/src/client/schema-form/value.tsx +146 -0
  27. package/src/client/settings-form/SettingsForm.styles.ts +58 -0
  28. package/src/client/settings-form/SettingsForm.tsx +72 -0
  29. package/src/client/settings-form/fields.styles.ts +158 -0
  30. package/src/client/settings-form/fields.tsx +194 -0
  31. package/src/client/settings-form/form-model.ts +421 -0
  32. package/src/client/settings-form/index.ts +19 -0
  33. package/src/client/styling/focus.ts +9 -0
  34. package/src/client/theme.generated.ts +802 -728
  35. package/cordis.patch.yml +0 -3
@@ -0,0 +1,14 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
4
+ var __exportAll = (all, no_symbols) => {
5
+ let target = {};
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
11
+ return target;
12
+ };
13
+ //#endregion
14
+ export { __exportAll as n, __commonJSMin as t };
package/locale/en.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "UI Primitives",
4
- "description": "css-in-js styling layer plus the shared reference parser and renderer for the forked conversation UI."
4
+ "description": "css-in-js styling layer plus the shared reference parser and renderer for the forked conversation UI. It also carries the schema-driven row config pages (field-slot injection)."
5
5
  }
6
6
  }
package/locale/zh.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "UI 基础层",
4
- "description": "css-in-js 样式层,以及被 fork 的对话 UI 共用的引用解析与渲染转换。"
4
+ "description": "css-in-js 样式层,以及被 fork 的对话 UI 共用的引用解析与渲染转换。 另含按行 schema 自动生成的行配置页(字段槽注入)。"
5
5
  }
6
6
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@morlay/dsh-client-ui-primitives",
3
- "version": "0.0.2-alpha.7",
4
- "description": "css-in-js styling kit (styled / Token / Styling) for the forked conversation UI: consumes the official --dsw-* design tokens, so no CSS Modules precompile step is needed.",
3
+ "version": "0.0.2-alpha.9",
4
+ "description": "css-in-js styling kit (styled / Token / Styling) plus the shared reference parser and renderer (findReferences / parseReferenceToken) for the forked conversation UI: consumes the official --dsw-* design tokens, so no CSS Modules precompile step is needed.",
5
5
  "keywords": [
6
6
  "client",
7
7
  "css-in-js",
@@ -19,14 +19,12 @@
19
19
  "locale/*.json",
20
20
  "dist",
21
21
  "src",
22
- "cordis.patch.yml",
23
22
  "!**/__tests__"
24
23
  ],
25
24
  "type": "module",
26
25
  "exports": {
27
26
  ".": "./dist/index.mjs",
28
27
  "./package.json": "./package.json",
29
- "./cordis.patch.yml": "./cordis.patch.yml",
30
28
  "./client": {
31
29
  "types": "./dist/client.d.cts",
32
30
  "default": "./dist/client.cjs"
@@ -42,7 +40,17 @@
42
40
  "micromark-util-types": "^2.0.2"
43
41
  },
44
42
  "devDependencies": {
45
- "@deepseek-ai/dsh-client-ui-primitives": "0.1.7-alpha.2",
43
+ "@deepseek-ai/dsh-api-remotes": "0.1.7-rc.2",
44
+ "@deepseek-ai/dsh-client-locale": "0.1.7-rc.2",
45
+ "@deepseek-ai/dsh-client-store": "0.1.7-rc.2",
46
+ "@deepseek-ai/dsh-client-ui-plugin-manager": "0.1.7-rc.2",
47
+ "@deepseek-ai/dsh-client-ui-primitives": "0.1.7-rc.2",
48
+ "@deepseek-ai/dsh-client-ui-renderer": "0.1.7-rc.2",
49
+ "@deepseek-ai/dsh-client-ui-settings": "0.1.7-rc.2",
50
+ "@deepseek-ai/dsh-client-ui-slots": "0.1.7-rc.2",
51
+ "@deepseek-ai/dsh-util-values": "0.1.7-rc.2",
52
+ "@deepseek-ai/schemastery": "3.18.4",
53
+ "@testing-library/react": "^16.3.0",
46
54
  "@types/mdast": "^4.0.4",
47
55
  "@types/react": "~18.3.1",
48
56
  "csstype": "^3.1.3",
@@ -50,19 +58,28 @@
50
58
  "react-dom": "^18.2.0"
51
59
  },
52
60
  "peerDependencies": {
53
- "@deepseek-ai/cordis": "4.0.4"
61
+ "@deepseek-ai/cordis": "^4.0.4",
62
+ "@deepseek-ai/dsh-api-remotes": "^0.1.7-rc.2",
63
+ "@deepseek-ai/dsh-client-locale": "^0.1.7-rc.2",
64
+ "@deepseek-ai/dsh-client-store": "^0.1.7-rc.2",
65
+ "@deepseek-ai/dsh-client-ui-plugin-manager": "^0.1.7-rc.2",
66
+ "@deepseek-ai/dsh-client-ui-renderer": "^0.1.7-rc.2",
67
+ "@deepseek-ai/dsh-client-ui-settings": "^0.1.7-rc.2",
68
+ "@deepseek-ai/dsh-client-ui-slots": "^0.1.7-rc.2"
54
69
  },
55
70
  "dsh": {
56
71
  "client": {
57
72
  "platform": "web",
58
- "inject": []
59
- },
60
- "bundle": {
61
- "patch": "./cordis.patch.yml"
73
+ "inject": [
74
+ "@deepseek-ai/dsh-client-locale",
75
+ "@deepseek-ai/dsh-client-ui-plugin-manager",
76
+ "@deepseek-ai/dsh-client-ui-settings",
77
+ "@deepseek-ai/dsh-client-ui-slots"
78
+ ]
62
79
  }
63
80
  },
64
81
  "scripts": {
65
82
  "build": "pnpm exec tsdown",
66
- "gen:tokens": "pnpm exec tsx scripts/gen-design-tokens.mts"
83
+ "gen:tokens": "pnpm exec tsx scripts/gen-design-tokens.mts && pnpm exec oxfmt src/client/theme.generated.ts"
67
84
  }
68
85
  }
@@ -1,8 +1,36 @@
1
1
  import type { Context } from "@deepseek-ai/cordis";
2
+ import * as schemaForm from "./schema-form/index.ts";
2
3
 
3
4
  export * from "./styling/index.ts";
4
5
  export * from "./theme.ts";
5
6
  export * from "./markdown-labels.ts";
7
+ export * from "./settings-form/index.ts";
8
+ // 按行 schema 自动生成的行配置页(原 `@morlay/dsh-client-ui-schema-form/client`,2026-09-28 合并进来):
9
+ // 两者都是"对话 UI / 设置页的基础面",拆成两行会各自注册一遍、还要求每个 bundle 都插齐两行。
10
+ // 只**具名导出**它那一面的门面:`export *` 会与 settings-form 的样式 / token 重名。
11
+ export * as schemaForm from "./schema-form/index.ts";
12
+ export {
13
+ NS as SCHEMA_FORM_NS,
14
+ SchemaFormController,
15
+ SchemaFormHints,
16
+ failureOf,
17
+ projectRoot,
18
+ rowRegistrations,
19
+ walkFields,
20
+ } from "./schema-form/index.ts";
21
+ export type {
22
+ FieldNode,
23
+ FieldMeta,
24
+ SchemaFormActions,
25
+ SchemaFormFace,
26
+ SchemaFormLocaleKey,
27
+ SchemaFormState,
28
+ SelectOption,
29
+ SelectSpec,
30
+ SuggestedKeys,
31
+ ValidationFailure,
32
+ WalkedField,
33
+ } from "./schema-form/index.ts";
6
34
 
7
35
  export {
8
36
  findReferences,
@@ -16,6 +44,17 @@ export type { Reference, ReferenceSpan } from "../reference.ts";
16
44
  export { ReferenceMarkdown, referenceMentions } from "../reference-markdown.tsx";
17
45
  export type { ReferenceActions, ReferenceMarkdownProps } from "../reference-markdown.tsx";
18
46
 
19
- export const inject: readonly string[] = [];
47
+ /**
48
+ * 需要的**服务名**:样式与引用那半不要服务,schema 表单那半要槽位、字典与配置表单。
49
+ *
50
+ * 与包清单里的 `dsh.client.inject` 不是一回事:那份是**装配行 id**(谁先到),交给模块系统排 arrival 顺序;
51
+ * 这里读的是 cordis 服务名(谁已 provide),Loader 拿它决定这一行何时才算 active。写错成包名,这一行就永远
52
+ * pending(`web boot: ... waiting for services`)。
53
+ *
54
+ * 值直接取自 schema 表单那一面,不另抄一份清单。
55
+ */
56
+ export const inject: readonly string[] = [...schemaForm.inject];
20
57
 
21
- export function apply(_ctx: Context): void {}
58
+ export function apply(ctx: Context): void {
59
+ schemaForm.apply(ctx);
60
+ }