@lvce-editor/renderer-process 27.0.0 → 28.0.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 +74 -33
- package/package.json +1 -1
|
@@ -1866,9 +1866,17 @@ const hydrate$4 = () => {
|
|
|
1866
1866
|
|
|
1867
1867
|
const shouldLaunchMultipleWorkers = true;
|
|
1868
1868
|
|
|
1869
|
+
const getConfig = () => {
|
|
1870
|
+
const configElement = document.getElementById('Config');
|
|
1871
|
+
if (!configElement?.textContent) {
|
|
1872
|
+
return {};
|
|
1873
|
+
}
|
|
1874
|
+
return JSON.parse(configElement.textContent);
|
|
1875
|
+
};
|
|
1869
1876
|
const getInitData = () => {
|
|
1870
1877
|
const initData = {
|
|
1871
1878
|
Config: {
|
|
1879
|
+
...getConfig(),
|
|
1872
1880
|
shouldLaunchMultipleWorkers: shouldLaunchMultipleWorkers
|
|
1873
1881
|
},
|
|
1874
1882
|
Layout: {
|
|
@@ -5544,7 +5552,7 @@ const ViewletE2eTestEvents = {
|
|
|
5544
5552
|
};
|
|
5545
5553
|
|
|
5546
5554
|
// TODO could use browser view when running in electron
|
|
5547
|
-
const setIframe$
|
|
5555
|
+
const setIframe$3 = (state, src, sandbox = []) => {
|
|
5548
5556
|
if (!src) {
|
|
5549
5557
|
return;
|
|
5550
5558
|
}
|
|
@@ -5587,7 +5595,7 @@ const setPreviewTransform = (state, transform) => {
|
|
|
5587
5595
|
const ViewletE2eTest = {
|
|
5588
5596
|
__proto__: null,
|
|
5589
5597
|
Events: ViewletE2eTestEvents,
|
|
5590
|
-
setIframe: setIframe$
|
|
5598
|
+
setIframe: setIframe$3,
|
|
5591
5599
|
setPreviewTransform
|
|
5592
5600
|
};
|
|
5593
5601
|
|
|
@@ -5635,7 +5643,7 @@ const handleLoad$1 = event => {
|
|
|
5635
5643
|
console.log(event.target.src);
|
|
5636
5644
|
send('E2eTests.handleLoad');
|
|
5637
5645
|
};
|
|
5638
|
-
const setIframe$
|
|
5646
|
+
const setIframe$2 = (state, src, sandbox = []) => {
|
|
5639
5647
|
if (!src) {
|
|
5640
5648
|
return;
|
|
5641
5649
|
}
|
|
@@ -5676,7 +5684,7 @@ const setPort$2 = (state, portId, origin) => {
|
|
|
5676
5684
|
const ViewletE2eTests = {
|
|
5677
5685
|
__proto__: null,
|
|
5678
5686
|
Events: ViewletE2eTestsEvents,
|
|
5679
|
-
setIframe: setIframe$
|
|
5687
|
+
setIframe: setIframe$2,
|
|
5680
5688
|
setPort: setPort$2
|
|
5681
5689
|
};
|
|
5682
5690
|
|
|
@@ -6411,6 +6419,66 @@ const ViewletError = {
|
|
|
6411
6419
|
setMessage: setMessage$1
|
|
6412
6420
|
};
|
|
6413
6421
|
|
|
6422
|
+
const commandMap$1 = {};
|
|
6423
|
+
|
|
6424
|
+
const ViewletExtensionViewEvents = {
|
|
6425
|
+
__proto__: null,
|
|
6426
|
+
commandMap: commandMap$1
|
|
6427
|
+
};
|
|
6428
|
+
|
|
6429
|
+
const setIframeCredentialless = ($Iframe, credentialless) => {
|
|
6430
|
+
if (credentialless) {
|
|
6431
|
+
// @ts-ignore
|
|
6432
|
+
$Iframe.credentialless = credentialless;
|
|
6433
|
+
}
|
|
6434
|
+
};
|
|
6435
|
+
|
|
6436
|
+
const setIframeCsp = ($Iframe, csp) => {
|
|
6437
|
+
if (csp) {
|
|
6438
|
+
// @ts-ignore
|
|
6439
|
+
$Iframe.csp = csp;
|
|
6440
|
+
}
|
|
6441
|
+
};
|
|
6442
|
+
|
|
6443
|
+
const setIframeSandBox = ($Iframe, sandbox) => {
|
|
6444
|
+
if (sandbox.length === 0) {
|
|
6445
|
+
return;
|
|
6446
|
+
}
|
|
6447
|
+
$Iframe.sandbox.add(...sandbox);
|
|
6448
|
+
};
|
|
6449
|
+
|
|
6450
|
+
const setIframeSrc = ($Iframe, src, srcDoc = '') => {
|
|
6451
|
+
if (src) {
|
|
6452
|
+
$Iframe.src = src;
|
|
6453
|
+
} else if (srcDoc) {
|
|
6454
|
+
$Iframe.srcdoc = srcDoc;
|
|
6455
|
+
}
|
|
6456
|
+
};
|
|
6457
|
+
|
|
6458
|
+
const setIframe$1 = (state, src, sandbox = [], srcDoc = '', csp = '', credentialless = true, title = '') => {
|
|
6459
|
+
if (!src && !srcDoc) {
|
|
6460
|
+
return;
|
|
6461
|
+
}
|
|
6462
|
+
const {
|
|
6463
|
+
$Viewlet
|
|
6464
|
+
} = state;
|
|
6465
|
+
$Viewlet.textContent = '';
|
|
6466
|
+
const $Iframe = document.createElement('iframe');
|
|
6467
|
+
$Iframe.className = 'ExtensionViewIframe';
|
|
6468
|
+
$Iframe.title = title;
|
|
6469
|
+
setIframeCredentialless($Iframe, credentialless);
|
|
6470
|
+
setIframeCsp($Iframe, csp);
|
|
6471
|
+
setIframeSandBox($Iframe, sandbox);
|
|
6472
|
+
setIframeSrc($Iframe, src, srcDoc);
|
|
6473
|
+
$Viewlet.append($Iframe);
|
|
6474
|
+
};
|
|
6475
|
+
|
|
6476
|
+
const ViewletExtensionView = {
|
|
6477
|
+
__proto__: null,
|
|
6478
|
+
Events: ViewletExtensionViewEvents,
|
|
6479
|
+
setIframe: setIframe$1
|
|
6480
|
+
};
|
|
6481
|
+
|
|
6414
6482
|
const handleInput$4 = event => {
|
|
6415
6483
|
const {
|
|
6416
6484
|
target
|
|
@@ -6933,6 +7001,7 @@ const EditorPlainText = 'EditorPlainText';
|
|
|
6933
7001
|
const EditorWidgetError = 'EditorWidgetError';
|
|
6934
7002
|
const Empty = 'Empty';
|
|
6935
7003
|
const Error$1 = 'Error';
|
|
7004
|
+
const ExtensionView = 'ExtensionView';
|
|
6936
7005
|
const FindWidget = 'FindWidget';
|
|
6937
7006
|
const ImagePreview = 'ImagePreview';
|
|
6938
7007
|
const InlineDiffEditor = 'InlineDiffEditor';
|
|
@@ -8093,35 +8162,6 @@ const ViewletWebViewEvents = {
|
|
|
8093
8162
|
returnValue
|
|
8094
8163
|
};
|
|
8095
8164
|
|
|
8096
|
-
const setIframeCredentialless = ($Iframe, credentialless) => {
|
|
8097
|
-
if (credentialless) {
|
|
8098
|
-
// @ts-ignore
|
|
8099
|
-
$Iframe.credentialless = credentialless;
|
|
8100
|
-
}
|
|
8101
|
-
};
|
|
8102
|
-
|
|
8103
|
-
const setIframeCsp = ($Iframe, csp) => {
|
|
8104
|
-
if (csp) {
|
|
8105
|
-
// @ts-ignore
|
|
8106
|
-
$Iframe.csp = csp;
|
|
8107
|
-
}
|
|
8108
|
-
};
|
|
8109
|
-
|
|
8110
|
-
const setIframeSandBox = ($Iframe, sandbox) => {
|
|
8111
|
-
if (sandbox.length === 0) {
|
|
8112
|
-
return;
|
|
8113
|
-
}
|
|
8114
|
-
$Iframe.sandbox.add(...sandbox);
|
|
8115
|
-
};
|
|
8116
|
-
|
|
8117
|
-
const setIframeSrc = ($Iframe, src, srcDoc = '') => {
|
|
8118
|
-
if (src) {
|
|
8119
|
-
$Iframe.src = src;
|
|
8120
|
-
} else if (srcDoc) {
|
|
8121
|
-
$Iframe.srcdoc = srcDoc;
|
|
8122
|
-
}
|
|
8123
|
-
};
|
|
8124
|
-
|
|
8125
8165
|
// TODO could use browser view when running in electron
|
|
8126
8166
|
const setIframe = (state, src, sandbox = [], srcDoc = '', csp = '', credentialless = true) => {
|
|
8127
8167
|
if (!src && !srcDoc) {
|
|
@@ -8206,6 +8246,7 @@ const moduleLoaders = {
|
|
|
8206
8246
|
[Empty]: () => ViewletEmpty,
|
|
8207
8247
|
[EmptyEditor]: () => ViewletEmptyEditor,
|
|
8208
8248
|
[Error$1]: () => ViewletError,
|
|
8249
|
+
[ExtensionView]: () => ViewletExtensionView,
|
|
8209
8250
|
[FindWidget]: () => ViewletFindWidget,
|
|
8210
8251
|
[ImagePreview]: () => ImagePreview$1,
|
|
8211
8252
|
[Implementations]: () => ViewletImplementations,
|