@lvce-editor/renderer-process 30.64.11 → 30.64.13
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/rendererProcessMain.js +39 -6
- package/package.json +1 -1
|
@@ -4641,6 +4641,9 @@ const addCssStyleSheet = (id, text) => {
|
|
|
4641
4641
|
if (existing) {
|
|
4642
4642
|
existing.replaceSync(text);
|
|
4643
4643
|
setText$1(id, text);
|
|
4644
|
+
if (id === 'ContributedColorTheme') {
|
|
4645
|
+
window.dispatchEvent(new Event('color-theme-changed'));
|
|
4646
|
+
}
|
|
4644
4647
|
return;
|
|
4645
4648
|
}
|
|
4646
4649
|
const sheet = new CSSStyleSheet({});
|
|
@@ -4648,6 +4651,9 @@ const addCssStyleSheet = (id, text) => {
|
|
|
4648
4651
|
setText$1(id, text);
|
|
4649
4652
|
sheet.replaceSync(text);
|
|
4650
4653
|
document.adoptedStyleSheets.push(sheet);
|
|
4654
|
+
if (id === 'ContributedColorTheme') {
|
|
4655
|
+
window.dispatchEvent(new Event('color-theme-changed'));
|
|
4656
|
+
}
|
|
4651
4657
|
};
|
|
4652
4658
|
const patchCssStyleSheet = (id, start, deleteCount, replacement) => {
|
|
4653
4659
|
const sheet = get$5(id);
|
|
@@ -8372,9 +8378,13 @@ const handleMouseEnter = event => {
|
|
|
8372
8378
|
send$1(/* Menu.handleMouseEnter */'Menu.handleMouseEnter', /* level */level, /* index */index, /* x */clientX, /* y */clientY, /* timeStamp */timeStamp);
|
|
8373
8379
|
};
|
|
8374
8380
|
const handleMouseLeave = event => {
|
|
8381
|
+
const $Menu = event.currentTarget;
|
|
8375
8382
|
const $RelatedTarget = event.relatedTarget;
|
|
8376
|
-
if ($RelatedTarget && $
|
|
8377
|
-
|
|
8383
|
+
if ($RelatedTarget && ($Menu.contains($RelatedTarget) || $RelatedTarget.closest?.('.MenuItem'))) {
|
|
8384
|
+
return;
|
|
8385
|
+
}
|
|
8386
|
+
const level = getLevel($Menu);
|
|
8387
|
+
send$1(/* Menu.handleMouseLeave */'Menu.handleMouseLeave', /* level */level);
|
|
8378
8388
|
};
|
|
8379
8389
|
|
|
8380
8390
|
// const handleBlur = (event) => {}
|
|
@@ -12329,6 +12339,24 @@ const ready = main();
|
|
|
12329
12339
|
|
|
12330
12340
|
const defaultColumns = 80;
|
|
12331
12341
|
const defaultRows = 24;
|
|
12342
|
+
const terminalAnsiColors = [['black', 'Black'], ['red', 'Red'], ['green', 'Green'], ['yellow', 'Yellow'], ['blue', 'Blue'], ['magenta', 'Magenta'], ['cyan', 'Cyan'], ['white', 'White'], ['brightBlack', 'BrightBlack'], ['brightRed', 'BrightRed'], ['brightGreen', 'BrightGreen'], ['brightYellow', 'BrightYellow'], ['brightBlue', 'BrightBlue'], ['brightMagenta', 'BrightMagenta'], ['brightCyan', 'BrightCyan'], ['brightWhite', 'BrightWhite']];
|
|
12343
|
+
const getTerminalTheme = () => {
|
|
12344
|
+
const getColor = key => getComputedStyle(document.documentElement).getPropertyValue(`--${key}`).trim();
|
|
12345
|
+
const theme = {
|
|
12346
|
+
background: 'rgba(0, 0, 0, 0)'
|
|
12347
|
+
};
|
|
12348
|
+
const foreground = getColor('TerminalForeground') || getColor('WorkbenchForeground');
|
|
12349
|
+
if (foreground) {
|
|
12350
|
+
theme.foreground = foreground;
|
|
12351
|
+
}
|
|
12352
|
+
for (const [xtermColor, themeColor] of terminalAnsiColors) {
|
|
12353
|
+
const color = getColor(`TerminalAnsi${themeColor}`);
|
|
12354
|
+
if (color) {
|
|
12355
|
+
theme[xtermColor] = color;
|
|
12356
|
+
}
|
|
12357
|
+
}
|
|
12358
|
+
return theme;
|
|
12359
|
+
};
|
|
12332
12360
|
const createTerminal = async uid => {
|
|
12333
12361
|
const [{
|
|
12334
12362
|
FitAddon
|
|
@@ -12344,9 +12372,7 @@ const createTerminal = async uid => {
|
|
|
12344
12372
|
convertEol: true,
|
|
12345
12373
|
cursorBlink: true,
|
|
12346
12374
|
rows: defaultRows,
|
|
12347
|
-
theme:
|
|
12348
|
-
background: 'rgba(0, 0, 0, 0)'
|
|
12349
|
-
}
|
|
12375
|
+
theme: getTerminalTheme()
|
|
12350
12376
|
});
|
|
12351
12377
|
const fitAddon = new FitAddon();
|
|
12352
12378
|
terminal.loadAddon(fitAddon);
|
|
@@ -12403,6 +12429,11 @@ const mountTerminal = async (state, uid) => {
|
|
|
12403
12429
|
rows
|
|
12404
12430
|
});
|
|
12405
12431
|
});
|
|
12432
|
+
const updateTheme = () => {
|
|
12433
|
+
terminal.options.theme = getTerminalTheme();
|
|
12434
|
+
};
|
|
12435
|
+
window.addEventListener('color-theme-changed', updateTheme);
|
|
12436
|
+
updateTheme();
|
|
12406
12437
|
terminal.open(state.$Viewlet);
|
|
12407
12438
|
const resizeObserver = new ResizeObserver(() => {
|
|
12408
12439
|
if (state.restoring) return;
|
|
@@ -12413,7 +12444,9 @@ const mountTerminal = async (state, uid) => {
|
|
|
12413
12444
|
state.fitAddon = fitAddon;
|
|
12414
12445
|
state.resizeObserver = resizeObserver;
|
|
12415
12446
|
state.terminal = terminal;
|
|
12416
|
-
state.disposables = [inputDisposable, resizeDisposable
|
|
12447
|
+
state.disposables = [inputDisposable, resizeDisposable, {
|
|
12448
|
+
dispose: () => window.removeEventListener('color-theme-changed', updateTheme)
|
|
12449
|
+
}];
|
|
12417
12450
|
fitAddon.fit();
|
|
12418
12451
|
flushPendingData(state);
|
|
12419
12452
|
focusIfConnected(state);
|