@lvce-editor/extension-search-view 3.2.0 → 3.4.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 +192 -207
- 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
|
};
|
|
@@ -1123,6 +1146,28 @@ const create$1 = () => {
|
|
|
1123
1146
|
return Object.keys(states).map(key => {
|
|
1124
1147
|
return Number.parseInt(key);
|
|
1125
1148
|
});
|
|
1149
|
+
},
|
|
1150
|
+
clear() {
|
|
1151
|
+
for (const key of Object.keys(states)) {
|
|
1152
|
+
delete states[key];
|
|
1153
|
+
}
|
|
1154
|
+
},
|
|
1155
|
+
wrapCommand(fn) {
|
|
1156
|
+
const wrapped = async (uid, ...args) => {
|
|
1157
|
+
const {
|
|
1158
|
+
newState
|
|
1159
|
+
} = states[uid];
|
|
1160
|
+
const newerState = await fn(newState, ...args);
|
|
1161
|
+
if (newState === newerState) {
|
|
1162
|
+
return;
|
|
1163
|
+
}
|
|
1164
|
+
const latest = states[uid];
|
|
1165
|
+
states[uid] = {
|
|
1166
|
+
oldState: latest.oldState,
|
|
1167
|
+
newState: newerState
|
|
1168
|
+
};
|
|
1169
|
+
};
|
|
1170
|
+
return wrapped;
|
|
1126
1171
|
}
|
|
1127
1172
|
};
|
|
1128
1173
|
};
|
|
@@ -1130,7 +1175,9 @@ const create$1 = () => {
|
|
|
1130
1175
|
const {
|
|
1131
1176
|
get: get$1,
|
|
1132
1177
|
set: set$1,
|
|
1133
|
-
dispose: dispose$1
|
|
1178
|
+
dispose: dispose$1,
|
|
1179
|
+
wrapCommand
|
|
1180
|
+
} = create$1();
|
|
1134
1181
|
|
|
1135
1182
|
const create = (id, uri, x, y, width, height, platform, assetDir) => {
|
|
1136
1183
|
const state = {
|
|
@@ -1356,7 +1403,7 @@ const focusPreviousPage = state => {
|
|
|
1356
1403
|
return focusIndex(state, indexPreviousPage);
|
|
1357
1404
|
};
|
|
1358
1405
|
|
|
1359
|
-
const Button$
|
|
1406
|
+
const Button$1 = 1;
|
|
1360
1407
|
|
|
1361
1408
|
const ClearAll = 'ClearAll';
|
|
1362
1409
|
const Filter = 'Filter';
|
|
@@ -1365,19 +1412,19 @@ const Ellipsis = 'Ellipsis';
|
|
|
1365
1412
|
|
|
1366
1413
|
const getActions = () => {
|
|
1367
1414
|
return [{
|
|
1368
|
-
type: Button$
|
|
1415
|
+
type: Button$1,
|
|
1369
1416
|
id: refresh(),
|
|
1370
1417
|
icon: Refresh,
|
|
1371
1418
|
command: ''
|
|
1372
1419
|
}, {
|
|
1373
|
-
type: Button$
|
|
1420
|
+
type: Button$1,
|
|
1374
1421
|
id: viewsAndMoreActions(),
|
|
1375
1422
|
icon: Ellipsis,
|
|
1376
1423
|
command: ''
|
|
1377
1424
|
}];
|
|
1378
1425
|
};
|
|
1379
1426
|
|
|
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'
|
|
1427
|
+
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
1428
|
|
|
1382
1429
|
const getCommandIds = () => {
|
|
1383
1430
|
return commandIds;
|
|
@@ -1440,6 +1487,37 @@ const getKeyBindings = () => {
|
|
|
1440
1487
|
}];
|
|
1441
1488
|
};
|
|
1442
1489
|
|
|
1490
|
+
const None$1 = 0;
|
|
1491
|
+
|
|
1492
|
+
const getMenuEntries = () => {
|
|
1493
|
+
return [{
|
|
1494
|
+
id: 'enable',
|
|
1495
|
+
label: enable(),
|
|
1496
|
+
flags: None$1,
|
|
1497
|
+
command: 'SearchExtensions.enable'
|
|
1498
|
+
}, {
|
|
1499
|
+
id: 'disable',
|
|
1500
|
+
label: disable(),
|
|
1501
|
+
flags: None$1,
|
|
1502
|
+
command: 'SearchExtensions.disable'
|
|
1503
|
+
}, {
|
|
1504
|
+
id: 'installAnotherVersion',
|
|
1505
|
+
label: installAnotherVersion(),
|
|
1506
|
+
flags: None$1,
|
|
1507
|
+
command: 'SearchExtensions.installAnotherVersion'
|
|
1508
|
+
}, {
|
|
1509
|
+
id: 'copy',
|
|
1510
|
+
label: copy(),
|
|
1511
|
+
flags: None$1,
|
|
1512
|
+
command: 'SearchExtensions.copy'
|
|
1513
|
+
}, {
|
|
1514
|
+
id: 'copyExtensionId',
|
|
1515
|
+
label: copyExtensionId(),
|
|
1516
|
+
flags: None$1,
|
|
1517
|
+
command: 'SearchExtensions.copyExtensionId'
|
|
1518
|
+
}];
|
|
1519
|
+
};
|
|
1520
|
+
|
|
1443
1521
|
const handleBlur = state => {
|
|
1444
1522
|
return state;
|
|
1445
1523
|
};
|
|
@@ -1518,7 +1596,7 @@ const show = async (x, y, id) => {
|
|
|
1518
1596
|
number(x);
|
|
1519
1597
|
number(y);
|
|
1520
1598
|
number(id);
|
|
1521
|
-
|
|
1599
|
+
await invoke('ContextMenu.show', x, y, id);
|
|
1522
1600
|
};
|
|
1523
1601
|
|
|
1524
1602
|
const ManageExtension = 8;
|
|
@@ -1774,7 +1852,7 @@ const getDescription = extension => {
|
|
|
1774
1852
|
}
|
|
1775
1853
|
return extension.description;
|
|
1776
1854
|
};
|
|
1777
|
-
const getId = extension => {
|
|
1855
|
+
const getId$1 = extension => {
|
|
1778
1856
|
if (!extension || !extension.id) {
|
|
1779
1857
|
return 'n/a';
|
|
1780
1858
|
}
|
|
@@ -1798,7 +1876,7 @@ const getPublisher = extension => {
|
|
|
1798
1876
|
|
|
1799
1877
|
const normalizeExtension$1 = (extension, platform, assetDir) => {
|
|
1800
1878
|
return {
|
|
1801
|
-
id: getId(extension),
|
|
1879
|
+
id: getId$1(extension),
|
|
1802
1880
|
name: getName(extension),
|
|
1803
1881
|
description: getDescription(extension),
|
|
1804
1882
|
uri: '',
|
|
@@ -1867,58 +1945,86 @@ const ExtensionListItemAuthorName = 'ExtensionListItemAuthorName';
|
|
|
1867
1945
|
const ExtensionListItemDescription = 'ExtensionListItemDescription';
|
|
1868
1946
|
const ExtensionListItemDetail = 'ExtensionListItemDetail';
|
|
1869
1947
|
const ExtensionListItemFooter = 'ExtensionListItemFooter';
|
|
1870
|
-
const MaskIcon = 'MaskIcon';
|
|
1871
1948
|
const ExtensionListItemIcon = 'ExtensionListItemIcon';
|
|
1872
1949
|
const ExtensionListItemName = 'ExtensionListItemName';
|
|
1873
1950
|
const IconButton = 'IconButton';
|
|
1874
1951
|
const ListItems = 'ListItems';
|
|
1952
|
+
const MaskIcon = 'MaskIcon';
|
|
1875
1953
|
const MultilineInputBox = 'MultilineInputBox';
|
|
1876
1954
|
const ScrollBarThumb = 'ScrollBarThumb';
|
|
1877
1955
|
const ScrollBarThumbActive = 'ScrollBarThumbActive';
|
|
1878
1956
|
const SearchField = 'SearchField';
|
|
1957
|
+
const SearchFieldButton = 'SearchFieldButton';
|
|
1879
1958
|
const SearchFieldButtons = 'SearchFieldButtons';
|
|
1880
1959
|
const SearchFieldContainer = 'SearchFieldContainer';
|
|
1960
|
+
const SearchFieldDisabled = 'SearchFieldDisabled';
|
|
1961
|
+
|
|
1962
|
+
const HandleContextMenu = 'handleContextMenu';
|
|
1963
|
+
const HandlePointerDown = 'handlePointerDown';
|
|
1964
|
+
const HandleTouchStart = 'handleTouchStart';
|
|
1965
|
+
const HandleWheel = 'handleWheel';
|
|
1966
|
+
const HandleExtensionsInput = 'handleExtensionsInput';
|
|
1967
|
+
const HandleClearSearchResults = 'handleClearSearchResults';
|
|
1968
|
+
const HandleClickFilter = 'handleClickFilter';
|
|
1881
1969
|
|
|
1882
|
-
const CheckBox = 'checkbox';
|
|
1883
1970
|
const List = 'list';
|
|
1884
1971
|
const ListItem = 'listitem';
|
|
1885
1972
|
const None = 'none';
|
|
1886
1973
|
const ToolBar = 'toolbar';
|
|
1887
1974
|
|
|
1888
|
-
const
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
const
|
|
1975
|
+
const mergeClassNames = (...classNames) => {
|
|
1976
|
+
return classNames.filter(Boolean).join(' ');
|
|
1977
|
+
};
|
|
1978
|
+
const Text = 12;
|
|
1979
|
+
const text = data => {
|
|
1980
|
+
return {
|
|
1981
|
+
type: Text,
|
|
1982
|
+
text: data,
|
|
1983
|
+
childCount: 0
|
|
1984
|
+
};
|
|
1985
|
+
};
|
|
1986
|
+
|
|
1987
|
+
const Div = 4;
|
|
1988
|
+
const Img = 17;
|
|
1989
|
+
const TextArea = 62;
|
|
1990
|
+
const Button = 1;
|
|
1892
1991
|
|
|
1992
|
+
const getClassName$1 = enabled => {
|
|
1993
|
+
if (enabled) {
|
|
1994
|
+
return SearchFieldButton;
|
|
1995
|
+
}
|
|
1996
|
+
return mergeClassNames(SearchFieldButton, SearchFieldDisabled);
|
|
1997
|
+
};
|
|
1893
1998
|
const getSearchFieldButtonVirtualDom = button => {
|
|
1894
1999
|
const {
|
|
1895
2000
|
icon,
|
|
1896
|
-
|
|
1897
|
-
|
|
2001
|
+
title,
|
|
2002
|
+
enabled,
|
|
2003
|
+
onClick
|
|
1898
2004
|
} = button;
|
|
1899
2005
|
return [{
|
|
1900
|
-
type: Div
|
|
1901
|
-
className:
|
|
2006
|
+
type: Div,
|
|
2007
|
+
className: getClassName$1(enabled),
|
|
1902
2008
|
title,
|
|
1903
|
-
role: CheckBox,
|
|
1904
|
-
ariaChecked: checked,
|
|
1905
2009
|
tabIndex: 0,
|
|
1906
|
-
childCount: 1
|
|
2010
|
+
childCount: 1,
|
|
2011
|
+
onClick
|
|
1907
2012
|
}, {
|
|
1908
|
-
type: Div
|
|
1909
|
-
className:
|
|
2013
|
+
type: Div,
|
|
2014
|
+
className: mergeClassNames(MaskIcon, icon),
|
|
1910
2015
|
childCount: 0
|
|
1911
2016
|
}];
|
|
1912
2017
|
};
|
|
1913
2018
|
|
|
1914
2019
|
const getSearchFieldVirtualDom = (name, placeholder, onInput, insideButtons, outsideButtons, onFocus = '') => {
|
|
2020
|
+
// TODO avoid mutation
|
|
1915
2021
|
const dom = [{
|
|
1916
|
-
type: Div
|
|
2022
|
+
type: Div,
|
|
1917
2023
|
className: SearchField,
|
|
1918
2024
|
role: None,
|
|
1919
2025
|
childCount: 2
|
|
1920
2026
|
}, {
|
|
1921
|
-
type: TextArea
|
|
2027
|
+
type: TextArea,
|
|
1922
2028
|
className: MultilineInputBox,
|
|
1923
2029
|
spellcheck: false,
|
|
1924
2030
|
autocapitalize: 'off',
|
|
@@ -1929,13 +2035,13 @@ const getSearchFieldVirtualDom = (name, placeholder, onInput, insideButtons, out
|
|
|
1929
2035
|
onFocus,
|
|
1930
2036
|
childCount: 0
|
|
1931
2037
|
}, {
|
|
1932
|
-
type: Div
|
|
2038
|
+
type: Div,
|
|
1933
2039
|
className: SearchFieldButtons,
|
|
1934
2040
|
childCount: insideButtons.length
|
|
1935
2041
|
}, ...insideButtons.flatMap(getSearchFieldButtonVirtualDom)];
|
|
1936
2042
|
if (outsideButtons.length > 0) {
|
|
1937
2043
|
dom.unshift({
|
|
1938
|
-
type: Div
|
|
2044
|
+
type: Div,
|
|
1939
2045
|
className: SearchFieldContainer,
|
|
1940
2046
|
role: None,
|
|
1941
2047
|
childCount: 1 + outsideButtons.length
|
|
@@ -1945,196 +2051,78 @@ const getSearchFieldVirtualDom = (name, placeholder, onInput, insideButtons, out
|
|
|
1945
2051
|
return dom;
|
|
1946
2052
|
};
|
|
1947
2053
|
|
|
2054
|
+
const parentNode = {
|
|
2055
|
+
type: Div,
|
|
2056
|
+
className: ExtensionHeader,
|
|
2057
|
+
childCount: 1
|
|
2058
|
+
};
|
|
1948
2059
|
const getExtensionHeaderVirtualDom = (placeholder, actions) => {
|
|
1949
|
-
return [
|
|
1950
|
-
type: Div$1,
|
|
1951
|
-
className: ExtensionHeader,
|
|
1952
|
-
childCount: 1
|
|
1953
|
-
}, ...getSearchFieldVirtualDom('extensions', placeholder, 'handleExtensionsInput', actions, [])];
|
|
2060
|
+
return [parentNode, ...getSearchFieldVirtualDom('extensions', placeholder, HandleExtensionsInput, actions, [])];
|
|
1954
2061
|
};
|
|
1955
2062
|
|
|
1956
|
-
const
|
|
2063
|
+
const getInputActions = newState => {
|
|
2064
|
+
const clearEnabled = newState.searchValue.length > 0;
|
|
1957
2065
|
const actions = [{
|
|
1958
|
-
|
|
1959
|
-
title: clearExtensionSearchResults(),
|
|
2066
|
+
onClick: HandleClearSearchResults,
|
|
1960
2067
|
icon: `MaskIcon${ClearAll}`,
|
|
1961
|
-
|
|
2068
|
+
title: clearExtensionSearchResults(),
|
|
2069
|
+
type: Button$1,
|
|
2070
|
+
enabled: clearEnabled
|
|
1962
2071
|
}, {
|
|
1963
|
-
|
|
2072
|
+
icon: `MaskIcon${Filter}`,
|
|
1964
2073
|
title: filter(),
|
|
1965
|
-
|
|
2074
|
+
type: Button$1,
|
|
2075
|
+
onClick: HandleClickFilter,
|
|
2076
|
+
enabled: true
|
|
1966
2077
|
}];
|
|
2078
|
+
return actions;
|
|
2079
|
+
};
|
|
2080
|
+
|
|
2081
|
+
const renderHeader = newState => {
|
|
2082
|
+
const actions = getInputActions(newState);
|
|
1967
2083
|
const dom = getExtensionHeaderVirtualDom(newState.placeholder, actions);
|
|
1968
2084
|
return ['setHeaderDom', dom];
|
|
1969
2085
|
};
|
|
1970
2086
|
|
|
1971
|
-
const HandleContextMenu = 'handleContextMenu';
|
|
1972
|
-
const HandlePointerDown = 'handlePointerDown';
|
|
1973
|
-
const HandleTouchStart = 'handleTouchStart';
|
|
1974
|
-
const HandleWheel = 'handleWheel';
|
|
1975
|
-
|
|
1976
2087
|
const Extension = 'Extension';
|
|
1977
2088
|
|
|
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
2089
|
const listItemDetail = {
|
|
2114
|
-
type: Div
|
|
2090
|
+
type: Div,
|
|
2115
2091
|
className: ExtensionListItemDetail,
|
|
2116
2092
|
childCount: 3
|
|
2117
2093
|
};
|
|
2118
2094
|
const listItemName = {
|
|
2119
|
-
type: Div
|
|
2095
|
+
type: Div,
|
|
2120
2096
|
className: ExtensionListItemName,
|
|
2121
2097
|
childCount: 1
|
|
2122
2098
|
};
|
|
2123
2099
|
const listItemDescription = {
|
|
2124
|
-
type: Div
|
|
2100
|
+
type: Div,
|
|
2125
2101
|
className: ExtensionListItemDescription,
|
|
2126
2102
|
childCount: 1
|
|
2127
2103
|
};
|
|
2128
2104
|
const listItemFooter = {
|
|
2129
|
-
type: Div
|
|
2105
|
+
type: Div,
|
|
2130
2106
|
className: ExtensionListItemFooter,
|
|
2131
2107
|
childCount: 2
|
|
2132
2108
|
};
|
|
2133
2109
|
const listItemAuthorName = {
|
|
2134
|
-
type: Div
|
|
2110
|
+
type: Div,
|
|
2135
2111
|
className: ExtensionListItemAuthorName,
|
|
2136
2112
|
childCount: 1
|
|
2137
2113
|
};
|
|
2114
|
+
const getClassName = focused => {
|
|
2115
|
+
if (focused) {
|
|
2116
|
+
return mergeClassNames(ExtensionListItem, ExtensionActive);
|
|
2117
|
+
}
|
|
2118
|
+
return ExtensionListItem;
|
|
2119
|
+
};
|
|
2120
|
+
const getId = focused => {
|
|
2121
|
+
if (focused) {
|
|
2122
|
+
return `ExtensionActive`;
|
|
2123
|
+
}
|
|
2124
|
+
return undefined;
|
|
2125
|
+
};
|
|
2138
2126
|
const getExtensionListItemVirtualDom = extension => {
|
|
2139
2127
|
const {
|
|
2140
2128
|
posInSet,
|
|
@@ -2147,35 +2135,32 @@ const getExtensionListItemVirtualDom = extension => {
|
|
|
2147
2135
|
focused
|
|
2148
2136
|
} = extension;
|
|
2149
2137
|
const dom = [{
|
|
2150
|
-
type: Div
|
|
2138
|
+
type: Div,
|
|
2151
2139
|
role: ListItem,
|
|
2152
2140
|
ariaRoleDescription: Extension,
|
|
2153
|
-
className:
|
|
2141
|
+
className: getClassName(focused),
|
|
2142
|
+
id: getId(focused),
|
|
2154
2143
|
ariaPosInSet: posInSet,
|
|
2155
2144
|
ariaSetSize: setSize,
|
|
2156
2145
|
top,
|
|
2157
2146
|
childCount: 2
|
|
2158
2147
|
}, {
|
|
2159
|
-
type: Img
|
|
2148
|
+
type: Img,
|
|
2160
2149
|
src: icon,
|
|
2161
2150
|
className: ExtensionListItemIcon,
|
|
2162
2151
|
role: None,
|
|
2163
2152
|
childCount: 0
|
|
2164
2153
|
}, listItemDetail, listItemName, text(name), listItemDescription, text(description), listItemFooter, listItemAuthorName, text(publisher), {
|
|
2165
|
-
type: Div
|
|
2154
|
+
type: Div,
|
|
2166
2155
|
className: ExtensionActions,
|
|
2167
2156
|
childCount: 0
|
|
2168
2157
|
}];
|
|
2169
|
-
if (focused) {
|
|
2170
|
-
dom[0].id = 'ExtensionActive';
|
|
2171
|
-
dom[0].className += ' ' + ExtensionActive;
|
|
2172
|
-
}
|
|
2173
2158
|
return dom;
|
|
2174
2159
|
};
|
|
2175
2160
|
|
|
2176
2161
|
const getExtensionsListVirtualDom = visibleExtensions => {
|
|
2177
2162
|
const dom = [{
|
|
2178
|
-
type: Div
|
|
2163
|
+
type: Div,
|
|
2179
2164
|
className: ListItems,
|
|
2180
2165
|
tabIndex: 0,
|
|
2181
2166
|
ariaLabel: extensions(),
|
|
@@ -2314,7 +2299,7 @@ const render3 = (uid, diffResult) => {
|
|
|
2314
2299
|
return commands;
|
|
2315
2300
|
};
|
|
2316
2301
|
|
|
2317
|
-
const getIconVirtualDom = (icon, type = Div
|
|
2302
|
+
const getIconVirtualDom = (icon, type = Div) => {
|
|
2318
2303
|
return {
|
|
2319
2304
|
type,
|
|
2320
2305
|
className: mergeClassNames(MaskIcon, `MaskIcon${icon}`),
|
|
@@ -2330,7 +2315,7 @@ const getActionButtonVirtualDom = action => {
|
|
|
2330
2315
|
command
|
|
2331
2316
|
} = action;
|
|
2332
2317
|
return [{
|
|
2333
|
-
type: Button
|
|
2318
|
+
type: Button,
|
|
2334
2319
|
className: IconButton,
|
|
2335
2320
|
title: id,
|
|
2336
2321
|
'data-command': command,
|
|
@@ -2340,7 +2325,7 @@ const getActionButtonVirtualDom = action => {
|
|
|
2340
2325
|
|
|
2341
2326
|
const getActionVirtualDom = action => {
|
|
2342
2327
|
switch (action.type) {
|
|
2343
|
-
case Button$
|
|
2328
|
+
case Button$1:
|
|
2344
2329
|
return getActionButtonVirtualDom(action);
|
|
2345
2330
|
default:
|
|
2346
2331
|
return [];
|
|
@@ -2349,7 +2334,7 @@ const getActionVirtualDom = action => {
|
|
|
2349
2334
|
|
|
2350
2335
|
const getActionsVirtualDom = actions => {
|
|
2351
2336
|
return [{
|
|
2352
|
-
type: Div
|
|
2337
|
+
type: Div,
|
|
2353
2338
|
className: Actions,
|
|
2354
2339
|
role: ToolBar,
|
|
2355
2340
|
childCount: actions.length
|
|
@@ -2378,6 +2363,15 @@ const renderEventListeners = () => {
|
|
|
2378
2363
|
name: HandleWheel,
|
|
2379
2364
|
params: ['handleWheel', 'event.deltaMode', 'event.deltaY'],
|
|
2380
2365
|
passive: true
|
|
2366
|
+
}, {
|
|
2367
|
+
name: HandleExtensionsInput,
|
|
2368
|
+
params: ['handleExtensionsInput', 'event.target.value', User]
|
|
2369
|
+
}, {
|
|
2370
|
+
name: HandleClearSearchResults,
|
|
2371
|
+
params: ['clearSearchResults']
|
|
2372
|
+
}, {
|
|
2373
|
+
name: HandleClickFilter,
|
|
2374
|
+
params: ['handleClickFilter']
|
|
2381
2375
|
}];
|
|
2382
2376
|
};
|
|
2383
2377
|
|
|
@@ -2410,17 +2404,6 @@ const toggleSuggest = state => {
|
|
|
2410
2404
|
return state;
|
|
2411
2405
|
};
|
|
2412
2406
|
|
|
2413
|
-
const wrapCommand = fn => {
|
|
2414
|
-
const wrapped = async (uid, ...args) => {
|
|
2415
|
-
const {
|
|
2416
|
-
newState
|
|
2417
|
-
} = get$1(uid);
|
|
2418
|
-
const newerState = await fn(newState, ...args);
|
|
2419
|
-
set$1(uid, newState, newerState);
|
|
2420
|
-
};
|
|
2421
|
-
return wrapped;
|
|
2422
|
-
};
|
|
2423
|
-
|
|
2424
2407
|
const commandMap = {
|
|
2425
2408
|
'SearchExtensions.clearSearchResults': wrapCommand(clearSearchResults),
|
|
2426
2409
|
'SearchExtensions.closeSuggest': wrapCommand(closeSuggest),
|
|
@@ -2436,6 +2419,7 @@ const commandMap = {
|
|
|
2436
2419
|
'SearchExtensions.getActions': getActions,
|
|
2437
2420
|
'SearchExtensions.getCommandIds': getCommandIds,
|
|
2438
2421
|
'SearchExtensions.getKeyBindings': getKeyBindings,
|
|
2422
|
+
'SearchExtensions.getMenuEntries': getMenuEntries,
|
|
2439
2423
|
'SearchExtensions.handleBlur': wrapCommand(handleBlur),
|
|
2440
2424
|
'SearchExtensions.handleClick': wrapCommand(handleClick),
|
|
2441
2425
|
'SearchExtensions.handleClickAt': wrapCommand(handleClickAt),
|
|
@@ -2458,6 +2442,7 @@ const commandMap = {
|
|
|
2458
2442
|
'SearchExtensions.render3': render3,
|
|
2459
2443
|
'SearchExtensions.renderActions': renderActions,
|
|
2460
2444
|
'SearchExtensions.renderEventListeners': renderEventListeners,
|
|
2445
|
+
'SearchExtensions.restoreState': restoreState,
|
|
2461
2446
|
'SearchExtensions.saveState': saveState,
|
|
2462
2447
|
'SearchExtensions.scrollDown': wrapCommand(scrollDown),
|
|
2463
2448
|
'SearchExtensions.searchExtensions': searchExtensions,
|