@lvce-editor/file-search-worker 6.14.0 → 6.16.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.
@@ -2043,8 +2043,8 @@ const getListHeight = (itemsLength, itemHeight, maxHeight) => {
2043
2043
  return Math.min(totalHeight, maxHeight);
2044
2044
  };
2045
2045
 
2046
- const getColorThemeNames = async () => {
2047
- return invoke$1(/* Ajax.getJson */'ColorTheme.getColorThemeNames');
2046
+ const getColorThemeNames = async (assetDir, platform) => {
2047
+ return invoke$1('ColorTheme.getColorThemeNames', assetDir, platform);
2048
2048
  };
2049
2049
 
2050
2050
  const toProtoVisibleItem$3 = name => {
@@ -2059,8 +2059,13 @@ const toProtoVisibleItem$3 = name => {
2059
2059
  };
2060
2060
  return pick;
2061
2061
  };
2062
- const getPicks$c = async searchValue => {
2063
- const colorThemeNames = await getColorThemeNames();
2062
+ const getPicks$c = async (searchValue, args) => {
2063
+ if (!args || !Array.isArray(args)) {
2064
+ args = ['', 0];
2065
+ }
2066
+ const platform = args.at(-1);
2067
+ const assetDir = args.at(-2);
2068
+ const colorThemeNames = await getColorThemeNames(assetDir, platform);
2064
2069
  const picks = colorThemeNames.map(toProtoVisibleItem$3);
2065
2070
  return picks;
2066
2071
  };
@@ -2130,6 +2135,9 @@ const prefixIdWithExt = item => {
2130
2135
  };
2131
2136
  const getExtensionPicks = async (assetDir, platform) => {
2132
2137
  try {
2138
+ // TODO
2139
+ // Assert.string(assetDir)
2140
+ // Assert.number(platform)
2133
2141
  // TODO ask extension management worker directly
2134
2142
  // TODO don't call this every time, cache the results
2135
2143
  const extensionPicks = await invoke$1('ExtensionHost.getCommands', assetDir, platform);
@@ -2160,7 +2168,12 @@ const toProtoVisibleItem$2 = item => {
2160
2168
  // @ts-ignore
2161
2169
  return pick;
2162
2170
  };
2163
- const getPicks$b = async (value, args, assetDir, platform) => {
2171
+ const getPicks$b = async (value, args) => {
2172
+ if (!args || !Array.isArray(args)) {
2173
+ args = ['', 0];
2174
+ }
2175
+ const platform = args.at(-1);
2176
+ const assetDir = args.at(-2);
2164
2177
  // TODO get picks in parallel
2165
2178
  const builtinPicks = await getBuiltinPicks();
2166
2179
  const extensionPicks = await getExtensionPicks(assetDir, platform);
@@ -2710,9 +2723,7 @@ const selectPick = async item => {
2710
2723
  };
2711
2724
 
2712
2725
  const selectPicks = [selectPick$9, selectPick$8, selectPick$7, selectPick$6, selectPickGoToColumn, selectPick$5, selectPick$4, selectPick$3, selectPick$2, selectPick$1, selectPick];
2713
- const getPicks$2 = [getPicks$c,
2714
- // @ts-ignore TODO
2715
- getPicks$b, getPicks$a, getPicks$9, getPicksGoToColumn, getPicks$8, getPicks$7, getPicks$6, getPicks$5, getPicks$4, getPicks$3];
2726
+ const getPicks$2 = [getPicks$c, getPicks$b, getPicks$a, getPicks$9, getPicksGoToColumn, getPicks$8, getPicks$7, getPicks$6, getPicks$5, getPicks$4, getPicks$3];
2716
2727
 
2717
2728
  const select = selectPicks;
2718
2729
  const getPick$1 = getPicks$2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/file-search-worker",
3
- "version": "6.14.0",
3
+ "version": "6.16.0",
4
4
  "keywords": [
5
5
  "text-search"
6
6
  ],