@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/index131.js
CHANGED
|
@@ -1,620 +1,71 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
@internal
|
|
29
|
-
*/
|
|
30
|
-
constructor(t) {
|
|
31
|
-
this.map = t;
|
|
1
|
+
import * as d from "react";
|
|
2
|
+
import { styleSingleton as f } from "./index132.js";
|
|
3
|
+
import { noScrollbarsClassName as p, zeroRightClassName as g, fullWidthClassName as l, removedBarSizeVariable as v } from "./index122.js";
|
|
4
|
+
import { getGapWidth as m } from "./index137.js";
|
|
5
|
+
var b = f(), e = "data-scroll-locked", h = function(n, a, o, t) {
|
|
6
|
+
var r = n.left, i = n.top, s = n.right, c = n.gap;
|
|
7
|
+
return o === void 0 && (o = "margin"), `
|
|
8
|
+
.`.concat(p, ` {
|
|
9
|
+
overflow: hidden `).concat(t, `;
|
|
10
|
+
padding-right: `).concat(c, "px ").concat(t, `;
|
|
11
|
+
}
|
|
12
|
+
body[`).concat(e, `] {
|
|
13
|
+
overflow: hidden `).concat(t, `;
|
|
14
|
+
overscroll-behavior: contain;
|
|
15
|
+
`).concat([
|
|
16
|
+
a && "position: relative ".concat(t, ";"),
|
|
17
|
+
o === "margin" && `
|
|
18
|
+
padding-left: `.concat(r, `px;
|
|
19
|
+
padding-top: `).concat(i, `px;
|
|
20
|
+
padding-right: `).concat(s, `px;
|
|
21
|
+
margin-left:0;
|
|
22
|
+
margin-top:0;
|
|
23
|
+
margin-right: `).concat(c, "px ").concat(t, `;
|
|
24
|
+
`),
|
|
25
|
+
o === "padding" && "padding-right: ".concat(c, "px ").concat(t, ";")
|
|
26
|
+
].filter(Boolean).join(""), `
|
|
32
27
|
}
|
|
33
|
-
/**
|
|
34
|
-
Create a [state effect](https://codemirror.net/6/docs/ref/#state.StateEffect) instance of this
|
|
35
|
-
type.
|
|
36
|
-
*/
|
|
37
|
-
of(t) {
|
|
38
|
-
return new k(this, t);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
class k {
|
|
42
|
-
/**
|
|
43
|
-
@internal
|
|
44
|
-
*/
|
|
45
|
-
constructor(t, e) {
|
|
46
|
-
this.type = t, this.value = e;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
Map this effect through a position mapping. Will return
|
|
50
|
-
`undefined` when that ends up deleting the effect.
|
|
51
|
-
*/
|
|
52
|
-
map(t) {
|
|
53
|
-
let e = this.type.map(this.value, t);
|
|
54
|
-
return e === void 0 ? void 0 : e == this.value ? this : new k(this.type, e);
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
Tells you whether this effect object is of a given
|
|
58
|
-
[type](https://codemirror.net/6/docs/ref/#state.StateEffectType).
|
|
59
|
-
*/
|
|
60
|
-
is(t) {
|
|
61
|
-
return this.type == t;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
Define a new effect type. The type parameter indicates the type
|
|
65
|
-
of values that his effect holds.
|
|
66
|
-
*/
|
|
67
|
-
static define(t = {}) {
|
|
68
|
-
return new z(t.map || ((e) => e));
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
Map an array of effects through a change set.
|
|
72
|
-
*/
|
|
73
|
-
static mapEffects(t, e) {
|
|
74
|
-
if (!t.length)
|
|
75
|
-
return t;
|
|
76
|
-
let i = [];
|
|
77
|
-
for (let s of t) {
|
|
78
|
-
let h = s.map(e);
|
|
79
|
-
h && i.push(h);
|
|
80
|
-
}
|
|
81
|
-
return i;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
k.reconfigure = /* @__PURE__ */ k.define();
|
|
85
|
-
k.appendConfig = /* @__PURE__ */ k.define();
|
|
86
|
-
let M;
|
|
87
|
-
try {
|
|
88
|
-
M = /* @__PURE__ */ new RegExp("[\\p{Alphabetic}\\p{Number}_]", "u");
|
|
89
|
-
} catch {
|
|
90
|
-
}
|
|
91
|
-
y.TrackDel;
|
|
92
|
-
class S {
|
|
93
|
-
constructor(t, e, i) {
|
|
94
|
-
this.from = t, this.to = e, this.value = i;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
@internal
|
|
98
|
-
*/
|
|
99
|
-
static create(t, e, i) {
|
|
100
|
-
return new S(t, e, i);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
function T(n, t) {
|
|
104
|
-
return n.from - t.from || n.value.startSide - t.value.startSide;
|
|
105
|
-
}
|
|
106
|
-
class E {
|
|
107
|
-
constructor(t, e, i, s) {
|
|
108
|
-
this.from = t, this.to = e, this.value = i, this.maxPoint = s;
|
|
109
|
-
}
|
|
110
|
-
get length() {
|
|
111
|
-
return this.to[this.to.length - 1];
|
|
112
|
-
}
|
|
113
|
-
// Find the index of the given position and side. Use the ranges'
|
|
114
|
-
// `from` pos when `end == false`, `to` when `end == true`.
|
|
115
|
-
findIndex(t, e, i, s = 0) {
|
|
116
|
-
let h = i ? this.to : this.from;
|
|
117
|
-
for (let r = s, o = h.length; ; ) {
|
|
118
|
-
if (r == o)
|
|
119
|
-
return r;
|
|
120
|
-
let a = r + o >> 1, l = h[a] - t || (i ? this.value[a].endSide : this.value[a].startSide) - e;
|
|
121
|
-
if (a == r)
|
|
122
|
-
return l >= 0 ? r : o;
|
|
123
|
-
l >= 0 ? o = a : r = a + 1;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
between(t, e, i, s) {
|
|
127
|
-
for (let h = this.findIndex(e, -1e9, !0), r = this.findIndex(i, 1e9, !1, h); h < r; h++)
|
|
128
|
-
if (s(this.from[h] + t, this.to[h] + t, this.value[h]) === !1)
|
|
129
|
-
return !1;
|
|
130
|
-
}
|
|
131
|
-
map(t, e) {
|
|
132
|
-
let i = [], s = [], h = [], r = -1, o = -1;
|
|
133
|
-
for (let a = 0; a < this.value.length; a++) {
|
|
134
|
-
let l = this.value[a], u = this.from[a] + t, c = this.to[a] + t, d, m;
|
|
135
|
-
if (u == c) {
|
|
136
|
-
let C = e.mapPos(u, l.startSide, l.mapMode);
|
|
137
|
-
if (C == null || (d = m = C, l.startSide != l.endSide && (m = e.mapPos(u, l.endSide), m < d)))
|
|
138
|
-
continue;
|
|
139
|
-
} else if (d = e.mapPos(u, l.startSide), m = e.mapPos(c, l.endSide), d > m || d == m && l.startSide > 0 && l.endSide <= 0)
|
|
140
|
-
continue;
|
|
141
|
-
(m - d || l.endSide - l.startSide) < 0 || (r < 0 && (r = d), l.point && (o = Math.max(o, m - d)), i.push(l), s.push(d - r), h.push(m - r));
|
|
142
|
-
}
|
|
143
|
-
return { mapped: i.length ? new E(s, h, i, o) : null, pos: r };
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
class f {
|
|
147
|
-
constructor(t, e, i, s) {
|
|
148
|
-
this.chunkPos = t, this.chunk = e, this.nextLayer = i, this.maxPoint = s;
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
@internal
|
|
152
|
-
*/
|
|
153
|
-
static create(t, e, i, s) {
|
|
154
|
-
return new f(t, e, i, s);
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
@internal
|
|
158
|
-
*/
|
|
159
|
-
get length() {
|
|
160
|
-
let t = this.chunk.length - 1;
|
|
161
|
-
return t < 0 ? 0 : Math.max(this.chunkEnd(t), this.nextLayer.length);
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
The number of ranges in the set.
|
|
165
|
-
*/
|
|
166
|
-
get size() {
|
|
167
|
-
if (this.isEmpty)
|
|
168
|
-
return 0;
|
|
169
|
-
let t = this.nextLayer.size;
|
|
170
|
-
for (let e of this.chunk)
|
|
171
|
-
t += e.value.length;
|
|
172
|
-
return t;
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
@internal
|
|
176
|
-
*/
|
|
177
|
-
chunkEnd(t) {
|
|
178
|
-
return this.chunkPos[t] + this.chunk[t].length;
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
Update the range set, optionally adding new ranges or filtering
|
|
182
|
-
out existing ones.
|
|
183
28
|
|
|
184
|
-
(
|
|
185
|
-
|
|
186
|
-
from being a subtype of `RangeSet<Y>` when `X` is a subtype of
|
|
187
|
-
`Y`.)
|
|
188
|
-
*/
|
|
189
|
-
update(t) {
|
|
190
|
-
let { add: e = [], sort: i = !1, filterFrom: s = 0, filterTo: h = this.length } = t, r = t.filter;
|
|
191
|
-
if (e.length == 0 && !r)
|
|
192
|
-
return this;
|
|
193
|
-
if (i && (e = e.slice().sort(T)), this.isEmpty)
|
|
194
|
-
return e.length ? f.of(e) : this;
|
|
195
|
-
let o = new F(this, null, -1).goto(0), a = 0, l = [], u = new P();
|
|
196
|
-
for (; o.value || a < e.length; )
|
|
197
|
-
if (a < e.length && (o.from - e[a].from || o.startSide - e[a].value.startSide) >= 0) {
|
|
198
|
-
let c = e[a++];
|
|
199
|
-
u.addInner(c.from, c.to, c.value) || l.push(c);
|
|
200
|
-
} else o.rangeIndex == 1 && o.chunkIndex < this.chunk.length && (a == e.length || this.chunkEnd(o.chunkIndex) < e[a].from) && (!r || s > this.chunkEnd(o.chunkIndex) || h < this.chunkPos[o.chunkIndex]) && u.addChunk(this.chunkPos[o.chunkIndex], this.chunk[o.chunkIndex]) ? o.nextChunk() : ((!r || s > o.to || h < o.from || r(o.from, o.to, o.value)) && (u.addInner(o.from, o.to, o.value) || l.push(S.create(o.from, o.to, o.value))), o.next());
|
|
201
|
-
return u.finishInner(this.nextLayer.isEmpty && !l.length ? f.empty : this.nextLayer.update({ add: l, filter: r, filterFrom: s, filterTo: h }));
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
Map this range set through a set of changes, return the new set.
|
|
205
|
-
*/
|
|
206
|
-
map(t) {
|
|
207
|
-
if (t.empty || this.isEmpty)
|
|
208
|
-
return this;
|
|
209
|
-
let e = [], i = [], s = -1;
|
|
210
|
-
for (let r = 0; r < this.chunk.length; r++) {
|
|
211
|
-
let o = this.chunkPos[r], a = this.chunk[r], l = t.touchesRange(o, o + a.length);
|
|
212
|
-
if (l === !1)
|
|
213
|
-
s = Math.max(s, a.maxPoint), e.push(a), i.push(t.mapPos(o));
|
|
214
|
-
else if (l === !0) {
|
|
215
|
-
let { mapped: u, pos: c } = a.map(o, t);
|
|
216
|
-
u && (s = Math.max(s, u.maxPoint), e.push(u), i.push(c));
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
let h = this.nextLayer.map(t);
|
|
220
|
-
return e.length == 0 ? h : new f(i, e, h || f.empty, s);
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
Iterate over the ranges that touch the region `from` to `to`,
|
|
224
|
-
calling `f` for each. There is no guarantee that the ranges will
|
|
225
|
-
be reported in any specific order. When the callback returns
|
|
226
|
-
`false`, iteration stops.
|
|
227
|
-
*/
|
|
228
|
-
between(t, e, i) {
|
|
229
|
-
if (!this.isEmpty) {
|
|
230
|
-
for (let s = 0; s < this.chunk.length; s++) {
|
|
231
|
-
let h = this.chunkPos[s], r = this.chunk[s];
|
|
232
|
-
if (e >= h && t <= h + r.length && r.between(h, t - h, e - h, i) === !1)
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
this.nextLayer.between(t, e, i);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
Iterate over the ranges in this set, in order, including all
|
|
240
|
-
ranges that end at or after `from`.
|
|
241
|
-
*/
|
|
242
|
-
iter(t = 0) {
|
|
243
|
-
return x.from([this]).goto(t);
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
@internal
|
|
247
|
-
*/
|
|
248
|
-
get isEmpty() {
|
|
249
|
-
return this.nextLayer == this;
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
Iterate over the ranges in a collection of sets, in order,
|
|
253
|
-
starting from `from`.
|
|
254
|
-
*/
|
|
255
|
-
static iter(t, e = 0) {
|
|
256
|
-
return x.from(t).goto(e);
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
Iterate over two groups of sets, calling methods on `comparator`
|
|
260
|
-
to notify it of possible differences.
|
|
261
|
-
*/
|
|
262
|
-
static compare(t, e, i, s, h = -1) {
|
|
263
|
-
let r = t.filter((c) => c.maxPoint > 0 || !c.isEmpty && c.maxPoint >= h), o = e.filter((c) => c.maxPoint > 0 || !c.isEmpty && c.maxPoint >= h), a = A(r, o, i), l = new p(r, a, h), u = new p(o, a, h);
|
|
264
|
-
i.iterGaps((c, d, m) => L(l, c, u, d, m, s)), i.empty && i.length == 0 && L(l, 0, u, 0, 0, s);
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
Compare the contents of two groups of range sets, returning true
|
|
268
|
-
if they are equivalent in the given range.
|
|
269
|
-
*/
|
|
270
|
-
static eq(t, e, i = 0, s) {
|
|
271
|
-
s == null && (s = 1e9);
|
|
272
|
-
let h = t.filter((u) => !u.isEmpty && e.indexOf(u) < 0), r = e.filter((u) => !u.isEmpty && t.indexOf(u) < 0);
|
|
273
|
-
if (h.length != r.length)
|
|
274
|
-
return !1;
|
|
275
|
-
if (!h.length)
|
|
276
|
-
return !0;
|
|
277
|
-
let o = A(h, r), a = new p(h, o, 0).goto(i), l = new p(r, o, 0).goto(i);
|
|
278
|
-
for (; ; ) {
|
|
279
|
-
if (a.to != l.to || !b(a.active, l.active) || a.point && (!l.point || !a.point.eq(l.point)))
|
|
280
|
-
return !1;
|
|
281
|
-
if (a.to > s)
|
|
282
|
-
return !0;
|
|
283
|
-
a.next(), l.next();
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
Iterate over a group of range sets at the same time, notifying
|
|
288
|
-
the iterator about the ranges covering every given piece of
|
|
289
|
-
content. Returns the open count (see
|
|
290
|
-
[`SpanIterator.span`](https://codemirror.net/6/docs/ref/#state.SpanIterator.span)) at the end
|
|
291
|
-
of the iteration.
|
|
292
|
-
*/
|
|
293
|
-
static spans(t, e, i, s, h = -1) {
|
|
294
|
-
let r = new p(t, null, h).goto(e), o = e, a = r.openStart;
|
|
295
|
-
for (; ; ) {
|
|
296
|
-
let l = Math.min(r.to, i);
|
|
297
|
-
if (r.point ? (s.point(o, l, r.point, r.activeForPoint(r.to), a, r.pointRank), a = r.openEnd(l) + (r.to > l ? 1 : 0)) : l > o && (s.span(o, l, r.active, a), a = r.openEnd(l)), r.to > i)
|
|
298
|
-
break;
|
|
299
|
-
o = r.to, r.next();
|
|
300
|
-
}
|
|
301
|
-
return a;
|
|
302
|
-
}
|
|
303
|
-
/**
|
|
304
|
-
Create a range set for the given range or array of ranges. By
|
|
305
|
-
default, this expects the ranges to be _sorted_ (by start
|
|
306
|
-
position and, if two start at the same position,
|
|
307
|
-
`value.startSide`). You can pass `true` as second argument to
|
|
308
|
-
cause the method to sort them.
|
|
309
|
-
*/
|
|
310
|
-
static of(t, e = !1) {
|
|
311
|
-
let i = new P();
|
|
312
|
-
for (let s of t instanceof S ? [t] : e ? B(t) : t)
|
|
313
|
-
i.add(s.from, s.to, s.value);
|
|
314
|
-
return i.finish();
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
f.empty = /* @__PURE__ */ new f([], [], null, -1);
|
|
318
|
-
function B(n) {
|
|
319
|
-
if (n.length > 1)
|
|
320
|
-
for (let t = n[0], e = 1; e < n.length; e++) {
|
|
321
|
-
let i = n[e];
|
|
322
|
-
if (T(t, i) > 0)
|
|
323
|
-
return n.slice().sort(T);
|
|
324
|
-
t = i;
|
|
325
|
-
}
|
|
326
|
-
return n;
|
|
327
|
-
}
|
|
328
|
-
f.empty.nextLayer = f.empty;
|
|
329
|
-
class P {
|
|
330
|
-
/**
|
|
331
|
-
Create an empty builder.
|
|
332
|
-
*/
|
|
333
|
-
constructor() {
|
|
334
|
-
this.chunks = [], this.chunkPos = [], this.chunkStart = -1, this.last = null, this.lastFrom = -1e9, this.lastTo = -1e9, this.from = [], this.to = [], this.value = [], this.maxPoint = -1, this.setMaxPoint = -1, this.nextLayer = null;
|
|
335
|
-
}
|
|
336
|
-
finishChunk(t) {
|
|
337
|
-
this.chunks.push(new E(this.from, this.to, this.value, this.maxPoint)), this.chunkPos.push(this.chunkStart), this.chunkStart = -1, this.setMaxPoint = Math.max(this.setMaxPoint, this.maxPoint), this.maxPoint = -1, t && (this.from = [], this.to = [], this.value = []);
|
|
338
|
-
}
|
|
339
|
-
/**
|
|
340
|
-
Add a range. Ranges should be added in sorted (by `from` and
|
|
341
|
-
`value.startSide`) order.
|
|
342
|
-
*/
|
|
343
|
-
add(t, e, i) {
|
|
344
|
-
this.addInner(t, e, i) || (this.nextLayer || (this.nextLayer = new P())).add(t, e, i);
|
|
345
|
-
}
|
|
346
|
-
/**
|
|
347
|
-
@internal
|
|
348
|
-
*/
|
|
349
|
-
addInner(t, e, i) {
|
|
350
|
-
let s = t - this.lastTo || i.startSide - this.last.endSide;
|
|
351
|
-
if (s <= 0 && (t - this.lastFrom || i.startSide - this.last.startSide) < 0)
|
|
352
|
-
throw new Error("Ranges must be added sorted by `from` position and `startSide`");
|
|
353
|
-
return s < 0 ? !1 : (this.from.length == 250 && this.finishChunk(!0), this.chunkStart < 0 && (this.chunkStart = t), this.from.push(t - this.chunkStart), this.to.push(e - this.chunkStart), this.last = i, this.lastFrom = t, this.lastTo = e, this.value.push(i), i.point && (this.maxPoint = Math.max(this.maxPoint, e - t)), !0);
|
|
29
|
+
.`).concat(g, ` {
|
|
30
|
+
right: `).concat(c, "px ").concat(t, `;
|
|
354
31
|
}
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
addChunk(t, e) {
|
|
359
|
-
if ((t - this.lastTo || e.value[0].startSide - this.last.endSide) < 0)
|
|
360
|
-
return !1;
|
|
361
|
-
this.from.length && this.finishChunk(!0), this.setMaxPoint = Math.max(this.setMaxPoint, e.maxPoint), this.chunks.push(e), this.chunkPos.push(t);
|
|
362
|
-
let i = e.value.length - 1;
|
|
363
|
-
return this.last = e.value[i], this.lastFrom = e.from[i] + t, this.lastTo = e.to[i] + t, !0;
|
|
364
|
-
}
|
|
365
|
-
/**
|
|
366
|
-
Finish the range set. Returns the new set. The builder can't be
|
|
367
|
-
used anymore after this has been called.
|
|
368
|
-
*/
|
|
369
|
-
finish() {
|
|
370
|
-
return this.finishInner(f.empty);
|
|
371
|
-
}
|
|
372
|
-
/**
|
|
373
|
-
@internal
|
|
374
|
-
*/
|
|
375
|
-
finishInner(t) {
|
|
376
|
-
if (this.from.length && this.finishChunk(!1), this.chunks.length == 0)
|
|
377
|
-
return t;
|
|
378
|
-
let e = f.create(this.chunkPos, this.chunks, this.nextLayer ? this.nextLayer.finishInner(t) : t, this.setMaxPoint);
|
|
379
|
-
return this.from = null, e;
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
function A(n, t, e) {
|
|
383
|
-
let i = /* @__PURE__ */ new Map();
|
|
384
|
-
for (let h of n)
|
|
385
|
-
for (let r = 0; r < h.chunk.length; r++)
|
|
386
|
-
h.chunk[r].maxPoint <= 0 && i.set(h.chunk[r], h.chunkPos[r]);
|
|
387
|
-
let s = /* @__PURE__ */ new Set();
|
|
388
|
-
for (let h of t)
|
|
389
|
-
for (let r = 0; r < h.chunk.length; r++) {
|
|
390
|
-
let o = i.get(h.chunk[r]);
|
|
391
|
-
o != null && (e ? e.mapPos(o) : o) == h.chunkPos[r] && !(e != null && e.touchesRange(o, o + h.chunk[r].length)) && s.add(h.chunk[r]);
|
|
392
|
-
}
|
|
393
|
-
return s;
|
|
394
|
-
}
|
|
395
|
-
class F {
|
|
396
|
-
constructor(t, e, i, s = 0) {
|
|
397
|
-
this.layer = t, this.skip = e, this.minPoint = i, this.rank = s;
|
|
398
|
-
}
|
|
399
|
-
get startSide() {
|
|
400
|
-
return this.value ? this.value.startSide : 0;
|
|
401
|
-
}
|
|
402
|
-
get endSide() {
|
|
403
|
-
return this.value ? this.value.endSide : 0;
|
|
404
|
-
}
|
|
405
|
-
goto(t, e = -1e9) {
|
|
406
|
-
return this.chunkIndex = this.rangeIndex = 0, this.gotoInner(t, e, !1), this;
|
|
407
|
-
}
|
|
408
|
-
gotoInner(t, e, i) {
|
|
409
|
-
for (; this.chunkIndex < this.layer.chunk.length; ) {
|
|
410
|
-
let s = this.layer.chunk[this.chunkIndex];
|
|
411
|
-
if (!(this.skip && this.skip.has(s) || this.layer.chunkEnd(this.chunkIndex) < t || s.maxPoint < this.minPoint))
|
|
412
|
-
break;
|
|
413
|
-
this.chunkIndex++, i = !1;
|
|
414
|
-
}
|
|
415
|
-
if (this.chunkIndex < this.layer.chunk.length) {
|
|
416
|
-
let s = this.layer.chunk[this.chunkIndex].findIndex(t - this.layer.chunkPos[this.chunkIndex], e, !0);
|
|
417
|
-
(!i || this.rangeIndex < s) && this.setRangeIndex(s);
|
|
418
|
-
}
|
|
419
|
-
this.next();
|
|
420
|
-
}
|
|
421
|
-
forward(t, e) {
|
|
422
|
-
(this.to - t || this.endSide - e) < 0 && this.gotoInner(t, e, !0);
|
|
423
|
-
}
|
|
424
|
-
next() {
|
|
425
|
-
for (; ; )
|
|
426
|
-
if (this.chunkIndex == this.layer.chunk.length) {
|
|
427
|
-
this.from = this.to = 1e9, this.value = null;
|
|
428
|
-
break;
|
|
429
|
-
} else {
|
|
430
|
-
let t = this.layer.chunkPos[this.chunkIndex], e = this.layer.chunk[this.chunkIndex], i = t + e.from[this.rangeIndex];
|
|
431
|
-
if (this.from = i, this.to = t + e.to[this.rangeIndex], this.value = e.value[this.rangeIndex], this.setRangeIndex(this.rangeIndex + 1), this.minPoint < 0 || this.value.point && this.to - this.from >= this.minPoint)
|
|
432
|
-
break;
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
setRangeIndex(t) {
|
|
436
|
-
if (t == this.layer.chunk[this.chunkIndex].value.length) {
|
|
437
|
-
if (this.chunkIndex++, this.skip)
|
|
438
|
-
for (; this.chunkIndex < this.layer.chunk.length && this.skip.has(this.layer.chunk[this.chunkIndex]); )
|
|
439
|
-
this.chunkIndex++;
|
|
440
|
-
this.rangeIndex = 0;
|
|
441
|
-
} else
|
|
442
|
-
this.rangeIndex = t;
|
|
443
|
-
}
|
|
444
|
-
nextChunk() {
|
|
445
|
-
this.chunkIndex++, this.rangeIndex = 0, this.next();
|
|
446
|
-
}
|
|
447
|
-
compare(t) {
|
|
448
|
-
return this.from - t.from || this.startSide - t.startSide || this.rank - t.rank || this.to - t.to || this.endSide - t.endSide;
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
class x {
|
|
452
|
-
constructor(t) {
|
|
453
|
-
this.heap = t;
|
|
454
|
-
}
|
|
455
|
-
static from(t, e = null, i = -1) {
|
|
456
|
-
let s = [];
|
|
457
|
-
for (let h = 0; h < t.length; h++)
|
|
458
|
-
for (let r = t[h]; !r.isEmpty; r = r.nextLayer)
|
|
459
|
-
r.maxPoint >= i && s.push(new F(r, e, i, h));
|
|
460
|
-
return s.length == 1 ? s[0] : new x(s);
|
|
461
|
-
}
|
|
462
|
-
get startSide() {
|
|
463
|
-
return this.value ? this.value.startSide : 0;
|
|
464
|
-
}
|
|
465
|
-
goto(t, e = -1e9) {
|
|
466
|
-
for (let i of this.heap)
|
|
467
|
-
i.goto(t, e);
|
|
468
|
-
for (let i = this.heap.length >> 1; i >= 0; i--)
|
|
469
|
-
w(this.heap, i);
|
|
470
|
-
return this.next(), this;
|
|
471
|
-
}
|
|
472
|
-
forward(t, e) {
|
|
473
|
-
for (let i of this.heap)
|
|
474
|
-
i.forward(t, e);
|
|
475
|
-
for (let i = this.heap.length >> 1; i >= 0; i--)
|
|
476
|
-
w(this.heap, i);
|
|
477
|
-
(this.to - t || this.value.endSide - e) < 0 && this.next();
|
|
478
|
-
}
|
|
479
|
-
next() {
|
|
480
|
-
if (this.heap.length == 0)
|
|
481
|
-
this.from = this.to = 1e9, this.value = null, this.rank = -1;
|
|
482
|
-
else {
|
|
483
|
-
let t = this.heap[0];
|
|
484
|
-
this.from = t.from, this.to = t.to, this.value = t.value, this.rank = t.rank, t.value && t.next(), w(this.heap, 0);
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
function w(n, t) {
|
|
489
|
-
for (let e = n[t]; ; ) {
|
|
490
|
-
let i = (t << 1) + 1;
|
|
491
|
-
if (i >= n.length)
|
|
492
|
-
break;
|
|
493
|
-
let s = n[i];
|
|
494
|
-
if (i + 1 < n.length && s.compare(n[i + 1]) >= 0 && (s = n[i + 1], i++), e.compare(s) < 0)
|
|
495
|
-
break;
|
|
496
|
-
n[i] = e, n[t] = s, t = i;
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
class p {
|
|
500
|
-
constructor(t, e, i) {
|
|
501
|
-
this.minPoint = i, this.active = [], this.activeTo = [], this.activeRank = [], this.minActive = -1, this.point = null, this.pointFrom = 0, this.pointRank = 0, this.to = -1e9, this.endSide = 0, this.openStart = -1, this.cursor = x.from(t, e, i);
|
|
502
|
-
}
|
|
503
|
-
goto(t, e = -1e9) {
|
|
504
|
-
return this.cursor.goto(t, e), this.active.length = this.activeTo.length = this.activeRank.length = 0, this.minActive = -1, this.to = t, this.endSide = e, this.openStart = -1, this.next(), this;
|
|
505
|
-
}
|
|
506
|
-
forward(t, e) {
|
|
507
|
-
for (; this.minActive > -1 && (this.activeTo[this.minActive] - t || this.active[this.minActive].endSide - e) < 0; )
|
|
508
|
-
this.removeActive(this.minActive);
|
|
509
|
-
this.cursor.forward(t, e);
|
|
510
|
-
}
|
|
511
|
-
removeActive(t) {
|
|
512
|
-
v(this.active, t), v(this.activeTo, t), v(this.activeRank, t), this.minActive = R(this.active, this.activeTo);
|
|
513
|
-
}
|
|
514
|
-
addActive(t) {
|
|
515
|
-
let e = 0, { value: i, to: s, rank: h } = this.cursor;
|
|
516
|
-
for (; e < this.activeRank.length && this.activeRank[e] <= h; )
|
|
517
|
-
e++;
|
|
518
|
-
g(this.active, e, i), g(this.activeTo, e, s), g(this.activeRank, e, h), t && g(t, e, this.cursor.from), this.minActive = R(this.active, this.activeTo);
|
|
519
|
-
}
|
|
520
|
-
// After calling this, if `this.point` != null, the next range is a
|
|
521
|
-
// point. Otherwise, it's a regular range, covered by `this.active`.
|
|
522
|
-
next() {
|
|
523
|
-
let t = this.to, e = this.point;
|
|
524
|
-
this.point = null;
|
|
525
|
-
let i = this.openStart < 0 ? [] : null, s = 0;
|
|
526
|
-
for (; ; ) {
|
|
527
|
-
let h = this.minActive;
|
|
528
|
-
if (h > -1 && (this.activeTo[h] - this.cursor.from || this.active[h].endSide - this.cursor.startSide) < 0) {
|
|
529
|
-
if (this.activeTo[h] > t) {
|
|
530
|
-
this.to = this.activeTo[h], this.endSide = this.active[h].endSide;
|
|
531
|
-
break;
|
|
532
|
-
}
|
|
533
|
-
this.removeActive(h), i && v(i, h);
|
|
534
|
-
} else if (this.cursor.value)
|
|
535
|
-
if (this.cursor.from > t) {
|
|
536
|
-
this.to = this.cursor.from, this.endSide = this.cursor.startSide;
|
|
537
|
-
break;
|
|
538
|
-
} else {
|
|
539
|
-
let r = this.cursor.value;
|
|
540
|
-
if (!r.point)
|
|
541
|
-
this.addActive(i), this.cursor.next();
|
|
542
|
-
else if (e && this.cursor.to == this.to && this.cursor.from < this.cursor.to)
|
|
543
|
-
this.cursor.next();
|
|
544
|
-
else {
|
|
545
|
-
this.point = r, this.pointFrom = this.cursor.from, this.pointRank = this.cursor.rank, this.to = this.cursor.to, this.endSide = r.endSide, this.cursor.from < t && (s = 1), this.cursor.next(), this.forward(this.to, this.endSide);
|
|
546
|
-
break;
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
else {
|
|
550
|
-
this.to = this.endSide = 1e9;
|
|
551
|
-
break;
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
if (i) {
|
|
555
|
-
let h = 0;
|
|
556
|
-
for (; h < i.length && i[h] < t; )
|
|
557
|
-
h++;
|
|
558
|
-
this.openStart = h + s;
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
activeForPoint(t) {
|
|
562
|
-
if (!this.active.length)
|
|
563
|
-
return this.active;
|
|
564
|
-
let e = [];
|
|
565
|
-
for (let i = this.active.length - 1; i >= 0 && !(this.activeRank[i] < this.pointRank); i--)
|
|
566
|
-
(this.activeTo[i] > t || this.activeTo[i] == t && this.active[i].endSide >= this.point.endSide) && e.push(this.active[i]);
|
|
567
|
-
return e.reverse();
|
|
32
|
+
|
|
33
|
+
.`).concat(l, ` {
|
|
34
|
+
margin-right: `).concat(c, "px ").concat(t, `;
|
|
568
35
|
}
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
e++;
|
|
573
|
-
return e;
|
|
36
|
+
|
|
37
|
+
.`).concat(g, " .").concat(g, ` {
|
|
38
|
+
right: 0 `).concat(t, `;
|
|
574
39
|
}
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
let r = i + s, o = i, a = i - t;
|
|
579
|
-
for (; ; ) {
|
|
580
|
-
let l = n.to + a - e.to || n.endSide - e.endSide, u = l < 0 ? n.to + a : e.to, c = Math.min(u, r);
|
|
581
|
-
if (n.point || e.point ? n.point && e.point && (n.point == e.point || n.point.eq(e.point)) && b(n.activeForPoint(n.to + a), e.activeForPoint(e.to)) || h.comparePoint(o, c, n.point, e.point) : c > o && !b(n.active, e.active) && h.compareRange(o, c, n.active, e.active), u > r)
|
|
582
|
-
break;
|
|
583
|
-
o = u, l <= 0 && n.next(), l >= 0 && e.next();
|
|
40
|
+
|
|
41
|
+
.`).concat(l, " .").concat(l, ` {
|
|
42
|
+
margin-right: 0 `).concat(t, `;
|
|
584
43
|
}
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
return
|
|
593
|
-
}
|
|
594
|
-
function
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
return e;
|
|
609
|
-
}
|
|
44
|
+
|
|
45
|
+
body[`).concat(e, `] {
|
|
46
|
+
`).concat(v, ": ").concat(c, `px;
|
|
47
|
+
}
|
|
48
|
+
`);
|
|
49
|
+
}, u = function() {
|
|
50
|
+
var n = parseInt(document.body.getAttribute(e) || "0", 10);
|
|
51
|
+
return isFinite(n) ? n : 0;
|
|
52
|
+
}, x = function() {
|
|
53
|
+
d.useEffect(function() {
|
|
54
|
+
return document.body.setAttribute(e, (u() + 1).toString()), function() {
|
|
55
|
+
var n = u() - 1;
|
|
56
|
+
n <= 0 ? document.body.removeAttribute(e) : document.body.setAttribute(e, n.toString());
|
|
57
|
+
};
|
|
58
|
+
}, []);
|
|
59
|
+
}, C = function(n) {
|
|
60
|
+
var a = n.noRelative, o = n.noImportant, t = n.gapMode, r = t === void 0 ? "margin" : t;
|
|
61
|
+
x();
|
|
62
|
+
var i = d.useMemo(function() {
|
|
63
|
+
return m(r);
|
|
64
|
+
}, [r]);
|
|
65
|
+
return d.createElement(b, { styles: h(i, !a, r, o ? "" : "!important") });
|
|
66
|
+
};
|
|
610
67
|
export {
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
P as RangeSetBuilder,
|
|
615
|
-
k as StateEffect,
|
|
616
|
-
z as StateEffectType,
|
|
617
|
-
O as codePointAt,
|
|
618
|
-
G as codePointSize,
|
|
619
|
-
V as fromCodePoint
|
|
68
|
+
C as RemoveScrollBar,
|
|
69
|
+
e as lockAttribute,
|
|
70
|
+
x as useLockAttribute
|
|
620
71
|
};
|