@lvce-editor/renderer-process 10.33.0 → 10.34.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 +45 -40
- package/package.json +1 -1
|
@@ -345,7 +345,7 @@ const setLoad = load => {
|
|
|
345
345
|
};
|
|
346
346
|
|
|
347
347
|
const ipcs = Object.create(null);
|
|
348
|
-
const set$
|
|
348
|
+
const set$9 = (name, ipc) => {
|
|
349
349
|
ipcs[name] = ipc;
|
|
350
350
|
};
|
|
351
351
|
const get$9 = name => {
|
|
@@ -455,7 +455,7 @@ const create$4$1 = (method, params) => {
|
|
|
455
455
|
};
|
|
456
456
|
};
|
|
457
457
|
const callbacks = Object.create(null);
|
|
458
|
-
const set$
|
|
458
|
+
const set$8 = (id, fn) => {
|
|
459
459
|
callbacks[id] = fn;
|
|
460
460
|
};
|
|
461
461
|
const get$8 = id => {
|
|
@@ -468,31 +468,18 @@ let id = 0;
|
|
|
468
468
|
const create$3$1 = () => {
|
|
469
469
|
return ++id;
|
|
470
470
|
};
|
|
471
|
-
const warn$1 = (...args) => {
|
|
472
|
-
console.warn(...args);
|
|
473
|
-
};
|
|
474
471
|
const registerPromise = () => {
|
|
475
472
|
const id = create$3$1();
|
|
476
473
|
const {
|
|
477
474
|
resolve,
|
|
478
475
|
promise
|
|
479
476
|
} = Promise.withResolvers();
|
|
480
|
-
set$
|
|
477
|
+
set$8(id, resolve);
|
|
481
478
|
return {
|
|
482
479
|
id,
|
|
483
480
|
promise
|
|
484
481
|
};
|
|
485
482
|
};
|
|
486
|
-
const resolve = (id, response) => {
|
|
487
|
-
const fn = get$8(id);
|
|
488
|
-
if (!fn) {
|
|
489
|
-
console.log(response);
|
|
490
|
-
warn$1(`callback ${id} may already be disposed`);
|
|
491
|
-
return;
|
|
492
|
-
}
|
|
493
|
-
fn(response);
|
|
494
|
-
remove$3(id);
|
|
495
|
-
};
|
|
496
483
|
const create$2$1 = (method, params) => {
|
|
497
484
|
const {
|
|
498
485
|
id,
|
|
@@ -640,6 +627,19 @@ const unwrapJsonRpcResult = responseMessage => {
|
|
|
640
627
|
}
|
|
641
628
|
throw new JsonRpcError('unexpected response message');
|
|
642
629
|
};
|
|
630
|
+
const warn$1 = (...args) => {
|
|
631
|
+
console.warn(...args);
|
|
632
|
+
};
|
|
633
|
+
const resolve = (id, response) => {
|
|
634
|
+
const fn = get$8(id);
|
|
635
|
+
if (!fn) {
|
|
636
|
+
console.log(response);
|
|
637
|
+
warn$1(`callback ${id} may already be disposed`);
|
|
638
|
+
return;
|
|
639
|
+
}
|
|
640
|
+
fn(response);
|
|
641
|
+
remove$3(id);
|
|
642
|
+
};
|
|
643
643
|
const E_COMMAND_NOT_FOUND = 'E_COMMAND_NOT_FOUND';
|
|
644
644
|
const getErrorType = prettyError => {
|
|
645
645
|
if (prettyError && prettyError.type) {
|
|
@@ -1020,7 +1020,7 @@ const hydrate$3 = async () => {
|
|
|
1020
1020
|
} = new MessageChannel();
|
|
1021
1021
|
// TODO only launch port and send to renderer worker
|
|
1022
1022
|
const promise = launchEditorWorker(port1);
|
|
1023
|
-
set$
|
|
1023
|
+
set$9('Editor Worker', port2);
|
|
1024
1024
|
await promise;
|
|
1025
1025
|
};
|
|
1026
1026
|
|
|
@@ -1051,7 +1051,7 @@ const hydrate$2 = async () => {
|
|
|
1051
1051
|
// TODO only launch port and send to renderer worker
|
|
1052
1052
|
const promise = launchExtensionHostWorker(port1);
|
|
1053
1053
|
const name = isElectron ? 'Extension Host (Electron)' : 'Extension Host';
|
|
1054
|
-
set$
|
|
1054
|
+
set$9(name, port2);
|
|
1055
1055
|
await promise;
|
|
1056
1056
|
};
|
|
1057
1057
|
|
|
@@ -1074,7 +1074,7 @@ const hydrate$1 = async () => {
|
|
|
1074
1074
|
} = new MessageChannel();
|
|
1075
1075
|
// TODO only launch port and send to renderer worker
|
|
1076
1076
|
const promise = launchSyntaxHighlightingWorker(port1);
|
|
1077
|
-
set$
|
|
1077
|
+
set$9('Syntax Highlighting Worker', port2);
|
|
1078
1078
|
await promise;
|
|
1079
1079
|
};
|
|
1080
1080
|
|
|
@@ -1485,7 +1485,7 @@ var cache$1 = /* @__PURE__ */new Map();
|
|
|
1485
1485
|
var has = listener => {
|
|
1486
1486
|
return cache$1.has(listener);
|
|
1487
1487
|
};
|
|
1488
|
-
var set$
|
|
1488
|
+
var set$7 = (listener, value) => {
|
|
1489
1489
|
cache$1.set(listener, value);
|
|
1490
1490
|
};
|
|
1491
1491
|
var get$7 = listener => {
|
|
@@ -1508,7 +1508,7 @@ var getWrappedListener$1 = (listener, returnValue) => {
|
|
|
1508
1508
|
ipc.send("Viewlet.executeViewletCommand", uid, ...result);
|
|
1509
1509
|
};
|
|
1510
1510
|
nameAnonymousFunction$1(wrapped, listener.name);
|
|
1511
|
-
set$
|
|
1511
|
+
set$7(listener, wrapped);
|
|
1512
1512
|
}
|
|
1513
1513
|
return get$7(listener);
|
|
1514
1514
|
};
|
|
@@ -1699,7 +1699,7 @@ var rememberFocus$1 = ($Viewlet, dom, eventMap, uid = 0) => {
|
|
|
1699
1699
|
return $Viewlet;
|
|
1700
1700
|
};
|
|
1701
1701
|
|
|
1702
|
-
const set$
|
|
1702
|
+
const set$6 = setComponentUid;
|
|
1703
1703
|
const get$6 = getComponentUid;
|
|
1704
1704
|
const fromEvent = getComponentUidFromEvent;
|
|
1705
1705
|
|
|
@@ -1711,7 +1711,7 @@ const applyUidWorkaround = element => {
|
|
|
1711
1711
|
throw new Error('no editor found');
|
|
1712
1712
|
}
|
|
1713
1713
|
const editorUid = get$6(editor);
|
|
1714
|
-
set$
|
|
1714
|
+
set$6(element, editorUid);
|
|
1715
1715
|
};
|
|
1716
1716
|
|
|
1717
1717
|
const setBounds$a = ($Element, x, y, width, height) => {
|
|
@@ -4064,7 +4064,7 @@ const ConfirmPrompt_ipc = {
|
|
|
4064
4064
|
const state$5 = {
|
|
4065
4065
|
styleSheets: Object.create(null)
|
|
4066
4066
|
};
|
|
4067
|
-
const set$
|
|
4067
|
+
const set$5 = (id, sheet) => {
|
|
4068
4068
|
state$5.styleSheets[id] = sheet;
|
|
4069
4069
|
};
|
|
4070
4070
|
const get$5 = id => {
|
|
@@ -4078,7 +4078,7 @@ const addCssStyleSheet = async (id, text) => {
|
|
|
4078
4078
|
return;
|
|
4079
4079
|
}
|
|
4080
4080
|
const sheet = new CSSStyleSheet({});
|
|
4081
|
-
set$
|
|
4081
|
+
set$5(id, sheet);
|
|
4082
4082
|
await sheet.replace(text);
|
|
4083
4083
|
document.adoptedStyleSheets.push(sheet);
|
|
4084
4084
|
};
|
|
@@ -4632,7 +4632,7 @@ const state$3 = {
|
|
|
4632
4632
|
const get$4 = id => {
|
|
4633
4633
|
return state$3.canvasObjects[id];
|
|
4634
4634
|
};
|
|
4635
|
-
const set$
|
|
4635
|
+
const set$4 = (canvasId, canvas) => {
|
|
4636
4636
|
state$3.canvasObjects[canvasId] = canvas;
|
|
4637
4637
|
};
|
|
4638
4638
|
|
|
@@ -4642,7 +4642,7 @@ const get$3 = id => {
|
|
|
4642
4642
|
const create$y = async (canvasId, objectId) => {
|
|
4643
4643
|
const canvas = document.createElement('canvas');
|
|
4644
4644
|
const offscreenCanvas = canvas.transferControlToOffscreen();
|
|
4645
|
-
set$
|
|
4645
|
+
set$4(canvasId, canvas);
|
|
4646
4646
|
await invokeAndTransfer('Transferrable.transfer', objectId, offscreenCanvas);
|
|
4647
4647
|
};
|
|
4648
4648
|
|
|
@@ -5089,7 +5089,7 @@ const screenCaptures = Object.create(null);
|
|
|
5089
5089
|
const get$2 = id => {
|
|
5090
5090
|
return screenCaptures[id];
|
|
5091
5091
|
};
|
|
5092
|
-
const set$
|
|
5092
|
+
const set$3 = (id, captureStream) => {
|
|
5093
5093
|
screenCaptures[id] = captureStream;
|
|
5094
5094
|
};
|
|
5095
5095
|
const remove$1 = id => {
|
|
@@ -5105,7 +5105,7 @@ const start = async (id, options) => {
|
|
|
5105
5105
|
number(id);
|
|
5106
5106
|
object(options);
|
|
5107
5107
|
const captureStream = await navigator.mediaDevices.getUserMedia(options);
|
|
5108
|
-
set$
|
|
5108
|
+
set$3(id, captureStream);
|
|
5109
5109
|
} catch (error) {
|
|
5110
5110
|
throw new VError$1(error, `Failed to start screen capture`);
|
|
5111
5111
|
}
|
|
@@ -5656,7 +5656,7 @@ const TestFrameWork_ipc = {
|
|
|
5656
5656
|
};
|
|
5657
5657
|
|
|
5658
5658
|
const webViews = Object.create(null);
|
|
5659
|
-
const set$
|
|
5659
|
+
const set$2 = (id, webView) => {
|
|
5660
5660
|
webViews[id] = webView;
|
|
5661
5661
|
};
|
|
5662
5662
|
const get = id => {
|
|
@@ -5869,7 +5869,7 @@ const create$x = (id, uid = id) => {
|
|
|
5869
5869
|
state$6.instances[id].state.$Viewlet.remove();
|
|
5870
5870
|
}
|
|
5871
5871
|
const instanceState = module.create();
|
|
5872
|
-
set$
|
|
5872
|
+
set$6(instanceState.$Viewlet, uid);
|
|
5873
5873
|
if (module.attachEvents) {
|
|
5874
5874
|
module.attachEvents(instanceState);
|
|
5875
5875
|
}
|
|
@@ -6032,7 +6032,7 @@ const setDom2 = (viewletId, dom) => {
|
|
|
6032
6032
|
const $NewViewlet = rememberFocus($Viewlet, dom, Events, viewletId);
|
|
6033
6033
|
if (uid) {
|
|
6034
6034
|
// @ts-ignore
|
|
6035
|
-
set$
|
|
6035
|
+
set$6($NewViewlet, uid);
|
|
6036
6036
|
}
|
|
6037
6037
|
instance.state.$Viewlet = $NewViewlet;
|
|
6038
6038
|
};
|
|
@@ -6445,13 +6445,13 @@ const Window_ipc = {
|
|
|
6445
6445
|
name: name$6
|
|
6446
6446
|
};
|
|
6447
6447
|
|
|
6448
|
-
const set = title => {
|
|
6448
|
+
const set$1 = title => {
|
|
6449
6449
|
document.title = title;
|
|
6450
6450
|
};
|
|
6451
6451
|
|
|
6452
6452
|
const name$5 = 'WindowTitle';
|
|
6453
6453
|
const Commands$6 = {
|
|
6454
|
-
set: set
|
|
6454
|
+
set: set$1
|
|
6455
6455
|
};
|
|
6456
6456
|
|
|
6457
6457
|
const WindowTitle_ipc = {
|
|
@@ -6585,6 +6585,13 @@ const setIframeCsp = ($Iframe, csp) => {
|
|
|
6585
6585
|
}
|
|
6586
6586
|
};
|
|
6587
6587
|
|
|
6588
|
+
const set = ($Iframe, permissionPolicy) => {
|
|
6589
|
+
if (permissionPolicy === undefined) {
|
|
6590
|
+
return;
|
|
6591
|
+
}
|
|
6592
|
+
$Iframe.allow = permissionPolicy;
|
|
6593
|
+
};
|
|
6594
|
+
|
|
6588
6595
|
const setIframeSandBox = ($Iframe, sandbox) => {
|
|
6589
6596
|
$Iframe.sandbox.add(...sandbox);
|
|
6590
6597
|
};
|
|
@@ -6615,12 +6622,10 @@ const create$w = async (uid, src, sandbox, csp, credentialless, permissionPolicy
|
|
|
6615
6622
|
setIframeCsp($Iframe, csp);
|
|
6616
6623
|
setIframeSandBox($Iframe, sandbox);
|
|
6617
6624
|
setIframeSrc($Iframe, src);
|
|
6625
|
+
set($Iframe, permissionPolicy);
|
|
6618
6626
|
// TODO set classname from iframe worker
|
|
6619
6627
|
$Iframe.className = 'E2eTestIframe WebViewIframe';
|
|
6620
|
-
|
|
6621
|
-
$Iframe.allow = permissionPolicy;
|
|
6622
|
-
}
|
|
6623
|
-
set$1(uid, $Iframe);
|
|
6628
|
+
set$2(uid, $Iframe);
|
|
6624
6629
|
// TODO make make waitForFrameToLoad a separate command
|
|
6625
6630
|
};
|
|
6626
6631
|
const load = async uid => {
|
|
@@ -11372,7 +11377,7 @@ const setMenus = (state, changes, uid) => {
|
|
|
11372
11377
|
const menu = change[1];
|
|
11373
11378
|
const dom = change[2];
|
|
11374
11379
|
const $Menu = create$Menu();
|
|
11375
|
-
set$
|
|
11380
|
+
set$6($Menu, uid);
|
|
11376
11381
|
$Menu.onmouseover = handleMenuMouseOver;
|
|
11377
11382
|
$Menu.onclick = handleMenuClick;
|
|
11378
11383
|
const {
|
|
@@ -11760,7 +11765,7 @@ const setIframe = (state, src, sandbox = [], srcDoc = '', csp = '', credentialle
|
|
|
11760
11765
|
$Iframe.className = 'E2eTestIframe WebViewIframe';
|
|
11761
11766
|
$Parent.append($Iframe);
|
|
11762
11767
|
state.frame = $Iframe;
|
|
11763
|
-
set$
|
|
11768
|
+
set$2(1, $Iframe);
|
|
11764
11769
|
};
|
|
11765
11770
|
const setPort = (state, portId, origin) => {
|
|
11766
11771
|
const port = acquire(portId);
|