@drjoshcsimmons/scl 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/alert/alert.d.ts +1 -1
- package/dist/components/ui/alert/alert.d.ts.map +1 -1
- package/dist/components/ui/badge/badge.d.ts +1 -1
- package/dist/components/ui/badge/badge.d.ts.map +1 -1
- package/dist/components/ui/button/button.d.ts +1 -1
- package/dist/components/ui/button/button.d.ts.map +1 -1
- package/dist/components/ui/combobox/combobox.d.ts +31 -0
- package/dist/components/ui/combobox/combobox.d.ts.map +1 -0
- package/dist/components/ui/combobox/index.d.ts +3 -0
- package/dist/components/ui/combobox/index.d.ts.map +1 -0
- package/dist/components/ui/command/command.d.ts +85 -0
- package/dist/components/ui/command/command.d.ts.map +1 -0
- package/dist/components/ui/command/index.d.ts +2 -0
- package/dist/components/ui/command/index.d.ts.map +1 -0
- package/dist/components/ui/dithered-image/dithered-image.d.ts +6 -2
- package/dist/components/ui/dithered-image/dithered-image.d.ts.map +1 -1
- package/dist/components/ui/dithered-image/index.d.ts +1 -1
- package/dist/components/ui/dithered-image/index.d.ts.map +1 -1
- package/dist/components/ui/form/form.d.ts +24 -0
- package/dist/components/ui/form/form.d.ts.map +1 -0
- package/dist/components/ui/form/index.d.ts +2 -0
- package/dist/components/ui/form/index.d.ts.map +1 -0
- package/dist/components/ui/progress/progress.d.ts +0 -6
- package/dist/components/ui/progress/progress.d.ts.map +1 -1
- package/dist/components/ui/scroll-area/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/skeleton/skeleton.d.ts +4 -1
- package/dist/components/ui/skeleton/skeleton.d.ts.map +1 -1
- package/dist/components/ui/statusline/statusline.d.ts.map +1 -1
- package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts +0 -5
- package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +166 -143
- package/dist/index10.js +30 -30
- package/dist/index100.js +9 -30
- package/dist/index101.js +50 -15
- package/dist/index102.js +212 -128
- package/dist/index103.js +4 -50
- package/dist/index104.js +30 -9
- package/dist/index105.js +6 -4
- package/dist/index106.js +19 -179
- package/dist/index107.js +9 -650
- package/dist/index108.js +38 -107
- package/dist/index109.js +17 -90
- package/dist/index11.js +13 -13
- package/dist/index110.js +11 -66
- package/dist/index111.js +201 -154
- package/dist/index112.js +20 -395
- package/dist/index113.js +395 -1675
- package/dist/index114.js +2 -278
- package/dist/index115.js +49 -128
- package/dist/index116.js +65 -32
- package/dist/index117.js +2 -1611
- package/dist/index118.js +2 -298
- package/dist/index119.js +22 -632
- package/dist/index12.js +1 -1
- package/dist/index120.js +29 -144
- package/dist/index121.js +5 -21
- package/dist/index122.js +5 -9
- package/dist/index123.js +3 -38
- package/dist/index124.js +24 -18
- package/dist/index125.js +113 -6
- package/dist/index126.js +15 -11
- package/dist/index127.js +513 -194
- package/dist/index128.js +128 -22
- package/dist/index129.js +114 -380
- package/dist/index13.js +132 -93
- package/dist/index130.js +59 -1300
- package/dist/index131.js +63 -612
- package/dist/index132.js +9 -2
- package/dist/index133.js +13 -52
- package/dist/index134.js +64 -63
- package/dist/index135.js +3 -24
- package/dist/index136.js +23 -29
- package/dist/index137.js +23 -5
- package/dist/index138.js +13 -2
- package/dist/index139.js +28 -2
- package/dist/index14.js +106 -220
- package/dist/index140.js +5 -5
- package/dist/index15.js +79 -125
- package/dist/index16.js +280 -17
- package/dist/index17.js +139 -12
- package/dist/index18.js +92 -22
- package/dist/index19.js +18 -55
- package/dist/index2.js +2 -2
- package/dist/index20.js +14 -26
- package/dist/index21.js +19 -33
- package/dist/index22.js +38 -121
- package/dist/index23.js +29 -22
- package/dist/index24.js +31 -64
- package/dist/index25.js +121 -15
- package/dist/index26.js +19 -29
- package/dist/index27.js +68 -77
- package/dist/index28.js +20 -25
- package/dist/index29.js +32 -88
- package/dist/index3.js +11 -9
- package/dist/index30.js +138 -38
- package/dist/index31.js +20 -227
- package/dist/index32.js +88 -18
- package/dist/index33.js +37 -28
- package/dist/index34.js +86 -22
- package/dist/index35.js +17 -102
- package/dist/index36.js +34 -65
- package/dist/index37.js +23 -49
- package/dist/index38.js +38 -99
- package/dist/index39.js +65 -10
- package/dist/index4.js +6 -6
- package/dist/index40.js +49 -15
- package/dist/index41.js +93 -2256
- package/dist/index42.js +10 -32
- package/dist/index43.js +15 -18
- package/dist/index44.js +2251 -225
- package/dist/index45.js +33 -11
- package/dist/index46.js +116 -64
- package/dist/index47.js +207 -219
- package/dist/index48.js +5 -3
- package/dist/index49.js +54 -330
- package/dist/index5.js +23 -23
- package/dist/index50.js +244 -55
- package/dist/index51.js +9 -241
- package/dist/index52.js +60 -847
- package/dist/index53.js +236 -9
- package/dist/index54.js +11 -118
- package/dist/index55.js +300 -215
- package/dist/index56.js +4 -3
- package/dist/index57.js +225 -11
- package/dist/index58.js +11 -236
- package/dist/index59.js +27 -256
- package/dist/index6.js +12 -12
- package/dist/index60.js +260 -12
- package/dist/index61.js +12 -22
- package/dist/index62.js +94 -506
- package/dist/index63.js +12 -6155
- package/dist/index64.js +20 -2631
- package/dist/index65.js +16 -296
- package/dist/index66.js +232 -663
- package/dist/index67.js +125 -825
- package/dist/index68.js +159 -23
- package/dist/index69.js +241 -315
- package/dist/index7.js +22 -22
- package/dist/index70.js +72 -4889
- package/dist/index71.js +503 -802
- package/dist/index72.js +412 -1235
- package/dist/index73.js +323 -521
- package/dist/index74.js +839 -104
- package/dist/index75.js +9 -161
- package/dist/index76.js +67 -30
- package/dist/index77.js +22 -430
- package/dist/index78.js +6 -129
- package/dist/index79.js +48 -75
- package/dist/index8.js +17 -18
- package/dist/index80.js +42 -64
- package/dist/index81.js +50 -44
- package/dist/index82.js +32 -25
- package/dist/index83.js +10 -6
- package/dist/index84.js +7 -51
- package/dist/index85.js +5 -33
- package/dist/index86.js +24 -10
- package/dist/index87.js +68 -7
- package/dist/index88.js +55 -30
- package/dist/index89.js +10 -54
- package/dist/index9.js +23 -31
- package/dist/index90.js +4 -11
- package/dist/index91.js +30 -4
- package/dist/index92.js +1 -1
- package/dist/index93.js +180 -5
- package/dist/index94.js +14 -24
- package/dist/index95.js +643 -62
- package/dist/index96.js +5 -5
- package/dist/index97.js +128 -212
- package/dist/index98.js +2 -2
- package/dist/index99.js +13 -52
- package/dist/tokens/colors.d.ts +26 -86
- package/dist/tokens/colors.d.ts.map +1 -1
- package/dist/tokens/index.d.ts +12 -84
- package/dist/tokens/index.d.ts.map +1 -1
- package/package.json +26 -22
- package/dist/index141.js +0 -5
- package/dist/index142.js +0 -26
- package/dist/index143.js +0 -115
- package/dist/index144.js +0 -18
- package/dist/index145.js +0 -527
- package/dist/index146.js +0 -130
- package/dist/index147.js +0 -136
- package/dist/index148.js +0 -67
- package/dist/index149.js +0 -71
- package/dist/index150.js +0 -11
- package/dist/index151.js +0 -16
- package/dist/index152.js +0 -68
- package/dist/index153.js +0 -6
- package/dist/index154.js +0 -25
- package/dist/index155.js +0 -25
- package/dist/index156.js +0 -15
- package/dist/index157.js +0 -30
- package/dist/index158.js +0 -7
package/dist/index72.js
CHANGED
|
@@ -1,1260 +1,437 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
Query whether this language is active at the given position.
|
|
46
|
-
*/
|
|
47
|
-
isActiveAt(e, t, r = -1) {
|
|
48
|
-
return J(e, t, r).type.prop(T) == this.data;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
Find the document regions that were parsed using this language.
|
|
52
|
-
The returned regions will _include_ any nested languages rooted
|
|
53
|
-
in this language, when those exist.
|
|
54
|
-
*/
|
|
55
|
-
findRegions(e) {
|
|
56
|
-
let t = e.facet(C);
|
|
57
|
-
if ((t == null ? void 0 : t.data) == this.data)
|
|
58
|
-
return [{ from: 0, to: e.doc.length }];
|
|
59
|
-
if (!t || !t.allowsNesting)
|
|
60
|
-
return [];
|
|
61
|
-
let r = [], i = (s, o) => {
|
|
62
|
-
if (s.prop(T) == this.data) {
|
|
63
|
-
r.push({ from: o, to: o + s.length });
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
let a = s.prop(p.mounted);
|
|
67
|
-
if (a) {
|
|
68
|
-
if (a.tree.prop(T) == this.data) {
|
|
69
|
-
if (a.overlay)
|
|
70
|
-
for (let l of a.overlay)
|
|
71
|
-
r.push({ from: l.from + o, to: l.to + o });
|
|
72
|
-
else
|
|
73
|
-
r.push({ from: o, to: o + s.length });
|
|
74
|
-
return;
|
|
75
|
-
} else if (a.overlay) {
|
|
76
|
-
let l = r.length;
|
|
77
|
-
if (i(a.tree, a.overlay[0].from + o), r.length > l)
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
for (let l = 0; l < s.children.length; l++) {
|
|
82
|
-
let u = s.children[l];
|
|
83
|
-
u instanceof x && i(u, s.positions[l] + o);
|
|
1
|
+
import * as d from "react";
|
|
2
|
+
import { clamp as $ } from "./index103.js";
|
|
3
|
+
import { composeEventHandlers as C } from "./index78.js";
|
|
4
|
+
import { useComposedRefs as M } from "./index77.js";
|
|
5
|
+
import { createContextScope as ce } from "./index76.js";
|
|
6
|
+
import { useControllableState as le } from "./index81.js";
|
|
7
|
+
import { useDirection as de } from "./index84.js";
|
|
8
|
+
import { usePrevious as ue } from "./index85.js";
|
|
9
|
+
import { useSize as fe } from "./index86.js";
|
|
10
|
+
import { Primitive as K } from "./index82.js";
|
|
11
|
+
import { createCollection as me } from "./index80.js";
|
|
12
|
+
import { jsx as v, jsxs as pe } from "react/jsx-runtime";
|
|
13
|
+
var j = ["PageUp", "PageDown"], X = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], G = {
|
|
14
|
+
"from-left": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
|
|
15
|
+
"from-right": ["Home", "PageDown", "ArrowDown", "ArrowRight"],
|
|
16
|
+
"from-bottom": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
|
|
17
|
+
"from-top": ["Home", "PageDown", "ArrowUp", "ArrowLeft"]
|
|
18
|
+
}, I = "Slider", [z, he, Se] = me(I), [W] = ce(I, [
|
|
19
|
+
Se
|
|
20
|
+
]), [ge, T] = W(I), q = d.forwardRef(
|
|
21
|
+
(e, t) => {
|
|
22
|
+
const {
|
|
23
|
+
name: o,
|
|
24
|
+
min: n = 0,
|
|
25
|
+
max: a = 100,
|
|
26
|
+
step: c = 1,
|
|
27
|
+
orientation: r = "horizontal",
|
|
28
|
+
disabled: s = !1,
|
|
29
|
+
minStepsBetweenThumbs: l = 0,
|
|
30
|
+
defaultValue: h = [n],
|
|
31
|
+
value: S,
|
|
32
|
+
onValueChange: i = () => {
|
|
33
|
+
},
|
|
34
|
+
onValueCommit: u = () => {
|
|
35
|
+
},
|
|
36
|
+
inverted: w = !1,
|
|
37
|
+
form: P,
|
|
38
|
+
...g
|
|
39
|
+
} = e, m = d.useRef(/* @__PURE__ */ new Set()), f = d.useRef(0), b = r === "horizontal" ? ve : we, [p = [], A] = le({
|
|
40
|
+
prop: S,
|
|
41
|
+
defaultProp: h,
|
|
42
|
+
onChange: (R) => {
|
|
43
|
+
var E;
|
|
44
|
+
(E = [...m.current][f.current]) == null || E.focus(), i(R);
|
|
84
45
|
}
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
Indicates whether this language allows nested languages. The
|
|
90
|
-
default implementation returns true.
|
|
91
|
-
*/
|
|
92
|
-
get allowsNesting() {
|
|
93
|
-
return !0;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
c.setState = /* @__PURE__ */ O.define();
|
|
97
|
-
function J(n, e, t) {
|
|
98
|
-
let r = n.facet(C), i = k(n).topNode;
|
|
99
|
-
if (!r || r.allowsNesting)
|
|
100
|
-
for (let s = i; s; s = s.enter(e, t, me.ExcludeBuffers))
|
|
101
|
-
s.type.isTop && (i = s);
|
|
102
|
-
return i;
|
|
103
|
-
}
|
|
104
|
-
class M extends c {
|
|
105
|
-
constructor(e, t, r) {
|
|
106
|
-
super(e, t, [], r), this.parser = t;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
Define a language from a parser.
|
|
110
|
-
*/
|
|
111
|
-
static define(e) {
|
|
112
|
-
let t = Ae(e.languageData);
|
|
113
|
-
return new M(t, e.parser.configure({
|
|
114
|
-
props: [T.add((r) => r.isTop ? t : void 0)]
|
|
115
|
-
}), e.name);
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
Create a new instance of this language with a reconfigured
|
|
119
|
-
version of its parser and optionally a new name.
|
|
120
|
-
*/
|
|
121
|
-
configure(e, t) {
|
|
122
|
-
return new M(this.data, this.parser.configure(e), t || this.name);
|
|
123
|
-
}
|
|
124
|
-
get allowsNesting() {
|
|
125
|
-
return this.parser.hasWrappers();
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
function k(n) {
|
|
129
|
-
let e = n.field(c.state, !1);
|
|
130
|
-
return e ? e.tree : x.empty;
|
|
131
|
-
}
|
|
132
|
-
function mt(n, e, t = 50) {
|
|
133
|
-
var r;
|
|
134
|
-
let i = (r = n.field(c.state, !1)) === null || r === void 0 ? void 0 : r.context;
|
|
135
|
-
if (!i)
|
|
136
|
-
return null;
|
|
137
|
-
let s = i.viewport;
|
|
138
|
-
i.updateViewport({ from: 0, to: e });
|
|
139
|
-
let o = i.isDone(e) || i.work(t, e) ? i.tree : null;
|
|
140
|
-
return i.updateViewport(s), o;
|
|
141
|
-
}
|
|
142
|
-
class Ie {
|
|
143
|
-
/**
|
|
144
|
-
Create an input object for the given document.
|
|
145
|
-
*/
|
|
146
|
-
constructor(e) {
|
|
147
|
-
this.doc = e, this.cursorPos = 0, this.string = "", this.cursor = e.iter();
|
|
148
|
-
}
|
|
149
|
-
get length() {
|
|
150
|
-
return this.doc.length;
|
|
151
|
-
}
|
|
152
|
-
syncTo(e) {
|
|
153
|
-
return this.string = this.cursor.next(e - this.cursorPos).value, this.cursorPos = e + this.string.length, this.cursorPos - this.string.length;
|
|
154
|
-
}
|
|
155
|
-
chunk(e) {
|
|
156
|
-
return this.syncTo(e), this.string;
|
|
157
|
-
}
|
|
158
|
-
get lineChunks() {
|
|
159
|
-
return !0;
|
|
160
|
-
}
|
|
161
|
-
read(e, t) {
|
|
162
|
-
let r = this.cursorPos - this.string.length;
|
|
163
|
-
return e < r || t >= this.cursorPos ? this.doc.sliceString(e, t) : this.string.slice(e - r, t - r);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
let A = null;
|
|
167
|
-
class D {
|
|
168
|
-
constructor(e, t, r = [], i, s, o, a, l) {
|
|
169
|
-
this.parser = e, this.state = t, this.fragments = r, this.tree = i, this.treeLen = s, this.viewport = o, this.skipped = a, this.scheduleOn = l, this.parse = null, this.tempSkipped = [];
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
@internal
|
|
173
|
-
*/
|
|
174
|
-
static create(e, t, r) {
|
|
175
|
-
return new D(e, t, [], x.empty, 0, r, [], null);
|
|
176
|
-
}
|
|
177
|
-
startParse() {
|
|
178
|
-
return this.parser.startParse(new Ie(this.state.doc), this.fragments);
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
@internal
|
|
182
|
-
*/
|
|
183
|
-
work(e, t) {
|
|
184
|
-
return t != null && t >= this.state.doc.length && (t = void 0), this.tree != x.empty && this.isDone(t ?? this.state.doc.length) ? (this.takeTree(), !0) : this.withContext(() => {
|
|
185
|
-
var r;
|
|
186
|
-
if (typeof e == "number") {
|
|
187
|
-
let i = Date.now() + e;
|
|
188
|
-
e = () => Date.now() > i;
|
|
189
|
-
}
|
|
190
|
-
for (this.parse || (this.parse = this.startParse()), t != null && (this.parse.stoppedAt == null || this.parse.stoppedAt > t) && t < this.state.doc.length && this.parse.stopAt(t); ; ) {
|
|
191
|
-
let i = this.parse.advance();
|
|
192
|
-
if (i)
|
|
193
|
-
if (this.fragments = this.withoutTempSkipped(P.addTree(i, this.fragments, this.parse.stoppedAt != null)), this.treeLen = (r = this.parse.stoppedAt) !== null && r !== void 0 ? r : this.state.doc.length, this.tree = i, this.parse = null, this.treeLen < (t ?? this.state.doc.length))
|
|
194
|
-
this.parse = this.startParse();
|
|
195
|
-
else
|
|
196
|
-
return !0;
|
|
197
|
-
if (e())
|
|
198
|
-
return !1;
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
@internal
|
|
204
|
-
*/
|
|
205
|
-
takeTree() {
|
|
206
|
-
let e, t;
|
|
207
|
-
this.parse && (e = this.parse.parsedPos) >= this.treeLen && ((this.parse.stoppedAt == null || this.parse.stoppedAt > e) && this.parse.stopAt(e), this.withContext(() => {
|
|
208
|
-
for (; !(t = this.parse.advance()); )
|
|
209
|
-
;
|
|
210
|
-
}), this.treeLen = e, this.tree = t, this.fragments = this.withoutTempSkipped(P.addTree(this.tree, this.fragments, !0)), this.parse = null);
|
|
211
|
-
}
|
|
212
|
-
withContext(e) {
|
|
213
|
-
let t = A;
|
|
214
|
-
A = this;
|
|
215
|
-
try {
|
|
216
|
-
return e();
|
|
217
|
-
} finally {
|
|
218
|
-
A = t;
|
|
46
|
+
}), k = d.useRef(p);
|
|
47
|
+
function H(R) {
|
|
48
|
+
const x = ye(p, R);
|
|
49
|
+
V(R, x);
|
|
219
50
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
for (let t; t = this.tempSkipped.pop(); )
|
|
223
|
-
e = G(e, t.from, t.to);
|
|
224
|
-
return e;
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
@internal
|
|
228
|
-
*/
|
|
229
|
-
changes(e, t) {
|
|
230
|
-
let { fragments: r, tree: i, treeLen: s, viewport: o, skipped: a } = this;
|
|
231
|
-
if (this.takeTree(), !e.empty) {
|
|
232
|
-
let l = [];
|
|
233
|
-
if (e.iterChangedRanges((u, h, f, m) => l.push({ fromA: u, toA: h, fromB: f, toB: m })), r = P.applyChanges(r, l), i = x.empty, s = 0, o = { from: e.mapPos(o.from, -1), to: e.mapPos(o.to, 1) }, this.skipped.length) {
|
|
234
|
-
a = [];
|
|
235
|
-
for (let u of this.skipped) {
|
|
236
|
-
let h = e.mapPos(u.from, 1), f = e.mapPos(u.to, -1);
|
|
237
|
-
h < f && a.push({ from: h, to: f });
|
|
238
|
-
}
|
|
239
|
-
}
|
|
51
|
+
function se(R) {
|
|
52
|
+
V(R, f.current);
|
|
240
53
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
@internal
|
|
245
|
-
*/
|
|
246
|
-
updateViewport(e) {
|
|
247
|
-
if (this.viewport.from == e.from && this.viewport.to == e.to)
|
|
248
|
-
return !1;
|
|
249
|
-
this.viewport = e;
|
|
250
|
-
let t = this.skipped.length;
|
|
251
|
-
for (let r = 0; r < this.skipped.length; r++) {
|
|
252
|
-
let { from: i, to: s } = this.skipped[r];
|
|
253
|
-
i < e.to && s > e.from && (this.fragments = G(this.fragments, i, s), this.skipped.splice(r--, 1));
|
|
54
|
+
function ae() {
|
|
55
|
+
const R = k.current[f.current];
|
|
56
|
+
p[f.current] !== R && u(p);
|
|
254
57
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
58
|
+
function V(R, x, { commit: E } = { commit: !1 }) {
|
|
59
|
+
const F = Ce(c), N = Me(Math.round((R - n) / c) * c + n, F), B = $(N, [n, a]);
|
|
60
|
+
A((_ = []) => {
|
|
61
|
+
const y = Pe(_, B, x);
|
|
62
|
+
if (_e(y, l * c)) {
|
|
63
|
+
f.current = y.indexOf(B);
|
|
64
|
+
const Y = String(y) !== String(_);
|
|
65
|
+
return Y && E && u(y), Y ? y : _;
|
|
66
|
+
} else
|
|
67
|
+
return _;
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return /* @__PURE__ */ v(
|
|
71
|
+
ge,
|
|
72
|
+
{
|
|
73
|
+
scope: e.__scopeSlider,
|
|
74
|
+
name: o,
|
|
75
|
+
disabled: s,
|
|
76
|
+
min: n,
|
|
77
|
+
max: a,
|
|
78
|
+
valueIndexToChangeRef: f,
|
|
79
|
+
thumbs: m.current,
|
|
80
|
+
values: p,
|
|
81
|
+
orientation: r,
|
|
82
|
+
form: P,
|
|
83
|
+
children: /* @__PURE__ */ v(z.Provider, { scope: e.__scopeSlider, children: /* @__PURE__ */ v(z.Slot, { scope: e.__scopeSlider, children: /* @__PURE__ */ v(
|
|
84
|
+
b,
|
|
85
|
+
{
|
|
86
|
+
"aria-disabled": s,
|
|
87
|
+
"data-disabled": s ? "" : void 0,
|
|
88
|
+
...g,
|
|
89
|
+
ref: t,
|
|
90
|
+
onPointerDown: C(g.onPointerDown, () => {
|
|
91
|
+
s || (k.current = p);
|
|
92
|
+
}),
|
|
93
|
+
min: n,
|
|
94
|
+
max: a,
|
|
95
|
+
inverted: w,
|
|
96
|
+
onSlideStart: s ? void 0 : H,
|
|
97
|
+
onSlideMove: s ? void 0 : se,
|
|
98
|
+
onSlideEnd: s ? void 0 : ae,
|
|
99
|
+
onHomeKeyDown: () => !s && V(n, 0, { commit: !0 }),
|
|
100
|
+
onEndKeyDown: () => !s && V(a, p.length - 1, { commit: !0 }),
|
|
101
|
+
onStepKeyDown: ({ event: R, direction: x }) => {
|
|
102
|
+
if (!s) {
|
|
103
|
+
const N = j.includes(R.key) || R.shiftKey && X.includes(R.key) ? 10 : 1, B = f.current, _ = p[B], y = c * N * x;
|
|
104
|
+
V(_ + y, B, { commit: !0 });
|
|
105
|
+
}
|
|
292
106
|
}
|
|
293
|
-
return this.parsedPos = o, new x(V.none, [], [], o - s);
|
|
294
|
-
},
|
|
295
|
-
stoppedAt: null,
|
|
296
|
-
stopAt() {
|
|
297
107
|
}
|
|
298
|
-
}
|
|
108
|
+
) }) })
|
|
299
109
|
}
|
|
300
|
-
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
apply(e) {
|
|
326
|
-
if (!e.docChanged && this.tree == this.context.tree)
|
|
327
|
-
return this;
|
|
328
|
-
let t = this.context.changes(e.changes, e.state), r = this.context.treeLen == e.startState.doc.length ? void 0 : Math.max(e.changes.mapPos(this.context.treeLen), t.viewport.to);
|
|
329
|
-
return t.work(20, r) || t.takeTree(), new S(t);
|
|
330
|
-
}
|
|
331
|
-
static init(e) {
|
|
332
|
-
let t = Math.min(3e3, e.doc.length), r = D.create(e.facet(C).parser, e, { from: 0, to: t });
|
|
333
|
-
return r.work(20, t) || r.takeTree(), new S(r);
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
c.state = /* @__PURE__ */ ee.define({
|
|
337
|
-
create: S.init,
|
|
338
|
-
update(n, e) {
|
|
339
|
-
for (let t of e.effects)
|
|
340
|
-
if (t.is(c.setState))
|
|
341
|
-
return t.value;
|
|
342
|
-
return e.startState.facet(C) != e.state.facet(C) ? S.init(e.state) : n.apply(e);
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
let ne = (n) => {
|
|
346
|
-
let e = setTimeout(
|
|
347
|
-
() => n(),
|
|
348
|
-
500
|
|
349
|
-
/* Work.MaxPause */
|
|
350
|
-
);
|
|
351
|
-
return () => clearTimeout(e);
|
|
352
|
-
};
|
|
353
|
-
typeof requestIdleCallback < "u" && (ne = (n) => {
|
|
354
|
-
let e = -1, t = setTimeout(
|
|
355
|
-
() => {
|
|
356
|
-
e = requestIdleCallback(n, {
|
|
357
|
-
timeout: 400
|
|
358
|
-
/* Work.MinPause */
|
|
359
|
-
});
|
|
360
|
-
},
|
|
361
|
-
100
|
|
362
|
-
/* Work.MinPause */
|
|
363
|
-
);
|
|
364
|
-
return () => e < 0 ? clearTimeout(t) : cancelIdleCallback(e);
|
|
365
|
-
});
|
|
366
|
-
const F = typeof navigator < "u" && (!((N = navigator.scheduling) === null || N === void 0) && N.isInputPending) ? () => navigator.scheduling.isInputPending() : null, De = /* @__PURE__ */ te.fromClass(class {
|
|
367
|
-
constructor(e) {
|
|
368
|
-
this.view = e, this.working = null, this.workScheduled = 0, this.chunkEnd = -1, this.chunkBudget = -1, this.work = this.work.bind(this), this.scheduleWork();
|
|
369
|
-
}
|
|
370
|
-
update(e) {
|
|
371
|
-
let t = this.view.state.field(c.state).context;
|
|
372
|
-
(t.updateViewport(e.view.viewport) || this.view.viewport.to > t.treeLen) && this.scheduleWork(), (e.docChanged || e.selectionSet) && (this.view.hasFocus && (this.chunkBudget += 50), this.scheduleWork()), this.checkAsyncSchedule(t);
|
|
373
|
-
}
|
|
374
|
-
scheduleWork() {
|
|
375
|
-
if (this.working)
|
|
376
|
-
return;
|
|
377
|
-
let { state: e } = this.view, t = e.field(c.state);
|
|
378
|
-
(t.tree != t.context.tree || !t.context.isDone(e.doc.length)) && (this.working = ne(this.work));
|
|
379
|
-
}
|
|
380
|
-
work(e) {
|
|
381
|
-
this.working = null;
|
|
382
|
-
let t = Date.now();
|
|
383
|
-
if (this.chunkEnd < t && (this.chunkEnd < 0 || this.view.hasFocus) && (this.chunkEnd = t + 3e4, this.chunkBudget = 3e3), this.chunkBudget <= 0)
|
|
384
|
-
return;
|
|
385
|
-
let { state: r, viewport: { to: i } } = this.view, s = r.field(c.state);
|
|
386
|
-
if (s.tree == s.context.tree && s.context.isDone(
|
|
387
|
-
i + 1e5
|
|
388
|
-
/* Work.MaxParseAhead */
|
|
389
|
-
))
|
|
390
|
-
return;
|
|
391
|
-
let o = Date.now() + Math.min(this.chunkBudget, 100, e && !F ? Math.max(25, e.timeRemaining() - 5) : 1e9), a = s.context.treeLen < i && r.doc.length > i + 1e3, l = s.context.work(() => F && F() || Date.now() > o, i + (a ? 0 : 1e5));
|
|
392
|
-
this.chunkBudget -= Date.now() - t, (l || this.chunkBudget <= 0) && (s.context.takeTree(), this.view.dispatch({ effects: c.setState.of(new S(s.context)) })), this.chunkBudget > 0 && !(l && !a) && this.scheduleWork(), this.checkAsyncSchedule(s.context);
|
|
393
|
-
}
|
|
394
|
-
checkAsyncSchedule(e) {
|
|
395
|
-
e.scheduleOn && (this.workScheduled++, e.scheduleOn.then(() => this.scheduleWork()).catch((t) => be(this.view.state, t)).then(() => this.workScheduled--), e.scheduleOn = null);
|
|
396
|
-
}
|
|
397
|
-
destroy() {
|
|
398
|
-
this.working && this.working();
|
|
399
|
-
}
|
|
400
|
-
isWorking() {
|
|
401
|
-
return !!(this.working || this.workScheduled > 0);
|
|
402
|
-
}
|
|
403
|
-
}, {
|
|
404
|
-
eventHandlers: { focus() {
|
|
405
|
-
this.scheduleWork();
|
|
406
|
-
} }
|
|
407
|
-
}), C = /* @__PURE__ */ w.define({
|
|
408
|
-
combine(n) {
|
|
409
|
-
return n.length ? n[0] : null;
|
|
410
|
-
},
|
|
411
|
-
enables: (n) => [
|
|
412
|
-
c.state,
|
|
413
|
-
De,
|
|
414
|
-
y.contentAttributes.compute([n], (e) => {
|
|
415
|
-
let t = e.facet(n);
|
|
416
|
-
return t && t.name ? { "data-language": t.name } : {};
|
|
417
|
-
})
|
|
418
|
-
]
|
|
419
|
-
});
|
|
420
|
-
class kt {
|
|
421
|
-
/**
|
|
422
|
-
Create a language support object.
|
|
423
|
-
*/
|
|
424
|
-
constructor(e, t = []) {
|
|
425
|
-
this.language = e, this.support = t, this.extension = [e, t];
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
class ie {
|
|
429
|
-
constructor(e, t, r, i, s, o = void 0) {
|
|
430
|
-
this.name = e, this.alias = t, this.extensions = r, this.filename = i, this.loadFunc = s, this.support = o, this.loading = null;
|
|
431
|
-
}
|
|
432
|
-
/**
|
|
433
|
-
Start loading the the language. Will return a promise that
|
|
434
|
-
resolves to a [`LanguageSupport`](https://codemirror.net/6/docs/ref/#language.LanguageSupport)
|
|
435
|
-
object when the language successfully loads.
|
|
436
|
-
*/
|
|
437
|
-
load() {
|
|
438
|
-
return this.loading || (this.loading = this.loadFunc().then((e) => this.support = e, (e) => {
|
|
439
|
-
throw this.loading = null, e;
|
|
440
|
-
}));
|
|
441
|
-
}
|
|
442
|
-
/**
|
|
443
|
-
Create a language description.
|
|
444
|
-
*/
|
|
445
|
-
static of(e) {
|
|
446
|
-
let { load: t, support: r } = e;
|
|
447
|
-
if (!t) {
|
|
448
|
-
if (!r)
|
|
449
|
-
throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");
|
|
450
|
-
t = () => Promise.resolve(r);
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
q.displayName = I;
|
|
114
|
+
var [J, Q] = W(I, {
|
|
115
|
+
startEdge: "left",
|
|
116
|
+
endEdge: "right",
|
|
117
|
+
size: "width",
|
|
118
|
+
direction: 1
|
|
119
|
+
}), ve = d.forwardRef(
|
|
120
|
+
(e, t) => {
|
|
121
|
+
const {
|
|
122
|
+
min: o,
|
|
123
|
+
max: n,
|
|
124
|
+
dir: a,
|
|
125
|
+
inverted: c,
|
|
126
|
+
onSlideStart: r,
|
|
127
|
+
onSlideMove: s,
|
|
128
|
+
onSlideEnd: l,
|
|
129
|
+
onStepKeyDown: h,
|
|
130
|
+
...S
|
|
131
|
+
} = e, [i, u] = d.useState(null), w = M(t, (b) => u(b)), P = d.useRef(void 0), g = de(a), m = g === "ltr", f = m && !c || !m && c;
|
|
132
|
+
function D(b) {
|
|
133
|
+
const p = P.current || i.getBoundingClientRect(), A = [0, p.width], H = U(A, f ? [o, n] : [n, o]);
|
|
134
|
+
return P.current = p, H(b - p.left);
|
|
451
135
|
}
|
|
452
|
-
return
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
136
|
+
return /* @__PURE__ */ v(
|
|
137
|
+
J,
|
|
138
|
+
{
|
|
139
|
+
scope: e.__scopeSlider,
|
|
140
|
+
startEdge: f ? "left" : "right",
|
|
141
|
+
endEdge: f ? "right" : "left",
|
|
142
|
+
direction: f ? 1 : -1,
|
|
143
|
+
size: "width",
|
|
144
|
+
children: /* @__PURE__ */ v(
|
|
145
|
+
Z,
|
|
146
|
+
{
|
|
147
|
+
dir: g,
|
|
148
|
+
"data-orientation": "horizontal",
|
|
149
|
+
...S,
|
|
150
|
+
ref: w,
|
|
151
|
+
style: {
|
|
152
|
+
...S.style,
|
|
153
|
+
"--radix-slider-thumb-transform": "translateX(-50%)"
|
|
154
|
+
},
|
|
155
|
+
onSlideStart: (b) => {
|
|
156
|
+
const p = D(b.clientX);
|
|
157
|
+
r == null || r(p);
|
|
158
|
+
},
|
|
159
|
+
onSlideMove: (b) => {
|
|
160
|
+
const p = D(b.clientX);
|
|
161
|
+
s == null || s(p);
|
|
162
|
+
},
|
|
163
|
+
onSlideEnd: () => {
|
|
164
|
+
P.current = void 0, l == null || l();
|
|
165
|
+
},
|
|
166
|
+
onStepKeyDown: (b) => {
|
|
167
|
+
const A = G[f ? "from-left" : "from-right"].includes(b.key);
|
|
168
|
+
h == null || h({ event: b, direction: A ? -1 : 1 });
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
)
|
|
172
|
+
}
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
), we = d.forwardRef(
|
|
176
|
+
(e, t) => {
|
|
177
|
+
const {
|
|
178
|
+
min: o,
|
|
179
|
+
max: n,
|
|
180
|
+
inverted: a,
|
|
181
|
+
onSlideStart: c,
|
|
182
|
+
onSlideMove: r,
|
|
183
|
+
onSlideEnd: s,
|
|
184
|
+
onStepKeyDown: l,
|
|
185
|
+
...h
|
|
186
|
+
} = e, S = d.useRef(null), i = M(t, S), u = d.useRef(void 0), w = !a;
|
|
187
|
+
function P(g) {
|
|
188
|
+
const m = u.current || S.current.getBoundingClientRect(), f = [0, m.height], b = U(f, w ? [n, o] : [o, n]);
|
|
189
|
+
return u.current = m, b(g - m.top);
|
|
470
190
|
}
|
|
471
|
-
return
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
191
|
+
return /* @__PURE__ */ v(
|
|
192
|
+
J,
|
|
193
|
+
{
|
|
194
|
+
scope: e.__scopeSlider,
|
|
195
|
+
startEdge: w ? "bottom" : "top",
|
|
196
|
+
endEdge: w ? "top" : "bottom",
|
|
197
|
+
size: "height",
|
|
198
|
+
direction: w ? 1 : -1,
|
|
199
|
+
children: /* @__PURE__ */ v(
|
|
200
|
+
Z,
|
|
201
|
+
{
|
|
202
|
+
"data-orientation": "vertical",
|
|
203
|
+
...h,
|
|
204
|
+
ref: i,
|
|
205
|
+
style: {
|
|
206
|
+
...h.style,
|
|
207
|
+
"--radix-slider-thumb-transform": "translateY(50%)"
|
|
208
|
+
},
|
|
209
|
+
onSlideStart: (g) => {
|
|
210
|
+
const m = P(g.clientY);
|
|
211
|
+
c == null || c(m);
|
|
212
|
+
},
|
|
213
|
+
onSlideMove: (g) => {
|
|
214
|
+
const m = P(g.clientY);
|
|
215
|
+
r == null || r(m);
|
|
216
|
+
},
|
|
217
|
+
onSlideEnd: () => {
|
|
218
|
+
u.current = void 0, s == null || s();
|
|
219
|
+
},
|
|
220
|
+
onStepKeyDown: (g) => {
|
|
221
|
+
const f = G[w ? "from-bottom" : "from-top"].includes(g.key);
|
|
222
|
+
l == null || l({ event: g, direction: f ? -1 : 1 });
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
)
|
|
226
|
+
}
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
), Z = d.forwardRef(
|
|
230
|
+
(e, t) => {
|
|
231
|
+
const {
|
|
232
|
+
__scopeSlider: o,
|
|
233
|
+
onSlideStart: n,
|
|
234
|
+
onSlideMove: a,
|
|
235
|
+
onSlideEnd: c,
|
|
236
|
+
onHomeKeyDown: r,
|
|
237
|
+
onEndKeyDown: s,
|
|
238
|
+
onStepKeyDown: l,
|
|
239
|
+
...h
|
|
240
|
+
} = e, S = T(I, o);
|
|
241
|
+
return /* @__PURE__ */ v(
|
|
242
|
+
K.span,
|
|
243
|
+
{
|
|
244
|
+
...h,
|
|
245
|
+
ref: t,
|
|
246
|
+
onKeyDown: C(e.onKeyDown, (i) => {
|
|
247
|
+
i.key === "Home" ? (r(i), i.preventDefault()) : i.key === "End" ? (s(i), i.preventDefault()) : j.concat(X).includes(i.key) && (l(i), i.preventDefault());
|
|
248
|
+
}),
|
|
249
|
+
onPointerDown: C(e.onPointerDown, (i) => {
|
|
250
|
+
const u = i.target;
|
|
251
|
+
u.setPointerCapture(i.pointerId), i.preventDefault(), S.thumbs.has(u) ? u.focus() : n(i);
|
|
252
|
+
}),
|
|
253
|
+
onPointerMove: C(e.onPointerMove, (i) => {
|
|
254
|
+
i.target.hasPointerCapture(i.pointerId) && a(i);
|
|
255
|
+
}),
|
|
256
|
+
onPointerUp: C(e.onPointerUp, (i) => {
|
|
257
|
+
const u = i.target;
|
|
258
|
+
u.hasPointerCapture(i.pointerId) && (u.releasePointerCapture(i.pointerId), c(i));
|
|
259
|
+
})
|
|
260
|
+
}
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
), ee = "SliderTrack", te = d.forwardRef(
|
|
264
|
+
(e, t) => {
|
|
265
|
+
const { __scopeSlider: o, ...n } = e, a = T(ee, o);
|
|
266
|
+
return /* @__PURE__ */ v(
|
|
267
|
+
K.span,
|
|
268
|
+
{
|
|
269
|
+
"data-disabled": a.disabled ? "" : void 0,
|
|
270
|
+
"data-orientation": a.orientation,
|
|
271
|
+
...n,
|
|
272
|
+
ref: t
|
|
273
|
+
}
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
);
|
|
277
|
+
te.displayName = ee;
|
|
278
|
+
var L = "SliderRange", ne = d.forwardRef(
|
|
279
|
+
(e, t) => {
|
|
280
|
+
const { __scopeSlider: o, ...n } = e, a = T(L, o), c = Q(L, o), r = d.useRef(null), s = M(t, r), l = a.values.length, h = a.values.map(
|
|
281
|
+
(u) => ie(u, a.min, a.max)
|
|
282
|
+
), S = l > 1 ? Math.min(...h) : 0, i = 100 - Math.max(...h);
|
|
283
|
+
return /* @__PURE__ */ v(
|
|
284
|
+
K.span,
|
|
285
|
+
{
|
|
286
|
+
"data-orientation": a.orientation,
|
|
287
|
+
"data-disabled": a.disabled ? "" : void 0,
|
|
288
|
+
...n,
|
|
289
|
+
ref: s,
|
|
290
|
+
style: {
|
|
291
|
+
...e.style,
|
|
292
|
+
[c.startEdge]: S + "%",
|
|
293
|
+
[c.endEdge]: i + "%"
|
|
491
294
|
}
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
let { text: r, from: i } = this.lineAt(e, t), s = this.options.overrideIndentation;
|
|
578
|
-
if (s) {
|
|
579
|
-
let o = s(i);
|
|
580
|
-
if (o > -1)
|
|
581
|
-
return o;
|
|
582
|
-
}
|
|
583
|
-
return this.countColumn(r, r.search(/\S|$/));
|
|
584
|
-
}
|
|
585
|
-
/**
|
|
586
|
-
Returns the [simulated line
|
|
587
|
-
break](https://codemirror.net/6/docs/ref/#language.IndentContext.constructor^options.simulateBreak)
|
|
588
|
-
for this context, if any.
|
|
589
|
-
*/
|
|
590
|
-
get simulatedBreak() {
|
|
591
|
-
return this.options.simulateBreak || null;
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
const Ne = /* @__PURE__ */ new p();
|
|
595
|
-
function Fe(n, e, t) {
|
|
596
|
-
let r = e.resolveStack(t), i = e.resolveInner(t, -1).resolve(t, 0).enterUnfinishedNodesBefore(t);
|
|
597
|
-
if (i != r.node) {
|
|
598
|
-
let s = [];
|
|
599
|
-
for (let o = i; o && !(o.from < r.node.from || o.to > r.node.to || o.from == r.node.from && o.type == r.node.type); o = o.parent)
|
|
600
|
-
s.push(o);
|
|
601
|
-
for (let o = s.length - 1; o >= 0; o--)
|
|
602
|
-
r = { node: s[o], next: r };
|
|
603
|
-
}
|
|
604
|
-
return le(r, n, t);
|
|
605
|
-
}
|
|
606
|
-
function le(n, e, t) {
|
|
607
|
-
for (let r = n; r; r = r.next) {
|
|
608
|
-
let i = Le(r.node);
|
|
609
|
-
if (i)
|
|
610
|
-
return i($.create(e, t, r));
|
|
611
|
-
}
|
|
612
|
-
return 0;
|
|
613
|
-
}
|
|
614
|
-
function Ee(n) {
|
|
615
|
-
return n.pos == n.options.simulateBreak && n.options.simulateDoubleBreak;
|
|
616
|
-
}
|
|
617
|
-
function Le(n) {
|
|
618
|
-
let e = n.type.prop(Ne);
|
|
619
|
-
if (e)
|
|
620
|
-
return e;
|
|
621
|
-
let t = n.firstChild, r;
|
|
622
|
-
if (t && (r = t.type.prop(p.closedBy))) {
|
|
623
|
-
let i = n.lastChild, s = i && r.indexOf(i.name) > -1;
|
|
624
|
-
return (o) => ae(o, !0, 1, void 0, s && !Ee(o) ? i.from : void 0);
|
|
625
|
-
}
|
|
626
|
-
return n.parent == null ? Me : null;
|
|
627
|
-
}
|
|
628
|
-
function Me() {
|
|
629
|
-
return 0;
|
|
630
|
-
}
|
|
631
|
-
class $ extends oe {
|
|
632
|
-
constructor(e, t, r) {
|
|
633
|
-
super(e.state, e.options), this.base = e, this.pos = t, this.context = r;
|
|
634
|
-
}
|
|
635
|
-
/**
|
|
636
|
-
The syntax tree node to which the indentation strategy
|
|
637
|
-
applies.
|
|
638
|
-
*/
|
|
639
|
-
get node() {
|
|
640
|
-
return this.context.node;
|
|
641
|
-
}
|
|
642
|
-
/**
|
|
643
|
-
@internal
|
|
644
|
-
*/
|
|
645
|
-
static create(e, t, r) {
|
|
646
|
-
return new $(e, t, r);
|
|
647
|
-
}
|
|
648
|
-
/**
|
|
649
|
-
Get the text directly after `this.pos`, either the entire line
|
|
650
|
-
or the next 100 characters, whichever is shorter.
|
|
651
|
-
*/
|
|
652
|
-
get textAfter() {
|
|
653
|
-
return this.textAfterPos(this.pos);
|
|
654
|
-
}
|
|
655
|
-
/**
|
|
656
|
-
Get the indentation at the reference line for `this.node`, which
|
|
657
|
-
is the line on which it starts, unless there is a node that is
|
|
658
|
-
_not_ a parent of this node covering the start of that line. If
|
|
659
|
-
so, the line at the start of that node is tried, again skipping
|
|
660
|
-
on if it is covered by another such node.
|
|
661
|
-
*/
|
|
662
|
-
get baseIndent() {
|
|
663
|
-
return this.baseIndentFor(this.node);
|
|
664
|
-
}
|
|
665
|
-
/**
|
|
666
|
-
Get the indentation for the reference line of the given node
|
|
667
|
-
(see [`baseIndent`](https://codemirror.net/6/docs/ref/#language.TreeIndentContext.baseIndent)).
|
|
668
|
-
*/
|
|
669
|
-
baseIndentFor(e) {
|
|
670
|
-
let t = this.state.doc.lineAt(e.from);
|
|
671
|
-
for (; ; ) {
|
|
672
|
-
let r = e.resolve(t.from);
|
|
673
|
-
for (; r.parent && r.parent.from == r.from; )
|
|
674
|
-
r = r.parent;
|
|
675
|
-
if (We(r, e))
|
|
676
|
-
break;
|
|
677
|
-
t = this.state.doc.lineAt(r.from);
|
|
678
|
-
}
|
|
679
|
-
return this.lineIndent(t.from);
|
|
680
|
-
}
|
|
681
|
-
/**
|
|
682
|
-
Continue looking for indentations in the node's parent nodes,
|
|
683
|
-
and return the result of that.
|
|
684
|
-
*/
|
|
685
|
-
continue() {
|
|
686
|
-
return le(this.context.next, this.base, this.pos);
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
function We(n, e) {
|
|
690
|
-
for (let t = e; t; t = t.parent)
|
|
691
|
-
if (n == t)
|
|
692
|
-
return !0;
|
|
693
|
-
return !1;
|
|
694
|
-
}
|
|
695
|
-
function Re(n) {
|
|
696
|
-
let e = n.node, t = e.childAfter(e.from), r = e.lastChild;
|
|
697
|
-
if (!t)
|
|
698
|
-
return null;
|
|
699
|
-
let i = n.options.simulateBreak, s = n.state.doc.lineAt(t.from), o = i == null || i <= s.from ? s.to : Math.min(s.to, i);
|
|
700
|
-
for (let a = t.to; ; ) {
|
|
701
|
-
let l = e.childAfter(a);
|
|
702
|
-
if (!l || l == r)
|
|
703
|
-
return null;
|
|
704
|
-
if (!l.type.isSkipped) {
|
|
705
|
-
if (l.from >= o)
|
|
706
|
-
return null;
|
|
707
|
-
let u = /^ */.exec(s.text.slice(t.to - s.from))[0].length;
|
|
708
|
-
return { from: t.from, to: t.to + u };
|
|
709
|
-
}
|
|
710
|
-
a = l.to;
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
function vt({ closing: n, align: e = !0, units: t = 1 }) {
|
|
714
|
-
return (r) => ae(r, e, t, n);
|
|
715
|
-
}
|
|
716
|
-
function ae(n, e, t, r, i) {
|
|
717
|
-
let s = n.textAfter, o = s.match(/^\s*/)[0].length, a = r && s.slice(o, o + r.length) == r || i == n.pos + o, l = e ? Re(n) : null;
|
|
718
|
-
return l ? a ? n.column(l.from) : n.column(l.to) : n.baseIndent + (a ? 0 : n.unit * t);
|
|
719
|
-
}
|
|
720
|
-
const bt = (n) => n.baseIndent;
|
|
721
|
-
function xt({ except: n, units: e = 1 } = {}) {
|
|
722
|
-
return (t) => {
|
|
723
|
-
let r = n && n.test(t.textAfter);
|
|
724
|
-
return t.baseIndent + (r ? 0 : e * t.unit);
|
|
725
|
-
};
|
|
726
|
-
}
|
|
727
|
-
const He = /* @__PURE__ */ w.define(), Ve = /* @__PURE__ */ new p();
|
|
728
|
-
function Tt(n) {
|
|
729
|
-
let e = n.firstChild, t = n.lastChild;
|
|
730
|
-
return e && e.to < t.from ? { from: e.to, to: t.type.isError ? n.to : t.from } : null;
|
|
731
|
-
}
|
|
732
|
-
function $e(n, e, t) {
|
|
733
|
-
let r = k(n);
|
|
734
|
-
if (r.length < t)
|
|
735
|
-
return null;
|
|
736
|
-
let i = r.resolveStack(t, 1), s = null;
|
|
737
|
-
for (let o = i; o; o = o.next) {
|
|
738
|
-
let a = o.node;
|
|
739
|
-
if (a.to <= t || a.from > t)
|
|
740
|
-
continue;
|
|
741
|
-
if (s && a.from < e)
|
|
742
|
-
break;
|
|
743
|
-
let l = a.type.prop(Ve);
|
|
744
|
-
if (l && (a.to < r.length - 50 || r.length == n.doc.length || !Ue(a))) {
|
|
745
|
-
let u = l(a, n);
|
|
746
|
-
u && u.from <= t && u.from >= e && u.to > t && (s = u);
|
|
747
|
-
}
|
|
295
|
+
}
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
);
|
|
299
|
+
ne.displayName = L;
|
|
300
|
+
var O = "SliderThumb", oe = d.forwardRef(
|
|
301
|
+
(e, t) => {
|
|
302
|
+
const o = he(e.__scopeSlider), [n, a] = d.useState(null), c = M(t, (s) => a(s)), r = d.useMemo(
|
|
303
|
+
() => n ? o().findIndex((s) => s.ref.current === n) : -1,
|
|
304
|
+
[o, n]
|
|
305
|
+
);
|
|
306
|
+
return /* @__PURE__ */ v(be, { ...e, ref: c, index: r });
|
|
307
|
+
}
|
|
308
|
+
), be = d.forwardRef(
|
|
309
|
+
(e, t) => {
|
|
310
|
+
const { __scopeSlider: o, index: n, name: a, ...c } = e, r = T(O, o), s = Q(O, o), [l, h] = d.useState(null), S = M(t, (D) => h(D)), i = l ? r.form || !!l.closest("form") : !0, u = fe(l), w = r.values[n], P = w === void 0 ? 0 : ie(w, r.min, r.max), g = xe(n, r.values.length), m = u == null ? void 0 : u[s.size], f = m ? De(m, P, s.direction) : 0;
|
|
311
|
+
return d.useEffect(() => {
|
|
312
|
+
if (l)
|
|
313
|
+
return r.thumbs.add(l), () => {
|
|
314
|
+
r.thumbs.delete(l);
|
|
315
|
+
};
|
|
316
|
+
}, [l, r.thumbs]), /* @__PURE__ */ pe(
|
|
317
|
+
"span",
|
|
318
|
+
{
|
|
319
|
+
style: {
|
|
320
|
+
transform: "var(--radix-slider-thumb-transform)",
|
|
321
|
+
position: "absolute",
|
|
322
|
+
[s.startEdge]: `calc(${P}% + ${f}px)`
|
|
323
|
+
},
|
|
324
|
+
children: [
|
|
325
|
+
/* @__PURE__ */ v(z.ItemSlot, { scope: e.__scopeSlider, children: /* @__PURE__ */ v(
|
|
326
|
+
K.span,
|
|
327
|
+
{
|
|
328
|
+
role: "slider",
|
|
329
|
+
"aria-label": e["aria-label"] || g,
|
|
330
|
+
"aria-valuemin": r.min,
|
|
331
|
+
"aria-valuenow": w,
|
|
332
|
+
"aria-valuemax": r.max,
|
|
333
|
+
"aria-orientation": r.orientation,
|
|
334
|
+
"data-orientation": r.orientation,
|
|
335
|
+
"data-disabled": r.disabled ? "" : void 0,
|
|
336
|
+
tabIndex: r.disabled ? void 0 : 0,
|
|
337
|
+
...c,
|
|
338
|
+
ref: S,
|
|
339
|
+
style: w === void 0 ? { display: "none" } : e.style,
|
|
340
|
+
onFocus: C(e.onFocus, () => {
|
|
341
|
+
r.valueIndexToChangeRef.current = n;
|
|
342
|
+
})
|
|
343
|
+
}
|
|
344
|
+
) }),
|
|
345
|
+
i && /* @__PURE__ */ v(
|
|
346
|
+
re,
|
|
347
|
+
{
|
|
348
|
+
name: a ?? (r.name ? r.name + (r.values.length > 1 ? "[]" : "") : void 0),
|
|
349
|
+
form: r.form,
|
|
350
|
+
value: w
|
|
351
|
+
},
|
|
352
|
+
n
|
|
353
|
+
)
|
|
354
|
+
]
|
|
355
|
+
}
|
|
356
|
+
);
|
|
357
|
+
}
|
|
358
|
+
);
|
|
359
|
+
oe.displayName = O;
|
|
360
|
+
var Re = "RadioBubbleInput", re = d.forwardRef(
|
|
361
|
+
({ __scopeSlider: e, value: t, ...o }, n) => {
|
|
362
|
+
const a = d.useRef(null), c = M(a, n), r = ue(t);
|
|
363
|
+
return d.useEffect(() => {
|
|
364
|
+
const s = a.current;
|
|
365
|
+
if (!s) return;
|
|
366
|
+
const l = window.HTMLInputElement.prototype, S = Object.getOwnPropertyDescriptor(l, "value").set;
|
|
367
|
+
if (r !== t && S) {
|
|
368
|
+
const i = new Event("input", { bubbles: !0 });
|
|
369
|
+
S.call(s, t), s.dispatchEvent(i);
|
|
370
|
+
}
|
|
371
|
+
}, [r, t]), /* @__PURE__ */ v(
|
|
372
|
+
K.input,
|
|
373
|
+
{
|
|
374
|
+
style: { display: "none" },
|
|
375
|
+
...o,
|
|
376
|
+
ref: c,
|
|
377
|
+
defaultValue: t
|
|
378
|
+
}
|
|
379
|
+
);
|
|
748
380
|
}
|
|
749
|
-
|
|
381
|
+
);
|
|
382
|
+
re.displayName = Re;
|
|
383
|
+
function Pe(e = [], t, o) {
|
|
384
|
+
const n = [...e];
|
|
385
|
+
return n[o] = t, n.sort((a, c) => a - c);
|
|
750
386
|
}
|
|
751
|
-
function
|
|
752
|
-
|
|
753
|
-
return
|
|
387
|
+
function ie(e, t, o) {
|
|
388
|
+
const c = 100 / (o - t) * (e - t);
|
|
389
|
+
return $(c, [0, 100]);
|
|
754
390
|
}
|
|
755
|
-
function
|
|
756
|
-
|
|
757
|
-
let i = r(n, e, t);
|
|
758
|
-
if (i)
|
|
759
|
-
return i;
|
|
760
|
-
}
|
|
761
|
-
return $e(n, e, t);
|
|
391
|
+
function xe(e, t) {
|
|
392
|
+
return t > 2 ? `Value ${e + 1} of ${t}` : t === 2 ? ["Minimum", "Maximum"][e] : void 0;
|
|
762
393
|
}
|
|
763
|
-
function
|
|
764
|
-
|
|
765
|
-
|
|
394
|
+
function ye(e, t) {
|
|
395
|
+
if (e.length === 1) return 0;
|
|
396
|
+
const o = e.map((a) => Math.abs(a - t)), n = Math.min(...o);
|
|
397
|
+
return o.indexOf(n);
|
|
766
398
|
}
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
for (let { head: t } of n.state.selection.ranges)
|
|
771
|
-
e.some((r) => r.from <= t && r.to >= t) || e.push(n.lineBlockAt(t));
|
|
772
|
-
return e;
|
|
399
|
+
function De(e, t, o) {
|
|
400
|
+
const n = e / 2, c = U([0, 50], [0, n]);
|
|
401
|
+
return (n - c(t) * o) * o;
|
|
773
402
|
}
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
return g.none;
|
|
777
|
-
},
|
|
778
|
-
update(n, e) {
|
|
779
|
-
e.isUserEvent("delete") && e.changes.iterChangedRanges((t, r) => n = K(n, t, r)), n = n.map(e.changes);
|
|
780
|
-
for (let t of e.effects)
|
|
781
|
-
if (t.is(he) && !Je(n, t.value.from, t.value.to)) {
|
|
782
|
-
let { preparePlaceholder: r } = e.state.facet(ce), i = r ? g.replace({ widget: new Ye(r(e.state, t.value)) }) : Q;
|
|
783
|
-
n = n.update({ add: [i.range(t.value.from, t.value.to)] });
|
|
784
|
-
} else t.is(fe) && (n = n.update({
|
|
785
|
-
filter: (r, i) => t.value.from != r || t.value.to != i,
|
|
786
|
-
filterFrom: t.value.from,
|
|
787
|
-
filterTo: t.value.to
|
|
788
|
-
}));
|
|
789
|
-
return e.selection && (n = K(n, e.selection.main.head)), n;
|
|
790
|
-
},
|
|
791
|
-
provide: (n) => y.decorations.from(n),
|
|
792
|
-
toJSON(n, e) {
|
|
793
|
-
let t = [];
|
|
794
|
-
return n.between(0, e.doc.length, (r, i) => {
|
|
795
|
-
t.push(r, i);
|
|
796
|
-
}), t;
|
|
797
|
-
},
|
|
798
|
-
fromJSON(n) {
|
|
799
|
-
if (!Array.isArray(n) || n.length % 2)
|
|
800
|
-
throw new RangeError("Invalid JSON for fold state");
|
|
801
|
-
let e = [];
|
|
802
|
-
for (let t = 0; t < n.length; ) {
|
|
803
|
-
let r = n[t++], i = n[t++];
|
|
804
|
-
if (typeof r != "number" || typeof i != "number")
|
|
805
|
-
throw new RangeError("Invalid JSON for fold state");
|
|
806
|
-
e.push(Q.range(r, i));
|
|
807
|
-
}
|
|
808
|
-
return g.set(e, !0);
|
|
809
|
-
}
|
|
810
|
-
});
|
|
811
|
-
function K(n, e, t = e) {
|
|
812
|
-
let r = !1;
|
|
813
|
-
return n.between(e, t, (i, s) => {
|
|
814
|
-
i < t && s > e && (r = !0);
|
|
815
|
-
}), r ? n.update({
|
|
816
|
-
filterFrom: e,
|
|
817
|
-
filterTo: t,
|
|
818
|
-
filter: (i, s) => i >= t || s <= e
|
|
819
|
-
}) : n;
|
|
403
|
+
function Ee(e) {
|
|
404
|
+
return e.slice(0, -1).map((t, o) => e[o + 1] - t);
|
|
820
405
|
}
|
|
821
|
-
function
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
(!i || i.from > s) && (i = { from: s, to: o });
|
|
826
|
-
}), i;
|
|
827
|
-
}
|
|
828
|
-
function Je(n, e, t) {
|
|
829
|
-
let r = !1;
|
|
830
|
-
return n.between(e, e, (i, s) => {
|
|
831
|
-
i == e && s == t && (r = !0);
|
|
832
|
-
}), r;
|
|
833
|
-
}
|
|
834
|
-
function Ge(n, e) {
|
|
835
|
-
return n.field(U, !1) ? e : e.concat(O.appendConfig.of(Xe()));
|
|
836
|
-
}
|
|
837
|
-
const St = (n) => {
|
|
838
|
-
for (let e of ze(n)) {
|
|
839
|
-
let t = je(n.state, e.from, e.to);
|
|
840
|
-
if (t)
|
|
841
|
-
return n.dispatch({ effects: Ge(n.state, [he.of(t), Ke(n, t)]) }), !0;
|
|
842
|
-
}
|
|
843
|
-
return !1;
|
|
844
|
-
};
|
|
845
|
-
function Ke(n, e, t = !0) {
|
|
846
|
-
let r = n.state.doc.lineAt(e.from).number, i = n.state.doc.lineAt(e.to).number;
|
|
847
|
-
return y.announce.of(`${n.state.phrase(t ? "Folded lines" : "Unfolded lines")} ${r} ${n.state.phrase("to")} ${i}.`);
|
|
848
|
-
}
|
|
849
|
-
const Qe = {
|
|
850
|
-
placeholderDOM: null,
|
|
851
|
-
preparePlaceholder: null,
|
|
852
|
-
placeholderText: "…"
|
|
853
|
-
}, ce = /* @__PURE__ */ w.define({
|
|
854
|
-
combine(n) {
|
|
855
|
-
return ve(n, Qe);
|
|
406
|
+
function _e(e, t) {
|
|
407
|
+
if (t > 0) {
|
|
408
|
+
const o = Ee(e);
|
|
409
|
+
return Math.min(...o) >= t;
|
|
856
410
|
}
|
|
857
|
-
|
|
858
|
-
function Xe(n) {
|
|
859
|
-
return [U, Ze];
|
|
411
|
+
return !0;
|
|
860
412
|
}
|
|
861
|
-
function
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
413
|
+
function U(e, t) {
|
|
414
|
+
return (o) => {
|
|
415
|
+
if (e[0] === e[1] || t[0] === t[1]) return t[0];
|
|
416
|
+
const n = (t[1] - t[0]) / (e[1] - e[0]);
|
|
417
|
+
return t[0] + n * (o - e[0]);
|
|
865
418
|
};
|
|
866
|
-
if (r.placeholderDOM)
|
|
867
|
-
return r.placeholderDOM(n, i, e);
|
|
868
|
-
let s = document.createElement("span");
|
|
869
|
-
return s.textContent = r.placeholderText, s.setAttribute("aria-label", t.phrase("folded code")), s.title = t.phrase("unfold"), s.className = "cm-foldPlaceholder", s.onclick = i, s;
|
|
870
419
|
}
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
return de(n, null);
|
|
874
|
-
}
|
|
875
|
-
}() });
|
|
876
|
-
class Ye extends re {
|
|
877
|
-
constructor(e) {
|
|
878
|
-
super(), this.value = e;
|
|
879
|
-
}
|
|
880
|
-
eq(e) {
|
|
881
|
-
return this.value == e.value;
|
|
882
|
-
}
|
|
883
|
-
toDOM(e) {
|
|
884
|
-
return de(e, this.value);
|
|
885
|
-
}
|
|
420
|
+
function Ce(e) {
|
|
421
|
+
return (String(e).split(".")[1] || "").length;
|
|
886
422
|
}
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
border: "1px solid #ddd",
|
|
891
|
-
color: "#888",
|
|
892
|
-
borderRadius: ".2em",
|
|
893
|
-
margin: "0 1px",
|
|
894
|
-
padding: "0 1px",
|
|
895
|
-
cursor: "pointer"
|
|
896
|
-
},
|
|
897
|
-
".cm-foldGutter span": {
|
|
898
|
-
padding: "0 1px",
|
|
899
|
-
cursor: "pointer"
|
|
900
|
-
}
|
|
901
|
-
});
|
|
902
|
-
class j {
|
|
903
|
-
constructor(e, t) {
|
|
904
|
-
this.specs = e;
|
|
905
|
-
let r;
|
|
906
|
-
function i(a) {
|
|
907
|
-
let l = q.newName();
|
|
908
|
-
return (r || (r = /* @__PURE__ */ Object.create(null)))["." + l] = a, l;
|
|
909
|
-
}
|
|
910
|
-
const s = typeof t.all == "string" ? t.all : t.all ? i(t.all) : void 0, o = t.scope;
|
|
911
|
-
this.scope = o instanceof c ? (a) => a.prop(T) == o.data : o ? (a) => a == o : void 0, this.style = xe(e.map((a) => ({
|
|
912
|
-
tag: a.tag,
|
|
913
|
-
class: a.class || i(Object.assign({}, a, { tag: null }))
|
|
914
|
-
})), {
|
|
915
|
-
all: s
|
|
916
|
-
}).style, this.module = r ? new q(r) : null, this.themeType = t.themeType;
|
|
917
|
-
}
|
|
918
|
-
/**
|
|
919
|
-
Create a highlighter style that associates the given styles to
|
|
920
|
-
the given tags. The specs must be objects that hold a style tag
|
|
921
|
-
or array of tags in their `tag` property, and either a single
|
|
922
|
-
`class` property providing a static CSS class (for highlighter
|
|
923
|
-
that rely on external styling), or a
|
|
924
|
-
[`style-mod`](https://github.com/marijnh/style-mod#documentation)-style
|
|
925
|
-
set of CSS properties (which define the styling for those tags).
|
|
926
|
-
|
|
927
|
-
The CSS rules created for a highlighter will be emitted in the
|
|
928
|
-
order of the spec's properties. That means that for elements that
|
|
929
|
-
have multiple tags associated with them, styles defined further
|
|
930
|
-
down in the list will have a higher CSS precedence than styles
|
|
931
|
-
defined earlier.
|
|
932
|
-
*/
|
|
933
|
-
static define(e, t) {
|
|
934
|
-
return new j(e, t || {});
|
|
935
|
-
}
|
|
936
|
-
}
|
|
937
|
-
const W = /* @__PURE__ */ w.define(), _e = /* @__PURE__ */ w.define({
|
|
938
|
-
combine(n) {
|
|
939
|
-
return n.length ? [n[0]] : null;
|
|
940
|
-
}
|
|
941
|
-
});
|
|
942
|
-
function E(n) {
|
|
943
|
-
let e = n.facet(W);
|
|
944
|
-
return e.length ? e : n.facet(_e);
|
|
945
|
-
}
|
|
946
|
-
function Ct(n, e) {
|
|
947
|
-
let t = [tt], r;
|
|
948
|
-
return n instanceof j && (n.module && t.push(y.styleModule.of(n.module)), r = n.themeType), r ? t.push(W.computeN([y.darkTheme], (i) => i.facet(y.darkTheme) == (r == "dark") ? [n] : [])) : t.push(W.of(n)), t;
|
|
949
|
-
}
|
|
950
|
-
class et {
|
|
951
|
-
constructor(e) {
|
|
952
|
-
this.markCache = /* @__PURE__ */ Object.create(null), this.tree = k(e.state), this.decorations = this.buildDeco(e, E(e.state)), this.decoratedTo = e.viewport.to;
|
|
953
|
-
}
|
|
954
|
-
update(e) {
|
|
955
|
-
let t = k(e.state), r = E(e.state), i = r != E(e.startState), { viewport: s } = e.view, o = e.changes.mapPos(this.decoratedTo, 1);
|
|
956
|
-
t.length < s.to && !i && t.type == this.tree.type && o >= s.to ? (this.decorations = this.decorations.map(e.changes), this.decoratedTo = o) : (t != this.tree || e.viewportChanged || i) && (this.tree = t, this.decorations = this.buildDeco(e.view, r), this.decoratedTo = s.to);
|
|
957
|
-
}
|
|
958
|
-
buildDeco(e, t) {
|
|
959
|
-
if (!t || !this.tree.length)
|
|
960
|
-
return g.none;
|
|
961
|
-
let r = new ye();
|
|
962
|
-
for (let { from: i, to: s } of e.visibleRanges)
|
|
963
|
-
Te(this.tree, t, (o, a, l) => {
|
|
964
|
-
r.add(o, a, this.markCache[l] || (this.markCache[l] = g.mark({ class: l })));
|
|
965
|
-
}, i, s);
|
|
966
|
-
return r.finish();
|
|
967
|
-
}
|
|
968
|
-
}
|
|
969
|
-
const tt = /* @__PURE__ */ ke.high(/* @__PURE__ */ te.fromClass(et, {
|
|
970
|
-
decorations: (n) => n.decorations
|
|
971
|
-
})), rt = 1e4, nt = "()[]{}", it = /* @__PURE__ */ new p();
|
|
972
|
-
function R(n, e, t) {
|
|
973
|
-
let r = n.prop(e < 0 ? p.openedBy : p.closedBy);
|
|
974
|
-
if (r)
|
|
975
|
-
return r;
|
|
976
|
-
if (n.name.length == 1) {
|
|
977
|
-
let i = t.indexOf(n.name);
|
|
978
|
-
if (i > -1 && i % 2 == (e < 0 ? 1 : 0))
|
|
979
|
-
return [t[i + e]];
|
|
980
|
-
}
|
|
981
|
-
return null;
|
|
982
|
-
}
|
|
983
|
-
function H(n) {
|
|
984
|
-
let e = n.type.prop(it);
|
|
985
|
-
return e ? e(n.node) : n;
|
|
986
|
-
}
|
|
987
|
-
function At(n, e, t, r = {}) {
|
|
988
|
-
let i = r.maxScanDistance || rt, s = r.brackets || nt, o = k(n), a = o.resolveInner(e, t);
|
|
989
|
-
for (let l = a; l; l = l.parent) {
|
|
990
|
-
let u = R(l.type, t, s);
|
|
991
|
-
if (u && l.from < l.to) {
|
|
992
|
-
let h = H(l);
|
|
993
|
-
if (h && (t > 0 ? e >= h.from && e < h.to : e > h.from && e <= h.to))
|
|
994
|
-
return st(n, e, t, l, h, u, s);
|
|
995
|
-
}
|
|
996
|
-
}
|
|
997
|
-
return ot(n, e, t, o, a.type, i, s);
|
|
998
|
-
}
|
|
999
|
-
function st(n, e, t, r, i, s, o) {
|
|
1000
|
-
let a = r.parent, l = { from: i.from, to: i.to }, u = 0, h = a == null ? void 0 : a.cursor();
|
|
1001
|
-
if (h && (t < 0 ? h.childBefore(r.from) : h.childAfter(r.to)))
|
|
1002
|
-
do
|
|
1003
|
-
if (t < 0 ? h.to <= r.from : h.from >= r.to) {
|
|
1004
|
-
if (u == 0 && s.indexOf(h.type.name) > -1 && h.from < h.to) {
|
|
1005
|
-
let f = H(h);
|
|
1006
|
-
return { start: l, end: f ? { from: f.from, to: f.to } : void 0, matched: !0 };
|
|
1007
|
-
} else if (R(h.type, t, o))
|
|
1008
|
-
u++;
|
|
1009
|
-
else if (R(h.type, -t, o)) {
|
|
1010
|
-
if (u == 0) {
|
|
1011
|
-
let f = H(h);
|
|
1012
|
-
return {
|
|
1013
|
-
start: l,
|
|
1014
|
-
end: f && f.from < f.to ? { from: f.from, to: f.to } : void 0,
|
|
1015
|
-
matched: !1
|
|
1016
|
-
};
|
|
1017
|
-
}
|
|
1018
|
-
u--;
|
|
1019
|
-
}
|
|
1020
|
-
}
|
|
1021
|
-
while (t < 0 ? h.prevSibling() : h.nextSibling());
|
|
1022
|
-
return { start: l, matched: !1 };
|
|
1023
|
-
}
|
|
1024
|
-
function ot(n, e, t, r, i, s, o) {
|
|
1025
|
-
let a = t < 0 ? n.sliceDoc(e - 1, e) : n.sliceDoc(e, e + 1), l = o.indexOf(a);
|
|
1026
|
-
if (l < 0 || l % 2 == 0 != t > 0)
|
|
1027
|
-
return null;
|
|
1028
|
-
let u = { from: t < 0 ? e - 1 : e, to: t > 0 ? e + 1 : e }, h = n.doc.iterRange(e, t > 0 ? n.doc.length : 0), f = 0;
|
|
1029
|
-
for (let m = 0; !h.next().done && m <= s; ) {
|
|
1030
|
-
let d = h.value;
|
|
1031
|
-
t < 0 && (m += d.length);
|
|
1032
|
-
let v = e + m * t;
|
|
1033
|
-
for (let b = t > 0 ? 0 : d.length - 1, pe = t > 0 ? d.length : -1; b != pe; b += t) {
|
|
1034
|
-
let B = o.indexOf(d[b]);
|
|
1035
|
-
if (!(B < 0 || r.resolveInner(v + b, 1).type != i))
|
|
1036
|
-
if (B % 2 == 0 == t > 0)
|
|
1037
|
-
f++;
|
|
1038
|
-
else {
|
|
1039
|
-
if (f == 1)
|
|
1040
|
-
return { start: u, end: { from: v + b, to: v + b + 1 }, matched: B >> 1 == l >> 1 };
|
|
1041
|
-
f--;
|
|
1042
|
-
}
|
|
1043
|
-
}
|
|
1044
|
-
t > 0 && (m += d.length);
|
|
1045
|
-
}
|
|
1046
|
-
return h.done ? { start: u, matched: !1 } : null;
|
|
1047
|
-
}
|
|
1048
|
-
function X(n, e, t, r = 0, i = 0) {
|
|
1049
|
-
e == null && (e = n.search(/[^\s\u00a0]/), e == -1 && (e = n.length));
|
|
1050
|
-
let s = i;
|
|
1051
|
-
for (let o = r; o < e; o++)
|
|
1052
|
-
n.charCodeAt(o) == 9 ? s += t - s % t : s++;
|
|
1053
|
-
return s;
|
|
1054
|
-
}
|
|
1055
|
-
class Pt {
|
|
1056
|
-
/**
|
|
1057
|
-
Create a stream.
|
|
1058
|
-
*/
|
|
1059
|
-
constructor(e, t, r, i) {
|
|
1060
|
-
this.string = e, this.tabSize = t, this.indentUnit = r, this.overrideIndent = i, this.pos = 0, this.start = 0, this.lastColumnPos = 0, this.lastColumnValue = 0;
|
|
1061
|
-
}
|
|
1062
|
-
/**
|
|
1063
|
-
True if we are at the end of the line.
|
|
1064
|
-
*/
|
|
1065
|
-
eol() {
|
|
1066
|
-
return this.pos >= this.string.length;
|
|
1067
|
-
}
|
|
1068
|
-
/**
|
|
1069
|
-
True if we are at the start of the line.
|
|
1070
|
-
*/
|
|
1071
|
-
sol() {
|
|
1072
|
-
return this.pos == 0;
|
|
1073
|
-
}
|
|
1074
|
-
/**
|
|
1075
|
-
Get the next code unit after the current position, or undefined
|
|
1076
|
-
if we're at the end of the line.
|
|
1077
|
-
*/
|
|
1078
|
-
peek() {
|
|
1079
|
-
return this.string.charAt(this.pos) || void 0;
|
|
1080
|
-
}
|
|
1081
|
-
/**
|
|
1082
|
-
Read the next code unit and advance `this.pos`.
|
|
1083
|
-
*/
|
|
1084
|
-
next() {
|
|
1085
|
-
if (this.pos < this.string.length)
|
|
1086
|
-
return this.string.charAt(this.pos++);
|
|
1087
|
-
}
|
|
1088
|
-
/**
|
|
1089
|
-
Match the next character against the given string, regular
|
|
1090
|
-
expression, or predicate. Consume and return it if it matches.
|
|
1091
|
-
*/
|
|
1092
|
-
eat(e) {
|
|
1093
|
-
let t = this.string.charAt(this.pos), r;
|
|
1094
|
-
if (typeof e == "string" ? r = t == e : r = t && (e instanceof RegExp ? e.test(t) : e(t)), r)
|
|
1095
|
-
return ++this.pos, t;
|
|
1096
|
-
}
|
|
1097
|
-
/**
|
|
1098
|
-
Continue matching characters that match the given string,
|
|
1099
|
-
regular expression, or predicate function. Return true if any
|
|
1100
|
-
characters were consumed.
|
|
1101
|
-
*/
|
|
1102
|
-
eatWhile(e) {
|
|
1103
|
-
let t = this.pos;
|
|
1104
|
-
for (; this.eat(e); )
|
|
1105
|
-
;
|
|
1106
|
-
return this.pos > t;
|
|
1107
|
-
}
|
|
1108
|
-
/**
|
|
1109
|
-
Consume whitespace ahead of `this.pos`. Return true if any was
|
|
1110
|
-
found.
|
|
1111
|
-
*/
|
|
1112
|
-
eatSpace() {
|
|
1113
|
-
let e = this.pos;
|
|
1114
|
-
for (; /[\s\u00a0]/.test(this.string.charAt(this.pos)); )
|
|
1115
|
-
++this.pos;
|
|
1116
|
-
return this.pos > e;
|
|
1117
|
-
}
|
|
1118
|
-
/**
|
|
1119
|
-
Move to the end of the line.
|
|
1120
|
-
*/
|
|
1121
|
-
skipToEnd() {
|
|
1122
|
-
this.pos = this.string.length;
|
|
1123
|
-
}
|
|
1124
|
-
/**
|
|
1125
|
-
Move to directly before the given character, if found on the
|
|
1126
|
-
current line.
|
|
1127
|
-
*/
|
|
1128
|
-
skipTo(e) {
|
|
1129
|
-
let t = this.string.indexOf(e, this.pos);
|
|
1130
|
-
if (t > -1)
|
|
1131
|
-
return this.pos = t, !0;
|
|
1132
|
-
}
|
|
1133
|
-
/**
|
|
1134
|
-
Move back `n` characters.
|
|
1135
|
-
*/
|
|
1136
|
-
backUp(e) {
|
|
1137
|
-
this.pos -= e;
|
|
1138
|
-
}
|
|
1139
|
-
/**
|
|
1140
|
-
Get the column position at `this.pos`.
|
|
1141
|
-
*/
|
|
1142
|
-
column() {
|
|
1143
|
-
return this.lastColumnPos < this.start && (this.lastColumnValue = X(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue), this.lastColumnPos = this.start), this.lastColumnValue;
|
|
1144
|
-
}
|
|
1145
|
-
/**
|
|
1146
|
-
Get the indentation column of the current line.
|
|
1147
|
-
*/
|
|
1148
|
-
indentation() {
|
|
1149
|
-
var e;
|
|
1150
|
-
return (e = this.overrideIndent) !== null && e !== void 0 ? e : X(this.string, null, this.tabSize);
|
|
1151
|
-
}
|
|
1152
|
-
/**
|
|
1153
|
-
Match the input against the given string or regular expression
|
|
1154
|
-
(which should start with a `^`). Return true or the regexp match
|
|
1155
|
-
if it matches.
|
|
1156
|
-
|
|
1157
|
-
Unless `consume` is set to `false`, this will move `this.pos`
|
|
1158
|
-
past the matched text.
|
|
1159
|
-
|
|
1160
|
-
When matching a string `caseInsensitive` can be set to true to
|
|
1161
|
-
make the match case-insensitive.
|
|
1162
|
-
*/
|
|
1163
|
-
match(e, t, r) {
|
|
1164
|
-
if (typeof e == "string") {
|
|
1165
|
-
let i = (o) => r ? o.toLowerCase() : o, s = this.string.substr(this.pos, e.length);
|
|
1166
|
-
return i(s) == i(e) ? (t !== !1 && (this.pos += e.length), !0) : null;
|
|
1167
|
-
} else {
|
|
1168
|
-
let i = this.string.slice(this.pos).match(e);
|
|
1169
|
-
return i && i.index > 0 ? null : (i && t !== !1 && (this.pos += i[0].length), i);
|
|
1170
|
-
}
|
|
1171
|
-
}
|
|
1172
|
-
/**
|
|
1173
|
-
Get the current token.
|
|
1174
|
-
*/
|
|
1175
|
-
current() {
|
|
1176
|
-
return this.string.slice(this.start, this.pos);
|
|
1177
|
-
}
|
|
1178
|
-
}
|
|
1179
|
-
const lt = /* @__PURE__ */ Object.create(null), Y = [V.none], Z = [], _ = /* @__PURE__ */ Object.create(null), at = /* @__PURE__ */ Object.create(null);
|
|
1180
|
-
for (let [n, e] of [
|
|
1181
|
-
["variable", "variableName"],
|
|
1182
|
-
["variable-2", "variableName.special"],
|
|
1183
|
-
["string-2", "string.special"],
|
|
1184
|
-
["def", "variableName.definition"],
|
|
1185
|
-
["tag", "tagName"],
|
|
1186
|
-
["attribute", "attributeName"],
|
|
1187
|
-
["type", "typeName"],
|
|
1188
|
-
["builtin", "variableName.standard"],
|
|
1189
|
-
["qualifier", "modifier"],
|
|
1190
|
-
["error", "invalid"],
|
|
1191
|
-
["header", "heading"],
|
|
1192
|
-
["property", "propertyName"]
|
|
1193
|
-
])
|
|
1194
|
-
at[n] = /* @__PURE__ */ ut(lt, e);
|
|
1195
|
-
function L(n, e) {
|
|
1196
|
-
Z.indexOf(n) > -1 || (Z.push(n), console.warn(e));
|
|
1197
|
-
}
|
|
1198
|
-
function ut(n, e) {
|
|
1199
|
-
let t = [];
|
|
1200
|
-
for (let a of e.split(" ")) {
|
|
1201
|
-
let l = [];
|
|
1202
|
-
for (let u of a.split(".")) {
|
|
1203
|
-
let h = n[u] || Se[u];
|
|
1204
|
-
h ? typeof h == "function" ? l.length ? l = l.map(h) : L(u, `Modifier ${u} used at start of tag`) : l.length ? L(u, `Tag ${u} used as modifier`) : l = Array.isArray(h) ? h : [h] : L(u, `Unknown highlighting tag ${u}`);
|
|
1205
|
-
}
|
|
1206
|
-
for (let u of l)
|
|
1207
|
-
t.push(u);
|
|
1208
|
-
}
|
|
1209
|
-
if (!t.length)
|
|
1210
|
-
return 0;
|
|
1211
|
-
let r = e.replace(/ /g, "_"), i = r + " " + t.map((a) => a.id), s = _[i];
|
|
1212
|
-
if (s)
|
|
1213
|
-
return s.id;
|
|
1214
|
-
let o = _[i] = V.define({
|
|
1215
|
-
id: Y.length,
|
|
1216
|
-
name: r,
|
|
1217
|
-
props: [Ce({ [r]: t })]
|
|
1218
|
-
});
|
|
1219
|
-
return Y.push(o), o.id;
|
|
423
|
+
function Me(e, t) {
|
|
424
|
+
const o = Math.pow(10, t);
|
|
425
|
+
return Math.round(e * o) / o;
|
|
1220
426
|
}
|
|
1221
|
-
|
|
427
|
+
var Oe = q, Ue = te, Fe = ne, Ye = oe;
|
|
1222
428
|
export {
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
Pt as StringStream,
|
|
1232
|
-
$ as TreeIndentContext,
|
|
1233
|
-
it as bracketMatchingHandle,
|
|
1234
|
-
Xe as codeFolding,
|
|
1235
|
-
xt as continuedIndent,
|
|
1236
|
-
Ae as defineLanguageFacet,
|
|
1237
|
-
vt as delimitedIndent,
|
|
1238
|
-
mt as ensureSyntaxTree,
|
|
1239
|
-
bt as flatIndent,
|
|
1240
|
-
St as foldCode,
|
|
1241
|
-
he as foldEffect,
|
|
1242
|
-
Tt as foldInside,
|
|
1243
|
-
Ve as foldNodeProp,
|
|
1244
|
-
He as foldService,
|
|
1245
|
-
U as foldState,
|
|
1246
|
-
je as foldable,
|
|
1247
|
-
Be as getIndentUnit,
|
|
1248
|
-
yt as getIndentation,
|
|
1249
|
-
Ne as indentNodeProp,
|
|
1250
|
-
Oe as indentService,
|
|
1251
|
-
wt as indentString,
|
|
1252
|
-
se as indentUnit,
|
|
1253
|
-
C as language,
|
|
1254
|
-
T as languageDataProp,
|
|
1255
|
-
At as matchBrackets,
|
|
1256
|
-
Pe as sublanguageProp,
|
|
1257
|
-
Ct as syntaxHighlighting,
|
|
1258
|
-
k as syntaxTree,
|
|
1259
|
-
fe as unfoldEffect
|
|
429
|
+
Fe as Range,
|
|
430
|
+
Oe as Root,
|
|
431
|
+
q as Slider,
|
|
432
|
+
ne as SliderRange,
|
|
433
|
+
oe as SliderThumb,
|
|
434
|
+
te as SliderTrack,
|
|
435
|
+
Ye as Thumb,
|
|
436
|
+
Ue as Track
|
|
1260
437
|
};
|