ensis-ui 3.0.0 → 3.0.2

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,18 @@
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [3.0.2] - 2026-10-18
10
+
11
+ ### 修复
12
+
13
+ - `RsTerminal`:全屏清屏前插入的 `CSI r` 会把光标拉到左上角。vim 的进入序列里常同时带清屏,这次复位发生在 `CSI ? 1049 h` 保存光标之前,退出后输入画在视口第一行。长输出把提示符顶在最后一行时尤其明显。现在复位滚动边距后把光标放回原位,再交给后续序列保存。
14
+
15
+ ## [3.0.1] - 2026-10-15
16
+
17
+ ### 修复
18
+
19
+ - `ensisUiHost`:npm 发布桶没有 `src/` 时,`pnpm dev` 不再把包根具名导入改写成 `exports` 未声明的子路径(如 `@niuma/ui/theme/apply.js`),避免 Vite `Missing "./…" specifier`。只有 `link:` 带源码时才改写到 `src` 做 HMR。
20
+
9
21
  ## [3.0.0] - 2026-10-11
10
22
 
11
23
  ### 变更
@@ -71,8 +71,9 @@ export declare function containsFullScreenClear(data: string): boolean;
71
71
  /** 数据块以光标归位首行开头(top 每轮刷新常见) */
72
72
  export declare function startsWithCursorHome(data: string): boolean;
73
73
  /**
74
- * 在本地解析层重置滚动边距等模式(不发给 PTY)。
75
- * 仅在全屏清屏等明确「新一轮绘制」时调用,避免打断进行中的 TUI 光标位置。
74
+ * 在本地解析层把滚动边距恢复成整屏(不发给 PTY)。
75
+ * `CSI r` 会把光标拉到左上角。若它排在 `CSI ? 1049 h` 之前,vim 保存的就是顶行,
76
+ * 退出后输入画在视口顶部。长输出把提示符顶在最后一行时尤其明显,所以复位后把光标放回原位。
76
77
  */
77
78
  export declare function resetLocalTerminalModes(terminal: Terminal): void;
78
79
  export declare function snapTerminalViewportToBottom(terminal: Terminal): void;
@@ -187,11 +187,15 @@ function containsFullScreenClear(data) {
187
187
  return FULL_SCREEN_CLEAR_PATTERN.test(data);
188
188
  }
189
189
  /**
190
- * 在本地解析层重置滚动边距等模式(不发给 PTY)。
191
- * 仅在全屏清屏等明确「新一轮绘制」时调用,避免打断进行中的 TUI 光标位置。
190
+ * 在本地解析层把滚动边距恢复成整屏(不发给 PTY)。
191
+ * `CSI r` 会把光标拉到左上角。若它排在 `CSI ? 1049 h` 之前,vim 保存的就是顶行,
192
+ * 退出后输入画在视口顶部。长输出把提示符顶在最后一行时尤其明显,所以复位后把光标放回原位。
192
193
  */
193
194
  function resetLocalTerminalModes(terminal) {
194
- terminal.write("\x1B[r");
195
+ const buffer = terminal.buffer.active;
196
+ const row = buffer.cursorY + 1;
197
+ const col = Math.min(buffer.cursorX, Math.max(terminal.cols - 1, 0)) + 1;
198
+ terminal.write(`\x1b[r\x1b[${row};${col}H`);
195
199
  }
196
200
  function snapTerminalViewportToBottom(terminal) {
197
201
  terminal.scrollToBottom();
@@ -1,6 +1,6 @@
1
1
  /**
2
- * 第一方宿主插件:只服务 pnpm dev(源码 HMR、styles alias)。
3
- * vite build / CI 走包主入口,不改写导入。
2
+ * 第一方宿主插件:只服务 pnpm dev + link 源码(HMR、styles alias)。
3
+ * 发布桶(无 src)与 vite build / CI:走包主入口,不改写导入。
4
4
  * 禁止把 @niuma/ui 别名到 src/index.ts(评估整桶会灌入未使用组件 CSS)。
5
5
  *
6
6
  * 写法:工厂 + options、createFilter、es-module-lexer 定位静态 import/export、
@@ -121,6 +121,9 @@ function ensisUiHostRewrite(ctx) {
121
121
  ctx.map = loadRuntimeBindings(ctx.root, ctx.useSource);
122
122
  },
123
123
  async transform(code, id) {
124
+ // 发布桶没有 src:保持包根具名导入,勿改成未在 exports 里的子路径。
125
+ if (!ctx.useSource)
126
+ return null;
124
127
  if (!ctx.filter(id))
125
128
  return null;
126
129
  if (!code.includes('@niuma/ui') && !code.includes('niuma-ui') && !code.includes('ensis-ui'))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ensis-ui",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "description": "Vue 3 workbench design system — Rs* components, --rs-* tokens, optional Monaco / CodeMirror / xterm",