@lvce-editor/text-search-worker 6.5.0 → 6.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.
@@ -1270,9 +1270,79 @@ const ToolBar = 'toolbar';
1270
1270
  const Tree$1 = 'tree';
1271
1271
  const TreeItem$1 = 'treeitem';
1272
1272
 
1273
+ const Actions = 'Actions';
1274
+ const Badge = 'Badge';
1275
+ const Chevron = 'Chevron';
1276
+ const CloseMaskIcon = 'MaskIcon MaskIconClose';
1277
+ const Empty$1 = '';
1278
+ const FileIcon = 'FileIcon';
1279
+ const FocusOutline = 'FocusOutline';
1280
+ const Grow = 'Grow';
1281
+ const Highlight = 'Highlight';
1282
+ const HighlightDeleted = 'HighlightDeleted';
1283
+ const HighlightInserted = 'HighlightInserted';
1284
+ const IconButton = 'IconButton';
1285
+ const IconButtonDisabled = 'IconButtonDisabled';
1286
+ const Label = 'Label';
1287
+ const List$1 = 'List';
1288
+ const MaskIcon = 'MaskIcon';
1289
+ const MaskIconBook = 'MaskIconBook';
1290
+ const MaskIconCaseSensitive = 'MaskIconCaseSensitive';
1291
+ const MaskIconChevronDown = 'MaskIconChevronDown';
1292
+ const MaskIconChevronRight = 'MaskIconChevronRight';
1293
+ const MaskIconEllipsis = 'MaskIconEllipsis';
1294
+ const MaskIconExclude = 'MaskIconExclude';
1295
+ const MaskIconPreserveCase = 'MaskIconPreserveCase';
1296
+ const MaskIconRegex = 'MaskIconRegex';
1297
+ const MaskIconReplaceAll = 'MaskIconReplaceAll';
1298
+ const MaskIconWholeWord = 'MaskIconWholeWord';
1299
+ const MultilineInputBox = 'MultilineInputBox';
1300
+ const ScrollBar = 'ScrollBar';
1301
+ const ScrollBarThumb = 'ScrollBarThumb';
1302
+ const ScrollBarVertical = 'ScrollBarVertical';
1303
+ const Search$2 = 'Search';
1304
+ const SearchField = 'SearchField';
1305
+ const SearchFieldButton = 'SearchFieldButton';
1306
+ const SearchFieldButtonChecked = 'SearchFieldButtonChecked';
1307
+ const SearchFieldButtonDisabled = 'SearchFieldButtonDisabled';
1308
+ const SearchFieldButtons = 'SearchFieldButtons';
1309
+ const SearchFieldContainer = 'SearchFieldContainer';
1310
+ const SearchFieldError = 'SearchFieldError';
1311
+ const SearchHeader = 'SearchHeader';
1312
+ const SearchHeaderDetails = 'SearchHeaderDetails';
1313
+ const SearchHeaderDetailsExpanded = 'SearchHeaderDetailsExpanded';
1314
+ const SearchHeaderDetailsExpandedTop = 'SearchHeaderDetailsExpandedTop';
1315
+ const SearchHeaderDetailsHeading = 'SearchHeaderDetailsHeading';
1316
+ const SearchHeaderTop = 'SearchHeaderTop';
1317
+ const SearchHeaderTopRight = 'SearchHeaderTopRight';
1318
+ const SearchInputError = 'SearchInputError';
1319
+ const SearchRemove = 'SearchRemove';
1320
+ const SearchToggleButton = 'SearchToggleButton';
1321
+ const SearchToggleButtonExpanded = 'SearchToggleButtonExpanded';
1322
+ const SourceControlBadge = 'SourceControlBadge';
1323
+ const ToggleDetails = 'ToggleDetails';
1324
+ const Tree = 'Tree';
1325
+ const TreeItem = 'TreeItem';
1326
+ const TreeItemActive = 'TreeItemActive';
1327
+ const TreeItems$1 = 'TreeItems';
1328
+ const Viewlet = 'Viewlet';
1329
+ const ViewletSearchMessage = 'ViewletSearchMessage';
1330
+ const ViewletSearchMessageIndented = 'ViewletSearchMessageIndented';
1331
+
1273
1332
  const File$2 = 7;
1274
1333
 
1275
- const Button$2 = 'event.button';
1334
+ const Button$2 = 1;
1335
+ const Div = 4;
1336
+ const Span = 8;
1337
+ const Text = 12;
1338
+ const Img = 17;
1339
+ const Ins = 20;
1340
+ const Del = 21;
1341
+ const H4 = 24;
1342
+ const TextArea = 62;
1343
+ const Reference = 100;
1344
+
1345
+ const Button$1 = 'event.button';
1276
1346
  const ClientX = 'event.clientX';
1277
1347
  const ClientY = 'event.clientY';
1278
1348
  const DeltaMode = 'event.deltaMode';
@@ -1284,7 +1354,7 @@ const TargetValue = 'event.target.value';
1284
1354
 
1285
1355
  const Script$1 = 2;
1286
1356
 
1287
- const Search$2 = 18;
1357
+ const Search$1 = 18;
1288
1358
  const InputContextMenu = 91;
1289
1359
 
1290
1360
  const Separator = 1;
@@ -1308,7 +1378,22 @@ const SetFocusContext = 'Viewlet.setFocusContext';
1308
1378
  const SetValueByName = 'Viewlet.setValueByName';
1309
1379
  const SetPatches = 'Viewlet.setPatches';
1310
1380
 
1311
- const FocusSearch$1 = 1013;
1381
+ const Empty = 0;
1382
+ const FocusIgnoreFiles = 1012;
1383
+ const FocusSearch = 1013;
1384
+ const FocusSearchExcludeInput = 1008;
1385
+ const FocusSearchIncludeInput = 1007;
1386
+ const FocusSearchInput = 21;
1387
+ const FocusSearchMatchCase = 32;
1388
+ const FocusSearchOpenEditors = 1011;
1389
+ const FocusSearchPreserveCase = 36;
1390
+ const FocusSearchRegex = 33;
1391
+ const FocusSearchReplaceAll = 35;
1392
+ const FocusSearchReplaceInput = 31;
1393
+ const FocusSearchResults = 22;
1394
+ const FocusSearchWholeWord = 34;
1395
+ const FocusToggleDetails = 1010;
1396
+ const FocusToggleReplace = 1020;
1312
1397
 
1313
1398
  const {
1314
1399
  invoke: invoke$2,
@@ -1476,93 +1561,6 @@ const terminate = () => {
1476
1561
  globalThis.close();
1477
1562
  };
1478
1563
 
1479
- const Actions = 'Actions';
1480
- const Badge = 'Badge';
1481
- const Chevron = 'Chevron';
1482
- const CloseMaskIcon = 'MaskIcon MaskIconClose';
1483
- const Empty$1 = '';
1484
- const FileIcon = 'FileIcon';
1485
- const FocusOutline = 'FocusOutline';
1486
- const Grow = 'Grow';
1487
- const Highlight = 'Highlight';
1488
- const HighlightDeleted = 'HighlightDeleted';
1489
- const HighlightInserted = 'HighlightInserted';
1490
- const IconButton = 'IconButton';
1491
- const IconButtonDisabled = 'IconButtonDisabled';
1492
- const Label = 'Label';
1493
- const List$1 = 'List';
1494
- const MaskIcon = 'MaskIcon';
1495
- const MaskIconBook = 'MaskIconBook';
1496
- const MaskIconCaseSensitive = 'MaskIconCaseSensitive';
1497
- const MaskIconChevronDown = 'MaskIconChevronDown';
1498
- const MaskIconChevronRight = 'MaskIconChevronRight';
1499
- const MaskIconEllipsis = 'MaskIconEllipsis';
1500
- const MaskIconExclude = 'MaskIconExclude';
1501
- const MaskIconPreserveCase = 'MaskIconPreserveCase';
1502
- const MaskIconRegex = 'MaskIconRegex';
1503
- const MaskIconReplaceAll = 'MaskIconReplaceAll';
1504
- const MaskIconWholeWord = 'MaskIconWholeWord';
1505
- const MultilineInputBox = 'MultilineInputBox';
1506
- const ScrollBar = 'ScrollBar';
1507
- const ScrollBarThumb = 'ScrollBarThumb';
1508
- const ScrollBarVertical = 'ScrollBarVertical';
1509
- const Search$1 = 'Search';
1510
- const SearchField = 'SearchField';
1511
- const SearchFieldButton = 'SearchFieldButton';
1512
- const SearchFieldButtonChecked = 'SearchFieldButtonChecked';
1513
- const SearchFieldButtonDisabled = 'SearchFieldButtonDisabled';
1514
- const SearchFieldButtons = 'SearchFieldButtons';
1515
- const SearchFieldContainer = 'SearchFieldContainer';
1516
- const SearchFieldError = 'SearchFieldError';
1517
- const SearchHeader = 'SearchHeader';
1518
- const SearchHeaderDetails = 'SearchHeaderDetails';
1519
- const SearchHeaderDetailsExpanded = 'SearchHeaderDetailsExpanded';
1520
- const SearchHeaderDetailsExpandedTop = 'SearchHeaderDetailsExpandedTop';
1521
- const SearchHeaderDetailsHeading = 'SearchHeaderDetailsHeading';
1522
- const SearchHeaderTop = 'SearchHeaderTop';
1523
- const SearchHeaderTopRight = 'SearchHeaderTopRight';
1524
- const SearchInputError = 'SearchInputError';
1525
- const SearchRemove = 'SearchRemove';
1526
- const SearchToggleButton = 'SearchToggleButton';
1527
- const SearchToggleButtonExpanded = 'SearchToggleButtonExpanded';
1528
- const SourceControlBadge = 'SourceControlBadge';
1529
- const ToggleDetails = 'ToggleDetails';
1530
- const Tree = 'Tree';
1531
- const TreeItem = 'TreeItem';
1532
- const TreeItemActive = 'TreeItemActive';
1533
- const TreeItems$1 = 'TreeItems';
1534
- const Viewlet = 'Viewlet';
1535
- const ViewletSearchMessage = 'ViewletSearchMessage';
1536
- const ViewletSearchMessageIndented = 'ViewletSearchMessageIndented';
1537
-
1538
- const Button$1 = 1;
1539
- const Div = 4;
1540
- const Span = 8;
1541
- const Text = 12;
1542
- const Img = 17;
1543
- const Ins = 20;
1544
- const Del = 21;
1545
- const H4 = 24;
1546
- const TextArea = 62;
1547
- const Reference = 100;
1548
-
1549
- const Empty = 0;
1550
- const FocusIgnoreFiles = 1012;
1551
- const FocusSearch = 1013;
1552
- const FocusSearchExcludeInput = 1008;
1553
- const FocusSearchIncludeInput = 1007;
1554
- const FocusSearchInput = 21;
1555
- const FocusSearchMatchCase = 32;
1556
- const FocusSearchOpenEditors = 1011;
1557
- const FocusSearchPreserveCase = 36;
1558
- const FocusSearchRegex = 33;
1559
- const FocusSearchReplaceAll = 35;
1560
- const FocusSearchReplaceInput = 31;
1561
- const FocusSearchResults = 22;
1562
- const FocusSearchWholeWord = 34;
1563
- const FocusToggleDetails = 1010;
1564
- const FocusToggleReplace = 1020;
1565
-
1566
1564
  const mergeClassNames = (...classNames) => {
1567
1565
  return classNames.filter(Boolean).join(' ');
1568
1566
  };
@@ -3064,17 +3062,18 @@ const getMenuEntriesList = (state, props) => {
3064
3062
  };
3065
3063
 
3066
3064
  const getMenuEntries = (state, props) => {
3067
- if (props.menuId === Search$2) {
3068
- return getMenuEntriesList(state, props);
3069
- }
3070
- if (props.menuId === InputContextMenu) {
3071
- return getMenuEntriesInput(props);
3065
+ switch (props.menuId) {
3066
+ case InputContextMenu:
3067
+ return getMenuEntriesInput(props);
3068
+ case Search$1:
3069
+ return getMenuEntriesList(state, props);
3070
+ default:
3071
+ return [];
3072
3072
  }
3073
- return [];
3074
3073
  };
3075
3074
 
3076
3075
  const getMenuEntryIds = () => {
3077
- return [Search$2, InputContextMenu];
3076
+ return [Search$1, InputContextMenu];
3078
3077
  };
3079
3078
 
3080
3079
  const ClearAll$1 = 'ClearAll';
@@ -3633,10 +3632,6 @@ const getReplacedMessage = (fileCount, replaceCount, replacement) => {
3633
3632
  };
3634
3633
 
3635
3634
  const getReplaceElements = (items, workspacePath, replacement) => {
3636
- let element = {
3637
- changes: [],
3638
- uri: ''
3639
- };
3640
3635
  const bulkChanges = [];
3641
3636
  let changes = [];
3642
3637
  // TODO simplify code by first matching files with their elements, then creating bulk edits
@@ -3652,11 +3647,10 @@ const getReplaceElements = (items, workspacePath, replacement) => {
3652
3647
  changes = [];
3653
3648
  const fileName = getFilePath(text);
3654
3649
  const absolutePath = `${workspacePath}/${fileName}`;
3655
- element = {
3650
+ bulkChanges.push({
3656
3651
  changes,
3657
3652
  uri: absolutePath
3658
- };
3659
- bulkChanges.push(element);
3653
+ });
3660
3654
  } else {
3661
3655
  changes.push({
3662
3656
  endColumnIndex: end,
@@ -5255,7 +5249,7 @@ const renderFocus = (oldState, newState) => {
5255
5249
  };
5256
5250
 
5257
5251
  const renderFocusContext = (oldState, newState) => {
5258
- return [SetFocusContext, newState.uid, FocusSearch$1, newState.focus];
5252
+ return [SetFocusContext, newState.uid, FocusSearch, newState.focus];
5259
5253
  };
5260
5254
 
5261
5255
  const HandleClick = 1;
@@ -5290,7 +5284,7 @@ const getSearchDetailsToggleVirtualDom = () => {
5290
5284
  role: Button$3,
5291
5285
  tabIndex: 0,
5292
5286
  title: toggleSearchDetails(),
5293
- type: Button$1
5287
+ type: Button$2
5294
5288
  }, {
5295
5289
  childCount: 0,
5296
5290
  className: mergeClassNames(MaskIcon, MaskIconEllipsis),
@@ -5410,7 +5404,7 @@ const getSearchFieldButtonVirtualDom = button => {
5410
5404
  role,
5411
5405
  tabIndex: 0,
5412
5406
  title,
5413
- type: Button$1
5407
+ type: Button$2
5414
5408
  }, {
5415
5409
  childCount: 0,
5416
5410
  className: mergeClassNames(MaskIcon, icon),
@@ -5504,11 +5498,7 @@ const SearchWarningMessage = 'SearchWarningMessage';
5504
5498
 
5505
5499
  const getSearchHeaderLimitHitVirtualDom = limitHitWarning => {
5506
5500
  if (!limitHitWarning) {
5507
- // TODO remove unused dom node
5508
- return [{
5509
- childCount: 0,
5510
- type: Div
5511
- }];
5501
+ return [];
5512
5502
  }
5513
5503
  const dom = [{
5514
5504
  childCount: 1,
@@ -5587,7 +5577,7 @@ const getSearchToggleVirtualDom = replaceExpanded => {
5587
5577
  name: ToggleReplace,
5588
5578
  onClick: HandleButtonClick,
5589
5579
  title: toggleReplace$1(),
5590
- type: Button$1
5580
+ type: Button$2
5591
5581
  }, {
5592
5582
  childCount: 0,
5593
5583
  className: mergeClassNames(MaskIcon, replaceExpanded ? MaskIconChevronDown : MaskIconChevronRight),
@@ -5618,15 +5608,16 @@ const getSearchHeaderTopVirtualDom = (flags, searchInputErrorMessage, matchCount
5618
5608
  return dom;
5619
5609
  };
5620
5610
 
5621
- const parentNode = {
5622
- childCount: 3,
5623
- className: SearchHeader,
5624
- onContextMenu: HandleHeaderContextMenu,
5625
- role: None$2,
5626
- type: Div
5627
- };
5628
5611
  const getSearchHeaderVirtualDom = (flags, message, searchInputErrorMessage, matchCount, focus, limitHitWarning) => {
5629
- const dom = [parentNode, ...getSearchHeaderTopVirtualDom(flags, searchInputErrorMessage, matchCount, focus), ...getSearchHeaderDetailsVirtualDom(flags, message), ...getSearchHeaderLimitHitVirtualDom(limitHitWarning)];
5612
+ const warningDom = getSearchHeaderLimitHitVirtualDom(limitHitWarning);
5613
+ const parentNode = {
5614
+ childCount: 2 + (warningDom.length > 0 ? 1 : 0),
5615
+ className: SearchHeader,
5616
+ onContextMenu: HandleHeaderContextMenu,
5617
+ role: None$2,
5618
+ type: Div
5619
+ };
5620
+ const dom = [parentNode, ...getSearchHeaderTopVirtualDom(flags, searchInputErrorMessage, matchCount, focus), ...getSearchHeaderDetailsVirtualDom(flags, message), ...warningDom];
5630
5621
  return dom;
5631
5622
  };
5632
5623
 
@@ -5799,7 +5790,7 @@ const getSearchRemoveVirtualDom = () => {
5799
5790
  className: SearchRemove,
5800
5791
  name: Remove,
5801
5792
  title,
5802
- type: Button$1
5793
+ type: Button$2
5803
5794
  }, closeIcon];
5804
5795
  return dom;
5805
5796
  };
@@ -5875,7 +5866,7 @@ const getSearchResultsVirtualDom = (visibleItems, focusOutline, scrollbarHeight,
5875
5866
  }, ...getTreeItemsVirtualDom(visibleItems, deltaY, itemHeight), ...getScrollBarVirtualDom(scrollbarHeight, scrollBarY, scrollBarValue)];
5876
5867
  };
5877
5868
 
5878
- const className = mergeClassNames(Viewlet, Search$1);
5869
+ const className = mergeClassNames(Viewlet, Search$2);
5879
5870
  const getSearchVirtualDom = (visibleItems, flags, message, focusOutline, searchInputErrorMessage, scrollBarHeight, scrollBarY, scrollBarValue, deltaY, itemHeight, matchCount, limitHitWarning, focus = 0, initial = false) => {
5880
5871
  if (initial) {
5881
5872
  return [];
@@ -5997,7 +5988,7 @@ const getActionButtonVirtualDom = action => {
5997
5988
  className,
5998
5989
  name: id,
5999
5990
  title: label,
6000
- type: Button$1
5991
+ type: Button$2
6001
5992
  }, getIconVirtualDom(icon)];
6002
5993
  };
6003
5994
 
@@ -6094,7 +6085,7 @@ const renderEventListeners = () => {
6094
6085
  params: ['handleClickAt', ClientX, ClientY, TargetName]
6095
6086
  }, {
6096
6087
  name: HandleListPointerDown,
6097
- params: ['handleListPointerDown', Button$2, TargetName]
6088
+ params: ['handleListPointerDown', Button$1, TargetName]
6098
6089
  }, {
6099
6090
  name: HandleToggleButtonClick,
6100
6091
  params: ['handleToggleButtonClick']
@@ -6106,11 +6097,11 @@ const renderEventListeners = () => {
6106
6097
  params: ['handleListBlur']
6107
6098
  }, {
6108
6099
  name: HandleListContextMenu,
6109
- params: ['handleContextMenu', Button$2, ClientX, ClientY],
6100
+ params: ['handleContextMenu', Button$1, ClientX, ClientY],
6110
6101
  preventDefault: true
6111
6102
  }, {
6112
6103
  name: HandleInputContextMenu,
6113
- params: ['handleInputContextMenu', TargetName, Button$2, ClientX, ClientY],
6104
+ params: ['handleInputContextMenu', TargetName, Button$1, ClientX, ClientY],
6114
6105
  preventDefault: true
6115
6106
  }, {
6116
6107
  name: HandleActionClick,
@@ -6321,10 +6312,10 @@ const handleContextMenuKeyboard = async state => {
6321
6312
  x,
6322
6313
  y
6323
6314
  } = state; // TODO
6324
- await show2(uid, Search$2, x, y, {
6315
+ await show2(uid, Search$1, x, y, {
6325
6316
  index: 0,
6326
6317
  // TODO pass proper index
6327
- menuId: Search$2
6318
+ menuId: Search$1
6328
6319
  });
6329
6320
  return state;
6330
6321
  };
@@ -6349,9 +6340,9 @@ const handleContextMenuMouseAt = async (state, eventX, eventY) => {
6349
6340
  focusedIndex: index,
6350
6341
  listFocusedIndex: index
6351
6342
  });
6352
- await show2(uid, Search$2, x, y, {
6343
+ await show2(uid, Search$1, x, y, {
6353
6344
  index,
6354
- menuId: Search$2
6345
+ menuId: Search$1
6355
6346
  });
6356
6347
  return state;
6357
6348
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/text-search-worker",
3
- "version": "6.5.0",
3
+ "version": "6.7.0",
4
4
  "description": "Text Search Worker",
5
5
  "keywords": [
6
6
  "text-search"