@univerjs/find-replace 1.0.0-alpha.8 → 1.0.0-beta.1

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.
Files changed (83) hide show
  1. package/lib/cjs/index.js +8 -13
  2. package/lib/cjs/locale/ar-SA.js +0 -1
  3. package/lib/cjs/locale/ca-ES.js +0 -1
  4. package/lib/cjs/locale/de-DE.js +0 -1
  5. package/lib/cjs/locale/en-US.js +0 -1
  6. package/lib/cjs/locale/es-ES.js +0 -1
  7. package/lib/cjs/locale/fa-IR.js +0 -1
  8. package/lib/cjs/locale/fr-FR.js +0 -1
  9. package/lib/cjs/locale/id-ID.js +0 -1
  10. package/lib/cjs/locale/it-IT.js +0 -1
  11. package/lib/cjs/locale/ja-JP.js +0 -1
  12. package/lib/cjs/locale/ko-KR.js +0 -1
  13. package/lib/cjs/locale/pl-PL.js +0 -1
  14. package/lib/cjs/locale/pt-BR.js +0 -1
  15. package/lib/cjs/locale/ru-RU.js +0 -1
  16. package/lib/cjs/locale/sk-SK.js +0 -1
  17. package/lib/cjs/locale/vi-VN.js +0 -1
  18. package/lib/cjs/locale/zh-CN.js +0 -1
  19. package/lib/cjs/locale/zh-HK.js +0 -1
  20. package/lib/cjs/locale/zh-TW.js +0 -1
  21. package/lib/es/index.js +10 -15
  22. package/lib/es/locale/ar-SA.js +0 -1
  23. package/lib/es/locale/ca-ES.js +0 -1
  24. package/lib/es/locale/de-DE.js +0 -1
  25. package/lib/es/locale/en-US.js +0 -1
  26. package/lib/es/locale/es-ES.js +0 -1
  27. package/lib/es/locale/fa-IR.js +0 -1
  28. package/lib/es/locale/fr-FR.js +0 -1
  29. package/lib/es/locale/id-ID.js +0 -1
  30. package/lib/es/locale/it-IT.js +0 -1
  31. package/lib/es/locale/ja-JP.js +0 -1
  32. package/lib/es/locale/ko-KR.js +0 -1
  33. package/lib/es/locale/pl-PL.js +0 -1
  34. package/lib/es/locale/pt-BR.js +0 -1
  35. package/lib/es/locale/ru-RU.js +0 -1
  36. package/lib/es/locale/sk-SK.js +0 -1
  37. package/lib/es/locale/vi-VN.js +0 -1
  38. package/lib/es/locale/zh-CN.js +0 -1
  39. package/lib/es/locale/zh-HK.js +0 -1
  40. package/lib/es/locale/zh-TW.js +0 -1
  41. package/lib/index.js +10 -15
  42. package/lib/locale/ar-SA.js +0 -1
  43. package/lib/locale/ca-ES.js +0 -1
  44. package/lib/locale/de-DE.js +0 -1
  45. package/lib/locale/en-US.js +0 -1
  46. package/lib/locale/es-ES.js +0 -1
  47. package/lib/locale/fa-IR.js +0 -1
  48. package/lib/locale/fr-FR.js +0 -1
  49. package/lib/locale/id-ID.js +0 -1
  50. package/lib/locale/it-IT.js +0 -1
  51. package/lib/locale/ja-JP.js +0 -1
  52. package/lib/locale/ko-KR.js +0 -1
  53. package/lib/locale/pl-PL.js +0 -1
  54. package/lib/locale/pt-BR.js +0 -1
  55. package/lib/locale/ru-RU.js +0 -1
  56. package/lib/locale/sk-SK.js +0 -1
  57. package/lib/locale/vi-VN.js +0 -1
  58. package/lib/locale/zh-CN.js +0 -1
  59. package/lib/locale/zh-HK.js +0 -1
  60. package/lib/locale/zh-TW.js +0 -1
  61. package/lib/types/controllers/find-replace.controller.d.ts +4 -0
  62. package/lib/types/locale/en-US.d.ts +0 -1
  63. package/lib/umd/index.js +1 -1
  64. package/lib/umd/locale/ar-SA.js +1 -1
  65. package/lib/umd/locale/ca-ES.js +1 -1
  66. package/lib/umd/locale/de-DE.js +1 -1
  67. package/lib/umd/locale/en-US.js +1 -1
  68. package/lib/umd/locale/es-ES.js +1 -1
  69. package/lib/umd/locale/fa-IR.js +1 -1
  70. package/lib/umd/locale/fr-FR.js +1 -1
  71. package/lib/umd/locale/id-ID.js +1 -1
  72. package/lib/umd/locale/it-IT.js +1 -1
  73. package/lib/umd/locale/ja-JP.js +1 -1
  74. package/lib/umd/locale/ko-KR.js +1 -1
  75. package/lib/umd/locale/pl-PL.js +1 -1
  76. package/lib/umd/locale/pt-BR.js +1 -1
  77. package/lib/umd/locale/ru-RU.js +1 -1
  78. package/lib/umd/locale/sk-SK.js +1 -1
  79. package/lib/umd/locale/vi-VN.js +1 -1
  80. package/lib/umd/locale/zh-CN.js +1 -1
  81. package/lib/umd/locale/zh-HK.js +1 -1
  82. package/lib/umd/locale/zh-TW.js +1 -1
  83. package/package.json +8 -8
package/lib/cjs/index.js CHANGED
@@ -688,13 +688,12 @@ let FindReplaceService = class FindReplaceService extends _univerjs_core.Disposa
688
688
  });
689
689
  }
690
690
  _syncActiveProvider() {
691
- var _Array$from$find, _provider$capabilitie;
692
691
  const unit = this._univerInstanceService.getFocusedUnit();
693
- const provider = unit == null ? null : (_Array$from$find = Array.from(this._providers).find((candidate) => candidate.isSupported(unit))) !== null && _Array$from$find !== void 0 ? _Array$from$find : null;
692
+ const provider = unit == null ? null : Array.from(this._providers).find((candidate) => candidate.isSupported(unit)) ?? null;
694
693
  if (provider === this._activeProvider) return;
695
694
  if (this.revealed) this.terminate();
696
695
  this._activeProvider = provider;
697
- this._providerCapabilities$.next((_provider$capabilitie = provider === null || provider === void 0 ? void 0 : provider.capabilities) !== null && _provider$capabilitie !== void 0 ? _provider$capabilitie : null);
696
+ this._providerCapabilities$.next((provider === null || provider === void 0 ? void 0 : provider.capabilities) ?? null);
698
697
  this._contextService.setContextValue(FIND_REPLACE_AVAILABLE, provider != null);
699
698
  }
700
699
  _toggleRevealReplace(revealReplace) {
@@ -912,7 +911,7 @@ const FocusSelectionShortcutItem = {
912
911
  //#region src/controllers/find-replace.controller.ts
913
912
  const FIND_REPLACE_DIALOG_ID = "DESKTOP_FIND_REPLACE_DIALOG";
914
913
  const FIND_REPLACE_PANEL_WIDTH = 350;
915
- const FIND_REPLACE_PANEL_RIGHT_PADDING = 20;
914
+ const FIND_REPLACE_PANEL_HORIZONTAL_PADDING = 20;
916
915
  const FIND_REPLACE_PANEL_TOP_PADDING = 64;
917
916
  let FindReplaceController = class FindReplaceController extends _univerjs_core.RxDisposable {
918
917
  constructor(_univerInstanceService, _menuManagerService, _shortcutService, _commandService, _findReplaceService, _dialogService, _layoutService, _localeService) {
@@ -976,7 +975,7 @@ let FindReplaceController = class FindReplaceController extends _univerjs_core.R
976
975
  children: { label: "FindReplaceDialog" },
977
976
  mask: false,
978
977
  maskClosable: false,
979
- defaultPosition: getFindReplaceDialogDefaultPosition(),
978
+ defaultPosition: getFindReplaceDialogDefaultPosition(this._localeService.getDirection()),
980
979
  preservePositionOnDestroy: true,
981
980
  onClose: () => this.closePanel()
982
981
  });
@@ -1003,10 +1002,10 @@ FindReplaceController = __decorate([
1003
1002
  __decorateParam(6, _univerjs_ui.ILayoutService),
1004
1003
  __decorateParam(7, (0, _univerjs_core.Inject)(_univerjs_core.LocaleService))
1005
1004
  ], FindReplaceController);
1006
- function getFindReplaceDialogDefaultPosition() {
1005
+ function getFindReplaceDialogDefaultPosition(direction) {
1007
1006
  const { innerWidth } = window;
1008
1007
  return {
1009
- x: innerWidth - FIND_REPLACE_PANEL_WIDTH - FIND_REPLACE_PANEL_RIGHT_PADDING,
1008
+ x: direction === "rtl" ? FIND_REPLACE_PANEL_HORIZONTAL_PADDING : innerWidth - FIND_REPLACE_PANEL_WIDTH - FIND_REPLACE_PANEL_HORIZONTAL_PADDING,
1010
1009
  y: FIND_REPLACE_PANEL_TOP_PADDING
1011
1010
  };
1012
1011
  }
@@ -1014,7 +1013,7 @@ function getFindReplaceDialogDefaultPosition() {
1014
1013
  //#endregion
1015
1014
  //#region package.json
1016
1015
  var name = "@univerjs/find-replace";
1017
- var version = "1.0.0-alpha.8";
1016
+ var version = "1.0.0-beta.1";
1018
1017
 
1019
1018
  //#endregion
1020
1019
  //#region src/config/config.ts
@@ -1383,11 +1382,7 @@ let UniverFindReplacePlugin = class UniverFindReplacePlugin extends _univerjs_co
1383
1382
  _defineProperty(UniverFindReplacePlugin, "pluginName", "UNIVER_FIND_REPLACE_PLUGIN");
1384
1383
  _defineProperty(UniverFindReplacePlugin, "packageName", name);
1385
1384
  _defineProperty(UniverFindReplacePlugin, "version", version);
1386
- UniverFindReplacePlugin = __decorate([
1387
- (0, _univerjs_core.DependentOn)(_univerjs_ui.UniverUIPlugin),
1388
- __decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_core.Injector)),
1389
- __decorateParam(2, _univerjs_core.IConfigService)
1390
- ], UniverFindReplacePlugin);
1385
+ UniverFindReplacePlugin = __decorate([__decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_core.Injector)), __decorateParam(2, _univerjs_core.IConfigService)], UniverFindReplacePlugin);
1391
1386
 
1392
1387
  //#endregion
1393
1388
  exports.FindBy = FindBy;
@@ -5,7 +5,6 @@ const locale = { "find-replace": {
5
5
  shortcut: {
6
6
  "open-find-dialog": "فتح مربع حوار البحث",
7
7
  "open-replace-dialog": "فتح مربع حوار الاستبدال",
8
- "close-dialog": "إغلاق مربع حوار البحث والاستبدال",
9
8
  "go-to-next-match": "الانتقال إلى التطابق التالي",
10
9
  "go-to-previous-match": "الانتقال إلى التطابق السابق",
11
10
  "focus-selection": "تركيز التحديد",
@@ -5,7 +5,6 @@ const locale = { "find-replace": {
5
5
  shortcut: {
6
6
  "open-find-dialog": "Obrir el diàleg de cerca",
7
7
  "open-replace-dialog": "Obrir el diàleg de reemplaçament",
8
- "close-dialog": "Tancar el diàleg de cerca i reemplaçament",
9
8
  "go-to-next-match": "Anar a la següent coincidència",
10
9
  "go-to-previous-match": "Anar a la coincidència anterior",
11
10
  "focus-selection": "Enfocar la selecció",
@@ -5,7 +5,6 @@ const locale = { "find-replace": {
5
5
  shortcut: {
6
6
  "open-find-dialog": "Suchdialog öffnen",
7
7
  "open-replace-dialog": "Ersetzungsdialog öffnen",
8
- "close-dialog": "Suchen & Ersetzen-Dialog schließen",
9
8
  "go-to-next-match": "Zum nächsten Treffer springen",
10
9
  "go-to-previous-match": "Zum vorherigen Treffer springen",
11
10
  "focus-selection": "Auswahl fokussieren",
@@ -20,7 +20,6 @@ const locale = { "find-replace": {
20
20
  shortcut: {
21
21
  "open-find-dialog": "Open Find Dialog",
22
22
  "open-replace-dialog": "Open Replace Dialog",
23
- "close-dialog": "Close Find & Replace Dialog",
24
23
  "go-to-next-match": "Go to Next Match",
25
24
  "go-to-previous-match": "Go to Previous Match",
26
25
  "focus-selection": "Focus Selection",
@@ -5,7 +5,6 @@ const locale = { "find-replace": {
5
5
  shortcut: {
6
6
  "open-find-dialog": "Abrir cuadro de diálogo de búsqueda",
7
7
  "open-replace-dialog": "Abrir cuadro de diálogo de reemplazo",
8
- "close-dialog": "Cerrar cuadro de diálogo de búsqueda y reemplazo",
9
8
  "go-to-next-match": "Ir a la siguiente coincidencia",
10
9
  "go-to-previous-match": "Ir a la coincidencia anterior",
11
10
  "focus-selection": "Enfocar selección",
@@ -5,7 +5,6 @@ const locale = { "find-replace": {
5
5
  shortcut: {
6
6
  "open-find-dialog": "باز کردن پنجره جستجو",
7
7
  "open-replace-dialog": "باز کردن پنجره جایگزینی",
8
- "close-dialog": "بستن پنجره جستجو و جایگزینی",
9
8
  "go-to-next-match": "رفتن به مورد تطابق بعدی",
10
9
  "go-to-previous-match": "رفتن به مورد تطابق قبلی",
11
10
  "focus-selection": "تمرکز بر انتخاب",
@@ -5,7 +5,6 @@ const locale = { "find-replace": {
5
5
  shortcut: {
6
6
  "open-find-dialog": "Ouvrir la boîte de dialogue de recherche",
7
7
  "open-replace-dialog": "Ouvrir la boîte de dialogue de remplacement",
8
- "close-dialog": "Fermer la boîte de dialogue de recherche et de remplacement",
9
8
  "go-to-next-match": "Aller à la correspondance suivante",
10
9
  "go-to-previous-match": "Aller à la correspondance précédente",
11
10
  "focus-selection": "Concentrer la sélection",
@@ -5,7 +5,6 @@ const locale = { "find-replace": {
5
5
  shortcut: {
6
6
  "open-find-dialog": "Buka Dialog Cari",
7
7
  "open-replace-dialog": "Buka Dialog Ganti",
8
- "close-dialog": "Tutup Dialog Cari & Ganti",
9
8
  "go-to-next-match": "Ke Hasil Berikutnya",
10
9
  "go-to-previous-match": "Ke Hasil Sebelumnya",
11
10
  "focus-selection": "Fokus Pilihan",
@@ -5,7 +5,6 @@ const locale = { "find-replace": {
5
5
  shortcut: {
6
6
  "open-find-dialog": "Apri finestra Trova",
7
7
  "open-replace-dialog": "Apri finestra Sostituisci",
8
- "close-dialog": "Chiudi finestra Trova e sostituisci",
9
8
  "go-to-next-match": "Vai alla corrispondenza successiva",
10
9
  "go-to-previous-match": "Vai alla corrispondenza precedente",
11
10
  "focus-selection": "Focus selezione",
@@ -5,7 +5,6 @@ const locale = { "find-replace": {
5
5
  shortcut: {
6
6
  "open-find-dialog": "検索ダイアログを開く",
7
7
  "open-replace-dialog": "置換ダイアログを開く",
8
- "close-dialog": "検索と置換ダイアログを閉じる",
9
8
  "go-to-next-match": "次の一致項目へ移動",
10
9
  "go-to-previous-match": "前の一致項目へ移動",
11
10
  "focus-selection": "選択範囲にフォーカス",
@@ -5,7 +5,6 @@ const locale = { "find-replace": {
5
5
  shortcut: {
6
6
  "open-find-dialog": "찾기 대화 상자 열기",
7
7
  "open-replace-dialog": "바꾸기 대화 상자 열기",
8
- "close-dialog": "찾기 및 바꾸기 대화 상자 닫기",
9
8
  "go-to-next-match": "다음 일치 항목으로 이동",
10
9
  "go-to-previous-match": "이전 일치 항목으로 이동",
11
10
  "focus-selection": "선택 영역에 포커스",
@@ -5,7 +5,6 @@ const locale = { "find-replace": {
5
5
  shortcut: {
6
6
  "open-find-dialog": "Otwórz okno Znajdź",
7
7
  "open-replace-dialog": "Otwórz okno Zamień",
8
- "close-dialog": "Zamknij okno Znajdź i zamień",
9
8
  "go-to-next-match": "Przejdź do następnego dopasowania",
10
9
  "go-to-previous-match": "Przejdź do poprzedniego dopasowania",
11
10
  "focus-selection": "Skup na zaznaczeniu",
@@ -5,7 +5,6 @@ const locale = { "find-replace": {
5
5
  shortcut: {
6
6
  "open-find-dialog": "Abrir Caixa de Localização",
7
7
  "open-replace-dialog": "Abrir Caixa de Substituição",
8
- "close-dialog": "Fechar Caixa de Localizar e Substituir",
9
8
  "go-to-next-match": "Ir para Próxima Correspondência",
10
9
  "go-to-previous-match": "Ir para Correspondência Anterior",
11
10
  "focus-selection": "Focar Seleção",
@@ -5,7 +5,6 @@ const locale = { "find-replace": {
5
5
  shortcut: {
6
6
  "open-find-dialog": "Открыть диалоговое окно поиска",
7
7
  "open-replace-dialog": "Открыть диалоговое окно замены",
8
- "close-dialog": "Закрыть диалоговое окно поиска и замены",
9
8
  "go-to-next-match": "Перейти к следующему совпадению",
10
9
  "go-to-previous-match": "Перейти к предыдущему совпадению",
11
10
  "focus-selection": "Фокус на выделении",
@@ -5,7 +5,6 @@ const locale = { "find-replace": {
5
5
  shortcut: {
6
6
  "open-find-dialog": "Otvoriť dialógové okno hľadania",
7
7
  "open-replace-dialog": "Otvoriť dialógové okno nahradenia",
8
- "close-dialog": "Zavrieť dialógové okno hľadania a nahradenia",
9
8
  "go-to-next-match": "Prejsť na ďalšiu zhodu",
10
9
  "go-to-previous-match": "Prejsť na predchádzajúcu zhodu",
11
10
  "focus-selection": "Zamerať výber",
@@ -5,7 +5,6 @@ const locale = { "find-replace": {
5
5
  shortcut: {
6
6
  "open-find-dialog": "Mở hộp thoại Tìm kiếm",
7
7
  "open-replace-dialog": "Mở hộp thoại Thay thế",
8
- "close-dialog": "Đóng hộp thoại Tìm kiếm & Thay thế",
9
8
  "go-to-next-match": "Chuyển đến kết quả tiếp theo",
10
9
  "go-to-previous-match": "Chuyển đến kết quả trước đó",
11
10
  "focus-selection": "Tập trung vào vùng chọn",
@@ -5,7 +5,6 @@ const locale = { "find-replace": {
5
5
  shortcut: {
6
6
  "open-find-dialog": "打开查找对话框",
7
7
  "open-replace-dialog": "打开替换对话框",
8
- "close-dialog": "关闭查找替换对话框",
9
8
  "go-to-next-match": "下一个匹配项",
10
9
  "go-to-previous-match": "下一个匹配项",
11
10
  "focus-selection": "聚焦选区",
@@ -5,7 +5,6 @@ const locale = { "find-replace": {
5
5
  shortcut: {
6
6
  "open-find-dialog": "打開尋找對話框",
7
7
  "open-replace-dialog": "打開取代對話框",
8
- "close-dialog": "關閉尋找與取代對話框",
9
8
  "go-to-next-match": "前往下一個匹配項",
10
9
  "go-to-previous-match": "前往上一個匹配項",
11
10
  "focus-selection": "聚焦選取範圍",
@@ -5,7 +5,6 @@ const locale = { "find-replace": {
5
5
  shortcut: {
6
6
  "open-find-dialog": "打開尋找對話框",
7
7
  "open-replace-dialog": "打開取代對話框",
8
- "close-dialog": "關閉尋找與取代對話框",
9
8
  "go-to-next-match": "前往下一個匹配項",
10
9
  "go-to-previous-match": "前往上一個匹配項",
11
10
  "focus-selection": "聚焦選取範圍",
package/lib/es/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { CommandType, DependentOn, Disposable, DisposableCollection, EDITOR_ACTIVATED, FOCUSING_SHEET, ICommandService, IConfigService, IConfirmService, IContextService, IUniverInstanceService, Inject, Injector, LocaleService, Plugin, RxDisposable, UniverInstanceType, createIdentifier, merge, toDisposable } from "@univerjs/core";
1
+ import { CommandType, Disposable, DisposableCollection, EDITOR_ACTIVATED, FOCUSING_SHEET, ICommandService, IConfigService, IConfirmService, IContextService, IUniverInstanceService, Inject, Injector, LocaleService, Plugin, RxDisposable, UniverInstanceType, createIdentifier, merge, toDisposable } from "@univerjs/core";
2
2
  import { Button, Checkbox, FormDualColumnLayout, FormLayout, Input, MessageType, Pager, Select } from "@univerjs/design";
3
- import { ComponentManager, IDialogService, ILayoutService, IMenuManagerService, IMessageService, IShortcutService, IconManager, KeyCode, MenuItemType, MetaKeys, RibbonDataGroup, UniverUIPlugin, getMenuHiddenObservable, useDebounceFn, useDependency, useObservable } from "@univerjs/ui";
3
+ import { ComponentManager, IDialogService, ILayoutService, IMenuManagerService, IMessageService, IShortcutService, IconManager, KeyCode, MenuItemType, MetaKeys, RibbonDataGroup, getMenuHiddenObservable, useDebounceFn, useDependency, useObservable } from "@univerjs/ui";
4
4
  import { RENDER_RAW_FORMULA_KEY } from "@univerjs/engine-render";
5
5
  import { BehaviorSubject, Subject, combineLatest, debounceTime, fromEvent, map, takeUntil, throttleTime } from "rxjs";
6
6
  import { SearchIcon } from "@univerjs/icons";
@@ -687,13 +687,12 @@ let FindReplaceService = class FindReplaceService extends Disposable {
687
687
  });
688
688
  }
689
689
  _syncActiveProvider() {
690
- var _Array$from$find, _provider$capabilitie;
691
690
  const unit = this._univerInstanceService.getFocusedUnit();
692
- const provider = unit == null ? null : (_Array$from$find = Array.from(this._providers).find((candidate) => candidate.isSupported(unit))) !== null && _Array$from$find !== void 0 ? _Array$from$find : null;
691
+ const provider = unit == null ? null : Array.from(this._providers).find((candidate) => candidate.isSupported(unit)) ?? null;
693
692
  if (provider === this._activeProvider) return;
694
693
  if (this.revealed) this.terminate();
695
694
  this._activeProvider = provider;
696
- this._providerCapabilities$.next((_provider$capabilitie = provider === null || provider === void 0 ? void 0 : provider.capabilities) !== null && _provider$capabilitie !== void 0 ? _provider$capabilitie : null);
695
+ this._providerCapabilities$.next((provider === null || provider === void 0 ? void 0 : provider.capabilities) ?? null);
697
696
  this._contextService.setContextValue(FIND_REPLACE_AVAILABLE, provider != null);
698
697
  }
699
698
  _toggleRevealReplace(revealReplace) {
@@ -911,7 +910,7 @@ const FocusSelectionShortcutItem = {
911
910
  //#region src/controllers/find-replace.controller.ts
912
911
  const FIND_REPLACE_DIALOG_ID = "DESKTOP_FIND_REPLACE_DIALOG";
913
912
  const FIND_REPLACE_PANEL_WIDTH = 350;
914
- const FIND_REPLACE_PANEL_RIGHT_PADDING = 20;
913
+ const FIND_REPLACE_PANEL_HORIZONTAL_PADDING = 20;
915
914
  const FIND_REPLACE_PANEL_TOP_PADDING = 64;
916
915
  let FindReplaceController = class FindReplaceController extends RxDisposable {
917
916
  constructor(_univerInstanceService, _menuManagerService, _shortcutService, _commandService, _findReplaceService, _dialogService, _layoutService, _localeService) {
@@ -975,7 +974,7 @@ let FindReplaceController = class FindReplaceController extends RxDisposable {
975
974
  children: { label: "FindReplaceDialog" },
976
975
  mask: false,
977
976
  maskClosable: false,
978
- defaultPosition: getFindReplaceDialogDefaultPosition(),
977
+ defaultPosition: getFindReplaceDialogDefaultPosition(this._localeService.getDirection()),
979
978
  preservePositionOnDestroy: true,
980
979
  onClose: () => this.closePanel()
981
980
  });
@@ -1002,10 +1001,10 @@ FindReplaceController = __decorate([
1002
1001
  __decorateParam(6, ILayoutService),
1003
1002
  __decorateParam(7, Inject(LocaleService))
1004
1003
  ], FindReplaceController);
1005
- function getFindReplaceDialogDefaultPosition() {
1004
+ function getFindReplaceDialogDefaultPosition(direction) {
1006
1005
  const { innerWidth } = window;
1007
1006
  return {
1008
- x: innerWidth - FIND_REPLACE_PANEL_WIDTH - FIND_REPLACE_PANEL_RIGHT_PADDING,
1007
+ x: direction === "rtl" ? FIND_REPLACE_PANEL_HORIZONTAL_PADDING : innerWidth - FIND_REPLACE_PANEL_WIDTH - FIND_REPLACE_PANEL_HORIZONTAL_PADDING,
1009
1008
  y: FIND_REPLACE_PANEL_TOP_PADDING
1010
1009
  };
1011
1010
  }
@@ -1013,7 +1012,7 @@ function getFindReplaceDialogDefaultPosition() {
1013
1012
  //#endregion
1014
1013
  //#region package.json
1015
1014
  var name = "@univerjs/find-replace";
1016
- var version = "1.0.0-alpha.8";
1015
+ var version = "1.0.0-beta.1";
1017
1016
 
1018
1017
  //#endregion
1019
1018
  //#region src/config/config.ts
@@ -1382,11 +1381,7 @@ let UniverFindReplacePlugin = class UniverFindReplacePlugin extends Plugin {
1382
1381
  _defineProperty(UniverFindReplacePlugin, "pluginName", "UNIVER_FIND_REPLACE_PLUGIN");
1383
1382
  _defineProperty(UniverFindReplacePlugin, "packageName", name);
1384
1383
  _defineProperty(UniverFindReplacePlugin, "version", version);
1385
- UniverFindReplacePlugin = __decorate([
1386
- DependentOn(UniverUIPlugin),
1387
- __decorateParam(1, Inject(Injector)),
1388
- __decorateParam(2, IConfigService)
1389
- ], UniverFindReplacePlugin);
1384
+ UniverFindReplacePlugin = __decorate([__decorateParam(1, Inject(Injector)), __decorateParam(2, IConfigService)], UniverFindReplacePlugin);
1390
1385
 
1391
1386
  //#endregion
1392
1387
  export { FindBy, FindDirection, FindModel, FindReplaceController, menuSchema as FindReplaceMenuSchema, FindReplaceModel, FindReplaceService, FindReplaceState, FindScope, GoToNextMatchOperation, GoToPreviousMatchOperation, IFindReplaceService, OpenFindDialogOperation, OpenReplaceDialogOperation, ReplaceAllMatchesCommand, ReplaceCurrentMatchCommand, UniverFindReplacePlugin, createInitFindReplaceState };
@@ -4,7 +4,6 @@ const locale = { "find-replace": {
4
4
  shortcut: {
5
5
  "open-find-dialog": "فتح مربع حوار البحث",
6
6
  "open-replace-dialog": "فتح مربع حوار الاستبدال",
7
- "close-dialog": "إغلاق مربع حوار البحث والاستبدال",
8
7
  "go-to-next-match": "الانتقال إلى التطابق التالي",
9
8
  "go-to-previous-match": "الانتقال إلى التطابق السابق",
10
9
  "focus-selection": "تركيز التحديد",
@@ -4,7 +4,6 @@ const locale = { "find-replace": {
4
4
  shortcut: {
5
5
  "open-find-dialog": "Obrir el diàleg de cerca",
6
6
  "open-replace-dialog": "Obrir el diàleg de reemplaçament",
7
- "close-dialog": "Tancar el diàleg de cerca i reemplaçament",
8
7
  "go-to-next-match": "Anar a la següent coincidència",
9
8
  "go-to-previous-match": "Anar a la coincidència anterior",
10
9
  "focus-selection": "Enfocar la selecció",
@@ -4,7 +4,6 @@ const locale = { "find-replace": {
4
4
  shortcut: {
5
5
  "open-find-dialog": "Suchdialog öffnen",
6
6
  "open-replace-dialog": "Ersetzungsdialog öffnen",
7
- "close-dialog": "Suchen & Ersetzen-Dialog schließen",
8
7
  "go-to-next-match": "Zum nächsten Treffer springen",
9
8
  "go-to-previous-match": "Zum vorherigen Treffer springen",
10
9
  "focus-selection": "Auswahl fokussieren",
@@ -19,7 +19,6 @@ const locale = { "find-replace": {
19
19
  shortcut: {
20
20
  "open-find-dialog": "Open Find Dialog",
21
21
  "open-replace-dialog": "Open Replace Dialog",
22
- "close-dialog": "Close Find & Replace Dialog",
23
22
  "go-to-next-match": "Go to Next Match",
24
23
  "go-to-previous-match": "Go to Previous Match",
25
24
  "focus-selection": "Focus Selection",
@@ -4,7 +4,6 @@ const locale = { "find-replace": {
4
4
  shortcut: {
5
5
  "open-find-dialog": "Abrir cuadro de diálogo de búsqueda",
6
6
  "open-replace-dialog": "Abrir cuadro de diálogo de reemplazo",
7
- "close-dialog": "Cerrar cuadro de diálogo de búsqueda y reemplazo",
8
7
  "go-to-next-match": "Ir a la siguiente coincidencia",
9
8
  "go-to-previous-match": "Ir a la coincidencia anterior",
10
9
  "focus-selection": "Enfocar selección",
@@ -4,7 +4,6 @@ const locale = { "find-replace": {
4
4
  shortcut: {
5
5
  "open-find-dialog": "باز کردن پنجره جستجو",
6
6
  "open-replace-dialog": "باز کردن پنجره جایگزینی",
7
- "close-dialog": "بستن پنجره جستجو و جایگزینی",
8
7
  "go-to-next-match": "رفتن به مورد تطابق بعدی",
9
8
  "go-to-previous-match": "رفتن به مورد تطابق قبلی",
10
9
  "focus-selection": "تمرکز بر انتخاب",
@@ -4,7 +4,6 @@ const locale = { "find-replace": {
4
4
  shortcut: {
5
5
  "open-find-dialog": "Ouvrir la boîte de dialogue de recherche",
6
6
  "open-replace-dialog": "Ouvrir la boîte de dialogue de remplacement",
7
- "close-dialog": "Fermer la boîte de dialogue de recherche et de remplacement",
8
7
  "go-to-next-match": "Aller à la correspondance suivante",
9
8
  "go-to-previous-match": "Aller à la correspondance précédente",
10
9
  "focus-selection": "Concentrer la sélection",
@@ -4,7 +4,6 @@ const locale = { "find-replace": {
4
4
  shortcut: {
5
5
  "open-find-dialog": "Buka Dialog Cari",
6
6
  "open-replace-dialog": "Buka Dialog Ganti",
7
- "close-dialog": "Tutup Dialog Cari & Ganti",
8
7
  "go-to-next-match": "Ke Hasil Berikutnya",
9
8
  "go-to-previous-match": "Ke Hasil Sebelumnya",
10
9
  "focus-selection": "Fokus Pilihan",
@@ -4,7 +4,6 @@ const locale = { "find-replace": {
4
4
  shortcut: {
5
5
  "open-find-dialog": "Apri finestra Trova",
6
6
  "open-replace-dialog": "Apri finestra Sostituisci",
7
- "close-dialog": "Chiudi finestra Trova e sostituisci",
8
7
  "go-to-next-match": "Vai alla corrispondenza successiva",
9
8
  "go-to-previous-match": "Vai alla corrispondenza precedente",
10
9
  "focus-selection": "Focus selezione",
@@ -4,7 +4,6 @@ const locale = { "find-replace": {
4
4
  shortcut: {
5
5
  "open-find-dialog": "検索ダイアログを開く",
6
6
  "open-replace-dialog": "置換ダイアログを開く",
7
- "close-dialog": "検索と置換ダイアログを閉じる",
8
7
  "go-to-next-match": "次の一致項目へ移動",
9
8
  "go-to-previous-match": "前の一致項目へ移動",
10
9
  "focus-selection": "選択範囲にフォーカス",
@@ -4,7 +4,6 @@ const locale = { "find-replace": {
4
4
  shortcut: {
5
5
  "open-find-dialog": "찾기 대화 상자 열기",
6
6
  "open-replace-dialog": "바꾸기 대화 상자 열기",
7
- "close-dialog": "찾기 및 바꾸기 대화 상자 닫기",
8
7
  "go-to-next-match": "다음 일치 항목으로 이동",
9
8
  "go-to-previous-match": "이전 일치 항목으로 이동",
10
9
  "focus-selection": "선택 영역에 포커스",
@@ -4,7 +4,6 @@ const locale = { "find-replace": {
4
4
  shortcut: {
5
5
  "open-find-dialog": "Otwórz okno Znajdź",
6
6
  "open-replace-dialog": "Otwórz okno Zamień",
7
- "close-dialog": "Zamknij okno Znajdź i zamień",
8
7
  "go-to-next-match": "Przejdź do następnego dopasowania",
9
8
  "go-to-previous-match": "Przejdź do poprzedniego dopasowania",
10
9
  "focus-selection": "Skup na zaznaczeniu",
@@ -4,7 +4,6 @@ const locale = { "find-replace": {
4
4
  shortcut: {
5
5
  "open-find-dialog": "Abrir Caixa de Localização",
6
6
  "open-replace-dialog": "Abrir Caixa de Substituição",
7
- "close-dialog": "Fechar Caixa de Localizar e Substituir",
8
7
  "go-to-next-match": "Ir para Próxima Correspondência",
9
8
  "go-to-previous-match": "Ir para Correspondência Anterior",
10
9
  "focus-selection": "Focar Seleção",
@@ -4,7 +4,6 @@ const locale = { "find-replace": {
4
4
  shortcut: {
5
5
  "open-find-dialog": "Открыть диалоговое окно поиска",
6
6
  "open-replace-dialog": "Открыть диалоговое окно замены",
7
- "close-dialog": "Закрыть диалоговое окно поиска и замены",
8
7
  "go-to-next-match": "Перейти к следующему совпадению",
9
8
  "go-to-previous-match": "Перейти к предыдущему совпадению",
10
9
  "focus-selection": "Фокус на выделении",
@@ -4,7 +4,6 @@ const locale = { "find-replace": {
4
4
  shortcut: {
5
5
  "open-find-dialog": "Otvoriť dialógové okno hľadania",
6
6
  "open-replace-dialog": "Otvoriť dialógové okno nahradenia",
7
- "close-dialog": "Zavrieť dialógové okno hľadania a nahradenia",
8
7
  "go-to-next-match": "Prejsť na ďalšiu zhodu",
9
8
  "go-to-previous-match": "Prejsť na predchádzajúcu zhodu",
10
9
  "focus-selection": "Zamerať výber",
@@ -4,7 +4,6 @@ const locale = { "find-replace": {
4
4
  shortcut: {
5
5
  "open-find-dialog": "Mở hộp thoại Tìm kiếm",
6
6
  "open-replace-dialog": "Mở hộp thoại Thay thế",
7
- "close-dialog": "Đóng hộp thoại Tìm kiếm & Thay thế",
8
7
  "go-to-next-match": "Chuyển đến kết quả tiếp theo",
9
8
  "go-to-previous-match": "Chuyển đến kết quả trước đó",
10
9
  "focus-selection": "Tập trung vào vùng chọn",
@@ -4,7 +4,6 @@ const locale = { "find-replace": {
4
4
  shortcut: {
5
5
  "open-find-dialog": "打开查找对话框",
6
6
  "open-replace-dialog": "打开替换对话框",
7
- "close-dialog": "关闭查找替换对话框",
8
7
  "go-to-next-match": "下一个匹配项",
9
8
  "go-to-previous-match": "下一个匹配项",
10
9
  "focus-selection": "聚焦选区",
@@ -4,7 +4,6 @@ const locale = { "find-replace": {
4
4
  shortcut: {
5
5
  "open-find-dialog": "打開尋找對話框",
6
6
  "open-replace-dialog": "打開取代對話框",
7
- "close-dialog": "關閉尋找與取代對話框",
8
7
  "go-to-next-match": "前往下一個匹配項",
9
8
  "go-to-previous-match": "前往上一個匹配項",
10
9
  "focus-selection": "聚焦選取範圍",
@@ -4,7 +4,6 @@ const locale = { "find-replace": {
4
4
  shortcut: {
5
5
  "open-find-dialog": "打開尋找對話框",
6
6
  "open-replace-dialog": "打開取代對話框",
7
- "close-dialog": "關閉尋找與取代對話框",
8
7
  "go-to-next-match": "前往下一個匹配項",
9
8
  "go-to-previous-match": "前往上一個匹配項",
10
9
  "focus-selection": "聚焦選取範圍",
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { CommandType, DependentOn, Disposable, DisposableCollection, EDITOR_ACTIVATED, FOCUSING_SHEET, ICommandService, IConfigService, IConfirmService, IContextService, IUniverInstanceService, Inject, Injector, LocaleService, Plugin, RxDisposable, UniverInstanceType, createIdentifier, merge, toDisposable } from "@univerjs/core";
1
+ import { CommandType, Disposable, DisposableCollection, EDITOR_ACTIVATED, FOCUSING_SHEET, ICommandService, IConfigService, IConfirmService, IContextService, IUniverInstanceService, Inject, Injector, LocaleService, Plugin, RxDisposable, UniverInstanceType, createIdentifier, merge, toDisposable } from "@univerjs/core";
2
2
  import { Button, Checkbox, FormDualColumnLayout, FormLayout, Input, MessageType, Pager, Select } from "@univerjs/design";
3
- import { ComponentManager, IDialogService, ILayoutService, IMenuManagerService, IMessageService, IShortcutService, IconManager, KeyCode, MenuItemType, MetaKeys, RibbonDataGroup, UniverUIPlugin, getMenuHiddenObservable, useDebounceFn, useDependency, useObservable } from "@univerjs/ui";
3
+ import { ComponentManager, IDialogService, ILayoutService, IMenuManagerService, IMessageService, IShortcutService, IconManager, KeyCode, MenuItemType, MetaKeys, RibbonDataGroup, getMenuHiddenObservable, useDebounceFn, useDependency, useObservable } from "@univerjs/ui";
4
4
  import { RENDER_RAW_FORMULA_KEY } from "@univerjs/engine-render";
5
5
  import { BehaviorSubject, Subject, combineLatest, debounceTime, fromEvent, map, takeUntil, throttleTime } from "rxjs";
6
6
  import { SearchIcon } from "@univerjs/icons";
@@ -687,13 +687,12 @@ let FindReplaceService = class FindReplaceService extends Disposable {
687
687
  });
688
688
  }
689
689
  _syncActiveProvider() {
690
- var _Array$from$find, _provider$capabilitie;
691
690
  const unit = this._univerInstanceService.getFocusedUnit();
692
- const provider = unit == null ? null : (_Array$from$find = Array.from(this._providers).find((candidate) => candidate.isSupported(unit))) !== null && _Array$from$find !== void 0 ? _Array$from$find : null;
691
+ const provider = unit == null ? null : Array.from(this._providers).find((candidate) => candidate.isSupported(unit)) ?? null;
693
692
  if (provider === this._activeProvider) return;
694
693
  if (this.revealed) this.terminate();
695
694
  this._activeProvider = provider;
696
- this._providerCapabilities$.next((_provider$capabilitie = provider === null || provider === void 0 ? void 0 : provider.capabilities) !== null && _provider$capabilitie !== void 0 ? _provider$capabilitie : null);
695
+ this._providerCapabilities$.next((provider === null || provider === void 0 ? void 0 : provider.capabilities) ?? null);
697
696
  this._contextService.setContextValue(FIND_REPLACE_AVAILABLE, provider != null);
698
697
  }
699
698
  _toggleRevealReplace(revealReplace) {
@@ -911,7 +910,7 @@ const FocusSelectionShortcutItem = {
911
910
  //#region src/controllers/find-replace.controller.ts
912
911
  const FIND_REPLACE_DIALOG_ID = "DESKTOP_FIND_REPLACE_DIALOG";
913
912
  const FIND_REPLACE_PANEL_WIDTH = 350;
914
- const FIND_REPLACE_PANEL_RIGHT_PADDING = 20;
913
+ const FIND_REPLACE_PANEL_HORIZONTAL_PADDING = 20;
915
914
  const FIND_REPLACE_PANEL_TOP_PADDING = 64;
916
915
  let FindReplaceController = class FindReplaceController extends RxDisposable {
917
916
  constructor(_univerInstanceService, _menuManagerService, _shortcutService, _commandService, _findReplaceService, _dialogService, _layoutService, _localeService) {
@@ -975,7 +974,7 @@ let FindReplaceController = class FindReplaceController extends RxDisposable {
975
974
  children: { label: "FindReplaceDialog" },
976
975
  mask: false,
977
976
  maskClosable: false,
978
- defaultPosition: getFindReplaceDialogDefaultPosition(),
977
+ defaultPosition: getFindReplaceDialogDefaultPosition(this._localeService.getDirection()),
979
978
  preservePositionOnDestroy: true,
980
979
  onClose: () => this.closePanel()
981
980
  });
@@ -1002,10 +1001,10 @@ FindReplaceController = __decorate([
1002
1001
  __decorateParam(6, ILayoutService),
1003
1002
  __decorateParam(7, Inject(LocaleService))
1004
1003
  ], FindReplaceController);
1005
- function getFindReplaceDialogDefaultPosition() {
1004
+ function getFindReplaceDialogDefaultPosition(direction) {
1006
1005
  const { innerWidth } = window;
1007
1006
  return {
1008
- x: innerWidth - FIND_REPLACE_PANEL_WIDTH - FIND_REPLACE_PANEL_RIGHT_PADDING,
1007
+ x: direction === "rtl" ? FIND_REPLACE_PANEL_HORIZONTAL_PADDING : innerWidth - FIND_REPLACE_PANEL_WIDTH - FIND_REPLACE_PANEL_HORIZONTAL_PADDING,
1009
1008
  y: FIND_REPLACE_PANEL_TOP_PADDING
1010
1009
  };
1011
1010
  }
@@ -1013,7 +1012,7 @@ function getFindReplaceDialogDefaultPosition() {
1013
1012
  //#endregion
1014
1013
  //#region package.json
1015
1014
  var name = "@univerjs/find-replace";
1016
- var version = "1.0.0-alpha.8";
1015
+ var version = "1.0.0-beta.1";
1017
1016
 
1018
1017
  //#endregion
1019
1018
  //#region src/config/config.ts
@@ -1382,11 +1381,7 @@ let UniverFindReplacePlugin = class UniverFindReplacePlugin extends Plugin {
1382
1381
  _defineProperty(UniverFindReplacePlugin, "pluginName", "UNIVER_FIND_REPLACE_PLUGIN");
1383
1382
  _defineProperty(UniverFindReplacePlugin, "packageName", name);
1384
1383
  _defineProperty(UniverFindReplacePlugin, "version", version);
1385
- UniverFindReplacePlugin = __decorate([
1386
- DependentOn(UniverUIPlugin),
1387
- __decorateParam(1, Inject(Injector)),
1388
- __decorateParam(2, IConfigService)
1389
- ], UniverFindReplacePlugin);
1384
+ UniverFindReplacePlugin = __decorate([__decorateParam(1, Inject(Injector)), __decorateParam(2, IConfigService)], UniverFindReplacePlugin);
1390
1385
 
1391
1386
  //#endregion
1392
1387
  export { FindBy, FindDirection, FindModel, FindReplaceController, menuSchema as FindReplaceMenuSchema, FindReplaceModel, FindReplaceService, FindReplaceState, FindScope, GoToNextMatchOperation, GoToPreviousMatchOperation, IFindReplaceService, OpenFindDialogOperation, OpenReplaceDialogOperation, ReplaceAllMatchesCommand, ReplaceCurrentMatchCommand, UniverFindReplacePlugin, createInitFindReplaceState };
@@ -4,7 +4,6 @@ const locale = { "find-replace": {
4
4
  shortcut: {
5
5
  "open-find-dialog": "فتح مربع حوار البحث",
6
6
  "open-replace-dialog": "فتح مربع حوار الاستبدال",
7
- "close-dialog": "إغلاق مربع حوار البحث والاستبدال",
8
7
  "go-to-next-match": "الانتقال إلى التطابق التالي",
9
8
  "go-to-previous-match": "الانتقال إلى التطابق السابق",
10
9
  "focus-selection": "تركيز التحديد",
@@ -4,7 +4,6 @@ const locale = { "find-replace": {
4
4
  shortcut: {
5
5
  "open-find-dialog": "Obrir el diàleg de cerca",
6
6
  "open-replace-dialog": "Obrir el diàleg de reemplaçament",
7
- "close-dialog": "Tancar el diàleg de cerca i reemplaçament",
8
7
  "go-to-next-match": "Anar a la següent coincidència",
9
8
  "go-to-previous-match": "Anar a la coincidència anterior",
10
9
  "focus-selection": "Enfocar la selecció",
@@ -4,7 +4,6 @@ const locale = { "find-replace": {
4
4
  shortcut: {
5
5
  "open-find-dialog": "Suchdialog öffnen",
6
6
  "open-replace-dialog": "Ersetzungsdialog öffnen",
7
- "close-dialog": "Suchen & Ersetzen-Dialog schließen",
8
7
  "go-to-next-match": "Zum nächsten Treffer springen",
9
8
  "go-to-previous-match": "Zum vorherigen Treffer springen",
10
9
  "focus-selection": "Auswahl fokussieren",
@@ -19,7 +19,6 @@ const locale = { "find-replace": {
19
19
  shortcut: {
20
20
  "open-find-dialog": "Open Find Dialog",
21
21
  "open-replace-dialog": "Open Replace Dialog",
22
- "close-dialog": "Close Find & Replace Dialog",
23
22
  "go-to-next-match": "Go to Next Match",
24
23
  "go-to-previous-match": "Go to Previous Match",
25
24
  "focus-selection": "Focus Selection",