@lvce-editor/extension-search-view 4.6.0 → 4.7.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.
@@ -1117,6 +1117,33 @@ const terminate = () => {
1117
1117
  globalThis.close();
1118
1118
  };
1119
1119
 
1120
+ const None$3 = 'none';
1121
+
1122
+ const Button$2 = 1;
1123
+ const Div = 4;
1124
+ const Input$1 = 6;
1125
+ const Text = 12;
1126
+ const Img = 17;
1127
+
1128
+ const Button$1 = 'event.button';
1129
+ const ClientX = 'event.clientX';
1130
+ const ClientY = 'event.clientY';
1131
+ const DeltaMode = 'event.deltaMode';
1132
+ const DeltaY = 'event.deltaY';
1133
+ const TargetValue = 'event.target.value';
1134
+
1135
+ const Script$1 = 2;
1136
+
1137
+ const LeftClick = 0;
1138
+
1139
+ const DebugWorker = 55;
1140
+ const ExtensionHostWorker = 44;
1141
+ const RendererWorker$1 = 1;
1142
+
1143
+ const None$2 = 0;
1144
+ const Input = 1;
1145
+ const List$2 = 2;
1146
+
1120
1147
  const handleError = async (error, notify = true, prefix = '') => {
1121
1148
  // @ts-ignore
1122
1149
  console.error(error);
@@ -1208,10 +1235,6 @@ const viewsAndMoreActions = () => {
1208
1235
  return i18nString(ViewsAndMoreActions);
1209
1236
  };
1210
1237
 
1211
- const None$3 = 0;
1212
- const Input$1 = 1;
1213
- const List$2 = 2;
1214
-
1215
1238
  const getFinalDeltaY = (height, itemHeight, itemsLength) => {
1216
1239
  const contentHeight = itemsLength * itemHeight;
1217
1240
  const finalDeltaY = Math.max(contentHeight - height, 0);
@@ -1387,7 +1410,7 @@ const handleInput = async (state, value, inputSource = User) => {
1387
1410
  allExtensions,
1388
1411
  deltaY: 0,
1389
1412
  finalDeltaY: 0,
1390
- focus: Input$1,
1413
+ focus: Input,
1391
1414
  items,
1392
1415
  maxLineY: 0,
1393
1416
  message: noExtensionsFound(),
@@ -1436,34 +1459,16 @@ const handleInput = async (state, value, inputSource = User) => {
1436
1459
  };
1437
1460
 
1438
1461
  const clearSearchResults = state => {
1439
- return handleInput(state, '');
1462
+ return handleInput({
1463
+ ...state,
1464
+ focus: Input
1465
+ }, '', Script$1);
1440
1466
  };
1441
1467
 
1442
1468
  const closeSuggest = state => {
1443
1469
  return state;
1444
1470
  };
1445
1471
 
1446
- const None$2 = 'none';
1447
-
1448
- const Button$2 = 1;
1449
- const Div = 4;
1450
- const Input = 6;
1451
- const Text = 12;
1452
- const Img = 17;
1453
-
1454
- const Button$1 = 'event.button';
1455
- const ClientX = 'event.clientX';
1456
- const ClientY = 'event.clientY';
1457
- const DeltaMode = 'event.deltaMode';
1458
- const DeltaY = 'event.deltaY';
1459
- const TargetValue = 'event.target.value';
1460
-
1461
- const LeftClick = 0;
1462
-
1463
- const DebugWorker = 55;
1464
- const ExtensionHostWorker = 44;
1465
- const RendererWorker$1 = 1;
1466
-
1467
1472
  const rpcs = Object.create(null);
1468
1473
  const set$5 = (id, rpc) => {
1469
1474
  rpcs[id] = rpc;
@@ -1970,7 +1975,8 @@ const {
1970
1975
  wrapCommand,
1971
1976
  getCommandIds,
1972
1977
  registerCommands,
1973
- wrapGetter
1978
+ wrapGetter,
1979
+ diff
1974
1980
  } = create$2();
1975
1981
 
1976
1982
  const create = (id, uri, x, y, width, height, platform, assetDir) => {
@@ -2036,18 +2042,7 @@ const modules = [isEqual$1, isEqual$2, isEqual, isEqual$2];
2036
2042
  const numbers = [RenderItems, RenderFocus, RenderSearchValue, RenderFocusContext];
2037
2043
 
2038
2044
  const diff2 = uid => {
2039
- const {
2040
- oldState,
2041
- newState
2042
- } = get(uid);
2043
- const diffResult = [];
2044
- for (let i = 0; i < modules.length; i++) {
2045
- const fn = modules[i];
2046
- if (!fn(oldState, newState)) {
2047
- diffResult.push(numbers[i]);
2048
- }
2049
- }
2050
- return diffResult;
2045
+ return diff(uid, modules, numbers);
2051
2046
  };
2052
2047
 
2053
2048
  const dispose = uid => {
@@ -2333,7 +2328,7 @@ const getMenuEntries = () => {
2333
2328
  const handleBlur = state => {
2334
2329
  return {
2335
2330
  ...state,
2336
- focus: None$3
2331
+ focus: None$2
2337
2332
  };
2338
2333
  };
2339
2334
 
@@ -2658,7 +2653,10 @@ const HandleTouchStart = 14;
2658
2653
  const HandleWheel = 15;
2659
2654
 
2660
2655
  const getInputActions = newState => {
2661
- const clearEnabled = newState.searchValue.length > 0;
2656
+ const {
2657
+ searchValue
2658
+ } = newState;
2659
+ const clearEnabled = searchValue.length > 0;
2662
2660
  const actions = [{
2663
2661
  onClick: HandleClearSearchResults,
2664
2662
  icon: `MaskIcon${ClearAll}`,
@@ -2830,7 +2828,7 @@ const loadContent = async (state, savedState) => {
2830
2828
  inputSource: Script,
2831
2829
  inputActions,
2832
2830
  deltaY
2833
- }, searchValue);
2831
+ }, searchValue, Script);
2834
2832
  return updatedState;
2835
2833
  };
2836
2834
 
@@ -2842,7 +2840,7 @@ const Extensions$1 = 'extensions';
2842
2840
 
2843
2841
  const getSelector = focus => {
2844
2842
  switch (focus) {
2845
- case Input$1:
2843
+ case Input:
2846
2844
  return `[name="${Extensions$1}"]`;
2847
2845
  case List$2:
2848
2846
  return '.ListItems';
@@ -2866,7 +2864,7 @@ const renderFocusContext = newState => {
2866
2864
  const {
2867
2865
  uid
2868
2866
  } = newState;
2869
- if (newState.focus === Input$1) {
2867
+ if (newState.focus === Input) {
2870
2868
  return ['Viewlet.setFocusContext', uid, FocusExtensionsInput];
2871
2869
  }
2872
2870
  if (newState.focus === List$2) {
@@ -2944,7 +2942,7 @@ const getSearchFieldVirtualDom = (name, placeholder, onInput, insideButtons, out
2944
2942
  role: None,
2945
2943
  childCount: 2
2946
2944
  }, {
2947
- type: Input,
2945
+ type: Input$1,
2948
2946
  inputType: 'search',
2949
2947
  className: MultilineInputBox,
2950
2948
  spellcheck: false,
@@ -3187,7 +3185,7 @@ const getExtensionsViewVirtualDom = state => {
3187
3185
  childCount: 2,
3188
3186
  ariaLive: 'polite',
3189
3187
  ariaBusy: false,
3190
- role: None$2
3188
+ role: None$3
3191
3189
  }, ...getExtensionHeaderVirtualDom(placeholder, inputActions), ...getContentVirtualDom(visibleExtensions, message, scrollBarHeight, scrollBarY)];
3192
3190
  };
3193
3191
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-search-view",
3
- "version": "4.6.0",
3
+ "version": "4.7.0",
4
4
  "description": "Extension Search View Worker",
5
5
  "repository": {
6
6
  "type": "git",