@univerjs/docs-quick-insert-ui 0.7.0 → 0.8.0-beta.1

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 b, 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 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 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";
17
- const Me = {
15
+ import { Menu as Ct, clsx as se, scrollbarClassName as _t, MenuItemGroup as It, MenuItem as yt, Tooltip as St, borderClassName as Pt } from "@univerjs/design";
16
+ import { useMemo as oe, useState as Ce, useRef as B, useEffect as j, forwardRef as Y, createElement as ee } from "react";
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 Me = {
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
+ }, xt = "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;
42
- const be = {
41
+ q.componentKey = xt;
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
+ }, Ot = "docs.quick.insert.placeholder", Z = () => {
56
56
  const t = I(pe);
57
57
  return /* @__PURE__ */ h(
58
58
  "div",
@@ -62,114 +62,114 @@ const be = {
62
62
  }
63
63
  );
64
64
  };
65
- q.componentKey = Ot;
65
+ Z.componentKey = Ot;
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 = [b.ARROW_UP, b.ARROW_DOWN, b.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 bt = [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), s = oe(() => Be(), []), [c, u] = Ce(0), o = 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 = oe(() => 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) => {
98
- const M = l.preconditions;
99
- l.preconditions = () => !1, m.add(Ve(() => {
100
- l.preconditions = M;
97
+ n.getAllShortcuts().filter((l) => l.binding && bt.includes(l.binding)).forEach((l) => {
98
+ const b = l.preconditions;
99
+ l.preconditions = () => !1, m.add(qe(() => {
100
+ l.preconditions = b;
101
101
  }));
102
102
  });
103
- const x = {
103
+ const O = {
104
104
  id: `quick.insert.popup.enter.${s}`,
105
105
  type: D.OPERATION,
106
106
  handler: () => {
107
107
  const l = o.current;
108
- l && O(l);
108
+ l && x(l);
109
109
  }
110
- }, E = {
110
+ }, N = {
111
111
  id: `quick.insert.popup.move.cursor.up.${s}`,
112
112
  type: D.OPERATION,
113
113
  handler: () => {
114
114
  u((l) => {
115
- const M = l - 1;
116
- return M >= 0 ? M : a.current - 1;
115
+ const b = l - 1;
116
+ return b >= 0 ? b : a.current - 1;
117
117
  });
118
118
  }
119
- }, k = {
119
+ }, R = {
120
120
  id: `quick.insert.popup.move.cursor.down.${s}`,
121
121
  type: D.OPERATION,
122
122
  handler: () => {
123
123
  u((l) => {
124
- const M = l + 1;
125
- return M <= a.current - 1 ? M : 0;
124
+ const b = l + 1;
125
+ return b <= a.current - 1 ? b : 0;
126
126
  });
127
127
  }
128
128
  };
129
- return m.add(r.registerCommand(E)), m.add(r.registerCommand(k)), m.add(r.registerCommand(x)), m.add(n.registerShortcut({
129
+ return m.add(i.registerCommand(N)), m.add(i.registerCommand(R)), m.add(i.registerCommand(O)), m.add(n.registerShortcut({
130
130
  priority: 1e3,
131
- id: E.id,
132
- binding: b.ARROW_UP,
131
+ id: N.id,
132
+ binding: M.ARROW_UP,
133
133
  preconditions: () => !0,
134
134
  staticParameters: {
135
135
  direction: W.UP
136
136
  }
137
137
  })), m.add(n.registerShortcut({
138
138
  priority: 1e3,
139
- id: k.id,
140
- binding: b.ARROW_DOWN,
139
+ id: R.id,
140
+ binding: M.ARROW_DOWN,
141
141
  preconditions: () => !0,
142
142
  staticParameters: {
143
143
  direction: W.DOWN
144
144
  }
145
145
  })), m.add(n.registerShortcut({
146
146
  priority: 1e3,
147
- id: x.id,
148
- binding: b.ENTER,
147
+ id: O.id,
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
- const R = B(/* @__PURE__ */ new Map());
157
- L(() => () => {
158
- R.current.clear();
156
+ const k = B(/* @__PURE__ */ new Map());
157
+ j(() => () => {
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
+ It,
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
  }
@@ -178,35 +178,35 @@ const xt = [b.ARROW_UP, b.ARROW_DOWN, b.ENTER], z = () => {
178
178
  },
179
179
  g.id
180
180
  );
181
- const E = a.current, k = c === E;
182
- if (k) {
181
+ const N = a.current, R = c === N;
182
+ if (R) {
183
183
  o.current = g;
184
- const l = R.current.get(g.id);
184
+ const l = k.current.get(g.id);
185
185
  l == null || l.scrollIntoView({
186
186
  block: "nearest"
187
187
  });
188
188
  }
189
189
  return a.current++, /* @__PURE__ */ h(
190
- It,
190
+ yt,
191
191
  {
192
192
  ref: (l) => {
193
- l && R.current.set(g.id, l);
193
+ l && k.current.set(g.id, l);
194
194
  },
195
- onMouseEnter: () => u(E),
195
+ onMouseEnter: () => u(N),
196
196
  onMouseLeave: () => u(Number.NaN),
197
197
  className: se("univer-w-[calc(220px-var(--padding-base)*2)] univer-text-sm", {
198
- "hover:univer-bg-transparent": !k,
199
- "univer-bg-gray-100": k
198
+ "hover:univer-bg-transparent": !R,
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, {}) }),
209
+ O && /* @__PURE__ */ h("span", { className: "univer-mr-2 univer-inline-flex univer-text-base", children: /* @__PURE__ */ h(O, {}) }),
210
210
  /* @__PURE__ */ h(St, { showIfEllipsis: !0, title: g.title, placement: "right", children: /* @__PURE__ */ h("span", { className: "univer-truncate", children: g.title }) })
211
211
  ]
212
212
  }
@@ -216,58 +216,64 @@ const xt = [b.ARROW_UP, b.ARROW_DOWN, b.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: "univer-mt-2", children: Ke ? /* @__PURE__ */ h(
221
+ Ct,
222
+ {
223
+ wrapperClass: se("univer-max-h-[360px] univer-w-[220px] univer-overflow-y-auto univer-overflow-x-hidden", _t),
224
+ children: $(w)
225
+ }
226
+ ) : me && /* @__PURE__ */ h(me, {}) });
221
227
  };
222
- z.componentKey = "docs.quick.insert.popup";
223
- var Mt = Object.getOwnPropertyDescriptor, bt = (t, e, i, n) => {
224
- for (var r = n > 1 ? void 0 : n ? Mt(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 = {
228
+ V.componentKey = "docs.quick.insert.popup";
229
+ var Mt = Object.getOwnPropertyDescriptor, wt = (t, e, r, n) => {
230
+ for (var i = n > 1 ? void 0 : n ? Mt(e, r) : e, s = t.length - 1, c; s >= 0; s--)
231
+ (c = t[s]) && (i = c(i) || i);
232
+ return i;
233
+ }, E = (t, e) => (r, n) => e(r, n, t);
234
+ const _e = {
229
235
  dispose: () => {
230
236
  }
231
237
  };
232
- let S = class extends X {
233
- constructor(e, i, n, r, s) {
238
+ let y = class extends X {
239
+ constructor(e, r, n, i, s) {
234
240
  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$);
241
+ C(this, "_popups", /* @__PURE__ */ new Set());
242
+ C(this, "_editPopup$", new A(void 0));
243
+ C(this, "editPopup$", this._editPopup$.asObservable());
244
+ C(this, "_isComposing$", new A(!1));
245
+ C(this, "isComposing$", this._isComposing$.asObservable());
246
+ C(this, "_inputOffset$", new A({ start: 0, end: 0 }));
247
+ C(this, "inputOffset$", this._inputOffset$.asObservable());
248
+ C(this, "filterKeyword$");
249
+ C(this, "_menuSelectedCallbacks", /* @__PURE__ */ new Set());
250
+ C(this, "_inputPlaceholderRenderRoot", null);
251
+ this._docCanvasPopupManagerService = e, this._univerInstanceService = r, this._commandService = n, this._renderManagerService = i, this._docSelectionManagerService = s, this.disposeWithMe(this._editPopup$);
246
252
  const c = (o, a) => {
247
253
  var d, p;
248
254
  return (p = (d = this._univerInstanceService.getCurrentUnitOfType(K.UNIVER_DOC)) == null ? void 0 : d.getBody()) == null ? void 0 : p.dataStream.slice(o, a);
249
255
  };
250
256
  let u = "";
251
257
  this.filterKeyword$ = this._inputOffset$.pipe(
252
- xe((o) => {
258
+ Oe((o) => {
253
259
  var d;
254
260
  const a = c(o.start, o.end);
255
261
  return (d = a == null ? void 0 : a.slice(1)) != null ? d : "";
256
262
  }),
257
263
  ft(),
258
- j((o) => {
264
+ L((o) => {
259
265
  u = o;
260
266
  })
261
267
  ), this.disposeWithMe(fe([
262
- this.filterKeyword$.pipe(j((o) => {
268
+ this.filterKeyword$.pipe(L((o) => {
263
269
  var a, d, p;
264
270
  o.length > 0 ? (d = (a = this._inputPlaceholderRenderRoot) == null ? void 0 : a.unmount) == null || d.dispose() : (p = this._inputPlaceholderRenderRoot) == null || p.mount();
265
271
  })),
266
- this.isComposing$.pipe(j((o) => {
272
+ this.isComposing$.pipe(L((o) => {
267
273
  var a, d, p;
268
274
  o ? (d = (a = this._inputPlaceholderRenderRoot) == null ? void 0 : a.unmount) == null || d.dispose() : u.length <= 0 && ((p = this._inputPlaceholderRenderRoot) == null || p.mount());
269
275
  })),
270
- this.editPopup$.pipe(j((o) => {
276
+ this.editPopup$.pipe(L((o) => {
271
277
  var a, d;
272
278
  o || ((d = (a = this._inputPlaceholderRenderRoot) == null ? void 0 : a.unmount) == null || d.dispose(), this._inputPlaceholderRenderRoot = null);
273
279
  }))
@@ -292,11 +298,11 @@ let S = class extends X {
292
298
  this._inputOffset$.next(e);
293
299
  }
294
300
  getDocEventManagerService(e) {
295
- var i;
296
- return (i = this._renderManagerService.getRenderById(e)) == null ? void 0 : i.with(Oe);
301
+ var r;
302
+ return (r = this._renderManagerService.getRenderById(e)) == null ? void 0 : r.with(xe);
297
303
  }
298
304
  resolvePopup(e) {
299
- return Array.from(this._popups).find((i) => i.keyword === e);
305
+ return Array.from(this._popups).find((r) => r.keyword === e);
300
306
  }
301
307
  registerPopup(e) {
302
308
  return this._popups.add(e), () => {
@@ -321,47 +327,47 @@ let S = class extends X {
321
327
  }
322
328
  showPopup(e) {
323
329
  var d, p;
324
- const { popup: i, index: n, unitId: r } = e;
330
+ const { popup: r, index: n, unitId: i } = e;
325
331
  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);
332
+ const s = this._univerInstanceService.getUnit(i), c = (p = (d = s == null ? void 0 : s.getBody()) == null ? void 0 : d.paragraphs) == null ? void 0 : p.find((v) => v.startIndex > n);
327
333
  if (!c)
328
334
  return;
329
- const u = this.getDocEventManagerService(r), o = u == null ? void 0 : u.findParagraphBoundByIndex(c.startIndex);
335
+ const u = this.getDocEventManagerService(i), o = u == null ? void 0 : u.findParagraphBoundByIndex(c.startIndex);
330
336
  if (!o)
331
337
  return;
332
338
  this._inputPlaceholderRenderRoot = this._createInputPlaceholderRenderRoot(() => {
333
339
  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);
340
+ const v = ($ = this._renderManagerService.getRenderById(i)) == null ? void 0 : $.with(mt), S = this._docSelectionManagerService.getActiveTextRange();
341
+ if (!v || !S)
342
+ return _e;
343
+ const P = v.getSkeleton().findNodeByCharIndex(S.startOffset, S.segmentId, S.segmentPage);
338
344
  if (!((P == null ? void 0 : P.content) === "\r"))
339
- return Ce;
340
- const R = this._docCanvasPopupManagerService.attachPopupToRange(
345
+ return _e;
346
+ const k = this._docCanvasPopupManagerService.attachPopupToRange(
341
347
  { startOffset: n + 1, endOffset: n + 1, collapsed: !1 },
342
348
  {
343
- componentKey: V.componentKey,
349
+ componentKey: q.componentKey,
344
350
  onClickOutside: () => {
345
- R.dispose();
351
+ k.dispose();
346
352
  },
347
353
  direction: "horizontal"
348
354
  },
349
- r
355
+ i
350
356
  );
351
- return R;
357
+ return k;
352
358
  }), this._inputPlaceholderRenderRoot.mount();
353
359
  const a = this._docCanvasPopupManagerService.attachPopupToRect(
354
360
  o.firstLine,
355
361
  {
356
- componentKey: z.componentKey,
362
+ componentKey: V.componentKey,
357
363
  onClickOutside: () => {
358
364
  this.closePopup();
359
365
  },
360
366
  direction: "bottom"
361
367
  },
362
- r
368
+ i
363
369
  );
364
- this._editPopup$.next({ disposable: a, popup: i, anchor: n, unitId: r });
370
+ this._editPopup$.next({ disposable: a, popup: r, anchor: n, unitId: i });
365
371
  }
366
372
  closePopup() {
367
373
  this.editPopup && (this.editPopup.disposable.dispose(), this._editPopup$.next(null));
@@ -372,43 +378,43 @@ let S = class extends X {
372
378
  };
373
379
  }
374
380
  emitMenuSelected(e) {
375
- const { start: i, end: n } = this.inputOffset;
376
- this._commandService.syncExecuteCommand(Me.id, {
377
- start: i,
381
+ const { start: r, end: n } = this.inputOffset;
382
+ this._commandService.syncExecuteCommand(be.id, {
383
+ start: r,
378
384
  end: n
379
385
  }), setTimeout(() => {
380
- this._menuSelectedCallbacks.forEach((r) => r(e));
386
+ this._menuSelectedCallbacks.forEach((i) => i(e));
381
387
  }, 0);
382
388
  }
383
389
  };
384
- S = bt([
385
- N(0, f(Pe)),
386
- N(1, f(le)),
387
- N(2, f(H)),
388
- N(3, f(he)),
389
- N(4, f(ve))
390
- ], S);
391
- const Re = "doc.quick-insert.button";
392
- var wt = Object.getOwnPropertyDescriptor, Rt = (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);
390
+ y = wt([
391
+ E(0, f(Pe)),
392
+ E(1, f(le)),
393
+ E(2, f(H)),
394
+ E(3, f(he)),
395
+ E(4, f(ve))
396
+ ], y);
397
+ const ke = "doc.quick-insert.button";
398
+ var kt = Object.getOwnPropertyDescriptor, Rt = (t, e, r, n) => {
399
+ for (var i = n > 1 ? void 0 : n ? kt(e, r) : e, s = t.length - 1, c; s >= 0; s--)
400
+ (c = t[s]) && (i = c(i) || i);
401
+ return i;
402
+ }, re = (t, e) => (r, n) => e(r, n, t);
397
403
  let F = class extends X {
398
- constructor(e, i, n, r) {
404
+ constructor(e, r, n, i) {
399
405
  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();
406
+ C(this, "_popup$", new A(null));
407
+ C(this, "popup$", this._popup$.asObservable());
408
+ this._context = e, this._docEventManagerService = r, this._docQuickInsertPopupService = n, this._docCanvasPopManagerService = i, this._init();
403
409
  }
404
410
  get popup() {
405
411
  return this._popup$.value;
406
412
  }
407
413
  _init() {
408
- this.disposeWithMe(fe([this._docEventManagerService.hoverParagraphLeftRealTime$, this._docEventManagerService.hoverParagraphRealTime$]).subscribe(([e, i]) => {
414
+ this.disposeWithMe(fe([this._docEventManagerService.hoverParagraphLeftRealTime$, this._docEventManagerService.hoverParagraphRealTime$]).subscribe(([e, r]) => {
409
415
  var s;
410
- const n = e != null ? e : i, r = this._context.unit.getDisabled();
411
- if (!n || r) {
416
+ const n = e != null ? e : r, i = this._context.unit.getDisabled();
417
+ if (!n || i) {
412
418
  this._hideMenu(!0);
413
419
  return;
414
420
  }
@@ -416,7 +422,7 @@ let F = class extends X {
416
422
  if (this._docQuickInsertPopupService.editPopup || n.startIndex === ((s = this.popup) == null ? void 0 : s.startIndex)) return;
417
423
  this._hideMenu(!0);
418
424
  const c = this._docCanvasPopManagerService.attachPopupToRect(n.firstLine, {
419
- componentKey: Re,
425
+ componentKey: ke,
420
426
  direction: "left-center"
421
427
  }, this._context.unit.getUnitId());
422
428
  this._popup$.next({
@@ -432,70 +438,70 @@ let F = class extends X {
432
438
  }
433
439
  };
434
440
  F = Rt([
435
- ie(1, f(Oe)),
436
- ie(2, f(S)),
437
- ie(3, f(Pe))
441
+ re(1, f(xe)),
442
+ re(2, f(y)),
443
+ re(3, f(Pe))
438
444
  ], F);
439
- const ke = {
445
+ const Re = {
440
446
  id: "quick-insert.text.menu",
441
447
  title: "docQuickInsert.menu.text",
442
- icon: "TextSingle",
448
+ icon: "TextIcon",
443
449
  keywords: ["text"]
444
450
  }, De = {
445
451
  id: st.id,
446
452
  title: "docQuickInsert.menu.numberedList",
447
- icon: "OrderSingle",
453
+ icon: "OrderIcon",
448
454
  keywords: ["numbered", "list", "ordered"]
449
455
  }, $e = {
450
456
  id: ot.id,
451
457
  title: "docQuickInsert.menu.bulletedList",
452
- icon: "UnorderSingle",
458
+ icon: "UnorderIcon",
453
459
  keywords: ["bulleted", "list", "unordered"]
454
- }, Ee = {
460
+ }, Ne = {
455
461
  id: ct.id,
456
462
  title: "docQuickInsert.menu.divider",
457
- icon: "DividerSingle",
463
+ icon: "DividerIcon",
458
464
  keywords: ["divider", "line", "separate"]
459
- }, Ne = {
465
+ }, Ee = {
460
466
  id: at.id,
461
467
  title: "docQuickInsert.menu.table",
462
- icon: "GridSingle",
468
+ icon: "GridIcon",
463
469
  keywords: ["table", "grid", "spreadsheet"]
464
470
  }, Te = {
465
471
  id: Je.id,
466
472
  title: "docQuickInsert.menu.image",
467
- icon: "addition-and-subtraction-single",
473
+ icon: "AdditionAndSubtractionIcon",
468
474
  keywords: ["image", "picture", "photo"]
469
- }, kt = [
475
+ }, Dt = [
470
476
  {
471
477
  title: "docQuickInsert.group.basics",
472
478
  id: "quick.insert.group.basic",
473
479
  children: [
474
- ke,
480
+ Re,
475
481
  De,
476
482
  $e,
477
- Ee,
478
483
  Ne,
484
+ Ee,
479
485
  Te
480
486
  ]
481
487
  }
482
- ], Dt = /* @__PURE__ */ new Set([
488
+ ], $t = /* @__PURE__ */ new Set([
483
489
  De.id,
484
490
  $e.id,
485
- Ee.id,
486
491
  Ne.id,
492
+ Ee.id,
487
493
  Te.id
488
494
  ]);
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);
495
+ var Nt = Object.getOwnPropertyDescriptor, Et = (t, e, r, n) => {
496
+ for (var i = n > 1 ? void 0 : n ? Nt(e, r) : e, s = t.length - 1, c; s >= 0; s--)
497
+ (c = t[s]) && (i = c(i) || i);
498
+ return i;
499
+ }, T = (t, e) => (r, n) => e(r, n, t);
494
500
  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({
501
+ constructor(t, e, r, n, i) {
502
+ super(), this._commandService = t, this._textSelectionManagerService = e, this._docQuickInsertPopupService = r, this._shortcutService = n, this._univerInstanceService = i, this.disposeWithMe(this._shortcutService.registerShortcut({
497
503
  id: Q.id,
498
- binding: b.ESC,
504
+ binding: M.ESC,
499
505
  preconditions: () => !!this._docQuickInsertPopupService.editPopup,
500
506
  priority: 1e3
501
507
  })), this._initTrigger(), this._initMenuHandler();
@@ -506,8 +512,8 @@ let G = class extends X {
506
512
  // eslint-disable-next-line complexity, max-lines-per-function
507
513
  this._commandService.onCommandExecuted((t) => {
508
514
  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())) {
515
+ const { _docQuickInsertPopupService: e, _textSelectionManagerService: r, _commandService: n } = this, i = this._univerInstanceService.getCurrentUnitOfType(K.UNIVER_DOC);
516
+ if (!(i != null && i.getDisabled())) {
511
517
  if (t.id === dt.id) {
512
518
  const o = t.params;
513
519
  if (e.editPopup) {
@@ -517,14 +523,14 @@ let G = class extends X {
517
523
  });
518
524
  return;
519
525
  }
520
- const a = i.getActiveTextRange();
526
+ const a = r.getActiveTextRange();
521
527
  if (!a)
522
528
  return;
523
529
  const d = e.resolvePopup(o.body.dataStream);
524
530
  if (!d || !(d.preconditions ? d.preconditions(o) : !0))
525
531
  return;
526
532
  e.setInputOffset({ start: a.startOffset - 1, end: a.startOffset }), setTimeout(() => {
527
- n.executeCommand(be.id, {
533
+ n.executeCommand(Me.id, {
528
534
  index: a.startOffset - 1,
529
535
  unitId: o.unitId,
530
536
  popup: d
@@ -544,7 +550,7 @@ let G = class extends X {
544
550
  }
545
551
  if (t.id === pt.id) {
546
552
  const o = t.params;
547
- if (e.editPopup && o.direction === qe.LEFT) {
553
+ if (e.editPopup && o.direction === Ze.LEFT) {
548
554
  const a = (u = o.len) != null ? u : 0;
549
555
  e.setInputOffset({ start: e.inputOffset.start, end: o.range.endOffset - a });
550
556
  }
@@ -554,7 +560,7 @@ let G = class extends X {
554
560
  (o.direction === W.LEFT || o.direction === W.RIGHT) && e.editPopup && n.executeCommand(Q.id);
555
561
  }
556
562
  if (t.id === ht.id) {
557
- const o = i.getActiveTextRange();
563
+ const o = r.getActiveTextRange();
558
564
  if (!e.editPopup || !o)
559
565
  return;
560
566
  o.endOffset <= e.editPopup.anchor && n.executeCommand(Q.id);
@@ -565,97 +571,97 @@ let G = class extends X {
565
571
  }
566
572
  _initMenuHandler() {
567
573
  this.disposeWithMe(this._docQuickInsertPopupService.onMenuSelected((t) => {
568
- t.id !== ke.id && Dt.has(t.id) && this._commandService.executeCommand(t.id);
574
+ t.id !== Re.id && $t.has(t.id) && this._commandService.executeCommand(t.id);
569
575
  }));
570
576
  }
571
577
  };
572
578
  G = Et([
573
579
  T(0, H),
574
580
  T(1, f(ve)),
575
- T(2, f(S)),
576
- T(3, f(ye)),
581
+ T(2, f(y)),
582
+ T(3, f(Se)),
577
583
  T(4, f(le))
578
584
  ], 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]);
585
+ var _ = function() {
586
+ return _ = Object.assign || function(t) {
587
+ for (var e, r = 1, n = arguments.length; r < n; r++) {
588
+ e = arguments[r];
589
+ for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
584
590
  }
585
591
  return t;
586
- }, C.apply(this, arguments);
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]);
592
+ }, _.apply(this, arguments);
593
+ }, Tt = function(t, e) {
594
+ var r = {};
595
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (r[n] = t[n]);
590
596
  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;
597
+ for (var i = 0, n = Object.getOwnPropertySymbols(t); i < n.length; i++)
598
+ e.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[i]) && (r[n[i]] = t[n[i]]);
599
+ return r;
594
600
  }, 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);
601
+ var r = t.icon, n = t.id, i = t.className, s = t.extend, c = Tt(t, ["icon", "id", "className", "extend"]), u = "univerjs-icon univerjs-icon-".concat(n, " ").concat(i || "").trim(), o = B("_".concat(Ht()));
602
+ return Ue(r, "".concat(n), { defIds: r.defIds, idSuffix: o.current }, _({ ref: e, className: u }, c), s);
597
603
  });
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);
604
+ function Ue(t, e, r, n, i) {
605
+ return ee(t.tag, _(_({ key: e }, Ut(t, r, i)), n), (Qt(t, r).children || []).map(function(s, c) {
606
+ return Ue(s, "".concat(e, "-").concat(t.tag, "-").concat(c), r, void 0, i);
601
607
  }));
602
608
  }
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) {
609
+ function Ut(t, e, r) {
610
+ var n = _({}, t.attrs);
611
+ 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(s) {
606
612
  var c = s[0], u = s[1];
607
613
  c === "mask" && typeof u == "string" && (n[c] = u.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
608
614
  });
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) {
615
+ var i = e.defIds;
616
+ return !i || i.length === 0 || (t.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + e.idSuffix), Object.entries(n).forEach(function(s) {
611
617
  var c = s[0], u = s[1];
612
618
  typeof u == "string" && (n[c] = u.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
613
619
  })), n;
614
620
  }
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;
621
+ function Qt(t, e) {
622
+ var r, n = e.defIds;
623
+ 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) {
624
+ return typeof i.attrs.id == "string" && n && n.includes(i.attrs.id) ? _(_({}, i), { attrs: _(_({}, i.attrs), { id: i.attrs.id + e.idSuffix }) }) : i;
619
625
  }) }) : t;
620
626
  }
621
- function Qt() {
627
+ function Ht() {
622
628
  return Math.random().toString(36).substring(2, 8);
623
629
  }
624
630
  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) {
631
+ 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: "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
632
  return ee(te, Object.assign({}, t, {
627
- id: "divider-single",
633
+ id: "divider-icon",
628
634
  ref: e,
629
- icon: Ht
635
+ icon: Kt
630
636
  }));
631
637
  });
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) {
638
+ ae.displayName = "DividerIcon";
639
+ var Lt = { 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
640
  return ee(te, Object.assign({}, t, {
635
- id: "plus-single",
641
+ id: "increase-icon",
636
642
  ref: e,
637
- icon: Kt
643
+ icon: Lt
638
644
  }));
639
645
  });
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) {
646
+ Qe.displayName = "IncreaseIcon";
647
+ var jt = { 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
648
  return ee(te, Object.assign({}, t, {
643
- id: "text-single",
649
+ id: "text-icon",
644
650
  ref: e,
645
651
  icon: jt
646
652
  }));
647
653
  });
648
- de.displayName = "TextSingle";
654
+ de.displayName = "TextIcon";
649
655
  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) => {
656
+ const e = I(y), r = I(le), n = I(he), i = U(oe(() => r.getCurrentTypeOfUnit$(K.UNIVER_DOC), [r])), s = i && n.getRenderById(i.getUnitId()), c = s == null ? void 0 : s.with(F), u = I(tt), o = I(ve), a = U(e.editPopup$), d = nt((p) => {
651
657
  var P;
652
658
  const v = c == null ? void 0 : c.popup;
653
659
  if (!v)
654
660
  return;
655
- const y = e.popups, w = {
661
+ const S = e.popups, w = {
656
662
  keyword: "",
657
- menus$: fe(y.map((O) => O.menus$)).pipe(
658
- xe((O) => O.flat())
663
+ menus$: fe(S.map((x) => x.menus$)).pipe(
664
+ Oe((x) => x.flat())
659
665
  )
660
666
  };
661
667
  o.replaceDocRanges([{
@@ -664,7 +670,7 @@ const ue = ({ className: t = "" }) => {
664
670
  }]), e.setInputOffset({ start: v.startIndex - 1, end: v.startIndex - 1 }), e.showPopup({
665
671
  popup: w,
666
672
  index: v.startIndex - 1,
667
- unitId: (P = r == null ? void 0 : r.getUnitId()) != null ? P : ""
673
+ unitId: (P = i == null ? void 0 : i.getUnitId()) != null ? P : ""
668
674
  }), setTimeout(() => {
669
675
  u.focus();
670
676
  });
@@ -672,31 +678,36 @@ const ue = ({ className: t = "" }) => {
672
678
  return /* @__PURE__ */ h(
673
679
  "div",
674
680
  {
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 hover:univer-bg-gray-100", yt, {
676
- "univer-bg-gray-100": a,
677
- "univer-bg-white": !a
681
+ 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", Pt, {
682
+ "univer-bg-gray-100 dark:!univer-bg-gray-700": a,
683
+ "univer-bg-white dark:!univer-bg-gray-900": !a
678
684
  }, t),
679
685
  role: "button",
680
686
  tabIndex: 0,
681
687
  onClick: d,
682
- children: /* @__PURE__ */ h(Qe, { className: "univer-text-gray-800" })
688
+ children: /* @__PURE__ */ h(
689
+ Qe,
690
+ {
691
+ className: "univer-text-gray-800 dark:!univer-text-gray-200"
692
+ }
693
+ )
683
694
  }
684
695
  );
685
696
  };
686
- ue.componentKey = Re;
687
- var Lt = Object.getOwnPropertyDescriptor, At = (t, e, i, n) => {
688
- for (var r = n > 1 ? void 0 : n ? Lt(e, i) : e, s = t.length - 1, c; s >= 0; s--)
689
- (c = t[s]) && (r = c(r) || r);
690
- return r;
691
- }, re = (t, e) => (i, n) => e(i, n, t);
692
- let Z = class extends X {
693
- constructor(t, e, i) {
694
- super(), this._commandService = t, this._docQuickInsertPopupService = e, this._componentManager = i, this._initCommands(), this._initComponents(), this._initMenus();
697
+ ue.componentKey = ke;
698
+ var At = Object.getOwnPropertyDescriptor, Bt = (t, e, r, n) => {
699
+ for (var i = n > 1 ? void 0 : n ? At(e, r) : e, s = t.length - 1, c; s >= 0; s--)
700
+ (c = t[s]) && (i = c(i) || i);
701
+ return i;
702
+ }, ie = (t, e) => (r, n) => e(r, n, t);
703
+ let z = class extends X {
704
+ constructor(t, e, r) {
705
+ super(), this._commandService = t, this._docQuickInsertPopupService = e, this._componentManager = r, this._initCommands(), this._initComponents(), this._initMenus();
695
706
  }
696
707
  _initCommands() {
697
708
  [
698
- Me,
699
709
  be,
710
+ Me,
700
711
  Q
701
712
  ].forEach((t) => {
702
713
  this.disposeWithMe(this._commandService.registerCommand(t));
@@ -704,22 +715,22 @@ let Z = class extends X {
704
715
  }
705
716
  _initComponents() {
706
717
  [
707
- [z.componentKey, z],
708
718
  [V.componentKey, V],
709
719
  [q.componentKey, q],
720
+ [Z.componentKey, Z],
710
721
  [ae.displayName, ae],
711
722
  [de.displayName, de],
712
723
  [ue.componentKey, ue]
713
- ].forEach(([e, i]) => {
714
- e && this.disposeWithMe(this._componentManager.register(e, i));
724
+ ].forEach(([e, r]) => {
725
+ e && this.disposeWithMe(this._componentManager.register(e, r));
715
726
  }), [
716
727
  {
717
728
  keyword: "/",
718
- menus$: vt(kt),
729
+ menus$: vt(Dt),
719
730
  // only show when the cursor is at the beginning of a line
720
731
  preconditions: (e) => {
721
- var i;
722
- return ((i = e.range.startNodePosition) == null ? void 0 : i.glyph) === 0;
732
+ var r;
733
+ return ((r = e.range.startNodePosition) == null ? void 0 : r.glyph) === 0;
723
734
  }
724
735
  }
725
736
  ].forEach((e) => {
@@ -729,30 +740,30 @@ let Z = class extends X {
729
740
  _initMenus() {
730
741
  }
731
742
  };
732
- Z = At([
733
- re(0, H),
734
- re(1, f(S)),
735
- re(2, f(Se))
736
- ], Z);
737
- 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) => {
738
- for (var r = n > 1 ? void 0 : n ? Wt(e, i) : e, s = t.length - 1, c; s >= 0; s--)
739
- (c = t[s]) && (r = c(r) || r);
740
- return r;
741
- }, Ie = (t, e) => (i, n) => e(i, n, t), He = (t, e, i) => Vt(t, typeof e != "symbol" ? e + "" : e, i);
742
- const zt = "DOC_QUICK_INSERT_UI_PLUGIN";
743
+ z = Bt([
744
+ ie(0, H),
745
+ ie(1, f(y)),
746
+ ie(2, f(ye))
747
+ ], z);
748
+ var Wt = Object.defineProperty, qt = Object.getOwnPropertyDescriptor, Zt = (t, e, r) => e in t ? Wt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Vt = (t, e, r, n) => {
749
+ for (var i = n > 1 ? void 0 : n ? qt(e, r) : e, s = t.length - 1, c; s >= 0; s--)
750
+ (c = t[s]) && (i = c(i) || i);
751
+ return i;
752
+ }, Ie = (t, e) => (r, n) => e(r, n, t), He = (t, e, r) => Zt(t, typeof e != "symbol" ? e + "" : e, r);
753
+ const Ft = "DOC_QUICK_INSERT_UI_PLUGIN";
743
754
  let J = class extends Ge {
744
755
  constructor(t, e) {
745
756
  super(), this._injector = t, this._renderManagerSrv = e;
746
757
  }
747
758
  onStarting() {
748
759
  [
749
- [Z],
760
+ [z],
750
761
  [G],
751
- [S]
752
- ].forEach((e) => this._injector.add(e)), this._injector.get(Z);
762
+ [y]
763
+ ].forEach((e) => this._injector.add(e)), this._injector.get(z);
753
764
  }
754
765
  onRendered() {
755
- this._injector.get(G), this._injector.get(S), [
766
+ this._injector.get(G), this._injector.get(y), [
756
767
  [F]
757
768
  ].forEach((t) => {
758
769
  this._renderManagerSrv.registerRenderModule(K.UNIVER_DOC, t);
@@ -760,17 +771,17 @@ let J = class extends Ge {
760
771
  }
761
772
  };
762
773
  He(J, "type", K.UNIVER_DOC);
763
- He(J, "pluginName", zt);
764
- J = qt([
765
- ze(et, Ye, Xe, Ze, it),
774
+ He(J, "pluginName", Ft);
775
+ J = Vt([
776
+ Ve(et, Ye, Xe, ze, rt),
766
777
  Ie(0, f(Fe)),
767
778
  Ie(1, f(he))
768
779
  ], J);
769
780
  export {
770
- S as DocQuickInsertPopupService,
781
+ y as DocQuickInsertPopupService,
771
782
  G as DocQuickInsertTriggerController,
772
- Z as DocQuickInsertUIController,
773
- Pt as KeywordInputPlaceholderComponentKey,
783
+ z as DocQuickInsertUIController,
784
+ xt as KeywordInputPlaceholderComponentKey,
774
785
  Ot as QuickInsertPlaceholderComponentKey,
775
786
  J as UniverDocsQuickInsertUIPlugin
776
787
  };