@lets-events/react 12.6.3 → 12.7.0

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @lets-events/react@12.6.3 build
2
+ > @lets-events/react@12.7.0 build
3
3
  > tsup src/index.tsx --format esm,cjs --dts --external react
4
4
 
5
5
  CLI Building entry: src/index.tsx
@@ -9,11 +9,11 @@
9
9
  CLI Target: es6
10
10
  ESM Build start
11
11
  CJS Build start
12
- ESM dist\index.mjs 389.21 KB
13
- ESM ⚡️ Build success in 204ms
14
- CJS dist\index.js 404.22 KB
15
- CJS ⚡️ Build success in 205ms
12
+ CJS dist\index.js 404.80 KB
13
+ CJS ⚡️ Build success in 204ms
14
+ ESM dist\index.mjs 389.71 KB
15
+ ESM ⚡️ Build success in 205ms
16
16
  DTS Build start
17
- DTS ⚡️ Build success in 4468ms
18
- DTS dist\index.d.mts 402.87 KB
19
- DTS dist\index.d.ts 402.87 KB
17
+ DTS ⚡️ Build success in 4513ms
18
+ DTS dist\index.d.mts 403.02 KB
19
+ DTS dist\index.d.ts 403.02 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @lets-events/react
2
2
 
3
+ ## 12.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - rich text presenter
8
+
9
+ ## 12.6.4
10
+
11
+ ### Patch Changes
12
+
13
+ - fix simple richeditor formats
14
+
3
15
  ## 12.6.3
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -15298,6 +15298,11 @@ interface RichEditorProps {
15298
15298
  }
15299
15299
  declare const RichEditor: (props: RichEditorProps) => react_jsx_runtime.JSX.Element | null;
15300
15300
 
15301
+ type Props = {
15302
+ richText: string;
15303
+ };
15304
+ declare const RichTextPresenter: ({ richText }: Props) => react_jsx_runtime.JSX.Element;
15305
+
15301
15306
  type RichEditorFormFieldProps = Omit<RichEditorProps, "value" | "onChange"> & {
15302
15307
  name: string;
15303
15308
  label?: string;
@@ -15400,4 +15405,4 @@ declare const useImageUpload: (options: UseImageUploadOptions) => {
15400
15405
  reset: () => void;
15401
15406
  };
15402
15407
 
15403
- export { AddressFormFields, Alert, AlertDialogCompleteStyled, AlertDialogDescriptionStyled, AlertDialogRowStyled, AlertDialogSimpleStyled, AlertDialogSubtitleStyled, AlertDialogTitleStyled, AlertDialoghrStyled, type AlertProps, Avatar, type AvatarProps, AvatarStyled, Badge, type BadgeProps, BadgeStyled, BirthDateFormField, Box, Button, ButtonGroup, type ButtonGroupProps, ButtonGroupStyled, ButtonItem, type ButtonItemProps, ButtonItemStyled, type ButtonProps, CNPJFormField, CPFFormField, Calendar, CalendarFormField, type CalendarFormFieldProps, type CalendarProps, Card, type CardProps, CardStyled, CheckboxGroup, CheckboxGroupFormField, type CheckboxGroupFormFieldProps, type CheckboxGroupProps, CheckboxGroupStyled, CheckboxItem, type CheckboxItemProps, Container, type ContainerProps, ContainerStyled, CountryFormField, type DateRange, Divider, DoubleCalendar, DoubleCalendarFormField, type DoubleCalendarFormFieldProps, type DoubleCalendarProps, Drawer, type DrawerProps, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, type DropdownMenuProps, EmailFormField, type EmailFormFieldProps, ErrorFormMessage, type ErrorFormMessageProps, Filter, FilterItem, type FilterItemProps, type FilterProps, Flex, type FlexProps, FlexStyled, Form, FormLabel, type FormLabelProps, type FormProps, Grid, type GridProps, GridStyled, Icon, type IconProps, IdentityDocumentNumberFormField, InputStyled, MenuDropdown, type MenuDropdownProps, Modal, type ModalProps, MultiSelect, MultiSelectFormField, type MultiSelectFormFieldProps, type MultiSelectProps, PhoneFormField, type PhoneFormFieldProps, RadioGroup, RadioGroupFormField, type RadioGroupFormFieldProps, type RadioGroupProps, RadioGroupStyled, RadioItem, type RadioItemProps, RichEditor, RichEditorFormField, type RichEditorFormFieldProps, type RichEditorProps, Section, type SectionProps, SectionStyled, SelectFormField, type SelectFormFieldProps, Step, StepContent, StepList, type StepProps, StepStyled, StepTrigger, StepWrapper, Switch, SwitchFormField, type SwitchFormFieldProps, type SwitchProps, SwitchStyled, Text, TextAreaFormField, type TextAreaFormFieldProps, TextField, type TextFieldProps, TextFieldSlot, type TextFieldSlotProps, TextFieldSlotStyled, TextFieldStyled, TextFormField, type TextFormFieldProps, type TextProps, TextStyle, TextareaField, type TextareaFieldProps, TextareaFieldStyle, TimePicker, TimePickerButtonStyled, TimePickerDropdownStyled, TimePickerFooterStyled, TimePickerFormField, type TimePickerFormFieldProps, TimePickerIconButton, type TimePickerProps, TimePickerStyled, TimerPickerContentStyled, type Toast, type ToastComponentProps, type ToastConfig, type ToastContextType, ToastItem, type ToastOptions, ToastProvider, type ToastProviderProps, type ToastType, type ToasterShowOptions, Tooltip, TooltipContent, type TooltipProps, TooltipProvider, TooltipRoot, TooltipTrigger, type UploadConfig, UploadService, isValidCNPJ, maskFormat, maskUnformat, useImageUpload, useToast };
15408
+ export { AddressFormFields, Alert, AlertDialogCompleteStyled, AlertDialogDescriptionStyled, AlertDialogRowStyled, AlertDialogSimpleStyled, AlertDialogSubtitleStyled, AlertDialogTitleStyled, AlertDialoghrStyled, type AlertProps, Avatar, type AvatarProps, AvatarStyled, Badge, type BadgeProps, BadgeStyled, BirthDateFormField, Box, Button, ButtonGroup, type ButtonGroupProps, ButtonGroupStyled, ButtonItem, type ButtonItemProps, ButtonItemStyled, type ButtonProps, CNPJFormField, CPFFormField, Calendar, CalendarFormField, type CalendarFormFieldProps, type CalendarProps, Card, type CardProps, CardStyled, CheckboxGroup, CheckboxGroupFormField, type CheckboxGroupFormFieldProps, type CheckboxGroupProps, CheckboxGroupStyled, CheckboxItem, type CheckboxItemProps, Container, type ContainerProps, ContainerStyled, CountryFormField, type DateRange, Divider, DoubleCalendar, DoubleCalendarFormField, type DoubleCalendarFormFieldProps, type DoubleCalendarProps, Drawer, type DrawerProps, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, type DropdownMenuProps, EmailFormField, type EmailFormFieldProps, ErrorFormMessage, type ErrorFormMessageProps, Filter, FilterItem, type FilterItemProps, type FilterProps, Flex, type FlexProps, FlexStyled, Form, FormLabel, type FormLabelProps, type FormProps, Grid, type GridProps, GridStyled, Icon, type IconProps, IdentityDocumentNumberFormField, InputStyled, MenuDropdown, type MenuDropdownProps, Modal, type ModalProps, MultiSelect, MultiSelectFormField, type MultiSelectFormFieldProps, type MultiSelectProps, PhoneFormField, type PhoneFormFieldProps, RadioGroup, RadioGroupFormField, type RadioGroupFormFieldProps, type RadioGroupProps, RadioGroupStyled, RadioItem, type RadioItemProps, RichEditor, RichEditorFormField, type RichEditorFormFieldProps, type RichEditorProps, RichTextPresenter, Section, type SectionProps, SectionStyled, SelectFormField, type SelectFormFieldProps, Step, StepContent, StepList, type StepProps, StepStyled, StepTrigger, StepWrapper, Switch, SwitchFormField, type SwitchFormFieldProps, type SwitchProps, SwitchStyled, Text, TextAreaFormField, type TextAreaFormFieldProps, TextField, type TextFieldProps, TextFieldSlot, type TextFieldSlotProps, TextFieldSlotStyled, TextFieldStyled, TextFormField, type TextFormFieldProps, type TextProps, TextStyle, TextareaField, type TextareaFieldProps, TextareaFieldStyle, TimePicker, TimePickerButtonStyled, TimePickerDropdownStyled, TimePickerFooterStyled, TimePickerFormField, type TimePickerFormFieldProps, TimePickerIconButton, type TimePickerProps, TimePickerStyled, TimerPickerContentStyled, type Toast, type ToastComponentProps, type ToastConfig, type ToastContextType, ToastItem, type ToastOptions, ToastProvider, type ToastProviderProps, type ToastType, type ToasterShowOptions, Tooltip, TooltipContent, type TooltipProps, TooltipProvider, TooltipRoot, TooltipTrigger, type UploadConfig, UploadService, isValidCNPJ, maskFormat, maskUnformat, useImageUpload, useToast };
package/dist/index.d.ts CHANGED
@@ -15298,6 +15298,11 @@ interface RichEditorProps {
15298
15298
  }
15299
15299
  declare const RichEditor: (props: RichEditorProps) => react_jsx_runtime.JSX.Element | null;
15300
15300
 
15301
+ type Props = {
15302
+ richText: string;
15303
+ };
15304
+ declare const RichTextPresenter: ({ richText }: Props) => react_jsx_runtime.JSX.Element;
15305
+
15301
15306
  type RichEditorFormFieldProps = Omit<RichEditorProps, "value" | "onChange"> & {
15302
15307
  name: string;
15303
15308
  label?: string;
@@ -15400,4 +15405,4 @@ declare const useImageUpload: (options: UseImageUploadOptions) => {
15400
15405
  reset: () => void;
15401
15406
  };
15402
15407
 
15403
- export { AddressFormFields, Alert, AlertDialogCompleteStyled, AlertDialogDescriptionStyled, AlertDialogRowStyled, AlertDialogSimpleStyled, AlertDialogSubtitleStyled, AlertDialogTitleStyled, AlertDialoghrStyled, type AlertProps, Avatar, type AvatarProps, AvatarStyled, Badge, type BadgeProps, BadgeStyled, BirthDateFormField, Box, Button, ButtonGroup, type ButtonGroupProps, ButtonGroupStyled, ButtonItem, type ButtonItemProps, ButtonItemStyled, type ButtonProps, CNPJFormField, CPFFormField, Calendar, CalendarFormField, type CalendarFormFieldProps, type CalendarProps, Card, type CardProps, CardStyled, CheckboxGroup, CheckboxGroupFormField, type CheckboxGroupFormFieldProps, type CheckboxGroupProps, CheckboxGroupStyled, CheckboxItem, type CheckboxItemProps, Container, type ContainerProps, ContainerStyled, CountryFormField, type DateRange, Divider, DoubleCalendar, DoubleCalendarFormField, type DoubleCalendarFormFieldProps, type DoubleCalendarProps, Drawer, type DrawerProps, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, type DropdownMenuProps, EmailFormField, type EmailFormFieldProps, ErrorFormMessage, type ErrorFormMessageProps, Filter, FilterItem, type FilterItemProps, type FilterProps, Flex, type FlexProps, FlexStyled, Form, FormLabel, type FormLabelProps, type FormProps, Grid, type GridProps, GridStyled, Icon, type IconProps, IdentityDocumentNumberFormField, InputStyled, MenuDropdown, type MenuDropdownProps, Modal, type ModalProps, MultiSelect, MultiSelectFormField, type MultiSelectFormFieldProps, type MultiSelectProps, PhoneFormField, type PhoneFormFieldProps, RadioGroup, RadioGroupFormField, type RadioGroupFormFieldProps, type RadioGroupProps, RadioGroupStyled, RadioItem, type RadioItemProps, RichEditor, RichEditorFormField, type RichEditorFormFieldProps, type RichEditorProps, Section, type SectionProps, SectionStyled, SelectFormField, type SelectFormFieldProps, Step, StepContent, StepList, type StepProps, StepStyled, StepTrigger, StepWrapper, Switch, SwitchFormField, type SwitchFormFieldProps, type SwitchProps, SwitchStyled, Text, TextAreaFormField, type TextAreaFormFieldProps, TextField, type TextFieldProps, TextFieldSlot, type TextFieldSlotProps, TextFieldSlotStyled, TextFieldStyled, TextFormField, type TextFormFieldProps, type TextProps, TextStyle, TextareaField, type TextareaFieldProps, TextareaFieldStyle, TimePicker, TimePickerButtonStyled, TimePickerDropdownStyled, TimePickerFooterStyled, TimePickerFormField, type TimePickerFormFieldProps, TimePickerIconButton, type TimePickerProps, TimePickerStyled, TimerPickerContentStyled, type Toast, type ToastComponentProps, type ToastConfig, type ToastContextType, ToastItem, type ToastOptions, ToastProvider, type ToastProviderProps, type ToastType, type ToasterShowOptions, Tooltip, TooltipContent, type TooltipProps, TooltipProvider, TooltipRoot, TooltipTrigger, type UploadConfig, UploadService, isValidCNPJ, maskFormat, maskUnformat, useImageUpload, useToast };
15408
+ export { AddressFormFields, Alert, AlertDialogCompleteStyled, AlertDialogDescriptionStyled, AlertDialogRowStyled, AlertDialogSimpleStyled, AlertDialogSubtitleStyled, AlertDialogTitleStyled, AlertDialoghrStyled, type AlertProps, Avatar, type AvatarProps, AvatarStyled, Badge, type BadgeProps, BadgeStyled, BirthDateFormField, Box, Button, ButtonGroup, type ButtonGroupProps, ButtonGroupStyled, ButtonItem, type ButtonItemProps, ButtonItemStyled, type ButtonProps, CNPJFormField, CPFFormField, Calendar, CalendarFormField, type CalendarFormFieldProps, type CalendarProps, Card, type CardProps, CardStyled, CheckboxGroup, CheckboxGroupFormField, type CheckboxGroupFormFieldProps, type CheckboxGroupProps, CheckboxGroupStyled, CheckboxItem, type CheckboxItemProps, Container, type ContainerProps, ContainerStyled, CountryFormField, type DateRange, Divider, DoubleCalendar, DoubleCalendarFormField, type DoubleCalendarFormFieldProps, type DoubleCalendarProps, Drawer, type DrawerProps, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, type DropdownMenuProps, EmailFormField, type EmailFormFieldProps, ErrorFormMessage, type ErrorFormMessageProps, Filter, FilterItem, type FilterItemProps, type FilterProps, Flex, type FlexProps, FlexStyled, Form, FormLabel, type FormLabelProps, type FormProps, Grid, type GridProps, GridStyled, Icon, type IconProps, IdentityDocumentNumberFormField, InputStyled, MenuDropdown, type MenuDropdownProps, Modal, type ModalProps, MultiSelect, MultiSelectFormField, type MultiSelectFormFieldProps, type MultiSelectProps, PhoneFormField, type PhoneFormFieldProps, RadioGroup, RadioGroupFormField, type RadioGroupFormFieldProps, type RadioGroupProps, RadioGroupStyled, RadioItem, type RadioItemProps, RichEditor, RichEditorFormField, type RichEditorFormFieldProps, type RichEditorProps, RichTextPresenter, Section, type SectionProps, SectionStyled, SelectFormField, type SelectFormFieldProps, Step, StepContent, StepList, type StepProps, StepStyled, StepTrigger, StepWrapper, Switch, SwitchFormField, type SwitchFormFieldProps, type SwitchProps, SwitchStyled, Text, TextAreaFormField, type TextAreaFormFieldProps, TextField, type TextFieldProps, TextFieldSlot, type TextFieldSlotProps, TextFieldSlotStyled, TextFieldStyled, TextFormField, type TextFormFieldProps, type TextProps, TextStyle, TextareaField, type TextareaFieldProps, TextareaFieldStyle, TimePicker, TimePickerButtonStyled, TimePickerDropdownStyled, TimePickerFooterStyled, TimePickerFormField, type TimePickerFormFieldProps, TimePickerIconButton, type TimePickerProps, TimePickerStyled, TimerPickerContentStyled, type Toast, type ToastComponentProps, type ToastConfig, type ToastContextType, ToastItem, type ToastOptions, ToastProvider, type ToastProviderProps, type ToastType, type ToasterShowOptions, Tooltip, TooltipContent, type TooltipProps, TooltipProvider, TooltipRoot, TooltipTrigger, type UploadConfig, UploadService, isValidCNPJ, maskFormat, maskUnformat, useImageUpload, useToast };
package/dist/index.js CHANGED
@@ -925,6 +925,7 @@ __export(index_exports, {
925
925
  RadioItem: () => RadioItem,
926
926
  RichEditor: () => RichEditor_default,
927
927
  RichEditorFormField: () => RichEditorFormField,
928
+ RichTextPresenter: () => RichTextPresenter_default,
928
929
  Section: () => Section,
929
930
  SectionStyled: () => SectionStyled,
930
931
  SelectFormField: () => SelectFormField,
@@ -12548,7 +12549,16 @@ var QuillComponent = ({
12548
12549
  matchVisual: false
12549
12550
  }
12550
12551
  };
12551
- const formats = simpleVersion ? ["bold", "italic", "underline", "list", "link"] : [
12552
+ const formats = simpleVersion ? [
12553
+ "header",
12554
+ "bold",
12555
+ "italic",
12556
+ "underline",
12557
+ "color",
12558
+ "background",
12559
+ "align",
12560
+ "list"
12561
+ ] : [
12552
12562
  "header",
12553
12563
  "bold",
12554
12564
  "italic",
@@ -12908,9 +12918,22 @@ var RichEditor = (props) => {
12908
12918
  };
12909
12919
  var RichEditor_default = RichEditor;
12910
12920
 
12921
+ // src/components/RichEditor/RichTextPresenter.tsx
12922
+ var import_jsx_runtime54 = require("react/jsx-runtime");
12923
+ var RichTextPresenter = ({ richText }) => {
12924
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(QuillEditor, { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
12925
+ "div",
12926
+ {
12927
+ className: "ql-editor",
12928
+ dangerouslySetInnerHTML: { __html: richText }
12929
+ }
12930
+ ) });
12931
+ };
12932
+ var RichTextPresenter_default = RichTextPresenter;
12933
+
12911
12934
  // src/components/FormFields/RichEditorFormField.tsx
12912
12935
  var import_react24 = require("react");
12913
- var import_jsx_runtime54 = require("react/jsx-runtime");
12936
+ var import_jsx_runtime55 = require("react/jsx-runtime");
12914
12937
  var RichEditorFormField = (_a) => {
12915
12938
  var _b = _a, {
12916
12939
  name,
@@ -12953,9 +12976,9 @@ var RichEditorFormField = (_a) => {
12953
12976
  const fieldError = fieldState.error;
12954
12977
  const haveError = !!fieldError;
12955
12978
  const errorMsg = fieldError == null ? void 0 : fieldError.message;
12956
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Flex, { direction: "column", children: [
12957
- maxLength ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Flex, { direction: "row", justify: "between", children: [
12958
- label && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
12979
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Flex, { direction: "column", children: [
12980
+ maxLength ? /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Flex, { direction: "row", justify: "between", children: [
12981
+ label && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
12959
12982
  FormLabel,
12960
12983
  {
12961
12984
  name,
@@ -12964,8 +12987,8 @@ var RichEditorFormField = (_a) => {
12964
12987
  haveError
12965
12988
  }
12966
12989
  ),
12967
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Badge, { color: "grey", size: "xs", children: caracterQuantity })
12968
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_jsx_runtime54.Fragment, { children: label && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
12990
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Badge, { color: "grey", size: "xs", children: caracterQuantity })
12991
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_jsx_runtime55.Fragment, { children: label && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
12969
12992
  FormLabel,
12970
12993
  {
12971
12994
  name,
@@ -12974,7 +12997,7 @@ var RichEditorFormField = (_a) => {
12974
12997
  haveError
12975
12998
  }
12976
12999
  ) }),
12977
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
13000
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
12978
13001
  RichEditor_default,
12979
13002
  __spreadProps(__spreadValues({}, props), {
12980
13003
  value: field.value,
@@ -12986,14 +13009,14 @@ var RichEditorFormField = (_a) => {
12986
13009
  simpleVersion
12987
13010
  })
12988
13011
  ),
12989
- /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ErrorFormMessage, { message: errorMsg })
13012
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ErrorFormMessage, { message: errorMsg })
12990
13013
  ] });
12991
13014
  };
12992
13015
 
12993
13016
  // src/components/FormFields/CalendarFormField.tsx
12994
13017
  var import_react_hook_form13 = require("react-hook-form");
12995
13018
  var import_react25 = require("react");
12996
- var import_jsx_runtime55 = require("react/jsx-runtime");
13019
+ var import_jsx_runtime56 = require("react/jsx-runtime");
12997
13020
  var CalendarFormField = (_a) => {
12998
13021
  var _b = _a, {
12999
13022
  name,
@@ -13042,8 +13065,8 @@ var CalendarFormField = (_a) => {
13042
13065
  const handleCalendarChange = (date) => {
13043
13066
  setSelected(date);
13044
13067
  };
13045
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Flex, { direction: "column", style: { flex: "1" }, children: [
13046
- label && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
13068
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Flex, { direction: "column", style: { flex: "1" }, children: [
13069
+ label && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
13047
13070
  FormLabel,
13048
13071
  {
13049
13072
  name,
@@ -13052,7 +13075,7 @@ var CalendarFormField = (_a) => {
13052
13075
  haveError
13053
13076
  }
13054
13077
  ),
13055
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
13078
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
13056
13079
  Calendar,
13057
13080
  __spreadValues({
13058
13081
  selected,
@@ -13065,14 +13088,14 @@ var CalendarFormField = (_a) => {
13065
13088
  maxYearsFromNow
13066
13089
  }, calendarProps)
13067
13090
  ),
13068
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ErrorFormMessage, { message: errorMsg })
13091
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ErrorFormMessage, { message: errorMsg })
13069
13092
  ] });
13070
13093
  };
13071
13094
 
13072
13095
  // src/components/FormFields/DoubleCalendarFormField.tsx
13073
13096
  var import_react26 = require("react");
13074
13097
  var import_react_hook_form14 = require("react-hook-form");
13075
- var import_jsx_runtime56 = require("react/jsx-runtime");
13098
+ var import_jsx_runtime57 = require("react/jsx-runtime");
13076
13099
  var DoubleCalendarFormField = (_a) => {
13077
13100
  var _b = _a, {
13078
13101
  name,
@@ -13121,9 +13144,9 @@ var DoubleCalendarFormField = (_a) => {
13121
13144
  const handleCalendarChange = (range) => {
13122
13145
  setSelected(range);
13123
13146
  };
13124
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Flex, { direction: "column", style: { flex: "1" }, children: [
13125
- label && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(FormLabel, { name, label, required, haveError }),
13126
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
13147
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Flex, { direction: "column", style: { flex: "1" }, children: [
13148
+ label && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(FormLabel, { name, label, required, haveError }),
13149
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
13127
13150
  DoubleCalendar,
13128
13151
  __spreadValues({
13129
13152
  selected,
@@ -13137,14 +13160,14 @@ var DoubleCalendarFormField = (_a) => {
13137
13160
  maxYearsFromNow
13138
13161
  }, calendarProps)
13139
13162
  ),
13140
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ErrorFormMessage, { message: errorMsg })
13163
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ErrorFormMessage, { message: errorMsg })
13141
13164
  ] });
13142
13165
  };
13143
13166
 
13144
13167
  // src/components/FormFields/TimePickerFormField.tsx
13145
13168
  var import_react_hook_form15 = require("react-hook-form");
13146
13169
  var import_react27 = require("react");
13147
- var import_jsx_runtime57 = require("react/jsx-runtime");
13170
+ var import_jsx_runtime58 = require("react/jsx-runtime");
13148
13171
  var TimePickerFormField = (_a) => {
13149
13172
  var _b = _a, {
13150
13173
  name,
@@ -13187,8 +13210,8 @@ var TimePickerFormField = (_a) => {
13187
13210
  const handleTimePickerChange = (time) => {
13188
13211
  setSelected(time);
13189
13212
  };
13190
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Flex, { direction: "column", style: { flex: "1" }, children: [
13191
- label && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
13213
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Flex, { direction: "column", style: { flex: "1" }, children: [
13214
+ label && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
13192
13215
  FormLabel,
13193
13216
  {
13194
13217
  name,
@@ -13197,7 +13220,7 @@ var TimePickerFormField = (_a) => {
13197
13220
  haveError
13198
13221
  }
13199
13222
  ),
13200
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
13223
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
13201
13224
  TimePicker,
13202
13225
  __spreadValues({
13203
13226
  selected,
@@ -13208,7 +13231,7 @@ var TimePickerFormField = (_a) => {
13208
13231
  hasError: haveError
13209
13232
  }, timePickerProps)
13210
13233
  ),
13211
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(ErrorFormMessage, { message: errorMsg })
13234
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(ErrorFormMessage, { message: errorMsg })
13212
13235
  ] });
13213
13236
  };
13214
13237
 
@@ -13376,6 +13399,7 @@ var useImageUpload = (options) => {
13376
13399
  RadioItem,
13377
13400
  RichEditor,
13378
13401
  RichEditorFormField,
13402
+ RichTextPresenter,
13379
13403
  Section,
13380
13404
  SectionStyled,
13381
13405
  SelectFormField,
package/dist/index.mjs CHANGED
@@ -12443,7 +12443,16 @@ var QuillComponent = ({
12443
12443
  matchVisual: false
12444
12444
  }
12445
12445
  };
12446
- const formats = simpleVersion ? ["bold", "italic", "underline", "list", "link"] : [
12446
+ const formats = simpleVersion ? [
12447
+ "header",
12448
+ "bold",
12449
+ "italic",
12450
+ "underline",
12451
+ "color",
12452
+ "background",
12453
+ "align",
12454
+ "list"
12455
+ ] : [
12447
12456
  "header",
12448
12457
  "bold",
12449
12458
  "italic",
@@ -12803,9 +12812,22 @@ var RichEditor = (props) => {
12803
12812
  };
12804
12813
  var RichEditor_default = RichEditor;
12805
12814
 
12815
+ // src/components/RichEditor/RichTextPresenter.tsx
12816
+ import { jsx as jsx54 } from "react/jsx-runtime";
12817
+ var RichTextPresenter = ({ richText }) => {
12818
+ return /* @__PURE__ */ jsx54(QuillEditor, { children: /* @__PURE__ */ jsx54(
12819
+ "div",
12820
+ {
12821
+ className: "ql-editor",
12822
+ dangerouslySetInnerHTML: { __html: richText }
12823
+ }
12824
+ ) });
12825
+ };
12826
+ var RichTextPresenter_default = RichTextPresenter;
12827
+
12806
12828
  // src/components/FormFields/RichEditorFormField.tsx
12807
12829
  import { useState as useState12 } from "react";
12808
- import { Fragment as Fragment5, jsx as jsx54, jsxs as jsxs29 } from "react/jsx-runtime";
12830
+ import { Fragment as Fragment5, jsx as jsx55, jsxs as jsxs29 } from "react/jsx-runtime";
12809
12831
  var RichEditorFormField = (_a) => {
12810
12832
  var _b = _a, {
12811
12833
  name,
@@ -12850,7 +12872,7 @@ var RichEditorFormField = (_a) => {
12850
12872
  const errorMsg = fieldError == null ? void 0 : fieldError.message;
12851
12873
  return /* @__PURE__ */ jsxs29(Flex, { direction: "column", children: [
12852
12874
  maxLength ? /* @__PURE__ */ jsxs29(Flex, { direction: "row", justify: "between", children: [
12853
- label && /* @__PURE__ */ jsx54(
12875
+ label && /* @__PURE__ */ jsx55(
12854
12876
  FormLabel,
12855
12877
  {
12856
12878
  name,
@@ -12859,8 +12881,8 @@ var RichEditorFormField = (_a) => {
12859
12881
  haveError
12860
12882
  }
12861
12883
  ),
12862
- /* @__PURE__ */ jsx54(Badge, { color: "grey", size: "xs", children: caracterQuantity })
12863
- ] }) : /* @__PURE__ */ jsx54(Fragment5, { children: label && /* @__PURE__ */ jsx54(
12884
+ /* @__PURE__ */ jsx55(Badge, { color: "grey", size: "xs", children: caracterQuantity })
12885
+ ] }) : /* @__PURE__ */ jsx55(Fragment5, { children: label && /* @__PURE__ */ jsx55(
12864
12886
  FormLabel,
12865
12887
  {
12866
12888
  name,
@@ -12869,7 +12891,7 @@ var RichEditorFormField = (_a) => {
12869
12891
  haveError
12870
12892
  }
12871
12893
  ) }),
12872
- /* @__PURE__ */ jsx54(
12894
+ /* @__PURE__ */ jsx55(
12873
12895
  RichEditor_default,
12874
12896
  __spreadProps(__spreadValues({}, props), {
12875
12897
  value: field.value,
@@ -12881,14 +12903,14 @@ var RichEditorFormField = (_a) => {
12881
12903
  simpleVersion
12882
12904
  })
12883
12905
  ),
12884
- /* @__PURE__ */ jsx54(ErrorFormMessage, { message: errorMsg })
12906
+ /* @__PURE__ */ jsx55(ErrorFormMessage, { message: errorMsg })
12885
12907
  ] });
12886
12908
  };
12887
12909
 
12888
12910
  // src/components/FormFields/CalendarFormField.tsx
12889
12911
  import { useController as useController4 } from "react-hook-form";
12890
12912
  import { useCallback as useCallback5 } from "react";
12891
- import { jsx as jsx55, jsxs as jsxs30 } from "react/jsx-runtime";
12913
+ import { jsx as jsx56, jsxs as jsxs30 } from "react/jsx-runtime";
12892
12914
  var CalendarFormField = (_a) => {
12893
12915
  var _b = _a, {
12894
12916
  name,
@@ -12938,7 +12960,7 @@ var CalendarFormField = (_a) => {
12938
12960
  setSelected(date);
12939
12961
  };
12940
12962
  return /* @__PURE__ */ jsxs30(Flex, { direction: "column", style: { flex: "1" }, children: [
12941
- label && /* @__PURE__ */ jsx55(
12963
+ label && /* @__PURE__ */ jsx56(
12942
12964
  FormLabel,
12943
12965
  {
12944
12966
  name,
@@ -12947,7 +12969,7 @@ var CalendarFormField = (_a) => {
12947
12969
  haveError
12948
12970
  }
12949
12971
  ),
12950
- /* @__PURE__ */ jsx55(
12972
+ /* @__PURE__ */ jsx56(
12951
12973
  Calendar,
12952
12974
  __spreadValues({
12953
12975
  selected,
@@ -12960,14 +12982,14 @@ var CalendarFormField = (_a) => {
12960
12982
  maxYearsFromNow
12961
12983
  }, calendarProps)
12962
12984
  ),
12963
- /* @__PURE__ */ jsx55(ErrorFormMessage, { message: errorMsg })
12985
+ /* @__PURE__ */ jsx56(ErrorFormMessage, { message: errorMsg })
12964
12986
  ] });
12965
12987
  };
12966
12988
 
12967
12989
  // src/components/FormFields/DoubleCalendarFormField.tsx
12968
12990
  import { useCallback as useCallback6 } from "react";
12969
12991
  import { useController as useController5 } from "react-hook-form";
12970
- import { jsx as jsx56, jsxs as jsxs31 } from "react/jsx-runtime";
12992
+ import { jsx as jsx57, jsxs as jsxs31 } from "react/jsx-runtime";
12971
12993
  var DoubleCalendarFormField = (_a) => {
12972
12994
  var _b = _a, {
12973
12995
  name,
@@ -13017,8 +13039,8 @@ var DoubleCalendarFormField = (_a) => {
13017
13039
  setSelected(range);
13018
13040
  };
13019
13041
  return /* @__PURE__ */ jsxs31(Flex, { direction: "column", style: { flex: "1" }, children: [
13020
- label && /* @__PURE__ */ jsx56(FormLabel, { name, label, required, haveError }),
13021
- /* @__PURE__ */ jsx56(
13042
+ label && /* @__PURE__ */ jsx57(FormLabel, { name, label, required, haveError }),
13043
+ /* @__PURE__ */ jsx57(
13022
13044
  DoubleCalendar,
13023
13045
  __spreadValues({
13024
13046
  selected,
@@ -13032,14 +13054,14 @@ var DoubleCalendarFormField = (_a) => {
13032
13054
  maxYearsFromNow
13033
13055
  }, calendarProps)
13034
13056
  ),
13035
- /* @__PURE__ */ jsx56(ErrorFormMessage, { message: errorMsg })
13057
+ /* @__PURE__ */ jsx57(ErrorFormMessage, { message: errorMsg })
13036
13058
  ] });
13037
13059
  };
13038
13060
 
13039
13061
  // src/components/FormFields/TimePickerFormField.tsx
13040
13062
  import { useController as useController6 } from "react-hook-form";
13041
13063
  import { useCallback as useCallback7 } from "react";
13042
- import { jsx as jsx57, jsxs as jsxs32 } from "react/jsx-runtime";
13064
+ import { jsx as jsx58, jsxs as jsxs32 } from "react/jsx-runtime";
13043
13065
  var TimePickerFormField = (_a) => {
13044
13066
  var _b = _a, {
13045
13067
  name,
@@ -13083,7 +13105,7 @@ var TimePickerFormField = (_a) => {
13083
13105
  setSelected(time);
13084
13106
  };
13085
13107
  return /* @__PURE__ */ jsxs32(Flex, { direction: "column", style: { flex: "1" }, children: [
13086
- label && /* @__PURE__ */ jsx57(
13108
+ label && /* @__PURE__ */ jsx58(
13087
13109
  FormLabel,
13088
13110
  {
13089
13111
  name,
@@ -13092,7 +13114,7 @@ var TimePickerFormField = (_a) => {
13092
13114
  haveError
13093
13115
  }
13094
13116
  ),
13095
- /* @__PURE__ */ jsx57(
13117
+ /* @__PURE__ */ jsx58(
13096
13118
  TimePicker,
13097
13119
  __spreadValues({
13098
13120
  selected,
@@ -13103,7 +13125,7 @@ var TimePickerFormField = (_a) => {
13103
13125
  hasError: haveError
13104
13126
  }, timePickerProps)
13105
13127
  ),
13106
- /* @__PURE__ */ jsx57(ErrorFormMessage, { message: errorMsg })
13128
+ /* @__PURE__ */ jsx58(ErrorFormMessage, { message: errorMsg })
13107
13129
  ] });
13108
13130
  };
13109
13131
 
@@ -13270,6 +13292,7 @@ export {
13270
13292
  RadioItem,
13271
13293
  RichEditor_default as RichEditor,
13272
13294
  RichEditorFormField,
13295
+ RichTextPresenter_default as RichTextPresenter,
13273
13296
  Section,
13274
13297
  SectionStyled,
13275
13298
  SelectFormField,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lets-events/react",
3
- "version": "12.6.3",
3
+ "version": "12.7.0",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -35,59 +35,70 @@ const QuillComponent: React.FC<RichEditorProps> = ({
35
35
  };
36
36
  const modules = simpleVersion
37
37
  ? {
38
- toolbar: [
39
- [{ header: [1, 2, false] }],
40
- ["bold", "italic", "underline"],
41
- [{ color: [] }, { background: [] }],
42
- [{ align: [] }],
43
- [{ list: "ordered" }, { list: "bullet" }],
44
- ],
45
- clipboard: {
46
- matchVisual: false,
47
- },
48
- }
49
- : disableVideo ? {
50
- toolbar: [
51
- [{ header: [1, 2, false] }],
52
- ["bold", "italic", "underline", "strike"],
53
- [{ color: [] }, { background: [] }],
54
- [{ align: [] }],
55
- [{ list: "ordered" }, { list: "bullet" }],
56
- ["link", "image"],
57
- ],
58
- clipboard: {
59
- matchVisual: false,
60
- },
61
- } : {
62
- toolbar: [
63
- [{ header: [1, 2, false] }],
64
- ["bold", "italic", "underline", "strike"],
65
- [{ color: [] }, { background: [] }],
66
- [{ align: [] }],
67
- [{ list: "ordered" }, { list: "bullet" }],
68
- ["link", "image", "video"],
69
- ],
70
- clipboard: {
71
- matchVisual: false,
72
- },
73
- };
38
+ toolbar: [
39
+ [{ header: [1, 2, false] }],
40
+ ["bold", "italic", "underline"],
41
+ [{ color: [] }, { background: [] }],
42
+ [{ align: [] }],
43
+ [{ list: "ordered" }, { list: "bullet" }],
44
+ ],
45
+ clipboard: {
46
+ matchVisual: false,
47
+ },
48
+ }
49
+ : disableVideo
50
+ ? {
51
+ toolbar: [
52
+ [{ header: [1, 2, false] }],
53
+ ["bold", "italic", "underline", "strike"],
54
+ [{ color: [] }, { background: [] }],
55
+ [{ align: [] }],
56
+ [{ list: "ordered" }, { list: "bullet" }],
57
+ ["link", "image"],
58
+ ],
59
+ clipboard: {
60
+ matchVisual: false,
61
+ },
62
+ }
63
+ : {
64
+ toolbar: [
65
+ [{ header: [1, 2, false] }],
66
+ ["bold", "italic", "underline", "strike"],
67
+ [{ color: [] }, { background: [] }],
68
+ [{ align: [] }],
69
+ [{ list: "ordered" }, { list: "bullet" }],
70
+ ["link", "image", "video"],
71
+ ],
72
+ clipboard: {
73
+ matchVisual: false,
74
+ },
75
+ };
74
76
 
75
77
  const formats = simpleVersion
76
- ? ["bold", "italic", "underline", "list", "link"]
78
+ ? [
79
+ "header",
80
+ "bold",
81
+ "italic",
82
+ "underline",
83
+ "color",
84
+ "background",
85
+ "align",
86
+ "list",
87
+ ]
77
88
  : [
78
- "header",
79
- "bold",
80
- "italic",
81
- "underline",
82
- "strike",
83
- "color",
84
- "background",
85
- "align",
86
- "list",
87
- "link",
88
- "image",
89
- "video",
90
- ];
89
+ "header",
90
+ "bold",
91
+ "italic",
92
+ "underline",
93
+ "strike",
94
+ "color",
95
+ "background",
96
+ "align",
97
+ "list",
98
+ "link",
99
+ "image",
100
+ "video",
101
+ ];
91
102
 
92
103
  const { quill, quillRef } = useQuill({
93
104
  theme: "snow",
@@ -134,7 +145,7 @@ const QuillComponent: React.FC<RichEditorProps> = ({
134
145
  });
135
146
  }
136
147
  },
137
- [disabled, quill, addToast, removeToast, uploadConfig, onChange]
148
+ [disabled, quill, addToast, removeToast, uploadConfig, onChange],
138
149
  );
139
150
 
140
151
  useEffect(() => {
@@ -157,15 +168,15 @@ const QuillComponent: React.FC<RichEditorProps> = ({
157
168
  if (quill) {
158
169
  quill.on("text-change", (delta: any, oldDelta: any, source: string) => {
159
170
  if (source === "user") {
160
- const text = quill.getText().trim()
161
- const count = text.length
171
+ const text = quill.getText().trim();
172
+ const count = text.length;
162
173
 
163
174
  if (maxLength !== undefined && count > maxLength) {
164
- quill.deleteText(maxLength, count - maxLength)
165
- return
175
+ quill.deleteText(maxLength, count - maxLength);
176
+ return;
166
177
  }
167
- onChange?.(formatHTML(quill.root.innerHTML))
168
- onCharacterCountChange?.(count)
178
+ onChange?.(formatHTML(quill.root.innerHTML));
179
+ onCharacterCountChange?.(count);
169
180
  }
170
181
  });
171
182
 
@@ -193,7 +204,7 @@ const QuillComponent: React.FC<RichEditorProps> = ({
193
204
  quillRef.current?.parentElement?.querySelector(".ql-toolbar");
194
205
  if (toolbarElement) {
195
206
  const headerSelect = toolbarElement.querySelector(
196
- "select[data-value]"
207
+ "select[data-value]",
197
208
  ) as HTMLSelectElement;
198
209
  if (headerSelect) {
199
210
  const options = headerSelect.querySelectorAll("option");
@@ -0,0 +1,18 @@
1
+ import { QuillEditor } from "./styledComponents";
2
+
3
+ type Props = {
4
+ richText: string;
5
+ };
6
+
7
+ const RichTextPresenter = ({ richText }: Props) => {
8
+ return (
9
+ <QuillEditor>
10
+ <div
11
+ className="ql-editor"
12
+ dangerouslySetInnerHTML={{ __html: richText }}
13
+ />
14
+ </QuillEditor>
15
+ );
16
+ };
17
+
18
+ export default RichTextPresenter;
@@ -1,2 +1,3 @@
1
1
  export { default as RichEditor } from "./RichEditor";
2
2
  export type { RichEditorProps } from "./RichEditor";
3
+ export { default as RichTextPresenter } from "./RichTextPresenter";