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