@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,73 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
className: "arkynElementVideo",
|
|
57
|
-
src: i?.src || "",
|
|
58
|
-
title: "YouTube video player",
|
|
59
|
-
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
|
|
60
|
-
referrerPolicy: "strict-origin-when-cross-origin",
|
|
61
|
-
allowFullScreen: !0
|
|
62
|
-
}), r]
|
|
63
|
-
});
|
|
64
|
-
default: return /* @__PURE__ */ e("p", {
|
|
65
|
-
className: "arkynElementParagraph",
|
|
66
|
-
style: a,
|
|
67
|
-
...n,
|
|
68
|
-
children: r
|
|
69
|
-
});
|
|
70
|
-
}
|
|
1
|
+
import { jsx as s, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
/* empty css */
|
|
3
|
+
function i({ attributes: e, children: a, element: c }) {
|
|
4
|
+
const r = { textAlign: c.align };
|
|
5
|
+
switch (c.type) {
|
|
6
|
+
case "blockQuote":
|
|
7
|
+
return /* @__PURE__ */ s(
|
|
8
|
+
"blockquote",
|
|
9
|
+
{
|
|
10
|
+
className: "arkynElementBlockquote",
|
|
11
|
+
style: r,
|
|
12
|
+
...e,
|
|
13
|
+
children: a
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
case "bulletedList":
|
|
17
|
+
return /* @__PURE__ */ s("ul", { className: "arkynElementBulletList", style: r, ...e, children: a });
|
|
18
|
+
case "headingOne":
|
|
19
|
+
return /* @__PURE__ */ s("h1", { className: "arkynElementHeadingOne", style: r, ...e, children: a });
|
|
20
|
+
case "headingTwo":
|
|
21
|
+
return /* @__PURE__ */ s("h2", { className: "arkynElementHeadingTwo", style: r, ...e, children: a });
|
|
22
|
+
case "listItem":
|
|
23
|
+
return /* @__PURE__ */ s("li", { className: "arkynElementListItem", style: r, ...e, children: a });
|
|
24
|
+
case "numberedList":
|
|
25
|
+
return /* @__PURE__ */ s("ol", { className: "arkynElementNumberedList", style: r, ...e, children: a });
|
|
26
|
+
case "image":
|
|
27
|
+
return /* @__PURE__ */ l("div", { style: r, ...e, children: [
|
|
28
|
+
/* @__PURE__ */ s(
|
|
29
|
+
"img",
|
|
30
|
+
{
|
|
31
|
+
className: "arkynElementImage",
|
|
32
|
+
alt: "arkynElementImage",
|
|
33
|
+
src: (c == null ? void 0 : c.src) || ""
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
a
|
|
37
|
+
] });
|
|
38
|
+
case "video":
|
|
39
|
+
return /* @__PURE__ */ l("div", { style: r, ...e, children: [
|
|
40
|
+
/* @__PURE__ */ s(
|
|
41
|
+
"iframe",
|
|
42
|
+
{
|
|
43
|
+
className: "arkynElementVideo",
|
|
44
|
+
src: (c == null ? void 0 : c.src) || "",
|
|
45
|
+
title: "YouTube video player",
|
|
46
|
+
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
|
|
47
|
+
referrerPolicy: "strict-origin-when-cross-origin",
|
|
48
|
+
allowFullScreen: !0
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
a
|
|
52
|
+
] });
|
|
53
|
+
default:
|
|
54
|
+
return /* @__PURE__ */ s("p", { className: "arkynElementParagraph", style: r, ...e, children: a });
|
|
55
|
+
}
|
|
71
56
|
}
|
|
72
|
-
|
|
73
|
-
|
|
57
|
+
export {
|
|
58
|
+
i as Element
|
|
59
|
+
};
|
|
@@ -1,144 +1,136 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}),
|
|
134
|
-
/* @__PURE__ */ h("input", {
|
|
135
|
-
type: "hidden",
|
|
136
|
-
name: `${A}Count`,
|
|
137
|
-
value: q
|
|
138
|
-
})
|
|
139
|
-
]
|
|
140
|
-
})
|
|
141
|
-
});
|
|
1
|
+
import { jsx as e, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import Y from "is-hotkey";
|
|
3
|
+
import { Heading1 as Z, Heading2 as _, Quote as ee, Bold as re, Italic as te, Underline as oe, Code as ne, AlignLeft as ie, AlignRight as se, AlignCenter as ae, AlignJustify as ce } from "lucide-react";
|
|
4
|
+
import { useMemo as le, useState as g, useRef as me, useId as fe, useCallback as F } from "react";
|
|
5
|
+
import { createEditor as ue, Transforms as de } from "slate";
|
|
6
|
+
import { withHistory as he } from "slate-history";
|
|
7
|
+
import { withReact as pe, Slate as ge, Editable as Ce } from "slate-react";
|
|
8
|
+
import { BlockButton as n } from "./blockButton/index.js";
|
|
9
|
+
import { Element as ye } from "./element/index.js";
|
|
10
|
+
import { InsertImage as Ne } from "./insertImage/index.js";
|
|
11
|
+
import { InsertVideo as be } from "./insertVideo/index.js";
|
|
12
|
+
import { Leaf as ke } from "./leaf/index.js";
|
|
13
|
+
import { MarkButton as l } from "./markButton/index.js";
|
|
14
|
+
import { Toolbar as Te } from "./toolbar/index.js";
|
|
15
|
+
import { useForm as xe } from "../../hooks/useForm.js";
|
|
16
|
+
import { extractTextFromNode as I } from "../../services/extractTextFromNode.js";
|
|
17
|
+
import { FieldTemplate as Fe } from "../../services/fieldTemplate.js";
|
|
18
|
+
import { toggleMark as Ie } from "../../services/toggleMark.js";
|
|
19
|
+
import { hotKeys as V, initialValue as m } from "../../templates/richTextTemplates.js";
|
|
20
|
+
/* empty css */
|
|
21
|
+
function Ge(w) {
|
|
22
|
+
const {
|
|
23
|
+
name: s,
|
|
24
|
+
hiddenButtons: f,
|
|
25
|
+
imageConfig: C,
|
|
26
|
+
videoConfig: A,
|
|
27
|
+
className: E = "",
|
|
28
|
+
defaultValue: O = "[]",
|
|
29
|
+
enforceCharacterLimit: S = !1,
|
|
30
|
+
onChangeCharactersCount: y,
|
|
31
|
+
baseErrorMessage: j,
|
|
32
|
+
maxLimit: a = 1e4,
|
|
33
|
+
onChange: N,
|
|
34
|
+
isError: H,
|
|
35
|
+
label: L,
|
|
36
|
+
showAsterisk: M,
|
|
37
|
+
id: R,
|
|
38
|
+
orientation: v = "vertical",
|
|
39
|
+
unShowFieldTemplate: B = !1
|
|
40
|
+
} = w, c = le(() => he(pe(ue())), []), { fieldErrors: u } = xe();
|
|
41
|
+
function d() {
|
|
42
|
+
try {
|
|
43
|
+
const r = JSON.parse(O);
|
|
44
|
+
return Array.isArray(r) ? r.length <= 0 ? m : r.every(
|
|
45
|
+
(i) => typeof i == "object" && i !== null && "type" in i && "children" in i
|
|
46
|
+
) ? r : m : m;
|
|
47
|
+
} catch {
|
|
48
|
+
return m;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const J = I(d()), [h, D] = g(J.length), [Q, $] = g(
|
|
52
|
+
JSON.stringify(d()) || "[]"
|
|
53
|
+
), [K, b] = g(!1), U = me(null), q = R || fe(), k = j || (u == null ? void 0 : u[s]), z = H || !!k, G = F(ke, []), P = F(ye, []);
|
|
54
|
+
function T(r) {
|
|
55
|
+
const o = I(r);
|
|
56
|
+
D(o.length), y && y(o.length), !(S && o.length >= a) && ($(JSON.stringify(r)), N && N(r), c.children = r, de.setNodes(c, { children: r }));
|
|
57
|
+
}
|
|
58
|
+
const W = K ? "focusTrue" : "focusFalse", X = `arkynRichText ${z || a < h ? "errorTrue" : "errorFalse"} ${W}`, x = a - h;
|
|
59
|
+
function t(r) {
|
|
60
|
+
return !(f != null && f.includes(r));
|
|
61
|
+
}
|
|
62
|
+
return /* @__PURE__ */ e(
|
|
63
|
+
Fe,
|
|
64
|
+
{
|
|
65
|
+
name: s,
|
|
66
|
+
label: L,
|
|
67
|
+
showAsterisk: M,
|
|
68
|
+
className: E,
|
|
69
|
+
errorMessage: k,
|
|
70
|
+
unShowFieldTemplate: B,
|
|
71
|
+
orientation: v,
|
|
72
|
+
children: /* @__PURE__ */ p(
|
|
73
|
+
ge,
|
|
74
|
+
{
|
|
75
|
+
editor: c,
|
|
76
|
+
initialValue: d(),
|
|
77
|
+
onChange: T,
|
|
78
|
+
onValueChange: T,
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ p("div", { className: X, children: [
|
|
81
|
+
/* @__PURE__ */ p(Te, { children: [
|
|
82
|
+
t("headingOne") && /* @__PURE__ */ e(n, { format: "headingOne", icon: Z }),
|
|
83
|
+
t("headingTwo") && /* @__PURE__ */ e(n, { format: "headingTwo", icon: _ }),
|
|
84
|
+
t("blockQuote") && /* @__PURE__ */ e(n, { format: "blockQuote", icon: ee }),
|
|
85
|
+
t("bold") && /* @__PURE__ */ e(l, { format: "bold", icon: re }),
|
|
86
|
+
t("italic") && /* @__PURE__ */ e(l, { format: "italic", icon: te }),
|
|
87
|
+
t("underline") && /* @__PURE__ */ e(l, { format: "underline", icon: oe }),
|
|
88
|
+
t("code") && /* @__PURE__ */ e(l, { format: "code", icon: ne }),
|
|
89
|
+
t("left") && /* @__PURE__ */ e(n, { format: "left", icon: ie }),
|
|
90
|
+
t("right") && /* @__PURE__ */ e(n, { format: "right", icon: se }),
|
|
91
|
+
t("center") && /* @__PURE__ */ e(n, { format: "center", icon: ae }),
|
|
92
|
+
t("justify") && /* @__PURE__ */ e(n, { format: "justify", icon: ce }),
|
|
93
|
+
C && t("image") && /* @__PURE__ */ e(Ne, { ...C }),
|
|
94
|
+
t("video") && /* @__PURE__ */ e(be, { ...A })
|
|
95
|
+
] }),
|
|
96
|
+
/* @__PURE__ */ e(
|
|
97
|
+
Ce,
|
|
98
|
+
{
|
|
99
|
+
className: "editorContainer",
|
|
100
|
+
renderElement: P,
|
|
101
|
+
renderLeaf: G,
|
|
102
|
+
spellCheck: !0,
|
|
103
|
+
ref: U,
|
|
104
|
+
id: q,
|
|
105
|
+
onFocus: () => b(!0),
|
|
106
|
+
onBlur: () => b(!1),
|
|
107
|
+
onKeyDown: (r) => {
|
|
108
|
+
for (const o in V)
|
|
109
|
+
if (Y(o, r)) {
|
|
110
|
+
r.preventDefault();
|
|
111
|
+
const i = V[o];
|
|
112
|
+
Ie(c, i);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
),
|
|
117
|
+
x < 0 && /* @__PURE__ */ e("div", { className: "restatesCharacters", children: x })
|
|
118
|
+
] }),
|
|
119
|
+
/* @__PURE__ */ e(
|
|
120
|
+
"input",
|
|
121
|
+
{
|
|
122
|
+
type: "hidden",
|
|
123
|
+
name: s,
|
|
124
|
+
value: Q.slice(0, a)
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
/* @__PURE__ */ e("input", { type: "hidden", name: `${s}Count`, value: h })
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
)
|
|
131
|
+
}
|
|
132
|
+
);
|
|
142
133
|
}
|
|
143
|
-
|
|
144
|
-
|
|
134
|
+
export {
|
|
135
|
+
Ge as RichText
|
|
136
|
+
};
|
|
@@ -1,95 +1,106 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
1
|
+
import { jsxs as a, Fragment as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Image as T } from "lucide-react";
|
|
3
|
+
import { useState as l } from "react";
|
|
4
|
+
import { useSlate as U } from "slate-react";
|
|
5
|
+
import { Button as d } from "../../button/index.js";
|
|
6
|
+
import { ImageUpload as L } from "../../imageUpload/index.js";
|
|
7
|
+
import { Input as R } from "../../input/index.js";
|
|
8
|
+
import { ModalContainer as k } from "../../modal/modalContainer/index.js";
|
|
9
|
+
import { ModalFooter as M } from "../../modal/modalFooter/index.js";
|
|
10
|
+
import { ModalHeader as w } from "../../modal/modalHeader/index.js";
|
|
11
|
+
import { TabButton as c } from "../../tab/tabButton/index.js";
|
|
12
|
+
import { TabContainer as V } from "../../tab/tabContainer/index.js";
|
|
13
|
+
/* empty css */
|
|
14
|
+
function J(u) {
|
|
15
|
+
const {
|
|
16
|
+
action: p,
|
|
17
|
+
tabLabels: i = ["Adicionar URL", "Upload de arquivo"],
|
|
18
|
+
modalCancelButton: h = "Cancelar",
|
|
19
|
+
modalConfirmButton: f = "Confirmar",
|
|
20
|
+
modalInputImageLabel: g = "Imagem:",
|
|
21
|
+
modalInputUrlLabel: I = "URL da imagem:",
|
|
22
|
+
modalTitle: b = "Inserir imagem"
|
|
23
|
+
} = u, x = U(), [y, o] = l(!1), [t, m] = l(""), [n, C] = l("url");
|
|
24
|
+
function v(r) {
|
|
25
|
+
r.preventDefault(), !(!t || t === "") && (x.insertNodes([
|
|
26
|
+
{ type: "paragraph", children: [{ text: "" }] },
|
|
27
|
+
{ type: "image", src: t, children: [{ text: "" }] },
|
|
28
|
+
{ type: "paragraph", children: [{ text: "" }] }
|
|
29
|
+
]), o(!1));
|
|
30
|
+
}
|
|
31
|
+
return /* @__PURE__ */ a(s, { children: [
|
|
32
|
+
/* @__PURE__ */ e(
|
|
33
|
+
"button",
|
|
34
|
+
{
|
|
35
|
+
type: "button",
|
|
36
|
+
className: "arkynRichTextInsertImage",
|
|
37
|
+
onMouseDown: () => o(!0),
|
|
38
|
+
children: /* @__PURE__ */ e(T, {})
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
/* @__PURE__ */ a(
|
|
42
|
+
k,
|
|
43
|
+
{
|
|
44
|
+
isVisible: y,
|
|
45
|
+
makeInvisible: () => o(!1),
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ e(w, { children: b }),
|
|
48
|
+
/* @__PURE__ */ a("div", { className: "arkynRichTextInsertImageModalContent", children: [
|
|
49
|
+
/* @__PURE__ */ a(V, { defaultValue: n, onChange: C, children: [
|
|
50
|
+
/* @__PURE__ */ e(c, { value: "url", children: i[0] }),
|
|
51
|
+
/* @__PURE__ */ e(c, { value: "file", children: i[1] })
|
|
52
|
+
] }),
|
|
53
|
+
n === "url" && /* @__PURE__ */ a(s, { children: [
|
|
54
|
+
/* @__PURE__ */ e(
|
|
55
|
+
R,
|
|
56
|
+
{
|
|
57
|
+
type: "text",
|
|
58
|
+
name: "richTextImageURL",
|
|
59
|
+
label: I,
|
|
60
|
+
showAsterisk: !0,
|
|
61
|
+
defaultValue: t,
|
|
62
|
+
onChange: (r) => m(r.target.value)
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
t && /* @__PURE__ */ e(
|
|
66
|
+
"img",
|
|
67
|
+
{
|
|
68
|
+
className: "arkynRichTextInsertImageModalPreviewImage",
|
|
69
|
+
src: t,
|
|
70
|
+
alt: "preview"
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
] }),
|
|
74
|
+
n === "file" && /* @__PURE__ */ e(
|
|
75
|
+
L,
|
|
76
|
+
{
|
|
77
|
+
name: "richTextImageURL",
|
|
78
|
+
action: p,
|
|
79
|
+
label: g,
|
|
80
|
+
showAsterisk: !0,
|
|
81
|
+
defaultValue: t,
|
|
82
|
+
onChange: (r) => m(r)
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
] }),
|
|
86
|
+
/* @__PURE__ */ a(M, { children: [
|
|
87
|
+
/* @__PURE__ */ e(
|
|
88
|
+
d,
|
|
89
|
+
{
|
|
90
|
+
type: "button",
|
|
91
|
+
scheme: "danger",
|
|
92
|
+
variant: "outline",
|
|
93
|
+
onClick: () => o(!1),
|
|
94
|
+
children: h
|
|
95
|
+
}
|
|
96
|
+
),
|
|
97
|
+
/* @__PURE__ */ e(d, { type: "button", onClick: v, children: f })
|
|
98
|
+
] })
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
] });
|
|
93
103
|
}
|
|
94
|
-
|
|
95
|
-
|
|
104
|
+
export {
|
|
105
|
+
J as InsertImage
|
|
106
|
+
};
|