@lvce-editor/renderer-process 30.12.3 → 30.12.4
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 +40 -20
- package/package.json +1 -1
|
@@ -122,7 +122,7 @@ const state$a = {
|
|
|
122
122
|
styleSheets: Object.create(null),
|
|
123
123
|
texts: Object.create(null)
|
|
124
124
|
};
|
|
125
|
-
const set$
|
|
125
|
+
const set$b = (id, sheet) => {
|
|
126
126
|
state$a.styleSheets[id] = sheet;
|
|
127
127
|
};
|
|
128
128
|
const get$b = id => {
|
|
@@ -134,7 +134,7 @@ const setText$2 = (id, text) => {
|
|
|
134
134
|
const getText = id => {
|
|
135
135
|
return state$a.texts[id];
|
|
136
136
|
};
|
|
137
|
-
const remove$
|
|
137
|
+
const remove$5 = id => {
|
|
138
138
|
delete state$a.styleSheets[id];
|
|
139
139
|
delete state$a.texts[id];
|
|
140
140
|
};
|
|
@@ -147,7 +147,7 @@ const addCssStyleSheet = (id, text) => {
|
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
149
|
const sheet = new CSSStyleSheet({});
|
|
150
|
-
set$
|
|
150
|
+
set$b(id, sheet);
|
|
151
151
|
setText$2(id, text);
|
|
152
152
|
sheet.replaceSync(text);
|
|
153
153
|
document.adoptedStyleSheets.push(sheet);
|
|
@@ -177,7 +177,7 @@ const removeCssStyleSheet = id => {
|
|
|
177
177
|
return;
|
|
178
178
|
}
|
|
179
179
|
document.adoptedStyleSheets = document.adoptedStyleSheets.filter(candidate => candidate !== sheet);
|
|
180
|
-
remove$
|
|
180
|
+
remove$5(id);
|
|
181
181
|
};
|
|
182
182
|
const getSelectionText = () => {
|
|
183
183
|
return document.getSelection()?.toString() || '';
|
|
@@ -1261,7 +1261,7 @@ const instances = Object.create(null);
|
|
|
1261
1261
|
const get$a = viewletId => {
|
|
1262
1262
|
return instances[viewletId];
|
|
1263
1263
|
};
|
|
1264
|
-
const set$
|
|
1264
|
+
const set$a = (viewletId, instance) => {
|
|
1265
1265
|
instances[viewletId] = instance;
|
|
1266
1266
|
};
|
|
1267
1267
|
|
|
@@ -1290,7 +1290,7 @@ const cache = new Map();
|
|
|
1290
1290
|
const has$1 = listener => {
|
|
1291
1291
|
return cache.has(listener);
|
|
1292
1292
|
};
|
|
1293
|
-
const set$
|
|
1293
|
+
const set$9 = (listener, value) => {
|
|
1294
1294
|
cache.set(listener, value);
|
|
1295
1295
|
};
|
|
1296
1296
|
const get$9 = listener => {
|
|
@@ -1313,7 +1313,7 @@ const getWrappedListener = (listener, returnValue) => {
|
|
|
1313
1313
|
ipc.send('Viewlet.executeViewletCommand', uid, ...result);
|
|
1314
1314
|
};
|
|
1315
1315
|
nameAnonymousFunction$1(wrapped, listener.name);
|
|
1316
|
-
set$
|
|
1316
|
+
set$9(listener, wrapped);
|
|
1317
1317
|
}
|
|
1318
1318
|
return get$9(listener);
|
|
1319
1319
|
};
|
|
@@ -2820,7 +2820,7 @@ const callbacks = Object.create(null);
|
|
|
2820
2820
|
const get$7 = id => {
|
|
2821
2821
|
return callbacks[id];
|
|
2822
2822
|
};
|
|
2823
|
-
const remove$
|
|
2823
|
+
const remove$4 = id => {
|
|
2824
2824
|
delete callbacks[id];
|
|
2825
2825
|
};
|
|
2826
2826
|
class JsonRpcError extends Error {
|
|
@@ -3014,7 +3014,7 @@ const resolve = (id, response) => {
|
|
|
3014
3014
|
return;
|
|
3015
3015
|
}
|
|
3016
3016
|
fn(response);
|
|
3017
|
-
remove$
|
|
3017
|
+
remove$4(id);
|
|
3018
3018
|
};
|
|
3019
3019
|
const E_COMMAND_NOT_FOUND = 'E_COMMAND_NOT_FOUND';
|
|
3020
3020
|
const getErrorType = prettyError => {
|
|
@@ -3376,18 +3376,33 @@ const create$z = async ({
|
|
|
3376
3376
|
});
|
|
3377
3377
|
};
|
|
3378
3378
|
|
|
3379
|
-
|
|
3379
|
+
const workers = Object.create(null);
|
|
3380
|
+
const set$8 = (id, worker) => {
|
|
3381
|
+
workers[id] = worker;
|
|
3382
|
+
};
|
|
3383
|
+
const remove$3 = id => {
|
|
3384
|
+
const worker = workers[id];
|
|
3385
|
+
delete workers[id];
|
|
3386
|
+
return worker;
|
|
3387
|
+
};
|
|
3388
|
+
|
|
3380
3389
|
const create$y = async ({
|
|
3390
|
+
id,
|
|
3381
3391
|
name,
|
|
3382
3392
|
port,
|
|
3393
|
+
raw,
|
|
3383
3394
|
url
|
|
3384
|
-
}) => {
|
|
3385
|
-
await
|
|
3395
|
+
}, createRpc = create$A) => {
|
|
3396
|
+
const rpc = await createRpc({
|
|
3386
3397
|
commandMap: {},
|
|
3387
3398
|
name,
|
|
3388
3399
|
port,
|
|
3389
3400
|
url
|
|
3390
3401
|
});
|
|
3402
|
+
const worker = rpc.ipc?._rawIpc;
|
|
3403
|
+
if (typeof id === 'number' && raw && worker) {
|
|
3404
|
+
set$8(id, worker);
|
|
3405
|
+
}
|
|
3391
3406
|
return undefined;
|
|
3392
3407
|
};
|
|
3393
3408
|
|
|
@@ -3579,7 +3594,7 @@ const hydrate$3 = async () => {
|
|
|
3579
3594
|
};
|
|
3580
3595
|
|
|
3581
3596
|
// TODO needed?
|
|
3582
|
-
const dispose$
|
|
3597
|
+
const dispose$k = () => {
|
|
3583
3598
|
if (state$7.rpc) {
|
|
3584
3599
|
state$7.rpc.dispose();
|
|
3585
3600
|
}
|
|
@@ -3603,7 +3618,7 @@ const invokeAndTransfer = (method, ...params) => {
|
|
|
3603
3618
|
|
|
3604
3619
|
const RendererWorker = {
|
|
3605
3620
|
__proto__: null,
|
|
3606
|
-
dispose: dispose$
|
|
3621
|
+
dispose: dispose$k,
|
|
3607
3622
|
hydrate: hydrate$3,
|
|
3608
3623
|
invoke: invoke$1,
|
|
3609
3624
|
invokeAndTransfer,
|
|
@@ -3631,6 +3646,10 @@ const create$w = async ({
|
|
|
3631
3646
|
// @ts-ignore
|
|
3632
3647
|
return module.create(options);
|
|
3633
3648
|
};
|
|
3649
|
+
const dispose$j = id => {
|
|
3650
|
+
const worker = remove$3(id);
|
|
3651
|
+
worker?.terminate();
|
|
3652
|
+
};
|
|
3634
3653
|
|
|
3635
3654
|
const getElementHeight = $Element => {
|
|
3636
3655
|
document.body.append($Element);
|
|
@@ -3811,7 +3830,7 @@ const create2 = async (canvasId, objectId, width, height) => {
|
|
|
3811
3830
|
}
|
|
3812
3831
|
const offscreenCanvas = canvas.transferControlToOffscreen();
|
|
3813
3832
|
canvas.dataset.id = canvasId;
|
|
3814
|
-
set$
|
|
3833
|
+
set$a(canvasId, {
|
|
3815
3834
|
factory: {},
|
|
3816
3835
|
state: {
|
|
3817
3836
|
$Viewlet: canvas
|
|
@@ -8573,7 +8592,7 @@ const create$4 = (id, uid = id) => {
|
|
|
8573
8592
|
if (module.attachEvents) {
|
|
8574
8593
|
module.attachEvents(instanceState);
|
|
8575
8594
|
}
|
|
8576
|
-
set$
|
|
8595
|
+
set$a(uid, {
|
|
8577
8596
|
factory: module,
|
|
8578
8597
|
state: instanceState
|
|
8579
8598
|
});
|
|
@@ -8593,7 +8612,7 @@ const createFunctionalRoot = (id, uid = id, hasFunctionalEvents) => {
|
|
|
8593
8612
|
const instanceState = {
|
|
8594
8613
|
$Viewlet: document.createElement('div')
|
|
8595
8614
|
};
|
|
8596
|
-
set$
|
|
8615
|
+
set$a(uid, {
|
|
8597
8616
|
factory: module,
|
|
8598
8617
|
state: instanceState
|
|
8599
8618
|
});
|
|
@@ -8774,7 +8793,7 @@ const createPlaceholder = (viewletId, parentId, top, left, width, height) => {
|
|
|
8774
8793
|
const parentInstance = get$a(parentId);
|
|
8775
8794
|
const $Parent = parentInstance.state.$Viewlet;
|
|
8776
8795
|
$Parent.append($Placeholder);
|
|
8777
|
-
set$
|
|
8796
|
+
set$a(viewletId, {
|
|
8778
8797
|
state: {
|
|
8779
8798
|
$Viewlet: $Placeholder
|
|
8780
8799
|
}
|
|
@@ -8819,7 +8838,7 @@ const setDom2 = (viewletId, dom) => {
|
|
|
8819
8838
|
// @ts-ignore
|
|
8820
8839
|
set$3($NewViewlet, uid);
|
|
8821
8840
|
}
|
|
8822
|
-
set$
|
|
8841
|
+
set$a(viewletId, {
|
|
8823
8842
|
...instance,
|
|
8824
8843
|
state: {
|
|
8825
8844
|
...instance.state,
|
|
@@ -8905,7 +8924,7 @@ const dispose$4 = id => {
|
|
|
8905
8924
|
instance.state.$Viewlet.remove();
|
|
8906
8925
|
}
|
|
8907
8926
|
removeCssStyleSheet(id);
|
|
8908
|
-
set$
|
|
8927
|
+
set$a(id, undefined);
|
|
8909
8928
|
} catch {
|
|
8910
8929
|
throw new Error(`Failed to dispose ${id}`);
|
|
8911
8930
|
}
|
|
@@ -9358,6 +9377,7 @@ const commandMap = {
|
|
|
9358
9377
|
'HandleMessagePort.handleMessagePort': handleMessagePort,
|
|
9359
9378
|
'InitData.getInitData': getInitData,
|
|
9360
9379
|
'IpcParent.create': create$w,
|
|
9380
|
+
'IpcParent.dispose': dispose$j,
|
|
9361
9381
|
'KeyBindings.setIdentifiers': setIdentifiers,
|
|
9362
9382
|
'Layout.getBounds': getBounds,
|
|
9363
9383
|
'Location.getHref': getHref,
|