@arkyn/components 3.0.1-beta.155 → 3.0.1-beta.156
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/calendar/_viewService.d.ts +1 -1
- package/dist/components/fullCalendar/_viewService.d.ts +2 -2
- package/dist/hooks/useScopedParams.d.ts +1 -1
- package/dist/index.js +4683 -4347
- package/dist/modules/components/alert/alertContainer/index.js +20 -25
- package/dist/modules/components/alert/alertContent/index.js +8 -11
- package/dist/modules/components/alert/alertDescription/index.js +8 -11
- package/dist/modules/components/alert/alertIcon/index.js +19 -27
- package/dist/modules/components/alert/alertTitle/index.js +8 -11
- package/dist/modules/components/audioPlayer/index.js +75 -74
- package/dist/modules/components/audioUpload/hasFileContent/index.js +62 -54
- package/dist/modules/components/audioUpload/index.js +79 -71
- package/dist/modules/components/audioUpload/noFileContent/index.js +45 -35
- package/dist/modules/components/badge/index.js +22 -26
- package/dist/modules/components/button/index.js +32 -39
- package/dist/modules/components/calendar/_calendarProvider.js +63 -38
- package/dist/modules/components/calendar/_viewService.js +140 -132
- package/dist/modules/components/calendar/calendarContainer/index.js +7 -10
- package/dist/modules/components/calendar/calendarHeader/index.js +72 -51
- package/dist/modules/components/calendar/calendarTableBody/index.js +10 -12
- package/dist/modules/components/calendar/calendarTableContainer/index.js +7 -10
- package/dist/modules/components/calendar/calendarTableHeader/index.js +10 -13
- package/dist/modules/components/calendar/calendarTableTd/index.js +23 -20
- package/dist/modules/components/calendar/index.js +49 -31
- package/dist/modules/components/cardTab/cardTabButton/index.js +29 -19
- package/dist/modules/components/cardTab/cardTabContainer/index.js +28 -22
- package/dist/modules/components/cardTab/cardTabContext.js +11 -13
- package/dist/modules/components/checkbox/index.js +64 -37
- package/dist/modules/components/clientOnly.js +8 -8
- package/dist/modules/components/currencyInput/index.js +138 -110
- package/dist/modules/components/divider/index.js +11 -10
- package/dist/modules/components/drawer/drawerContainer/index.js +43 -40
- package/dist/modules/components/drawer/drawerContext.js +11 -13
- package/dist/modules/components/drawer/drawerHeader/index.js +27 -20
- package/dist/modules/components/facebookPixel/facebookPixel.client.js +18 -8
- package/dist/modules/components/facebookPixel/index.js +8 -8
- package/dist/modules/components/facebookPixel/pixel.js +52 -47
- package/dist/modules/components/fieldError/index.js +8 -12
- package/dist/modules/components/fieldLabel/index.js +12 -11
- package/dist/modules/components/fieldWrapper/index.js +13 -12
- package/dist/modules/components/fileUpload/hasFileContent/index.js +67 -59
- package/dist/modules/components/fileUpload/index.js +72 -65
- package/dist/modules/components/fileUpload/noFileContent/index.js +45 -35
- package/dist/modules/components/fullCalendar/_fullCalendarProvider.js +46 -33
- package/dist/modules/components/fullCalendar/_viewService.js +105 -100
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarContainer/index.js +7 -10
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarEvent/index.js +78 -70
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarRow/index.js +33 -28
- package/dist/modules/components/fullCalendar/dayCalendar/index.js +9 -12
- package/dist/modules/components/fullCalendar/fullCalendarContainer/index.js +7 -10
- package/dist/modules/components/fullCalendar/fullCalendarHeader/index.js +70 -67
- package/dist/modules/components/fullCalendar/index.js +30 -30
- package/dist/modules/components/fullCalendar/monthlyCalendar/index.js +12 -9
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarEvent/index.js +36 -28
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableBody/index.js +9 -11
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableContainer/index.js +9 -10
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableHeader/index.js +10 -13
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableTd/index.js +36 -35
- package/dist/modules/components/fullCalendar/weekCalendar/index.js +11 -8
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarEvent/index.js +78 -70
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableBody/index.js +20 -17
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableContainer/index.js +8 -9
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableHeader/index.js +19 -16
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableTd/index.js +39 -34
- package/dist/modules/components/googleAnalytics/googleAnalytics.client.js +7 -7
- package/dist/modules/components/googleAnalytics/googleAnalytics.js +17 -17
- package/dist/modules/components/googleAnalytics/index.js +9 -9
- package/dist/modules/components/googleAnalytics/snippets/generateGAElements.js +12 -10
- package/dist/modules/components/googleTagManager/googleTagManager.client.js +6 -6
- package/dist/modules/components/googleTagManager/googleTagManager.js +48 -44
- package/dist/modules/components/googleTagManager/index.js +27 -16
- package/dist/modules/components/googleTagManager/snippets/appendToDataLayer.js +8 -8
- package/dist/modules/components/googleTagManager/snippets/generateGTMElements.js +20 -19
- package/dist/modules/components/iconButton/index.js +29 -31
- package/dist/modules/components/imageUpload/hasFileContent/index.js +63 -46
- package/dist/modules/components/imageUpload/index.js +82 -65
- package/dist/modules/components/imageUpload/noFileContent/index.js +45 -35
- package/dist/modules/components/input/index.js +120 -92
- package/dist/modules/components/mapView/index.js +31 -27
- package/dist/modules/components/mapView/mapView.client.js +51 -49
- package/dist/modules/components/maskedInput/index.js +112 -101
- package/dist/modules/components/modal/modalContainer/index.js +42 -49
- package/dist/modules/components/modal/modalContext.js +11 -13
- package/dist/modules/components/modal/modalFooter/index.js +7 -10
- package/dist/modules/components/modal/modalHeader/index.js +27 -20
- package/dist/modules/components/multiSelect/index.js +154 -115
- package/dist/modules/components/multiSelect/multiSelectChevron/index.js +21 -18
- package/dist/modules/components/multiSelect/multiSelectContainer/index.js +29 -13
- package/dist/modules/components/multiSelect/multiSelectContent/index.js +8 -11
- package/dist/modules/components/multiSelect/multiSelectMark/index.js +22 -19
- package/dist/modules/components/multiSelect/multiSelectOption/index.js +13 -17
- package/dist/modules/components/multiSelect/multiSelectOptionsContainer/index.js +45 -35
- package/dist/modules/components/multiSelect/multiSelectOverlay/index.js +8 -11
- package/dist/modules/components/multiSelect/multiSelectSpinner/index.js +16 -13
- package/dist/modules/components/pagination/chevronButton/index.js +17 -17
- package/dist/modules/components/pagination/currentButton/index.js +7 -11
- package/dist/modules/components/pagination/index.js +83 -51
- package/dist/modules/components/pagination/pageButton/index.js +8 -12
- package/dist/modules/components/pagination/paginationService.js +48 -33
- package/dist/modules/components/pagination/spread/index.js +7 -10
- package/dist/modules/components/phoneInput/index.js +151 -103
- package/dist/modules/components/phoneInput/phoneInputContainer/index.js +19 -12
- package/dist/modules/components/phoneInput/phoneInputCountriesOverlay/index.js +8 -11
- package/dist/modules/components/phoneInput/phoneInputCountryOption/index.js +15 -23
- package/dist/modules/components/phoneInput/phoneInputCountryOptionsContainer/index.js +43 -33
- package/dist/modules/components/phoneInput/phoneInputCountrySelector/index.js +21 -25
- package/dist/modules/components/phoneInput/phoneInputMask/index.js +62 -46
- package/dist/modules/components/popover/index.js +36 -37
- package/dist/modules/components/radio/radioBox/index.js +42 -24
- package/dist/modules/components/radio/radioContext.js +18 -20
- package/dist/modules/components/radio/radioGroup/index.js +64 -41
- package/dist/modules/components/richText/blockButton/index.js +23 -20
- package/dist/modules/components/richText/element/index.js +58 -72
- package/dist/modules/components/richText/index.js +135 -143
- package/dist/modules/components/richText/insertImage/index.js +105 -94
- package/dist/modules/components/richText/insertVideo/index.js +97 -85
- package/dist/modules/components/richText/leaf/index.js +6 -9
- package/dist/modules/components/richText/markButton/index.js +22 -19
- package/dist/modules/components/richText/toolbar/index.js +7 -10
- package/dist/modules/components/searchPlaces.js +66 -57
- package/dist/modules/components/select/index.js +144 -112
- package/dist/modules/components/select/selectChevron/index.js +21 -18
- package/dist/modules/components/select/selectContainer/index.js +29 -13
- package/dist/modules/components/select/selectContent/index.js +8 -11
- package/dist/modules/components/select/selectOption/index.js +13 -17
- package/dist/modules/components/select/selectOptionsContainer/index.js +45 -35
- package/dist/modules/components/select/selectOverlay/index.js +8 -11
- package/dist/modules/components/select/selectSpinner/index.js +9 -13
- package/dist/modules/components/slider/index.js +41 -34
- package/dist/modules/components/switch/index.js +62 -35
- package/dist/modules/components/tab/tabButton/index.js +29 -19
- package/dist/modules/components/tab/tabContainer/index.js +28 -22
- package/dist/modules/components/tab/tabContext.js +10 -12
- package/dist/modules/components/table/tableBody/index.js +14 -19
- package/dist/modules/components/table/tableCaption/index.js +8 -15
- package/dist/modules/components/table/tableContainer/index.js +8 -12
- package/dist/modules/components/table/tableFooter/index.js +11 -18
- package/dist/modules/components/table/tableHeader/index.js +11 -12
- package/dist/modules/components/textarea/index.js +69 -51
- package/dist/modules/components/tooltip/index.js +45 -34
- package/dist/modules/hooks/useAutomation.js +27 -35
- package/dist/modules/hooks/useDrawer.js +19 -17
- package/dist/modules/hooks/useForm.js +6 -6
- package/dist/modules/hooks/useHydrated.js +12 -7
- package/dist/modules/hooks/useModal.js +19 -17
- package/dist/modules/hooks/useScopedParams.js +17 -17
- package/dist/modules/hooks/useScrollLock.js +19 -19
- package/dist/modules/hooks/useSearchAutomation.js +14 -31
- package/dist/modules/hooks/useSlider.js +13 -13
- package/dist/modules/hooks/useToast.js +9 -8
- package/dist/modules/index.js +144 -72
- package/dist/modules/providers/drawerProvider.js +30 -35
- package/dist/modules/providers/formProvider.js +16 -11
- package/dist/modules/providers/modalProvider.js +33 -39
- package/dist/modules/providers/placesProvider.js +16 -16
- package/dist/modules/providers/toastProvider.js +51 -45
- package/dist/modules/services/extractTextFromNode.js +6 -6
- package/dist/modules/services/fieldTemplate.js +23 -22
- package/dist/modules/services/iconRenderer.js +7 -14
- package/dist/modules/services/isBlockActive.js +14 -12
- package/dist/modules/services/isMarkActive.js +6 -6
- package/dist/modules/services/maskCurrencyValues.js +12 -11
- package/dist/modules/services/toHtml.js +6 -6
- package/dist/modules/services/toRichTextValue.js +7 -7
- package/dist/modules/services/toggleBlock.js +19 -20
- package/dist/modules/services/toggleMark.js +7 -7
- package/dist/modules/style.css +1 -0
- package/dist/modules/templates/badResponses.js +13 -13
- package/dist/modules/templates/richTextTemplates.js +14 -17
- package/dist/modules/templates/successResponses.js +4 -9
- package/dist/modules/utils/phoneInputUtilities.js +28 -18
- package/dist/modules/utils/richTextUtilities.js +75 -88
- package/dist/services/fieldTemplate.d.ts +1 -1
- package/dist/services/fieldTemplate.d.ts.map +1 -1
- package/dist/style.css +1 -0
- package/package.json +65 -65
- package/dist/components.css +0 -2
- package/dist/modules/components.css +0 -2
|
@@ -1,27 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return n(i);
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as A, useContext as u } from "react";
|
|
3
|
+
import { AlertTitle as h } from "../alertTitle/index.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
const s = A({});
|
|
6
|
+
function j() {
|
|
7
|
+
return u(s);
|
|
9
8
|
}
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
children: /* @__PURE__ */ r("div", {
|
|
20
|
-
className: c.trim(),
|
|
21
|
-
...s,
|
|
22
|
-
children: a
|
|
23
|
-
})
|
|
24
|
-
});
|
|
9
|
+
function v(r) {
|
|
10
|
+
const { schema: o, children: l, className: a, ...c } = r, p = !((m) => {
|
|
11
|
+
let i = !1;
|
|
12
|
+
const e = (t) => {
|
|
13
|
+
Array.isArray(t) ? t.forEach(e) : t && typeof t == "object" && "type" in t && (t.type === h ? i = !0 : t.props && typeof t.props == "object" && t.props !== null && "children" in t.props && e(t.props.children));
|
|
14
|
+
};
|
|
15
|
+
return e(m), i;
|
|
16
|
+
})(l) ? "nonExistsAlertTitle" : "existsAlertTitle", f = `arkynAlertContainer ${o} ${p} ${a}`;
|
|
17
|
+
return /* @__PURE__ */ n(s.Provider, { value: r, children: /* @__PURE__ */ n("div", { className: f.trim(), ...c, children: l }) });
|
|
25
18
|
}
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
export {
|
|
20
|
+
v as AlertContainer,
|
|
21
|
+
j as useAlertContainer
|
|
22
|
+
};
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return /* @__PURE__ */ e("div", {
|
|
7
|
-
className: `arkynAlertContent ${n}`.trim(),
|
|
8
|
-
...r
|
|
9
|
-
});
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
3
|
+
function m(t) {
|
|
4
|
+
const { className: s, ...e } = t, r = `arkynAlertContent ${s}`;
|
|
5
|
+
return /* @__PURE__ */ a("div", { className: r.trim(), ...e });
|
|
10
6
|
}
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
export {
|
|
8
|
+
m as AlertContent
|
|
9
|
+
};
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return /* @__PURE__ */ e("div", {
|
|
7
|
-
className: `arkynAlertDescription ${n}`.trim(),
|
|
8
|
-
...r
|
|
9
|
-
});
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
3
|
+
function c(s) {
|
|
4
|
+
const { className: r, ...t } = s, e = `arkynAlertDescription ${r}`;
|
|
5
|
+
return /* @__PURE__ */ a("div", { className: e.trim(), ...t });
|
|
10
6
|
}
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
export {
|
|
8
|
+
c as AlertDescription
|
|
9
|
+
};
|
|
@@ -1,28 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
case "warning": return /* @__PURE__ */ t(n, {
|
|
18
|
-
className: u,
|
|
19
|
-
...c
|
|
20
|
-
});
|
|
21
|
-
case "info": return /* @__PURE__ */ t(i, {
|
|
22
|
-
className: u,
|
|
23
|
-
...c
|
|
24
|
-
});
|
|
25
|
-
}
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { Info as a, AlertTriangle as o, XCircle as i, CheckCircle2 as m } from "lucide-react";
|
|
3
|
+
import { useAlertContainer as l } from "../alertContainer/index.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
function A(t) {
|
|
6
|
+
const { className: c, ...r } = t, { schema: n } = l(), e = `arkynAlertIcon ${n} ${c}`;
|
|
7
|
+
switch (n) {
|
|
8
|
+
case "success":
|
|
9
|
+
return /* @__PURE__ */ s(m, { className: e, ...r });
|
|
10
|
+
case "danger":
|
|
11
|
+
return /* @__PURE__ */ s(i, { className: e, ...r });
|
|
12
|
+
case "warning":
|
|
13
|
+
return /* @__PURE__ */ s(o, { className: e, ...r });
|
|
14
|
+
case "info":
|
|
15
|
+
return /* @__PURE__ */ s(a, { className: e, ...r });
|
|
16
|
+
}
|
|
26
17
|
}
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
export {
|
|
19
|
+
A as AlertIcon
|
|
20
|
+
};
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return /* @__PURE__ */ e("div", {
|
|
7
|
-
className: `arkynAlertTitle ${n}`.trim(),
|
|
8
|
-
...r
|
|
9
|
-
});
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
3
|
+
function i(s) {
|
|
4
|
+
const { className: t, ...e } = s, r = `arkynAlertTitle ${t}`;
|
|
5
|
+
return /* @__PURE__ */ a("div", { className: r.trim(), ...e });
|
|
10
6
|
}
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
export {
|
|
8
|
+
i as AlertTitle
|
|
9
|
+
};
|
|
@@ -1,75 +1,76 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
1
|
+
import { jsxs as E, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Pause as R, Play as V } from "lucide-react";
|
|
3
|
+
import { useState as v, useRef as $, useEffect as N } from "react";
|
|
4
|
+
import { useSlider as U } from "../../hooks/useSlider.js";
|
|
5
|
+
import { Slider as q } from "../slider/index.js";
|
|
6
|
+
/* empty css */
|
|
7
|
+
function O(r) {
|
|
8
|
+
var h, A, S, p;
|
|
9
|
+
const { onPlayAudio: w, onPauseAudio: z, disabled: c, style: C, ...b } = r, [x, D] = U(0), [i, d] = v(!1), [I, M] = v(!1), t = $(null), l = ((h = t.current) == null ? void 0 : h.currentTime) || 0, m = ((A = t.current) == null ? void 0 : A.duration) || 0, f = y(l), g = y(m), T = {
|
|
10
|
+
totalTime: m,
|
|
11
|
+
currentTime: l,
|
|
12
|
+
formattedCurrentTime: f,
|
|
13
|
+
formattedTotalTime: g
|
|
14
|
+
};
|
|
15
|
+
function y(e) {
|
|
16
|
+
if (!e) return "00:00";
|
|
17
|
+
const n = Math.floor(e / 60), u = Math.floor(e % 60), a = String(n).padStart(2, "0"), s = String(u).padStart(2, "0");
|
|
18
|
+
return `${a}:${s}`;
|
|
19
|
+
}
|
|
20
|
+
function j() {
|
|
21
|
+
const e = t.current;
|
|
22
|
+
e && (r.onPlayAudio && r.onPlayAudio(T), e.play(), d(!0));
|
|
23
|
+
}
|
|
24
|
+
function P() {
|
|
25
|
+
const e = t.current;
|
|
26
|
+
e && (r.onPauseAudio && r.onPauseAudio(T), e.pause(), d(!1));
|
|
27
|
+
}
|
|
28
|
+
function k() {
|
|
29
|
+
i ? P() : j();
|
|
30
|
+
}
|
|
31
|
+
function L(e) {
|
|
32
|
+
const n = t.current;
|
|
33
|
+
if (!n) return;
|
|
34
|
+
const u = n.duration, a = e / 100 * u;
|
|
35
|
+
n.currentTime = a;
|
|
36
|
+
}
|
|
37
|
+
return I || !i ? (S = t.current) == null || S.pause() : i && ((p = t.current) == null || p.play()), N(() => {
|
|
38
|
+
const e = t.current;
|
|
39
|
+
if (!e) return;
|
|
40
|
+
const n = () => {
|
|
41
|
+
const u = e.duration, s = e.currentTime / u * 100;
|
|
42
|
+
D(s);
|
|
43
|
+
};
|
|
44
|
+
return e.addEventListener("timeupdate", n), () => {
|
|
45
|
+
e.removeEventListener("timeupdate", n);
|
|
46
|
+
};
|
|
47
|
+
}, []), /* @__PURE__ */ E("div", { className: "arkynAudioPlayer", style: C, children: [
|
|
48
|
+
/* @__PURE__ */ o(
|
|
49
|
+
"audio",
|
|
50
|
+
{
|
|
51
|
+
...b,
|
|
52
|
+
ref: t,
|
|
53
|
+
src: r.src,
|
|
54
|
+
onEnded: P
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ E("button", { type: "button", disabled: c, onClick: k, children: [
|
|
58
|
+
i && /* @__PURE__ */ o(R, {}),
|
|
59
|
+
!i && /* @__PURE__ */ o(V, {})
|
|
60
|
+
] }),
|
|
61
|
+
/* @__PURE__ */ o("p", { children: f }),
|
|
62
|
+
/* @__PURE__ */ o(
|
|
63
|
+
q,
|
|
64
|
+
{
|
|
65
|
+
value: x,
|
|
66
|
+
onChange: L,
|
|
67
|
+
onDragging: M,
|
|
68
|
+
disabled: c
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ o("p", { children: g })
|
|
72
|
+
] });
|
|
73
73
|
}
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
export {
|
|
75
|
+
O as AudioPlayer
|
|
76
|
+
};
|
|
@@ -1,55 +1,63 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { RefreshCw as h } from "lucide-react";
|
|
3
|
+
import { AudioPlayer as C } from "../../audioPlayer/index.js";
|
|
4
|
+
import { Button as g } from "../../button/index.js";
|
|
5
|
+
import { Divider as k } from "../../divider/index.js";
|
|
6
|
+
import { IconButton as v } from "../../iconButton/index.js";
|
|
7
|
+
import { Tooltip as y } from "../../tooltip/index.js";
|
|
8
|
+
/* empty css */
|
|
9
|
+
function N(c) {
|
|
10
|
+
const {
|
|
11
|
+
filePath: s,
|
|
12
|
+
disabled: i,
|
|
13
|
+
acceptAudio: d,
|
|
14
|
+
handleSelectFile: m,
|
|
15
|
+
isLoading: o,
|
|
16
|
+
reSendAudio: n,
|
|
17
|
+
changeAudioButtonText: u
|
|
18
|
+
} = c;
|
|
19
|
+
function p() {
|
|
20
|
+
if (i) return;
|
|
21
|
+
const t = document.createElement("input");
|
|
22
|
+
t.type = "file", t.accept = d, t.onchange = (f) => {
|
|
23
|
+
var a;
|
|
24
|
+
const r = (a = f.target.files) == null ? void 0 : a[0];
|
|
25
|
+
r && m(r);
|
|
26
|
+
}, t.click();
|
|
27
|
+
}
|
|
28
|
+
return /* @__PURE__ */ l("div", { className: "arkynAudioUploadHasFileContentContainer", children: [
|
|
29
|
+
/* @__PURE__ */ e(C, { src: s }),
|
|
30
|
+
/* @__PURE__ */ e(k, {}),
|
|
31
|
+
/* @__PURE__ */ l("div", { className: "arkynAudioUploadButtonsContainer", children: [
|
|
32
|
+
!!n && /* @__PURE__ */ e(y, { orientation: "bottom", text: "Reenviar áudio", children: /* @__PURE__ */ e(
|
|
33
|
+
v,
|
|
34
|
+
{
|
|
35
|
+
type: "button",
|
|
36
|
+
"aria-label": "resend image",
|
|
37
|
+
variant: "outline",
|
|
38
|
+
scheme: "danger",
|
|
39
|
+
size: "sm",
|
|
40
|
+
isLoading: o,
|
|
41
|
+
onClick: n,
|
|
42
|
+
icon: h,
|
|
43
|
+
disabled: i
|
|
44
|
+
}
|
|
45
|
+
) }),
|
|
46
|
+
/* @__PURE__ */ e(
|
|
47
|
+
g,
|
|
48
|
+
{
|
|
49
|
+
isLoading: o,
|
|
50
|
+
onClick: p,
|
|
51
|
+
variant: "outline",
|
|
52
|
+
size: "sm",
|
|
53
|
+
type: "button",
|
|
54
|
+
disabled: i,
|
|
55
|
+
children: u
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
] })
|
|
59
|
+
] });
|
|
53
60
|
}
|
|
54
|
-
|
|
55
|
-
|
|
61
|
+
export {
|
|
62
|
+
N as HasFileContent
|
|
63
|
+
};
|
|
@@ -1,72 +1,80 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
1
|
+
import { jsxs as x, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as r } from "react";
|
|
3
|
+
import { useForm as P } from "../../hooks/useForm.js";
|
|
4
|
+
import { FieldError as R } from "../fieldError/index.js";
|
|
5
|
+
import { FieldLabel as k } from "../fieldLabel/index.js";
|
|
6
|
+
import { FieldWrapper as B } from "../fieldWrapper/index.js";
|
|
7
|
+
import { HasFileContent as D } from "./hasFileContent/index.js";
|
|
8
|
+
import { NoFileContent as V } from "./noFileContent/index.js";
|
|
9
|
+
/* empty css */
|
|
10
|
+
function oo(y) {
|
|
11
|
+
const {
|
|
12
|
+
name: u,
|
|
13
|
+
label: c,
|
|
14
|
+
fileName: C = "file",
|
|
15
|
+
method: E = "POST",
|
|
16
|
+
onChange: s,
|
|
17
|
+
fileResponseName: m = "url",
|
|
18
|
+
selectAudioButtonText: q = "Selecionar arquivo de áudio",
|
|
19
|
+
dropAudioText: b = "Ou arraste e solte um arquivo de áudio aqui",
|
|
20
|
+
changeAudioButtonText: L = "Trocar arquivo de áudio",
|
|
21
|
+
acceptAudio: f = "audio/*",
|
|
22
|
+
action: O,
|
|
23
|
+
defaultValue: h = "",
|
|
24
|
+
showAsterisk: S = !1,
|
|
25
|
+
disabled: t = !1
|
|
26
|
+
} = y, { fieldErrors: n } = P(), T = n == null ? void 0 : n[u], [U, j] = r(h), [w, i] = r(""), [A, H] = r(null), [l, I] = r(h), [v, F] = r(!1);
|
|
27
|
+
async function N(a) {
|
|
28
|
+
if (t) return;
|
|
29
|
+
F(!0), H(a), i("");
|
|
30
|
+
const g = new FormData();
|
|
31
|
+
g.append(C, a), await fetch(O, { method: E, body: g }).then(async (o) => await o.json()).then((o) => {
|
|
32
|
+
o != null && o.error ? i(o.error) : j(o == null ? void 0 : o[m]), s && s(o == null ? void 0 : o[m]);
|
|
33
|
+
}).catch((o) => {
|
|
34
|
+
console.error(o), i("Erro ao enviar audio");
|
|
35
|
+
}).finally(() => F(!1));
|
|
36
|
+
}
|
|
37
|
+
function p(a) {
|
|
38
|
+
if (!t) {
|
|
39
|
+
if (a.type.indexOf("audio") === -1) {
|
|
40
|
+
i("O arquivo selecionado não é um arquivo de áudio");
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
I(URL.createObjectURL(a)), N(a);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const d = T || w;
|
|
47
|
+
return /* @__PURE__ */ x(B, { children: [
|
|
48
|
+
c && /* @__PURE__ */ e(k, { showAsterisk: S, children: c }),
|
|
49
|
+
/* @__PURE__ */ x("div", { className: `arkynAudioUpload ${d ? "hasError" : "noHasError"} ${l ? "hasAudio" : "noHasAudio"}`, children: [
|
|
50
|
+
/* @__PURE__ */ e("input", { type: "hidden", name: u, value: U || "" }),
|
|
51
|
+
!l && /* @__PURE__ */ e(
|
|
52
|
+
V,
|
|
53
|
+
{
|
|
54
|
+
disabled: t,
|
|
55
|
+
isLoading: v,
|
|
56
|
+
acceptAudio: f,
|
|
57
|
+
dropAudioText: b,
|
|
58
|
+
handleSelectFile: p,
|
|
59
|
+
selectAudioButtonText: q
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
l && /* @__PURE__ */ e(
|
|
63
|
+
D,
|
|
64
|
+
{
|
|
65
|
+
filePath: l,
|
|
66
|
+
acceptAudio: f,
|
|
67
|
+
changeAudioButtonText: L,
|
|
68
|
+
disabled: t,
|
|
69
|
+
handleSelectFile: p,
|
|
70
|
+
isLoading: v,
|
|
71
|
+
reSendAudio: d && A ? () => N(A) : void 0
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
] }),
|
|
75
|
+
d && /* @__PURE__ */ e(R, { children: d })
|
|
76
|
+
] });
|
|
70
77
|
}
|
|
71
|
-
|
|
72
|
-
|
|
78
|
+
export {
|
|
79
|
+
oo as AudioUpload
|
|
80
|
+
};
|