@lvce-editor/about-view 4.1.1 → 4.3.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/aboutWorkerMain.js +36 -14
- package/package.json +1 -1
package/dist/aboutWorkerMain.js
CHANGED
@@ -267,14 +267,14 @@ const readyMessage = 'ready';
|
|
267
267
|
const getData$2 = event => {
|
268
268
|
return event.data;
|
269
269
|
};
|
270
|
-
const listen$
|
270
|
+
const listen$7 = () => {
|
271
271
|
// @ts-ignore
|
272
272
|
if (typeof WorkerGlobalScope === 'undefined') {
|
273
273
|
throw new TypeError('module is not in web worker scope');
|
274
274
|
}
|
275
275
|
return globalThis;
|
276
276
|
};
|
277
|
-
const signal$
|
277
|
+
const signal$7 = global => {
|
278
278
|
global.postMessage(readyMessage);
|
279
279
|
};
|
280
280
|
class IpcChildWithModuleWorker extends Ipc {
|
@@ -300,7 +300,7 @@ class IpcChildWithModuleWorker extends Ipc {
|
|
300
300
|
this._rawIpc.addEventListener('message', callback);
|
301
301
|
}
|
302
302
|
}
|
303
|
-
const wrap$
|
303
|
+
const wrap$e = global => {
|
304
304
|
return new IpcChildWithModuleWorker(global);
|
305
305
|
};
|
306
306
|
const withResolvers = () => {
|
@@ -325,10 +325,10 @@ const waitForFirstMessage = async port => {
|
|
325
325
|
// @ts-ignore
|
326
326
|
return event.data;
|
327
327
|
};
|
328
|
-
const listen$
|
329
|
-
const parentIpcRaw = listen$
|
330
|
-
signal$
|
331
|
-
const parentIpc = wrap$
|
328
|
+
const listen$6 = async () => {
|
329
|
+
const parentIpcRaw = listen$7();
|
330
|
+
signal$7(parentIpcRaw);
|
331
|
+
const parentIpc = wrap$e(parentIpcRaw);
|
332
332
|
const firstMessage = await waitForFirstMessage(parentIpc);
|
333
333
|
if (firstMessage.method !== 'initialize') {
|
334
334
|
throw new IpcError('unexpected first message');
|
@@ -373,13 +373,13 @@ class IpcChildWithModuleWorkerAndMessagePort extends Ipc {
|
|
373
373
|
this._rawIpc.start();
|
374
374
|
}
|
375
375
|
}
|
376
|
-
const wrap$
|
376
|
+
const wrap$d = port => {
|
377
377
|
return new IpcChildWithModuleWorkerAndMessagePort(port);
|
378
378
|
};
|
379
379
|
const IpcChildWithModuleWorkerAndMessagePort$1 = {
|
380
380
|
__proto__: null,
|
381
|
-
listen: listen$
|
382
|
-
wrap: wrap$
|
381
|
+
listen: listen$6,
|
382
|
+
wrap: wrap$d
|
383
383
|
};
|
384
384
|
|
385
385
|
const Two = '2.0';
|
@@ -1385,6 +1385,29 @@ const getKeyBindings = () => {
|
|
1385
1385
|
}];
|
1386
1386
|
};
|
1387
1387
|
|
1388
|
+
const handleClickClose = async state => {
|
1389
|
+
await invoke('Viewlet.closeWidget', 'About');
|
1390
|
+
return state;
|
1391
|
+
};
|
1392
|
+
|
1393
|
+
const writeText = async text => {
|
1394
|
+
await invoke('ClipBoard.writeText', /* text */text);
|
1395
|
+
};
|
1396
|
+
|
1397
|
+
const handleClickCopy = async state => {
|
1398
|
+
const {
|
1399
|
+
lines
|
1400
|
+
} = state;
|
1401
|
+
const message = joinLines(lines);
|
1402
|
+
await writeText(message);
|
1403
|
+
return state;
|
1404
|
+
};
|
1405
|
+
|
1406
|
+
const handleClickOk = async state => {
|
1407
|
+
await invoke('Viewlet.closeWidget', 'About');
|
1408
|
+
return state;
|
1409
|
+
};
|
1410
|
+
|
1388
1411
|
const loadContent = state => {
|
1389
1412
|
const lines = getDetailStringWeb();
|
1390
1413
|
return {
|
@@ -1477,10 +1500,6 @@ const renderEventListeners = () => {
|
|
1477
1500
|
}];
|
1478
1501
|
};
|
1479
1502
|
|
1480
|
-
const writeText = async text => {
|
1481
|
-
await invoke('ClipBoard.writeText', /* text */text);
|
1482
|
-
};
|
1483
|
-
|
1484
1503
|
const getWindowId = async () => {
|
1485
1504
|
return invoke('GetWindowId.getWindowId');
|
1486
1505
|
};
|
@@ -1529,6 +1548,9 @@ const commandMap = {
|
|
1529
1548
|
'About.getDetailStringWeb': getDetailStringWeb,
|
1530
1549
|
'About.getKeyBindings': getKeyBindings,
|
1531
1550
|
'About.getVirtualDom': getAboutVirtualDom,
|
1551
|
+
'About.handleClickClose': handleClickClose,
|
1552
|
+
'About.handleClickCopy': handleClickCopy,
|
1553
|
+
'About.handleClickOk': handleClickOk,
|
1532
1554
|
'About.loadContent': loadContent,
|
1533
1555
|
'About.render': doRender,
|
1534
1556
|
'About.renderEventListeners': renderEventListeners,
|