niuma-ui 1.3.7 → 1.3.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.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,28 @@
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.3.9] - 2026-09-21
10
+
11
+ ### 新增
12
+
13
+ - `RsAnchor`:页内目录。滚动容器可注入、墨点跟随、嵌套标题;Hash 路由设 `changeHash=false`。
14
+
15
+ ### 文档
16
+
17
+ - 新增 `site/` 文档站(何时使用、代码演示、API、Design Token)。GitHub Pages 部署 `pnpm build:site`。`playground/` 仅内部测试,`pnpm dev` 不变。
18
+ - `docs/components.md` 补为维护者架构契约(红线、公开面分层、Token / Vue / 浮层 / 表单 / a11y / SSR、新增检查清单);英文 `docs/components.en.md`。`CONTRIBUTING.md` 改为 site 优先,playground 不能代替文档站。
19
+ - `docs/components.en.md` 含完整组件清单;新增 `docs/consumers.en.md`;规范写明第三语言与 RTL 扩展步骤。中英清单必须同 PR 更新。
20
+ - README / 接入指南按消费方改写:用户页不写发版密钥;版本统一 1.3.8;快速开始可复制;`consumers.md` 与英文同步。发版步骤只留在 `CONTRIBUTING.md` / `CONTRIBUTING.en.md`。
21
+ - npm `description` 改为英文;`homepage` 指向文档站。`SECURITY.md` 中英并列。文档站指南页随 locale 切换英文正文。
22
+ - 架构契约写明外部规范范围:尽量遵守 WHATWG HTML、Vue Style Guide A/B、WAI-ARIA APG;Google HTML/CSS Style Guide 不作合同。冲突时语义 > APG 键盘 > Vue 风格。
23
+ - 明确 `playground/` 仅为内部冒烟与像素回归;对外用法只认 `site/` 文档站。playground 首页不再写安装教程。
24
+
25
+ ## [1.3.8] - 2026-09-17
26
+
27
+ ### 修复
28
+
29
+ - `RsSelect`:`size` 四档(`ssm` 极小 / `sm` / `md` / `lg`)同步到 Portal 下拉面板。选项行高、搜索框、空态跟触发器同档,不再一律按 md 高度。
30
+
9
31
  ## [1.3.7] - 2026-09-15
10
32
 
11
33
  ### 新增
package/NOTICE CHANGED
@@ -9,17 +9,20 @@ See the LICENSE file for the full license text.
9
9
 
10
10
  ----
11
11
 
12
+ Third-party dependencies are distributed under their own licenses.
13
+ Versions below are typical; the lockfile is authoritative.
14
+
12
15
  第三方依赖按其各自许可证分发,常见依赖如下(请以 lockfile 中的实际版本为准):
13
16
 
14
- | 项目 | 常见许可证 | 用途 |
15
- |------|------------|------|
16
- | Vue | MIT | peer 框架 |
17
- | Reka UI | MIT | 无障碍交互原语 |
18
- | Lucide (@lucide/vue) | ISC | 默认图标 |
17
+ | Project / 项目 | Typical license / 常见许可证 | Use / 用途 |
18
+ |----------------|------------------------------|------------|
19
+ | Vue | MIT | peer framework |
20
+ | Reka UI | MIT | accessible primitives |
21
+ | Lucide (@lucide/vue) | ISC | default icons |
19
22
  | Monaco Editor | MIT | RsMonacoEditor |
20
23
  | CodeMirror | MIT | RsCodeEditor |
21
24
  | xterm.js (@xterm/xterm) | MIT | RsTerminal |
22
- | marked | MIT | Markdown 解析 |
23
- | DOMPurify | Apache-2.0 / MPL-2.0 | HTML 消毒 |
24
- | dayjs | MIT | 日期辅助 |
25
- | vue-sonner | MIT | Toast 原语 |
25
+ | marked | MIT | Markdown parse |
26
+ | DOMPurify | Apache-2.0 / MPL-2.0 | HTML sanitize |
27
+ | dayjs | MIT | date helpers |
28
+ | vue-sonner | MIT | toast primitive |
package/README.en.md CHANGED
@@ -1,35 +1,35 @@
1
1
  # niuma-ui
2
2
 
3
3
  [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](./LICENSE)
4
+ [![npm](https://img.shields.io/npm/v/niuma-ui.svg)](https://www.npmjs.com/package/niuma-ui)
4
5
  [![Vue 3](https://img.shields.io/badge/Vue-3.5+-42b883.svg)](https://vuejs.org/)
5
6
  [![Node](https://img.shields.io/badge/Node-%3E%3D20-brightgreen.svg)](https://nodejs.org/)
6
- [![pnpm](https://img.shields.io/badge/pnpm-%3E%3D9-yellow.svg)](https://pnpm.io/)
7
7
 
8
8
  English | [简体中文](./README.md)
9
9
 
10
- Vue 3 **workbench** design system: `Rs*` components, `--rs-*` tokens, and optional editor / terminal wrappers.
10
+ Vue 3 **workbench** design system: consistent `Rs*` components, `--rs-*` tokens, and optional editor / terminal wrappers.
11
11
 
12
- Built for ops consoles, database workbenches, and internal admin UIs. Marketing sites can use named imports, but this is not a lightweight Ant Design-style kit — `npm install` pulls Monaco, CodeMirror, and xterm.
12
+ Built for ops consoles, database workbenches, and internal admin UIs. Marketing sites can use named imports. `npm install` pulls Monaco, CodeMirror, and xterm; named imports control the bundle.
13
13
 
14
- **Status:** open source from **v1.0.0** under [Apache License 2.0](./LICENSE). From **v1.2.0** the npm package is compiled ESM (`install` then import by package name).
14
+ **Status:** [Apache License 2.0](./LICENSE) since v1.0.0. Compiled ESM on npm since v1.2.0. Current version is **1.3.8** (`package.json` / npm `niuma-ui`).
15
15
 
16
16
  ## Features
17
17
 
18
- - **Design tokens** — light / dark via `data-rs-theme` and CSS variables; hosts can override a brand layer
19
- - **Rs\* components** — Button, Form, Dialog, Table, Tree, Tabs, and more
20
- - **Tooling-oriented** — Monaco, CodeMirror, xterm wrappers (import carefully in light apps)
21
- - **Accessible primitives** — built on [Reka UI](https://reka-ui.com/); apps only consume `niuma-ui`
22
- - **Vite-friendly** — `import { RsButton } from 'niuma-ui'` is the public API; `niumaUiHost` is serve-only HMR
18
+ - **Design tokens** — light / dark via `data-rs-theme` and CSS variables; hosts override a brand layer
19
+ - **Rs\* components** — Button, Form, Dialog, Table, Tree, Tabs, Anchor, and more
20
+ - **Tooling** — Monaco, CodeMirror, xterm (import only on routes that need them)
21
+ - **Accessibility** — [Reka UI](https://reka-ui.com/) underneath; apps depend only on `niuma-ui`
22
+ - **Vite** — `import { RsButton } from 'niuma-ui'` is enough to bundle; `niumaUiHost` is local `pnpm dev` HMR only
23
23
 
24
24
  ## Requirements
25
25
 
26
26
  | Item | Version |
27
27
  |------|---------|
28
28
  | Node.js | ≥ 20 |
29
- | Package manager | npm / pnpm / yarn (this repo develops with pnpm) |
29
+ | Package manager | npm / pnpm / yarn (this repo develops with pnpm ≥ 9) |
30
30
  | Vue | ^3.5 (`peerDependency`) |
31
31
  | Bundler | Vite 5+ recommended; `RsMonacoEditor` needs Vite `?worker` |
32
- | Styles | `import 'niuma-ui/styles.css'` passes through `@import 'tailwindcss'`; Vite hosts need `@tailwindcss/vite` |
32
+ | Styles | `import 'niuma-ui/styles.css'` (forwards `@import 'tailwindcss'`); Vite hosts add `@tailwindcss/vite` |
33
33
 
34
34
  ## Install
35
35
 
@@ -38,19 +38,15 @@ pnpm add niuma-ui
38
38
  # or: npm install niuma-ui / yarn add niuma-ui
39
39
  ```
40
40
 
41
- Pin a version:
41
+ Prefer a range such as `^1.3.0`. Pin **1.3.8** when you need a bit-for-bit install.
42
42
 
43
- ```bash
44
- pnpm add niuma-ui@1.2.0
45
- ```
46
-
47
- Local link and Vite details: **[Consumer guide](./docs/consumers.md)** (Chinese).
43
+ Local `link`, Vite plugins, and bundle size: **[Consumer guide](./docs/consumers.en.md)** ([中文](./docs/consumers.md)).
48
44
 
49
45
  ## Quick start
50
46
 
51
47
  ```ts
48
+ // main.ts
52
49
  import { createApp } from 'vue'
53
- import { RsConfigProvider, RsButton } from 'niuma-ui'
54
50
  import 'niuma-ui/styles.css'
55
51
  import App from './App.vue'
56
52
 
@@ -58,45 +54,67 @@ createApp(App).mount('#app')
58
54
  ```
59
55
 
60
56
  ```vue
57
+ <!-- App.vue -->
61
58
  <script setup lang="ts">
62
59
  import { RsConfigProvider, RsButton } from 'niuma-ui'
63
60
  </script>
64
61
 
65
62
  <template>
66
- <RsConfigProvider theme="light" locale="zh-CN">
63
+ <RsConfigProvider theme="light" locale="en-US">
67
64
  <RsButton variant="primary">Hello</RsButton>
68
65
  </RsConfigProvider>
69
66
  </template>
70
67
  ```
71
68
 
72
- ## Usage conventions
69
+ Shipped locales: `zh-CN` | `en-US`.
70
+
71
+ ## Usage
73
72
 
74
- 1. Apps import only from `niuma-ui` — **do not** depend on `reka-ui` directly.
75
- 2. Styles: `import 'niuma-ui/styles.css'`.
76
- 3. Wrap the app with `RsConfigProvider`.
77
- 4. Light apps should named-import and wrap what they need — do not `import *`. Install still includes editor dependencies; tree-shaking only affects the bundle.
73
+ 1. Named-import from the package root only. **Do not** depend on `reka-ui`. Do not `import *`.
74
+ 2. Import `niuma-ui/styles.css` once, then your brand CSS.
75
+ 3. Wrap the app with `RsConfigProvider` (theme, locale, default control size).
76
+ 4. Light sites re-export used symbols from their own `ui.ts`. Do not alias the package to this repo’s `src/index.ts`.
78
77
 
79
- Component catalog: **[docs/components.md](./docs/components.md)**.
78
+ Component APIs live on the docs site. The architecture contract is for maintainers: [components.en.md](./docs/components.en.md) ([中文](./docs/components.md)).
80
79
 
81
- ## Live demos
80
+ ## Docs
82
81
 
83
- - **Component site**: [https://blair-shang.github.io/niuma-ui/](https://blair-shang.github.io/niuma-ui/) (GitHub Pages, deploys from `main`)
84
- - Local: `pnpm dev` → http://localhost:5180
82
+ - **Component site:** [https://blair-shang.github.io/niuma-ui/](https://blair-shang.github.io/niuma-ui/) (source: `site/`)
83
+ - Local docs: `pnpm dev:site` → http://127.0.0.1:5181
84
+ - `playground/` is internal smoke / visual regression only (`pnpm dev` → :5180). It is not usage documentation.
85
+
86
+ | Doc | Audience |
87
+ |-----|----------|
88
+ | [docs/consumers.en.md](./docs/consumers.en.md) | People installing the library ([中文](./docs/consumers.md)) |
89
+ | [docs/components.en.md](./docs/components.en.md) | People changing this repository ([中文](./docs/components.md)) |
90
+ | [CONTRIBUTING.en.md](./CONTRIBUTING.en.md) | PRs, tests, releases ([中文](./CONTRIBUTING.md)) |
91
+ | [CHANGELOG.md](./CHANGELOG.md) | Release notes |
92
+ | [SECURITY.md](./SECURITY.md) | Private vulnerability reports |
85
93
 
86
94
  ## Local development
87
95
 
88
96
  ```bash
89
97
  pnpm install
90
- pnpm dev
91
- pnpm build # library → dist/ (npm publish)
92
- pnpm build:playground
98
+ pnpm dev:site # docs site
93
99
  pnpm test
100
+ pnpm build # library → dist/
94
101
  ```
95
102
 
103
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for the full contributor flow.
104
+
96
105
  ## Versioning
97
106
 
98
- Semantic Versioning. Stable publishes set the npm dist-tag **`latest`** (prereleases use `next`). There is no GitHub tag named `latest`. Pin a SemVer tag for reproducible releases. See [CHANGELOG.md](./CHANGELOG.md).
107
+ [Semantic Versioning](https://semver.org/): compatible fixes are PATCH, compatible features MINOR, breaking API or token renames MAJOR.
108
+
109
+ Stable publishes set npm dist-tag **`latest`**; prereleases use **`next`**. There is no Git tag named `latest`. Release steps live only in [CONTRIBUTING.md](./CONTRIBUTING.md).
110
+
111
+ ## License and credits
112
+
113
+ [Apache License 2.0](./LICENSE). Attribution: [NOTICE](./NOTICE).
99
114
 
100
- ## License
115
+ Primitives: [Reka UI](https://reka-ui.com/). Icons: [Lucide](https://lucide.dev/). Editors: [Monaco](https://microsoft.github.io/monaco-editor/), [CodeMirror](https://codemirror.net/). Terminal: [xterm.js](https://xtermjs.org/).
101
116
 
102
- [Apache License 2.0](./LICENSE). See [NOTICE](./NOTICE) for attribution.
117
+ - Docs: https://blair-shang.github.io/niuma-ui/
118
+ - npm: https://www.npmjs.com/package/niuma-ui
119
+ - Source: https://github.com/Blair-Shang/niuma-ui
120
+ - Issues: https://github.com/Blair-Shang/niuma-ui/issues
package/README.md CHANGED
@@ -1,60 +1,52 @@
1
1
  # niuma-ui
2
2
 
3
3
  [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](./LICENSE)
4
+ [![npm](https://img.shields.io/npm/v/niuma-ui.svg)](https://www.npmjs.com/package/niuma-ui)
4
5
  [![Vue 3](https://img.shields.io/badge/Vue-3.5+-42b883.svg)](https://vuejs.org/)
5
6
  [![Node](https://img.shields.io/badge/Node-%3E%3D20-brightgreen.svg)](https://nodejs.org/)
6
- [![pnpm](https://img.shields.io/badge/pnpm-%3E%3D9-yellow.svg)](https://pnpm.io/)
7
7
 
8
8
  [English](./README.en.md) | 简体中文
9
9
 
10
- Vue 3 **工作台**设计系统:一致的 `Rs*` 组件、`--rs-*` token,以及面向桌面工具的编辑器 / 终端封装。
10
+ Vue 3 **工作台**设计系统:一致的 `Rs*` 组件与 `--rs-*` Token,以及按需使用的编辑器 / 终端封装。
11
11
 
12
- 适用于运维控制台、数据库工作台、内部后台。营销站 / 落地页也可以用,但请具名导入;本包不是 Ant Design 那种轻量通用库,`npm install` 会带上 Monaco、CodeMirror、xterm。
12
+ 适用于运维控制台、数据库工作台、内部后台。营销站也可以用具名导入。`npm install` 会带上 Monaco、CodeMirror、xterm,体积靠具名导入摇树。
13
13
 
14
- **状态:** 自 **v1.0.0** 起按 [Apache License 2.0](./LICENSE) 开源。自 **v1.2.0** 起 npm 发布编译后的 ESM(`install` 后按包名导入即可)。
14
+ **状态:** [Apache License 2.0](./LICENSE),自 v1.0.0 开源。自 v1.2.0 起 npm 发布编译 ESM,按包名导入即可。当前版本见 npm 上的 `niuma-ui`(仓库 `package.json` 为 **1.3.8**)。
15
15
 
16
16
  ## 特性
17
17
 
18
- - **设计 token**:明暗主题通过 `data-rs-theme` 与 CSS 变量驱动,业务侧可用品牌层覆盖
19
- - **Rs\* 组件**:Button、Form、Dialog、Table、Tree、Tabs 等完整交互控件
20
- - **专业工具向**:Monaco、CodeMirror、xterm 等编辑器 / 终端封装(按需引入)
21
- - **无障碍与焦点**:底层基于 [Reka UI](https://reka-ui.com/),业务层只消费 `niuma-ui`
22
- - **Vite 友好**:`import { RsButton } from 'niuma-ui'` 即可打包;`niumaUiHost` 只服务本机 `pnpm dev` 联调源码
18
+ - **Design Token**:明暗主题走 `data-rs-theme` 与 CSS 变量,宿主用品牌层覆盖
19
+ - **Rs\* 组件**:Button、Form、Dialog、Table、Tree、Tabs、Anchor 等
20
+ - **专业工具**:Monaco、CodeMirror、xterm(只在用到的路由引入)
21
+ - **无障碍**:底层 [Reka UI](https://reka-ui.com/),应用只依赖 `niuma-ui`
22
+ - **Vite**:`import { RsButton } from 'niuma-ui'` 即可打包;`niumaUiHost` 仅本机 `pnpm dev` 联调源码
23
23
 
24
24
  ## 要求
25
25
 
26
26
  | 项 | 版本 |
27
27
  |----|------|
28
28
  | Node.js | ≥ 20 |
29
- | 包管理器 | npm / pnpm / yarn(本仓库开发用 pnpm) |
30
- | Vue | ^3.5.0(peerDependency) |
31
- | 打包器 | Vite 5+ 推荐;使用 `RsMonacoEditor` 时需要 Vite 处理 `?worker` |
32
- | 样式 | `import 'niuma-ui/styles.css'`(透传 `@import 'tailwindcss'`);Vite 宿主用 `@tailwindcss/vite` 处理 |
29
+ | 包管理器 | npm / pnpm / yarn(本仓库开发用 pnpm ≥ 9) |
30
+ | Vue | ^3.5(peerDependency) |
31
+ | 打包器 | 推荐 Vite 5+;`RsMonacoEditor` 需要 Vite 处理 `?worker` |
32
+ | 样式 | `import 'niuma-ui/styles.css'`(内含 `@import 'tailwindcss'`);Vite 宿主加 `@tailwindcss/vite` |
33
33
 
34
34
  ## 安装
35
35
 
36
36
  ```bash
37
37
  pnpm add niuma-ui
38
38
  # 或 npm install niuma-ui / yarn add niuma-ui
39
- # 业务流水线跟最新正式版(npm dist-tag latest,无 GitHub 标签 latest)
40
- pnpm add niuma-ui@latest
41
39
  ```
42
40
 
43
- 钉死某一版:
41
+ 建议锁定兼容范围,例如 `^1.3.0`。精确复现请钉死版本(当前 **1.3.8**)。
44
42
 
45
- ```bash
46
- pnpm add niuma-ui@1.2.0
47
- # 或
48
- pnpm add git+https://github.com/Blair-Shang/niuma-ui.git#v1.2.0
49
- ```
50
-
51
- 本地 link、Vite 配置、包体积建议见 **[消费方指南](./docs/consumers.md)**。
43
+ 本地改源码、Vite 插件、包体积见 **[消费方指南](./docs/consumers.md)**([English](./docs/consumers.en.md))。
52
44
 
53
45
  ## 快速开始
54
46
 
55
47
  ```ts
48
+ // main.ts
56
49
  import { createApp } from 'vue'
57
- import { RsConfigProvider, RsButton } from 'niuma-ui'
58
50
  import 'niuma-ui/styles.css'
59
51
  import App from './App.vue'
60
52
 
@@ -62,6 +54,7 @@ createApp(App).mount('#app')
62
54
  ```
63
55
 
64
56
  ```vue
57
+ <!-- App.vue -->
65
58
  <script setup lang="ts">
66
59
  import { RsConfigProvider, RsButton } from 'niuma-ui'
67
60
  </script>
@@ -73,96 +66,61 @@ import { RsConfigProvider, RsButton } from 'niuma-ui'
73
66
  </template>
74
67
  ```
75
68
 
69
+ `locale` 现支持 `zh-CN` | `en-US`。
70
+
76
71
  ## 使用约定
77
72
 
78
- 1. 应用与业务模块只允许 `import { … } from 'niuma-ui'`,**禁止**直接依赖 `reka-ui`。
79
- 2. 样式入口:`import 'niuma-ui/styles.css'`(须在业务品牌 CSS 之前或按文档顺序加载)。
80
- 3. 根节点使用 `RsConfigProvider` 提供主题、语言与默认控件尺寸。
81
- 4. 从主入口具名导入;轻量宿主在自己的 `ui.ts` 里再导出。启用 `niumaUiHost`,不要 `import *`,也不要把主入口别名到 `src/index.ts`。
73
+ 1. 只从包根具名导入:`import { RsButton } from 'niuma-ui'`。**不要**直接依赖 `reka-ui`,不要 `import *`。
74
+ 2. 样式只引一次 `niuma-ui/styles.css`,再加载你的品牌 CSS。
75
+ 3. 根节点包 `RsConfigProvider`(主题、语言、默认控件尺寸)。
76
+ 4. 轻量站点在自己的 `ui.ts` 里再导出用到的符号。不要把包名别名到本仓库的 `src/index.ts`。
77
+
78
+ 组件 API 以文档站为准。仓库里的架构契约给维护者:[组件规范](./docs/components.md)([English](./docs/components.en.md))。
82
79
 
83
- 组件清单与新增组件规范见 **[组件说明](./docs/components.md)**。
80
+ ## 文档
84
81
 
85
- ## 在线演示
82
+ - **组件文档(官网)**:[https://blair-shang.github.io/niuma-ui/](https://blair-shang.github.io/niuma-ui/)(源码 `site/`)
83
+ - 本地文档站:`pnpm dev:site` → http://127.0.0.1:5181
84
+ - `playground/` 仅内部冒烟与像素回归(`pnpm dev` → :5180),不提供对外用法
86
85
 
87
- - **组件演示站**:[https://blair-shang.github.io/niuma-ui/](https://blair-shang.github.io/niuma-ui/)(随 `main` 由 [pages.yml](./.github/workflows/pages.yml) 部署)
88
- - 首次启用:仓库 **Settings → Pages → Source** 选 **GitHub Actions**
89
- - 本地:`pnpm dev` → http://localhost:5180
86
+ | 文档 | 给谁看 |
87
+ |------|--------|
88
+ | [docs/consumers.md](./docs/consumers.md) | 把库装进产品的人([English](./docs/consumers.en.md)) |
89
+ | [docs/components.md](./docs/components.md) | 改本仓库的人([English](./docs/components.en.md)) |
90
+ | [CONTRIBUTING.md](./CONTRIBUTING.md) | PR、测试、发版([English](./CONTRIBUTING.en.md)) |
91
+ | [CHANGELOG.md](./CHANGELOG.md) | 版本记录 |
92
+ | [SECURITY.md](./SECURITY.md) | 漏洞私下报告 |
90
93
 
91
94
  ## 本地开发
92
95
 
93
96
  ```bash
94
97
  pnpm install
95
- pnpm dev # 组件演示,默认 http://localhost:5180
96
- pnpm build # 库产物 → dist/(npm 发布)
97
- pnpm build:playground # 构建演示站静态资源 → playground-dist/
98
- pnpm test # Vitest
99
- pnpm test:watch
98
+ pnpm dev:site # 文档站
99
+ pnpm test # Vitest
100
+ pnpm build # 库 → dist/
100
101
  ```
101
102
 
102
- | 路径 | 说明 |
103
- |------|------|
104
- | `src/components/` | `Rs*` 组件实现 |
105
- | `src/styles.css` | Token 与全局样式 |
106
- | `src/theme/` | 主题应用与品牌覆盖示例 |
107
- | `src/monaco/` | Monaco 语言与 Worker 辅助 |
108
- | `playground/` | 组件演示应用(对外演示门面) |
109
- | `vite-plugins/` | 可供宿主工程复用的 Vite 插件 |
110
- | `docs/` | 接入与组件类文档 |
111
-
112
- ## 版本与发版
103
+ 贡献步骤见 [CONTRIBUTING.md](./CONTRIBUTING.md)。
113
104
 
114
- 遵循 [Semantic Versioning](https://semver.org/):
105
+ ## 版本
115
106
 
116
- | 变更类型 | 版本 |
117
- |----------|------|
118
- | 缺陷修复、文档(兼容) | PATCH `1.0.x` |
119
- | 新增组件 / 能力(兼容) | MINOR `1.x.0` |
120
- | 破坏性 API 或 token 更名 | MAJOR `x.0.0` |
107
+ 遵循 [Semantic Versioning](https://semver.org/lang/zh-CN/):
121
108
 
122
- ```bash
123
- # 1. 更新 package.json 的 version
124
- # 2. 更新 CHANGELOG.md
125
- # 3. 提交并推送 main 后打 tag(推送 tag 会触发 Publish 流水线自动 pnpm publish)
126
- git tag v1.0.1
127
- git push origin v1.0.1
128
- ```
129
-
130
- 需在仓库 Settings → Secrets 配置 **`NPM_TOKEN`**:
131
-
132
- 1. 打开 https://www.npmjs.com/settings/shangjian/tokens → **Generate New Token** → **Granular Access Token**
133
- 2. Permissions:对包 `niuma-ui` 勾选 **Read and write**
134
- 3. 务必开启 **Bypass two-factor authentication**(否则 CI 会报 `EOTP`)
135
- 4. 把 token 填进 GitHub Secret 名 `NPM_TOKEN`
136
-
137
- 不要配置 `NPM_OTP`:一次性验证码约 30 秒过期,无法用于自动发版。
109
+ | 变更 | 版本 |
110
+ |------|------|
111
+ | 兼容的缺陷 / 文档 | PATCH |
112
+ | 兼容的新组件 / 能力 | MINOR |
113
+ | 破坏性 API 或 Token 更名 | MAJOR |
138
114
 
139
- 也可在 Actions 里手动运行 **Publish** 工作流。
115
+ 正式版更新 npm dist-tag **`latest`**,预发布走 **`next`**。没有名为 `latest` 的 Git 标签。发版流程只在 [CONTRIBUTING.md](./CONTRIBUTING.md),不在本页。
140
116
 
141
- 正式版会更新 npm dist-tag **`latest`**(`niuma-ui@latest`),不维护 GitHub 标签 `latest`。可复现发版请钉 SemVer tag;预发布走 npm tag `next`。
117
+ ## 许可与致谢
142
118
 
143
- 详见 [CHANGELOG.md](./CHANGELOG.md)。
119
+ [Apache License 2.0](./LICENSE)。版权与第三方声明见 [NOTICE](./NOTICE)。
144
120
 
145
- ## 相关文档
121
+ 交互原语:[Reka UI](https://reka-ui.com/)。图标:[Lucide](https://lucide.dev/)。编辑器:[Monaco](https://microsoft.github.io/monaco-editor/)、[CodeMirror](https://codemirror.net/)。终端:[xterm.js](https://xtermjs.org/)。
146
122
 
147
- | 文档 | 内容 |
148
- |------|------|
149
- | [docs/consumers.md](./docs/consumers.md) | 宿主工程接入、联调、CI、体积与插件 |
150
- | [docs/components.md](./docs/components.md) | 公开组件清单与设计约定 |
151
- | [CONTRIBUTING.md](./CONTRIBUTING.md) | 贡献指南 |
152
- | [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) | 行为准则 |
153
- | [SECURITY.md](./SECURITY.md) | 安全漏洞报告 |
154
- | [NOTICE](./NOTICE) | Apache 版权与第三方声明 |
155
- | [README.en.md](./README.en.md) | English README |
156
- | [src/theme/brand.example.css](./src/theme/brand.example.css) | 品牌色覆盖示例 |
157
-
158
- ## 仓库信息
159
-
160
- - **包名**:`niuma-ui`
161
- - **源码**:https://github.com/Blair-Shang/niuma-ui
162
- - **Issues**:https://github.com/Blair-Shang/niuma-ui/issues
163
- - **开源基线**:`v1.0.0`
164
- - **许可**:[Apache License 2.0](./LICENSE)
165
-
166
- ## 致谢
167
-
168
- 交互原语基于 [Reka UI](https://reka-ui.com/);图标默认集成 [Lucide](https://lucide.dev/);代码编辑能力基于 [Monaco Editor](https://microsoft.github.io/monaco-editor/) 与 [CodeMirror](https://codemirror.net/);终端基于 [xterm.js](https://xtermjs.org/)。
123
+ - 文档站:https://blair-shang.github.io/niuma-ui/
124
+ - npm:https://www.npmjs.com/package/niuma-ui
125
+ - 源码:https://github.com/Blair-Shang/niuma-ui
126
+ - Issues:https://github.com/Blair-Shang/niuma-ui/issues
@@ -0,0 +1,65 @@
1
+
2
+ .rs-anchor[data-v-d8c4280b] {
3
+ position: relative;
4
+ display: flex;
5
+ gap: 0.7rem;
6
+ min-width: 8.5rem;
7
+ }
8
+ .rs-anchor--affix[data-v-d8c4280b] {
9
+ position: sticky;
10
+ top: var(--rs-space-lg);
11
+ }
12
+ .rs-anchor__rail[data-v-d8c4280b] {
13
+ position: relative;
14
+ flex-shrink: 0;
15
+ width: 2px;
16
+ border-radius: var(--rs-radius-full);
17
+ background: color-mix(in srgb, var(--rs-border-subtle) 88%, var(--rs-muted));
18
+ }
19
+ .rs-anchor__ink[data-v-d8c4280b] {
20
+ position: absolute;
21
+ inset-inline-start: 0;
22
+ top: 0;
23
+ width: 2px;
24
+ border-radius: inherit;
25
+ background: var(--rs-primary);
26
+ box-shadow: 0 0 0 1px color-mix(in srgb, var(--rs-primary) 18%, transparent);
27
+ opacity: 0;
28
+ transition:
29
+ transform 180ms ease,
30
+ height 180ms ease,
31
+ opacity 180ms ease;
32
+ }
33
+ .rs-anchor__list[data-v-d8c4280b] {
34
+ display: flex;
35
+ flex-direction: column;
36
+ min-width: 0;
37
+ flex: 1;
38
+ }
39
+ .rs-anchor__link[data-v-d8c4280b] {
40
+ display: block;
41
+ padding-block: 0.28rem;
42
+ color: var(--rs-muted);
43
+ font-size: var(--rs-font-size-xs);
44
+ line-height: 1.55;
45
+ text-decoration: none;
46
+ border-radius: var(--rs-radius-xs);
47
+ transition: color var(--rs-transition-fast);
48
+ }
49
+ .rs-anchor__link[data-v-d8c4280b]:hover {
50
+ color: var(--rs-text);
51
+ }
52
+ .rs-anchor__link[data-v-d8c4280b]:focus-visible {
53
+ outline: 2px solid var(--rs-primary);
54
+ outline-offset: 2px;
55
+ }
56
+ .rs-anchor__link--active[data-v-d8c4280b] {
57
+ color: var(--rs-primary);
58
+ font-weight: 600;
59
+ }
60
+ .rs-anchor--lineless .rs-anchor__link[data-v-d8c4280b] {
61
+ padding-inline: 0.45rem;
62
+ }
63
+ .rs-anchor--lineless .rs-anchor__link--active[data-v-d8c4280b] {
64
+ background: color-mix(in srgb, var(--rs-primary) 10%, transparent);
65
+ }
@@ -0,0 +1,41 @@
1
+ import { type RsAnchorItem } from './anchor-utils';
2
+ type __VLS_Props = {
3
+ items: RsAnchorItem[];
4
+ /** 判定「已滚过」的顶部偏移(px) */
5
+ offset?: number;
6
+ /** 点击滚动后标题距容器顶的距离 */
7
+ targetOffset?: number;
8
+ /** 额外容差,避免刚贴顶就跳下一项 */
9
+ bounds?: number;
10
+ /** sticky 吸附 */
11
+ affix?: boolean;
12
+ /** 无轨道墨点(仅文字高亮) */
13
+ lineless?: boolean;
14
+ /**
15
+ * 是否改写 location.hash。
16
+ * Hash 路由(Vue Router createWebHashHistory)必须为 false,否则会丢掉当前路由。
17
+ */
18
+ changeHash?: boolean;
19
+ getContainer?: () => HTMLElement | Window | null | undefined;
20
+ };
21
+ type __VLS_ModelProps = {
22
+ modelValue?: string;
23
+ };
24
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
25
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
26
+ change: (href: string) => any;
27
+ click: (href: string, event: MouseEvent) => any;
28
+ "update:modelValue": (value: string) => any;
29
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
30
+ onChange?: ((href: string) => any) | undefined;
31
+ onClick?: ((href: string, event: MouseEvent) => any) | undefined;
32
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
33
+ }>, {
34
+ offset: number;
35
+ bounds: number;
36
+ affix: boolean;
37
+ lineless: boolean;
38
+ changeHash: boolean;
39
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
40
+ declare const _default: typeof __VLS_export;
41
+ export default _default;