@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/index69.js
CHANGED
|
@@ -1,330 +1,256 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
let n = /^(?:ATX|Setext)Heading(\d)$/.exec(r.name);
|
|
22
|
-
return n ? +n[1] : void 0;
|
|
1
|
+
import u from "react";
|
|
2
|
+
var z = (e) => e.type === "checkbox", k = (e) => e instanceof Date, w = (e) => e == null;
|
|
3
|
+
const H = (e) => typeof e == "object";
|
|
4
|
+
var p = (e) => !w(e) && !Array.isArray(e) && H(e) && !k(e), J = (e) => p(e) && e.target ? z(e.target) ? e.target.checked : e.target.value : e, Q = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, X = (e, s) => e.has(Q(s)), Y = (e) => {
|
|
5
|
+
const s = e.constructor && e.constructor.prototype;
|
|
6
|
+
return p(s) && s.hasOwnProperty("isPrototypeOf");
|
|
7
|
+
}, Z = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
8
|
+
function W(e) {
|
|
9
|
+
if (e instanceof Date)
|
|
10
|
+
return new Date(e);
|
|
11
|
+
const s = typeof FileList < "u" && e instanceof FileList;
|
|
12
|
+
if (Z && (e instanceof Blob || s))
|
|
13
|
+
return e;
|
|
14
|
+
const t = Array.isArray(e);
|
|
15
|
+
if (!t && !(p(e) && Y(e)))
|
|
16
|
+
return e;
|
|
17
|
+
const n = t ? [] : Object.create(Object.getPrototypeOf(e));
|
|
18
|
+
for (const r in e)
|
|
19
|
+
Object.prototype.hasOwnProperty.call(e, r) && (n[r] = W(e[r]));
|
|
20
|
+
return n;
|
|
23
21
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
for (let t = A(r).resolveInner(o, -1); t && !(t.from < n); t = t.parent) {
|
|
39
|
-
let e = t.type.prop(q);
|
|
40
|
-
if (e == null)
|
|
41
|
-
continue;
|
|
42
|
-
let i = pe(t, e);
|
|
43
|
-
if (i > o)
|
|
44
|
-
return { from: o, to: i };
|
|
45
|
-
}
|
|
46
|
-
return null;
|
|
47
|
-
});
|
|
48
|
-
function T(r) {
|
|
49
|
-
return new Q($, r, [], "markdown");
|
|
50
|
-
}
|
|
51
|
-
const he = /* @__PURE__ */ T(H), ge = /* @__PURE__ */ H.configure([ie, le, se, fe, {
|
|
52
|
-
props: [
|
|
53
|
-
/* @__PURE__ */ R.add({
|
|
54
|
-
Table: (r, n) => ({ from: n.doc.lineAt(r.from).to, to: r.to })
|
|
55
|
-
})
|
|
56
|
-
]
|
|
57
|
-
}]), b = /* @__PURE__ */ T(ge);
|
|
58
|
-
function ke(r, n) {
|
|
59
|
-
return (o) => {
|
|
60
|
-
if (o && r) {
|
|
61
|
-
let t = null;
|
|
62
|
-
if (o = /\S*/.exec(o)[0], typeof r == "function" ? t = r(o) : t = D.matchLanguageName(r, o, !0), t instanceof D)
|
|
63
|
-
return t.support ? t.support.language.parser : ee.getSkippingParser(t.load());
|
|
64
|
-
if (t)
|
|
65
|
-
return t.parser;
|
|
22
|
+
var G = (e) => /^\w*$/.test(e), R = (e) => e === void 0, j = (e) => Array.isArray(e) ? e.filter(Boolean) : [], $ = (e) => j(e.replace(/["|']|\]/g, "").split(/\.|\[/)), y = (e, s, t) => {
|
|
23
|
+
if (!s || !p(e))
|
|
24
|
+
return t;
|
|
25
|
+
const n = (G(s) ? [s] : $(s)).reduce((r, a) => w(r) ? r : r[a], e);
|
|
26
|
+
return R(n) || n === e ? R(e[s]) ? t : e[s] : n;
|
|
27
|
+
}, P = (e) => typeof e == "boolean", E = (e) => typeof e == "function", D = (e, s, t) => {
|
|
28
|
+
let n = -1;
|
|
29
|
+
const r = G(s) ? [s] : $(s), a = r.length, i = a - 1;
|
|
30
|
+
for (; ++n < a; ) {
|
|
31
|
+
const l = r[n];
|
|
32
|
+
let c = t;
|
|
33
|
+
if (n !== i) {
|
|
34
|
+
const f = e[l];
|
|
35
|
+
c = p(f) || Array.isArray(f) ? f : isNaN(+r[n + 1]) ? {} : [];
|
|
66
36
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
class v {
|
|
71
|
-
constructor(n, o, t, e, i, a, m) {
|
|
72
|
-
this.node = n, this.from = o, this.to = t, this.spaceBefore = e, this.spaceAfter = i, this.type = a, this.item = m;
|
|
37
|
+
if (l === "__proto__" || l === "constructor" || l === "prototype")
|
|
38
|
+
return;
|
|
39
|
+
e[l] = c, e = e[l];
|
|
73
40
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
41
|
+
};
|
|
42
|
+
const I = {
|
|
43
|
+
BLUR: "blur",
|
|
44
|
+
CHANGE: "change"
|
|
45
|
+
}, B = {
|
|
46
|
+
all: "all"
|
|
47
|
+
}, L = u.createContext(null);
|
|
48
|
+
L.displayName = "HookFormContext";
|
|
49
|
+
const M = () => u.useContext(L), oe = (e) => {
|
|
50
|
+
const { children: s, ...t } = e;
|
|
51
|
+
return u.createElement(L.Provider, { value: t }, s);
|
|
52
|
+
};
|
|
53
|
+
var ee = (e, s, t, n = !0) => {
|
|
54
|
+
const r = {
|
|
55
|
+
defaultValues: s._defaultValues
|
|
56
|
+
};
|
|
57
|
+
for (const a in e)
|
|
58
|
+
Object.defineProperty(r, a, {
|
|
59
|
+
get: () => {
|
|
60
|
+
const i = a;
|
|
61
|
+
return s._proxyFormState[i] !== B.all && (s._proxyFormState[i] = !n || B.all), t && (t[i] = !0), e[i];
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
return r;
|
|
65
|
+
};
|
|
66
|
+
const q = typeof window < "u" ? u.useLayoutEffect : u.useEffect;
|
|
67
|
+
function te(e) {
|
|
68
|
+
const s = M(), { control: t = s.control, disabled: n, name: r, exact: a } = e || {}, [i, l] = u.useState(t._formState), c = u.useRef({
|
|
69
|
+
isDirty: !1,
|
|
70
|
+
isLoading: !1,
|
|
71
|
+
dirtyFields: !1,
|
|
72
|
+
touchedFields: !1,
|
|
73
|
+
validatingFields: !1,
|
|
74
|
+
isValidating: !1,
|
|
75
|
+
isValid: !1,
|
|
76
|
+
errors: !1
|
|
77
|
+
});
|
|
78
|
+
return q(() => t._subscribe({
|
|
79
|
+
name: r,
|
|
80
|
+
formState: c.current,
|
|
81
|
+
exact: a,
|
|
82
|
+
callback: (f) => {
|
|
83
|
+
!n && l({
|
|
84
|
+
...t._formState,
|
|
85
|
+
...f
|
|
86
|
+
});
|
|
84
87
|
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return this.spaceBefore + t + this.type + this.spaceAfter;
|
|
89
|
-
}
|
|
88
|
+
}), [r, n, a]), u.useEffect(() => {
|
|
89
|
+
c.current.isValid && t._setValid(!0);
|
|
90
|
+
}, [t]), u.useMemo(() => ee(i, t, c.current, !1), [i, t]);
|
|
90
91
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
92
|
+
var re = (e) => typeof e == "string", T = (e, s, t, n, r) => re(e) ? y(t, e, r) : Array.isArray(e) ? e.map((a) => y(t, a)) : t, U = (e) => w(e) || !H(e);
|
|
93
|
+
function S(e, s, t = /* @__PURE__ */ new WeakSet()) {
|
|
94
|
+
if (U(e) || U(s))
|
|
95
|
+
return Object.is(e, s);
|
|
96
|
+
if (k(e) && k(s))
|
|
97
|
+
return e.getTime() === s.getTime();
|
|
98
|
+
const n = Object.keys(e), r = Object.keys(s);
|
|
99
|
+
if (n.length !== r.length)
|
|
100
|
+
return !1;
|
|
101
|
+
if (t.has(e) || t.has(s))
|
|
102
|
+
return !0;
|
|
103
|
+
t.add(e), t.add(s);
|
|
104
|
+
for (const a of n) {
|
|
105
|
+
const i = e[a];
|
|
106
|
+
if (!r.includes(a))
|
|
107
|
+
return !1;
|
|
108
|
+
if (a !== "ref") {
|
|
109
|
+
const l = s[a];
|
|
110
|
+
if (k(i) && k(l) || p(i) && p(l) || Array.isArray(i) && Array.isArray(l) ? !S(i, l, t) : !Object.is(i, l))
|
|
111
|
+
return !1;
|
|
110
112
|
}
|
|
111
113
|
}
|
|
112
|
-
return
|
|
114
|
+
return !0;
|
|
113
115
|
}
|
|
114
|
-
function
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
116
|
+
function se(e) {
|
|
117
|
+
const s = M(), { control: t = s.control, name: n, defaultValue: r, disabled: a, exact: i, compute: l } = e || {}, c = u.useRef(r), f = u.useRef(l), V = u.useRef(void 0), d = u.useRef(t), g = u.useRef(n);
|
|
118
|
+
f.current = l;
|
|
119
|
+
const [A, v] = u.useState(() => {
|
|
120
|
+
const o = t._getWatch(n, c.current);
|
|
121
|
+
return f.current ? f.current(o) : o;
|
|
122
|
+
}), C = u.useCallback((o) => {
|
|
123
|
+
const m = T(n, t._names, o || t._formValues, !1, c.current);
|
|
124
|
+
return f.current ? f.current(m) : m;
|
|
125
|
+
}, [t._formValues, t._names, n]), b = u.useCallback((o) => {
|
|
126
|
+
if (!a) {
|
|
127
|
+
const m = T(n, t._names, o || t._formValues, !1, c.current);
|
|
128
|
+
if (f.current) {
|
|
129
|
+
const _ = f.current(m);
|
|
130
|
+
S(_, V.current) || (v(_), V.current = _);
|
|
131
|
+
} else
|
|
132
|
+
v(m);
|
|
127
133
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
return r;
|
|
138
|
-
let t = w(r, 4, o), e = "";
|
|
139
|
-
for (let i = t; i > 0; )
|
|
140
|
-
i >= 4 ? (e += " ", i -= 4) : (e += " ", i--);
|
|
141
|
-
return e + r.slice(o);
|
|
142
|
-
}
|
|
143
|
-
const xe = (r = {}) => ({ state: n, dispatch: o }) => {
|
|
144
|
-
let t = A(n), { doc: e } = n, i = null, a = n.changeByRange((m) => {
|
|
145
|
-
if (!m.empty || !b.isActiveAt(n, m.from, -1) && !b.isActiveAt(n, m.from, 1))
|
|
146
|
-
return i = { range: m };
|
|
147
|
-
let s = m.from, f = e.lineAt(s), l = U(t.resolveInner(s, -1), e);
|
|
148
|
-
for (; l.length && l[l.length - 1].from > s - f.from; )
|
|
149
|
-
l.pop();
|
|
150
|
-
if (!l.length)
|
|
151
|
-
return i = { range: m };
|
|
152
|
-
let u = l[l.length - 1];
|
|
153
|
-
if (u.to - u.spaceAfter.length > s - f.from)
|
|
154
|
-
return i = { range: m };
|
|
155
|
-
let d = s >= u.to - u.spaceAfter.length && !/\S/.test(f.text.slice(u.to));
|
|
156
|
-
if (u.item && d) {
|
|
157
|
-
let p = u.node.firstChild, h = u.node.getChild("ListItem", "ListItem");
|
|
158
|
-
if (p.to >= s || h && h.to < s || f.from > 0 && !/[^\s>]/.test(e.lineAt(f.from - 1).text) || r.nonTightLists === !1) {
|
|
159
|
-
let c = l.length > 1 ? l[l.length - 2] : null, C, B = "";
|
|
160
|
-
c && c.item ? (C = f.from + c.from, B = c.marker(e, 1)) : C = f.from + (c ? c.to : 0);
|
|
161
|
-
let S = [{ from: C, to: s, insert: B }];
|
|
162
|
-
return u.node.name == "OrderedList" && I(u.item, e, S, -2), c && c.node.name == "OrderedList" && I(c.item, e, S), { range: x.cursor(C + B.length), changes: S };
|
|
163
|
-
} else {
|
|
164
|
-
let c = F(l, n, f);
|
|
165
|
-
return {
|
|
166
|
-
range: x.cursor(s + c.length + 1),
|
|
167
|
-
changes: { from: f.from, insert: c + n.lineBreak }
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
if (u.node.name == "Blockquote" && d && f.from) {
|
|
172
|
-
let p = e.lineAt(f.from - 1), h = />\s*$/.exec(p.text);
|
|
173
|
-
if (h && h.index == u.from) {
|
|
174
|
-
let c = n.changes([
|
|
175
|
-
{ from: p.from + h.index, to: p.to },
|
|
176
|
-
{ from: f.from + u.from, to: f.to }
|
|
177
|
-
]);
|
|
178
|
-
return { range: m.map(c), changes: c };
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
let g = [];
|
|
182
|
-
u.node.name == "OrderedList" && I(u.item, e, g);
|
|
183
|
-
let M = u.item && u.item.from < f.from, k = "";
|
|
184
|
-
if (!M || /^[\s\d.)\-+*>]*/.exec(f.text)[0].length >= u.to)
|
|
185
|
-
for (let p = 0, h = l.length - 1; p <= h; p++)
|
|
186
|
-
k += p == h && !M ? l[p].marker(e, 1) : l[p].blank(p < h ? w(f.text, 4, l[p + 1].from) - k.length : null);
|
|
187
|
-
let L = s;
|
|
188
|
-
for (; L > f.from && /\s/.test(f.text.charAt(L - f.from - 1)); )
|
|
189
|
-
L--;
|
|
190
|
-
return k = E(k, n), we(u.node, n.doc) && (k = F(l, n, f) + n.lineBreak + k), g.push({ from: L, to: s, insert: n.lineBreak + k }), { range: x.cursor(L + k.length + 1), changes: g };
|
|
191
|
-
});
|
|
192
|
-
return i ? !1 : (o(n.update(a, { scrollIntoView: !0, userEvent: "input" })), !0);
|
|
193
|
-
}, Le = /* @__PURE__ */ xe();
|
|
194
|
-
function O(r) {
|
|
195
|
-
return r.name == "QuoteMark" || r.name == "ListMark";
|
|
196
|
-
}
|
|
197
|
-
function we(r, n) {
|
|
198
|
-
if (r.name != "OrderedList" && r.name != "BulletList")
|
|
199
|
-
return !1;
|
|
200
|
-
let o = r.firstChild, t = r.getChild("ListItem", "ListItem");
|
|
201
|
-
if (!t)
|
|
202
|
-
return !1;
|
|
203
|
-
let e = n.lineAt(o.to), i = n.lineAt(t.from), a = /^[\s>]*$/.test(e.text);
|
|
204
|
-
return e.number + (a ? 0 : 1) < i.number;
|
|
205
|
-
}
|
|
206
|
-
function F(r, n, o) {
|
|
207
|
-
let t = "";
|
|
208
|
-
for (let e = 0, i = r.length - 2; e <= i; e++)
|
|
209
|
-
t += r[e].blank(e < i ? w(o.text, 4, r[e + 1].from) - t.length : null, e < i);
|
|
210
|
-
return E(t, n);
|
|
211
|
-
}
|
|
212
|
-
function Ae(r, n) {
|
|
213
|
-
let o = r.resolveInner(n, -1), t = n;
|
|
214
|
-
O(o) && (t = o.from, o = o.parent);
|
|
215
|
-
for (let e; e = o.childBefore(t); )
|
|
216
|
-
if (O(e))
|
|
217
|
-
t = e.from;
|
|
218
|
-
else if (e.name == "OrderedList" || e.name == "BulletList")
|
|
219
|
-
o = e.lastChild, t = o.to;
|
|
220
|
-
else
|
|
221
|
-
break;
|
|
222
|
-
return o;
|
|
223
|
-
}
|
|
224
|
-
const Ce = ({ state: r, dispatch: n }) => {
|
|
225
|
-
let o = A(r), t = null, e = r.changeByRange((i) => {
|
|
226
|
-
let a = i.from, { doc: m } = r;
|
|
227
|
-
if (i.empty && b.isActiveAt(r, i.from)) {
|
|
228
|
-
let s = m.lineAt(a), f = U(Ae(o, a), m);
|
|
229
|
-
if (f.length) {
|
|
230
|
-
let l = f[f.length - 1], u = l.to - l.spaceAfter.length + (l.spaceAfter ? 1 : 0);
|
|
231
|
-
if (a - s.from > u && !/\S/.test(s.text.slice(u, a - s.from)))
|
|
232
|
-
return {
|
|
233
|
-
range: x.cursor(s.from + u),
|
|
234
|
-
changes: { from: s.from + u, to: a }
|
|
235
|
-
};
|
|
236
|
-
if (a - s.from == u && // Only apply this if we're on the line that has the
|
|
237
|
-
// construct's syntax, or there's only indentation in the
|
|
238
|
-
// target range
|
|
239
|
-
(!l.item || s.from <= l.item.from || !/\S/.test(s.text.slice(0, l.to)))) {
|
|
240
|
-
let d = s.from + l.from;
|
|
241
|
-
if (l.item && l.node.from < l.item.from && /\S/.test(s.text.slice(l.from, l.to))) {
|
|
242
|
-
let g = l.blank(w(s.text, 4, l.to) - w(s.text, 4, l.from));
|
|
243
|
-
return d == s.from && (g = E(g, r)), {
|
|
244
|
-
range: x.cursor(d + g.length),
|
|
245
|
-
changes: { from: d, to: s.from + l.to, insert: g }
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
if (d < a)
|
|
249
|
-
return { range: x.cursor(d), changes: { from: d, to: a } };
|
|
250
|
-
}
|
|
251
|
-
}
|
|
134
|
+
}, [t._formValues, t._names, a, n]);
|
|
135
|
+
q(() => ((d.current !== t || !S(g.current, n)) && (d.current = t, g.current = n, b()), t._subscribe({
|
|
136
|
+
name: n,
|
|
137
|
+
formState: {
|
|
138
|
+
values: !0
|
|
139
|
+
},
|
|
140
|
+
exact: i,
|
|
141
|
+
callback: (o) => {
|
|
142
|
+
b(o.values);
|
|
252
143
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
}, be = [
|
|
257
|
-
{ key: "Enter", run: Le },
|
|
258
|
-
{ key: "Backspace", run: Ce }
|
|
259
|
-
], X = /* @__PURE__ */ ae({ matchClosingTags: !1 });
|
|
260
|
-
function Oe(r = {}) {
|
|
261
|
-
let { codeLanguages: n, defaultCodeLanguage: o, addKeymap: t = !0, base: { parser: e } = he, completeHTMLTags: i = !0, pasteURLAsLink: a = !0, htmlTagLanguage: m = X } = r;
|
|
262
|
-
if (!(e instanceof re))
|
|
263
|
-
throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");
|
|
264
|
-
let s = r.extensions ? [r.extensions] : [], f = [m.support, de], l;
|
|
265
|
-
a && f.push(Ie), o instanceof N ? (f.push(o.support), l = o.language) : o && (l = o);
|
|
266
|
-
let u = n || l ? ke(n, l) : void 0;
|
|
267
|
-
s.push(ne({ codeParser: u, htmlParser: m.language.parser })), t && f.push(z.high(_.of(be)));
|
|
268
|
-
let d = T(e.configure(s));
|
|
269
|
-
return i && f.push(d.data.of({ autocomplete: Be })), new N(d, f);
|
|
270
|
-
}
|
|
271
|
-
function Be(r) {
|
|
272
|
-
let { state: n, pos: o } = r, t = /<[:\-\.\w\u00b7-\uffff]*$/.exec(n.sliceDoc(o - 25, o));
|
|
273
|
-
if (!t)
|
|
274
|
-
return null;
|
|
275
|
-
let e = A(n).resolveInner(o, -1);
|
|
276
|
-
for (; e && !e.type.isTop; ) {
|
|
277
|
-
if (e.name == "CodeBlock" || e.name == "FencedCode" || e.name == "ProcessingInstructionBlock" || e.name == "CommentBlock" || e.name == "Link" || e.name == "Image")
|
|
144
|
+
})), [t, i, n, b]), u.useEffect(() => t._removeUnmounted());
|
|
145
|
+
const h = d.current !== t, F = g.current, O = u.useMemo(() => {
|
|
146
|
+
if (a)
|
|
278
147
|
return null;
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
to: o,
|
|
284
|
-
options: Se(),
|
|
285
|
-
validFor: /^<[:\-\.\w\u00b7-\uffff]*$/
|
|
286
|
-
};
|
|
148
|
+
const o = !h && !S(F, n);
|
|
149
|
+
return h || o ? C() : null;
|
|
150
|
+
}, [a, h, n, F, C]);
|
|
151
|
+
return O !== null ? O : A;
|
|
287
152
|
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
153
|
+
function ne(e) {
|
|
154
|
+
const s = M(), { name: t, disabled: n, control: r = s.control, shouldUnregister: a, defaultValue: i, exact: l = !0 } = e, c = X(r._names.array, t), f = u.useMemo(() => y(r._formValues, t, y(r._defaultValues, t, i)), [r, t, i]), V = se({
|
|
155
|
+
control: r,
|
|
156
|
+
name: t,
|
|
157
|
+
defaultValue: f,
|
|
158
|
+
exact: l
|
|
159
|
+
}), d = te({
|
|
160
|
+
control: r,
|
|
161
|
+
name: t,
|
|
162
|
+
exact: l
|
|
163
|
+
}), g = u.useRef(e), A = u.useRef(void 0), v = u.useRef(r.register(t, {
|
|
164
|
+
...e.rules,
|
|
165
|
+
value: V,
|
|
166
|
+
...P(e.disabled) ? { disabled: e.disabled } : {}
|
|
167
|
+
}));
|
|
168
|
+
g.current = e;
|
|
169
|
+
const C = u.useMemo(() => Object.defineProperties({}, {
|
|
170
|
+
invalid: {
|
|
171
|
+
enumerable: !0,
|
|
172
|
+
get: () => !!y(d.errors, t)
|
|
173
|
+
},
|
|
174
|
+
isDirty: {
|
|
175
|
+
enumerable: !0,
|
|
176
|
+
get: () => !!y(d.dirtyFields, t)
|
|
177
|
+
},
|
|
178
|
+
isTouched: {
|
|
179
|
+
enumerable: !0,
|
|
180
|
+
get: () => !!y(d.touchedFields, t)
|
|
181
|
+
},
|
|
182
|
+
isValidating: {
|
|
183
|
+
enumerable: !0,
|
|
184
|
+
get: () => !!y(d.validatingFields, t)
|
|
185
|
+
},
|
|
186
|
+
error: {
|
|
187
|
+
enumerable: !0,
|
|
188
|
+
get: () => y(d.errors, t)
|
|
189
|
+
}
|
|
190
|
+
}), [d, t]), b = u.useCallback((o) => v.current.onChange({
|
|
191
|
+
target: {
|
|
192
|
+
value: J(o),
|
|
193
|
+
name: t
|
|
194
|
+
},
|
|
195
|
+
type: I.CHANGE
|
|
196
|
+
}), [t]), h = u.useCallback(() => v.current.onBlur({
|
|
197
|
+
target: {
|
|
198
|
+
value: y(r._formValues, t),
|
|
199
|
+
name: t
|
|
200
|
+
},
|
|
201
|
+
type: I.BLUR
|
|
202
|
+
}), [t, r._formValues]), F = u.useCallback((o) => {
|
|
203
|
+
const m = y(r._fields, t);
|
|
204
|
+
m && m._f && o && (m._f.ref = {
|
|
205
|
+
focus: () => E(o.focus) && o.focus(),
|
|
206
|
+
select: () => E(o.select) && o.select(),
|
|
207
|
+
setCustomValidity: (_) => E(o.setCustomValidity) && o.setCustomValidity(_),
|
|
208
|
+
reportValidity: () => E(o.reportValidity) && o.reportValidity()
|
|
209
|
+
});
|
|
210
|
+
}, [r._fields, t]), O = u.useMemo(() => ({
|
|
211
|
+
name: t,
|
|
212
|
+
value: V,
|
|
213
|
+
...P(n) || d.disabled ? { disabled: d.disabled || n } : {},
|
|
214
|
+
onChange: b,
|
|
215
|
+
onBlur: h,
|
|
216
|
+
ref: F
|
|
217
|
+
}), [t, n, d.disabled, b, h, F, V]);
|
|
218
|
+
return u.useEffect(() => {
|
|
219
|
+
const o = r._options.shouldUnregister || a, m = A.current;
|
|
220
|
+
m && m !== t && !c && r.unregister(m), r.register(t, {
|
|
221
|
+
...g.current.rules,
|
|
222
|
+
...P(g.current.disabled) ? { disabled: g.current.disabled } : {}
|
|
223
|
+
});
|
|
224
|
+
const _ = (x, K) => {
|
|
225
|
+
const N = y(r._fields, x);
|
|
226
|
+
N && N._f && (N._f.mount = K);
|
|
227
|
+
};
|
|
228
|
+
if (_(t, !0), o) {
|
|
229
|
+
const x = W(y(r._options.defaultValues, t, g.current.defaultValue));
|
|
230
|
+
D(r._defaultValues, t, x), R(y(r._formValues, t)) && D(r._formValues, t, x);
|
|
231
|
+
}
|
|
232
|
+
return !c && r.register(t), A.current = t, () => {
|
|
233
|
+
(c ? o && !r._state.action : o) ? r.unregister(t) : _(t, !1);
|
|
234
|
+
};
|
|
235
|
+
}, [t, r, c, a]), u.useEffect(() => {
|
|
236
|
+
r._setDisabledField({
|
|
237
|
+
disabled: n,
|
|
238
|
+
name: t
|
|
239
|
+
});
|
|
240
|
+
}, [n, t, r]), u.useMemo(() => ({
|
|
241
|
+
field: O,
|
|
242
|
+
formState: d,
|
|
243
|
+
fieldState: C
|
|
244
|
+
}), [O, d, C]);
|
|
294
245
|
}
|
|
295
|
-
const
|
|
296
|
-
paste: (r, n) => {
|
|
297
|
-
var o;
|
|
298
|
-
let { main: t } = n.state.selection;
|
|
299
|
-
if (t.empty)
|
|
300
|
-
return !1;
|
|
301
|
-
let e = (o = r.clipboardData) === null || o === void 0 ? void 0 : o.getData("text/plain");
|
|
302
|
-
if (!e || !/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(e) || (/^www\./.test(e) && (e = "https://" + e), !b.isActiveAt(n.state, t.from, 1)))
|
|
303
|
-
return !1;
|
|
304
|
-
let i = A(n.state), a = !1;
|
|
305
|
-
return i.iterate({
|
|
306
|
-
from: t.from,
|
|
307
|
-
to: t.to,
|
|
308
|
-
enter: (m) => {
|
|
309
|
-
(m.from > t.from || ve.test(m.name)) && (a = !0);
|
|
310
|
-
},
|
|
311
|
-
leave: (m) => {
|
|
312
|
-
m.to < t.to && (a = !0);
|
|
313
|
-
}
|
|
314
|
-
}), a ? !1 : (n.dispatch({
|
|
315
|
-
changes: [{ from: t.from, insert: "[" }, { from: t.to, insert: `](${e})` }],
|
|
316
|
-
userEvent: "input.paste",
|
|
317
|
-
scrollIntoView: !0
|
|
318
|
-
}), !0);
|
|
319
|
-
}
|
|
320
|
-
});
|
|
246
|
+
const ae = (e) => e.render(ne(e));
|
|
321
247
|
export {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
248
|
+
ae as Controller,
|
|
249
|
+
oe as FormProvider,
|
|
250
|
+
y as get,
|
|
251
|
+
D as set,
|
|
252
|
+
ne as useController,
|
|
253
|
+
M as useFormContext,
|
|
254
|
+
te as useFormState,
|
|
255
|
+
se as useWatch
|
|
330
256
|
};
|
package/dist/index7.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import { Root as s, Image as t, Fallback as
|
|
4
|
-
import { cn as
|
|
5
|
-
const
|
|
2
|
+
import * as o from "react";
|
|
3
|
+
import { Root as s, Image as t, Fallback as d } from "./index52.js";
|
|
4
|
+
import { cn as m } from "./index2.js";
|
|
5
|
+
const f = o.forwardRef(({ className: a, ...r }, e) => /* @__PURE__ */ l(
|
|
6
6
|
s,
|
|
7
7
|
{
|
|
8
|
-
ref:
|
|
9
|
-
className:
|
|
10
|
-
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full border border-
|
|
8
|
+
ref: e,
|
|
9
|
+
className: m(
|
|
10
|
+
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full border border-primary",
|
|
11
11
|
a
|
|
12
12
|
),
|
|
13
|
-
...
|
|
13
|
+
...r
|
|
14
14
|
}
|
|
15
15
|
));
|
|
16
|
-
|
|
17
|
-
const i =
|
|
16
|
+
f.displayName = s.displayName;
|
|
17
|
+
const i = o.forwardRef(({ className: a, ...r }, e) => /* @__PURE__ */ l(
|
|
18
18
|
t,
|
|
19
19
|
{
|
|
20
|
-
ref:
|
|
21
|
-
className:
|
|
22
|
-
...
|
|
20
|
+
ref: e,
|
|
21
|
+
className: m("aspect-square h-full w-full", a),
|
|
22
|
+
...r
|
|
23
23
|
}
|
|
24
24
|
));
|
|
25
25
|
i.displayName = t.displayName;
|
|
26
|
-
const
|
|
27
|
-
|
|
26
|
+
const p = o.forwardRef(({ className: a, ...r }, e) => /* @__PURE__ */ l(
|
|
27
|
+
d,
|
|
28
28
|
{
|
|
29
|
-
ref:
|
|
30
|
-
className:
|
|
31
|
-
"flex h-full w-full items-center justify-center rounded-full bg-
|
|
29
|
+
ref: e,
|
|
30
|
+
className: m(
|
|
31
|
+
"flex h-full w-full items-center justify-center rounded-full bg-background border border-primary text-primary",
|
|
32
32
|
a
|
|
33
33
|
),
|
|
34
|
-
...
|
|
34
|
+
...r
|
|
35
35
|
}
|
|
36
36
|
));
|
|
37
|
-
|
|
37
|
+
p.displayName = d.displayName;
|
|
38
38
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
f as Avatar,
|
|
40
|
+
p as AvatarFallback,
|
|
41
41
|
i as AvatarImage
|
|
42
42
|
};
|