@univerjs/find-replace 1.3.1 → 1.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/lib/cjs/index.js +29 -56
- package/lib/cjs/locale/ar-SA.js +1 -2
- package/lib/cjs/locale/ca-ES.js +1 -2
- package/lib/cjs/locale/de-DE.js +1 -2
- package/lib/cjs/locale/en-US.js +1 -2
- package/lib/cjs/locale/es-ES.js +1 -2
- package/lib/cjs/locale/fa-IR.js +1 -2
- package/lib/cjs/locale/fr-FR.js +1 -2
- package/lib/cjs/locale/id-ID.js +1 -2
- package/lib/cjs/locale/it-IT.js +1 -2
- package/lib/cjs/locale/ja-JP.js +1 -2
- package/lib/cjs/locale/ko-KR.js +1 -2
- package/lib/cjs/locale/pl-PL.js +1 -2
- package/lib/cjs/locale/pt-BR.js +1 -2
- package/lib/cjs/locale/ru-RU.js +1 -2
- package/lib/cjs/locale/sk-SK.js +1 -2
- package/lib/cjs/locale/vi-VN.js +1 -2
- package/lib/cjs/locale/zh-CN.js +1 -2
- package/lib/cjs/locale/zh-HK.js +1 -2
- package/lib/cjs/locale/zh-TW.js +1 -2
- package/lib/es/index.js +29 -56
- package/lib/es/locale/ar-SA.js +1 -2
- package/lib/es/locale/ca-ES.js +1 -2
- package/lib/es/locale/de-DE.js +1 -2
- package/lib/es/locale/en-US.js +1 -2
- package/lib/es/locale/es-ES.js +1 -2
- package/lib/es/locale/fa-IR.js +1 -2
- package/lib/es/locale/fr-FR.js +1 -2
- package/lib/es/locale/id-ID.js +1 -2
- package/lib/es/locale/it-IT.js +1 -2
- package/lib/es/locale/ja-JP.js +1 -2
- package/lib/es/locale/ko-KR.js +1 -2
- package/lib/es/locale/pl-PL.js +1 -2
- package/lib/es/locale/pt-BR.js +1 -2
- package/lib/es/locale/ru-RU.js +1 -2
- package/lib/es/locale/sk-SK.js +1 -2
- package/lib/es/locale/vi-VN.js +1 -2
- package/lib/es/locale/zh-CN.js +1 -2
- package/lib/es/locale/zh-HK.js +1 -2
- package/lib/es/locale/zh-TW.js +1 -2
- package/lib/index.js +29 -56
- package/lib/locale/ar-SA.js +1 -2
- package/lib/locale/ca-ES.js +1 -2
- package/lib/locale/de-DE.js +1 -2
- package/lib/locale/en-US.js +1 -2
- package/lib/locale/es-ES.js +1 -2
- package/lib/locale/fa-IR.js +1 -2
- package/lib/locale/fr-FR.js +1 -2
- package/lib/locale/id-ID.js +1 -2
- package/lib/locale/it-IT.js +1 -2
- package/lib/locale/ja-JP.js +1 -2
- package/lib/locale/ko-KR.js +1 -2
- package/lib/locale/pl-PL.js +1 -2
- package/lib/locale/pt-BR.js +1 -2
- package/lib/locale/ru-RU.js +1 -2
- package/lib/locale/sk-SK.js +1 -2
- package/lib/locale/vi-VN.js +1 -2
- package/lib/locale/zh-CN.js +1 -2
- package/lib/locale/zh-HK.js +1 -2
- package/lib/locale/zh-TW.js +1 -2
- package/lib/types/services/find-replace.service.d.ts +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +12 -12
package/lib/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { ArrowDownIcon, ArrowUpIcon, CloseIcon, ConfigureTabIcon, SearchIcon } f
|
|
|
7
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// src/services/context-keys.ts
|
|
11
11
|
/**
|
|
12
12
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
13
13
|
*
|
|
@@ -35,8 +35,7 @@ const FIND_REPLACE_REPLACE_REVEALED = "FIND_REPLACE_REPLACE_REVEALED";
|
|
|
35
35
|
/** If the focused unit has a find-replace provider. */
|
|
36
36
|
const FIND_REPLACE_AVAILABLE = "FIND_REPLACE_AVAILABLE";
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
|
|
38
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/typeof.js
|
|
40
39
|
function _typeof(o) {
|
|
41
40
|
"@babel/helpers - typeof";
|
|
42
41
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -46,8 +45,7 @@ function _typeof(o) {
|
|
|
46
45
|
}, _typeof(o);
|
|
47
46
|
}
|
|
48
47
|
|
|
49
|
-
|
|
50
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
|
|
48
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/toPrimitive.js
|
|
51
49
|
function toPrimitive(t, r) {
|
|
52
50
|
if ("object" != _typeof(t) || !t) return t;
|
|
53
51
|
var e = t[Symbol.toPrimitive];
|
|
@@ -59,15 +57,13 @@ function toPrimitive(t, r) {
|
|
|
59
57
|
return ("string" === r ? String : Number)(t);
|
|
60
58
|
}
|
|
61
59
|
|
|
62
|
-
|
|
63
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
|
|
60
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/toPropertyKey.js
|
|
64
61
|
function toPropertyKey(t) {
|
|
65
62
|
var i = toPrimitive(t, "string");
|
|
66
63
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
67
64
|
}
|
|
68
65
|
|
|
69
|
-
|
|
70
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
|
|
66
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/defineProperty.js
|
|
71
67
|
function _defineProperty(e, r, t) {
|
|
72
68
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
73
69
|
value: t,
|
|
@@ -77,16 +73,14 @@ function _defineProperty(e, r, t) {
|
|
|
77
73
|
}) : e[r] = t, e;
|
|
78
74
|
}
|
|
79
75
|
|
|
80
|
-
|
|
81
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateParam.js
|
|
76
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/decorateParam.js
|
|
82
77
|
function __decorateParam(paramIndex, decorator) {
|
|
83
78
|
return function(target, key) {
|
|
84
79
|
decorator(target, key, paramIndex);
|
|
85
80
|
};
|
|
86
81
|
}
|
|
87
82
|
|
|
88
|
-
|
|
89
|
-
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
|
|
83
|
+
// \0@oxc-project+runtime@0.156.0/helpers/esm/decorate.js
|
|
90
84
|
function __decorate(decorators, target, key, desc) {
|
|
91
85
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
92
86
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -94,8 +88,7 @@ function __decorate(decorators, target, key, desc) {
|
|
|
94
88
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
95
89
|
}
|
|
96
90
|
|
|
97
|
-
|
|
98
|
-
//#region src/services/find-replace.service.ts
|
|
91
|
+
// src/services/find-replace.service.ts
|
|
99
92
|
var FindModel = class extends Disposable {};
|
|
100
93
|
const IFindReplaceService = createIdentifier("find-replace.service");
|
|
101
94
|
/**
|
|
@@ -209,7 +202,7 @@ let FindReplaceModel = class FindReplaceModel extends Disposable {
|
|
|
209
202
|
}
|
|
210
203
|
_subscribeToModelsChanges(models) {
|
|
211
204
|
const disposables = this._currentSearchingDisposables = new DisposableCollection();
|
|
212
|
-
const matchesUpdateSubscription = combineLatest(models.map((model) => model.matchesUpdate$)).pipe(debounceTime(220)).subscribe(([
|
|
205
|
+
const matchesUpdateSubscription = combineLatest(models.map((model) => model.matchesUpdate$)).pipe(debounceTime(220)).subscribe(([...allMatches]) => {
|
|
213
206
|
const newMatches = this._matches = allMatches.flat();
|
|
214
207
|
if (newMatches.length) {
|
|
215
208
|
this._moveToInitialMatch(this._findModels, true);
|
|
@@ -715,8 +708,7 @@ FindReplaceService = __decorate([
|
|
|
715
708
|
__decorateParam(2, IUniverInstanceService)
|
|
716
709
|
], FindReplaceService);
|
|
717
710
|
|
|
718
|
-
|
|
719
|
-
//#region src/commands/commands/replace.command.ts
|
|
711
|
+
// src/commands/commands/replace.command.ts
|
|
720
712
|
const ReplaceCurrentMatchCommand = {
|
|
721
713
|
id: "ui.command.replace-current-match",
|
|
722
714
|
type: CommandType.COMMAND,
|
|
@@ -758,8 +750,7 @@ const ReplaceAllMatchesCommand = {
|
|
|
758
750
|
}
|
|
759
751
|
};
|
|
760
752
|
|
|
761
|
-
|
|
762
|
-
//#region src/commands/operations/find-replace.operation.ts
|
|
753
|
+
// src/commands/operations/find-replace.operation.ts
|
|
763
754
|
const OpenFindDialogOperation = {
|
|
764
755
|
id: "ui.operation.open-find-dialog",
|
|
765
756
|
type: CommandType.OPERATION,
|
|
@@ -814,8 +805,7 @@ const FocusSelectionOperation = {
|
|
|
814
805
|
}
|
|
815
806
|
};
|
|
816
807
|
|
|
817
|
-
|
|
818
|
-
//#region src/menu/find-replace.menu.ts
|
|
808
|
+
// src/menu/find-replace.menu.ts
|
|
819
809
|
function FindReplaceMenuItemFactory(accessor) {
|
|
820
810
|
const contextService = accessor.get(IContextService);
|
|
821
811
|
return {
|
|
@@ -832,8 +822,7 @@ function FindReplaceMenuItemFactory(accessor) {
|
|
|
832
822
|
};
|
|
833
823
|
}
|
|
834
824
|
|
|
835
|
-
|
|
836
|
-
//#region src/menu/schema.ts
|
|
825
|
+
// src/menu/schema.ts
|
|
837
826
|
const menuSchema = { [RibbonDataGroup.OTHERS]: { [OpenFindDialogOperation.id]: {
|
|
838
827
|
order: 0,
|
|
839
828
|
gridLayout: {
|
|
@@ -846,8 +835,7 @@ const menuSchema = { [RibbonDataGroup.OTHERS]: { [OpenFindDialogOperation.id]: {
|
|
|
846
835
|
menuItemFactory: FindReplaceMenuItemFactory
|
|
847
836
|
} } };
|
|
848
837
|
|
|
849
|
-
|
|
850
|
-
//#region src/controllers/find-replace.shortcut.ts
|
|
838
|
+
// src/controllers/find-replace.shortcut.ts
|
|
851
839
|
function whenFindReplaceDialogFocused(contextService) {
|
|
852
840
|
return contextService.getContextValue(FIND_REPLACE_DIALOG_FOCUS);
|
|
853
841
|
}
|
|
@@ -928,8 +916,7 @@ const FocusSelectionShortcutItem = {
|
|
|
928
916
|
}
|
|
929
917
|
};
|
|
930
918
|
|
|
931
|
-
|
|
932
|
-
//#region src/controllers/find-replace.controller.ts
|
|
919
|
+
// src/controllers/find-replace.controller.ts
|
|
933
920
|
const FIND_REPLACE_DIALOG_ID = "DESKTOP_FIND_REPLACE_DIALOG";
|
|
934
921
|
const FIND_REPLACE_PANEL_WIDTH = 350;
|
|
935
922
|
const FIND_REPLACE_PANEL_HORIZONTAL_PADDING = 20;
|
|
@@ -1036,19 +1023,16 @@ function getFindReplaceDialogDefaultPosition(direction) {
|
|
|
1036
1023
|
};
|
|
1037
1024
|
}
|
|
1038
1025
|
|
|
1039
|
-
|
|
1040
|
-
//#region package.json
|
|
1026
|
+
// package.json
|
|
1041
1027
|
var name = "@univerjs/find-replace";
|
|
1042
|
-
var version = "1.
|
|
1028
|
+
var version = "1.4.0";
|
|
1043
1029
|
|
|
1044
|
-
|
|
1045
|
-
//#region src/config/config.ts
|
|
1030
|
+
// src/config/config.ts
|
|
1046
1031
|
const FIND_REPLACE_PLUGIN_CONFIG_KEY = "find-replace.config";
|
|
1047
1032
|
const configSymbol = Symbol(FIND_REPLACE_PLUGIN_CONFIG_KEY);
|
|
1048
1033
|
const defaultPluginConfig = {};
|
|
1049
1034
|
|
|
1050
|
-
|
|
1051
|
-
//#region src/const.ts
|
|
1035
|
+
// src/const.ts
|
|
1052
1036
|
/**
|
|
1053
1037
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1054
1038
|
*
|
|
@@ -1067,8 +1051,7 @@ const defaultPluginConfig = {};
|
|
|
1067
1051
|
const MOBILE_FIND_REPLACE_SETTINGS_COMPONENT = "MobileFindReplaceSettings";
|
|
1068
1052
|
const MOBILE_FIND_REPLACE_SETTINGS_DIALOG_ID = "MOBILE_FIND_REPLACE_SETTINGS_DIALOG";
|
|
1069
1053
|
|
|
1070
|
-
|
|
1071
|
-
//#region src/views/mobile/MobileFindReplaceSettings.tsx
|
|
1054
|
+
// src/views/mobile/MobileFindReplaceSettings.tsx
|
|
1072
1055
|
const FIND_SCOPE_OPTIONS$1 = [{
|
|
1073
1056
|
label: "find-replace.dialog.find-scope.current-sheet",
|
|
1074
1057
|
value: "subunit"
|
|
@@ -1198,8 +1181,7 @@ function SettingCheckbox(props) {
|
|
|
1198
1181
|
});
|
|
1199
1182
|
}
|
|
1200
1183
|
|
|
1201
|
-
|
|
1202
|
-
//#region src/controllers/mobile/components.controller.ts
|
|
1184
|
+
// src/controllers/mobile/components.controller.ts
|
|
1203
1185
|
/**
|
|
1204
1186
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1205
1187
|
*
|
|
@@ -1224,15 +1206,13 @@ let MobileComponentsController = class MobileComponentsController extends Dispos
|
|
|
1224
1206
|
};
|
|
1225
1207
|
MobileComponentsController = __decorate([__decorateParam(0, Inject(ComponentManager)), __decorateParam(1, Inject(IconManager))], MobileComponentsController);
|
|
1226
1208
|
|
|
1227
|
-
|
|
1228
|
-
//#region src/menu/mobile-schema.ts
|
|
1209
|
+
// src/menu/mobile-schema.ts
|
|
1229
1210
|
const mobileMenuSchema = { [RibbonDataGroup.ORGANIZATION]: { [OpenFindDialogOperation.id]: {
|
|
1230
1211
|
order: 2,
|
|
1231
1212
|
menuItemFactory: FindReplaceMenuItemFactory
|
|
1232
1213
|
} } };
|
|
1233
1214
|
|
|
1234
|
-
|
|
1235
|
-
//#region src/views/mobile/MobileFindReplaceBar.tsx
|
|
1215
|
+
// src/views/mobile/MobileFindReplaceBar.tsx
|
|
1236
1216
|
const SEARCH_DEBOUNCE_TIME = 500;
|
|
1237
1217
|
function MobileFindReplaceBar() {
|
|
1238
1218
|
const findReplaceService = useDependency(IFindReplaceService);
|
|
@@ -1437,8 +1417,7 @@ function ActionButton(props) {
|
|
|
1437
1417
|
});
|
|
1438
1418
|
}
|
|
1439
1419
|
|
|
1440
|
-
|
|
1441
|
-
//#region src/controllers/mobile/find-replace.controller.ts
|
|
1420
|
+
// src/controllers/mobile/find-replace.controller.ts
|
|
1442
1421
|
/**
|
|
1443
1422
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1444
1423
|
*
|
|
@@ -1494,8 +1473,7 @@ FindReplaceMobileController = __decorate([
|
|
|
1494
1473
|
__decorateParam(6, IUIPartsService)
|
|
1495
1474
|
], FindReplaceMobileController);
|
|
1496
1475
|
|
|
1497
|
-
|
|
1498
|
-
//#region src/mobile-plugin.ts
|
|
1476
|
+
// src/mobile-plugin.ts
|
|
1499
1477
|
let UniverFindReplaceMobileUIPlugin = class UniverFindReplaceMobileUIPlugin extends Plugin {
|
|
1500
1478
|
constructor(_config = defaultPluginConfig, _injector, _configService) {
|
|
1501
1479
|
super();
|
|
@@ -1523,8 +1501,7 @@ UniverFindReplaceMobileUIPlugin = __decorate([
|
|
|
1523
1501
|
__decorateParam(2, IConfigService)
|
|
1524
1502
|
], UniverFindReplaceMobileUIPlugin);
|
|
1525
1503
|
|
|
1526
|
-
|
|
1527
|
-
//#region src/views/dialog/SearchInput.tsx
|
|
1504
|
+
// src/views/dialog/SearchInput.tsx
|
|
1528
1505
|
function SearchInput(props) {
|
|
1529
1506
|
const { findCompleted: findComplete, matchesCount, matchesPosition, initialFindString, findReplaceService, onChange, ...rest } = props;
|
|
1530
1507
|
const localeService = useDependency(LocaleService);
|
|
@@ -1560,8 +1537,7 @@ function SearchInput(props) {
|
|
|
1560
1537
|
});
|
|
1561
1538
|
}
|
|
1562
1539
|
|
|
1563
|
-
|
|
1564
|
-
//#region src/views/dialog/FindReplaceDialog.tsx
|
|
1540
|
+
// src/views/dialog/FindReplaceDialog.tsx
|
|
1565
1541
|
/**
|
|
1566
1542
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1567
1543
|
*
|
|
@@ -1852,8 +1828,7 @@ function FindReplaceDialog() {
|
|
|
1852
1828
|
});
|
|
1853
1829
|
}
|
|
1854
1830
|
|
|
1855
|
-
|
|
1856
|
-
//#region src/controllers/components.controller.ts
|
|
1831
|
+
// src/controllers/components.controller.ts
|
|
1857
1832
|
/**
|
|
1858
1833
|
* Copyright 2023-present DreamNum Co., Ltd.
|
|
1859
1834
|
*
|
|
@@ -1888,8 +1863,7 @@ let ComponentsController = class ComponentsController extends Disposable {
|
|
|
1888
1863
|
};
|
|
1889
1864
|
ComponentsController = __decorate([__decorateParam(0, Inject(ComponentManager)), __decorateParam(1, Inject(IconManager))], ComponentsController);
|
|
1890
1865
|
|
|
1891
|
-
|
|
1892
|
-
//#region src/plugin.ts
|
|
1866
|
+
// src/plugin.ts
|
|
1893
1867
|
let UniverFindReplacePlugin = class UniverFindReplacePlugin extends Plugin {
|
|
1894
1868
|
constructor(_config = defaultPluginConfig, _injector, _configService) {
|
|
1895
1869
|
super();
|
|
@@ -1913,5 +1887,4 @@ _defineProperty(UniverFindReplacePlugin, "packageName", name);
|
|
|
1913
1887
|
_defineProperty(UniverFindReplacePlugin, "version", version);
|
|
1914
1888
|
UniverFindReplacePlugin = __decorate([__decorateParam(1, Inject(Injector)), __decorateParam(2, IConfigService)], UniverFindReplacePlugin);
|
|
1915
1889
|
|
|
1916
|
-
//#endregion
|
|
1917
1890
|
export { CloseFindDialogOperation, FindBy, FindDirection, FindModel, FindReplaceController, menuSchema as FindReplaceMenuSchema, FindReplaceModel, FindReplaceService, FindReplaceState, FindScope, GoToNextMatchOperation, GoToPreviousMatchOperation, IFindReplaceService, OpenFindDialogOperation, OpenReplaceDialogOperation, ReplaceAllMatchesCommand, ReplaceCurrentMatchCommand, UniverFindReplaceMobileUIPlugin, UniverFindReplacePlugin, createInitFindReplaceState };
|
package/lib/locale/ar-SA.js
CHANGED
package/lib/locale/ca-ES.js
CHANGED
package/lib/locale/de-DE.js
CHANGED
package/lib/locale/en-US.js
CHANGED
package/lib/locale/es-ES.js
CHANGED
package/lib/locale/fa-IR.js
CHANGED
package/lib/locale/fr-FR.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/fr-FR.ts
|
|
2
2
|
const locale = { "find-replace": {
|
|
3
3
|
toolbar: "Rechercher & Remplacer",
|
|
4
4
|
mobile: {
|
|
@@ -57,5 +57,4 @@ const locale = { "find-replace": {
|
|
|
57
57
|
}
|
|
58
58
|
} };
|
|
59
59
|
|
|
60
|
-
//#endregion
|
|
61
60
|
export { locale as default };
|
package/lib/locale/id-ID.js
CHANGED
package/lib/locale/it-IT.js
CHANGED
package/lib/locale/ja-JP.js
CHANGED
package/lib/locale/ko-KR.js
CHANGED
package/lib/locale/pl-PL.js
CHANGED
package/lib/locale/pt-BR.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locale/pt-BR.ts
|
|
2
2
|
const locale = { "find-replace": {
|
|
3
3
|
toolbar: "Localizar e Substituir",
|
|
4
4
|
mobile: {
|
|
@@ -57,5 +57,4 @@ const locale = { "find-replace": {
|
|
|
57
57
|
}
|
|
58
58
|
} };
|
|
59
59
|
|
|
60
|
-
//#endregion
|
|
61
60
|
export { locale as default };
|
package/lib/locale/ru-RU.js
CHANGED
package/lib/locale/sk-SK.js
CHANGED
package/lib/locale/vi-VN.js
CHANGED
package/lib/locale/zh-CN.js
CHANGED
package/lib/locale/zh-HK.js
CHANGED
package/lib/locale/zh-TW.js
CHANGED
|
@@ -142,7 +142,7 @@ export interface IFindReplaceService {
|
|
|
142
142
|
focusSelection(): void;
|
|
143
143
|
getProviders(): Set<IFindReplaceProvider>;
|
|
144
144
|
}
|
|
145
|
-
export declare const IFindReplaceService: import("@
|
|
145
|
+
export declare const IFindReplaceService: import("@univerjs/core").IdentifierDecorator<IFindReplaceService>;
|
|
146
146
|
/**
|
|
147
147
|
* The find query object with finding options.
|
|
148
148
|
*/
|