@lvce-editor/renderer-process 13.14.0 → 13.15.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 +66 -28
- package/package.json +1 -1
|
@@ -361,7 +361,7 @@ const setLoad = load => {
|
|
|
361
361
|
};
|
|
362
362
|
|
|
363
363
|
const ipcs = Object.create(null);
|
|
364
|
-
const set$
|
|
364
|
+
const set$a = (name, ipc) => {
|
|
365
365
|
ipcs[name] = ipc;
|
|
366
366
|
};
|
|
367
367
|
const get$9 = name => {
|
|
@@ -469,7 +469,7 @@ const create$4$1 = (method, params) => {
|
|
|
469
469
|
};
|
|
470
470
|
};
|
|
471
471
|
const callbacks = Object.create(null);
|
|
472
|
-
const set$
|
|
472
|
+
const set$9 = (id, fn) => {
|
|
473
473
|
callbacks[id] = fn;
|
|
474
474
|
};
|
|
475
475
|
const get$8 = id => {
|
|
@@ -488,7 +488,7 @@ const registerPromise = () => {
|
|
|
488
488
|
resolve,
|
|
489
489
|
promise
|
|
490
490
|
} = Promise.withResolvers();
|
|
491
|
-
set$
|
|
491
|
+
set$9(id, resolve);
|
|
492
492
|
return {
|
|
493
493
|
id,
|
|
494
494
|
promise
|
|
@@ -1069,7 +1069,7 @@ const hydrate$3 = async () => {
|
|
|
1069
1069
|
} = new MessageChannel();
|
|
1070
1070
|
// TODO only launch port and send to renderer worker
|
|
1071
1071
|
const promise = launchEditorWorker(port1);
|
|
1072
|
-
set$
|
|
1072
|
+
set$a('Editor Worker', port2);
|
|
1073
1073
|
await promise;
|
|
1074
1074
|
};
|
|
1075
1075
|
|
|
@@ -1100,7 +1100,7 @@ const hydrate$2 = async () => {
|
|
|
1100
1100
|
// TODO only launch port and send to renderer worker
|
|
1101
1101
|
const promise = launchExtensionHostWorker(port1);
|
|
1102
1102
|
const name = isElectron ? 'Extension Host (Electron)' : 'Extension Host';
|
|
1103
|
-
set$
|
|
1103
|
+
set$a(name, port2);
|
|
1104
1104
|
await promise;
|
|
1105
1105
|
};
|
|
1106
1106
|
|
|
@@ -1123,7 +1123,7 @@ const hydrate$1 = async () => {
|
|
|
1123
1123
|
} = new MessageChannel();
|
|
1124
1124
|
// TODO only launch port and send to renderer worker
|
|
1125
1125
|
const promise = launchSyntaxHighlightingWorker(port1);
|
|
1126
|
-
set$
|
|
1126
|
+
set$a('Syntax Highlighting Worker', port2);
|
|
1127
1127
|
await promise;
|
|
1128
1128
|
};
|
|
1129
1129
|
|
|
@@ -1490,7 +1490,7 @@ const cache$1 = new Map();
|
|
|
1490
1490
|
const has = listener => {
|
|
1491
1491
|
return cache$1.has(listener);
|
|
1492
1492
|
};
|
|
1493
|
-
const set$
|
|
1493
|
+
const set$8 = (listener, value) => {
|
|
1494
1494
|
cache$1.set(listener, value);
|
|
1495
1495
|
};
|
|
1496
1496
|
const get$7 = listener => {
|
|
@@ -1517,7 +1517,7 @@ const getWrappedListener$1 = (listener, returnValue) => {
|
|
|
1517
1517
|
ipc.send('Viewlet.executeViewletCommand', uid, ...result);
|
|
1518
1518
|
};
|
|
1519
1519
|
nameAnonymousFunction$1(wrapped, listener.name);
|
|
1520
|
-
set$
|
|
1520
|
+
set$8(listener, wrapped);
|
|
1521
1521
|
}
|
|
1522
1522
|
return get$7(listener);
|
|
1523
1523
|
};
|
|
@@ -1739,6 +1739,13 @@ const applyPatch = ($Element, patches) => {
|
|
|
1739
1739
|
}
|
|
1740
1740
|
}
|
|
1741
1741
|
};
|
|
1742
|
+
const dragInfos = Object.create(null);
|
|
1743
|
+
const setDragInfo = (id, data) => {
|
|
1744
|
+
dragInfos[id] = data;
|
|
1745
|
+
};
|
|
1746
|
+
const getDragInfo = id => {
|
|
1747
|
+
return dragInfos[id];
|
|
1748
|
+
};
|
|
1742
1749
|
let id = 0;
|
|
1743
1750
|
const create$H = () => {
|
|
1744
1751
|
return ++id;
|
|
@@ -1763,6 +1770,36 @@ const addFileHandle$1 = fileHandle => {
|
|
|
1763
1770
|
const promise = Promise.resolve(fileHandle);
|
|
1764
1771
|
return add(promise);
|
|
1765
1772
|
};
|
|
1773
|
+
const setDragImage = (dataTransfer, label) => {
|
|
1774
|
+
const dragImage = document.createElement('div');
|
|
1775
|
+
dragImage.className = 'DragImage';
|
|
1776
|
+
dragImage.textContent = label;
|
|
1777
|
+
document.body.append(dragImage);
|
|
1778
|
+
dataTransfer.setDragImage(dragImage, -10, -10);
|
|
1779
|
+
const handleTimeOut = () => {
|
|
1780
|
+
dragImage.remove();
|
|
1781
|
+
};
|
|
1782
|
+
setTimeout(handleTimeOut, 0);
|
|
1783
|
+
};
|
|
1784
|
+
const applyDragInfoMaybe = event => {
|
|
1785
|
+
const {
|
|
1786
|
+
target,
|
|
1787
|
+
dataTransfer
|
|
1788
|
+
} = event;
|
|
1789
|
+
if (dataTransfer) {
|
|
1790
|
+
const uid = getComponentUid(target);
|
|
1791
|
+
const dragInfo = getDragInfo(uid);
|
|
1792
|
+
if (!dragInfo) {
|
|
1793
|
+
return;
|
|
1794
|
+
}
|
|
1795
|
+
for (const item of dragInfo) {
|
|
1796
|
+
dataTransfer.setData(item.type, item.data);
|
|
1797
|
+
}
|
|
1798
|
+
if (dragInfo.label) {
|
|
1799
|
+
setDragImage(dataTransfer, dragInfo.label);
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
1802
|
+
};
|
|
1766
1803
|
let ignore = false;
|
|
1767
1804
|
const startIgnore = () => {
|
|
1768
1805
|
ignore = true;
|
|
@@ -1867,6 +1904,7 @@ const createFn = info => {
|
|
|
1867
1904
|
const uid = getComponentUidFromEvent(event);
|
|
1868
1905
|
const args = getEventListenerArgs(info.params, event);
|
|
1869
1906
|
preventEventsMaybe(info, event);
|
|
1907
|
+
applyDragInfoMaybe(event);
|
|
1870
1908
|
if (args.length === 0) {
|
|
1871
1909
|
return;
|
|
1872
1910
|
}
|
|
@@ -2000,7 +2038,7 @@ const rememberFocus$1 = ($Viewlet, dom, eventMap, uid = 0) => {
|
|
|
2000
2038
|
return $Viewlet;
|
|
2001
2039
|
};
|
|
2002
2040
|
|
|
2003
|
-
const set$
|
|
2041
|
+
const set$7 = setComponentUid;
|
|
2004
2042
|
const get$6 = getComponentUid;
|
|
2005
2043
|
const fromEvent = getComponentUidFromEvent;
|
|
2006
2044
|
|
|
@@ -2012,7 +2050,7 @@ const applyUidWorkaround = element => {
|
|
|
2012
2050
|
throw new Error('no editor found');
|
|
2013
2051
|
}
|
|
2014
2052
|
const editorUid = get$6(editor);
|
|
2015
|
-
set$
|
|
2053
|
+
set$7(element, editorUid);
|
|
2016
2054
|
};
|
|
2017
2055
|
|
|
2018
2056
|
const setBounds$a = ($Element, x, y, width, height) => {
|
|
@@ -4405,7 +4443,7 @@ const FileHandles_ipc = {
|
|
|
4405
4443
|
const state$5 = {
|
|
4406
4444
|
styleSheets: Object.create(null)
|
|
4407
4445
|
};
|
|
4408
|
-
const set$
|
|
4446
|
+
const set$6 = (id, sheet) => {
|
|
4409
4447
|
state$5.styleSheets[id] = sheet;
|
|
4410
4448
|
};
|
|
4411
4449
|
const get$5 = id => {
|
|
@@ -4419,7 +4457,7 @@ const addCssStyleSheet = async (id, text) => {
|
|
|
4419
4457
|
return;
|
|
4420
4458
|
}
|
|
4421
4459
|
const sheet = new CSSStyleSheet({});
|
|
4422
|
-
set$
|
|
4460
|
+
set$6(id, sheet);
|
|
4423
4461
|
await sheet.replace(text);
|
|
4424
4462
|
document.adoptedStyleSheets.push(sheet);
|
|
4425
4463
|
};
|
|
@@ -4970,7 +5008,7 @@ const state$3 = {
|
|
|
4970
5008
|
const get$4 = id => {
|
|
4971
5009
|
return state$3.canvasObjects[id];
|
|
4972
5010
|
};
|
|
4973
|
-
const set$
|
|
5011
|
+
const set$5 = (canvasId, canvas) => {
|
|
4974
5012
|
state$3.canvasObjects[canvasId] = canvas;
|
|
4975
5013
|
};
|
|
4976
5014
|
|
|
@@ -4980,7 +5018,7 @@ const get$3 = id => {
|
|
|
4980
5018
|
const create$u = async (canvasId, objectId) => {
|
|
4981
5019
|
const canvas = document.createElement('canvas');
|
|
4982
5020
|
const offscreenCanvas = canvas.transferControlToOffscreen();
|
|
4983
|
-
set$
|
|
5021
|
+
set$5(canvasId, canvas);
|
|
4984
5022
|
await invokeAndTransfer('Transferrable.transfer', objectId, offscreenCanvas);
|
|
4985
5023
|
};
|
|
4986
5024
|
|
|
@@ -5421,7 +5459,7 @@ const screenCaptures = Object.create(null);
|
|
|
5421
5459
|
const get$2 = id => {
|
|
5422
5460
|
return screenCaptures[id];
|
|
5423
5461
|
};
|
|
5424
|
-
const set$
|
|
5462
|
+
const set$4 = (id, captureStream) => {
|
|
5425
5463
|
screenCaptures[id] = captureStream;
|
|
5426
5464
|
};
|
|
5427
5465
|
const remove$1 = id => {
|
|
@@ -5437,7 +5475,7 @@ const start = async (id, options) => {
|
|
|
5437
5475
|
number(id);
|
|
5438
5476
|
object(options);
|
|
5439
5477
|
const captureStream = await navigator.mediaDevices.getUserMedia(options);
|
|
5440
|
-
set$
|
|
5478
|
+
set$4(id, captureStream);
|
|
5441
5479
|
} catch (error) {
|
|
5442
5480
|
throw new VError$1(error, `Failed to start screen capture`);
|
|
5443
5481
|
}
|
|
@@ -5999,7 +6037,7 @@ const TestFrameWork_ipc = {
|
|
|
5999
6037
|
};
|
|
6000
6038
|
|
|
6001
6039
|
const webViews = Object.create(null);
|
|
6002
|
-
const set$
|
|
6040
|
+
const set$3 = (id, webView) => {
|
|
6003
6041
|
webViews[id] = webView;
|
|
6004
6042
|
};
|
|
6005
6043
|
const get = id => {
|
|
@@ -6055,6 +6093,10 @@ const Transferrable_ipc = {
|
|
|
6055
6093
|
name: name$9
|
|
6056
6094
|
};
|
|
6057
6095
|
|
|
6096
|
+
const set$2 = (id, data) => {
|
|
6097
|
+
setDragInfo(id, data);
|
|
6098
|
+
};
|
|
6099
|
+
|
|
6058
6100
|
const state = {
|
|
6059
6101
|
identifiers: new Uint32Array()
|
|
6060
6102
|
};
|
|
@@ -9892,7 +9934,7 @@ const setMenus = (state, changes, uid) => {
|
|
|
9892
9934
|
const menu = change[1];
|
|
9893
9935
|
const dom = change[2];
|
|
9894
9936
|
const $Menu = create$Menu();
|
|
9895
|
-
set$
|
|
9937
|
+
set$7($Menu, uid);
|
|
9896
9938
|
$Menu.onmouseover = handleMenuMouseOver;
|
|
9897
9939
|
$Menu.onclick = handleMenuClick;
|
|
9898
9940
|
const {
|
|
@@ -10093,7 +10135,7 @@ const setIframe = (state, src, sandbox = [], srcDoc = '', csp = '', credentialle
|
|
|
10093
10135
|
$Iframe.className = 'E2eTestIframe WebViewIframe';
|
|
10094
10136
|
$Parent.append($Iframe);
|
|
10095
10137
|
state.frame = $Iframe;
|
|
10096
|
-
set$
|
|
10138
|
+
set$3(1, $Iframe);
|
|
10097
10139
|
};
|
|
10098
10140
|
const setPort$1 = (state, portId, origin) => {
|
|
10099
10141
|
const port = acquire(portId);
|
|
@@ -10255,7 +10297,7 @@ const create$3 = (id, uid = id) => {
|
|
|
10255
10297
|
state$6.instances[id].state.$Viewlet.remove();
|
|
10256
10298
|
}
|
|
10257
10299
|
const instanceState = module.create();
|
|
10258
|
-
set$
|
|
10300
|
+
set$7(instanceState.$Viewlet, uid);
|
|
10259
10301
|
if (module.attachEvents) {
|
|
10260
10302
|
module.attachEvents(instanceState);
|
|
10261
10303
|
}
|
|
@@ -10385,7 +10427,7 @@ const setUid = (viewletId, uid) => {
|
|
|
10385
10427
|
const {
|
|
10386
10428
|
$Viewlet
|
|
10387
10429
|
} = instance.state;
|
|
10388
|
-
set$
|
|
10430
|
+
set$7($Viewlet, uid);
|
|
10389
10431
|
};
|
|
10390
10432
|
const focusSelector = (viewletId, selector) => {
|
|
10391
10433
|
const instance = state$6.instances[viewletId];
|
|
@@ -10435,11 +10477,7 @@ const createPlaceholder = (viewletId, parentId, top, left, width, height) => {
|
|
|
10435
10477
|
};
|
|
10436
10478
|
};
|
|
10437
10479
|
const setDragData = (viewletId, dragData) => {
|
|
10438
|
-
|
|
10439
|
-
if (!instance) {
|
|
10440
|
-
return;
|
|
10441
|
-
}
|
|
10442
|
-
instance.state.dragData = dragData;
|
|
10480
|
+
set$2(viewletId, dragData);
|
|
10443
10481
|
};
|
|
10444
10482
|
const setDom = (viewletId, dom) => {
|
|
10445
10483
|
const instance = state$6.instances[viewletId];
|
|
@@ -10475,7 +10513,7 @@ const setDom2 = (viewletId, dom) => {
|
|
|
10475
10513
|
const $NewViewlet = rememberFocus($Viewlet, dom, Events, viewletId);
|
|
10476
10514
|
if (uid) {
|
|
10477
10515
|
// @ts-ignore
|
|
10478
|
-
set$
|
|
10516
|
+
set$7($NewViewlet, uid);
|
|
10479
10517
|
}
|
|
10480
10518
|
instance.state.$Viewlet = $NewViewlet;
|
|
10481
10519
|
};
|
|
@@ -11120,7 +11158,7 @@ const create$2 = async (uid, src, sandbox, csp, credentialless, permissionPolicy
|
|
|
11120
11158
|
if (title) {
|
|
11121
11159
|
$Iframe.title = title;
|
|
11122
11160
|
}
|
|
11123
|
-
set$
|
|
11161
|
+
set$3(uid, $Iframe);
|
|
11124
11162
|
// TODO make make waitForFrameToLoad a separate command
|
|
11125
11163
|
};
|
|
11126
11164
|
const loadOnly = async uid => {
|