@lvce-editor/renderer-process 10.31.0 → 10.33.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 +50 -55
- package/package.json +1 -1
|
@@ -271,7 +271,7 @@ let VError$1 = class VError extends Error {
|
|
|
271
271
|
}
|
|
272
272
|
};
|
|
273
273
|
|
|
274
|
-
const state$
|
|
274
|
+
const state$a = {
|
|
275
275
|
commands: Object.create(null),
|
|
276
276
|
pendingModules: Object.create(null),
|
|
277
277
|
async load(moduleId) {}
|
|
@@ -292,7 +292,7 @@ const initializeModule = module => {
|
|
|
292
292
|
};
|
|
293
293
|
const loadModule$1 = async moduleId => {
|
|
294
294
|
try {
|
|
295
|
-
const module = await state$
|
|
295
|
+
const module = await state$a.load(moduleId);
|
|
296
296
|
initializeModule(module);
|
|
297
297
|
} catch (error) {
|
|
298
298
|
if (error && error instanceof SyntaxError && error.stack === `SyntaxError: ${error.message}`) {
|
|
@@ -303,16 +303,16 @@ const loadModule$1 = async moduleId => {
|
|
|
303
303
|
}
|
|
304
304
|
};
|
|
305
305
|
const getOrLoadModule = moduleId => {
|
|
306
|
-
if (!state$
|
|
307
|
-
state$
|
|
306
|
+
if (!state$a.pendingModules[moduleId]) {
|
|
307
|
+
state$a.pendingModules[moduleId] = loadModule$1(moduleId);
|
|
308
308
|
}
|
|
309
|
-
return state$
|
|
309
|
+
return state$a.pendingModules[moduleId];
|
|
310
310
|
};
|
|
311
311
|
const loadCommand = async command => {
|
|
312
312
|
await getOrLoadModule(getModuleId(command));
|
|
313
313
|
};
|
|
314
314
|
const register = (commandId, listener) => {
|
|
315
|
-
state$
|
|
315
|
+
state$a.commands[commandId] = listener;
|
|
316
316
|
};
|
|
317
317
|
const hasThrown = new Set();
|
|
318
318
|
const executeCommandAsync = async (command, ...args) => {
|
|
@@ -321,7 +321,7 @@ const executeCommandAsync = async (command, ...args) => {
|
|
|
321
321
|
} catch (error) {
|
|
322
322
|
throw new VError$1(error, `Failed to load command ${command}`);
|
|
323
323
|
}
|
|
324
|
-
if (!(command in state$
|
|
324
|
+
if (!(command in state$a.commands)) {
|
|
325
325
|
if (hasThrown.has(command)) {
|
|
326
326
|
return;
|
|
327
327
|
}
|
|
@@ -331,8 +331,8 @@ const executeCommandAsync = async (command, ...args) => {
|
|
|
331
331
|
return execute(command, ...args);
|
|
332
332
|
};
|
|
333
333
|
const execute = (command, ...args) => {
|
|
334
|
-
if (command in state$
|
|
335
|
-
const fn = state$
|
|
334
|
+
if (command in state$a.commands) {
|
|
335
|
+
const fn = state$a.commands[command];
|
|
336
336
|
if (typeof fn !== 'function') {
|
|
337
337
|
throw new Error(`[renderer-worker] Command ${command} is not a function`);
|
|
338
338
|
}
|
|
@@ -341,7 +341,7 @@ const execute = (command, ...args) => {
|
|
|
341
341
|
return executeCommandAsync(command, ...args);
|
|
342
342
|
};
|
|
343
343
|
const setLoad = load => {
|
|
344
|
-
state$
|
|
344
|
+
state$a.load = load;
|
|
345
345
|
};
|
|
346
346
|
|
|
347
347
|
const ipcs = Object.create(null);
|
|
@@ -454,17 +454,15 @@ const create$4$1 = (method, params) => {
|
|
|
454
454
|
params
|
|
455
455
|
};
|
|
456
456
|
};
|
|
457
|
-
const
|
|
458
|
-
callbacks: Object.create(null)
|
|
459
|
-
};
|
|
457
|
+
const callbacks = Object.create(null);
|
|
460
458
|
const set$7 = (id, fn) => {
|
|
461
|
-
|
|
459
|
+
callbacks[id] = fn;
|
|
462
460
|
};
|
|
463
461
|
const get$8 = id => {
|
|
464
|
-
return
|
|
462
|
+
return callbacks[id];
|
|
465
463
|
};
|
|
466
464
|
const remove$3 = id => {
|
|
467
|
-
delete
|
|
465
|
+
delete callbacks[id];
|
|
468
466
|
};
|
|
469
467
|
let id = 0;
|
|
470
468
|
const create$3$1 = () => {
|
|
@@ -2793,11 +2791,11 @@ const setBounds$3 = (state, x, y, width, height) => {
|
|
|
2793
2791
|
const dispose$i = state => {
|
|
2794
2792
|
remove$2(state.$Viewlet);
|
|
2795
2793
|
};
|
|
2796
|
-
const Events$
|
|
2794
|
+
const Events$c = ViewletFindWidgetEvents;
|
|
2797
2795
|
|
|
2798
2796
|
const ViewletFindWidget = {
|
|
2799
2797
|
__proto__: null,
|
|
2800
|
-
Events: Events$
|
|
2798
|
+
Events: Events$c,
|
|
2801
2799
|
appendWidget,
|
|
2802
2800
|
create: create$H,
|
|
2803
2801
|
dispose: dispose$i,
|
|
@@ -2858,7 +2856,6 @@ const TitleBarIcon = 'TitleBarIcon';
|
|
|
2858
2856
|
const TitleBarMenuBar = 'TitleBarMenuBar';
|
|
2859
2857
|
const Video = 'Video';
|
|
2860
2858
|
const TitleBarTitle = 'TitleBarTitle';
|
|
2861
|
-
const About = 'About';
|
|
2862
2859
|
const EditorSourceActions = 'EditorSourceActions';
|
|
2863
2860
|
const E2eTests = 'E2eTests';
|
|
2864
2861
|
const E2eTest = 'E2eTest';
|
|
@@ -5840,8 +5837,6 @@ const load$1 = moduleId => {
|
|
|
5840
5837
|
return Promise.resolve().then(function () { return ViewletVideo; });
|
|
5841
5838
|
case TitleBarTitle:
|
|
5842
5839
|
return Promise.resolve().then(function () { return ViewletTitleBarTitle; });
|
|
5843
|
-
case About:
|
|
5844
|
-
return Promise.resolve().then(function () { return ViewletAbout; });
|
|
5845
5840
|
case EditorSourceActions:
|
|
5846
5841
|
return Promise.resolve().then(function () { return ViewletEditorSourceActions; });
|
|
5847
5842
|
case EmptyEditor:
|
|
@@ -6129,6 +6124,8 @@ const sendMultiple = commands => {
|
|
|
6129
6124
|
case 'Viewlet.focusElementByName':
|
|
6130
6125
|
// @ts-ignore
|
|
6131
6126
|
return focusElementByName(viewletId, method, ...args);
|
|
6127
|
+
case 'Viewlet.registerEventListeners':
|
|
6128
|
+
return registerEventListeners(viewletId, method, ...args);
|
|
6132
6129
|
default:
|
|
6133
6130
|
{
|
|
6134
6131
|
invoke(viewletId, method, ...args);
|
|
@@ -6292,6 +6289,8 @@ const getFn = command => {
|
|
|
6292
6289
|
return createFunctionalRoot;
|
|
6293
6290
|
case 'Viewlet.focusElementByName':
|
|
6294
6291
|
return focusElementByName;
|
|
6292
|
+
case 'Viewlet.registerEventListeners':
|
|
6293
|
+
return registerEventListeners;
|
|
6295
6294
|
default:
|
|
6296
6295
|
throw new Error(`unknown command ${command}`);
|
|
6297
6296
|
}
|
|
@@ -6299,7 +6298,6 @@ const getFn = command => {
|
|
|
6299
6298
|
const executeCommands = commands => {
|
|
6300
6299
|
for (const [command, ...args] of commands) {
|
|
6301
6300
|
const fn = getFn(command);
|
|
6302
|
-
// @ts-expect-error
|
|
6303
6301
|
fn(...args);
|
|
6304
6302
|
}
|
|
6305
6303
|
};
|
|
@@ -6611,13 +6609,17 @@ const waitForFrameToLoad = $Frame => {
|
|
|
6611
6609
|
};
|
|
6612
6610
|
|
|
6613
6611
|
// TODO could use browser view when running in electron
|
|
6614
|
-
const create$w = async (uid, src, sandbox, csp, credentialless) => {
|
|
6612
|
+
const create$w = async (uid, src, sandbox, csp, credentialless, permissionPolicy) => {
|
|
6615
6613
|
const $Iframe = document.createElement('iframe');
|
|
6616
6614
|
setIframeCredentialless($Iframe, credentialless);
|
|
6617
6615
|
setIframeCsp($Iframe, csp);
|
|
6618
6616
|
setIframeSandBox($Iframe, sandbox);
|
|
6619
6617
|
setIframeSrc($Iframe, src);
|
|
6618
|
+
// TODO set classname from iframe worker
|
|
6620
6619
|
$Iframe.className = 'E2eTestIframe WebViewIframe';
|
|
6620
|
+
if (permissionPolicy) {
|
|
6621
|
+
$Iframe.allow = permissionPolicy;
|
|
6622
|
+
}
|
|
6621
6623
|
set$1(uid, $Iframe);
|
|
6622
6624
|
// TODO make make waitForFrameToLoad a separate command
|
|
6623
6625
|
};
|
|
@@ -6727,11 +6729,11 @@ const ViewletActivityBarEvents = {
|
|
|
6727
6729
|
returnValue: returnValue$6
|
|
6728
6730
|
};
|
|
6729
6731
|
|
|
6730
|
-
const Events$
|
|
6732
|
+
const Events$b = ViewletActivityBarEvents;
|
|
6731
6733
|
|
|
6732
6734
|
const ViewletActivityBar = {
|
|
6733
6735
|
__proto__: null,
|
|
6734
|
-
Events: Events$
|
|
6736
|
+
Events: Events$b
|
|
6735
6737
|
};
|
|
6736
6738
|
|
|
6737
6739
|
const handleAudioError = event => {
|
|
@@ -6754,11 +6756,11 @@ const ViewletAudioEvents = {
|
|
|
6754
6756
|
handleAudioError
|
|
6755
6757
|
};
|
|
6756
6758
|
|
|
6757
|
-
const Events$
|
|
6759
|
+
const Events$a = ViewletAudioEvents;
|
|
6758
6760
|
|
|
6759
6761
|
const ViewletAudio = {
|
|
6760
6762
|
__proto__: null,
|
|
6761
|
-
Events: Events$
|
|
6763
|
+
Events: Events$a
|
|
6762
6764
|
};
|
|
6763
6765
|
|
|
6764
6766
|
const create$v = () => {
|
|
@@ -8156,7 +8158,7 @@ const create$i = () => {
|
|
|
8156
8158
|
$Viewlet
|
|
8157
8159
|
};
|
|
8158
8160
|
};
|
|
8159
|
-
const Events$
|
|
8161
|
+
const Events$9 = ViewletExplorerEvents;
|
|
8160
8162
|
const handleError$3 = (state, message) => {
|
|
8161
8163
|
object(state);
|
|
8162
8164
|
string(message);
|
|
@@ -8203,7 +8205,7 @@ const setDom$2 = (state, dom) => {
|
|
|
8203
8205
|
|
|
8204
8206
|
const ViewletExplorer = {
|
|
8205
8207
|
__proto__: null,
|
|
8206
|
-
Events: Events$
|
|
8208
|
+
Events: Events$9,
|
|
8207
8209
|
create: create$i,
|
|
8208
8210
|
dispose: dispose$9,
|
|
8209
8211
|
focusInput,
|
|
@@ -8247,11 +8249,11 @@ const ViewletExtensionDetailEvents = {
|
|
|
8247
8249
|
handleReadmeContextMenu
|
|
8248
8250
|
};
|
|
8249
8251
|
|
|
8250
|
-
const Events$
|
|
8252
|
+
const Events$8 = ViewletExtensionDetailEvents;
|
|
8251
8253
|
|
|
8252
8254
|
const ViewletExtensionDetail = {
|
|
8253
8255
|
__proto__: null,
|
|
8254
|
-
Events: Events$
|
|
8256
|
+
Events: Events$8,
|
|
8255
8257
|
setSize
|
|
8256
8258
|
};
|
|
8257
8259
|
|
|
@@ -8531,7 +8533,7 @@ const ViewletLocationsEvents = {
|
|
|
8531
8533
|
handleLocationsMouseDown
|
|
8532
8534
|
};
|
|
8533
8535
|
|
|
8534
|
-
const Events$
|
|
8536
|
+
const Events$7 = ViewletLocationsEvents;
|
|
8535
8537
|
const setFocusedIndex$3 = (state, oldFocusedIndex, newFocusedIndex) => {
|
|
8536
8538
|
const {
|
|
8537
8539
|
$Viewlet
|
|
@@ -8566,7 +8568,7 @@ const focus$b = state => {
|
|
|
8566
8568
|
|
|
8567
8569
|
const ViewletImplementations = {
|
|
8568
8570
|
__proto__: null,
|
|
8569
|
-
Events: Events$
|
|
8571
|
+
Events: Events$7,
|
|
8570
8572
|
focus: focus$b,
|
|
8571
8573
|
handleError: handleError$1,
|
|
8572
8574
|
setFocusedIndex: setFocusedIndex$3
|
|
@@ -8677,11 +8679,11 @@ const setColumnWidths = (state, columnWidth1, columnWidth2, columnWidth3) => {
|
|
|
8677
8679
|
$Resizer1.style.left = `${paddingLeft + columnWidth1}px`;
|
|
8678
8680
|
$Resizer2.style.left = `${paddingLeft + columnWidth1 + columnWidth2}px`;
|
|
8679
8681
|
};
|
|
8680
|
-
const Events$
|
|
8682
|
+
const Events$6 = ViewletkeyBindingsEvents;
|
|
8681
8683
|
|
|
8682
8684
|
const ViewletKeyBindings = {
|
|
8683
8685
|
__proto__: null,
|
|
8684
|
-
Events: Events$
|
|
8686
|
+
Events: Events$6,
|
|
8685
8687
|
setColumnWidths,
|
|
8686
8688
|
setScrollBar: setScrollBar$2,
|
|
8687
8689
|
setSize,
|
|
@@ -10054,7 +10056,7 @@ const ViewletQuickPick = {
|
|
|
10054
10056
|
|
|
10055
10057
|
const ViewletReferences = {
|
|
10056
10058
|
__proto__: null,
|
|
10057
|
-
Events: Events$
|
|
10059
|
+
Events: Events$7,
|
|
10058
10060
|
focus: focus$b,
|
|
10059
10061
|
handleError: handleError$1,
|
|
10060
10062
|
setFocusedIndex: setFocusedIndex$3
|
|
@@ -10440,11 +10442,11 @@ const setFocus = (state, selector) => {
|
|
|
10440
10442
|
}
|
|
10441
10443
|
};
|
|
10442
10444
|
const dispose$3 = () => {};
|
|
10443
|
-
const Events$
|
|
10445
|
+
const Events$5 = ViewletSearchEvents;
|
|
10444
10446
|
|
|
10445
10447
|
const ViewletSearch = {
|
|
10446
10448
|
__proto__: null,
|
|
10447
|
-
Events: Events$
|
|
10449
|
+
Events: Events$5,
|
|
10448
10450
|
dispose: dispose$3,
|
|
10449
10451
|
focus: focus$5,
|
|
10450
10452
|
setFocus,
|
|
@@ -10775,11 +10777,11 @@ const ViewletStorageEvents = {
|
|
|
10775
10777
|
handleClick: handleClick$1
|
|
10776
10778
|
};
|
|
10777
10779
|
|
|
10778
|
-
const Events$
|
|
10780
|
+
const Events$4 = ViewletStorageEvents;
|
|
10779
10781
|
|
|
10780
10782
|
const ViewletStorage = {
|
|
10781
10783
|
__proto__: null,
|
|
10782
|
-
Events: Events$
|
|
10784
|
+
Events: Events$4
|
|
10783
10785
|
};
|
|
10784
10786
|
|
|
10785
10787
|
const isUint8Array = value => {
|
|
@@ -11090,18 +11092,18 @@ const ViewletTitleBarButtonEvents = {
|
|
|
11090
11092
|
returnValue: returnValue$3
|
|
11091
11093
|
};
|
|
11092
11094
|
|
|
11093
|
-
const Events$
|
|
11095
|
+
const Events$3 = ViewletTitleBarButtonEvents;
|
|
11094
11096
|
|
|
11095
11097
|
const ViewletTitleBarButtons = {
|
|
11096
11098
|
__proto__: null,
|
|
11097
|
-
Events: Events$
|
|
11099
|
+
Events: Events$3
|
|
11098
11100
|
};
|
|
11099
11101
|
|
|
11100
|
-
const Events$
|
|
11102
|
+
const Events$2 = {};
|
|
11101
11103
|
|
|
11102
11104
|
const ViewletTitleBarIcon = {
|
|
11103
11105
|
__proto__: null,
|
|
11104
|
-
Events: Events$
|
|
11106
|
+
Events: Events$2
|
|
11105
11107
|
};
|
|
11106
11108
|
|
|
11107
11109
|
const isInsideTitleBarMenu = $Element => {
|
|
@@ -11433,11 +11435,11 @@ const setMenus = (state, changes, uid) => {
|
|
|
11433
11435
|
}
|
|
11434
11436
|
}
|
|
11435
11437
|
};
|
|
11436
|
-
const Events$
|
|
11438
|
+
const Events$1 = ViewletTitleBarMenuBarEvents;
|
|
11437
11439
|
|
|
11438
11440
|
const ViewletTitleBarMenuBar = {
|
|
11439
11441
|
__proto__: null,
|
|
11440
|
-
Events: Events$
|
|
11442
|
+
Events: Events$1,
|
|
11441
11443
|
closeMenu,
|
|
11442
11444
|
dispose,
|
|
11443
11445
|
focus,
|
|
@@ -11469,11 +11471,11 @@ const ViewletVideoEvents = {
|
|
|
11469
11471
|
handleVideoError
|
|
11470
11472
|
};
|
|
11471
11473
|
|
|
11472
|
-
const Events
|
|
11474
|
+
const Events = ViewletVideoEvents;
|
|
11473
11475
|
|
|
11474
11476
|
const ViewletVideo = {
|
|
11475
11477
|
__proto__: null,
|
|
11476
|
-
Events
|
|
11478
|
+
Events
|
|
11477
11479
|
};
|
|
11478
11480
|
|
|
11479
11481
|
const create$2 = () => {
|
|
@@ -11496,13 +11498,6 @@ const ViewletTitleBarTitle = {
|
|
|
11496
11498
|
setDom
|
|
11497
11499
|
};
|
|
11498
11500
|
|
|
11499
|
-
const Events = {};
|
|
11500
|
-
|
|
11501
|
-
const ViewletAbout = {
|
|
11502
|
-
__proto__: null,
|
|
11503
|
-
Events
|
|
11504
|
-
};
|
|
11505
|
-
|
|
11506
11501
|
const create$1 = () => {
|
|
11507
11502
|
const $Viewlet = document.createElement('div');
|
|
11508
11503
|
$Viewlet.className = 'Viewlet EmptyEditor';
|