@univerjs/sheets-crosshair-highlight 0.10.12 → 0.10.13-nightly.202510290902

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,16 +1,16 @@
1
- var K = Object.defineProperty;
2
- var q = (n, e, t) => e in n ? K(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var c = (n, e, t) => q(n, typeof e != "symbol" ? e + "" : e, t);
4
- import { Disposable as y, CommandType as H, UniverInstanceType as E, Inject as u, ICommandService as J, RANGE_TYPE as f, Rectangle as $, IContextService as Q, ColorKit as ee, Plugin as te, merge as re, Injector as ne, IConfigService as ie } from "@univerjs/core";
5
- import { BehaviorSubject as x, combineLatest as se, merge as T, startWith as oe, tap as ae, map as N } from "rxjs";
6
- import { Shape as ce, Rect as le, IRenderManagerService as he } from "@univerjs/engine-render";
7
- import { useDependency as ge, useObservable as de, getMenuHiddenObservable as ue, MenuItemType as fe, ContextMenuPosition as _e, ContextMenuGroup as ve, ComponentManager as Se, IMenuManagerService as pe } from "@univerjs/ui";
8
- import { jsx as P } from "react/jsx-runtime";
9
- import { clsx as Ce, borderClassName as me } from "@univerjs/design";
10
- import { forwardRef as k, useRef as be, createElement as A, useCallback as Re } from "react";
11
- import { SheetsSelectionsService as He, IRefSelectionsService as Oe, REF_SELECTIONS_ENABLED as Ie } from "@univerjs/sheets";
12
- import { SheetSkeletonManagerService as Ee, getCoordByCell as V } from "@univerjs/sheets-ui";
13
- const G = [
1
+ var X = Object.defineProperty;
2
+ var z = (s, e, t) => e in s ? X(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
+ var c = (s, e, t) => z(s, typeof e != "symbol" ? e + "" : e, t);
4
+ import { Disposable as E, CommandType as b, UniverInstanceType as O, Inject as d, ICommandService as K, RANGE_TYPE as u, Rectangle as M, IContextService as q, ColorKit as J, Plugin as Q, merge as ee, Injector as te, IConfigService as re } from "@univerjs/core";
5
+ import { BehaviorSubject as y, combineLatest as se, merge as T, startWith as ie, tap as ne, map as x } from "rxjs";
6
+ import { Shape as oe, Rect as ae, IRenderManagerService as ce } from "@univerjs/engine-render";
7
+ import { useRef as le, createElement as A, forwardRef as he, useCallback as ge } from "react";
8
+ import { useDependency as de, useObservable as ue, getMenuHiddenObservable as _e, MenuItemType as fe, ContextMenuPosition as Se, ContextMenuGroup as pe, ComponentManager as ve, IMenuManagerService as Ce } from "@univerjs/ui";
9
+ import { jsx as N } from "react/jsx-runtime";
10
+ import { clsx as me, borderClassName as Re } from "@univerjs/design";
11
+ import { SheetsSelectionsService as be, IRefSelectionsService as He, REF_SELECTIONS_ENABLED as Ie } from "@univerjs/sheets";
12
+ import { SheetSkeletonManagerService as Oe, getCoordByCell as V } from "@univerjs/sheets-ui";
13
+ const j = [
14
14
  "rgba(158, 109, 227, 0.3)",
15
15
  "rgba(254, 75, 75, 0.3)",
16
16
  "rgba(255, 140, 81, 0.3)",
@@ -28,12 +28,12 @@ const G = [
28
28
  "rgba(242, 72, 166, 0.15)",
29
29
  "rgba(153, 153, 153, 0.15)"
30
30
  ];
31
- class g extends y {
31
+ class h extends E {
32
32
  constructor() {
33
33
  super(...arguments);
34
- c(this, "_enabled$", new x(!1));
34
+ c(this, "_enabled$", new y(!1));
35
35
  c(this, "enabled$", this._enabled$.asObservable());
36
- c(this, "_color$", new x(G[0]));
36
+ c(this, "_color$", new y(j[0]));
37
37
  c(this, "color$", this._color$.asObservable());
38
38
  }
39
39
  get enabled() {
@@ -52,174 +52,192 @@ class g extends y {
52
52
  this._color$.next(t);
53
53
  }
54
54
  }
55
- const w = {
55
+ const $ = {
56
56
  id: "sheet.operation.toggle-crosshair-highlight",
57
- type: H.OPERATION,
58
- handler(n) {
59
- const e = n.get(g), t = e.enabled;
57
+ type: b.OPERATION,
58
+ handler(s) {
59
+ const e = s.get(h), t = e.enabled;
60
60
  return e.setEnabled(!t), !0;
61
61
  }
62
- }, U = {
62
+ }, k = {
63
63
  id: "sheet.operation.set-crosshair-highlight-color",
64
- type: H.OPERATION,
65
- handler(n, { value: e }) {
66
- const t = n.get(g);
64
+ type: b.OPERATION,
65
+ handler(s, { value: e }) {
66
+ const t = s.get(h);
67
67
  return t.enabled || t.setEnabled(!0), t.setColor(e), !0;
68
68
  }
69
- }, ye = {
69
+ }, Ee = {
70
70
  id: "sheet.operation.enable-crosshair-highlight",
71
- type: H.OPERATION,
72
- handler(n) {
73
- const e = n.get(g);
71
+ type: b.OPERATION,
72
+ handler(s) {
73
+ const e = s.get(h);
74
74
  return e.enabled ? !1 : (e.setEnabled(!0), !0);
75
75
  }
76
- }, we = {
76
+ }, $e = {
77
77
  id: "sheet.operation.disable-crosshair-highlight",
78
- type: H.OPERATION,
79
- handler(n) {
80
- const e = n.get(g);
78
+ type: b.OPERATION,
79
+ handler(s) {
80
+ const e = s.get(h);
81
81
  return e.enabled ? (e.setEnabled(!1), !0) : !1;
82
82
  }
83
- }, Me = "sheets-crosshair-highlight.config", j = {};
84
- var l = function() {
85
- return l = Object.assign || function(n) {
86
- for (var e, t = 1, r = arguments.length; t < r; t++) {
87
- e = arguments[t];
88
- for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (n[i] = e[i]);
89
- }
90
- return n;
91
- }, l.apply(this, arguments);
92
- }, $e = function(n, e) {
93
- var t = {};
94
- for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && e.indexOf(r) < 0 && (t[r] = n[r]);
95
- if (n != null && typeof Object.getOwnPropertySymbols == "function")
96
- for (var i = 0, r = Object.getOwnPropertySymbols(n); i < r.length; i++)
97
- e.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(n, r[i]) && (t[r[i]] = n[r[i]]);
98
- return t;
99
- }, D = k(function(n, e) {
100
- var t = n.icon, r = n.id, i = n.className, s = n.extend, o = $e(n, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(r, " ").concat(i || "").trim(), h = be("_".concat(Ne()));
101
- return B(t, "".concat(r), { defIds: t.defIds, idSuffix: h.current }, l({ ref: e, className: a }, o), s);
102
- });
103
- function B(n, e, t, r, i) {
104
- return A(n.tag, l(l({ key: e }, xe(n, t, i)), r), (Te(n, t).children || []).map(function(s, o) {
105
- return B(s, "".concat(e, "-").concat(n.tag, "-").concat(o), t, void 0, i);
106
- }));
83
+ }, we = "sheets-crosshair-highlight.config", L = {};
84
+ function G({ ref: s, ...e }) {
85
+ const { icon: t, id: r, className: i, extend: n, ...o } = e, a = `univerjs-icon univerjs-icon-${r} ${i || ""}`.trim(), l = le(`_${Te()}`);
86
+ return U(t, `${r}`, {
87
+ defIds: t.defIds,
88
+ idSuffix: l.current
89
+ }, {
90
+ ref: s,
91
+ className: a,
92
+ ...o
93
+ }, n);
94
+ }
95
+ function U(s, e, t, r, i) {
96
+ return A(s.tag, {
97
+ key: e,
98
+ ...Me(s, t, i),
99
+ ...r
100
+ }, (ye(s, t).children || []).map((n, o) => U(n, `${e}-${s.tag}-${o}`, t, void 0, i)));
107
101
  }
108
- function xe(n, e, t) {
109
- var r = l({}, n.attrs);
110
- t != null && t.colorChannel1 && r.fill === "colorChannel1" && (r.fill = t.colorChannel1), n.tag === "mask" && r.id && (r.id = r.id + e.idSuffix), Object.entries(r).forEach(function(s) {
111
- var o = s[0], a = s[1];
112
- o === "mask" && typeof a == "string" && (r[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
102
+ function Me(s, e, t) {
103
+ const r = { ...s.attrs };
104
+ t != null && t.colorChannel1 && r.fill === "colorChannel1" && (r.fill = t.colorChannel1), s.tag === "mask" && r.id && (r.id = r.id + e.idSuffix), Object.entries(r).forEach(([n, o]) => {
105
+ n === "mask" && typeof o == "string" && (r[n] = o.replace(/url\(#(.*)\)/, `url(#$1${e.idSuffix})`));
113
106
  });
114
- var i = e.defIds;
115
- return !i || i.length === 0 || (n.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + e.idSuffix), Object.entries(r).forEach(function(s) {
116
- var o = s[0], a = s[1];
117
- typeof a == "string" && (r[o] = a.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
107
+ const { defIds: i } = e;
108
+ return !i || i.length === 0 || (s.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + e.idSuffix), Object.entries(r).forEach(([n, o]) => {
109
+ typeof o == "string" && (r[n] = o.replace(/url\(#(.*)\)/, `url(#$1${e.idSuffix})`));
118
110
  })), r;
119
111
  }
120
- function Te(n, e) {
121
- var t, r = e.defIds;
122
- return !r || r.length === 0 ? n : n.tag === "defs" && (!((t = n.children) === null || t === void 0) && t.length) ? l(l({}, n), { children: n.children.map(function(i) {
123
- return typeof i.attrs.id == "string" && r && r.includes(i.attrs.id) ? l(l({}, i), { attrs: l(l({}, i.attrs), { id: i.attrs.id + e.idSuffix }) }) : i;
124
- }) }) : n;
112
+ function ye(s, e) {
113
+ var r;
114
+ const { defIds: t } = e;
115
+ return !t || t.length === 0 ? s : s.tag === "defs" && ((r = s.children) != null && r.length) ? {
116
+ ...s,
117
+ children: s.children.map((i) => typeof i.attrs.id == "string" && t && t.includes(i.attrs.id) ? {
118
+ ...i,
119
+ attrs: {
120
+ ...i.attrs,
121
+ id: i.attrs.id + e.idSuffix
122
+ }
123
+ } : i)
124
+ } : s;
125
125
  }
126
- function Ne() {
126
+ function Te() {
127
127
  return Math.random().toString(36).substring(2, 8);
128
128
  }
129
- D.displayName = "UniverIcon";
130
- var Pe = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3.6498 1.05005C2.21386 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V3.65005C14.9498 2.21411 13.7857 1.05005 12.3498 1.05005H3.6498ZM5.4002 2.25005H3.6498C2.87661 2.25005 2.2498 2.87685 2.2498 3.65005V5.40002H5.4002V2.25005ZM2.2498 10.6V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H5.4002V10.6H2.2498ZM6.60019 13.75H9.4002V9.40002H13.7498V6.60002H9.4002V2.25005H6.60019V6.60002H2.25029V9.40002H6.60019V13.75ZM10.6002 2.25005V5.40002H13.7498V3.65005C13.7498 2.87685 13.123 2.25005 12.3498 2.25005H10.6002ZM13.7498 10.6H10.6002V13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.6Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Z = k(function(n, e) {
131
- return A(D, Object.assign({}, n, {
129
+ G.displayName = "UniverIcon";
130
+ const xe = {
131
+ tag: "svg",
132
+ attrs: {
133
+ xmlns: "http://www.w3.org/2000/svg",
134
+ fill: "none",
135
+ viewBox: "0 0 16 16",
136
+ width: "1em",
137
+ height: "1em"
138
+ },
139
+ children: [{
140
+ tag: "path",
141
+ attrs: {
142
+ fill: "currentColor",
143
+ d: "M3.6498 1.05005C2.21386 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V3.65005C14.9498 2.21411 13.7857 1.05005 12.3498 1.05005H3.6498ZM5.4002 2.25005H3.6498C2.87661 2.25005 2.2498 2.87685 2.2498 3.65005V5.40002H5.4002V2.25005ZM2.2498 10.6V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H5.4002V10.6H2.2498ZM6.60019 13.75H9.4002V9.40002H13.7498V6.60002H9.4002V2.25005H6.60019V6.60002H2.25029V9.40002H6.60019V13.75ZM10.6002 2.25005V5.40002H13.7498V3.65005C13.7498 2.87685 13.123 2.25005 12.3498 2.25005H10.6002ZM13.7498 10.6H10.6002V13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.6Z",
144
+ fillRule: "evenodd",
145
+ clipRule: "evenodd"
146
+ }
147
+ }]
148
+ }, D = he(function(e, t) {
149
+ return A(G, Object.assign({}, e, {
132
150
  id: "cross-highlighting-icon",
133
- ref: e,
134
- icon: Pe
151
+ ref: t,
152
+ icon: xe
135
153
  }));
136
154
  });
137
- Z.displayName = "CrossHighlightingIcon";
138
- function Ve(n) {
139
- const { onChange: e } = n, t = ge(g), r = de(t.color$), i = Re((s) => {
140
- e == null || e(s);
155
+ D.displayName = "CrossHighlightingIcon";
156
+ function Ne(s) {
157
+ const { onChange: e } = s, t = de(h), r = ue(t.color$), i = ge((n) => {
158
+ e == null || e(n);
141
159
  }, [e]);
142
- return /* @__PURE__ */ P("div", { className: "univer-grid univer-grid-cols-8 univer-gap-x-2 univer-gap-y-3", children: G.map((s) => /* @__PURE__ */ P(
160
+ return /* @__PURE__ */ N("div", { className: "univer-grid univer-grid-cols-8 univer-gap-x-2 univer-gap-y-3", children: j.map((n) => /* @__PURE__ */ N(
143
161
  "div",
144
162
  {
145
- className: Ce("hover:univer-ring-primary-600/40 hover:univer-ring-[1.5px] univer-box-border univer-size-5 univer-cursor-pointer univer-rounded univer-ring-offset-1 univer-transition-shadow", me, {
146
- "univer-ring-[1.5px] univer-ring-primary-600 hover:univer-ring-primary-600": s === r
163
+ className: me("hover:univer-ring-primary-600/40 hover:univer-ring-[1.5px] univer-box-border univer-size-5 univer-cursor-pointer univer-rounded univer-ring-offset-1 univer-transition-shadow", Re, {
164
+ "univer-ring-[1.5px] univer-ring-primary-600 hover:univer-ring-primary-600": n === r
147
165
  }),
148
- style: { backgroundColor: s },
149
- onClick: () => i(s)
166
+ style: { backgroundColor: n },
167
+ onClick: () => i(n)
150
168
  },
151
- s
169
+ n
152
170
  )) });
153
171
  }
154
- const W = "CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT";
155
- function je(n) {
156
- const e = n.get(g);
172
+ const B = "CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT";
173
+ function Ve(s) {
174
+ const e = s.get(h);
157
175
  return {
158
- id: w.id,
176
+ id: $.id,
159
177
  tooltip: "crosshair.button.tooltip",
160
178
  type: fe.BUTTON_SELECTOR,
161
179
  icon: "CrossHighlightingIcon",
162
180
  selections: [
163
181
  {
164
182
  label: {
165
- name: W,
183
+ name: B,
166
184
  hoverable: !1,
167
185
  selectable: !1
168
186
  }
169
187
  }
170
188
  ],
171
- selectionsCommandId: U.id,
189
+ selectionsCommandId: k.id,
172
190
  activated$: e.enabled$,
173
- hidden$: ue(n, E.UNIVER_SHEET)
191
+ hidden$: _e(s, O.UNIVER_SHEET)
174
192
  };
175
193
  }
176
194
  const Le = {
177
- [_e.FOOTER_MENU]: {
178
- [ve.OTHERS]: {
179
- [w.id]: {
195
+ [Se.FOOTER_MENU]: {
196
+ [pe.OTHERS]: {
197
+ [$.id]: {
180
198
  order: 0,
181
- menuItemFactory: je
199
+ menuItemFactory: Ve
182
200
  }
183
201
  }
184
202
  }
185
203
  };
186
- var ke = Object.getOwnPropertyDescriptor, Ae = (n, e, t, r) => {
187
- for (var i = r > 1 ? void 0 : r ? ke(e, t) : e, s = n.length - 1, o; s >= 0; s--)
188
- (o = n[s]) && (i = o(i) || i);
204
+ var Pe = Object.getOwnPropertyDescriptor, Ae = (s, e, t, r) => {
205
+ for (var i = r > 1 ? void 0 : r ? Pe(e, t) : e, n = s.length - 1, o; n >= 0; n--)
206
+ (o = s[n]) && (i = o(i) || i);
189
207
  return i;
190
- }, O = (n, e) => (t, r) => e(t, r, n);
191
- let b = class extends y {
192
- constructor(n, e, t) {
193
- super(), this._componentMgr = n, this._menuManagerService = e, this._cmdSrv = t, this._initCommands(), this._initMenus(), this._initComponents();
208
+ }, H = (s, e) => (t, r) => e(t, r, s);
209
+ let m = class extends E {
210
+ constructor(s, e, t) {
211
+ super(), this._componentMgr = s, this._menuManagerService = e, this._cmdSrv = t, this._initCommands(), this._initMenus(), this._initComponents();
194
212
  }
195
213
  _initCommands() {
196
214
  [
197
- w,
198
- U,
199
- ye,
200
- we
201
- ].forEach((n) => this._cmdSrv.registerCommand(n));
215
+ $,
216
+ k,
217
+ Ee,
218
+ $e
219
+ ].forEach((s) => this._cmdSrv.registerCommand(s));
202
220
  }
203
221
  _initMenus() {
204
222
  this._menuManagerService.mergeMenu(Le);
205
223
  }
206
224
  _initComponents() {
207
- this._componentMgr.register(W, Ve), this._componentMgr.register("CrossHighlightingIcon", Z);
225
+ this._componentMgr.register(B, Ne), this._componentMgr.register("CrossHighlightingIcon", D);
208
226
  }
209
227
  };
210
- b = Ae([
211
- O(0, u(Se)),
212
- O(1, pe),
213
- O(2, J)
214
- ], b);
215
- const Ge = 1;
216
- class Ue {
228
+ m = Ae([
229
+ H(0, d(ve)),
230
+ H(1, Ce),
231
+ H(2, K)
232
+ ], m);
233
+ const je = 1;
234
+ class ke {
217
235
  constructor() {
218
236
  c(this, "_selectedRanges", []);
219
237
  c(this, "_ranges", []);
220
238
  }
221
239
  addRange(e) {
222
- if (e.rangeType === f.COLUMN || e.rangeType === f.ROW || e.rangeType === f.ALL)
240
+ if (e.rangeType === u.COLUMN || e.rangeType === u.ROW || e.rangeType === u.ALL)
223
241
  return;
224
242
  const t = this._getIntersects(e), r = this._getSplitRanges(e, t);
225
243
  r.length > 0 && this._ranges.push(...r);
@@ -230,19 +248,19 @@ class Ue {
230
248
  _getSplitRanges(e, t) {
231
249
  let r = [e];
232
250
  for (const i of t.concat(this._selectedRanges)) {
233
- const s = [];
251
+ const n = [];
234
252
  for (const o of r) {
235
- const a = $.subtract(o, i);
236
- a && a.length > 0 && s.push(...a);
253
+ const a = M.subtract(o, i);
254
+ a && a.length > 0 && n.push(...a);
237
255
  }
238
- r = s;
256
+ r = n;
239
257
  }
240
258
  return r.filter((i) => i.startRow <= i.endRow && i.startColumn <= i.endColumn);
241
259
  }
242
260
  _getIntersects(e) {
243
261
  const t = [];
244
262
  for (const r of this._ranges) {
245
- const i = $.getIntersects(r, e);
263
+ const i = M.getIntersects(r, e);
246
264
  i && t.push(i);
247
265
  }
248
266
  return t;
@@ -254,7 +272,7 @@ class Ue {
254
272
  this._ranges = [], this._selectedRanges = [];
255
273
  }
256
274
  }
257
- class De extends ce {
275
+ class Ge extends oe {
258
276
  constructor(t, r) {
259
277
  super(t, r);
260
278
  // protected _showHighLight = false;
@@ -268,9 +286,9 @@ class De extends ce {
268
286
  });
269
287
  }
270
288
  _draw(t) {
271
- var i, s;
272
- const r = `rgba(${this._color.r}, ${this._color.g}, ${this._color.b}, ${(s = (i = this._color) == null ? void 0 : i.a) != null ? s : 0.5})`;
273
- le.drawWith(t, {
289
+ var i, n;
290
+ const r = `rgba(${this._color.r}, ${this._color.g}, ${this._color.b}, ${(n = (i = this._color) == null ? void 0 : i.a) != null ? n : 0.5})`;
291
+ ae.drawWith(t, {
274
292
  width: this.width,
275
293
  height: this.height,
276
294
  fill: r,
@@ -280,84 +298,84 @@ class De extends ce {
280
298
  });
281
299
  }
282
300
  }
283
- var Be = Object.getOwnPropertyDescriptor, Ze = (n, e, t, r) => {
284
- for (var i = r > 1 ? void 0 : r ? Be(e, t) : e, s = n.length - 1, o; s >= 0; s--)
285
- (o = n[s]) && (i = o(i) || i);
301
+ var Ue = Object.getOwnPropertyDescriptor, De = (s, e, t, r) => {
302
+ for (var i = r > 1 ? void 0 : r ? Ue(e, t) : e, n = s.length - 1, o; n >= 0; n--)
303
+ (o = s[n]) && (i = o(i) || i);
286
304
  return i;
287
- }, S = (n, e) => (t, r) => e(t, r, n);
288
- let R = class extends y {
289
- constructor(e, t, r, i, s, o) {
305
+ }, S = (s, e) => (t, r) => e(t, r, s);
306
+ let R = class extends E {
307
+ constructor(e, t, r, i, n, o) {
290
308
  super();
291
309
  c(this, "_shapes", []);
292
- c(this, "_rangeCollection", new Ue());
310
+ c(this, "_rangeCollection", new ke());
293
311
  c(this, "_color", "rgba(255,0,0,0.5)");
294
- this._context = e, this._sheetSkeletonManagerService = t, this._sheetsSelectionsService = r, this._sheetsCrosshairHighlightService = i, this._contextService = s, this._refSelectionsService = o, this._initRenderListener();
312
+ this._context = e, this._sheetSkeletonManagerService = t, this._sheetsSelectionsService = r, this._sheetsCrosshairHighlightService = i, this._contextService = n, this._refSelectionsService = o, this._initRenderListener();
295
313
  }
296
314
  _transformSelection(e, t) {
297
315
  if (!e)
298
316
  return;
299
- const r = t.getRowCount(), i = t.getColumnCount(), s = [];
317
+ const r = t.getRowCount(), i = t.getColumnCount(), n = [];
300
318
  for (const o of e) {
301
- const { startRow: a, endRow: h, startColumn: _, endColumn: v } = o.range;
302
- h - a + 1 === r || v - _ + 1 === i || s.push(o.range);
319
+ const { startRow: a, endRow: l, startColumn: _, endColumn: f } = o.range;
320
+ l - a + 1 === r || f - _ + 1 === i || n.push(o.range);
303
321
  }
304
- this._rangeCollection.setSelectedRanges(s);
305
- for (const o of s)
322
+ this._rangeCollection.setSelectedRanges(n);
323
+ for (const o of n)
306
324
  this.addSelection(o, t);
307
325
  }
308
326
  _initRenderListener() {
309
327
  const e = this._context.unit;
310
328
  this.disposeWithMe(se([
311
- this._contextService.subscribeContextValue$(Ie).pipe(oe(!1)),
329
+ this._contextService.subscribeContextValue$(Ie).pipe(ie(!1)),
312
330
  this._sheetSkeletonManagerService.currentSkeleton$,
313
331
  this._sheetsCrosshairHighlightService.enabled$,
314
- this._sheetsCrosshairHighlightService.color$.pipe(ae((t) => this._color = t)),
332
+ this._sheetsCrosshairHighlightService.color$.pipe(ne((t) => this._color = t)),
315
333
  T(
316
334
  this._sheetsSelectionsService.selectionMoveStart$,
317
335
  this._sheetsSelectionsService.selectionMoving$,
318
336
  this._sheetsSelectionsService.selectionMoveEnd$,
319
337
  this._sheetsSelectionsService.selectionSet$,
320
- e.activeSheet$.pipe(N(() => this._sheetsSelectionsService.getCurrentSelections()))
338
+ e.activeSheet$.pipe(x(() => this._sheetsSelectionsService.getCurrentSelections()))
321
339
  ),
322
340
  T(
323
341
  this._refSelectionsService.selectionMoveStart$,
324
342
  this._refSelectionsService.selectionMoving$,
325
343
  this._refSelectionsService.selectionMoveEnd$,
326
344
  this._sheetsSelectionsService.selectionSet$,
327
- e.activeSheet$.pipe(N(() => this._refSelectionsService.getCurrentSelections()))
345
+ e.activeSheet$.pipe(x(() => this._refSelectionsService.getCurrentSelections()))
328
346
  )
329
- ]).subscribe(([t, r, i, s, o, a]) => {
347
+ ]).subscribe(([t, r, i, n, o, a]) => {
330
348
  if (this._clear(), !i) return;
331
- const h = t ? a : o;
332
- this._rangeCollection.reset(), this._transformSelection(h, e.getActiveSheet()), this.render(this._rangeCollection.getRanges());
349
+ const l = t ? a : o;
350
+ this._rangeCollection.reset(), this._transformSelection(l, e.getActiveSheet()), this.render(this._rangeCollection.getRanges());
333
351
  }));
334
352
  }
335
353
  addSelection(e, t) {
336
- if (e.rangeType === f.COLUMN || e.rangeType === f.ROW || e.rangeType === f.ALL)
354
+ if (e.rangeType === u.COLUMN || e.rangeType === u.ROW || e.rangeType === u.ALL)
337
355
  return;
338
- const r = t.getRowCount(), i = t.getColumnCount(), { startRow: s, endRow: o, startColumn: a, endColumn: h } = e, _ = {
339
- startRow: s,
356
+ const r = t.getRowCount(), i = t.getColumnCount(), { startRow: n, endRow: o, startColumn: a, endColumn: l } = e, _ = {
357
+ startRow: n,
340
358
  endRow: o,
341
359
  startColumn: 0,
342
360
  endColumn: a - 1
343
- }, v = {
344
- startRow: s,
361
+ }, f = {
362
+ startRow: n,
345
363
  endRow: o,
346
- startColumn: h + 1,
364
+ startColumn: l + 1,
347
365
  endColumn: i
348
366
  }, p = {
349
367
  startRow: 0,
350
- endRow: s - 1,
368
+ endRow: n - 1,
351
369
  startColumn: a,
352
- endColumn: h
353
- }, C = {
370
+ endColumn: l
371
+ }, v = {
354
372
  startRow: o + 1,
355
373
  endRow: r,
356
374
  startColumn: a,
357
- endColumn: h
375
+ endColumn: l
358
376
  };
359
- for (const d of [_, v, p, C])
360
- d.startRow <= d.endRow && d.startColumn <= d.endColumn && this._rangeCollection.addRange(d);
377
+ for (const g of [_, f, p, v])
378
+ g.startRow <= g.endRow && g.startColumn <= g.endColumn && this._rangeCollection.addRange(g);
361
379
  }
362
380
  _clear() {
363
381
  this._shapes.forEach((e) => {
@@ -365,16 +383,16 @@ let R = class extends y {
365
383
  }), this._shapes = [];
366
384
  }
367
385
  _addShapes(e, t, r, i) {
368
- const { startRow: s, endRow: o, startColumn: a, endColumn: h } = e, _ = V(s, a, r, i), v = V(o, h, r, i), { startX: p, startY: C } = _, { endX: d, endY: Y } = v, F = d - p, X = Y - C, z = {
386
+ const { startRow: n, endRow: o, startColumn: a, endColumn: l } = e, _ = V(n, a, r, i), f = V(o, l, r, i), { startX: p, startY: v } = _, { endX: g, endY: Z } = f, W = g - p, Y = Z - v, F = {
369
387
  left: p,
370
- top: C,
371
- color: new ee(this._color).toRgb(),
372
- width: F,
373
- height: X,
374
- zIndex: Ge,
388
+ top: v,
389
+ color: new J(this._color).toRgb(),
390
+ width: W,
391
+ height: Y,
392
+ zIndex: je,
375
393
  evented: !1
376
- }, M = new De(`crosshair-${t}`, z);
377
- this._shapes.push(M), r.addObject(M);
394
+ }, w = new Ge(`crosshair-${t}`, F);
395
+ this._shapes.push(w), r.addObject(w);
378
396
  }
379
397
  render(e) {
380
398
  const t = this._sheetSkeletonManagerService.getCurrentSkeleton();
@@ -383,8 +401,8 @@ let R = class extends y {
383
401
  const { scene: r } = this._context;
384
402
  this._clear();
385
403
  for (let i = 0; i < e.length; i++) {
386
- const s = e[i];
387
- this._addShapes(s, i, r, t);
404
+ const n = e[i];
405
+ this._addShapes(n, i, r, t);
388
406
  }
389
407
  r.makeDirty(!0);
390
408
  }
@@ -392,51 +410,51 @@ let R = class extends y {
392
410
  super.dispose();
393
411
  }
394
412
  };
395
- R = Ze([
396
- S(1, u(Ee)),
397
- S(2, u(He)),
398
- S(3, u(g)),
399
- S(4, u(Q)),
400
- S(5, Oe)
413
+ R = De([
414
+ S(1, d(Oe)),
415
+ S(2, d(be)),
416
+ S(3, d(h)),
417
+ S(4, d(q)),
418
+ S(5, He)
401
419
  ], R);
402
- var We = Object.getOwnPropertyDescriptor, Ye = (n, e, t, r) => {
403
- for (var i = r > 1 ? void 0 : r ? We(e, t) : e, s = n.length - 1, o; s >= 0; s--)
404
- (o = n[s]) && (i = o(i) || i);
420
+ var Be = Object.getOwnPropertyDescriptor, Ze = (s, e, t, r) => {
421
+ for (var i = r > 1 ? void 0 : r ? Be(e, t) : e, n = s.length - 1, o; n >= 0; n--)
422
+ (o = s[n]) && (i = o(i) || i);
405
423
  return i;
406
- }, I = (n, e) => (t, r) => e(t, r, n), m;
407
- let L = (m = class extends te {
408
- constructor(n = j, e, t, r) {
409
- super(), this._config = n, this._injector = e, this._renderManagerService = t, this._configService = r;
410
- const { ...i } = re(
424
+ }, I = (s, e) => (t, r) => e(t, r, s), C;
425
+ let P = (C = class extends Q {
426
+ constructor(s = L, e, t, r) {
427
+ super(), this._config = s, this._injector = e, this._renderManagerService = t, this._configService = r;
428
+ const { ...i } = ee(
411
429
  {},
412
- j,
430
+ L,
413
431
  this._config
414
432
  );
415
- this._configService.setConfig(Me, i);
433
+ this._configService.setConfig(we, i);
416
434
  }
417
435
  onStarting() {
418
436
  [
419
- [g],
420
- [b]
421
- ].forEach((n) => this._injector.add(n));
437
+ [h],
438
+ [m]
439
+ ].forEach((s) => this._injector.add(s));
422
440
  }
423
441
  onReady() {
424
442
  [
425
443
  [R]
426
- ].forEach((n) => this._injector.add(n)), this._injector.get(b), this._renderManagerService.registerRenderModule(E.UNIVER_SHEET, [R]);
427
- }
428
- }, c(m, "pluginName", "SHEET_CROSSHAIR_HIGHLIGHT_PLUGIN"), c(m, "type", E.UNIVER_SHEET), m);
429
- L = Ye([
430
- I(1, u(ne)),
431
- I(2, he),
432
- I(3, ie)
433
- ], L);
444
+ ].forEach((s) => this._injector.add(s)), this._injector.get(m), this._renderManagerService.registerRenderModule(O.UNIVER_SHEET, [R]);
445
+ }
446
+ }, c(C, "pluginName", "SHEET_CROSSHAIR_HIGHLIGHT_PLUGIN"), c(C, "type", O.UNIVER_SHEET), C);
447
+ P = Ze([
448
+ I(1, d(te)),
449
+ I(2, ce),
450
+ I(3, re)
451
+ ], P);
434
452
  export {
435
- G as CROSSHAIR_HIGHLIGHT_COLORS,
436
- we as DisableCrosshairHighlightOperation,
437
- ye as EnableCrosshairHighlightOperation,
438
- U as SetCrosshairHighlightColorOperation,
439
- g as SheetsCrosshairHighlightService,
440
- w as ToggleCrosshairHighlightOperation,
441
- L as UniverSheetsCrosshairHighlightPlugin
453
+ j as CROSSHAIR_HIGHLIGHT_COLORS,
454
+ $e as DisableCrosshairHighlightOperation,
455
+ Ee as EnableCrosshairHighlightOperation,
456
+ k as SetCrosshairHighlightColorOperation,
457
+ h as SheetsCrosshairHighlightService,
458
+ $ as ToggleCrosshairHighlightOperation,
459
+ P as UniverSheetsCrosshairHighlightPlugin
442
460
  };