@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.
- package/README.md +44 -26
- package/dist/TMermaidText-CXm_L969.js +885 -0
- package/dist/{TSelect-DR0FomSu.js → TSelect-CiyMvwl-.js} +60 -81
- package/dist/{TTree-kzhlB5P0.js → TTree-DKGiuIcM.js} +140 -103
- package/dist/agent/mermaid.cjs +2 -0
- package/dist/agent/mermaid.d.cts +2 -0
- package/dist/agent/mermaid.d.ts +2 -0
- package/dist/agent/mermaid.js +1 -0
- package/dist/agent.cjs +31184 -24907
- package/dist/agent.d.cts +11 -1
- package/dist/agent.d.ts +11 -1
- package/dist/agent.js +1700 -13
- package/dist/block-source-5CQp4tF8.js +3230 -0
- package/dist/cli/stdin-buffer.d.ts +1 -1
- package/dist/cli.cjs +5037 -6767
- package/dist/cli.d.cts +4 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.js +2733 -148
- package/dist/core/buffer/eaw-ranges-unicode-17.d.ts +14 -0
- package/dist/core/perf/instrumentation-noop.d.ts +48 -0
- package/dist/core/perf/instrumentation.d.ts +136 -0
- package/dist/core/terminal/create-terminal.d.ts +1 -0
- package/dist/core.cjs +843 -1469
- package/dist/core.js +6 -6
- package/dist/{create-terminal-DBFNYr8f.js → create-terminal-DXuZ2fci.js} +39 -13
- package/dist/debug-logger-ChY_PXVk.js +74 -0
- package/dist/{dom-renderer-BniJSQyX.js → dom-renderer-DNzmg2As.js} +2 -2
- package/dist/experimental.cjs +4115 -5928
- package/dist/experimental.d.cts +2 -0
- package/dist/experimental.d.ts +2 -0
- package/dist/experimental.js +1490 -9
- package/dist/frame-perf-BBhE-iuS.js +111 -0
- package/dist/{sgr-BmzxEjAO.js → hyperlink-B35-O-cW.js} +100 -1
- package/dist/index.cjs +5017 -10339
- package/dist/index.js +16 -14
- package/dist/{linkify-D_gzn9Xq.js → linkify-CuuquMQT.js} +32 -3
- package/dist/markdown.cjs +21295 -12691
- package/dist/markdown.d.cts +1 -1
- package/dist/markdown.d.ts +1 -1
- package/dist/markdown.js +211 -51
- package/dist/mermaid-CWto52Wk.js +123 -0
- package/dist/mermaid.cjs +1707 -0
- package/dist/mermaid.d.cts +3 -0
- package/dist/mermaid.d.ts +3 -0
- package/dist/mermaid.js +6 -0
- package/dist/observability/frame-perf-store.d.ts +2 -1
- package/dist/observability/frame-perf.d.ts +33 -0
- package/dist/observability.cjs +106 -107
- package/dist/observability.d.cts +2 -2
- package/dist/observability.d.ts +2 -2
- package/dist/observability.js +3 -3
- package/dist/{path-suggest-BNqcuE3-.js → path-suggest-fPzRsgPv.js} +1 -1
- package/dist/{wheel-scroll-vBRaQ7p-.js → rect-Ng-3eKzF.js} +253 -117
- package/dist/renderer/cli/stdout-metrics.d.ts +10 -0
- package/dist/renderer/cli/stdout-renderer.d.ts +3 -0
- package/dist/renderer/terminal-graphic-render-queue.d.ts +50 -0
- package/dist/renderer/terminal-graphics-trace.d.ts +53 -0
- package/dist/renderer/terminal-graphics.d.ts +146 -0
- package/dist/renderer-dom.cjs +364 -903
- package/dist/renderer-dom.js +4 -4
- package/dist/runtime/index.d.ts +2 -0
- package/dist/{runtime-rfcZCyJq.js → runtime-D77C03RM.js} +28 -15
- package/dist/runtime.cjs +427 -889
- package/dist/runtime.js +2 -2
- package/dist/{terminal-selection-DBinO6p5.js → terminal-selection-CQYr--26.js} +4 -1
- package/dist/{tlog-theme-CvLFNMwk.js → tlog-theme-CopRt9SC.js} +37 -6
- package/dist/{trace-CjzYeIxN.js → trace-CYHDKM1m.js} +5 -0
- package/dist/vue/agent/create-png-terminal-graphic-renderer.d.ts +19 -0
- package/dist/vue/components/TAgentTerminalGraphic.d.ts +481 -0
- package/dist/vue/components/TCharts.d.ts +1121 -0
- package/dist/vue/components/TFeedback.d.ts +1 -1
- package/dist/vue/components/TFlex.d.ts +389 -0
- package/dist/vue/components/TForm.d.ts +4 -4
- package/dist/vue/components/TLogSearchBar.d.ts +3 -3
- package/dist/vue/components/TLogSearchPager.d.ts +2 -2
- package/dist/vue/components/TMarkdownText.d.ts +162 -4
- package/dist/vue/components/TMermaidText.d.ts +900 -0
- package/dist/vue/components/TVirtualList.d.ts +9 -0
- package/dist/vue/components/TVirtualMarkdown.d.ts +170 -9
- package/dist/vue/components/TVirtualRows.d.ts +9 -0
- package/dist/vue/components/TerminalProvider.d.ts +2 -0
- package/dist/vue/context.d.ts +24 -0
- package/dist/vue/index.d.ts +5 -0
- package/dist/vue/layout/flex.d.ts +67 -0
- package/dist/vue/markdown/ast.d.ts +5 -2
- package/dist/vue/markdown/document.d.ts +5 -0
- package/dist/vue/markdown/image-actions.d.ts +14 -0
- package/dist/vue/markdown/image.d.ts +11 -0
- package/dist/vue/markdown/link-actions.d.ts +14 -0
- package/dist/vue/markdown/math-actions.d.ts +14 -0
- package/dist/vue/markdown/math.d.ts +6 -0
- package/dist/vue/markdown/render.d.ts +28 -0
- package/dist/vue/markdown/types.d.ts +78 -0
- package/dist/vue/mermaid/beautiful-mermaid.d.ts +1436 -0
- package/dist/vue/render/render-manager.d.ts +7 -0
- package/dist/vue.cjs +7207 -12437
- package/dist/vue.js +706 -39
- package/dist/wheel-scroll-CQ22Hcyj.js +106 -0
- package/dist/{hyperlink-Bn02UXJb.js → width-GqllnV8C.js} +166 -111
- package/package.json +85 -14
- package/dist/block-source-CKUOnkgT.js +0 -1663
- package/dist/frame-perf-C6Xfg85O.js +0 -24
- /package/dist/{env-Cl8qmNFN.js → env-DNCzvX8b.js} +0 -0
- /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-
|
|
2
|
-
import { sanitizeDomHref } from "./hyperlink-
|
|
3
|
-
import { DOM_RENDERER_CAPABILITIES, createDomRenderer } from "./dom-renderer-
|
|
4
|
-
import { EventZIndexContextKey, ImeAnchorContextKey, LayoutContextKey, RenderStackKey, TInputPluginsContextKey, TPathPickerProviderContextKey, TerminalContextKey, VisibilityContextKey,
|
|
5
|
-
import { TView, TuiThemeContextKey, createFrameMailbox, createTheme, defaultActiveStyle, defaultDimStyle, linkifyTextSegments, tuiDefaultTheme } from "./linkify-
|
|
6
|
-
import { SUPPRESS_TERMINAL_POINTER_DOWN, SUPPRESS_TERMINAL_POINTER_MOVE, SUPPRESS_TERMINAL_POINTER_UP, createEventManager, createRuntime } from "./runtime-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
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
|
-
|
|
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
|
|
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
|
|
1844
|
+
return activeClipboard.value.readText();
|
|
1815
1845
|
},
|
|
1816
1846
|
writeText(text) {
|
|
1817
|
-
return
|
|
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
|
+
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";
|