@arkyn/components 3.0.5 → 3.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/components/richText/index.d.ts +1 -0
- package/dist/components/richText/index.d.ts.map +1 -1
- package/dist/hooks/useCopyToClipboard.d.ts +38 -0
- package/dist/hooks/useCopyToClipboard.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +188 -154
- package/dist/index.js.map +1 -1
- package/dist/modules/components/richText/index.js +73 -71
- package/dist/modules/components/richText/index.js.map +1 -1
- package/dist/modules/hooks/useCopyToClipboard.js +28 -0
- package/dist/modules/hooks/useCopyToClipboard.js.map +1 -0
- package/dist/modules/services/clearLinkMarkAtBoundary.js +12 -0
- package/dist/modules/services/clearLinkMarkAtBoundary.js.map +1 -0
- package/dist/services/clearLinkMarkAtBoundary.d.ts +4 -0
- package/dist/services/clearLinkMarkAtBoundary.d.ts.map +1 -0
- package/package.json +10 -2
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Children as e, cloneElement as t, createContext as n, forwardRef as r, useCallback as i, useContext as a, useEffect as o, useId as s, useMemo as c, useRef as l, useState as u, useSyncExternalStore as d } from "react";
|
|
2
2
|
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
3
3
|
import { AlertTriangle as h, AlignCenter as g, AlignJustify as _, AlignLeft as v, AlignRight as y, Bold as b, Check as x, CheckCircle2 as S, ChevronDown as C, ChevronLeft as w, ChevronRight as T, Code as E, Ellipsis as D, File as O, FileArchive as k, FileAudio as A, FileImage as j, Heading1 as M, Heading2 as N, Image as P, Info as F, Italic as I, Link as L, Loader2 as R, MapPinned as z, Pause as B, Play as V, Quote as H, RefreshCw as U, Search as W, Underline as G, Video as K, X as q, XCircle as ee } from "lucide-react";
|
|
4
|
-
import { findCountryMask as te, formatToCapitalizeFirstWordLetter as J, formatToCurrency as ne, formatToPhone as re, removeNonNumeric as
|
|
5
|
-
import
|
|
6
|
-
import { createRoot as
|
|
7
|
-
import { InputMask as
|
|
8
|
-
import { countries as
|
|
9
|
-
import
|
|
10
|
-
import { Editor as
|
|
4
|
+
import { findCountryMask as te, formatToCapitalizeFirstWordLetter as J, formatToCurrency as ne, formatToPhone as re, removeNonNumeric as ie } from "@arkyn/shared";
|
|
5
|
+
import ae from "mapbox-gl";
|
|
6
|
+
import { createRoot as oe } from "react-dom/client";
|
|
7
|
+
import { InputMask as Y } from "@react-input/mask";
|
|
8
|
+
import { countries as se } from "@arkyn/templates";
|
|
9
|
+
import { isHotkey as ce } from "is-hotkey";
|
|
10
|
+
import { Editor as X, Element as le, Node as ue, Range as de, Text as fe, Transforms as pe, createEditor as me } from "slate";
|
|
11
11
|
import { withHistory as he } from "slate-history";
|
|
12
12
|
import { Editable as ge, Slate as _e, useSlate as ve, withReact as ye } from "slate-react";
|
|
13
13
|
import { StandaloneSearchBox as be, useLoadScript as xe } from "@react-google-maps/api";
|
|
@@ -946,7 +946,7 @@ function ut(e) {
|
|
|
946
946
|
function re(e) {
|
|
947
947
|
q(e) ? (G(""), x && x("")) : (G(e), x && x(e)), a && J();
|
|
948
948
|
}
|
|
949
|
-
let
|
|
949
|
+
let ie = n.filter((t) => !!(e.onSearch || !e.isSearchable || t.label.toLowerCase().includes(B.toLowerCase())));
|
|
950
950
|
return /* @__PURE__ */ p($e, {
|
|
951
951
|
name: t,
|
|
952
952
|
label: _,
|
|
@@ -994,13 +994,13 @@ function ut(e) {
|
|
|
994
994
|
isSearchable: h,
|
|
995
995
|
search: B,
|
|
996
996
|
onSearch: ne,
|
|
997
|
-
children: [
|
|
997
|
+
children: [ie.map(({ label: e, value: t }) => /* @__PURE__ */ p(rt, {
|
|
998
998
|
label: e,
|
|
999
999
|
value: t,
|
|
1000
1000
|
size: D,
|
|
1001
1001
|
handleChangeValue: re,
|
|
1002
1002
|
optionHasSelected: q
|
|
1003
|
-
}, t)),
|
|
1003
|
+
}, t)), ie.length <= 0 && /* @__PURE__ */ p("p", { children: C })]
|
|
1004
1004
|
}),
|
|
1005
1005
|
/* @__PURE__ */ p(et, {
|
|
1006
1006
|
disabled: R,
|
|
@@ -1241,7 +1241,7 @@ function Tt(e) {
|
|
|
1241
1241
|
//#region src/services/maskCurrencyValues.ts
|
|
1242
1242
|
function Et(e) {
|
|
1243
1243
|
let t = e;
|
|
1244
|
-
return typeof e == "string" ? (t = +
|
|
1244
|
+
return typeof e == "string" ? (t = +ie(e), t % 1 != 0 && (t = t.toFixed(2))) : t = Number.isInteger(e) ? Number(e) * 10 ** 2 : e.toFixed(2), ie(String(t)) / 10 ** 2;
|
|
1245
1245
|
}
|
|
1246
1246
|
function Dt(e, t) {
|
|
1247
1247
|
if (!e) return [0, ne(0, t)];
|
|
@@ -1264,7 +1264,7 @@ function Ot(e) {
|
|
|
1264
1264
|
function re(e) {
|
|
1265
1265
|
I(!1), T && T(e);
|
|
1266
1266
|
}
|
|
1267
|
-
let
|
|
1267
|
+
let ie = (e) => {
|
|
1268
1268
|
let [t, n] = Dt(e, _);
|
|
1269
1269
|
return !g || t <= g ? (z(n), [t, n]) : Dt(e, _);
|
|
1270
1270
|
};
|
|
@@ -1317,7 +1317,7 @@ function Ot(e) {
|
|
|
1317
1317
|
onBlur: re,
|
|
1318
1318
|
onChange: (e) => {
|
|
1319
1319
|
e.preventDefault();
|
|
1320
|
-
let [t, n] =
|
|
1320
|
+
let [t, n] = ie(e.target.value);
|
|
1321
1321
|
v?.(e, String(t), String(n));
|
|
1322
1322
|
},
|
|
1323
1323
|
id: H,
|
|
@@ -2668,7 +2668,7 @@ function Pn(e) {
|
|
|
2668
2668
|
//#region src/components/mapView/mapView.client.tsx
|
|
2669
2669
|
function Fn({ center: e, coordinates: t, onMarkerClick: n, accessToken: r, ...i }) {
|
|
2670
2670
|
let a = l(null), s = l(null), c = e || t[0];
|
|
2671
|
-
return o(() => (
|
|
2671
|
+
return o(() => (ae.accessToken = r, a.current = new ae.Map({
|
|
2672
2672
|
container: s.current,
|
|
2673
2673
|
style: "mapbox://styles/mapbox/light-v11",
|
|
2674
2674
|
center: [c.lng, c.lat],
|
|
@@ -2677,11 +2677,11 @@ function Fn({ center: e, coordinates: t, onMarkerClick: n, accessToken: r, ...i
|
|
|
2677
2677
|
}), t.forEach((e) => {
|
|
2678
2678
|
let { lat: t, lng: r, popUp: i } = e, o = document.createElement("img");
|
|
2679
2679
|
o.className = "arkynMarker", o.src = "https://i.postimg.cc/mgKggjk7/Pin.png";
|
|
2680
|
-
let s = new
|
|
2680
|
+
let s = new ae.Marker(o).setLngLat([r, t]).addTo(a.current);
|
|
2681
2681
|
if (i) {
|
|
2682
2682
|
let e = document.createElement("div");
|
|
2683
|
-
|
|
2684
|
-
let t = new
|
|
2683
|
+
oe(e).render(i);
|
|
2684
|
+
let t = new ae.Popup({
|
|
2685
2685
|
offset: 25,
|
|
2686
2686
|
closeButton: !1,
|
|
2687
2687
|
className: "arkynMapViewPopup"
|
|
@@ -2788,7 +2788,7 @@ function zn(e) {
|
|
|
2788
2788
|
icon: b,
|
|
2789
2789
|
iconSize: U
|
|
2790
2790
|
}),
|
|
2791
|
-
/* @__PURE__ */ p(
|
|
2791
|
+
/* @__PURE__ */ p(Y, {
|
|
2792
2792
|
component: Rn,
|
|
2793
2793
|
mask: c,
|
|
2794
2794
|
replacement: f,
|
|
@@ -3034,7 +3034,7 @@ function er(e) {
|
|
|
3034
3034
|
function re(e) {
|
|
3035
3035
|
q(e) ? (G(W.filter((t) => t !== e)), x && x(W.filter((t) => t !== e))) : (G([...W, e]), x && x([...W, e])), a && J();
|
|
3036
3036
|
}
|
|
3037
|
-
let
|
|
3037
|
+
let ie = n.filter((t) => !!(e.onSearch || !e.isSearchable || t.label.toLowerCase().includes(B.toLowerCase())));
|
|
3038
3038
|
return /* @__PURE__ */ p($e, {
|
|
3039
3039
|
name: t,
|
|
3040
3040
|
label: _,
|
|
@@ -3084,13 +3084,13 @@ function er(e) {
|
|
|
3084
3084
|
isSearchable: h,
|
|
3085
3085
|
search: B,
|
|
3086
3086
|
onSearch: ne,
|
|
3087
|
-
children: [
|
|
3087
|
+
children: [ie.map(({ label: e, value: t }) => /* @__PURE__ */ p(Xn, {
|
|
3088
3088
|
label: e,
|
|
3089
3089
|
value: t,
|
|
3090
3090
|
size: D,
|
|
3091
3091
|
handleChangeValue: re,
|
|
3092
3092
|
optionHasSelected: q
|
|
3093
|
-
}, t)),
|
|
3093
|
+
}, t)), ie.length <= 0 && /* @__PURE__ */ p("p", { children: C })]
|
|
3094
3094
|
}),
|
|
3095
3095
|
/* @__PURE__ */ p(Kn, {
|
|
3096
3096
|
disabled: R,
|
|
@@ -3373,7 +3373,7 @@ var _r = r((e, t) => /* @__PURE__ */ p("input", {
|
|
|
3373
3373
|
disabled: d,
|
|
3374
3374
|
readOnly: r,
|
|
3375
3375
|
ref: t
|
|
3376
|
-
}) : /* @__PURE__ */ p(
|
|
3376
|
+
}) : /* @__PURE__ */ p(Y, {
|
|
3377
3377
|
id: f,
|
|
3378
3378
|
value: c,
|
|
3379
3379
|
readOnly: r,
|
|
@@ -3392,11 +3392,11 @@ var _r = r((e, t) => /* @__PURE__ */ p("input", {
|
|
|
3392
3392
|
//#endregion
|
|
3393
3393
|
//#region src/components/phoneInput/index.tsx
|
|
3394
3394
|
function yr(e, t) {
|
|
3395
|
-
let n =
|
|
3395
|
+
let n = ie(e), r = ie(t.code), i = e.trim().startsWith("+") && n.startsWith(r) ? n.slice(r.length) : n;
|
|
3396
3396
|
return t.code === "+55" ? lr(i, cr[ur(i)]) : lr(i, typeof t.mask == "string" ? t.mask : t.mask[0], "_");
|
|
3397
3397
|
}
|
|
3398
3398
|
function br(e) {
|
|
3399
|
-
let { value: t, label: n, className: r = "", disabled: i = !1, errorMessage: a, isLoading: o = !1, readOnly: c = !1, size: d = "md", defaultValue: f = "", variant: h = "solid", showAsterisk: g, name: _, onChange: v, searchCountryPlaceholder: y = "Pesquisar país", notFoundCountryText: b = "Nenhum país encontrado", id: x, unShowFieldTemplate: S = !1, orientation: C = "vertical" } = e, w =
|
|
3399
|
+
let { value: t, label: n, className: r = "", disabled: i = !1, errorMessage: a, isLoading: o = !1, readOnly: c = !1, size: d = "md", defaultValue: f = "", variant: h = "solid", showAsterisk: g, name: _, onChange: v, searchCountryPlaceholder: y = "Pesquisar país", notFoundCountryText: b = "Nenhum país encontrado", id: x, unShowFieldTemplate: S = !1, orientation: C = "vertical" } = e, w = se.find((e) => e.iso === "BR"), T = f ? re(f) : "", E = f ? te(f)[1] : w, [D, O] = u(!1), [k, A] = u(""), [j, M] = u(!1), [N, P] = u(T), [F, I] = u(E), L = t === void 0 ? N : yr(t, F), { fieldErrors: R } = Z(), z = l(null), B = s(), V = x || B, H = a || R?.[_], U = !!H, W = i || o, G = l(null);
|
|
3400
3400
|
function K() {
|
|
3401
3401
|
W || D || j || (O(!0), G.current && G.current.focus());
|
|
3402
3402
|
}
|
|
@@ -3412,12 +3412,12 @@ function br(e) {
|
|
|
3412
3412
|
function ne() {
|
|
3413
3413
|
O(!1);
|
|
3414
3414
|
}
|
|
3415
|
-
function
|
|
3415
|
+
function ae(e) {
|
|
3416
3416
|
return e.name.toLowerCase().includes(k.toLowerCase());
|
|
3417
3417
|
}
|
|
3418
|
-
function
|
|
3418
|
+
function oe(e) {
|
|
3419
3419
|
let t = F.code;
|
|
3420
|
-
return t +=
|
|
3420
|
+
return t += ie(e || L), t;
|
|
3421
3421
|
}
|
|
3422
3422
|
return /* @__PURE__ */ p($e, {
|
|
3423
3423
|
name: _,
|
|
@@ -3447,14 +3447,14 @@ function br(e) {
|
|
|
3447
3447
|
search: k,
|
|
3448
3448
|
placeholder: y,
|
|
3449
3449
|
onSearch: A,
|
|
3450
|
-
children: [
|
|
3450
|
+
children: [se.filter((e) => ae(e)).map((e) => /* @__PURE__ */ p(mr, {
|
|
3451
3451
|
country: e,
|
|
3452
3452
|
handleChangeValue: () => {
|
|
3453
3453
|
I(e), M(!1), P("");
|
|
3454
3454
|
},
|
|
3455
3455
|
isActive: e.iso === F.iso,
|
|
3456
3456
|
size: d
|
|
3457
|
-
}, e.iso)),
|
|
3457
|
+
}, e.iso)), se.filter((e) => ae(e)).length === 0 && /* @__PURE__ */ p("p", { children: b })]
|
|
3458
3458
|
}),
|
|
3459
3459
|
/* @__PURE__ */ p(pr, {
|
|
3460
3460
|
isOpen: W || c ? !1 : j,
|
|
@@ -3471,14 +3471,14 @@ function br(e) {
|
|
|
3471
3471
|
onFocus: J,
|
|
3472
3472
|
size: d,
|
|
3473
3473
|
onChange: (e) => {
|
|
3474
|
-
P(e), v?.(
|
|
3474
|
+
P(e), v?.(oe(e));
|
|
3475
3475
|
}
|
|
3476
3476
|
}),
|
|
3477
3477
|
/* @__PURE__ */ p("input", {
|
|
3478
3478
|
ref: z,
|
|
3479
3479
|
type: "hidden",
|
|
3480
3480
|
name: _,
|
|
3481
|
-
value:
|
|
3481
|
+
value: oe()
|
|
3482
3482
|
})
|
|
3483
3483
|
]
|
|
3484
3484
|
})
|
|
@@ -3585,32 +3585,40 @@ function Er(e) {
|
|
|
3585
3585
|
});
|
|
3586
3586
|
}
|
|
3587
3587
|
//#endregion
|
|
3588
|
-
//#region src/services/
|
|
3588
|
+
//#region src/services/clearLinkMarkAtBoundary.ts
|
|
3589
3589
|
function Dr(e) {
|
|
3590
|
+
let { selection: t } = e;
|
|
3591
|
+
if (!t || !de.isCollapsed(t)) return;
|
|
3592
|
+
let [n, r] = X.leaf(e, t.anchor);
|
|
3593
|
+
n.link && X.isEnd(e, t.anchor, r) && (X.removeMark(e, "link"), X.removeMark(e, "href"));
|
|
3594
|
+
}
|
|
3595
|
+
//#endregion
|
|
3596
|
+
//#region src/services/extractTextFromNode.ts
|
|
3597
|
+
function Or(e) {
|
|
3590
3598
|
return e.map((e) => ue.string(e)).join("");
|
|
3591
3599
|
}
|
|
3592
3600
|
//#endregion
|
|
3593
3601
|
//#region src/services/isMarkActive.ts
|
|
3594
|
-
function
|
|
3595
|
-
let n =
|
|
3602
|
+
function kr(e, t) {
|
|
3603
|
+
let n = X.marks(e);
|
|
3596
3604
|
return n ? n[t] === !0 : !1;
|
|
3597
3605
|
}
|
|
3598
3606
|
//#endregion
|
|
3599
3607
|
//#region src/services/toggleMark.ts
|
|
3600
|
-
function
|
|
3601
|
-
|
|
3608
|
+
function Ar(e, t) {
|
|
3609
|
+
kr(e, t) ? X.removeMark(e, t) : X.addMark(e, t, !0);
|
|
3602
3610
|
}
|
|
3603
3611
|
//#endregion
|
|
3604
3612
|
//#region src/templates/richTextTemplates.ts
|
|
3605
|
-
var
|
|
3613
|
+
var jr = {
|
|
3606
3614
|
"mod+b": "bold",
|
|
3607
3615
|
"mod+i": "italic",
|
|
3608
3616
|
"mod+u": "underline",
|
|
3609
3617
|
"mod+`": "code"
|
|
3610
|
-
},
|
|
3618
|
+
}, Mr = [{
|
|
3611
3619
|
type: "paragraph",
|
|
3612
3620
|
children: [{ text: "" }]
|
|
3613
|
-
}],
|
|
3621
|
+
}], Nr = ["listItem", "numberedList"], Pr = [
|
|
3614
3622
|
"left",
|
|
3615
3623
|
"center",
|
|
3616
3624
|
"right",
|
|
@@ -3618,25 +3626,25 @@ var Ar = {
|
|
|
3618
3626
|
];
|
|
3619
3627
|
//#endregion
|
|
3620
3628
|
//#region src/services/isBlockActive.ts
|
|
3621
|
-
function
|
|
3629
|
+
function Fr(e, t, n = "type") {
|
|
3622
3630
|
let { selection: r } = e;
|
|
3623
3631
|
if (!r) return !1;
|
|
3624
|
-
let [i] = Array.from(
|
|
3625
|
-
at:
|
|
3626
|
-
match: (e) => !
|
|
3632
|
+
let [i] = Array.from(X.nodes(e, {
|
|
3633
|
+
at: X.unhangRange(e, r),
|
|
3634
|
+
match: (e) => !X.isEditor(e) && le.isElement(e) && e[n] === t
|
|
3627
3635
|
}));
|
|
3628
3636
|
return !!i;
|
|
3629
3637
|
}
|
|
3630
3638
|
//#endregion
|
|
3631
3639
|
//#region src/services/toggleBlock.ts
|
|
3632
|
-
function
|
|
3633
|
-
let n =
|
|
3640
|
+
function Ir(e, t) {
|
|
3641
|
+
let n = Fr(e, t, Pr.includes(t) ? "align" : "type"), r = Nr.includes(t);
|
|
3634
3642
|
pe.unwrapNodes(e, {
|
|
3635
|
-
match: (e) => !
|
|
3643
|
+
match: (e) => !X.isEditor(e) && le.isElement(e) && Nr.includes(e.type) && !Pr.includes(t),
|
|
3636
3644
|
split: !0
|
|
3637
3645
|
});
|
|
3638
3646
|
let i;
|
|
3639
|
-
if (i =
|
|
3647
|
+
if (i = Pr.includes(t) ? { align: n ? void 0 : t } : { type: n ? "paragraph" : r ? "listItem" : t }, pe.setNodes(e, i), !n && r) {
|
|
3640
3648
|
let n = {
|
|
3641
3649
|
type: t,
|
|
3642
3650
|
children: []
|
|
@@ -3646,10 +3654,10 @@ function Fr(e, t) {
|
|
|
3646
3654
|
}
|
|
3647
3655
|
//#endregion
|
|
3648
3656
|
//#region src/components/richText/blockButton/index.tsx
|
|
3649
|
-
function
|
|
3650
|
-
let n = ve(), r =
|
|
3657
|
+
function Lr({ format: e, icon: t }) {
|
|
3658
|
+
let n = ve(), r = Fr(n, e, Pr.includes(e) ? "align" : "type") ? "activeTrue" : "activeFalse";
|
|
3651
3659
|
function i(t) {
|
|
3652
|
-
t.preventDefault(),
|
|
3660
|
+
t.preventDefault(), Ir(n, e);
|
|
3653
3661
|
}
|
|
3654
3662
|
return /* @__PURE__ */ p("button", {
|
|
3655
3663
|
type: "button",
|
|
@@ -3660,7 +3668,7 @@ function Ir({ format: e, icon: t }) {
|
|
|
3660
3668
|
}
|
|
3661
3669
|
//#endregion
|
|
3662
3670
|
//#region src/components/richText/element/index.tsx
|
|
3663
|
-
function
|
|
3671
|
+
function Rr({ attributes: e, children: t, element: n }) {
|
|
3664
3672
|
let r = { textAlign: n.align };
|
|
3665
3673
|
switch (n.type) {
|
|
3666
3674
|
case "blockQuote": return /* @__PURE__ */ p("blockquote", {
|
|
@@ -3730,11 +3738,11 @@ function Lr({ attributes: e, children: t, element: n }) {
|
|
|
3730
3738
|
}
|
|
3731
3739
|
//#endregion
|
|
3732
3740
|
//#region src/components/tab/tabContext.tsx
|
|
3733
|
-
var
|
|
3734
|
-
function
|
|
3735
|
-
return a(
|
|
3741
|
+
var zr = n({});
|
|
3742
|
+
function Br() {
|
|
3743
|
+
return a(zr);
|
|
3736
3744
|
}
|
|
3737
|
-
function
|
|
3745
|
+
function Vr(e) {
|
|
3738
3746
|
let { disabled: t, currentTab: n, changeCurrentTab: r } = e, i = c(() => ({
|
|
3739
3747
|
disabled: t,
|
|
3740
3748
|
currentTab: n,
|
|
@@ -3744,15 +3752,15 @@ function Br(e) {
|
|
|
3744
3752
|
n,
|
|
3745
3753
|
r
|
|
3746
3754
|
]);
|
|
3747
|
-
return /* @__PURE__ */ p(
|
|
3755
|
+
return /* @__PURE__ */ p(zr.Provider, {
|
|
3748
3756
|
value: i,
|
|
3749
3757
|
children: e.children
|
|
3750
3758
|
});
|
|
3751
3759
|
}
|
|
3752
3760
|
//#endregion
|
|
3753
3761
|
//#region src/components/tab/tabButton/index.tsx
|
|
3754
|
-
function
|
|
3755
|
-
let { children: t, disabled: n = !1, className: r = "", onClick: i, value: a, ...o } = e, { disabled: s, currentTab: c, changeCurrentTab: l } =
|
|
3762
|
+
function Hr(e) {
|
|
3763
|
+
let { children: t, disabled: n = !1, className: r = "", onClick: i, value: a, ...o } = e, { disabled: s, currentTab: c, changeCurrentTab: l } = Br(), u = s || n, d = `arkynTabButton ${u ? "isDisabled" : ""} ${c === a && a ? "isActive" : ""} ${r}`;
|
|
3756
3764
|
function f(e) {
|
|
3757
3765
|
l(a), i?.(e);
|
|
3758
3766
|
}
|
|
@@ -3767,12 +3775,12 @@ function Vr(e) {
|
|
|
3767
3775
|
}
|
|
3768
3776
|
//#endregion
|
|
3769
3777
|
//#region src/components/tab/tabContainer/index.tsx
|
|
3770
|
-
function
|
|
3778
|
+
function Ur(e) {
|
|
3771
3779
|
let { children: t, onChange: n, defaultValue: r, disabled: i = !1, className: a, ...o } = e, [s, c] = u(r || ""), l = `arkynTabContainer ${a || ""}`;
|
|
3772
3780
|
function d(e) {
|
|
3773
3781
|
c(e), n && n(e);
|
|
3774
3782
|
}
|
|
3775
|
-
return /* @__PURE__ */ p(
|
|
3783
|
+
return /* @__PURE__ */ p(Vr, {
|
|
3776
3784
|
disabled: i,
|
|
3777
3785
|
currentTab: s,
|
|
3778
3786
|
changeCurrentTab: d,
|
|
@@ -3785,7 +3793,7 @@ function Hr(e) {
|
|
|
3785
3793
|
}
|
|
3786
3794
|
//#endregion
|
|
3787
3795
|
//#region src/components/richText/insertImage/index.tsx
|
|
3788
|
-
function
|
|
3796
|
+
function Wr(e) {
|
|
3789
3797
|
let { action: t, tabLabels: n = ["Adicionar URL", "Upload de arquivo"], modalCancelButton: r = "Cancelar", modalConfirmButton: i = "Confirmar", modalInputImageLabel: a = "Imagem:", modalInputUrlLabel: o = "URL da imagem:", modalTitle: s = "Inserir imagem" } = e, c = ve(), [l, d] = u(!1), [h, g] = u(""), [_, v] = u("url");
|
|
3790
3798
|
function y(e) {
|
|
3791
3799
|
e.preventDefault(), !(!h || h === "") && (c.insertNodes([
|
|
@@ -3817,13 +3825,13 @@ function Ur(e) {
|
|
|
3817
3825
|
/* @__PURE__ */ m("div", {
|
|
3818
3826
|
className: "arkynRichTextInsertImageModalContent",
|
|
3819
3827
|
children: [
|
|
3820
|
-
/* @__PURE__ */ m(
|
|
3828
|
+
/* @__PURE__ */ m(Ur, {
|
|
3821
3829
|
defaultValue: _,
|
|
3822
3830
|
onChange: v,
|
|
3823
|
-
children: [/* @__PURE__ */ p(
|
|
3831
|
+
children: [/* @__PURE__ */ p(Hr, {
|
|
3824
3832
|
value: "url",
|
|
3825
3833
|
children: n[0]
|
|
3826
|
-
}), /* @__PURE__ */ p(
|
|
3834
|
+
}), /* @__PURE__ */ p(Hr, {
|
|
3827
3835
|
value: "file",
|
|
3828
3836
|
children: n[1]
|
|
3829
3837
|
})]
|
|
@@ -3866,7 +3874,7 @@ function Ur(e) {
|
|
|
3866
3874
|
}
|
|
3867
3875
|
//#endregion
|
|
3868
3876
|
//#region src/services/isValidHttpsUrl.ts
|
|
3869
|
-
function
|
|
3877
|
+
function Gr(e) {
|
|
3870
3878
|
try {
|
|
3871
3879
|
return new URL(e).protocol === "https:";
|
|
3872
3880
|
} catch {
|
|
@@ -3875,8 +3883,8 @@ function Wr(e) {
|
|
|
3875
3883
|
}
|
|
3876
3884
|
//#endregion
|
|
3877
3885
|
//#region src/components/richText/insertLink/index.tsx
|
|
3878
|
-
function
|
|
3879
|
-
let { modalCancelButton: t = "Cancelar", modalConfirmButton: n = "Confirmar", modalInputUrlLabel: r = "URL do link:", modalTitle: i = "Inserir link", invalidUrlMessage: a = "URL inválida" } = e, s = ve(), [c, l] = u(!1), [d, h] = u(""), [g, _] = u(s.selection), v =
|
|
3886
|
+
function Kr(e) {
|
|
3887
|
+
let { modalCancelButton: t = "Cancelar", modalConfirmButton: n = "Confirmar", modalInputUrlLabel: r = "URL do link:", modalTitle: i = "Inserir link", invalidUrlMessage: a = "URL inválida" } = e, s = ve(), [c, l] = u(!1), [d, h] = u(""), [g, _] = u(s.selection), v = Gr(d), y = d && !v ? a : "";
|
|
3880
3888
|
function b(e) {
|
|
3881
3889
|
e.preventDefault(), _(s.selection), l(!0);
|
|
3882
3890
|
}
|
|
@@ -3885,7 +3893,7 @@ function Gr(e) {
|
|
|
3885
3893
|
text: d,
|
|
3886
3894
|
link: !0,
|
|
3887
3895
|
href: d
|
|
3888
|
-
}) : (
|
|
3896
|
+
}) : (X.addMark(s, "link", !0), X.addMark(s, "href", d)), l(!1));
|
|
3889
3897
|
}
|
|
3890
3898
|
return o(() => {
|
|
3891
3899
|
c || (h(""), _(null));
|
|
@@ -3928,7 +3936,7 @@ function Gr(e) {
|
|
|
3928
3936
|
}
|
|
3929
3937
|
//#endregion
|
|
3930
3938
|
//#region src/components/richText/insertVideo/index.tsx
|
|
3931
|
-
function
|
|
3939
|
+
function qr(e) {
|
|
3932
3940
|
let { modalCancelButton: t = "Cancelar", modalConfirmButton: n = "Confirmar", modalInputUrlLabel: r = "URL do vídeo:", modalTitle: i = "Inserir vídeo", invalidUrlMessage: a = "URL inválida" } = e, s = ve(), [c, l] = u(!1), [d, h] = u(""), [g, _] = u(""), [v, y] = u("");
|
|
3933
3941
|
function b(e) {
|
|
3934
3942
|
if (e.preventDefault(), !d || d === "") return;
|
|
@@ -3951,7 +3959,7 @@ function Kr(e) {
|
|
|
3951
3959
|
}
|
|
3952
3960
|
return o(() => {
|
|
3953
3961
|
if (!g || g === "") return;
|
|
3954
|
-
if (h(""), y(""), !
|
|
3962
|
+
if (h(""), y(""), !Gr(g)) {
|
|
3955
3963
|
y(a);
|
|
3956
3964
|
return;
|
|
3957
3965
|
}
|
|
@@ -4006,7 +4014,7 @@ function Kr(e) {
|
|
|
4006
4014
|
}
|
|
4007
4015
|
//#endregion
|
|
4008
4016
|
//#region src/components/richText/leaf/index.tsx
|
|
4009
|
-
function
|
|
4017
|
+
function Jr({ attributes: e, children: t, leaf: n }) {
|
|
4010
4018
|
return n.bold && (t = /* @__PURE__ */ p("strong", { children: t })), n.code && (t = /* @__PURE__ */ p("code", { children: t })), n.italic && (t = /* @__PURE__ */ p("em", { children: t })), n.underline && (t = /* @__PURE__ */ p("u", { children: t })), n.link && (t = /* @__PURE__ */ p("a", {
|
|
4011
4019
|
className: "arkynLeafLink",
|
|
4012
4020
|
href: n.href,
|
|
@@ -4018,10 +4026,10 @@ function qr({ attributes: e, children: t, leaf: n }) {
|
|
|
4018
4026
|
}
|
|
4019
4027
|
//#endregion
|
|
4020
4028
|
//#region src/components/richText/markButton/index.tsx
|
|
4021
|
-
function
|
|
4022
|
-
let n = ve(), r =
|
|
4029
|
+
function Yr({ format: e, icon: t }) {
|
|
4030
|
+
let n = ve(), r = kr(n, e) ? "activeTrue" : "activeFalse";
|
|
4023
4031
|
function i(t) {
|
|
4024
|
-
t.preventDefault(),
|
|
4032
|
+
t.preventDefault(), Ar(n, e);
|
|
4025
4033
|
}
|
|
4026
4034
|
return /* @__PURE__ */ p("button", {
|
|
4027
4035
|
type: "button",
|
|
@@ -4032,7 +4040,7 @@ function Jr({ format: e, icon: t }) {
|
|
|
4032
4040
|
}
|
|
4033
4041
|
//#endregion
|
|
4034
4042
|
//#region src/components/richText/toolbar/index.tsx
|
|
4035
|
-
function
|
|
4043
|
+
function Xr({ children: e }) {
|
|
4036
4044
|
return /* @__PURE__ */ p("div", {
|
|
4037
4045
|
className: "arkynRichTextToolbar",
|
|
4038
4046
|
children: e
|
|
@@ -4040,21 +4048,21 @@ function Yr({ children: e }) {
|
|
|
4040
4048
|
}
|
|
4041
4049
|
//#endregion
|
|
4042
4050
|
//#region src/components/richText/index.tsx
|
|
4043
|
-
function
|
|
4051
|
+
function Zr(e) {
|
|
4044
4052
|
let { name: t, hiddenButtons: n, imageConfig: r, videoConfig: a, linkConfig: o, className: d = "", defaultValue: f = "[]", enforceCharacterLimit: h = !1, onChangeCharactersCount: x, baseErrorMessage: S, maxLimit: C = 1e4, onChange: w, isError: T, label: D, showAsterisk: O, id: k, orientation: A = "vertical", unShowFieldTemplate: j = !1 } = e, P = c(() => he(ye(me())), []), { fieldErrors: F } = Z(), L = c(() => {
|
|
4045
4053
|
try {
|
|
4046
4054
|
let e = JSON.parse(f);
|
|
4047
|
-
return !Array.isArray(e) || e.length === 0 ? structuredClone(
|
|
4055
|
+
return !Array.isArray(e) || e.length === 0 ? structuredClone(Mr) : e.every((e) => typeof e == "object" && !!e && "type" in e && "children" in e) ? e : structuredClone(Mr);
|
|
4048
4056
|
} catch {
|
|
4049
|
-
return structuredClone(
|
|
4057
|
+
return structuredClone(Mr);
|
|
4050
4058
|
}
|
|
4051
|
-
}, [f]), [R, z] = u(
|
|
4052
|
-
function
|
|
4053
|
-
let t =
|
|
4059
|
+
}, [f]), [R, z] = u(Or(L).length), [B, V] = u(JSON.stringify(L) || "[]"), [U, W] = u(!1), K = l(null), q = s(), ee = k || q, te = S || F?.[t], J = T || !!te, ne = i(Jr, []), re = i(Rr, []);
|
|
4060
|
+
function ie(e) {
|
|
4061
|
+
let t = Or(e);
|
|
4054
4062
|
z(t.length), x?.(t.length), !(h && t.length >= C) && (V(JSON.stringify(e)), w?.(e));
|
|
4055
4063
|
}
|
|
4056
|
-
let
|
|
4057
|
-
function
|
|
4064
|
+
let ae = `arkynRichText ${J || C < R ? "errorTrue" : "errorFalse"} ${U ? "focusTrue" : "focusFalse"}`, oe = C - R;
|
|
4065
|
+
function Y(e) {
|
|
4058
4066
|
return !n?.includes(e);
|
|
4059
4067
|
}
|
|
4060
4068
|
return /* @__PURE__ */ p($e, {
|
|
@@ -4068,60 +4076,60 @@ function Xr(e) {
|
|
|
4068
4076
|
children: /* @__PURE__ */ m(_e, {
|
|
4069
4077
|
editor: P,
|
|
4070
4078
|
initialValue: L,
|
|
4071
|
-
onChange:
|
|
4072
|
-
onValueChange:
|
|
4079
|
+
onChange: ie,
|
|
4080
|
+
onValueChange: ie,
|
|
4073
4081
|
children: [
|
|
4074
4082
|
/* @__PURE__ */ m("div", {
|
|
4075
|
-
className:
|
|
4083
|
+
className: ae,
|
|
4076
4084
|
children: [
|
|
4077
|
-
/* @__PURE__ */ m(
|
|
4078
|
-
|
|
4085
|
+
/* @__PURE__ */ m(Xr, { children: [
|
|
4086
|
+
Y("headingOne") && /* @__PURE__ */ p(Lr, {
|
|
4079
4087
|
format: "headingOne",
|
|
4080
4088
|
icon: M
|
|
4081
4089
|
}),
|
|
4082
|
-
|
|
4090
|
+
Y("headingTwo") && /* @__PURE__ */ p(Lr, {
|
|
4083
4091
|
format: "headingTwo",
|
|
4084
4092
|
icon: N
|
|
4085
4093
|
}),
|
|
4086
|
-
|
|
4094
|
+
Y("blockQuote") && /* @__PURE__ */ p(Lr, {
|
|
4087
4095
|
format: "blockQuote",
|
|
4088
4096
|
icon: H
|
|
4089
4097
|
}),
|
|
4090
|
-
|
|
4098
|
+
Y("bold") && /* @__PURE__ */ p(Yr, {
|
|
4091
4099
|
format: "bold",
|
|
4092
4100
|
icon: b
|
|
4093
4101
|
}),
|
|
4094
|
-
|
|
4102
|
+
Y("italic") && /* @__PURE__ */ p(Yr, {
|
|
4095
4103
|
format: "italic",
|
|
4096
4104
|
icon: I
|
|
4097
4105
|
}),
|
|
4098
|
-
|
|
4106
|
+
Y("underline") && /* @__PURE__ */ p(Yr, {
|
|
4099
4107
|
format: "underline",
|
|
4100
4108
|
icon: G
|
|
4101
4109
|
}),
|
|
4102
|
-
|
|
4110
|
+
Y("code") && /* @__PURE__ */ p(Yr, {
|
|
4103
4111
|
format: "code",
|
|
4104
4112
|
icon: E
|
|
4105
4113
|
}),
|
|
4106
|
-
|
|
4114
|
+
Y("left") && /* @__PURE__ */ p(Lr, {
|
|
4107
4115
|
format: "left",
|
|
4108
4116
|
icon: v
|
|
4109
4117
|
}),
|
|
4110
|
-
|
|
4118
|
+
Y("right") && /* @__PURE__ */ p(Lr, {
|
|
4111
4119
|
format: "right",
|
|
4112
4120
|
icon: y
|
|
4113
4121
|
}),
|
|
4114
|
-
|
|
4122
|
+
Y("center") && /* @__PURE__ */ p(Lr, {
|
|
4115
4123
|
format: "center",
|
|
4116
4124
|
icon: g
|
|
4117
4125
|
}),
|
|
4118
|
-
|
|
4126
|
+
Y("justify") && /* @__PURE__ */ p(Lr, {
|
|
4119
4127
|
format: "justify",
|
|
4120
4128
|
icon: _
|
|
4121
4129
|
}),
|
|
4122
|
-
r &&
|
|
4123
|
-
|
|
4124
|
-
|
|
4130
|
+
r && Y("image") && /* @__PURE__ */ p(Wr, { ...r }),
|
|
4131
|
+
Y("video") && /* @__PURE__ */ p(qr, { ...a }),
|
|
4132
|
+
Y("link") && /* @__PURE__ */ p(Kr, { ...o })
|
|
4125
4133
|
] }),
|
|
4126
4134
|
/* @__PURE__ */ p(ge, {
|
|
4127
4135
|
className: "editorContainer",
|
|
@@ -4133,16 +4141,17 @@ function Xr(e) {
|
|
|
4133
4141
|
onFocus: () => W(!0),
|
|
4134
4142
|
onBlur: () => W(!1),
|
|
4135
4143
|
onKeyDown: (e) => {
|
|
4136
|
-
|
|
4144
|
+
(e.key === " " || e.key === "Enter") && Dr(P);
|
|
4145
|
+
for (let t in jr) if (ce(t, e)) {
|
|
4137
4146
|
e.preventDefault();
|
|
4138
|
-
let n =
|
|
4139
|
-
|
|
4147
|
+
let n = jr[t];
|
|
4148
|
+
Ar(P, n);
|
|
4140
4149
|
}
|
|
4141
4150
|
}
|
|
4142
4151
|
}),
|
|
4143
|
-
|
|
4152
|
+
oe < 0 && /* @__PURE__ */ p("div", {
|
|
4144
4153
|
className: "restatesCharacters",
|
|
4145
|
-
children:
|
|
4154
|
+
children: oe
|
|
4146
4155
|
})
|
|
4147
4156
|
]
|
|
4148
4157
|
}),
|
|
@@ -4162,7 +4171,7 @@ function Xr(e) {
|
|
|
4162
4171
|
}
|
|
4163
4172
|
//#endregion
|
|
4164
4173
|
//#region src/components/searchPlaces.tsx
|
|
4165
|
-
function
|
|
4174
|
+
function Qr(e) {
|
|
4166
4175
|
let { onChange: t, onPlaceChanged: n, options: r, ...i } = e, [a, o] = u(null);
|
|
4167
4176
|
return /* @__PURE__ */ p(be, {
|
|
4168
4177
|
onLoad: (e) => o(e),
|
|
@@ -4215,7 +4224,7 @@ function Zr(e) {
|
|
|
4215
4224
|
}
|
|
4216
4225
|
//#endregion
|
|
4217
4226
|
//#region src/components/switch/index.tsx
|
|
4218
|
-
function
|
|
4227
|
+
function $r(e) {
|
|
4219
4228
|
let { label: t, size: n = "lg", defaultChecked: r = !1, checked: i = null, value: a, unCheckedValue: o = "", name: c, className: d = "", onCheck: f, id: m, orientation: h = "horizontalReverse", className: g = "", showAsterisk: _, errorMessage: v, unShowFieldTemplate: y = !1, ...b } = e, x = l(null), S = s(), C = m || S, [w, T] = u(r), E = typeof i == "boolean" ? i : w;
|
|
4220
4229
|
function D() {
|
|
4221
4230
|
T(!w), f?.(E ? o : a || "checked");
|
|
@@ -4246,7 +4255,7 @@ function Qr(e) {
|
|
|
4246
4255
|
}
|
|
4247
4256
|
//#endregion
|
|
4248
4257
|
//#region src/components/table/tableBody/index.tsx
|
|
4249
|
-
function
|
|
4258
|
+
function ei(t) {
|
|
4250
4259
|
let { emptyMessage: n = "Nenhum dado adicionado.", className: r, children: i, ...a } = t, o = `arkynTableBody ${r}`, s = e.toArray(i).filter(Boolean), c = s.length === 0;
|
|
4251
4260
|
return /* @__PURE__ */ p("tbody", {
|
|
4252
4261
|
className: o.trim(),
|
|
@@ -4262,7 +4271,7 @@ function $r(t) {
|
|
|
4262
4271
|
}
|
|
4263
4272
|
//#endregion
|
|
4264
4273
|
//#region src/components/table/tableCaption/index.tsx
|
|
4265
|
-
function
|
|
4274
|
+
function ti(e) {
|
|
4266
4275
|
let { className: t, children: n, ...r } = e;
|
|
4267
4276
|
return /* @__PURE__ */ p("caption", {
|
|
4268
4277
|
className: `arkynTableCaption ${t}`.trim(),
|
|
@@ -4275,7 +4284,7 @@ function ei(e) {
|
|
|
4275
4284
|
}
|
|
4276
4285
|
//#endregion
|
|
4277
4286
|
//#region src/components/table/tableContainer/index.tsx
|
|
4278
|
-
function
|
|
4287
|
+
function ni(e) {
|
|
4279
4288
|
let { children: t, className: n, ...r } = e;
|
|
4280
4289
|
return /* @__PURE__ */ p("div", {
|
|
4281
4290
|
className: `arkynTableContainer ${n}`.trim(),
|
|
@@ -4285,7 +4294,7 @@ function ti(e) {
|
|
|
4285
4294
|
}
|
|
4286
4295
|
//#endregion
|
|
4287
4296
|
//#region src/components/table/tableFooter/index.tsx
|
|
4288
|
-
function
|
|
4297
|
+
function ri(e) {
|
|
4289
4298
|
let { className: t, children: n, ...r } = e;
|
|
4290
4299
|
return /* @__PURE__ */ m("tfoot", {
|
|
4291
4300
|
className: `arkynTableFooter ${t}`.trim(),
|
|
@@ -4301,7 +4310,7 @@ function ni(e) {
|
|
|
4301
4310
|
}
|
|
4302
4311
|
//#endregion
|
|
4303
4312
|
//#region src/components/table/tableHeader/index.tsx
|
|
4304
|
-
function
|
|
4313
|
+
function ii(e) {
|
|
4305
4314
|
let { className: t, children: n, ...r } = e;
|
|
4306
4315
|
return /* @__PURE__ */ m("thead", {
|
|
4307
4316
|
className: `arkynTableHeader ${t}`.trim(),
|
|
@@ -4311,7 +4320,7 @@ function ri(e) {
|
|
|
4311
4320
|
}
|
|
4312
4321
|
//#endregion
|
|
4313
4322
|
//#region src/components/textarea/index.tsx
|
|
4314
|
-
function
|
|
4323
|
+
function ai(e) {
|
|
4315
4324
|
let { variant: t = "solid", size: n = "md", className: r, errorMessage: i, disabled: a = !1, readOnly: o = !1, label: c, showAsterisk: d, name: f, onFocus: h, onBlur: g, title: _, style: v, value: y, defaultValue: b, placeholder: x, id: S, ...C } = e, { fieldErrors: w } = Z(), [T, E] = u(!1), D = l(null), O = s(), k = S || O, A = i || w?.[f], j = `arkynTextarea ${t} ${n} ${a || o ? "opacityTrue" : "opacityFalse"} ${A ? "errorTrue" : "errorFalse"} ${T ? "focusedTrue" : "focusedFalse"}`, M = a ? void 0 : y;
|
|
4316
4325
|
function N() {
|
|
4317
4326
|
a || !D?.current || (E(!0), D.current.focus());
|
|
@@ -4355,7 +4364,7 @@ function ii(e) {
|
|
|
4355
4364
|
}
|
|
4356
4365
|
//#endregion
|
|
4357
4366
|
//#region src/templates/badResponses.ts
|
|
4358
|
-
var
|
|
4367
|
+
var oi = [
|
|
4359
4368
|
"BadGateway",
|
|
4360
4369
|
"BadRequest",
|
|
4361
4370
|
"Conflict",
|
|
@@ -4365,13 +4374,13 @@ var ai = [
|
|
|
4365
4374
|
"ServerError",
|
|
4366
4375
|
"Unauthorized",
|
|
4367
4376
|
"UnprocessableEntity"
|
|
4368
|
-
],
|
|
4377
|
+
], si = [
|
|
4369
4378
|
"Created",
|
|
4370
4379
|
"Found",
|
|
4371
4380
|
"Success",
|
|
4372
4381
|
"Updated"
|
|
4373
|
-
],
|
|
4374
|
-
function
|
|
4382
|
+
], ci = n({});
|
|
4383
|
+
function li(e) {
|
|
4375
4384
|
let { children: t = !1 } = e, [n, r] = u([]), a = i((e) => n.some((t) => t.key === e), [n]), o = i((e) => n.find((t) => t.key === e)?.data, [n]), s = i((e, t) => {
|
|
4376
4385
|
r((n) => [...n.filter((t) => t.key !== e), {
|
|
4377
4386
|
key: e,
|
|
@@ -4394,15 +4403,15 @@ function ci(e) {
|
|
|
4394
4403
|
l,
|
|
4395
4404
|
d
|
|
4396
4405
|
]);
|
|
4397
|
-
return /* @__PURE__ */ p(
|
|
4406
|
+
return /* @__PURE__ */ p(ci.Provider, {
|
|
4398
4407
|
value: f,
|
|
4399
4408
|
children: t
|
|
4400
4409
|
});
|
|
4401
4410
|
}
|
|
4402
4411
|
//#endregion
|
|
4403
4412
|
//#region src/hooks/useModal.ts
|
|
4404
|
-
function
|
|
4405
|
-
let t = a(
|
|
4413
|
+
function ui(e) {
|
|
4414
|
+
let t = a(ci);
|
|
4406
4415
|
if (Object.entries(t).length === 0) throw Error("useModal must be used within a Provider");
|
|
4407
4416
|
if (e) {
|
|
4408
4417
|
let { modalData: n, modalIsOpen: r, openModal: i, closeModal: a } = t;
|
|
@@ -4416,8 +4425,8 @@ function li(e) {
|
|
|
4416
4425
|
}
|
|
4417
4426
|
//#endregion
|
|
4418
4427
|
//#region src/providers/toastProvider.tsx
|
|
4419
|
-
var
|
|
4420
|
-
function
|
|
4428
|
+
var di = n({});
|
|
4429
|
+
function fi(e) {
|
|
4421
4430
|
switch (e.type) {
|
|
4422
4431
|
case "success": return Ce.success(e.message, {
|
|
4423
4432
|
style: {
|
|
@@ -4447,9 +4456,9 @@ function di(e) {
|
|
|
4447
4456
|
});
|
|
4448
4457
|
}
|
|
4449
4458
|
}
|
|
4450
|
-
function
|
|
4451
|
-
let t = c(() => ({ showToast:
|
|
4452
|
-
return /* @__PURE__ */ m(
|
|
4459
|
+
function pi({ children: e }) {
|
|
4460
|
+
let t = c(() => ({ showToast: fi }), []);
|
|
4461
|
+
return /* @__PURE__ */ m(di.Provider, {
|
|
4453
4462
|
value: t,
|
|
4454
4463
|
children: [/* @__PURE__ */ p(we, {
|
|
4455
4464
|
position: "top-right",
|
|
@@ -4459,21 +4468,21 @@ function fi({ children: e }) {
|
|
|
4459
4468
|
}
|
|
4460
4469
|
//#endregion
|
|
4461
4470
|
//#region src/hooks/useToast.ts
|
|
4462
|
-
function
|
|
4463
|
-
let e = a(
|
|
4471
|
+
function mi() {
|
|
4472
|
+
let e = a(di);
|
|
4464
4473
|
if (Object.entries(e).length === 0) throw Error("useToast must be used within a Provider");
|
|
4465
4474
|
return e;
|
|
4466
4475
|
}
|
|
4467
4476
|
//#endregion
|
|
4468
4477
|
//#region src/hooks/useAutomation.ts
|
|
4469
|
-
function
|
|
4470
|
-
let { closeAll: t } =
|
|
4478
|
+
function hi(e) {
|
|
4479
|
+
let { closeAll: t } = ui(), { showToast: n } = mi(), r = e?.closeModal, a = e?.message, s = e?.name, c = e?.cause?.data?.scrollTo, l = e?.cause?.fieldErrors ? Object.values(e?.cause?.fieldErrors)[0] : null, u = i(() => {
|
|
4471
4480
|
if (!(!a && !l)) {
|
|
4472
|
-
if (
|
|
4481
|
+
if (si.includes(s)) return n({
|
|
4473
4482
|
message: a,
|
|
4474
4483
|
type: "success"
|
|
4475
4484
|
});
|
|
4476
|
-
if (
|
|
4485
|
+
if (oi.includes(s)) {
|
|
4477
4486
|
if (l) return n({
|
|
4478
4487
|
message: l,
|
|
4479
4488
|
type: "danger"
|
|
@@ -4503,9 +4512,34 @@ function mi(e) {
|
|
|
4503
4512
|
]);
|
|
4504
4513
|
}
|
|
4505
4514
|
//#endregion
|
|
4506
|
-
//#region src/
|
|
4507
|
-
var hi = n({});
|
|
4515
|
+
//#region src/hooks/useCopyToClipboard.ts
|
|
4508
4516
|
function gi(e) {
|
|
4517
|
+
let t = document.createElement("textarea");
|
|
4518
|
+
t.value = e, t.style.position = "fixed", t.style.opacity = "0", document.body.appendChild(t), t.select();
|
|
4519
|
+
try {
|
|
4520
|
+
return document.execCommand("copy");
|
|
4521
|
+
} finally {
|
|
4522
|
+
document.body.removeChild(t);
|
|
4523
|
+
}
|
|
4524
|
+
}
|
|
4525
|
+
function _i() {
|
|
4526
|
+
async function e(e) {
|
|
4527
|
+
try {
|
|
4528
|
+
return await navigator.clipboard.writeText(e), !0;
|
|
4529
|
+
} catch {
|
|
4530
|
+
try {
|
|
4531
|
+
return gi(e);
|
|
4532
|
+
} catch {
|
|
4533
|
+
return !1;
|
|
4534
|
+
}
|
|
4535
|
+
}
|
|
4536
|
+
}
|
|
4537
|
+
return { copyToClipboard: e };
|
|
4538
|
+
}
|
|
4539
|
+
//#endregion
|
|
4540
|
+
//#region src/providers/drawerProvider.tsx
|
|
4541
|
+
var vi = n({});
|
|
4542
|
+
function yi(e) {
|
|
4509
4543
|
let { children: t = !1 } = e, [n, r] = u([]);
|
|
4510
4544
|
function i(e) {
|
|
4511
4545
|
return !!n.some((t) => t.key === e);
|
|
@@ -4525,7 +4559,7 @@ function gi(e) {
|
|
|
4525
4559
|
function s(e) {
|
|
4526
4560
|
r(n.filter((t) => t.key !== e));
|
|
4527
4561
|
}
|
|
4528
|
-
return /* @__PURE__ */ p(
|
|
4562
|
+
return /* @__PURE__ */ p(vi.Provider, {
|
|
4529
4563
|
value: {
|
|
4530
4564
|
drawerIsOpen: i,
|
|
4531
4565
|
drawerData: a,
|
|
@@ -4537,8 +4571,8 @@ function gi(e) {
|
|
|
4537
4571
|
}
|
|
4538
4572
|
//#endregion
|
|
4539
4573
|
//#region src/hooks/useDrawer.ts
|
|
4540
|
-
function
|
|
4541
|
-
let t = a(
|
|
4574
|
+
function bi(e) {
|
|
4575
|
+
let t = a(vi);
|
|
4542
4576
|
if (Object.entries(t).length === 0) throw Error("useDrawer must be used within a Provider");
|
|
4543
4577
|
if (e) {
|
|
4544
4578
|
let { drawerData: n, drawerIsOpen: r, openDrawer: i, closeDrawer: a } = t;
|
|
@@ -4552,7 +4586,7 @@ function _i(e) {
|
|
|
4552
4586
|
}
|
|
4553
4587
|
//#endregion
|
|
4554
4588
|
//#region src/hooks/useScopedParams.ts
|
|
4555
|
-
function
|
|
4589
|
+
function xi(e, t = "") {
|
|
4556
4590
|
let n = new URLSearchParams(e), r = t ? `${t}:` : "", i = (e) => {
|
|
4557
4591
|
Object.entries(e).forEach(([e, t]) => {
|
|
4558
4592
|
t === void 0 ? n.delete(`${r}${e}`) : n.set(`${r}${e}`, String(t));
|
|
@@ -4569,8 +4603,8 @@ function vi(e, t = "") {
|
|
|
4569
4603
|
}
|
|
4570
4604
|
//#endregion
|
|
4571
4605
|
//#region src/hooks/useSearchAutomation.ts
|
|
4572
|
-
function
|
|
4573
|
-
let { closeAll: n } =
|
|
4606
|
+
function Si(e, t = "") {
|
|
4607
|
+
let { closeAll: n } = ui(), { showToast: r } = mi(), { getParam: i } = xi(e, t), a = i("closeModal") === "true", s = i("message"), c = i("name"), l = i("type");
|
|
4574
4608
|
o(() => {
|
|
4575
4609
|
a && n(), s && (l === "success" && r({
|
|
4576
4610
|
message: s,
|
|
@@ -4578,10 +4612,10 @@ function yi(e, t = "") {
|
|
|
4578
4612
|
}), l === "danger" && r({
|
|
4579
4613
|
message: s,
|
|
4580
4614
|
type: "danger"
|
|
4581
|
-
}), c &&
|
|
4615
|
+
}), c && oi.includes(c) && !oi.includes(s) && r({
|
|
4582
4616
|
message: s,
|
|
4583
4617
|
type: "danger"
|
|
4584
|
-
}), c &&
|
|
4618
|
+
}), c && si.includes(c) && !si.includes(s) && r({
|
|
4585
4619
|
message: s,
|
|
4586
4620
|
type: "success"
|
|
4587
4621
|
}));
|
|
@@ -4596,28 +4630,28 @@ function yi(e, t = "") {
|
|
|
4596
4630
|
}
|
|
4597
4631
|
//#endregion
|
|
4598
4632
|
//#region src/providers/placesProvider.tsx
|
|
4599
|
-
var
|
|
4633
|
+
var Ci = [
|
|
4600
4634
|
"places",
|
|
4601
4635
|
"marker",
|
|
4602
4636
|
"maps"
|
|
4603
4637
|
];
|
|
4604
|
-
function
|
|
4638
|
+
function wi(e) {
|
|
4605
4639
|
let { apiKey: t, children: n, preventFontsLoading: r = !0 } = e, { isLoaded: i } = xe({
|
|
4606
4640
|
googleMapsApiKey: t,
|
|
4607
|
-
libraries:
|
|
4641
|
+
libraries: Ci,
|
|
4608
4642
|
preventGoogleFontsLoading: r
|
|
4609
4643
|
});
|
|
4610
4644
|
return /* @__PURE__ */ p(f, { children: n(i) });
|
|
4611
4645
|
}
|
|
4612
4646
|
//#endregion
|
|
4613
4647
|
//#region src/utils/richTextUtilities.ts
|
|
4614
|
-
function
|
|
4648
|
+
function Ti(e) {
|
|
4615
4649
|
if (fe.isText(e)) {
|
|
4616
4650
|
let t = e?.text;
|
|
4617
4651
|
return e?.bold && (t = `<strong>${t}</strong>`), e?.code && (t = `<code>${t}</code>`), e?.italic && (t = `<em>${t}</em>`), e?.underline && (t = `<u>${t}</u>`), e?.link && (t = `<a href="${e.href}">${t}</a>`), t;
|
|
4618
4652
|
}
|
|
4619
4653
|
if (le.isElement(e)) {
|
|
4620
|
-
let t = e.children?.map((e) =>
|
|
4654
|
+
let t = e.children?.map((e) => Ti(e)).join(""), n = e.align || "left";
|
|
4621
4655
|
switch (e.type) {
|
|
4622
4656
|
case "video": return `<iframe src="${e.src}" class="align_${n}" />`;
|
|
4623
4657
|
case "image": return `<img src="${e.src}" class="align_${n}" />`;
|
|
@@ -4633,10 +4667,10 @@ function Si(e) {
|
|
|
4633
4667
|
}
|
|
4634
4668
|
return "";
|
|
4635
4669
|
}
|
|
4636
|
-
function
|
|
4670
|
+
function Ei(e) {
|
|
4637
4671
|
if (typeof e == "string") return { text: e };
|
|
4638
4672
|
let t = e.props.children, n;
|
|
4639
|
-
n = Array.isArray(t) ? t.map((e) =>
|
|
4673
|
+
n = Array.isArray(t) ? t.map((e) => Ei(e)) : typeof t == "string" || !t ? [{ text: t || "" }] : [Ei(t)];
|
|
4640
4674
|
let r = e.props.className?.replace("align_", "");
|
|
4641
4675
|
switch (e.type) {
|
|
4642
4676
|
case "img": return {
|
|
@@ -4706,16 +4740,16 @@ function Ci(e) {
|
|
|
4706
4740
|
}
|
|
4707
4741
|
//#endregion
|
|
4708
4742
|
//#region src/services/toHtml.ts
|
|
4709
|
-
function
|
|
4710
|
-
return e.map((e) =>
|
|
4743
|
+
function Di(e) {
|
|
4744
|
+
return e.map((e) => Ti(e)).join("");
|
|
4711
4745
|
}
|
|
4712
4746
|
//#endregion
|
|
4713
4747
|
//#region src/services/toRichTextValue.ts
|
|
4714
|
-
function
|
|
4748
|
+
function Oi(e) {
|
|
4715
4749
|
let t = Te(e);
|
|
4716
|
-
return Array.isArray(t) ? t.map((e) => typeof e == "string" ? { text: e } :
|
|
4750
|
+
return Array.isArray(t) ? t.map((e) => typeof e == "string" ? { text: e } : Ei(e)) : typeof t == "string" ? [{ text: t }] : [Ei(t)];
|
|
4717
4751
|
}
|
|
4718
4752
|
//#endregion
|
|
4719
|
-
export { ke as AlertContainer, Ae as AlertContent, je as AlertDescription, Me as AlertIcon, Ee as AlertTitle, Fe as AudioPlayer, Ke as AudioUpload, qe as Badge, $ as Button, gt as Calendar, bt as CardTabButton, xt as CardTabContainer, St as Checkbox, Tt as ClientOnly, Ot as CurrencyInput, Lt as DatePicker, Ve as Divider, Vt as DrawerContainer, Ht as DrawerHeader,
|
|
4753
|
+
export { ke as AlertContainer, Ae as AlertContent, je as AlertDescription, Me as AlertIcon, Ee as AlertTitle, Fe as AudioPlayer, Ke as AudioUpload, qe as Badge, $ as Button, gt as Calendar, bt as CardTabButton, xt as CardTabContainer, St as Checkbox, Tt as ClientOnly, Ot as CurrencyInput, Lt as DatePicker, Ve as Divider, Vt as DrawerContainer, Ht as DrawerHeader, yi as DrawerProvider, Gt as FacebookPixel, Re as FieldError, ze as FieldLabel, Be as FieldWrapper, Jt as FileUpload, Le as FormProvider, Sn as FullCalendar, En as GoogleAnalytics, jn as GoogleTagManager, He as IconButton, Pn as ImageUpload, ot as Input, Ln as MapView, zn as MaskedInput, Un as ModalContainer, Wn as ModalFooter, Gn as ModalHeader, li as ModalProvider, er as MultiSelect, or as Pagination, br as PhoneInput, wi as PlacesProvider, xr as Popover, Tr as RadioBox, Er as RadioGroup, Zr as RichText, Qr as SearchPlaces, ut as Select, Pe as Slider, $r as Switch, Hr as TabButton, Ur as TabContainer, ei as TableBody, ti as TableCaption, ni as TableContainer, ri as TableFooter, ii as TableHeader, ai as Textarea, pi as ToastProvider, Ue as Tooltip, Di as toHtml, Oi as toRichTextValue, hi as useAutomation, _i as useCopyToClipboard, bi as useDrawer, Z as useForm, wt as useHydrated, ui as useModal, xi as useScopedParams, at as useScrollLock, Si as useSearchAutomation, Ne as useSlider, mi as useToast };
|
|
4720
4754
|
|
|
4721
4755
|
//# sourceMappingURL=index.js.map
|