@drjoshcsimmons/scl 0.1.0
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/LICENSE +21 -0
- package/README.md +73 -0
- package/dist/components/ui/accordion/accordion.d.ts +8 -0
- package/dist/components/ui/accordion/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion/index.d.ts +2 -0
- package/dist/components/ui/accordion/index.d.ts.map +1 -0
- package/dist/components/ui/alert/alert.d.ts +9 -0
- package/dist/components/ui/alert/alert.d.ts.map +1 -0
- package/dist/components/ui/alert/index.d.ts +2 -0
- package/dist/components/ui/alert/index.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog/alert-dialog.d.ts +21 -0
- package/dist/components/ui/alert-dialog/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog/index.d.ts +2 -0
- package/dist/components/ui/alert-dialog/index.d.ts.map +1 -0
- package/dist/components/ui/avatar/avatar.d.ts +7 -0
- package/dist/components/ui/avatar/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar/index.d.ts +2 -0
- package/dist/components/ui/avatar/index.d.ts.map +1 -0
- package/dist/components/ui/badge/badge.d.ts +10 -0
- package/dist/components/ui/badge/badge.d.ts.map +1 -0
- package/dist/components/ui/badge/index.d.ts +2 -0
- package/dist/components/ui/badge/index.d.ts.map +1 -0
- package/dist/components/ui/button/button.d.ts +12 -0
- package/dist/components/ui/button/button.d.ts.map +1 -0
- package/dist/components/ui/button/index.d.ts +2 -0
- package/dist/components/ui/button/index.d.ts.map +1 -0
- package/dist/components/ui/card/card.d.ts +9 -0
- package/dist/components/ui/card/card.d.ts.map +1 -0
- package/dist/components/ui/card/index.d.ts +2 -0
- package/dist/components/ui/card/index.d.ts.map +1 -0
- package/dist/components/ui/checkbox/checkbox.d.ts +5 -0
- package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox/index.d.ts +2 -0
- package/dist/components/ui/checkbox/index.d.ts.map +1 -0
- package/dist/components/ui/collapsible/collapsible.d.ts +6 -0
- package/dist/components/ui/collapsible/collapsible.d.ts.map +1 -0
- package/dist/components/ui/collapsible/index.d.ts +2 -0
- package/dist/components/ui/collapsible/index.d.ts.map +1 -0
- package/dist/components/ui/dialog/dialog.d.ts +20 -0
- package/dist/components/ui/dialog/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog/index.d.ts +2 -0
- package/dist/components/ui/dialog/index.d.ts.map +1 -0
- package/dist/components/ui/dithered-image/dithered-image.d.ts +17 -0
- package/dist/components/ui/dithered-image/dithered-image.d.ts.map +1 -0
- package/dist/components/ui/dithered-image/index.d.ts +3 -0
- package/dist/components/ui/dithered-image/index.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +28 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu/index.d.ts +2 -0
- package/dist/components/ui/dropdown-menu/index.d.ts.map +1 -0
- package/dist/components/ui/input/index.d.ts +2 -0
- package/dist/components/ui/input/index.d.ts.map +1 -0
- package/dist/components/ui/input/input.d.ts +5 -0
- package/dist/components/ui/input/input.d.ts.map +1 -0
- package/dist/components/ui/label/index.d.ts +2 -0
- package/dist/components/ui/label/index.d.ts.map +1 -0
- package/dist/components/ui/label/label.d.ts +6 -0
- package/dist/components/ui/label/label.d.ts.map +1 -0
- package/dist/components/ui/popover/index.d.ts +2 -0
- package/dist/components/ui/popover/index.d.ts.map +1 -0
- package/dist/components/ui/popover/popover.d.ts +8 -0
- package/dist/components/ui/popover/popover.d.ts.map +1 -0
- package/dist/components/ui/progress/index.d.ts +2 -0
- package/dist/components/ui/progress/index.d.ts.map +1 -0
- package/dist/components/ui/progress/progress.d.ts +19 -0
- package/dist/components/ui/progress/progress.d.ts.map +1 -0
- package/dist/components/ui/radio-group/index.d.ts +2 -0
- package/dist/components/ui/radio-group/index.d.ts.map +1 -0
- package/dist/components/ui/radio-group/radio-group.d.ts +6 -0
- package/dist/components/ui/radio-group/radio-group.d.ts.map +1 -0
- package/dist/components/ui/scroll-area/index.d.ts +2 -0
- package/dist/components/ui/scroll-area/index.d.ts.map +1 -0
- package/dist/components/ui/scroll-area/scroll-area.d.ts +6 -0
- package/dist/components/ui/scroll-area/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/select/index.d.ts +2 -0
- package/dist/components/ui/select/index.d.ts.map +1 -0
- package/dist/components/ui/select/select.d.ts +14 -0
- package/dist/components/ui/select/select.d.ts.map +1 -0
- package/dist/components/ui/separator/index.d.ts +2 -0
- package/dist/components/ui/separator/index.d.ts.map +1 -0
- package/dist/components/ui/separator/separator.d.ts +5 -0
- package/dist/components/ui/separator/separator.d.ts.map +1 -0
- package/dist/components/ui/sheet/index.d.ts +2 -0
- package/dist/components/ui/sheet/index.d.ts.map +1 -0
- package/dist/components/ui/sheet/sheet.d.ts +26 -0
- package/dist/components/ui/sheet/sheet.d.ts.map +1 -0
- package/dist/components/ui/skeleton/index.d.ts +2 -0
- package/dist/components/ui/skeleton/index.d.ts.map +1 -0
- package/dist/components/ui/skeleton/skeleton.d.ts +3 -0
- package/dist/components/ui/skeleton/skeleton.d.ts.map +1 -0
- package/dist/components/ui/slider/index.d.ts +2 -0
- package/dist/components/ui/slider/index.d.ts.map +1 -0
- package/dist/components/ui/slider/slider.d.ts +5 -0
- package/dist/components/ui/slider/slider.d.ts.map +1 -0
- package/dist/components/ui/statusline/index.d.ts +2 -0
- package/dist/components/ui/statusline/index.d.ts.map +1 -0
- package/dist/components/ui/statusline/statusline.d.ts +40 -0
- package/dist/components/ui/statusline/statusline.d.ts.map +1 -0
- package/dist/components/ui/switch/index.d.ts +2 -0
- package/dist/components/ui/switch/index.d.ts.map +1 -0
- package/dist/components/ui/switch/switch.d.ts +5 -0
- package/dist/components/ui/switch/switch.d.ts.map +1 -0
- package/dist/components/ui/table/index.d.ts +2 -0
- package/dist/components/ui/table/index.d.ts.map +1 -0
- package/dist/components/ui/table/table.d.ts +11 -0
- package/dist/components/ui/table/table.d.ts.map +1 -0
- package/dist/components/ui/tabs/index.d.ts +2 -0
- package/dist/components/ui/tabs/index.d.ts.map +1 -0
- package/dist/components/ui/tabs/tabs.d.ts +8 -0
- package/dist/components/ui/tabs/tabs.d.ts.map +1 -0
- package/dist/components/ui/terminal-textarea/index.d.ts +2 -0
- package/dist/components/ui/terminal-textarea/index.d.ts.map +1 -0
- package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts +27 -0
- package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea/index.d.ts +2 -0
- package/dist/components/ui/textarea/index.d.ts.map +1 -0
- package/dist/components/ui/textarea/textarea.d.ts +5 -0
- package/dist/components/ui/textarea/textarea.d.ts.map +1 -0
- package/dist/components/ui/toggle/index.d.ts +2 -0
- package/dist/components/ui/toggle/index.d.ts.map +1 -0
- package/dist/components/ui/toggle/toggle.d.ts +13 -0
- package/dist/components/ui/toggle/toggle.d.ts.map +1 -0
- package/dist/components/ui/tooltip/index.d.ts +2 -0
- package/dist/components/ui/tooltip/index.d.ts.map +1 -0
- package/dist/components/ui/tooltip/tooltip.d.ts +11 -0
- package/dist/components/ui/tooltip/tooltip.d.ts.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +165 -0
- package/dist/index10.js +61 -0
- package/dist/index100.js +32 -0
- package/dist/index101.js +17 -0
- package/dist/index102.js +137 -0
- package/dist/index103.js +52 -0
- package/dist/index104.js +11 -0
- package/dist/index105.js +6 -0
- package/dist/index106.js +183 -0
- package/dist/index107.js +652 -0
- package/dist/index108.js +109 -0
- package/dist/index109.js +93 -0
- package/dist/index11.js +27 -0
- package/dist/index110.js +69 -0
- package/dist/index111.js +161 -0
- package/dist/index112.js +399 -0
- package/dist/index113.js +1682 -0
- package/dist/index114.js +280 -0
- package/dist/index115.js +134 -0
- package/dist/index116.js +34 -0
- package/dist/index117.js +1613 -0
- package/dist/index118.js +300 -0
- package/dist/index119.js +637 -0
- package/dist/index12.js +7 -0
- package/dist/index120.js +146 -0
- package/dist/index121.js +23 -0
- package/dist/index122.js +11 -0
- package/dist/index123.js +40 -0
- package/dist/index124.js +20 -0
- package/dist/index125.js +8 -0
- package/dist/index126.js +14 -0
- package/dist/index127.js +208 -0
- package/dist/index128.js +24 -0
- package/dist/index129.js +402 -0
- package/dist/index13.js +100 -0
- package/dist/index130.js +1308 -0
- package/dist/index131.js +620 -0
- package/dist/index132.js +4 -0
- package/dist/index133.js +55 -0
- package/dist/index134.js +67 -0
- package/dist/index135.js +27 -0
- package/dist/index136.js +31 -0
- package/dist/index137.js +7 -0
- package/dist/index138.js +4 -0
- package/dist/index139.js +4 -0
- package/dist/index14.js +226 -0
- package/dist/index140.js +7 -0
- package/dist/index141.js +5 -0
- package/dist/index142.js +26 -0
- package/dist/index143.js +115 -0
- package/dist/index144.js +18 -0
- package/dist/index145.js +527 -0
- package/dist/index146.js +130 -0
- package/dist/index147.js +136 -0
- package/dist/index148.js +67 -0
- package/dist/index149.js +71 -0
- package/dist/index15.js +146 -0
- package/dist/index150.js +11 -0
- package/dist/index151.js +16 -0
- package/dist/index152.js +68 -0
- package/dist/index153.js +6 -0
- package/dist/index154.js +25 -0
- package/dist/index155.js +25 -0
- package/dist/index156.js +15 -0
- package/dist/index157.js +30 -0
- package/dist/index158.js +7 -0
- package/dist/index16.js +21 -0
- package/dist/index17.js +19 -0
- package/dist/index18.js +24 -0
- package/dist/index19.js +58 -0
- package/dist/index2.js +8 -0
- package/dist/index20.js +31 -0
- package/dist/index21.js +38 -0
- package/dist/index22.js +123 -0
- package/dist/index23.js +24 -0
- package/dist/index24.js +72 -0
- package/dist/index25.js +17 -0
- package/dist/index26.js +34 -0
- package/dist/index27.js +81 -0
- package/dist/index28.js +27 -0
- package/dist/index29.js +90 -0
- package/dist/index3.js +22 -0
- package/dist/index30.js +46 -0
- package/dist/index31.js +234 -0
- package/dist/index32.js +20 -0
- package/dist/index33.js +37 -0
- package/dist/index34.js +25 -0
- package/dist/index35.js +105 -0
- package/dist/index36.js +68 -0
- package/dist/index37.js +51 -0
- package/dist/index38.js +102 -0
- package/dist/index39.js +13 -0
- package/dist/index4.js +46 -0
- package/dist/index40.js +17 -0
- package/dist/index41.js +2265 -0
- package/dist/index42.js +35 -0
- package/dist/index43.js +20 -0
- package/dist/index44.js +239 -0
- package/dist/index45.js +13 -0
- package/dist/index46.js +75 -0
- package/dist/index47.js +251 -0
- package/dist/index48.js +11 -0
- package/dist/index49.js +338 -0
- package/dist/index5.js +51 -0
- package/dist/index50.js +62 -0
- package/dist/index51.js +243 -0
- package/dist/index52.js +862 -0
- package/dist/index53.js +11 -0
- package/dist/index54.js +120 -0
- package/dist/index55.js +227 -0
- package/dist/index56.js +13 -0
- package/dist/index57.js +13 -0
- package/dist/index58.js +238 -0
- package/dist/index59.js +262 -0
- package/dist/index6.js +51 -0
- package/dist/index60.js +14 -0
- package/dist/index61.js +24 -0
- package/dist/index62.js +532 -0
- package/dist/index63.js +6157 -0
- package/dist/index64.js +2635 -0
- package/dist/index65.js +300 -0
- package/dist/index66.js +674 -0
- package/dist/index67.js +832 -0
- package/dist/index68.js +27 -0
- package/dist/index69.js +330 -0
- package/dist/index7.js +42 -0
- package/dist/index70.js +4901 -0
- package/dist/index71.js +831 -0
- package/dist/index72.js +1260 -0
- package/dist/index73.js +536 -0
- package/dist/index74.js +127 -0
- package/dist/index75.js +163 -0
- package/dist/index76.js +33 -0
- package/dist/index77.js +437 -0
- package/dist/index78.js +132 -0
- package/dist/index79.js +83 -0
- package/dist/index8.js +31 -0
- package/dist/index80.js +70 -0
- package/dist/index81.js +48 -0
- package/dist/index82.js +29 -0
- package/dist/index83.js +9 -0
- package/dist/index84.js +54 -0
- package/dist/index85.js +36 -0
- package/dist/index86.js +13 -0
- package/dist/index87.js +10 -0
- package/dist/index88.js +32 -0
- package/dist/index89.js +57 -0
- package/dist/index9.js +54 -0
- package/dist/index90.js +13 -0
- package/dist/index91.js +6 -0
- package/dist/index92.js +15 -0
- package/dist/index93.js +8 -0
- package/dist/index94.js +27 -0
- package/dist/index95.js +71 -0
- package/dist/index96.js +127 -0
- package/dist/index97.js +221 -0
- package/dist/index98.js +16 -0
- package/dist/index99.js +56 -0
- package/dist/lib/utils.d.ts +14 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/tokens/animations.d.ts +174 -0
- package/dist/tokens/animations.d.ts.map +1 -0
- package/dist/tokens/colors.d.ts +92 -0
- package/dist/tokens/colors.d.ts.map +1 -0
- package/dist/tokens/index.d.ts +403 -0
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/tokens/shadows.d.ts +15 -0
- package/dist/tokens/shadows.d.ts.map +1 -0
- package/dist/tokens/spacing.d.ts +55 -0
- package/dist/tokens/spacing.d.ts.map +1 -0
- package/dist/tokens/typography.d.ts +80 -0
- package/dist/tokens/typography.d.ts.map +1 -0
- package/package.json +128 -0
package/dist/index112.js
ADDED
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
import { Annotation as T, Transaction as L, Text as A, StateEffect as x, StateField as D, Prec as O, EditorSelection as k, Facet as P, MapMode as v, RangeValue as M } from "./index64.js";
|
|
2
|
+
import { EditorView as w, Decoration as g, keymap as B, WidgetType as R } from "./index63.js";
|
|
3
|
+
import { syntaxTree as $, indentUnit as j } from "./index72.js";
|
|
4
|
+
class oe {
|
|
5
|
+
/**
|
|
6
|
+
Create a new completion context. (Mostly useful for testing
|
|
7
|
+
completion sources—in the editor, the extension will create
|
|
8
|
+
these for you.)
|
|
9
|
+
*/
|
|
10
|
+
constructor(t, e, n, i) {
|
|
11
|
+
this.state = t, this.pos = e, this.explicit = n, this.view = i, this.abortListeners = [], this.abortOnDocChange = !1;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
Get the extent, content, and (if there is a token) type of the
|
|
15
|
+
token before `this.pos`.
|
|
16
|
+
*/
|
|
17
|
+
tokenBefore(t) {
|
|
18
|
+
let e = $(this.state).resolveInner(this.pos, -1);
|
|
19
|
+
for (; e && t.indexOf(e.name) < 0; )
|
|
20
|
+
e = e.parent;
|
|
21
|
+
return e ? {
|
|
22
|
+
from: e.from,
|
|
23
|
+
to: this.pos,
|
|
24
|
+
text: this.state.sliceDoc(e.from, this.pos),
|
|
25
|
+
type: e.type
|
|
26
|
+
} : null;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
Get the match of the given expression directly before the
|
|
30
|
+
cursor.
|
|
31
|
+
*/
|
|
32
|
+
matchBefore(t) {
|
|
33
|
+
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(W(t));
|
|
34
|
+
return l < 0 ? null : { from: n + l, to: this.pos, text: i.slice(l) };
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
Yields true when the query has been aborted. Can be useful in
|
|
38
|
+
asynchronous queries to avoid doing work that will be ignored.
|
|
39
|
+
*/
|
|
40
|
+
get aborted() {
|
|
41
|
+
return this.abortListeners == null;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
Allows you to register abort handlers, which will be called when
|
|
45
|
+
the query is
|
|
46
|
+
[aborted](https://codemirror.net/6/docs/ref/#autocomplete.CompletionContext.aborted).
|
|
47
|
+
|
|
48
|
+
By default, running queries will not be aborted for regular
|
|
49
|
+
typing or backspacing, on the assumption that they are likely to
|
|
50
|
+
return a result with a
|
|
51
|
+
[`validFor`](https://codemirror.net/6/docs/ref/#autocomplete.CompletionResult.validFor) field that
|
|
52
|
+
allows the result to be used after all. Passing `onDocChange:
|
|
53
|
+
true` will cause this query to be aborted for any document
|
|
54
|
+
change.
|
|
55
|
+
*/
|
|
56
|
+
addEventListener(t, e, n) {
|
|
57
|
+
t == "abort" && this.abortListeners && (this.abortListeners.push(e), n && n.onDocChange && (this.abortOnDocChange = !0));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function S(o) {
|
|
61
|
+
let t = Object.keys(o).join(""), e = /\w/.test(t);
|
|
62
|
+
return e && (t = t.replace(/\w/g, "")), `[${e ? "\\w" : ""}${t.replace(/[^\w\s]/g, "\\$&")}]`;
|
|
63
|
+
}
|
|
64
|
+
function V(o) {
|
|
65
|
+
let t = /* @__PURE__ */ Object.create(null), e = /* @__PURE__ */ Object.create(null);
|
|
66
|
+
for (let { label: i } of o) {
|
|
67
|
+
t[i[0]] = !0;
|
|
68
|
+
for (let l = 1; l < i.length; l++)
|
|
69
|
+
e[i[l]] = !0;
|
|
70
|
+
}
|
|
71
|
+
let n = S(t) + S(e) + "*$";
|
|
72
|
+
return [new RegExp("^" + n), new RegExp(n)];
|
|
73
|
+
}
|
|
74
|
+
function ie(o) {
|
|
75
|
+
let t = o.map((i) => typeof i == "string" ? { label: i } : i), [e, n] = t.every((i) => /^\w+$/.test(i.label)) ? [/\w*$/, /\w+$/] : V(t);
|
|
76
|
+
return (i) => {
|
|
77
|
+
let l = i.matchBefore(n);
|
|
78
|
+
return l || i.explicit ? { from: l ? l.from : i.pos, options: t, validFor: e } : null;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function le(o, t) {
|
|
82
|
+
return (e) => {
|
|
83
|
+
for (let n = $(e.state).resolveInner(e.pos, -1); n; n = n.parent) {
|
|
84
|
+
if (o.indexOf(n.name) > -1)
|
|
85
|
+
return null;
|
|
86
|
+
if (n.type.isTop)
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
return t(e);
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
function W(o, t) {
|
|
93
|
+
var e;
|
|
94
|
+
let { source: n } = o, i = n[n.length - 1] != "$";
|
|
95
|
+
return i ? new RegExp(`(?:${n})${i ? "$" : ""}`, (e = o.flags) !== null && e !== void 0 ? e : o.ignoreCase ? "i" : "") : o;
|
|
96
|
+
}
|
|
97
|
+
const q = /* @__PURE__ */ T.define(), z = /* @__PURE__ */ w.baseTheme({
|
|
98
|
+
".cm-tooltip.cm-tooltip-autocomplete": {
|
|
99
|
+
"& > ul": {
|
|
100
|
+
fontFamily: "monospace",
|
|
101
|
+
whiteSpace: "nowrap",
|
|
102
|
+
overflow: "hidden auto",
|
|
103
|
+
maxWidth_fallback: "700px",
|
|
104
|
+
maxWidth: "min(700px, 95vw)",
|
|
105
|
+
minWidth: "250px",
|
|
106
|
+
maxHeight: "10em",
|
|
107
|
+
height: "100%",
|
|
108
|
+
listStyle: "none",
|
|
109
|
+
margin: 0,
|
|
110
|
+
padding: 0,
|
|
111
|
+
"& > li, & > completion-section": {
|
|
112
|
+
padding: "1px 3px",
|
|
113
|
+
lineHeight: 1.2
|
|
114
|
+
},
|
|
115
|
+
"& > li": {
|
|
116
|
+
overflowX: "hidden",
|
|
117
|
+
textOverflow: "ellipsis",
|
|
118
|
+
cursor: "pointer"
|
|
119
|
+
},
|
|
120
|
+
"& > completion-section": {
|
|
121
|
+
display: "list-item",
|
|
122
|
+
borderBottom: "1px solid silver",
|
|
123
|
+
paddingLeft: "0.5em",
|
|
124
|
+
opacity: 0.7
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"&light .cm-tooltip-autocomplete ul li[aria-selected]": {
|
|
129
|
+
background: "#17c",
|
|
130
|
+
color: "white"
|
|
131
|
+
},
|
|
132
|
+
"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]": {
|
|
133
|
+
background: "#777"
|
|
134
|
+
},
|
|
135
|
+
"&dark .cm-tooltip-autocomplete ul li[aria-selected]": {
|
|
136
|
+
background: "#347",
|
|
137
|
+
color: "white"
|
|
138
|
+
},
|
|
139
|
+
"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]": {
|
|
140
|
+
background: "#444"
|
|
141
|
+
},
|
|
142
|
+
".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after": {
|
|
143
|
+
content: '"···"',
|
|
144
|
+
opacity: 0.5,
|
|
145
|
+
display: "block",
|
|
146
|
+
textAlign: "center"
|
|
147
|
+
},
|
|
148
|
+
".cm-tooltip.cm-completionInfo": {
|
|
149
|
+
position: "absolute",
|
|
150
|
+
padding: "3px 9px",
|
|
151
|
+
width: "max-content",
|
|
152
|
+
maxWidth: "400px",
|
|
153
|
+
boxSizing: "border-box",
|
|
154
|
+
whiteSpace: "pre-line"
|
|
155
|
+
},
|
|
156
|
+
".cm-completionInfo.cm-completionInfo-left": { right: "100%" },
|
|
157
|
+
".cm-completionInfo.cm-completionInfo-right": { left: "100%" },
|
|
158
|
+
".cm-completionInfo.cm-completionInfo-left-narrow": { right: "30px" },
|
|
159
|
+
".cm-completionInfo.cm-completionInfo-right-narrow": { left: "30px" },
|
|
160
|
+
"&light .cm-snippetField": { backgroundColor: "#00000022" },
|
|
161
|
+
"&dark .cm-snippetField": { backgroundColor: "#ffffff22" },
|
|
162
|
+
".cm-snippetFieldPosition": {
|
|
163
|
+
verticalAlign: "text-top",
|
|
164
|
+
width: 0,
|
|
165
|
+
height: "1.15em",
|
|
166
|
+
display: "inline-block",
|
|
167
|
+
margin: "0 -0.7px -.7em",
|
|
168
|
+
borderLeft: "1.4px dotted #888"
|
|
169
|
+
},
|
|
170
|
+
".cm-completionMatchedText": {
|
|
171
|
+
textDecoration: "underline"
|
|
172
|
+
},
|
|
173
|
+
".cm-completionDetail": {
|
|
174
|
+
marginLeft: "0.5em",
|
|
175
|
+
fontStyle: "italic"
|
|
176
|
+
},
|
|
177
|
+
".cm-completionIcon": {
|
|
178
|
+
fontSize: "90%",
|
|
179
|
+
width: ".8em",
|
|
180
|
+
display: "inline-block",
|
|
181
|
+
textAlign: "center",
|
|
182
|
+
paddingRight: ".6em",
|
|
183
|
+
opacity: "0.6",
|
|
184
|
+
boxSizing: "content-box"
|
|
185
|
+
},
|
|
186
|
+
".cm-completionIcon-function, .cm-completionIcon-method": {
|
|
187
|
+
"&:after": { content: "'ƒ'" }
|
|
188
|
+
},
|
|
189
|
+
".cm-completionIcon-class": {
|
|
190
|
+
"&:after": { content: "'○'" }
|
|
191
|
+
},
|
|
192
|
+
".cm-completionIcon-interface": {
|
|
193
|
+
"&:after": { content: "'◌'" }
|
|
194
|
+
},
|
|
195
|
+
".cm-completionIcon-variable": {
|
|
196
|
+
"&:after": { content: "'𝑥'" }
|
|
197
|
+
},
|
|
198
|
+
".cm-completionIcon-constant": {
|
|
199
|
+
"&:after": { content: "'𝐶'" }
|
|
200
|
+
},
|
|
201
|
+
".cm-completionIcon-type": {
|
|
202
|
+
"&:after": { content: "'𝑡'" }
|
|
203
|
+
},
|
|
204
|
+
".cm-completionIcon-enum": {
|
|
205
|
+
"&:after": { content: "'∪'" }
|
|
206
|
+
},
|
|
207
|
+
".cm-completionIcon-property": {
|
|
208
|
+
"&:after": { content: "'□'" }
|
|
209
|
+
},
|
|
210
|
+
".cm-completionIcon-keyword": {
|
|
211
|
+
"&:after": { content: "'🔑︎'" }
|
|
212
|
+
// Disable emoji rendering
|
|
213
|
+
},
|
|
214
|
+
".cm-completionIcon-namespace": {
|
|
215
|
+
"&:after": { content: "'▢'" }
|
|
216
|
+
},
|
|
217
|
+
".cm-completionIcon-text": {
|
|
218
|
+
"&:after": { content: "'abc'", fontSize: "50%", verticalAlign: "middle" }
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
class H {
|
|
222
|
+
constructor(t, e, n, i) {
|
|
223
|
+
this.field = t, this.line = e, this.from = n, this.to = i;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
class b {
|
|
227
|
+
constructor(t, e, n) {
|
|
228
|
+
this.field = t, this.from = e, this.to = n;
|
|
229
|
+
}
|
|
230
|
+
map(t) {
|
|
231
|
+
let e = t.mapPos(this.from, -1, v.TrackDel), n = t.mapPos(this.to, 1, v.TrackDel);
|
|
232
|
+
return e == null || n == null ? null : new b(this.field, e, n);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
class I {
|
|
236
|
+
constructor(t, e) {
|
|
237
|
+
this.lines = t, this.fieldPositions = e;
|
|
238
|
+
}
|
|
239
|
+
instantiate(t, e) {
|
|
240
|
+
let n = [], i = [e], l = t.doc.lineAt(e), f = /^\s*/.exec(l.text)[0];
|
|
241
|
+
for (let s of this.lines) {
|
|
242
|
+
if (n.length) {
|
|
243
|
+
let a = f, c = /^\t*/.exec(s)[0].length;
|
|
244
|
+
for (let r = 0; r < c; r++)
|
|
245
|
+
a += t.facet(j);
|
|
246
|
+
i.push(e + a.length - c), s = a + s.slice(c);
|
|
247
|
+
}
|
|
248
|
+
n.push(s), e += s.length + 1;
|
|
249
|
+
}
|
|
250
|
+
let p = this.fieldPositions.map((s) => new b(s.field, i[s.line] + s.from, i[s.line] + s.to));
|
|
251
|
+
return { text: n, ranges: p };
|
|
252
|
+
}
|
|
253
|
+
static parse(t) {
|
|
254
|
+
let e = [], n = [], i = [], l;
|
|
255
|
+
for (let f of t.split(/\r\n?|\n/)) {
|
|
256
|
+
for (; l = /[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(f); ) {
|
|
257
|
+
let p = l[1] ? +l[1] : null, s = l[2] || l[3] || "", a = -1, c = s.replace(/\\[{}]/g, (r) => r[1]);
|
|
258
|
+
for (let r = 0; r < e.length; r++)
|
|
259
|
+
(p != null ? e[r].seq == p : c && e[r].name == c) && (a = r);
|
|
260
|
+
if (a < 0) {
|
|
261
|
+
let r = 0;
|
|
262
|
+
for (; r < e.length && (p == null || e[r].seq != null && e[r].seq < p); )
|
|
263
|
+
r++;
|
|
264
|
+
e.splice(r, 0, { seq: p, name: c }), a = r;
|
|
265
|
+
for (let d of i)
|
|
266
|
+
d.field >= a && d.field++;
|
|
267
|
+
}
|
|
268
|
+
for (let r of i)
|
|
269
|
+
if (r.line == n.length && r.from > l.index) {
|
|
270
|
+
let d = l[2] ? 3 + (l[1] || "").length : 2;
|
|
271
|
+
r.from -= d, r.to -= d;
|
|
272
|
+
}
|
|
273
|
+
i.push(new H(a, n.length, l.index, l.index + c.length)), f = f.slice(0, l.index) + s + f.slice(l.index + l[0].length);
|
|
274
|
+
}
|
|
275
|
+
f = f.replace(/\\([{}])/g, (p, s, a) => {
|
|
276
|
+
for (let c of i)
|
|
277
|
+
c.line == n.length && c.from > a && (c.from--, c.to--);
|
|
278
|
+
return s;
|
|
279
|
+
}), n.push(f);
|
|
280
|
+
}
|
|
281
|
+
return new I(n, i);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
let K = /* @__PURE__ */ g.widget({ widget: /* @__PURE__ */ new class extends R {
|
|
285
|
+
toDOM() {
|
|
286
|
+
let o = document.createElement("span");
|
|
287
|
+
return o.className = "cm-snippetFieldPosition", o;
|
|
288
|
+
}
|
|
289
|
+
ignoreEvent() {
|
|
290
|
+
return !1;
|
|
291
|
+
}
|
|
292
|
+
}() }), N = /* @__PURE__ */ g.mark({ class: "cm-snippetField" });
|
|
293
|
+
class m {
|
|
294
|
+
constructor(t, e) {
|
|
295
|
+
this.ranges = t, this.active = e, this.deco = g.set(t.map((n) => (n.from == n.to ? K : N).range(n.from, n.to)), !0);
|
|
296
|
+
}
|
|
297
|
+
map(t) {
|
|
298
|
+
let e = [];
|
|
299
|
+
for (let n of this.ranges) {
|
|
300
|
+
let i = n.map(t);
|
|
301
|
+
if (!i)
|
|
302
|
+
return null;
|
|
303
|
+
e.push(i);
|
|
304
|
+
}
|
|
305
|
+
return new m(e, this.active);
|
|
306
|
+
}
|
|
307
|
+
selectionInsideField(t) {
|
|
308
|
+
return t.ranges.every((e) => this.ranges.some((n) => n.field == this.active && n.from <= e.from && n.to >= e.to));
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
const h = /* @__PURE__ */ x.define({
|
|
312
|
+
map(o, t) {
|
|
313
|
+
return o && o.map(t);
|
|
314
|
+
}
|
|
315
|
+
}), X = /* @__PURE__ */ x.define(), u = /* @__PURE__ */ D.define({
|
|
316
|
+
create() {
|
|
317
|
+
return null;
|
|
318
|
+
},
|
|
319
|
+
update(o, t) {
|
|
320
|
+
for (let e of t.effects) {
|
|
321
|
+
if (e.is(h))
|
|
322
|
+
return e.value;
|
|
323
|
+
if (e.is(X) && o)
|
|
324
|
+
return new m(o.ranges, e.value);
|
|
325
|
+
}
|
|
326
|
+
return o && t.docChanged && (o = o.map(t.changes)), o && t.selection && !o.selectionInsideField(t.selection) && (o = null), o;
|
|
327
|
+
},
|
|
328
|
+
provide: (o) => w.decorations.from(o, (t) => t ? t.deco : g.none)
|
|
329
|
+
});
|
|
330
|
+
function y(o, t) {
|
|
331
|
+
return k.create(o.filter((e) => e.field == t).map((e) => k.range(e.from, e.to)));
|
|
332
|
+
}
|
|
333
|
+
function U(o) {
|
|
334
|
+
let t = I.parse(o);
|
|
335
|
+
return (e, n, i, l) => {
|
|
336
|
+
let { text: f, ranges: p } = t.instantiate(e.state, i), { main: s } = e.state.selection, a = {
|
|
337
|
+
changes: { from: i, to: l == s.from ? s.to : l, insert: A.of(f) },
|
|
338
|
+
scrollIntoView: !0,
|
|
339
|
+
annotations: n ? [q.of(n), L.userEvent.of("input.complete")] : void 0
|
|
340
|
+
};
|
|
341
|
+
if (p.length && (a.selection = y(p, 0)), p.some((c) => c.field > 0)) {
|
|
342
|
+
let c = new m(p, 0), r = a.effects = [h.of(c)];
|
|
343
|
+
e.state.field(u, !1) === void 0 && r.push(x.appendConfig.of([u, Z, _, z]));
|
|
344
|
+
}
|
|
345
|
+
e.dispatch(e.state.update(a));
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
function E(o) {
|
|
349
|
+
return ({ state: t, dispatch: e }) => {
|
|
350
|
+
let n = t.field(u, !1);
|
|
351
|
+
if (!n || o < 0 && n.active == 0)
|
|
352
|
+
return !1;
|
|
353
|
+
let i = n.active + o, l = o > 0 && !n.ranges.some((f) => f.field == i + o);
|
|
354
|
+
return e(t.update({
|
|
355
|
+
selection: y(n.ranges, i),
|
|
356
|
+
effects: h.of(l ? null : new m(n.ranges, i)),
|
|
357
|
+
scrollIntoView: !0
|
|
358
|
+
})), !0;
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
const Y = ({ state: o, dispatch: t }) => o.field(u, !1) ? (t(o.update({ effects: h.of(null) })), !0) : !1, G = /* @__PURE__ */ E(1), J = /* @__PURE__ */ E(-1), Q = [
|
|
362
|
+
{ key: "Tab", run: G, shift: J },
|
|
363
|
+
{ key: "Escape", run: Y }
|
|
364
|
+
], F = /* @__PURE__ */ P.define({
|
|
365
|
+
combine(o) {
|
|
366
|
+
return o.length ? o[0] : Q;
|
|
367
|
+
}
|
|
368
|
+
}), Z = /* @__PURE__ */ O.highest(/* @__PURE__ */ B.compute([F], (o) => o.facet(F)));
|
|
369
|
+
function re(o, t) {
|
|
370
|
+
return { ...t, apply: U(o) };
|
|
371
|
+
}
|
|
372
|
+
const _ = /* @__PURE__ */ w.domEventHandlers({
|
|
373
|
+
mousedown(o, t) {
|
|
374
|
+
let e = t.state.field(u, !1), n;
|
|
375
|
+
if (!e || (n = t.posAtCoords({ x: o.clientX, y: o.clientY })) == null)
|
|
376
|
+
return !1;
|
|
377
|
+
let i = e.ranges.find((l) => l.from <= n && l.to >= n);
|
|
378
|
+
return !i || i.field == e.active ? !1 : (t.dispatch({
|
|
379
|
+
selection: y(e.ranges, i.field),
|
|
380
|
+
effects: h.of(e.ranges.some((l) => l.field > i.field) ? new m(e.ranges, i.field) : null),
|
|
381
|
+
scrollIntoView: !0
|
|
382
|
+
}), !0);
|
|
383
|
+
}
|
|
384
|
+
}), C = /* @__PURE__ */ new class extends M {
|
|
385
|
+
}();
|
|
386
|
+
C.startSide = 1;
|
|
387
|
+
C.endSide = -1;
|
|
388
|
+
export {
|
|
389
|
+
oe as CompletionContext,
|
|
390
|
+
Y as clearSnippet,
|
|
391
|
+
ie as completeFromList,
|
|
392
|
+
le as ifNotIn,
|
|
393
|
+
G as nextSnippetField,
|
|
394
|
+
q as pickedCompletion,
|
|
395
|
+
J as prevSnippetField,
|
|
396
|
+
U as snippet,
|
|
397
|
+
re as snippetCompletion,
|
|
398
|
+
F as snippetKeymap
|
|
399
|
+
};
|