@lvce-editor/renderer-process 9.7.0 → 9.9.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 +47 -55
- package/package.json +1 -1
|
@@ -210,6 +210,7 @@ const getModuleId = commandId => {
|
|
|
210
210
|
return HandleMessagePort;
|
|
211
211
|
case 'WebView.create':
|
|
212
212
|
case 'WebView.setPort':
|
|
213
|
+
case 'WebView.dispose':
|
|
213
214
|
return WebView$1;
|
|
214
215
|
default:
|
|
215
216
|
throw new CommandNotFoundError(commandId);
|
|
@@ -525,7 +526,7 @@ const set$7 = (id, fn) => {
|
|
|
525
526
|
const get$8 = id => {
|
|
526
527
|
return state$1$1.callbacks[id];
|
|
527
528
|
};
|
|
528
|
-
const remove$
|
|
529
|
+
const remove$4 = id => {
|
|
529
530
|
delete state$1$1.callbacks[id];
|
|
530
531
|
};
|
|
531
532
|
const state$a = {
|
|
@@ -571,7 +572,7 @@ const resolve = (id, args) => {
|
|
|
571
572
|
return;
|
|
572
573
|
}
|
|
573
574
|
fn(args);
|
|
574
|
-
remove$
|
|
575
|
+
remove$4(id);
|
|
575
576
|
};
|
|
576
577
|
const create$2$1 = (method, params) => {
|
|
577
578
|
const {
|
|
@@ -917,24 +918,7 @@ const getModule$1 = method => {
|
|
|
917
918
|
}
|
|
918
919
|
};
|
|
919
920
|
|
|
920
|
-
const
|
|
921
|
-
if (typeof location === 'undefined' || typeof document === 'undefined') {
|
|
922
|
-
return false;
|
|
923
|
-
}
|
|
924
|
-
const configElement = document.getElementById('Config');
|
|
925
|
-
if (!configElement) {
|
|
926
|
-
return false;
|
|
927
|
-
}
|
|
928
|
-
const text = configElement.textContent;
|
|
929
|
-
if (!text) {
|
|
930
|
-
return false;
|
|
931
|
-
}
|
|
932
|
-
const config = JSON.parse(text);
|
|
933
|
-
const result = config[key];
|
|
934
|
-
return result;
|
|
935
|
-
};
|
|
936
|
-
|
|
937
|
-
const shouldLaunchMultipleWorkers = hasFlag('prelaunchWorkers');
|
|
921
|
+
const shouldLaunchMultipleWorkers = true;
|
|
938
922
|
|
|
939
923
|
const ipcs = Object.create(null);
|
|
940
924
|
const set$6 = (name, ipc) => {
|
|
@@ -943,7 +927,7 @@ const set$6 = (name, ipc) => {
|
|
|
943
927
|
const get$7 = name => {
|
|
944
928
|
return ipcs[name];
|
|
945
929
|
};
|
|
946
|
-
const remove$
|
|
930
|
+
const remove$3 = name => {
|
|
947
931
|
delete ipcs[name];
|
|
948
932
|
};
|
|
949
933
|
const has = name => {
|
|
@@ -954,14 +938,14 @@ const create$L = async ({
|
|
|
954
938
|
method,
|
|
955
939
|
...options
|
|
956
940
|
}) => {
|
|
957
|
-
if (
|
|
941
|
+
if (options.name && has(options.name)) {
|
|
958
942
|
if (!options.id) {
|
|
959
943
|
throw new Error('id is required');
|
|
960
944
|
}
|
|
961
945
|
// TODO rename method
|
|
962
946
|
// TODO avoid cyclic dependency
|
|
963
947
|
const port = get$7(options.name);
|
|
964
|
-
remove$
|
|
948
|
+
remove$3(options.name);
|
|
965
949
|
await invokeAndTransfer('Transferrable.transfer', options.id, port);
|
|
966
950
|
return;
|
|
967
951
|
}
|
|
@@ -1112,7 +1096,7 @@ const hydrate$4 = async () => {
|
|
|
1112
1096
|
};
|
|
1113
1097
|
|
|
1114
1098
|
// TODO needed?
|
|
1115
|
-
const dispose$
|
|
1099
|
+
const dispose$k = () => {
|
|
1116
1100
|
// @ts-expect-error
|
|
1117
1101
|
if (state$9.rendererWorker) {
|
|
1118
1102
|
// @ts-expect-error
|
|
@@ -1135,7 +1119,7 @@ const invokeAndTransfer = (method, ...params) => {
|
|
|
1135
1119
|
|
|
1136
1120
|
const RendererWorker = {
|
|
1137
1121
|
__proto__: null,
|
|
1138
|
-
dispose: dispose$
|
|
1122
|
+
dispose: dispose$k,
|
|
1139
1123
|
hydrate: hydrate$4,
|
|
1140
1124
|
invoke: invoke$1,
|
|
1141
1125
|
invokeAndTransfer,
|
|
@@ -1581,10 +1565,9 @@ const hydrate$1 = async () => {
|
|
|
1581
1565
|
};
|
|
1582
1566
|
|
|
1583
1567
|
const launchWorkers = () => {
|
|
1584
|
-
|
|
1568
|
+
{
|
|
1585
1569
|
return Promise.all([hydrate$4(), hydrate$3(), hydrate$1(), hydrate$2()]);
|
|
1586
1570
|
}
|
|
1587
|
-
return hydrate$4();
|
|
1588
1571
|
};
|
|
1589
1572
|
|
|
1590
1573
|
const Alert = 'alert';
|
|
@@ -2212,7 +2195,7 @@ const append$1 = $Element => {
|
|
|
2212
2195
|
document.body.append(state$7.$Widgets);
|
|
2213
2196
|
}
|
|
2214
2197
|
};
|
|
2215
|
-
const remove$
|
|
2198
|
+
const remove$2 = $Element => {
|
|
2216
2199
|
if (!$Element) {
|
|
2217
2200
|
// TODO $Element should always be defined
|
|
2218
2201
|
return;
|
|
@@ -2514,8 +2497,8 @@ const setDom$a = (state, dom) => {
|
|
|
2514
2497
|
// TODO recycle nodes
|
|
2515
2498
|
// TODO set right aria attributes on $EditorInput
|
|
2516
2499
|
};
|
|
2517
|
-
const dispose$
|
|
2518
|
-
remove$
|
|
2500
|
+
const dispose$j = state => {
|
|
2501
|
+
remove$2(state.$Viewlet);
|
|
2519
2502
|
// state.$EditorInput.removeAttribute('aria-activedescendant')
|
|
2520
2503
|
};
|
|
2521
2504
|
const showLoading = (state, x, y) => {
|
|
@@ -2545,7 +2528,7 @@ const ViewletEditorCompletion = {
|
|
|
2545
2528
|
__proto__: null,
|
|
2546
2529
|
attachEvents: attachEvents$b,
|
|
2547
2530
|
create: create$K,
|
|
2548
|
-
dispose: dispose$
|
|
2531
|
+
dispose: dispose$j,
|
|
2549
2532
|
handleError: handleError$7,
|
|
2550
2533
|
setBounds: setBounds$5,
|
|
2551
2534
|
setContentHeight,
|
|
@@ -2971,9 +2954,9 @@ const create$H = (x, y) => {
|
|
|
2971
2954
|
$RenameWidgetInputBox
|
|
2972
2955
|
};
|
|
2973
2956
|
};
|
|
2974
|
-
const dispose$
|
|
2957
|
+
const dispose$i = state => {
|
|
2975
2958
|
// TODO focus editor
|
|
2976
|
-
remove$
|
|
2959
|
+
remove$2(state.$RenameWidget);
|
|
2977
2960
|
};
|
|
2978
2961
|
|
|
2979
2962
|
// TODO could also be event based
|
|
@@ -2988,7 +2971,7 @@ const finish = state => {
|
|
|
2988
2971
|
const name$s = 'EditorRename';
|
|
2989
2972
|
const Commands$t = {
|
|
2990
2973
|
create: create$H,
|
|
2991
|
-
dispose: dispose$
|
|
2974
|
+
dispose: dispose$i,
|
|
2992
2975
|
finish: finish
|
|
2993
2976
|
};
|
|
2994
2977
|
|
|
@@ -3098,14 +3081,14 @@ const create$G = (uri, top, left) => {
|
|
|
3098
3081
|
const update = (state, uri) => {
|
|
3099
3082
|
state.$ImagePreviewImage.uri = uri;
|
|
3100
3083
|
};
|
|
3101
|
-
const dispose$
|
|
3102
|
-
remove$
|
|
3084
|
+
const dispose$h = state => {
|
|
3085
|
+
remove$2(state.$ImagePreview);
|
|
3103
3086
|
};
|
|
3104
3087
|
|
|
3105
3088
|
const ImagePreview = {
|
|
3106
3089
|
__proto__: null,
|
|
3107
3090
|
create: create$G,
|
|
3108
|
-
dispose: dispose$
|
|
3091
|
+
dispose: dispose$h,
|
|
3109
3092
|
showError,
|
|
3110
3093
|
update
|
|
3111
3094
|
};
|
|
@@ -3113,7 +3096,7 @@ const ImagePreview = {
|
|
|
3113
3096
|
const name$p = 'ImagePreview';
|
|
3114
3097
|
const Commands$q = {
|
|
3115
3098
|
create: create$G,
|
|
3116
|
-
dispose: dispose$
|
|
3099
|
+
dispose: dispose$h,
|
|
3117
3100
|
showError: showError,
|
|
3118
3101
|
update: update
|
|
3119
3102
|
};
|
|
@@ -3355,7 +3338,7 @@ const createWithOptions = (type, message, options) => {
|
|
|
3355
3338
|
const $Notification = create$NotificationWithOptions(message, options);
|
|
3356
3339
|
append$1($Notification);
|
|
3357
3340
|
};
|
|
3358
|
-
const dispose$
|
|
3341
|
+
const dispose$g = id => {
|
|
3359
3342
|
// const $Notification = state.$Notifications
|
|
3360
3343
|
};
|
|
3361
3344
|
|
|
@@ -3365,7 +3348,7 @@ const name$h = 'Notification';
|
|
|
3365
3348
|
const Commands$i = {
|
|
3366
3349
|
create: create$F,
|
|
3367
3350
|
createWithOptions: createWithOptions,
|
|
3368
|
-
dispose: dispose$
|
|
3351
|
+
dispose: dispose$g
|
|
3369
3352
|
};
|
|
3370
3353
|
|
|
3371
3354
|
const Notification_ipc = {
|
|
@@ -3626,7 +3609,7 @@ const showMenu = (x, y, width, height, items, level, parentIndex = -1, dom, mous
|
|
|
3626
3609
|
const hideSubMenu = level => {
|
|
3627
3610
|
const $$ChildMenus = state$1.$$Menus.slice(level);
|
|
3628
3611
|
for (const $ChildMenu of $$ChildMenus) {
|
|
3629
|
-
remove$
|
|
3612
|
+
remove$2($ChildMenu);
|
|
3630
3613
|
}
|
|
3631
3614
|
};
|
|
3632
3615
|
|
|
@@ -3684,11 +3667,11 @@ const showControlled = ({
|
|
|
3684
3667
|
|
|
3685
3668
|
const hide = (restoreFocus = true) => {
|
|
3686
3669
|
for (const $Menu of state$1.$$Menus) {
|
|
3687
|
-
remove$
|
|
3670
|
+
remove$2($Menu);
|
|
3688
3671
|
}
|
|
3689
3672
|
state$1.$$Menus = [];
|
|
3690
3673
|
if (state$1.$BackDrop) {
|
|
3691
|
-
remove$
|
|
3674
|
+
remove$2(state$1.$BackDrop);
|
|
3692
3675
|
state$1.$BackDrop = undefined;
|
|
3693
3676
|
}
|
|
3694
3677
|
// TODO focus previous item
|
|
@@ -3800,7 +3783,7 @@ const get$2 = id => {
|
|
|
3800
3783
|
const set$2 = (id, captureStream) => {
|
|
3801
3784
|
screenCaptures[id] = captureStream;
|
|
3802
3785
|
};
|
|
3803
|
-
const remove = id => {
|
|
3786
|
+
const remove$1 = id => {
|
|
3804
3787
|
delete screenCaptures[id];
|
|
3805
3788
|
};
|
|
3806
3789
|
|
|
@@ -3818,14 +3801,14 @@ const start = async (id, options) => {
|
|
|
3818
3801
|
throw new VError$1(error, `Failed to start screen capture`);
|
|
3819
3802
|
}
|
|
3820
3803
|
};
|
|
3821
|
-
const dispose$
|
|
3804
|
+
const dispose$f = async (id, options) => {
|
|
3822
3805
|
try {
|
|
3823
3806
|
number(id);
|
|
3824
3807
|
const captureStream = get$2(id);
|
|
3825
3808
|
for (const track of captureStream.getTracks()) {
|
|
3826
3809
|
track.stop();
|
|
3827
3810
|
}
|
|
3828
|
-
remove(id);
|
|
3811
|
+
remove$1(id);
|
|
3829
3812
|
} catch (error) {
|
|
3830
3813
|
throw new VError$1(error, `Failed to start screen capture`);
|
|
3831
3814
|
}
|
|
@@ -3833,7 +3816,7 @@ const dispose$e = async (id, options) => {
|
|
|
3833
3816
|
|
|
3834
3817
|
const name$b = 'ScreenCapture';
|
|
3835
3818
|
const Commands$c = {
|
|
3836
|
-
dispose: dispose$
|
|
3819
|
+
dispose: dispose$f,
|
|
3837
3820
|
start: start
|
|
3838
3821
|
};
|
|
3839
3822
|
|
|
@@ -4370,6 +4353,9 @@ const set$1 = (id, webView) => {
|
|
|
4370
4353
|
const get = id => {
|
|
4371
4354
|
return webViews[id];
|
|
4372
4355
|
};
|
|
4356
|
+
const remove = id => {
|
|
4357
|
+
delete webViews[id];
|
|
4358
|
+
};
|
|
4373
4359
|
|
|
4374
4360
|
const objects = Object.create(null);
|
|
4375
4361
|
const transfer = (transferable, objectId) => {
|
|
@@ -4747,7 +4733,7 @@ const sendMultiple = commands => {
|
|
|
4747
4733
|
}
|
|
4748
4734
|
case 'Viewlet.dispose':
|
|
4749
4735
|
{
|
|
4750
|
-
dispose$
|
|
4736
|
+
dispose$e(viewletId);
|
|
4751
4737
|
break;
|
|
4752
4738
|
}
|
|
4753
4739
|
case 'Viewlet.createPlaceholder':
|
|
@@ -4800,7 +4786,7 @@ const sendMultiple = commands => {
|
|
|
4800
4786
|
}
|
|
4801
4787
|
}
|
|
4802
4788
|
};
|
|
4803
|
-
const dispose$
|
|
4789
|
+
const dispose$e = id => {
|
|
4804
4790
|
try {
|
|
4805
4791
|
number(id);
|
|
4806
4792
|
const {
|
|
@@ -4931,7 +4917,7 @@ const getFn = command => {
|
|
|
4931
4917
|
case 'Viewlet.show':
|
|
4932
4918
|
return show;
|
|
4933
4919
|
case 'Viewlet.dispose':
|
|
4934
|
-
return dispose$
|
|
4920
|
+
return dispose$e;
|
|
4935
4921
|
case 'Viewlet.setDom2':
|
|
4936
4922
|
return setDom2;
|
|
4937
4923
|
case 'Viewlet.setBounds':
|
|
@@ -4988,7 +4974,7 @@ const name$8 = 'Viewlet';
|
|
|
4988
4974
|
const Commands$9 = {
|
|
4989
4975
|
addKeyBindings: addKeyBindings,
|
|
4990
4976
|
appendViewlet: appendViewlet,
|
|
4991
|
-
dispose: dispose$
|
|
4977
|
+
dispose: dispose$e,
|
|
4992
4978
|
executeCommands: executeCommands,
|
|
4993
4979
|
focus: focus$h,
|
|
4994
4980
|
focusSelector: focusSelector,
|
|
@@ -5841,12 +5827,18 @@ const setPort$2 = (uid, port, origin, portType) => {
|
|
|
5841
5827
|
params: [port, portType]
|
|
5842
5828
|
}, origin, [port]);
|
|
5843
5829
|
};
|
|
5830
|
+
const dispose$d = uid => {
|
|
5831
|
+
const $Iframe = get(uid);
|
|
5832
|
+
$Iframe.remove();
|
|
5833
|
+
remove(uid);
|
|
5834
|
+
};
|
|
5844
5835
|
|
|
5845
5836
|
const name = 'WebView';
|
|
5846
5837
|
const Commands$1 = {
|
|
5847
5838
|
create: create$C,
|
|
5848
5839
|
load: load,
|
|
5849
|
-
setPort: setPort$2
|
|
5840
|
+
setPort: setPort$2,
|
|
5841
|
+
dispose: dispose$d
|
|
5850
5842
|
};
|
|
5851
5843
|
|
|
5852
5844
|
const WebView_ipc = {
|
|
@@ -7394,7 +7386,7 @@ const hideOverlayMessage = state => {
|
|
|
7394
7386
|
for (const $Widget of state$7.widgetSet) {
|
|
7395
7387
|
// @ts-expect-error
|
|
7396
7388
|
if ($Widget.className === 'EditorOverlayMessage') {
|
|
7397
|
-
remove$
|
|
7389
|
+
remove$2($Widget);
|
|
7398
7390
|
}
|
|
7399
7391
|
}
|
|
7400
7392
|
};
|
|
@@ -10892,7 +10884,7 @@ const openMenu = (state, unFocusIndex, index, level, menuItems, menuFocusedIndex
|
|
|
10892
10884
|
focusIndex(0, -1, menuFocusedIndex);
|
|
10893
10885
|
}
|
|
10894
10886
|
for (const $Menu of $$Menus) {
|
|
10895
|
-
remove$
|
|
10887
|
+
remove$2($Menu);
|
|
10896
10888
|
}
|
|
10897
10889
|
};
|
|
10898
10890
|
|
|
@@ -11008,7 +11000,7 @@ const setMenus = (state, changes, uid) => {
|
|
|
11008
11000
|
const keepCount = change[1];
|
|
11009
11001
|
const $$ToDispose = $$Menus.slice(keepCount);
|
|
11010
11002
|
for (const $ToDispose of $$ToDispose) {
|
|
11011
|
-
remove$
|
|
11003
|
+
remove$2($ToDispose);
|
|
11012
11004
|
}
|
|
11013
11005
|
$$Menus.length = keepCount;
|
|
11014
11006
|
break;
|