@univerjs/docs-quick-insert-ui 0.6.7 → 0.6.9-nightly.202504021607
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/cjs/index.js +7 -5
- package/lib/es/index.js +420 -345
- package/lib/index.css +1 -1
- package/lib/index.js +668 -0
- package/lib/locale/en-US.js +18 -0
- package/lib/locale/fa-IR.js +18 -0
- package/lib/locale/fr-FR.js +18 -0
- package/lib/locale/ru-RU.js +18 -0
- package/lib/locale/vi-VN.js +18 -0
- package/lib/locale/zh-CN.js +18 -0
- package/lib/locale/zh-TW.js +18 -0
- package/lib/types/controllers/doc-quick-insert-trigger.controller.d.ts +3 -2
- package/lib/types/services/doc-quick-insert-popup.service.d.ts +9 -1
- package/lib/umd/index.js +7 -5
- package/package.json +13 -13
- package/LICENSE +0 -176
package/lib/es/index.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { CommandType as
|
|
5
|
-
import { UniverDocsDrawingPlugin as
|
|
6
|
-
import { UniverDrawingPlugin as
|
|
7
|
-
import { UniverDrawingUIPlugin as
|
|
8
|
-
import { useDependency as O, KeyCode as y, ComponentManager as
|
|
9
|
-
import { DocSelectionManagerService as
|
|
10
|
-
import { CutContentCommand as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
1
|
+
var Me = Object.defineProperty;
|
|
2
|
+
var we = (t, e, i) => e in t ? Me(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i;
|
|
3
|
+
var _ = (t, e, i) => we(t, typeof e != "symbol" ? e + "" : e, i);
|
|
4
|
+
import { CommandType as x, ICommandService as N, RANGE_DIRECTION as Re, LocaleService as X, generateRandomId as ke, DisposableCollection as Ne, toDisposable as De, Direction as T, Inject as g, IUniverInstanceService as pe, Disposable as Y, UniverInstanceType as ee, DeleteDirection as Ee, DependentOn as $e, Injector as Te, Plugin as He } from "@univerjs/core";
|
|
5
|
+
import { UniverDocsDrawingPlugin as Ue } from "@univerjs/docs-drawing";
|
|
6
|
+
import { UniverDrawingPlugin as Ke } from "@univerjs/drawing";
|
|
7
|
+
import { UniverDrawingUIPlugin as Qe } from "@univerjs/drawing-ui";
|
|
8
|
+
import { useDependency as O, KeyCode as y, ComponentManager as fe, IShortcutService as he, useObservable as B, UniverUIPlugin as je } from "@univerjs/ui";
|
|
9
|
+
import { DocSelectionManagerService as me, DocSkeletonManagerService as Ae, RichTextEditingMutation as Le } from "@univerjs/docs";
|
|
10
|
+
import { CutContentCommand as We, DocCanvasPopManagerService as qe, OrderListCommand as ze, BulletListCommand as Be, HorizontalLineCommand as Ve, InsertCommand as Fe, IMEInputCommand as Ge, DeleteCommand as Ze, MoveCursorOperation as Je, DeleteLeftCommand as Xe } from "@univerjs/docs-ui";
|
|
11
|
+
import { IRenderManagerService as Ye } from "@univerjs/engine-render";
|
|
12
|
+
import { map as et, distinctUntilChanged as tt, tap as D, combineLatest as nt, BehaviorSubject as V, of as it } from "rxjs";
|
|
13
|
+
import { jsx as f, jsxs as ce } from "react/jsx-runtime";
|
|
14
|
+
import { clsx as ae, Menu as rt, MenuItemGroup as st, MenuItem as ot, Tooltip as ct } from "@univerjs/design";
|
|
15
|
+
import { useMemo as de, useState as ue, useRef as $, useEffect as E, forwardRef as te, createElement as ne } from "react";
|
|
16
|
+
const ve = {
|
|
16
17
|
id: "doc.command.delete-search-key",
|
|
17
|
-
type:
|
|
18
|
+
type: x.COMMAND,
|
|
18
19
|
handler: (t, e) => {
|
|
19
|
-
const
|
|
20
|
-
return
|
|
20
|
+
const i = t.get(N), { start: n, end: r } = e;
|
|
21
|
+
return i.syncExecuteCommand(We.id, {
|
|
21
22
|
segmentId: "",
|
|
22
23
|
textRanges: [{
|
|
23
24
|
startOffset: n,
|
|
@@ -26,221 +27,269 @@ const pe = {
|
|
|
26
27
|
}],
|
|
27
28
|
selections: [{
|
|
28
29
|
startOffset: n,
|
|
29
|
-
endOffset:
|
|
30
|
+
endOffset: r,
|
|
30
31
|
collapsed: !1,
|
|
31
|
-
direction:
|
|
32
|
+
direction: Re.FORWARD
|
|
32
33
|
}]
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
|
-
},
|
|
36
|
-
const t = O(
|
|
37
|
-
return /* @__PURE__ */
|
|
36
|
+
}, at = "docs.quick.insert.keyword-input-placeholder", H = () => {
|
|
37
|
+
const t = O(X);
|
|
38
|
+
return /* @__PURE__ */ f("div", { className: "univer-translate-y-1.5 univer-text-sm univer-text-gray-500", children: t.t("docQuickInsert.keywordInputPlaceholder") });
|
|
38
39
|
};
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
const t = O(
|
|
42
|
-
return /* @__PURE__ */
|
|
40
|
+
H.componentKey = at;
|
|
41
|
+
const dt = "docs.quick.insert.placeholder", U = () => {
|
|
42
|
+
const t = O(X);
|
|
43
|
+
return /* @__PURE__ */ f(
|
|
43
44
|
"div",
|
|
44
45
|
{
|
|
45
46
|
className: `
|
|
46
47
|
univer-flex univer-h-full univer-items-center univer-justify-center univer-rounded-lg univer-bg-white
|
|
47
48
|
univer-px-12 univer-py-6 univer-text-gray-400
|
|
48
49
|
`,
|
|
49
|
-
children: /* @__PURE__ */
|
|
50
|
+
children: /* @__PURE__ */ f("span", { children: t.t("docQuickInsert.placeholder") })
|
|
50
51
|
}
|
|
51
52
|
);
|
|
52
53
|
};
|
|
53
|
-
|
|
54
|
-
function
|
|
55
|
-
return t.map((
|
|
56
|
-
if ("children" in
|
|
57
|
-
return
|
|
58
|
-
const n =
|
|
59
|
-
return n ? n.some((
|
|
54
|
+
U.componentKey = dt;
|
|
55
|
+
function G(t, e) {
|
|
56
|
+
return t.map((i) => ({ ...i })).filter((i) => {
|
|
57
|
+
if ("children" in i)
|
|
58
|
+
return i.children = G(i.children, e), i.children.length > 0;
|
|
59
|
+
const n = i.keywords;
|
|
60
|
+
return n ? n.some((r) => r.includes(e)) : i.title.toLowerCase().includes(e);
|
|
60
61
|
});
|
|
61
62
|
}
|
|
62
|
-
function
|
|
63
|
-
return t.map((
|
|
64
|
-
const n = { ...
|
|
65
|
-
return "children" in n && (n.children =
|
|
63
|
+
function ge(t, e) {
|
|
64
|
+
return t.map((i) => {
|
|
65
|
+
const n = { ...i };
|
|
66
|
+
return "children" in n && (n.children = ge(n.children, e)), n.title = e.t(n.title), "keywords" in n && (n.keywords = n.keywords.concat(n.title).map((r) => r.toLowerCase())), n;
|
|
66
67
|
});
|
|
67
68
|
}
|
|
68
|
-
const
|
|
69
|
-
const t = O(
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
|
|
69
|
+
const ut = [y.ARROW_UP, y.ARROW_DOWN, y.ENTER], K = () => {
|
|
70
|
+
const t = O(X), e = O(C), i = O(fe), n = O(he), r = O(N), o = de(() => ke(), []), [a, d] = ue(0), s = $(null), c = $(0);
|
|
71
|
+
c.current = 0;
|
|
72
|
+
const u = B(e.filterKeyword$, ""), p = B(e.editPopup$), b = B(p == null ? void 0 : p.popup.menus$, []), L = de(() => ge(b, t), [b]), [W, xe] = ue(() => G(L, u.toLowerCase()));
|
|
73
|
+
E(() => {
|
|
74
|
+
const h = requestIdleCallback(() => {
|
|
75
|
+
xe(G(L, u.toLowerCase()));
|
|
75
76
|
});
|
|
76
77
|
return () => {
|
|
77
|
-
cancelIdleCallback(
|
|
78
|
+
cancelIdleCallback(h);
|
|
78
79
|
};
|
|
79
|
-
}, [
|
|
80
|
-
const
|
|
81
|
-
e.emitMenuSelected(
|
|
80
|
+
}, [L, u]);
|
|
81
|
+
const re = (h) => {
|
|
82
|
+
e.emitMenuSelected(h), r.executeCommand(k.id);
|
|
82
83
|
};
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
n.getAllShortcuts().filter((l) => l.binding &&
|
|
86
|
-
const
|
|
87
|
-
l.preconditions = () => !1,
|
|
88
|
-
l.preconditions =
|
|
84
|
+
E(() => {
|
|
85
|
+
const h = new Ne();
|
|
86
|
+
n.getAllShortcuts().filter((l) => l.binding && ut.includes(l.binding)).forEach((l) => {
|
|
87
|
+
const I = l.preconditions;
|
|
88
|
+
l.preconditions = () => !1, h.add(De(() => {
|
|
89
|
+
l.preconditions = I;
|
|
89
90
|
}));
|
|
90
91
|
});
|
|
91
|
-
const
|
|
92
|
+
const S = {
|
|
92
93
|
id: `quick.insert.popup.enter.${o}`,
|
|
93
|
-
type:
|
|
94
|
+
type: x.OPERATION,
|
|
94
95
|
handler: () => {
|
|
95
|
-
const l =
|
|
96
|
-
l &&
|
|
96
|
+
const l = s.current;
|
|
97
|
+
l && re(l);
|
|
97
98
|
}
|
|
98
|
-
},
|
|
99
|
+
}, M = {
|
|
99
100
|
id: `quick.insert.popup.move.cursor.up.${o}`,
|
|
100
|
-
type:
|
|
101
|
+
type: x.OPERATION,
|
|
101
102
|
handler: () => {
|
|
102
|
-
|
|
103
|
-
const
|
|
104
|
-
return
|
|
103
|
+
d((l) => {
|
|
104
|
+
const I = l - 1;
|
|
105
|
+
return I >= 0 ? I : c.current - 1;
|
|
105
106
|
});
|
|
106
107
|
}
|
|
107
108
|
}, P = {
|
|
108
109
|
id: `quick.insert.popup.move.cursor.down.${o}`,
|
|
109
|
-
type:
|
|
110
|
+
type: x.OPERATION,
|
|
110
111
|
handler: () => {
|
|
111
|
-
|
|
112
|
-
const
|
|
113
|
-
return
|
|
112
|
+
d((l) => {
|
|
113
|
+
const I = l + 1;
|
|
114
|
+
return I <= c.current - 1 ? I : 0;
|
|
114
115
|
});
|
|
115
116
|
}
|
|
116
117
|
};
|
|
117
|
-
return
|
|
118
|
+
return h.add(r.registerCommand(M)), h.add(r.registerCommand(P)), h.add(r.registerCommand(S)), h.add(n.registerShortcut({
|
|
118
119
|
priority: 1e3,
|
|
119
|
-
id:
|
|
120
|
+
id: M.id,
|
|
120
121
|
binding: y.ARROW_UP,
|
|
121
122
|
preconditions: () => !0,
|
|
122
123
|
staticParameters: {
|
|
123
|
-
direction:
|
|
124
|
+
direction: T.UP
|
|
124
125
|
}
|
|
125
|
-
})),
|
|
126
|
+
})), h.add(n.registerShortcut({
|
|
126
127
|
priority: 1e3,
|
|
127
128
|
id: P.id,
|
|
128
129
|
binding: y.ARROW_DOWN,
|
|
129
130
|
preconditions: () => !0,
|
|
130
131
|
staticParameters: {
|
|
131
|
-
direction:
|
|
132
|
+
direction: T.DOWN
|
|
132
133
|
}
|
|
133
|
-
})),
|
|
134
|
+
})), h.add(n.registerShortcut({
|
|
134
135
|
priority: 1e3,
|
|
135
|
-
id:
|
|
136
|
+
id: S.id,
|
|
136
137
|
binding: y.ENTER,
|
|
137
138
|
preconditions: () => !0
|
|
138
139
|
})), () => {
|
|
139
|
-
|
|
140
|
+
h.dispose();
|
|
140
141
|
};
|
|
141
|
-
}, []),
|
|
142
|
-
|
|
143
|
-
}, [
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
142
|
+
}, []), E(() => {
|
|
143
|
+
d(0);
|
|
144
|
+
}, [W]);
|
|
145
|
+
const q = $(/* @__PURE__ */ new Map());
|
|
146
|
+
E(() => () => {
|
|
147
|
+
q.current.clear();
|
|
148
|
+
}, []);
|
|
149
|
+
function se(h) {
|
|
150
|
+
return h.map((m) => {
|
|
151
|
+
const z = m.icon, S = z ? i.get(z) : null;
|
|
152
|
+
if ("children" in m)
|
|
153
|
+
return /* @__PURE__ */ f(
|
|
154
|
+
st,
|
|
150
155
|
{
|
|
151
|
-
title: /* @__PURE__ */
|
|
156
|
+
title: /* @__PURE__ */ ce(
|
|
152
157
|
"div",
|
|
153
158
|
{
|
|
154
159
|
className: `
|
|
155
160
|
univer-mb-2 univer-flex univer-items-center univer-text-xs univer-text-gray-400
|
|
156
161
|
`,
|
|
157
162
|
children: [
|
|
158
|
-
|
|
159
|
-
/* @__PURE__ */
|
|
163
|
+
S && /* @__PURE__ */ f("span", { className: "univer-mr-2 univer-inline-flex univer-text-base", children: /* @__PURE__ */ f(S, {}) }),
|
|
164
|
+
/* @__PURE__ */ f("span", { children: m.title })
|
|
160
165
|
]
|
|
161
166
|
}
|
|
162
167
|
),
|
|
163
|
-
children:
|
|
168
|
+
children: se(m.children)
|
|
164
169
|
},
|
|
165
|
-
|
|
170
|
+
m.id
|
|
166
171
|
);
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
|
|
172
|
+
const M = c.current, P = a === M;
|
|
173
|
+
if (P) {
|
|
174
|
+
s.current = m;
|
|
175
|
+
const l = q.current.get(m.id);
|
|
176
|
+
l == null || l.scrollIntoView({
|
|
177
|
+
block: "nearest"
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
return c.current++, /* @__PURE__ */ f(
|
|
181
|
+
ot,
|
|
170
182
|
{
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
183
|
+
ref: (l) => {
|
|
184
|
+
l && q.current.set(m.id, l);
|
|
185
|
+
},
|
|
186
|
+
onMouseEnter: () => d(M),
|
|
187
|
+
onMouseLeave: () => d(Number.NaN),
|
|
188
|
+
className: ae("univer-w-[calc(220px-var(--padding-base)*2)] univer-text-sm", {
|
|
174
189
|
"hover:univer-bg-transparent": !P,
|
|
175
190
|
"univer-bg-gray-100": P
|
|
176
191
|
}),
|
|
177
192
|
onClick: () => {
|
|
178
|
-
|
|
193
|
+
re(m);
|
|
179
194
|
},
|
|
180
|
-
children: /* @__PURE__ */
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
195
|
+
children: /* @__PURE__ */ ce(
|
|
196
|
+
"div",
|
|
197
|
+
{
|
|
198
|
+
className: "univer-flex univer-w-full univer-items-center univer-px-1",
|
|
199
|
+
children: [
|
|
200
|
+
S && /* @__PURE__ */ f("span", { className: "univer-mr-2 univer-inline-flex univer-text-base", children: /* @__PURE__ */ f(S, {}) }),
|
|
201
|
+
/* @__PURE__ */ f(ct, { showIfEllipsis: !0, title: m.title, placement: "right", children: /* @__PURE__ */ f("span", { className: "univer-truncate", children: m.title }) })
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
)
|
|
184
205
|
},
|
|
185
|
-
|
|
206
|
+
m.id
|
|
186
207
|
);
|
|
187
208
|
});
|
|
188
209
|
}
|
|
189
|
-
const
|
|
190
|
-
return /* @__PURE__ */
|
|
210
|
+
const be = W.length > 0, oe = (p == null ? void 0 : p.popup.Placeholder) || i.get(U.componentKey);
|
|
211
|
+
return /* @__PURE__ */ f(
|
|
191
212
|
"div",
|
|
192
213
|
{
|
|
193
|
-
className:
|
|
194
|
-
univer-rounded-lg univer-border univer-border-solid univer-border-gray-100
|
|
214
|
+
className: ae(`
|
|
215
|
+
univer-rounded-lg univer-border univer-border-solid univer-border-gray-100 univer-bg-white
|
|
195
216
|
univer-shadow-[0_0_10px_0_rgba(0,0,0,0.1)]
|
|
196
217
|
`),
|
|
197
|
-
children:
|
|
218
|
+
children: be ? /* @__PURE__ */ f(
|
|
219
|
+
"div",
|
|
220
|
+
{
|
|
221
|
+
className: `
|
|
222
|
+
univer-max-h-[360px] univer-w-[220px] univer-overflow-y-auto univer-overflow-x-hidden
|
|
223
|
+
`,
|
|
224
|
+
children: /* @__PURE__ */ f(rt, { children: se(W) })
|
|
225
|
+
}
|
|
226
|
+
) : oe && /* @__PURE__ */ f(oe, {})
|
|
198
227
|
}
|
|
199
228
|
);
|
|
200
229
|
};
|
|
201
|
-
|
|
202
|
-
var
|
|
203
|
-
for (var
|
|
204
|
-
(
|
|
205
|
-
return
|
|
206
|
-
},
|
|
207
|
-
|
|
208
|
-
|
|
230
|
+
K.componentKey = "docs.quick.insert.popup";
|
|
231
|
+
var lt = Object.getOwnPropertyDescriptor, pt = (t, e, i, n) => {
|
|
232
|
+
for (var r = n > 1 ? void 0 : n ? lt(e, i) : e, o = t.length - 1, a; o >= 0; o--)
|
|
233
|
+
(a = t[o]) && (r = a(r) || r);
|
|
234
|
+
return r;
|
|
235
|
+
}, w = (t, e) => (i, n) => e(i, n, t);
|
|
236
|
+
const le = {
|
|
237
|
+
dispose: () => {
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
let C = class extends Y {
|
|
241
|
+
constructor(e, i, n, r, o) {
|
|
209
242
|
super();
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
this
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
243
|
+
_(this, "_popups", /* @__PURE__ */ new Set());
|
|
244
|
+
_(this, "_editPopup$", new V(void 0));
|
|
245
|
+
_(this, "editPopup$", this._editPopup$.asObservable());
|
|
246
|
+
_(this, "_isComposing$", new V(!1));
|
|
247
|
+
_(this, "isComposing$", this._isComposing$.asObservable());
|
|
248
|
+
_(this, "_inputOffset$", new V({ start: 0, end: 0 }));
|
|
249
|
+
_(this, "inputOffset$", this._inputOffset$.asObservable());
|
|
250
|
+
_(this, "filterKeyword$");
|
|
251
|
+
_(this, "_menuSelectedCallbacks", /* @__PURE__ */ new Set());
|
|
252
|
+
_(this, "_inputPlaceholderRenderRoot", null);
|
|
253
|
+
this._docCanvasPopupManagerService = e, this._univerInstanceService = i, this._commandService = n, this._renderManagerService = r, this._docSelectionManagerService = o, this.disposeWithMe(this._editPopup$);
|
|
254
|
+
const a = (s, c) => {
|
|
255
|
+
var u, p;
|
|
256
|
+
return (p = (u = this._univerInstanceService.getCurrentUnitOfType(ee.UNIVER_DOC)) == null ? void 0 : u.getBody()) == null ? void 0 : p.dataStream.slice(s, c);
|
|
222
257
|
};
|
|
258
|
+
let d = "";
|
|
223
259
|
this.filterKeyword$ = this._inputOffset$.pipe(
|
|
224
|
-
|
|
225
|
-
var
|
|
226
|
-
const c =
|
|
227
|
-
return (
|
|
260
|
+
et((s) => {
|
|
261
|
+
var u;
|
|
262
|
+
const c = a(s.start, s.end);
|
|
263
|
+
return (u = c == null ? void 0 : c.slice(1)) != null ? u : "";
|
|
228
264
|
}),
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
265
|
+
tt(),
|
|
266
|
+
D((s) => {
|
|
267
|
+
d = s;
|
|
268
|
+
})
|
|
269
|
+
), this.disposeWithMe(nt([
|
|
270
|
+
this.filterKeyword$.pipe(D((s) => {
|
|
271
|
+
var c, u, p;
|
|
272
|
+
s.length > 0 ? (u = (c = this._inputPlaceholderRenderRoot) == null ? void 0 : c.unmount) == null || u.dispose() : (p = this._inputPlaceholderRenderRoot) == null || p.mount();
|
|
273
|
+
})),
|
|
274
|
+
this.isComposing$.pipe(D((s) => {
|
|
275
|
+
var c, u, p;
|
|
276
|
+
s ? (u = (c = this._inputPlaceholderRenderRoot) == null ? void 0 : c.unmount) == null || u.dispose() : d.length <= 0 && ((p = this._inputPlaceholderRenderRoot) == null || p.mount());
|
|
234
277
|
})),
|
|
235
|
-
this.editPopup$.pipe(
|
|
236
|
-
var c,
|
|
237
|
-
|
|
278
|
+
this.editPopup$.pipe(D((s) => {
|
|
279
|
+
var c, u;
|
|
280
|
+
s || ((u = (c = this._inputPlaceholderRenderRoot) == null ? void 0 : c.unmount) == null || u.dispose(), this._inputPlaceholderRenderRoot = null);
|
|
238
281
|
}))
|
|
239
282
|
]).subscribe());
|
|
240
283
|
}
|
|
241
284
|
get editPopup() {
|
|
242
285
|
return this._editPopup$.value;
|
|
243
286
|
}
|
|
287
|
+
get isComposing() {
|
|
288
|
+
return this._isComposing$.value;
|
|
289
|
+
}
|
|
290
|
+
setIsComposing(e) {
|
|
291
|
+
this._isComposing$.next(e);
|
|
292
|
+
}
|
|
244
293
|
get inputOffset() {
|
|
245
294
|
return this._inputOffset$.value;
|
|
246
295
|
}
|
|
@@ -248,7 +297,7 @@ let g = class extends G {
|
|
|
248
297
|
this._inputOffset$.next(e);
|
|
249
298
|
}
|
|
250
299
|
resolvePopup(e) {
|
|
251
|
-
return Array.from(this._popups).find((
|
|
300
|
+
return Array.from(this._popups).find((i) => i.keyword === e);
|
|
252
301
|
}
|
|
253
302
|
registerPopup(e) {
|
|
254
303
|
return this._popups.add(e), () => {
|
|
@@ -257,39 +306,55 @@ let g = class extends G {
|
|
|
257
306
|
}
|
|
258
307
|
_createInputPlaceholderRenderRoot(e) {
|
|
259
308
|
return {
|
|
309
|
+
isMounted: !1,
|
|
260
310
|
mount() {
|
|
261
|
-
this.
|
|
311
|
+
if (this.isMounted)
|
|
312
|
+
return;
|
|
313
|
+
this.isMounted = !0;
|
|
314
|
+
const n = e();
|
|
315
|
+
this.unmount = {
|
|
316
|
+
dispose: () => {
|
|
317
|
+
n.dispose(), this.isMounted = !1;
|
|
318
|
+
}
|
|
319
|
+
};
|
|
262
320
|
}
|
|
263
321
|
};
|
|
264
322
|
}
|
|
265
323
|
showPopup(e) {
|
|
266
|
-
const { popup:
|
|
267
|
-
this.closePopup()
|
|
324
|
+
const { popup: i, index: n, unitId: r } = e;
|
|
325
|
+
this.closePopup(), this._inputPlaceholderRenderRoot = this._createInputPlaceholderRenderRoot(() => {
|
|
326
|
+
var b;
|
|
327
|
+
const a = (b = this._renderManagerService.getRenderById(r)) == null ? void 0 : b.with(Ae), d = this._docSelectionManagerService.getActiveTextRange();
|
|
328
|
+
if (!a || !d)
|
|
329
|
+
return le;
|
|
330
|
+
const c = a.getSkeleton().findNodeByCharIndex(d.startOffset, d.segmentId, d.segmentPage);
|
|
331
|
+
if (!((c == null ? void 0 : c.content) === "\r"))
|
|
332
|
+
return le;
|
|
333
|
+
const p = this._docCanvasPopupManagerService.attachPopupToRange(
|
|
334
|
+
{ startOffset: n + 1, endOffset: n + 1, collapsed: !1 },
|
|
335
|
+
{
|
|
336
|
+
componentKey: H.componentKey,
|
|
337
|
+
onClickOutside: () => {
|
|
338
|
+
p.dispose();
|
|
339
|
+
},
|
|
340
|
+
direction: "horizontal"
|
|
341
|
+
},
|
|
342
|
+
r
|
|
343
|
+
);
|
|
344
|
+
return p;
|
|
345
|
+
}), this._inputPlaceholderRenderRoot.mount();
|
|
268
346
|
const o = this._docCanvasPopupManagerService.attachPopupToRange(
|
|
269
347
|
{ startOffset: n, endOffset: n, collapsed: !0 },
|
|
270
348
|
{
|
|
271
|
-
componentKey:
|
|
349
|
+
componentKey: K.componentKey,
|
|
272
350
|
onClickOutside: () => {
|
|
273
351
|
this.closePopup();
|
|
274
352
|
},
|
|
275
353
|
direction: "bottom"
|
|
276
354
|
},
|
|
277
|
-
|
|
355
|
+
r
|
|
278
356
|
);
|
|
279
|
-
this.
|
|
280
|
-
const c = this._docCanvasPopupManagerService.attachPopupToRange(
|
|
281
|
-
{ startOffset: n + 1, endOffset: n + 1, collapsed: !1 },
|
|
282
|
-
{
|
|
283
|
-
componentKey: D.componentKey,
|
|
284
|
-
onClickOutside: () => {
|
|
285
|
-
c.dispose();
|
|
286
|
-
},
|
|
287
|
-
direction: "horizontal"
|
|
288
|
-
},
|
|
289
|
-
i
|
|
290
|
-
);
|
|
291
|
-
return c;
|
|
292
|
-
}), this._inputPlaceholderRenderRoot.mount(), this._editPopup$.next({ disposable: o, popup: r, anchor: n, unitId: i });
|
|
357
|
+
this._editPopup$.next({ disposable: o, popup: i, anchor: n, unitId: r });
|
|
293
358
|
}
|
|
294
359
|
closePopup() {
|
|
295
360
|
this.editPopup && (this.editPopup.disposable.dispose(), this._editPopup$.next(null));
|
|
@@ -300,248 +365,258 @@ let g = class extends G {
|
|
|
300
365
|
};
|
|
301
366
|
}
|
|
302
367
|
emitMenuSelected(e) {
|
|
303
|
-
const { start:
|
|
304
|
-
this._commandService.syncExecuteCommand(
|
|
305
|
-
start:
|
|
368
|
+
const { start: i, end: n } = this.inputOffset;
|
|
369
|
+
this._commandService.syncExecuteCommand(ve.id, {
|
|
370
|
+
start: i,
|
|
306
371
|
end: n
|
|
307
372
|
}), setTimeout(() => {
|
|
308
|
-
this._menuSelectedCallbacks.forEach((
|
|
373
|
+
this._menuSelectedCallbacks.forEach((r) => r(e));
|
|
309
374
|
}, 0);
|
|
310
375
|
}
|
|
311
376
|
};
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
377
|
+
C = pt([
|
|
378
|
+
w(0, g(qe)),
|
|
379
|
+
w(1, g(pe)),
|
|
380
|
+
w(2, g(N)),
|
|
381
|
+
w(3, g(Ye)),
|
|
382
|
+
w(4, g(me))
|
|
383
|
+
], C);
|
|
384
|
+
const _e = {
|
|
385
|
+
type: x.OPERATION,
|
|
319
386
|
id: "doc.operation.show-quick-insert-popup",
|
|
320
387
|
handler(t, e) {
|
|
321
|
-
const
|
|
322
|
-
return e ? (
|
|
388
|
+
const i = t.get(C);
|
|
389
|
+
return e ? (i.showPopup(e), !0) : !1;
|
|
323
390
|
}
|
|
324
|
-
},
|
|
325
|
-
type:
|
|
391
|
+
}, k = {
|
|
392
|
+
type: x.OPERATION,
|
|
326
393
|
id: "doc.operation.close-quick-insert-popup",
|
|
327
394
|
handler(t) {
|
|
328
|
-
return t.get(
|
|
395
|
+
return t.get(C).closePopup(), !0;
|
|
329
396
|
}
|
|
330
|
-
},
|
|
397
|
+
}, Ce = {
|
|
331
398
|
id: "quick-insert.text.menu",
|
|
332
399
|
title: "docQuickInsert.menu.text",
|
|
333
400
|
icon: "TextSingle",
|
|
334
401
|
keywords: ["text"]
|
|
335
|
-
},
|
|
336
|
-
id:
|
|
402
|
+
}, Se = {
|
|
403
|
+
id: ze.id,
|
|
337
404
|
title: "docQuickInsert.menu.numberedList",
|
|
338
405
|
icon: "OrderSingle",
|
|
339
406
|
keywords: ["numbered", "list", "ordered"]
|
|
340
|
-
},
|
|
341
|
-
id:
|
|
407
|
+
}, Ie = {
|
|
408
|
+
id: Be.id,
|
|
342
409
|
title: "docQuickInsert.menu.bulletedList",
|
|
343
410
|
icon: "UnorderSingle",
|
|
344
411
|
keywords: ["bulleted", "list", "unordered"]
|
|
345
|
-
},
|
|
346
|
-
id:
|
|
412
|
+
}, Oe = {
|
|
413
|
+
id: Ve.id,
|
|
347
414
|
title: "docQuickInsert.menu.divider",
|
|
348
415
|
icon: "DividerSingle",
|
|
349
416
|
keywords: ["divider", "line", "separate"]
|
|
350
|
-
},
|
|
417
|
+
}, ft = [
|
|
351
418
|
{
|
|
352
419
|
title: "docQuickInsert.group.basics",
|
|
353
420
|
id: "quick.insert.group.basic",
|
|
354
421
|
children: [
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
422
|
+
Ce,
|
|
423
|
+
Se,
|
|
424
|
+
Ie,
|
|
425
|
+
Oe
|
|
359
426
|
]
|
|
360
427
|
}
|
|
361
|
-
],
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
428
|
+
], ht = /* @__PURE__ */ new Set([
|
|
429
|
+
Se.id,
|
|
430
|
+
Ie.id,
|
|
431
|
+
Oe.id
|
|
365
432
|
]);
|
|
366
|
-
var
|
|
367
|
-
for (var
|
|
368
|
-
(
|
|
369
|
-
return
|
|
370
|
-
}, R = (t, e) => (
|
|
371
|
-
let
|
|
372
|
-
constructor(t, e,
|
|
373
|
-
super(), this._commandService = t, this._textSelectionManagerService = e, this._docQuickInsertPopupService =
|
|
374
|
-
id:
|
|
433
|
+
var mt = Object.getOwnPropertyDescriptor, vt = (t, e, i, n) => {
|
|
434
|
+
for (var r = n > 1 ? void 0 : n ? mt(e, i) : e, o = t.length - 1, a; o >= 0; o--)
|
|
435
|
+
(a = t[o]) && (r = a(r) || r);
|
|
436
|
+
return r;
|
|
437
|
+
}, R = (t, e) => (i, n) => e(i, n, t);
|
|
438
|
+
let Q = class extends Y {
|
|
439
|
+
constructor(t, e, i, n, r) {
|
|
440
|
+
super(), this._commandService = t, this._textSelectionManagerService = e, this._docQuickInsertPopupService = i, this._shortcutService = n, this._univerInstanceService = r, this.disposeWithMe(this._shortcutService.registerShortcut({
|
|
441
|
+
id: k.id,
|
|
375
442
|
binding: y.ESC,
|
|
376
443
|
preconditions: () => !!this._docQuickInsertPopupService.editPopup,
|
|
377
444
|
priority: 1e3
|
|
378
445
|
})), this._initTrigger(), this._initMenuHandler();
|
|
379
446
|
}
|
|
447
|
+
// eslint-disable-next-line max-lines-per-function
|
|
380
448
|
_initTrigger() {
|
|
381
449
|
this.disposeWithMe(
|
|
382
|
-
// eslint-disable-next-line complexity
|
|
450
|
+
// eslint-disable-next-line complexity, max-lines-per-function
|
|
383
451
|
this._commandService.onCommandExecuted((t) => {
|
|
384
|
-
var
|
|
385
|
-
const { _docQuickInsertPopupService: e, _textSelectionManagerService:
|
|
386
|
-
if (
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
e.
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
452
|
+
var o, a, d;
|
|
453
|
+
const { _docQuickInsertPopupService: e, _textSelectionManagerService: i, _commandService: n } = this, r = this._univerInstanceService.getCurrentUnitOfType(ee.UNIVER_DOC);
|
|
454
|
+
if (!(r != null && r.getDisabled())) {
|
|
455
|
+
if (t.id === Fe.id) {
|
|
456
|
+
const s = t.params;
|
|
457
|
+
if (e.editPopup) {
|
|
458
|
+
e.setInputOffset({
|
|
459
|
+
start: e.inputOffset.start,
|
|
460
|
+
end: s.range.endOffset + 1
|
|
461
|
+
});
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
const c = i.getActiveTextRange();
|
|
465
|
+
if (!c)
|
|
466
|
+
return;
|
|
467
|
+
const u = e.resolvePopup(s.body.dataStream);
|
|
468
|
+
if (!u || !(u.preconditions ? u.preconditions(s) : !0))
|
|
469
|
+
return;
|
|
470
|
+
e.setInputOffset({ start: c.startOffset - 1, end: c.startOffset }), setTimeout(() => {
|
|
471
|
+
n.executeCommand(_e.id, {
|
|
472
|
+
index: c.startOffset - 1,
|
|
473
|
+
unitId: s.unitId,
|
|
474
|
+
popup: u
|
|
475
|
+
});
|
|
476
|
+
}, 100);
|
|
394
477
|
}
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
const f = e.resolvePopup(s.body.dataStream);
|
|
399
|
-
if (!f || !(f.preconditions ? f.preconditions(s) : !0))
|
|
400
|
-
return;
|
|
401
|
-
e.setInputOffset({ start: d.startOffset - 1, end: d.startOffset }), setTimeout(() => {
|
|
402
|
-
n.executeCommand(he.id, {
|
|
403
|
-
index: d.startOffset - 1,
|
|
404
|
-
unitId: s.unitId,
|
|
405
|
-
popup: f
|
|
406
|
-
});
|
|
407
|
-
}, 100);
|
|
408
|
-
}
|
|
409
|
-
if (t.id === Ke.id) {
|
|
410
|
-
const s = t.params;
|
|
411
|
-
if (s.isCompositionEnd) {
|
|
412
|
-
const d = (o = (i = s.textRanges) == null ? void 0 : i[0]) == null ? void 0 : o.endOffset;
|
|
413
|
-
d && e.setInputOffset({ start: e.inputOffset.start, end: d });
|
|
478
|
+
if (t.id === Ge.id) {
|
|
479
|
+
const s = t.params;
|
|
480
|
+
!e.isComposing && s.isCompositionStart && e.setIsComposing(!0), e.isComposing && s.isCompositionEnd && e.setIsComposing(!1);
|
|
414
481
|
}
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
482
|
+
if (t.id === Le.id) {
|
|
483
|
+
const s = t.params;
|
|
484
|
+
if (s.isCompositionEnd) {
|
|
485
|
+
const c = (a = (o = s.textRanges) == null ? void 0 : o[0]) == null ? void 0 : a.endOffset;
|
|
486
|
+
c && e.setInputOffset({ start: e.inputOffset.start, end: c });
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
if (t.id === Ze.id) {
|
|
490
|
+
const s = t.params;
|
|
491
|
+
if (e.editPopup && s.direction === Ee.LEFT) {
|
|
492
|
+
const c = (d = s.len) != null ? d : 0;
|
|
493
|
+
e.setInputOffset({ start: e.inputOffset.start, end: s.range.endOffset - c });
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
if (t.id === Je.id) {
|
|
497
|
+
const s = t.params;
|
|
498
|
+
(s.direction === T.LEFT || s.direction === T.RIGHT) && e.editPopup && n.executeCommand(k.id);
|
|
499
|
+
}
|
|
500
|
+
if (t.id === Xe.id) {
|
|
501
|
+
const s = i.getActiveTextRange();
|
|
502
|
+
if (!e.editPopup || !s)
|
|
503
|
+
return;
|
|
504
|
+
s.endOffset <= e.editPopup.anchor && n.executeCommand(k.id);
|
|
421
505
|
}
|
|
422
|
-
}
|
|
423
|
-
if (t.id === Ve.id) {
|
|
424
|
-
const s = t.params;
|
|
425
|
-
(s.direction === k.LEFT || s.direction === k.RIGHT) && e.editPopup && n.executeCommand(b.id);
|
|
426
|
-
}
|
|
427
|
-
if (t.id === Fe.id) {
|
|
428
|
-
const s = r.getActiveTextRange();
|
|
429
|
-
if (!e.editPopup || !s)
|
|
430
|
-
return;
|
|
431
|
-
s.endOffset <= e.editPopup.anchor && n.executeCommand(b.id);
|
|
432
506
|
}
|
|
433
507
|
})
|
|
434
508
|
);
|
|
435
509
|
}
|
|
436
510
|
_initMenuHandler() {
|
|
437
511
|
this.disposeWithMe(this._docQuickInsertPopupService.onMenuSelected((t) => {
|
|
438
|
-
t.id !==
|
|
512
|
+
t.id !== Ce.id && ht.has(t.id) && this._commandService.executeCommand(t.id);
|
|
439
513
|
}));
|
|
440
514
|
}
|
|
441
515
|
};
|
|
442
|
-
|
|
443
|
-
R(0,
|
|
444
|
-
R(1,
|
|
445
|
-
R(2,
|
|
446
|
-
R(3,
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
516
|
+
Q = vt([
|
|
517
|
+
R(0, N),
|
|
518
|
+
R(1, g(me)),
|
|
519
|
+
R(2, g(C)),
|
|
520
|
+
R(3, g(he)),
|
|
521
|
+
R(4, g(pe))
|
|
522
|
+
], Q);
|
|
523
|
+
var v = function() {
|
|
524
|
+
return v = Object.assign || function(t) {
|
|
525
|
+
for (var e, i = 1, n = arguments.length; i < n; i++) {
|
|
526
|
+
e = arguments[i];
|
|
527
|
+
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
|
|
453
528
|
}
|
|
454
529
|
return t;
|
|
455
|
-
},
|
|
456
|
-
},
|
|
457
|
-
var
|
|
458
|
-
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (
|
|
530
|
+
}, v.apply(this, arguments);
|
|
531
|
+
}, gt = function(t, e) {
|
|
532
|
+
var i = {};
|
|
533
|
+
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (i[n] = t[n]);
|
|
459
534
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
460
|
-
for (var
|
|
461
|
-
e.indexOf(n[
|
|
462
|
-
return
|
|
463
|
-
},
|
|
464
|
-
var
|
|
465
|
-
return
|
|
535
|
+
for (var r = 0, n = Object.getOwnPropertySymbols(t); r < n.length; r++)
|
|
536
|
+
e.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[r]) && (i[n[r]] = t[n[r]]);
|
|
537
|
+
return i;
|
|
538
|
+
}, ie = te(function(t, e) {
|
|
539
|
+
var i = t.icon, n = t.id, r = t.className, o = t.extend, a = gt(t, ["icon", "id", "className", "extend"]), d = "univerjs-icon univerjs-icon-".concat(n, " ").concat(r || "").trim(), s = $("_".concat(St()));
|
|
540
|
+
return ye(i, "".concat(n), { defIds: i.defIds, idSuffix: s.current }, v({ ref: e, className: d }, a), o);
|
|
466
541
|
});
|
|
467
|
-
function
|
|
468
|
-
return
|
|
469
|
-
return
|
|
542
|
+
function ye(t, e, i, n, r) {
|
|
543
|
+
return ne(t.tag, v(v({ key: e }, _t(t, i, r)), n), (Ct(t, i).children || []).map(function(o, a) {
|
|
544
|
+
return ye(o, "".concat(e, "-").concat(t.tag, "-").concat(a), i, void 0, r);
|
|
470
545
|
}));
|
|
471
546
|
}
|
|
472
|
-
function
|
|
473
|
-
var n =
|
|
474
|
-
|
|
475
|
-
var
|
|
476
|
-
|
|
547
|
+
function _t(t, e, i) {
|
|
548
|
+
var n = v({}, t.attrs);
|
|
549
|
+
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(o) {
|
|
550
|
+
var a = o[0], d = o[1];
|
|
551
|
+
a === "mask" && typeof d == "string" && (n[a] = d.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
477
552
|
});
|
|
478
|
-
var
|
|
479
|
-
return !
|
|
480
|
-
var
|
|
481
|
-
typeof
|
|
553
|
+
var r = e.defIds;
|
|
554
|
+
return !r || r.length === 0 || (t.tag === "use" && n["xlink:href"] && (n["xlink:href"] = n["xlink:href"] + e.idSuffix), Object.entries(n).forEach(function(o) {
|
|
555
|
+
var a = o[0], d = o[1];
|
|
556
|
+
typeof d == "string" && (n[a] = d.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
482
557
|
})), n;
|
|
483
558
|
}
|
|
484
|
-
function
|
|
485
|
-
var
|
|
486
|
-
return !n || n.length === 0 ? t : t.tag === "defs" && (!((
|
|
487
|
-
return typeof
|
|
559
|
+
function Ct(t, e) {
|
|
560
|
+
var i, n = e.defIds;
|
|
561
|
+
return !n || n.length === 0 ? t : t.tag === "defs" && (!((i = t.children) === null || i === void 0) && i.length) ? v(v({}, t), { children: t.children.map(function(r) {
|
|
562
|
+
return typeof r.attrs.id == "string" && n && n.indexOf(r.attrs.id) > -1 ? v(v({}, r), { attrs: v(v({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
|
|
488
563
|
}) }) : t;
|
|
489
564
|
}
|
|
490
|
-
function
|
|
565
|
+
function St() {
|
|
491
566
|
return Math.random().toString(36).substring(2, 8);
|
|
492
567
|
}
|
|
493
|
-
|
|
494
|
-
var
|
|
495
|
-
return
|
|
568
|
+
ie.displayName = "UniverIcon";
|
|
569
|
+
var It = { 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" } }] }, Z = te(function(t, e) {
|
|
570
|
+
return ne(ie, Object.assign({}, t, {
|
|
496
571
|
id: "divider-single",
|
|
497
572
|
ref: e,
|
|
498
|
-
icon:
|
|
573
|
+
icon: It
|
|
499
574
|
}));
|
|
500
575
|
});
|
|
501
|
-
|
|
502
|
-
var
|
|
503
|
-
return
|
|
576
|
+
Z.displayName = "DividerSingle";
|
|
577
|
+
var Ot = { 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" } }] }, J = te(function(t, e) {
|
|
578
|
+
return ne(ie, Object.assign({}, t, {
|
|
504
579
|
id: "text-single",
|
|
505
580
|
ref: e,
|
|
506
|
-
icon:
|
|
581
|
+
icon: Ot
|
|
507
582
|
}));
|
|
508
583
|
});
|
|
509
|
-
|
|
510
|
-
var
|
|
511
|
-
for (var
|
|
512
|
-
(
|
|
513
|
-
return
|
|
514
|
-
},
|
|
515
|
-
let
|
|
516
|
-
constructor(t, e,
|
|
517
|
-
super(), this._commandService = t, this._docQuickInsertPopupService = e, this._componentManager =
|
|
584
|
+
J.displayName = "TextSingle";
|
|
585
|
+
var yt = Object.getOwnPropertyDescriptor, Pt = (t, e, i, n) => {
|
|
586
|
+
for (var r = n > 1 ? void 0 : n ? yt(e, i) : e, o = t.length - 1, a; o >= 0; o--)
|
|
587
|
+
(a = t[o]) && (r = a(r) || r);
|
|
588
|
+
return r;
|
|
589
|
+
}, F = (t, e) => (i, n) => e(i, n, t);
|
|
590
|
+
let j = class extends Y {
|
|
591
|
+
constructor(t, e, i) {
|
|
592
|
+
super(), this._commandService = t, this._docQuickInsertPopupService = e, this._componentManager = i, this._initCommands(), this._initComponents(), this._initMenus();
|
|
518
593
|
}
|
|
519
594
|
_initCommands() {
|
|
520
595
|
[
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
596
|
+
ve,
|
|
597
|
+
_e,
|
|
598
|
+
k
|
|
524
599
|
].forEach((t) => {
|
|
525
600
|
this.disposeWithMe(this._commandService.registerCommand(t));
|
|
526
601
|
});
|
|
527
602
|
}
|
|
528
603
|
_initComponents() {
|
|
529
604
|
[
|
|
530
|
-
[
|
|
531
|
-
[
|
|
532
|
-
[
|
|
533
|
-
[
|
|
534
|
-
[
|
|
535
|
-
].forEach(([e,
|
|
536
|
-
e && this.disposeWithMe(this._componentManager.register(e,
|
|
605
|
+
[K.componentKey, K],
|
|
606
|
+
[H.componentKey, H],
|
|
607
|
+
[U.componentKey, U],
|
|
608
|
+
[Z.displayName, Z],
|
|
609
|
+
[J.displayName, J]
|
|
610
|
+
].forEach(([e, i]) => {
|
|
611
|
+
e && this.disposeWithMe(this._componentManager.register(e, i));
|
|
537
612
|
}), [
|
|
538
613
|
{
|
|
539
614
|
keyword: "/",
|
|
540
|
-
menus$:
|
|
615
|
+
menus$: it(ft),
|
|
541
616
|
// only show when the cursor is at the beginning of a line
|
|
542
617
|
preconditions: (e) => {
|
|
543
|
-
var
|
|
544
|
-
return ((
|
|
618
|
+
var i;
|
|
619
|
+
return ((i = e.range.startNodePosition) == null ? void 0 : i.glyph) === 0;
|
|
545
620
|
}
|
|
546
621
|
}
|
|
547
622
|
].forEach((e) => {
|
|
@@ -551,43 +626,43 @@ let H = class extends G {
|
|
|
551
626
|
_initMenus() {
|
|
552
627
|
}
|
|
553
628
|
};
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
],
|
|
559
|
-
var
|
|
560
|
-
for (var
|
|
561
|
-
(
|
|
562
|
-
return
|
|
563
|
-
},
|
|
564
|
-
const
|
|
565
|
-
let
|
|
629
|
+
j = Pt([
|
|
630
|
+
F(0, N),
|
|
631
|
+
F(1, g(C)),
|
|
632
|
+
F(2, g(fe))
|
|
633
|
+
], j);
|
|
634
|
+
var xt = Object.defineProperty, bt = Object.getOwnPropertyDescriptor, Mt = (t, e, i) => e in t ? xt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, wt = (t, e, i, n) => {
|
|
635
|
+
for (var r = n > 1 ? void 0 : n ? bt(e, i) : e, o = t.length - 1, a; o >= 0; o--)
|
|
636
|
+
(a = t[o]) && (r = a(r) || r);
|
|
637
|
+
return r;
|
|
638
|
+
}, Rt = (t, e) => (i, n) => e(i, n, t), Pe = (t, e, i) => Mt(t, typeof e != "symbol" ? e + "" : e, i);
|
|
639
|
+
const kt = "DOC_QUICK_INSERT_UI_PLUGIN";
|
|
640
|
+
let A = class extends He {
|
|
566
641
|
constructor(t) {
|
|
567
642
|
super(), this._injector = t;
|
|
568
643
|
}
|
|
569
644
|
onStarting() {
|
|
570
645
|
[
|
|
571
|
-
[
|
|
572
|
-
[
|
|
573
|
-
[
|
|
574
|
-
].forEach((e) => this._injector.add(e)), this._injector.get(
|
|
646
|
+
[j],
|
|
647
|
+
[Q],
|
|
648
|
+
[C]
|
|
649
|
+
].forEach((e) => this._injector.add(e)), this._injector.get(j);
|
|
575
650
|
}
|
|
576
651
|
onRendered() {
|
|
577
|
-
this._injector.get(
|
|
652
|
+
this._injector.get(Q), this._injector.get(C);
|
|
578
653
|
}
|
|
579
654
|
};
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
],
|
|
655
|
+
Pe(A, "type", ee.UNIVER_DOC);
|
|
656
|
+
Pe(A, "pluginName", kt);
|
|
657
|
+
A = wt([
|
|
658
|
+
$e(Qe, Ke, Ue, je),
|
|
659
|
+
Rt(0, g(Te))
|
|
660
|
+
], A);
|
|
586
661
|
export {
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
662
|
+
C as DocQuickInsertPopupService,
|
|
663
|
+
Q as DocQuickInsertTriggerController,
|
|
664
|
+
j as DocQuickInsertUIController,
|
|
665
|
+
at as KeywordInputPlaceholderComponentKey,
|
|
666
|
+
dt as QuickInsertPlaceholderComponentKey,
|
|
667
|
+
A as UniverDocsQuickInsertUIPlugin
|
|
593
668
|
};
|