@lvce-editor/renderer-process 6.6.0 → 6.8.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 +66 -51
- package/package.json +1 -1
|
@@ -8324,6 +8324,16 @@ const ViewletKeyBindings = {
|
|
|
8324
8324
|
setValue: setValue$2
|
|
8325
8325
|
};
|
|
8326
8326
|
|
|
8327
|
+
const getSashId = $Target => {
|
|
8328
|
+
if ($Target.id === 'SashPanel') {
|
|
8329
|
+
return 'Panel';
|
|
8330
|
+
}
|
|
8331
|
+
if ($Target.id === 'SashSideBar') {
|
|
8332
|
+
return 'SideBar';
|
|
8333
|
+
}
|
|
8334
|
+
return '';
|
|
8335
|
+
};
|
|
8336
|
+
|
|
8327
8337
|
const Backspace$1 = 'Backspace';
|
|
8328
8338
|
const Tab$1 = 'Tab';
|
|
8329
8339
|
const Space$1 = ' ';
|
|
@@ -8756,15 +8766,6 @@ const handleBlur$4 = () => {
|
|
|
8756
8766
|
send('Layout.handleBlur');
|
|
8757
8767
|
};
|
|
8758
8768
|
|
|
8759
|
-
const getSashId = $Target => {
|
|
8760
|
-
if ($Target.id === 'SashPanel') {
|
|
8761
|
-
return 'Panel';
|
|
8762
|
-
}
|
|
8763
|
-
if ($Target.id === 'SashSideBar') {
|
|
8764
|
-
return 'SideBar';
|
|
8765
|
-
}
|
|
8766
|
-
return '';
|
|
8767
|
-
};
|
|
8768
8769
|
const handleSashPointerMove = event => {
|
|
8769
8770
|
const {
|
|
8770
8771
|
clientX,
|
|
@@ -11156,7 +11157,7 @@ const handleClickAt$1 = event => {
|
|
|
11156
11157
|
} = event;
|
|
11157
11158
|
return ['handleClickAt', clientX, clientY];
|
|
11158
11159
|
};
|
|
11159
|
-
const handleLoad$
|
|
11160
|
+
const handleLoad$2 = event => {
|
|
11160
11161
|
return ['handleLoad'];
|
|
11161
11162
|
};
|
|
11162
11163
|
const handleContextMenu$1 = event => {
|
|
@@ -11174,7 +11175,7 @@ const ViewletE2eTestsEvents = {
|
|
|
11174
11175
|
__proto__: null,
|
|
11175
11176
|
handleClickAt: handleClickAt$1,
|
|
11176
11177
|
handleContextMenu: handleContextMenu$1,
|
|
11177
|
-
handleLoad: handleLoad$
|
|
11178
|
+
handleLoad: handleLoad$2,
|
|
11178
11179
|
returnValue: returnValue$1
|
|
11179
11180
|
};
|
|
11180
11181
|
|
|
@@ -11187,7 +11188,7 @@ const sendToIframe = (contentWindow, message, origin, transfer) => {
|
|
|
11187
11188
|
}
|
|
11188
11189
|
};
|
|
11189
11190
|
|
|
11190
|
-
const handleLoad$
|
|
11191
|
+
const handleLoad$1 = event => {
|
|
11191
11192
|
console.log(event.target.src);
|
|
11192
11193
|
send('E2eTests.handleLoad');
|
|
11193
11194
|
};
|
|
@@ -11208,12 +11209,12 @@ const setIframe$1 = (state, src, sandbox = []) => {
|
|
|
11208
11209
|
console.log({
|
|
11209
11210
|
src
|
|
11210
11211
|
});
|
|
11211
|
-
$Iframe.addEventListener('load', handleLoad$
|
|
11212
|
+
$Iframe.addEventListener('load', handleLoad$1, {
|
|
11212
11213
|
once: true
|
|
11213
11214
|
});
|
|
11214
11215
|
document.body.append($Iframe);
|
|
11215
11216
|
};
|
|
11216
|
-
const setPort
|
|
11217
|
+
const setPort = (state, portId, origin) => {
|
|
11217
11218
|
const $ExistingIframe = document.querySelector('.E2eTestsIframe');
|
|
11218
11219
|
if (!$ExistingIframe) {
|
|
11219
11220
|
throw new Error('no iframe found');
|
|
@@ -11236,7 +11237,7 @@ const ViewletE2eTests = {
|
|
|
11236
11237
|
__proto__: null,
|
|
11237
11238
|
Events: ViewletE2eTestsEvents,
|
|
11238
11239
|
setIframe: setIframe$1,
|
|
11239
|
-
setPort
|
|
11240
|
+
setPort
|
|
11240
11241
|
};
|
|
11241
11242
|
|
|
11242
11243
|
const handleClickAt = event => {
|
|
@@ -11246,7 +11247,7 @@ const handleClickAt = event => {
|
|
|
11246
11247
|
} = event;
|
|
11247
11248
|
return ['handleClickAt', clientX, clientY];
|
|
11248
11249
|
};
|
|
11249
|
-
const handleLoad
|
|
11250
|
+
const handleLoad = event => {
|
|
11250
11251
|
return ['handleLoad'];
|
|
11251
11252
|
};
|
|
11252
11253
|
const handleContextMenu = event => {
|
|
@@ -11258,68 +11259,82 @@ const handleContextMenu = event => {
|
|
|
11258
11259
|
} = event;
|
|
11259
11260
|
return ['handleContextMenu', button, clientX, clientY];
|
|
11260
11261
|
};
|
|
11262
|
+
const handleSashCornerPointerDown = create$v(event => {
|
|
11263
|
+
const {
|
|
11264
|
+
clientX,
|
|
11265
|
+
clientY
|
|
11266
|
+
} = event;
|
|
11267
|
+
return ['handleSashCornerPointerDown', clientX, clientY];
|
|
11268
|
+
}, event => {
|
|
11269
|
+
const {
|
|
11270
|
+
clientX,
|
|
11271
|
+
clientY
|
|
11272
|
+
} = event;
|
|
11273
|
+
return ['handleSashCornerPointerMove', clientX, clientY];
|
|
11274
|
+
}, event => {
|
|
11275
|
+
const {
|
|
11276
|
+
clientX,
|
|
11277
|
+
clientY
|
|
11278
|
+
} = event;
|
|
11279
|
+
return ['handleSashCornerPointerUp', clientX, clientY];
|
|
11280
|
+
});
|
|
11261
11281
|
const returnValue = true;
|
|
11262
11282
|
|
|
11263
11283
|
const ViewletE2eTestEvents = {
|
|
11264
11284
|
__proto__: null,
|
|
11265
11285
|
handleClickAt,
|
|
11266
11286
|
handleContextMenu,
|
|
11267
|
-
handleLoad
|
|
11287
|
+
handleLoad,
|
|
11288
|
+
handleSashCornerPointerDown,
|
|
11268
11289
|
returnValue
|
|
11269
11290
|
};
|
|
11270
11291
|
|
|
11271
|
-
const handleLoad = event => {
|
|
11272
|
-
console.log(event.target.src);
|
|
11273
|
-
send('E2eTests.handleLoad');
|
|
11274
|
-
};
|
|
11275
|
-
|
|
11276
11292
|
// TODO could use browser view when running in electron
|
|
11277
11293
|
const setIframe = (state, src, sandbox = []) => {
|
|
11278
11294
|
if (!src) {
|
|
11279
11295
|
return;
|
|
11280
11296
|
}
|
|
11281
|
-
const
|
|
11282
|
-
|
|
11283
|
-
|
|
11284
|
-
|
|
11297
|
+
const {
|
|
11298
|
+
$Viewlet
|
|
11299
|
+
} = state;
|
|
11300
|
+
const $Parent = $Viewlet.querySelector('.E2eTestIframeWrapper');
|
|
11285
11301
|
const $Iframe = document.createElement('iframe');
|
|
11286
11302
|
for (const element of sandbox) {
|
|
11287
11303
|
$Iframe.sandbox.add(element);
|
|
11288
11304
|
}
|
|
11289
|
-
$Iframe.className = '
|
|
11305
|
+
$Iframe.className = 'E2eTestIframe';
|
|
11290
11306
|
$Iframe.src = src;
|
|
11291
|
-
|
|
11292
|
-
src
|
|
11293
|
-
});
|
|
11294
|
-
$Iframe.addEventListener('load', handleLoad, {
|
|
11295
|
-
once: true
|
|
11296
|
-
});
|
|
11297
|
-
document.body.append($Iframe);
|
|
11307
|
+
$Parent.append($Iframe);
|
|
11298
11308
|
};
|
|
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
|
|
11309
|
+
const setPreviewTransform = (state, transform) => {
|
|
11306
11310
|
const {
|
|
11307
|
-
|
|
11308
|
-
} =
|
|
11309
|
-
const
|
|
11310
|
-
|
|
11311
|
-
method: 'handleIpc',
|
|
11312
|
-
params: [port]
|
|
11313
|
-
};
|
|
11314
|
-
const transfer = [port];
|
|
11315
|
-
sendToIframe(contentWindow, message, origin, transfer);
|
|
11311
|
+
$Viewlet
|
|
11312
|
+
} = state;
|
|
11313
|
+
const $Parent = $Viewlet.querySelector('.E2eTestIframeWrapper');
|
|
11314
|
+
$Parent.style.transform = transform;
|
|
11316
11315
|
};
|
|
11316
|
+
// export const setPort = (state, portId, origin) => {
|
|
11317
|
+
// const $ExistingIframe = document.querySelector('.E2eTestsIframe')
|
|
11318
|
+
// if (!$ExistingIframe) {
|
|
11319
|
+
// throw new Error('no iframe found')
|
|
11320
|
+
// }
|
|
11321
|
+
// const port = Transferrable.acquire(portId)
|
|
11322
|
+
// // @ts-ignore
|
|
11323
|
+
// const { contentWindow } = $ExistingIframe
|
|
11324
|
+
// const message = {
|
|
11325
|
+
// jsonrpc: '2.0',
|
|
11326
|
+
// method: 'handleIpc',
|
|
11327
|
+
// params: [port],
|
|
11328
|
+
// }
|
|
11329
|
+
// const transfer = [port]
|
|
11330
|
+
// SendToIframe.sendToIframe(contentWindow, message, origin, transfer)
|
|
11331
|
+
// }
|
|
11317
11332
|
|
|
11318
11333
|
const ViewletE2eTest = {
|
|
11319
11334
|
__proto__: null,
|
|
11320
11335
|
Events: ViewletE2eTestEvents,
|
|
11321
11336
|
setIframe,
|
|
11322
|
-
|
|
11337
|
+
setPreviewTransform
|
|
11323
11338
|
};
|
|
11324
11339
|
|
|
11325
11340
|
const getWorkerDisplayName = name => {
|