@lvce-editor/renderer-process 12.0.0 → 12.2.0
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 +49 -36
- package/package.json +1 -1
|
@@ -98,6 +98,7 @@ const getModuleId = commandId => {
|
|
|
98
98
|
case 'FilePicker.showSaveFilePicker':
|
|
99
99
|
return FilePicker;
|
|
100
100
|
case 'FileSystemHandle.requestPermission':
|
|
101
|
+
case 'FileSystemHandle.getFileHandles':
|
|
101
102
|
return FileSystemHandle;
|
|
102
103
|
case 'ImagePreview.create':
|
|
103
104
|
case 'ImagePreview.dispose':
|
|
@@ -354,7 +355,7 @@ const ipcs = Object.create(null);
|
|
|
354
355
|
const set$9 = (name, ipc) => {
|
|
355
356
|
ipcs[name] = ipc;
|
|
356
357
|
};
|
|
357
|
-
const get$
|
|
358
|
+
const get$9 = name => {
|
|
358
359
|
return ipcs[name];
|
|
359
360
|
};
|
|
360
361
|
const remove$4 = name => {
|
|
@@ -462,7 +463,7 @@ const callbacks = Object.create(null);
|
|
|
462
463
|
const set$8 = (id, fn) => {
|
|
463
464
|
callbacks[id] = fn;
|
|
464
465
|
};
|
|
465
|
-
const get$
|
|
466
|
+
const get$8 = id => {
|
|
466
467
|
return callbacks[id];
|
|
467
468
|
};
|
|
468
469
|
const remove$3 = id => {
|
|
@@ -635,7 +636,7 @@ const warn$1 = (...args) => {
|
|
|
635
636
|
console.warn(...args);
|
|
636
637
|
};
|
|
637
638
|
const resolve = (id, response) => {
|
|
638
|
-
const fn = get$
|
|
639
|
+
const fn = get$8(id);
|
|
639
640
|
if (!fn) {
|
|
640
641
|
console.log(response);
|
|
641
642
|
warn$1(`callback ${id} may already be disposed`);
|
|
@@ -999,7 +1000,7 @@ const create$I = async ({
|
|
|
999
1000
|
}
|
|
1000
1001
|
// TODO rename method
|
|
1001
1002
|
// TODO avoid cyclic dependency
|
|
1002
|
-
const port = get$
|
|
1003
|
+
const port = get$9(options.name);
|
|
1003
1004
|
remove$4(options.name);
|
|
1004
1005
|
await invokeAndTransfer('Transferrable.transfer', options.id, port);
|
|
1005
1006
|
return;
|
|
@@ -1446,7 +1447,7 @@ const has = listener => {
|
|
|
1446
1447
|
const set$7 = (listener, value) => {
|
|
1447
1448
|
cache$1.set(listener, value);
|
|
1448
1449
|
};
|
|
1449
|
-
const get$
|
|
1450
|
+
const get$7 = listener => {
|
|
1450
1451
|
return cache$1.get(listener);
|
|
1451
1452
|
};
|
|
1452
1453
|
const nameAnonymousFunction$1 = (fn, name) => {
|
|
@@ -1472,7 +1473,7 @@ const getWrappedListener$1 = (listener, returnValue) => {
|
|
|
1472
1473
|
nameAnonymousFunction$1(wrapped, listener.name);
|
|
1473
1474
|
set$7(listener, wrapped);
|
|
1474
1475
|
}
|
|
1475
|
-
return get$
|
|
1476
|
+
return get$7(listener);
|
|
1476
1477
|
};
|
|
1477
1478
|
const getOptions = fn => {
|
|
1478
1479
|
if (fn.passive) {
|
|
@@ -1694,11 +1695,13 @@ const create$H = () => {
|
|
|
1694
1695
|
return ++id;
|
|
1695
1696
|
};
|
|
1696
1697
|
const state$8 = Object.create(null);
|
|
1697
|
-
const
|
|
1698
|
-
|
|
1698
|
+
const acquire$1 = id => {
|
|
1699
|
+
const promise = state$8[id];
|
|
1700
|
+
delete state$8[id];
|
|
1701
|
+
return promise;
|
|
1699
1702
|
};
|
|
1700
|
-
const getFileHandles = async ids => {
|
|
1701
|
-
const promises = ids.map(id =>
|
|
1703
|
+
const getFileHandles$1 = async ids => {
|
|
1704
|
+
const promises = ids.map(id => acquire$1(id));
|
|
1702
1705
|
const handles = await Promise.all(promises);
|
|
1703
1706
|
return handles;
|
|
1704
1707
|
};
|
|
@@ -1707,7 +1710,7 @@ const add = promise => {
|
|
|
1707
1710
|
state$8[id] = promise;
|
|
1708
1711
|
return id;
|
|
1709
1712
|
};
|
|
1710
|
-
const handleDataTransferFiles =
|
|
1713
|
+
const handleDataTransferFiles = event => {
|
|
1711
1714
|
const items = [...event.dataTransfer.items];
|
|
1712
1715
|
const promises = items.map(item => item.getAsFileSystemHandle());
|
|
1713
1716
|
const ids = promises.map(promise => add(promise));
|
|
@@ -1894,7 +1897,7 @@ const rememberFocus$1 = ($Viewlet, dom, eventMap, uid = 0) => {
|
|
|
1894
1897
|
};
|
|
1895
1898
|
|
|
1896
1899
|
const set$6 = setComponentUid;
|
|
1897
|
-
const get$
|
|
1900
|
+
const get$6 = getComponentUid;
|
|
1898
1901
|
const fromEvent = getComponentUidFromEvent;
|
|
1899
1902
|
|
|
1900
1903
|
const applyUidWorkaround = element => {
|
|
@@ -1904,7 +1907,7 @@ const applyUidWorkaround = element => {
|
|
|
1904
1907
|
if (!editor) {
|
|
1905
1908
|
throw new Error('no editor found');
|
|
1906
1909
|
}
|
|
1907
|
-
const editorUid = get$
|
|
1910
|
+
const editorUid = get$6(editor);
|
|
1908
1911
|
set$6(element, editorUid);
|
|
1909
1912
|
};
|
|
1910
1913
|
|
|
@@ -4245,14 +4248,17 @@ const ConfirmPrompt_ipc = {
|
|
|
4245
4248
|
name: name$x
|
|
4246
4249
|
};
|
|
4247
4250
|
|
|
4248
|
-
const
|
|
4251
|
+
const requestPermission = (handle, options) => {
|
|
4252
|
+
return handle.requestPermission(options);
|
|
4253
|
+
};
|
|
4254
|
+
const getFileHandles = ids => {
|
|
4249
4255
|
// @ts-ignore
|
|
4250
|
-
return getFileHandles(ids);
|
|
4256
|
+
return getFileHandles$1(ids);
|
|
4251
4257
|
};
|
|
4252
4258
|
|
|
4253
4259
|
const name$w = 'FileHandles';
|
|
4254
4260
|
const Commands$x = {
|
|
4255
|
-
get:
|
|
4261
|
+
get: getFileHandles
|
|
4256
4262
|
};
|
|
4257
4263
|
|
|
4258
4264
|
const FileHandles_ipc = {
|
|
@@ -4475,13 +4481,10 @@ const FilePicker_ipc = {
|
|
|
4475
4481
|
name: name$r
|
|
4476
4482
|
};
|
|
4477
4483
|
|
|
4478
|
-
const requestPermission = (handle, options) => {
|
|
4479
|
-
return handle.requestPermission(options);
|
|
4480
|
-
};
|
|
4481
|
-
|
|
4482
4484
|
const name$q = 'FileSystemHandle';
|
|
4483
4485
|
const Commands$r = {
|
|
4484
|
-
requestPermission: requestPermission
|
|
4486
|
+
requestPermission: requestPermission,
|
|
4487
|
+
getFileHandles: getFileHandles
|
|
4485
4488
|
};
|
|
4486
4489
|
|
|
4487
4490
|
const FileSystemHandle_ipc = {
|
|
@@ -8598,7 +8601,7 @@ const getUid = () => {
|
|
|
8598
8601
|
if (!$Main) {
|
|
8599
8602
|
return 0;
|
|
8600
8603
|
}
|
|
8601
|
-
return get$
|
|
8604
|
+
return get$6($Main);
|
|
8602
8605
|
};
|
|
8603
8606
|
const handleTabsWheel = event => {
|
|
8604
8607
|
const uid = getUid();
|
|
@@ -10438,7 +10441,7 @@ const setDom2 = (viewletId, dom) => {
|
|
|
10438
10441
|
let uid;
|
|
10439
10442
|
if ($Viewlet) {
|
|
10440
10443
|
try {
|
|
10441
|
-
uid = get$
|
|
10444
|
+
uid = get$6($Viewlet);
|
|
10442
10445
|
} catch {}
|
|
10443
10446
|
}
|
|
10444
10447
|
// TODO optimize rendering with virtual dom diffing
|
|
@@ -11119,20 +11122,21 @@ const isUint8Array = value => {
|
|
|
11119
11122
|
return value instanceof Uint8Array;
|
|
11120
11123
|
};
|
|
11121
11124
|
|
|
11122
|
-
|
|
11123
|
-
const
|
|
11124
|
-
|
|
11125
|
+
const CHAR_WIDTH = 12;
|
|
11126
|
+
const CHAR_HEIGHT = 15;
|
|
11127
|
+
|
|
11125
11128
|
const supportsOffscreenCanvas = true;
|
|
11129
|
+
|
|
11126
11130
|
(() => {
|
|
11127
11131
|
try {
|
|
11128
11132
|
supportsOffscreenCanvas ? (() => {
|
|
11129
|
-
const canvas = new OffscreenCanvas(CHAR_WIDTH
|
|
11133
|
+
const canvas = new OffscreenCanvas(CHAR_WIDTH, CHAR_HEIGHT);
|
|
11130
11134
|
canvas.getContext("2d");
|
|
11131
11135
|
canvas.transferToImageBitmap();
|
|
11132
11136
|
})() : (() => {
|
|
11133
11137
|
const canvas = document.createElement("canvas");
|
|
11134
|
-
canvas.width = CHAR_WIDTH
|
|
11135
|
-
canvas.height = CHAR_HEIGHT
|
|
11138
|
+
canvas.width = CHAR_WIDTH;
|
|
11139
|
+
canvas.height = CHAR_HEIGHT;
|
|
11136
11140
|
canvas.transferToImageBitmap();
|
|
11137
11141
|
})();
|
|
11138
11142
|
return true;
|
|
@@ -11140,15 +11144,18 @@ const supportsOffscreenCanvas = true;
|
|
|
11140
11144
|
return false;
|
|
11141
11145
|
}
|
|
11142
11146
|
})();
|
|
11143
|
-
|
|
11147
|
+
|
|
11148
|
+
const tmpCanvas = new OffscreenCanvas(CHAR_WIDTH, CHAR_HEIGHT) ;
|
|
11144
11149
|
tmpCanvas.getContext("2d", {
|
|
11145
|
-
|
|
11150
|
+
// desynchronized: true, // perf
|
|
11151
|
+
alpha: false // perf
|
|
11146
11152
|
});
|
|
11147
|
-
|
|
11153
|
+
|
|
11154
|
+
const noop = () => {};
|
|
11148
11155
|
const createOffscreenTerminalDom = (root, {
|
|
11149
|
-
handleMouseDown = noop
|
|
11150
|
-
handleKeyDown = noop
|
|
11151
|
-
handleBlur = noop
|
|
11156
|
+
handleMouseDown = noop,
|
|
11157
|
+
handleKeyDown = noop,
|
|
11158
|
+
handleBlur = noop,
|
|
11152
11159
|
canvasText = document.createElement("canvas"),
|
|
11153
11160
|
canvasCursor = document.createElement("canvas")
|
|
11154
11161
|
}) => {
|
|
@@ -11167,6 +11174,7 @@ const createOffscreenTerminalDom = (root, {
|
|
|
11167
11174
|
$Layers.append(canvasText, canvasCursor);
|
|
11168
11175
|
root.append(textarea, $Layers);
|
|
11169
11176
|
const wrappedKeyDown = event => {
|
|
11177
|
+
// @ts-ignore
|
|
11170
11178
|
handleKeyDown({
|
|
11171
11179
|
key: event.key,
|
|
11172
11180
|
shiftKey: event.shiftKey,
|
|
@@ -11185,9 +11193,15 @@ const createOffscreenTerminalDom = (root, {
|
|
|
11185
11193
|
textarea.focus();
|
|
11186
11194
|
};
|
|
11187
11195
|
return {
|
|
11196
|
+
/**
|
|
11197
|
+
* @deprecated
|
|
11198
|
+
*/
|
|
11188
11199
|
get offscreenCanvasCursor() {
|
|
11189
11200
|
return canvasCursor.transferControlToOffscreen();
|
|
11190
11201
|
},
|
|
11202
|
+
/**
|
|
11203
|
+
* @deprecated
|
|
11204
|
+
*/
|
|
11191
11205
|
get offscreenCanvasText() {
|
|
11192
11206
|
return canvasText.transferControlToOffscreen();
|
|
11193
11207
|
},
|
|
@@ -11195,7 +11209,6 @@ const createOffscreenTerminalDom = (root, {
|
|
|
11195
11209
|
};
|
|
11196
11210
|
};
|
|
11197
11211
|
|
|
11198
|
-
// @ts-ignore
|
|
11199
11212
|
const create$1 = ({
|
|
11200
11213
|
$Element,
|
|
11201
11214
|
...options
|