@lvce-editor/extension-detail-view 5.1.0 → 5.3.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.
@@ -61,6 +61,7 @@ const SetColorTheme$1 = 'Set Color Theme';
61
61
  const Settings$1 = 'Settings';
62
62
  const Size = 'Size';
63
63
  const Snippets = 'Snippets';
64
+ const Status = 'Status';
64
65
  const StringMustNotBeEmpty = 'String must not be empty';
65
66
  const Theme$1 = 'Theme';
66
67
  const Uninstall$1 = 'Uninstall';
@@ -122,6 +123,9 @@ const fileMatch = () => {
122
123
  const schema = () => {
123
124
  return i18nString(Schema);
124
125
  };
126
+ const status = () => {
127
+ return i18nString(Status);
128
+ };
125
129
  const setColorTheme$3 = () => {
126
130
  return i18nString(SetColorTheme$1);
127
131
  };
@@ -2585,10 +2589,11 @@ const RendererWorker = {
2585
2589
  writeClipBoardText: writeClipBoardText$1
2586
2590
  };
2587
2591
 
2592
+ /* eslint-disable unicorn/prefer-export-from */
2593
+
2588
2594
  const {
2589
2595
  set: set$5,
2590
- getRuntimeStatus: getRuntimeStatus$1
2591
- } = ExtensionHost;
2596
+ getRuntimeStatus: getRuntimeStatus$1} = ExtensionHost;
2592
2597
 
2593
2598
  const getRuntimeStatus = async extensionId => {
2594
2599
  // @ts-ignore
@@ -2680,11 +2685,10 @@ const value = {
2680
2685
  className: 'RuntimeStatusDefinitionListValue',
2681
2686
  childCount: 1
2682
2687
  };
2683
- const getStatusVirtualDom = status => {
2684
- const statusString = getStatusMessage(status);
2685
- return [key, text(`Status: `),
2686
- // i18n
2687
- value, text(`${statusString}`)];
2688
+ const getStatusVirtualDom = status$1 => {
2689
+ const statusKey = status();
2690
+ const statusValue = getStatusMessage(status$1);
2691
+ return [key, text(`${statusKey}: `), value, text(`${statusValue}`)];
2688
2692
  };
2689
2693
 
2690
2694
  const getChildCount$1 = (status, activationTime, importTime) => {
@@ -3435,7 +3439,7 @@ const isEqual$2 = (oldState, newState) => {
3435
3439
  };
3436
3440
 
3437
3441
  const isEqual$1 = (oldState, newState) => {
3438
- return oldState.activationEvents === newState.activationEvents && oldState.badge === newState.badge && oldState.buttons === newState.buttons && oldState.categories === newState.categories && oldState.changelogVirtualDom === newState.changelogVirtualDom && oldState.commands === newState.commands && oldState.description === newState.description && oldState.detailsVirtualDom === newState.detailsVirtualDom && oldState.disabled === newState.disabled && oldState.displaySize === newState.displaySize && oldState.extensionId === newState.extensionId && oldState.extensionVersion === newState.extensionVersion && oldState.features === newState.features && oldState.jsonValidation === newState.jsonValidation && oldState.selectedFeature === newState.selectedFeature && oldState.selectedTab === newState.selectedTab && oldState.settings === newState.settings && oldState.showSideBar === newState.showSideBar && oldState.sizeValue === newState.sizeValue && oldState.themesMarkdownDom === newState.themesMarkdownDom && oldState.webViews === newState.webViews;
3442
+ return oldState.activationEvents === newState.activationEvents && oldState.badge === newState.badge && oldState.buttons === newState.buttons && oldState.categories === newState.categories && oldState.changelogVirtualDom === newState.changelogVirtualDom && oldState.commands === newState.commands && oldState.description === newState.description && oldState.detailsVirtualDom === newState.detailsVirtualDom && oldState.disabled === newState.disabled && oldState.displaySize === newState.displaySize && oldState.extensionId === newState.extensionId && oldState.extensionVersion === newState.extensionVersion && oldState.features === newState.features && oldState.jsonValidation === newState.jsonValidation && oldState.resources === newState.resources && oldState.selectedFeature === newState.selectedFeature && oldState.selectedTab === newState.selectedTab && oldState.settings === newState.settings && oldState.showSideBar === newState.showSideBar && oldState.sizeValue === newState.sizeValue && oldState.themesMarkdownDom === newState.themesMarkdownDom && oldState.webViews === newState.webViews;
3439
3443
  };
3440
3444
 
3441
3445
  const User = 1;
@@ -4122,7 +4126,11 @@ const initialize = async () => {
4122
4126
  };
4123
4127
 
4124
4128
  const existsFile = async uri => {
4125
- return exists(uri);
4129
+ try {
4130
+ return await exists(uri);
4131
+ } catch {
4132
+ return false;
4133
+ }
4126
4134
  };
4127
4135
 
4128
4136
  class ExtensionNotFoundError extends Error {
@@ -4538,17 +4546,24 @@ const getMarketplaceEntries = isBuiltin => {
4538
4546
  }];
4539
4547
  };
4540
4548
 
4541
- const getResources = isBuiltin => {
4549
+ const getRepositoryLink = extension => {
4550
+ if (extension && hasProperty(extension, 'repository') && typeof extension.repository === 'string') {
4551
+ return extension.repository; // TODO watch out for javascript: or other invalid links or path traversal
4552
+ }
4553
+ return '';
4554
+ };
4555
+ const getResources = (isBuiltin, extension) => {
4542
4556
  if (isBuiltin) {
4543
4557
  return [];
4544
4558
  }
4559
+ const repositoryLink = getRepositoryLink(extension);
4545
4560
  // TODO
4546
4561
  return [{
4547
4562
  label: marketplace(),
4548
4563
  url: '#'
4549
4564
  }, {
4550
4565
  label: issues(),
4551
- url: '#'
4566
+ url: repositoryLink
4552
4567
  }, {
4553
4568
  label: repository(),
4554
4569
  url: '#'
@@ -4564,7 +4579,7 @@ const loadSideBarContent = async (extensionId, extensionVersion, extensionUri, i
4564
4579
  const installationEntries = getInstallationEntries(displaySize, extensionId, extensionVersion, extensionUri);
4565
4580
  const marketplaceEntries = getMarketplaceEntries(isBuiltin);
4566
4581
  const categories = getCategories(extension);
4567
- const resources = getResources(isBuiltin);
4582
+ const resources = getResources(isBuiltin, extension);
4568
4583
  return {
4569
4584
  installationEntries,
4570
4585
  marketplaceEntries,
@@ -4904,8 +4919,19 @@ const resourceNode = {
4904
4919
  };
4905
4920
  const getResourceVirtualDom = resource => {
4906
4921
  const {
4907
- label
4922
+ label,
4923
+ url
4908
4924
  } = resource;
4925
+ if (url && url !== '#') {
4926
+ return [{
4927
+ type: A,
4928
+ className: Resource,
4929
+ childCount: 1,
4930
+ target: '_blank',
4931
+ rel: 'noopener noreferrer',
4932
+ href: url
4933
+ }, text(label)];
4934
+ }
4909
4935
  return [resourceNode, text(label)];
4910
4936
  };
4911
4937
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-detail-view",
3
- "version": "5.1.0",
3
+ "version": "5.3.0",
4
4
  "description": "Extension Detail View Worker",
5
5
  "repository": {
6
6
  "type": "git",