@lvce-editor/extension-search-view 3.2.0 → 3.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.
- package/dist/extensionSearchViewWorkerMain.js +163 -194
- package/package.json +1 -1
|
@@ -797,6 +797,9 @@ const createRpc = ipc => {
|
|
|
797
797
|
},
|
|
798
798
|
invokeAndTransfer(method, ...params) {
|
|
799
799
|
return invokeAndTransfer(ipc, method, ...params);
|
|
800
|
+
},
|
|
801
|
+
async dispose() {
|
|
802
|
+
await ipc?.dispose();
|
|
800
803
|
}
|
|
801
804
|
};
|
|
802
805
|
return rpc;
|
|
@@ -866,9 +869,14 @@ const NoExtensionsFound = 'No extensions found.';
|
|
|
866
869
|
const Filter$1 = 'Filter';
|
|
867
870
|
const Refresh$1 = 'Refresh';
|
|
868
871
|
const ClearExtensionSearchResults = 'Clear extension search results';
|
|
872
|
+
const Enable = 'Enable';
|
|
873
|
+
const Disable = 'Disable';
|
|
874
|
+
const InstallAnotherVersion = 'Install Another Version';
|
|
869
875
|
const SearchExtensionsInMarketplace = 'Search Extensions in Marketplace';
|
|
870
876
|
const ViewsAndMoreActions = 'Views and more Actions...';
|
|
871
877
|
const Extensions = 'Extensions';
|
|
878
|
+
const Copy = 'Copy';
|
|
879
|
+
const CopyExtensionId = 'CopyExtensionId';
|
|
872
880
|
|
|
873
881
|
const noExtensionsFound = () => {
|
|
874
882
|
return i18nString(NoExtensionsFound);
|
|
@@ -885,6 +893,21 @@ const extensions = () => {
|
|
|
885
893
|
const clearExtensionSearchResults = () => {
|
|
886
894
|
return i18nString(ClearExtensionSearchResults);
|
|
887
895
|
};
|
|
896
|
+
const enable = () => {
|
|
897
|
+
return i18nString(Enable);
|
|
898
|
+
};
|
|
899
|
+
const disable = () => {
|
|
900
|
+
return i18nString(Disable);
|
|
901
|
+
};
|
|
902
|
+
const installAnotherVersion = () => {
|
|
903
|
+
return i18nString(InstallAnotherVersion);
|
|
904
|
+
};
|
|
905
|
+
const copy = () => {
|
|
906
|
+
return i18nString(Copy);
|
|
907
|
+
};
|
|
908
|
+
const copyExtensionId = () => {
|
|
909
|
+
return i18nString(CopyExtensionId);
|
|
910
|
+
};
|
|
888
911
|
const searchExtensionsInMarketPlace = () => {
|
|
889
912
|
return i18nString(SearchExtensionsInMarketplace);
|
|
890
913
|
};
|
|
@@ -1356,7 +1379,7 @@ const focusPreviousPage = state => {
|
|
|
1356
1379
|
return focusIndex(state, indexPreviousPage);
|
|
1357
1380
|
};
|
|
1358
1381
|
|
|
1359
|
-
const Button$
|
|
1382
|
+
const Button$1 = 1;
|
|
1360
1383
|
|
|
1361
1384
|
const ClearAll = 'ClearAll';
|
|
1362
1385
|
const Filter = 'Filter';
|
|
@@ -1365,19 +1388,19 @@ const Ellipsis = 'Ellipsis';
|
|
|
1365
1388
|
|
|
1366
1389
|
const getActions = () => {
|
|
1367
1390
|
return [{
|
|
1368
|
-
type: Button$
|
|
1391
|
+
type: Button$1,
|
|
1369
1392
|
id: refresh(),
|
|
1370
1393
|
icon: Refresh,
|
|
1371
1394
|
command: ''
|
|
1372
1395
|
}, {
|
|
1373
|
-
type: Button$
|
|
1396
|
+
type: Button$1,
|
|
1374
1397
|
id: viewsAndMoreActions(),
|
|
1375
1398
|
icon: Ellipsis,
|
|
1376
1399
|
command: ''
|
|
1377
1400
|
}];
|
|
1378
1401
|
};
|
|
1379
1402
|
|
|
1380
|
-
const commandIds = ['clearSearchResults', 'closeSuggest', 'focusFirst', 'focusLast', 'focusNext', 'focusNextPage', 'focusPrevious', 'focusPreviousPage', 'handleBlur', 'handleClick', 'handleContextMenu', 'handleDisable', 'handleFocus', 'handleInput', 'handleInstall', 'handleScrollBarCaptureLost', 'handleScrollBarClick', 'handleScrollBarMove', 'handleUninstall', 'handleWheel', 'openSuggest', 'render', 'saveState', 'scrollDown', 'selectIndex', 'setDeltaY', 'toggleSuggest'
|
|
1403
|
+
const commandIds = ['clearSearchResults', 'closeSuggest', 'focusFirst', 'focusLast', 'focusNext', 'focusNextPage', 'focusPrevious', 'focusPreviousPage', 'handleBlur', 'handleClick', 'handleClickFilter', 'handleContextMenu', 'handleDisable', 'handleFocus', 'handleInput', 'handleInstall', 'handleScrollBarCaptureLost', 'handleScrollBarClick', 'handleScrollBarMove', 'handleScrollBarThumbPointerMove', 'handleUninstall', 'handleWheel', 'openSuggest', 'render', 'saveState', 'scrollDown', 'selectIndex', 'setDeltaY', 'toggleSuggest'];
|
|
1381
1404
|
|
|
1382
1405
|
const getCommandIds = () => {
|
|
1383
1406
|
return commandIds;
|
|
@@ -1440,6 +1463,37 @@ const getKeyBindings = () => {
|
|
|
1440
1463
|
}];
|
|
1441
1464
|
};
|
|
1442
1465
|
|
|
1466
|
+
const None$1 = 0;
|
|
1467
|
+
|
|
1468
|
+
const getMenuEntries = () => {
|
|
1469
|
+
return [{
|
|
1470
|
+
id: 'enable',
|
|
1471
|
+
label: enable(),
|
|
1472
|
+
flags: None$1,
|
|
1473
|
+
command: 'SearchExtensions.enable'
|
|
1474
|
+
}, {
|
|
1475
|
+
id: 'disable',
|
|
1476
|
+
label: disable(),
|
|
1477
|
+
flags: None$1,
|
|
1478
|
+
command: 'SearchExtensions.disable'
|
|
1479
|
+
}, {
|
|
1480
|
+
id: 'installAnotherVersion',
|
|
1481
|
+
label: installAnotherVersion(),
|
|
1482
|
+
flags: None$1,
|
|
1483
|
+
command: 'SearchExtensions.installAnotherVersion'
|
|
1484
|
+
}, {
|
|
1485
|
+
id: 'copy',
|
|
1486
|
+
label: copy(),
|
|
1487
|
+
flags: None$1,
|
|
1488
|
+
command: 'SearchExtensions.copy'
|
|
1489
|
+
}, {
|
|
1490
|
+
id: 'copyExtensionId',
|
|
1491
|
+
label: copyExtensionId(),
|
|
1492
|
+
flags: None$1,
|
|
1493
|
+
command: 'SearchExtensions.copyExtensionId'
|
|
1494
|
+
}];
|
|
1495
|
+
};
|
|
1496
|
+
|
|
1443
1497
|
const handleBlur = state => {
|
|
1444
1498
|
return state;
|
|
1445
1499
|
};
|
|
@@ -1518,7 +1572,7 @@ const show = async (x, y, id) => {
|
|
|
1518
1572
|
number(x);
|
|
1519
1573
|
number(y);
|
|
1520
1574
|
number(id);
|
|
1521
|
-
|
|
1575
|
+
await invoke('ContextMenu.show', x, y, id);
|
|
1522
1576
|
};
|
|
1523
1577
|
|
|
1524
1578
|
const ManageExtension = 8;
|
|
@@ -1774,7 +1828,7 @@ const getDescription = extension => {
|
|
|
1774
1828
|
}
|
|
1775
1829
|
return extension.description;
|
|
1776
1830
|
};
|
|
1777
|
-
const getId = extension => {
|
|
1831
|
+
const getId$1 = extension => {
|
|
1778
1832
|
if (!extension || !extension.id) {
|
|
1779
1833
|
return 'n/a';
|
|
1780
1834
|
}
|
|
@@ -1798,7 +1852,7 @@ const getPublisher = extension => {
|
|
|
1798
1852
|
|
|
1799
1853
|
const normalizeExtension$1 = (extension, platform, assetDir) => {
|
|
1800
1854
|
return {
|
|
1801
|
-
id: getId(extension),
|
|
1855
|
+
id: getId$1(extension),
|
|
1802
1856
|
name: getName(extension),
|
|
1803
1857
|
description: getDescription(extension),
|
|
1804
1858
|
uri: '',
|
|
@@ -1867,58 +1921,84 @@ const ExtensionListItemAuthorName = 'ExtensionListItemAuthorName';
|
|
|
1867
1921
|
const ExtensionListItemDescription = 'ExtensionListItemDescription';
|
|
1868
1922
|
const ExtensionListItemDetail = 'ExtensionListItemDetail';
|
|
1869
1923
|
const ExtensionListItemFooter = 'ExtensionListItemFooter';
|
|
1870
|
-
const MaskIcon = 'MaskIcon';
|
|
1871
1924
|
const ExtensionListItemIcon = 'ExtensionListItemIcon';
|
|
1872
1925
|
const ExtensionListItemName = 'ExtensionListItemName';
|
|
1873
1926
|
const IconButton = 'IconButton';
|
|
1874
1927
|
const ListItems = 'ListItems';
|
|
1928
|
+
const MaskIcon = 'MaskIcon';
|
|
1875
1929
|
const MultilineInputBox = 'MultilineInputBox';
|
|
1876
1930
|
const ScrollBarThumb = 'ScrollBarThumb';
|
|
1877
1931
|
const ScrollBarThumbActive = 'ScrollBarThumbActive';
|
|
1878
1932
|
const SearchField = 'SearchField';
|
|
1933
|
+
const SearchFieldButton = 'SearchFieldButton';
|
|
1879
1934
|
const SearchFieldButtons = 'SearchFieldButtons';
|
|
1880
1935
|
const SearchFieldContainer = 'SearchFieldContainer';
|
|
1936
|
+
const SearchFieldDisabled = 'SearchFieldDisabled';
|
|
1937
|
+
|
|
1938
|
+
const HandleContextMenu = 'handleContextMenu';
|
|
1939
|
+
const HandlePointerDown = 'handlePointerDown';
|
|
1940
|
+
const HandleTouchStart = 'handleTouchStart';
|
|
1941
|
+
const HandleWheel = 'handleWheel';
|
|
1942
|
+
const HandleExtensionsInput = 'handleExtensionsInput';
|
|
1943
|
+
const HandleClearSearchResults = 'handleClearSearchResults';
|
|
1944
|
+
const HandleClickFilter = 'handleClickFilter';
|
|
1881
1945
|
|
|
1882
|
-
const CheckBox = 'checkbox';
|
|
1883
1946
|
const List = 'list';
|
|
1884
1947
|
const ListItem = 'listitem';
|
|
1885
1948
|
const None = 'none';
|
|
1886
1949
|
const ToolBar = 'toolbar';
|
|
1887
1950
|
|
|
1888
|
-
const
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
const
|
|
1951
|
+
const mergeClassNames = (...classNames) => {
|
|
1952
|
+
return classNames.filter(Boolean).join(' ');
|
|
1953
|
+
};
|
|
1954
|
+
const Text = 12;
|
|
1955
|
+
const text = data => {
|
|
1956
|
+
return {
|
|
1957
|
+
type: Text,
|
|
1958
|
+
text: data,
|
|
1959
|
+
childCount: 0
|
|
1960
|
+
};
|
|
1961
|
+
};
|
|
1962
|
+
|
|
1963
|
+
const Div = 4;
|
|
1964
|
+
const Img = 17;
|
|
1965
|
+
const TextArea = 62;
|
|
1966
|
+
const Button = 1;
|
|
1892
1967
|
|
|
1968
|
+
const getClassName$1 = enabled => {
|
|
1969
|
+
if (enabled) {
|
|
1970
|
+
return SearchFieldButton;
|
|
1971
|
+
}
|
|
1972
|
+
return mergeClassNames(SearchFieldButton, SearchFieldDisabled);
|
|
1973
|
+
};
|
|
1893
1974
|
const getSearchFieldButtonVirtualDom = button => {
|
|
1894
1975
|
const {
|
|
1895
1976
|
icon,
|
|
1896
|
-
|
|
1897
|
-
|
|
1977
|
+
title,
|
|
1978
|
+
enabled
|
|
1898
1979
|
} = button;
|
|
1899
1980
|
return [{
|
|
1900
|
-
type: Div
|
|
1901
|
-
className:
|
|
1981
|
+
type: Div,
|
|
1982
|
+
className: getClassName$1(enabled),
|
|
1902
1983
|
title,
|
|
1903
|
-
role: CheckBox,
|
|
1904
|
-
ariaChecked: checked,
|
|
1905
1984
|
tabIndex: 0,
|
|
1906
1985
|
childCount: 1
|
|
1907
1986
|
}, {
|
|
1908
|
-
type: Div
|
|
1909
|
-
className:
|
|
1987
|
+
type: Div,
|
|
1988
|
+
className: mergeClassNames(MaskIcon, icon),
|
|
1910
1989
|
childCount: 0
|
|
1911
1990
|
}];
|
|
1912
1991
|
};
|
|
1913
1992
|
|
|
1914
1993
|
const getSearchFieldVirtualDom = (name, placeholder, onInput, insideButtons, outsideButtons, onFocus = '') => {
|
|
1994
|
+
// TODO avoid mutation
|
|
1915
1995
|
const dom = [{
|
|
1916
|
-
type: Div
|
|
1996
|
+
type: Div,
|
|
1917
1997
|
className: SearchField,
|
|
1918
1998
|
role: None,
|
|
1919
1999
|
childCount: 2
|
|
1920
2000
|
}, {
|
|
1921
|
-
type: TextArea
|
|
2001
|
+
type: TextArea,
|
|
1922
2002
|
className: MultilineInputBox,
|
|
1923
2003
|
spellcheck: false,
|
|
1924
2004
|
autocapitalize: 'off',
|
|
@@ -1929,13 +2009,13 @@ const getSearchFieldVirtualDom = (name, placeholder, onInput, insideButtons, out
|
|
|
1929
2009
|
onFocus,
|
|
1930
2010
|
childCount: 0
|
|
1931
2011
|
}, {
|
|
1932
|
-
type: Div
|
|
2012
|
+
type: Div,
|
|
1933
2013
|
className: SearchFieldButtons,
|
|
1934
2014
|
childCount: insideButtons.length
|
|
1935
2015
|
}, ...insideButtons.flatMap(getSearchFieldButtonVirtualDom)];
|
|
1936
2016
|
if (outsideButtons.length > 0) {
|
|
1937
2017
|
dom.unshift({
|
|
1938
|
-
type: Div
|
|
2018
|
+
type: Div,
|
|
1939
2019
|
className: SearchFieldContainer,
|
|
1940
2020
|
role: None,
|
|
1941
2021
|
childCount: 1 + outsideButtons.length
|
|
@@ -1945,196 +2025,78 @@ const getSearchFieldVirtualDom = (name, placeholder, onInput, insideButtons, out
|
|
|
1945
2025
|
return dom;
|
|
1946
2026
|
};
|
|
1947
2027
|
|
|
2028
|
+
const parentNode = {
|
|
2029
|
+
type: Div,
|
|
2030
|
+
className: ExtensionHeader,
|
|
2031
|
+
childCount: 1
|
|
2032
|
+
};
|
|
1948
2033
|
const getExtensionHeaderVirtualDom = (placeholder, actions) => {
|
|
1949
|
-
return [
|
|
1950
|
-
type: Div$1,
|
|
1951
|
-
className: ExtensionHeader,
|
|
1952
|
-
childCount: 1
|
|
1953
|
-
}, ...getSearchFieldVirtualDom('extensions', placeholder, 'handleExtensionsInput', actions, [])];
|
|
2034
|
+
return [parentNode, ...getSearchFieldVirtualDom('extensions', placeholder, HandleExtensionsInput, actions, [])];
|
|
1954
2035
|
};
|
|
1955
2036
|
|
|
1956
|
-
const
|
|
2037
|
+
const getInputActions = newState => {
|
|
2038
|
+
const clearEnabled = newState.searchValue.length > 0;
|
|
1957
2039
|
const actions = [{
|
|
1958
|
-
|
|
1959
|
-
title: clearExtensionSearchResults(),
|
|
2040
|
+
command: HandleClearSearchResults,
|
|
1960
2041
|
icon: `MaskIcon${ClearAll}`,
|
|
1961
|
-
|
|
2042
|
+
title: clearExtensionSearchResults(),
|
|
2043
|
+
type: Button$1,
|
|
2044
|
+
enabled: clearEnabled
|
|
1962
2045
|
}, {
|
|
1963
|
-
|
|
2046
|
+
icon: `MaskIcon${Filter}`,
|
|
1964
2047
|
title: filter(),
|
|
1965
|
-
|
|
2048
|
+
type: Button$1,
|
|
2049
|
+
command: HandleClickFilter,
|
|
2050
|
+
enabled: true
|
|
1966
2051
|
}];
|
|
2052
|
+
return actions;
|
|
2053
|
+
};
|
|
2054
|
+
|
|
2055
|
+
const renderHeader = newState => {
|
|
2056
|
+
const actions = getInputActions(newState);
|
|
1967
2057
|
const dom = getExtensionHeaderVirtualDom(newState.placeholder, actions);
|
|
1968
2058
|
return ['setHeaderDom', dom];
|
|
1969
2059
|
};
|
|
1970
2060
|
|
|
1971
|
-
const HandleContextMenu = 'handleContextMenu';
|
|
1972
|
-
const HandlePointerDown = 'handlePointerDown';
|
|
1973
|
-
const HandleTouchStart = 'handleTouchStart';
|
|
1974
|
-
const HandleWheel = 'handleWheel';
|
|
1975
|
-
|
|
1976
2061
|
const Extension = 'Extension';
|
|
1977
2062
|
|
|
1978
|
-
var __defProp = Object.defineProperty;
|
|
1979
|
-
var __export = (target, all) => {
|
|
1980
|
-
for (var name in all) __defProp(target, name, {
|
|
1981
|
-
get: all[name],
|
|
1982
|
-
enumerable: true
|
|
1983
|
-
});
|
|
1984
|
-
};
|
|
1985
|
-
|
|
1986
|
-
// src/parts/MergeClassNames/MergeClassNames.ts
|
|
1987
|
-
var mergeClassNames = (...classNames) => {
|
|
1988
|
-
return classNames.filter(Boolean).join(" ");
|
|
1989
|
-
};
|
|
1990
|
-
|
|
1991
|
-
// src/parts/VirtualDomElements/VirtualDomElements.ts
|
|
1992
|
-
var VirtualDomElements_exports = {};
|
|
1993
|
-
__export(VirtualDomElements_exports, {
|
|
1994
|
-
A: () => A,
|
|
1995
|
-
Abbr: () => Abbr,
|
|
1996
|
-
Article: () => Article,
|
|
1997
|
-
Aside: () => Aside,
|
|
1998
|
-
Audio: () => Audio,
|
|
1999
|
-
Br: () => Br,
|
|
2000
|
-
Button: () => Button,
|
|
2001
|
-
Cite: () => Cite,
|
|
2002
|
-
Col: () => Col,
|
|
2003
|
-
ColGroup: () => ColGroup,
|
|
2004
|
-
Data: () => Data,
|
|
2005
|
-
Dd: () => Dd,
|
|
2006
|
-
Del: () => Del,
|
|
2007
|
-
Div: () => Div,
|
|
2008
|
-
Dl: () => Dl,
|
|
2009
|
-
Figcaption: () => Figcaption,
|
|
2010
|
-
Figure: () => Figure,
|
|
2011
|
-
Footer: () => Footer,
|
|
2012
|
-
H1: () => H1,
|
|
2013
|
-
H2: () => H2,
|
|
2014
|
-
H3: () => H3,
|
|
2015
|
-
H4: () => H4,
|
|
2016
|
-
H5: () => H5,
|
|
2017
|
-
H6: () => H6,
|
|
2018
|
-
Header: () => Header,
|
|
2019
|
-
Hr: () => Hr,
|
|
2020
|
-
I: () => I,
|
|
2021
|
-
Img: () => Img,
|
|
2022
|
-
Input: () => Input,
|
|
2023
|
-
Ins: () => Ins,
|
|
2024
|
-
Kbd: () => Kbd,
|
|
2025
|
-
Li: () => Li,
|
|
2026
|
-
Nav: () => Nav,
|
|
2027
|
-
Ol: () => Ol,
|
|
2028
|
-
Option: () => Option,
|
|
2029
|
-
P: () => P,
|
|
2030
|
-
Pre: () => Pre,
|
|
2031
|
-
Root: () => Root,
|
|
2032
|
-
Search: () => Search,
|
|
2033
|
-
Section: () => Section,
|
|
2034
|
-
Select: () => Select,
|
|
2035
|
-
Span: () => Span,
|
|
2036
|
-
TBody: () => TBody,
|
|
2037
|
-
THead: () => THead,
|
|
2038
|
-
Table: () => Table,
|
|
2039
|
-
Td: () => Td,
|
|
2040
|
-
Text: () => Text,
|
|
2041
|
-
TextArea: () => TextArea,
|
|
2042
|
-
Tfoot: () => Tfoot,
|
|
2043
|
-
Th: () => Th,
|
|
2044
|
-
Time: () => Time,
|
|
2045
|
-
Tr: () => Tr,
|
|
2046
|
-
Ul: () => Ul,
|
|
2047
|
-
Video: () => Video
|
|
2048
|
-
});
|
|
2049
|
-
var Audio = 0;
|
|
2050
|
-
var Button = 1;
|
|
2051
|
-
var Col = 2;
|
|
2052
|
-
var ColGroup = 3;
|
|
2053
|
-
var Div = 4;
|
|
2054
|
-
var H1 = 5;
|
|
2055
|
-
var Input = 6;
|
|
2056
|
-
var Kbd = 7;
|
|
2057
|
-
var Span = 8;
|
|
2058
|
-
var Table = 9;
|
|
2059
|
-
var TBody = 10;
|
|
2060
|
-
var Td = 11;
|
|
2061
|
-
var Text = 12;
|
|
2062
|
-
var Th = 13;
|
|
2063
|
-
var THead = 14;
|
|
2064
|
-
var Tr = 15;
|
|
2065
|
-
var I = 16;
|
|
2066
|
-
var Img = 17;
|
|
2067
|
-
var Root = 0;
|
|
2068
|
-
var Ins = 20;
|
|
2069
|
-
var Del = 21;
|
|
2070
|
-
var H2 = 22;
|
|
2071
|
-
var H3 = 23;
|
|
2072
|
-
var H4 = 24;
|
|
2073
|
-
var H5 = 25;
|
|
2074
|
-
var H6 = 26;
|
|
2075
|
-
var Article = 27;
|
|
2076
|
-
var Aside = 28;
|
|
2077
|
-
var Footer = 29;
|
|
2078
|
-
var Header = 30;
|
|
2079
|
-
var Nav = 40;
|
|
2080
|
-
var Section = 41;
|
|
2081
|
-
var Search = 42;
|
|
2082
|
-
var Dd = 43;
|
|
2083
|
-
var Dl = 44;
|
|
2084
|
-
var Figcaption = 45;
|
|
2085
|
-
var Figure = 46;
|
|
2086
|
-
var Hr = 47;
|
|
2087
|
-
var Li = 48;
|
|
2088
|
-
var Ol = 49;
|
|
2089
|
-
var P = 50;
|
|
2090
|
-
var Pre = 51;
|
|
2091
|
-
var A = 53;
|
|
2092
|
-
var Abbr = 54;
|
|
2093
|
-
var Br = 55;
|
|
2094
|
-
var Cite = 56;
|
|
2095
|
-
var Data = 57;
|
|
2096
|
-
var Time = 58;
|
|
2097
|
-
var Tfoot = 59;
|
|
2098
|
-
var Ul = 60;
|
|
2099
|
-
var Video = 61;
|
|
2100
|
-
var TextArea = 62;
|
|
2101
|
-
var Select = 63;
|
|
2102
|
-
var Option = 64;
|
|
2103
|
-
|
|
2104
|
-
// src/parts/Text/Text.ts
|
|
2105
|
-
var text = data => {
|
|
2106
|
-
return {
|
|
2107
|
-
type: Text,
|
|
2108
|
-
text: data,
|
|
2109
|
-
childCount: 0
|
|
2110
|
-
};
|
|
2111
|
-
};
|
|
2112
|
-
|
|
2113
2063
|
const listItemDetail = {
|
|
2114
|
-
type: Div
|
|
2064
|
+
type: Div,
|
|
2115
2065
|
className: ExtensionListItemDetail,
|
|
2116
2066
|
childCount: 3
|
|
2117
2067
|
};
|
|
2118
2068
|
const listItemName = {
|
|
2119
|
-
type: Div
|
|
2069
|
+
type: Div,
|
|
2120
2070
|
className: ExtensionListItemName,
|
|
2121
2071
|
childCount: 1
|
|
2122
2072
|
};
|
|
2123
2073
|
const listItemDescription = {
|
|
2124
|
-
type: Div
|
|
2074
|
+
type: Div,
|
|
2125
2075
|
className: ExtensionListItemDescription,
|
|
2126
2076
|
childCount: 1
|
|
2127
2077
|
};
|
|
2128
2078
|
const listItemFooter = {
|
|
2129
|
-
type: Div
|
|
2079
|
+
type: Div,
|
|
2130
2080
|
className: ExtensionListItemFooter,
|
|
2131
2081
|
childCount: 2
|
|
2132
2082
|
};
|
|
2133
2083
|
const listItemAuthorName = {
|
|
2134
|
-
type: Div
|
|
2084
|
+
type: Div,
|
|
2135
2085
|
className: ExtensionListItemAuthorName,
|
|
2136
2086
|
childCount: 1
|
|
2137
2087
|
};
|
|
2088
|
+
const getClassName = focused => {
|
|
2089
|
+
if (focused) {
|
|
2090
|
+
return mergeClassNames(ExtensionListItem, ExtensionActive);
|
|
2091
|
+
}
|
|
2092
|
+
return ExtensionListItem;
|
|
2093
|
+
};
|
|
2094
|
+
const getId = focused => {
|
|
2095
|
+
if (focused) {
|
|
2096
|
+
return `ExtensionActive`;
|
|
2097
|
+
}
|
|
2098
|
+
return undefined;
|
|
2099
|
+
};
|
|
2138
2100
|
const getExtensionListItemVirtualDom = extension => {
|
|
2139
2101
|
const {
|
|
2140
2102
|
posInSet,
|
|
@@ -2147,35 +2109,32 @@ const getExtensionListItemVirtualDom = extension => {
|
|
|
2147
2109
|
focused
|
|
2148
2110
|
} = extension;
|
|
2149
2111
|
const dom = [{
|
|
2150
|
-
type: Div
|
|
2112
|
+
type: Div,
|
|
2151
2113
|
role: ListItem,
|
|
2152
2114
|
ariaRoleDescription: Extension,
|
|
2153
|
-
className:
|
|
2115
|
+
className: getClassName(focused),
|
|
2116
|
+
id: getId(focused),
|
|
2154
2117
|
ariaPosInSet: posInSet,
|
|
2155
2118
|
ariaSetSize: setSize,
|
|
2156
2119
|
top,
|
|
2157
2120
|
childCount: 2
|
|
2158
2121
|
}, {
|
|
2159
|
-
type: Img
|
|
2122
|
+
type: Img,
|
|
2160
2123
|
src: icon,
|
|
2161
2124
|
className: ExtensionListItemIcon,
|
|
2162
2125
|
role: None,
|
|
2163
2126
|
childCount: 0
|
|
2164
2127
|
}, listItemDetail, listItemName, text(name), listItemDescription, text(description), listItemFooter, listItemAuthorName, text(publisher), {
|
|
2165
|
-
type: Div
|
|
2128
|
+
type: Div,
|
|
2166
2129
|
className: ExtensionActions,
|
|
2167
2130
|
childCount: 0
|
|
2168
2131
|
}];
|
|
2169
|
-
if (focused) {
|
|
2170
|
-
dom[0].id = 'ExtensionActive';
|
|
2171
|
-
dom[0].className += ' ' + ExtensionActive;
|
|
2172
|
-
}
|
|
2173
2132
|
return dom;
|
|
2174
2133
|
};
|
|
2175
2134
|
|
|
2176
2135
|
const getExtensionsListVirtualDom = visibleExtensions => {
|
|
2177
2136
|
const dom = [{
|
|
2178
|
-
type: Div
|
|
2137
|
+
type: Div,
|
|
2179
2138
|
className: ListItems,
|
|
2180
2139
|
tabIndex: 0,
|
|
2181
2140
|
ariaLabel: extensions(),
|
|
@@ -2314,7 +2273,7 @@ const render3 = (uid, diffResult) => {
|
|
|
2314
2273
|
return commands;
|
|
2315
2274
|
};
|
|
2316
2275
|
|
|
2317
|
-
const getIconVirtualDom = (icon, type = Div
|
|
2276
|
+
const getIconVirtualDom = (icon, type = Div) => {
|
|
2318
2277
|
return {
|
|
2319
2278
|
type,
|
|
2320
2279
|
className: mergeClassNames(MaskIcon, `MaskIcon${icon}`),
|
|
@@ -2330,7 +2289,7 @@ const getActionButtonVirtualDom = action => {
|
|
|
2330
2289
|
command
|
|
2331
2290
|
} = action;
|
|
2332
2291
|
return [{
|
|
2333
|
-
type: Button
|
|
2292
|
+
type: Button,
|
|
2334
2293
|
className: IconButton,
|
|
2335
2294
|
title: id,
|
|
2336
2295
|
'data-command': command,
|
|
@@ -2340,7 +2299,7 @@ const getActionButtonVirtualDom = action => {
|
|
|
2340
2299
|
|
|
2341
2300
|
const getActionVirtualDom = action => {
|
|
2342
2301
|
switch (action.type) {
|
|
2343
|
-
case Button$
|
|
2302
|
+
case Button$1:
|
|
2344
2303
|
return getActionButtonVirtualDom(action);
|
|
2345
2304
|
default:
|
|
2346
2305
|
return [];
|
|
@@ -2349,7 +2308,7 @@ const getActionVirtualDom = action => {
|
|
|
2349
2308
|
|
|
2350
2309
|
const getActionsVirtualDom = actions => {
|
|
2351
2310
|
return [{
|
|
2352
|
-
type: Div
|
|
2311
|
+
type: Div,
|
|
2353
2312
|
className: Actions,
|
|
2354
2313
|
role: ToolBar,
|
|
2355
2314
|
childCount: actions.length
|
|
@@ -2378,6 +2337,15 @@ const renderEventListeners = () => {
|
|
|
2378
2337
|
name: HandleWheel,
|
|
2379
2338
|
params: ['handleWheel', 'event.deltaMode', 'event.deltaY'],
|
|
2380
2339
|
passive: true
|
|
2340
|
+
}, {
|
|
2341
|
+
name: HandleExtensionsInput,
|
|
2342
|
+
params: ['handleExtensionsInput', 'event.target.value', User]
|
|
2343
|
+
}, {
|
|
2344
|
+
name: HandleClearSearchResults,
|
|
2345
|
+
params: ['clearSearchResults']
|
|
2346
|
+
}, {
|
|
2347
|
+
name: HandleClickFilter,
|
|
2348
|
+
params: ['handleClickFilter']
|
|
2381
2349
|
}];
|
|
2382
2350
|
};
|
|
2383
2351
|
|
|
@@ -2463,6 +2431,7 @@ const commandMap = {
|
|
|
2463
2431
|
'SearchExtensions.searchExtensions': searchExtensions,
|
|
2464
2432
|
'SearchExtensions.selectIndex': wrapCommand(selectIndex),
|
|
2465
2433
|
'SearchExtensions.setDeltaY': wrapCommand(setDeltaY),
|
|
2434
|
+
'SearchExtensions.getMenuEntries': getMenuEntries,
|
|
2466
2435
|
'SearchExtensions.terminate': terminate,
|
|
2467
2436
|
'SearchExtensions.toggleSuggest': wrapCommand(toggleSuggest)
|
|
2468
2437
|
};
|