@univerjs/sheets-crosshair-highlight 0.5.5-nightly.202501210604 → 0.5.5-nightly.202501210849
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/facade.js +31 -24
- package/lib/es/index.js +329 -314
- package/lib/es/locale/en-US.js +2 -2
- package/lib/es/locale/fa-IR.js +2 -2
- package/lib/es/locale/fr-FR.js +2 -2
- package/lib/es/locale/ru-RU.js +2 -2
- package/lib/es/locale/vi-VN.js +2 -2
- package/lib/es/locale/zh-CN.js +2 -2
- package/lib/es/locale/zh-TW.js +2 -2
- package/lib/types/facade/f-univer.d.ts +3 -0
- package/package.json +6 -6
package/lib/es/facade.js
CHANGED
|
@@ -1,43 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
|
|
3
|
+
import { FUniver, ICommandService } from "@univerjs/core";
|
|
4
|
+
import { EnableCrosshairHighlightOperation, DisableCrosshairHighlightOperation, SetCrosshairHighlightColorOperation, SheetsCrosshairHighlightService, CROSSHAIR_HIGHLIGHT_COLORS } from "@univerjs/sheets-crosshair-highlight";
|
|
5
|
+
const _FUniverCrosshairHighlightMixin = class _FUniverCrosshairHighlightMixin extends FUniver {
|
|
6
|
+
/**
|
|
7
|
+
* @ignore
|
|
8
|
+
*/
|
|
9
|
+
_initialize(injector) {
|
|
10
|
+
const commandService = injector.get(ICommandService);
|
|
11
|
+
this.disposeWithMe(commandService.onCommandExecuted((commandInfo) => {
|
|
12
|
+
if (commandInfo.id === EnableCrosshairHighlightOperation.id || commandInfo.id === DisableCrosshairHighlightOperation.id) {
|
|
13
|
+
const activeSheet = this.getActiveSheet();
|
|
14
|
+
if (!activeSheet || !this._eventListend(this.Event.CrosshairHighlightEnabledChanged)) return;
|
|
10
15
|
this.fireEvent(this.Event.CrosshairHighlightEnabledChanged, {
|
|
11
16
|
enabled: this.getCrosshairHighlightEnabled(),
|
|
12
|
-
...
|
|
17
|
+
...activeSheet
|
|
13
18
|
});
|
|
14
19
|
}
|
|
15
|
-
if (
|
|
16
|
-
const
|
|
17
|
-
if (!
|
|
20
|
+
if (commandInfo.id === SetCrosshairHighlightColorOperation.id) {
|
|
21
|
+
const activeSheet = this.getActiveSheet();
|
|
22
|
+
if (!activeSheet || !this._eventListend(this.Event.CrosshairHighlightColorChanged)) return;
|
|
18
23
|
this.fireEvent(this.Event.CrosshairHighlightColorChanged, {
|
|
19
24
|
color: this.getCrosshairHighlightColor(),
|
|
20
|
-
...
|
|
25
|
+
...activeSheet
|
|
21
26
|
});
|
|
22
27
|
}
|
|
23
28
|
}));
|
|
24
29
|
}
|
|
25
|
-
setCrosshairHighlightEnabled(
|
|
26
|
-
return
|
|
30
|
+
setCrosshairHighlightEnabled(enabled) {
|
|
31
|
+
return enabled ? this._commandService.syncExecuteCommand(EnableCrosshairHighlightOperation.id) : this._commandService.syncExecuteCommand(DisableCrosshairHighlightOperation.id), this;
|
|
27
32
|
}
|
|
28
|
-
setCrosshairHighlightColor(
|
|
29
|
-
return this._commandService.syncExecuteCommand(
|
|
30
|
-
value:
|
|
33
|
+
setCrosshairHighlightColor(color) {
|
|
34
|
+
return this._commandService.syncExecuteCommand(SetCrosshairHighlightColorOperation.id, {
|
|
35
|
+
value: color
|
|
31
36
|
}), this;
|
|
32
37
|
}
|
|
33
38
|
getCrosshairHighlightEnabled() {
|
|
34
|
-
return this._injector.get(
|
|
39
|
+
return this._injector.get(SheetsCrosshairHighlightService).enabled;
|
|
35
40
|
}
|
|
36
41
|
getCrosshairHighlightColor() {
|
|
37
|
-
return this._injector.get(
|
|
42
|
+
return this._injector.get(SheetsCrosshairHighlightService).color;
|
|
38
43
|
}
|
|
39
44
|
get CROSSHAIR_HIGHLIGHT_COLORS() {
|
|
40
|
-
return
|
|
45
|
+
return CROSSHAIR_HIGHLIGHT_COLORS;
|
|
41
46
|
}
|
|
42
|
-
}
|
|
43
|
-
|
|
47
|
+
};
|
|
48
|
+
__name(_FUniverCrosshairHighlightMixin, "FUniverCrosshairHighlightMixin");
|
|
49
|
+
let FUniverCrosshairHighlightMixin = _FUniverCrosshairHighlightMixin;
|
|
50
|
+
FUniver.extend(FUniverCrosshairHighlightMixin);
|
package/lib/es/index.js
CHANGED
|
@@ -1,66 +1,71 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value;
|
|
3
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
|
|
4
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
|
|
5
|
+
import { Disposable, CommandType, useDependency, useObservable, UniverInstanceType, Inject, ICommandService, RANGE_TYPE, Rectangle, IContextService, ColorKit, Plugin, merge as merge$1, Injector, IConfigService } from "@univerjs/core";
|
|
6
|
+
import { Shape, Rect, IRenderManagerService } from "@univerjs/engine-render";
|
|
7
|
+
import { MenuItemType, getMenuHiddenObservable, ContextMenuPosition, ContextMenuGroup, ComponentManager, IMenuManagerService } from "@univerjs/ui";
|
|
8
|
+
import { BehaviorSubject, combineLatest, startWith, tap, merge, map } from "rxjs";
|
|
9
|
+
import require$$0, { forwardRef, useRef, createElement, useCallback } from "react";
|
|
10
|
+
import { SheetsSelectionsService, REF_SELECTIONS_ENABLED, IRefSelectionsService } from "@univerjs/sheets";
|
|
11
|
+
import { SheetSkeletonManagerService, getCoordByCell } from "@univerjs/sheets-ui";
|
|
12
|
+
const SHEETS_CROSSHAIR_HIGHLIGHT_PLUGIN_CONFIG_KEY = "sheets-crosshair-highlight.config", defaultPluginConfig = {};
|
|
13
|
+
var __assign = function() {
|
|
14
|
+
return __assign = Object.assign || function(t) {
|
|
15
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
16
|
+
s = arguments[i];
|
|
17
|
+
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && (t[p] = s[p]);
|
|
17
18
|
}
|
|
18
|
-
return
|
|
19
|
-
},
|
|
20
|
-
},
|
|
19
|
+
return t;
|
|
20
|
+
}, __assign.apply(this, arguments);
|
|
21
|
+
}, __rest = function(s, e) {
|
|
21
22
|
var t = {};
|
|
22
|
-
for (var
|
|
23
|
-
if (
|
|
24
|
-
for (var
|
|
25
|
-
e.indexOf(
|
|
23
|
+
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
24
|
+
if (s != null && typeof Object.getOwnPropertySymbols == "function")
|
|
25
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
|
|
26
|
+
e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
|
|
26
27
|
return t;
|
|
27
|
-
},
|
|
28
|
-
var
|
|
29
|
-
return
|
|
28
|
+
}, IconBase = forwardRef(function(props, ref) {
|
|
29
|
+
var icon = props.icon, id = props.id, className = props.className, extend = props.extend, restProps = __rest(props, ["icon", "id", "className", "extend"]), cls = "univerjs-icon univerjs-icon-".concat(id, " ").concat(className || "").trim(), idSuffix = useRef("_".concat(generateShortUuid()));
|
|
30
|
+
return render(icon, "".concat(id), { defIds: icon.defIds, idSuffix: idSuffix.current }, __assign({ ref, className: cls }, restProps), extend);
|
|
30
31
|
});
|
|
31
|
-
function
|
|
32
|
-
return
|
|
33
|
-
return
|
|
32
|
+
function render(node, id, runtimeProps, rootProps, extend) {
|
|
33
|
+
return createElement(node.tag, __assign(__assign({ key: id }, replaceRuntimeIdsAndExtInAttrs(node, runtimeProps, extend)), rootProps), (replaceRuntimeIdsInDefs(node, runtimeProps).children || []).map(function(child, index) {
|
|
34
|
+
return render(child, "".concat(id, "-").concat(node.tag, "-").concat(index), runtimeProps, void 0, extend);
|
|
34
35
|
}));
|
|
35
36
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
__name(render, "render");
|
|
38
|
+
function replaceRuntimeIdsAndExtInAttrs(node, runtimeProps, extend) {
|
|
39
|
+
var attrs = __assign({}, node.attrs);
|
|
40
|
+
extend != null && extend.colorChannel1 && attrs.fill === "colorChannel1" && (attrs.fill = extend.colorChannel1);
|
|
41
|
+
var defIds = runtimeProps.defIds;
|
|
42
|
+
return !defIds || defIds.length === 0 || (node.tag === "use" && attrs["xlink:href"] && (attrs["xlink:href"] = attrs["xlink:href"] + runtimeProps.idSuffix), Object.entries(attrs).forEach(function(_a4) {
|
|
43
|
+
var key = _a4[0], value = _a4[1];
|
|
44
|
+
typeof value == "string" && (attrs[key] = value.replace(/url\(#(.*)\)/, "url(#$1".concat(runtimeProps.idSuffix, ")")));
|
|
45
|
+
})), attrs;
|
|
44
46
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
__name(replaceRuntimeIdsAndExtInAttrs, "replaceRuntimeIdsAndExtInAttrs");
|
|
48
|
+
function replaceRuntimeIdsInDefs(node, runtimeProps) {
|
|
49
|
+
var _a4, defIds = runtimeProps.defIds;
|
|
50
|
+
return !defIds || defIds.length === 0 ? node : node.tag === "defs" && (!((_a4 = node.children) === null || _a4 === void 0) && _a4.length) ? __assign(__assign({}, node), { children: node.children.map(function(child) {
|
|
51
|
+
return typeof child.attrs.id == "string" && defIds && defIds.indexOf(child.attrs.id) > -1 ? __assign(__assign({}, child), { attrs: __assign(__assign({}, child.attrs), { id: child.attrs.id + runtimeProps.idSuffix }) }) : child;
|
|
52
|
+
}) }) : node;
|
|
50
53
|
}
|
|
51
|
-
|
|
54
|
+
__name(replaceRuntimeIdsInDefs, "replaceRuntimeIdsInDefs");
|
|
55
|
+
function generateShortUuid() {
|
|
52
56
|
return Math.random().toString(36).substring(2, 8);
|
|
53
57
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
__name(generateShortUuid, "generateShortUuid");
|
|
59
|
+
IconBase.displayName = "UniverIcon";
|
|
60
|
+
var element = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "#E5E5E5", d: "M1.6499 3.65002C1.6499 2.54545 2.54533 1.65002 3.6499 1.65002H12.3499C13.4545 1.65002 14.3499 2.54545 14.3499 3.65002V12.35C14.3499 13.4546 13.4545 14.35 12.3499 14.35H3.6499C2.54533 14.35 1.6499 13.4546 1.6499 12.35V3.65002Z" } }, { tag: "path", attrs: { fill: "#fff", d: "M9.9998 1.65002H5.9998V6H1.6499V10H5.9998V14.35H9.9998V10H14.3499V6H9.9998V1.65002Z" } }, { 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" } }] }, CrossHighlightingSingle = forwardRef(function(props, ref) {
|
|
61
|
+
return createElement(IconBase, Object.assign({}, props, {
|
|
57
62
|
id: "cross-highlighting-single",
|
|
58
|
-
ref
|
|
59
|
-
icon:
|
|
63
|
+
ref,
|
|
64
|
+
icon: element
|
|
60
65
|
}));
|
|
61
66
|
});
|
|
62
|
-
|
|
63
|
-
const
|
|
67
|
+
CrossHighlightingSingle.displayName = "CrossHighlightingSingle";
|
|
68
|
+
const CROSSHAIR_HIGHLIGHT_COLORS = [
|
|
64
69
|
"rgba(158, 109, 227, 0.3)",
|
|
65
70
|
"rgba(254, 75, 75, 0.3)",
|
|
66
71
|
"rgba(255, 140, 81, 0.3)",
|
|
@@ -77,14 +82,13 @@ const q = [
|
|
|
77
82
|
"rgba(58, 96, 247, 0.15)",
|
|
78
83
|
"rgba(242, 72, 166, 0.15)",
|
|
79
84
|
"rgba(153, 153, 153, 0.15)"
|
|
80
|
-
]
|
|
81
|
-
class S extends $ {
|
|
85
|
+
], _SheetsCrosshairHighlightService = class _SheetsCrosshairHighlightService extends Disposable {
|
|
82
86
|
constructor() {
|
|
83
87
|
super(...arguments);
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
__publicField(this, "_enabled$", new BehaviorSubject(!1));
|
|
89
|
+
__publicField(this, "enabled$", this._enabled$.asObservable());
|
|
90
|
+
__publicField(this, "_color$", new BehaviorSubject(CROSSHAIR_HIGHLIGHT_COLORS[0]));
|
|
91
|
+
__publicField(this, "color$", this._color$.asObservable());
|
|
88
92
|
}
|
|
89
93
|
get enabled() {
|
|
90
94
|
return this._enabled$.getValue();
|
|
@@ -95,43 +99,45 @@ class S extends $ {
|
|
|
95
99
|
dispose() {
|
|
96
100
|
this._enabled$.complete();
|
|
97
101
|
}
|
|
98
|
-
setEnabled(
|
|
99
|
-
this._enabled$.next(
|
|
102
|
+
setEnabled(value) {
|
|
103
|
+
this._enabled$.next(value);
|
|
100
104
|
}
|
|
101
|
-
setColor(
|
|
102
|
-
this._color$.next(
|
|
105
|
+
setColor(value) {
|
|
106
|
+
this._color$.next(value);
|
|
103
107
|
}
|
|
104
|
-
}
|
|
105
|
-
|
|
108
|
+
};
|
|
109
|
+
__name(_SheetsCrosshairHighlightService, "SheetsCrosshairHighlightService");
|
|
110
|
+
let SheetsCrosshairHighlightService = _SheetsCrosshairHighlightService;
|
|
111
|
+
const ToggleCrosshairHighlightOperation = {
|
|
106
112
|
id: "sheet.operation.toggle-crosshair-highlight",
|
|
107
|
-
type:
|
|
108
|
-
handler(
|
|
109
|
-
const
|
|
110
|
-
return
|
|
113
|
+
type: CommandType.OPERATION,
|
|
114
|
+
handler(accessor) {
|
|
115
|
+
const service = accessor.get(SheetsCrosshairHighlightService), turnedOn = service.enabled;
|
|
116
|
+
return service.setEnabled(!turnedOn), !0;
|
|
111
117
|
}
|
|
112
|
-
},
|
|
118
|
+
}, SetCrosshairHighlightColorOperation = {
|
|
113
119
|
id: "sheet.operation.set-crosshair-highlight-color",
|
|
114
|
-
type:
|
|
115
|
-
handler(
|
|
116
|
-
const
|
|
117
|
-
return
|
|
120
|
+
type: CommandType.OPERATION,
|
|
121
|
+
handler(accessor, { value }) {
|
|
122
|
+
const service = accessor.get(SheetsCrosshairHighlightService);
|
|
123
|
+
return service.enabled || service.setEnabled(!0), service.setColor(value), !0;
|
|
118
124
|
}
|
|
119
|
-
},
|
|
125
|
+
}, EnableCrosshairHighlightOperation = {
|
|
120
126
|
id: "sheet.operation.enable-crosshair-highlight",
|
|
121
|
-
type:
|
|
122
|
-
handler(
|
|
123
|
-
const
|
|
124
|
-
return
|
|
127
|
+
type: CommandType.OPERATION,
|
|
128
|
+
handler(accessor) {
|
|
129
|
+
const service = accessor.get(SheetsCrosshairHighlightService);
|
|
130
|
+
return service.enabled ? !1 : (service.setEnabled(!0), !0);
|
|
125
131
|
}
|
|
126
|
-
},
|
|
132
|
+
}, DisableCrosshairHighlightOperation = {
|
|
127
133
|
id: "sheet.operation.disable-crosshair-highlight",
|
|
128
|
-
type:
|
|
129
|
-
handler(
|
|
130
|
-
const
|
|
131
|
-
return
|
|
134
|
+
type: CommandType.OPERATION,
|
|
135
|
+
handler(accessor) {
|
|
136
|
+
const service = accessor.get(SheetsCrosshairHighlightService);
|
|
137
|
+
return service.enabled ? (service.setEnabled(!1), !0) : !1;
|
|
132
138
|
}
|
|
133
139
|
};
|
|
134
|
-
var
|
|
140
|
+
var jsxRuntime = { exports: {} }, reactJsxRuntime_production_min = {};
|
|
135
141
|
/**
|
|
136
142
|
* @license React
|
|
137
143
|
* react-jsx-runtime.production.min.js
|
|
@@ -141,153 +147,158 @@ var I = { exports: {} }, m = {};
|
|
|
141
147
|
* This source code is licensed under the MIT license found in the
|
|
142
148
|
* LICENSE file in the root directory of this source tree.
|
|
143
149
|
*/
|
|
144
|
-
var
|
|
145
|
-
function
|
|
146
|
-
if (
|
|
147
|
-
|
|
148
|
-
var
|
|
149
|
-
function
|
|
150
|
-
var
|
|
151
|
-
|
|
152
|
-
for (
|
|
153
|
-
if (
|
|
154
|
-
return { $$typeof:
|
|
155
|
-
}
|
|
156
|
-
return
|
|
150
|
+
var hasRequiredReactJsxRuntime_production_min;
|
|
151
|
+
function requireReactJsxRuntime_production_min() {
|
|
152
|
+
if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
|
|
153
|
+
hasRequiredReactJsxRuntime_production_min = 1;
|
|
154
|
+
var f = require$$0, k = Symbol.for("react.element"), l = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
155
|
+
function q(c, a, g) {
|
|
156
|
+
var b, d = {}, e = null, h = null;
|
|
157
|
+
g !== void 0 && (e = "" + g), a.key !== void 0 && (e = "" + a.key), a.ref !== void 0 && (h = a.ref);
|
|
158
|
+
for (b in a) m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
|
|
159
|
+
if (c && c.defaultProps) for (b in a = c.defaultProps, a) d[b] === void 0 && (d[b] = a[b]);
|
|
160
|
+
return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current };
|
|
161
|
+
}
|
|
162
|
+
return __name(q, "q"), reactJsxRuntime_production_min.Fragment = l, reactJsxRuntime_production_min.jsx = q, reactJsxRuntime_production_min.jsxs = q, reactJsxRuntime_production_min;
|
|
157
163
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
164
|
+
__name(requireReactJsxRuntime_production_min, "requireReactJsxRuntime_production_min");
|
|
165
|
+
var hasRequiredJsxRuntime;
|
|
166
|
+
function requireJsxRuntime() {
|
|
167
|
+
return hasRequiredJsxRuntime || (hasRequiredJsxRuntime = 1, jsxRuntime.exports = requireReactJsxRuntime_production_min()), jsxRuntime.exports;
|
|
161
168
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
__name(requireJsxRuntime, "requireJsxRuntime");
|
|
170
|
+
var jsxRuntimeExports = requireJsxRuntime();
|
|
171
|
+
function r(e) {
|
|
172
|
+
var t, f, n = "";
|
|
173
|
+
if (typeof e == "string" || typeof e == "number") n += e;
|
|
174
|
+
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
175
|
+
var o = e.length;
|
|
176
|
+
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
177
|
+
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
178
|
+
return n;
|
|
171
179
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
180
|
+
__name(r, "r");
|
|
181
|
+
function clsx() {
|
|
182
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
183
|
+
return n;
|
|
175
184
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
185
|
+
__name(clsx, "clsx");
|
|
186
|
+
const crosshairHighlightOverlay = "univer-crosshair-highlight-overlay", crosshairHighlightItem = "univer-crosshair-highlight-item", crosshairHighlightItemSelected = "univer-crosshair-highlight-item-selected", styles = {
|
|
187
|
+
crosshairHighlightOverlay,
|
|
188
|
+
crosshairHighlightItem,
|
|
189
|
+
crosshairHighlightItemSelected
|
|
180
190
|
};
|
|
181
|
-
function
|
|
182
|
-
const { onChange
|
|
183
|
-
|
|
184
|
-
}, [
|
|
185
|
-
return /* @__PURE__ */
|
|
191
|
+
function CrosshairOverlay(props) {
|
|
192
|
+
const { onChange } = props, crosshairSrv = useDependency(SheetsCrosshairHighlightService), currentColor = useObservable(crosshairSrv.color$), handleColorPicked = useCallback((color) => {
|
|
193
|
+
onChange == null || onChange(color);
|
|
194
|
+
}, [onChange]);
|
|
195
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles.crosshairHighlightOverlay, children: CROSSHAIR_HIGHLIGHT_COLORS.map((color) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
186
196
|
"div",
|
|
187
197
|
{
|
|
188
|
-
className:
|
|
189
|
-
[
|
|
198
|
+
className: clsx(styles.crosshairHighlightItem, {
|
|
199
|
+
[styles.crosshairHighlightItemSelected]: color === currentColor
|
|
190
200
|
}),
|
|
191
|
-
style: { backgroundColor:
|
|
192
|
-
onClick: () =>
|
|
201
|
+
style: { backgroundColor: color },
|
|
202
|
+
onClick: /* @__PURE__ */ __name(() => handleColorPicked(color), "onClick")
|
|
193
203
|
},
|
|
194
|
-
|
|
204
|
+
color
|
|
195
205
|
)) });
|
|
196
206
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
207
|
+
__name(CrosshairOverlay, "CrosshairOverlay");
|
|
208
|
+
const CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT = "CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT";
|
|
209
|
+
function CrosshairHighlightMenuItemFactory(accessor) {
|
|
210
|
+
const crosshairHighlightService = accessor.get(SheetsCrosshairHighlightService);
|
|
200
211
|
return {
|
|
201
|
-
id:
|
|
212
|
+
id: ToggleCrosshairHighlightOperation.id,
|
|
202
213
|
tooltip: "crosshair.button.tooltip",
|
|
203
|
-
type:
|
|
214
|
+
type: MenuItemType.BUTTON_SELECTOR,
|
|
204
215
|
icon: "CrossHighlightingSingle",
|
|
205
216
|
selections: [
|
|
206
217
|
{
|
|
207
218
|
label: {
|
|
208
|
-
name:
|
|
219
|
+
name: CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT,
|
|
209
220
|
hoverable: !1
|
|
210
221
|
}
|
|
211
222
|
}
|
|
212
223
|
],
|
|
213
|
-
selectionsCommandId:
|
|
214
|
-
activated$:
|
|
215
|
-
hidden$:
|
|
224
|
+
selectionsCommandId: SetCrosshairHighlightColorOperation.id,
|
|
225
|
+
activated$: crosshairHighlightService.enabled$,
|
|
226
|
+
hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET)
|
|
216
227
|
};
|
|
217
228
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
229
|
+
__name(CrosshairHighlightMenuItemFactory, "CrosshairHighlightMenuItemFactory");
|
|
230
|
+
const menuSchema = {
|
|
231
|
+
[ContextMenuPosition.FOOTER_MENU]: {
|
|
232
|
+
[ContextMenuGroup.OTHERS]: {
|
|
233
|
+
[ToggleCrosshairHighlightOperation.id]: {
|
|
222
234
|
order: 0,
|
|
223
|
-
menuItemFactory:
|
|
235
|
+
menuItemFactory: CrosshairHighlightMenuItemFactory
|
|
224
236
|
}
|
|
225
237
|
}
|
|
226
238
|
}
|
|
227
239
|
};
|
|
228
|
-
var
|
|
229
|
-
for (var
|
|
230
|
-
(
|
|
231
|
-
return
|
|
232
|
-
},
|
|
233
|
-
let
|
|
234
|
-
constructor(
|
|
235
|
-
super(), this._componentMgr =
|
|
240
|
+
var __defProp$2 = Object.defineProperty, __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor, __decorateClass$2 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
241
|
+
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
242
|
+
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
243
|
+
return kind && result && __defProp$2(target, key, result), result;
|
|
244
|
+
}, "__decorateClass$2"), __decorateParam$2 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$2"), _a;
|
|
245
|
+
let SheetsCrosshairHighlightController = (_a = class extends Disposable {
|
|
246
|
+
constructor(_componentMgr, _menuManagerService, _cmdSrv) {
|
|
247
|
+
super(), this._componentMgr = _componentMgr, this._menuManagerService = _menuManagerService, this._cmdSrv = _cmdSrv, this._initCommands(), this._initMenus(), this._initComponents();
|
|
236
248
|
}
|
|
237
249
|
_initCommands() {
|
|
238
250
|
[
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
].forEach((
|
|
251
|
+
ToggleCrosshairHighlightOperation,
|
|
252
|
+
SetCrosshairHighlightColorOperation,
|
|
253
|
+
EnableCrosshairHighlightOperation,
|
|
254
|
+
DisableCrosshairHighlightOperation
|
|
255
|
+
].forEach((c) => this._cmdSrv.registerCommand(c));
|
|
244
256
|
}
|
|
245
257
|
_initMenus() {
|
|
246
|
-
this._menuManagerService.mergeMenu(
|
|
258
|
+
this._menuManagerService.mergeMenu(menuSchema);
|
|
247
259
|
}
|
|
248
260
|
_initComponents() {
|
|
249
|
-
this._componentMgr.register(
|
|
250
|
-
}
|
|
251
|
-
};
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
],
|
|
257
|
-
const
|
|
258
|
-
class Qe {
|
|
261
|
+
this._componentMgr.register(CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT, CrosshairOverlay), this._componentMgr.register("CrossHighlightingSingle", CrossHighlightingSingle);
|
|
262
|
+
}
|
|
263
|
+
}, __name(_a, "SheetsCrosshairHighlightController"), _a);
|
|
264
|
+
SheetsCrosshairHighlightController = __decorateClass$2([
|
|
265
|
+
__decorateParam$2(0, Inject(ComponentManager)),
|
|
266
|
+
__decorateParam$2(1, IMenuManagerService),
|
|
267
|
+
__decorateParam$2(2, ICommandService)
|
|
268
|
+
], SheetsCrosshairHighlightController);
|
|
269
|
+
const SHEETS_CROSSHAIR_HIGHLIGHT_Z_INDEX = 1, _CrossHairRangeCollection = class _CrossHairRangeCollection {
|
|
259
270
|
constructor() {
|
|
260
|
-
|
|
261
|
-
|
|
271
|
+
__publicField(this, "_selectedRanges", []);
|
|
272
|
+
__publicField(this, "_ranges", []);
|
|
262
273
|
}
|
|
263
|
-
addRange(
|
|
264
|
-
if (
|
|
274
|
+
addRange(range) {
|
|
275
|
+
if (range.rangeType === RANGE_TYPE.COLUMN || range.rangeType === RANGE_TYPE.ROW || range.rangeType === RANGE_TYPE.ALL)
|
|
265
276
|
return;
|
|
266
|
-
const
|
|
267
|
-
|
|
268
|
-
}
|
|
269
|
-
setSelectedRanges(
|
|
270
|
-
this._selectedRanges =
|
|
271
|
-
}
|
|
272
|
-
_getSplitRanges(
|
|
273
|
-
let
|
|
274
|
-
for (const
|
|
275
|
-
const
|
|
276
|
-
for (const
|
|
277
|
-
const
|
|
278
|
-
|
|
277
|
+
const intersects = this._getIntersects(range), splitRanges = this._getSplitRanges(range, intersects);
|
|
278
|
+
splitRanges.length > 0 && this._ranges.push(...splitRanges);
|
|
279
|
+
}
|
|
280
|
+
setSelectedRanges(selectedRange) {
|
|
281
|
+
this._selectedRanges = selectedRange;
|
|
282
|
+
}
|
|
283
|
+
_getSplitRanges(range, intersects) {
|
|
284
|
+
let splitRanges = [range];
|
|
285
|
+
for (const intersect of intersects.concat(this._selectedRanges)) {
|
|
286
|
+
const newRanges = [];
|
|
287
|
+
for (const splitRange of splitRanges) {
|
|
288
|
+
const split = Rectangle.subtract(splitRange, intersect);
|
|
289
|
+
split && split.length > 0 && newRanges.push(...split);
|
|
279
290
|
}
|
|
280
|
-
|
|
291
|
+
splitRanges = newRanges;
|
|
281
292
|
}
|
|
282
|
-
return
|
|
293
|
+
return splitRanges.filter((range2) => range2.startRow <= range2.endRow && range2.startColumn <= range2.endColumn);
|
|
283
294
|
}
|
|
284
|
-
_getIntersects(
|
|
285
|
-
const
|
|
286
|
-
for (const
|
|
287
|
-
const
|
|
288
|
-
|
|
295
|
+
_getIntersects(addRange) {
|
|
296
|
+
const intersects = [];
|
|
297
|
+
for (const range of this._ranges) {
|
|
298
|
+
const intersect = Rectangle.getIntersects(range, addRange);
|
|
299
|
+
intersect && intersects.push(intersect);
|
|
289
300
|
}
|
|
290
|
-
return
|
|
301
|
+
return intersects;
|
|
291
302
|
}
|
|
292
303
|
getRanges() {
|
|
293
304
|
return this._ranges;
|
|
@@ -295,189 +306,193 @@ class Qe {
|
|
|
295
306
|
reset() {
|
|
296
307
|
this._ranges = [], this._selectedRanges = [];
|
|
297
308
|
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
309
|
+
};
|
|
310
|
+
__name(_CrossHairRangeCollection, "CrossHairRangeCollection");
|
|
311
|
+
let CrossHairRangeCollection = _CrossHairRangeCollection;
|
|
312
|
+
const _SheetCrossHairHighlightShape = class _SheetCrossHairHighlightShape extends Shape {
|
|
313
|
+
constructor(key, props) {
|
|
314
|
+
super(key, props);
|
|
302
315
|
// protected _showHighLight = false;
|
|
303
|
-
|
|
304
|
-
|
|
316
|
+
__publicField(this, "_color");
|
|
317
|
+
props && this.setShapeProps(props);
|
|
305
318
|
}
|
|
306
|
-
setShapeProps(
|
|
307
|
-
typeof
|
|
308
|
-
width:
|
|
309
|
-
height:
|
|
319
|
+
setShapeProps(props) {
|
|
320
|
+
typeof props.color < "u" && (this._color = props.color), this.transformByState({
|
|
321
|
+
width: props.width,
|
|
322
|
+
height: props.height
|
|
310
323
|
});
|
|
311
324
|
}
|
|
312
|
-
_draw(
|
|
313
|
-
const
|
|
314
|
-
|
|
325
|
+
_draw(ctx) {
|
|
326
|
+
const color = `rgba(${this._color.r}, ${this._color.g}, ${this._color.b}, ${this._color.a})`;
|
|
327
|
+
Rect.drawWith(ctx, {
|
|
315
328
|
width: this.width,
|
|
316
329
|
height: this.height,
|
|
317
|
-
fill:
|
|
330
|
+
fill: color,
|
|
318
331
|
stroke: void 0,
|
|
319
332
|
strokeWidth: 0,
|
|
320
333
|
evented: !1
|
|
321
334
|
});
|
|
322
335
|
}
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
336
|
+
};
|
|
337
|
+
__name(_SheetCrossHairHighlightShape, "SheetCrossHairHighlightShape");
|
|
338
|
+
let SheetCrossHairHighlightShape = _SheetCrossHairHighlightShape;
|
|
339
|
+
var __defProp$1 = Object.defineProperty, __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor, __decorateClass$1 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
340
|
+
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
341
|
+
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
342
|
+
return kind && result && __defProp$1(target, key, result), result;
|
|
343
|
+
}, "__decorateClass$1"), __decorateParam$1 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$1"), _a2;
|
|
344
|
+
let SheetCrosshairHighlightRenderController = (_a2 = class extends Disposable {
|
|
345
|
+
constructor(_context, _sheetSkeletonManagerService, _sheetsSelectionsService, _sheetsCrosshairHighlightService, _contextService, _refSelectionsService) {
|
|
331
346
|
super();
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
this._context =
|
|
347
|
+
__publicField(this, "_shapes", []);
|
|
348
|
+
__publicField(this, "_rangeCollection", new CrossHairRangeCollection());
|
|
349
|
+
__publicField(this, "_color", "rgba(255,0,0,0.5)");
|
|
350
|
+
this._context = _context, this._sheetSkeletonManagerService = _sheetSkeletonManagerService, this._sheetsSelectionsService = _sheetsSelectionsService, this._sheetsCrosshairHighlightService = _sheetsCrosshairHighlightService, this._contextService = _contextService, this._refSelectionsService = _refSelectionsService, this._initRenderListener();
|
|
336
351
|
}
|
|
337
|
-
_transformSelection(
|
|
338
|
-
if (!
|
|
352
|
+
_transformSelection(selectionData, sheet) {
|
|
353
|
+
if (!selectionData)
|
|
339
354
|
return;
|
|
340
|
-
const
|
|
341
|
-
for (const
|
|
342
|
-
const { startRow
|
|
343
|
-
|
|
355
|
+
const rowCount = sheet.getRowCount(), columnCount = sheet.getColumnCount(), ranges = [];
|
|
356
|
+
for (const selection of selectionData) {
|
|
357
|
+
const { startRow, endRow, startColumn, endColumn } = selection.range;
|
|
358
|
+
endRow - startRow + 1 === rowCount || endColumn - startColumn + 1 === columnCount || ranges.push(selection.range);
|
|
344
359
|
}
|
|
345
|
-
this._rangeCollection.setSelectedRanges(
|
|
346
|
-
for (const
|
|
347
|
-
this.addSelection(
|
|
360
|
+
this._rangeCollection.setSelectedRanges(ranges);
|
|
361
|
+
for (const range of ranges)
|
|
362
|
+
this.addSelection(range, sheet);
|
|
348
363
|
}
|
|
349
364
|
_initRenderListener() {
|
|
350
|
-
const
|
|
351
|
-
this.disposeWithMe(
|
|
352
|
-
this._contextService.subscribeContextValue$(
|
|
365
|
+
const workbook = this._context.unit;
|
|
366
|
+
this.disposeWithMe(combineLatest([
|
|
367
|
+
this._contextService.subscribeContextValue$(REF_SELECTIONS_ENABLED).pipe(startWith(!1)),
|
|
353
368
|
this._sheetSkeletonManagerService.currentSkeleton$,
|
|
354
369
|
this._sheetsCrosshairHighlightService.enabled$,
|
|
355
|
-
this._sheetsCrosshairHighlightService.color$.pipe(
|
|
356
|
-
|
|
370
|
+
this._sheetsCrosshairHighlightService.color$.pipe(tap((color) => this._color = color)),
|
|
371
|
+
merge(
|
|
357
372
|
this._sheetsSelectionsService.selectionMoveStart$,
|
|
358
373
|
this._sheetsSelectionsService.selectionMoving$,
|
|
359
374
|
this._sheetsSelectionsService.selectionMoveEnd$,
|
|
360
375
|
this._sheetsSelectionsService.selectionSet$,
|
|
361
|
-
|
|
376
|
+
workbook.activeSheet$.pipe(map(() => this._sheetsSelectionsService.getCurrentSelections()))
|
|
362
377
|
),
|
|
363
|
-
|
|
378
|
+
merge(
|
|
364
379
|
this._refSelectionsService.selectionMoveStart$,
|
|
365
380
|
this._refSelectionsService.selectionMoving$,
|
|
366
381
|
this._refSelectionsService.selectionMoveEnd$,
|
|
367
382
|
this._sheetsSelectionsService.selectionSet$,
|
|
368
|
-
|
|
383
|
+
workbook.activeSheet$.pipe(map(() => this._refSelectionsService.getCurrentSelections()))
|
|
369
384
|
)
|
|
370
|
-
]).subscribe(([
|
|
371
|
-
if (this._clear(), !
|
|
372
|
-
const
|
|
373
|
-
this._rangeCollection.reset(), this._transformSelection(
|
|
385
|
+
]).subscribe(([refSelectionEnabled, _, enabled, _color, normalSelections, refSelection]) => {
|
|
386
|
+
if (this._clear(), !enabled) return;
|
|
387
|
+
const selections = refSelectionEnabled ? refSelection : normalSelections;
|
|
388
|
+
this._rangeCollection.reset(), this._transformSelection(selections, workbook.getActiveSheet()), this.render(this._rangeCollection.getRanges());
|
|
374
389
|
}));
|
|
375
390
|
}
|
|
376
|
-
addSelection(
|
|
377
|
-
if (
|
|
391
|
+
addSelection(range, sheet) {
|
|
392
|
+
if (range.rangeType === RANGE_TYPE.COLUMN || range.rangeType === RANGE_TYPE.ROW || range.rangeType === RANGE_TYPE.ALL)
|
|
378
393
|
return;
|
|
379
|
-
const
|
|
380
|
-
startRow
|
|
381
|
-
endRow
|
|
394
|
+
const maxRow = sheet.getRowCount(), maxColumn = sheet.getColumnCount(), { startRow, endRow, startColumn, endColumn } = range, left = {
|
|
395
|
+
startRow,
|
|
396
|
+
endRow,
|
|
382
397
|
startColumn: 0,
|
|
383
|
-
endColumn:
|
|
384
|
-
},
|
|
385
|
-
startRow
|
|
386
|
-
endRow
|
|
387
|
-
startColumn:
|
|
388
|
-
endColumn:
|
|
389
|
-
},
|
|
398
|
+
endColumn: startColumn - 1
|
|
399
|
+
}, right = {
|
|
400
|
+
startRow,
|
|
401
|
+
endRow,
|
|
402
|
+
startColumn: endColumn + 1,
|
|
403
|
+
endColumn: maxColumn
|
|
404
|
+
}, top = {
|
|
390
405
|
startRow: 0,
|
|
391
|
-
endRow:
|
|
392
|
-
startColumn
|
|
393
|
-
endColumn
|
|
394
|
-
},
|
|
395
|
-
startRow:
|
|
396
|
-
endRow:
|
|
397
|
-
startColumn
|
|
398
|
-
endColumn
|
|
406
|
+
endRow: startRow - 1,
|
|
407
|
+
startColumn,
|
|
408
|
+
endColumn
|
|
409
|
+
}, bottom = {
|
|
410
|
+
startRow: endRow + 1,
|
|
411
|
+
endRow: maxRow,
|
|
412
|
+
startColumn,
|
|
413
|
+
endColumn
|
|
399
414
|
};
|
|
400
|
-
for (const
|
|
401
|
-
|
|
415
|
+
for (const range2 of [left, right, top, bottom])
|
|
416
|
+
range2.startRow <= range2.endRow && range2.startColumn <= range2.endColumn && this._rangeCollection.addRange(range2);
|
|
402
417
|
}
|
|
403
418
|
_clear() {
|
|
404
|
-
this._shapes.forEach((
|
|
405
|
-
|
|
419
|
+
this._shapes.forEach((shape) => {
|
|
420
|
+
shape.dispose();
|
|
406
421
|
}), this._shapes = [];
|
|
407
422
|
}
|
|
408
|
-
_addShapes(
|
|
409
|
-
const { startRow
|
|
410
|
-
left:
|
|
411
|
-
top:
|
|
412
|
-
color: new
|
|
413
|
-
width
|
|
414
|
-
height
|
|
415
|
-
zIndex:
|
|
423
|
+
_addShapes(range, index, scene, skeleton) {
|
|
424
|
+
const { startRow, endRow, startColumn, endColumn } = range, startPosition = getCoordByCell(startRow, startColumn, scene, skeleton), endPosition = getCoordByCell(endRow, endColumn, scene, skeleton), { startX, startY } = startPosition, { endX, endY } = endPosition, width = endX - startX, height = endY - startY, shapeProps = {
|
|
425
|
+
left: startX,
|
|
426
|
+
top: startY,
|
|
427
|
+
color: new ColorKit(this._color).toRgb(),
|
|
428
|
+
width,
|
|
429
|
+
height,
|
|
430
|
+
zIndex: SHEETS_CROSSHAIR_HIGHLIGHT_Z_INDEX,
|
|
416
431
|
evented: !1
|
|
417
|
-
},
|
|
418
|
-
this._shapes.push(
|
|
432
|
+
}, currentShapes = new SheetCrossHairHighlightShape(`crosshair-${index}`, shapeProps);
|
|
433
|
+
this._shapes.push(currentShapes), scene.addObject(currentShapes);
|
|
419
434
|
}
|
|
420
|
-
render(
|
|
421
|
-
const
|
|
422
|
-
if (!
|
|
435
|
+
render(ranges) {
|
|
436
|
+
const skeleton = this._sheetSkeletonManagerService.getCurrentSkeleton();
|
|
437
|
+
if (!skeleton)
|
|
423
438
|
return;
|
|
424
|
-
const { scene
|
|
439
|
+
const { scene } = this._context;
|
|
425
440
|
this._clear();
|
|
426
|
-
for (let
|
|
427
|
-
const
|
|
428
|
-
this._addShapes(
|
|
441
|
+
for (let i = 0; i < ranges.length; i++) {
|
|
442
|
+
const range = ranges[i];
|
|
443
|
+
this._addShapes(range, i, scene, skeleton);
|
|
429
444
|
}
|
|
430
|
-
|
|
445
|
+
scene.makeDirty(!0);
|
|
431
446
|
}
|
|
432
447
|
async dispose() {
|
|
433
448
|
super.dispose();
|
|
434
449
|
}
|
|
435
|
-
};
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
],
|
|
443
|
-
var
|
|
444
|
-
for (var
|
|
445
|
-
(
|
|
446
|
-
return
|
|
447
|
-
},
|
|
448
|
-
let
|
|
449
|
-
constructor(
|
|
450
|
-
super(), this._config =
|
|
451
|
-
const { ...
|
|
450
|
+
}, __name(_a2, "SheetCrosshairHighlightRenderController"), _a2);
|
|
451
|
+
SheetCrosshairHighlightRenderController = __decorateClass$1([
|
|
452
|
+
__decorateParam$1(1, Inject(SheetSkeletonManagerService)),
|
|
453
|
+
__decorateParam$1(2, Inject(SheetsSelectionsService)),
|
|
454
|
+
__decorateParam$1(3, Inject(SheetsCrosshairHighlightService)),
|
|
455
|
+
__decorateParam$1(4, Inject(IContextService)),
|
|
456
|
+
__decorateParam$1(5, IRefSelectionsService)
|
|
457
|
+
], SheetCrosshairHighlightRenderController);
|
|
458
|
+
var __defProp2 = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __decorateClass = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
459
|
+
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
460
|
+
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
461
|
+
return kind && result && __defProp2(target, key, result), result;
|
|
462
|
+
}, "__decorateClass"), __decorateParam = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam"), _a3;
|
|
463
|
+
let UniverSheetsCrosshairHighlightPlugin = (_a3 = class extends Plugin {
|
|
464
|
+
constructor(_config = defaultPluginConfig, _injector, _renderManagerService, _configService) {
|
|
465
|
+
super(), this._config = _config, this._injector = _injector, this._renderManagerService = _renderManagerService, this._configService = _configService;
|
|
466
|
+
const { ...rest } = merge$1(
|
|
452
467
|
{},
|
|
453
|
-
|
|
468
|
+
defaultPluginConfig,
|
|
454
469
|
this._config
|
|
455
470
|
);
|
|
456
|
-
this._configService.setConfig(
|
|
471
|
+
this._configService.setConfig(SHEETS_CROSSHAIR_HIGHLIGHT_PLUGIN_CONFIG_KEY, rest);
|
|
457
472
|
}
|
|
458
473
|
onStarting() {
|
|
459
474
|
[
|
|
460
|
-
[
|
|
461
|
-
[
|
|
462
|
-
].forEach((
|
|
475
|
+
[SheetsCrosshairHighlightService],
|
|
476
|
+
[SheetsCrosshairHighlightController]
|
|
477
|
+
].forEach((d) => this._injector.add(d));
|
|
463
478
|
}
|
|
464
479
|
onReady() {
|
|
465
480
|
[
|
|
466
|
-
[
|
|
467
|
-
].forEach((
|
|
468
|
-
}
|
|
469
|
-
},
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
],
|
|
481
|
+
[SheetCrosshairHighlightRenderController]
|
|
482
|
+
].forEach((d) => this._injector.add(d)), this._injector.get(SheetsCrosshairHighlightController), this._renderManagerService.registerRenderModule(UniverInstanceType.UNIVER_SHEET, [SheetCrosshairHighlightRenderController]);
|
|
483
|
+
}
|
|
484
|
+
}, __name(_a3, "UniverSheetsCrosshairHighlightPlugin"), __publicField(_a3, "pluginName", "SHEET_CROSSHAIR_HIGHLIGHT_PLUGIN"), __publicField(_a3, "type", UniverInstanceType.UNIVER_SHEET), _a3);
|
|
485
|
+
UniverSheetsCrosshairHighlightPlugin = __decorateClass([
|
|
486
|
+
__decorateParam(1, Inject(Injector)),
|
|
487
|
+
__decorateParam(2, IRenderManagerService),
|
|
488
|
+
__decorateParam(3, IConfigService)
|
|
489
|
+
], UniverSheetsCrosshairHighlightPlugin);
|
|
475
490
|
export {
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
491
|
+
CROSSHAIR_HIGHLIGHT_COLORS,
|
|
492
|
+
DisableCrosshairHighlightOperation,
|
|
493
|
+
EnableCrosshairHighlightOperation,
|
|
494
|
+
SetCrosshairHighlightColorOperation,
|
|
495
|
+
SheetsCrosshairHighlightService,
|
|
496
|
+
ToggleCrosshairHighlightOperation,
|
|
497
|
+
UniverSheetsCrosshairHighlightPlugin
|
|
483
498
|
};
|
package/lib/es/locale/en-US.js
CHANGED
package/lib/es/locale/fa-IR.js
CHANGED
package/lib/es/locale/fr-FR.js
CHANGED
package/lib/es/locale/ru-RU.js
CHANGED
package/lib/es/locale/vi-VN.js
CHANGED
package/lib/es/locale/zh-CN.js
CHANGED
package/lib/es/locale/zh-TW.js
CHANGED
|
@@ -107,6 +107,9 @@ export interface IFUniverCrosshairHighlightMixin {
|
|
|
107
107
|
readonly CROSSHAIR_HIGHLIGHT_COLORS: string[];
|
|
108
108
|
}
|
|
109
109
|
export declare class FUniverCrosshairHighlightMixin extends FUniver implements IFUniverCrosshairHighlightMixin {
|
|
110
|
+
/**
|
|
111
|
+
* @ignore
|
|
112
|
+
*/
|
|
110
113
|
_initialize(injector: Injector): void;
|
|
111
114
|
setCrosshairHighlightEnabled(enabled: boolean): FUniver;
|
|
112
115
|
setCrosshairHighlightColor(color: string): FUniver;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/sheets-crosshair-highlight",
|
|
3
|
-
"version": "0.5.5-nightly.
|
|
3
|
+
"version": "0.5.5-nightly.202501210849",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -59,11 +59,11 @@
|
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@univerjs/icons": "^0.2.12",
|
|
61
61
|
"clsx": "^2.1.1",
|
|
62
|
-
"@univerjs/
|
|
63
|
-
"@univerjs/
|
|
64
|
-
"@univerjs/
|
|
65
|
-
"@univerjs/sheets-ui": "0.5.5-nightly.
|
|
66
|
-
"@univerjs/
|
|
62
|
+
"@univerjs/core": "0.5.5-nightly.202501210849",
|
|
63
|
+
"@univerjs/engine-render": "0.5.5-nightly.202501210849",
|
|
64
|
+
"@univerjs/sheets": "0.5.5-nightly.202501210849",
|
|
65
|
+
"@univerjs/sheets-ui": "0.5.5-nightly.202501210849",
|
|
66
|
+
"@univerjs/ui": "0.5.5-nightly.202501210849"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"less": "^4.2.1",
|