@solibo/solibo-ui 1.0.5 → 1.0.7
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/assets/index.css +1 -1
- package/dist/assets/index10.css +1 -1
- package/dist/assets/index11.css +1 -1
- package/dist/assets/index12.css +1 -1
- package/dist/assets/index13.css +1 -1
- package/dist/assets/index14.css +1 -1
- package/dist/assets/index15.css +1 -1
- package/dist/assets/index19.css +1 -1
- package/dist/assets/index20.css +1 -1
- package/dist/assets/index26.css +1 -1
- package/dist/assets/index3.css +1 -1
- package/dist/assets/index31.css +1 -1
- package/dist/assets/index32.css +1 -1
- package/dist/assets/index36.css +1 -1
- package/dist/assets/index38.css +1 -1
- package/dist/assets/index39.css +1 -1
- package/dist/assets/index4.css +1 -1
- package/dist/assets/index42.css +1 -1
- package/dist/assets/index5.css +1 -1
- package/dist/assets/index6.css +1 -1
- package/dist/assets/index7.css +1 -1
- package/dist/assets/index8.css +1 -1
- package/dist/assets/index9.css +1 -1
- package/dist/components/aside/index.cjs +1 -1
- package/dist/components/aside/index.js +15 -15
- package/dist/components/button/index.cjs +1 -1
- package/dist/components/button/index.cjs.map +1 -1
- package/dist/components/button/index.js +25 -22
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/card/index.cjs +1 -1
- package/dist/components/card/index.js +38 -38
- package/dist/components/checkbox/index.cjs +1 -1
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/controls/index.cjs +1 -1
- package/dist/components/controls/index.cjs.map +1 -1
- package/dist/components/controls/index.js +15 -14
- package/dist/components/controls/index.js.map +1 -1
- package/dist/components/dialog/index.cjs +1 -1
- package/dist/components/dialog/index.cjs.map +1 -1
- package/dist/components/dialog/index.js +56 -24
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/dropdown/index.cjs +1 -1
- package/dist/components/dropdown/index.js +101 -101
- package/dist/components/editor/index.cjs +1 -1
- package/dist/components/editor/index.js +1 -1
- package/dist/components/header/index.cjs +1 -1
- package/dist/components/header/index.js +10 -10
- package/dist/components/icon/index.cjs +1 -1
- package/dist/components/icon/index.js +1 -1
- package/dist/components/iframe/index.cjs +1 -1
- package/dist/components/iframe/index.cjs.map +1 -1
- package/dist/components/iframe/index.js +56 -58
- package/dist/components/iframe/index.js.map +1 -1
- package/dist/components/input/index.cjs +1 -1
- package/dist/components/input/index.js +2 -2
- package/dist/components/message/index.cjs +1 -1
- package/dist/components/message/index.cjs.map +1 -1
- package/dist/components/message/index.js +31 -30
- package/dist/components/message/index.js.map +1 -1
- package/dist/components/messages/index.cjs +1 -1
- package/dist/components/messages/index.cjs.map +1 -1
- package/dist/components/messages/index.js +34 -31
- package/dist/components/messages/index.js.map +1 -1
- package/dist/components/nav/index.cjs +1 -1
- package/dist/components/nav/index.js +22 -22
- package/dist/components/object/index.cjs +1 -1
- package/dist/components/object/index.js +1 -1
- package/dist/components/portal/index.cjs +1 -1
- package/dist/components/portal/index.js +17 -17
- package/dist/components/search/index.cjs +1 -1
- package/dist/components/search/index.cjs.map +1 -1
- package/dist/components/search/index.js +44 -50
- package/dist/components/search/index.js.map +1 -1
- package/dist/components/select/index.cjs +1 -1
- package/dist/components/select/index.js +2 -2
- package/dist/components/sortable/index.cjs +1 -1
- package/dist/components/sortable/index.js +1 -1
- package/dist/components/table/index.cjs +1 -1
- package/dist/components/table/index.js +1 -1
- package/dist/components/textarea/index.cjs +1 -1
- package/dist/components/textarea/index.js +1 -1
- package/dist/components/toast/index.cjs +1 -1
- package/dist/components/toast/index.js +1 -1
- package/dist/components/toasts/index.cjs +1 -1
- package/dist/components/toasts/index.js +1 -1
- package/dist/components/toggle/index.cjs +1 -1
- package/dist/components/toggle/index.js +1 -1
- package/dist/components/tooltip/index.cjs +1 -1
- package/dist/components/tooltip/index.js +6 -6
- package/dist/{icons-CH48JQqt.js → icons-BFgf_lJN.js} +13 -1
- package/dist/icons-BFgf_lJN.js.map +1 -0
- package/dist/icons-Dx0NQYLH.cjs +2 -0
- package/dist/icons-Dx0NQYLH.cjs.map +1 -0
- package/dist/{index-BrGCs_7h.js → index-BHgGZxsR.js} +2 -2
- package/dist/{index-BrGCs_7h.js.map → index-BHgGZxsR.js.map} +1 -1
- package/dist/{index-CIugi8vq.cjs → index-CEzqxRIu.cjs} +2 -2
- package/dist/{index-CIugi8vq.cjs.map → index-CEzqxRIu.cjs.map} +1 -1
- package/dist/{index-CRAuAHow.js → index-CMfR_USP.js} +2 -2
- package/dist/{index-CRAuAHow.js.map → index-CMfR_USP.js.map} +1 -1
- package/dist/{index-CSYOtiWJ.cjs → index-oL8GYbhj.cjs} +2 -2
- package/dist/{index-CSYOtiWJ.cjs.map → index-oL8GYbhj.cjs.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +20 -3
- package/dist/index.js +2 -2
- package/dist/tokens.css +7 -2
- package/dist/tokens.json +105 -33
- package/package.json +1 -1
- package/dist/icons-BROXUtPz.cjs +0 -2
- package/dist/icons-BROXUtPz.cjs.map +0 -1
- package/dist/icons-CH48JQqt.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsxs as p, Fragment as pe, jsx as
|
|
2
|
-
import { t as
|
|
3
|
-
import fe, { Children as me, isValidElement as v, useRef as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { i as
|
|
6
|
-
import { f as
|
|
7
|
-
import { List as
|
|
8
|
-
import { S as ve, s as
|
|
9
|
-
import '../../assets/index39.css';function
|
|
10
|
-
return typeof t == "string" || typeof t == "number" ? String(t) : Array.isArray(t) ? t.map(
|
|
1
|
+
import { jsxs as p, Fragment as pe, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { t as I } from "../../classix-DG18itHa.js";
|
|
3
|
+
import fe, { Children as me, isValidElement as v, useRef as L, useId as ge, useState as Q, useEffect as z } from "react";
|
|
4
|
+
import { Button as M } from "../button/index.js";
|
|
5
|
+
import { i as he } from "../../icons-BFgf_lJN.js";
|
|
6
|
+
import { f as _e, I as be } from "../../index-BHgGZxsR.js";
|
|
7
|
+
import { List as xe } from "../list/index.js";
|
|
8
|
+
import { S as ve, s as ye, r as ee } from "../../index-CMfR_USP.js";
|
|
9
|
+
import '../../assets/index39.css';function $(t) {
|
|
10
|
+
return typeof t == "string" || typeof t == "number" ? String(t) : Array.isArray(t) ? t.map($).join(" ") : v(t) ? $(t.props.children) : "";
|
|
11
11
|
}
|
|
12
12
|
function we(t) {
|
|
13
13
|
return v(t) && t.type === "option";
|
|
@@ -15,22 +15,22 @@ function we(t) {
|
|
|
15
15
|
function Se(t) {
|
|
16
16
|
return v(t) && t.type === "optgroup";
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function Ne(t) {
|
|
19
19
|
return v(t) && t.type === fe.Fragment;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function Ce(t) {
|
|
22
22
|
return v(t) && t.type === ve;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function A(t, i, r = !1) {
|
|
25
25
|
const l = [];
|
|
26
26
|
return me.forEach(t, (n) => {
|
|
27
|
-
if (
|
|
28
|
-
l.push(...
|
|
27
|
+
if (Ne(n))
|
|
28
|
+
l.push(...A(n.props.children, i, r));
|
|
29
29
|
else if (we(n)) {
|
|
30
|
-
const a =
|
|
30
|
+
const a = $(n.props.children).trim(), f = n.props.value != null ? String(n.props.value) : a;
|
|
31
31
|
l.push({
|
|
32
32
|
disabled: r || !!n.props.disabled,
|
|
33
|
-
groupLabel:
|
|
33
|
+
groupLabel: i,
|
|
34
34
|
hidden: !!n.props.hidden,
|
|
35
35
|
isPlaceholder: !!(n.props.hidden && f === ""),
|
|
36
36
|
label: n.props.children,
|
|
@@ -38,37 +38,37 @@ function M(t, o, r = !1) {
|
|
|
38
38
|
text: a,
|
|
39
39
|
value: f
|
|
40
40
|
});
|
|
41
|
-
} else Se(n) && l.push(...
|
|
41
|
+
} else Se(n) && l.push(...A(n.props.children, n.props.label, r || !!n.props.disabled));
|
|
42
42
|
}), l;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
const
|
|
46
|
-
if (!
|
|
47
|
-
const l = [.../[*?]/.test(
|
|
44
|
+
function Ee(t) {
|
|
45
|
+
const i = t.trim();
|
|
46
|
+
if (!i) return null;
|
|
47
|
+
const l = [.../[*?]/.test(i) ? i : `*${i}*`].map((n) => n === "*" ? ".*" : n === "?" ? "." : n.replace(/[|\\{}()[\]^$+.,]/g, "\\$&")).join("");
|
|
48
48
|
return new RegExp(`^${l}$`, "i");
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
const r =
|
|
50
|
+
function Ve(t, i) {
|
|
51
|
+
const r = Ee(i), l = t.filter((n) => !n.hidden && !n.isPlaceholder);
|
|
52
52
|
return r ? l.filter((n) => r.test([n.groupLabel, n.text, n.value].filter(Boolean).join(" "))) : l;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
return t.find((r) => r.value ===
|
|
54
|
+
function Ie(t, i) {
|
|
55
|
+
return t.find((r) => r.value === i) ?? t.find((r) => r.isPlaceholder) ?? t[0];
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function Le(t, i, r) {
|
|
58
58
|
var l, n;
|
|
59
|
-
return
|
|
59
|
+
return i != null ? String(i) : r != null ? String(r) : ((l = t.find((a) => a.selected)) == null ? void 0 : l.value) ?? ((n = t[0]) == null ? void 0 : n.value) ?? "";
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
if (
|
|
61
|
+
function $e(t) {
|
|
62
|
+
if (Ce(t)) {
|
|
63
63
|
const {
|
|
64
|
-
children:
|
|
64
|
+
children: i,
|
|
65
65
|
placeholder: r,
|
|
66
66
|
...l
|
|
67
67
|
} = t.props;
|
|
68
68
|
return {
|
|
69
69
|
children: /* @__PURE__ */ p(pe, { children: [
|
|
70
|
-
r && /* @__PURE__ */
|
|
71
|
-
|
|
70
|
+
r && /* @__PURE__ */ s("option", { hidden: !0, value: "", children: r }),
|
|
71
|
+
i
|
|
72
72
|
] }),
|
|
73
73
|
props: l
|
|
74
74
|
};
|
|
@@ -78,131 +78,131 @@ function Le(t) {
|
|
|
78
78
|
props: t.props
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
-
const
|
|
82
|
-
combobox:
|
|
83
|
-
"combobox-input": "_combobox-
|
|
84
|
-
dropdown:
|
|
85
|
-
empty:
|
|
86
|
-
group:
|
|
87
|
-
placeholder:
|
|
88
|
-
filter:
|
|
89
|
-
native:
|
|
90
|
-
option:
|
|
91
|
-
options:
|
|
92
|
-
panel:
|
|
93
|
-
selected:
|
|
94
|
-
text:
|
|
95
|
-
trigger:
|
|
96
|
-
minimal:
|
|
97
|
-
inline:
|
|
98
|
-
label:
|
|
99
|
-
"inline-field": "_inline-
|
|
81
|
+
const Be = "_combobox_1x1gr_3", ke = "_dropdown_1x1gr_27", De = "_empty_1x1gr_30", Pe = "_group_1x1gr_31", Re = "_placeholder_1x1gr_32", je = "_filter_1x1gr_40", Fe = "_native_1x1gr_52", We = "_option_1x1gr_62", Qe = "_options_1x1gr_84", ze = "_panel_1x1gr_108", Me = "_selected_1x1gr_132", Ae = "_text_1x1gr_136", Ge = "_trigger_1x1gr_145", Ke = "_minimal_1x1gr_164", Oe = "_inline_1x1gr_219", Te = "_label_1x1gr_251", o = {
|
|
82
|
+
combobox: Be,
|
|
83
|
+
"combobox-input": "_combobox-input_1x1gr_12",
|
|
84
|
+
dropdown: ke,
|
|
85
|
+
empty: De,
|
|
86
|
+
group: Pe,
|
|
87
|
+
placeholder: Re,
|
|
88
|
+
filter: je,
|
|
89
|
+
native: Fe,
|
|
90
|
+
option: We,
|
|
91
|
+
options: Qe,
|
|
92
|
+
panel: ze,
|
|
93
|
+
selected: Me,
|
|
94
|
+
text: Ae,
|
|
95
|
+
trigger: Ge,
|
|
96
|
+
minimal: Ke,
|
|
97
|
+
inline: Oe,
|
|
98
|
+
label: Te,
|
|
99
|
+
"inline-field": "_inline-field_1x1gr_257"
|
|
100
100
|
};
|
|
101
|
-
function te(t,
|
|
101
|
+
function te(t, i) {
|
|
102
102
|
return {
|
|
103
|
-
"--icon-svg":
|
|
103
|
+
"--icon-svg": he(t).replace("currentColor", i)
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
const tt = ({
|
|
107
107
|
children: t,
|
|
108
|
-
className:
|
|
108
|
+
className: i,
|
|
109
109
|
combobox: r = !1,
|
|
110
110
|
createOption: l,
|
|
111
111
|
emptyLabel: n = "No matches found",
|
|
112
112
|
label: a,
|
|
113
113
|
renderOption: f,
|
|
114
|
-
searchPlaceholder:
|
|
114
|
+
searchPlaceholder: B = "Filter",
|
|
115
115
|
selectedItems: ne,
|
|
116
|
-
variant:
|
|
116
|
+
variant: _ = "default",
|
|
117
117
|
...re
|
|
118
118
|
}) => {
|
|
119
|
-
const
|
|
119
|
+
const k = $e(t), {
|
|
120
120
|
defaultValue: le,
|
|
121
|
-
onChange:
|
|
122
|
-
value:
|
|
123
|
-
...
|
|
124
|
-
} =
|
|
121
|
+
onChange: D,
|
|
122
|
+
value: P,
|
|
123
|
+
...oe
|
|
124
|
+
} = k.props, y = ye(oe), G = L(null), K = L(null), w = ge(), O = L(null), m = L(null), b = A(k.children), x = P != null, R = Le(b, P, le), [j, F] = Q(() => R), [c, d] = Q(!1), [S, N] = Q(""), C = x ? String(P) : j, T = {
|
|
125
125
|
default: ee("--colors-semantic-content-secondary"),
|
|
126
126
|
white: ee("--color-white", "white")
|
|
127
|
-
},
|
|
127
|
+
}, q = _ === "minimal" ? T.white : T.default, E = Ie(b, C), ie = te("chevron", q), se = te("search", q), H = Ve(b, S), g = S.trim(), V = !!(r && l && g && l.isValid(g)), ae = a && _ === "inline" ? _e(a) : a, J = (e) => e ? (f == null ? void 0 : f({
|
|
128
128
|
groupLabel: e.groupLabel,
|
|
129
|
-
isSelected: e.value ===
|
|
129
|
+
isSelected: e.value === C,
|
|
130
130
|
label: e.label,
|
|
131
131
|
text: e.text,
|
|
132
132
|
value: e.value
|
|
133
133
|
})) ?? e.label : "Select an option";
|
|
134
|
-
|
|
135
|
-
!
|
|
136
|
-
}, [
|
|
134
|
+
z(() => {
|
|
135
|
+
!x && !b.some((e) => e.value === j) && F(R);
|
|
136
|
+
}, [R, j, x, b]), z(() => {
|
|
137
137
|
var e;
|
|
138
138
|
if (!c) {
|
|
139
|
-
|
|
139
|
+
N("");
|
|
140
140
|
return;
|
|
141
141
|
}
|
|
142
142
|
(e = m.current) == null || e.focus();
|
|
143
|
-
}, [c]),
|
|
143
|
+
}, [c]), z(() => {
|
|
144
144
|
if (!c)
|
|
145
145
|
return;
|
|
146
146
|
const e = (u) => {
|
|
147
|
-
var
|
|
148
|
-
(
|
|
147
|
+
var h;
|
|
148
|
+
(h = K.current) != null && h.contains(u.target) || d(!1);
|
|
149
149
|
};
|
|
150
150
|
return document.addEventListener("mousedown", e), () => {
|
|
151
151
|
document.removeEventListener("mousedown", e);
|
|
152
152
|
};
|
|
153
153
|
}, [c]);
|
|
154
154
|
const ce = (e) => {
|
|
155
|
-
|
|
156
|
-
},
|
|
155
|
+
x || F(e.target.value), D == null || D(e);
|
|
156
|
+
}, W = () => {
|
|
157
157
|
var e;
|
|
158
|
-
d(!1), r || (e =
|
|
158
|
+
d(!1), r || (e = G.current) == null || e.focus();
|
|
159
159
|
}, U = () => {
|
|
160
160
|
var e;
|
|
161
|
-
|
|
161
|
+
N(""), d(!0), (e = m.current) == null || e.focus();
|
|
162
162
|
}, X = () => {
|
|
163
|
-
!l || !
|
|
163
|
+
!l || !V || (l.onCreate(g), U());
|
|
164
164
|
}, ue = (e) => {
|
|
165
165
|
var Z;
|
|
166
|
-
|
|
167
|
-
const u =
|
|
166
|
+
x || F(e);
|
|
167
|
+
const u = O.current;
|
|
168
168
|
if (!u) {
|
|
169
|
-
|
|
169
|
+
W();
|
|
170
170
|
return;
|
|
171
171
|
}
|
|
172
|
-
const
|
|
173
|
-
|
|
172
|
+
const h = (Z = Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype, "value")) == null ? void 0 : Z.set;
|
|
173
|
+
h == null || h.call(u, e), u.dispatchEvent(new Event("change", {
|
|
174
174
|
bubbles: !0
|
|
175
|
-
})), r ? U() :
|
|
175
|
+
})), r ? U() : W();
|
|
176
176
|
}, de = (e) => {
|
|
177
|
-
e.key === "Escape" &&
|
|
178
|
-
}, Y = /* @__PURE__ */ p("div", { className:
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
-
r ? /* @__PURE__ */ p("div", { className:
|
|
177
|
+
e.key === "Escape" && W(), e.key === "Enter" && e.target === m.current && V && (e.preventDefault(), X());
|
|
178
|
+
}, Y = /* @__PURE__ */ p("div", { className: I(o.dropdown, _ === "inline" && o.inline, _ === "minimal" && o.minimal, i), onKeyDown: de, ref: K, ...re, children: [
|
|
179
|
+
/* @__PURE__ */ s("select", { ...y, "aria-hidden": "true", className: o.native, onChange: ce, ref: O, tabIndex: -1, value: C, children: k.children }),
|
|
180
|
+
r ? /* @__PURE__ */ p("div", { className: o.combobox, onClick: () => {
|
|
181
181
|
var e;
|
|
182
182
|
return (e = m.current) == null ? void 0 : e.focus();
|
|
183
183
|
}, children: [
|
|
184
184
|
ne,
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
|
|
187
|
-
}, onClick: () => d(!0), onFocus: () => d(!0), placeholder:
|
|
188
|
-
] }) : /* @__PURE__ */
|
|
189
|
-
c && /* @__PURE__ */ p("div", { className:
|
|
190
|
-
!r && /* @__PURE__ */
|
|
191
|
-
/* @__PURE__ */ p(
|
|
185
|
+
/* @__PURE__ */ s("input", { "aria-autocomplete": "list", "aria-expanded": c, "aria-label": y["aria-label"] ?? a ?? B, className: o["combobox-input"], disabled: y.disabled, onChange: (e) => {
|
|
186
|
+
N(e.target.value), d(!0);
|
|
187
|
+
}, onClick: () => d(!0), onFocus: () => d(!0), placeholder: B || void 0, ref: m, role: "combobox", type: "text", value: S })
|
|
188
|
+
] }) : /* @__PURE__ */ s(M, { "aria-expanded": c, "aria-haspopup": "dialog", "aria-labelledby": a ? `${w} ${w}-value` : void 0, className: I(o.trigger, (E == null ? void 0 : E.isPlaceholder) && o.placeholder), "data-open": c ? "true" : void 0, disabled: y.disabled, onClick: () => d((e) => !e), ref: G, style: ie, variant: "tertiary", children: /* @__PURE__ */ s("span", { className: o.text, id: `${w}-value`, children: J(E) }) }),
|
|
189
|
+
c && /* @__PURE__ */ p("div", { className: o.panel, children: [
|
|
190
|
+
!r && /* @__PURE__ */ s(be, { "aria-label": "Filter", className: o.filter, icon: "search", onChange: (e) => N(e.target.value), placeholder: B, ref: m, style: se, type: "search", value: S }),
|
|
191
|
+
/* @__PURE__ */ p(xe, { "aria-label": "Dropdown", className: o.options, children: [
|
|
192
192
|
H.map((e) => {
|
|
193
|
-
const u = e.value ===
|
|
194
|
-
return /* @__PURE__ */
|
|
195
|
-
/* @__PURE__ */
|
|
196
|
-
e.groupLabel && /* @__PURE__ */
|
|
193
|
+
const u = e.value === C;
|
|
194
|
+
return /* @__PURE__ */ s("li", { "data-component": "dropdown", children: /* @__PURE__ */ p(M, { "aria-label": u ? `${e.text}, selected` : e.text, className: I(o.option, u && o.selected), disabled: e.disabled, onClick: () => ue(e.value), variant: "tertiary", children: [
|
|
195
|
+
/* @__PURE__ */ s("span", { className: o.text, children: J(e) }),
|
|
196
|
+
e.groupLabel && /* @__PURE__ */ s("small", { className: o.group, children: e.groupLabel })
|
|
197
197
|
] }) }, `${e.groupLabel ?? "root"}-${e.value}`);
|
|
198
198
|
}),
|
|
199
|
-
|
|
200
|
-
H.length === 0 && !
|
|
199
|
+
V && l && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(M, { "aria-label": $(l.render(g)) || g, className: o.option, onClick: X, variant: "tertiary", children: /* @__PURE__ */ s("span", { className: o.text, children: l.render(g) }) }) }),
|
|
200
|
+
H.length === 0 && !V && /* @__PURE__ */ s("li", { className: o.empty, children: n })
|
|
201
201
|
] })
|
|
202
202
|
] })
|
|
203
203
|
] });
|
|
204
|
-
return a ? /* @__PURE__ */ p("div", { className:
|
|
205
|
-
/* @__PURE__ */
|
|
204
|
+
return a ? /* @__PURE__ */ p("div", { className: I(o.label, _ === "inline" && o["inline-field"]), "data-component": "dropdown", children: [
|
|
205
|
+
/* @__PURE__ */ s("span", { id: w, children: ae }),
|
|
206
206
|
Y
|
|
207
207
|
] }) : Y;
|
|
208
208
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";require('../../assets/index41.css');var g0=Object.defineProperty;var m0=(n,e,t)=>e in n?g0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var yn=(n,e,t)=>m0(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("react/jsx-runtime"),q=require("react"),zs=require("react-dom"),Ur=require("../../classix-5H4IWnMA.cjs"),b0=require("../file/index.cjs"),Ue=require("../button/index.cjs"),y0=require("../dropzone/index.cjs"),ze=require("../icon/index.cjs"),$s=require("../../index-
|
|
1
|
+
"use strict";require('../../assets/index41.css');var g0=Object.defineProperty;var m0=(n,e,t)=>e in n?g0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var yn=(n,e,t)=>m0(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("react/jsx-runtime"),q=require("react"),zs=require("react-dom"),Ur=require("../../classix-5H4IWnMA.cjs"),b0=require("../file/index.cjs"),Ue=require("../button/index.cjs"),y0=require("../dropzone/index.cjs"),ze=require("../icon/index.cjs"),$s=require("../../index-CEzqxRIu.cjs"),_0=require("../toolbar/index.cjs");function x0(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const qu=x0(q);function dn(n){return{}}const mu={},v0={},Oa={},It={},en={},Mn={},tn={},bu={},ui={},Rn={},Bn={},Ge={},Ki={},Ji={},w0={},Ia={},S0={},Pa={},T0={},La={},Da={},zr={},C0={},Ma={},Ra={},Ba={},E0={},k0={},N0={},Ws={},Fa={},A0={},ja={},qa={},O0={},yu={},Xi={},ii={},I0={},P0={},mr={},br={},L0={},D0={},M0={},Fe=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,R0=Fe&&"documentMode"in document?document.documentMode:null,Pe=Fe&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),_t=Fe&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),$r=!(!Fe||!("InputEvent"in window)||R0)&&"getTargetRanges"in new window.InputEvent("input"),_u=Fe&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Xn=Fe&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,B0=Fe&&/Android/.test(navigator.userAgent),Ua=Fe&&/^(?=.*Chrome).*/i.test(navigator.userAgent),F0=Fe&&B0&&Ua,Zi=Fe&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ua,Zn=1,wt=3,Lt=0,za=1,un=2,j0=0,q0=1,U0=2,Wr=4,Hr=8,Qi=128,z0=112|(3|Wr|Hr)|Qi,Yi=1,es=2,ts=3,ns=4,rs=5,us=6,xu=_u||Xn||Zi?" ":"",rt=`
|
|
2
2
|
|
|
3
3
|
`,$0=_t?" ":xu,$a="֑-߿יִ-﷽ﹰ-ﻼ",Wa="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",W0=new RegExp("^[^"+Wa+"]*["+$a+"]"),H0=new RegExp("^[^"+$a+"]*["+Wa+"]"),Dt={bold:1,code:16,highlight:Qi,italic:2,strikethrough:Wr,subscript:32,superscript:64,underline:Hr},V0={directionless:1,unmergeable:2},Hs={center:es,end:us,justify:ns,left:Yi,right:ts,start:rs},G0={[es]:"center",[us]:"end",[ns]:"justify",[Yi]:"left",[ts]:"right",[rs]:"start"},K0={normal:0,segmented:2,token:1},J0={[j0]:"normal",[U0]:"segmented",[q0]:"token"};function X0(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var R=X0(function(n){const e=new URLSearchParams;e.append("code",n);for(let t=1;t<arguments.length;t++)e.append("v",arguments[t]);throw Error(`Minified Lexical error #${n}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function Vr(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}const Z0=100;let si=!1,is=0;function Q0(n){is=n.timeStamp}function Uu(n,e,t){const r=n.nodeName==="BR",u=e.__lexicalLineBreak;return u&&(n===u||r&&n.previousSibling===u)||r&&wu(n,t)!==void 0}function Y0(n,e,t){const r=Oe(t._window);let u=null,i=null;r!==null&&r.anchorNode===n&&(u=r.anchorOffset,i=r.focusOffset);const s=n.nodeValue;s!==null&&cs(e,s,u,i,!1)}function ef(n,e,t){if(L(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return e.nodeType===wt&&t.isAttached()}function tf(n,e,t,r){for(let u=n;u&&!mf(u);u=Yn(u)){const i=wu(u,e);if(i!==void 0){const s=he(i,t);if(s)return re(s)?void 0:[u,s]}else if(u===r)return[r,Ya(t)]}}function Ha(n,e,t){si=!0;const r=performance.now()-is>Z0;try{Ce(n,()=>{const u=j()||function(c){return c.getEditorState().read(()=>{const d=j();return d!==null?d.clone():null})}(n),i=new Map,s=n.getRootElement(),o=n._editorState,a=n._blockCursorElement;let l=!1,f="";for(let c=0;c<e.length;c++){const d=e[c],p=d.type,m=d.target,g=tf(m,n,o,s);if(!g)continue;const[y,b]=g;if(p==="characterData")r&&M(b)&&ef(u,m,b)&&Y0(m,b,n);else if(p==="childList"){l=!0;const v=d.addedNodes;for(let S=0;S<v.length;S++){const I=v[S],T=Za(I),P=I.parentNode;if(P!=null&&I!==a&&T===null&&!Uu(I,P,n)){if(_t){const $=I.innerText||I.nodeValue;$&&(f+=$)}P.removeChild(I)}}const w=d.removedNodes,C=w.length;if(C>0){let S=0;for(let I=0;I<C;I++){const T=w[I];(Uu(T,m,n)||a===T)&&(m.appendChild(T),S++)}C!==S&&i.set(y,b)}}}if(i.size>0)for(const[c,d]of i)d.reconcileObservedMutation(c,n);const h=t.takeRecords();if(h.length>0){for(let c=0;c<h.length;c++){const d=h[c],p=d.addedNodes,m=d.target;for(let g=0;g<p.length;g++){const y=p[g],b=y.parentNode;b==null||y.nodeName!=="BR"||Uu(y,m,n)||b.removeChild(y)}}t.takeRecords()}u!==null&&(l&&(u.dirty=!0,Ae(u)),_t&&rl(n)&&u.insertRawText(f))})}finally{si=!1}}function Va(n){const e=n._observer;e!==null&&Ha(n,e.takeRecords(),e)}function Ga(n){(function(e){is===0&&Tu(e).addEventListener("textInput",Q0,!0)})(n),n._observer=new MutationObserver((e,t)=>{Ha(n,e,t)})}function Vs(n,e){const t=n.__mode,r=n.__format,u=n.__style,i=e.__mode,s=e.__format,o=e.__style;return!(t!==null&&t!==i||r!==null&&r!==s||u!==null&&u!==o)}function Gs(n,e){const t=n.mergeWithSibling(e),r=oe()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function Ks(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&M(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(Vs(e,r)){r=Gs(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&M(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(Vs(r,t)){r=Gs(r,t);break}break}t.remove()}}else r.remove()}function Ka(n){return Js(n.anchor),Js(n.focus),n}function Js(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,u;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),u=!0):(r=e.getChildAtIndex(t),u=!1),M(r)){n.set(r.__key,u?r.getTextContentSize():0,"text");break}if(!k(r))break;n.set(r.__key,u?r.getChildrenSize():0,"element")}}let nf=1;const rf=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function ss(n){const e=document.activeElement;if(e===null)return!1;const t=e.nodeName;return re(sn(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&vu(e)==null)}function Qn(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!ss(e)&&Ja(e)===n}catch{return!1}}function os(n){return n instanceof Au}function Ja(n){let e=n;for(;e!=null;){const t=vu(e);if(os(t))return t;e=Yn(e)}return null}function vu(n){return n?n.__lexicalEditor:null}function At(n){return n.isToken()||n.isSegmented()}function uf(n){return n.nodeType===wt}function Gr(n){let e=n;for(;e!=null;){if(uf(e))return e;e=e.firstChild}return null}function Kr(n,e,t){const r=Dt[e];if(t!==null&&(n&r)==(t&r))return n;let u=n^r;return e==="subscript"?u&=-65:e==="superscript"&&(u&=-33),u}function Xa(n){return M(n)||xt(n)||re(n)}function sf(n,e){if(e!=null)return void(n.__key=e);ve(),Sl();const t=oe(),r=ot(),u=""+nf++;r._nodeMap.set(u,n),k(n)?t._dirtyElements.set(u,!0):t._dirtyLeaves.add(u),t._cloneNotNeeded.add(u),t._dirtyType=za,n.__key=u}function Pt(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),u=n.getPreviousSibling(),i=n.getNextSibling();if(u===null)if(i!==null){const s=i.getWritable();r.__first=i.__key,s.__prev=null}else r.__first=null;else{const s=u.getWritable();if(i!==null){const o=i.getWritable();o.__prev=s.__key,s.__next=o.__key}else s.__next=null;t.__prev=null}if(i===null)if(u!==null){const s=u.getWritable();r.__last=u.__key,s.__next=null}else r.__last=null;else{const s=i.getWritable();if(u!==null){const o=u.getWritable();o.__next=s.__key,s.__prev=o.__key}else s.__prev=null;t.__next=null}r.__size--,t.__parent=null}}function Jr(n){Sl();const e=n.getLatest(),t=e.__parent,r=ot(),u=oe(),i=r._nodeMap,s=u._dirtyElements;t!==null&&function(a,l,f){let h=a;for(;h!==null;){if(f.has(h))return;const c=l.get(h);if(c===void 0)break;f.set(h,!1),h=c.__parent}}(t,i,s);const o=e.__key;u._dirtyType=za,k(n)?s.set(o,!0):u._dirtyLeaves.add(o)}function me(n){ve();const e=oe(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){const r=he(t);r!==null&&r.getWritable()}if(n!==null){const r=he(n);r!==null&&r.getWritable()}}}function gt(){return ur()?null:oe()._compositionKey}function he(n,e){const t=(e||ot())._nodeMap.get(n);return t===void 0?null:t}function Za(n,e){const t=wu(n,oe());return t!==void 0?he(t,e):null}function wu(n,e){return n[`__lexicalKey_${e._key}`]}function sn(n,e){let t=n;for(;t!=null;){const r=Za(t,e);if(r!==null)return r;t=Yn(t)}return null}function Qa(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function Xs(n){return n.read(()=>ce().getTextContent())}function ce(){return Ya(ot())}function Ya(n){return n._nodeMap.get("root")}function Ae(n){ve();const e=ot();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function Qt(n){const e=oe(),t=function(r,u){let i=r;for(;i!=null;){const s=wu(i,u);if(s!==void 0)return s;i=Yn(i)}return null}(n,e);return t===null?n===e.getRootElement()?he("root"):null:he(t)}function Zs(n,e){return e?n.getTextContentSize():0}function el(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function as(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function tl(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function nl(n){return n.nodeType===wt?n.nodeValue:null}function ls(n,e,t){const r=Oe(e._window);if(r===null)return;const u=r.anchorNode;let{anchorOffset:i,focusOffset:s}=r;if(u!==null){let o=nl(u);const a=sn(u);if(o!==null&&M(a)){if(o===xu&&t){const l=t.length;o=t,i=l,s=l}o!==null&&cs(a,o,i,s,n)}}}function cs(n,e,t,r,u){let i=n;if(i.isAttached()&&(u||!i.isDirty())){const s=i.isComposing();let o=e;(s||u)&&e[e.length-1]===xu&&(o=e.slice(0,-1));const a=i.getTextContent();if(u||o!==a){if(o===""){if(me(null),_u||Xn||Zi)i.remove();else{const m=oe();setTimeout(()=>{m.update(()=>{i.isAttached()&&i.remove()})},20)}return}const l=i.getParent(),f=rr(),h=i.getTextContentSize(),c=gt(),d=i.getKey();if(i.isToken()||c!==null&&d===c&&!s||L(f)&&(l!==null&&!l.canInsertTextBefore()&&f.anchor.offset===0||f.anchor.key===n.__key&&f.anchor.offset===0&&!i.canInsertTextBefore()&&!s||f.focus.key===n.__key&&f.focus.offset===h&&!i.canInsertTextAfter()&&!s))return void i.markDirty();const p=j();if(!L(p)||t===null||r===null)return void i.setTextContent(o);if(p.setTextNodeRange(i,t,i,r),i.isSegmented()){const m=le(i.getTextContent());i.replace(m),i=m}i.setTextContent(o)}}}function of(n,e){if(e.isSegmented())return!0;if(!n.isCollapsed())return!1;const t=n.anchor.offset,r=e.getParentOrThrow(),u=e.isToken();return t===0?!e.canInsertTextBefore()||!r.canInsertTextBefore()&&!e.isComposing()||u||function(i){const s=i.getPreviousSibling();return(M(s)||k(s)&&s.isInline())&&!s.canInsertTextAfter()}(e):t===e.getTextContentSize()&&(!e.canInsertTextAfter()||!r.canInsertTextAfter()&&!e.isComposing()||u)}function Qs(n){return n==="ArrowLeft"}function Ys(n){return n==="ArrowRight"}function En(n,e){return Pe?n:e}function eo(n){return n==="Enter"}function _n(n){return n==="Backspace"}function xn(n){return n==="Delete"}function to(n,e,t){return n.toLowerCase()==="a"&&En(e,t)}function af(){const n=ce();Ae(Ka(n.select(0,n.getChildrenSize())))}function Nn(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});const t=n.__lexicalClassNameCache,r=t[e];if(r!==void 0)return r;const u=n[e];if(typeof u=="string"){const i=Vr(u);return t[e]=i,i}return u}function fs(n,e,t,r,u){if(t.size===0)return;const i=r.__type,s=r.__key,o=e.get(i);o===void 0&&R(33,i);const a=o.klass;let l=n.get(a);l===void 0&&(l=new Map,n.set(a,l));const f=l.get(s),h=f==="destroyed"&&u==="created";(f===void 0||h)&&l.set(s,h?"updated":u)}function no(n,e,t){const r=n.getParent();let u=t,i=n;return r!==null&&(e&&t===0?(u=i.getIndexWithinParent(),i=r):e||t!==i.getChildrenSize()||(u=i.getIndexWithinParent()+1,i=r)),i.getChildAtIndex(e?u-1:u)}function Fn(n,e){const t=n.offset;if(n.type==="element")return no(n.getNode(),e,t);{const r=n.getNode();if(e&&t===0||!e&&t===r.getTextContentSize()){const u=e?r.getPreviousSibling():r.getNextSibling();return u===null?no(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):u}}return null}function rl(n){const e=Tu(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function F(n,e,t){return El(n,e,t)}function Su(n){return!ye(n)&&!n.isLastChild()&&!n.isInline()}function Xr(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&R(75,e),t}function Yn(n){const e=n.assignedSlot||n.parentElement;return e!==null&&e.nodeType===11?e.host:e}function An(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function Tu(n){const e=n._window;return e===null&&R(78),e}function lf(n){let e=n.getParentOrThrow();for(;e!==null;){if(ut(e))return e;e=e.getParentOrThrow()}return e}function ut(n){return ye(n)||k(n)&&n.isShadowRoot()}function St(n){const e=oe(),t=n.constructor.getType(),r=e._nodes.get(t);r===void 0&&R(200,n.constructor.name,t);const{replace:u,replaceWithKlass:i}=r;if(u!==null){const s=u(n),o=s.constructor;return i!==null?s instanceof i||R(201,i.name,i.getType(),o.name,o.getType(),n.constructor.name,t):s instanceof n.constructor&&o!==n.constructor||R(202,o.name,o.getType(),n.constructor.name,t),s.__key===n.__key&&R(203,n.constructor.name,t,o.name,o.getType()),s}return n}function zu(n,e){!ye(n.getParent())||k(e)||re(e)||R(99)}function $u(n){return(re(n)||k(n)&&!n.canBeEmpty())&&!n.isInline()}function ds(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function cf(n,e,t){let r=n._blockCursorElement;if(L(t)&&t.isCollapsed()&&t.anchor.type==="element"&&e.contains(document.activeElement)){const u=t.anchor,i=u.getNode(),s=u.offset;let o=!1,a=null;if(s===i.getChildrenSize())$u(i.getChildAtIndex(s-1))&&(o=!0);else{const l=i.getChildAtIndex(s);if(l!==null&&$u(l)){const f=l.getPreviousSibling();(f===null||$u(f))&&(o=!0,a=n.getElementByKey(l.__key))}}if(o){const l=n.getElementByKey(i.__key);return r===null&&(n._blockCursorElement=r=function(f){const h=f.theme,c=document.createElement("div");c.contentEditable="false",c.setAttribute("data-lexical-cursor","true");let d=h.blockCursor;if(d!==void 0){if(typeof d=="string"){const p=Vr(d);d=h.blockCursor=p}d!==void 0&&c.classList.add(...d)}return c}(n._config)),e.style.caretColor="transparent",void(a===null?l.appendChild(r):l.insertBefore(r,a))}}r!==null&&ds(r,n,e)}function Oe(n){return Fe?(n||window).getSelection():null}function ff(n){return Ut(n)&&n.tagName==="A"}function Ut(n){return n.nodeType===1}function ro(n){return n.nodeType===11}function oi(n){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return n.nodeName.match(e)!==null}function Zr(n){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return n.nodeName.match(e)!==null}function ht(n){if(re(n)&&!n.isInline())return!0;if(!k(n)||ut(n))return!1;const e=n.getFirstChild(),t=e===null||xt(e)||M(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function vn(n,e){let t=n;for(;t!==null&&t.getParent()!==null&&!e(t);)t=t.getParentOrThrow();return e(t)?t:null}function df(){return oe()}const uo=new WeakMap,hf=new Map;function pf(n){if(!n._readOnly&&n.isEmpty())return hf;n._readOnly||R(192);let e=uo.get(n);if(!e){e=new Map,uo.set(n,e);for(const[t,r]of n._nodeMap){const u=r.__type;let i=e.get(u);i||(i=new Map,e.set(u,i)),i.set(t,r)}}return e}function hs(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function gf(n,e){const t=(parseInt(n.style.paddingInlineStart,10)||0)/40;e.setIndent(t)}function mf(n){return n.__lexicalUnmanaged===!0}function ul(n,e,t,r,u,i){let s=n.getFirstChild();for(;s!==null;){const o=s.__key;s.__parent===e&&(k(s)&&ul(s,o,t,r,u,i),t.has(o)||i.delete(o),u.push(o)),s=s.getNextSibling()}}let vt,_e,jn,Cu,ai,li,Mt,Be,ci,qn,de="",be="",We=null,Le="",tt="",il=!1,Un=!1,Dr=null;function Qr(n,e){const t=Mt.get(n);if(e!==null){const r=hi(n);r.parentNode===e&&e.removeChild(r)}if(Be.has(n)||_e._keyToDOMMap.delete(n),k(t)){const r=eu(t,Mt);fi(r,0,r.length-1,null)}t!==void 0&&fs(qn,jn,Cu,t,"destroyed")}function fi(n,e,t,r){let u=e;for(;u<=t;++u){const i=n[u];i!==void 0&&Qr(i,r)}}function Nt(n,e){n.setProperty("text-align",e)}const bf="40px";function sl(n,e){const t=vt.theme.indent;if(typeof t=="string"){const u=n.classList.contains(t);e>0&&!u?n.classList.add(t):e<1&&u&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||bf;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function ol(n,e){const t=n.style;e===0?Nt(t,""):e===Yi?Nt(t,"left"):e===es?Nt(t,"center"):e===ts?Nt(t,"right"):e===ns?Nt(t,"justify"):e===rs?Nt(t,"start"):e===us&&Nt(t,"end")}function Yr(n,e){const t=Be.get(n);t===void 0&&R(60);const r=t.createDOM(vt,_e);if(function(u,i,s){const o=s._keyToDOMMap;(function(a,l,f){a[`__lexicalKey_${l._key}`]=f})(i,s,u),o.set(u,i)}(n,r,_e),M(t)?r.setAttribute("data-lexical-text","true"):re(t)&&r.setAttribute("data-lexical-decorator","true"),k(t)){const u=t.__indent,i=t.__size;if(u!==0&&sl(r,u),i!==0){const o=i-1;(function(a,l,f,h){const c=be;be="",di(a,f,0,l,f.getDOMSlot(h)),ll(f,h),be=c})(eu(t,Be),o,t,r)}const s=t.__format;s!==0&&ol(r,s),t.isInline()||al(null,t,r),Su(t)&&(de+=rt,tt+=rt)}else{const u=t.getTextContent();if(re(t)){const i=t.decorate(_e,vt);i!==null&&cl(n,i),r.contentEditable="false"}else M(t)&&(t.isDirectionless()||(be+=u));de+=u,tt+=u}return e!==null&&e.insertChild(r),fs(qn,jn,Cu,t,"created"),r}function di(n,e,t,r,u){const i=de;de="";let s=t;for(;s<=r;++s){Yr(n[s],u);const o=Be.get(n[s]);o!==null&&M(o)&&(We===null&&(We=o.getFormat()),Le===""&&(Le=o.getStyle()))}Su(e)&&(de+=rt),u.element.__lexicalTextContent=de,de=i+de}function io(n,e){if(n){const t=n.__last;if(t){const r=e.get(t);if(r)return xt(r)?"line-break":re(r)&&r.isInline()?"decorator":null}return"empty"}return null}function al(n,e,t){const r=io(n,Mt),u=io(e,Be);r!==u&&e.getDOMSlot(t).setManagedLineBreak(u)}function ll(n,e){const t=e.__lexicalDirTextContent||"",r=e.__lexicalDir||"";if(t!==be||r!==Dr){const i=be==="",s=i?Dr:(u=be,W0.test(u)?"rtl":H0.test(u)?"ltr":null);if(s!==r){const o=e.classList,a=vt.theme;let l=r!==null?a[r]:void 0,f=s!==null?a[s]:void 0;if(l!==void 0){if(typeof l=="string"){const h=Vr(l);l=a[r]=h}o.remove(...l)}if(s===null||i&&s==="ltr")e.removeAttribute("dir");else{if(f!==void 0){if(typeof f=="string"){const h=Vr(f);f=a[s]=h}f!==void 0&&o.add(...f)}e.dir=s}Un||(n.getWritable().__dir=s)}Dr=s,e.__lexicalDirTextContent=be,e.__lexicalDir=s}var u}function yf(n,e,t){const r=be;var u;be="",We=null,Le="",function(i,s,o){const a=de,l=i.__size,f=s.__size;de="";const h=o.element;if(l===1&&f===1){const c=i.__first,d=s.__first;if(c===d)kn(c,h);else{const m=hi(c),g=Yr(d,null);try{h.replaceChild(g,m)}catch(y){if(typeof y=="object"&&y!=null){const b=`${y.toString()} Parent: ${h.tagName}, new child: {tag: ${g.tagName} key: ${d}}, old child: {tag: ${m.tagName}, key: ${c}}.`;throw new Error(b)}throw y}Qr(c,null)}const p=Be.get(d);M(p)&&(We===null&&(We=p.getFormat()),Le===""&&(Le=p.getStyle()))}else{const c=eu(i,Mt),d=eu(s,Be);if(c.length!==l&&R(227),d.length!==f&&R(228),l===0)f!==0&&di(d,s,0,f-1,o);else if(f===0){if(l!==0){const p=o.after==null&&o.before==null&&o.element.__lexicalLineBreak==null;fi(c,0,l-1,p?null:h),p&&(h.textContent="")}}else(function(p,m,g,y,b,v){const w=y-1,C=b-1;let S,I,T=v.getFirstChild(),P=0,$=0;for(;P<=w&&$<=C;){const N=m[P],B=g[$];if(N===B)T=Wu(kn(B,v.element)),P++,$++;else{S===void 0&&(S=new Set(m)),I===void 0&&(I=new Set(g));const O=I.has(N),A=S.has(B);if(O)if(A){const U=Xr(_e,B);U===T?T=Wu(kn(B,v.element)):(v.withBefore(T).insertChild(U),kn(B,v.element)),P++,$++}else Yr(B,v.withBefore(T)),$++;else T=Wu(hi(N)),Qr(N,v.element),P++}const x=Be.get(B);x!==null&&M(x)&&(We===null&&(We=x.getFormat()),Le===""&&(Le=x.getStyle()))}const _=P>w,E=$>C;if(_&&!E){const N=g[C+1],B=N===void 0?null:_e.getElementByKey(N);di(g,p,$,C,v.withBefore(B))}else E&&!_&&fi(m,P,w,v.element)})(s,c,d,l,f,o)}Su(s)&&(de+=rt),h.__lexicalTextContent=de,de=a+de}(n,e,e.getDOMSlot(t)),ll(e,t),Bt(u=e)&&We!=null&&We!==u.__textFormat&&!Un&&(u.setTextFormat(We),u.setTextStyle(Le)),function(i){Bt(i)&&Le!==""&&Le!==i.__textStyle&&!Un&&i.setTextStyle(Le)}(e),be=r}function eu(n,e){const t=[];let r=n.__first;for(;r!==null;){const u=e.get(r);u===void 0&&R(101),t.push(r),r=u.__next}return t}function kn(n,e){const t=Mt.get(n);let r=Be.get(n);t!==void 0&&r!==void 0||R(61);const u=il||li.has(n)||ai.has(n),i=Xr(_e,n);if(t===r&&!u){if(k(t)){const s=i.__lexicalTextContent;s!==void 0&&(de+=s,tt+=s);const o=i.__lexicalDirTextContent;o!==void 0&&(be+=o)}else{const s=t.getTextContent();M(t)&&!t.isDirectionless()&&(be+=s),tt+=s,de+=s}return i}if(t!==r&&u&&fs(qn,jn,Cu,r,"updated"),r.updateDOM(t,i,vt)){const s=Yr(n,null);return e===null&&R(62),e.replaceChild(s,i),Qr(n,null),s}if(k(t)&&k(r)){const s=r.__indent;s!==t.__indent&&sl(i,s);const o=r.__format;o!==t.__format&&ol(i,o),u&&(yf(t,r,i),ye(r)||r.isInline()||al(t,r,i)),Su(r)&&(de+=rt,tt+=rt)}else{const s=r.getTextContent();if(re(r)){const o=r.decorate(_e,vt);o!==null&&cl(n,o)}else M(r)&&!r.isDirectionless()&&(be+=s);de+=s,tt+=s}if(!Un&&ye(r)&&r.__cachedText!==tt){const s=r.getWritable();s.__cachedText=tt,r=s}return i}function cl(n,e){let t=_e._pendingDecorators;const r=_e._decorators;if(t===null){if(r[n]===e)return;t=Qa(_e)}t[n]=e}function Wu(n){let e=n.nextSibling;return e!==null&&e===_e._blockCursorElement&&(e=e.nextSibling),e}function _f(n,e,t,r,u,i){de="",tt="",be="",il=r===un,Dr=null,_e=t,vt=t._config,jn=t._nodes,Cu=_e._listeners.mutation,ai=u,li=i,Mt=n._nodeMap,Be=e._nodeMap,Un=e._readOnly,ci=new Map(t._keyToDOMMap);const s=new Map;return qn=s,kn("root",null),_e=void 0,jn=void 0,ai=void 0,li=void 0,Mt=void 0,Be=void 0,vt=void 0,ci=void 0,qn=void 0,s}function hi(n){const e=ci.get(n);return e===void 0&&R(75,n),e}const Ze=Object.freeze({}),pi=30,gi=[["keydown",function(n,e){if(On=n.timeStamp,fl=n.key,e.isComposing())return;const{key:t,shiftKey:r,ctrlKey:u,metaKey:i,altKey:s}=n;if(!F(e,w0,n)&&t!=null){if(function(o,a,l,f){return Ys(o)&&!a&&!f&&!l}(t,u,s,i))F(e,Ia,n);else if(function(o,a,l,f,h){return Ys(o)&&!f&&!l&&(a||h)}(t,u,r,s,i))F(e,S0,n);else if(function(o,a,l,f){return Qs(o)&&!a&&!f&&!l}(t,u,s,i))F(e,Pa,n);else if(function(o,a,l,f,h){return Qs(o)&&!f&&!l&&(a||h)}(t,u,r,s,i))F(e,T0,n);else if(function(o,a,l){return function(f){return f==="ArrowUp"}(o)&&!a&&!l}(t,u,i))F(e,La,n);else if(function(o,a,l){return function(f){return f==="ArrowDown"}(o)&&!a&&!l}(t,u,i))F(e,Da,n);else if(function(o,a){return eo(o)&&a}(t,r))In=!0,F(e,zr,n);else if(function(o){return o===" "}(t))F(e,C0,n);else if(function(o,a){return Pe&&a&&o.toLowerCase()==="o"}(t,u))n.preventDefault(),In=!0,F(e,en,!0);else if(function(o,a){return eo(o)&&!a}(t,r))In=!1,F(e,zr,n);else if(function(o,a,l,f){return Pe?!a&&!l&&(_n(o)||o.toLowerCase()==="h"&&f):!(f||a||l)&&_n(o)}(t,s,i,u))_n(t)?F(e,Ma,n):(n.preventDefault(),F(e,It,!0));else if(function(o){return o==="Escape"}(t))F(e,Ra,n);else if(function(o,a,l,f,h){return Pe?!(l||f||h)&&(xn(o)||o.toLowerCase()==="d"&&a):!(a||f||h)&&xn(o)}(t,u,r,s,i))xn(t)?F(e,Ba,n):(n.preventDefault(),F(e,It,!1));else if(function(o,a,l){return _n(o)&&(Pe?a:l)}(t,s,u))n.preventDefault(),F(e,Rn,!0);else if(function(o,a,l){return xn(o)&&(Pe?a:l)}(t,s,u))n.preventDefault(),F(e,Rn,!1);else if(function(o,a){return Pe&&a&&_n(o)}(t,i))n.preventDefault(),F(e,Bn,!0);else if(function(o,a){return Pe&&a&&xn(o)}(t,i))n.preventDefault(),F(e,Bn,!1);else if(function(o,a,l,f){return o.toLowerCase()==="b"&&!a&&En(l,f)}(t,s,i,u))n.preventDefault(),F(e,Ge,"bold");else if(function(o,a,l,f){return o.toLowerCase()==="u"&&!a&&En(l,f)}(t,s,i,u))n.preventDefault(),F(e,Ge,"underline");else if(function(o,a,l,f){return o.toLowerCase()==="i"&&!a&&En(l,f)}(t,s,i,u))n.preventDefault(),F(e,Ge,"italic");else if(function(o,a,l,f){return o==="Tab"&&!a&&!l&&!f}(t,s,u,i))F(e,E0,n);else if(function(o,a,l,f){return o.toLowerCase()==="z"&&!a&&En(l,f)}(t,r,i,u))n.preventDefault(),F(e,Ki,void 0);else if(function(o,a,l,f){return Pe?o.toLowerCase()==="z"&&l&&a:o.toLowerCase()==="y"&&f||o.toLowerCase()==="z"&&f&&a}(t,r,i,u))n.preventDefault(),F(e,Ji,void 0);else{const o=e._editorState._selection;o===null||L(o)?!_t&&to(t,i,u)&&(n.preventDefault(),F(e,ii,n)):function(a,l,f,h){return!l&&a.toLowerCase()==="c"&&(Pe?f:h)}(t,r,i,u)?(n.preventDefault(),F(e,yu,n)):function(a,l,f,h){return!l&&a.toLowerCase()==="x"&&(Pe?f:h)}(t,r,i,u)?(n.preventDefault(),F(e,Xi,n)):to(t,i,u)&&(n.preventDefault(),F(e,ii,n))}(function(o,a,l,f){return o||a||l||f})(u,r,s,i)&&F(e,M0,n)}}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;t instanceof Node&&r!=="touch"&&Ce(e,()=>{re(sn(t))||(bi=!0)})}],["compositionstart",function(n,e){Ce(e,()=>{const t=j();if(L(t)&&!e.isComposing()){const r=t.anchor,u=t.anchor.getNode();me(r.key),(n.timeStamp<On+pi||r.type==="element"||!t.isCollapsed()||u.getFormat()!==t.format||M(u)&&u.getStyle()!==t.style)&&F(e,tn,$0)}})}],["compositionend",function(n,e){_t?wn=!0:Ce(e,()=>{Hu(e,n.data)})}],["input",function(n,e){n.stopPropagation(),Ce(e,()=>{const t=j(),r=n.data,u=gl(n);if(r!=null&&L(t)&&pl(t,u,r,n.timeStamp,!1)){wn&&(Hu(e,r),wn=!1);const i=t.anchor.getNode(),s=Oe(e._window);if(s===null)return;const o=t.isBackward(),a=o?t.anchor.offset:t.focus.offset,l=o?t.focus.offset:t.anchor.offset;$r&&!t.isCollapsed()&&M(i)&&s.anchorNode!==null&&i.getTextContent().slice(0,a)+r+i.getTextContent().slice(a+l)===nl(s.anchorNode)||F(e,tn,r);const f=r.length;_t&&f>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=f),_u||Xn||Zi||!e.isComposing()||(On=0,me(null))}else ls(!1,e,r!==null?r:void 0),wn&&(Hu(e,r||void 0),wn=!1);ve(),Va(oe())}),Jt=null}],["click",function(n,e){Ce(e,()=>{const t=j(),r=Oe(e._window),u=rr();if(r){if(L(t)){const i=t.anchor,s=i.getNode();i.type==="element"&&i.offset===0&&t.isCollapsed()&&!ye(s)&&ce().getChildrenSize()===1&&s.getTopLevelElementOrThrow().isEmpty()&&u!==null&&t.is(u)?(r.removeAllRanges(),t.dirty=!0):n.detail===3&&!t.isCollapsed()&&s!==t.focus.getNode()&&(k(s)?s.select(0):s.getParentOrThrow().select(0))}else if(n.pointerType==="touch"){const i=r.anchorNode;if(i!==null){const s=i.nodeType;(s===Zn||s===wt)&&Ae(gs(u,r,e,n))}}}F(e,Oa,n)})}],["cut",Ze],["copy",Ze],["dragstart",Ze],["dragover",Ze],["dragend",Ze],["paste",Ze],["focus",Ze],["blur",Ze],["drop",Ze]];$r&&gi.push(["beforeinput",(n,e)=>function(t,r){const u=t.inputType,i=gl(t);u==="deleteCompositionText"||_t&&rl(r)||u!=="insertCompositionText"&&Ce(r,()=>{const s=j();if(u==="deleteContentBackward"){if(s===null){const d=rr();if(!L(d))return;Ae(d.clone())}if(L(s)){const d=s.anchor.key===s.focus.key;if(o=t.timeStamp,fl==="MediaLast"&&o<On+pi&&r.isComposing()&&d){if(me(null),On=0,setTimeout(()=>{Ce(r,()=>{me(null)})},pi),L(s)){const p=s.anchor.getNode();p.markDirty(),s.format=p.getFormat(),M(p)||R(142),s.style=p.getStyle()}}else{me(null),t.preventDefault();const p=s.anchor.getNode(),m=p.getTextContent(),g=p.canInsertTextAfter(),y=s.anchor.offset===0&&s.focus.offset===m.length;F0&&d&&!y&&g||F(r,It,!0)}return}}var o;if(!L(s))return;const a=t.data;Jt!==null&&ls(!1,r,Jt),s.dirty&&Jt===null||!s.isCollapsed()||ye(s.anchor.getNode())||i===null||s.applyDOMRange(i),Jt=null;const l=s.anchor,f=s.focus,h=l.getNode(),c=f.getNode();if(u!=="insertText"&&u!=="insertTranspose")switch(t.preventDefault(),u){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":F(r,tn,t);break;case"insertFromComposition":me(null),F(r,tn,t);break;case"insertLineBreak":me(null),F(r,en,!1);break;case"insertParagraph":me(null),In&&!Xn?(In=!1,F(r,en,!1)):F(r,Mn,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":F(r,bu,t);break;case"deleteByComposition":(function(d,p){return d!==p||k(d)||k(p)||!d.isToken()||!p.isToken()})(h,c)&&F(r,ui,t);break;case"deleteByDrag":case"deleteByCut":F(r,ui,t);break;case"deleteContent":F(r,It,!1);break;case"deleteWordBackward":F(r,Rn,!0);break;case"deleteWordForward":F(r,Rn,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":F(r,Bn,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":F(r,Bn,!1);break;case"formatStrikeThrough":F(r,Ge,"strikethrough");break;case"formatBold":F(r,Ge,"bold");break;case"formatItalic":F(r,Ge,"italic");break;case"formatUnderline":F(r,Ge,"underline");break;case"historyUndo":F(r,Ki,void 0);break;case"historyRedo":F(r,Ji,void 0)}else{if(a===`
|
|
4
4
|
`)t.preventDefault(),F(r,en,!1);else if(a===rt)t.preventDefault(),F(r,Mn,void 0);else if(a==null&&t.dataTransfer){const d=t.dataTransfer.getData("text/plain");t.preventDefault(),s.insertRawText(d)}else a!=null&&pl(s,i,a,t.timeStamp,!0)?(t.preventDefault(),F(r,tn,a)):Jt=a;dl=t.timeStamp}})}(n,e)]);let On=0,fl=null,dl=0,Jt=null;const tu=new WeakMap;let mi=!1,bi=!1,In=!1,wn=!1,hl=[0,"",0,"root",0];function pl(n,e,t,r,u){const i=n.anchor,s=n.focus,o=i.getNode(),a=oe(),l=Oe(a._window),f=l!==null?l.anchorNode:null,h=i.key,c=a.getElementByKey(h),d=t.length;return h!==s.key||!M(o)||(!u&&(!$r||dl<r+50)||o.isDirty()&&d<2||el(t))&&i.offset!==s.offset&&!o.isComposing()||At(o)||o.isDirty()&&d>1||(u||!$r)&&c!==null&&!o.isComposing()&&f!==Gr(c)||l!==null&&e!==null&&(!e.collapsed||e.startContainer!==l.anchorNode||e.startOffset!==l.anchorOffset)||o.getFormat()!==n.format||o.getStyle()!==n.style||of(n,o)}function so(n,e){return n!==null&&n.nodeValue!==null&&n.nodeType===wt&&e!==0&&e!==n.nodeValue.length}function oo(n,e,t){const{anchorNode:r,anchorOffset:u,focusNode:i,focusOffset:s}=n;mi&&(mi=!1,so(r,u)&&so(i,s))||Ce(e,()=>{if(!t)return void Ae(null);if(!Qn(e,r,i))return;const o=j();if(L(o)){const a=o.anchor,l=a.getNode();if(o.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(o.dirty=!0);const f=Tu(e).event,h=f?f.timeStamp:performance.now(),[c,d,p,m,g]=hl,y=ce(),b=e.isComposing()===!1&&y.getTextContent()==="";if(h<g+200&&a.offset===p&&a.key===m)o.format=c,o.style=d;else if(a.type==="text")M(l)||R(141),o.format=l.getFormat(),o.style=l.getStyle();else if(a.type==="element"&&!b){const v=a.getNode();o.style="",v instanceof hn&&v.getChildrenSize()===0?(o.format=v.getTextFormat(),o.style=v.getTextStyle()):o.format=0}}else{const f=a.key,h=o.focus.key,c=o.getNodes(),d=c.length,p=o.isBackward(),m=p?s:u,g=p?u:s,y=p?h:f,b=p?f:h;let v=z0,w=!1;for(let C=0;C<d;C++){const S=c[C],I=S.getTextContentSize();if(M(S)&&I!==0&&!(C===0&&S.__key===y&&m===I||C===d-1&&S.__key===b&&g===0)&&(w=!0,v&=S.getFormat(),v===0))break}o.format=w?v:0}}F(e,mu,void 0)})}function gl(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function Hu(n,e){const t=n._compositionKey;if(me(null),t!==null&&e!=null){if(e===""){const r=he(t),u=Gr(n.getElementByKey(t));return void(u!==null&&u.nodeValue!==null&&M(r)&&cs(r,u.nodeValue,null,null,!0))}if(e[e.length-1]===`
|
|
@@ -10,7 +10,7 @@ import { File as O0 } from "../file/index.js";
|
|
|
10
10
|
import { Button as $e } from "../button/index.js";
|
|
11
11
|
import { Dropzone as I0 } from "../dropzone/index.js";
|
|
12
12
|
import { Icon as We } from "../icon/index.js";
|
|
13
|
-
import { I as Js } from "../../index-
|
|
13
|
+
import { I as Js } from "../../index-BHgGZxsR.js";
|
|
14
14
|
import { Toolbar as P0 } from "../toolbar/index.js";
|
|
15
15
|
function bn(n) {
|
|
16
16
|
return {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index20.css');const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index20.css');const s=require("react/jsx-runtime"),o=require("../../classix-5H4IWnMA.cjs"),c="_header_jyftr_1",i="_capitalize_jyftr_86",n="_jumbo_jyftr_98",e={header:c,capitalize:i,jumbo:n},u={default:e.default,jumbo:e.jumbo},d=({capitalize:t=!1,children:a,variant:r="default"})=>s.jsx("header",{className:o.t(e.header,u[r],t&&e.capitalize),"data-component":"header",children:a});exports.Header=d;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { t as
|
|
3
|
-
import '../../assets/index20.css';const
|
|
4
|
-
header:
|
|
5
|
-
capitalize:
|
|
6
|
-
jumbo:
|
|
7
|
-
},
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { t as s } from "../../classix-DG18itHa.js";
|
|
3
|
+
import '../../assets/index20.css';const c = "_header_jyftr_1", d = "_capitalize_jyftr_86", i = "_jumbo_jyftr_98", e = {
|
|
4
|
+
header: c,
|
|
5
|
+
capitalize: d,
|
|
6
|
+
jumbo: i
|
|
7
|
+
}, m = {
|
|
8
8
|
default: e.default,
|
|
9
9
|
jumbo: e.jumbo
|
|
10
|
-
},
|
|
10
|
+
}, f = ({
|
|
11
11
|
capitalize: a = !1,
|
|
12
12
|
children: t,
|
|
13
13
|
variant: o = "default"
|
|
14
|
-
}) => /* @__PURE__ */
|
|
14
|
+
}) => /* @__PURE__ */ r("header", { className: s(e.header, m[o], a && e.capitalize), "data-component": "header", children: t });
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
f as Header
|
|
17
17
|
};
|
|
18
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index46.css');const r=require("react/jsx-runtime"),l=require("../../classix-5H4IWnMA.cjs"),t=require("../../icons-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index46.css');const r=require("react/jsx-runtime"),l=require("../../classix-5H4IWnMA.cjs"),t=require("../../icons-Dx0NQYLH.cjs"),m="_icon_vhz6u_1",u="_small_vhz6u_10",_="_medium_vhz6u_15",g="_large_vhz6u_20",d="_danger_vhz6u_25",e={icon:m,small:u,medium:_,large:g,danger:d,"gap-right":"_gap-right_vhz6u_29","gap-left":"_gap-left_vhz6u_33"},h={large:e.large,medium:e.medium,small:e.small},v={danger:e.danger},z=({fill:o,gap:n="none",name:a,size:c="medium",variant:s})=>{const i={maskImage:t.iconSVG(a,o??!1)};return r.jsx("span",{"aria-hidden":"true",className:l.t(n!=="none"&&e[`gap-${n}`],h[c],e.icon,s&&v[s]),style:i,"data-component":"icon"})},p=()=>Object.keys(t.iconPaths);exports.Icon=z;exports.Icons=p;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { t as c } from "../../classix-DG18itHa.js";
|
|
3
|
-
import { i, a as l } from "../../icons-
|
|
3
|
+
import { i, a as l } from "../../icons-BFgf_lJN.js";
|
|
4
4
|
import '../../assets/index46.css';const _ = "_icon_vhz6u_1", g = "_small_vhz6u_10", u = "_medium_vhz6u_15", d = "_large_vhz6u_20", h = "_danger_vhz6u_25", n = {
|
|
5
5
|
icon: _,
|
|
6
6
|
small: g,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index19.css');const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index19.css');const o=require("react/jsx-runtime"),S=require("../../classix-5H4IWnMA.cjs"),n=require("react"),q=require("../button/index.cjs"),B=require("../dialog/index.cjs"),G="_wrapper_owo4o_1",R="_toolbar_owo4o_6",V="_iframe_owo4o_16",c={wrapper:G,toolbar:R,"fullscreen-toolbar":"_fullscreen-toolbar_owo4o_7",iframe:V,"fullscreen-dialog":"_fullscreen-dialog_owo4o_22","fullscreen-iframe":"_fullscreen-iframe_owo4o_40"},f=120,$=12e3,L=8,X=({accessibleLabel:m,autoResize:l=!1,className:H,closeFullscreenLabel:A="Close fullscreen",fullscreenLabel:C="View in fullscreen",hasFullscreenView:I=!0,loading:O="lazy",onLoad:h,referrerPolicy:x="no-referrer",sandbox:y="",srcDoc:w,style:E,...b})=>{const _=n.useRef(null),i=n.useRef(null),s=n.useRef(null),[N,M]=n.useState(f),[T,g]=n.useState(!1),p=n.useCallback(()=>{i.current!==null&&(window.cancelAnimationFrame(i.current),i.current=null),s.current!==null&&(window.clearTimeout(s.current),s.current=null)},[]),v=n.useCallback(()=>{if(!l)return;const t=_.current,e=t==null?void 0:t.contentDocument;if(!t||!e)return;const d=t.style.height;try{t.style.height=`${f}px`;const a=e.querySelector("[data-iframe-content]")??e.body,u=a.getBoundingClientRect(),{body:j,documentElement:F}=e,U=Math.min(Math.max(Math.ceil(Math.max(a.scrollHeight,a.offsetHeight,u.height,j.scrollHeight,j.offsetHeight,F.scrollHeight,F.offsetHeight)+L),f),$);M(U)}catch{}finally{t.style.height=d}},[l]),r=n.useCallback(()=>{!l||i.current!==null||(i.current=window.requestAnimationFrame(()=>{i.current=null,v(),s.current!==null&&window.clearTimeout(s.current),s.current=window.setTimeout(()=>{s.current=null,v()},250)}))},[l,v]),k=t=>{var d,a;r();const e=(d=_.current)==null?void 0:d.contentDocument;Array.from((e==null?void 0:e.images)??[]).forEach(u=>{u.complete||(u.addEventListener("load",r,{once:!0}),u.addEventListener("error",r,{once:!0}))}),(a=e==null?void 0:e.fonts)==null||a.ready.then(r).catch(()=>{}),h==null||h(t)};return n.useEffect(()=>{if(l)return p(),M(f),r(),p},[l,p,r,w]),n.useEffect(()=>{var t;if(l)return window.addEventListener("resize",r),(t=window.visualViewport)==null||t.addEventListener("resize",r),()=>{var e;window.removeEventListener("resize",r),(e=window.visualViewport)==null||e.removeEventListener("resize",r)}},[l,r]),o.jsxs("div",{className:c.wrapper,"data-component":"iframe",children:[I&&o.jsx("div",{className:c.toolbar,children:o.jsx(q.Button,{"aria-expanded":T,"aria-haspopup":"dialog",onClick:()=>g(!0),variant:"tertiary",children:C})}),o.jsx("iframe",{...b,className:S.t(c.iframe,H),loading:O,onLoad:k,ref:_,referrerPolicy:x,sandbox:y,srcDoc:w,style:l?{...E,height:N,minHeight:f}:E,title:m}),T&&o.jsxs(B.Dialog,{"aria-label":`${m} fullscreen`,className:c["fullscreen-dialog"],open:!0,setOpen:g,children:[o.jsx("div",{className:c["fullscreen-toolbar"],children:o.jsx(q.Button,{autoFocus:!0,onClick:()=>g(!1),children:A})}),o.jsx("iframe",{...b,className:S.t(c.iframe,c["fullscreen-iframe"],H),loading:"eager",referrerPolicy:x,sandbox:y,srcDoc:w,title:`${m} fullscreen`})]})]})};exports.Iframe=X;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/iframe/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { type ComponentPropsWithoutRef, useCallback, useEffect, useRef, useState } from 'react';\n\nimport { Button } from '../button';\nimport { Dialog } from '../dialog';\nimport styles from './styles.module.css';\n\nconst MIN_AUTO_HEIGHT = 120;\nconst MAX_AUTO_HEIGHT = 12000;\nconst AUTO_HEIGHT_BUFFER = 8;\n\nexport type IframeProps = Omit<ComponentPropsWithoutRef<'iframe'>, 'src' | 'srcDoc' | 'title'> & {\n accessibleLabel: string;\n autoResize?: boolean;\n closeFullscreenLabel?: string;\n fullscreenLabel?: string;\n hasFullscreenView?: boolean;\n srcDoc: string;\n};\n\nexport const Iframe = ({\n accessibleLabel,\n autoResize = false,\n className,\n closeFullscreenLabel = 'Close fullscreen',\n fullscreenLabel = 'View in fullscreen',\n hasFullscreenView = true,\n loading = 'lazy',\n onLoad,\n referrerPolicy = 'no-referrer',\n sandbox = '',\n srcDoc,\n style,\n ...props\n}: IframeProps) => {\n const iframeRef = useRef<HTMLIFrameElement>(null);\n const measurementFrameRef = useRef<number | null>(null);\n const followUpMeasurementTimeoutRef = useRef<number | null>(null);\n const [measuredHeight, setMeasuredHeight] = useState(MIN_AUTO_HEIGHT);\n const [isFullscreenOpen, setIsFullscreenOpen] = useState(false);\n\n const clearScheduledMeasurements = useCallback(() => {\n if (measurementFrameRef.current !== null) {\n window.cancelAnimationFrame(measurementFrameRef.current);\n measurementFrameRef.current = null;\n }\n\n if (followUpMeasurementTimeoutRef.current !== null) {\n window.clearTimeout(followUpMeasurementTimeoutRef.current);\n followUpMeasurementTimeoutRef.current = null;\n }\n }, []);\n\n const measureSize = useCallback(() => {\n if (!autoResize) return;\n\n const iframe = iframeRef.current;\n const iframeDocument = iframe?.contentDocument;\n if (!iframe || !iframeDocument) return;\n\n const renderedHeight = iframe.style.height;\n\n try {\n // measure from a stable viewport height so content sized with percentages or\n // viewport units cannot feed the iframe's previous height back into itself\n iframe.style.height = `${MIN_AUTO_HEIGHT}px`;\n\n const content =\n iframeDocument.querySelector<HTMLElement>('[data-iframe-content]') ?? iframeDocument.body;\n const contentRect = content.getBoundingClientRect();\n const { body, documentElement } = iframeDocument;\n const height = Math.min(\n Math.max(\n Math.ceil(\n Math.max(\n content.scrollHeight,\n content.offsetHeight,\n contentRect.height,\n body.scrollHeight,\n body.offsetHeight,\n documentElement.scrollHeight,\n documentElement.offsetHeight\n ) + AUTO_HEIGHT_BUFFER\n ),\n MIN_AUTO_HEIGHT\n ),\n MAX_AUTO_HEIGHT\n );\n\n setMeasuredHeight(height);\n } catch {\n // cross-origin iframe content cannot be measured; retain minimum height\n } finally {\n iframe.style.height = renderedHeight;\n }\n }, [autoResize]);\n\n const scheduleSizeMeasurement = useCallback(() => {\n if (!autoResize || measurementFrameRef.current !== null) return;\n\n measurementFrameRef.current = window.requestAnimationFrame(() => {\n measurementFrameRef.current = null;\n measureSize();\n\n if (followUpMeasurementTimeoutRef.current !== null) {\n window.clearTimeout(followUpMeasurementTimeoutRef.current);\n }\n\n followUpMeasurementTimeoutRef.current = window.setTimeout(() => {\n followUpMeasurementTimeoutRef.current = null;\n measureSize();\n }, 250);\n });\n }, [autoResize, measureSize]);\n\n const handleLoad: NonNullable<IframeProps['onLoad']> = (event) => {\n scheduleSizeMeasurement();\n\n const iframeDocument = iframeRef.current?.contentDocument;\n Array.from(iframeDocument?.images ?? []).forEach((image) => {\n if (image.complete) return;\n image.addEventListener('load', scheduleSizeMeasurement, { once: true });\n image.addEventListener('error', scheduleSizeMeasurement, { once: true });\n });\n iframeDocument?.fonts?.ready.then(scheduleSizeMeasurement).catch(() => undefined);\n\n onLoad?.(event);\n };\n\n useEffect(() => {\n if (!autoResize) return undefined;\n\n clearScheduledMeasurements();\n setMeasuredHeight(MIN_AUTO_HEIGHT);\n scheduleSizeMeasurement();\n\n return clearScheduledMeasurements;\n }, [autoResize, clearScheduledMeasurements, scheduleSizeMeasurement, srcDoc]);\n\n useEffect(() => {\n if (!autoResize) return undefined;\n\n window.addEventListener('resize', scheduleSizeMeasurement);\n window.visualViewport?.addEventListener('resize', scheduleSizeMeasurement);\n\n return () => {\n window.removeEventListener('resize', scheduleSizeMeasurement);\n window.visualViewport?.removeEventListener('resize', scheduleSizeMeasurement);\n };\n }, [autoResize, scheduleSizeMeasurement]);\n\n return (\n <div className={styles.wrapper}>\n {hasFullscreenView && (\n <div className={styles.toolbar}>\n <Button\n aria-expanded={isFullscreenOpen}\n aria-haspopup='dialog'\n onClick={() => setIsFullscreenOpen(true)}\n variant='tertiary'\n >\n {fullscreenLabel}\n </Button>\n </div>\n )}\n <iframe\n {...props}\n className={cx(styles.iframe, className)}\n loading={loading}\n onLoad={handleLoad}\n ref={iframeRef}\n referrerPolicy={referrerPolicy}\n sandbox={sandbox}\n srcDoc={srcDoc}\n style={\n autoResize\n ? {\n ...style,\n height: measuredHeight,\n minHeight: MIN_AUTO_HEIGHT,\n }\n : style\n }\n title={accessibleLabel}\n />\n {isFullscreenOpen && (\n <Dialog\n aria-label={`${accessibleLabel} fullscreen`}\n className={styles['fullscreen-dialog']}\n onKeyDown={(event) => {\n if (event.key === 'Escape') setIsFullscreenOpen(false);\n }}\n open\n setOpen={setIsFullscreenOpen}\n >\n <div className={styles['fullscreen-toolbar']}>\n <Button\n autoFocus\n onClick={() => setIsFullscreenOpen(false)}\n >\n {closeFullscreenLabel}\n </Button>\n </div>\n <iframe\n {...props}\n className={cx(styles.iframe, styles['fullscreen-iframe'], className)}\n loading='eager'\n referrerPolicy={referrerPolicy}\n sandbox={sandbox}\n srcDoc={srcDoc}\n title={`${accessibleLabel} fullscreen`}\n />\n </Dialog>\n )}\n </div>\n );\n};\n"],"names":["MIN_AUTO_HEIGHT","MAX_AUTO_HEIGHT","AUTO_HEIGHT_BUFFER","Iframe","accessibleLabel","autoResize","className","closeFullscreenLabel","fullscreenLabel","hasFullscreenView","loading","onLoad","referrerPolicy","sandbox","srcDoc","style","props","iframeRef","useRef","measurementFrameRef","followUpMeasurementTimeoutRef","measuredHeight","setMeasuredHeight","useState","isFullscreenOpen","setIsFullscreenOpen","clearScheduledMeasurements","useCallback","current","window","cancelAnimationFrame","clearTimeout","measureSize","iframe","iframeDocument","contentDocument","renderedHeight","height","content","querySelector","body","contentRect","getBoundingClientRect","documentElement","Math","min","max","ceil","scrollHeight","offsetHeight","scheduleSizeMeasurement","requestAnimationFrame","setTimeout","handleLoad","event","Array","from","images","forEach","image","complete","addEventListener","once","fonts","ready","then","catch","useEffect","visualViewport","removeEventListener","styles","wrapper","toolbar","jsx","Button","cx","minHeight","jsxs","Dialog","key"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/iframe/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { type ComponentPropsWithoutRef, useCallback, useEffect, useRef, useState } from 'react';\n\nimport { Button } from '../button';\nimport { Dialog } from '../dialog';\nimport styles from './styles.module.css';\n\nconst MIN_AUTO_HEIGHT = 120;\nconst MAX_AUTO_HEIGHT = 12000;\nconst AUTO_HEIGHT_BUFFER = 8;\n\nexport type IframeProps = Omit<ComponentPropsWithoutRef<'iframe'>, 'src' | 'srcDoc' | 'title'> & {\n accessibleLabel: string;\n autoResize?: boolean;\n closeFullscreenLabel?: string;\n fullscreenLabel?: string;\n hasFullscreenView?: boolean;\n srcDoc: string;\n};\n\nexport const Iframe = ({\n accessibleLabel,\n autoResize = false,\n className,\n closeFullscreenLabel = 'Close fullscreen',\n fullscreenLabel = 'View in fullscreen',\n hasFullscreenView = true,\n loading = 'lazy',\n onLoad,\n referrerPolicy = 'no-referrer',\n sandbox = '',\n srcDoc,\n style,\n ...props\n}: IframeProps) => {\n const iframeRef = useRef<HTMLIFrameElement>(null);\n const measurementFrameRef = useRef<number | null>(null);\n const followUpMeasurementTimeoutRef = useRef<number | null>(null);\n const [measuredHeight, setMeasuredHeight] = useState(MIN_AUTO_HEIGHT);\n const [isFullscreenOpen, setIsFullscreenOpen] = useState(false);\n\n const clearScheduledMeasurements = useCallback(() => {\n if (measurementFrameRef.current !== null) {\n window.cancelAnimationFrame(measurementFrameRef.current);\n measurementFrameRef.current = null;\n }\n\n if (followUpMeasurementTimeoutRef.current !== null) {\n window.clearTimeout(followUpMeasurementTimeoutRef.current);\n followUpMeasurementTimeoutRef.current = null;\n }\n }, []);\n\n const measureSize = useCallback(() => {\n if (!autoResize) return;\n\n const iframe = iframeRef.current;\n const iframeDocument = iframe?.contentDocument;\n if (!iframe || !iframeDocument) return;\n\n const renderedHeight = iframe.style.height;\n\n try {\n // measure from a stable viewport height so content sized with percentages or\n // viewport units cannot feed the iframe's previous height back into itself\n iframe.style.height = `${MIN_AUTO_HEIGHT}px`;\n\n const content =\n iframeDocument.querySelector<HTMLElement>('[data-iframe-content]') ?? iframeDocument.body;\n const contentRect = content.getBoundingClientRect();\n const { body, documentElement } = iframeDocument;\n const height = Math.min(\n Math.max(\n Math.ceil(\n Math.max(\n content.scrollHeight,\n content.offsetHeight,\n contentRect.height,\n body.scrollHeight,\n body.offsetHeight,\n documentElement.scrollHeight,\n documentElement.offsetHeight\n ) + AUTO_HEIGHT_BUFFER\n ),\n MIN_AUTO_HEIGHT\n ),\n MAX_AUTO_HEIGHT\n );\n\n setMeasuredHeight(height);\n } catch {\n // cross-origin iframe content cannot be measured; retain minimum height\n } finally {\n iframe.style.height = renderedHeight;\n }\n }, [autoResize]);\n\n const scheduleSizeMeasurement = useCallback(() => {\n if (!autoResize || measurementFrameRef.current !== null) return;\n\n measurementFrameRef.current = window.requestAnimationFrame(() => {\n measurementFrameRef.current = null;\n measureSize();\n\n if (followUpMeasurementTimeoutRef.current !== null) {\n window.clearTimeout(followUpMeasurementTimeoutRef.current);\n }\n\n followUpMeasurementTimeoutRef.current = window.setTimeout(() => {\n followUpMeasurementTimeoutRef.current = null;\n measureSize();\n }, 250);\n });\n }, [autoResize, measureSize]);\n\n const handleLoad: NonNullable<IframeProps['onLoad']> = (event) => {\n scheduleSizeMeasurement();\n\n const iframeDocument = iframeRef.current?.contentDocument;\n Array.from(iframeDocument?.images ?? []).forEach((image) => {\n if (image.complete) return;\n image.addEventListener('load', scheduleSizeMeasurement, { once: true });\n image.addEventListener('error', scheduleSizeMeasurement, { once: true });\n });\n iframeDocument?.fonts?.ready.then(scheduleSizeMeasurement).catch(() => undefined);\n\n onLoad?.(event);\n };\n\n useEffect(() => {\n if (!autoResize) return undefined;\n\n clearScheduledMeasurements();\n setMeasuredHeight(MIN_AUTO_HEIGHT);\n scheduleSizeMeasurement();\n\n return clearScheduledMeasurements;\n }, [autoResize, clearScheduledMeasurements, scheduleSizeMeasurement, srcDoc]);\n\n useEffect(() => {\n if (!autoResize) return undefined;\n\n window.addEventListener('resize', scheduleSizeMeasurement);\n window.visualViewport?.addEventListener('resize', scheduleSizeMeasurement);\n\n return () => {\n window.removeEventListener('resize', scheduleSizeMeasurement);\n window.visualViewport?.removeEventListener('resize', scheduleSizeMeasurement);\n };\n }, [autoResize, scheduleSizeMeasurement]);\n\n return (\n <div className={styles.wrapper}>\n {hasFullscreenView && (\n <div className={styles.toolbar}>\n <Button\n aria-expanded={isFullscreenOpen}\n aria-haspopup='dialog'\n onClick={() => setIsFullscreenOpen(true)}\n variant='tertiary'\n >\n {fullscreenLabel}\n </Button>\n </div>\n )}\n <iframe\n {...props}\n className={cx(styles.iframe, className)}\n loading={loading}\n onLoad={handleLoad}\n ref={iframeRef}\n referrerPolicy={referrerPolicy}\n sandbox={sandbox}\n srcDoc={srcDoc}\n style={\n autoResize\n ? {\n ...style,\n height: measuredHeight,\n minHeight: MIN_AUTO_HEIGHT,\n }\n : style\n }\n title={accessibleLabel}\n />\n {isFullscreenOpen && (\n <Dialog\n aria-label={`${accessibleLabel} fullscreen`}\n className={styles['fullscreen-dialog']}\n open\n setOpen={setIsFullscreenOpen}\n >\n <div className={styles['fullscreen-toolbar']}>\n <Button\n autoFocus\n onClick={() => setIsFullscreenOpen(false)}\n >\n {closeFullscreenLabel}\n </Button>\n </div>\n <iframe\n {...props}\n className={cx(styles.iframe, styles['fullscreen-iframe'], className)}\n loading='eager'\n referrerPolicy={referrerPolicy}\n sandbox={sandbox}\n srcDoc={srcDoc}\n title={`${accessibleLabel} fullscreen`}\n />\n </Dialog>\n )}\n </div>\n );\n};\n"],"names":["MIN_AUTO_HEIGHT","MAX_AUTO_HEIGHT","AUTO_HEIGHT_BUFFER","Iframe","accessibleLabel","autoResize","className","closeFullscreenLabel","fullscreenLabel","hasFullscreenView","loading","onLoad","referrerPolicy","sandbox","srcDoc","style","props","iframeRef","useRef","measurementFrameRef","followUpMeasurementTimeoutRef","measuredHeight","setMeasuredHeight","useState","isFullscreenOpen","setIsFullscreenOpen","clearScheduledMeasurements","useCallback","current","window","cancelAnimationFrame","clearTimeout","measureSize","iframe","iframeDocument","contentDocument","renderedHeight","height","content","querySelector","body","contentRect","getBoundingClientRect","documentElement","Math","min","max","ceil","scrollHeight","offsetHeight","scheduleSizeMeasurement","requestAnimationFrame","setTimeout","handleLoad","event","Array","from","images","forEach","image","complete","addEventListener","once","fonts","ready","then","catch","useEffect","visualViewport","removeEventListener","styles","wrapper","toolbar","jsx","Button","cx","minHeight","jsxs","Dialog"],"mappings":"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"}
|