@arkyn/components 3.0.1-beta.156 → 3.0.1-beta.158
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 +4347 -4683
- package/dist/modules/components/alert/alertContainer/index.js +25 -20
- package/dist/modules/components/alert/alertContent/index.js +11 -8
- package/dist/modules/components/alert/alertDescription/index.js +11 -8
- package/dist/modules/components/alert/alertIcon/index.js +27 -19
- package/dist/modules/components/alert/alertTitle/index.js +11 -8
- package/dist/modules/components/audioPlayer/index.js +74 -75
- package/dist/modules/components/audioUpload/hasFileContent/index.js +54 -62
- package/dist/modules/components/audioUpload/index.js +71 -79
- package/dist/modules/components/audioUpload/noFileContent/index.js +35 -45
- package/dist/modules/components/badge/index.js +26 -22
- package/dist/modules/components/button/index.js +39 -32
- package/dist/modules/components/calendar/_calendarProvider.js +38 -63
- package/dist/modules/components/calendar/_viewService.js +132 -140
- package/dist/modules/components/calendar/calendarContainer/index.js +10 -7
- package/dist/modules/components/calendar/calendarHeader/index.js +51 -72
- package/dist/modules/components/calendar/calendarTableBody/index.js +12 -10
- package/dist/modules/components/calendar/calendarTableContainer/index.js +10 -7
- package/dist/modules/components/calendar/calendarTableHeader/index.js +13 -10
- package/dist/modules/components/calendar/calendarTableTd/index.js +20 -23
- package/dist/modules/components/calendar/index.js +31 -49
- package/dist/modules/components/cardTab/cardTabButton/index.js +19 -29
- package/dist/modules/components/cardTab/cardTabContainer/index.js +22 -28
- package/dist/modules/components/cardTab/cardTabContext.js +13 -11
- package/dist/modules/components/checkbox/index.js +37 -64
- package/dist/modules/components/clientOnly.js +8 -8
- package/dist/modules/components/currencyInput/index.js +110 -138
- package/dist/modules/components/divider/index.js +10 -11
- package/dist/modules/components/drawer/drawerContainer/index.js +40 -43
- package/dist/modules/components/drawer/drawerContext.js +13 -11
- package/dist/modules/components/drawer/drawerHeader/index.js +20 -27
- package/dist/modules/components/facebookPixel/facebookPixel.client.js +8 -18
- package/dist/modules/components/facebookPixel/index.js +8 -8
- package/dist/modules/components/facebookPixel/pixel.js +47 -52
- package/dist/modules/components/fieldError/index.js +12 -8
- package/dist/modules/components/fieldLabel/index.js +11 -12
- package/dist/modules/components/fieldWrapper/index.js +12 -13
- package/dist/modules/components/fileUpload/hasFileContent/index.js +59 -67
- package/dist/modules/components/fileUpload/index.js +65 -72
- package/dist/modules/components/fileUpload/noFileContent/index.js +35 -45
- package/dist/modules/components/fullCalendar/_fullCalendarProvider.js +33 -46
- package/dist/modules/components/fullCalendar/_viewService.js +100 -105
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarContainer/index.js +10 -7
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarEvent/index.js +70 -78
- package/dist/modules/components/fullCalendar/dayCalendar/dayCalendarRow/index.js +28 -33
- package/dist/modules/components/fullCalendar/dayCalendar/index.js +12 -9
- package/dist/modules/components/fullCalendar/fullCalendarContainer/index.js +10 -7
- package/dist/modules/components/fullCalendar/fullCalendarHeader/index.js +67 -70
- package/dist/modules/components/fullCalendar/index.js +30 -30
- package/dist/modules/components/fullCalendar/monthlyCalendar/index.js +9 -12
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarEvent/index.js +28 -36
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableBody/index.js +11 -9
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableContainer/index.js +10 -9
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableHeader/index.js +13 -10
- package/dist/modules/components/fullCalendar/monthlyCalendar/monthlyCalendarTableTd/index.js +35 -36
- package/dist/modules/components/fullCalendar/weekCalendar/index.js +8 -11
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarEvent/index.js +70 -78
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableBody/index.js +17 -20
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableContainer/index.js +9 -8
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableHeader/index.js +16 -19
- package/dist/modules/components/fullCalendar/weekCalendar/weekCalendarTableTd/index.js +34 -39
- 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 +10 -12
- package/dist/modules/components/googleTagManager/googleTagManager.client.js +6 -6
- package/dist/modules/components/googleTagManager/googleTagManager.js +44 -48
- package/dist/modules/components/googleTagManager/index.js +16 -27
- package/dist/modules/components/googleTagManager/snippets/appendToDataLayer.js +8 -8
- package/dist/modules/components/googleTagManager/snippets/generateGTMElements.js +19 -20
- package/dist/modules/components/iconButton/index.js +31 -29
- package/dist/modules/components/imageUpload/hasFileContent/index.js +46 -63
- package/dist/modules/components/imageUpload/index.js +65 -82
- package/dist/modules/components/imageUpload/noFileContent/index.js +35 -45
- package/dist/modules/components/input/index.js +92 -120
- package/dist/modules/components/mapView/index.js +27 -31
- package/dist/modules/components/mapView/mapView.client.js +49 -51
- package/dist/modules/components/maskedInput/index.js +101 -112
- package/dist/modules/components/modal/modalContainer/index.js +49 -42
- package/dist/modules/components/modal/modalContext.js +13 -11
- package/dist/modules/components/modal/modalFooter/index.js +10 -7
- package/dist/modules/components/modal/modalHeader/index.js +20 -27
- package/dist/modules/components/multiSelect/index.js +115 -154
- package/dist/modules/components/multiSelect/multiSelectChevron/index.js +18 -21
- package/dist/modules/components/multiSelect/multiSelectContainer/index.js +13 -29
- package/dist/modules/components/multiSelect/multiSelectContent/index.js +11 -8
- package/dist/modules/components/multiSelect/multiSelectMark/index.js +19 -22
- package/dist/modules/components/multiSelect/multiSelectOption/index.js +17 -13
- package/dist/modules/components/multiSelect/multiSelectOptionsContainer/index.js +35 -45
- package/dist/modules/components/multiSelect/multiSelectOverlay/index.js +11 -8
- package/dist/modules/components/multiSelect/multiSelectSpinner/index.js +13 -16
- package/dist/modules/components/pagination/chevronButton/index.js +17 -17
- package/dist/modules/components/pagination/currentButton/index.js +11 -7
- package/dist/modules/components/pagination/index.js +51 -83
- package/dist/modules/components/pagination/pageButton/index.js +12 -8
- package/dist/modules/components/pagination/paginationService.js +33 -48
- package/dist/modules/components/pagination/spread/index.js +10 -7
- package/dist/modules/components/phoneInput/index.js +103 -151
- package/dist/modules/components/phoneInput/phoneInputContainer/index.js +12 -19
- package/dist/modules/components/phoneInput/phoneInputCountriesOverlay/index.js +11 -8
- package/dist/modules/components/phoneInput/phoneInputCountryOption/index.js +23 -15
- package/dist/modules/components/phoneInput/phoneInputCountryOptionsContainer/index.js +33 -43
- package/dist/modules/components/phoneInput/phoneInputCountrySelector/index.js +25 -21
- package/dist/modules/components/phoneInput/phoneInputMask/index.js +46 -62
- package/dist/modules/components/popover/index.js +37 -36
- package/dist/modules/components/radio/radioBox/index.js +24 -42
- package/dist/modules/components/radio/radioContext.js +20 -18
- package/dist/modules/components/radio/radioGroup/index.js +41 -64
- package/dist/modules/components/richText/blockButton/index.js +20 -23
- package/dist/modules/components/richText/element/index.js +72 -58
- package/dist/modules/components/richText/index.js +143 -135
- package/dist/modules/components/richText/insertImage/index.js +94 -105
- package/dist/modules/components/richText/insertVideo/index.js +85 -97
- package/dist/modules/components/richText/leaf/index.js +9 -6
- package/dist/modules/components/richText/markButton/index.js +19 -22
- package/dist/modules/components/richText/toolbar/index.js +10 -7
- package/dist/modules/components/searchPlaces.js +57 -66
- package/dist/modules/components/select/index.js +112 -144
- package/dist/modules/components/select/selectChevron/index.js +18 -21
- package/dist/modules/components/select/selectContainer/index.js +13 -29
- package/dist/modules/components/select/selectContent/index.js +11 -8
- package/dist/modules/components/select/selectOption/index.js +17 -13
- package/dist/modules/components/select/selectOptionsContainer/index.js +35 -45
- package/dist/modules/components/select/selectOverlay/index.js +11 -8
- package/dist/modules/components/select/selectSpinner/index.js +13 -9
- package/dist/modules/components/slider/index.js +34 -41
- package/dist/modules/components/switch/index.js +35 -62
- package/dist/modules/components/tab/tabButton/index.js +19 -29
- package/dist/modules/components/tab/tabContainer/index.js +22 -28
- package/dist/modules/components/tab/tabContext.js +12 -10
- package/dist/modules/components/table/tableBody/index.js +19 -14
- package/dist/modules/components/table/tableCaption/index.js +15 -8
- package/dist/modules/components/table/tableContainer/index.js +12 -8
- package/dist/modules/components/table/tableFooter/index.js +18 -11
- package/dist/modules/components/table/tableHeader/index.js +12 -11
- package/dist/modules/components/textarea/index.js +51 -69
- package/dist/modules/components/tooltip/index.js +34 -45
- package/dist/modules/hooks/useAutomation.js +35 -27
- package/dist/modules/hooks/useDrawer.js +17 -19
- package/dist/modules/hooks/useForm.js +6 -6
- package/dist/modules/hooks/useHydrated.js +7 -12
- package/dist/modules/hooks/useModal.js +17 -19
- package/dist/modules/hooks/useScopedParams.js +17 -17
- package/dist/modules/hooks/useScrollLock.js +19 -19
- package/dist/modules/hooks/useSearchAutomation.js +31 -14
- package/dist/modules/hooks/useSlider.js +13 -13
- package/dist/modules/hooks/useToast.js +8 -9
- package/dist/modules/index.js +72 -144
- package/dist/modules/providers/drawerProvider.js +35 -30
- package/dist/modules/providers/formProvider.js +11 -16
- package/dist/modules/providers/modalProvider.js +39 -33
- package/dist/modules/providers/placesProvider.js +16 -16
- package/dist/modules/providers/toastProvider.js +45 -51
- package/dist/modules/services/extractTextFromNode.js +6 -6
- package/dist/modules/services/fieldTemplate.js +22 -23
- package/dist/modules/services/iconRenderer.js +14 -7
- package/dist/modules/services/isBlockActive.js +12 -14
- package/dist/modules/services/isMarkActive.js +6 -6
- package/dist/modules/services/maskCurrencyValues.js +11 -12
- package/dist/modules/services/toHtml.js +6 -6
- package/dist/modules/services/toRichTextValue.js +7 -7
- package/dist/modules/services/toggleBlock.js +20 -19
- package/dist/modules/services/toggleMark.js +7 -7
- package/dist/modules/style.css +2 -1
- package/dist/modules/templates/badResponses.js +13 -13
- package/dist/modules/templates/richTextTemplates.js +17 -14
- package/dist/modules/templates/successResponses.js +9 -4
- package/dist/modules/utils/phoneInputUtilities.js +18 -28
- package/dist/modules/utils/richTextUtilities.js +88 -75
- package/dist/services/fieldTemplate.d.ts +1 -1
- package/dist/services/fieldTemplate.d.ts.map +1 -1
- package/dist/style.css +2 -1
- package/package.json +4 -4
- package/styles.d.ts +2 -0
|
@@ -1,59 +1,73 @@
|
|
|
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
|
-
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/richText/element/index.tsx
|
|
4
|
+
function n({ attributes: n, children: r, element: i }) {
|
|
5
|
+
let a = { textAlign: i.align };
|
|
6
|
+
switch (i.type) {
|
|
7
|
+
case "blockQuote": return /* @__PURE__ */ e("blockquote", {
|
|
8
|
+
className: "arkynElementBlockquote",
|
|
9
|
+
style: a,
|
|
10
|
+
...n,
|
|
11
|
+
children: r
|
|
12
|
+
});
|
|
13
|
+
case "bulletedList": return /* @__PURE__ */ e("ul", {
|
|
14
|
+
className: "arkynElementBulletList",
|
|
15
|
+
style: a,
|
|
16
|
+
...n,
|
|
17
|
+
children: r
|
|
18
|
+
});
|
|
19
|
+
case "headingOne": return /* @__PURE__ */ e("h1", {
|
|
20
|
+
className: "arkynElementHeadingOne",
|
|
21
|
+
style: a,
|
|
22
|
+
...n,
|
|
23
|
+
children: r
|
|
24
|
+
});
|
|
25
|
+
case "headingTwo": return /* @__PURE__ */ e("h2", {
|
|
26
|
+
className: "arkynElementHeadingTwo",
|
|
27
|
+
style: a,
|
|
28
|
+
...n,
|
|
29
|
+
children: r
|
|
30
|
+
});
|
|
31
|
+
case "listItem": return /* @__PURE__ */ e("li", {
|
|
32
|
+
className: "arkynElementListItem",
|
|
33
|
+
style: a,
|
|
34
|
+
...n,
|
|
35
|
+
children: r
|
|
36
|
+
});
|
|
37
|
+
case "numberedList": return /* @__PURE__ */ e("ol", {
|
|
38
|
+
className: "arkynElementNumberedList",
|
|
39
|
+
style: a,
|
|
40
|
+
...n,
|
|
41
|
+
children: r
|
|
42
|
+
});
|
|
43
|
+
case "image": return /* @__PURE__ */ t("div", {
|
|
44
|
+
style: a,
|
|
45
|
+
...n,
|
|
46
|
+
children: [/* @__PURE__ */ e("img", {
|
|
47
|
+
className: "arkynElementImage",
|
|
48
|
+
alt: "arkynElementImage",
|
|
49
|
+
src: i?.src || ""
|
|
50
|
+
}), r]
|
|
51
|
+
});
|
|
52
|
+
case "video": return /* @__PURE__ */ t("div", {
|
|
53
|
+
style: a,
|
|
54
|
+
...n,
|
|
55
|
+
children: [/* @__PURE__ */ e("iframe", {
|
|
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
|
+
}
|
|
56
71
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
};
|
|
72
|
+
//#endregion
|
|
73
|
+
export { n as Element };
|
|
@@ -1,136 +1,144 @@
|
|
|
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
|
-
|
|
1
|
+
import { useForm as e } from "../../hooks/useForm.js";
|
|
2
|
+
import { FieldTemplate as t } from "../../services/fieldTemplate.js";
|
|
3
|
+
import { hotKeys as n, initialValue as r } from "../../templates/richTextTemplates.js";
|
|
4
|
+
import { BlockButton as i } from "./blockButton/index.js";
|
|
5
|
+
import { Element as ee } from "./element/index.js";
|
|
6
|
+
import { InsertImage as a } from "./insertImage/index.js";
|
|
7
|
+
import { InsertVideo as o } from "./insertVideo/index.js";
|
|
8
|
+
import { Leaf as te } from "./leaf/index.js";
|
|
9
|
+
import { toggleMark as ne } from "../../services/toggleMark.js";
|
|
10
|
+
import { MarkButton as s } from "./markButton/index.js";
|
|
11
|
+
import { Toolbar as c } from "./toolbar/index.js";
|
|
12
|
+
import { extractTextFromNode as l } from "../../services/extractTextFromNode.js";
|
|
13
|
+
/* empty css */
|
|
14
|
+
import { useCallback as u, useId as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
15
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
16
|
+
import { AlignCenter as re, AlignJustify as ie, AlignLeft as ae, AlignRight as oe, Bold as se, Code as ce, Heading1 as _, Heading2 as v, Italic as y, Quote as b, Underline as x } from "lucide-react";
|
|
17
|
+
import S from "is-hotkey";
|
|
18
|
+
import { Transforms as C, createEditor as w } from "slate";
|
|
19
|
+
import { withHistory as T } from "slate-history";
|
|
20
|
+
import { Editable as E, Slate as D, withReact as O } from "slate-react";
|
|
21
|
+
//#region src/components/richText/index.tsx
|
|
22
|
+
function k(k) {
|
|
23
|
+
let { name: A, hiddenButtons: j, imageConfig: M, videoConfig: N, className: P = "", defaultValue: F = "[]", enforceCharacterLimit: I = !1, onChangeCharactersCount: L, baseErrorMessage: R, maxLimit: z = 1e4, onChange: B, isError: le, label: V, showAsterisk: H, id: U, orientation: W = "vertical", unShowFieldTemplate: ue = !1 } = k, G = f(() => T(O(w())), []), { fieldErrors: de } = e();
|
|
24
|
+
function K() {
|
|
25
|
+
try {
|
|
26
|
+
let e = JSON.parse(F);
|
|
27
|
+
return !Array.isArray(e) || e.length <= 0 ? r : e.every((e) => typeof e == "object" && !!e && "type" in e && "children" in e) ? e : r;
|
|
28
|
+
} catch {
|
|
29
|
+
return r;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
let [q, fe] = m(l(K()).length), [pe, me] = m(JSON.stringify(K()) || "[]"), [he, J] = m(!1), ge = p(null), _e = U || d(), Y = R || de?.[A], ve = le || !!Y, ye = u(te, []), X = u(ee, []);
|
|
33
|
+
function Z(e) {
|
|
34
|
+
let t = l(e);
|
|
35
|
+
fe(t.length), L && L(t.length), !(I && t.length >= z) && (me(JSON.stringify(e)), B && B(e), G.children = e, C.setNodes(G, { children: e }));
|
|
36
|
+
}
|
|
37
|
+
let be = `arkynRichText ${ve || z < q ? "errorTrue" : "errorFalse"} ${he ? "focusTrue" : "focusFalse"}`, Q = z - q;
|
|
38
|
+
function $(e) {
|
|
39
|
+
return !j?.includes(e);
|
|
40
|
+
}
|
|
41
|
+
return /* @__PURE__ */ h(t, {
|
|
42
|
+
name: A,
|
|
43
|
+
label: V,
|
|
44
|
+
showAsterisk: H,
|
|
45
|
+
className: P,
|
|
46
|
+
errorMessage: Y,
|
|
47
|
+
unShowFieldTemplate: ue,
|
|
48
|
+
orientation: W,
|
|
49
|
+
children: /* @__PURE__ */ g(D, {
|
|
50
|
+
editor: G,
|
|
51
|
+
initialValue: K(),
|
|
52
|
+
onChange: Z,
|
|
53
|
+
onValueChange: Z,
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ g("div", {
|
|
56
|
+
className: be,
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ g(c, { children: [
|
|
59
|
+
$("headingOne") && /* @__PURE__ */ h(i, {
|
|
60
|
+
format: "headingOne",
|
|
61
|
+
icon: _
|
|
62
|
+
}),
|
|
63
|
+
$("headingTwo") && /* @__PURE__ */ h(i, {
|
|
64
|
+
format: "headingTwo",
|
|
65
|
+
icon: v
|
|
66
|
+
}),
|
|
67
|
+
$("blockQuote") && /* @__PURE__ */ h(i, {
|
|
68
|
+
format: "blockQuote",
|
|
69
|
+
icon: b
|
|
70
|
+
}),
|
|
71
|
+
$("bold") && /* @__PURE__ */ h(s, {
|
|
72
|
+
format: "bold",
|
|
73
|
+
icon: se
|
|
74
|
+
}),
|
|
75
|
+
$("italic") && /* @__PURE__ */ h(s, {
|
|
76
|
+
format: "italic",
|
|
77
|
+
icon: y
|
|
78
|
+
}),
|
|
79
|
+
$("underline") && /* @__PURE__ */ h(s, {
|
|
80
|
+
format: "underline",
|
|
81
|
+
icon: x
|
|
82
|
+
}),
|
|
83
|
+
$("code") && /* @__PURE__ */ h(s, {
|
|
84
|
+
format: "code",
|
|
85
|
+
icon: ce
|
|
86
|
+
}),
|
|
87
|
+
$("left") && /* @__PURE__ */ h(i, {
|
|
88
|
+
format: "left",
|
|
89
|
+
icon: ae
|
|
90
|
+
}),
|
|
91
|
+
$("right") && /* @__PURE__ */ h(i, {
|
|
92
|
+
format: "right",
|
|
93
|
+
icon: oe
|
|
94
|
+
}),
|
|
95
|
+
$("center") && /* @__PURE__ */ h(i, {
|
|
96
|
+
format: "center",
|
|
97
|
+
icon: re
|
|
98
|
+
}),
|
|
99
|
+
$("justify") && /* @__PURE__ */ h(i, {
|
|
100
|
+
format: "justify",
|
|
101
|
+
icon: ie
|
|
102
|
+
}),
|
|
103
|
+
M && $("image") && /* @__PURE__ */ h(a, { ...M }),
|
|
104
|
+
$("video") && /* @__PURE__ */ h(o, { ...N })
|
|
105
|
+
] }),
|
|
106
|
+
/* @__PURE__ */ h(E, {
|
|
107
|
+
className: "editorContainer",
|
|
108
|
+
renderElement: X,
|
|
109
|
+
renderLeaf: ye,
|
|
110
|
+
spellCheck: !0,
|
|
111
|
+
ref: ge,
|
|
112
|
+
id: _e,
|
|
113
|
+
onFocus: () => J(!0),
|
|
114
|
+
onBlur: () => J(!1),
|
|
115
|
+
onKeyDown: (e) => {
|
|
116
|
+
for (let t in n) if (S(t, e)) {
|
|
117
|
+
e.preventDefault();
|
|
118
|
+
let r = n[t];
|
|
119
|
+
ne(G, r);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}),
|
|
123
|
+
Q < 0 && /* @__PURE__ */ h("div", {
|
|
124
|
+
className: "restatesCharacters",
|
|
125
|
+
children: Q
|
|
126
|
+
})
|
|
127
|
+
]
|
|
128
|
+
}),
|
|
129
|
+
/* @__PURE__ */ h("input", {
|
|
130
|
+
type: "hidden",
|
|
131
|
+
name: A,
|
|
132
|
+
value: pe.slice(0, z)
|
|
133
|
+
}),
|
|
134
|
+
/* @__PURE__ */ h("input", {
|
|
135
|
+
type: "hidden",
|
|
136
|
+
name: `${A}Count`,
|
|
137
|
+
value: q
|
|
138
|
+
})
|
|
139
|
+
]
|
|
140
|
+
})
|
|
141
|
+
});
|
|
133
142
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
};
|
|
143
|
+
//#endregion
|
|
144
|
+
export { k as RichText };
|
|
@@ -1,106 +1,95 @@
|
|
|
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
|
-
|
|
93
|
-
onClick: () => o(!1),
|
|
94
|
-
children: h
|
|
95
|
-
}
|
|
96
|
-
),
|
|
97
|
-
/* @__PURE__ */ e(d, { type: "button", onClick: v, children: f })
|
|
98
|
-
] })
|
|
99
|
-
]
|
|
100
|
-
}
|
|
101
|
-
)
|
|
102
|
-
] });
|
|
1
|
+
import { Button as e } from "../../button/index.js";
|
|
2
|
+
import { Input as t } from "../../input/index.js";
|
|
3
|
+
import { ImageUpload as n } from "../../imageUpload/index.js";
|
|
4
|
+
import { ModalContainer as r } from "../../modal/modalContainer/index.js";
|
|
5
|
+
import { ModalFooter as i } from "../../modal/modalFooter/index.js";
|
|
6
|
+
import { ModalHeader as a } from "../../modal/modalHeader/index.js";
|
|
7
|
+
import { TabButton as o } from "../../tab/tabButton/index.js";
|
|
8
|
+
import { TabContainer as s } from "../../tab/tabContainer/index.js";
|
|
9
|
+
/* empty css */
|
|
10
|
+
import { useState as c } from "react";
|
|
11
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
12
|
+
import { Image as f } from "lucide-react";
|
|
13
|
+
import { useSlate as p } from "slate-react";
|
|
14
|
+
//#region src/components/richText/insertImage/index.tsx
|
|
15
|
+
function m(m) {
|
|
16
|
+
let { action: h, tabLabels: g = ["Adicionar URL", "Upload de arquivo"], modalCancelButton: _ = "Cancelar", modalConfirmButton: v = "Confirmar", modalInputImageLabel: y = "Imagem:", modalInputUrlLabel: b = "URL da imagem:", modalTitle: x = "Inserir imagem" } = m, S = p(), [C, w] = c(!1), [T, E] = c(""), [D, O] = c("url");
|
|
17
|
+
function k(e) {
|
|
18
|
+
e.preventDefault(), !(!T || T === "") && (S.insertNodes([
|
|
19
|
+
{
|
|
20
|
+
type: "paragraph",
|
|
21
|
+
children: [{ text: "" }]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
type: "image",
|
|
25
|
+
src: T,
|
|
26
|
+
children: [{ text: "" }]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
type: "paragraph",
|
|
30
|
+
children: [{ text: "" }]
|
|
31
|
+
}
|
|
32
|
+
]), w(!1));
|
|
33
|
+
}
|
|
34
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("button", {
|
|
35
|
+
type: "button",
|
|
36
|
+
className: "arkynRichTextInsertImage",
|
|
37
|
+
onMouseDown: () => w(!0),
|
|
38
|
+
children: /* @__PURE__ */ u(f, {})
|
|
39
|
+
}), /* @__PURE__ */ d(r, {
|
|
40
|
+
isVisible: C,
|
|
41
|
+
makeInvisible: () => w(!1),
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ u(a, { children: x }),
|
|
44
|
+
/* @__PURE__ */ d("div", {
|
|
45
|
+
className: "arkynRichTextInsertImageModalContent",
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ d(s, {
|
|
48
|
+
defaultValue: D,
|
|
49
|
+
onChange: O,
|
|
50
|
+
children: [/* @__PURE__ */ u(o, {
|
|
51
|
+
value: "url",
|
|
52
|
+
children: g[0]
|
|
53
|
+
}), /* @__PURE__ */ u(o, {
|
|
54
|
+
value: "file",
|
|
55
|
+
children: g[1]
|
|
56
|
+
})]
|
|
57
|
+
}),
|
|
58
|
+
D === "url" && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(t, {
|
|
59
|
+
type: "text",
|
|
60
|
+
name: "richTextImageURL",
|
|
61
|
+
label: b,
|
|
62
|
+
showAsterisk: !0,
|
|
63
|
+
defaultValue: T,
|
|
64
|
+
onChange: (e) => E(e.target.value)
|
|
65
|
+
}), T && /* @__PURE__ */ u("img", {
|
|
66
|
+
className: "arkynRichTextInsertImageModalPreviewImage",
|
|
67
|
+
src: T,
|
|
68
|
+
alt: "preview"
|
|
69
|
+
})] }),
|
|
70
|
+
D === "file" && /* @__PURE__ */ u(n, {
|
|
71
|
+
name: "richTextImageURL",
|
|
72
|
+
action: h,
|
|
73
|
+
label: y,
|
|
74
|
+
showAsterisk: !0,
|
|
75
|
+
defaultValue: T,
|
|
76
|
+
onChange: (e) => E(e)
|
|
77
|
+
})
|
|
78
|
+
]
|
|
79
|
+
}),
|
|
80
|
+
/* @__PURE__ */ d(i, { children: [/* @__PURE__ */ u(e, {
|
|
81
|
+
type: "button",
|
|
82
|
+
scheme: "danger",
|
|
83
|
+
variant: "outline",
|
|
84
|
+
onClick: () => w(!1),
|
|
85
|
+
children: _
|
|
86
|
+
}), /* @__PURE__ */ u(e, {
|
|
87
|
+
type: "button",
|
|
88
|
+
onClick: k,
|
|
89
|
+
children: v
|
|
90
|
+
})] })
|
|
91
|
+
]
|
|
92
|
+
})] });
|
|
103
93
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
};
|
|
94
|
+
//#endregion
|
|
95
|
+
export { m as InsertImage };
|