@univerjs/docs-quick-insert-ui 0.8.0-beta.0 → 0.8.0-nightly.202505271607

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,25 +1,25 @@
1
- var je = Object.defineProperty;
2
- var Le = (t, e, i) => e in t ? je(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i;
3
- var _ = (t, e, i) => Le(t, typeof e != "symbol" ? e + "" : e, i);
4
- import { CommandType as D, ICommandService as H, RANGE_DIRECTION as Ae, LocaleService as pe, generateRandomId as Be, DisposableCollection as We, toDisposable as Ve, Direction as W, Inject as f, IUniverInstanceService as le, Disposable as X, UniverInstanceType as K, DeleteDirection as qe, DependentOn as ze, Injector as Fe, Plugin as Ge } from "@univerjs/core";
5
- import { UniverDocsDrawingPlugin as Ze } from "@univerjs/docs-drawing";
1
+ var Le = Object.defineProperty;
2
+ var je = (t, e, r) => e in t ? Le(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var C = (t, e, r) => je(t, typeof e != "symbol" ? e + "" : e, r);
4
+ import { CommandType as D, ICommandService as H, RANGE_DIRECTION as Ae, LocaleService as pe, generateRandomId as Be, DisposableCollection as We, toDisposable as qe, Direction as W, Inject as f, IUniverInstanceService as le, Disposable as X, UniverInstanceType as K, DeleteDirection as Ze, DependentOn as Ve, Injector as Fe, Plugin as Ge } from "@univerjs/core";
5
+ import { UniverDocsDrawingPlugin as ze } from "@univerjs/docs-drawing";
6
6
  import { InsertDocImageCommand as Je, UniverDocsDrawingUIPlugin as Xe } from "@univerjs/docs-drawing-ui";
7
7
  import { UniverDrawingPlugin as Ye } from "@univerjs/drawing";
8
8
  import { UniverDrawingUIPlugin as et } from "@univerjs/drawing-ui";
9
9
  import { IRenderManagerService as he } from "@univerjs/engine-render";
10
- import { useDependency as I, KeyCode as M, ComponentManager as Se, IShortcutService as ye, useObservable as U, ILayoutService as tt, useEvent as nt, UniverUIPlugin as it } from "@univerjs/ui";
11
- import { CutContentCommand as rt, DocCanvasPopManagerService as Pe, DocEventManagerService as Oe, OrderListCommand as st, BulletListCommand as ot, HorizontalLineCommand as ct, DocCreateTableOperation as at, InsertCommand as dt, IMEInputCommand as ut, DeleteCommand as pt, MoveCursorOperation as lt, DeleteLeftCommand as ht } from "@univerjs/docs-ui";
12
- import { map as xe, distinctUntilChanged as ft, tap as j, combineLatest as fe, BehaviorSubject as A, of as vt } from "rxjs";
10
+ import { useDependency as I, KeyCode as M, ComponentManager as ye, IShortcutService as Se, useObservable as U, ILayoutService as tt, useEvent as nt, UniverUIPlugin as rt } from "@univerjs/ui";
11
+ import { CutContentCommand as it, DocCanvasPopManagerService as Pe, DocEventManagerService as xe, OrderListCommand as ot, BulletListCommand as st, HorizontalLineCommand as ct, DocCreateTableOperation as at, InsertCommand as dt, IMEInputCommand as ut, DeleteCommand as pt, MoveCursorOperation as lt, DeleteLeftCommand as ht } from "@univerjs/docs-ui";
12
+ import { map as Oe, distinctUntilChanged as ft, tap as L, combineLatest as fe, BehaviorSubject as A, of as vt } from "rxjs";
13
13
  import { DocSelectionManagerService as ve, DocSkeletonManagerService as mt, RichTextEditingMutation as gt } from "@univerjs/docs";
14
14
  import { jsx as h, jsxs as ge } from "react/jsx-runtime";
15
- import { clsx as se, Menu as _t, MenuItemGroup as Ct, MenuItem as It, Tooltip as St, borderClassName as yt } from "@univerjs/design";
16
- import { useMemo as oe, useState as _e, useRef as B, useEffect as L, forwardRef as Y, createElement as ee } from "react";
15
+ import { clsx as oe, Menu as Ct, MenuItemGroup as _t, MenuItem as It, Tooltip as yt, borderClassName as St } from "@univerjs/design";
16
+ import { useMemo as se, useState as Ce, useRef as B, useEffect as j, forwardRef as Y, createElement as ee } from "react";
17
17
  const be = {
18
18
  id: "doc.command.delete-search-key",
19
19
  type: D.COMMAND,
20
20
  handler: (t, e) => {
21
- const i = t.get(H), { start: n, end: r } = e;
22
- return i.syncExecuteCommand(rt.id, {
21
+ const r = t.get(H), { start: n, end: i } = e;
22
+ return r.syncExecuteCommand(it.id, {
23
23
  segmentId: "",
24
24
  textRanges: [{
25
25
  startOffset: n,
@@ -28,31 +28,31 @@ const be = {
28
28
  }],
29
29
  selections: [{
30
30
  startOffset: n,
31
- endOffset: r,
31
+ endOffset: i,
32
32
  collapsed: !1,
33
33
  direction: Ae.FORWARD
34
34
  }]
35
35
  });
36
36
  }
37
- }, Pt = "docs.quick.insert.keyword-input-placeholder", V = () => {
37
+ }, Pt = "docs.quick.insert.keyword-input-placeholder", q = () => {
38
38
  const t = I(pe);
39
39
  return /* @__PURE__ */ h("div", { className: "univer-translate-y-1.5 univer-text-sm univer-text-gray-500", children: t.t("docQuickInsert.keywordInputPlaceholder") });
40
40
  };
41
- V.componentKey = Pt;
41
+ q.componentKey = Pt;
42
42
  const Me = {
43
43
  type: D.OPERATION,
44
44
  id: "doc.operation.show-quick-insert-popup",
45
45
  handler(t, e) {
46
- const i = t.get(S);
47
- return e ? (i.showPopup(e), !0) : !1;
46
+ const r = t.get(y);
47
+ return e ? (r.showPopup(e), !0) : !1;
48
48
  }
49
49
  }, Q = {
50
50
  type: D.OPERATION,
51
51
  id: "doc.operation.close-quick-insert-popup",
52
52
  handler(t) {
53
- return t.get(S).closePopup(), !0;
53
+ return t.get(y).closePopup(), !0;
54
54
  }
55
- }, Ot = "docs.quick.insert.placeholder", q = () => {
55
+ }, xt = "docs.quick.insert.placeholder", Z = () => {
56
56
  const t = I(pe);
57
57
  return /* @__PURE__ */ h(
58
58
  "div",
@@ -62,53 +62,53 @@ const Me = {
62
62
  }
63
63
  );
64
64
  };
65
- q.componentKey = Ot;
65
+ Z.componentKey = xt;
66
66
  function ce(t, e) {
67
- return t.map((i) => ({ ...i })).filter((i) => {
68
- if ("children" in i)
69
- return i.children = ce(i.children, e), i.children.length > 0;
70
- const n = i.keywords;
71
- return n ? n.some((r) => r.includes(e)) : i.title.toLowerCase().includes(e);
67
+ return t.map((r) => ({ ...r })).filter((r) => {
68
+ if ("children" in r)
69
+ return r.children = ce(r.children, e), r.children.length > 0;
70
+ const n = r.keywords;
71
+ return n ? n.some((i) => i.includes(e)) : r.title.toLowerCase().includes(e);
72
72
  });
73
73
  }
74
74
  function we(t, e) {
75
- return t.map((i) => {
76
- const n = { ...i };
77
- return "children" in n && (n.children = we(n.children, e)), n.title = e.t(n.title), "keywords" in n && (n.keywords = n.keywords.concat(n.title).map((r) => r.toLowerCase())), n;
75
+ return t.map((r) => {
76
+ const n = { ...r };
77
+ return "children" in n && (n.children = we(n.children, e)), n.title = e.t(n.title), "keywords" in n && (n.keywords = n.keywords.concat(n.title).map((i) => i.toLowerCase())), n;
78
78
  });
79
79
  }
80
- const xt = [M.ARROW_UP, M.ARROW_DOWN, M.ENTER], z = () => {
81
- const t = I(pe), e = I(S), i = I(Se), n = I(ye), r = I(H), s = oe(() => Be(), []), [c, u] = _e(0), o = B(null), a = B(0);
80
+ const Ot = [M.ARROW_UP, M.ARROW_DOWN, M.ENTER], V = () => {
81
+ const t = I(pe), e = I(y), r = I(ye), n = I(Se), i = I(H), o = se(() => Be(), []), [c, u] = Ce(0), s = B(null), a = B(0);
82
82
  a.current = 0;
83
- const d = U(e.filterKeyword$, ""), p = U(e.editPopup$), v = U(p == null ? void 0 : p.popup.menus$, []), y = oe(() => we(v, t), [v]), [w, P] = _e(() => ce(y, d.toLowerCase()));
84
- L(() => {
83
+ const d = U(e.filterKeyword$, ""), p = U(e.editPopup$), v = U(p == null ? void 0 : p.popup.menus$, []), S = se(() => we(v, t), [v]), [w, P] = Ce(() => ce(S, d.toLowerCase()));
84
+ j(() => {
85
85
  const m = requestIdleCallback(() => {
86
- P(ce(y, d.toLowerCase()));
86
+ P(ce(S, d.toLowerCase()));
87
87
  });
88
88
  return () => {
89
89
  cancelIdleCallback(m);
90
90
  };
91
- }, [y, d]);
92
- const O = (m) => {
93
- e.emitMenuSelected(m), r.executeCommand(Q.id);
91
+ }, [S, d]);
92
+ const x = (m) => {
93
+ e.emitMenuSelected(m), i.executeCommand(Q.id);
94
94
  };
95
- L(() => {
95
+ j(() => {
96
96
  const m = new We();
97
- n.getAllShortcuts().filter((l) => l.binding && xt.includes(l.binding)).forEach((l) => {
97
+ n.getAllShortcuts().filter((l) => l.binding && Ot.includes(l.binding)).forEach((l) => {
98
98
  const b = l.preconditions;
99
- l.preconditions = () => !1, m.add(Ve(() => {
99
+ l.preconditions = () => !1, m.add(qe(() => {
100
100
  l.preconditions = b;
101
101
  }));
102
102
  });
103
- const x = {
104
- id: `quick.insert.popup.enter.${s}`,
103
+ const O = {
104
+ id: `quick.insert.popup.enter.${o}`,
105
105
  type: D.OPERATION,
106
106
  handler: () => {
107
- const l = o.current;
108
- l && O(l);
107
+ const l = s.current;
108
+ l && x(l);
109
109
  }
110
110
  }, E = {
111
- id: `quick.insert.popup.move.cursor.up.${s}`,
111
+ id: `quick.insert.popup.move.cursor.up.${o}`,
112
112
  type: D.OPERATION,
113
113
  handler: () => {
114
114
  u((l) => {
@@ -117,7 +117,7 @@ const xt = [M.ARROW_UP, M.ARROW_DOWN, M.ENTER], z = () => {
117
117
  });
118
118
  }
119
119
  }, R = {
120
- id: `quick.insert.popup.move.cursor.down.${s}`,
120
+ id: `quick.insert.popup.move.cursor.down.${o}`,
121
121
  type: D.OPERATION,
122
122
  handler: () => {
123
123
  u((l) => {
@@ -126,7 +126,7 @@ const xt = [M.ARROW_UP, M.ARROW_DOWN, M.ENTER], z = () => {
126
126
  });
127
127
  }
128
128
  };
129
- return m.add(r.registerCommand(E)), m.add(r.registerCommand(R)), m.add(r.registerCommand(x)), m.add(n.registerShortcut({
129
+ return m.add(i.registerCommand(E)), m.add(i.registerCommand(R)), m.add(i.registerCommand(O)), m.add(n.registerShortcut({
130
130
  priority: 1e3,
131
131
  id: E.id,
132
132
  binding: M.ARROW_UP,
@@ -144,32 +144,32 @@ const xt = [M.ARROW_UP, M.ARROW_DOWN, M.ENTER], z = () => {
144
144
  }
145
145
  })), m.add(n.registerShortcut({
146
146
  priority: 1e3,
147
- id: x.id,
147
+ id: O.id,
148
148
  binding: M.ENTER,
149
149
  preconditions: () => !0
150
150
  })), () => {
151
151
  m.dispose();
152
152
  };
153
- }, []), L(() => {
153
+ }, []), j(() => {
154
154
  u(0);
155
155
  }, [w]);
156
156
  const k = B(/* @__PURE__ */ new Map());
157
- L(() => () => {
157
+ j(() => () => {
158
158
  k.current.clear();
159
159
  }, []);
160
160
  function $(m) {
161
161
  return m.map((g) => {
162
- const ne = g.icon, x = ne ? i.get(ne) : null;
162
+ const ne = g.icon, O = ne ? r.get(ne) : null;
163
163
  if ("children" in g)
164
164
  return /* @__PURE__ */ h(
165
- Ct,
165
+ _t,
166
166
  {
167
167
  title: /* @__PURE__ */ ge(
168
168
  "div",
169
169
  {
170
170
  className: "univer-mb-2 univer-flex univer-items-center univer-text-xs univer-text-gray-400",
171
171
  children: [
172
- x && /* @__PURE__ */ h("span", { className: "univer-mr-2 univer-inline-flex univer-text-base", children: /* @__PURE__ */ h(x, {}) }),
172
+ O && /* @__PURE__ */ h("span", { className: "univer-mr-2 univer-inline-flex univer-text-base", children: /* @__PURE__ */ h(O, {}) }),
173
173
  /* @__PURE__ */ h("span", { children: g.title })
174
174
  ]
175
175
  }
@@ -180,7 +180,7 @@ const xt = [M.ARROW_UP, M.ARROW_DOWN, M.ENTER], z = () => {
180
180
  );
181
181
  const E = a.current, R = c === E;
182
182
  if (R) {
183
- o.current = g;
183
+ s.current = g;
184
184
  const l = k.current.get(g.id);
185
185
  l == null || l.scrollIntoView({
186
186
  block: "nearest"
@@ -194,20 +194,20 @@ const xt = [M.ARROW_UP, M.ARROW_DOWN, M.ENTER], z = () => {
194
194
  },
195
195
  onMouseEnter: () => u(E),
196
196
  onMouseLeave: () => u(Number.NaN),
197
- className: se("univer-w-[calc(220px-var(--padding-base)*2)] univer-text-sm", {
197
+ className: oe("univer-w-[calc(220px-var(--padding-base)*2)] univer-text-sm", {
198
198
  "hover:univer-bg-transparent": !R,
199
199
  "univer-bg-gray-100 dark:!univer-bg-gray-500": R
200
200
  }),
201
201
  onClick: () => {
202
- O(g);
202
+ x(g);
203
203
  },
204
204
  children: /* @__PURE__ */ ge(
205
205
  "div",
206
206
  {
207
207
  className: "univer-flex univer-w-full univer-items-center univer-px-1",
208
208
  children: [
209
- x && /* @__PURE__ */ h("span", { className: "univer-mr-2 univer-inline-flex univer-text-base", children: /* @__PURE__ */ h(x, {}) }),
210
- /* @__PURE__ */ h(St, { showIfEllipsis: !0, title: g.title, placement: "right", children: /* @__PURE__ */ h("span", { className: "univer-truncate", children: g.title }) })
209
+ O && /* @__PURE__ */ h("span", { className: "univer-mr-2 univer-inline-flex univer-text-base", children: /* @__PURE__ */ h(O, {}) }),
210
+ /* @__PURE__ */ h(yt, { showIfEllipsis: !0, title: g.title, placement: "right", children: /* @__PURE__ */ h("span", { className: "univer-truncate", children: g.title }) })
211
211
  ]
212
212
  }
213
213
  )
@@ -216,60 +216,60 @@ const xt = [M.ARROW_UP, M.ARROW_DOWN, M.ENTER], z = () => {
216
216
  );
217
217
  });
218
218
  }
219
- const Ke = w.length > 0, me = (p == null ? void 0 : p.popup.Placeholder) || i.get(q.componentKey);
220
- return /* @__PURE__ */ h("div", { className: se("univer-mt-2"), children: Ke ? /* @__PURE__ */ h(_t, { wrapperClass: "univer-max-h-[360px] univer-w-[220px] univer-overflow-y-auto univer-overflow-x-hidden", children: $(w) }) : me && /* @__PURE__ */ h(me, {}) });
219
+ const Ke = w.length > 0, me = (p == null ? void 0 : p.popup.Placeholder) || r.get(Z.componentKey);
220
+ return /* @__PURE__ */ h("div", { className: oe("univer-mt-2"), children: Ke ? /* @__PURE__ */ h(Ct, { wrapperClass: "univer-max-h-[360px] univer-w-[220px] univer-overflow-y-auto univer-overflow-x-hidden", children: $(w) }) : me && /* @__PURE__ */ h(me, {}) });
221
221
  };
222
- z.componentKey = "docs.quick.insert.popup";
223
- var bt = Object.getOwnPropertyDescriptor, Mt = (t, e, i, n) => {
224
- for (var r = n > 1 ? void 0 : n ? bt(e, i) : e, s = t.length - 1, c; s >= 0; s--)
225
- (c = t[s]) && (r = c(r) || r);
226
- return r;
227
- }, N = (t, e) => (i, n) => e(i, n, t);
228
- const Ce = {
222
+ V.componentKey = "docs.quick.insert.popup";
223
+ var bt = Object.getOwnPropertyDescriptor, Mt = (t, e, r, n) => {
224
+ for (var i = n > 1 ? void 0 : n ? bt(e, r) : e, o = t.length - 1, c; o >= 0; o--)
225
+ (c = t[o]) && (i = c(i) || i);
226
+ return i;
227
+ }, N = (t, e) => (r, n) => e(r, n, t);
228
+ const _e = {
229
229
  dispose: () => {
230
230
  }
231
231
  };
232
- let S = class extends X {
233
- constructor(e, i, n, r, s) {
232
+ let y = class extends X {
233
+ constructor(e, r, n, i, o) {
234
234
  super();
235
- _(this, "_popups", /* @__PURE__ */ new Set());
236
- _(this, "_editPopup$", new A(void 0));
237
- _(this, "editPopup$", this._editPopup$.asObservable());
238
- _(this, "_isComposing$", new A(!1));
239
- _(this, "isComposing$", this._isComposing$.asObservable());
240
- _(this, "_inputOffset$", new A({ start: 0, end: 0 }));
241
- _(this, "inputOffset$", this._inputOffset$.asObservable());
242
- _(this, "filterKeyword$");
243
- _(this, "_menuSelectedCallbacks", /* @__PURE__ */ new Set());
244
- _(this, "_inputPlaceholderRenderRoot", null);
245
- this._docCanvasPopupManagerService = e, this._univerInstanceService = i, this._commandService = n, this._renderManagerService = r, this._docSelectionManagerService = s, this.disposeWithMe(this._editPopup$);
246
- const c = (o, a) => {
235
+ C(this, "_popups", /* @__PURE__ */ new Set());
236
+ C(this, "_editPopup$", new A(void 0));
237
+ C(this, "editPopup$", this._editPopup$.asObservable());
238
+ C(this, "_isComposing$", new A(!1));
239
+ C(this, "isComposing$", this._isComposing$.asObservable());
240
+ C(this, "_inputOffset$", new A({ start: 0, end: 0 }));
241
+ C(this, "inputOffset$", this._inputOffset$.asObservable());
242
+ C(this, "filterKeyword$");
243
+ C(this, "_menuSelectedCallbacks", /* @__PURE__ */ new Set());
244
+ C(this, "_inputPlaceholderRenderRoot", null);
245
+ this._docCanvasPopupManagerService = e, this._univerInstanceService = r, this._commandService = n, this._renderManagerService = i, this._docSelectionManagerService = o, this.disposeWithMe(this._editPopup$);
246
+ const c = (s, a) => {
247
247
  var d, p;
248
- return (p = (d = this._univerInstanceService.getCurrentUnitOfType(K.UNIVER_DOC)) == null ? void 0 : d.getBody()) == null ? void 0 : p.dataStream.slice(o, a);
248
+ return (p = (d = this._univerInstanceService.getCurrentUnitOfType(K.UNIVER_DOC)) == null ? void 0 : d.getBody()) == null ? void 0 : p.dataStream.slice(s, a);
249
249
  };
250
250
  let u = "";
251
251
  this.filterKeyword$ = this._inputOffset$.pipe(
252
- xe((o) => {
252
+ Oe((s) => {
253
253
  var d;
254
- const a = c(o.start, o.end);
254
+ const a = c(s.start, s.end);
255
255
  return (d = a == null ? void 0 : a.slice(1)) != null ? d : "";
256
256
  }),
257
257
  ft(),
258
- j((o) => {
259
- u = o;
258
+ L((s) => {
259
+ u = s;
260
260
  })
261
261
  ), this.disposeWithMe(fe([
262
- this.filterKeyword$.pipe(j((o) => {
262
+ this.filterKeyword$.pipe(L((s) => {
263
263
  var a, d, p;
264
- o.length > 0 ? (d = (a = this._inputPlaceholderRenderRoot) == null ? void 0 : a.unmount) == null || d.dispose() : (p = this._inputPlaceholderRenderRoot) == null || p.mount();
264
+ s.length > 0 ? (d = (a = this._inputPlaceholderRenderRoot) == null ? void 0 : a.unmount) == null || d.dispose() : (p = this._inputPlaceholderRenderRoot) == null || p.mount();
265
265
  })),
266
- this.isComposing$.pipe(j((o) => {
266
+ this.isComposing$.pipe(L((s) => {
267
267
  var a, d, p;
268
- o ? (d = (a = this._inputPlaceholderRenderRoot) == null ? void 0 : a.unmount) == null || d.dispose() : u.length <= 0 && ((p = this._inputPlaceholderRenderRoot) == null || p.mount());
268
+ s ? (d = (a = this._inputPlaceholderRenderRoot) == null ? void 0 : a.unmount) == null || d.dispose() : u.length <= 0 && ((p = this._inputPlaceholderRenderRoot) == null || p.mount());
269
269
  })),
270
- this.editPopup$.pipe(j((o) => {
270
+ this.editPopup$.pipe(L((s) => {
271
271
  var a, d;
272
- o || ((d = (a = this._inputPlaceholderRenderRoot) == null ? void 0 : a.unmount) == null || d.dispose(), this._inputPlaceholderRenderRoot = null);
272
+ s || ((d = (a = this._inputPlaceholderRenderRoot) == null ? void 0 : a.unmount) == null || d.dispose(), this._inputPlaceholderRenderRoot = null);
273
273
  }))
274
274
  ]).subscribe());
275
275
  }
@@ -292,11 +292,11 @@ let S = class extends X {
292
292
  this._inputOffset$.next(e);
293
293
  }
294
294
  getDocEventManagerService(e) {
295
- var i;
296
- return (i = this._renderManagerService.getRenderById(e)) == null ? void 0 : i.with(Oe);
295
+ var r;
296
+ return (r = this._renderManagerService.getRenderById(e)) == null ? void 0 : r.with(xe);
297
297
  }
298
298
  resolvePopup(e) {
299
- return Array.from(this._popups).find((i) => i.keyword === e);
299
+ return Array.from(this._popups).find((r) => r.keyword === e);
300
300
  }
301
301
  registerPopup(e) {
302
302
  return this._popups.add(e), () => {
@@ -321,47 +321,47 @@ let S = class extends X {
321
321
  }
322
322
  showPopup(e) {
323
323
  var d, p;
324
- const { popup: i, index: n, unitId: r } = e;
324
+ const { popup: r, index: n, unitId: i } = e;
325
325
  this.closePopup();
326
- const s = this._univerInstanceService.getUnit(r), c = (p = (d = s == null ? void 0 : s.getBody()) == null ? void 0 : d.paragraphs) == null ? void 0 : p.find((v) => v.startIndex > n);
326
+ const o = this._univerInstanceService.getUnit(i), c = (p = (d = o == null ? void 0 : o.getBody()) == null ? void 0 : d.paragraphs) == null ? void 0 : p.find((v) => v.startIndex > n);
327
327
  if (!c)
328
328
  return;
329
- const u = this.getDocEventManagerService(r), o = u == null ? void 0 : u.findParagraphBoundByIndex(c.startIndex);
330
- if (!o)
329
+ const u = this.getDocEventManagerService(i), s = u == null ? void 0 : u.findParagraphBoundByIndex(c.startIndex);
330
+ if (!s)
331
331
  return;
332
332
  this._inputPlaceholderRenderRoot = this._createInputPlaceholderRenderRoot(() => {
333
333
  var $;
334
- const v = ($ = this._renderManagerService.getRenderById(r)) == null ? void 0 : $.with(mt), y = this._docSelectionManagerService.getActiveTextRange();
335
- if (!v || !y)
336
- return Ce;
337
- const P = v.getSkeleton().findNodeByCharIndex(y.startOffset, y.segmentId, y.segmentPage);
334
+ const v = ($ = this._renderManagerService.getRenderById(i)) == null ? void 0 : $.with(mt), S = this._docSelectionManagerService.getActiveTextRange();
335
+ if (!v || !S)
336
+ return _e;
337
+ const P = v.getSkeleton().findNodeByCharIndex(S.startOffset, S.segmentId, S.segmentPage);
338
338
  if (!((P == null ? void 0 : P.content) === "\r"))
339
- return Ce;
339
+ return _e;
340
340
  const k = this._docCanvasPopupManagerService.attachPopupToRange(
341
341
  { startOffset: n + 1, endOffset: n + 1, collapsed: !1 },
342
342
  {
343
- componentKey: V.componentKey,
343
+ componentKey: q.componentKey,
344
344
  onClickOutside: () => {
345
345
  k.dispose();
346
346
  },
347
347
  direction: "horizontal"
348
348
  },
349
- r
349
+ i
350
350
  );
351
351
  return k;
352
352
  }), this._inputPlaceholderRenderRoot.mount();
353
353
  const a = this._docCanvasPopupManagerService.attachPopupToRect(
354
- o.firstLine,
354
+ s.firstLine,
355
355
  {
356
- componentKey: z.componentKey,
356
+ componentKey: V.componentKey,
357
357
  onClickOutside: () => {
358
358
  this.closePopup();
359
359
  },
360
360
  direction: "bottom"
361
361
  },
362
- r
362
+ i
363
363
  );
364
- this._editPopup$.next({ disposable: a, popup: i, anchor: n, unitId: r });
364
+ this._editPopup$.next({ disposable: a, popup: r, anchor: n, unitId: i });
365
365
  }
366
366
  closePopup() {
367
367
  this.editPopup && (this.editPopup.disposable.dispose(), this._editPopup$.next(null));
@@ -372,48 +372,48 @@ let S = class extends X {
372
372
  };
373
373
  }
374
374
  emitMenuSelected(e) {
375
- const { start: i, end: n } = this.inputOffset;
375
+ const { start: r, end: n } = this.inputOffset;
376
376
  this._commandService.syncExecuteCommand(be.id, {
377
- start: i,
377
+ start: r,
378
378
  end: n
379
379
  }), setTimeout(() => {
380
- this._menuSelectedCallbacks.forEach((r) => r(e));
380
+ this._menuSelectedCallbacks.forEach((i) => i(e));
381
381
  }, 0);
382
382
  }
383
383
  };
384
- S = Mt([
384
+ y = Mt([
385
385
  N(0, f(Pe)),
386
386
  N(1, f(le)),
387
387
  N(2, f(H)),
388
388
  N(3, f(he)),
389
389
  N(4, f(ve))
390
- ], S);
390
+ ], y);
391
391
  const ke = "doc.quick-insert.button";
392
- var wt = Object.getOwnPropertyDescriptor, kt = (t, e, i, n) => {
393
- for (var r = n > 1 ? void 0 : n ? wt(e, i) : e, s = t.length - 1, c; s >= 0; s--)
394
- (c = t[s]) && (r = c(r) || r);
395
- return r;
396
- }, ie = (t, e) => (i, n) => e(i, n, t);
392
+ var wt = Object.getOwnPropertyDescriptor, kt = (t, e, r, n) => {
393
+ for (var i = n > 1 ? void 0 : n ? wt(e, r) : e, o = t.length - 1, c; o >= 0; o--)
394
+ (c = t[o]) && (i = c(i) || i);
395
+ return i;
396
+ }, re = (t, e) => (r, n) => e(r, n, t);
397
397
  let F = class extends X {
398
- constructor(e, i, n, r) {
398
+ constructor(e, r, n, i) {
399
399
  super();
400
- _(this, "_popup$", new A(null));
401
- _(this, "popup$", this._popup$.asObservable());
402
- this._context = e, this._docEventManagerService = i, this._docQuickInsertPopupService = n, this._docCanvasPopManagerService = r, this._init();
400
+ C(this, "_popup$", new A(null));
401
+ C(this, "popup$", this._popup$.asObservable());
402
+ this._context = e, this._docEventManagerService = r, this._docQuickInsertPopupService = n, this._docCanvasPopManagerService = i, this._init();
403
403
  }
404
404
  get popup() {
405
405
  return this._popup$.value;
406
406
  }
407
407
  _init() {
408
- this.disposeWithMe(fe([this._docEventManagerService.hoverParagraphLeftRealTime$, this._docEventManagerService.hoverParagraphRealTime$]).subscribe(([e, i]) => {
409
- var s;
410
- const n = e != null ? e : i, r = this._context.unit.getDisabled();
411
- if (!n || r) {
408
+ this.disposeWithMe(fe([this._docEventManagerService.hoverParagraphLeftRealTime$, this._docEventManagerService.hoverParagraphRealTime$]).subscribe(([e, r]) => {
409
+ var o;
410
+ const n = e != null ? e : r, i = this._context.unit.getDisabled();
411
+ if (!n || i) {
412
412
  this._hideMenu(!0);
413
413
  return;
414
414
  }
415
415
  if (n.paragraphStart === n.paragraphEnd) {
416
- if (this._docQuickInsertPopupService.editPopup || n.startIndex === ((s = this.popup) == null ? void 0 : s.startIndex)) return;
416
+ if (this._docQuickInsertPopupService.editPopup || n.startIndex === ((o = this.popup) == null ? void 0 : o.startIndex)) return;
417
417
  this._hideMenu(!0);
418
418
  const c = this._docCanvasPopManagerService.attachPopupToRect(n.firstLine, {
419
419
  componentKey: ke,
@@ -432,39 +432,39 @@ let F = class extends X {
432
432
  }
433
433
  };
434
434
  F = kt([
435
- ie(1, f(Oe)),
436
- ie(2, f(S)),
437
- ie(3, f(Pe))
435
+ re(1, f(xe)),
436
+ re(2, f(y)),
437
+ re(3, f(Pe))
438
438
  ], F);
439
439
  const Re = {
440
440
  id: "quick-insert.text.menu",
441
441
  title: "docQuickInsert.menu.text",
442
- icon: "TextSingle",
442
+ icon: "TextIcon",
443
443
  keywords: ["text"]
444
444
  }, De = {
445
- id: st.id,
445
+ id: ot.id,
446
446
  title: "docQuickInsert.menu.numberedList",
447
- icon: "OrderSingle",
447
+ icon: "OrderIcon",
448
448
  keywords: ["numbered", "list", "ordered"]
449
449
  }, $e = {
450
- id: ot.id,
450
+ id: st.id,
451
451
  title: "docQuickInsert.menu.bulletedList",
452
- icon: "UnorderSingle",
452
+ icon: "UnorderIcon",
453
453
  keywords: ["bulleted", "list", "unordered"]
454
454
  }, Ee = {
455
455
  id: ct.id,
456
456
  title: "docQuickInsert.menu.divider",
457
- icon: "DividerSingle",
457
+ icon: "DividerIcon",
458
458
  keywords: ["divider", "line", "separate"]
459
459
  }, Ne = {
460
460
  id: at.id,
461
461
  title: "docQuickInsert.menu.table",
462
- icon: "GridSingle",
462
+ icon: "GridIcon",
463
463
  keywords: ["table", "grid", "spreadsheet"]
464
464
  }, Te = {
465
465
  id: Je.id,
466
466
  title: "docQuickInsert.menu.image",
467
- icon: "addition-and-subtraction-single",
467
+ icon: "AdditionAndSubtractionIcon",
468
468
  keywords: ["image", "picture", "photo"]
469
469
  }, Rt = [
470
470
  {
@@ -486,14 +486,14 @@ const Re = {
486
486
  Ne.id,
487
487
  Te.id
488
488
  ]);
489
- var $t = Object.getOwnPropertyDescriptor, Et = (t, e, i, n) => {
490
- for (var r = n > 1 ? void 0 : n ? $t(e, i) : e, s = t.length - 1, c; s >= 0; s--)
491
- (c = t[s]) && (r = c(r) || r);
492
- return r;
493
- }, T = (t, e) => (i, n) => e(i, n, t);
489
+ var $t = Object.getOwnPropertyDescriptor, Et = (t, e, r, n) => {
490
+ for (var i = n > 1 ? void 0 : n ? $t(e, r) : e, o = t.length - 1, c; o >= 0; o--)
491
+ (c = t[o]) && (i = c(i) || i);
492
+ return i;
493
+ }, T = (t, e) => (r, n) => e(r, n, t);
494
494
  let G = class extends X {
495
- constructor(t, e, i, n, r) {
496
- super(), this._commandService = t, this._textSelectionManagerService = e, this._docQuickInsertPopupService = i, this._shortcutService = n, this._univerInstanceService = r, this.disposeWithMe(this._shortcutService.registerShortcut({
495
+ constructor(t, e, r, n, i) {
496
+ super(), this._commandService = t, this._textSelectionManagerService = e, this._docQuickInsertPopupService = r, this._shortcutService = n, this._univerInstanceService = i, this.disposeWithMe(this._shortcutService.registerShortcut({
497
497
  id: Q.id,
498
498
  binding: M.ESC,
499
499
  preconditions: () => !!this._docQuickInsertPopupService.editPopup,
@@ -505,59 +505,59 @@ let G = class extends X {
505
505
  this.disposeWithMe(
506
506
  // eslint-disable-next-line complexity, max-lines-per-function
507
507
  this._commandService.onCommandExecuted((t) => {
508
- var s, c, u;
509
- const { _docQuickInsertPopupService: e, _textSelectionManagerService: i, _commandService: n } = this, r = this._univerInstanceService.getCurrentUnitOfType(K.UNIVER_DOC);
510
- if (!(r != null && r.getDisabled())) {
508
+ var o, c, u;
509
+ const { _docQuickInsertPopupService: e, _textSelectionManagerService: r, _commandService: n } = this, i = this._univerInstanceService.getCurrentUnitOfType(K.UNIVER_DOC);
510
+ if (!(i != null && i.getDisabled())) {
511
511
  if (t.id === dt.id) {
512
- const o = t.params;
512
+ const s = t.params;
513
513
  if (e.editPopup) {
514
514
  e.setInputOffset({
515
515
  start: e.inputOffset.start,
516
- end: o.range.endOffset + 1
516
+ end: s.range.endOffset + 1
517
517
  });
518
518
  return;
519
519
  }
520
- const a = i.getActiveTextRange();
520
+ const a = r.getActiveTextRange();
521
521
  if (!a)
522
522
  return;
523
- const d = e.resolvePopup(o.body.dataStream);
524
- if (!d || !(d.preconditions ? d.preconditions(o) : !0))
523
+ const d = e.resolvePopup(s.body.dataStream);
524
+ if (!d || !(d.preconditions ? d.preconditions(s) : !0))
525
525
  return;
526
526
  e.setInputOffset({ start: a.startOffset - 1, end: a.startOffset }), setTimeout(() => {
527
527
  n.executeCommand(Me.id, {
528
528
  index: a.startOffset - 1,
529
- unitId: o.unitId,
529
+ unitId: s.unitId,
530
530
  popup: d
531
531
  });
532
532
  }, 100);
533
533
  }
534
534
  if (t.id === ut.id) {
535
- const o = t.params;
536
- !e.isComposing && o.isCompositionStart && e.setIsComposing(!0), e.isComposing && o.isCompositionEnd && e.setIsComposing(!1);
535
+ const s = t.params;
536
+ !e.isComposing && s.isCompositionStart && e.setIsComposing(!0), e.isComposing && s.isCompositionEnd && e.setIsComposing(!1);
537
537
  }
538
538
  if (t.id === gt.id) {
539
- const o = t.params;
540
- if (o.isCompositionEnd) {
541
- const a = (c = (s = o.textRanges) == null ? void 0 : s[0]) == null ? void 0 : c.endOffset;
539
+ const s = t.params;
540
+ if (s.isCompositionEnd) {
541
+ const a = (c = (o = s.textRanges) == null ? void 0 : o[0]) == null ? void 0 : c.endOffset;
542
542
  a && e.setInputOffset({ start: e.inputOffset.start, end: a });
543
543
  }
544
544
  }
545
545
  if (t.id === pt.id) {
546
- const o = t.params;
547
- if (e.editPopup && o.direction === qe.LEFT) {
548
- const a = (u = o.len) != null ? u : 0;
549
- e.setInputOffset({ start: e.inputOffset.start, end: o.range.endOffset - a });
546
+ const s = t.params;
547
+ if (e.editPopup && s.direction === Ze.LEFT) {
548
+ const a = (u = s.len) != null ? u : 0;
549
+ e.setInputOffset({ start: e.inputOffset.start, end: s.range.endOffset - a });
550
550
  }
551
551
  }
552
552
  if (t.id === lt.id) {
553
- const o = t.params;
554
- (o.direction === W.LEFT || o.direction === W.RIGHT) && e.editPopup && n.executeCommand(Q.id);
553
+ const s = t.params;
554
+ (s.direction === W.LEFT || s.direction === W.RIGHT) && e.editPopup && n.executeCommand(Q.id);
555
555
  }
556
556
  if (t.id === ht.id) {
557
- const o = i.getActiveTextRange();
558
- if (!e.editPopup || !o)
557
+ const s = r.getActiveTextRange();
558
+ if (!e.editPopup || !s)
559
559
  return;
560
- o.endOffset <= e.editPopup.anchor && n.executeCommand(Q.id);
560
+ s.endOffset <= e.editPopup.anchor && n.executeCommand(Q.id);
561
561
  }
562
562
  }
563
563
  })
@@ -572,99 +572,99 @@ let G = class extends X {
572
572
  G = Et([
573
573
  T(0, H),
574
574
  T(1, f(ve)),
575
- T(2, f(S)),
576
- T(3, f(ye)),
575
+ T(2, f(y)),
576
+ T(3, f(Se)),
577
577
  T(4, f(le))
578
578
  ], G);
579
- var C = function() {
580
- return C = Object.assign || function(t) {
581
- for (var e, i = 1, n = arguments.length; i < n; i++) {
582
- e = arguments[i];
583
- for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
579
+ var _ = function() {
580
+ return _ = Object.assign || function(t) {
581
+ for (var e, r = 1, n = arguments.length; r < n; r++) {
582
+ e = arguments[r];
583
+ for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
584
584
  }
585
585
  return t;
586
- }, C.apply(this, arguments);
586
+ }, _.apply(this, arguments);
587
587
  }, Nt = function(t, e) {
588
- var i = {};
589
- for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (i[n] = t[n]);
588
+ var r = {};
589
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (r[n] = t[n]);
590
590
  if (t != null && typeof Object.getOwnPropertySymbols == "function")
591
- for (var r = 0, n = Object.getOwnPropertySymbols(t); r < n.length; r++)
592
- e.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[r]) && (i[n[r]] = t[n[r]]);
593
- return i;
591
+ for (var i = 0, n = Object.getOwnPropertySymbols(t); i < n.length; i++)
592
+ e.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[i]) && (r[n[i]] = t[n[i]]);
593
+ return r;
594
594
  }, te = Y(function(t, e) {
595
- var i = t.icon, n = t.id, r = t.className, s = t.extend, c = Nt(t, ["icon", "id", "className", "extend"]), u = "univerjs-icon univerjs-icon-".concat(n, " ").concat(r || "").trim(), o = B("_".concat(Qt()));
596
- return Ue(i, "".concat(n), { defIds: i.defIds, idSuffix: o.current }, C({ ref: e, className: u }, c), s);
595
+ var r = t.icon, n = t.id, i = t.className, o = t.extend, c = Nt(t, ["icon", "id", "className", "extend"]), u = "univerjs-icon univerjs-icon-".concat(n, " ").concat(i || "").trim(), s = B("_".concat(Qt()));
596
+ return Ue(r, "".concat(n), { defIds: r.defIds, idSuffix: s.current }, _({ ref: e, className: u }, c), o);
597
597
  });
598
- function Ue(t, e, i, n, r) {
599
- return ee(t.tag, C(C({ key: e }, Tt(t, i, r)), n), (Ut(t, i).children || []).map(function(s, c) {
600
- return Ue(s, "".concat(e, "-").concat(t.tag, "-").concat(c), i, void 0, r);
598
+ function Ue(t, e, r, n, i) {
599
+ return ee(t.tag, _(_({ key: e }, Tt(t, r, i)), n), (Ut(t, r).children || []).map(function(o, c) {
600
+ return Ue(o, "".concat(e, "-").concat(t.tag, "-").concat(c), r, void 0, i);
601
601
  }));
602
602
  }
603
- function Tt(t, e, i) {
604
- var n = C({}, t.attrs);
605
- i != null && i.colorChannel1 && n.fill === "colorChannel1" && (n.fill = i.colorChannel1), t.tag === "mask" && n.id && (n.id = n.id + e.idSuffix), Object.entries(n).forEach(function(s) {
606
- var c = s[0], u = s[1];
603
+ function Tt(t, e, r) {
604
+ var n = _({}, t.attrs);
605
+ r != null && r.colorChannel1 && n.fill === "colorChannel1" && (n.fill = r.colorChannel1), t.tag === "mask" && n.id && (n.id = n.id + e.idSuffix), Object.entries(n).forEach(function(o) {
606
+ var c = o[0], u = o[1];
607
607
  c === "mask" && typeof u == "string" && (n[c] = u.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
608
608
  });
609
- var r = e.defIds;
610
- return !r || r.length === 0 || (t.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + e.idSuffix), Object.entries(n).forEach(function(s) {
611
- var c = s[0], u = s[1];
609
+ var i = e.defIds;
610
+ return !i || i.length === 0 || (t.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + e.idSuffix), Object.entries(n).forEach(function(o) {
611
+ var c = o[0], u = o[1];
612
612
  typeof u == "string" && (n[c] = u.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
613
613
  })), n;
614
614
  }
615
615
  function Ut(t, e) {
616
- var i, n = e.defIds;
617
- return !n || n.length === 0 ? t : t.tag === "defs" && (!((i = t.children) === null || i === void 0) && i.length) ? C(C({}, t), { children: t.children.map(function(r) {
618
- return typeof r.attrs.id == "string" && n && n.indexOf(r.attrs.id) > -1 ? C(C({}, r), { attrs: C(C({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
616
+ var r, n = e.defIds;
617
+ return !n || n.length === 0 ? t : t.tag === "defs" && (!((r = t.children) === null || r === void 0) && r.length) ? _(_({}, t), { children: t.children.map(function(i) {
618
+ return typeof i.attrs.id == "string" && n && n.indexOf(i.attrs.id) > -1 ? _(_({}, i), { attrs: _(_({}, i.attrs), { id: i.attrs.id + e.idSuffix }) }) : i;
619
619
  }) }) : t;
620
620
  }
621
621
  function Qt() {
622
622
  return Math.random().toString(36).substring(2, 8);
623
623
  }
624
624
  te.displayName = "UniverIcon";
625
- var Ht = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.01953 3.13985C1.01953 2.77258 1.31726 2.47485 1.68453 2.47485H2.73713C3.1044 2.47485 3.40213 2.77258 3.40213 3.13985 3.40213 3.50712 3.1044 3.80485 2.73713 3.80485H1.68453C1.31726 3.80485 1.01953 3.50712 1.01953 3.13985zM4.17734 3.13985C4.17734 2.77258 4.47507 2.47485 4.84234 2.47485H6.94754C7.31481 2.47485 7.61254 2.77258 7.61254 3.13985 7.61254 3.50712 7.31481 3.80485 6.94754 3.80485H4.84234C4.47507 3.80485 4.17734 3.50712 4.17734 3.13985zM8.38775 3.13985C8.38775 2.77258 8.68548 2.47485 9.05275 2.47485H11.158C11.5252 2.47485 11.823 2.77258 11.823 3.13985 11.823 3.50712 11.5252 3.80485 11.158 3.80485H9.05275C8.68548 3.80485 8.38775 3.50712 8.38775 3.13985zM12.5982 3.13985C12.5982 2.77258 12.8959 2.47485 13.2632 2.47485H14.3158C14.683 2.47485 14.9808 2.77258 14.9808 3.13985 14.9808 3.50712 14.683 3.80485 14.3158 3.80485H13.2632C12.8959 3.80485 12.5982 3.50712 12.5982 3.13985zM1.01953 7.99972C1.01953 7.63245 1.31726 7.33472 1.68453 7.33472H14.3158C14.683 7.33472 14.9808 7.63245 14.9808 7.99972 14.9808 8.36699 14.683 8.66472 14.3158 8.66472H1.68453C1.31726 8.66472 1.01953 8.36699 1.01953 7.99972zM1.68453 12.1951C1.31726 12.1951 1.01953 12.4928 1.01953 12.8601 1.01953 13.2273 1.31726 13.5251 1.68453 13.5251H2.73713C3.1044 13.5251 3.40213 13.2273 3.40213 12.8601 3.40213 12.4928 3.1044 12.1951 2.73713 12.1951H1.68453zM4.84234 12.1951C4.47507 12.1951 4.17734 12.4928 4.17734 12.8601 4.17734 13.2273 4.47507 13.5251 4.84234 13.5251H6.94754C7.31481 13.5251 7.61254 13.2273 7.61254 12.8601 7.61254 12.4928 7.31481 12.1951 6.94754 12.1951H4.84234zM9.05275 12.1951C8.68548 12.1951 8.38775 12.4928 8.38775 12.8601 8.38775 13.2273 8.68548 13.5251 9.05275 13.5251H11.158C11.5252 13.5251 11.823 13.2273 11.823 12.8601 11.823 12.4928 11.5252 12.1951 11.158 12.1951H9.05275zM13.2632 12.1951C12.8959 12.1951 12.5982 12.4928 12.5982 12.8601 12.5982 13.2273 12.8959 13.5251 13.2632 13.5251H14.3158C14.683 13.5251 14.9808 13.2273 14.9808 12.8601 14.9808 12.4928 14.683 12.1951 14.3158 12.1951H13.2632z" } }] }, ae = Y(function(t, e) {
625
+ var Ht = { 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: "M1.01953 3.13985C1.01953 2.77258 1.31726 2.47485 1.68453 2.47485H2.73713C3.1044 2.47485 3.40213 2.77258 3.40213 3.13985C3.40213 3.50712 3.1044 3.80485 2.73713 3.80485H1.68453C1.31726 3.80485 1.01953 3.50712 1.01953 3.13985Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.17734 3.13985C4.17734 2.77258 4.47507 2.47485 4.84234 2.47485H6.94754C7.31481 2.47485 7.61254 2.77258 7.61254 3.13985C7.61254 3.50712 7.31481 3.80485 6.94754 3.80485H4.84234C4.47507 3.80485 4.17734 3.50712 4.17734 3.13985Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M8.38775 3.13985C8.38775 2.77258 8.68548 2.47485 9.05275 2.47485H11.158C11.5252 2.47485 11.823 2.77258 11.823 3.13985C11.823 3.50712 11.5252 3.80485 11.158 3.80485H9.05275C8.68548 3.80485 8.38775 3.50712 8.38775 3.13985Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M12.5982 3.13985C12.5982 2.77258 12.8959 2.47485 13.2632 2.47485H14.3158C14.683 2.47485 14.9808 2.77258 14.9808 3.13985C14.9808 3.50712 14.683 3.80485 14.3158 3.80485H13.2632C12.8959 3.80485 12.5982 3.50712 12.5982 3.13985Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.01953 7.99972C1.01953 7.63245 1.31726 7.33472 1.68453 7.33472H14.3158C14.683 7.33472 14.9808 7.63245 14.9808 7.99972C14.9808 8.36699 14.683 8.66472 14.3158 8.66472H1.68453C1.31726 8.66472 1.01953 8.36699 1.01953 7.99972Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.68453 12.1951C1.31726 12.1951 1.01953 12.4928 1.01953 12.8601C1.01953 13.2273 1.31726 13.5251 1.68453 13.5251H2.73713C3.1044 13.5251 3.40213 13.2273 3.40213 12.8601C3.40213 12.4928 3.1044 12.1951 2.73713 12.1951H1.68453Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.84234 12.1951C4.47507 12.1951 4.17734 12.4928 4.17734 12.8601C4.17734 13.2273 4.47507 13.5251 4.84234 13.5251H6.94754C7.31481 13.5251 7.61254 13.2273 7.61254 12.8601C7.61254 12.4928 7.31481 12.1951 6.94754 12.1951H4.84234Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M9.05275 12.1951C8.68548 12.1951 8.38775 12.4928 8.38775 12.8601C8.38775 13.2273 8.68548 13.5251 9.05275 13.5251H11.158C11.5252 13.5251 11.823 13.2273 11.823 12.8601C11.823 12.4928 11.5252 12.1951 11.158 12.1951H9.05275Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M13.2632 12.1951C12.8959 12.1951 12.5982 12.4928 12.5982 12.8601C12.5982 13.2273 12.8959 13.5251 13.2632 13.5251H14.3158C14.683 13.5251 14.9808 13.2273 14.9808 12.8601C14.9808 12.4928 14.683 12.1951 14.3158 12.1951H13.2632Z" } }] }, ae = Y(function(t, e) {
626
626
  return ee(te, Object.assign({}, t, {
627
- id: "divider-single",
627
+ id: "divider-icon",
628
628
  ref: e,
629
629
  icon: Ht
630
630
  }));
631
631
  });
632
- ae.displayName = "DividerSingle";
633
- var Kt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.00033 2.66699C8.36852 2.66699 8.66699 2.96547 8.66699 3.33366V7.33366H12.667C13.0352 7.33366 13.3337 7.63214 13.3337 8.00033C13.3337 8.36852 13.0352 8.66699 12.667 8.66699H8.66699V12.667C8.66699 13.0352 8.36852 13.3337 8.00033 13.3337C7.63214 13.3337 7.33366 13.0352 7.33366 12.667V8.66699H3.33366C2.96547 8.66699 2.66699 8.36852 2.66699 8.00033C2.66699 7.63214 2.96547 7.33366 3.33366 7.33366H7.33366V3.33366C7.33366 2.96547 7.63214 2.66699 8.00033 2.66699Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Qe = Y(function(t, e) {
632
+ ae.displayName = "DividerIcon";
633
+ var Kt = { 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: "M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z" } }] }, Qe = Y(function(t, e) {
634
634
  return ee(te, Object.assign({}, t, {
635
- id: "plus-single",
635
+ id: "increase-icon",
636
636
  ref: e,
637
637
  icon: Kt
638
638
  }));
639
639
  });
640
- Qe.displayName = "PlusSingle";
641
- var jt = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2.66695 1.33496C2.29968 1.33496 2.00195 1.63269 2.00195 1.99996V3.64439C2.00195 4.01166 2.29968 4.30939 2.66695 4.30939C3.03422 4.30939 3.33195 4.01166 3.33195 3.64439V2.66496H7.33521V13.335H5.3337C4.96643 13.335 4.6687 13.6327 4.6687 14C4.6687 14.3672 4.96643 14.665 5.3337 14.665H10.667C11.0343 14.665 11.332 14.3672 11.332 14C11.332 13.6327 11.0343 13.335 10.667 13.335H8.66521V2.66496H12.6686V3.64439C12.6686 4.01166 12.9664 4.30939 13.3336 4.30939C13.7009 4.30939 13.9986 4.01166 13.9986 3.64439V1.99996C13.9986 1.63269 13.7009 1.33496 13.3336 1.33496H2.66695Z" } }] }, de = Y(function(t, e) {
640
+ Qe.displayName = "IncreaseIcon";
641
+ var Lt = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "g", attrs: { fill: "currentColor", clipPath: "url(#text-icon_clip0_1293_26)" }, children: [{ tag: "path", attrs: { d: "M2.22891 2.07227C1.89754 2.07227 1.62891 2.34089 1.62891 2.67227C1.62891 3.00364 1.89754 3.27227 2.22891 3.27227H6.29541V14.0056C6.29541 14.337 6.56404 14.6056 6.89541 14.6056C7.22678 14.6056 7.49541 14.337 7.49541 14.0056V3.27227H11.5622C11.8936 3.27227 12.1622 3.00364 12.1622 2.67227C12.1622 2.34089 11.8936 2.07227 11.5622 2.07227H2.22891Z" } }, { tag: "path", attrs: { d: "M10.2289 6.40552C9.89754 6.40552 9.62891 6.67415 9.62891 7.00552C9.62891 7.33689 9.89754 7.60552 10.2289 7.60552H12.2954V14.0055C12.2954 14.3369 12.564 14.6055 12.8954 14.6055C13.2268 14.6055 13.4954 14.3369 13.4954 14.0055V7.60552H15.5622C15.8936 7.60552 16.1622 7.33689 16.1622 7.00552C16.1622 6.67415 15.8936 6.40552 15.5622 6.40552H10.2289Z" } }] }, { tag: "defs", attrs: {}, children: [{ tag: "clipPath", attrs: { id: "text-icon_clip0_1293_26" }, children: [{ tag: "path", attrs: { fill: "white", d: "M0 0H16V16H0z", transform: "translate(.9)" } }] }] }], defIds: ["text-icon_clip0_1293_26"] }, de = Y(function(t, e) {
642
642
  return ee(te, Object.assign({}, t, {
643
- id: "text-single",
643
+ id: "text-icon",
644
644
  ref: e,
645
- icon: jt
645
+ icon: Lt
646
646
  }));
647
647
  });
648
- de.displayName = "TextSingle";
648
+ de.displayName = "TextIcon";
649
649
  const ue = ({ className: t = "" }) => {
650
- const e = I(S), i = I(le), n = I(he), r = U(oe(() => i.getCurrentTypeOfUnit$(K.UNIVER_DOC), [i])), s = r && n.getRenderById(r.getUnitId()), c = s == null ? void 0 : s.with(F), u = I(tt), o = I(ve), a = U(e.editPopup$), d = nt((p) => {
650
+ const e = I(y), r = I(le), n = I(he), i = U(se(() => r.getCurrentTypeOfUnit$(K.UNIVER_DOC), [r])), o = i && n.getRenderById(i.getUnitId()), c = o == null ? void 0 : o.with(F), u = I(tt), s = I(ve), a = U(e.editPopup$), d = nt((p) => {
651
651
  var P;
652
652
  const v = c == null ? void 0 : c.popup;
653
653
  if (!v)
654
654
  return;
655
- const y = e.popups, w = {
655
+ const S = e.popups, w = {
656
656
  keyword: "",
657
- menus$: fe(y.map((O) => O.menus$)).pipe(
658
- xe((O) => O.flat())
657
+ menus$: fe(S.map((x) => x.menus$)).pipe(
658
+ Oe((x) => x.flat())
659
659
  )
660
660
  };
661
- o.replaceDocRanges([{
661
+ s.replaceDocRanges([{
662
662
  startOffset: v.startIndex,
663
663
  endOffset: v.startIndex
664
664
  }]), e.setInputOffset({ start: v.startIndex - 1, end: v.startIndex - 1 }), e.showPopup({
665
665
  popup: w,
666
666
  index: v.startIndex - 1,
667
- unitId: (P = r == null ? void 0 : r.getUnitId()) != null ? P : ""
667
+ unitId: (P = i == null ? void 0 : i.getUnitId()) != null ? P : ""
668
668
  }), setTimeout(() => {
669
669
  u.focus();
670
670
  });
@@ -672,7 +672,7 @@ const ue = ({ className: t = "" }) => {
672
672
  return /* @__PURE__ */ h(
673
673
  "div",
674
674
  {
675
- className: se("univer-mr-1 univer-flex univer-cursor-pointer univer-items-center univer-gap-2.5 univer-rounded-full univer-p-1.5 univer-shadow-sm dark:!univer-text-gray-200 dark:hover:!univer-bg-gray-700 hover:univer-bg-gray-100", yt, {
675
+ className: oe("univer-mr-1 univer-flex univer-cursor-pointer univer-items-center univer-gap-2.5 univer-rounded-full univer-p-1.5 univer-shadow-sm dark:!univer-text-gray-200 dark:hover:!univer-bg-gray-700 hover:univer-bg-gray-100", St, {
676
676
  "univer-bg-gray-100 dark:!univer-bg-gray-700": a,
677
677
  "univer-bg-white dark:!univer-bg-gray-900": !a
678
678
  }, t),
@@ -689,14 +689,14 @@ const ue = ({ className: t = "" }) => {
689
689
  );
690
690
  };
691
691
  ue.componentKey = ke;
692
- var Lt = Object.getOwnPropertyDescriptor, At = (t, e, i, n) => {
693
- for (var r = n > 1 ? void 0 : n ? Lt(e, i) : e, s = t.length - 1, c; s >= 0; s--)
694
- (c = t[s]) && (r = c(r) || r);
695
- return r;
696
- }, re = (t, e) => (i, n) => e(i, n, t);
697
- let Z = class extends X {
698
- constructor(t, e, i) {
699
- super(), this._commandService = t, this._docQuickInsertPopupService = e, this._componentManager = i, this._initCommands(), this._initComponents(), this._initMenus();
692
+ var jt = Object.getOwnPropertyDescriptor, At = (t, e, r, n) => {
693
+ for (var i = n > 1 ? void 0 : n ? jt(e, r) : e, o = t.length - 1, c; o >= 0; o--)
694
+ (c = t[o]) && (i = c(i) || i);
695
+ return i;
696
+ }, ie = (t, e) => (r, n) => e(r, n, t);
697
+ let z = class extends X {
698
+ constructor(t, e, r) {
699
+ super(), this._commandService = t, this._docQuickInsertPopupService = e, this._componentManager = r, this._initCommands(), this._initComponents(), this._initMenus();
700
700
  }
701
701
  _initCommands() {
702
702
  [
@@ -709,22 +709,22 @@ let Z = class extends X {
709
709
  }
710
710
  _initComponents() {
711
711
  [
712
- [z.componentKey, z],
713
712
  [V.componentKey, V],
714
713
  [q.componentKey, q],
714
+ [Z.componentKey, Z],
715
715
  [ae.displayName, ae],
716
716
  [de.displayName, de],
717
717
  [ue.componentKey, ue]
718
- ].forEach(([e, i]) => {
719
- e && this.disposeWithMe(this._componentManager.register(e, i));
718
+ ].forEach(([e, r]) => {
719
+ e && this.disposeWithMe(this._componentManager.register(e, r));
720
720
  }), [
721
721
  {
722
722
  keyword: "/",
723
723
  menus$: vt(Rt),
724
724
  // only show when the cursor is at the beginning of a line
725
725
  preconditions: (e) => {
726
- var i;
727
- return ((i = e.range.startNodePosition) == null ? void 0 : i.glyph) === 0;
726
+ var r;
727
+ return ((r = e.range.startNodePosition) == null ? void 0 : r.glyph) === 0;
728
728
  }
729
729
  }
730
730
  ].forEach((e) => {
@@ -734,30 +734,30 @@ let Z = class extends X {
734
734
  _initMenus() {
735
735
  }
736
736
  };
737
- Z = At([
738
- re(0, H),
739
- re(1, f(S)),
740
- re(2, f(Se))
741
- ], Z);
742
- var Bt = Object.defineProperty, Wt = Object.getOwnPropertyDescriptor, Vt = (t, e, i) => e in t ? Bt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, qt = (t, e, i, n) => {
743
- for (var r = n > 1 ? void 0 : n ? Wt(e, i) : e, s = t.length - 1, c; s >= 0; s--)
744
- (c = t[s]) && (r = c(r) || r);
745
- return r;
746
- }, Ie = (t, e) => (i, n) => e(i, n, t), He = (t, e, i) => Vt(t, typeof e != "symbol" ? e + "" : e, i);
747
- const zt = "DOC_QUICK_INSERT_UI_PLUGIN";
737
+ z = At([
738
+ ie(0, H),
739
+ ie(1, f(y)),
740
+ ie(2, f(ye))
741
+ ], z);
742
+ var Bt = Object.defineProperty, Wt = Object.getOwnPropertyDescriptor, qt = (t, e, r) => e in t ? Bt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Zt = (t, e, r, n) => {
743
+ for (var i = n > 1 ? void 0 : n ? Wt(e, r) : e, o = t.length - 1, c; o >= 0; o--)
744
+ (c = t[o]) && (i = c(i) || i);
745
+ return i;
746
+ }, Ie = (t, e) => (r, n) => e(r, n, t), He = (t, e, r) => qt(t, typeof e != "symbol" ? e + "" : e, r);
747
+ const Vt = "DOC_QUICK_INSERT_UI_PLUGIN";
748
748
  let J = class extends Ge {
749
749
  constructor(t, e) {
750
750
  super(), this._injector = t, this._renderManagerSrv = e;
751
751
  }
752
752
  onStarting() {
753
753
  [
754
- [Z],
754
+ [z],
755
755
  [G],
756
- [S]
757
- ].forEach((e) => this._injector.add(e)), this._injector.get(Z);
756
+ [y]
757
+ ].forEach((e) => this._injector.add(e)), this._injector.get(z);
758
758
  }
759
759
  onRendered() {
760
- this._injector.get(G), this._injector.get(S), [
760
+ this._injector.get(G), this._injector.get(y), [
761
761
  [F]
762
762
  ].forEach((t) => {
763
763
  this._renderManagerSrv.registerRenderModule(K.UNIVER_DOC, t);
@@ -765,17 +765,17 @@ let J = class extends Ge {
765
765
  }
766
766
  };
767
767
  He(J, "type", K.UNIVER_DOC);
768
- He(J, "pluginName", zt);
769
- J = qt([
770
- ze(et, Ye, Xe, Ze, it),
768
+ He(J, "pluginName", Vt);
769
+ J = Zt([
770
+ Ve(et, Ye, Xe, ze, rt),
771
771
  Ie(0, f(Fe)),
772
772
  Ie(1, f(he))
773
773
  ], J);
774
774
  export {
775
- S as DocQuickInsertPopupService,
775
+ y as DocQuickInsertPopupService,
776
776
  G as DocQuickInsertTriggerController,
777
- Z as DocQuickInsertUIController,
777
+ z as DocQuickInsertUIController,
778
778
  Pt as KeywordInputPlaceholderComponentKey,
779
- Ot as QuickInsertPlaceholderComponentKey,
779
+ xt as QuickInsertPlaceholderComponentKey,
780
780
  J as UniverDocsQuickInsertUIPlugin
781
781
  };