@lvce-editor/extension-detail-view 4.18.0 → 5.1.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.
@@ -19,7 +19,6 @@ const ContentSecurityPolicy = 'ContentSecurityPolicy';
19
19
  const Copy = 'Copy';
20
20
  const CopyImage = 'Copy Image';
21
21
  const CopyImageUrl = 'Copy Image Url';
22
- const CopyLink = 'Copy Link';
23
22
  const Details$1 = 'Details';
24
23
  const Disable$1 = 'Disable';
25
24
  const Elements = 'Elements';
@@ -78,9 +77,6 @@ const marketplace = () => {
78
77
  const categories = () => {
79
78
  return i18nString(Categories$1);
80
79
  };
81
- const copyLink = () => {
82
- return i18nString(CopyLink);
83
- };
84
80
  const resources = () => {
85
81
  return i18nString(Resources$1);
86
82
  };
@@ -327,6 +323,7 @@ const TargetHref = 'event.target.href';
327
323
  const TargetName = 'event.target.name';
328
324
 
329
325
  const ExtensionDetailReadme = 20;
326
+ const ExtensionDetailIconContextMenu$3 = 4091;
330
327
 
331
328
  const None$2 = 0;
332
329
 
@@ -1926,7 +1923,7 @@ const send = (transport, method, ...params) => {
1926
1923
  const message = create$4(method, params);
1927
1924
  transport.send(message);
1928
1925
  };
1929
- const invoke$5 = (ipc, method, ...params) => {
1926
+ const invoke$6 = (ipc, method, ...params) => {
1930
1927
  return invokeHelper(ipc, method, params, false);
1931
1928
  };
1932
1929
  const invokeAndTransfer$4 = (ipc, method, ...params) => {
@@ -1965,7 +1962,7 @@ const createRpc = ipc => {
1965
1962
  send(ipc, method, ...params);
1966
1963
  },
1967
1964
  invoke(method, ...params) {
1968
- return invoke$5(ipc, method, ...params);
1965
+ return invoke$6(ipc, method, ...params);
1969
1966
  },
1970
1967
  invokeAndTransfer(method, ...params) {
1971
1968
  return invokeAndTransfer$4(ipc, method, ...params);
@@ -2075,22 +2072,22 @@ const createMockRpc = ({
2075
2072
  };
2076
2073
 
2077
2074
  const {
2078
- invoke: invoke$4,
2075
+ invoke: invoke$5,
2079
2076
  invokeAndTransfer: invokeAndTransfer$3,
2080
2077
  set: set$9,
2081
2078
  dispose: dispose$5
2082
2079
  } = create$7(ExtensionHostWorker);
2083
2080
  const executeReferenceProvider = async (id, offset) => {
2084
2081
  // @ts-ignore
2085
- return invoke$4('ExtensionHostReference.executeReferenceProvider', id, offset);
2082
+ return invoke$5('ExtensionHostReference.executeReferenceProvider', id, offset);
2086
2083
  };
2087
2084
  const executeFileReferenceProvider = async id => {
2088
2085
  // @ts-ignore
2089
- return invoke$4('ExtensionHostReference.executeFileReferenceProvider', id);
2086
+ return invoke$5('ExtensionHostReference.executeFileReferenceProvider', id);
2090
2087
  };
2091
2088
  const getRuntimeStatus$2 = async extensionId => {
2092
2089
  // @ts-ignore
2093
- return invoke$4('ExtensionHost.getRuntimeStatus', extensionId);
2090
+ return invoke$5('ExtensionHost.getRuntimeStatus', extensionId);
2094
2091
  };
2095
2092
  const registerMockRpc$3 = commandMap => {
2096
2093
  const mockRpc = createMockRpc({
@@ -2106,67 +2103,67 @@ const ExtensionHost = {
2106
2103
  executeFileReferenceProvider,
2107
2104
  executeReferenceProvider,
2108
2105
  getRuntimeStatus: getRuntimeStatus$2,
2109
- invoke: invoke$4,
2106
+ invoke: invoke$5,
2110
2107
  invokeAndTransfer: invokeAndTransfer$3,
2111
2108
  registerMockRpc: registerMockRpc$3,
2112
2109
  set: set$9
2113
2110
  };
2114
2111
 
2115
2112
  const {
2116
- invoke: invoke$3,
2113
+ invoke: invoke$4,
2117
2114
  invokeAndTransfer: invokeAndTransfer$2,
2118
2115
  set: set$8,
2119
2116
  dispose: dispose$4
2120
2117
  } = create$7(FileSystemWorker$1);
2121
2118
  const remove = async dirent => {
2122
- return invoke$3('FileSystem.remove', dirent);
2119
+ return invoke$4('FileSystem.remove', dirent);
2123
2120
  };
2124
2121
  const readDirWithFileTypes = async uri => {
2125
- return invoke$3('FileSystem.readDirWithFileTypes', uri);
2122
+ return invoke$4('FileSystem.readDirWithFileTypes', uri);
2126
2123
  };
2127
2124
  const getPathSeparator = async root => {
2128
2125
  // @ts-ignore
2129
- return invoke$3('FileSystem.getPathSeparator', root);
2126
+ return invoke$4('FileSystem.getPathSeparator', root);
2130
2127
  };
2131
2128
  const getRealPath = async path => {
2132
- return invoke$3('FileSystem.getRealPath', path);
2129
+ return invoke$4('FileSystem.getRealPath', path);
2133
2130
  };
2134
2131
  const stat = async dirent => {
2135
- return invoke$3('FileSystem.stat', dirent);
2132
+ return invoke$4('FileSystem.stat', dirent);
2136
2133
  };
2137
2134
  const createFile = async uri => {
2138
- return invoke$3('FileSystem.writeFile', uri, '');
2135
+ return invoke$4('FileSystem.writeFile', uri, '');
2139
2136
  };
2140
2137
  const readFile$3 = async uri => {
2141
- return invoke$3('FileSystem.readFile', uri);
2138
+ return invoke$4('FileSystem.readFile', uri);
2142
2139
  };
2143
2140
  const writeFile = async (uri, content) => {
2144
- return invoke$3('FileSystem.writeFile', uri, content);
2141
+ return invoke$4('FileSystem.writeFile', uri, content);
2145
2142
  };
2146
2143
  const mkdir = async uri => {
2147
- return invoke$3('FileSystem.mkdir', uri);
2144
+ return invoke$4('FileSystem.mkdir', uri);
2148
2145
  };
2149
2146
  const rename = async (oldUri, newUri) => {
2150
- return invoke$3('FileSystem.rename', oldUri, newUri);
2147
+ return invoke$4('FileSystem.rename', oldUri, newUri);
2151
2148
  };
2152
2149
  const copy = async (oldUri, newUri) => {
2153
- return invoke$3('FileSystem.copy', oldUri, newUri);
2150
+ return invoke$4('FileSystem.copy', oldUri, newUri);
2154
2151
  };
2155
2152
  const exists$1 = async uri => {
2156
2153
  // @ts-ignore
2157
- return invoke$3('FileSystem.exists', uri);
2154
+ return invoke$4('FileSystem.exists', uri);
2158
2155
  };
2159
2156
  const getFolderSize$2 = async uri => {
2160
2157
  // @ts-ignore
2161
- return invoke$3('FileSystem.getFolderSize', uri);
2158
+ return invoke$4('FileSystem.getFolderSize', uri);
2162
2159
  };
2163
2160
  const readFileAsBlob$1 = async uri => {
2164
2161
  // @ts-ignore
2165
- return invoke$3('FileSystem.readFileAsBlob', uri);
2162
+ return invoke$4('FileSystem.readFileAsBlob', uri);
2166
2163
  };
2167
2164
  const appendFile = async (uri, text) => {
2168
2165
  // @ts-ignore
2169
- return invoke$3('FileSystem.appendFile', uri, text);
2166
+ return invoke$4('FileSystem.appendFile', uri, text);
2170
2167
  };
2171
2168
  const registerMockRpc$2 = commandMap => {
2172
2169
  const mockRpc = createMockRpc({
@@ -2186,7 +2183,7 @@ const FileSystemWorker = {
2186
2183
  getFolderSize: getFolderSize$2,
2187
2184
  getPathSeparator,
2188
2185
  getRealPath,
2189
- invoke: invoke$3,
2186
+ invoke: invoke$4,
2190
2187
  invokeAndTransfer: invokeAndTransfer$2,
2191
2188
  mkdir,
2192
2189
  readDirWithFileTypes,
@@ -2201,18 +2198,18 @@ const FileSystemWorker = {
2201
2198
  };
2202
2199
 
2203
2200
  const {
2204
- invoke: invoke$2,
2201
+ invoke: invoke$3,
2205
2202
  invokeAndTransfer: invokeAndTransfer$1,
2206
2203
  set: set$7,
2207
2204
  dispose: dispose$3
2208
2205
  } = create$7(MarkdownWorker$1);
2209
2206
  const getVirtualDom$1 = async html => {
2210
2207
  // @ts-ignore
2211
- return invoke$2('Markdown.getVirtualDom', html);
2208
+ return invoke$3('Markdown.getVirtualDom', html);
2212
2209
  };
2213
2210
  const render$1 = async (markdown, options) => {
2214
2211
  // @ts-ignore
2215
- return invoke$2('Markdown.render', markdown, options);
2212
+ return invoke$3('Markdown.render', markdown, options);
2216
2213
  };
2217
2214
  const registerMockRpc$1 = commandMap => {
2218
2215
  const mockRpc = createMockRpc({
@@ -2226,7 +2223,7 @@ const MarkdownWorker = {
2226
2223
  __proto__: null,
2227
2224
  dispose: dispose$3,
2228
2225
  getVirtualDom: getVirtualDom$1,
2229
- invoke: invoke$2,
2226
+ invoke: invoke$3,
2230
2227
  invokeAndTransfer: invokeAndTransfer$1,
2231
2228
  registerMockRpc: registerMockRpc$1,
2232
2229
  render: render$1,
@@ -2234,51 +2231,51 @@ const MarkdownWorker = {
2234
2231
  };
2235
2232
 
2236
2233
  const {
2237
- invoke: invoke$1,
2234
+ invoke: invoke$2,
2238
2235
  invokeAndTransfer,
2239
2236
  set: set$6,
2240
2237
  dispose: dispose$2
2241
2238
  } = create$7(RendererWorker$1);
2242
2239
  const searchFileHtml = async uri => {
2243
- return invoke$1('ExtensionHost.searchFileWithHtml', uri);
2240
+ return invoke$2('ExtensionHost.searchFileWithHtml', uri);
2244
2241
  };
2245
2242
  const getFilePathElectron = async file => {
2246
- return invoke$1('FileSystemHandle.getFilePathElectron', file);
2243
+ return invoke$2('FileSystemHandle.getFilePathElectron', file);
2247
2244
  };
2248
- const showContextMenu$1 = async (x, y, id, ...args) => {
2249
- return invoke$1('ContextMenu.show', x, y, id, ...args);
2245
+ const showContextMenu = async (x, y, id, ...args) => {
2246
+ return invoke$2('ContextMenu.show', x, y, id, ...args);
2250
2247
  };
2251
2248
  const getElectronVersion = async () => {
2252
- return invoke$1('Process.getElectronVersion');
2249
+ return invoke$2('Process.getElectronVersion');
2253
2250
  };
2254
2251
  const applyBulkReplacement = async bulkEdits => {
2255
- await invoke$1('BulkReplacement.applyBulkReplacement', bulkEdits);
2252
+ await invoke$2('BulkReplacement.applyBulkReplacement', bulkEdits);
2256
2253
  };
2257
2254
  const setColorTheme$2 = async id => {
2258
2255
  // @ts-ignore
2259
- return invoke$1(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
2256
+ return invoke$2(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
2260
2257
  };
2261
2258
  const getNodeVersion = async () => {
2262
- return invoke$1('Process.getNodeVersion');
2259
+ return invoke$2('Process.getNodeVersion');
2263
2260
  };
2264
2261
  const getChromeVersion = async () => {
2265
- return invoke$1('Process.getChromeVersion');
2262
+ return invoke$2('Process.getChromeVersion');
2266
2263
  };
2267
2264
  const getV8Version = async () => {
2268
- return invoke$1('Process.getV8Version');
2265
+ return invoke$2('Process.getV8Version');
2269
2266
  };
2270
2267
  const getFileHandles = async fileIds => {
2271
- const files = await invoke$1('FileSystemHandle.getFileHandles', fileIds);
2268
+ const files = await invoke$2('FileSystemHandle.getFileHandles', fileIds);
2272
2269
  return files;
2273
2270
  };
2274
2271
  const setWorkspacePath = async path => {
2275
- await invoke$1('Workspace.setPath', path);
2272
+ await invoke$2('Workspace.setPath', path);
2276
2273
  };
2277
2274
  const registerWebViewInterceptor = async (id, port) => {
2278
2275
  await invokeAndTransfer('WebView.registerInterceptor', id, port);
2279
2276
  };
2280
2277
  const unregisterWebViewInterceptor = async id => {
2281
- await invoke$1('WebView.unregisterInterceptor', id);
2278
+ await invoke$2('WebView.unregisterInterceptor', id);
2282
2279
  };
2283
2280
  const sendMessagePortToEditorWorker = async (port, rpcId) => {
2284
2281
  const command = 'HandleMessagePort.handleMessagePort';
@@ -2306,41 +2303,41 @@ const sendMessagePortToFileSystemWorker$2 = async (port, rpcId) => {
2306
2303
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSystemWorker', port, command, rpcId);
2307
2304
  };
2308
2305
  const readFile$2 = async uri => {
2309
- return invoke$1('FileSystem.readFile', uri);
2306
+ return invoke$2('FileSystem.readFile', uri);
2310
2307
  };
2311
2308
  const getWebViewSecret = async key => {
2312
2309
  // @ts-ignore
2313
- return invoke$1('WebView.getSecret', key);
2310
+ return invoke$2('WebView.getSecret', key);
2314
2311
  };
2315
2312
  const setWebViewPort = async (uid, port, origin, portType) => {
2316
2313
  return invokeAndTransfer('WebView.setPort', uid, port, origin, portType);
2317
2314
  };
2318
2315
  const setFocus = key => {
2319
- return invoke$1('Focus.setFocus', key);
2316
+ return invoke$2('Focus.setFocus', key);
2320
2317
  };
2321
2318
  const getFileIcon = async options => {
2322
- return invoke$1('IconTheme.getFileIcon', options);
2319
+ return invoke$2('IconTheme.getFileIcon', options);
2323
2320
  };
2324
2321
  const getColorThemeNames = async () => {
2325
- return invoke$1('ColorTheme.getColorThemeNames');
2322
+ return invoke$2('ColorTheme.getColorThemeNames');
2326
2323
  };
2327
2324
  const disableExtension$2 = async id => {
2328
2325
  // @ts-ignore
2329
- return invoke$1('ExtensionManagement.disable', id);
2326
+ return invoke$2('ExtensionManagement.disable', id);
2330
2327
  };
2331
2328
  const enableExtension$2 = async id => {
2332
2329
  // @ts-ignore
2333
- return invoke$1('ExtensionManagement.enable', id);
2330
+ return invoke$2('ExtensionManagement.enable', id);
2334
2331
  };
2335
2332
  const handleDebugChange = async params => {
2336
2333
  // @ts-ignore
2337
- return invoke$1('Run And Debug.handleChange', params);
2334
+ return invoke$2('Run And Debug.handleChange', params);
2338
2335
  };
2339
2336
  const getFolderIcon = async options => {
2340
- return invoke$1('IconTheme.getFolderIcon', options);
2337
+ return invoke$2('IconTheme.getFolderIcon', options);
2341
2338
  };
2342
2339
  const closeWidget = async widgetId => {
2343
- return invoke$1('Viewlet.closeWidget', widgetId);
2340
+ return invoke$2('Viewlet.closeWidget', widgetId);
2344
2341
  };
2345
2342
  const sendMessagePortToExtensionHostWorker$2 = async (port, rpcId = 0) => {
2346
2343
  const command = 'HandleMessagePort.handleMessagePort2';
@@ -2351,55 +2348,55 @@ const sendMessagePortToSearchProcess = async port => {
2351
2348
  };
2352
2349
  const confirm = async (message, options) => {
2353
2350
  // @ts-ignore
2354
- const result = await invoke$1('ConfirmPrompt.prompt', message, options);
2351
+ const result = await invoke$2('ConfirmPrompt.prompt', message, options);
2355
2352
  return result;
2356
2353
  };
2357
2354
  const getRecentlyOpened = async () => {
2358
- return invoke$1(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
2355
+ return invoke$2(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
2359
2356
  };
2360
2357
  const getKeyBindings = async () => {
2361
- return invoke$1('KeyBindingsInitial.getKeyBindings');
2358
+ return invoke$2('KeyBindingsInitial.getKeyBindings');
2362
2359
  };
2363
2360
  const writeClipBoardText$1 = async text => {
2364
- await invoke$1('ClipBoard.writeText', /* text */text);
2361
+ await invoke$2('ClipBoard.writeText', /* text */text);
2365
2362
  };
2366
2363
  const writeClipBoardImage$1 = async blob => {
2367
2364
  // @ts-ignore
2368
- await invoke$1('ClipBoard.writeImage', /* text */blob);
2365
+ await invoke$2('ClipBoard.writeImage', /* text */blob);
2369
2366
  };
2370
2367
  const searchFileMemory = async uri => {
2371
2368
  // @ts-ignore
2372
- return invoke$1('ExtensionHost.searchFileWithMemory', uri);
2369
+ return invoke$2('ExtensionHost.searchFileWithMemory', uri);
2373
2370
  };
2374
2371
  const searchFileFetch = async uri => {
2375
- return invoke$1('ExtensionHost.searchFileWithFetch', uri);
2372
+ return invoke$2('ExtensionHost.searchFileWithFetch', uri);
2376
2373
  };
2377
2374
  const showMessageBox = async options => {
2378
- return invoke$1('ElectronDialog.showMessageBox', options);
2375
+ return invoke$2('ElectronDialog.showMessageBox', options);
2379
2376
  };
2380
2377
  const handleDebugResumed = async params => {
2381
- await invoke$1('Run And Debug.handleResumed', params);
2378
+ await invoke$2('Run And Debug.handleResumed', params);
2382
2379
  };
2383
2380
  const openWidget = async name => {
2384
- await invoke$1('Viewlet.openWidget', name);
2381
+ await invoke$2('Viewlet.openWidget', name);
2385
2382
  };
2386
2383
  const getIcons = async requests => {
2387
- const icons = await invoke$1('IconTheme.getIcons', requests);
2384
+ const icons = await invoke$2('IconTheme.getIcons', requests);
2388
2385
  return icons;
2389
2386
  };
2390
2387
  const activateByEvent = event => {
2391
- return invoke$1('ExtensionHostManagement.activateByEvent', event);
2388
+ return invoke$2('ExtensionHostManagement.activateByEvent', event);
2392
2389
  };
2393
2390
  const setAdditionalFocus = focusKey => {
2394
2391
  // @ts-ignore
2395
- return invoke$1('Focus.setAdditionalFocus', focusKey);
2392
+ return invoke$2('Focus.setAdditionalFocus', focusKey);
2396
2393
  };
2397
2394
  const getActiveEditorId = () => {
2398
2395
  // @ts-ignore
2399
- return invoke$1('GetActiveEditor.getActiveEditorId');
2396
+ return invoke$2('GetActiveEditor.getActiveEditorId');
2400
2397
  };
2401
2398
  const getWorkspacePath = () => {
2402
- return invoke$1('Workspace.getPath');
2399
+ return invoke$2('Workspace.getPath');
2403
2400
  };
2404
2401
  const sendMessagePortToRendererProcess = async port => {
2405
2402
  const command = 'HandleMessagePort.handleMessagePort';
@@ -2407,20 +2404,20 @@ const sendMessagePortToRendererProcess = async port => {
2407
2404
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToRendererProcess', port, command, DebugWorker);
2408
2405
  };
2409
2406
  const getPreference = async key => {
2410
- return await invoke$1('Preferences.get', key);
2407
+ return await invoke$2('Preferences.get', key);
2411
2408
  };
2412
2409
  const getAllExtensions$2 = async () => {
2413
- return invoke$1('ExtensionManagement.getAllExtensions');
2410
+ return invoke$2('ExtensionManagement.getAllExtensions');
2414
2411
  };
2415
2412
  const rerenderEditor = async key => {
2416
2413
  // @ts-ignore
2417
- return invoke$1('Editor.rerender', key);
2414
+ return invoke$2('Editor.rerender', key);
2418
2415
  };
2419
2416
  const handleDebugPaused = async params => {
2420
- await invoke$1('Run And Debug.handlePaused', params);
2417
+ await invoke$2('Run And Debug.handlePaused', params);
2421
2418
  };
2422
2419
  const openUri = async (uri, focus, options) => {
2423
- await invoke$1('Main.openUri', uri, focus, options);
2420
+ await invoke$2('Main.openUri', uri, focus, options);
2424
2421
  };
2425
2422
  const sendMessagePortToSyntaxHighlightingWorker = async port => {
2426
2423
  await invokeAndTransfer(
@@ -2428,76 +2425,76 @@ const sendMessagePortToSyntaxHighlightingWorker = async port => {
2428
2425
  'SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker', port, 'HandleMessagePort.handleMessagePort2');
2429
2426
  };
2430
2427
  const handleDebugScriptParsed = async script => {
2431
- await invoke$1('Run And Debug.handleScriptParsed', script);
2428
+ await invoke$2('Run And Debug.handleScriptParsed', script);
2432
2429
  };
2433
2430
  const getWindowId = async () => {
2434
- return invoke$1('GetWindowId.getWindowId');
2431
+ return invoke$2('GetWindowId.getWindowId');
2435
2432
  };
2436
2433
  const getBlob = async uri => {
2437
2434
  // @ts-ignore
2438
- return invoke$1('FileSystem.getBlob', uri);
2435
+ return invoke$2('FileSystem.getBlob', uri);
2439
2436
  };
2440
2437
  const getExtensionCommands = async () => {
2441
- return invoke$1('ExtensionHost.getCommands');
2438
+ return invoke$2('ExtensionHost.getCommands');
2442
2439
  };
2443
2440
  const showErrorDialog = async errorInfo => {
2444
2441
  // @ts-ignore
2445
- await invoke$1('ErrorHandling.showErrorDialog', errorInfo);
2442
+ await invoke$2('ErrorHandling.showErrorDialog', errorInfo);
2446
2443
  };
2447
2444
  const getFolderSize$1 = async uri => {
2448
2445
  // @ts-ignore
2449
- return await invoke$1('FileSystem.getFolderSize', uri);
2446
+ return await invoke$2('FileSystem.getFolderSize', uri);
2450
2447
  };
2451
2448
  const getExtension$3 = async id => {
2452
2449
  // @ts-ignore
2453
- return invoke$1('ExtensionManagement.getExtension', id);
2450
+ return invoke$2('ExtensionManagement.getExtension', id);
2454
2451
  };
2455
2452
  const getMarkdownDom = async html => {
2456
2453
  // @ts-ignore
2457
- return invoke$1('Markdown.getVirtualDom', html);
2454
+ return invoke$2('Markdown.getVirtualDom', html);
2458
2455
  };
2459
2456
  const renderMarkdown$1 = async (markdown, options) => {
2460
2457
  // @ts-ignore
2461
- return invoke$1('Markdown.renderMarkdown', markdown, options);
2458
+ return invoke$2('Markdown.renderMarkdown', markdown, options);
2462
2459
  };
2463
2460
  const openNativeFolder$1 = async uri => {
2464
2461
  // @ts-ignore
2465
- await invoke$1('OpenNativeFolder.openNativeFolder', uri);
2462
+ await invoke$2('OpenNativeFolder.openNativeFolder', uri);
2466
2463
  };
2467
2464
  const uninstallExtension$1 = async id => {
2468
- return invoke$1('ExtensionManagement.uninstall', id);
2465
+ return invoke$2('ExtensionManagement.uninstall', id);
2469
2466
  };
2470
2467
  const installExtension = async id => {
2471
2468
  // @ts-ignore
2472
- return invoke$1('ExtensionManagement.install', id);
2469
+ return invoke$2('ExtensionManagement.install', id);
2473
2470
  };
2474
2471
  const openExtensionSearch$2 = async () => {
2475
2472
  // @ts-ignore
2476
- return invoke$1('SideBar.openViewlet', 'Extensions');
2473
+ return invoke$2('SideBar.openViewlet', 'Extensions');
2477
2474
  };
2478
2475
  const setExtensionsSearchValue$1 = async searchValue => {
2479
2476
  // @ts-ignore
2480
- return invoke$1('Extensions.handleInput', searchValue);
2477
+ return invoke$2('Extensions.handleInput', searchValue);
2481
2478
  };
2482
2479
  const openExternal = async uri => {
2483
2480
  // @ts-ignore
2484
- await invoke$1('Open.openExternal', uri);
2481
+ await invoke$2('Open.openExternal', uri);
2485
2482
  };
2486
2483
  const openUrl$2 = async uri => {
2487
2484
  // @ts-ignore
2488
- await invoke$1('Open.openUrl', uri);
2485
+ await invoke$2('Open.openUrl', uri);
2489
2486
  };
2490
2487
  const getAllPreferences = async () => {
2491
2488
  // @ts-ignore
2492
- return invoke$1('Preferences.getAll');
2489
+ return invoke$2('Preferences.getAll');
2493
2490
  };
2494
2491
  const showSaveFilePicker = async () => {
2495
2492
  // @ts-ignore
2496
- return invoke$1('FilePicker.showSaveFilePicker');
2493
+ return invoke$2('FilePicker.showSaveFilePicker');
2497
2494
  };
2498
2495
  const getLogsDir = async () => {
2499
2496
  // @ts-ignore
2500
- return invoke$1('PlatformPaths.getLogsDir');
2497
+ return invoke$2('PlatformPaths.getLogsDir');
2501
2498
  };
2502
2499
  const registerMockRpc = commandMap => {
2503
2500
  const mockRpc = createMockRpc({
@@ -2546,7 +2543,7 @@ const RendererWorker = {
2546
2543
  handleDebugResumed,
2547
2544
  handleDebugScriptParsed,
2548
2545
  installExtension,
2549
- invoke: invoke$1,
2546
+ invoke: invoke$2,
2550
2547
  invokeAndTransfer,
2551
2548
  openExtensionSearch: openExtensionSearch$2,
2552
2549
  openExternal,
@@ -2578,7 +2575,7 @@ const RendererWorker = {
2578
2575
  setFocus,
2579
2576
  setWebViewPort,
2580
2577
  setWorkspacePath,
2581
- showContextMenu: showContextMenu$1,
2578
+ showContextMenu,
2582
2579
  showErrorDialog,
2583
2580
  showMessageBox,
2584
2581
  showSaveFilePicker,
@@ -2786,6 +2783,7 @@ const HandleReadmeScroll = 13;
2786
2783
  const HandleTabsClick = 14;
2787
2784
  const HandleAdditionalDetailContextMenu = 15;
2788
2785
  const HandleReadmeClick = 16;
2786
+ const HandleSelectionChange = 17;
2789
2787
 
2790
2788
  const ActivationEvents = 'ActivationEvents';
2791
2789
  const Changelog = 'Changelog';
@@ -2837,7 +2835,8 @@ const getMarkdownVirtualDom = async (html, options) => {
2837
2835
  ...firstNode,
2838
2836
  onScroll: HandleReadmeScroll,
2839
2837
  childCount: firstNode.childCount + 1,
2840
- onClick: HandleReadmeClick
2838
+ onClick: HandleReadmeClick,
2839
+ onSelectionChange: HandleSelectionChange
2841
2840
  }, ...extraDom, ...rest];
2842
2841
  }
2843
2842
  return dom;
@@ -3284,6 +3283,7 @@ const {
3284
3283
  enableExtension: enableExtension$1,
3285
3284
  getAllExtensions: getAllExtensions$1,
3286
3285
  getExtension: getExtension$2,
3286
+ invoke: invoke$1,
3287
3287
  openExtensionSearch: openExtensionSearch$1,
3288
3288
  openNativeFolder,
3289
3289
  openUrl: openUrl$1,
@@ -3293,7 +3293,6 @@ const {
3293
3293
  set: set$2,
3294
3294
  setColorTheme: setColorTheme$1,
3295
3295
  setExtensionsSearchValue,
3296
- showContextMenu,
3297
3296
  uninstallExtension,
3298
3297
  writeClipBoardImage,
3299
3298
  writeClipBoardText} = RendererWorker;
@@ -3345,6 +3344,11 @@ const copyImageUrl = async state => {
3345
3344
  return state;
3346
3345
  };
3347
3346
 
3347
+ const copyReadmeLink = async (state, href) => {
3348
+ await writeText(href);
3349
+ return state;
3350
+ };
3351
+
3348
3352
  const {
3349
3353
  get,
3350
3354
  set,
@@ -3468,34 +3472,42 @@ const dispose = uid => {
3468
3472
  dispose$1(uid);
3469
3473
  };
3470
3474
 
3471
- const getMenuEntriesReadmeLink = props => {
3475
+ const executeCopy = async state => {
3476
+ // TODO
3477
+ // 1. get selection text
3478
+ // 2. copy it
3479
+ return state;
3480
+ };
3481
+
3482
+ const getMenuEntriesImage = (state, props) => {
3472
3483
  return [{
3473
- id: 'copyLink',
3474
- label: copyLink(),
3484
+ id: 'copyImage',
3485
+ label: copyImage$1(),
3486
+ flags: None$2,
3487
+ command: 'ExtensionDetail.copyImage',
3488
+ args: []
3489
+ }, {
3490
+ id: 'copyImage',
3491
+ label: copyImageUrl$1(),
3475
3492
  flags: None$2,
3476
- command: 'ExtensionDetail.copyLink',
3493
+ command: 'ExtensionDetail.copyImageUrl',
3477
3494
  args: []
3478
3495
  }];
3479
3496
  };
3480
- const getMenuEntriesReadme$1 = props => {
3481
- if (props.href) {
3482
- return getMenuEntriesReadmeLink();
3497
+
3498
+ const getMenuEntries2 = (state, props) => {
3499
+ if (props.menuId === ExtensionDetailIconContextMenu$3) {
3500
+ return getMenuEntriesImage();
3483
3501
  }
3484
3502
  return [{
3485
3503
  id: 'copy',
3486
3504
  label: copy$1(),
3487
3505
  flags: None$2,
3488
- command: 'ExtensionDetail.copyReadmeText',
3506
+ command: 'ExtensionDetail.executeCopy',
3489
3507
  args: []
3490
3508
  }];
3491
3509
  };
3492
3510
 
3493
- // TODO maybe add props object as second property with properties like imagesrc, linksrc, nodeName
3494
-
3495
- const getMenuEntries2 = (state, props) => {
3496
- return getMenuEntriesReadme$1(props);
3497
- };
3498
-
3499
3511
  const None = 0;
3500
3512
 
3501
3513
  const getCopyMenuEntry = () => ({
@@ -3822,14 +3834,20 @@ const handleIconError = state => {
3822
3834
  };
3823
3835
  };
3824
3836
 
3825
- const show = async (menuId, x, y) => {
3826
- await showContextMenu(x, y, menuId);
3837
+ const show2 = async (uid, menuId, x, y, args) => {
3838
+ // @ts-ignore
3839
+ await invoke$1('ContextMenu.show2', uid, menuId, x, y, args);
3827
3840
  };
3828
3841
 
3829
3842
  const ExtensionDetailIconContextMenu = 4091;
3830
3843
 
3831
3844
  const handleImageContextMenu = async (state, eventX, eventY) => {
3832
- await show(ExtensionDetailIconContextMenu, eventX, eventY);
3845
+ const {
3846
+ uid
3847
+ } = state;
3848
+ await show2(uid, ExtensionDetailIconContextMenu, eventX, eventY, {
3849
+ menuId: ExtensionDetailIconContextMenu
3850
+ });
3833
3851
  return state;
3834
3852
  };
3835
3853
 
@@ -3848,7 +3866,15 @@ const handleReadmeClick = async (state, nodeName, href) => {
3848
3866
  };
3849
3867
 
3850
3868
  const handleReadmeContextMenu = async (state, x, y, nodeName, href) => {
3851
- await show(ExtensionDetailReadme, x, y);
3869
+ const {
3870
+ uid
3871
+ } = state;
3872
+ // TODO maybe also pass other args
3873
+ await show2(uid, ExtensionDetailReadme, x, y, {
3874
+ menuId: ExtensionDetailReadme,
3875
+ nodeName,
3876
+ href
3877
+ });
3852
3878
  // TODO
3853
3879
  return state;
3854
3880
  };
@@ -3862,6 +3888,11 @@ const handleScroll = (state, scrollTop, scrollSource = Script) => {
3862
3888
  };
3863
3889
  };
3864
3890
 
3891
+ const handleSelectionChange = async (state, selection) => {
3892
+ // console.log('selection change')
3893
+ return state;
3894
+ };
3895
+
3865
3896
  const readFile = async uri => {
3866
3897
  return readFile$1(uri);
3867
3898
  };
@@ -4306,12 +4337,25 @@ const loadHeaderContent = (state, platform, extension) => {
4306
4337
  };
4307
4338
  };
4308
4339
 
4309
- const getCategories = () => {
4310
- // TODO
4311
- return [{
4312
- id: 'themes',
4313
- label: 'Themes'
4314
- }];
4340
+ const stringifyCategory = category => {
4341
+ if (typeof category === 'string') {
4342
+ return category;
4343
+ }
4344
+ return JSON.stringify(category);
4345
+ };
4346
+ const toCategory = categoryString => {
4347
+ return {
4348
+ id: categoryString.toLowerCase(),
4349
+ label: categoryString
4350
+ };
4351
+ };
4352
+ const getCategories = extension => {
4353
+ if (!hasProperty(extension, 'categories') || !Array.isArray(extension.categories)) {
4354
+ return [];
4355
+ }
4356
+ const categoryStrings = extension.categories.map(stringifyCategory);
4357
+ const categories = categoryStrings.map(toCategory);
4358
+ return categories;
4315
4359
  };
4316
4360
 
4317
4361
  const BYTE_UNITS = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
@@ -4514,12 +4558,12 @@ const getResources = isBuiltin => {
4514
4558
  }];
4515
4559
  };
4516
4560
 
4517
- const loadSideBarContent = async (extensionId, extensionVersion, extensionUri, isBuiltin) => {
4561
+ const loadSideBarContent = async (extensionId, extensionVersion, extensionUri, isBuiltin, extension) => {
4518
4562
  const folderSize = await getFolderSize(extensionUri);
4519
4563
  const displaySize = getDisplaySize(folderSize);
4520
4564
  const installationEntries = getInstallationEntries(displaySize, extensionId, extensionVersion, extensionUri);
4521
4565
  const marketplaceEntries = getMarketplaceEntries(isBuiltin);
4522
- const categories = getCategories();
4566
+ const categories = getCategories(extension);
4523
4567
  const resources = getResources(isBuiltin);
4524
4568
  return {
4525
4569
  installationEntries,
@@ -4634,7 +4678,7 @@ const loadContent = async (state, platform, savedState, isTest = false) => {
4634
4678
  categories,
4635
4679
  resources,
4636
4680
  folderSize
4637
- } = await loadSideBarContent(extensionId, extensionVersion, extensionUri, isBuiltin);
4681
+ } = await loadSideBarContent(extensionId, extensionVersion, extensionUri, isBuiltin, extension);
4638
4682
  const padding = getPadding(width);
4639
4683
  const sideBarWidth = getSideBarWidth(width);
4640
4684
  const showSideBar = sideBarWidth > 0;
@@ -5285,6 +5329,9 @@ const renderEventListeners = () => {
5285
5329
  }, {
5286
5330
  name: HandleClickSetColorTheme,
5287
5331
  params: ['handleClickSetColorTheme']
5332
+ }, {
5333
+ name: HandleSelectionChange,
5334
+ params: ['handleSelectionChange']
5288
5335
  }];
5289
5336
  };
5290
5337
 
@@ -5320,17 +5367,18 @@ const saveState = state => {
5320
5367
  const commandMap = {
5321
5368
  'ExtensionDetail.copyImage': wrapCommand(copyImage),
5322
5369
  'ExtensionDetail.copyImageUrl': wrapCommand(copyImageUrl),
5370
+ 'ExtensionDetail.copyReadmeLink': wrapCommand(copyReadmeLink),
5323
5371
  'ExtensionDetail.create': create,
5324
5372
  'ExtensionDetail.diff2': diff2,
5325
5373
  'ExtensionDetail.dispose': dispose,
5374
+ 'ExtensionDetail.executeCopy': wrapCommand(executeCopy),
5326
5375
  'ExtensionDetail.getCommandIds': getCommandIds,
5327
5376
  'ExtensionDetail.getMenuEntries': getMenuEntries,
5328
5377
  'ExtensionDetail.getMenuEntries2': wrapGetter(getMenuEntries2),
5329
- 'ExtensionDetail.getMenus': getMenus,
5330
5378
  'ExtensionDetail.getMenuIds': getMenuIds,
5331
- 'ExtensionDetail.handleClickCategory': wrapCommand(handleClickCategory),
5332
- 'ExtensionDetail.handleReadmeContextMenu': wrapCommand(handleReadmeContextMenu),
5379
+ 'ExtensionDetail.getMenus': getMenus,
5333
5380
  'ExtensionDetail.handleAdditionalDetailsContextMenu': wrapCommand(handleAdditionalDetailContextMenu),
5381
+ 'ExtensionDetail.handleClickCategory': wrapCommand(handleClickCategory),
5334
5382
  'ExtensionDetail.handleClickDisable': wrapCommand(handleClickDisable),
5335
5383
  'ExtensionDetail.handleClickEnable': wrapCommand(handleClickEnable),
5336
5384
  'ExtensionDetail.handleClickScrollToTop': wrapCommand(handleClickScrollToTop),
@@ -5342,9 +5390,11 @@ const commandMap = {
5342
5390
  'ExtensionDetail.handleFeaturesClick': wrapCommand(handleClickFeatures),
5343
5391
  'ExtensionDetail.handleIconError': wrapCommand(handleIconError),
5344
5392
  'ExtensionDetail.handleImageContextMenu': wrapCommand(handleImageContextMenu),
5393
+ 'ExtensionDetail.handleReadmeClick': wrapCommand(handleReadmeClick),
5394
+ 'ExtensionDetail.handleReadmeContextMenu': wrapCommand(handleReadmeContextMenu),
5345
5395
  'ExtensionDetail.handleScroll': wrapCommand(handleScroll),
5396
+ 'ExtensionDetail.handleSelectionChange': wrapCommand(handleSelectionChange),
5346
5397
  'ExtensionDetail.handleTabsClick': wrapCommand(handleTabsClick),
5347
- 'ExtensionDetail.handleReadmeClick': wrapCommand(handleReadmeClick),
5348
5398
  'ExtensionDetail.handleWheel': wrapCommand(handleScroll),
5349
5399
  // deprecated
5350
5400
  'ExtensionDetail.initialize': initialize,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-detail-view",
3
- "version": "4.18.0",
3
+ "version": "5.1.0",
4
4
  "description": "Extension Detail View Worker",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,6 +11,6 @@
11
11
  "type": "module",
12
12
  "main": "dist/extensionDetailViewWorkerMain.js",
13
13
  "dependencies": {
14
- "@lvce-editor/constants": "^1.29.0"
14
+ "@lvce-editor/constants": "^1.30.0"
15
15
  }
16
16
  }