@lvce-editor/extension-search-view 7.24.1 → 7.26.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.
|
@@ -651,6 +651,9 @@ const restoreExistingError = (error, currentStack) => {
|
|
|
651
651
|
};
|
|
652
652
|
const restoreMethodNotFoundError = (error, currentStack) => {
|
|
653
653
|
const restoredError = new JsonRpcError(error.message);
|
|
654
|
+
Object.assign(restoredError, {
|
|
655
|
+
code: error.code
|
|
656
|
+
});
|
|
654
657
|
const parentStack = getParentStack(error);
|
|
655
658
|
setStack(restoredError, `${parentStack}${NewLine}${currentStack}`);
|
|
656
659
|
return restoredError;
|
|
@@ -670,9 +673,13 @@ const applyDataProperties = (restoredError, error) => {
|
|
|
670
673
|
// @ts-ignore
|
|
671
674
|
restoredError.codeFrame = error.data.codeFrame;
|
|
672
675
|
}
|
|
673
|
-
if (error.data.code) {
|
|
676
|
+
if (typeof error.data.code === 'string' || typeof error.data.code === 'number') {
|
|
674
677
|
// @ts-ignore
|
|
675
|
-
restoredError
|
|
678
|
+
Object.defineProperty(restoredError, 'code', {
|
|
679
|
+
configurable: true,
|
|
680
|
+
value: error.data.code,
|
|
681
|
+
writable: true
|
|
682
|
+
});
|
|
676
683
|
}
|
|
677
684
|
if (error.data.type) {
|
|
678
685
|
// @ts-ignore
|
|
@@ -694,6 +701,13 @@ const applyDirectProperties = (restoredError, error) => {
|
|
|
694
701
|
};
|
|
695
702
|
const restoreMessageError = (error, _currentStack) => {
|
|
696
703
|
const restoredError = constructError(error.message, error.type, error.name);
|
|
704
|
+
if (typeof error.code === 'string' || typeof error.code === 'number') {
|
|
705
|
+
Object.defineProperty(restoredError, 'code', {
|
|
706
|
+
configurable: true,
|
|
707
|
+
value: error.code,
|
|
708
|
+
writable: true
|
|
709
|
+
});
|
|
710
|
+
}
|
|
697
711
|
if (error.data) {
|
|
698
712
|
applyDataProperties(restoredError, error);
|
|
699
713
|
} else {
|
|
@@ -772,7 +786,7 @@ const getErrorProperty = (error, prettyError) => {
|
|
|
772
786
|
return {
|
|
773
787
|
code: Custom,
|
|
774
788
|
data: {
|
|
775
|
-
code: prettyError.code,
|
|
789
|
+
code: prettyError.code ?? error?.code,
|
|
776
790
|
codeFrame: prettyError.codeFrame,
|
|
777
791
|
name: prettyError.name,
|
|
778
792
|
stack: getStack(prettyError),
|
|
@@ -809,7 +823,12 @@ const getErrorResponseSimple = (id, error) => {
|
|
|
809
823
|
return {
|
|
810
824
|
error: {
|
|
811
825
|
code: Custom,
|
|
812
|
-
data: error
|
|
826
|
+
data: error instanceof Error ? {
|
|
827
|
+
...error,
|
|
828
|
+
code: 'code' in error ? error.code : undefined,
|
|
829
|
+
stack: error.stack,
|
|
830
|
+
type: error.name
|
|
831
|
+
} : error,
|
|
813
832
|
// @ts-ignore
|
|
814
833
|
message: error.message
|
|
815
834
|
},
|
|
@@ -1383,6 +1402,12 @@ const disableWorkspace$2 = id => {
|
|
|
1383
1402
|
const uninstall$2 = id => {
|
|
1384
1403
|
return invoke$3(`Extensions.uninstall`, id);
|
|
1385
1404
|
};
|
|
1405
|
+
const enableWorkspace$2 = id => {
|
|
1406
|
+
return invoke$3('Extensions.enableWorkspace', id);
|
|
1407
|
+
};
|
|
1408
|
+
const getAllExtensions$1 = (assetDir, platform) => {
|
|
1409
|
+
return invoke$3('Extensions.getAllExtensions', assetDir, platform);
|
|
1410
|
+
};
|
|
1386
1411
|
|
|
1387
1412
|
const {
|
|
1388
1413
|
invoke: invoke$2,
|
|
@@ -2664,7 +2689,7 @@ const enableWorkspace = async state => {
|
|
|
2664
2689
|
if (!item) {
|
|
2665
2690
|
return state;
|
|
2666
2691
|
}
|
|
2667
|
-
await
|
|
2692
|
+
await enableWorkspace$2(item.id);
|
|
2668
2693
|
return setExtensionStatus(state, item.id, Enabled);
|
|
2669
2694
|
};
|
|
2670
2695
|
|
|
@@ -4210,9 +4235,9 @@ const Web = 1;
|
|
|
4210
4235
|
const Electron = 2;
|
|
4211
4236
|
const Remote = 3;
|
|
4212
4237
|
|
|
4213
|
-
const getAllExtensions
|
|
4238
|
+
const getAllExtensions = async (assetDir, platform) => {
|
|
4214
4239
|
try {
|
|
4215
|
-
return await
|
|
4240
|
+
return await getAllExtensions$1(assetDir, platform);
|
|
4216
4241
|
} catch (error) {
|
|
4217
4242
|
if (platform === Web) {
|
|
4218
4243
|
return [];
|
|
@@ -4221,10 +4246,6 @@ const getAllExtensions$1 = async (assetDir, platform) => {
|
|
|
4221
4246
|
}
|
|
4222
4247
|
};
|
|
4223
4248
|
|
|
4224
|
-
const getAllExtensions = (assetDir, platform) => {
|
|
4225
|
-
return getAllExtensions$1(assetDir, platform);
|
|
4226
|
-
};
|
|
4227
|
-
|
|
4228
4249
|
const getBuiltin = extension => {
|
|
4229
4250
|
if (extension === null || typeof extension !== 'object') {
|
|
4230
4251
|
return false;
|
|
@@ -4711,10 +4732,6 @@ const initializeExtensionManagementWorker = async () => {
|
|
|
4711
4732
|
}
|
|
4712
4733
|
};
|
|
4713
4734
|
|
|
4714
|
-
const initialize = async () => {
|
|
4715
|
-
await initializeExtensionManagementWorker();
|
|
4716
|
-
};
|
|
4717
|
-
|
|
4718
4735
|
const installAnotherVersion = async state => {
|
|
4719
4736
|
await invoke$4('ConfirmPrompt.prompt', 'not implemented', undefined);
|
|
4720
4737
|
return state;
|
|
@@ -5150,8 +5167,10 @@ const render3 = async (uid, diffResult) => {
|
|
|
5150
5167
|
newState,
|
|
5151
5168
|
oldState
|
|
5152
5169
|
} = get(uid);
|
|
5170
|
+
// Commands can update state while the renderer worker is sending the diff back.
|
|
5171
|
+
const currentDiffResult = [...new Set([...diff2(uid), ...diffResult])];
|
|
5153
5172
|
set$1(uid, newState, newState);
|
|
5154
|
-
const commands = applyRender(oldState, newState,
|
|
5173
|
+
const commands = applyRender(oldState, newState, currentDiffResult);
|
|
5155
5174
|
if (!isConnected()) {
|
|
5156
5175
|
return commands;
|
|
5157
5176
|
}
|
|
@@ -5462,7 +5481,7 @@ const commandMap = {
|
|
|
5462
5481
|
'SearchExtensions.handleSettingsButtonClick': wrapCommand(handleSettingsButtonClick),
|
|
5463
5482
|
'SearchExtensions.handleUninstall': wrapCommand(handleUninstall),
|
|
5464
5483
|
'SearchExtensions.handleWheel': wrapCommand(handleWheel),
|
|
5465
|
-
'SearchExtensions.initialize':
|
|
5484
|
+
'SearchExtensions.initialize': initializeExtensionManagementWorker,
|
|
5466
5485
|
'SearchExtensions.installAnotherVersion': wrapCommand(installAnotherVersion),
|
|
5467
5486
|
'SearchExtensions.loadContent': wrapAsyncCommand(loadContentWithContext),
|
|
5468
5487
|
'SearchExtensions.openSuggest': wrapCommand(openSuggest),
|