@lvce-editor/text-search-worker 3.47.0 → 3.49.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.
@@ -1086,6 +1086,30 @@ const clearSearchResults$1 = state => {
1086
1086
  };
1087
1087
  };
1088
1088
 
1089
+ const PreserveCase$2 = 1 << 0; // 1
1090
+ const UseRegularExpression$2 = 1 << 1; // 2
1091
+ const ReplaceExpanded = 1 << 2; // 4
1092
+ const MatchWholeWord$2 = 1 << 3; // 8
1093
+ const MatchCase$2 = 1 << 4; // 16
1094
+ const DetailsExpanded = 1 << 5; // 32
1095
+ const OpenEditors = 1 << 6; // 64
1096
+ const UseIgnoreFiles = 1 << 7; // 128
1097
+ const hasDetailsExpanded = flags => {
1098
+ return (flags & DetailsExpanded) === DetailsExpanded;
1099
+ };
1100
+
1101
+ const collapseDetails = state => {
1102
+ const {
1103
+ flags
1104
+ } = state;
1105
+ return {
1106
+ ...state,
1107
+ flags: flags & -33,
1108
+ focus: FocusSearchInput,
1109
+ focusSource: Script
1110
+ };
1111
+ };
1112
+
1089
1113
  const RendererWorker = 1;
1090
1114
 
1091
1115
  const rpcs = Object.create(null);
@@ -1238,19 +1262,19 @@ const ConfirmReplaceOneOccurrenceInOneFile = "Replace 1 occurrence across 1 file
1238
1262
  const ConfirmReplaceOneOccurrenceInOneFileNoValue = 'Replace 1 occurrence across 1 file';
1239
1263
  const ManyResultsInManyFiles = '{PH1} results in {PH2} files';
1240
1264
  const ManyResultsInOneFile = '{PH1} results in 1 file';
1241
- const MatchCase$2 = 'Match Case';
1242
- const MatchWholeWord$2 = 'Match Whole Word';
1265
+ const MatchCase$1 = 'Match Case';
1266
+ const MatchWholeWord$1 = 'Match Whole Word';
1243
1267
  const NoResults = 'No results found';
1244
1268
  const Oneresult = '1 result in 1 file';
1245
1269
  const OpenNewSearchEditor = 'Open New Search Editor';
1246
- const PreserveCase$2 = 'Preserve Case';
1270
+ const PreserveCase$1 = 'Preserve Case';
1247
1271
  const Refresh$1 = 'Refresh';
1248
1272
  const Replace = 'Replace';
1249
1273
  const ReplaceAll$1 = 'Replace All';
1250
1274
  const ReplacedManyOccurrencesInManyFiles = "Replaced {PH1} occurrences across {PH2} files with '{PH3}'";
1251
1275
  const ReplacedOneOccurrenceInOneFile = "Replaced 1 occurrence across 1 file with '{PH1}'";
1252
1276
  const ToggleReplace$1 = 'Toggle Replace';
1253
- const UseRegularExpression$2 = 'Use Regular Expression';
1277
+ const UseRegularExpression$1 = 'Use Regular Expression';
1254
1278
  const ViewAsTree = 'View as Tree';
1255
1279
  const FilesToInclude$1 = 'Files to Include';
1256
1280
  const FilesToExclude$1 = 'Files to Exclude';
@@ -1268,19 +1292,19 @@ const toggleReplace$1 = () => {
1268
1292
  return i18nString(ToggleReplace$1);
1269
1293
  };
1270
1294
  const matchCase = () => {
1271
- return i18nString(MatchCase$2);
1295
+ return i18nString(MatchCase$1);
1272
1296
  };
1273
1297
  const preserveCase = () => {
1274
- return i18nString(PreserveCase$2);
1298
+ return i18nString(PreserveCase$1);
1275
1299
  };
1276
1300
  const matchWholeWord = () => {
1277
- return i18nString(MatchWholeWord$2);
1301
+ return i18nString(MatchWholeWord$1);
1278
1302
  };
1279
1303
  const toggleSearchDetails = () => {
1280
1304
  return i18nString(ToggleSearchDetails$1);
1281
1305
  };
1282
1306
  const useRegularExpression = () => {
1283
- return i18nString(UseRegularExpression$2);
1307
+ return i18nString(UseRegularExpression$1);
1284
1308
  };
1285
1309
  const manyResultsInOneFile = resultCount => {
1286
1310
  return i18nString(ManyResultsInOneFile, {
@@ -1520,23 +1544,23 @@ const dismissItem = state => {
1520
1544
  };
1521
1545
  };
1522
1546
 
1523
- const focusMatchCase$1 = state => {
1547
+ const expandDetails = state => {
1548
+ const {
1549
+ flags
1550
+ } = state;
1524
1551
  return {
1525
1552
  ...state,
1526
- focus: FocusSearchMatchCase
1553
+ flags: flags | DetailsExpanded,
1554
+ focus: FocusSearchIncludeInput,
1555
+ focusSource: Script
1527
1556
  };
1528
1557
  };
1529
1558
 
1530
- const PreserveCase$1 = 1 << 0; // 1
1531
- const UseRegularExpression$1 = 1 << 1; // 2
1532
- const ReplaceExpanded = 1 << 2; // 4
1533
- const MatchWholeWord$1 = 1 << 3; // 8
1534
- const MatchCase$1 = 1 << 4; // 16
1535
- const DetailsExpanded = 1 << 5; // 32
1536
- const OpenEditors = 1 << 6; // 64
1537
- const UseIgnoreFiles = 1 << 7; // 128
1538
- const hasDetailsExpanded = flags => {
1539
- return (flags & DetailsExpanded) === DetailsExpanded;
1559
+ const focusMatchCase$1 = state => {
1560
+ return {
1561
+ ...state,
1562
+ focus: FocusSearchMatchCase
1563
+ };
1540
1564
  };
1541
1565
 
1542
1566
  const getNextFocus = (focus, flags) => {
@@ -1723,113 +1747,455 @@ const ViewletSearchMessageIndented = 'ViewletSearchMessageIndented';
1723
1747
 
1724
1748
  const Button$2 = 1;
1725
1749
 
1726
- const mergeClassNames = (...classNames) => {
1727
- return classNames.filter(Boolean).join(' ');
1750
+ var __defProp = Object.defineProperty;
1751
+ var __export = (target, all) => {
1752
+ for (var name in all) __defProp(target, name, {
1753
+ get: all[name],
1754
+ enumerable: true
1755
+ });
1728
1756
  };
1729
1757
 
1730
- const Button$1 = 1;
1731
- const Del$1 = 21;
1732
- const Div$1 = 4;
1733
- const H4$1 = 24;
1734
- const Img$1 = 17;
1735
- const Ins$1 = 20;
1736
- const Span$1 = 8;
1737
- const Text$1 = 12;
1738
- const TextArea$1 = 62;
1739
-
1740
- const getIconVirtualDom = (icon, type = Div$1) => {
1741
- return {
1742
- type,
1743
- className: mergeClassNames(MaskIcon, `MaskIcon${icon}`),
1744
- role: None$1,
1745
- childCount: 0
1746
- };
1758
+ // src/parts/MergeClassNames/MergeClassNames.ts
1759
+ var mergeClassNames = (...classNames) => {
1760
+ return classNames.filter(Boolean).join(" ");
1747
1761
  };
1748
1762
 
1749
- const getActionButtonVirtualDom = action => {
1750
- const {
1751
- id,
1752
- icon,
1753
- command
1754
- } = action;
1755
- return [{
1756
- type: Button$1,
1757
- className: IconButton,
1758
- title: id,
1759
- 'data-command': command,
1760
- childCount: 1
1761
- }, getIconVirtualDom(icon)];
1762
- };
1763
+ // src/parts/VirtualDomElements/VirtualDomElements.ts
1764
+ var VirtualDomElements_exports = {};
1765
+ __export(VirtualDomElements_exports, {
1766
+ A: () => A,
1767
+ Abbr: () => Abbr,
1768
+ Article: () => Article,
1769
+ Aside: () => Aside,
1770
+ Audio: () => Audio,
1771
+ Br: () => Br,
1772
+ Button: () => Button$1,
1773
+ Cite: () => Cite,
1774
+ Col: () => Col,
1775
+ ColGroup: () => ColGroup,
1776
+ Data: () => Data,
1777
+ Dd: () => Dd,
1778
+ Del: () => Del$1,
1779
+ Div: () => Div$1,
1780
+ Dl: () => Dl,
1781
+ Figcaption: () => Figcaption,
1782
+ Figure: () => Figure,
1783
+ Footer: () => Footer,
1784
+ H1: () => H1,
1785
+ H2: () => H2,
1786
+ H3: () => H3,
1787
+ H4: () => H4$1,
1788
+ H5: () => H5,
1789
+ H6: () => H6,
1790
+ Header: () => Header,
1791
+ Hr: () => Hr,
1792
+ I: () => I,
1793
+ Img: () => Img$1,
1794
+ Input: () => Input,
1795
+ Ins: () => Ins$1,
1796
+ Kbd: () => Kbd,
1797
+ Li: () => Li,
1798
+ Nav: () => Nav,
1799
+ Ol: () => Ol,
1800
+ Option: () => Option,
1801
+ P: () => P,
1802
+ Pre: () => Pre,
1803
+ Root: () => Root,
1804
+ Search: () => Search$1,
1805
+ Section: () => Section,
1806
+ Select: () => Select,
1807
+ Span: () => Span$1,
1808
+ TBody: () => TBody,
1809
+ THead: () => THead,
1810
+ Table: () => Table,
1811
+ Td: () => Td,
1812
+ Text: () => Text$1,
1813
+ TextArea: () => TextArea$1,
1814
+ Tfoot: () => Tfoot,
1815
+ Th: () => Th,
1816
+ Time: () => Time,
1817
+ Tr: () => Tr,
1818
+ Ul: () => Ul,
1819
+ Video: () => Video
1820
+ });
1821
+ var Audio = 0;
1822
+ var Button$1 = 1;
1823
+ var Col = 2;
1824
+ var ColGroup = 3;
1825
+ var Div$1 = 4;
1826
+ var H1 = 5;
1827
+ var Input = 6;
1828
+ var Kbd = 7;
1829
+ var Span$1 = 8;
1830
+ var Table = 9;
1831
+ var TBody = 10;
1832
+ var Td = 11;
1833
+ var Text$1 = 12;
1834
+ var Th = 13;
1835
+ var THead = 14;
1836
+ var Tr = 15;
1837
+ var I = 16;
1838
+ var Img$1 = 17;
1839
+ var Root = 0;
1840
+ var Ins$1 = 20;
1841
+ var Del$1 = 21;
1842
+ var H2 = 22;
1843
+ var H3 = 23;
1844
+ var H4$1 = 24;
1845
+ var H5 = 25;
1846
+ var H6 = 26;
1847
+ var Article = 27;
1848
+ var Aside = 28;
1849
+ var Footer = 29;
1850
+ var Header = 30;
1851
+ var Nav = 40;
1852
+ var Section = 41;
1853
+ var Search$1 = 42;
1854
+ var Dd = 43;
1855
+ var Dl = 44;
1856
+ var Figcaption = 45;
1857
+ var Figure = 46;
1858
+ var Hr = 47;
1859
+ var Li = 48;
1860
+ var Ol = 49;
1861
+ var P = 50;
1862
+ var Pre = 51;
1863
+ var A = 53;
1864
+ var Abbr = 54;
1865
+ var Br = 55;
1866
+ var Cite = 56;
1867
+ var Data = 57;
1868
+ var Time = 58;
1869
+ var Tfoot = 59;
1870
+ var Ul = 60;
1871
+ var Video = 61;
1872
+ var TextArea$1 = 62;
1873
+ var Select = 63;
1874
+ var Option = 64;
1763
1875
 
1764
- const getActionVirtualDom = action => {
1765
- switch (action.type) {
1766
- case Button$2:
1767
- return getActionButtonVirtualDom(action);
1768
- default:
1769
- return [];
1770
- }
1771
- };
1876
+ // src/parts/PatchType/PatchType.ts
1877
+ var SetText = 1;
1878
+ var SetAttribute = 3;
1879
+ var RemoveAttribute = 4;
1880
+ var Add = 6;
1881
+ var NavigateChild = 7;
1882
+ var NavigateParent = 8;
1883
+ var RemoveChild = 9;
1884
+ var NavigateSibling = 10;
1772
1885
 
1773
- const getActionsVirtualDom = actions => {
1774
- return [{
1775
- type: Div$1,
1776
- className: Actions,
1777
- role: ToolBar,
1778
- childCount: actions.length
1779
- }, ...actions.flatMap(getActionVirtualDom)];
1886
+ // src/parts/ApplyPendingPatches/ApplyPendingPatches.ts
1887
+ var applyPendingPatches = (patches, pendingPatches, skip) => {
1888
+ for (let k = 0; k < pendingPatches.length - skip; k += 2) {
1889
+ const type = pendingPatches[k];
1890
+ const index = pendingPatches[k + 1];
1891
+ if (type === NavigateParent) {
1892
+ patches.push({
1893
+ type
1894
+ });
1895
+ } else {
1896
+ patches.push({
1897
+ type,
1898
+ index
1899
+ });
1900
+ }
1901
+ }
1902
+ pendingPatches.length = 0;
1780
1903
  };
1781
1904
 
1782
- const commandIds = ['clearSearchResults', 'copy', 'dismissItem', 'focusFirst', 'focusIndex', 'focusLast', 'focusMatchCase', 'focusMatchCasePrevious', 'focusMatchWholeWord', 'focusNext', 'focusNextInput', 'focusNextPage', 'focusPreserveCasePrevious', 'focusPrevious', 'focusPreviousInput', 'focusPreviousPage', 'focusRegex', 'focusRegexNext', 'focusReplaceAll', 'focusReplaceValue', 'focusReplaceValueNext', 'focusReplaceValuePrevious', 'focusSearchValue', 'focusSearchValueNext', 'handleClick', 'handleClickAt', 'handleContextMenu', 'handleContextMenuKeyboard', 'handleContextMenuMouseAt', 'handleExcludeInput', 'handleFocusIn', 'handleHeaderClick', 'handleIconThemeChange', 'handleIconThemeChange', 'handleIncludeInput', 'handleInput', 'handleListBlur', 'handleListFocus', 'handleReplaceInput', 'handleScrollBarCaptureLost', 'handleScrollBarClick', 'handleScrollBarMove', 'handleScrollBarThumbPointerMove', 'handleTouchEnd', 'handleTouchMove', 'handleTouchStart', 'handleUpdate', 'handleWheel', 'refresh', 'replaceAll', 'scrollDown', 'selectIndex', 'submit', 'toggleMatchCase', 'toggleMatchWholeWord', 'togglePreserveCase', 'toggleReplace', 'toggleSearchDetails', 'toggleUseRegularExpression'];
1783
-
1784
- const getCommandIds = () => {
1785
- return commandIds;
1905
+ // src/parts/IsKey/IsKey.ts
1906
+ var isKey = key => {
1907
+ return key !== "type" && key !== "childCount";
1786
1908
  };
1787
1909
 
1788
- const getFlags = uid => {
1789
- const {
1790
- newState
1791
- } = get(uid);
1792
- return newState.flags;
1910
+ // src/parts/GetKeys/GetKeys.ts
1911
+ var getKeys = node => {
1912
+ const keys = Object.keys(node).filter(isKey);
1913
+ return keys;
1793
1914
  };
1794
1915
 
1795
- const getFocus = uid => {
1796
- const {
1797
- newState
1798
- } = get(uid);
1799
- return newState.focus;
1916
+ // src/parts/GetTotalChildCount/GetTotalChildCount.ts
1917
+ var getTotalChildCount = (nodes, index) => {
1918
+ let i = index;
1919
+ let pending = 1;
1920
+ while (pending) {
1921
+ const node = nodes[i];
1922
+ pending += node.childCount;
1923
+ pending--;
1924
+ i++;
1925
+ }
1926
+ return i - index;
1800
1927
  };
1801
1928
 
1802
- const Tab = 2;
1803
- const Enter = 3;
1804
- const End = 255;
1805
- const Home = 12;
1806
- const UpArrow = 14;
1807
- const DownArrow = 16;
1808
- const Delete = 18;
1809
- const KeyC = 31;
1810
-
1811
- const CtrlCmd = 1 << 11 >>> 0;
1812
- const Shift = 1 << 10 >>> 0;
1813
- const Alt = 1 << 9 >>> 0;
1814
-
1815
- const getKeyBindings = () => {
1816
- return [{
1817
- key: CtrlCmd | Alt | Enter,
1818
- command: 'Search.replaceAll',
1819
- when: FocusSearch
1820
- }, {
1821
- key: Tab,
1822
- command: 'Search.focusNextInput',
1823
- when: FocusSearch
1824
- }, {
1825
- key: Shift | Tab,
1826
- command: 'Search.focusPreviousInput',
1827
- when: FocusSearch
1828
- }, {
1829
- key: DownArrow,
1830
- command: 'Search.focusNext',
1831
- when: FocusSearchResults
1832
- }, {
1929
+ // src/parts/VirtualDomDiff/VirtualDomDiff.ts
1930
+ var diff$1 = (oldNodes, newNodes) => {
1931
+ const patches = [];
1932
+ const pendingPatches = [];
1933
+ let i = 0;
1934
+ let j = 0;
1935
+ let siblingOffset = 0;
1936
+ let maxSiblingOffset = 1;
1937
+ const indexStack = [0, 1];
1938
+ while (i < oldNodes.length && j < newNodes.length) {
1939
+ const oldNode = oldNodes[i];
1940
+ const newNode = newNodes[j];
1941
+ if (siblingOffset === maxSiblingOffset) {
1942
+ indexStack.pop();
1943
+ indexStack.pop();
1944
+ pendingPatches.push(NavigateParent, 0);
1945
+ maxSiblingOffset = indexStack.pop();
1946
+ siblingOffset = indexStack.pop() + 1;
1947
+ }
1948
+ while (siblingOffset === maxSiblingOffset) {
1949
+ pendingPatches.push(NavigateParent, 0);
1950
+ maxSiblingOffset = indexStack.pop();
1951
+ siblingOffset = indexStack.pop() + 1;
1952
+ }
1953
+ if (oldNode.type !== newNode.type) {
1954
+ let skip = 0;
1955
+ if (pendingPatches.length > 0 && pendingPatches.at(-2) === NavigateChild) {
1956
+ skip = 2;
1957
+ }
1958
+ applyPendingPatches(patches, pendingPatches, skip);
1959
+ const oldTotal = getTotalChildCount(oldNodes, i);
1960
+ const newTotal = getTotalChildCount(newNodes, j);
1961
+ patches.push({
1962
+ type: RemoveChild,
1963
+ index: siblingOffset
1964
+ });
1965
+ patches.push({
1966
+ type: Add,
1967
+ nodes: newNodes.slice(j, j + newTotal)
1968
+ });
1969
+ siblingOffset++;
1970
+ i += oldTotal;
1971
+ j += newTotal;
1972
+ continue;
1973
+ }
1974
+ if (oldNode.type === Text$1 && newNode.type === Text$1) {
1975
+ if (oldNode.text !== newNode.text) {
1976
+ if (siblingOffset !== 0) {
1977
+ pendingPatches.push(NavigateSibling, siblingOffset);
1978
+ }
1979
+ applyPendingPatches(patches, pendingPatches, 0);
1980
+ patches.push({
1981
+ type: SetText,
1982
+ value: newNode.text
1983
+ });
1984
+ }
1985
+ i++;
1986
+ j++;
1987
+ siblingOffset++;
1988
+ continue;
1989
+ }
1990
+ const oldKeys = getKeys(oldNode);
1991
+ const newKeys = getKeys(newNode);
1992
+ let hasAttributeChanges = false;
1993
+ for (const key of newKeys) {
1994
+ if (oldNode[key] !== newNode[key]) {
1995
+ hasAttributeChanges = true;
1996
+ break;
1997
+ }
1998
+ }
1999
+ for (const key of oldKeys) {
2000
+ if (!(key in newNode)) {
2001
+ hasAttributeChanges = true;
2002
+ break;
2003
+ }
2004
+ }
2005
+ if (hasAttributeChanges) {
2006
+ if (siblingOffset > 0) {
2007
+ pendingPatches.push(NavigateSibling, siblingOffset);
2008
+ }
2009
+ applyPendingPatches(patches, pendingPatches, 0);
2010
+ for (const key of newKeys) {
2011
+ if (oldNode[key] !== newNode[key]) {
2012
+ patches.push({
2013
+ type: SetAttribute,
2014
+ key,
2015
+ value: newNode[key]
2016
+ });
2017
+ }
2018
+ }
2019
+ for (const key of oldKeys) {
2020
+ if (!(key in newNode)) {
2021
+ patches.push({
2022
+ type: RemoveAttribute,
2023
+ key
2024
+ });
2025
+ }
2026
+ }
2027
+ }
2028
+ if (oldNode.childCount && newNode.childCount) {
2029
+ maxSiblingOffset = oldNode.childCount;
2030
+ indexStack.push(0, maxSiblingOffset);
2031
+ pendingPatches.push(NavigateChild, 0);
2032
+ i++;
2033
+ j++;
2034
+ continue;
2035
+ }
2036
+ if (oldNode.childCount) {
2037
+ applyPendingPatches(patches, pendingPatches, 0);
2038
+ for (let k = 0; k < oldNode.childCount; k++) {
2039
+ patches.push({
2040
+ type: RemoveChild,
2041
+ index: 0
2042
+ });
2043
+ }
2044
+ i += getTotalChildCount(oldNodes, i);
2045
+ j++;
2046
+ siblingOffset++;
2047
+ continue;
2048
+ }
2049
+ if (newNode.childCount) {
2050
+ applyPendingPatches(patches, pendingPatches, 0);
2051
+ const total = getTotalChildCount(newNodes, j);
2052
+ patches.push({
2053
+ type: Add,
2054
+ nodes: newNodes.slice(j + 1, j + total)
2055
+ });
2056
+ i++;
2057
+ j += total;
2058
+ continue;
2059
+ }
2060
+ i++;
2061
+ j++;
2062
+ siblingOffset++;
2063
+ }
2064
+ while (i < oldNodes.length) {
2065
+ if (indexStack.length !== 2) {
2066
+ patches.push({
2067
+ type: NavigateParent
2068
+ });
2069
+ }
2070
+ patches.push({
2071
+ type: RemoveChild,
2072
+ index: siblingOffset
2073
+ });
2074
+ i += getTotalChildCount(oldNodes, i);
2075
+ indexStack.pop();
2076
+ indexStack.pop();
2077
+ }
2078
+ while (j < newNodes.length) {
2079
+ if (siblingOffset > 0) {
2080
+ patches.push({
2081
+ type: NavigateSibling,
2082
+ index: siblingOffset
2083
+ });
2084
+ siblingOffset = 0;
2085
+ }
2086
+ const count = getTotalChildCount(newNodes, j);
2087
+ patches.push({
2088
+ type: Add,
2089
+ nodes: newNodes.slice(j, j + count)
2090
+ });
2091
+ j += count;
2092
+ }
2093
+ return patches;
2094
+ };
2095
+
2096
+ const Button = 1;
2097
+ const Del = 21;
2098
+ const Div = 4;
2099
+ const H4 = 24;
2100
+ const Img = 17;
2101
+ const Ins = 20;
2102
+ const Span = 8;
2103
+ const Text = 12;
2104
+ const TextArea = 62;
2105
+
2106
+ const getIconVirtualDom = (icon, type = Div) => {
2107
+ return {
2108
+ type,
2109
+ className: mergeClassNames(MaskIcon, `MaskIcon${icon}`),
2110
+ role: None$1,
2111
+ childCount: 0
2112
+ };
2113
+ };
2114
+
2115
+ const getActionButtonVirtualDom = action => {
2116
+ const {
2117
+ id,
2118
+ icon,
2119
+ command
2120
+ } = action;
2121
+ return [{
2122
+ type: Button,
2123
+ className: IconButton,
2124
+ title: id,
2125
+ 'data-command': command,
2126
+ childCount: 1
2127
+ }, getIconVirtualDom(icon)];
2128
+ };
2129
+
2130
+ const getActionVirtualDom = action => {
2131
+ switch (action.type) {
2132
+ case Button$2:
2133
+ return getActionButtonVirtualDom(action);
2134
+ default:
2135
+ return [];
2136
+ }
2137
+ };
2138
+
2139
+ const getActionsVirtualDom = actions => {
2140
+ return [{
2141
+ type: Div,
2142
+ className: Actions,
2143
+ role: ToolBar,
2144
+ childCount: actions.length
2145
+ }, ...actions.flatMap(getActionVirtualDom)];
2146
+ };
2147
+
2148
+ const commandIds = ['clearSearchResults', 'collapseDetails', 'copy', 'dismissItem', 'expandDetails', 'focusFirst', 'focusIndex', 'focusLast', 'focusMatchCase', 'focusMatchCasePrevious', 'focusMatchWholeWord', 'focusNext', 'focusNextInput', 'focusNextPage', 'focusPreserveCasePrevious', 'focusPrevious', 'focusPreviousInput', 'focusPreviousPage', 'focusRegex', 'focusRegexNext', 'focusReplaceAll', 'focusReplaceValue', 'focusReplaceValueNext', 'focusReplaceValuePrevious', 'focusSearchValue', 'focusSearchValueNext', 'handleClick', 'handleClickAt', 'handleContextMenu', 'handleContextMenuKeyboard', 'handleContextMenuMouseAt', 'handleExcludeInput', 'handleFocusIn', 'handleHeaderClick', 'handleIconThemeChange', 'handleIconThemeChange', 'handleIncludeInput', 'handleInput', 'handleListBlur', 'handleListFocus', 'handleReplaceInput', 'handleScrollBarCaptureLost', 'handleScrollBarClick', 'handleScrollBarMove', 'handleScrollBarThumbPointerMove', 'handleTouchEnd', 'handleTouchMove', 'handleTouchStart', 'handleUpdate', 'handleWheel', 'refresh', 'replaceAll', 'scrollDown', 'selectIndex', 'submit', 'toggleMatchCase', 'toggleMatchWholeWord', 'togglePreserveCase', 'toggleReplace', 'toggleSearchDetails', 'toggleUseRegularExpression'];
2149
+
2150
+ const getCommandIds = () => {
2151
+ return commandIds;
2152
+ };
2153
+
2154
+ const getFlags = uid => {
2155
+ const {
2156
+ newState
2157
+ } = get(uid);
2158
+ return newState.flags;
2159
+ };
2160
+
2161
+ const getFocus = uid => {
2162
+ const {
2163
+ newState
2164
+ } = get(uid);
2165
+ return newState.focus;
2166
+ };
2167
+
2168
+ const Tab = 2;
2169
+ const Enter = 3;
2170
+ const End = 255;
2171
+ const Home = 12;
2172
+ const UpArrow = 14;
2173
+ const DownArrow = 16;
2174
+ const Delete = 18;
2175
+ const KeyC = 31;
2176
+
2177
+ const CtrlCmd = 1 << 11 >>> 0;
2178
+ const Shift = 1 << 10 >>> 0;
2179
+ const Alt = 1 << 9 >>> 0;
2180
+
2181
+ const getKeyBindings = () => {
2182
+ return [{
2183
+ key: CtrlCmd | Alt | Enter,
2184
+ command: 'Search.replaceAll',
2185
+ when: FocusSearch
2186
+ }, {
2187
+ key: Tab,
2188
+ command: 'Search.focusNextInput',
2189
+ when: FocusSearch
2190
+ }, {
2191
+ key: Shift | Tab,
2192
+ command: 'Search.focusPreviousInput',
2193
+ when: FocusSearch
2194
+ }, {
2195
+ key: DownArrow,
2196
+ command: 'Search.focusNext',
2197
+ when: FocusSearchResults
2198
+ }, {
1833
2199
  key: UpArrow,
1834
2200
  command: 'Search.focusPrevious',
1835
2201
  when: FocusSearchResults
@@ -2037,7 +2403,7 @@ const UseRegularExpression = 'UseRegularExpression';
2037
2403
 
2038
2404
  const getSearchDetailsToggleVirtualDom = () => {
2039
2405
  return [{
2040
- type: Div$1,
2406
+ type: Div,
2041
2407
  className: ToggleDetails,
2042
2408
  role: Button$3,
2043
2409
  tabIndex: 0,
@@ -2046,7 +2412,7 @@ const getSearchDetailsToggleVirtualDom = () => {
2046
2412
  name: ToggleSearchDetails,
2047
2413
  childCount: 1
2048
2414
  }, {
2049
- type: Div$1,
2415
+ type: Div,
2050
2416
  className: mergeClassNames(MaskIcon, MaskIconEllipsis),
2051
2417
  childCount: 0
2052
2418
  }];
@@ -2054,7 +2420,7 @@ const getSearchDetailsToggleVirtualDom = () => {
2054
2420
 
2055
2421
  const text = data => {
2056
2422
  return {
2057
- type: Text$1,
2423
+ type: Text,
2058
2424
  text: data,
2059
2425
  childCount: 0
2060
2426
  };
@@ -2068,7 +2434,7 @@ const getClassName = indented => {
2068
2434
  };
2069
2435
  const getSearchMessageVirtualDom = (message, indented) => {
2070
2436
  return [{
2071
- type: Div$1,
2437
+ type: Div,
2072
2438
  className: getClassName(indented),
2073
2439
  role: Status,
2074
2440
  tabIndex: 0,
@@ -2078,7 +2444,7 @@ const getSearchMessageVirtualDom = (message, indented) => {
2078
2444
 
2079
2445
  const getSearchHeaderDetailsCollapsedVirtualDom = message => {
2080
2446
  return [{
2081
- type: Div$1,
2447
+ type: Div,
2082
2448
  className: SearchHeaderDetails,
2083
2449
  childCount: 2
2084
2450
  }, ...getSearchMessageVirtualDom(message, true), ...getSearchDetailsToggleVirtualDom()];
@@ -2164,7 +2530,7 @@ const getSearchFieldButtonVirtualDom = button => {
2164
2530
  const role = getRole(flag);
2165
2531
  const disabled = getDisabled(flag);
2166
2532
  return [{
2167
- type: Button$1,
2533
+ type: Button,
2168
2534
  className: getSearchFieldButtonClassName(flag),
2169
2535
  name,
2170
2536
  title,
@@ -2174,7 +2540,7 @@ const getSearchFieldButtonVirtualDom = button => {
2174
2540
  tabIndex: 0,
2175
2541
  childCount: 1
2176
2542
  }, {
2177
- type: Span$1,
2543
+ type: Span,
2178
2544
  className: mergeClassNames(MaskIcon, icon),
2179
2545
  childCount: 0
2180
2546
  }];
@@ -2189,7 +2555,7 @@ const getOutSideButtonsDom = outsideButtons => {
2189
2555
  }
2190
2556
  return {
2191
2557
  preNodes: [{
2192
- type: Div$1,
2558
+ type: Div,
2193
2559
  className: SearchFieldContainer,
2194
2560
  role: None$1,
2195
2561
  childCount: 1 + outsideButtons.length
@@ -2205,12 +2571,12 @@ const getSearchFieldVirtualDom = (name, placeholder, onInput, insideButtons, out
2205
2571
  } = getOutSideButtonsDom(outsideButtons);
2206
2572
  const searchFieldClassName = hasError ? mergeClassNames(SearchField, SearchFieldError) : SearchField;
2207
2573
  const dom = [...preNodes, {
2208
- type: Div$1,
2574
+ type: Div,
2209
2575
  className: searchFieldClassName,
2210
2576
  role: None$1,
2211
2577
  childCount: 2
2212
2578
  }, {
2213
- type: TextArea$1,
2579
+ type: TextArea,
2214
2580
  className: MultilineInputBox,
2215
2581
  spellcheck: false,
2216
2582
  autocapitalize: 'off',
@@ -2221,7 +2587,7 @@ const getSearchFieldVirtualDom = (name, placeholder, onInput, insideButtons, out
2221
2587
  onFocus,
2222
2588
  childCount: 0
2223
2589
  }, {
2224
- type: Div$1,
2590
+ type: Div,
2225
2591
  className: SearchFieldButtons,
2226
2592
  childCount: insideButtons.length
2227
2593
  }, ...insideButtons.flatMap(getSearchFieldButtonVirtualDom), ...postNodes];
@@ -2232,19 +2598,19 @@ const getSearchHeaderDetailsExpandedVirtualDom = (flags, message) => {
2232
2598
  const includeButtons = getInputActionsInclude(flags);
2233
2599
  const excludeButtons = getInputActionsExclude(flags);
2234
2600
  return [{
2235
- type: Div$1,
2601
+ type: Div,
2236
2602
  className: SearchHeaderDetailsExpanded,
2237
2603
  childCount: 5
2238
2604
  }, {
2239
- type: Div$1,
2605
+ type: Div,
2240
2606
  className: SearchHeaderDetailsExpandedTop,
2241
2607
  childCount: 2
2242
2608
  }, ...getSearchDetailsToggleVirtualDom(), {
2243
- type: H4$1,
2609
+ type: H4,
2244
2610
  className: SearchHeaderDetailsHeading,
2245
2611
  childCount: 1
2246
2612
  }, text(filesToInclude()), ...getSearchFieldVirtualDom(FilesToInclude, 'Include', HandleIncludeInput, includeButtons.inside, includeButtons.outside), {
2247
- type: H4$1,
2613
+ type: H4,
2248
2614
  className: SearchHeaderDetailsHeading,
2249
2615
  childCount: 1
2250
2616
  }, text(filesToExclude()), ...getSearchFieldVirtualDom(FilesToExclude, 'Exclude', HandleExcludeInput, excludeButtons.inside, excludeButtons.outside), ...getSearchMessageVirtualDom(message, false)];
@@ -2260,17 +2626,17 @@ const getSearchHeaderDetailsVirtualDom = (flags, message) => {
2260
2626
  const getInputActionsInput = flags => {
2261
2627
  const inside = [{
2262
2628
  icon: MaskIconCaseSensitive,
2263
- flag: flags & MatchCase$1 ? CheckBoxEnabled : CheckBoxDisabled,
2629
+ flag: flags & MatchCase$2 ? CheckBoxEnabled : CheckBoxDisabled,
2264
2630
  title: matchCase(),
2265
2631
  name: MatchCase
2266
2632
  }, {
2267
2633
  icon: MaskIconWholeWord,
2268
- flag: flags & MatchWholeWord$1 ? CheckBoxEnabled : CheckBoxDisabled,
2634
+ flag: flags & MatchWholeWord$2 ? CheckBoxEnabled : CheckBoxDisabled,
2269
2635
  title: matchWholeWord(),
2270
2636
  name: MatchWholeWord
2271
2637
  }, {
2272
2638
  icon: MaskIconRegex,
2273
- flag: flags & UseRegularExpression$1 ? CheckBoxEnabled : CheckBoxDisabled,
2639
+ flag: flags & UseRegularExpression$2 ? CheckBoxEnabled : CheckBoxDisabled,
2274
2640
  title: useRegularExpression(),
2275
2641
  name: UseRegularExpression
2276
2642
  }];
@@ -2284,7 +2650,7 @@ const getInputActionsInput = flags => {
2284
2650
  const getInputActionsReplace = (flags, matchCount) => {
2285
2651
  const inside = [{
2286
2652
  icon: MaskIconPreserveCase,
2287
- flag: flags & PreserveCase$1 ? CheckBoxEnabled : CheckBoxDisabled,
2653
+ flag: flags & PreserveCase$2 ? CheckBoxEnabled : CheckBoxDisabled,
2288
2654
  title: preserveCase(),
2289
2655
  name: PreserveCase
2290
2656
  }];
@@ -2302,7 +2668,7 @@ const getInputActionsReplace = (flags, matchCount) => {
2302
2668
 
2303
2669
  const getSearchToggleVirtualDom = flags => {
2304
2670
  return [{
2305
- type: Button$1,
2671
+ type: Button,
2306
2672
  className: mergeClassNames(IconButton, SearchToggleButton, flags & ReplaceExpanded ? SearchToggleButtonExpanded : ''),
2307
2673
  title: toggleReplace$1(),
2308
2674
  ariaLabel: toggleReplace$1(),
@@ -2311,7 +2677,7 @@ const getSearchToggleVirtualDom = flags => {
2311
2677
  'data-command': 'toggleReplace',
2312
2678
  name: ToggleReplace
2313
2679
  }, {
2314
- type: Div$1,
2680
+ type: Div,
2315
2681
  className: mergeClassNames(MaskIcon, flags & ReplaceExpanded ? MaskIconChevronDown : MaskIconChevronRight),
2316
2682
  childCount: 0
2317
2683
  }];
@@ -2321,12 +2687,12 @@ const getSearchHeaderTopVirtualDom = (flags, searchInputErrorMessage, matchCount
2321
2687
  const inputActions = getInputActionsInput(flags);
2322
2688
  const replaceActions = getInputActionsReplace(flags, matchCount);
2323
2689
  const dom = [{
2324
- type: Div$1,
2690
+ type: Div,
2325
2691
  className: SearchHeaderTop,
2326
2692
  role: None$1,
2327
2693
  childCount: 2
2328
2694
  }, ...getSearchToggleVirtualDom(flags), {
2329
- type: Div$1,
2695
+ type: Div,
2330
2696
  className: SearchHeaderTopRight,
2331
2697
  role: None$1,
2332
2698
  childCount: flags & ReplaceExpanded ? 2 : 1
@@ -2338,7 +2704,7 @@ const getSearchHeaderTopVirtualDom = (flags, searchInputErrorMessage, matchCount
2338
2704
  };
2339
2705
 
2340
2706
  const parentNode = {
2341
- type: Div$1,
2707
+ type: Div,
2342
2708
  className: SearchHeader,
2343
2709
  role: None$1,
2344
2710
  childCount: 2,
@@ -2355,7 +2721,7 @@ const getSearchInputErrorVirtualDom = errorMessage => {
2355
2721
  return [];
2356
2722
  }
2357
2723
  return [{
2358
- type: Div$1,
2724
+ type: Div,
2359
2725
  className: SearchInputError,
2360
2726
  role: Alert,
2361
2727
  childCount: 1
@@ -2369,7 +2735,7 @@ const getScrollBarVirtualDom = (scrollBarHeight, scrollBarY, scrollBarValue) =>
2369
2735
  return [];
2370
2736
  }
2371
2737
  return [{
2372
- type: Div$1,
2738
+ type: Div,
2373
2739
  className: mergeClassNames(ScrollBar, ScrollBarVertical),
2374
2740
  childCount: 1,
2375
2741
  onPointerDown: HandleScrollBarPointerDown,
@@ -2377,7 +2743,7 @@ const getScrollBarVirtualDom = (scrollBarHeight, scrollBarY, scrollBarValue) =>
2377
2743
  ariaControls: TreeItems,
2378
2744
  ariaValueNow: scrollBarValue
2379
2745
  }, {
2380
- type: Div$1,
2746
+ type: Div,
2381
2747
  className: ScrollBarThumb,
2382
2748
  height: scrollBarHeight,
2383
2749
  translate: `0 ${scrollBarY}px`,
@@ -2403,26 +2769,26 @@ const getBadgeVirtualDom = (className, badgeText) => {
2403
2769
  return [];
2404
2770
  }
2405
2771
  return [{
2406
- type: Div$1,
2772
+ type: Div,
2407
2773
  className: mergeClassNames(Badge, className),
2408
2774
  childCount: 1
2409
2775
  }, text(badgeText)];
2410
2776
  };
2411
2777
 
2412
2778
  const chevronDownVirtualDom = {
2413
- type: Div$1,
2779
+ type: Div,
2414
2780
  className: mergeClassNames(Chevron, MaskIconChevronDown),
2415
2781
  childCount: 0
2416
2782
  };
2417
2783
  const chevronRightVirtualDom = {
2418
- type: Div$1,
2784
+ type: Div,
2419
2785
  className: mergeClassNames(Chevron, MaskIconChevronRight),
2420
2786
  childCount: 0
2421
2787
  };
2422
2788
 
2423
2789
  const getFileIconVirtualDom = icon => {
2424
2790
  return {
2425
- type: Img$1,
2791
+ type: Img,
2426
2792
  className: FileIcon,
2427
2793
  src: icon,
2428
2794
  role: None$1,
@@ -2442,22 +2808,22 @@ const getIconsVirtualDom = (expanded, icon) => {
2442
2808
  };
2443
2809
 
2444
2810
  const deleted = {
2445
- type: Del$1,
2811
+ type: Del,
2446
2812
  className: HighlightDeleted,
2447
2813
  childCount: 1
2448
2814
  };
2449
2815
  const inserted = {
2450
- type: Ins$1,
2816
+ type: Ins,
2451
2817
  className: HighlightInserted,
2452
2818
  childCount: 1
2453
2819
  };
2454
2820
  const highlighted = {
2455
- type: Span$1,
2821
+ type: Span,
2456
2822
  className: Highlight,
2457
2823
  childCount: 1
2458
2824
  };
2459
2825
  const label1 = {
2460
- type: Div$1,
2826
+ type: Div,
2461
2827
  className: mergeClassNames(Label, Grow),
2462
2828
  childCount: 1
2463
2829
  };
@@ -2512,7 +2878,7 @@ const getSearchResultVirtualDom = rowInfo => {
2512
2878
  badgeText
2513
2879
  } = rowInfo;
2514
2880
  const dom = [{
2515
- type: Div$1,
2881
+ type: Div,
2516
2882
  role: TreeItem$1,
2517
2883
  className: getSearchResultClassName(focused),
2518
2884
  title,
@@ -2526,11 +2892,11 @@ const getSearchResultVirtualDom = rowInfo => {
2526
2892
  paddingRight: PaddingRight,
2527
2893
  ariaExpanded: getAriaExpanded(expanded)
2528
2894
  }, ...getIconsVirtualDom(expanded, icon), ...getLabelVirtualDom(displayText, matchLength, matchStart, replacement), ...getBadgeVirtualDom(SourceControlBadge, badgeText), {
2529
- type: Div$1,
2895
+ type: Div,
2530
2896
  className: SearchRemove,
2531
2897
  childCount: 1
2532
2898
  }, {
2533
- type: Div$1,
2899
+ type: Div,
2534
2900
  className: CloseMaskIcon,
2535
2901
  childCount: 0
2536
2902
  }];
@@ -2540,7 +2906,7 @@ const getSearchResultVirtualDom = rowInfo => {
2540
2906
  const getTreeItemsVirtualDom = (visibleItems, deltaY, itemHeight) => {
2541
2907
  const pixelOffset = deltaY % itemHeight;
2542
2908
  return [{
2543
- type: Div$1,
2909
+ type: Div,
2544
2910
  className: TreeItems$1,
2545
2911
  childCount: visibleItems.length,
2546
2912
  onClick: HandleClick,
@@ -2554,7 +2920,7 @@ const getTreeItemsVirtualDom = (visibleItems, deltaY, itemHeight) => {
2554
2920
  const getSearchResultsVirtualDom = (visibleItems, focusOutline, scrollbarHeight, scrollBarY, scrollBarValue, deltaY, itemHeight) => {
2555
2921
  const scrollBarDomNodes = scrollbarHeight === 0 ? 0 : 1;
2556
2922
  return [{
2557
- type: Div$1,
2923
+ type: Div,
2558
2924
  className: mergeClassNames(Viewlet, List, Tree, focusOutline ? FocusOutline : Empty),
2559
2925
  role: Tree$1,
2560
2926
  tabIndex: 0,
@@ -2566,7 +2932,7 @@ const getSearchVirtualDom = (visibleItems, flags, message, focusOutline, searchI
2566
2932
  const errorDom = getSearchInputErrorVirtualDom(searchInputErrorMessage);
2567
2933
  const childCount = 2 + (errorDom.length > 0 ? 1 : 0);
2568
2934
  return [{
2569
- type: Div$1,
2935
+ type: Div,
2570
2936
  className: mergeClassNames(Viewlet, Search$2),
2571
2937
  childCount
2572
2938
  }, ...getSearchHeaderVirtualDom(flags, message, searchInputErrorMessage, matchCount), ...errorDom, ...getSearchResultsVirtualDom(visibleItems, focusOutline, scrollBarHeight, scrollBarY, scrollBarValue, deltaY, itemHeight)];
@@ -2874,7 +3240,7 @@ const validateSearchInput = (value, flags) => {
2874
3240
  if (!value) {
2875
3241
  return '';
2876
3242
  }
2877
- if (!(flags & UseRegularExpression$1)) {
3243
+ if (!(flags & UseRegularExpression$2)) {
2878
3244
  return '';
2879
3245
  }
2880
3246
  try {
@@ -2930,8 +3296,8 @@ const handleUpdate = async (state, update) => {
2930
3296
  const scheme = getProtocol$1(root);
2931
3297
  const results = await textSearch(root, value, {
2932
3298
  threads,
2933
- isCaseSensitive: Boolean(flags & MatchCase$1),
2934
- useRegularExpression: Boolean(flags & UseRegularExpression$1),
3299
+ isCaseSensitive: Boolean(flags & MatchCase$2),
3300
+ useRegularExpression: Boolean(flags & UseRegularExpression$2),
2935
3301
  exclude: excludeValue,
2936
3302
  include: includeValue,
2937
3303
  assetDir: state.assetDir,
@@ -2939,7 +3305,7 @@ const handleUpdate = async (state, update) => {
2939
3305
  query: value,
2940
3306
  scheme,
2941
3307
  flags,
2942
- matchWholeWord: Boolean(flags & MatchWholeWord$1)
3308
+ matchWholeWord: Boolean(flags & MatchWholeWord$2)
2943
3309
  }, state.assetDir, state.platform);
2944
3310
  if (!Array.isArray(results)) {
2945
3311
  throw new TypeError('results must be of type array');
@@ -3079,28 +3445,6 @@ const replaceAll = async state => {
3079
3445
  };
3080
3446
  };
3081
3447
 
3082
- const toggleSearchFlag = (state, flag) => {
3083
- return handleUpdate(state, {
3084
- flags: state.flags ^ flag
3085
- });
3086
- };
3087
-
3088
- const collapseDetails = async state => {
3089
- return {
3090
- ...(await toggleSearchFlag(state, DetailsExpanded)),
3091
- focus: FocusSearchInput,
3092
- focusSource: Script
3093
- };
3094
- };
3095
-
3096
- const expandDetails = async state => {
3097
- return {
3098
- ...(await toggleSearchFlag(state, DetailsExpanded)),
3099
- focus: FocusSearchIncludeInput,
3100
- focusSource: Script
3101
- };
3102
- };
3103
-
3104
3448
  const toggleDetailsExpanded = state => {
3105
3449
  if (hasDetailsExpanded(state.flags)) {
3106
3450
  return collapseDetails(state);
@@ -3108,12 +3452,18 @@ const toggleDetailsExpanded = state => {
3108
3452
  return expandDetails(state);
3109
3453
  };
3110
3454
 
3455
+ const toggleSearchFlag = (state, flag) => {
3456
+ return handleUpdate(state, {
3457
+ flags: state.flags ^ flag
3458
+ });
3459
+ };
3460
+
3111
3461
  const toggleMatchCase = state => {
3112
- return toggleSearchFlag(state, MatchCase$1);
3462
+ return toggleSearchFlag(state, MatchCase$2);
3113
3463
  };
3114
3464
 
3115
3465
  const toggleMatchWholeWord = state => {
3116
- return toggleSearchFlag(state, MatchWholeWord$1);
3466
+ return toggleSearchFlag(state, MatchWholeWord$2);
3117
3467
  };
3118
3468
 
3119
3469
  const toggleOpenEditors = state => {
@@ -3121,7 +3471,7 @@ const toggleOpenEditors = state => {
3121
3471
  };
3122
3472
 
3123
3473
  const togglePreserveCase = state => {
3124
- return toggleSearchFlag(state, PreserveCase$1);
3474
+ return toggleSearchFlag(state, PreserveCase$2);
3125
3475
  };
3126
3476
 
3127
3477
  const toggleReplace = state => {
@@ -3133,7 +3483,7 @@ const toggleUseIgnoreFiles = state => {
3133
3483
  };
3134
3484
 
3135
3485
  const toggleUseRegularExpression = state => {
3136
- return toggleSearchFlag(state, UseRegularExpression$1);
3486
+ return toggleSearchFlag(state, UseRegularExpression$2);
3137
3487
  };
3138
3488
 
3139
3489
  const getClickHandler = name => {
@@ -3707,8 +4057,42 @@ const RenderReplaceValue = 4;
3707
4057
  const RenderIncludeValue = 5;
3708
4058
  const RenderExcludeValue = 6;
3709
4059
 
4060
+ const getFocusSelector = focusKey => {
4061
+ switch (focusKey) {
4062
+ case FocusSearchInput:
4063
+ return SearchValue;
4064
+ case FocusSearchReplaceInput:
4065
+ return ReplaceValue;
4066
+ case FocusToggleDetails:
4067
+ return ToggleSearchDetails;
4068
+ case FocusSearchMatchCase:
4069
+ return MatchCase;
4070
+ case FocusSearchPreserveCase:
4071
+ return PreserveCase;
4072
+ case FocusSearchRegex:
4073
+ return UseRegularExpression;
4074
+ case FocusSearchIncludeInput:
4075
+ return FilesToInclude;
4076
+ case FocusSearchExcludeInput:
4077
+ return FilesToExclude;
4078
+ case FocusSearchWholeWord:
4079
+ return MatchWholeWord;
4080
+ case FocusSearchReplaceAll:
4081
+ return ReplaceAll;
4082
+ case FocusSearchOpenEditors:
4083
+ return SearchOnlyOpenEditors;
4084
+ case FocusIgnoreFiles:
4085
+ return UseExcludeSettings;
4086
+ case FocusToggleReplace:
4087
+ return ToggleReplace;
4088
+ default:
4089
+ return '';
4090
+ }
4091
+ };
4092
+
3710
4093
  const renderFocus = (oldState, newState) => {
3711
- return oldState.focus === newState.focus || newState.focusSource === User;
4094
+ const selector = getFocusSelector(newState.focus);
4095
+ return ['Viewlet.focusElementByName', newState.uid, selector];
3712
4096
  };
3713
4097
 
3714
4098
  const createViewModel = state => {
@@ -3869,7 +4253,7 @@ const DiffValue = {
3869
4253
 
3870
4254
  const modules = [DiffItems, DiffFocus, DiffIncludeValue, DiffExcludeValue, DiffReplaceValue, DiffValue];
3871
4255
 
3872
- const diff$1 = (oldState, newState) => {
4256
+ const diff = (oldState, newState) => {
3873
4257
  const diffResult = [];
3874
4258
  for (const module of modules) {
3875
4259
  if (!module.isEqual(oldState, newState)) {
@@ -3884,8 +4268,9 @@ const doRender = uid => {
3884
4268
  oldState,
3885
4269
  newState
3886
4270
  } = get(uid);
3887
- const diffResult = diff$1(oldState, newState);
3888
- return applyRender(oldState, newState, diffResult);
4271
+ const diffResult = diff(oldState, newState);
4272
+ const commands = applyRender(oldState, newState, diffResult);
4273
+ return commands;
3889
4274
  };
3890
4275
 
3891
4276
  const renderActions = uid => {
@@ -3916,13 +4301,13 @@ const renderEventListeners = () => {
3916
4301
  params: ['handleInput', 'event.target.value', User]
3917
4302
  }, {
3918
4303
  name: HandleClick,
3919
- params: ['handleClickAt', 'event.clientX', 'event.clientY']
4304
+ params: ['handleClick', 'event.clientX', 'event.clientY']
3920
4305
  }, {
3921
4306
  name: HandleToggleButtonClick,
3922
- params: ['handleClickAt', 'event.clientX', 'event.clientY']
4307
+ params: ['handleToggleButtonClick']
3923
4308
  }, {
3924
4309
  name: HandleListFocus,
3925
- params: ['handleClickAt', 'event.clientX', 'event.clientY']
4310
+ params: ['handleListFocus']
3926
4311
  }, {
3927
4312
  name: HandleListBlur,
3928
4313
  params: ['handleListBlur']
@@ -3932,355 +4317,20 @@ const renderEventListeners = () => {
3932
4317
  preventDefault: true
3933
4318
  }, {
3934
4319
  name: HandleWheel,
3935
- params: ['handleContextMenu', 'event.deltaMode', 'event.deltaY'],
4320
+ params: ['handleWheel', 'event.deltaMode', 'event.deltaY'],
3936
4321
  passive: true
3937
4322
  }, {
3938
4323
  name: HandleHeaderClick2,
3939
4324
  params: ['handleHeaderClick', 'event.target.name']
4325
+ }, {
4326
+ name: HandleHeaderFocusIn,
4327
+ params: ['handleHeaderFocusIn']
4328
+ }, {
4329
+ name: HandleScrollBarPointerDown,
4330
+ params: ['handleScrollBarClick', 'event.deltaY']
3940
4331
  }];
3941
4332
  };
3942
4333
 
3943
- var __defProp = Object.defineProperty;
3944
- var __export = (target, all) => {
3945
- for (var name in all) __defProp(target, name, {
3946
- get: all[name],
3947
- enumerable: true
3948
- });
3949
- };
3950
-
3951
- // src/parts/VirtualDomElements/VirtualDomElements.ts
3952
- var VirtualDomElements_exports = {};
3953
- __export(VirtualDomElements_exports, {
3954
- A: () => A,
3955
- Abbr: () => Abbr,
3956
- Article: () => Article,
3957
- Aside: () => Aside,
3958
- Audio: () => Audio,
3959
- Br: () => Br,
3960
- Button: () => Button,
3961
- Cite: () => Cite,
3962
- Col: () => Col,
3963
- ColGroup: () => ColGroup,
3964
- Data: () => Data,
3965
- Dd: () => Dd,
3966
- Del: () => Del,
3967
- Div: () => Div,
3968
- Dl: () => Dl,
3969
- Figcaption: () => Figcaption,
3970
- Figure: () => Figure,
3971
- Footer: () => Footer,
3972
- H1: () => H1,
3973
- H2: () => H2,
3974
- H3: () => H3,
3975
- H4: () => H4,
3976
- H5: () => H5,
3977
- H6: () => H6,
3978
- Header: () => Header,
3979
- Hr: () => Hr,
3980
- I: () => I,
3981
- Img: () => Img,
3982
- Input: () => Input,
3983
- Ins: () => Ins,
3984
- Kbd: () => Kbd,
3985
- Li: () => Li,
3986
- Nav: () => Nav,
3987
- Ol: () => Ol,
3988
- Option: () => Option,
3989
- P: () => P,
3990
- Pre: () => Pre,
3991
- Root: () => Root,
3992
- Search: () => Search$1,
3993
- Section: () => Section,
3994
- Select: () => Select,
3995
- Span: () => Span,
3996
- TBody: () => TBody,
3997
- THead: () => THead,
3998
- Table: () => Table,
3999
- Td: () => Td,
4000
- Text: () => Text,
4001
- TextArea: () => TextArea,
4002
- Tfoot: () => Tfoot,
4003
- Th: () => Th,
4004
- Time: () => Time,
4005
- Tr: () => Tr,
4006
- Ul: () => Ul,
4007
- Video: () => Video
4008
- });
4009
- var Audio = 0;
4010
- var Button = 1;
4011
- var Col = 2;
4012
- var ColGroup = 3;
4013
- var Div = 4;
4014
- var H1 = 5;
4015
- var Input = 6;
4016
- var Kbd = 7;
4017
- var Span = 8;
4018
- var Table = 9;
4019
- var TBody = 10;
4020
- var Td = 11;
4021
- var Text = 12;
4022
- var Th = 13;
4023
- var THead = 14;
4024
- var Tr = 15;
4025
- var I = 16;
4026
- var Img = 17;
4027
- var Root = 0;
4028
- var Ins = 20;
4029
- var Del = 21;
4030
- var H2 = 22;
4031
- var H3 = 23;
4032
- var H4 = 24;
4033
- var H5 = 25;
4034
- var H6 = 26;
4035
- var Article = 27;
4036
- var Aside = 28;
4037
- var Footer = 29;
4038
- var Header = 30;
4039
- var Nav = 40;
4040
- var Section = 41;
4041
- var Search$1 = 42;
4042
- var Dd = 43;
4043
- var Dl = 44;
4044
- var Figcaption = 45;
4045
- var Figure = 46;
4046
- var Hr = 47;
4047
- var Li = 48;
4048
- var Ol = 49;
4049
- var P = 50;
4050
- var Pre = 51;
4051
- var A = 53;
4052
- var Abbr = 54;
4053
- var Br = 55;
4054
- var Cite = 56;
4055
- var Data = 57;
4056
- var Time = 58;
4057
- var Tfoot = 59;
4058
- var Ul = 60;
4059
- var Video = 61;
4060
- var TextArea = 62;
4061
- var Select = 63;
4062
- var Option = 64;
4063
-
4064
- // src/parts/PatchType/PatchType.ts
4065
- var SetText = 1;
4066
- var SetAttribute = 3;
4067
- var RemoveAttribute = 4;
4068
- var Add = 6;
4069
- var NavigateChild = 7;
4070
- var NavigateParent = 8;
4071
- var RemoveChild = 9;
4072
- var NavigateSibling = 10;
4073
-
4074
- // src/parts/ApplyPendingPatches/ApplyPendingPatches.ts
4075
- var applyPendingPatches = (patches, pendingPatches, skip) => {
4076
- for (let k = 0; k < pendingPatches.length - skip; k += 2) {
4077
- const type = pendingPatches[k];
4078
- const index = pendingPatches[k + 1];
4079
- if (type === NavigateParent) {
4080
- patches.push({
4081
- type
4082
- });
4083
- } else {
4084
- patches.push({
4085
- type,
4086
- index
4087
- });
4088
- }
4089
- }
4090
- pendingPatches.length = 0;
4091
- };
4092
-
4093
- // src/parts/IsKey/IsKey.ts
4094
- var isKey = key => {
4095
- return key !== "type" && key !== "childCount";
4096
- };
4097
-
4098
- // src/parts/GetKeys/GetKeys.ts
4099
- var getKeys = node => {
4100
- const keys = Object.keys(node).filter(isKey);
4101
- return keys;
4102
- };
4103
-
4104
- // src/parts/GetTotalChildCount/GetTotalChildCount.ts
4105
- var getTotalChildCount = (nodes, index) => {
4106
- let i = index;
4107
- let pending = 1;
4108
- while (pending) {
4109
- const node = nodes[i];
4110
- pending += node.childCount;
4111
- pending--;
4112
- i++;
4113
- }
4114
- return i - index;
4115
- };
4116
-
4117
- // src/parts/VirtualDomDiff/VirtualDomDiff.ts
4118
- var diff = (oldNodes, newNodes) => {
4119
- const patches = [];
4120
- const pendingPatches = [];
4121
- let i = 0;
4122
- let j = 0;
4123
- let siblingOffset = 0;
4124
- let maxSiblingOffset = 1;
4125
- const indexStack = [0, 1];
4126
- while (i < oldNodes.length && j < newNodes.length) {
4127
- const oldNode = oldNodes[i];
4128
- const newNode = newNodes[j];
4129
- if (siblingOffset === maxSiblingOffset) {
4130
- indexStack.pop();
4131
- indexStack.pop();
4132
- pendingPatches.push(NavigateParent, 0);
4133
- maxSiblingOffset = indexStack.pop();
4134
- siblingOffset = indexStack.pop() + 1;
4135
- }
4136
- while (siblingOffset === maxSiblingOffset) {
4137
- pendingPatches.push(NavigateParent, 0);
4138
- maxSiblingOffset = indexStack.pop();
4139
- siblingOffset = indexStack.pop() + 1;
4140
- }
4141
- if (oldNode.type !== newNode.type) {
4142
- let skip = 0;
4143
- if (pendingPatches.length > 0 && pendingPatches.at(-2) === NavigateChild) {
4144
- skip = 2;
4145
- }
4146
- applyPendingPatches(patches, pendingPatches, skip);
4147
- const oldTotal = getTotalChildCount(oldNodes, i);
4148
- const newTotal = getTotalChildCount(newNodes, j);
4149
- patches.push({
4150
- type: RemoveChild,
4151
- index: siblingOffset
4152
- });
4153
- patches.push({
4154
- type: Add,
4155
- nodes: newNodes.slice(j, j + newTotal)
4156
- });
4157
- siblingOffset++;
4158
- i += oldTotal;
4159
- j += newTotal;
4160
- continue;
4161
- }
4162
- if (oldNode.type === Text && newNode.type === Text) {
4163
- if (oldNode.text !== newNode.text) {
4164
- if (siblingOffset !== 0) {
4165
- pendingPatches.push(NavigateSibling, siblingOffset);
4166
- }
4167
- applyPendingPatches(patches, pendingPatches, 0);
4168
- patches.push({
4169
- type: SetText,
4170
- value: newNode.text
4171
- });
4172
- }
4173
- i++;
4174
- j++;
4175
- siblingOffset++;
4176
- continue;
4177
- }
4178
- const oldKeys = getKeys(oldNode);
4179
- const newKeys = getKeys(newNode);
4180
- let hasAttributeChanges = false;
4181
- for (const key of newKeys) {
4182
- if (oldNode[key] !== newNode[key]) {
4183
- hasAttributeChanges = true;
4184
- break;
4185
- }
4186
- }
4187
- for (const key of oldKeys) {
4188
- if (!(key in newNode)) {
4189
- hasAttributeChanges = true;
4190
- break;
4191
- }
4192
- }
4193
- if (hasAttributeChanges) {
4194
- if (siblingOffset > 0) {
4195
- pendingPatches.push(NavigateSibling, siblingOffset);
4196
- }
4197
- applyPendingPatches(patches, pendingPatches, 0);
4198
- for (const key of newKeys) {
4199
- if (oldNode[key] !== newNode[key]) {
4200
- patches.push({
4201
- type: SetAttribute,
4202
- key,
4203
- value: newNode[key]
4204
- });
4205
- }
4206
- }
4207
- for (const key of oldKeys) {
4208
- if (!(key in newNode)) {
4209
- patches.push({
4210
- type: RemoveAttribute,
4211
- key
4212
- });
4213
- }
4214
- }
4215
- }
4216
- if (oldNode.childCount && newNode.childCount) {
4217
- maxSiblingOffset = oldNode.childCount;
4218
- indexStack.push(0, maxSiblingOffset);
4219
- pendingPatches.push(NavigateChild, 0);
4220
- i++;
4221
- j++;
4222
- continue;
4223
- }
4224
- if (oldNode.childCount) {
4225
- applyPendingPatches(patches, pendingPatches, 0);
4226
- for (let k = 0; k < oldNode.childCount; k++) {
4227
- patches.push({
4228
- type: RemoveChild,
4229
- index: 0
4230
- });
4231
- }
4232
- i += getTotalChildCount(oldNodes, i);
4233
- j++;
4234
- siblingOffset++;
4235
- continue;
4236
- }
4237
- if (newNode.childCount) {
4238
- applyPendingPatches(patches, pendingPatches, 0);
4239
- const total = getTotalChildCount(newNodes, j);
4240
- patches.push({
4241
- type: Add,
4242
- nodes: newNodes.slice(j + 1, j + total)
4243
- });
4244
- i++;
4245
- j += total;
4246
- continue;
4247
- }
4248
- i++;
4249
- j++;
4250
- siblingOffset++;
4251
- }
4252
- while (i < oldNodes.length) {
4253
- if (indexStack.length !== 2) {
4254
- patches.push({
4255
- type: NavigateParent
4256
- });
4257
- }
4258
- patches.push({
4259
- type: RemoveChild,
4260
- index: siblingOffset
4261
- });
4262
- i += getTotalChildCount(oldNodes, i);
4263
- indexStack.pop();
4264
- indexStack.pop();
4265
- }
4266
- while (j < newNodes.length) {
4267
- if (siblingOffset > 0) {
4268
- patches.push({
4269
- type: NavigateSibling,
4270
- index: siblingOffset
4271
- });
4272
- siblingOffset = 0;
4273
- }
4274
- const count = getTotalChildCount(newNodes, j);
4275
- patches.push({
4276
- type: Add,
4277
- nodes: newNodes.slice(j, j + count)
4278
- });
4279
- j += count;
4280
- }
4281
- return patches;
4282
- };
4283
-
4284
4334
  const getDom = state => {
4285
4335
  const displayResults = getDisplayResults(state.listItems, state.itemHeight, state.fileCount, state.value, state.minLineY, state.maxLineY, state.replacement, state.icons, state.listFocusedIndex, state.collapsedPaths, state.items);
4286
4336
  const focusOutline = state.listFocused && state.listFocusedIndex === -1;
@@ -4298,7 +4348,7 @@ const renderIncremental = uid => {
4298
4348
  } = get(uid);
4299
4349
  const oldDom = getDom(oldState);
4300
4350
  const newDom = getDom(newState);
4301
- const patches = diff(oldDom, newDom);
4351
+ const patches = diff$1(oldDom, newDom);
4302
4352
  return patches;
4303
4353
  };
4304
4354
 
@@ -4525,6 +4575,8 @@ const commandMap = {
4525
4575
  'TextSearch.copy': wrapCommand(copy),
4526
4576
  'TextSearch.dismissItem': wrapCommand(dismissItem),
4527
4577
  'TextSearch.focusFirst': wrapCommand(focusFirst),
4578
+ 'TextSearch.collapseDetails': wrapCommand(collapseDetails),
4579
+ 'TextSearch.expandDetails': wrapCommand(expandDetails),
4528
4580
  'TextSearch.focusIndex': wrapCommand(focusIndex),
4529
4581
  'TextSearch.focusLast': wrapCommand(focusLast),
4530
4582
  'TextSearch.focusMatchCase': wrapCommand(focusMatchCase$1),
@@ -4539,14 +4591,14 @@ const commandMap = {
4539
4591
  'TextSearch.focusPreviousInput': wrapCommand(focusPreviousInput),
4540
4592
  'TextSearch.focusPreviousPage': wrapCommand(focusPreviousPage),
4541
4593
  'TextSearch.focusRegex': wrapCommand(focusRegex),
4542
- 'TextSearch.getCommandIds': getCommandIds,
4543
4594
  'TextSearch.focusRegexNext': wrapCommand(focusRegexNext),
4544
4595
  'TextSearch.focusReplaceAll': wrapCommand(focusReplaceAll),
4545
4596
  'TextSearch.focusReplaceValue': wrapCommand(focusReplaceValue$1),
4546
4597
  'TextSearch.focusReplaceValueNext': wrapCommand(focusReplaceValueNext),
4547
4598
  'TextSearch.focusReplaceValuePrevious': wrapCommand(focusReplaceValuePrevious),
4548
- 'TextSearch.renderActions': wrapCommand(renderActions),
4549
4599
  'TextSearch.focusSearchValue': wrapCommand(focusSearchValue$1),
4600
+ 'TextSearch.getCommandIds': getCommandIds,
4601
+ 'TextSearch.renderActions': wrapCommand(renderActions),
4550
4602
  'TextSearch.focusSearchValueNext': wrapCommand(focusSearchValueNext),
4551
4603
  'TextSearch.getActions': wrapCommand(getActions),
4552
4604
  'TextSearch.getActionsVirtualDom': wrapCommand(getActionsVirtualDom),