@lvce-editor/renderer-process 30.32.2 → 30.33.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/dist/rendererProcessMain.js +43 -30
- package/package.json +1 -1
|
@@ -4049,6 +4049,10 @@ const create$BackDrop = () => {
|
|
|
4049
4049
|
return $BackDrop;
|
|
4050
4050
|
};
|
|
4051
4051
|
|
|
4052
|
+
const set$5 = setComponentUid;
|
|
4053
|
+
const get$3 = getComponentUid;
|
|
4054
|
+
const fromEvent = getComponentUidFromEvent;
|
|
4055
|
+
|
|
4052
4056
|
const AriaOwns = 'aria-owns';
|
|
4053
4057
|
const AriaLabelledBy = 'aria-labelledby';
|
|
4054
4058
|
const AriaDescribedBy = 'aria-describedby';
|
|
@@ -4423,6 +4427,11 @@ const showControlled = ({
|
|
|
4423
4427
|
y
|
|
4424
4428
|
}) => {
|
|
4425
4429
|
showMenu(x, y, width, height, items, level);
|
|
4430
|
+
const $Menu = state$5.$$Menus.at(-1);
|
|
4431
|
+
if ($Parent && $Menu) {
|
|
4432
|
+
const uid = get$3($Parent);
|
|
4433
|
+
set$5($Menu, uid);
|
|
4434
|
+
}
|
|
4426
4435
|
// TODO menu should not necessarily know about parent (titleBarMenuBar)
|
|
4427
4436
|
// it should be the other way around
|
|
4428
4437
|
// @ts-expect-error
|
|
@@ -4507,10 +4516,10 @@ const prompt = (message, defaultValue) => {
|
|
|
4507
4516
|
};
|
|
4508
4517
|
|
|
4509
4518
|
const screenCaptures = Object.create(null);
|
|
4510
|
-
const get$
|
|
4519
|
+
const get$2 = id => {
|
|
4511
4520
|
return screenCaptures[id];
|
|
4512
4521
|
};
|
|
4513
|
-
const set$
|
|
4522
|
+
const set$4 = (id, captureStream) => {
|
|
4514
4523
|
screenCaptures[id] = captureStream;
|
|
4515
4524
|
};
|
|
4516
4525
|
|
|
@@ -4573,16 +4582,16 @@ class VError extends Error {
|
|
|
4573
4582
|
}
|
|
4574
4583
|
}
|
|
4575
4584
|
|
|
4576
|
-
const get$
|
|
4585
|
+
const get$1 = id => {
|
|
4577
4586
|
number(id);
|
|
4578
|
-
return get$
|
|
4587
|
+
return get$2(id);
|
|
4579
4588
|
};
|
|
4580
4589
|
const start = async (id, options) => {
|
|
4581
4590
|
try {
|
|
4582
4591
|
number(id);
|
|
4583
4592
|
object(options);
|
|
4584
4593
|
const captureStream = await navigator.mediaDevices.getUserMedia(options);
|
|
4585
|
-
set$
|
|
4594
|
+
set$4(id, captureStream);
|
|
4586
4595
|
} catch (error) {
|
|
4587
4596
|
throw new VError(error, `Failed to start screen capture`);
|
|
4588
4597
|
}
|
|
@@ -5229,10 +5238,10 @@ const checkConditionError = (fnName, ...params) => {
|
|
|
5229
5238
|
};
|
|
5230
5239
|
|
|
5231
5240
|
const webViews = Object.create(null);
|
|
5232
|
-
const set$
|
|
5241
|
+
const set$3 = (id, webView) => {
|
|
5233
5242
|
webViews[id] = webView;
|
|
5234
5243
|
};
|
|
5235
|
-
const get
|
|
5244
|
+
const get = id => {
|
|
5236
5245
|
return webViews[id];
|
|
5237
5246
|
};
|
|
5238
5247
|
const remove = id => {
|
|
@@ -5252,7 +5261,7 @@ const acquire = objectId => {
|
|
|
5252
5261
|
// TODO transfer port directly instead of storing
|
|
5253
5262
|
// it for a short time in state
|
|
5254
5263
|
const transferToWebView = objectId => {
|
|
5255
|
-
const $Iframe = get
|
|
5264
|
+
const $Iframe = get(1);
|
|
5256
5265
|
if (!$Iframe) {
|
|
5257
5266
|
throw new Error(`webview not found`);
|
|
5258
5267
|
}
|
|
@@ -5281,10 +5290,6 @@ const attachEvents$7 = ($Node, eventMap) => {
|
|
|
5281
5290
|
}
|
|
5282
5291
|
};
|
|
5283
5292
|
|
|
5284
|
-
const set$3 = setComponentUid;
|
|
5285
|
-
const get = getComponentUid;
|
|
5286
|
-
const fromEvent = getComponentUidFromEvent;
|
|
5287
|
-
|
|
5288
5293
|
const state$4 = {
|
|
5289
5294
|
currentDragInfo: undefined
|
|
5290
5295
|
};
|
|
@@ -5661,8 +5666,8 @@ const applyUidWorkaround = element => {
|
|
|
5661
5666
|
if (!editor) {
|
|
5662
5667
|
throw new Error('no editor found');
|
|
5663
5668
|
}
|
|
5664
|
-
const editorUid = get(editor);
|
|
5665
|
-
set$
|
|
5669
|
+
const editorUid = get$3(editor);
|
|
5670
|
+
set$5(element, editorUid);
|
|
5666
5671
|
};
|
|
5667
5672
|
|
|
5668
5673
|
const startTracking$1 = ($Target, pointerId, handlePointerMove, handlePointerUp) => {
|
|
@@ -7635,7 +7640,7 @@ const handleClickAction$1 = target => {
|
|
|
7635
7640
|
console.info('[panel] action command not found');
|
|
7636
7641
|
return;
|
|
7637
7642
|
}
|
|
7638
|
-
const childUid = get(target);
|
|
7643
|
+
const childUid = get$3(target);
|
|
7639
7644
|
handleClickAction$2(childUid, index, command);
|
|
7640
7645
|
};
|
|
7641
7646
|
const handleHeaderClick$1 = event => {
|
|
@@ -7814,7 +7819,7 @@ const setScreenCapture = (state, id) => {
|
|
|
7814
7819
|
$Viewlet
|
|
7815
7820
|
} = state;
|
|
7816
7821
|
const $Video = document.createElement('video');
|
|
7817
|
-
const screenCapture = get$
|
|
7822
|
+
const screenCapture = get$1(id);
|
|
7818
7823
|
$Video.srcObject = screenCapture;
|
|
7819
7824
|
$Video.onloadedmetadata = handleLoadedMetadata;
|
|
7820
7825
|
$Viewlet.append($Video);
|
|
@@ -8193,7 +8198,7 @@ const handleMouseDown$1 = event => {
|
|
|
8193
8198
|
if (!terminal) {
|
|
8194
8199
|
return;
|
|
8195
8200
|
}
|
|
8196
|
-
const terminalUid = get(terminal);
|
|
8201
|
+
const terminalUid = get$3(terminal);
|
|
8197
8202
|
if (!terminalUid) {
|
|
8198
8203
|
return;
|
|
8199
8204
|
}
|
|
@@ -8488,7 +8493,7 @@ const addMenu = ($$Menus, change, uid) => {
|
|
|
8488
8493
|
const menu = change[1];
|
|
8489
8494
|
const dom = change[2];
|
|
8490
8495
|
const $Menu = create$Menu();
|
|
8491
|
-
set$
|
|
8496
|
+
set$5($Menu, uid);
|
|
8492
8497
|
$Menu.onmouseover = handleMenuMouseOver;
|
|
8493
8498
|
$Menu.onclick = handleMenuClick;
|
|
8494
8499
|
const {
|
|
@@ -8723,7 +8728,7 @@ const setIframe = (state, src, sandbox = [], srcDoc = '', csp = '', credentialle
|
|
|
8723
8728
|
$Iframe.className = 'E2eTestIframe WebViewIframe';
|
|
8724
8729
|
$Parent.append($Iframe);
|
|
8725
8730
|
state.frame = $Iframe;
|
|
8726
|
-
set$
|
|
8731
|
+
set$3(1, $Iframe);
|
|
8727
8732
|
};
|
|
8728
8733
|
const setPort$1 = (state, portId, origin) => {
|
|
8729
8734
|
const port = acquire(portId);
|
|
@@ -8748,7 +8753,7 @@ const setPort$1 = (state, portId, origin) => {
|
|
|
8748
8753
|
});
|
|
8749
8754
|
};
|
|
8750
8755
|
const setPosition = (state, id, x, y, width, height) => {
|
|
8751
|
-
const $Iframe = get
|
|
8756
|
+
const $Iframe = get(id);
|
|
8752
8757
|
if (!$Iframe) {
|
|
8753
8758
|
return;
|
|
8754
8759
|
}
|
|
@@ -8838,7 +8843,7 @@ const create$2 = (id, uid = id) => {
|
|
|
8838
8843
|
existing.state.$Viewlet.remove();
|
|
8839
8844
|
}
|
|
8840
8845
|
const instanceState = module.create();
|
|
8841
|
-
set$
|
|
8846
|
+
set$5(instanceState.$Viewlet, uid);
|
|
8842
8847
|
if (module.attachEvents) {
|
|
8843
8848
|
module.attachEvents(instanceState);
|
|
8844
8849
|
}
|
|
@@ -8985,7 +8990,7 @@ const setUid = (viewletId, uid) => {
|
|
|
8985
8990
|
const {
|
|
8986
8991
|
$Viewlet
|
|
8987
8992
|
} = instance.state;
|
|
8988
|
-
set$
|
|
8993
|
+
set$5($Viewlet, uid);
|
|
8989
8994
|
};
|
|
8990
8995
|
const focusCallback = {
|
|
8991
8996
|
id: 0,
|
|
@@ -9089,14 +9094,14 @@ const setDom2 = (viewletId, dom) => {
|
|
|
9089
9094
|
let uid;
|
|
9090
9095
|
if ($Viewlet) {
|
|
9091
9096
|
try {
|
|
9092
|
-
uid = get($Viewlet);
|
|
9097
|
+
uid = get$3($Viewlet);
|
|
9093
9098
|
} catch {}
|
|
9094
9099
|
}
|
|
9095
9100
|
// TODO optimize rendering with virtual DOM diffing
|
|
9096
9101
|
const $NewViewlet = rememberFocus($Viewlet, dom, Events, viewletId);
|
|
9097
9102
|
if (uid) {
|
|
9098
9103
|
// @ts-ignore
|
|
9099
|
-
set$
|
|
9104
|
+
set$5($NewViewlet, uid);
|
|
9100
9105
|
}
|
|
9101
9106
|
set$a(viewletId, {
|
|
9102
9107
|
...instance,
|
|
@@ -9485,6 +9490,12 @@ const toggleFullScreen = () => {
|
|
|
9485
9490
|
}
|
|
9486
9491
|
return document.documentElement.requestFullscreen();
|
|
9487
9492
|
};
|
|
9493
|
+
const handleFullScreenChange = isFullScreen => {
|
|
9494
|
+
send('Layout.handleFullScreenChange', isFullScreen);
|
|
9495
|
+
};
|
|
9496
|
+
const handleDocumentFullScreenChange = () => {
|
|
9497
|
+
handleFullScreenChange(Boolean(document.fullscreenElement));
|
|
9498
|
+
};
|
|
9488
9499
|
const sendVisibilityChangeHint = () => {
|
|
9489
9500
|
send(/* SaveState.handleVisibilityChange */'SaveState.handleVisibilityChange', /* visibilityState */'hidden');
|
|
9490
9501
|
};
|
|
@@ -9500,6 +9511,7 @@ const handlePointerLeave = () => {
|
|
|
9500
9511
|
// beforeunload event has the same problem, pointerleave event sometimes works
|
|
9501
9512
|
const onVisibilityChange = () => {
|
|
9502
9513
|
window.addEventListener('beforeunload', handleBeforeUnload);
|
|
9514
|
+
document.addEventListener('fullscreenchange', handleDocumentFullScreenChange);
|
|
9503
9515
|
document.addEventListener('pointerleave', handlePointerLeave);
|
|
9504
9516
|
};
|
|
9505
9517
|
|
|
@@ -9576,16 +9588,16 @@ const create$1 = async (uid, src, sandbox, csp, credentialless, permissionPolicy
|
|
|
9576
9588
|
if (title) {
|
|
9577
9589
|
$Iframe.title = title;
|
|
9578
9590
|
}
|
|
9579
|
-
set$
|
|
9591
|
+
set$3(uid, $Iframe);
|
|
9580
9592
|
// TODO make make waitForFrameToLoad a separate command
|
|
9581
9593
|
};
|
|
9582
9594
|
const loadOnly = async uid => {
|
|
9583
|
-
const $Iframe = get
|
|
9595
|
+
const $Iframe = get(uid);
|
|
9584
9596
|
const promise = waitForFrameToLoad($Iframe);
|
|
9585
9597
|
await promise;
|
|
9586
9598
|
};
|
|
9587
9599
|
const appendOnly = async uid => {
|
|
9588
|
-
const $Iframe = get
|
|
9600
|
+
const $Iframe = get(uid);
|
|
9589
9601
|
const parent = document.getElementById('Workbench');
|
|
9590
9602
|
parent.append($Iframe);
|
|
9591
9603
|
};
|
|
@@ -9594,7 +9606,7 @@ const appendOnly = async uid => {
|
|
|
9594
9606
|
* @deprecated use loadOnly and appendOnly instead
|
|
9595
9607
|
*/
|
|
9596
9608
|
const load = async uid => {
|
|
9597
|
-
const $Iframe = get
|
|
9609
|
+
const $Iframe = get(uid);
|
|
9598
9610
|
const promise = waitForFrameToLoad($Iframe);
|
|
9599
9611
|
const parent = document.getElementById('Workbench');
|
|
9600
9612
|
parent.append($Iframe);
|
|
@@ -9603,7 +9615,7 @@ const load = async uid => {
|
|
|
9603
9615
|
|
|
9604
9616
|
// TODO rename to sendMessage
|
|
9605
9617
|
const setPort = (uid, port, origin, portType) => {
|
|
9606
|
-
const $Iframe = get
|
|
9618
|
+
const $Iframe = get(uid);
|
|
9607
9619
|
// TODO use jsonrpc invoke
|
|
9608
9620
|
const {
|
|
9609
9621
|
contentWindow
|
|
@@ -9618,7 +9630,7 @@ const setPort = (uid, port, origin, portType) => {
|
|
|
9618
9630
|
}, origin, [port]);
|
|
9619
9631
|
};
|
|
9620
9632
|
const dispose$2 = uid => {
|
|
9621
|
-
const $Iframe = get
|
|
9633
|
+
const $Iframe = get(uid);
|
|
9622
9634
|
$Iframe.remove();
|
|
9623
9635
|
remove(uid);
|
|
9624
9636
|
};
|
|
@@ -9895,6 +9907,7 @@ const commandMap = {
|
|
|
9895
9907
|
'WebView.loadOnly': loadOnly,
|
|
9896
9908
|
'WebView.setPort': setPort,
|
|
9897
9909
|
'Window.close': close,
|
|
9910
|
+
'Window.handleFullScreenChange': handleFullScreenChange,
|
|
9898
9911
|
'Window.maximize': maximize,
|
|
9899
9912
|
'Window.minimize': minimize,
|
|
9900
9913
|
'Window.onVisibilityChange': onVisibilityChange,
|