@lvce-editor/extension-detail-view 3.55.0 → 3.57.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.
@@ -11,7 +11,7 @@ const i18nString = (key, placeholders = emptyObject) => {
11
11
  };
12
12
 
13
13
  const ActivationEvents$1 = 'Activation Events';
14
- const RuntimeStatus$1 = 'Runtime Status';
14
+ const ActivationTime = 'Activation Time: ';
15
15
  const Categories$1 = 'Categories';
16
16
  const Changelog$2 = 'Changelog';
17
17
  const Commands$1 = 'Commands';
@@ -22,29 +22,42 @@ const CopyImageUrl = 'Copy Image Url';
22
22
  const Details$1 = 'Details';
23
23
  const Disable$1 = 'Disable';
24
24
  const Elements = 'Elements';
25
+ const EmptyCommandsArray = 'The extension contributed an empty commands array.';
26
+ const Enable$1 = 'Enable';
25
27
  const Features$2 = 'Features';
26
28
  const FileMatch = 'File Match';
27
29
  const Id = 'ID';
30
+ const Identifier = 'Identifier';
31
+ const ImportTime = 'Import Time: ';
28
32
  const Installation = 'Installation';
33
+ const Issues = 'Issues';
29
34
  const JsonValidation$1 = 'Json Validation';
30
35
  const Label = 'Label';
36
+ const LastReleased = 'Last Released';
37
+ const LastUpdated = 'Last Updated';
38
+ const License = 'License';
31
39
  const Marketplace = 'Marketplace';
32
40
  const None$3 = 'None';
33
41
  const NoReadmeFound = 'No Readme Found.';
34
- const EmptyCommandsArray = 'The extension contributed an empty commands array.';
35
42
  const OpenImageInNewTab = 'Open Image in New Tab';
36
43
  const OpenInNewTab = 'Open in New Tab';
37
44
  const ProgrammingLanguages$1 = 'Programming Languages';
45
+ const Published = 'Published';
46
+ const Repository = 'Repository';
38
47
  const Resources$1 = 'Resources';
48
+ const RuntimeStatus$1 = 'Runtime Status';
39
49
  const SaveImageAs = 'Save Image as';
40
50
  const Schema = 'Schema';
41
51
  const ScrollToTop$1 = 'Scroll to top';
52
+ const SelectedFeatureUnknownOrUnsupported = 'Selected feature is unknown or unsupported';
42
53
  const Selector = 'Selector';
43
54
  const SetColorTheme$1 = 'Set Color Theme';
44
- const Enable$1 = 'Enable';
45
55
  const Settings$1 = 'Settings';
56
+ const Size = 'Size';
46
57
  const Theme$1 = 'Theme';
47
58
  const Uninstall$1 = 'Uninstall';
59
+ const UnsupportedFeature = 'Unsupported Feature';
60
+ const Version = 'Version';
48
61
  const WebViews$1 = 'WebViews';
49
62
 
50
63
  const installation = () => {
@@ -155,6 +168,45 @@ const noReadmeFound = () => {
155
168
  const emptyCommandsArray = () => {
156
169
  return i18nString(EmptyCommandsArray);
157
170
  };
171
+ const importTime = () => {
172
+ return i18nString(ImportTime);
173
+ };
174
+ const activationTime = () => {
175
+ return i18nString(ActivationTime);
176
+ };
177
+ const unsupportedFeature = () => {
178
+ return i18nString(UnsupportedFeature);
179
+ };
180
+ const selectedFeatureUnknownOrUnsupported = () => {
181
+ return i18nString(SelectedFeatureUnknownOrUnsupported);
182
+ };
183
+ const identifier = () => {
184
+ return i18nString(Identifier);
185
+ };
186
+ const version = () => {
187
+ return i18nString(Version);
188
+ };
189
+ const lastUpdated = () => {
190
+ return i18nString(LastUpdated);
191
+ };
192
+ const size = () => {
193
+ return i18nString(Size);
194
+ };
195
+ const published = () => {
196
+ return i18nString(Published);
197
+ };
198
+ const lastReleased = () => {
199
+ return i18nString(LastReleased);
200
+ };
201
+ const issues = () => {
202
+ return i18nString(Issues);
203
+ };
204
+ const repository = () => {
205
+ return i18nString(Repository);
206
+ };
207
+ const license = () => {
208
+ return i18nString(License);
209
+ };
158
210
 
159
211
  const getActivationEventsDetails = async extension => {
160
212
  const activationEvents = extension.activation || [];
@@ -196,6 +248,7 @@ const THead = 14;
196
248
  const Tr = 15;
197
249
  const Img = 17;
198
250
  const H2 = 22;
251
+ const Aside$1 = 28;
199
252
  const Dd = 43;
200
253
  const Dl = 44;
201
254
  const Li = 48;
@@ -208,6 +261,7 @@ const Dt = 67;
208
261
  const VirtualDomElements = {
209
262
  __proto__: null,
210
263
  A,
264
+ Aside: Aside$1,
211
265
  Button: Button$1,
212
266
  Code: Code$2,
213
267
  Dd,
@@ -472,10 +526,11 @@ const getCommandsVirtualDom = state => {
472
526
  };
473
527
 
474
528
  const getJsonValidationTableEntry = validation => {
529
+ // TODO handle case when validation is invalid like null
475
530
  const {
476
- fileMatch,
477
- schema
531
+ fileMatch
478
532
  } = validation;
533
+ const schema = validation.schema ?? validation.url;
479
534
  return [{
480
535
  type: Code,
481
536
  value: fileMatch
@@ -565,10 +620,10 @@ const getFeatureUnsupportedVirtualDom = state => {
565
620
  }, {
566
621
  type: VirtualDomElements.H1,
567
622
  childCount: 1
568
- }, text('Unsupported Feature'), {
623
+ }, text(unsupportedFeature()), {
569
624
  type: VirtualDomElements.P,
570
625
  childCount: 1
571
- }, text('Selected feature is unknown or unsupported')];
626
+ }, text(selectedFeatureUnknownOrUnsupported())];
572
627
  };
573
628
 
574
629
  const features = Object.create(null);
@@ -642,9 +697,13 @@ const MarkdownWorker$1 = 300;
642
697
  const {
643
698
  invoke: invoke$9,
644
699
  set: set$9} = create$7(ExtensionHostWorker);
700
+ const getRuntimeStatus$2 = async extensionId => {
701
+ // @ts-ignore
702
+ return invoke$9('ExtensionHost.getRuntimeStatus', extensionId);
703
+ };
645
704
  const ExtensionHost = {
646
705
  __proto__: null,
647
- invoke: invoke$9,
706
+ getRuntimeStatus: getRuntimeStatus$2,
648
707
  set: set$9
649
708
  };
650
709
  const {
@@ -763,13 +822,12 @@ const RendererWorker = {
763
822
 
764
823
  const {
765
824
  set: set$5,
766
- invoke: invoke$2
825
+ getRuntimeStatus: getRuntimeStatus$1
767
826
  } = ExtensionHost;
768
827
 
769
828
  const getRuntimeStatus = async extensionId => {
770
- // TODO simplify api
771
829
  // @ts-ignore
772
- const status = await invoke$2('ExtensionHost.getRuntimeStatus', extensionId);
830
+ const status = await getRuntimeStatus$1(extensionId);
773
831
  // @ts-ignore
774
832
  return status;
775
833
  };
@@ -803,26 +861,22 @@ const formatTime = time => {
803
861
  return time.toFixed(2) + 'ms';
804
862
  };
805
863
 
806
- const getActivationTimeVirtualDom = (importTime, activationTime) => {
807
- if (!activationTime && !importTime) {
864
+ const getActivationTimeVirtualDom = (importTime$1, activationTime$1) => {
865
+ if (!activationTime$1 && !importTime$1) {
808
866
  return [];
809
867
  }
810
- const formattedImportTime = formatTime(importTime);
811
- const formattedTime = formatTime(activationTime);
868
+ const formattedImportTime = formatTime(importTime$1);
869
+ const formattedTime = formatTime(activationTime$1);
812
870
  return [{
813
871
  type: VirtualDomElements.Dt,
814
872
  childCount: 1
815
- }, text('Import Time: '),
816
- // i18n
817
- {
873
+ }, text(importTime()), {
818
874
  type: VirtualDomElements.Dd,
819
875
  childCount: 1
820
876
  }, text(formattedImportTime), {
821
877
  type: VirtualDomElements.Dt,
822
878
  childCount: 1
823
- }, text('Activation Time: '),
824
- // i18n
825
- {
879
+ }, text(activationTime()), {
826
880
  type: VirtualDomElements.Dd,
827
881
  childCount: 1
828
882
  }, text(formattedTime)];
@@ -851,17 +905,21 @@ const getStatusMessage = statusType => {
851
905
  }
852
906
  };
853
907
 
908
+ const key = {
909
+ type: VirtualDomElements.Dt,
910
+ childCount: 1,
911
+ className: 'RuntimeStatusDefinitionListKey'
912
+ };
913
+ const value = {
914
+ type: VirtualDomElements.Dd,
915
+ className: 'RuntimeStatusDefinitionListValue',
916
+ childCount: 1
917
+ };
854
918
  const getStatusVirtualDom = status => {
855
919
  const statusString = getStatusMessage(status);
856
- return [{
857
- type: VirtualDomElements.Dt,
858
- childCount: 1
859
- }, text(`Status: `),
920
+ return [key, text(`Status: `),
860
921
  // i18n
861
- {
862
- type: VirtualDomElements.Dd,
863
- childCount: 1
864
- }, text(`${statusString}`)];
922
+ value, text(`${statusString}`)];
865
923
  };
866
924
 
867
925
  const getChildCount$1 = (status, activationTime, importTime) => {
@@ -886,6 +944,7 @@ const getRuntimeStatusVirtualDom = state => {
886
944
  childCount: 2
887
945
  }, ...getFeatureContentHeadingVirtualDom(heading), {
888
946
  type: VirtualDomElements.Dl,
947
+ className: 'RuntimeStatusDefinitionList',
889
948
  childCount
890
949
  }, ...getStatusVirtualDom(status), ...getActivationTimeVirtualDom(activationTime, importTime)];
891
950
  };
@@ -2447,6 +2506,7 @@ const create = (uid, uri, x, y, width, height, platform, assetDir) => {
2447
2506
  description: '',
2448
2507
  detailsVirtualDom: [],
2449
2508
  displaySize: '',
2509
+ downloadCount: 'n/a',
2450
2510
  installationEntries: [],
2451
2511
  extension: {},
2452
2512
  extensionId: '',
@@ -2461,6 +2521,7 @@ const create = (uid, uri, x, y, width, height, platform, assetDir) => {
2461
2521
  name: '',
2462
2522
  platform,
2463
2523
  programmingLanguages: [],
2524
+ rating: 'n/a',
2464
2525
  readmeScrollTop: 0,
2465
2526
  resources: [],
2466
2527
  scrollSource: 0,
@@ -3311,20 +3372,20 @@ const getFolderSize = async uri => {
3311
3372
 
3312
3373
  const getInstallationEntries = (displaySize, extensionId, extensionVersion, extensionUri) => {
3313
3374
  const entries = [{
3314
- key: 'Identifier',
3375
+ key: identifier(),
3315
3376
  value: extensionId,
3316
3377
  odd: true,
3317
3378
  code: true
3318
3379
  }, {
3319
- key: 'Version',
3380
+ key: version(),
3320
3381
  value: extensionVersion,
3321
3382
  code: true
3322
3383
  }, {
3323
- key: 'Last Updated',
3384
+ key: lastUpdated(),
3324
3385
  value: 'n/a',
3325
3386
  odd: true
3326
3387
  }, {
3327
- key: 'Size',
3388
+ key: size(),
3328
3389
  value: displaySize,
3329
3390
  onClick: HandleClickSize,
3330
3391
  title: extensionUri
@@ -3337,11 +3398,11 @@ const getMarketplaceEntries = isBuiltin => {
3337
3398
  return [];
3338
3399
  }
3339
3400
  return [{
3340
- key: 'Published',
3401
+ key: published(),
3341
3402
  value: 'n/a',
3342
3403
  odd: true
3343
3404
  }, {
3344
- key: 'Last Released',
3405
+ key: lastReleased(),
3345
3406
  value: 'n/a'
3346
3407
  }];
3347
3408
  };
@@ -3352,16 +3413,16 @@ const getResources = isBuiltin => {
3352
3413
  }
3353
3414
  // TODO
3354
3415
  return [{
3355
- label: 'Marketplace',
3416
+ label: marketplace(),
3356
3417
  url: '#'
3357
3418
  }, {
3358
- label: 'Issues',
3419
+ label: issues(),
3359
3420
  url: '#'
3360
3421
  }, {
3361
- label: 'Repository',
3422
+ label: repository(),
3362
3423
  url: '#'
3363
3424
  }, {
3364
- label: 'License',
3425
+ label: license(),
3365
3426
  url: '#'
3366
3427
  }];
3367
3428
  };
@@ -3591,12 +3652,14 @@ const getMoreInfoEntryKeyVirtualDom = item => {
3591
3652
  return [parentNode, text(key)];
3592
3653
  };
3593
3654
 
3655
+ const classLink = mergeClassNames(MoreInfoEntryValue, Link);
3656
+ const classCode = mergeClassNames(MoreInfoEntryValue, Code$1);
3594
3657
  const getMoreInfoEntryValueClassName = (onClick, code) => {
3595
3658
  if (onClick) {
3596
- return mergeClassNames(MoreInfoEntryValue, Link);
3659
+ return classLink;
3597
3660
  }
3598
3661
  if (code) {
3599
- return mergeClassNames(MoreInfoEntryValue, Code$1);
3662
+ return classCode;
3600
3663
  }
3601
3664
  return MoreInfoEntryValue;
3602
3665
  };
@@ -3621,7 +3684,7 @@ const getMoreInfoEntryValueVirtualDom = item => {
3621
3684
  const type = getMoreInfoEntryValueTag(onClick, code);
3622
3685
  const className = getMoreInfoEntryValueClassName(onClick, code);
3623
3686
  return [{
3624
- type: type,
3687
+ type,
3625
3688
  className,
3626
3689
  childCount: 1,
3627
3690
  onClick,
@@ -3630,12 +3693,12 @@ const getMoreInfoEntryValueVirtualDom = item => {
3630
3693
  };
3631
3694
 
3632
3695
  const parentNodeEven = {
3633
- type: VirtualDomElements.Dt,
3696
+ type: VirtualDomElements.Div,
3634
3697
  className: MoreInfoEntry,
3635
3698
  childCount: 2
3636
3699
  };
3637
3700
  const parentNodeOdd = {
3638
- type: VirtualDomElements.Dt,
3701
+ type: VirtualDomElements.Div,
3639
3702
  className: mergeClassNames(MoreInfoEntry, MoreInfoEntryOdd),
3640
3703
  childCount: 2
3641
3704
  };
@@ -3681,7 +3744,7 @@ const getAdditionalDetailsVirtualDom = (showAdditionalDetails, firstHeading, ent
3681
3744
  return [];
3682
3745
  }
3683
3746
  return [{
3684
- type: VirtualDomElements.Div,
3747
+ type: VirtualDomElements.Aside,
3685
3748
  className: Aside,
3686
3749
  childCount: 1
3687
3750
  }, {
@@ -3746,6 +3809,15 @@ const getFeatureListVirtualDom = features => {
3746
3809
  }, ...features.flatMap(getFeatureListItemVirtualDom)];
3747
3810
  };
3748
3811
 
3812
+ const getFeaturesEmptyVirtualDom = () => {
3813
+ const none$1 = none();
3814
+ return [{
3815
+ type: VirtualDomElements.Div,
3816
+ className: Features$1,
3817
+ childCount: 1
3818
+ }, text(none$1)];
3819
+ };
3820
+
3749
3821
  const sash = {
3750
3822
  type: VirtualDomElements.Div,
3751
3823
  className: mergeClassNames(Sash, SashVertical),
@@ -3753,12 +3825,7 @@ const sash = {
3753
3825
  };
3754
3826
  const getFeaturesVirtualDom = (features, selectedFeature, state) => {
3755
3827
  if (features.length === 0) {
3756
- const none$1 = none();
3757
- return [{
3758
- type: VirtualDomElements.Div,
3759
- className: Features$1,
3760
- childCount: 1
3761
- }, text(none$1)];
3828
+ return getFeaturesEmptyVirtualDom();
3762
3829
  }
3763
3830
  const fn = getFeatureVirtualDomHandler(selectedFeature);
3764
3831
  const featureVirtualDom = fn(state);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-detail-view",
3
- "version": "3.55.0",
3
+ "version": "3.57.0",
4
4
  "description": "Extension Detail View Worker",
5
5
  "license": "MIT",
6
6
  "author": "Lvce Editor",