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