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 +22 -0
- package/NOTICE +12 -9
- package/README.en.md +52 -34
- package/README.md +55 -97
- package/dist/components/RsAnchor.css +65 -0
- package/dist/components/RsAnchor.d.ts +41 -0
- package/dist/components/RsAnchor.impl.js +188 -0
- package/dist/components/RsAnchor.js +8 -0
- package/dist/components/RsSelect.css +39 -39
- package/dist/components/RsSelect.impl.js +1 -0
- package/dist/components/RsSelect.js +1 -1
- package/dist/components/RsTerminal.css +23 -23
- package/dist/components/RsTerminal.d.ts +9 -0
- package/dist/components/RsTerminal.impl.js +21 -2
- package/dist/components/RsTerminal.js +1 -1
- package/dist/components/anchor-utils.d.ts +26 -0
- package/dist/components/anchor-utils.js +63 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4 -0
- package/dist/locale/messages.js +40 -38
- package/dist/styles.css +58 -0
- package/package.json +7 -3
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 |
|
|
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)
|
|
4
|
+
[](https://www.npmjs.com/package/niuma-ui)
|
|
4
5
|
[](https://vuejs.org/)
|
|
5
6
|
[](https://nodejs.org/)
|
|
6
|
-
[](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
|
|
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:**
|
|
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
|
|
19
|
-
- **Rs\* components** — Button, Form, Dialog, Table, Tree, Tabs, and more
|
|
20
|
-
- **Tooling
|
|
21
|
-
- **
|
|
22
|
-
- **Vite
|
|
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'`
|
|
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
|
|
41
|
+
Prefer a range such as `^1.3.0`. Pin **1.3.8** when you need a bit-for-bit install.
|
|
42
42
|
|
|
43
|
-
|
|
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="
|
|
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
|
-
|
|
69
|
+
Shipped locales: `zh-CN` | `en-US`.
|
|
70
|
+
|
|
71
|
+
## Usage
|
|
73
72
|
|
|
74
|
-
1.
|
|
75
|
-
2.
|
|
76
|
-
3. Wrap the app with `RsConfigProvider
|
|
77
|
-
4. Light
|
|
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
|
|
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
|
-
##
|
|
80
|
+
## Docs
|
|
82
81
|
|
|
83
|
-
- **Component site
|
|
84
|
-
- Local: `pnpm dev` → http://
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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)
|
|
4
|
+
[](https://www.npmjs.com/package/niuma-ui)
|
|
4
5
|
[](https://vuejs.org/)
|
|
5
6
|
[](https://nodejs.org/)
|
|
6
|
-
[](https://pnpm.io/)
|
|
7
7
|
|
|
8
8
|
[English](./README.en.md) | 简体中文
|
|
9
9
|
|
|
10
|
-
Vue 3 **工作台**设计系统:一致的 `Rs*`
|
|
10
|
+
Vue 3 **工作台**设计系统:一致的 `Rs*` 组件与 `--rs-*` Token,以及按需使用的编辑器 / 终端封装。
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
适用于运维控制台、数据库工作台、内部后台。营销站也可以用具名导入。`npm install` 会带上 Monaco、CodeMirror、xterm,体积靠具名导入摇树。
|
|
13
13
|
|
|
14
|
-
**状态:**
|
|
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
|
-
-
|
|
19
|
-
- **Rs\* 组件**:Button、Form、Dialog、Table、Tree、Tabs
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
- **Vite
|
|
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
|
|
31
|
-
| 打包器 | Vite 5
|
|
32
|
-
| 样式 | `import 'niuma-ui/styles.css'
|
|
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
|
-
|
|
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.
|
|
79
|
-
2.
|
|
80
|
-
3.
|
|
81
|
-
4.
|
|
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
|
-
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
|
96
|
-
pnpm
|
|
97
|
-
pnpm build
|
|
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
|
-
|
|
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
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
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
|
-
|
|
115
|
+
正式版更新 npm dist-tag **`latest`**,预发布走 **`next`**。没有名为 `latest` 的 Git 标签。发版流程只在 [CONTRIBUTING.md](./CONTRIBUTING.md),不在本页。
|
|
140
116
|
|
|
141
|
-
|
|
117
|
+
## 许可与致谢
|
|
142
118
|
|
|
143
|
-
|
|
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
|
-
|
|
150
|
-
|
|
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;
|