@simon_he/vue-tui 1.0.2 → 1.1.1

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 (104) hide show
  1. package/README.md +44 -26
  2. package/dist/TMermaidText-CXm_L969.js +885 -0
  3. package/dist/{TSelect-DR0FomSu.js → TSelect-CiyMvwl-.js} +60 -81
  4. package/dist/{TTree-kzhlB5P0.js → TTree-DKGiuIcM.js} +140 -103
  5. package/dist/agent/mermaid.cjs +2 -0
  6. package/dist/agent/mermaid.d.cts +2 -0
  7. package/dist/agent/mermaid.d.ts +2 -0
  8. package/dist/agent/mermaid.js +1 -0
  9. package/dist/agent.cjs +31184 -24907
  10. package/dist/agent.d.cts +11 -1
  11. package/dist/agent.d.ts +11 -1
  12. package/dist/agent.js +1700 -13
  13. package/dist/block-source-5CQp4tF8.js +3230 -0
  14. package/dist/cli/stdin-buffer.d.ts +1 -1
  15. package/dist/cli.cjs +5037 -6767
  16. package/dist/cli.d.cts +4 -0
  17. package/dist/cli.d.ts +4 -0
  18. package/dist/cli.js +2733 -148
  19. package/dist/core/buffer/eaw-ranges-unicode-17.d.ts +14 -0
  20. package/dist/core/perf/instrumentation-noop.d.ts +48 -0
  21. package/dist/core/perf/instrumentation.d.ts +136 -0
  22. package/dist/core/terminal/create-terminal.d.ts +1 -0
  23. package/dist/core.cjs +843 -1469
  24. package/dist/core.js +6 -6
  25. package/dist/{create-terminal-DBFNYr8f.js → create-terminal-DXuZ2fci.js} +39 -13
  26. package/dist/debug-logger-ChY_PXVk.js +74 -0
  27. package/dist/{dom-renderer-BniJSQyX.js → dom-renderer-DNzmg2As.js} +2 -2
  28. package/dist/experimental.cjs +4115 -5928
  29. package/dist/experimental.d.cts +2 -0
  30. package/dist/experimental.d.ts +2 -0
  31. package/dist/experimental.js +1490 -9
  32. package/dist/frame-perf-BBhE-iuS.js +111 -0
  33. package/dist/{sgr-BmzxEjAO.js → hyperlink-B35-O-cW.js} +100 -1
  34. package/dist/index.cjs +5017 -10339
  35. package/dist/index.js +16 -14
  36. package/dist/{linkify-D_gzn9Xq.js → linkify-CuuquMQT.js} +32 -3
  37. package/dist/markdown.cjs +21295 -12691
  38. package/dist/markdown.d.cts +1 -1
  39. package/dist/markdown.d.ts +1 -1
  40. package/dist/markdown.js +211 -51
  41. package/dist/mermaid-CWto52Wk.js +123 -0
  42. package/dist/mermaid.cjs +1707 -0
  43. package/dist/mermaid.d.cts +3 -0
  44. package/dist/mermaid.d.ts +3 -0
  45. package/dist/mermaid.js +6 -0
  46. package/dist/observability/frame-perf-store.d.ts +2 -1
  47. package/dist/observability/frame-perf.d.ts +33 -0
  48. package/dist/observability.cjs +106 -107
  49. package/dist/observability.d.cts +2 -2
  50. package/dist/observability.d.ts +2 -2
  51. package/dist/observability.js +3 -3
  52. package/dist/{path-suggest-BNqcuE3-.js → path-suggest-fPzRsgPv.js} +1 -1
  53. package/dist/{wheel-scroll-vBRaQ7p-.js → rect-Ng-3eKzF.js} +253 -117
  54. package/dist/renderer/cli/stdout-metrics.d.ts +10 -0
  55. package/dist/renderer/cli/stdout-renderer.d.ts +3 -0
  56. package/dist/renderer/terminal-graphic-render-queue.d.ts +50 -0
  57. package/dist/renderer/terminal-graphics-trace.d.ts +53 -0
  58. package/dist/renderer/terminal-graphics.d.ts +146 -0
  59. package/dist/renderer-dom.cjs +364 -903
  60. package/dist/renderer-dom.js +4 -4
  61. package/dist/runtime/index.d.ts +2 -0
  62. package/dist/{runtime-rfcZCyJq.js → runtime-D77C03RM.js} +28 -15
  63. package/dist/runtime.cjs +427 -889
  64. package/dist/runtime.js +2 -2
  65. package/dist/{terminal-selection-DBinO6p5.js → terminal-selection-CQYr--26.js} +4 -1
  66. package/dist/{tlog-theme-CvLFNMwk.js → tlog-theme-CopRt9SC.js} +37 -6
  67. package/dist/{trace-CjzYeIxN.js → trace-CYHDKM1m.js} +5 -0
  68. package/dist/vue/agent/create-png-terminal-graphic-renderer.d.ts +19 -0
  69. package/dist/vue/components/TAgentTerminalGraphic.d.ts +481 -0
  70. package/dist/vue/components/TCharts.d.ts +1121 -0
  71. package/dist/vue/components/TFeedback.d.ts +1 -1
  72. package/dist/vue/components/TFlex.d.ts +389 -0
  73. package/dist/vue/components/TForm.d.ts +4 -4
  74. package/dist/vue/components/TLogSearchBar.d.ts +3 -3
  75. package/dist/vue/components/TLogSearchPager.d.ts +2 -2
  76. package/dist/vue/components/TMarkdownText.d.ts +162 -4
  77. package/dist/vue/components/TMermaidText.d.ts +900 -0
  78. package/dist/vue/components/TVirtualList.d.ts +9 -0
  79. package/dist/vue/components/TVirtualMarkdown.d.ts +170 -9
  80. package/dist/vue/components/TVirtualRows.d.ts +9 -0
  81. package/dist/vue/components/TerminalProvider.d.ts +2 -0
  82. package/dist/vue/context.d.ts +24 -0
  83. package/dist/vue/index.d.ts +5 -0
  84. package/dist/vue/layout/flex.d.ts +67 -0
  85. package/dist/vue/markdown/ast.d.ts +5 -2
  86. package/dist/vue/markdown/document.d.ts +5 -0
  87. package/dist/vue/markdown/image-actions.d.ts +14 -0
  88. package/dist/vue/markdown/image.d.ts +11 -0
  89. package/dist/vue/markdown/link-actions.d.ts +14 -0
  90. package/dist/vue/markdown/math-actions.d.ts +14 -0
  91. package/dist/vue/markdown/math.d.ts +6 -0
  92. package/dist/vue/markdown/render.d.ts +28 -0
  93. package/dist/vue/markdown/types.d.ts +78 -0
  94. package/dist/vue/mermaid/beautiful-mermaid.d.ts +1436 -0
  95. package/dist/vue/render/render-manager.d.ts +7 -0
  96. package/dist/vue.cjs +7207 -12437
  97. package/dist/vue.js +706 -39
  98. package/dist/wheel-scroll-CQ22Hcyj.js +106 -0
  99. package/dist/{hyperlink-Bn02UXJb.js → width-GqllnV8C.js} +166 -111
  100. package/package.json +85 -14
  101. package/dist/block-source-CKUOnkgT.js +0 -1663
  102. package/dist/frame-perf-C6Xfg85O.js +0 -24
  103. /package/dist/{env-Cl8qmNFN.js → env-DNCzvX8b.js} +0 -0
  104. /package/dist/{path-mnSgEpCm.js → path-BI9W15Zt.js} +0 -0
@@ -1,14 +1,16 @@
1
- import { TERMINAL_RENDER_PLANES, createTerminal, getPlaneTerminal, resetPlaneRowsForRender, scrollPlaneRows } from "./create-terminal-DBFNYr8f.js";
2
- import { sanitizeDomHref } from "./hyperlink-Bn02UXJb.js";
3
- import { DOM_RENDERER_CAPABILITIES, createDomRenderer } from "./dom-renderer-BniJSQyX.js";
4
- import { EventZIndexContextKey, ImeAnchorContextKey, LayoutContextKey, RenderStackKey, TInputPluginsContextKey, TPathPickerProviderContextKey, TerminalContextKey, VisibilityContextKey, applyWheelScroll, clearTextCaches, createWheelScrollState, forEachTextCellSegment, formatInlineCellLine, injectionKey, intersectRect, normalizeCellRect, padEndByCells$1 as padEndByCells, resetWheelScrollState, sanitizeInlineText, sanitizeTextBlock, sliceByCells, sliceByCellsRange, spaces, textCellWidth$1 as textCellWidth, translateRect, useLayout, useRenderNode, useTerminal, useTerminalNode, useVisibility, withTextRenderPass } from "./wheel-scroll-vBRaQ7p-.js";
5
- import { TView, TuiThemeContextKey, createFrameMailbox, createTheme, defaultActiveStyle, defaultDimStyle, linkifyTextSegments, tuiDefaultTheme } from "./linkify-D_gzn9Xq.js";
6
- import { SUPPRESS_TERMINAL_POINTER_DOWN, SUPPRESS_TERMINAL_POINTER_MOVE, SUPPRESS_TERMINAL_POINTER_UP, createEventManager, createRuntime } from "./runtime-rfcZCyJq.js";
7
- import { createFramePerfStore, createTraceStore } from "./trace-CjzYeIxN.js";
8
- import { envFlag, envString, firstNonEmptyEnv } from "./env-Cl8qmNFN.js";
9
- import { createTerminalSelectionController } from "./terminal-selection-DBinO6p5.js";
10
- import { TBox, TInput, TRenderPlane, TText, clamp, fitCellText, mergeStyle, repeatToCells, resolveOverlayPlacement } from "./TSelect-DR0FomSu.js";
11
- import { framePerfNow, mergeFramePerfReason } from "./frame-perf-C6Xfg85O.js";
1
+ import { TERMINAL_RENDER_PLANES, createTerminal, getPlaneTerminal, resetPlaneRowsForRender, scrollPlaneRows } from "./create-terminal-DXuZ2fci.js";
2
+ import { sanitizeDomHref } from "./hyperlink-B35-O-cW.js";
3
+ import { DOM_RENDERER_CAPABILITIES, createDomRenderer } from "./dom-renderer-DNzmg2As.js";
4
+ import { EventZIndexContextKey, ImeAnchorContextKey, LayoutContextKey, RenderStackKey, TInputPluginsContextKey, TPathPickerProviderContextKey, TerminalContextKey, VisibilityContextKey, clearTextCaches, forEachTextCellSegment, formatInlineCellLine, injectionKey, intersectRect, normalizeCellRect, padEndByCells$1 as padEndByCells, sanitizeInlineText, sanitizeTextBlock, sliceByCells, sliceByCellsRange, spaces, textCellWidth$1 as textCellWidth, translateRect, useLayout, useRenderNode, useTerminal, useTerminalNode, useVisibility, withTextRenderPass } from "./rect-Ng-3eKzF.js";
5
+ import { TView, TuiThemeContextKey, clamp, createFrameMailbox, createTheme, defaultActiveStyle, defaultDimStyle, fitCellText, linkifyTextSegments, mergeStyle, repeatToCells, tuiDefaultTheme } from "./linkify-CuuquMQT.js";
6
+ import { SUPPRESS_TERMINAL_POINTER_DOWN, SUPPRESS_TERMINAL_POINTER_MOVE, SUPPRESS_TERMINAL_POINTER_UP, createEventManager, createRuntime } from "./runtime-D77C03RM.js";
7
+ import { framePerfNow, mergeFramePerfReason } from "./frame-perf-BBhE-iuS.js";
8
+ import { createFramePerfStore, createTraceStore } from "./trace-CYHDKM1m.js";
9
+ import { envFlag, envString, firstNonEmptyEnv } from "./env-DNCzvX8b.js";
10
+ import { createTerminalSelectionController } from "./terminal-selection-CQYr--26.js";
11
+ import { createDebugLogger, isDebugEnabled } from "./debug-logger-ChY_PXVk.js";
12
+ import { TBox, TInput, TRenderPlane, TText, resolveOverlayPlacement } from "./TSelect-CiyMvwl-.js";
13
+ import { applyWheelScroll, createWheelScrollState, resetWheelScrollState } from "./wheel-scroll-CQ22Hcyj.js";
12
14
  import { computed, defineComponent, effectScope, getCurrentInstance, h, inject, nextTick, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, provide, ref, shallowReactive, shallowRef, toRef, watch, watchEffect } from "vue";
13
15
 
14
16
  //#region src/observability/tui-profiler.ts
@@ -200,77 +202,6 @@ function createTuiProfiler(name, options = {}) {
200
202
  };
201
203
  }
202
204
 
203
- //#endregion
204
- //#region src/core/debug-logger.ts
205
- const DEFAULT_LOG_FILE = "vue-tui-debug.log";
206
- let debugFileWriter = null;
207
- let debugLogDefaultPath = DEFAULT_LOG_FILE;
208
- const initializedDebugLogPaths = new Set();
209
- function getFileWriter() {
210
- const writer = globalThis.__VT_DEBUG_FILE_WRITER__;
211
- if (writer && typeof writer === "object") return writer;
212
- return debugFileWriter;
213
- }
214
- function resolveDebugLogPath(env, fallback = DEFAULT_LOG_FILE) {
215
- return envString(env, "VUE_TUI_DEBUG_LOG_PATH", "DIMCODE_DEBUG_LOG_PATH", fallback);
216
- }
217
- function debugLogPath() {
218
- const env = globalThis.process?.env;
219
- return resolveDebugLogPath(env, debugLogDefaultPath);
220
- }
221
- function safeJson(value) {
222
- try {
223
- return JSON.stringify(value);
224
- } catch {
225
- return "[unserializable]";
226
- }
227
- }
228
- function createDebugLogger(enable = false) {
229
- const enabled = enable;
230
- const ensureHeader = () => {
231
- if (!enabled) return;
232
- const writer = getFileWriter();
233
- if (!writer?.writeFileSync) return;
234
- const path = debugLogPath();
235
- if (initializedDebugLogPaths.has(path)) return;
236
- try {
237
- const data = `=== Vue TUI Debug Log Started at ${new Date().toISOString()} ===\n\n`;
238
- writer.writeFileSync(path, data);
239
- initializedDebugLogPaths.add(path);
240
- } catch {}
241
- };
242
- const write = (data) => {
243
- if (!enabled) return;
244
- ensureHeader();
245
- try {
246
- getFileWriter()?.appendFileSync?.(debugLogPath(), data);
247
- } catch {}
248
- };
249
- const log = (category, message) => {
250
- if (!enabled) return;
251
- const timestamp = new Date().toISOString().split("T")[1].slice(0, -1);
252
- write(`[${timestamp}] ${category} ${message}\n`);
253
- };
254
- ensureHeader();
255
- return {
256
- render: (message) => log("[RENDER]", message),
257
- stream: (message) => log("[STREAM]", message),
258
- error: (message, ...args) => {
259
- if (!enabled) return;
260
- const timestamp = new Date().toISOString().split("T")[1].slice(0, -1);
261
- const fullMessage = `[${timestamp}] [ERROR] ${message}${args.length ? ` ${safeJson(args)}` : ""}`;
262
- write(`${fullMessage}\n`);
263
- }
264
- };
265
- }
266
- /**
267
- * Check if debug logging is enabled via environment variable
268
- */
269
- function isDebugEnabled() {
270
- const env = globalThis.process?.env;
271
- return envFlag(env, "VUE_TUI_DEBUG", "DIMCODE_DEBUG") || env?.DEBUG === "1";
272
- }
273
-
274
205
  //#endregion
275
206
  //#region src/vue/render/render-manager.ts
276
207
  const renderMgrDebugLog = createDebugLogger(isDebugEnabled());
@@ -302,6 +233,10 @@ function sameRect(a, b) {
302
233
  if (!a || !b) return false;
303
234
  return a.x === b.x && a.y === b.y && a.w === b.w && a.h === b.h;
304
235
  }
236
+ function rectsIntersect(a, b) {
237
+ if (isEmptyRect(a) || isEmptyRect(b)) return false;
238
+ return a.x < b.x + b.w && a.x + a.w > b.x && a.y < b.y + b.h && a.y + a.h > b.y;
239
+ }
305
240
  function createRenderManager(terminal, options = {}) {
306
241
  const widthProvider = options.widthProvider ?? "default";
307
242
  const withRenderTextPass = (fn) => withTextRenderPass(fn, widthProvider);
@@ -309,6 +244,7 @@ function createRenderManager(terminal, options = {}) {
309
244
  const nodes = new Map();
310
245
  const planeDirtyStates = new Map();
311
246
  const initialSize = terminal.size();
247
+ let terminalCols = initialSize.cols;
312
248
  let terminalRows = initialSize.rows;
313
249
  let allRows = Array.from({ length: terminalRows }, (_, index) => index);
314
250
  let sortedNodes = [];
@@ -329,19 +265,37 @@ function createRenderManager(terminal, options = {}) {
329
265
  let disposed = false;
330
266
  const stackPathCache = new WeakMap();
331
267
  const profiler = createTuiProfiler("render-manager", options.profiler);
332
- const offResize = terminal.on("resize", ({ rows }) => {
268
+ const offResize = terminal.on("resize", ({ cols, rows }) => {
333
269
  if (disposed) return;
270
+ const colsChanged = cols !== terminalCols;
271
+ const prevRows = terminalRows;
272
+ terminalCols = cols;
334
273
  terminalRows = rows;
335
274
  allRows = Array.from({ length: terminalRows }, (_, index) => index);
336
275
  for (const state of planeDirtyStates.values()) {
337
- state.allRowsDirty = true;
276
+ const prevBits = state.dirtyRowBits;
338
277
  state.dirtyRowBits = new Uint8Array(terminalRows);
339
278
  state.dirtyRowCount = 0;
340
279
  state.dirtyMinY = Number.POSITIVE_INFINITY;
341
280
  state.dirtyMaxY = -1;
281
+ const limit = Math.min(terminalRows, prevBits.length);
282
+ for (let y = 0; y < limit; y++) {
283
+ if (prevBits[y] !== 1) continue;
284
+ state.dirtyRowBits[y] = 1;
285
+ state.dirtyRowCount++;
286
+ if (y < state.dirtyMinY) state.dirtyMinY = y;
287
+ if (y > state.dirtyMaxY) state.dirtyMaxY = y;
288
+ }
289
+ for (let y = prevRows; y < terminalRows; y++) {
290
+ if (state.dirtyRowBits[y] === 1) continue;
291
+ state.dirtyRowBits[y] = 1;
292
+ state.dirtyRowCount++;
293
+ if (y < state.dirtyMinY) state.dirtyMinY = y;
294
+ if (y > state.dirtyMaxY) state.dirtyMaxY = y;
295
+ }
342
296
  }
343
297
  rebuildRowBuckets();
344
- clearTextCaches();
298
+ if (colsChanged) clearTextCaches();
345
299
  });
346
300
  const rootStack = Object.freeze({
347
301
  id: `s${nextStackId++}`,
@@ -539,6 +493,33 @@ function createRenderManager(terminal, options = {}) {
539
493
  if (y > state.dirtyMaxY) state.dirtyMaxY = y;
540
494
  }
541
495
  }
496
+ function markLowerPlanesForRect(plane, rect) {
497
+ const planeIndex = TERMINAL_RENDER_PLANES.indexOf(plane);
498
+ if (planeIndex <= 0) return;
499
+ for (let i = 0; i < planeIndex; i++) markRect(TERMINAL_RENDER_PLANES[i], rect);
500
+ }
501
+ function markRowRange(plane, startY, endY) {
502
+ const state = getDirtyState(plane);
503
+ const start = Math.max(0, Math.min(terminalRows, Math.floor(startY)));
504
+ const end = Math.max(start, Math.min(terminalRows, Math.floor(endY)));
505
+ for (let y = start; y < end; y++) {
506
+ if (state.dirtyRowBits[y] === 1) continue;
507
+ state.dirtyRowBits[y] = 1;
508
+ state.dirtyRowCount++;
509
+ if (y < state.dirtyMinY) state.dirtyMinY = y;
510
+ if (y > state.dirtyMaxY) state.dirtyMaxY = y;
511
+ }
512
+ }
513
+ function markRectHeightDelta(plane, prev, next) {
514
+ if (!prev || !next) return false;
515
+ if (prev.x !== next.x || prev.y !== next.y || prev.w !== next.w) return false;
516
+ const prevBounds = rectToYBounds(prev);
517
+ const nextBounds = rectToYBounds(next);
518
+ if (prevBounds.y0 !== nextBounds.y0) return false;
519
+ if (nextBounds.y1 > prevBounds.y1) markRowRange(plane, prevBounds.y1, nextBounds.y1);
520
+ else if (prevBounds.y1 > nextBounds.y1) markRowRange(plane, nextBounds.y1, prevBounds.y1);
521
+ return true;
522
+ }
542
523
  function markRowsForNode(node, rows) {
543
524
  if (!rows.length) return false;
544
525
  warnIfRowsLookLocal(node, rows);
@@ -586,6 +567,7 @@ function createRenderManager(terminal, options = {}) {
586
567
  nodes.set(id, full);
587
568
  addToRowBuckets(full);
588
569
  markRect(full.plane, full.rect);
570
+ markLowerPlanesForRect(full.plane, full.rect);
589
571
  sortedDirty = true;
590
572
  return full;
591
573
  }
@@ -597,6 +579,7 @@ function createRenderManager(terminal, options = {}) {
597
579
  const nextPlane = next.plane ?? prev.plane;
598
580
  const planeChanged = nextPlane !== prev.plane;
599
581
  const hasRect = Object.prototype.hasOwnProperty.call(next, "rect");
582
+ const paintChanged = Object.prototype.hasOwnProperty.call(next, "paint");
600
583
  const nextRect = hasRect ? next.rect ?? null : prev.rect;
601
584
  const rectChanged = !sameRect(prev.rect, nextRect);
602
585
  const bucketChanged = planeChanged || rectChanged;
@@ -604,10 +587,12 @@ function createRenderManager(terminal, options = {}) {
604
587
  const dirtyRowsHint = next.dirtyRowsHint;
605
588
  const canUseDirtyRowsHint = !sortChanged && !rectChanged && nextPlane === prev.plane && dirtyRowsHint != null && dirtyRowsHint.length > 0;
606
589
  if (canUseDirtyRowsHint) markRowsForNode(prev, dirtyRowsHint);
607
- else {
590
+ else if (rectChanged && !paintChanged && !sortChanged && !planeChanged && markRectHeightDelta(prev.plane, prev.rect, nextRect)) {} else {
608
591
  markRect(prev.plane, prev.rect);
609
592
  markRect(nextPlane, nextRect);
610
593
  }
594
+ markLowerPlanesForRect(prev.plane, prev.rect);
595
+ markLowerPlanesForRect(nextPlane, nextRect);
611
596
  if (bucketChanged) removeFromRowBuckets(prev);
612
597
  const full = Object.freeze({
613
598
  ...prev,
@@ -637,11 +622,41 @@ function createRenderManager(terminal, options = {}) {
637
622
  if (!node) return false;
638
623
  return markRowsForNode(node, rows);
639
624
  }
625
+ function isRectCoveredByHigherNode(id, rect, options$1 = {}) {
626
+ return higherNodeCoverageRects(id, rect, options$1).length > 0;
627
+ }
628
+ function higherNodeCoverageRects(id, rect, options$1 = {}) {
629
+ if (disposed || isEmptyRect(rect)) return [];
630
+ const owner = nodes.get(id);
631
+ if (!owner) return [];
632
+ const ownerPlaneIndex = TERMINAL_RENDER_PLANES.indexOf(owner.plane);
633
+ if (ownerPlaneIndex < 0) return [];
634
+ const out = [];
635
+ for (const candidate of nodes.values()) {
636
+ if (candidate.id === id || !candidate.rect || isEmptyRect(candidate.rect)) continue;
637
+ if (!rectsIntersect(rect, candidate.rect)) continue;
638
+ const candidatePlaneIndex = TERMINAL_RENDER_PLANES.indexOf(candidate.plane);
639
+ const covered = candidatePlaneIndex > ownerPlaneIndex || !options$1.ignoreSamePlane && candidatePlaneIndex === ownerPlaneIndex && compareNodes(owner, candidate) < 0;
640
+ if (!covered) continue;
641
+ const x0 = Math.max(rect.x, candidate.rect.x);
642
+ const y0 = Math.max(rect.y, candidate.rect.y);
643
+ const x1 = Math.min(rect.x + rect.w, candidate.rect.x + candidate.rect.w);
644
+ const y1 = Math.min(rect.y + rect.h, candidate.rect.y + candidate.rect.h);
645
+ if (x1 > x0 && y1 > y0) out.push({
646
+ x: x0,
647
+ y: y0,
648
+ w: x1 - x0,
649
+ h: y1 - y0
650
+ });
651
+ }
652
+ return out;
653
+ }
640
654
  function unregister(id) {
641
655
  if (disposed) return;
642
656
  const prev = nodes.get(id);
643
657
  if (prev) {
644
658
  markRect(prev.plane, prev.rect);
659
+ markLowerPlanesForRect(prev.plane, prev.rect);
645
660
  removeFromRowBuckets(prev);
646
661
  warnedLocalDirtyRows.delete(id);
647
662
  }
@@ -856,6 +871,8 @@ function createRenderManager(terminal, options = {}) {
856
871
  register,
857
872
  update,
858
873
  markDirtyRows,
874
+ isRectCoveredByHigherNode,
875
+ higherNodeCoverageRects,
859
876
  unregister,
860
877
  render,
861
878
  dispose() {
@@ -1669,6 +1686,12 @@ function createTerminalProviderScheduler(options) {
1669
1686
 
1670
1687
  //#endregion
1671
1688
  //#region src/vue/components/TerminalProvider.ts
1689
+ function clipboardCanRead(api) {
1690
+ return api.canRead ?? api.supported;
1691
+ }
1692
+ function clipboardCanWrite(api) {
1693
+ return api.canWrite ?? api.supported;
1694
+ }
1672
1695
  const TerminalProvider = defineComponent({
1673
1696
  name: "TerminalProvider",
1674
1697
  props: {
@@ -1806,15 +1829,22 @@ const TerminalProvider = defineComponent({
1806
1829
  const schedulerApi = scheduler.api;
1807
1830
  const invalidate = schedulerApi.invalidate;
1808
1831
  const platformRuntime = createRuntime();
1832
+ const activeClipboard = computed(() => props.clipboard ?? platformRuntime.clipboard);
1809
1833
  const selectionClipboard = {
1810
1834
  get supported() {
1811
- return props.clipboard?.supported ?? platformRuntime.clipboard.supported;
1835
+ return activeClipboard.value.supported;
1836
+ },
1837
+ get canRead() {
1838
+ return clipboardCanRead(activeClipboard.value);
1839
+ },
1840
+ get canWrite() {
1841
+ return clipboardCanWrite(activeClipboard.value);
1812
1842
  },
1813
1843
  readText() {
1814
- return (props.clipboard ?? platformRuntime.clipboard).readText();
1844
+ return activeClipboard.value.readText();
1815
1845
  },
1816
1846
  writeText(text) {
1817
- return (props.clipboard ?? platformRuntime.clipboard).writeText(text);
1847
+ return activeClipboard.value.writeText(text);
1818
1848
  }
1819
1849
  };
1820
1850
  const selectionTextProviders = new Map();
@@ -1841,6 +1871,7 @@ const TerminalProvider = defineComponent({
1841
1871
  };
1842
1872
  const selectionOverlay = getPlaneTerminal(terminal, "overlay");
1843
1873
  let selectionRenderNodeId = null;
1874
+ const selectionRenderRect = () => null;
1844
1875
  const selection = createTerminalSelectionController({
1845
1876
  terminal,
1846
1877
  overlayTerminal: selectionOverlay,
@@ -1888,15 +1919,22 @@ const TerminalProvider = defineComponent({
1888
1919
  stack: render.rootStack,
1889
1920
  plane: "overlay",
1890
1921
  zIndex: -1e4,
1891
- rect: {
1892
- x: 0,
1893
- y: 0,
1894
- w: props.cols,
1895
- h: props.rows
1896
- },
1922
+ rect: selectionRenderRect(),
1897
1923
  paint: selection.paint
1898
1924
  });
1899
1925
  selectionRenderNodeId = selectionRenderNode.id;
1926
+ watch(() => [
1927
+ selection.state.value.active,
1928
+ selection.state.value.hasRange,
1929
+ props.cols,
1930
+ props.rows
1931
+ ], () => {
1932
+ render.update(selectionRenderNode.id, { rect: selectionRenderRect() });
1933
+ invalidate({
1934
+ plane: "overlay",
1935
+ reason: "selection"
1936
+ });
1937
+ });
1900
1938
  const { portals, runtime } = createTerminalPortals(invalidate);
1901
1939
  const rootLayout = shallowReactive({
1902
1940
  originX: 0,
@@ -1915,6 +1953,7 @@ const TerminalProvider = defineComponent({
1915
1953
  events,
1916
1954
  scheduler: schedulerApi,
1917
1955
  runtime,
1956
+ clipboard: selectionClipboard,
1918
1957
  observability: {
1919
1958
  trace,
1920
1959
  framePerf
@@ -1949,6 +1988,11 @@ const TerminalProvider = defineComponent({
1949
1988
  scope.run(() => {
1950
1989
  const el = containerRef.value;
1951
1990
  if (!el) return;
1991
+ const imeInput = imeRef.value;
1992
+ if (imeInput) {
1993
+ imeInput.style.left = "0px";
1994
+ imeInput.style.top = "0px";
1995
+ }
1952
1996
  const r = createDomRenderer(terminal, el, props.domRendererOptions ?? {});
1953
1997
  renderer.value = r;
1954
1998
  rendererCapabilities.value = r.capabilities;
@@ -2006,12 +2050,7 @@ const TerminalProvider = defineComponent({
2006
2050
  h: rows
2007
2051
  };
2008
2052
  selection.clear();
2009
- render.update(selectionRenderNode.id, { rect: {
2010
- x: 0,
2011
- y: 0,
2012
- w: cols,
2013
- h: rows
2014
- } });
2053
+ render.update(selectionRenderNode.id, { rect: selectionRenderRect() });
2015
2054
  clearTextCaches();
2016
2055
  invalidate({ reason: "resize" });
2017
2056
  });
@@ -2829,8 +2868,6 @@ const TerminalProvider = defineComponent({
2829
2868
  inputmode: "text",
2830
2869
  style: {
2831
2870
  position: "fixed",
2832
- left: "0px",
2833
- top: "0px",
2834
2871
  width: debugIme ? "240px" : "10px",
2835
2872
  height: debugIme ? "90px" : "20px",
2836
2873
  opacity: debugIme ? 1 : .01,
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ module.exports = require("../mermaid.cjs");
@@ -0,0 +1,2 @@
1
+ export type { TMermaidAsciiOptions, TMermaidAsciiTheme, TMermaidCopyPayload, TMermaidRenderer, TMermaidRenderEligibility, TMermaidRenderEligibilityContext, TMermaidResolvedAsciiOptions, TMermaidTextProps, TMermaidTransientErrorClassifier, TMermaidTransientErrorContext, } from "../mermaid.js";
2
+ export { beautifulMermaidRenderer, createBeautifulMermaidRenderer, isSimpleMermaidFlowchartSource, markMermaidRenderErrorFatal, TBeautifulMermaid, TBeautifulMermaidText, TMermaid, TMermaidText, } from "../mermaid.js";
@@ -0,0 +1,2 @@
1
+ export type { TMermaidAsciiOptions, TMermaidAsciiTheme, TMermaidCopyPayload, TMermaidRenderer, TMermaidRenderEligibility, TMermaidRenderEligibilityContext, TMermaidResolvedAsciiOptions, TMermaidTextProps, TMermaidTransientErrorClassifier, TMermaidTransientErrorContext, } from "../mermaid.js";
2
+ export { beautifulMermaidRenderer, createBeautifulMermaidRenderer, isSimpleMermaidFlowchartSource, markMermaidRenderErrorFatal, TBeautifulMermaid, TBeautifulMermaidText, TMermaid, TMermaidText, } from "../mermaid.js";
@@ -0,0 +1 @@
1
+ export * from "../mermaid.js";