@lvce-editor/renderer-process 6.6.0 → 6.7.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 +36 -42
- package/package.json +1 -1
|
@@ -11156,7 +11156,7 @@ const handleClickAt$1 = event => {
|
|
|
11156
11156
|
} = event;
|
|
11157
11157
|
return ['handleClickAt', clientX, clientY];
|
|
11158
11158
|
};
|
|
11159
|
-
const handleLoad$
|
|
11159
|
+
const handleLoad$2 = event => {
|
|
11160
11160
|
return ['handleLoad'];
|
|
11161
11161
|
};
|
|
11162
11162
|
const handleContextMenu$1 = event => {
|
|
@@ -11174,7 +11174,7 @@ const ViewletE2eTestsEvents = {
|
|
|
11174
11174
|
__proto__: null,
|
|
11175
11175
|
handleClickAt: handleClickAt$1,
|
|
11176
11176
|
handleContextMenu: handleContextMenu$1,
|
|
11177
|
-
handleLoad: handleLoad$
|
|
11177
|
+
handleLoad: handleLoad$2,
|
|
11178
11178
|
returnValue: returnValue$1
|
|
11179
11179
|
};
|
|
11180
11180
|
|
|
@@ -11187,7 +11187,7 @@ const sendToIframe = (contentWindow, message, origin, transfer) => {
|
|
|
11187
11187
|
}
|
|
11188
11188
|
};
|
|
11189
11189
|
|
|
11190
|
-
const handleLoad$
|
|
11190
|
+
const handleLoad$1 = event => {
|
|
11191
11191
|
console.log(event.target.src);
|
|
11192
11192
|
send('E2eTests.handleLoad');
|
|
11193
11193
|
};
|
|
@@ -11208,12 +11208,12 @@ const setIframe$1 = (state, src, sandbox = []) => {
|
|
|
11208
11208
|
console.log({
|
|
11209
11209
|
src
|
|
11210
11210
|
});
|
|
11211
|
-
$Iframe.addEventListener('load', handleLoad$
|
|
11211
|
+
$Iframe.addEventListener('load', handleLoad$1, {
|
|
11212
11212
|
once: true
|
|
11213
11213
|
});
|
|
11214
11214
|
document.body.append($Iframe);
|
|
11215
11215
|
};
|
|
11216
|
-
const setPort
|
|
11216
|
+
const setPort = (state, portId, origin) => {
|
|
11217
11217
|
const $ExistingIframe = document.querySelector('.E2eTestsIframe');
|
|
11218
11218
|
if (!$ExistingIframe) {
|
|
11219
11219
|
throw new Error('no iframe found');
|
|
@@ -11236,7 +11236,7 @@ const ViewletE2eTests = {
|
|
|
11236
11236
|
__proto__: null,
|
|
11237
11237
|
Events: ViewletE2eTestsEvents,
|
|
11238
11238
|
setIframe: setIframe$1,
|
|
11239
|
-
setPort
|
|
11239
|
+
setPort
|
|
11240
11240
|
};
|
|
11241
11241
|
|
|
11242
11242
|
const handleClickAt = event => {
|
|
@@ -11246,7 +11246,7 @@ const handleClickAt = event => {
|
|
|
11246
11246
|
} = event;
|
|
11247
11247
|
return ['handleClickAt', clientX, clientY];
|
|
11248
11248
|
};
|
|
11249
|
-
const handleLoad
|
|
11249
|
+
const handleLoad = event => {
|
|
11250
11250
|
return ['handleLoad'];
|
|
11251
11251
|
};
|
|
11252
11252
|
const handleContextMenu = event => {
|
|
@@ -11264,62 +11264,56 @@ const ViewletE2eTestEvents = {
|
|
|
11264
11264
|
__proto__: null,
|
|
11265
11265
|
handleClickAt,
|
|
11266
11266
|
handleContextMenu,
|
|
11267
|
-
handleLoad
|
|
11267
|
+
handleLoad,
|
|
11268
11268
|
returnValue
|
|
11269
11269
|
};
|
|
11270
11270
|
|
|
11271
|
-
const handleLoad = event => {
|
|
11272
|
-
console.log(event.target.src);
|
|
11273
|
-
send('E2eTests.handleLoad');
|
|
11274
|
-
};
|
|
11275
|
-
|
|
11276
11271
|
// TODO could use browser view when running in electron
|
|
11277
11272
|
const setIframe = (state, src, sandbox = []) => {
|
|
11278
11273
|
if (!src) {
|
|
11279
11274
|
return;
|
|
11280
11275
|
}
|
|
11281
|
-
const
|
|
11282
|
-
|
|
11283
|
-
|
|
11284
|
-
|
|
11276
|
+
const {
|
|
11277
|
+
$Viewlet
|
|
11278
|
+
} = state;
|
|
11279
|
+
const $Parent = $Viewlet.querySelector('.E2eTestIframeWrapper');
|
|
11285
11280
|
const $Iframe = document.createElement('iframe');
|
|
11286
11281
|
for (const element of sandbox) {
|
|
11287
11282
|
$Iframe.sandbox.add(element);
|
|
11288
11283
|
}
|
|
11289
|
-
$Iframe.className = '
|
|
11284
|
+
$Iframe.className = 'E2eTestIframe';
|
|
11290
11285
|
$Iframe.src = src;
|
|
11291
|
-
|
|
11292
|
-
src
|
|
11293
|
-
});
|
|
11294
|
-
$Iframe.addEventListener('load', handleLoad, {
|
|
11295
|
-
once: true
|
|
11296
|
-
});
|
|
11297
|
-
document.body.append($Iframe);
|
|
11286
|
+
$Parent.append($Iframe);
|
|
11298
11287
|
};
|
|
11299
|
-
const
|
|
11300
|
-
const $ExistingIframe = document.querySelector('.E2eTestsIframe');
|
|
11301
|
-
if (!$ExistingIframe) {
|
|
11302
|
-
throw new Error('no iframe found');
|
|
11303
|
-
}
|
|
11304
|
-
const port = acquire(portId);
|
|
11305
|
-
// @ts-ignore
|
|
11288
|
+
const setPreviewTransform = (state, transform) => {
|
|
11306
11289
|
const {
|
|
11307
|
-
|
|
11308
|
-
} =
|
|
11309
|
-
const
|
|
11310
|
-
|
|
11311
|
-
method: 'handleIpc',
|
|
11312
|
-
params: [port]
|
|
11313
|
-
};
|
|
11314
|
-
const transfer = [port];
|
|
11315
|
-
sendToIframe(contentWindow, message, origin, transfer);
|
|
11290
|
+
$Viewlet
|
|
11291
|
+
} = state;
|
|
11292
|
+
const $Parent = $Viewlet.querySelector('.E2eTestIframeWrapper');
|
|
11293
|
+
$Parent.style.transform = transform;
|
|
11316
11294
|
};
|
|
11295
|
+
// export const setPort = (state, portId, origin) => {
|
|
11296
|
+
// const $ExistingIframe = document.querySelector('.E2eTestsIframe')
|
|
11297
|
+
// if (!$ExistingIframe) {
|
|
11298
|
+
// throw new Error('no iframe found')
|
|
11299
|
+
// }
|
|
11300
|
+
// const port = Transferrable.acquire(portId)
|
|
11301
|
+
// // @ts-ignore
|
|
11302
|
+
// const { contentWindow } = $ExistingIframe
|
|
11303
|
+
// const message = {
|
|
11304
|
+
// jsonrpc: '2.0',
|
|
11305
|
+
// method: 'handleIpc',
|
|
11306
|
+
// params: [port],
|
|
11307
|
+
// }
|
|
11308
|
+
// const transfer = [port]
|
|
11309
|
+
// SendToIframe.sendToIframe(contentWindow, message, origin, transfer)
|
|
11310
|
+
// }
|
|
11317
11311
|
|
|
11318
11312
|
const ViewletE2eTest = {
|
|
11319
11313
|
__proto__: null,
|
|
11320
11314
|
Events: ViewletE2eTestEvents,
|
|
11321
11315
|
setIframe,
|
|
11322
|
-
|
|
11316
|
+
setPreviewTransform
|
|
11323
11317
|
};
|
|
11324
11318
|
|
|
11325
11319
|
const getWorkerDisplayName = name => {
|