@univerjs/sheets-zen-editor 0.4.2 → 0.5.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/es/index.js CHANGED
@@ -1,158 +1,156 @@
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 { CommandType, IUniverInstanceService, DOCS_ZEN_EDITOR_UNIT_ID_KEY, Tools, UniverInstanceType, DocumentFlavor, DocumentDataModel, createIdentifier, RxDisposable, DEFAULT_EMPTY_DOCUMENT_VALUE, useDependency, ICommandService, FOCUSING_DOC, FOCUSING_UNIVER_EDITOR, EDITOR_ACTIVATED, FOCUSING_EDITOR_STANDALONE, Disposable, Plugin, Inject, Injector, IConfigService } from "@univerjs/core";
6
- import { IEditorService, VIEWPORT_KEY, DocBackScrollRenderController } from "@univerjs/docs-ui";
7
- import { IRenderManagerService } from "@univerjs/engine-render";
8
- import { IEditorBridgeService, EditingRenderController, getEditorObject, getCurrentExclusiveRangeInterest$, getCurrentRangeDisable$ } from "@univerjs/sheets-ui";
9
- import { IZenZoneService, MenuItemType, ContextMenuPosition, ContextMenuGroup, KeyCode, MetaKeys, IMenuManagerService, IShortcutService } from "@univerjs/ui";
10
- import { BehaviorSubject, takeUntil } from "rxjs";
11
- import require$$0, { forwardRef, useRef, createElement, useEffect } from "react";
12
- import { WorkbookEditablePermission, WorksheetEditPermission, WorksheetSetCellValuePermission, WorksheetSetCellStylePermission, RangeProtectionPermissionEditPoint } from "@univerjs/sheets";
13
- const OpenZenEditorCommand = {
1
+ var ce = Object.defineProperty;
2
+ var ae = (e, t, r) => t in e ? ce(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var v = (e, t, r) => ae(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { CommandType as x, IUniverInstanceService as R, DOCS_ZEN_EDITOR_UNIT_ID_KEY as p, Tools as Y, UniverInstanceType as M, DocumentFlavor as H, DocumentDataModel as le, createIdentifier as de, RxDisposable as ue, DEFAULT_EMPTY_DOCUMENT_VALUE as fe, useDependency as P, ICommandService as G, FOCUSING_DOC as ge, FOCUSING_UNIVER_EDITOR as he, EDITOR_ACTIVATED as me, FOCUSING_EDITOR_STANDALONE as pe, Disposable as _e, Plugin as ve, Inject as Ee, Injector as Ie, IConfigService as Se } from "@univerjs/core";
5
+ import { IEditorService as D, VIEWPORT_KEY as Ce, DocBackScrollRenderController as Oe } from "@univerjs/docs-ui";
6
+ import { IRenderManagerService as K } from "@univerjs/engine-render";
7
+ import { IEditorBridgeService as j, EditingRenderController as ye, getEditorObject as Ne, getCurrentExclusiveRangeInterest$ as Te, getCurrentRangeDisable$ as be } from "@univerjs/sheets-ui";
8
+ import { IZenZoneService as T, MenuItemType as ze, ContextMenuPosition as Pe, ContextMenuGroup as xe, KeyCode as X, MetaKeys as Re, IMenuManagerService as Me, IShortcutService as De } from "@univerjs/ui";
9
+ import { BehaviorSubject as je, takeUntil as we } from "rxjs";
10
+ import Ue, { forwardRef as w, useRef as q, createElement as U, useEffect as Ze } from "react";
11
+ import { WorkbookEditablePermission as Le, WorksheetEditPermission as Ae, WorksheetSetCellValuePermission as $e, WorksheetSetCellStylePermission as Be, RangeProtectionPermissionEditPoint as ke } from "@univerjs/sheets";
12
+ const Z = {
14
13
  id: "zen-editor.command.open-zen-editor",
15
- type: CommandType.COMMAND,
16
- handler: /* @__PURE__ */ __name(async (accessor) => {
17
- var _a4;
18
- const zenZoneService = accessor.get(IZenZoneService), editorService = accessor.get(IEditorService), editorBridgeService = accessor.get(IEditorBridgeService), univerInstanceService = accessor.get(IUniverInstanceService);
19
- zenZoneService.open();
20
- const editor = editorService.getEditor(DOCS_ZEN_EDITOR_UNIT_ID_KEY);
21
- if (editor == null)
14
+ type: x.COMMAND,
15
+ handler: async (e) => {
16
+ var f;
17
+ const t = e.get(T), r = e.get(D), n = e.get(j), i = e.get(R);
18
+ t.open();
19
+ const o = r.getEditor(p);
20
+ if (o == null)
22
21
  return !1;
23
- const editCellState = editorBridgeService.getLatestEditCellState();
24
- if (editCellState == null)
22
+ const s = n.getLatestEditCellState();
23
+ if (s == null)
25
24
  return !1;
26
- const snapshot = (_a4 = editCellState.documentLayoutObject.documentModel) == null ? void 0 : _a4.getSnapshot();
27
- if (snapshot == null)
25
+ const c = (f = s.documentLayoutObject.documentModel) == null ? void 0 : f.getSnapshot();
26
+ if (c == null)
28
27
  return !1;
29
- univerInstanceService.focusUnit(DOCS_ZEN_EDITOR_UNIT_ID_KEY);
30
- const { body, drawings, drawingsOrder, tableSource, settings } = Tools.deepClone(snapshot), newSnapshot = {
31
- ...editor.getDocumentData(),
32
- body,
33
- drawings,
34
- drawingsOrder,
35
- tableSource,
36
- settings
37
- }, textRanges = [
28
+ i.focusUnit(p);
29
+ const { body: a, drawings: u, drawingsOrder: g, tableSource: d, settings: S } = Y.deepClone(c), I = {
30
+ ...o.getDocumentData(),
31
+ body: a,
32
+ drawings: u,
33
+ drawingsOrder: g,
34
+ tableSource: d,
35
+ settings: S
36
+ }, _ = [
38
37
  {
39
38
  startOffset: 0,
40
39
  endOffset: 0,
41
40
  collapsed: !0
42
41
  }
43
42
  ];
44
- return editor.focus(), editor.setDocumentData(newSnapshot, textRanges), editor.clearUndoRedoHistory(), !0;
45
- }, "handler")
46
- }, CancelZenEditCommand = {
43
+ return o.focus(), o.setDocumentData(I, _), o.clearUndoRedoHistory(), !0;
44
+ }
45
+ }, L = {
47
46
  id: "zen-editor.command.cancel-zen-edit",
48
- type: CommandType.COMMAND,
49
- handler: /* @__PURE__ */ __name(async (accessor) => {
50
- const zenZoneEditorService = accessor.get(IZenZoneService), editorBridgeService = accessor.get(IEditorBridgeService), univerInstanceManager = accessor.get(IUniverInstanceService);
51
- zenZoneEditorService.close();
52
- const currentSheetInstance = univerInstanceManager.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
53
- return currentSheetInstance ? (univerInstanceManager.focusUnit(currentSheetInstance.getUnitId()), editorBridgeService.refreshEditCellState(), !0) : !1;
54
- }, "handler")
55
- }, ConfirmZenEditCommand = {
47
+ type: x.COMMAND,
48
+ handler: async (e) => {
49
+ const t = e.get(T), r = e.get(j), n = e.get(R);
50
+ t.close();
51
+ const i = n.getCurrentUnitForType(M.UNIVER_SHEET);
52
+ return i ? (n.focusUnit(i.getUnitId()), r.refreshEditCellState(), !0) : !1;
53
+ }
54
+ }, A = {
56
55
  id: "zen-editor.command.confirm-zen-edit",
57
- type: CommandType.COMMAND,
58
- handler: /* @__PURE__ */ __name(async (accessor) => {
59
- var _a4;
60
- const zenZoneEditorService = accessor.get(IZenZoneService), editorBridgeService = accessor.get(IEditorBridgeService), univerInstanceManager = accessor.get(IUniverInstanceService), editorService = accessor.get(IEditorService);
61
- zenZoneEditorService.close();
62
- const editor = editorService.getEditor(DOCS_ZEN_EDITOR_UNIT_ID_KEY);
63
- if (editor == null)
56
+ type: x.COMMAND,
57
+ handler: async (e) => {
58
+ var a;
59
+ const t = e.get(T), r = e.get(j), n = e.get(R), i = e.get(D);
60
+ t.close();
61
+ const o = i.getEditor(p);
62
+ if (o == null)
64
63
  return !1;
65
- const renderManagerService = accessor.get(IRenderManagerService), currentSheetInstance = univerInstanceManager.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
66
- if (currentSheetInstance) {
67
- const currentSheetId = currentSheetInstance.getUnitId(), editingRenderController = (_a4 = renderManagerService.getRenderById(currentSheetId)) == null ? void 0 : _a4.with(EditingRenderController);
68
- if (editingRenderController) {
69
- const snapshot = Tools.deepClone(editor.getDocumentData());
70
- snapshot.documentStyle.documentFlavor = DocumentFlavor.UNSPECIFIED, editingRenderController.submitCellData(new DocumentDataModel(snapshot));
64
+ const s = e.get(K), c = n.getCurrentUnitForType(M.UNIVER_SHEET);
65
+ if (c) {
66
+ const u = c.getUnitId(), g = (a = s.getRenderById(u)) == null ? void 0 : a.with(ye);
67
+ if (g) {
68
+ const d = Y.deepClone(o.getDocumentData());
69
+ d.documentStyle.documentFlavor = H.UNSPECIFIED, g.submitCellData(new le(d));
71
70
  }
72
- return univerInstanceManager.focusUnit(currentSheetInstance.getUnitId()), editorBridgeService.refreshEditCellState(), !0;
71
+ return n.focusUnit(c.getUnitId()), r.refreshEditCellState(), !0;
73
72
  }
74
73
  return !1;
75
- }, "handler")
76
- }, PLUGIN_CONFIG_KEY = "sheets-zen-editor.config", defaultPluginConfig = {}, _ZenEditorManagerService = class _ZenEditorManagerService {
74
+ }
75
+ }, Ve = "sheets-zen-editor.config", Fe = {};
76
+ class We {
77
77
  constructor() {
78
- __publicField(this, "_position", null);
79
- __publicField(this, "_position$", new BehaviorSubject(null));
80
- __publicField(this, "position$", this._position$.asObservable());
78
+ v(this, "_position", null);
79
+ v(this, "_position$", new je(null));
80
+ v(this, "position$", this._position$.asObservable());
81
81
  }
82
82
  dispose() {
83
83
  this._position$.complete(), this._position = null;
84
84
  }
85
- setPosition(param) {
86
- this._position = param, this._refresh(param);
85
+ setPosition(t) {
86
+ this._position = t, this._refresh(t);
87
87
  }
88
88
  getPosition() {
89
89
  return this._position;
90
90
  }
91
- _refresh(param) {
92
- this._position$.next(param);
91
+ _refresh(t) {
92
+ this._position$.next(t);
93
93
  }
94
- };
95
- __name(_ZenEditorManagerService, "ZenEditorManagerService");
96
- let ZenEditorManagerService = _ZenEditorManagerService;
97
- const IZenEditorManagerService = createIdentifier(
94
+ }
95
+ const $ = de(
98
96
  "univer.sheet-zen-editor-manager.service"
99
97
  );
100
- var __defProp$2 = Object.defineProperty, __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor, __decorateClass$2 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
101
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
102
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
103
- return kind && result && __defProp$2(target, key, result), result;
104
- }, "__decorateClass$2"), __decorateParam$2 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$2"), _a;
105
- let ZenEditorController = (_a = class extends RxDisposable {
106
- constructor(_zenEditorManagerService, _renderManagerService) {
107
- super(), this._zenEditorManagerService = _zenEditorManagerService, this._renderManagerService = _renderManagerService, this._initialize();
98
+ var Ye = Object.defineProperty, He = Object.getOwnPropertyDescriptor, Ge = (e, t, r, n) => {
99
+ for (var i = n > 1 ? void 0 : n ? He(t, r) : t, o = e.length - 1, s; o >= 0; o--)
100
+ (s = e[o]) && (i = (n ? s(t, r, i) : s(i)) || i);
101
+ return n && i && Ye(t, r, i), i;
102
+ }, k = (e, t) => (r, n) => t(r, n, e);
103
+ let y = class extends ue {
104
+ constructor(e, t) {
105
+ super(), this._zenEditorManagerService = e, this._renderManagerService = t, this._initialize();
108
106
  }
109
107
  _initialize() {
110
108
  this._syncZenEditorSize();
111
109
  }
112
110
  // Listen to changes in the size of the zen editor container to set the size of the editor.
113
111
  _syncZenEditorSize() {
114
- this._zenEditorManagerService.position$.pipe(takeUntil(this.dispose$)).subscribe((position) => {
115
- if (position == null)
112
+ this._zenEditorManagerService.position$.pipe(we(this.dispose$)).subscribe((e) => {
113
+ if (e == null)
116
114
  return;
117
- const { width, height } = position, editorObject = getEditorObject(DOCS_ZEN_EDITOR_UNIT_ID_KEY, this._renderManagerService);
118
- editorObject != null && requestIdleCallback(() => {
119
- editorObject.engine.resizeBySize(width, height), this._calculatePagePosition(editorObject), this._scrollToTop();
115
+ const { width: t, height: r } = e, n = Ne(p, this._renderManagerService);
116
+ n != null && requestIdleCallback(() => {
117
+ n.engine.resizeBySize(t, r), this._calculatePagePosition(n), this._scrollToTop();
120
118
  });
121
119
  });
122
120
  }
123
- _calculatePagePosition(currentRender) {
124
- const { document: docsComponent, scene, docBackground } = currentRender, parent = scene == null ? void 0 : scene.getParent(), { width: docsWidth, height: docsHeight, pageMarginLeft, pageMarginTop } = docsComponent;
125
- if (parent == null || docsWidth === Number.POSITIVE_INFINITY || docsHeight === Number.POSITIVE_INFINITY)
121
+ _calculatePagePosition(e) {
122
+ const { document: t, scene: r, docBackground: n } = e, i = r == null ? void 0 : r.getParent(), { width: o, height: s, pageMarginLeft: c, pageMarginTop: a } = t;
123
+ if (i == null || o === Number.POSITIVE_INFINITY || s === Number.POSITIVE_INFINITY)
126
124
  return;
127
- const { width: engineWidth, height: engineHeight } = parent;
128
- let docsLeft = 0;
129
- const docsTop = pageMarginTop;
130
- let sceneWidth = 0, sceneHeight = 0, scrollToX = Number.POSITIVE_INFINITY;
131
- const { scaleX, scaleY } = scene.getAncestorScale();
132
- engineWidth > (docsWidth + pageMarginLeft * 2) * scaleX ? (docsLeft = engineWidth / 2 - docsWidth * scaleX / 2, docsLeft /= scaleX, sceneWidth = (engineWidth - pageMarginLeft * 2) / scaleX, scrollToX = 0) : (docsLeft = pageMarginLeft, sceneWidth = docsWidth + pageMarginLeft * 2, scrollToX = (sceneWidth - engineWidth / scaleX) / 2), engineHeight > docsHeight ? sceneHeight = (engineHeight - pageMarginTop * 2) / scaleY : sceneHeight = docsHeight + pageMarginTop * 2, scene.resize(sceneWidth, sceneHeight), docsComponent.translate(docsLeft, docsTop), docBackground.translate(docsLeft, docsTop);
133
- const viewport = scene.getViewport(VIEWPORT_KEY.VIEW_MAIN);
134
- if (scrollToX !== Number.POSITIVE_INFINITY && viewport != null) {
135
- const actualX = viewport.transScroll2ViewportScrollValue(scrollToX, 0).x;
136
- viewport.scrollToBarPos({
137
- x: actualX
125
+ const { width: u, height: g } = i;
126
+ let d = 0;
127
+ const S = a;
128
+ let E = 0, I = 0, _ = Number.POSITIVE_INFINITY;
129
+ const { scaleX: f, scaleY: oe } = r.getAncestorScale();
130
+ u > (o + c * 2) * f ? (d = u / 2 - o * f / 2, d /= f, E = (u - c * 2) / f, _ = 0) : (d = c, E = o + c * 2, _ = (E - u / f) / 2), g > s ? I = (g - a * 2) / oe : I = s + a * 2, r.resize(E, I), t.translate(d, S), n.translate(d, S);
131
+ const z = r.getViewport(Ce.VIEW_MAIN);
132
+ if (_ !== Number.POSITIVE_INFINITY && z != null) {
133
+ const se = z.transScroll2ViewportScrollValue(_, 0).x;
134
+ z.scrollToBarPos({
135
+ x: se
138
136
  });
139
137
  }
140
138
  return this;
141
139
  }
142
140
  _scrollToTop() {
143
- var _a4;
144
- const backScrollController = (_a4 = this._renderManagerService.getRenderById(DOCS_ZEN_EDITOR_UNIT_ID_KEY)) == null ? void 0 : _a4.with(DocBackScrollRenderController), textRange = {
141
+ var r;
142
+ const e = (r = this._renderManagerService.getRenderById(p)) == null ? void 0 : r.with(Oe), t = {
145
143
  startOffset: 0,
146
144
  endOffset: 0
147
145
  };
148
- backScrollController && backScrollController.scrollToRange(textRange);
146
+ e && e.scrollToRange(t);
149
147
  }
150
- }, __name(_a, "ZenEditorController"), _a);
151
- ZenEditorController = __decorateClass$2([
152
- __decorateParam$2(0, IZenEditorManagerService),
153
- __decorateParam$2(1, IRenderManagerService)
154
- ], ZenEditorController);
155
- var jsxRuntime = { exports: {} }, reactJsxRuntime_production_min = {};
148
+ };
149
+ y = Ge([
150
+ k(0, $),
151
+ k(1, K)
152
+ ], y);
153
+ var J = { exports: {} }, b = {};
156
154
  /**
157
155
  * @license React
158
156
  * react-jsx-runtime.production.min.js
@@ -162,108 +160,101 @@ var jsxRuntime = { exports: {} }, reactJsxRuntime_production_min = {};
162
160
  * This source code is licensed under the MIT license found in the
163
161
  * LICENSE file in the root directory of this source tree.
164
162
  */
165
- 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 };
166
- function q(c, a, g) {
167
- var b, d = {}, e = null, h = null;
168
- g !== void 0 && (e = "" + g), a.key !== void 0 && (e = "" + a.key), a.ref !== void 0 && (h = a.ref);
169
- for (b in a) m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
170
- if (c && c.defaultProps) for (b in a = c.defaultProps, a) d[b] === void 0 && (d[b] = a[b]);
171
- return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current };
163
+ var Ke = Ue, Xe = Symbol.for("react.element"), qe = Symbol.for("react.fragment"), Je = Object.prototype.hasOwnProperty, Qe = Ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, et = { key: !0, ref: !0, __self: !0, __source: !0 };
164
+ function Q(e, t, r) {
165
+ var n, i = {}, o = null, s = null;
166
+ r !== void 0 && (o = "" + r), t.key !== void 0 && (o = "" + t.key), t.ref !== void 0 && (s = t.ref);
167
+ for (n in t) Je.call(t, n) && !et.hasOwnProperty(n) && (i[n] = t[n]);
168
+ if (e && e.defaultProps) for (n in t = e.defaultProps, t) i[n] === void 0 && (i[n] = t[n]);
169
+ return { $$typeof: Xe, type: e, key: o, ref: s, props: i, _owner: Qe.current };
172
170
  }
173
- __name(q, "q");
174
- reactJsxRuntime_production_min.Fragment = l;
175
- reactJsxRuntime_production_min.jsx = q;
176
- reactJsxRuntime_production_min.jsxs = q;
177
- jsxRuntime.exports = reactJsxRuntime_production_min;
178
- var jsxRuntimeExports = jsxRuntime.exports, __assign = function() {
179
- return __assign = Object.assign || function(t) {
180
- for (var s, i = 1, n2 = arguments.length; i < n2; i++) {
181
- s = arguments[i];
182
- for (var p2 in s) Object.prototype.hasOwnProperty.call(s, p2) && (t[p2] = s[p2]);
171
+ b.Fragment = qe;
172
+ b.jsx = Q;
173
+ b.jsxs = Q;
174
+ J.exports = b;
175
+ var h = J.exports, l = function() {
176
+ return l = Object.assign || function(e) {
177
+ for (var t, r = 1, n = arguments.length; r < n; r++) {
178
+ t = arguments[r];
179
+ for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
183
180
  }
184
- return t;
185
- }, __assign.apply(this, arguments);
186
- }, __rest = function(s, e) {
187
- var t = {};
188
- for (var p2 in s) Object.prototype.hasOwnProperty.call(s, p2) && e.indexOf(p2) < 0 && (t[p2] = s[p2]);
189
- if (s != null && typeof Object.getOwnPropertySymbols == "function")
190
- for (var i = 0, p2 = Object.getOwnPropertySymbols(s); i < p2.length; i++)
191
- e.indexOf(p2[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p2[i]) && (t[p2[i]] = s[p2[i]]);
192
- return t;
193
- }, IconBase = forwardRef(function(props, ref) {
194
- 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()));
195
- return render(icon, "".concat(id), { defIds: icon.defIds, idSuffix: idSuffix.current }, __assign({ ref, className: cls }, restProps), extend);
181
+ return e;
182
+ }, l.apply(this, arguments);
183
+ }, tt = function(e, t) {
184
+ var r = {};
185
+ for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
186
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
187
+ for (var i = 0, n = Object.getOwnPropertySymbols(e); i < n.length; i++)
188
+ t.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]]);
189
+ return r;
190
+ }, B = w(function(e, t) {
191
+ var r = e.icon, n = e.id, i = e.className, o = e.extend, s = tt(e, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(n, " ").concat(i || "").trim(), a = q("_".concat(it()));
192
+ return ee(r, "".concat(n), { defIds: r.defIds, idSuffix: a.current }, l({ ref: t, className: c }, s), o);
196
193
  });
197
- function render(node, id, runtimeProps, rootProps, extend) {
198
- return createElement(node.tag, __assign(__assign({ key: id }, replaceRuntimeIdsAndExtInAttrs(node, runtimeProps, extend)), rootProps), (replaceRuntimeIdsInDefs(node, runtimeProps).children || []).map(function(child, index) {
199
- return render(child, "".concat(id, "-").concat(node.tag, "-").concat(index), runtimeProps, void 0, extend);
194
+ function ee(e, t, r, n, i) {
195
+ return U(e.tag, l(l({ key: t }, nt(e, r, i)), n), (rt(e, r).children || []).map(function(o, s) {
196
+ return ee(o, "".concat(t, "-").concat(e.tag, "-").concat(s), r, void 0, i);
200
197
  }));
201
198
  }
202
- __name(render, "render");
203
- function replaceRuntimeIdsAndExtInAttrs(node, runtimeProps, extend) {
204
- var attrs = __assign({}, node.attrs);
205
- extend != null && extend.colorChannel1 && attrs.fill === "colorChannel1" && (attrs.fill = extend.colorChannel1);
206
- var defIds = runtimeProps.defIds;
207
- 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) {
208
- var key = _a4[0], value = _a4[1];
209
- typeof value == "string" && (attrs[key] = value.replace(/url\(#(.*)\)/, "url(#$1".concat(runtimeProps.idSuffix, ")")));
210
- })), attrs;
199
+ function nt(e, t, r) {
200
+ var n = l({}, e.attrs);
201
+ r != null && r.colorChannel1 && n.fill === "colorChannel1" && (n.fill = r.colorChannel1);
202
+ var i = t.defIds;
203
+ return !i || i.length === 0 || (e.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + t.idSuffix), Object.entries(n).forEach(function(o) {
204
+ var s = o[0], c = o[1];
205
+ typeof c == "string" && (n[s] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
206
+ })), n;
211
207
  }
212
- __name(replaceRuntimeIdsAndExtInAttrs, "replaceRuntimeIdsAndExtInAttrs");
213
- function replaceRuntimeIdsInDefs(node, runtimeProps) {
214
- var _a4, defIds = runtimeProps.defIds;
215
- 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) {
216
- 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;
217
- }) }) : node;
208
+ function rt(e, t) {
209
+ var r, n = t.defIds;
210
+ return !n || n.length === 0 ? e : e.tag === "defs" && (!((r = e.children) === null || r === void 0) && r.length) ? l(l({}, e), { children: e.children.map(function(i) {
211
+ return typeof i.attrs.id == "string" && n && n.indexOf(i.attrs.id) > -1 ? l(l({}, i), { attrs: l(l({}, i.attrs), { id: i.attrs.id + t.idSuffix }) }) : i;
212
+ }) }) : e;
218
213
  }
219
- __name(replaceRuntimeIdsInDefs, "replaceRuntimeIdsInDefs");
220
- function generateShortUuid() {
214
+ function it() {
221
215
  return Math.random().toString(36).substring(2, 8);
222
216
  }
223
- __name(generateShortUuid, "generateShortUuid");
224
- IconBase.displayName = "UniverIcon";
225
- var element$1 = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, CheckMarkSingle = forwardRef(function(props, ref) {
226
- return createElement(IconBase, Object.assign({}, props, {
217
+ B.displayName = "UniverIcon";
218
+ var ot = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, te = w(function(e, t) {
219
+ return U(B, Object.assign({}, e, {
227
220
  id: "check-mark-single",
228
- ref,
229
- icon: element$1
221
+ ref: t,
222
+ icon: ot
230
223
  }));
231
224
  });
232
- CheckMarkSingle.displayName = "CheckMarkSingle";
233
- var element = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3.71274 2.86421C3.47843 2.6299 3.09853 2.6299 2.86421 2.86421C2.6299 3.09853 2.6299 3.47843 2.86421 3.71274L7.15154 8.00007L2.86421 12.2874C2.6299 12.5217 2.6299 12.9016 2.86421 13.1359C3.09853 13.3702 3.47843 13.3702 3.71274 13.1359L8.00007 8.84859L12.2874 13.1359C12.5217 13.3702 12.9016 13.3702 13.1359 13.1359C13.3702 12.9016 13.3702 12.5217 13.1359 12.2874L8.84859 8.00007L13.1359 3.71274C13.3702 3.47843 13.3702 3.09853 13.1359 2.86421C12.9016 2.6299 12.5217 2.6299 12.2874 2.86421L8.00007 7.15154L3.71274 2.86421Z" } }] }, CloseSingle = forwardRef(function(props, ref) {
234
- return createElement(IconBase, Object.assign({}, props, {
225
+ te.displayName = "CheckMarkSingle";
226
+ var st = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3.71274 2.86421C3.47843 2.6299 3.09853 2.6299 2.86421 2.86421C2.6299 3.09853 2.6299 3.47843 2.86421 3.71274L7.15154 8.00007L2.86421 12.2874C2.6299 12.5217 2.6299 12.9016 2.86421 13.1359C3.09853 13.3702 3.47843 13.3702 3.71274 13.1359L8.00007 8.84859L12.2874 13.1359C12.5217 13.3702 12.9016 13.3702 13.1359 13.1359C13.3702 12.9016 13.3702 12.5217 13.1359 12.2874L8.84859 8.00007L13.1359 3.71274C13.3702 3.47843 13.3702 3.09853 13.1359 2.86421C12.9016 2.6299 12.5217 2.6299 12.2874 2.86421L8.00007 7.15154L3.71274 2.86421Z" } }] }, ne = w(function(e, t) {
227
+ return U(B, Object.assign({}, e, {
235
228
  id: "close-single",
236
- ref,
237
- icon: element
229
+ ref: t,
230
+ icon: st
238
231
  }));
239
232
  });
240
- CloseSingle.displayName = "CloseSingle";
241
- function r(e) {
242
- var t, f2, n2 = "";
243
- if (typeof e == "string" || typeof e == "number") n2 += e;
233
+ ne.displayName = "CloseSingle";
234
+ function re(e) {
235
+ var t, r, n = "";
236
+ if (typeof e == "string" || typeof e == "number") n += e;
244
237
  else if (typeof e == "object") if (Array.isArray(e)) {
245
- var o = e.length;
246
- for (t = 0; t < o; t++) e[t] && (f2 = r(e[t])) && (n2 && (n2 += " "), n2 += f2);
247
- } else for (f2 in e) e[f2] && (n2 && (n2 += " "), n2 += f2);
248
- return n2;
238
+ var i = e.length;
239
+ for (t = 0; t < i; t++) e[t] && (r = re(e[t])) && (n && (n += " "), n += r);
240
+ } else for (r in e) e[r] && (n && (n += " "), n += r);
241
+ return n;
249
242
  }
250
- __name(r, "r");
251
- function clsx() {
252
- for (var e, t, f2 = 0, n2 = "", o = arguments.length; f2 < o; f2++) (e = arguments[f2]) && (t = r(e)) && (n2 && (n2 += " "), n2 += t);
253
- return n2;
243
+ function V() {
244
+ for (var e, t, r = 0, n = "", i = arguments.length; r < i; r++) (e = arguments[r]) && (t = re(e)) && (n && (n += " "), n += t);
245
+ return n;
254
246
  }
255
- __name(clsx, "clsx");
256
- const zenEditor = "univer-zen-editor", zenEditorIconWrapper = "univer-zen-editor-icon-wrapper", zenEditorIconContainer = "univer-zen-editor-icon-container", zenEditorIconSuccess = "univer-zen-editor-icon-success", zenEditorIconError = "univer-zen-editor-icon-error", zenEditorCanvasContainer = "univer-zen-editor-canvas-container", styles = {
257
- zenEditor,
258
- zenEditorIconWrapper,
259
- zenEditorIconContainer,
260
- zenEditorIconSuccess,
261
- zenEditorIconError,
262
- zenEditorCanvasContainer
263
- }, COMPONENT_PREFIX = "ZEN_EDITOR_PLUGIN_", ZEN_EDITOR_COMPONENT = `${COMPONENT_PREFIX}ZEN_EDITOR_COMPONENT`, INITIAL_SNAPSHOT = {
264
- id: DOCS_ZEN_EDITOR_UNIT_ID_KEY,
247
+ const ct = "univer-zen-editor", at = "univer-zen-editor-icon-wrapper", lt = "univer-zen-editor-icon-container", dt = "univer-zen-editor-icon-success", ut = "univer-zen-editor-icon-error", ft = "univer-zen-editor-canvas-container", m = {
248
+ zenEditor: ct,
249
+ zenEditorIconWrapper: at,
250
+ zenEditorIconContainer: lt,
251
+ zenEditorIconSuccess: dt,
252
+ zenEditorIconError: ut,
253
+ zenEditorCanvasContainer: ft
254
+ }, gt = "ZEN_EDITOR_PLUGIN_", ht = `${gt}ZEN_EDITOR_COMPONENT`, mt = {
255
+ id: p,
265
256
  body: {
266
- dataStream: `${DEFAULT_EMPTY_DOCUMENT_VALUE}`,
257
+ dataStream: `${fe}`,
267
258
  textRuns: [],
268
259
  tables: [],
269
260
  customBlocks: [],
@@ -282,7 +273,7 @@ const zenEditor = "univer-zen-editor", zenEditorIconWrapper = "univer-zen-editor
282
273
  width: 595,
283
274
  height: Number.POSITIVE_INFINITY
284
275
  },
285
- documentFlavor: DocumentFlavor.MODERN,
276
+ documentFlavor: H.MODERN,
286
277
  marginTop: 0,
287
278
  marginBottom: 0,
288
279
  marginRight: 0,
@@ -295,162 +286,158 @@ const zenEditor = "univer-zen-editor", zenEditorIconWrapper = "univer-zen-editor
295
286
  drawings: {},
296
287
  drawingsOrder: []
297
288
  };
298
- function ZenEditor() {
299
- const editorRef = useRef(null), zenEditorService = useDependency(IZenEditorManagerService), editorService = useDependency(IEditorService), commandService = useDependency(ICommandService);
300
- useEffect(() => {
301
- const editorDom = editorRef.current;
302
- if (!editorDom)
289
+ function pt() {
290
+ const e = q(null), t = P($), r = P(D), n = P(G);
291
+ Ze(() => {
292
+ const s = e.current;
293
+ if (!s)
303
294
  return;
304
- const registerSubscription = editorService.register(
295
+ const c = r.register(
305
296
  {
306
- editorUnitId: DOCS_ZEN_EDITOR_UNIT_ID_KEY,
307
- initialSnapshot: INITIAL_SNAPSHOT,
297
+ editorUnitId: p,
298
+ initialSnapshot: mt,
308
299
  scrollBar: !0,
309
300
  noNeedVerticalAlign: !0,
310
301
  backScrollOffset: 100
311
302
  },
312
- editorDom
313
- ), resizeObserver = new ResizeObserver(() => {
314
- zenEditorService.setPosition(editorDom.getBoundingClientRect());
303
+ s
304
+ ), a = new ResizeObserver(() => {
305
+ t.setPosition(s.getBoundingClientRect());
315
306
  });
316
- return resizeObserver.observe(editorDom), () => {
317
- registerSubscription.dispose(), resizeObserver.unobserve(editorDom);
307
+ return a.observe(s), () => {
308
+ c.dispose(), a.unobserve(s);
318
309
  };
319
310
  }, []);
320
- function handleCloseBtnClick() {
321
- commandService.executeCommand(CancelZenEditCommand.id);
311
+ function i() {
312
+ n.executeCommand(L.id);
322
313
  }
323
- __name(handleCloseBtnClick, "handleCloseBtnClick");
324
- function handleConfirmBtnClick() {
325
- commandService.executeCommand(ConfirmZenEditCommand.id);
314
+ function o() {
315
+ n.executeCommand(A.id);
326
316
  }
327
- return __name(handleConfirmBtnClick, "handleConfirmBtnClick"), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles.zenEditor, children: [
328
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles.zenEditorIconWrapper, children: [
329
- /* @__PURE__ */ jsxRuntimeExports.jsx(
317
+ return /* @__PURE__ */ h.jsxs("div", { className: m.zenEditor, children: [
318
+ /* @__PURE__ */ h.jsxs("div", { className: m.zenEditorIconWrapper, children: [
319
+ /* @__PURE__ */ h.jsx(
330
320
  "span",
331
321
  {
332
- className: clsx(styles.zenEditorIconContainer, styles.zenEditorIconError),
333
- onClick: handleCloseBtnClick,
334
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(CloseSingle, { style: { fontSize: "22px" } })
322
+ className: V(m.zenEditorIconContainer, m.zenEditorIconError),
323
+ onClick: i,
324
+ children: /* @__PURE__ */ h.jsx(ne, { style: { fontSize: "22px" } })
335
325
  }
336
326
  ),
337
- /* @__PURE__ */ jsxRuntimeExports.jsx(
327
+ /* @__PURE__ */ h.jsx(
338
328
  "span",
339
329
  {
340
- className: clsx(styles.zenEditorIconContainer, styles.zenEditorIconSuccess),
341
- onClick: handleConfirmBtnClick,
342
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(CheckMarkSingle, { style: { fontSize: "22px" } })
330
+ className: V(m.zenEditorIconContainer, m.zenEditorIconSuccess),
331
+ onClick: o,
332
+ children: /* @__PURE__ */ h.jsx(te, { style: { fontSize: "22px" } })
343
333
  }
344
334
  )
345
335
  ] }),
346
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles.zenEditorCanvasContainer, ref: editorRef })
336
+ /* @__PURE__ */ h.jsx("div", { className: m.zenEditorCanvasContainer, ref: e })
347
337
  ] });
348
338
  }
349
- __name(ZenEditor, "ZenEditor");
350
- function ZenEditorMenuItemFactory(accessor) {
339
+ function _t(e) {
351
340
  return {
352
- id: OpenZenEditorCommand.id,
353
- type: MenuItemType.BUTTON,
341
+ id: Z.id,
342
+ type: ze.BUTTON,
354
343
  title: "rightClick.zenEditor",
355
344
  icon: "AmplifySingle",
356
- hidden$: getCurrentExclusiveRangeInterest$(accessor),
357
- disabled$: getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission, WorksheetSetCellValuePermission, WorksheetSetCellStylePermission], rangeTypes: [RangeProtectionPermissionEditPoint] })
345
+ hidden$: Te(e),
346
+ disabled$: be(e, { workbookTypes: [Le], worksheetTypes: [Ae, $e, Be], rangeTypes: [ke] })
358
347
  };
359
348
  }
360
- __name(ZenEditorMenuItemFactory, "ZenEditorMenuItemFactory");
361
- const menuSchema = {
362
- [ContextMenuPosition.MAIN_AREA]: {
363
- [ContextMenuGroup.OTHERS]: {
364
- [OpenZenEditorCommand.id]: {
349
+ const vt = {
350
+ [Pe.MAIN_AREA]: {
351
+ [xe.OTHERS]: {
352
+ [Z.id]: {
365
353
  order: 2,
366
- menuItemFactory: ZenEditorMenuItemFactory
354
+ menuItemFactory: _t
367
355
  }
368
356
  }
369
357
  }
370
- }, ZenEditorConfirmShortcut = {
371
- id: ConfirmZenEditCommand.id,
358
+ }, Et = {
359
+ id: A.id,
372
360
  description: "shortcut.sheet.zen-edit-confirm",
373
361
  group: "4_sheet-edit",
374
- preconditions: /* @__PURE__ */ __name((contextService) => whenZenEditorActivated(contextService), "preconditions"),
375
- binding: KeyCode.ENTER | MetaKeys.ALT
376
- }, ZenEditorCancelShortcut = {
377
- id: CancelZenEditCommand.id,
362
+ preconditions: (e) => ie(e),
363
+ binding: X.ENTER | Re.ALT
364
+ }, It = {
365
+ id: L.id,
378
366
  description: "shortcut.sheet.zen-edit-cancel",
379
367
  group: "4_sheet-edit",
380
- preconditions: /* @__PURE__ */ __name((contextService) => whenZenEditorActivated(contextService), "preconditions"),
381
- binding: KeyCode.ESC
368
+ preconditions: (e) => ie(e),
369
+ binding: X.ESC
382
370
  };
383
- function whenZenEditorActivated(contextService) {
384
- return contextService.getContextValue(FOCUSING_DOC) && contextService.getContextValue(FOCUSING_UNIVER_EDITOR) && contextService.getContextValue(EDITOR_ACTIVATED) && !contextService.getContextValue(FOCUSING_EDITOR_STANDALONE);
371
+ function ie(e) {
372
+ return e.getContextValue(ge) && e.getContextValue(he) && e.getContextValue(me) && !e.getContextValue(pe);
385
373
  }
386
- __name(whenZenEditorActivated, "whenZenEditorActivated");
387
- var __defProp$1 = Object.defineProperty, __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor, __decorateClass$1 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
388
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
389
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
390
- return kind && result && __defProp$1(target, key, result), result;
391
- }, "__decorateClass$1"), __decorateParam$1 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$1"), _a2;
392
- let ZenEditorUIController = (_a2 = class extends Disposable {
393
- constructor(_zenZoneService, _commandService, _menuManagerService, _shortcutService) {
394
- super(), this._zenZoneService = _zenZoneService, this._commandService = _commandService, this._menuManagerService = _menuManagerService, this._shortcutService = _shortcutService, this._initialize();
374
+ var St = Object.defineProperty, Ct = Object.getOwnPropertyDescriptor, Ot = (e, t, r, n) => {
375
+ for (var i = n > 1 ? void 0 : n ? Ct(t, r) : t, o = e.length - 1, s; o >= 0; o--)
376
+ (s = e[o]) && (i = (n ? s(t, r, i) : s(i)) || i);
377
+ return n && i && St(t, r, i), i;
378
+ }, C = (e, t) => (r, n) => t(r, n, e);
379
+ let N = class extends _e {
380
+ constructor(e, t, r, n) {
381
+ super(), this._zenZoneService = e, this._commandService = t, this._menuManagerService = r, this._shortcutService = n, this._initialize();
395
382
  }
396
383
  _initialize() {
397
384
  this._initCustomComponents(), this._initCommands(), this._initMenus(), this._initShortcuts();
398
385
  }
399
386
  _initCustomComponents() {
400
- this.disposeWithMe(this._zenZoneService.set(ZEN_EDITOR_COMPONENT, ZenEditor));
387
+ this.disposeWithMe(this._zenZoneService.set(ht, pt));
401
388
  }
402
389
  _initCommands() {
403
- [OpenZenEditorCommand, CancelZenEditCommand, ConfirmZenEditCommand].forEach((c) => {
404
- this.disposeWithMe(this._commandService.registerCommand(c));
390
+ [Z, L, A].forEach((e) => {
391
+ this.disposeWithMe(this._commandService.registerCommand(e));
405
392
  });
406
393
  }
407
394
  _initMenus() {
408
- this._menuManagerService.mergeMenu(menuSchema);
395
+ this._menuManagerService.mergeMenu(vt);
409
396
  }
410
397
  _initShortcuts() {
411
- [ZenEditorConfirmShortcut, ZenEditorCancelShortcut].forEach((item) => {
412
- this.disposeWithMe(this._shortcutService.registerShortcut(item));
398
+ [Et, It].forEach((e) => {
399
+ this.disposeWithMe(this._shortcutService.registerShortcut(e));
413
400
  });
414
401
  }
415
- }, __name(_a2, "ZenEditorUIController"), _a2);
416
- ZenEditorUIController = __decorateClass$1([
417
- __decorateParam$1(0, IZenZoneService),
418
- __decorateParam$1(1, ICommandService),
419
- __decorateParam$1(2, IMenuManagerService),
420
- __decorateParam$1(3, IShortcutService)
421
- ], ZenEditorUIController);
422
- var __defProp2 = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __decorateClass = /* @__PURE__ */ __name((decorators, target, key, kind) => {
423
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
424
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
425
- return kind && result && __defProp2(target, key, result), result;
426
- }, "__decorateClass"), __decorateParam = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam"), _a3;
427
- let UniverSheetsZenEditorPlugin = (_a3 = class extends Plugin {
428
- constructor(_config = defaultPluginConfig, _injector, _configService) {
429
- super(), this._config = _config, this._injector = _injector, this._configService = _configService;
430
- const { menu, ...rest } = this._config;
431
- menu && this._configService.setConfig("menu", menu, { merge: !0 }), this._configService.setConfig(PLUGIN_CONFIG_KEY, rest), this._initializeDependencies(this._injector);
402
+ };
403
+ N = Ot([
404
+ C(0, T),
405
+ C(1, G),
406
+ C(2, Me),
407
+ C(3, De)
408
+ ], N);
409
+ var yt = Object.defineProperty, Nt = Object.getOwnPropertyDescriptor, Tt = (e, t, r, n) => {
410
+ for (var i = n > 1 ? void 0 : n ? Nt(t, r) : t, o = e.length - 1, s; o >= 0; o--)
411
+ (s = e[o]) && (i = (n ? s(t, r, i) : s(i)) || i);
412
+ return n && i && yt(t, r, i), i;
413
+ }, F = (e, t) => (r, n) => t(r, n, e), O;
414
+ let W = (O = class extends ve {
415
+ constructor(e = Fe, t, r) {
416
+ super(), this._config = e, this._injector = t, this._configService = r;
417
+ const { menu: n, ...i } = this._config;
418
+ n && this._configService.setConfig("menu", n, { merge: !0 }), this._configService.setConfig(Ve, i), this._initializeDependencies(this._injector);
432
419
  }
433
- _initializeDependencies(injector) {
420
+ _initializeDependencies(e) {
434
421
  [
435
- [ZenEditorUIController],
436
- [ZenEditorController],
437
- [IZenEditorManagerService, { useClass: ZenEditorManagerService }]
438
- ].forEach((dependency) => injector.add(dependency));
422
+ [N],
423
+ [y],
424
+ [$, { useClass: We }]
425
+ ].forEach((r) => e.add(r));
439
426
  }
440
427
  onReady() {
441
- this._injector.get(ZenEditorUIController);
428
+ this._injector.get(N);
442
429
  }
443
430
  onSteady() {
444
- this._injector.get(ZenEditorController);
431
+ this._injector.get(y);
445
432
  }
446
- }, __name(_a3, "UniverSheetsZenEditorPlugin"), __publicField(_a3, "pluginName", "SHEET_ZEN_EDITOR_PLUGIN"), __publicField(_a3, "type", UniverInstanceType.UNIVER_SHEET), _a3);
447
- UniverSheetsZenEditorPlugin = __decorateClass([
448
- __decorateParam(1, Inject(Injector)),
449
- __decorateParam(2, IConfigService)
450
- ], UniverSheetsZenEditorPlugin);
433
+ }, v(O, "pluginName", "SHEET_ZEN_EDITOR_PLUGIN"), v(O, "type", M.UNIVER_SHEET), O);
434
+ W = Tt([
435
+ F(1, Ee(Ie)),
436
+ F(2, Se)
437
+ ], W);
451
438
  export {
452
- CancelZenEditCommand,
453
- ConfirmZenEditCommand,
454
- OpenZenEditorCommand,
455
- UniverSheetsZenEditorPlugin
439
+ L as CancelZenEditCommand,
440
+ A as ConfirmZenEditCommand,
441
+ Z as OpenZenEditorCommand,
442
+ W as UniverSheetsZenEditorPlugin
456
443
  };