@univerjs/find-replace 0.5.1 → 0.5.2

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/es/index.js CHANGED
@@ -1,13 +1,13 @@
1
- var ot = Object.defineProperty;
2
- var ct = (t, e, n) => e in t ? ot(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var o = (t, e, n) => ct(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { createIdentifier as lt, Inject as D, Injector as ee, Disposable as te, IUniverInstanceService as me, IContextService as ie, DisposableCollection as dt, toDisposable as L, CommandType as y, LocaleService as B, useDependency as C, ICommandService as ne, FOCUSING_SHEET as ve, EDITOR_ACTIVATED as Se, UniverInstanceType as ht, RxDisposable as ut, Plugin as ft, IConfigService as pt } from "@univerjs/core";
5
- import { IConfirmService as _t, IMessageService as Ce, useObservable as F, ILayoutService as Re, KeyCode as b, MetaKeys as x, MenuItemType as gt, getMenuHiddenObservable as mt, RibbonStartGroup as vt, ComponentManager as St, IMenuManagerService as Ct, IShortcutService as Rt, IDialogService as Mt } from "@univerjs/ui";
6
- import { throttleTime as bt, BehaviorSubject as P, combineLatest as Me, debounceTime as xt, Subject as be, fromEvent as yt, map as It, takeUntil as le } from "rxjs";
7
- import { MessageType as N, InputWithSlot as Dt, Pager as Ft, Button as $, FormLayout as M, Input as Pt, Select as V, FormDualColumnLayout as de, Checkbox as he } from "@univerjs/design";
1
+ var at = Object.defineProperty;
2
+ var ot = (t, e, n) => e in t ? at(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var c = (t, e, n) => ot(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { createIdentifier as ct, Inject as F, Injector as Q, Disposable as X, IUniverInstanceService as ge, IContextService as ee, DisposableCollection as lt, toDisposable as $, CommandType as y, LocaleService as w, useDependency as C, ICommandService as te, FOCUSING_SHEET as me, EDITOR_ACTIVATED as ve, UniverInstanceType as dt, RxDisposable as ht, Plugin as ut, merge as ft, IConfigService as pt } from "@univerjs/core";
5
+ import { IConfirmService as _t, IMessageService as Se, useObservable as D, ILayoutService as Ce, KeyCode as b, MetaKeys as x, MenuItemType as gt, getMenuHiddenObservable as mt, RibbonStartGroup as vt, ComponentManager as St, IMenuManagerService as Ct, IShortcutService as Rt, IDialogService as Mt } from "@univerjs/ui";
6
+ import { throttleTime as bt, BehaviorSubject as P, combineLatest as Re, debounceTime as xt, Subject as Me, fromEvent as yt, map as It, takeUntil as oe } from "rxjs";
7
+ import { MessageType as E, InputWithSlot as Ft, Pager as Dt, Button as N, FormLayout as M, Input as Pt, Select as G, FormDualColumnLayout as ce, Checkbox as le } from "@univerjs/design";
8
8
  import { RENDER_RAW_FORMULA_KEY as Ot } from "@univerjs/engine-render";
9
- import Tt, { forwardRef as W, useRef as J, createElement as xe, useCallback as p, Fragment as A, useEffect as j, useMemo as re, useImperativeHandle as Et } from "react";
10
- const Nt = "find-replace.config", $t = {};
9
+ import Tt, { forwardRef as U, useRef as H, createElement as be, useCallback as p, useEffect as A, useMemo as ie, useImperativeHandle as Et } from "react";
10
+ const Nt = "find-replace.config", de = {};
11
11
  var g = function() {
12
12
  return g = Object.assign || function(t) {
13
13
  for (var e, n = 1, i = arguments.length; n < i; n++) {
@@ -16,76 +16,76 @@ var g = function() {
16
16
  }
17
17
  return t;
18
18
  }, g.apply(this, arguments);
19
- }, At = function(t, e) {
19
+ }, $t = function(t, e) {
20
20
  var n = {};
21
21
  for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && e.indexOf(i) < 0 && (n[i] = t[i]);
22
22
  if (t != null && typeof Object.getOwnPropertySymbols == "function")
23
23
  for (var r = 0, i = Object.getOwnPropertySymbols(t); r < i.length; r++)
24
24
  e.indexOf(i[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, i[r]) && (n[i[r]] = t[i[r]]);
25
25
  return n;
26
- }, ye = W(function(t, e) {
27
- var n = t.icon, i = t.id, r = t.className, s = t.extend, a = At(t, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(i, " ").concat(r || "").trim(), l = J("_".concat(wt()));
28
- return Ie(n, "".concat(i), { defIds: n.defIds, idSuffix: l.current }, g({ ref: e, className: c }, a), s);
26
+ }, xe = U(function(t, e) {
27
+ var n = t.icon, i = t.id, r = t.className, s = t.extend, a = $t(t, ["icon", "id", "className", "extend"]), l = "univerjs-icon univerjs-icon-".concat(i, " ").concat(r || "").trim(), d = H("_".concat(jt()));
28
+ return ye(n, "".concat(i), { defIds: n.defIds, idSuffix: d.current }, g({ ref: e, className: l }, a), s);
29
29
  });
30
- function Ie(t, e, n, i, r) {
31
- return xe(t.tag, g(g({ key: e }, Lt(t, n, r)), i), (jt(t, n).children || []).map(function(s, a) {
32
- return Ie(s, "".concat(e, "-").concat(t.tag, "-").concat(a), n, void 0, r);
30
+ function ye(t, e, n, i, r) {
31
+ return be(t.tag, g(g({ key: e }, At(t, n, r)), i), (Lt(t, n).children || []).map(function(s, a) {
32
+ return ye(s, "".concat(e, "-").concat(t.tag, "-").concat(a), n, void 0, r);
33
33
  }));
34
34
  }
35
- function Lt(t, e, n) {
35
+ function At(t, e, n) {
36
36
  var i = g({}, t.attrs);
37
37
  n != null && n.colorChannel1 && i.fill === "colorChannel1" && (i.fill = n.colorChannel1);
38
38
  var r = e.defIds;
39
39
  return !r || r.length === 0 || (t.tag === "use" && i["xlink:href"] && (i["xlink:href"] = i["xlink:href"] + e.idSuffix), Object.entries(i).forEach(function(s) {
40
- var a = s[0], c = s[1];
41
- typeof c == "string" && (i[a] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
40
+ var a = s[0], l = s[1];
41
+ typeof l == "string" && (i[a] = l.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
42
42
  })), i;
43
43
  }
44
- function jt(t, e) {
44
+ function Lt(t, e) {
45
45
  var n, i = e.defIds;
46
46
  return !i || i.length === 0 ? t : t.tag === "defs" && (!((n = t.children) === null || n === void 0) && n.length) ? g(g({}, t), { children: t.children.map(function(r) {
47
47
  return typeof r.attrs.id == "string" && i && i.indexOf(r.attrs.id) > -1 ? g(g({}, r), { attrs: g(g({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
48
48
  }) }) : t;
49
49
  }
50
- function wt() {
50
+ function jt() {
51
51
  return Math.random().toString(36).substring(2, 8);
52
52
  }
53
- ye.displayName = "UniverIcon";
54
- var Ut = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" }, children: [{ tag: "mask", attrs: { id: "mask0_217_40", style: { maskType: "alpha" }, width: 17, height: 17, x: 0, y: 0, maskUnits: "userSpaceOnUse" }, children: [{ tag: "path", attrs: { fill: "#D9D9D9", d: "M0.9 0.09H16.9V16.09H0.9z" } }] }, { tag: "g", attrs: { mask: "url(#mask0_217_40)" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.39551 7.37266C2.39551 4.18105 4.98281 1.59375 8.17441 1.59375C11.366 1.59375 13.9533 4.18105 13.9533 7.37266C13.9533 8.72342 13.4898 9.96603 12.7133 10.95L15.1964 13.4331C15.4619 13.6986 15.4619 14.1291 15.1964 14.3946C14.9309 14.6601 14.5004 14.6601 14.2349 14.3946L11.7518 11.9115C10.7678 12.6881 9.52525 13.1516 8.17441 13.1516C4.98281 13.1516 2.39551 10.5642 2.39551 7.37266ZM8.17441 2.95349C5.73378 2.95349 3.75525 4.93202 3.75525 7.37266C3.75525 9.81333 5.73378 11.7918 8.17441 11.7918C10.6151 11.7918 12.5936 9.81333 12.5936 7.37266C12.5936 4.93202 10.6151 2.95349 8.17441 2.95349Z", fillRule: "evenodd", clipRule: "evenodd" } }] }] }, De = W(function(t, e) {
55
- return xe(ye, Object.assign({}, t, {
53
+ xe.displayName = "UniverIcon";
54
+ var wt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 17", width: "1em", height: "1em" }, children: [{ tag: "mask", attrs: { id: "mask0_217_40", style: { maskType: "alpha" }, width: 17, height: 17, x: 0, y: 0, maskUnits: "userSpaceOnUse" }, children: [{ tag: "path", attrs: { fill: "#D9D9D9", d: "M0.9 0.09H16.9V16.09H0.9z" } }] }, { tag: "g", attrs: { mask: "url(#mask0_217_40)" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.39551 7.37266C2.39551 4.18105 4.98281 1.59375 8.17441 1.59375C11.366 1.59375 13.9533 4.18105 13.9533 7.37266C13.9533 8.72342 13.4898 9.96603 12.7133 10.95L15.1964 13.4331C15.4619 13.6986 15.4619 14.1291 15.1964 14.3946C14.9309 14.6601 14.5004 14.6601 14.2349 14.3946L11.7518 11.9115C10.7678 12.6881 9.52525 13.1516 8.17441 13.1516C4.98281 13.1516 2.39551 10.5642 2.39551 7.37266ZM8.17441 2.95349C5.73378 2.95349 3.75525 4.93202 3.75525 7.37266C3.75525 9.81333 5.73378 11.7918 8.17441 11.7918C10.6151 11.7918 12.5936 9.81333 12.5936 7.37266C12.5936 4.93202 10.6151 2.95349 8.17441 2.95349Z", fillRule: "evenodd", clipRule: "evenodd" } }] }] }, Ie = U(function(t, e) {
55
+ return be(xe, Object.assign({}, t, {
56
56
  id: "search-single-16",
57
57
  ref: e,
58
- icon: Ut
58
+ icon: wt
59
59
  }));
60
60
  });
61
- De.displayName = "SearchSingle16";
62
- const Fe = "FIND_REPLACE_INPUT_FOCUS", Pe = "FIND_REPLACE_DIALOG_FOCUS", Oe = "FIND_REPLACE_REPLACE_REVEALED";
63
- var Bt = Object.defineProperty, Wt = Object.getOwnPropertyDescriptor, Te = (t, e, n, i) => {
64
- for (var r = i > 1 ? void 0 : i ? Wt(e, n) : e, s = t.length - 1, a; s >= 0; s--)
61
+ Ie.displayName = "SearchSingle16";
62
+ const Fe = "FIND_REPLACE_INPUT_FOCUS", De = "FIND_REPLACE_DIALOG_FOCUS", Pe = "FIND_REPLACE_REPLACE_REVEALED";
63
+ var Ut = Object.defineProperty, Bt = Object.getOwnPropertyDescriptor, Oe = (t, e, n, i) => {
64
+ for (var r = i > 1 ? void 0 : i ? Bt(e, n) : e, s = t.length - 1, a; s >= 0; s--)
65
65
  (a = t[s]) && (r = (i ? a(e, n, r) : a(r)) || r);
66
- return i && r && Bt(e, n, r), r;
67
- }, K = (t, e) => (n, i) => e(n, i, t);
68
- class Pi extends te {
66
+ return i && r && Ut(e, n, r), r;
67
+ }, q = (t, e) => (n, i) => e(n, i, t);
68
+ class Di extends X {
69
69
  }
70
- const m = lt("find-replace.service");
71
- function Gt(t) {
70
+ const m = ct("find-replace.service");
71
+ function Wt(t) {
72
72
  return typeof t.findString < "u" || typeof t.inputtingFindString < "u" || typeof t.findDirection < "u" || typeof t.matchesTheWholeCell < "u" || typeof t.caseSensitive < "u" || typeof t.findScope < "u" || typeof t.findBy < "u";
73
73
  }
74
- let z = class extends te {
74
+ let J = class extends X {
75
75
  constructor(e, n, i) {
76
76
  super();
77
- o(this, "currentMatch$", new P(null));
78
- o(this, "replaceables$", new P([]));
77
+ c(this, "currentMatch$", new P(null));
78
+ c(this, "replaceables$", new P([]));
79
79
  /** All find models returned by providers. */
80
- o(this, "_findModels", []);
80
+ c(this, "_findModels", []);
81
81
  /** The find model that the current match is from. */
82
- o(this, "_matchingModel", null);
83
- o(this, "_matches", []);
84
- o(this, "_currentSearchingDisposables", null);
82
+ c(this, "_matchingModel", null);
83
+ c(this, "_matches", []);
84
+ c(this, "_currentSearchingDisposables", null);
85
85
  this._state = e, this._providers = n, this._univerInstanceService = i, this.disposeWithMe(
86
86
  this._state.stateUpdates$.pipe(bt(200, void 0, { leading: !0, trailing: !0 })).subscribe(async (r) => {
87
87
  const s = this._state.state;
88
- Gt(r) && (s.findString !== "" && !s.replaceRevealed ? (await this._startSearching(), this._state.changeState({ findCompleted: !0 })) : r.replaceRevealed !== !0 && this._stopSearching());
88
+ Wt(r) && (s.findString !== "" && !s.replaceRevealed ? (await this._startSearching(), this._state.changeState({ findCompleted: !0 })) : r.replaceRevealed !== !0 && this._stopSearching());
89
89
  })
90
90
  );
91
91
  }
@@ -93,7 +93,7 @@ let z = class extends te {
93
93
  return this._findModels.length > 0;
94
94
  }
95
95
  dispose() {
96
- super.dispose(), this._stopSearching(), this.currentMatch$.complete(), this.replaceables$.complete(), this._state.changeState({ ...se(), revealed: !1 });
96
+ super.dispose(), this._stopSearching(), this.currentMatch$.complete(), this.replaceables$.complete(), this._state.changeState({ ...ne(), revealed: !1 });
97
97
  }
98
98
  async start() {
99
99
  if (!this._state.findString)
@@ -129,14 +129,14 @@ let z = class extends te {
129
129
  }
130
130
  // When a document's content changes, we should reset all matches and try to move to the next match.
131
131
  _subscribeToModelsChanges(e) {
132
- const n = this._currentSearchingDisposables = new dt(), i = Me(e.map((r) => r.matchesUpdate$)).pipe(xt(220)).subscribe(([...r]) => {
132
+ const n = this._currentSearchingDisposables = new lt(), i = Re(e.map((r) => r.matchesUpdate$)).pipe(xt(220)).subscribe(([...r]) => {
133
133
  const s = this._matches = r.flat();
134
134
  s.length ? (this._moveToInitialMatch(this._findModels, !0), this._state.changeState({ matchesCount: s.length }), this.replaceables$.next(s.filter((a) => a.replaceable))) : (this._state.changeState({ matchesCount: 0, matchesPosition: 0 }), this.replaceables$.next([]));
135
135
  });
136
- e.forEach((r) => n.add(L(r.activelyChangingMatch$.subscribe((s) => {
137
- const a = this._matches.findIndex((c) => c === s);
136
+ e.forEach((r) => n.add($(r.activelyChangingMatch$.subscribe((s) => {
137
+ const a = this._matches.findIndex((l) => l === s);
138
138
  this._state.changeState({ matchesPosition: a + 1 });
139
- })))), n.add(L(i));
139
+ })))), n.add($(i));
140
140
  }
141
141
  async replace() {
142
142
  return this._matchingModel ? this._matchingModel.replace(this._state.replaceString) : !1;
@@ -188,9 +188,9 @@ let z = class extends te {
188
188
  } else {
189
189
  const i = this._findModels.length, r = this._findModels.findIndex((a) => a === this._matchingModel);
190
190
  for (let a = (r - 1 + i) % i; a !== r; ) {
191
- const c = this._findModels[a], l = c.moveToPreviousMatch({ ignoreSelection: !0 });
192
- if (l) {
193
- this._matchingModel = c, this._markMatch(l);
191
+ const l = this._findModels[a], d = l.moveToPreviousMatch({ ignoreSelection: !0 });
192
+ if (d) {
193
+ this._matchingModel = l, this._markMatch(d);
194
194
  return;
195
195
  }
196
196
  a = (a - 1) % i;
@@ -214,11 +214,11 @@ let z = class extends te {
214
214
  return this._moveToNextUnitMatch(r), 0;
215
215
  }
216
216
  };
217
- z = Te([
218
- K(2, me)
219
- ], z);
220
- var Y = /* @__PURE__ */ ((t) => (t.ROW = "row", t.COLUMN = "column", t))(Y || {}), Z = /* @__PURE__ */ ((t) => (t.VALUE = "value", t.FORMULA = "formula", t))(Z || {}), Q = /* @__PURE__ */ ((t) => (t.SUBUNIT = "subunit", t.UNIT = "unit", t))(Q || {});
221
- function se() {
217
+ J = Oe([
218
+ q(2, ge)
219
+ ], J);
220
+ var K = /* @__PURE__ */ ((t) => (t.ROW = "row", t.COLUMN = "column", t))(K || {}), z = /* @__PURE__ */ ((t) => (t.VALUE = "value", t.FORMULA = "formula", t))(z || {}), Y = /* @__PURE__ */ ((t) => (t.SUBUNIT = "subunit", t.UNIT = "unit", t))(Y || {});
221
+ function ne() {
222
222
  return {
223
223
  caseSensitive: !1,
224
224
  findBy: "value",
@@ -235,25 +235,25 @@ function se() {
235
235
  revealed: !0
236
236
  };
237
237
  }
238
- class kt {
238
+ class Gt {
239
239
  constructor() {
240
- o(this, "_stateUpdates$", new be());
241
- o(this, "stateUpdates$", this._stateUpdates$.asObservable());
242
- o(this, "_state$", new P(se()));
243
- o(this, "state$", this._state$.asObservable());
244
- o(this, "_findString", "");
245
- o(this, "_inputtingFindString", "");
246
- o(this, "_replaceString", "");
247
- o(this, "_revealed", !1);
248
- o(this, "_replaceRevealed", !1);
249
- o(this, "_matchesPosition", 0);
250
- o(this, "_matchesCount", 0);
251
- o(this, "_caseSensitive", !0);
252
- o(this, "_matchesTheWholeCell", !1);
253
- o(this, "_findDirection", "row");
254
- o(this, "_findScope", "subunit");
255
- o(this, "_findBy", "value");
256
- o(this, "_findCompleted", !1);
240
+ c(this, "_stateUpdates$", new Me());
241
+ c(this, "stateUpdates$", this._stateUpdates$.asObservable());
242
+ c(this, "_state$", new P(ne()));
243
+ c(this, "state$", this._state$.asObservable());
244
+ c(this, "_findString", "");
245
+ c(this, "_inputtingFindString", "");
246
+ c(this, "_replaceString", "");
247
+ c(this, "_revealed", !1);
248
+ c(this, "_replaceRevealed", !1);
249
+ c(this, "_matchesPosition", 0);
250
+ c(this, "_matchesCount", 0);
251
+ c(this, "_caseSensitive", !0);
252
+ c(this, "_matchesTheWholeCell", !1);
253
+ c(this, "_findDirection", "row");
254
+ c(this, "_findScope", "subunit");
255
+ c(this, "_findBy", "value");
256
+ c(this, "_findCompleted", !1);
257
257
  }
258
258
  get state() {
259
259
  return this._state$.getValue();
@@ -317,18 +317,18 @@ class kt {
317
317
  }), this._stateUpdates$.next(i));
318
318
  }
319
319
  }
320
- let X = class extends te {
320
+ let Z = class extends X {
321
321
  constructor(e, n) {
322
322
  super();
323
- o(this, "_providers", /* @__PURE__ */ new Set());
324
- o(this, "_state", new kt());
325
- o(this, "_model");
326
- o(this, "_currentMatch$", new P(null));
327
- o(this, "currentMatch$", this._currentMatch$.asObservable());
328
- o(this, "_replaceables$", new P([]));
329
- o(this, "replaceables$", this._replaceables$.asObservable());
330
- o(this, "_focusSignal$", new be());
331
- o(this, "focusSignal$", this._focusSignal$.asObservable());
323
+ c(this, "_providers", /* @__PURE__ */ new Set());
324
+ c(this, "_state", new Gt());
325
+ c(this, "_model");
326
+ c(this, "_currentMatch$", new P(null));
327
+ c(this, "currentMatch$", this._currentMatch$.asObservable());
328
+ c(this, "_replaceables$", new P([]));
329
+ c(this, "replaceables$", this._replaceables$.asObservable());
330
+ c(this, "_focusSignal$", new Me());
331
+ c(this, "focusSignal$", this._focusSignal$.asObservable());
332
332
  this._injector = e, this._contextService = n;
333
333
  }
334
334
  get stateUpdates$() {
@@ -403,8 +403,8 @@ let X = class extends te {
403
403
  start(e = !1) {
404
404
  if (this._providers.size === 0)
405
405
  return !1;
406
- this._model = this._injector.createInstance(z, this._state, this._providers), this._model.currentMatch$.subscribe((i) => this._currentMatch$.next(i)), this._model.replaceables$.subscribe((i) => this._replaceables$.next(i));
407
- const n = se();
406
+ this._model = this._injector.createInstance(J, this._state, this._providers), this._model.currentMatch$.subscribe((i) => this._currentMatch$.next(i)), this._model.replaceables$.subscribe((i) => this._replaceables$.next(i));
407
+ const n = ne();
408
408
  return e && (n.replaceRevealed = !0), this._state.changeState(n), this._toggleRevealReplace(e), !0;
409
409
  }
410
410
  find() {
@@ -416,44 +416,44 @@ let X = class extends te {
416
416
  (e = this._model) == null || e.dispose(), this._model = null, this._toggleDisplayRawFormula(!1), this._toggleRevealReplace(!1);
417
417
  }
418
418
  registerFindReplaceProvider(e) {
419
- return this._providers.add(e), L(() => this._providers.delete(e));
419
+ return this._providers.add(e), $(() => this._providers.delete(e));
420
420
  }
421
421
  _toggleRevealReplace(e) {
422
- this._contextService.setContextValue(Oe, e);
422
+ this._contextService.setContextValue(Pe, e);
423
423
  }
424
424
  _toggleDisplayRawFormula(e) {
425
425
  this._contextService.setContextValue(Ot, e);
426
426
  }
427
427
  };
428
- X = Te([
429
- K(0, D(ee)),
430
- K(1, ie)
431
- ], X);
432
- const Ee = {
428
+ Z = Oe([
429
+ q(0, F(Q)),
430
+ q(1, ee)
431
+ ], Z);
432
+ const Te = {
433
433
  id: "ui.command.replace-current-match",
434
434
  type: y.COMMAND,
435
435
  handler: (t) => t.get(m).replace()
436
- }, Vt = "CONFIRM_REPLACE_ALL", Ne = {
436
+ }, kt = "CONFIRM_REPLACE_ALL", Ee = {
437
437
  id: "ui.command.replace-all-matches",
438
438
  type: y.COMMAND,
439
439
  handler: async (t) => {
440
- const e = t.get(_t), n = t.get(B), i = t.get(Ce);
440
+ const e = t.get(_t), n = t.get(w), i = t.get(Se);
441
441
  if (!await e.confirm({
442
- id: Vt,
442
+ id: kt,
443
443
  title: { title: n.t("find-replace.replace.confirm.title") },
444
444
  cancelText: n.t("button.cancel"),
445
445
  confirmText: n.t("button.confirm")
446
446
  }))
447
447
  return !1;
448
- const s = await t.get(m).replaceAll(), { success: a, failure: c } = s;
449
- return c > 0 ? (a === 0 ? i.show({
450
- type: N.Error,
448
+ const s = await t.get(m).replaceAll(), { success: a, failure: l } = s;
449
+ return l > 0 ? (a === 0 ? i.show({
450
+ type: E.Error,
451
451
  content: n.t("find-replace.replace.all-failure")
452
452
  }) : i.show({
453
- type: N.Warning,
454
- content: n.t("find-replace.replace.partial-success", `${a}`, `${c}`)
453
+ type: E.Warning,
454
+ content: n.t("find-replace.replace.partial-success", `${a}`, `${l}`)
455
455
  }), !1) : (i.show({
456
- type: N.Success,
456
+ type: E.Success,
457
457
  content: n.t("find-replace.replace.all-success", `${a}`)
458
458
  }), !0);
459
459
  }
@@ -464,23 +464,23 @@ const Ee = {
464
464
  const e = t.get(m);
465
465
  return e.revealed ? e.focusFindInput() : e.start(), !0;
466
466
  }
467
- }, ae = {
467
+ }, re = {
468
468
  id: "ui.operation.open-replace-dialog",
469
469
  type: y.OPERATION,
470
470
  handler: (t) => {
471
471
  const e = t.get(m);
472
472
  return e.revealed ? e.replaceRevealed ? e.focusFindInput() : e.revealReplace() : e.start(!0), !0;
473
473
  }
474
- }, $e = {
474
+ }, Ne = {
475
475
  type: y.OPERATION,
476
476
  id: "ui.operation.go-to-next-match",
477
477
  handler: (t) => (t.get(m).moveToNextMatch(), !0)
478
- }, Ae = {
478
+ }, $e = {
479
479
  type: y.OPERATION,
480
480
  id: "ui.operation.go-to-previous-match",
481
481
  handler: (t) => (t.get(m).moveToPreviousMatch(), !0)
482
482
  };
483
- var H = { exports: {} }, I = {};
483
+ var k = { exports: {} }, I = {};
484
484
  /**
485
485
  * @license React
486
486
  * react-jsx-runtime.production.min.js
@@ -490,34 +490,41 @@ var H = { exports: {} }, I = {};
490
490
  * This source code is licensed under the MIT license found in the
491
491
  * LICENSE file in the root directory of this source tree.
492
492
  */
493
- var ue;
494
- function Ht() {
495
- if (ue) return I;
496
- ue = 1;
493
+ var he;
494
+ function Vt() {
495
+ if (he) return I;
496
+ he = 1;
497
497
  var t = Tt, e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, r = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
498
- function a(c, l, _) {
498
+ function a(l, d, _) {
499
499
  var h, u = {}, R = null, v = null;
500
- _ !== void 0 && (R = "" + _), l.key !== void 0 && (R = "" + l.key), l.ref !== void 0 && (v = l.ref);
501
- for (h in l) i.call(l, h) && !s.hasOwnProperty(h) && (u[h] = l[h]);
502
- if (c && c.defaultProps) for (h in l = c.defaultProps, l) u[h] === void 0 && (u[h] = l[h]);
503
- return { $$typeof: e, type: c, key: R, ref: v, props: u, _owner: r.current };
500
+ _ !== void 0 && (R = "" + _), d.key !== void 0 && (R = "" + d.key), d.ref !== void 0 && (v = d.ref);
501
+ for (h in d) i.call(d, h) && !s.hasOwnProperty(h) && (u[h] = d[h]);
502
+ if (l && l.defaultProps) for (h in d = l.defaultProps, d) u[h] === void 0 && (u[h] = d[h]);
503
+ return { $$typeof: e, type: l, key: R, ref: v, props: u, _owner: r.current };
504
504
  }
505
505
  return I.Fragment = n, I.jsx = a, I.jsxs = a, I;
506
506
  }
507
- var fe;
508
- function qt() {
509
- return fe || (fe = 1, H.exports = Ht()), H.exports;
507
+ var ue;
508
+ function Ht() {
509
+ return ue || (ue = 1, k.exports = Vt()), k.exports;
510
510
  }
511
- var d = qt();
512
- function Le(t) {
513
- const { findCompleted: e, localeService: n, matchesCount: i, matchesPosition: r, findString: s, findReplaceService: a, onChange: c, ...l } = t, h = e && i === 0 ? n.t("find-replace.dialog.no-result") : i === 0 ? " " : void 0;
514
- return /* @__PURE__ */ d.jsx(
515
- Dt,
511
+ var o = Ht();
512
+ const qt = "univer-find-replace-dialog-container", Jt = "univer-find-replace-expand-container", Kt = "univer-button-text", zt = "univer-find-replace-buttons-group", Yt = "univer-find-replace-buttons-group-right", L = {
513
+ findReplaceDialogContainer: qt,
514
+ findReplaceExpandContainer: Jt,
515
+ buttonText: Kt,
516
+ findReplaceButtonsGroup: zt,
517
+ findReplaceButtonsGroupRight: Yt
518
+ };
519
+ function Ae(t) {
520
+ const { findCompleted: e, localeService: n, matchesCount: i, matchesPosition: r, findString: s, findReplaceService: a, onChange: l, ...d } = t, h = e && i === 0 ? n.t("find-replace.dialog.no-result") : i === 0 ? " " : void 0;
521
+ return /* @__PURE__ */ o.jsx(
522
+ Ft,
516
523
  {
517
524
  autoFocus: !0,
518
525
  placeholder: n.t("find-replace.dialog.find-placeholder"),
519
- slot: /* @__PURE__ */ d.jsx(
520
- Ft,
526
+ slot: /* @__PURE__ */ o.jsx(
527
+ Dt,
521
528
  {
522
529
  loop: !0,
523
530
  text: h,
@@ -529,19 +536,12 @@ function Le(t) {
529
536
  }
530
537
  ),
531
538
  value: s,
532
- onChange: (u) => c == null ? void 0 : c(u),
533
- ...l
539
+ onChange: (u) => l == null ? void 0 : l(u),
540
+ ...d
534
541
  }
535
542
  );
536
543
  }
537
- const Jt = "univer-find-replace-dialog-container", Kt = "univer-find-replace-expand-container", zt = "univer-button-text", Yt = "univer-find-replace-buttons-group", Zt = "univer-find-replace-buttons-group-right", w = {
538
- findReplaceDialogContainer: Jt,
539
- findReplaceExpandContainer: Kt,
540
- buttonText: zt,
541
- findReplaceButtonsGroup: Yt,
542
- findReplaceButtonsGroupRight: Zt
543
- };
544
- function je(t, e) {
544
+ function Le(t, e) {
545
545
  const n = p(() => {
546
546
  var r;
547
547
  (r = document.querySelector(".univer-find-input input")) == null || r.focus();
@@ -549,111 +549,109 @@ function je(t, e) {
549
549
  const r = document.querySelectorAll(".univer-find-replace-dialog-container .univer-select-selection-search-input");
550
550
  return Array.from(r).some((s) => s === document.activeElement);
551
551
  }, []);
552
- return Et(e, () => ({ focus: n, selectHasFocus: i })), j(() => {
552
+ return Et(e, () => ({ focus: n, selectHasFocus: i })), A(() => {
553
553
  const r = t.focusSignal$.subscribe(() => n());
554
554
  return () => r.unsubscribe();
555
555
  }, [t, n]), { focus: n, selectHasFocus: i };
556
556
  }
557
- const Qt = W(function(e, n) {
558
- const i = C(B), r = C(m), s = C(ne), a = F(r.state$, void 0, !0), { findCompleted: c, findString: l, matchesCount: _, matchesPosition: h } = a, u = p(() => {
559
- s.executeCommand(ae.id);
557
+ const Zt = U(function(e, n) {
558
+ const i = C(w), r = C(m), s = C(te), a = D(r.state$, void 0, !0), { findCompleted: l, findString: d, matchesCount: _, matchesPosition: h } = a, u = p(() => {
559
+ s.executeCommand(re.id);
560
560
  }, [s]), R = p((v) => r.changeFindString(v), [r]);
561
- return je(r, n), /* @__PURE__ */ d.jsxs(A, { children: [
562
- /* @__PURE__ */ d.jsx(
563
- Le,
561
+ return Le(r, n), /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
562
+ /* @__PURE__ */ o.jsx(
563
+ Ae,
564
564
  {
565
- findCompleted: c,
565
+ findCompleted: l,
566
566
  className: "univer-find-input",
567
567
  matchesCount: _,
568
568
  matchesPosition: h,
569
569
  findReplaceService: r,
570
570
  localeService: i,
571
- findString: l,
571
+ findString: d,
572
572
  onChange: R
573
573
  }
574
574
  ),
575
- /* @__PURE__ */ d.jsx("div", { className: w.findReplaceExpandContainer, children: /* @__PURE__ */ d.jsx($, { type: "text", size: "small", onClick: u, children: i.t("find-replace.dialog.advanced-finding") }) })
575
+ /* @__PURE__ */ o.jsx("div", { className: L.findReplaceExpandContainer, children: /* @__PURE__ */ o.jsx(N, { type: "text", size: "small", onClick: u, children: i.t("find-replace.dialog.advanced-finding") }) })
576
576
  ] });
577
- }), Xt = W(function(e, n) {
578
- const i = C(m), r = C(B), s = C(ne), a = C(Ce), c = F(i.currentMatch$, void 0, !0), l = F(i.replaceables$, void 0, !0), _ = F(i.state$, void 0, !0), {
577
+ }), Qt = U(function(e, n) {
578
+ const i = C(m), r = C(w), s = C(te), a = C(Se), l = D(i.currentMatch$, void 0, !0), d = D(i.replaceables$, void 0, !0), _ = D(i.state$, void 0, !0), {
579
579
  matchesCount: h,
580
580
  matchesPosition: u,
581
581
  findString: R,
582
582
  inputtingFindString: v,
583
- replaceString: Be,
584
- caseSensitive: We,
585
- matchesTheWholeCell: Ge,
586
- findDirection: ke,
587
- findScope: Ve,
588
- findBy: He,
589
- findCompleted: k
590
- } = _, qe = v.length === 0, Je = h === 0 || !(c != null && c.replaceable), Ke = l.length === 0, ze = p(
583
+ replaceString: Ue,
584
+ caseSensitive: Be,
585
+ matchesTheWholeCell: We,
586
+ findDirection: Ge,
587
+ findScope: ke,
588
+ findBy: Ve,
589
+ findCompleted: W
590
+ } = _, He = v.length === 0, qe = h === 0 || !(l != null && l.replaceable), Je = d.length === 0, Ke = p(
591
591
  (f) => i.changeInputtingFindString(f),
592
592
  [i]
593
- ), Ye = p(
593
+ ), ze = p(
594
594
  (f) => i.changeReplaceString(f),
595
595
  [i]
596
- ), { focus: Ze } = je(i, n), Qe = p(() => {
596
+ ), { focus: Ye } = Le(i, n), Ze = p(() => {
597
597
  R === v ? i.moveToNextMatch() : (i.changeFindString(v), i.find());
598
- }, [R, v, i]), Xe = p(() => s.executeCommand(Ee.id), [s]), et = p(async () => {
599
- await s.executeCommand(Ne.id), Ze();
600
- }, [s]), tt = p((f) => {
598
+ }, [R, v, i]), Qe = p(() => s.executeCommand(Te.id), [s]), Xe = p(async () => {
599
+ await s.executeCommand(Ee.id), Ye();
600
+ }, [s]), et = p((f) => {
601
601
  i.changeFindDirection(f);
602
- }, [i]), it = p((f) => {
602
+ }, [i]), tt = p((f) => {
603
603
  i.changeFindScope(f);
604
- }, [i]), nt = p((f) => {
604
+ }, [i]), it = p((f) => {
605
605
  i.changeFindBy(f);
606
- }, [i]), rt = ti(r), st = ii(r), at = ni(r);
607
- return j(() => {
608
- const f = k && h === 0;
609
- let E = null;
610
- return f && (E = a.show({
606
+ }, [i]), nt = ei(r), rt = ti(r), st = ii(r);
607
+ return A(() => {
608
+ W && h === 0 && a.show({
611
609
  content: r.t("find-replace.dialog.no-match"),
612
- type: N.Warning,
610
+ type: E.Warning,
613
611
  duration: 5e3
614
- })), () => E == null ? void 0 : E.dispose();
615
- }, [k, h, a, r]), /* @__PURE__ */ d.jsxs(A, { children: [
616
- /* @__PURE__ */ d.jsx(M, { label: r.t("find-replace.dialog.find"), children: /* @__PURE__ */ d.jsx(
617
- Le,
612
+ });
613
+ }, [W, h, a, r]), /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
614
+ /* @__PURE__ */ o.jsx(M, { label: r.t("find-replace.dialog.find"), children: /* @__PURE__ */ o.jsx(
615
+ Ae,
618
616
  {
619
- findCompleted: k,
617
+ findCompleted: W,
620
618
  className: "univer-find-input",
621
619
  matchesCount: h,
622
620
  matchesPosition: u,
623
621
  findReplaceService: i,
624
622
  localeService: r,
625
623
  findString: v,
626
- onChange: ze
624
+ onChange: Ke
627
625
  }
628
626
  ) }),
629
- /* @__PURE__ */ d.jsx(M, { label: r.t("find-replace.dialog.replace"), children: /* @__PURE__ */ d.jsx(
627
+ /* @__PURE__ */ o.jsx(M, { label: r.t("find-replace.dialog.replace"), children: /* @__PURE__ */ o.jsx(
630
628
  Pt,
631
629
  {
632
630
  placeholder: r.t("find-replace.dialog.replace-placeholder"),
633
- value: Be,
634
- onChange: (f) => Ye(f)
631
+ value: Ue,
632
+ onChange: (f) => ze(f)
635
633
  }
636
634
  ) }),
637
- /* @__PURE__ */ d.jsx(M, { label: r.t("find-replace.dialog.find-direction.title"), children: /* @__PURE__ */ d.jsx(V, { value: ke, options: st, onChange: tt }) }),
638
- /* @__PURE__ */ d.jsx(de, { children: /* @__PURE__ */ d.jsxs(A, { children: [
639
- /* @__PURE__ */ d.jsx(M, { label: r.t("find-replace.dialog.find-scope.title"), children: /* @__PURE__ */ d.jsx(V, { value: Ve, options: rt, onChange: it }) }),
640
- /* @__PURE__ */ d.jsx(M, { label: r.t("find-replace.dialog.find-by.title"), children: /* @__PURE__ */ d.jsx(V, { value: He, options: at, onChange: nt }) })
635
+ /* @__PURE__ */ o.jsx(M, { label: r.t("find-replace.dialog.find-direction.title"), children: /* @__PURE__ */ o.jsx(G, { value: Ge, options: rt, onChange: et }) }),
636
+ /* @__PURE__ */ o.jsx(ce, { children: /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
637
+ /* @__PURE__ */ o.jsx(M, { label: r.t("find-replace.dialog.find-scope.title"), children: /* @__PURE__ */ o.jsx(G, { value: ke, options: nt, onChange: tt }) }),
638
+ /* @__PURE__ */ o.jsx(M, { label: r.t("find-replace.dialog.find-by.title"), children: /* @__PURE__ */ o.jsx(G, { value: Ve, options: st, onChange: it }) })
641
639
  ] }) }),
642
- /* @__PURE__ */ d.jsx(de, { children: /* @__PURE__ */ d.jsxs(A, { children: [
643
- /* @__PURE__ */ d.jsx(M, { children: /* @__PURE__ */ d.jsx(
644
- he,
640
+ /* @__PURE__ */ o.jsx(ce, { children: /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
641
+ /* @__PURE__ */ o.jsx(M, { children: /* @__PURE__ */ o.jsx(
642
+ le,
645
643
  {
646
- checked: We,
644
+ checked: Be,
647
645
  onChange: (f) => {
648
646
  i.changeCaseSensitive(f);
649
647
  },
650
648
  children: r.t("find-replace.dialog.case-sensitive")
651
649
  }
652
650
  ) }),
653
- /* @__PURE__ */ d.jsx(M, { children: /* @__PURE__ */ d.jsx(
654
- he,
651
+ /* @__PURE__ */ o.jsx(M, { children: /* @__PURE__ */ o.jsx(
652
+ le,
655
653
  {
656
- checked: Ge,
654
+ checked: We,
657
655
  onChange: (f) => {
658
656
  i.changeMatchesTheWholeCell(f);
659
657
  },
@@ -661,153 +659,153 @@ const Qt = W(function(e, n) {
661
659
  }
662
660
  ) })
663
661
  ] }) }),
664
- /* @__PURE__ */ d.jsxs("div", { className: w.findReplaceButtonsGroup, children: [
665
- /* @__PURE__ */ d.jsx($, { type: "primary", onClick: Qe, disabled: qe, children: r.t("find-replace.dialog.find") }),
666
- /* @__PURE__ */ d.jsxs("span", { className: w.findReplaceButtonsGroupRight, children: [
667
- /* @__PURE__ */ d.jsx($, { disabled: Je, onClick: Xe, children: r.t("find-replace.dialog.replace") }),
668
- /* @__PURE__ */ d.jsx($, { disabled: Ke, onClick: et, children: r.t("find-replace.dialog.replace-all") })
662
+ /* @__PURE__ */ o.jsxs("div", { className: L.findReplaceButtonsGroup, children: [
663
+ /* @__PURE__ */ o.jsx(N, { type: "primary", onClick: Ze, disabled: He, children: r.t("find-replace.dialog.find") }),
664
+ /* @__PURE__ */ o.jsxs("span", { className: L.findReplaceButtonsGroupRight, children: [
665
+ /* @__PURE__ */ o.jsx(N, { disabled: qe, onClick: Qe, children: r.t("find-replace.dialog.replace") }),
666
+ /* @__PURE__ */ o.jsx(N, { disabled: Je, onClick: Xe, children: r.t("find-replace.dialog.replace-all") })
669
667
  ] })
670
668
  ] })
671
669
  ] });
672
670
  });
673
- function ei() {
674
- const t = C(m), e = C(Re), n = C(ie), i = F(t.state$, void 0, !0), r = J(null);
675
- j(() => {
676
- let l;
677
- return r.current && (l = e.registerContainerElement(r.current)), () => l == null ? void 0 : l.dispose();
671
+ function Xt() {
672
+ const t = C(m), e = C(Ce), n = C(ee), i = D(t.state$, void 0, !0), r = H(null);
673
+ A(() => {
674
+ let d;
675
+ return r.current && (d = e.registerContainerElement(r.current)), () => d == null ? void 0 : d.dispose();
678
676
  }, [e]);
679
- const s = J(null), a = p(
680
- (l) => n.setContextValue(Pe, l),
677
+ const s = H(null), a = p(
678
+ (d) => n.setContextValue(De, d),
681
679
  [n]
682
- ), c = p(
683
- (l) => n.setContextValue(Fe, l),
680
+ ), l = p(
681
+ (d) => n.setContextValue(Fe, d),
684
682
  [n]
685
683
  );
686
- return j(() => {
684
+ return A(() => {
687
685
  var _;
688
- const l = yt(document, "focusin").subscribe((h) => {
686
+ const d = yt(document, "focusin").subscribe((h) => {
689
687
  var u;
690
- h.target && ((u = r.current) != null && u.contains(h.target)) ? a(!0) : a(!1), !s.current || !s.current.selectHasFocus() ? c(!0) : c(!1);
688
+ h.target && ((u = r.current) != null && u.contains(h.target)) ? a(!0) : a(!1), !s.current || !s.current.selectHasFocus() ? l(!0) : l(!1);
691
689
  });
692
- return (_ = s.current) == null || _.focus(), a(!0), c(!0), () => {
693
- l.unsubscribe(), a(!1);
690
+ return (_ = s.current) == null || _.focus(), a(!0), l(!0), () => {
691
+ d.unsubscribe(), a(!1);
694
692
  };
695
- }, [a, c]), /* @__PURE__ */ d.jsx("div", { className: w.findReplaceDialogContainer, ref: r, children: i.replaceRevealed ? /* @__PURE__ */ d.jsx(Xt, { ref: s }) : /* @__PURE__ */ d.jsx(Qt, { ref: s }) });
693
+ }, [a, l]), /* @__PURE__ */ o.jsx("div", { className: L.findReplaceDialogContainer, ref: r, children: i.replaceRevealed ? /* @__PURE__ */ o.jsx(Qt, { ref: s }) : /* @__PURE__ */ o.jsx(Zt, { ref: s }) });
696
694
  }
697
- function ti(t) {
695
+ function ei(t) {
698
696
  const e = t.getCurrentLocale();
699
- return re(() => [
700
- { label: t.t("find-replace.dialog.find-scope.current-sheet"), value: Q.SUBUNIT },
701
- { label: t.t("find-replace.dialog.find-scope.workbook"), value: Q.UNIT }
697
+ return ie(() => [
698
+ { label: t.t("find-replace.dialog.find-scope.current-sheet"), value: Y.SUBUNIT },
699
+ { label: t.t("find-replace.dialog.find-scope.workbook"), value: Y.UNIT }
702
700
  ], [e]);
703
701
  }
704
- function ii(t) {
702
+ function ti(t) {
705
703
  const e = t.getCurrentLocale();
706
- return re(() => [
707
- { label: t.t("find-replace.dialog.find-direction.row"), value: Y.ROW },
708
- { label: t.t("find-replace.dialog.find-direction.column"), value: Y.COLUMN }
704
+ return ie(() => [
705
+ { label: t.t("find-replace.dialog.find-direction.row"), value: K.ROW },
706
+ { label: t.t("find-replace.dialog.find-direction.column"), value: K.COLUMN }
709
707
  ], [e]);
710
708
  }
711
- function ni(t) {
709
+ function ii(t) {
712
710
  const e = t.getCurrentLocale();
713
- return re(() => [
714
- { label: t.t("find-replace.dialog.find-by.value"), value: Z.VALUE },
715
- { label: t.t("find-replace.dialog.find-by.formula"), value: Z.FORMULA }
711
+ return ie(() => [
712
+ { label: t.t("find-replace.dialog.find-by.value"), value: z.VALUE },
713
+ { label: t.t("find-replace.dialog.find-by.formula"), value: z.FORMULA }
716
714
  ], [e]);
717
715
  }
718
716
  function T(t) {
719
- return t.getContextValue(Pe);
717
+ return t.getContextValue(De);
720
718
  }
721
- function ri(t) {
722
- return t.getContextValue(Oe);
719
+ function ni(t) {
720
+ return t.getContextValue(Pe);
723
721
  }
724
- function we(t) {
722
+ function je(t) {
725
723
  return t.getContextValue(Fe);
726
724
  }
727
- const G = "7_find-replace-shortcuts";
728
- function oe(t) {
729
- return t.getContextValue(ve);
725
+ const B = "7_find-replace-shortcuts";
726
+ function se(t) {
727
+ return t.getContextValue(me);
730
728
  }
731
- function ce(t) {
732
- return !t.getContextValue(Se);
729
+ function ae(t) {
730
+ return !t.getContextValue(ve);
733
731
  }
734
- const si = {
732
+ const ri = {
735
733
  id: O.id,
736
734
  description: "find-replace.shortcut.open-find-dialog",
737
735
  binding: b.F | x.CTRL_COMMAND,
738
- group: G,
736
+ group: B,
739
737
  preconditions(t) {
740
- return !T(t) && oe(t) && ce(t);
738
+ return !T(t) && se(t) && ae(t);
741
739
  }
742
- }, ai = {
740
+ }, si = {
743
741
  id: O.id,
744
742
  description: "find-replace.shortcut.open-find-dialog",
745
743
  binding: b.F | x.CTRL_COMMAND,
746
744
  mac: b.F | x.MAC_CTRL,
747
745
  preconditions(t) {
748
- return !T(t) && oe(t) && ce(t);
746
+ return !T(t) && se(t) && ae(t);
749
747
  }
750
- }, oi = {
751
- id: ae.id,
748
+ }, ai = {
749
+ id: re.id,
752
750
  description: "find-replace.shortcut.open-replace-dialog",
753
751
  binding: b.H | x.CTRL_COMMAND,
754
752
  mac: b.H | x.MAC_CTRL,
755
- group: G,
753
+ group: B,
756
754
  preconditions(t) {
757
- return oe(t) && ce(t) && (!T(t) || !ri(t));
755
+ return se(t) && ae(t) && (!T(t) || !ni(t));
758
756
  }
759
- }, ci = {
760
- id: $e.id,
757
+ }, oi = {
758
+ id: Ne.id,
761
759
  description: "find-replace.shortcut.go-to-next-match",
762
760
  binding: b.ENTER,
763
- group: G,
761
+ group: B,
764
762
  priority: 1e3,
765
763
  preconditions(t) {
766
- return we(t) && T(t);
764
+ return je(t) && T(t);
767
765
  }
768
- }, li = {
769
- id: Ae.id,
766
+ }, ci = {
767
+ id: $e.id,
770
768
  description: "find-replace.shortcut.go-to-previous-match",
771
769
  binding: b.ENTER | x.SHIFT,
772
- group: G,
770
+ group: B,
773
771
  priority: 1e3,
774
772
  preconditions(t) {
775
- return we(t) && T(t);
773
+ return je(t) && T(t);
776
774
  }
777
775
  };
778
- function di(t) {
779
- const e = t.get(ie);
776
+ function li(t) {
777
+ const e = t.get(ee);
780
778
  return {
781
779
  id: O.id,
782
780
  icon: "SearchIcon",
783
781
  tooltip: "find-replace.toolbar",
784
782
  type: gt.BUTTON,
785
- hidden$: mt(t, ht.UNIVER_SHEET),
786
- disabled$: Me([
787
- e.subscribeContextValue$(Se),
788
- e.subscribeContextValue$(ve)
783
+ hidden$: mt(t, dt.UNIVER_SHEET),
784
+ disabled$: Re([
785
+ e.subscribeContextValue$(ve),
786
+ e.subscribeContextValue$(me)
789
787
  ]).pipe(It(([n, i]) => n || !i))
790
788
  };
791
789
  }
792
- const hi = {
790
+ const di = {
793
791
  [vt.OTHERS]: {
794
792
  [O.id]: {
795
793
  order: 2,
796
- menuItemFactory: di
794
+ menuItemFactory: li
797
795
  }
798
796
  }
799
797
  };
800
- var ui = Object.defineProperty, fi = Object.getOwnPropertyDescriptor, pi = (t, e, n, i) => {
801
- for (var r = i > 1 ? void 0 : i ? fi(e, n) : e, s = t.length - 1, a; s >= 0; s--)
798
+ var hi = Object.defineProperty, ui = Object.getOwnPropertyDescriptor, fi = (t, e, n, i) => {
799
+ for (var r = i > 1 ? void 0 : i ? ui(e, n) : e, s = t.length - 1, a; s >= 0; s--)
802
800
  (a = t[s]) && (r = (i ? a(e, n, r) : a(r)) || r);
803
- return i && r && ui(e, n, r), r;
801
+ return i && r && hi(e, n, r), r;
804
802
  }, S = (t, e) => (n, i) => e(n, i, t);
805
- const pe = "DESKTOP_FIND_REPLACE_DIALOG", Ue = 350, _i = 20, gi = -90;
806
- let U = class extends ut {
807
- constructor(e, n, i, r, s, a, c, l, _, h) {
803
+ const fe = "DESKTOP_FIND_REPLACE_DIALOG", we = 350, pi = 20, _i = -90;
804
+ let j = class extends ht {
805
+ constructor(e, n, i, r, s, a, l, d, _, h) {
808
806
  super();
809
- o(this, "_closingListenerDisposable");
810
- this._univerInstanceService = e, this._menuManagerService = n, this._shortcutService = i, this._commandService = r, this._findReplaceService = s, this._dialogService = a, this._layoutService = c, this._localeService = l, this._componentManager = _, this._injector = h, this._initCommands(), this._initUI(), this._initShortcuts();
807
+ c(this, "_closingListenerDisposable");
808
+ this._univerInstanceService = e, this._menuManagerService = n, this._shortcutService = i, this._commandService = r, this._findReplaceService = s, this._dialogService = a, this._layoutService = l, this._localeService = d, this._componentManager = _, this._injector = h, this._initCommands(), this._initUI(), this._initShortcuts();
811
809
  }
812
810
  dispose() {
813
811
  var e;
@@ -816,103 +814,107 @@ let U = class extends ut {
816
814
  _initCommands() {
817
815
  [
818
816
  O,
819
- ae,
820
- $e,
821
- Ae,
817
+ re,
822
818
  Ne,
823
- Ee
819
+ $e,
820
+ Ee,
821
+ Te
824
822
  ].forEach((e) => {
825
823
  this.disposeWithMe(this._commandService.registerCommand(e));
826
824
  });
827
825
  }
828
826
  _initShortcuts() {
829
827
  [
830
- oi,
831
- si,
832
828
  ai,
833
- li,
834
- ci
829
+ ri,
830
+ si,
831
+ ci,
832
+ oi
835
833
  ].forEach((e) => this.disposeWithMe(this._shortcutService.registerShortcut(e)));
836
834
  }
837
835
  _initUI() {
838
- this.disposeWithMe(this._componentManager.register("FindReplaceDialog", ei)), this.disposeWithMe(this._componentManager.register("SearchIcon", De)), this._menuManagerService.mergeMenu(hi), this._findReplaceService.stateUpdates$.pipe(le(this.dispose$)).subscribe((e) => {
836
+ this.disposeWithMe(this._componentManager.register("FindReplaceDialog", Xt)), this.disposeWithMe(this._componentManager.register("SearchIcon", Ie)), this._menuManagerService.mergeMenu(di), this._findReplaceService.stateUpdates$.pipe(oe(this.dispose$)).subscribe((e) => {
839
837
  e.revealed === !0 && this._openPanel();
840
838
  });
841
839
  }
842
840
  _openPanel() {
843
841
  this._dialogService.open({
844
- id: pe,
842
+ id: fe,
845
843
  draggable: !0,
846
- width: Ue,
844
+ width: we,
847
845
  title: { title: this._localeService.t("find-replace.dialog.title") },
848
846
  children: { label: "FindReplaceDialog" },
849
847
  destroyOnClose: !0,
850
- defaultPosition: mi(),
848
+ defaultPosition: gi(),
851
849
  preservePositionOnDestroy: !0,
852
850
  onClose: () => this.closePanel()
853
- }), this._closingListenerDisposable = L(this._univerInstanceService.focused$.pipe(le(this.dispose$)).subscribe((e) => {
851
+ }), this._closingListenerDisposable = $(this._univerInstanceService.focused$.pipe(oe(this.dispose$)).subscribe((e) => {
854
852
  (!e || !this._univerInstanceService.getUniverSheetInstance(e)) && this.closePanel();
855
853
  }));
856
854
  }
857
855
  closePanel() {
858
- this._closingListenerDisposable && (this._closingListenerDisposable.dispose(), this._closingListenerDisposable = null, this._dialogService.close(pe), this._findReplaceService.terminate(), queueMicrotask(() => this._layoutService.focus()));
856
+ this._closingListenerDisposable && (this._closingListenerDisposable.dispose(), this._closingListenerDisposable = null, this._dialogService.close(fe), this._findReplaceService.terminate(), queueMicrotask(() => this._layoutService.focus()));
859
857
  }
860
858
  };
861
- U = pi([
862
- S(0, me),
859
+ j = fi([
860
+ S(0, ge),
863
861
  S(1, Ct),
864
862
  S(2, Rt),
865
- S(3, ne),
863
+ S(3, te),
866
864
  S(4, m),
867
865
  S(5, Mt),
868
- S(6, Re),
869
- S(7, D(B)),
870
- S(8, D(St)),
871
- S(9, D(ee))
872
- ], U);
873
- function mi() {
866
+ S(6, Ce),
867
+ S(7, F(w)),
868
+ S(8, F(St)),
869
+ S(9, F(Q))
870
+ ], j);
871
+ function gi() {
874
872
  const { innerWidth: t } = window;
875
- return { x: (t - Ue) / 2 - _i, y: gi };
873
+ return { x: (t - we) / 2 - pi, y: _i };
876
874
  }
877
- var vi = Object.defineProperty, Si = Object.getOwnPropertyDescriptor, Ci = (t, e, n, i) => {
878
- for (var r = i > 1 ? void 0 : i ? Si(e, n) : e, s = t.length - 1, a; s >= 0; s--)
875
+ var mi = Object.defineProperty, vi = Object.getOwnPropertyDescriptor, Si = (t, e, n, i) => {
876
+ for (var r = i > 1 ? void 0 : i ? vi(e, n) : e, s = t.length - 1, a; s >= 0; s--)
879
877
  (a = t[s]) && (r = (i ? a(e, n, r) : a(r)) || r);
880
- return i && r && vi(e, n, r), r;
881
- }, _e = (t, e) => (n, i) => e(n, i, t);
882
- const Ri = "UNIVER_FIND_REPLACE_PLUGIN";
883
- var q;
884
- let ge = (q = class extends ft {
885
- constructor(t = $t, e, n) {
878
+ return i && r && mi(e, n, r), r;
879
+ }, pe = (t, e) => (n, i) => e(n, i, t);
880
+ const Ci = "UNIVER_FIND_REPLACE_PLUGIN";
881
+ var V;
882
+ let _e = (V = class extends ut {
883
+ constructor(t = de, e, n) {
886
884
  super(), this._config = t, this._injector = e, this._configService = n;
887
- const { ...i } = this._config;
885
+ const { ...i } = ft(
886
+ {},
887
+ de,
888
+ this._config
889
+ );
888
890
  this._configService.setConfig(Nt, i);
889
891
  }
890
892
  onStarting() {
891
893
  [
892
- [U],
893
- [m, { useClass: X }]
894
+ [j],
895
+ [m, { useClass: Z }]
894
896
  ].forEach((t) => this._injector.add(t));
895
897
  }
896
898
  onRendered() {
897
- this._injector.get(U);
899
+ this._injector.get(j);
898
900
  }
899
- }, o(q, "pluginName", Ri), q);
900
- ge = Ci([
901
- _e(1, D(ee)),
902
- _e(2, pt)
903
- ], ge);
901
+ }, c(V, "pluginName", Ci), V);
902
+ _e = Si([
903
+ pe(1, F(Q)),
904
+ pe(2, pt)
905
+ ], _e);
904
906
  export {
905
- Z as FindBy,
906
- Y as FindDirection,
907
- Pi as FindModel,
908
- U as FindReplaceController,
909
- Q as FindScope,
910
- $e as GoToNextMatchOperation,
911
- Ae as GoToPreviousMatchOperation,
907
+ z as FindBy,
908
+ K as FindDirection,
909
+ Di as FindModel,
910
+ j as FindReplaceController,
911
+ Y as FindScope,
912
+ Ne as GoToNextMatchOperation,
913
+ $e as GoToPreviousMatchOperation,
912
914
  m as IFindReplaceService,
913
915
  O as OpenFindDialogOperation,
914
- ae as OpenReplaceDialogOperation,
915
- Ne as ReplaceAllMatchesCommand,
916
- Ee as ReplaceCurrentMatchCommand,
917
- ge as UniverFindReplacePlugin
916
+ re as OpenReplaceDialogOperation,
917
+ Ee as ReplaceAllMatchesCommand,
918
+ Te as ReplaceCurrentMatchCommand,
919
+ _e as UniverFindReplacePlugin
918
920
  };