@lvce-editor/extension-detail-view 3.22.0 → 3.24.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.
@@ -60,31 +60,39 @@ class AssertionError extends Error {
60
60
  this.name = 'AssertionError';
61
61
  }
62
62
  }
63
+ const Object$1 = 1;
64
+ const Number$1 = 2;
65
+ const Array$1 = 3;
66
+ const String = 4;
67
+ const Boolean$1 = 5;
68
+ const Function = 6;
69
+ const Null = 7;
70
+ const Unknown = 8;
63
71
  const getType = value => {
64
72
  switch (typeof value) {
65
73
  case 'number':
66
- return 'number';
74
+ return Number$1;
67
75
  case 'function':
68
- return 'function';
76
+ return Function;
69
77
  case 'string':
70
- return 'string';
78
+ return String;
71
79
  case 'object':
72
80
  if (value === null) {
73
- return 'null';
81
+ return Null;
74
82
  }
75
83
  if (Array.isArray(value)) {
76
- return 'array';
84
+ return Array$1;
77
85
  }
78
- return 'object';
86
+ return Object$1;
79
87
  case 'boolean':
80
- return 'boolean';
88
+ return Boolean$1;
81
89
  default:
82
- return 'unknown';
90
+ return Unknown;
83
91
  }
84
92
  };
85
93
  const string = value => {
86
94
  const type = getType(value);
87
- if (type !== 'string') {
95
+ if (type !== String) {
88
96
  throw new AssertionError('expected value to be of type string');
89
97
  }
90
98
  };
@@ -338,22 +346,11 @@ class IpcChildWithModuleWorker extends Ipc {
338
346
  const wrap$f = global => {
339
347
  return new IpcChildWithModuleWorker(global);
340
348
  };
341
- const withResolvers = () => {
342
- let _resolve;
343
- const promise = new Promise(resolve => {
344
- _resolve = resolve;
345
- });
346
- return {
347
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
348
- resolve: _resolve,
349
- promise
350
- };
351
- };
352
349
  const waitForFirstMessage = async port => {
353
350
  const {
354
351
  resolve,
355
352
  promise
356
- } = withResolvers();
353
+ } = Promise.withResolvers();
357
354
  port.addEventListener('message', resolve, {
358
355
  once: true
359
356
  });
@@ -424,7 +421,7 @@ const create$4 = (method, params) => {
424
421
  };
425
422
  };
426
423
  const callbacks = Object.create(null);
427
- const set$4 = (id, fn) => {
424
+ const set$2 = (id, fn) => {
428
425
  callbacks[id] = fn;
429
426
  };
430
427
  const get$2 = id => {
@@ -434,16 +431,16 @@ const remove = id => {
434
431
  delete callbacks[id];
435
432
  };
436
433
  let id$1 = 0;
437
- const create$3 = () => {
434
+ const create$3$1 = () => {
438
435
  return ++id$1;
439
436
  };
440
437
  const registerPromise = () => {
441
- const id = create$3();
438
+ const id = create$3$1();
442
439
  const {
443
440
  resolve,
444
441
  promise
445
442
  } = Promise.withResolvers();
446
- set$4(id, resolve);
443
+ set$2(id, resolve);
447
444
  return {
448
445
  id,
449
446
  promise
@@ -516,6 +513,16 @@ const constructError = (message, type, name) => {
516
513
  }
517
514
  return new ErrorConstructor(message);
518
515
  };
516
+ const joinLines = lines => {
517
+ return lines.join(NewLine);
518
+ };
519
+ const splitLines = lines => {
520
+ return lines.split(NewLine);
521
+ };
522
+ const getCurrentStack = () => {
523
+ const currentStack = joinLines(splitLines(new Error().stack || '').slice(2));
524
+ return currentStack;
525
+ };
519
526
  const getNewLineIndex = (string, startIndex = undefined) => {
520
527
  return string.indexOf(NewLine, startIndex);
521
528
  };
@@ -526,19 +533,16 @@ const getParentStack = error => {
526
533
  }
527
534
  return parentStack;
528
535
  };
529
- const joinLines = lines => {
530
- return lines.join(NewLine);
531
- };
532
536
  const MethodNotFound = -32601;
533
537
  const Custom = -32001;
534
- const splitLines = lines => {
535
- return lines.split(NewLine);
536
- };
537
538
  const restoreJsonRpcError = error => {
539
+ const currentStack = getCurrentStack();
538
540
  if (error && error instanceof Error) {
541
+ if (typeof error.stack === 'string') {
542
+ error.stack = error.stack + NewLine + currentStack;
543
+ }
539
544
  return error;
540
545
  }
541
- const currentStack = joinLines(splitLines(new Error().stack || '').slice(1));
542
546
  if (error && error.code && error.code === MethodNotFound) {
543
547
  const restoredError = new JsonRpcError(error.message);
544
548
  const parentStack = getParentStack(error);
@@ -619,6 +623,17 @@ const getErrorType = prettyError => {
619
623
  }
620
624
  return undefined;
621
625
  };
626
+ const isAlreadyStack = line => {
627
+ return line.trim().startsWith('at ');
628
+ };
629
+ const getStack = prettyError => {
630
+ const stackString = prettyError.stack || '';
631
+ const newLineIndex = stackString.indexOf('\n');
632
+ if (newLineIndex !== -1 && !isAlreadyStack(stackString.slice(0, newLineIndex))) {
633
+ return stackString.slice(newLineIndex + 1);
634
+ }
635
+ return stackString;
636
+ };
622
637
  const getErrorProperty = (error, prettyError) => {
623
638
  if (error && error.code === E_COMMAND_NOT_FOUND) {
624
639
  return {
@@ -631,7 +646,7 @@ const getErrorProperty = (error, prettyError) => {
631
646
  code: Custom,
632
647
  message: prettyError.message,
633
648
  data: {
634
- stack: prettyError.stack,
649
+ stack: getStack(prettyError),
635
650
  codeFrame: prettyError.codeFrame,
636
651
  type: getErrorType(prettyError),
637
652
  code: prettyError.code,
@@ -639,18 +654,18 @@ const getErrorProperty = (error, prettyError) => {
639
654
  }
640
655
  };
641
656
  };
642
- const create$1$1 = (message, error) => {
657
+ const create$1$1 = (id, error) => {
643
658
  return {
644
659
  jsonrpc: Two,
645
- id: message.id,
660
+ id,
646
661
  error
647
662
  };
648
663
  };
649
- const getErrorResponse = (message, error, preparePrettyError, logError) => {
664
+ const getErrorResponse = (id, error, preparePrettyError, logError) => {
650
665
  const prettyError = preparePrettyError(error);
651
666
  logError(error, prettyError);
652
667
  const errorProperty = getErrorProperty(error, prettyError);
653
- return create$1$1(message, errorProperty);
668
+ return create$1$1(id, errorProperty);
654
669
  };
655
670
  const create$5 = (message, result) => {
656
671
  return {
@@ -663,12 +678,27 @@ const getSuccessResponse = (message, result) => {
663
678
  const resultProperty = result ?? null;
664
679
  return create$5(message, resultProperty);
665
680
  };
681
+ const getErrorResponseSimple = (id, error) => {
682
+ return {
683
+ jsonrpc: Two,
684
+ id,
685
+ error: {
686
+ code: Custom,
687
+ // @ts-ignore
688
+ message: error.message,
689
+ data: error
690
+ }
691
+ };
692
+ };
666
693
  const getResponse = async (message, ipc, execute, preparePrettyError, logError, requiresSocket) => {
667
694
  try {
668
695
  const result = requiresSocket(message.method) ? await execute(message.method, ipc, ...message.params) : await execute(message.method, ...message.params);
669
696
  return getSuccessResponse(message, result);
670
697
  } catch (error) {
671
- return getErrorResponse(message, error, preparePrettyError, logError);
698
+ if (ipc.canUseSimpleErrorResponse) {
699
+ return getErrorResponseSimple(message.id, error);
700
+ }
701
+ return getErrorResponse(message.id, error, preparePrettyError, logError);
672
702
  }
673
703
  };
674
704
  const defaultPreparePrettyError = error => {
@@ -723,7 +753,7 @@ const handleJsonRpcMessage = async (...args) => {
723
753
  try {
724
754
  ipc.send(response);
725
755
  } catch (error) {
726
- const errorResponse = getErrorResponse(message, error, preparePrettyError, logError);
756
+ const errorResponse = getErrorResponse(message.id, error, preparePrettyError, logError);
727
757
  ipc.send(errorResponse);
728
758
  }
729
759
  return;
@@ -828,7 +858,7 @@ const listen$1 = async (module, options) => {
828
858
  const ipc = module.wrap(rawIpc);
829
859
  return ipc;
830
860
  };
831
- const create$2 = async ({
861
+ const create$3 = async ({
832
862
  commandMap
833
863
  }) => {
834
864
  // TODO create a commandMap per rpc instance
@@ -840,12 +870,12 @@ const create$2 = async ({
840
870
  };
841
871
  const WebWorkerRpcClient = {
842
872
  __proto__: null,
843
- create: create$2
873
+ create: create$3
844
874
  };
845
875
 
846
876
  const assetDir = '';
847
877
 
848
- const create$1 = () => {
878
+ const create$2 = () => {
849
879
  const states = Object.create(null);
850
880
  return {
851
881
  get(uid) {
@@ -909,9 +939,9 @@ const {
909
939
  set: set$1,
910
940
  dispose: dispose$1,
911
941
  wrapCommand
912
- } = create$1();
942
+ } = create$2();
913
943
 
914
- const create = (uid, uri, x, y, width, height, platform, assetDir$1) => {
944
+ const create$1 = (uid, uri, x, y, width, height, platform, assetDir$1) => {
915
945
  const state = {
916
946
  description: '',
917
947
  iconSrc: '',
@@ -1146,30 +1176,60 @@ const handleClickFeatures = async (state, name) => {
1146
1176
  };
1147
1177
 
1148
1178
  const rpcs = Object.create(null);
1149
- const set$3 = (id, rpc) => {
1179
+ const set$g = (id, rpc) => {
1150
1180
  rpcs[id] = rpc;
1151
1181
  };
1152
1182
  const get = id => {
1153
1183
  return rpcs[id];
1154
1184
  };
1185
+
1186
+ /* eslint-disable @typescript-eslint/explicit-function-return-type */
1187
+
1188
+ const create = rpcId => {
1189
+ return {
1190
+ // @ts-ignore
1191
+ invoke(method, ...params) {
1192
+ const rpc = get(rpcId);
1193
+ // @ts-ignore
1194
+ return rpc.invoke(method, ...params);
1195
+ },
1196
+ // @ts-ignore
1197
+ invokeAndTransfer(method, ...params) {
1198
+ const rpc = get(rpcId);
1199
+ // @ts-ignore
1200
+ return rpc.invokeAndTransfer(method, ...params);
1201
+ },
1202
+ set(rpc) {
1203
+ set$g(rpcId, rpc);
1204
+ },
1205
+ async dispose() {
1206
+ const rpc = get(rpcId);
1207
+ await rpc.dispose();
1208
+ }
1209
+ };
1210
+ };
1155
1211
  const RendererWorker$1 = 1;
1156
- const invoke$2 = (method, ...params) => {
1157
- const rpc = get(RendererWorker$1);
1158
- // @ts-ignore
1159
- return rpc.invoke(method, ...params);
1212
+ const {
1213
+ invoke: invoke$3,
1214
+ set: set$3} = create(RendererWorker$1);
1215
+ const readFile$2 = async uri => {
1216
+ return invoke$3('FileSystem.readFile', uri);
1160
1217
  };
1161
- const set$2 = rpc => {
1162
- set$3(RendererWorker$1, rpc);
1218
+ const getAllExtensions$2 = async key => {
1219
+ return invoke$3('ExtensionManagement.getAllExtensions');
1163
1220
  };
1164
1221
  const RendererWorker = {
1165
1222
  __proto__: null,
1166
- invoke: invoke$2,
1167
- set: set$2
1168
- };
1223
+ getAllExtensions: getAllExtensions$2,
1224
+ invoke: invoke$3,
1225
+ readFile: readFile$2,
1226
+ set: set$3};
1169
1227
 
1170
1228
  const {
1171
1229
  invoke,
1172
- set
1230
+ set,
1231
+ readFile: readFile$1,
1232
+ getAllExtensions: getAllExtensions$1
1173
1233
  } = RendererWorker;
1174
1234
 
1175
1235
  const handleClickSize = async state => {
@@ -1375,7 +1435,8 @@ const getAllExtensions = async platform => {
1375
1435
  if (platform === Web) {
1376
1436
  return [];
1377
1437
  }
1378
- return invoke('ExtensionManagement.getAllExtensions');
1438
+ // @ts-ignore
1439
+ return getAllExtensions$1();
1379
1440
  };
1380
1441
  const getExtension$1 = async (id, platform) => {
1381
1442
  // TODO only ask one extension from renderer worker instead of all
@@ -1497,7 +1558,7 @@ const readFile = async uri => {
1497
1558
  const result = await response.text();
1498
1559
  return result;
1499
1560
  }
1500
- return invoke('FileSystem.readFile', uri);
1561
+ return readFile$1(uri);
1501
1562
  };
1502
1563
 
1503
1564
  const ENOENT = 'ENOENT';
@@ -1630,11 +1691,51 @@ const loadContent2 = async (state, savedState) => {
1630
1691
  return loadContent(state, state.platform, savedState);
1631
1692
  };
1632
1693
 
1694
+ const mergeClassNames = (...classNames) => {
1695
+ return classNames.filter(Boolean).join(' ');
1696
+ };
1697
+ const Button$1 = 1;
1698
+ const Div = 4;
1699
+ const H1 = 5;
1700
+ const Table$1 = 9;
1701
+ const TBody = 10;
1702
+ const Td = 11;
1703
+ const Text$1 = 12;
1704
+ const Th = 13;
1705
+ const THead = 14;
1706
+ const Tr = 15;
1707
+ const Img = 17;
1708
+ const H2 = 22;
1709
+ const Pre = 51;
1710
+ const A = 53;
1711
+ const VirtualDomElements = {
1712
+ __proto__: null,
1713
+ A,
1714
+ Button: Button$1,
1715
+ Div,
1716
+ H1,
1717
+ H2,
1718
+ Img,
1719
+ Pre,
1720
+ TBody,
1721
+ THead,
1722
+ Table: Table$1,
1723
+ Td,
1724
+ Th,
1725
+ Tr};
1726
+ const text = data => {
1727
+ return {
1728
+ type: Text$1,
1729
+ text: data,
1730
+ childCount: 0
1731
+ };
1732
+ };
1733
+
1633
1734
  const AdditionalDetails = 'AdditionalDetails';
1634
1735
  const AdditionalDetailsEntry = 'AdditionalDetailsEntry';
1635
1736
  const AdditionalDetailsTitle = 'AdditionalDetailsTitle';
1636
1737
  const Aside = 'Aside';
1637
- const Button$1 = 'Button';
1738
+ const Button = 'Button';
1638
1739
  const ButtonPrimary = 'ButtonPrimary';
1639
1740
  const DefaultMarkdown = 'DefaultMarkdown';
1640
1741
  const Categories = 'Categories';
@@ -1671,7 +1772,7 @@ const Normal = 'Normal';
1671
1772
  const Resource = 'Resource';
1672
1773
  const Resources = 'Resources';
1673
1774
  const Small = 'Small';
1674
- const Table$1 = 'Table';
1775
+ const Table = 'Table';
1675
1776
  const TableCell = 'TableCell';
1676
1777
  const TableHeading = 'TableHeading';
1677
1778
  const Viewlet = 'Viewlet';
@@ -1769,37 +1870,11 @@ const getDisplaySize = size => {
1769
1870
  });
1770
1871
  };
1771
1872
 
1772
- const A = 53;
1773
- const Button = 1;
1774
- const Div = 4;
1775
- const H1 = 5;
1776
- const H2 = 22;
1777
- const Img = 17;
1778
- const Pre = 51;
1779
- const Table = 9;
1780
- const TBody = 10;
1781
- const Td = 11;
1782
- const Th = 13;
1783
- const THead = 14;
1784
- const Tr = 15;
1785
-
1786
- const mergeClassNames = (...classNames) => {
1787
- return classNames.filter(Boolean).join(' ');
1788
- };
1789
- const Text$1 = 12;
1790
- const text = data => {
1791
- return {
1792
- type: Text$1,
1793
- text: data,
1794
- childCount: 0
1795
- };
1796
- };
1797
-
1798
1873
  const getChangelogVirtualDom = () => {
1799
1874
  const notImplemented$1 = notImplemented();
1800
1875
  // TODO set tabpanel role
1801
1876
  return [{
1802
- type: Div,
1877
+ type: VirtualDomElements.Div,
1803
1878
  className: Changelog,
1804
1879
  childCount: 1
1805
1880
  }, text(notImplemented$1)];
@@ -1811,11 +1886,11 @@ const Panel = 'panel';
1811
1886
 
1812
1887
  const getAdditionalDetailsEntryVirtualDom = (heading, items, renderer) => {
1813
1888
  return [{
1814
- type: Div,
1889
+ type: VirtualDomElements.Div,
1815
1890
  className: AdditionalDetailsEntry,
1816
1891
  childCount: 2
1817
1892
  }, {
1818
- type: Div,
1893
+ type: VirtualDomElements.Div,
1819
1894
  className: AdditionalDetailsTitle,
1820
1895
  childCount: 1
1821
1896
  }, text(heading), ...renderer(items)];
@@ -1826,7 +1901,7 @@ const getCategoryVirtualDom = category => {
1826
1901
  label
1827
1902
  } = category;
1828
1903
  return [{
1829
- type: Div,
1904
+ type: VirtualDomElements.Div,
1830
1905
  className: Category,
1831
1906
  childCount: 1
1832
1907
  }, text(label)];
@@ -1834,14 +1909,14 @@ const getCategoryVirtualDom = category => {
1834
1909
 
1835
1910
  const getCategoriesDom = categories => {
1836
1911
  return [{
1837
- type: Div,
1912
+ type: VirtualDomElements.Div,
1838
1913
  className: Categories,
1839
1914
  childCount: categories.length
1840
1915
  }, ...categories.flatMap(getCategoryVirtualDom)];
1841
1916
  };
1842
1917
 
1843
1918
  const parentNode$1 = {
1844
- type: Div,
1919
+ type: VirtualDomElements.Div,
1845
1920
  className: MoreInfoEntryKey,
1846
1921
  childCount: 1
1847
1922
  };
@@ -1854,13 +1929,13 @@ const getMoreInfoEntryKeyVirtualDom = item => {
1854
1929
 
1855
1930
  const getTag = (onClick, code) => {
1856
1931
  if (onClick) {
1857
- return A;
1932
+ return VirtualDomElements.A;
1858
1933
  }
1859
1934
  if (code) {
1860
1935
  // TODO use code tag
1861
- return Div;
1936
+ return VirtualDomElements.Div;
1862
1937
  }
1863
- return Div;
1938
+ return VirtualDomElements.Div;
1864
1939
  };
1865
1940
  const getClassName = (onClick, code) => {
1866
1941
  if (onClick) {
@@ -1888,12 +1963,12 @@ const getMoreInfoEntryValueVirtualDom = item => {
1888
1963
  };
1889
1964
 
1890
1965
  const parentNodeEven = {
1891
- type: Div,
1966
+ type: VirtualDomElements.Div,
1892
1967
  className: MoreInfoEntry,
1893
1968
  childCount: 2
1894
1969
  };
1895
1970
  const parentNodeOdd = {
1896
- type: Div,
1971
+ type: VirtualDomElements.Div,
1897
1972
  className: mergeClassNames(MoreInfoEntry, MoreInfoEntryOdd),
1898
1973
  childCount: 2
1899
1974
  };
@@ -1907,7 +1982,7 @@ const getMoreInfoEntryVirtualDom = item => {
1907
1982
 
1908
1983
  const getMoreInfoVirtualDom = items => {
1909
1984
  return [{
1910
- type: Div,
1985
+ type: VirtualDomElements.Div,
1911
1986
  className: MoreInfo,
1912
1987
  childCount: items.length
1913
1988
  }, ...items.flatMap(getMoreInfoEntryVirtualDom)];
@@ -1915,7 +1990,7 @@ const getMoreInfoVirtualDom = items => {
1915
1990
 
1916
1991
  const resourceNode = {
1917
1992
  // TODO use link with url
1918
- type: Div,
1993
+ type: VirtualDomElements.Div,
1919
1994
  className: Resource,
1920
1995
  childCount: 1
1921
1996
  };
@@ -1928,7 +2003,7 @@ const getResourceVirtualDom = resource => {
1928
2003
 
1929
2004
  const getResourcesVirtualDom = resources => {
1930
2005
  return [{
1931
- type: Div,
2006
+ type: VirtualDomElements.Div,
1932
2007
  className: Resources,
1933
2008
  childCount: resources.length
1934
2009
  }, ...resources.flatMap(getResourceVirtualDom)];
@@ -1939,11 +2014,11 @@ const getAdditionalDetailsVirtualDom = (showAdditionalDetails, firstHeading, ent
1939
2014
  return [];
1940
2015
  }
1941
2016
  return [{
1942
- type: Div,
2017
+ type: VirtualDomElements.Div,
1943
2018
  className: Aside,
1944
2019
  childCount: 1
1945
2020
  }, {
1946
- type: Div,
2021
+ type: VirtualDomElements.Div,
1947
2022
  className: AdditionalDetails,
1948
2023
  tabIndex: 0,
1949
2024
  childCount: 4
@@ -2026,7 +2101,7 @@ const getDetailsVirtualDom = async (sanitizedReadmeHtml, displaySize, extensionI
2026
2101
  const showAdditionalDetails = width > showAdditionalDetailsBreakpoint;
2027
2102
  const childCount = showAdditionalDetails ? 2 : 1;
2028
2103
  const dom = [{
2029
- type: Div,
2104
+ type: VirtualDomElements.Div,
2030
2105
  className: ExtensionDetailPanel,
2031
2106
  childCount: childCount,
2032
2107
  role: Panel
@@ -2065,14 +2140,14 @@ const getCommandTableEntries = extension => {
2065
2140
 
2066
2141
  const getFeatureContentHeadingVirtualDom = heading => {
2067
2142
  return [{
2068
- type: H1,
2143
+ type: VirtualDomElements.H1,
2069
2144
  childCount: 1
2070
2145
  }, text(heading)];
2071
2146
  };
2072
2147
 
2073
2148
  const getTableHeadingVirtualDom = heading => {
2074
2149
  return [{
2075
- type: Th,
2150
+ type: VirtualDomElements.Th,
2076
2151
  className: TableHeading,
2077
2152
  childCount: 1
2078
2153
  }, text(heading)];
@@ -2080,11 +2155,11 @@ const getTableHeadingVirtualDom = heading => {
2080
2155
 
2081
2156
  const getCellCodeVirtualDom = value => {
2082
2157
  return [{
2083
- type: Td,
2158
+ type: VirtualDomElements.Td,
2084
2159
  className: TableCell,
2085
2160
  childCount: 1
2086
2161
  }, {
2087
- type: Div,
2162
+ type: VirtualDomElements.Div,
2088
2163
  // TODO use code tag
2089
2164
  childCount: 1
2090
2165
  }, text(value)];
@@ -2092,7 +2167,7 @@ const getCellCodeVirtualDom = value => {
2092
2167
 
2093
2168
  const getCellTextVirtualDom = value => {
2094
2169
  return [{
2095
- type: Td,
2170
+ type: VirtualDomElements.Td,
2096
2171
  className: TableCell,
2097
2172
  childCount: 1
2098
2173
  }, text(value)];
@@ -2120,7 +2195,7 @@ const getCellVirtualDom = entry => {
2120
2195
 
2121
2196
  const getTableRowVirtualDom = entries => {
2122
2197
  return [{
2123
- type: Tr,
2198
+ type: VirtualDomElements.Tr,
2124
2199
  childCount: entries.length
2125
2200
  }, ...entries.flatMap(getCellVirtualDom)];
2126
2201
  };
@@ -2131,17 +2206,17 @@ const getTableVirtualDom = tableInfo => {
2131
2206
  rows
2132
2207
  } = tableInfo;
2133
2208
  return [{
2134
- type: Table,
2135
- className: Table$1,
2209
+ type: VirtualDomElements.Table,
2210
+ className: Table,
2136
2211
  childCount: 2
2137
2212
  }, {
2138
- type: THead,
2213
+ type: VirtualDomElements.THead,
2139
2214
  childCount: 1
2140
2215
  }, {
2141
- type: Tr,
2216
+ type: VirtualDomElements.Tr,
2142
2217
  childCount: headings.length
2143
2218
  }, ...headings.flatMap(getTableHeadingVirtualDom), {
2144
- type: TBody,
2219
+ type: VirtualDomElements.TBody,
2145
2220
  childCount: rows.length
2146
2221
  }, ...rows.flatMap(getTableRowVirtualDom)];
2147
2222
  };
@@ -2151,7 +2226,7 @@ const getFeatureCommandsVirtualDom = extension => {
2151
2226
  const heading = commands();
2152
2227
  const tableInfo = getCommandTableEntries(extension);
2153
2228
  return [{
2154
- type: Div,
2229
+ type: VirtualDomElements.Div,
2155
2230
  className: FeatureContent,
2156
2231
  childCount: 2
2157
2232
  }, ...getFeatureContentHeadingVirtualDom(heading), ...getTableVirtualDom(tableInfo)];
@@ -2181,7 +2256,7 @@ const getJsonValidationTableEntries = extension => {
2181
2256
  };
2182
2257
 
2183
2258
  const parentNode = {
2184
- type: Div,
2259
+ type: VirtualDomElements.Div,
2185
2260
  className: FeatureContent,
2186
2261
  childCount: 2
2187
2262
  };
@@ -2194,11 +2269,11 @@ const getFeatureJsonValidationVirtualDom = extension => {
2194
2269
  const getFeatureNotImplementedVirtualDom = () => {
2195
2270
  const heading = 'Not implemented';
2196
2271
  return [{
2197
- type: Div,
2272
+ type: VirtualDomElements.Div,
2198
2273
  className: FeatureContent,
2199
2274
  childCount: 1
2200
2275
  }, {
2201
- type: H1,
2276
+ type: VirtualDomElements.H1,
2202
2277
  childCount: 1
2203
2278
  }, text(heading)];
2204
2279
  };
@@ -2207,7 +2282,7 @@ const getFeatureProgrammingLanguagesVirtualDom = () => {
2207
2282
  const heading = programmingLanguages();
2208
2283
  // TODO
2209
2284
  return [{
2210
- type: Div,
2285
+ type: VirtualDomElements.Div,
2211
2286
  className: FeatureContent,
2212
2287
  childCount: 1
2213
2288
  }, ...getFeatureContentHeadingVirtualDom(heading)];
@@ -2243,7 +2318,7 @@ const getFeatureSettingsVirtualDom = extension => {
2243
2318
  const heading = settings();
2244
2319
  const tableInfo = getSettingsTableEntries(extension);
2245
2320
  return [{
2246
- type: Div,
2321
+ type: VirtualDomElements.Div,
2247
2322
  className: FeatureContent,
2248
2323
  childCount: 2
2249
2324
  }, ...getFeatureContentHeadingVirtualDom(heading), ...getTableVirtualDom(tableInfo)];
@@ -2267,11 +2342,11 @@ const getFeatureThemesVirtualDom = async themesHtml => {
2267
2342
  const childCount = getVirtualDomChildCount(markdownDom);
2268
2343
  const heading = theme();
2269
2344
  return [{
2270
- type: Div,
2345
+ type: VirtualDomElements.Div,
2271
2346
  className: FeatureContent,
2272
2347
  childCount: 2
2273
2348
  }, ...getFeatureContentHeadingVirtualDom(heading), {
2274
- type: Div,
2349
+ type: VirtualDomElements.Div,
2275
2350
  className: DefaultMarkdown,
2276
2351
  childCount
2277
2352
  }, ...markdownDom];
@@ -2298,17 +2373,17 @@ const getWebViews = extension => {
2298
2373
  };
2299
2374
 
2300
2375
  const heading = {
2301
- type: H2,
2376
+ type: VirtualDomElements.H2,
2302
2377
  className: DefinitionListItemHeading,
2303
2378
  childCount: 1
2304
2379
  };
2305
2380
  const pre = {
2306
- type: Pre,
2381
+ type: VirtualDomElements.Pre,
2307
2382
  className: DefinitionListItemValue,
2308
2383
  childCount: 1
2309
2384
  };
2310
2385
  const item = {
2311
- type: Div,
2386
+ type: VirtualDomElements.Div,
2312
2387
  className: DefinitionListItem,
2313
2388
  childCount: 2
2314
2389
  };
@@ -2324,7 +2399,7 @@ const getWebViewVirtualDom = webView => {
2324
2399
  const textContentSecurityPolicy = contentSecurityPolicy();
2325
2400
  const textElements = elements();
2326
2401
  return [{
2327
- type: Div,
2402
+ type: VirtualDomElements.Div,
2328
2403
  className: FeatureWebView,
2329
2404
  childCount: 5
2330
2405
  }, item, heading, text(textId), pre, text(id$1), item, heading, text(textSelector), pre, text(selectorString), item, heading, text(textContentSecurityPolicy), pre, text(contentSecurityPolicyString), item, heading, text(textElements), pre, text(elementsString)];
@@ -2334,11 +2409,11 @@ const getFeatureWebViewsVirtualDom = extension => {
2334
2409
  const webViews$1 = getWebViews(extension);
2335
2410
  const heading = webViews();
2336
2411
  return [{
2337
- type: Div,
2412
+ type: VirtualDomElements.Div,
2338
2413
  className: FeatureContent,
2339
2414
  childCount: 2
2340
2415
  }, ...getFeatureContentHeadingVirtualDom(heading), {
2341
- type: Div,
2416
+ type: VirtualDomElements.Div,
2342
2417
  childCount: webViews$1.length
2343
2418
  }, ...webViews$1.flatMap(getWebViewVirtualDom)];
2344
2419
  };
@@ -2371,7 +2446,7 @@ const getFeatureListItemVirtualDom = feature => {
2371
2446
  const className = selected ? 'Feature FeatureSelected' : Feature;
2372
2447
  return [{
2373
2448
  // TODO use role list item or tab
2374
- type: Button,
2449
+ type: VirtualDomElements.Button,
2375
2450
  name: id,
2376
2451
  className,
2377
2452
  childCount: 1
@@ -2381,7 +2456,7 @@ const getFeatureListItemVirtualDom = feature => {
2381
2456
  const getFeatureListVirtualDom = features => {
2382
2457
  return [{
2383
2458
  // TODO use either list or tabs role
2384
- type: Div,
2459
+ type: VirtualDomElements.Div,
2385
2460
  className: FeaturesList,
2386
2461
  childCount: features.length,
2387
2462
  onClick: HandleFeaturesClick
@@ -2392,17 +2467,17 @@ const getFeaturesVirtualDom = async (features, themesHtml, selectedFeature, exte
2392
2467
  if (features.length === 0) {
2393
2468
  const none$1 = none();
2394
2469
  return [{
2395
- type: Div,
2470
+ type: VirtualDomElements.Div,
2396
2471
  className: Features,
2397
2472
  childCount: 3
2398
2473
  }, text(none$1)];
2399
2474
  }
2400
2475
  return [{
2401
- type: Div,
2476
+ type: VirtualDomElements.Div,
2402
2477
  className: Features,
2403
2478
  childCount: 3
2404
2479
  }, ...getFeatureListVirtualDom(features), {
2405
- type: Div,
2480
+ type: VirtualDomElements.Div,
2406
2481
  className: mergeClassNames(Sash, SashVertical),
2407
2482
  childCount: 0
2408
2483
  }, ...(await getFeatureContentVirtualDom(features, themesHtml, selectedFeature, extension))];
@@ -2423,8 +2498,8 @@ const getExtensionDetailContentVirtualDom = async (sanitizedReadmeHtml, themesHt
2423
2498
 
2424
2499
  const getButtonVirtualDom = (message, onClick) => {
2425
2500
  return [{
2426
- type: Button,
2427
- className: mergeClassNames(Button$1, ButtonPrimary),
2501
+ type: VirtualDomElements.Button,
2502
+ className: mergeClassNames(Button, ButtonPrimary),
2428
2503
  onClick,
2429
2504
  childCount: 1
2430
2505
  }, text(message)];
@@ -2432,7 +2507,7 @@ const getButtonVirtualDom = (message, onClick) => {
2432
2507
 
2433
2508
  const getExtensionDetailHeaderActionsVirtualDom = () => {
2434
2509
  const dom = [{
2435
- type: Div,
2510
+ type: VirtualDomElements.Div,
2436
2511
  className: ExtensionDetailHeaderActions,
2437
2512
  childCount: 2
2438
2513
  }, ...getButtonVirtualDom('Disable', HandleClickDisable), ...getButtonVirtualDom('Uninstall', HandleClickUninstall)];
@@ -2446,26 +2521,26 @@ const getExtensionDetailHeaderVirtualDom = extensionDetail => {
2446
2521
  description
2447
2522
  } = extensionDetail;
2448
2523
  const dom = [{
2449
- type: Div,
2524
+ type: VirtualDomElements.Div,
2450
2525
  className: ExtensionDetailHeader,
2451
2526
  childCount: 2
2452
2527
  }, {
2453
- type: Img,
2528
+ type: VirtualDomElements.Img,
2454
2529
  className: ExtensionDetailIcon,
2455
2530
  alt: '',
2456
2531
  draggable: false,
2457
2532
  childCount: 0,
2458
2533
  src: iconSrc
2459
2534
  }, {
2460
- type: Div,
2535
+ type: VirtualDomElements.Div,
2461
2536
  className: ExtensionDetailHeaderDetails,
2462
2537
  childCount: 3
2463
2538
  }, {
2464
- type: Div,
2539
+ type: VirtualDomElements.Div,
2465
2540
  className: ExtensionDetailName,
2466
2541
  childCount: 1
2467
2542
  }, text(name), {
2468
- type: Div,
2543
+ type: VirtualDomElements.Div,
2469
2544
  className: ExtensionDetailDescription,
2470
2545
  childCount: 1
2471
2546
  }, text(description), ...getExtensionDetailHeaderActionsVirtualDom()];
@@ -2500,7 +2575,7 @@ const getTabVirtualDom = tab => {
2500
2575
  const className = selected ? selectedClassName : defaultClassName;
2501
2576
  const ariaSelected = selected ? 'true' : 'false';
2502
2577
  return [{
2503
- type: Button,
2578
+ type: VirtualDomElements.Button,
2504
2579
  role: Tab,
2505
2580
  name,
2506
2581
  className,
@@ -2512,7 +2587,7 @@ const getTabVirtualDom = tab => {
2512
2587
 
2513
2588
  const getTabsVirtualDom = tabs => {
2514
2589
  return [{
2515
- type: Div,
2590
+ type: VirtualDomElements.Div,
2516
2591
  className: ExtensionDetailTabs,
2517
2592
  childCount: tabs.length,
2518
2593
  role: TabList,
@@ -2553,7 +2628,7 @@ const getExtensionDetailVirtualDom = async (extensionDetail, sanitizedReadmeHtml
2553
2628
  const sizeValue = getViewletSize(newState?.width || 0);
2554
2629
  const sizeClass = getClassNames(sizeValue);
2555
2630
  const dom = [{
2556
- type: Div,
2631
+ type: VirtualDomElements.Div,
2557
2632
  className: mergeClassNames(Viewlet, ExtensionDetail, sizeClass),
2558
2633
  childCount: 3
2559
2634
  }, ...getExtensionDetailHeaderVirtualDom(extensionDetail), ...getTabsVirtualDom(tabs), ...(await getExtensionDetailContentVirtualDom(sanitizedReadmeHtml, themesHtml, selectedTab, features, displaySize, extensionId, extensionVersion, selectedFeature, extension, width))];
@@ -2650,7 +2725,7 @@ const terminate = () => {
2650
2725
  };
2651
2726
 
2652
2727
  const commandMap = {
2653
- 'ExtensionDetail.create': create,
2728
+ 'ExtensionDetail.create': create$1,
2654
2729
  'ExtensionDetail.diff2': diff2,
2655
2730
  'ExtensionDetail.dispose': dispose,
2656
2731
  'ExtensionDetail.getCommandIds': getCommandIds,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-detail-view",
3
- "version": "3.22.0",
3
+ "version": "3.24.0",
4
4
  "description": "Extension Detail View Worker",
5
5
  "license": "MIT",
6
6
  "author": "Lvce Editor",