@aiao/code-editor-vue 0.0.8 → 0.0.9

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.
Files changed (27) hide show
  1. package/dist/{index-qH2lMs0G-VT1Nd_LF.js → index-4oLq9F9B-Bwzqzq-7.js} +4 -4
  2. package/dist/{index-CpRVx97--qRVKhpm0.js → index-9NH8hlZ--BIK1-_7Y.js} +2 -2
  3. package/dist/{index-DEB5VK0f-DmPMy-wS.js → index-BFXNCCbG-Dn1DmTkR.js} +18 -17
  4. package/dist/{index-D0BZOY-S-DP1N-_JY.js → index-BLHYcXXK-D3jw64Ia.js} +4 -4
  5. package/dist/{index-Bg1KDWyt-DaNGMguF.js → index-BQU3Rb2C-BhijiYjz.js} +10 -10
  6. package/dist/{index-CrbQBmWq-CH-PcW1J.js → index-Bg18ePld-CYeapYL7.js} +2 -2
  7. package/dist/{index-D0svJS59-B1ELwWap.js → index-Bp5lqnbN-BoMgXRma.js} +72 -72
  8. package/dist/{index-srIksFxX-jkv39JhL.js → index-Bqzq8A1N-PdN6VK36.js} +2 -2
  9. package/dist/{index-Dy-OpkyQ-BBMsyHBR.js → index-Bx-s4g99-DYf1g6JD.js} +2 -2
  10. package/dist/{index-C71CZfUx-CXN80Lrt.js → index-BxX25QmV-DN1ZGFmt.js} +24 -23
  11. package/dist/{index-Ds4AioqO-C6aO_ISw.js → index-CFCzgc33-DE9rG3W6.js} +3 -3
  12. package/dist/{index-D93XVMi1-BA3BTMNq.js → index-CL7JTU9M-4NGEQoO4.js} +3 -3
  13. package/dist/{index-ZJkjD9tT-CsDrbsME.js → index-CipmEceX-CFTPqpKk.js} +4 -4
  14. package/dist/{index-BuVm7ZG6-BZLKs8s6.js → index-Cv4vvpa2-BukCrc2X.js} +1 -1
  15. package/dist/index-D4hhdPbZ-DdhnEv3l.js +6152 -0
  16. package/dist/{index-CqvQj6d--Cks52f8R.js → index-DhNQ8g9I-CVe0AfsL.js} +3 -3
  17. package/dist/{index-wcsJ2mym.js → index-DiRkPt_L.js} +12161 -6310
  18. package/dist/{index-BNuasEBW-Djq6JMRj.js → index-Djp53tAP-D0DXRMTU.js} +2 -2
  19. package/dist/{index-CQ6JWNwi-BkIQd0CX.js → index-KlsAFhIj-eocEKyjX.js} +22 -22
  20. package/dist/{index-BMiCCEB1-Bhkem_yf.js → index-OntZqtu6-D0l05YUl.js} +2 -2
  21. package/dist/{index-CzovO10m-BGtdggaq.js → index-PGnZjMCR-CmhlYKb5.js} +3 -3
  22. package/dist/{index-BvS1cnHq-DM0hbFEQ.js → index-TyYoYgss-C-LVSkzX.js} +19 -19
  23. package/dist/{index-Dp8osI_J-_47iGH9z.js → index-oMSPmlXA-CBTT7XSR.js} +2 -2
  24. package/dist/{index-C44L0DmY-BmmnwVzM.js → index-rQC6Gbk0-Cj-ZtGkV.js} +2 -2
  25. package/dist/index.js +2 -2
  26. package/package.json +6 -3
  27. package/dist/index-Dyi9rNIT-DTaMAKyY.js +0 -391
@@ -1,391 +0,0 @@
1
- import { R as C, o as L, p as O, I as E, q as x, v as A, w as R, a as w, y as T, S as y, z as g, i as q, O as z, A as k, B, D as P } from "./index-wcsJ2mym.js";
2
- class te {
3
- /**
4
- Create a new completion context. (Mostly useful for testing
5
- completion sources—in the editor, the extension will create
6
- these for you.)
7
- */
8
- constructor(t, e, n, i) {
9
- this.state = t, this.pos = e, this.explicit = n, this.view = i, this.abortListeners = [], this.abortOnDocChange = !1;
10
- }
11
- /**
12
- Get the extent, content, and (if there is a token) type of the
13
- token before `this.pos`.
14
- */
15
- tokenBefore(t) {
16
- let e = C(this.state).resolveInner(this.pos, -1);
17
- for (; e && t.indexOf(e.name) < 0; )
18
- e = e.parent;
19
- return e ? {
20
- from: e.from,
21
- to: this.pos,
22
- text: this.state.sliceDoc(e.from, this.pos),
23
- type: e.type
24
- } : null;
25
- }
26
- /**
27
- Get the match of the given expression directly before the
28
- cursor.
29
- */
30
- matchBefore(t) {
31
- let e = this.state.doc.lineAt(this.pos), n = Math.max(e.from, this.pos - 250), i = e.text.slice(n - e.from, this.pos - e.from), l = i.search(H(t));
32
- return l < 0 ? null : { from: n + l, to: this.pos, text: i.slice(l) };
33
- }
34
- /**
35
- Yields true when the query has been aborted. Can be useful in
36
- asynchronous queries to avoid doing work that will be ignored.
37
- */
38
- get aborted() {
39
- return this.abortListeners == null;
40
- }
41
- /**
42
- Allows you to register abort handlers, which will be called when
43
- the query is
44
- [aborted](https://codemirror.net/6/docs/ref/#autocomplete.CompletionContext.aborted).
45
-
46
- By default, running queries will not be aborted for regular
47
- typing or backspacing, on the assumption that they are likely to
48
- return a result with a
49
- [`validFor`](https://codemirror.net/6/docs/ref/#autocomplete.CompletionResult.validFor) field that
50
- allows the result to be used after all. Passing `onDocChange:
51
- true` will cause this query to be aborted for any document
52
- change.
53
- */
54
- addEventListener(t, e, n) {
55
- t == "abort" && this.abortListeners && (this.abortListeners.push(e), n && n.onDocChange && (this.abortOnDocChange = !0));
56
- }
57
- }
58
- function $(o) {
59
- let t = Object.keys(o).join(""), e = /\w/.test(t);
60
- return e && (t = t.replace(/\w/g, "")), `[${e ? "\\w" : ""}${t.replace(/[^\w\s]/g, "\\$&")}]`;
61
- }
62
- function j(o) {
63
- let t = /* @__PURE__ */ Object.create(null), e = /* @__PURE__ */ Object.create(null);
64
- for (let { label: i } of o) {
65
- t[i[0]] = !0;
66
- for (let l = 1; l < i.length; l++)
67
- e[i[l]] = !0;
68
- }
69
- let n = $(t) + $(e) + "*$";
70
- return [new RegExp("^" + n), new RegExp(n)];
71
- }
72
- function ne(o) {
73
- let t = o.map((i) => typeof i == "string" ? { label: i } : i), [e, n] = t.every((i) => /^\w+$/.test(i.label)) ? [/\w*$/, /\w+$/] : j(t);
74
- return (i) => {
75
- let l = i.matchBefore(n);
76
- return l || i.explicit ? { from: l ? l.from : i.pos, options: t, validFor: e } : null;
77
- };
78
- }
79
- function oe(o, t) {
80
- return (e) => {
81
- for (let n = C(e.state).resolveInner(e.pos, -1); n; n = n.parent) {
82
- if (o.indexOf(n.name) > -1)
83
- return null;
84
- if (n.type.isTop)
85
- break;
86
- }
87
- return t(e);
88
- };
89
- }
90
- function H(o, t) {
91
- var e;
92
- let { source: n } = o, i = n[n.length - 1] != "$";
93
- return i ? new RegExp(`(?:${n})${i ? "$" : ""}`, (e = o.flags) !== null && e !== void 0 ? e : o.ignoreCase ? "i" : "") : o;
94
- }
95
- const V = /* @__PURE__ */ L.define(), W = /* @__PURE__ */ w.baseTheme({
96
- ".cm-tooltip.cm-tooltip-autocomplete": {
97
- "& > ul": {
98
- fontFamily: "monospace",
99
- whiteSpace: "nowrap",
100
- overflow: "hidden auto",
101
- maxWidth_fallback: "700px",
102
- maxWidth: "min(700px, 95vw)",
103
- minWidth: "250px",
104
- maxHeight: "10em",
105
- height: "100%",
106
- listStyle: "none",
107
- margin: 0,
108
- padding: 0,
109
- "& > li, & > completion-section": {
110
- padding: "1px 3px",
111
- lineHeight: 1.2
112
- },
113
- "& > li": {
114
- overflowX: "hidden",
115
- textOverflow: "ellipsis",
116
- cursor: "pointer"
117
- },
118
- "& > completion-section": {
119
- display: "list-item",
120
- borderBottom: "1px solid silver",
121
- paddingLeft: "0.5em",
122
- opacity: 0.7
123
- }
124
- }
125
- },
126
- "&light .cm-tooltip-autocomplete ul li[aria-selected]": {
127
- background: "#17c",
128
- color: "white"
129
- },
130
- "&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]": {
131
- background: "#777"
132
- },
133
- "&dark .cm-tooltip-autocomplete ul li[aria-selected]": {
134
- background: "#347",
135
- color: "white"
136
- },
137
- "&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]": {
138
- background: "#444"
139
- },
140
- ".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after": {
141
- content: '"···"',
142
- opacity: 0.5,
143
- display: "block",
144
- textAlign: "center"
145
- },
146
- ".cm-tooltip.cm-completionInfo": {
147
- position: "absolute",
148
- padding: "3px 9px",
149
- width: "max-content",
150
- maxWidth: "400px",
151
- boxSizing: "border-box",
152
- whiteSpace: "pre-line"
153
- },
154
- ".cm-completionInfo.cm-completionInfo-left": { right: "100%" },
155
- ".cm-completionInfo.cm-completionInfo-right": { left: "100%" },
156
- ".cm-completionInfo.cm-completionInfo-left-narrow": { right: "30px" },
157
- ".cm-completionInfo.cm-completionInfo-right-narrow": { left: "30px" },
158
- "&light .cm-snippetField": { backgroundColor: "#00000022" },
159
- "&dark .cm-snippetField": { backgroundColor: "#ffffff22" },
160
- ".cm-snippetFieldPosition": {
161
- verticalAlign: "text-top",
162
- width: 0,
163
- height: "1.15em",
164
- display: "inline-block",
165
- margin: "0 -0.7px -.7em",
166
- borderLeft: "1.4px dotted #888"
167
- },
168
- ".cm-completionMatchedText": {
169
- textDecoration: "underline"
170
- },
171
- ".cm-completionDetail": {
172
- marginLeft: "0.5em",
173
- fontStyle: "italic"
174
- },
175
- ".cm-completionIcon": {
176
- fontSize: "90%",
177
- width: ".8em",
178
- display: "inline-block",
179
- textAlign: "center",
180
- paddingRight: ".6em",
181
- opacity: "0.6",
182
- boxSizing: "content-box"
183
- },
184
- ".cm-completionIcon-function, .cm-completionIcon-method": {
185
- "&:after": { content: "'ƒ'" }
186
- },
187
- ".cm-completionIcon-class": {
188
- "&:after": { content: "'○'" }
189
- },
190
- ".cm-completionIcon-interface": {
191
- "&:after": { content: "'◌'" }
192
- },
193
- ".cm-completionIcon-variable": {
194
- "&:after": { content: "'𝑥'" }
195
- },
196
- ".cm-completionIcon-constant": {
197
- "&:after": { content: "'𝐶'" }
198
- },
199
- ".cm-completionIcon-type": {
200
- "&:after": { content: "'𝑡'" }
201
- },
202
- ".cm-completionIcon-enum": {
203
- "&:after": { content: "'∪'" }
204
- },
205
- ".cm-completionIcon-property": {
206
- "&:after": { content: "'□'" }
207
- },
208
- ".cm-completionIcon-keyword": {
209
- "&:after": { content: "'🔑︎'" }
210
- // Disable emoji rendering
211
- },
212
- ".cm-completionIcon-namespace": {
213
- "&:after": { content: "'▢'" }
214
- },
215
- ".cm-completionIcon-text": {
216
- "&:after": { content: "'abc'", fontSize: "50%", verticalAlign: "middle" }
217
- }
218
- });
219
- class X {
220
- constructor(t, e, n, i) {
221
- this.field = t, this.line = e, this.from = n, this.to = i;
222
- }
223
- }
224
- class b {
225
- constructor(t, e, n) {
226
- this.field = t, this.from = e, this.to = n;
227
- }
228
- map(t) {
229
- let e = t.mapPos(this.from, -1, k.TrackDel), n = t.mapPos(this.to, 1, k.TrackDel);
230
- return e == null || n == null ? null : new b(this.field, e, n);
231
- }
232
- }
233
- class I {
234
- constructor(t, e) {
235
- this.lines = t, this.fieldPositions = e;
236
- }
237
- instantiate(t, e) {
238
- let n = [], i = [e], l = t.doc.lineAt(e), f = /^\s*/.exec(l.text)[0];
239
- for (let s of this.lines) {
240
- if (n.length) {
241
- let a = f, c = /^\t*/.exec(s)[0].length;
242
- for (let r = 0; r < c; r++)
243
- a += t.facet(T);
244
- i.push(e + a.length - c), s = a + s.slice(c);
245
- }
246
- n.push(s), e += s.length + 1;
247
- }
248
- let p = this.fieldPositions.map((s) => new b(s.field, i[s.line] + s.from, i[s.line] + s.to));
249
- return { text: n, ranges: p };
250
- }
251
- static parse(t) {
252
- let e = [], n = [], i = [], l;
253
- for (let f of t.split(/\r\n?|\n/)) {
254
- for (; l = /[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(f); ) {
255
- let p = l[1] ? +l[1] : null, s = l[2] || l[3] || "", a = -1, c = s.replace(/\\[{}]/g, (r) => r[1]);
256
- for (let r = 0; r < e.length; r++)
257
- (p != null ? e[r].seq == p : c && e[r].name == c) && (a = r);
258
- if (a < 0) {
259
- let r = 0;
260
- for (; r < e.length && (p == null || e[r].seq != null && e[r].seq < p); )
261
- r++;
262
- e.splice(r, 0, { seq: p, name: c }), a = r;
263
- for (let d of i)
264
- d.field >= a && d.field++;
265
- }
266
- for (let r of i)
267
- if (r.line == n.length && r.from > l.index) {
268
- let d = l[2] ? 3 + (l[1] || "").length : 2;
269
- r.from -= d, r.to -= d;
270
- }
271
- i.push(new X(a, n.length, l.index, l.index + c.length)), f = f.slice(0, l.index) + s + f.slice(l.index + l[0].length);
272
- }
273
- f = f.replace(/\\([{}])/g, (p, s, a) => {
274
- for (let c of i)
275
- c.line == n.length && c.from > a && (c.from--, c.to--);
276
- return s;
277
- }), n.push(f);
278
- }
279
- return new I(n, i);
280
- }
281
- }
282
- let M = /* @__PURE__ */ g.widget({ widget: /* @__PURE__ */ new class extends B {
283
- toDOM() {
284
- let o = document.createElement("span");
285
- return o.className = "cm-snippetFieldPosition", o;
286
- }
287
- ignoreEvent() {
288
- return !1;
289
- }
290
- }() }), N = /* @__PURE__ */ g.mark({ class: "cm-snippetField" });
291
- class m {
292
- constructor(t, e) {
293
- this.ranges = t, this.active = e, this.deco = g.set(t.map((n) => (n.from == n.to ? M : N).range(n.from, n.to)), !0);
294
- }
295
- map(t) {
296
- let e = [];
297
- for (let n of this.ranges) {
298
- let i = n.map(t);
299
- if (!i)
300
- return null;
301
- e.push(i);
302
- }
303
- return new m(e, this.active);
304
- }
305
- selectionInsideField(t) {
306
- return t.ranges.every((e) => this.ranges.some((n) => n.field == this.active && n.from <= e.from && n.to >= e.to));
307
- }
308
- }
309
- const h = /* @__PURE__ */ x.define({
310
- map(o, t) {
311
- return o && o.map(t);
312
- }
313
- }), Y = /* @__PURE__ */ x.define(), u = /* @__PURE__ */ A.define({
314
- create() {
315
- return null;
316
- },
317
- update(o, t) {
318
- for (let e of t.effects) {
319
- if (e.is(h))
320
- return e.value;
321
- if (e.is(Y) && o)
322
- return new m(o.ranges, e.value);
323
- }
324
- return o && t.docChanged && (o = o.map(t.changes)), o && t.selection && !o.selectionInsideField(t.selection) && (o = null), o;
325
- },
326
- provide: (o) => w.decorations.from(o, (t) => t ? t.deco : g.none)
327
- });
328
- function v(o, t) {
329
- return y.create(o.filter((e) => e.field == t).map((e) => y.range(e.from, e.to)));
330
- }
331
- function G(o) {
332
- let t = I.parse(o);
333
- return (e, n, i, l) => {
334
- let { text: f, ranges: p } = t.instantiate(e.state, i), { main: s } = e.state.selection, a = {
335
- changes: { from: i, to: l == s.from ? s.to : l, insert: E.of(f) },
336
- scrollIntoView: !0,
337
- annotations: n ? [V.of(n), O.userEvent.of("input.complete")] : void 0
338
- };
339
- if (p.length && (a.selection = v(p, 0)), p.some((c) => c.field > 0)) {
340
- let c = new m(p, 0), r = a.effects = [h.of(c)];
341
- e.state.field(u, !1) === void 0 && r.push(x.appendConfig.of([u, Z, _, W]));
342
- }
343
- e.dispatch(e.state.update(a));
344
- };
345
- }
346
- function D(o) {
347
- return ({ state: t, dispatch: e }) => {
348
- let n = t.field(u, !1);
349
- if (!n || o < 0 && n.active == 0)
350
- return !1;
351
- let i = n.active + o, l = o > 0 && !n.ranges.some((f) => f.field == i + o);
352
- return e(t.update({
353
- selection: v(n.ranges, i),
354
- effects: h.of(l ? null : new m(n.ranges, i)),
355
- scrollIntoView: !0
356
- })), !0;
357
- };
358
- }
359
- const J = ({ state: o, dispatch: t }) => o.field(u, !1) ? (t(o.update({ effects: h.of(null) })), !0) : !1, K = /* @__PURE__ */ D(1), Q = /* @__PURE__ */ D(-1), U = [
360
- { key: "Tab", run: K, shift: Q },
361
- { key: "Escape", run: J }
362
- ], S = /* @__PURE__ */ z.define({
363
- combine(o) {
364
- return o.length ? o[0] : U;
365
- }
366
- }), Z = /* @__PURE__ */ R.highest(/* @__PURE__ */ q.compute([S], (o) => o.facet(S)));
367
- function ie(o, t) {
368
- return { ...t, apply: G(o) };
369
- }
370
- const _ = /* @__PURE__ */ w.domEventHandlers({
371
- mousedown(o, t) {
372
- let e = t.state.field(u, !1), n;
373
- if (!e || (n = t.posAtCoords({ x: o.clientX, y: o.clientY })) == null)
374
- return !1;
375
- let i = e.ranges.find((l) => l.from <= n && l.to >= n);
376
- return !i || i.field == e.active ? !1 : (t.dispatch({
377
- selection: v(e.ranges, i.field),
378
- effects: h.of(e.ranges.some((l) => l.field > i.field) ? new m(e.ranges, i.field) : null),
379
- scrollIntoView: !0
380
- }), !0);
381
- }
382
- }), F = /* @__PURE__ */ new class extends P {
383
- }();
384
- F.startSide = 1;
385
- F.endSide = -1;
386
- export {
387
- ie as i,
388
- ne as n,
389
- oe as o,
390
- te as t
391
- };