@drjoshcsimmons/scl 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/dist/components/ui/alert/alert.d.ts +1 -1
  2. package/dist/components/ui/alert/alert.d.ts.map +1 -1
  3. package/dist/components/ui/badge/badge.d.ts +1 -1
  4. package/dist/components/ui/badge/badge.d.ts.map +1 -1
  5. package/dist/components/ui/button/button.d.ts +1 -1
  6. package/dist/components/ui/button/button.d.ts.map +1 -1
  7. package/dist/components/ui/combobox/combobox.d.ts +31 -0
  8. package/dist/components/ui/combobox/combobox.d.ts.map +1 -0
  9. package/dist/components/ui/combobox/index.d.ts +3 -0
  10. package/dist/components/ui/combobox/index.d.ts.map +1 -0
  11. package/dist/components/ui/command/command.d.ts +85 -0
  12. package/dist/components/ui/command/command.d.ts.map +1 -0
  13. package/dist/components/ui/command/index.d.ts +2 -0
  14. package/dist/components/ui/command/index.d.ts.map +1 -0
  15. package/dist/components/ui/dithered-image/dithered-image.d.ts +6 -2
  16. package/dist/components/ui/dithered-image/dithered-image.d.ts.map +1 -1
  17. package/dist/components/ui/dithered-image/index.d.ts +1 -1
  18. package/dist/components/ui/dithered-image/index.d.ts.map +1 -1
  19. package/dist/components/ui/form/form.d.ts +24 -0
  20. package/dist/components/ui/form/form.d.ts.map +1 -0
  21. package/dist/components/ui/form/index.d.ts +2 -0
  22. package/dist/components/ui/form/index.d.ts.map +1 -0
  23. package/dist/components/ui/progress/progress.d.ts +0 -6
  24. package/dist/components/ui/progress/progress.d.ts.map +1 -1
  25. package/dist/components/ui/scroll-area/scroll-area.d.ts.map +1 -1
  26. package/dist/components/ui/skeleton/skeleton.d.ts +4 -1
  27. package/dist/components/ui/skeleton/skeleton.d.ts.map +1 -1
  28. package/dist/components/ui/statusline/statusline.d.ts.map +1 -1
  29. package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts +0 -5
  30. package/dist/components/ui/terminal-textarea/terminal-textarea.d.ts.map +1 -1
  31. package/dist/index.d.ts +3 -0
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +166 -143
  34. package/dist/index10.js +30 -30
  35. package/dist/index100.js +218 -29
  36. package/dist/index101.js +646 -11
  37. package/dist/index102.js +173 -127
  38. package/dist/index103.js +4 -50
  39. package/dist/index104.js +30 -9
  40. package/dist/index105.js +6 -4
  41. package/dist/index106.js +11 -180
  42. package/dist/index107.js +19 -648
  43. package/dist/index108.js +9 -107
  44. package/dist/index109.js +38 -91
  45. package/dist/index11.js +13 -13
  46. package/dist/index110.js +18 -67
  47. package/dist/index111.js +201 -154
  48. package/dist/index112.js +20 -395
  49. package/dist/index113.js +395 -1675
  50. package/dist/index114.js +2 -278
  51. package/dist/index115.js +49 -128
  52. package/dist/index116.js +65 -32
  53. package/dist/index117.js +19 -1605
  54. package/dist/index118.js +28 -297
  55. package/dist/index119.js +5 -635
  56. package/dist/index12.js +1 -1
  57. package/dist/index120.js +2 -144
  58. package/dist/index121.js +2 -21
  59. package/dist/index122.js +5 -9
  60. package/dist/index123.js +3 -38
  61. package/dist/index124.js +24 -18
  62. package/dist/index125.js +113 -6
  63. package/dist/index126.js +15 -11
  64. package/dist/index127.js +513 -194
  65. package/dist/index128.js +128 -22
  66. package/dist/index129.js +114 -380
  67. package/dist/index13.js +132 -93
  68. package/dist/index130.js +59 -1300
  69. package/dist/index131.js +63 -612
  70. package/dist/index132.js +9 -2
  71. package/dist/index133.js +13 -52
  72. package/dist/index134.js +64 -63
  73. package/dist/index135.js +3 -24
  74. package/dist/index136.js +23 -29
  75. package/dist/index137.js +23 -5
  76. package/dist/index138.js +13 -2
  77. package/dist/index139.js +28 -2
  78. package/dist/index14.js +106 -220
  79. package/dist/index140.js +5 -5
  80. package/dist/index15.js +79 -125
  81. package/dist/index16.js +280 -17
  82. package/dist/index17.js +139 -12
  83. package/dist/index18.js +92 -22
  84. package/dist/index19.js +18 -55
  85. package/dist/index2.js +2 -2
  86. package/dist/index20.js +14 -26
  87. package/dist/index21.js +19 -33
  88. package/dist/index22.js +38 -121
  89. package/dist/index23.js +29 -22
  90. package/dist/index24.js +31 -64
  91. package/dist/index25.js +121 -15
  92. package/dist/index26.js +19 -29
  93. package/dist/index27.js +68 -77
  94. package/dist/index28.js +20 -25
  95. package/dist/index29.js +32 -88
  96. package/dist/index3.js +11 -9
  97. package/dist/index30.js +138 -38
  98. package/dist/index31.js +20 -227
  99. package/dist/index32.js +88 -18
  100. package/dist/index33.js +37 -28
  101. package/dist/index34.js +86 -22
  102. package/dist/index35.js +17 -102
  103. package/dist/index36.js +34 -65
  104. package/dist/index37.js +23 -49
  105. package/dist/index38.js +38 -99
  106. package/dist/index39.js +65 -10
  107. package/dist/index4.js +6 -6
  108. package/dist/index40.js +49 -15
  109. package/dist/index41.js +93 -2256
  110. package/dist/index42.js +10 -32
  111. package/dist/index43.js +15 -18
  112. package/dist/index44.js +2251 -225
  113. package/dist/index45.js +237 -11
  114. package/dist/index46.js +11 -73
  115. package/dist/index47.js +33 -249
  116. package/dist/index48.js +118 -9
  117. package/dist/index49.js +63 -326
  118. package/dist/index5.js +23 -23
  119. package/dist/index50.js +307 -57
  120. package/dist/index51.js +12 -241
  121. package/dist/index52.js +222 -822
  122. package/dist/index53.js +6 -3
  123. package/dist/index54.js +56 -114
  124. package/dist/index55.js +248 -219
  125. package/dist/index56.js +249 -11
  126. package/dist/index57.js +3 -5
  127. package/dist/index58.js +110 -221
  128. package/dist/index59.js +12 -260
  129. package/dist/index6.js +12 -12
  130. package/dist/index60.js +18 -12
  131. package/dist/index61.js +221 -18
  132. package/dist/index62.js +11 -530
  133. package/dist/index63.js +11 -6155
  134. package/dist/index64.js +234 -2626
  135. package/dist/index65.js +230 -292
  136. package/dist/index66.js +504 -646
  137. package/dist/index67.js +155 -824
  138. package/dist/index68.js +128 -23
  139. package/dist/index69.js +319 -311
  140. package/dist/index7.js +22 -22
  141. package/dist/index70.js +72 -4889
  142. package/dist/index71.js +408 -802
  143. package/dist/index72.js +18 -1254
  144. package/dist/index73.js +844 -518
  145. package/dist/index74.js +9 -125
  146. package/dist/index75.js +31 -161
  147. package/dist/index76.js +7 -31
  148. package/dist/index77.js +62 -429
  149. package/dist/index78.js +50 -128
  150. package/dist/index79.js +4 -81
  151. package/dist/index8.js +17 -18
  152. package/dist/index80.js +23 -64
  153. package/dist/index81.js +33 -45
  154. package/dist/index82.js +63 -21
  155. package/dist/index83.js +10 -6
  156. package/dist/index84.js +52 -49
  157. package/dist/index85.js +10 -33
  158. package/dist/index86.js +30 -11
  159. package/dist/index87.js +12 -7
  160. package/dist/index88.js +46 -30
  161. package/dist/index89.js +7 -54
  162. package/dist/index9.js +23 -31
  163. package/dist/index90.js +14 -10
  164. package/dist/index91.js +125 -4
  165. package/dist/index92.js +131 -9
  166. package/dist/index93.js +14 -6
  167. package/dist/index94.js +14 -24
  168. package/dist/index95.js +9 -69
  169. package/dist/index96.js +47 -122
  170. package/dist/index97.js +51 -216
  171. package/dist/index98.js +6 -14
  172. package/dist/index99.js +24 -53
  173. package/dist/tokens/colors.d.ts +26 -86
  174. package/dist/tokens/colors.d.ts.map +1 -1
  175. package/dist/tokens/index.d.ts +12 -84
  176. package/dist/tokens/index.d.ts.map +1 -1
  177. package/package.json +28 -23
  178. package/dist/index141.js +0 -5
  179. package/dist/index142.js +0 -26
  180. package/dist/index143.js +0 -115
  181. package/dist/index144.js +0 -18
  182. package/dist/index145.js +0 -527
  183. package/dist/index146.js +0 -130
  184. package/dist/index147.js +0 -136
  185. package/dist/index148.js +0 -67
  186. package/dist/index149.js +0 -71
  187. package/dist/index150.js +0 -11
  188. package/dist/index151.js +0 -16
  189. package/dist/index152.js +0 -68
  190. package/dist/index153.js +0 -6
  191. package/dist/index154.js +0 -25
  192. package/dist/index155.js +0 -25
  193. package/dist/index156.js +0 -15
  194. package/dist/index157.js +0 -30
  195. package/dist/index158.js +0 -7
package/dist/index131.js CHANGED
@@ -1,620 +1,71 @@
1
- let I = /* @__PURE__ */ "lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((n) => n ? parseInt(n, 36) : 1);
2
- for (let n = 1; n < I.length; n++)
3
- I[n] += I[n - 1];
4
- function q(n) {
5
- return n >= 56320 && n < 57344;
6
- }
7
- function j(n) {
8
- return n >= 55296 && n < 56320;
9
- }
10
- function O(n, t) {
11
- let e = n.charCodeAt(t);
12
- if (!j(e) || t + 1 == n.length)
13
- return e;
14
- let i = n.charCodeAt(t + 1);
15
- return q(i) ? (e - 55296 << 10) + (i - 56320) + 65536 : e;
16
- }
17
- function V(n) {
18
- return n <= 65535 ? String.fromCharCode(n) : (n -= 65536, String.fromCharCode((n >> 10) + 55296, (n & 1023) + 56320));
19
- }
20
- function G(n) {
21
- return n < 65536 ? 1 : 2;
22
- }
23
- var y = /* @__PURE__ */ function(n) {
24
- return n[n.Simple = 0] = "Simple", n[n.TrackDel = 1] = "TrackDel", n[n.TrackBefore = 2] = "TrackBefore", n[n.TrackAfter = 3] = "TrackAfter", n;
25
- }(y || (y = {}));
26
- class z {
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
- (Note: The type parameter is just there as a kludge to work
185
- around TypeScript variance issues that prevented `RangeSet<X>`
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
- @internal
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
- openEnd(t) {
570
- let e = 0;
571
- for (let i = this.activeTo.length - 1; i >= 0 && this.activeTo[i] > t; i--)
572
- e++;
573
- return e;
36
+
37
+ .`).concat(g, " .").concat(g, ` {
38
+ right: 0 `).concat(t, `;
574
39
  }
575
- }
576
- function L(n, t, e, i, s, h) {
577
- n.goto(t), e.goto(i);
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
- function b(n, t) {
587
- if (n.length != t.length)
588
- return !1;
589
- for (let e = 0; e < n.length; e++)
590
- if (n[e] != t[e] && !n[e].eq(t[e]))
591
- return !1;
592
- return !0;
593
- }
594
- function v(n, t) {
595
- for (let e = t, i = n.length - 1; e < i; e++)
596
- n[e] = n[e + 1];
597
- n.pop();
598
- }
599
- function g(n, t, e) {
600
- for (let i = n.length - 1; i >= t; i--)
601
- n[i + 1] = n[i];
602
- n[t] = e;
603
- }
604
- function R(n, t) {
605
- let e = -1, i = 1e9;
606
- for (let s = 0; s < t.length; s++)
607
- (t[s] - i || n[s].endSide - n[e].endSide) < 0 && (e = s, i = t[s]);
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
- y as MapMode,
612
- S as Range,
613
- f as RangeSet,
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
  };