@simon_he/vue-tui 1.1.15 → 1.1.17

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/dist/agent.cjs CHANGED
@@ -15183,7 +15183,7 @@ function loadBuiltinMathRasterizer() {
15183
15183
  })()), builtinRasterizerLoad;
15184
15184
  }
15185
15185
 
15186
- // node_modules/.pnpm/stream-markdown-parser@1.2.20/node_modules/stream-markdown-parser/dist/index.js
15186
+ // node_modules/.pnpm/stream-markdown-parser@1.2.21/node_modules/stream-markdown-parser/dist/index.js
15187
15187
  var __create2 = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __commonJS = (cb, mod) => function() {
15188
15188
  return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15189
15189
  }, __export$1 = (all) => {
@@ -31248,7 +31248,7 @@ function handleEmphasisAndStrikethrough(state, content, token) {
31248
31248
  if (runInfo.intraword && closeRunInfo.intraword && !isWordOnly(inner) || !inner && runInfo.len >= 4 && runInfo.intraword)
31249
31249
  return state.pushText(content.slice(beforeText.length), content.slice(beforeText.length)), state.index++, !0;
31250
31250
  } else {
31251
- if (state.requireClosingStrong || close.sawInvalidClose || runInfo.intraword)
31251
+ if (state.requireClosingStrong || close.sawInvalidClose || state.options?.final || runInfo.intraword)
31252
31252
  return state.pushText(content.slice(beforeText.length), content.slice(beforeText.length)), state.index++, !0;
31253
31253
  inner = content.slice(openIdx + 2), after = "";
31254
31254
  }
package/dist/markdown.cjs CHANGED
@@ -1292,7 +1292,7 @@ function loadBuiltinMathRasterizer() {
1292
1292
  })()), builtinRasterizerLoad;
1293
1293
  }
1294
1294
 
1295
- // node_modules/.pnpm/stream-markdown-parser@1.2.20/node_modules/stream-markdown-parser/dist/index.js
1295
+ // node_modules/.pnpm/stream-markdown-parser@1.2.21/node_modules/stream-markdown-parser/dist/index.js
1296
1296
  var __create2 = Object.create, __defProp$1 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __commonJS = (cb, mod) => function() {
1297
1297
  return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
1298
1298
  }, __export$1 = (all) => {
@@ -17357,7 +17357,7 @@ function handleEmphasisAndStrikethrough(state, content, token) {
17357
17357
  if (runInfo.intraword && closeRunInfo.intraword && !isWordOnly(inner) || !inner && runInfo.len >= 4 && runInfo.intraword)
17358
17358
  return state.pushText(content.slice(beforeText.length), content.slice(beforeText.length)), state.index++, !0;
17359
17359
  } else {
17360
- if (state.requireClosingStrong || close.sawInvalidClose || runInfo.intraword)
17360
+ if (state.requireClosingStrong || close.sawInvalidClose || state.options?.final || runInfo.intraword)
17361
17361
  return state.pushText(content.slice(beforeText.length), content.slice(beforeText.length)), state.index++, !0;
17362
17362
  inner = content.slice(openIdx + 2), after = "";
17363
17363
  }
@@ -1,8 +1,14 @@
1
+ import type { Style } from "../../../../core/types.js";
1
2
  import type { MentionPathProvider, MentionSuggestionProvider } from "./promptMentionState.js";
2
3
  import type { TInputPlugin } from "./types.js";
3
4
  export type { MentionPathProvider, MentionSuggestionProvider } from "./promptMentionState.js";
4
5
  export type PromptMentionPluginOptions = Readonly<{
5
6
  mentionSuggestionProviders?: readonly MentionSuggestionProvider[];
6
7
  mentionPathProvider?: MentionPathProvider;
8
+ /**
9
+ * Style for the `›` gutter marker drawn on the selected popup row.
10
+ * Called on every paint, so a theme lookup stays live; omit it to keep the popup gutter-free.
11
+ */
12
+ selectedMarkerStyle?: () => Style;
7
13
  }>;
8
14
  export declare function createPromptMentionPlugin(options?: PromptMentionPluginOptions): TInputPlugin;
package/dist/vue.cjs CHANGED
@@ -1798,6 +1798,7 @@ function usePromptMentionState(options) {
1798
1798
  }
1799
1799
 
1800
1800
  // src/vue/components/input/plugins/promptMentionPlugin.ts
1801
+ var SELECTED_ROW_MARKER = "\u203A";
1801
1802
  function omitInverse(style) {
1802
1803
  if (!style)
1803
1804
  return {};
@@ -2081,7 +2082,8 @@ function createPromptMentionPlugin(options = {}) {
2081
2082
  getProps().promptSelectedStyle,
2082
2083
  getProps().zIndex,
2083
2084
  ctx.defaultStyle.value,
2084
- promptMention.mentionKindVersion.value
2085
+ promptMention.mentionKindVersion.value,
2086
+ options.selectedMarkerStyle?.()
2085
2087
  ],
2086
2088
  paint: () => {
2087
2089
  if (!ctx.visible.value || !promptMention.promptVisible.value)
@@ -2111,7 +2113,7 @@ function createPromptMentionPlugin(options = {}) {
2111
2113
  emptyStyle
2112
2114
  }, cacheKey && derivedStyleCache.set(cacheKey, derived);
2113
2115
  }
2114
- let x0 = Math.floor(r.x), y0 = Math.floor(r.y), w = Math.max(0, Math.floor(r.w)), h30 = Math.max(0, Math.floor(r.h)), innerW = Math.max(0, w - 2), sidePad = innerW >= 4 ? 1 : 0, contentW = Math.max(0, innerW - sidePad * 2), contentX = x0 + 1 + sidePad, borderStyle = derived.borderStyle;
2116
+ let x0 = Math.floor(r.x), y0 = Math.floor(r.y), w = Math.max(0, Math.floor(r.w)), h30 = Math.max(0, Math.floor(r.h)), innerW = Math.max(0, w - 2), sidePad = innerW >= 4 ? 1 : 0, markerW = options.selectedMarkerStyle && innerW >= 6 ? 1 : 0, contentW = Math.max(0, innerW - sidePad * 2 - markerW), contentX = x0 + 1 + sidePad + markerW, borderStyle = derived.borderStyle;
2115
2117
  lastTopClampedRect && y0 > 0 && (ctx.terminal.write(spaces(lastTopClampedRect.w), {
2116
2118
  x: lastTopClampedRect.x,
2117
2119
  y: 0,
@@ -2141,7 +2143,7 @@ function createPromptMentionPlugin(options = {}) {
2141
2143
  let match = list[row], isSelected = row === promptMention.promptActiveVisible.value, rawValue = sanitizeInlineText(match.item.value), rawDetail = match.item.detail ? sanitizeInlineText(match.item.detail) : "", highlightRanges = query ? computeHighlightRanges(rawValue, query) : [], valueCells = textCellWidth2(rawValue), detailCells = rawDetail ? textCellWidth2(rawDetail) : 0, availableForDetail = contentW - valueCells - 2;
2142
2144
  if (rawDetail && availableForDetail >= 4) {
2143
2145
  let valueStyle = isSelected ? derived.selectedStyle : derived.itemStyle, highlightStyle = buildPromptMatchHighlightStyle(valueStyle, popupMatchStyle), rowStyle = valueStyle;
2144
- sidePad > 0 && ctx.terminal.write(spaces(sidePad), {
2146
+ sidePad > 0 && ctx.terminal.write(spaces(sidePad + markerW), {
2145
2147
  x: x0 + 1,
2146
2148
  y,
2147
2149
  style: rowStyle
@@ -2173,7 +2175,7 @@ function createPromptMentionPlugin(options = {}) {
2173
2175
  });
2174
2176
  } else {
2175
2177
  let style = isSelected ? derived.selectedStyle : derived.itemStyle, highlightStyle = buildPromptMatchHighlightStyle(style, popupMatchStyle);
2176
- sidePad > 0 && ctx.terminal.write(spaces(sidePad), {
2178
+ sidePad > 0 && ctx.terminal.write(spaces(sidePad + markerW), {
2177
2179
  x: x0 + 1,
2178
2180
  y,
2179
2181
  style
@@ -2198,12 +2200,16 @@ function createPromptMentionPlugin(options = {}) {
2198
2200
  style
2199
2201
  });
2200
2202
  }
2203
+ markerW && isSelected && ctx.terminal.put(x0 + 1, y, SELECTED_ROW_MARKER, {
2204
+ ...derived.selectedStyle,
2205
+ ...options.selectedMarkerStyle?.()
2206
+ });
2201
2207
  }
2202
2208
  if (list.length === 0 && contentH > 0) {
2203
2209
  let y = y0 + 1;
2204
2210
  ctx.terminal.put(x0, y, "\u2502", borderStyle), ctx.terminal.put(x0 + w - 1, y, "\u2502", borderStyle);
2205
2211
  let msg = padEndByCells2(sliceByCellsWindow("(no matches)", 0, contentW), contentW);
2206
- sidePad > 0 && ctx.terminal.write(spaces(sidePad), {
2212
+ sidePad > 0 && ctx.terminal.write(spaces(sidePad + markerW), {
2207
2213
  x: x0 + 1,
2208
2214
  y,
2209
2215
  style: derived.emptyStyle
package/dist/vue.js CHANGED
@@ -419,6 +419,7 @@ function usePromptMentionState(options) {
419
419
 
420
420
  //#endregion
421
421
  //#region src/vue/components/input/plugins/promptMentionPlugin.ts
422
+ const SELECTED_ROW_MARKER = "›";
422
423
  function omitInverse(style) {
423
424
  if (!style) return {};
424
425
  const { inverse: _inverse,...rest } = style;
@@ -845,7 +846,8 @@ function createPromptMentionPlugin(options = {}) {
845
846
  getProps().promptSelectedStyle,
846
847
  getProps().zIndex,
847
848
  ctx.defaultStyle.value,
848
- promptMention.mentionKindVersion.value
849
+ promptMention.mentionKindVersion.value,
850
+ options.selectedMarkerStyle?.()
849
851
  ],
850
852
  paint: () => {
851
853
  if (!ctx.visible.value || !promptMention.promptVisible.value) return;
@@ -903,8 +905,9 @@ function createPromptMentionPlugin(options = {}) {
903
905
  const h$1 = Math.max(0, Math.floor(r.h));
904
906
  const innerW = Math.max(0, w - 2);
905
907
  const sidePad = innerW >= 4 ? 1 : 0;
906
- const contentW = Math.max(0, innerW - sidePad * 2);
907
- const contentX = x0 + 1 + sidePad;
908
+ const markerW = options.selectedMarkerStyle && innerW >= 6 ? 1 : 0;
909
+ const contentW = Math.max(0, innerW - sidePad * 2 - markerW);
910
+ const contentX = x0 + 1 + sidePad + markerW;
908
911
  const borderStyle = derived.borderStyle;
909
912
  if (lastTopClampedRect && y0 > 0) {
910
913
  ctx.terminal.write(spaces(lastTopClampedRect.w), {
@@ -964,7 +967,7 @@ function createPromptMentionPlugin(options = {}) {
964
967
  const valueStyle = isSelected ? derived.selectedStyle : derived.itemStyle;
965
968
  const highlightStyle = buildPromptMatchHighlightStyle(valueStyle, popupMatchStyle);
966
969
  const rowStyle = valueStyle;
967
- if (sidePad > 0) ctx.terminal.write(spaces(sidePad), {
970
+ if (sidePad > 0) ctx.terminal.write(spaces(sidePad + markerW), {
968
971
  x: x0 + 1,
969
972
  y,
970
973
  style: rowStyle
@@ -1001,7 +1004,7 @@ function createPromptMentionPlugin(options = {}) {
1001
1004
  } else {
1002
1005
  const style = isSelected ? derived.selectedStyle : derived.itemStyle;
1003
1006
  const highlightStyle = buildPromptMatchHighlightStyle(style, popupMatchStyle);
1004
- if (sidePad > 0) ctx.terminal.write(spaces(sidePad), {
1007
+ if (sidePad > 0) ctx.terminal.write(spaces(sidePad + markerW), {
1005
1008
  x: x0 + 1,
1006
1009
  y,
1007
1010
  style
@@ -1028,13 +1031,17 @@ function createPromptMentionPlugin(options = {}) {
1028
1031
  style
1029
1032
  });
1030
1033
  }
1034
+ if (markerW && isSelected) ctx.terminal.put(x0 + 1, y, SELECTED_ROW_MARKER, {
1035
+ ...derived.selectedStyle,
1036
+ ...options.selectedMarkerStyle?.()
1037
+ });
1031
1038
  }
1032
1039
  if (list.length === 0 && contentH > 0) {
1033
1040
  const y = y0 + 1;
1034
1041
  ctx.terminal.put(x0, y, "│", borderStyle);
1035
1042
  ctx.terminal.put(x0 + w - 1, y, "│", borderStyle);
1036
1043
  const msg = padEndByCells$1(sliceByCellsWindow("(no matches)", 0, contentW), contentW);
1037
- if (sidePad > 0) ctx.terminal.write(spaces(sidePad), {
1044
+ if (sidePad > 0) ctx.terminal.write(spaces(sidePad + markerW), {
1038
1045
  x: x0 + 1,
1039
1046
  y,
1040
1047
  style: derived.emptyStyle
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simon_he/vue-tui",
3
- "version": "1.1.15",
3
+ "version": "1.1.17",
4
4
  "description": "Vue 3 terminal UI components and renderers for browser DOM, CLI stdout, logs, markdown transcripts, and agent consoles",
5
5
  "keywords": [
6
6
  "agent-console",
@@ -259,7 +259,7 @@
259
259
  "access": "public"
260
260
  },
261
261
  "dependencies": {
262
- "stream-markdown-parser": "1.2.20"
262
+ "stream-markdown-parser": "1.2.21"
263
263
  },
264
264
  "devDependencies": {
265
265
  "@arethetypeswrong/core": "^0.18.5",