@lvce-editor/renderer-process 13.10.0 → 13.12.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 +49 -3
- package/package.json +1 -1
|
@@ -62,6 +62,8 @@ const getModuleId = commandId => {
|
|
|
62
62
|
case 'ClipBoard.readText':
|
|
63
63
|
case 'ClipBoard.writeImage':
|
|
64
64
|
case 'ClipBoard.writeText':
|
|
65
|
+
case 'ClipBoard.write':
|
|
66
|
+
case 'ClipBoard.read':
|
|
65
67
|
return ClipBoard;
|
|
66
68
|
case 'FileHandles.get':
|
|
67
69
|
return FileHandles;
|
|
@@ -4297,10 +4299,38 @@ const Audio_ipc = {
|
|
|
4297
4299
|
const readText = async () => {
|
|
4298
4300
|
return navigator.clipboard.readText();
|
|
4299
4301
|
};
|
|
4302
|
+
const normalizeItems = async items => {
|
|
4303
|
+
const normalized = [];
|
|
4304
|
+
for (const clipboardItem of items) {
|
|
4305
|
+
for (const type of clipboardItem.types) {
|
|
4306
|
+
if (!type.startsWith('web ')) {
|
|
4307
|
+
continue;
|
|
4308
|
+
}
|
|
4309
|
+
const blob = await clipboardItem.getType(type);
|
|
4310
|
+
normalized.push({
|
|
4311
|
+
blob,
|
|
4312
|
+
type
|
|
4313
|
+
});
|
|
4314
|
+
}
|
|
4315
|
+
}
|
|
4316
|
+
return normalized;
|
|
4317
|
+
};
|
|
4318
|
+
const read = async () => {
|
|
4319
|
+
const items = await navigator.clipboard.read();
|
|
4320
|
+
const normalized = normalizeItems(items);
|
|
4321
|
+
return normalized;
|
|
4322
|
+
};
|
|
4300
4323
|
const writeText = async text => {
|
|
4301
4324
|
string(text);
|
|
4302
4325
|
await navigator.clipboard.writeText(text);
|
|
4303
4326
|
};
|
|
4327
|
+
const toClipBoardItem = options => {
|
|
4328
|
+
return new ClipboardItem(options);
|
|
4329
|
+
};
|
|
4330
|
+
const write$1 = async itemOptions => {
|
|
4331
|
+
const items = itemOptions.map(toClipBoardItem);
|
|
4332
|
+
await navigator.clipboard.write(items);
|
|
4333
|
+
};
|
|
4304
4334
|
const writeImage = async blob => {
|
|
4305
4335
|
await navigator.clipboard.write([new ClipboardItem({
|
|
4306
4336
|
[blob.type]: blob
|
|
@@ -4317,7 +4347,9 @@ const Commands$z = {
|
|
|
4317
4347
|
execCopy: execCopy,
|
|
4318
4348
|
readText: readText,
|
|
4319
4349
|
writeImage: writeImage,
|
|
4320
|
-
writeText: writeText
|
|
4350
|
+
writeText: writeText,
|
|
4351
|
+
write: write$1,
|
|
4352
|
+
read: read
|
|
4321
4353
|
};
|
|
4322
4354
|
|
|
4323
4355
|
const ClipBoard_ipc = {
|
|
@@ -10300,7 +10332,7 @@ const focusElementByName = (viewletId, name) => {
|
|
|
10300
10332
|
}
|
|
10301
10333
|
$Element.focus();
|
|
10302
10334
|
};
|
|
10303
|
-
const
|
|
10335
|
+
const setElementProperty = (viewletId, name, key, value) => {
|
|
10304
10336
|
const selector = `[name="${name}"]`;
|
|
10305
10337
|
const instance = state$6.instances[viewletId];
|
|
10306
10338
|
if (!instance) {
|
|
@@ -10313,7 +10345,13 @@ const setValueByName = (viewletId, name, value) => {
|
|
|
10313
10345
|
if (!$Element) {
|
|
10314
10346
|
return;
|
|
10315
10347
|
}
|
|
10316
|
-
$Element
|
|
10348
|
+
$Element[key] = value;
|
|
10349
|
+
};
|
|
10350
|
+
const setValueByName = (viewletId, name, value) => {
|
|
10351
|
+
setElementProperty(viewletId, name, 'value', value);
|
|
10352
|
+
};
|
|
10353
|
+
const setCheckBoxValue = (viewletId, name, value) => {
|
|
10354
|
+
setElementProperty(viewletId, name, 'checked', value);
|
|
10317
10355
|
};
|
|
10318
10356
|
const setSelectionByName = (viewletId, name, start, end) => {
|
|
10319
10357
|
const selector = `[name="${name}"]`;
|
|
@@ -10546,11 +10584,16 @@ const sendMultiple = commands => {
|
|
|
10546
10584
|
// @ts-ignore
|
|
10547
10585
|
setValueByName(viewletId, method, ...args);
|
|
10548
10586
|
break;
|
|
10587
|
+
case 'Viewlet.setCheckBoxValue':
|
|
10588
|
+
// @ts-ignore
|
|
10589
|
+
setCheckBoxValue(viewletId, method, ...args);
|
|
10590
|
+
break;
|
|
10549
10591
|
case 'Viewlet.setSelectionByName':
|
|
10550
10592
|
// @ts-ignore
|
|
10551
10593
|
setSelectionByName(viewletId, method, ...args);
|
|
10552
10594
|
break;
|
|
10553
10595
|
case 'Viewlet.registerEventListeners':
|
|
10596
|
+
// @ts-ignore
|
|
10554
10597
|
registerEventListeners(viewletId, method, ...args);
|
|
10555
10598
|
break;
|
|
10556
10599
|
case 'Viewlet.setUid':
|
|
@@ -10728,6 +10771,8 @@ const getFn = command => {
|
|
|
10728
10771
|
return focusElementByName;
|
|
10729
10772
|
case 'Viewlet.setValueByName':
|
|
10730
10773
|
return setValueByName;
|
|
10774
|
+
case 'Viewlet.setCheckBoxValue':
|
|
10775
|
+
return setCheckBoxValue;
|
|
10731
10776
|
case 'Viewlet.registerEventListeners':
|
|
10732
10777
|
return registerEventListeners;
|
|
10733
10778
|
case 'Viewlet.setPatches':
|
|
@@ -10745,6 +10790,7 @@ const getFn = command => {
|
|
|
10745
10790
|
const executeCommands = commands => {
|
|
10746
10791
|
for (const [command, ...args] of commands) {
|
|
10747
10792
|
const fn = getFn(command);
|
|
10793
|
+
// @ts-ignore
|
|
10748
10794
|
fn(...args);
|
|
10749
10795
|
}
|
|
10750
10796
|
};
|