@lvce-editor/renderer-process 10.32.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 +19 -17
- 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 = () => {
|
|
@@ -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
|
};
|