@lvce-editor/extension-detail-view 7.21.0 → 7.22.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/extensionDetailViewWorkerMain.js +143 -146
- package/package.json +1 -1
|
@@ -544,6 +544,7 @@ const Web$1 = 1;
|
|
|
544
544
|
const Electron$1 = 2;
|
|
545
545
|
|
|
546
546
|
const ClipBoardWorker = 3400;
|
|
547
|
+
const DialogWorker = 7014;
|
|
547
548
|
const ExtensionHostWorker = 44;
|
|
548
549
|
const ExtensionManagementWorker = 9006;
|
|
549
550
|
const FileSystemWorker$1 = 209;
|
|
@@ -2692,7 +2693,7 @@ const createMockRpc = ({
|
|
|
2692
2693
|
};
|
|
2693
2694
|
|
|
2694
2695
|
const rpcs = Object.create(null);
|
|
2695
|
-
const set$
|
|
2696
|
+
const set$d = (id, rpc) => {
|
|
2696
2697
|
rpcs[id] = rpc;
|
|
2697
2698
|
};
|
|
2698
2699
|
const get$3 = id => {
|
|
@@ -2725,7 +2726,7 @@ const create$2 = rpcId => {
|
|
|
2725
2726
|
const mockRpc = createMockRpc({
|
|
2726
2727
|
commandMap
|
|
2727
2728
|
});
|
|
2728
|
-
set$
|
|
2729
|
+
set$d(rpcId, mockRpc);
|
|
2729
2730
|
// @ts-ignore
|
|
2730
2731
|
mockRpc[Symbol.dispose] = () => {
|
|
2731
2732
|
remove(rpcId);
|
|
@@ -2734,22 +2735,27 @@ const create$2 = rpcId => {
|
|
|
2734
2735
|
return mockRpc;
|
|
2735
2736
|
},
|
|
2736
2737
|
set(rpc) {
|
|
2737
|
-
set$
|
|
2738
|
+
set$d(rpcId, rpc);
|
|
2738
2739
|
}
|
|
2739
2740
|
};
|
|
2740
2741
|
};
|
|
2741
2742
|
|
|
2742
2743
|
const {
|
|
2743
|
-
invoke: invoke$
|
|
2744
|
-
set: set$
|
|
2744
|
+
invoke: invoke$6,
|
|
2745
|
+
set: set$c
|
|
2745
2746
|
} = create$2(ClipBoardWorker);
|
|
2746
2747
|
const writeText$1 = async text => {
|
|
2747
|
-
return invoke$
|
|
2748
|
+
return invoke$6('ClipBoard.writeText', text);
|
|
2748
2749
|
};
|
|
2749
2750
|
const writeImage = async image => {
|
|
2750
|
-
return invoke$
|
|
2751
|
+
return invoke$6('ClipBoard.writeImage', image);
|
|
2751
2752
|
};
|
|
2752
2753
|
|
|
2754
|
+
const {
|
|
2755
|
+
invoke: invoke$5,
|
|
2756
|
+
set: set$b
|
|
2757
|
+
} = create$2(DialogWorker);
|
|
2758
|
+
|
|
2753
2759
|
const {
|
|
2754
2760
|
set: set$a
|
|
2755
2761
|
} = create$2(ExtensionHostWorker);
|
|
@@ -2832,6 +2838,10 @@ const sendMessagePortToClipBoardWorker = async (port, rpcId) => {
|
|
|
2832
2838
|
const command = 'ClipBoard.handleMessagePort';
|
|
2833
2839
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToClipBoardWorker', port, command, rpcId);
|
|
2834
2840
|
};
|
|
2841
|
+
const sendMessagePortToDialogWorker = async port => {
|
|
2842
|
+
const command = 'HandleMessagePort.handleMessagePort';
|
|
2843
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToDialogWorker', port, command);
|
|
2844
|
+
};
|
|
2835
2845
|
const sendMessagePortToMarkdownWorker$1 = async (port, rpcId) => {
|
|
2836
2846
|
const command = 'Markdown.handleMessagePort';
|
|
2837
2847
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToMarkdownWorker', port, command, rpcId);
|
|
@@ -2844,10 +2854,6 @@ const sendMessagePortToExtensionHostWorker$1 = async (port, rpcId = 0) => {
|
|
|
2844
2854
|
const command = 'HandleMessagePort.handleMessagePort2';
|
|
2845
2855
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, rpcId);
|
|
2846
2856
|
};
|
|
2847
|
-
const confirm = async (message, options) => {
|
|
2848
|
-
const result = await invoke$1('ConfirmPrompt.prompt', message, options);
|
|
2849
|
-
return result;
|
|
2850
|
-
};
|
|
2851
2857
|
const sendMessagePortToExtensionManagementWorker = async (port, rpcId) => {
|
|
2852
2858
|
const command = 'Extensions.handleMessagePort';
|
|
2853
2859
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionManagementWorker', port, command, rpcId);
|
|
@@ -3271,23 +3277,19 @@ const getCache = (cacheName, bucketName) => {
|
|
|
3271
3277
|
return cachedCaches[cacheName];
|
|
3272
3278
|
};
|
|
3273
3279
|
|
|
3274
|
-
|
|
3275
|
-
const
|
|
3276
|
-
cacheName$1 = `${applicationName}/markdown-cache`;
|
|
3277
|
-
};
|
|
3278
|
-
const has = async (key, bucketName, getCacheFunction = getCache) => {
|
|
3279
|
-
const cache = await getCacheFunction(cacheName$1, bucketName);
|
|
3280
|
+
const has = async (cacheName, key, bucketName, getCacheFunction = getCache) => {
|
|
3281
|
+
const cache = await getCacheFunction(cacheName, bucketName);
|
|
3280
3282
|
const response = await cache.match(key);
|
|
3281
3283
|
return Boolean(response);
|
|
3282
3284
|
};
|
|
3283
|
-
const get$2 = async (key, bucketName, getCacheFunction = getCache) => {
|
|
3284
|
-
const cache = await getCacheFunction(cacheName
|
|
3285
|
+
const get$2 = async (cacheName, key, bucketName, getCacheFunction = getCache) => {
|
|
3286
|
+
const cache = await getCacheFunction(cacheName, bucketName);
|
|
3285
3287
|
const response = await cache.match(key);
|
|
3286
3288
|
const text = await response?.text();
|
|
3287
3289
|
return text || '';
|
|
3288
3290
|
};
|
|
3289
|
-
const set$4 = async (key, bucketName, value, getCacheFunction = getCache) => {
|
|
3290
|
-
const cache = await getCacheFunction(cacheName
|
|
3291
|
+
const set$4 = async (cacheName, key, bucketName, value, getCacheFunction = getCache) => {
|
|
3292
|
+
const cache = await getCacheFunction(cacheName, bucketName);
|
|
3291
3293
|
await cache.put(key, new Response(value, {
|
|
3292
3294
|
headers: {
|
|
3293
3295
|
'Content-Length': `${value.length}`,
|
|
@@ -3296,25 +3298,25 @@ const set$4 = async (key, bucketName, value, getCacheFunction = getCache) => {
|
|
|
3296
3298
|
}));
|
|
3297
3299
|
};
|
|
3298
3300
|
|
|
3299
|
-
const renderMarkdownCached = async (markdown, options) => {
|
|
3301
|
+
const renderMarkdownCached = async (markdown, options, cacheName) => {
|
|
3300
3302
|
const cacheKey = await getMarkdownCacheKey(markdown, options);
|
|
3301
3303
|
const bucketName = `markdown-cache`;
|
|
3302
|
-
const hasItem = await has(cacheKey, bucketName);
|
|
3304
|
+
const hasItem = await has(cacheName, cacheKey, bucketName);
|
|
3303
3305
|
if (hasItem) {
|
|
3304
|
-
const value = await get$2(cacheKey, bucketName);
|
|
3306
|
+
const value = await get$2(cacheName, cacheKey, bucketName);
|
|
3305
3307
|
return value; // TODO validate if it's valid
|
|
3306
3308
|
}
|
|
3307
3309
|
const html = await render(markdown, options);
|
|
3308
|
-
await set$4(cacheKey, bucketName, html);
|
|
3310
|
+
await set$4(cacheName, cacheKey, bucketName, html);
|
|
3309
3311
|
return html;
|
|
3310
3312
|
};
|
|
3311
3313
|
|
|
3312
|
-
const renderMarkdown = async (markdown, options) => {
|
|
3313
|
-
const html = await renderMarkdownCached(markdown, options);
|
|
3314
|
+
const renderMarkdown = async (markdown, options, cacheName) => {
|
|
3315
|
+
const html = await renderMarkdownCached(markdown, options, cacheName);
|
|
3314
3316
|
return html;
|
|
3315
3317
|
};
|
|
3316
3318
|
|
|
3317
|
-
const getThemeDetails = async (extension, baseUrl, locationProtocol) => {
|
|
3319
|
+
const getThemeDetails = async (extension, baseUrl, locationProtocol, cacheName) => {
|
|
3318
3320
|
const {
|
|
3319
3321
|
colorThemes,
|
|
3320
3322
|
iconThemes,
|
|
@@ -3324,7 +3326,7 @@ const getThemeDetails = async (extension, baseUrl, locationProtocol) => {
|
|
|
3324
3326
|
const rendered = await renderMarkdown(markdown, {
|
|
3325
3327
|
baseUrl,
|
|
3326
3328
|
locationProtocol
|
|
3327
|
-
});
|
|
3329
|
+
}, cacheName);
|
|
3328
3330
|
const themesMarkdownDom = await getMarkdownVirtualDom(rendered);
|
|
3329
3331
|
return {
|
|
3330
3332
|
themesMarkdownDom
|
|
@@ -3914,6 +3916,7 @@ const create = (uid, uri, x, y, width, height, platform, assetDir) => {
|
|
|
3914
3916
|
baseUrl: '',
|
|
3915
3917
|
builtinExtensionsBadgeEnabled: true,
|
|
3916
3918
|
buttons: [],
|
|
3919
|
+
cacheName: '',
|
|
3917
3920
|
categories: [],
|
|
3918
3921
|
changelogScrollTop: 0,
|
|
3919
3922
|
changelogVirtualDom: [],
|
|
@@ -4441,7 +4444,7 @@ const updateExtensionStatus = async (state, updateFunction) => {
|
|
|
4441
4444
|
} = state;
|
|
4442
4445
|
const error = await updateFunction(extensionId, platform);
|
|
4443
4446
|
if (error) {
|
|
4444
|
-
await
|
|
4447
|
+
await invoke$5('ConfirmPrompt.prompt', `${error}`);
|
|
4445
4448
|
}
|
|
4446
4449
|
const extension = await getExtension(extensionId, platform);
|
|
4447
4450
|
const disabled = extension?.disabled;
|
|
@@ -4474,6 +4477,7 @@ const selectFeature = async (state, name) => {
|
|
|
4474
4477
|
}
|
|
4475
4478
|
const {
|
|
4476
4479
|
baseUrl,
|
|
4480
|
+
cacheName,
|
|
4477
4481
|
extension,
|
|
4478
4482
|
features,
|
|
4479
4483
|
locationProtocol
|
|
@@ -4491,7 +4495,7 @@ const selectFeature = async (state, name) => {
|
|
|
4491
4495
|
};
|
|
4492
4496
|
});
|
|
4493
4497
|
const fn = getFeatureDetailsHandler(name);
|
|
4494
|
-
const partialNewState = await fn(extension, baseUrl, locationProtocol);
|
|
4498
|
+
const partialNewState = await fn(extension, baseUrl, locationProtocol, cacheName);
|
|
4495
4499
|
return {
|
|
4496
4500
|
...state,
|
|
4497
4501
|
...partialNewState,
|
|
@@ -4542,7 +4546,7 @@ const handleClickSetColorTheme = async state => {
|
|
|
4542
4546
|
if (colorThemeId) {
|
|
4543
4547
|
const error = await setColorTheme(colorThemeId);
|
|
4544
4548
|
if (error) {
|
|
4545
|
-
await
|
|
4549
|
+
await invoke$5('ConfirmPrompt.prompt', `${error}`);
|
|
4546
4550
|
}
|
|
4547
4551
|
const isBuiltin = extension?.isBuiltin || extension?.builtin || false;
|
|
4548
4552
|
const colorThemeLabel = getColorThemeLabel(extension) || '';
|
|
@@ -4624,6 +4628,10 @@ class ExtensionNotFoundError extends Error {
|
|
|
4624
4628
|
}
|
|
4625
4629
|
}
|
|
4626
4630
|
|
|
4631
|
+
const getApplicationName = async () => {
|
|
4632
|
+
return invoke$1('Layout.getApplicationName');
|
|
4633
|
+
};
|
|
4634
|
+
|
|
4627
4635
|
const getRemoteSrc = uri => {
|
|
4628
4636
|
const src = `/remote${uri}`;
|
|
4629
4637
|
return src;
|
|
@@ -5524,6 +5532,8 @@ const loadContentInternal = async (state, platform, savedState, isTest = false)
|
|
|
5524
5532
|
throw new ExtensionNotFoundError(id);
|
|
5525
5533
|
}
|
|
5526
5534
|
const currentColorThemeId = await getCurrentColorTheme();
|
|
5535
|
+
const applicationName = await getApplicationName();
|
|
5536
|
+
const cacheName = `${applicationName}/markdown-cache`;
|
|
5527
5537
|
const commit = await getCommit();
|
|
5528
5538
|
const languages = await getSyntaxLanguages(platform, assetDir);
|
|
5529
5539
|
const headerData = loadHeaderContent(state, platform, extension);
|
|
@@ -5554,7 +5564,7 @@ const loadContentInternal = async (state, platform, savedState, isTest = false)
|
|
|
5554
5564
|
languages,
|
|
5555
5565
|
linksExternal: true,
|
|
5556
5566
|
locationProtocol
|
|
5557
|
-
});
|
|
5567
|
+
}, cacheName);
|
|
5558
5568
|
const detailsVirtualDom = await getMarkdownVirtualDom(readmeHtml, {
|
|
5559
5569
|
scrollToTopEnabled: true
|
|
5560
5570
|
});
|
|
@@ -5596,6 +5606,7 @@ const loadContentInternal = async (state, platform, savedState, isTest = false)
|
|
|
5596
5606
|
badge,
|
|
5597
5607
|
baseUrl,
|
|
5598
5608
|
buttons,
|
|
5609
|
+
cacheName,
|
|
5599
5610
|
categories,
|
|
5600
5611
|
changelogScrollTop,
|
|
5601
5612
|
commit,
|
|
@@ -5813,7 +5824,7 @@ const handleReadmeLinkClick = async (linkProtectionEnabled, platform, href) => {
|
|
|
5813
5824
|
// TODO what to do about mail links?
|
|
5814
5825
|
if (linkProtectionEnabled) {
|
|
5815
5826
|
const message = `Do you want to open this external link?\n\n${href}`;
|
|
5816
|
-
const confirmed = await
|
|
5827
|
+
const confirmed = await invoke$5('ConfirmPrompt.prompt', message);
|
|
5817
5828
|
if (!confirmed) {
|
|
5818
5829
|
return;
|
|
5819
5830
|
}
|
|
@@ -6144,7 +6155,7 @@ const mergeMarkdownVirtualDoms = chunks => {
|
|
|
6144
6155
|
}
|
|
6145
6156
|
return root ? [root, ...children] : [];
|
|
6146
6157
|
};
|
|
6147
|
-
const renderGithubReleases = async (result, githubRepository, languages, locationProtocol) => {
|
|
6158
|
+
const renderGithubReleases = async (result, githubRepository, cacheName, languages, locationProtocol) => {
|
|
6148
6159
|
const chunks = [];
|
|
6149
6160
|
const {
|
|
6150
6161
|
isTruncated,
|
|
@@ -6164,7 +6175,7 @@ const renderGithubReleases = async (result, githubRepository, languages, locatio
|
|
|
6164
6175
|
languages,
|
|
6165
6176
|
linksExternal: true,
|
|
6166
6177
|
locationProtocol
|
|
6167
|
-
});
|
|
6178
|
+
}, cacheName);
|
|
6168
6179
|
chunks.push([...(await getMarkdownVirtualDom(html))]);
|
|
6169
6180
|
}
|
|
6170
6181
|
return addScrollToTopVirtualDom(mergeMarkdownVirtualDoms(chunks));
|
|
@@ -6172,6 +6183,7 @@ const renderGithubReleases = async (result, githubRepository, languages, locatio
|
|
|
6172
6183
|
const selectTabChangelog = async state => {
|
|
6173
6184
|
const {
|
|
6174
6185
|
baseUrl,
|
|
6186
|
+
cacheName,
|
|
6175
6187
|
extension,
|
|
6176
6188
|
extensionUri,
|
|
6177
6189
|
languages,
|
|
@@ -6183,7 +6195,7 @@ const selectTabChangelog = async state => {
|
|
|
6183
6195
|
if (githubRepository) {
|
|
6184
6196
|
try {
|
|
6185
6197
|
const result = await loadGithubReleases(githubRepository);
|
|
6186
|
-
changelogDom = await renderGithubReleases(result, githubRepository, languages, locationProtocol);
|
|
6198
|
+
changelogDom = await renderGithubReleases(result, githubRepository, cacheName, languages, locationProtocol);
|
|
6187
6199
|
} catch (error) {
|
|
6188
6200
|
const message = error instanceof GithubReleasesError ? error.message : 'GitHub releases could not be loaded. Please try again later.';
|
|
6189
6201
|
const html = await renderMarkdown(`# Changelog\n\n${message}`, {
|
|
@@ -6191,7 +6203,7 @@ const selectTabChangelog = async state => {
|
|
|
6191
6203
|
languages,
|
|
6192
6204
|
linksExternal: true,
|
|
6193
6205
|
locationProtocol
|
|
6194
|
-
});
|
|
6206
|
+
}, cacheName);
|
|
6195
6207
|
changelogDom = await getMarkdownVirtualDom(html, {
|
|
6196
6208
|
scrollToTopEnabled: true
|
|
6197
6209
|
});
|
|
@@ -6203,7 +6215,7 @@ const selectTabChangelog = async state => {
|
|
|
6203
6215
|
languages,
|
|
6204
6216
|
linksExternal: true,
|
|
6205
6217
|
locationProtocol
|
|
6206
|
-
});
|
|
6218
|
+
}, cacheName);
|
|
6207
6219
|
changelogDom = await getMarkdownVirtualDom(html, {
|
|
6208
6220
|
scrollToTopEnabled: true
|
|
6209
6221
|
});
|
|
@@ -6229,6 +6241,7 @@ const selectTabDefault = async state => {
|
|
|
6229
6241
|
const selectTabDetails = async state => {
|
|
6230
6242
|
const {
|
|
6231
6243
|
baseUrl,
|
|
6244
|
+
cacheName,
|
|
6232
6245
|
languages,
|
|
6233
6246
|
locationProtocol,
|
|
6234
6247
|
readmeUrl,
|
|
@@ -6240,7 +6253,7 @@ const selectTabDetails = async state => {
|
|
|
6240
6253
|
languages,
|
|
6241
6254
|
linksExternal: true,
|
|
6242
6255
|
locationProtocol
|
|
6243
|
-
});
|
|
6256
|
+
}, cacheName);
|
|
6244
6257
|
const detailsDom = await getMarkdownVirtualDom(readmeHtml);
|
|
6245
6258
|
const newTabs = tabs.map(tab => {
|
|
6246
6259
|
return {
|
|
@@ -6259,6 +6272,7 @@ const selectTabDetails = async state => {
|
|
|
6259
6272
|
const selectTabFeatures = async state => {
|
|
6260
6273
|
const {
|
|
6261
6274
|
baseUrl,
|
|
6275
|
+
cacheName,
|
|
6262
6276
|
extension,
|
|
6263
6277
|
features,
|
|
6264
6278
|
locationProtocol,
|
|
@@ -6270,7 +6284,7 @@ const selectTabFeatures = async state => {
|
|
|
6270
6284
|
}
|
|
6271
6285
|
const actualSelectedFeature = selectedFeature || Theme;
|
|
6272
6286
|
const fn = getFeatureDetailsHandler(actualSelectedFeature);
|
|
6273
|
-
const partialNewState = await fn(extension, baseUrl, locationProtocol);
|
|
6287
|
+
const partialNewState = await fn(extension, baseUrl, locationProtocol, cacheName);
|
|
6274
6288
|
const newTabs = tabs.map(tab => {
|
|
6275
6289
|
return {
|
|
6276
6290
|
...tab,
|
|
@@ -6339,110 +6353,6 @@ const hideSizeLink = state => {
|
|
|
6339
6353
|
};
|
|
6340
6354
|
};
|
|
6341
6355
|
|
|
6342
|
-
const createRpc = async () => {
|
|
6343
|
-
const rpc = await create$4({
|
|
6344
|
-
commandMap: {},
|
|
6345
|
-
send: async port => {
|
|
6346
|
-
await sendMessagePortToClipBoardWorker(port, 0);
|
|
6347
|
-
}
|
|
6348
|
-
});
|
|
6349
|
-
return rpc;
|
|
6350
|
-
};
|
|
6351
|
-
const initializeClipBoardWorker = async () => {
|
|
6352
|
-
const rpc = await createRpc();
|
|
6353
|
-
set$b(rpc);
|
|
6354
|
-
};
|
|
6355
|
-
|
|
6356
|
-
const sendMessagePortToExtensionHostWorker = async port => {
|
|
6357
|
-
await sendMessagePortToExtensionHostWorker$1(port, 0);
|
|
6358
|
-
};
|
|
6359
|
-
|
|
6360
|
-
const createExtensionHostWorkerRpc = async () => {
|
|
6361
|
-
try {
|
|
6362
|
-
const rpc = await create$5({
|
|
6363
|
-
commandMap: {},
|
|
6364
|
-
send: sendMessagePortToExtensionHostWorker
|
|
6365
|
-
});
|
|
6366
|
-
return rpc;
|
|
6367
|
-
} catch (error) {
|
|
6368
|
-
throw new VError(error, `Failed to create extension host rpc`);
|
|
6369
|
-
}
|
|
6370
|
-
};
|
|
6371
|
-
|
|
6372
|
-
const {
|
|
6373
|
-
set
|
|
6374
|
-
} = ExtensionHost;
|
|
6375
|
-
|
|
6376
|
-
const initializeExtensionHostWorker = async () => {
|
|
6377
|
-
const rpc = await createExtensionHostWorkerRpc();
|
|
6378
|
-
set(rpc);
|
|
6379
|
-
};
|
|
6380
|
-
|
|
6381
|
-
const createExtensionManagementWorkerRpc = async () => {
|
|
6382
|
-
try {
|
|
6383
|
-
const rpc = await create$5({
|
|
6384
|
-
commandMap: {},
|
|
6385
|
-
send: port => sendMessagePortToExtensionManagementWorker(port, 0)
|
|
6386
|
-
});
|
|
6387
|
-
return rpc;
|
|
6388
|
-
} catch (error) {
|
|
6389
|
-
throw new VError(error, `Failed to create extension management rpc`);
|
|
6390
|
-
}
|
|
6391
|
-
};
|
|
6392
|
-
|
|
6393
|
-
const initializeExtensionManagementWorker = async () => {
|
|
6394
|
-
try {
|
|
6395
|
-
const rpc = await createExtensionManagementWorkerRpc();
|
|
6396
|
-
set$9(rpc);
|
|
6397
|
-
} catch {
|
|
6398
|
-
// ignore
|
|
6399
|
-
}
|
|
6400
|
-
};
|
|
6401
|
-
|
|
6402
|
-
const sendMessagePortToFileSystemWorker = async port => {
|
|
6403
|
-
await sendMessagePortToFileSystemWorker$1(port, 0);
|
|
6404
|
-
};
|
|
6405
|
-
|
|
6406
|
-
const createFileSystemWorkerRpc = async () => {
|
|
6407
|
-
try {
|
|
6408
|
-
const rpc = await create$5({
|
|
6409
|
-
commandMap: {},
|
|
6410
|
-
send: sendMessagePortToFileSystemWorker
|
|
6411
|
-
});
|
|
6412
|
-
return rpc;
|
|
6413
|
-
} catch (error) {
|
|
6414
|
-
throw new VError(error, `Failed to create file system worker rpc`);
|
|
6415
|
-
}
|
|
6416
|
-
};
|
|
6417
|
-
|
|
6418
|
-
const initializeFileSystemWorker = async () => {
|
|
6419
|
-
const rpc = await createFileSystemWorkerRpc();
|
|
6420
|
-
set$3(rpc);
|
|
6421
|
-
};
|
|
6422
|
-
|
|
6423
|
-
const sendMessagePortToMarkdownWorker = async port => {
|
|
6424
|
-
await sendMessagePortToMarkdownWorker$1(port, 0);
|
|
6425
|
-
};
|
|
6426
|
-
|
|
6427
|
-
const createMarkdownWorkerRpc = async () => {
|
|
6428
|
-
const rpc = await create$4({
|
|
6429
|
-
commandMap: {},
|
|
6430
|
-
send: sendMessagePortToMarkdownWorker
|
|
6431
|
-
});
|
|
6432
|
-
return rpc;
|
|
6433
|
-
};
|
|
6434
|
-
|
|
6435
|
-
const initializeMarkdownWorker = async () => {
|
|
6436
|
-
const rpc = await createMarkdownWorkerRpc();
|
|
6437
|
-
set$5(rpc);
|
|
6438
|
-
};
|
|
6439
|
-
|
|
6440
|
-
const initialize = async applicationName => {
|
|
6441
|
-
setApplicationName(applicationName);
|
|
6442
|
-
// TODO load markdown worker only when needed
|
|
6443
|
-
await Promise.all([initializeMarkdownWorker(), initializeFileSystemWorker(), initializeExtensionHostWorker(), initializeExtensionManagementWorker(), initializeClipBoardWorker()]);
|
|
6444
|
-
};
|
|
6445
|
-
|
|
6446
6356
|
const loadContent2 = async (state, savedState, isTest = false) => {
|
|
6447
6357
|
const {
|
|
6448
6358
|
platform
|
|
@@ -7362,7 +7272,6 @@ const commandMap = {
|
|
|
7362
7272
|
'ExtensionDetail.handleWheel': wrapCommand(handleScroll),
|
|
7363
7273
|
// deprecated
|
|
7364
7274
|
'ExtensionDetail.hideSizeLink': wrapCommand(hideSizeLink),
|
|
7365
|
-
'ExtensionDetail.initialize': initialize,
|
|
7366
7275
|
'ExtensionDetail.loadContent2': wrapCommand(loadContent2),
|
|
7367
7276
|
'ExtensionDetail.mockGithubApi': wrapCommand(handleMockGithubApi),
|
|
7368
7277
|
'ExtensionDetail.openImageInNewTab': wrapCommand(openImageInNewTab),
|
|
@@ -7376,12 +7285,100 @@ const commandMap = {
|
|
|
7376
7285
|
'ExtensionDetail.terminate': terminate
|
|
7377
7286
|
};
|
|
7378
7287
|
|
|
7288
|
+
const createRpc = async () => {
|
|
7289
|
+
const rpc = await create$4({
|
|
7290
|
+
commandMap: {},
|
|
7291
|
+
send: async port => {
|
|
7292
|
+
await sendMessagePortToClipBoardWorker(port, 0);
|
|
7293
|
+
}
|
|
7294
|
+
});
|
|
7295
|
+
return rpc;
|
|
7296
|
+
};
|
|
7297
|
+
const initializeClipBoardWorker = async () => {
|
|
7298
|
+
const rpc = await createRpc();
|
|
7299
|
+
set$c(rpc);
|
|
7300
|
+
};
|
|
7301
|
+
|
|
7302
|
+
const sendMessagePortToExtensionHostWorker = async port => {
|
|
7303
|
+
await sendMessagePortToExtensionHostWorker$1(port, 0);
|
|
7304
|
+
};
|
|
7305
|
+
|
|
7306
|
+
const createExtensionHostWorkerRpc = async () => {
|
|
7307
|
+
return create$4({
|
|
7308
|
+
commandMap: {},
|
|
7309
|
+
send: sendMessagePortToExtensionHostWorker
|
|
7310
|
+
});
|
|
7311
|
+
};
|
|
7312
|
+
|
|
7313
|
+
const {
|
|
7314
|
+
set
|
|
7315
|
+
} = ExtensionHost;
|
|
7316
|
+
|
|
7317
|
+
const initializeExtensionHostWorker = async () => {
|
|
7318
|
+
const rpc = await createExtensionHostWorkerRpc();
|
|
7319
|
+
set(rpc);
|
|
7320
|
+
};
|
|
7321
|
+
|
|
7322
|
+
const createExtensionManagementWorkerRpc = async () => {
|
|
7323
|
+
return create$4({
|
|
7324
|
+
commandMap: {},
|
|
7325
|
+
send: port => sendMessagePortToExtensionManagementWorker(port, 0)
|
|
7326
|
+
});
|
|
7327
|
+
};
|
|
7328
|
+
|
|
7329
|
+
const initializeExtensionManagementWorker = async () => {
|
|
7330
|
+
try {
|
|
7331
|
+
const rpc = await createExtensionManagementWorkerRpc();
|
|
7332
|
+
set$9(rpc);
|
|
7333
|
+
} catch {
|
|
7334
|
+
// ignore
|
|
7335
|
+
}
|
|
7336
|
+
};
|
|
7337
|
+
|
|
7338
|
+
const sendMessagePortToFileSystemWorker = async port => {
|
|
7339
|
+
await sendMessagePortToFileSystemWorker$1(port, 0);
|
|
7340
|
+
};
|
|
7341
|
+
|
|
7342
|
+
const createFileSystemWorkerRpc = async () => {
|
|
7343
|
+
return create$4({
|
|
7344
|
+
commandMap: {},
|
|
7345
|
+
send: sendMessagePortToFileSystemWorker
|
|
7346
|
+
});
|
|
7347
|
+
};
|
|
7348
|
+
|
|
7349
|
+
const initializeFileSystemWorker = async () => {
|
|
7350
|
+
const rpc = await createFileSystemWorkerRpc();
|
|
7351
|
+
set$3(rpc);
|
|
7352
|
+
};
|
|
7353
|
+
|
|
7354
|
+
const sendMessagePortToMarkdownWorker = async port => {
|
|
7355
|
+
await sendMessagePortToMarkdownWorker$1(port, 0);
|
|
7356
|
+
};
|
|
7357
|
+
|
|
7358
|
+
const createMarkdownWorkerRpc = async () => {
|
|
7359
|
+
const rpc = await create$4({
|
|
7360
|
+
commandMap: {},
|
|
7361
|
+
send: sendMessagePortToMarkdownWorker
|
|
7362
|
+
});
|
|
7363
|
+
return rpc;
|
|
7364
|
+
};
|
|
7365
|
+
|
|
7366
|
+
const initializeMarkdownWorker = async () => {
|
|
7367
|
+
const rpc = await createMarkdownWorkerRpc();
|
|
7368
|
+
set$5(rpc);
|
|
7369
|
+
};
|
|
7370
|
+
|
|
7379
7371
|
const listen = async () => {
|
|
7380
7372
|
registerCommands(commandMap);
|
|
7381
7373
|
const rpc = await create$3({
|
|
7382
7374
|
commandMap: commandMap
|
|
7383
7375
|
});
|
|
7384
7376
|
set$6(rpc);
|
|
7377
|
+
const [dialogRpc] = await Promise.all([create$4({
|
|
7378
|
+
commandMap: {},
|
|
7379
|
+
send: sendMessagePortToDialogWorker
|
|
7380
|
+
}), initializeMarkdownWorker(), initializeFileSystemWorker(), initializeExtensionHostWorker(), initializeExtensionManagementWorker(), initializeClipBoardWorker()]);
|
|
7381
|
+
set$b(dialogRpc);
|
|
7385
7382
|
};
|
|
7386
7383
|
|
|
7387
7384
|
const main = async () => {
|