@lvce-editor/extension-host-worker 3.18.0 → 3.19.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.
|
@@ -2753,7 +2753,7 @@ const getWebView = id => {
|
|
|
2753
2753
|
const setWebView = (id, webView) => {
|
|
2754
2754
|
webViews[id] = webView;
|
|
2755
2755
|
};
|
|
2756
|
-
const getWebViews = () => {
|
|
2756
|
+
const getWebViews$1 = () => {
|
|
2757
2757
|
return webViews;
|
|
2758
2758
|
};
|
|
2759
2759
|
|
|
@@ -2775,7 +2775,7 @@ const getRemoteUrlForWebView = async (uri, options = {}) => {
|
|
|
2775
2775
|
return objectUrl;
|
|
2776
2776
|
};
|
|
2777
2777
|
|
|
2778
|
-
const getRemoteUrl = async (uri, options = {}) => {
|
|
2778
|
+
const getRemoteUrl$1 = async (uri, options = {}) => {
|
|
2779
2779
|
// TODO uri should always have protocol
|
|
2780
2780
|
// then ask file system provider for remote url, for example disk file system provider or html file system provider
|
|
2781
2781
|
const protocol = getProtocol(uri);
|
|
@@ -2978,7 +2978,7 @@ const api = {
|
|
|
2978
2978
|
registerTypeDefinitionProvider: registerTypeDefinitionProvider,
|
|
2979
2979
|
executeTypeDefinitionProvider: executeTypeDefinitionProvider,
|
|
2980
2980
|
// Url
|
|
2981
|
-
getRemoteUrl: getRemoteUrl,
|
|
2981
|
+
getRemoteUrl: getRemoteUrl$1,
|
|
2982
2982
|
// Webview
|
|
2983
2983
|
registerWebViewProvider: registerWebViewProvider,
|
|
2984
2984
|
// Worker
|
|
@@ -4769,6 +4769,39 @@ const getRpcInfo = rpcId => {
|
|
|
4769
4769
|
return info;
|
|
4770
4770
|
};
|
|
4771
4771
|
|
|
4772
|
+
const getRemoteUrl = uri => {
|
|
4773
|
+
return `/remote/${uri}`;
|
|
4774
|
+
};
|
|
4775
|
+
|
|
4776
|
+
const getWebViewsFromExtensions = extensions => {
|
|
4777
|
+
const webViews = [];
|
|
4778
|
+
for (const extension of extensions) {
|
|
4779
|
+
if (extension && extension.webViews) {
|
|
4780
|
+
for (const webView of extension.webViews) {
|
|
4781
|
+
let path = extension.path;
|
|
4782
|
+
if (webView && webView.path) {
|
|
4783
|
+
path = `${extension.path}/${webView.path}`;
|
|
4784
|
+
}
|
|
4785
|
+
const uri = path;
|
|
4786
|
+
const remotePath = getRemoteUrl(uri);
|
|
4787
|
+
webViews.push({
|
|
4788
|
+
...webView,
|
|
4789
|
+
path,
|
|
4790
|
+
uri,
|
|
4791
|
+
remotePath
|
|
4792
|
+
});
|
|
4793
|
+
}
|
|
4794
|
+
}
|
|
4795
|
+
}
|
|
4796
|
+
return webViews;
|
|
4797
|
+
};
|
|
4798
|
+
|
|
4799
|
+
const getWebViews = async () => {
|
|
4800
|
+
const extensions = await getExtensions();
|
|
4801
|
+
const webViews = getWebViewsFromExtensions(extensions);
|
|
4802
|
+
return webViews;
|
|
4803
|
+
};
|
|
4804
|
+
|
|
4772
4805
|
const handleBeforeUnload = () => {
|
|
4773
4806
|
// TODO save all webviews in localstorage
|
|
4774
4807
|
// cannot use indexeddb during unload
|
|
@@ -4952,9 +4985,6 @@ const getLanguages = async () => {
|
|
|
4952
4985
|
try {
|
|
4953
4986
|
const extensions = await getExtensions();
|
|
4954
4987
|
const languages = extensions.flatMap(getLanguagesFromExtension);
|
|
4955
|
-
console.log({
|
|
4956
|
-
languages
|
|
4957
|
-
});
|
|
4958
4988
|
return languages;
|
|
4959
4989
|
} catch (error) {
|
|
4960
4990
|
throw new VError(error, 'Failed to load languages');
|
|
@@ -5004,7 +5034,7 @@ const getAdditional = () => {
|
|
|
5004
5034
|
}
|
|
5005
5035
|
};
|
|
5006
5036
|
const saveState = async () => {
|
|
5007
|
-
const webViews = getWebViews();
|
|
5037
|
+
const webViews = getWebViews$1();
|
|
5008
5038
|
const serialized = await serializeWebViews(webViews);
|
|
5009
5039
|
const additional = await getAdditional();
|
|
5010
5040
|
const all = [...serialized, ...additional];
|
|
@@ -5327,6 +5357,7 @@ const commandMap = {
|
|
|
5327
5357
|
'ExtensionHost.launchIframeWorker': launchIframeWorker,
|
|
5328
5358
|
'ExtensionHostRename.executeprepareRenameProvider': executeprepareRenameProvider,
|
|
5329
5359
|
'ExtensionHostRename.executeRenameProvider': executeRenameProvider,
|
|
5360
|
+
'Extensions.getExtensions': getExtensions,
|
|
5330
5361
|
'FileSystemFetch.chmod': chmod$1,
|
|
5331
5362
|
'FileSystemFetch.getBlob': getBlob$1,
|
|
5332
5363
|
'FileSystemFetch.mkdir': mkdir$1,
|
|
@@ -5335,7 +5366,6 @@ const commandMap = {
|
|
|
5335
5366
|
'FileSystemFetch.remove': remove$1,
|
|
5336
5367
|
'FileSystemFetch.writeFile': writeFile$1,
|
|
5337
5368
|
'FileSystemMemory.chmod': chmod,
|
|
5338
|
-
'Languages.getLanguages': getLanguages,
|
|
5339
5369
|
'FileSystemMemory.getBlob': getBlob,
|
|
5340
5370
|
'FileSystemMemory.getBlobUrl': getBlobUrl,
|
|
5341
5371
|
'FileSystemMemory.getFiles': getFiles,
|
|
@@ -5355,6 +5385,7 @@ const commandMap = {
|
|
|
5355
5385
|
'IndexedDb.getValuesByIndexName': getValuesByIndexName,
|
|
5356
5386
|
'IndexedDb.saveValue': saveValue,
|
|
5357
5387
|
'IndexedDb.set': set$4,
|
|
5388
|
+
'Languages.getLanguages': getLanguages,
|
|
5358
5389
|
'SearchFileWithFetch.searchFileWithFetch': searchFile$1,
|
|
5359
5390
|
'SearchFileWithHtml.searchFileWithHtml': searchFile,
|
|
5360
5391
|
'TextSearchFetch.textSearch': textSearch$2,
|
|
@@ -5363,6 +5394,7 @@ const commandMap = {
|
|
|
5363
5394
|
'WebView.create3': createWebView3,
|
|
5364
5395
|
'WebView.createWebViewWorkerRpc': createWebViewWorkerRpc,
|
|
5365
5396
|
'WebView.getRpcInfo': getRpcInfo,
|
|
5397
|
+
'WebViews.getWebViews': getWebViews,
|
|
5366
5398
|
['ExtensionHostDebug.evaluate']: evaluate,
|
|
5367
5399
|
['ExtensionHostDebug.getProperties']: getProperties,
|
|
5368
5400
|
['ExtensionHostDebug.listProcesses']: listProcesses,
|
package/package.json
CHANGED