@arkyn/components 3.0.1-beta.95 → 3.0.1-beta.99
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/README.md +6 -236
- package/dist/bundle.js +2 -8
- package/dist/bundle.umd.cjs +1 -1
- package/dist/components/alert/alertContainer/index.d.ts +46 -26
- package/dist/components/alert/alertContainer/index.d.ts.map +1 -1
- package/dist/components/alert/alertContainer/index.js +42 -25
- package/dist/components/alert/alertContent/index.d.ts +34 -30
- package/dist/components/alert/alertContent/index.d.ts.map +1 -1
- package/dist/components/alert/alertContent/index.js +27 -28
- package/dist/components/alert/alertDescription/index.d.ts +36 -34
- package/dist/components/alert/alertDescription/index.d.ts.map +1 -1
- package/dist/components/alert/alertDescription/index.js +29 -32
- package/dist/components/alert/alertIcon/index.d.ts +36 -34
- package/dist/components/alert/alertIcon/index.d.ts.map +1 -1
- package/dist/components/alert/alertIcon/index.js +28 -33
- package/dist/components/alert/alertTitle/index.d.ts +31 -29
- package/dist/components/alert/alertTitle/index.d.ts.map +1 -1
- package/dist/components/alert/alertTitle/index.js +21 -27
- package/dist/components/audioPlayer/index.d.ts +33 -34
- package/dist/components/audioPlayer/index.d.ts.map +1 -1
- package/dist/components/audioPlayer/index.js +17 -32
- package/dist/components/richText/index.d.ts +1 -1
- package/dist/components/richText/index.d.ts.map +1 -1
- package/dist/components/richText/index.js +3 -3
- package/package.json +1 -1
|
@@ -1,46 +1,48 @@
|
|
|
1
|
-
import { HTMLAttributes } from "react";
|
|
1
|
+
import { HTMLAttributes, JSX } from "react";
|
|
2
2
|
import "./styles.css";
|
|
3
|
+
/**
|
|
4
|
+
* Props for the AlertTitle component.
|
|
5
|
+
* Extends all standard HTML div element attributes.
|
|
6
|
+
*
|
|
7
|
+
* @typedef {Object} AlertTitleProps
|
|
8
|
+
* @property {string} [className] - Additional CSS class names to apply to the alert title
|
|
9
|
+
* @extends {HTMLAttributes<HTMLDivElement>}
|
|
10
|
+
*/
|
|
3
11
|
type AlertTitleProps = HTMLAttributes<HTMLDivElement>;
|
|
4
12
|
/**
|
|
5
|
-
* AlertTitle component -
|
|
13
|
+
* AlertTitle component - Displays the title section of an alert message.
|
|
6
14
|
*
|
|
7
|
-
*
|
|
15
|
+
* This component renders a styled title for alert components, providing semantic structure
|
|
16
|
+
* and consistent styling across the application.
|
|
8
17
|
*
|
|
9
|
-
*
|
|
18
|
+
* @component
|
|
19
|
+
* @memberof Alert
|
|
10
20
|
*
|
|
11
|
-
* @
|
|
21
|
+
* @param {AlertTitleProps} props - Component props extending HTML div attributes
|
|
12
22
|
*
|
|
13
|
-
* @
|
|
14
|
-
* This component affects the layout of the AlertContainer. When present, the container
|
|
15
|
-
* content will be aligned differently compared to alerts without a title.
|
|
23
|
+
* @returns {JSX.Element} A div element with alert title styling
|
|
16
24
|
*
|
|
17
|
-
* @
|
|
18
|
-
* ```tsx
|
|
19
|
-
* // Basic alert with title
|
|
20
|
-
* <AlertContainer schema="info">
|
|
21
|
-
* <AlertTitle>Information</AlertTitle>
|
|
22
|
-
* <AlertDescription>This is important information.</AlertDescription>
|
|
23
|
-
* </AlertContainer>
|
|
25
|
+
* @requires react
|
|
24
26
|
*
|
|
25
|
-
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Basic usage
|
|
26
29
|
* <AlertContainer schema="success">
|
|
27
|
-
* <AlertIcon />
|
|
28
30
|
* <AlertTitle>Success!</AlertTitle>
|
|
29
|
-
* <AlertDescription>Your
|
|
31
|
+
* <AlertDescription>Your changes have been saved.</AlertDescription>
|
|
30
32
|
* </AlertContainer>
|
|
31
33
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
34
|
+
* @example
|
|
35
|
+
* // Complete alert example
|
|
36
|
+
* <AlertContainer schema="success">
|
|
37
|
+
* <AlertIcon />
|
|
38
|
+
* <AlertContent>
|
|
39
|
+
* <AlertTitle>Success!</AlertTitle>
|
|
40
|
+
* <AlertDescription>
|
|
41
|
+
* You are premium user now!
|
|
42
|
+
* </AlertDescription>
|
|
43
|
+
* </AlertContent>
|
|
41
44
|
* </AlertContainer>
|
|
42
|
-
* ```
|
|
43
45
|
*/
|
|
44
|
-
declare function AlertTitle(props: AlertTitleProps):
|
|
46
|
+
declare function AlertTitle(props: AlertTitleProps): JSX.Element;
|
|
45
47
|
export { AlertTitle };
|
|
46
48
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/alert/alertTitle/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/alert/alertTitle/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,cAAc,CAAC;AAEtB;;;;;;;GAOG;AACH,KAAK,eAAe,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,iBAAS,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,GAAG,CAAC,OAAO,CAKvD;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1,44 +1,38 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "./styles.css";
|
|
3
3
|
/**
|
|
4
|
-
* AlertTitle component -
|
|
4
|
+
* AlertTitle component - Displays the title section of an alert message.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* This component renders a styled title for alert components, providing semantic structure
|
|
7
|
+
* and consistent styling across the application.
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
+
* @component
|
|
10
|
+
* @memberof Alert
|
|
9
11
|
*
|
|
10
|
-
* @
|
|
12
|
+
* @param {AlertTitleProps} props - Component props extending HTML div attributes
|
|
11
13
|
*
|
|
12
|
-
* @
|
|
13
|
-
* This component affects the layout of the AlertContainer. When present, the container
|
|
14
|
-
* content will be aligned differently compared to alerts without a title.
|
|
14
|
+
* @returns {JSX.Element} A div element with alert title styling
|
|
15
15
|
*
|
|
16
|
-
* @
|
|
17
|
-
* ```tsx
|
|
18
|
-
* // Basic alert with title
|
|
19
|
-
* <AlertContainer schema="info">
|
|
20
|
-
* <AlertTitle>Information</AlertTitle>
|
|
21
|
-
* <AlertDescription>This is important information.</AlertDescription>
|
|
22
|
-
* </AlertContainer>
|
|
16
|
+
* @requires react
|
|
23
17
|
*
|
|
24
|
-
*
|
|
18
|
+
* @example
|
|
19
|
+
* // Basic usage
|
|
25
20
|
* <AlertContainer schema="success">
|
|
26
|
-
* <AlertIcon />
|
|
27
21
|
* <AlertTitle>Success!</AlertTitle>
|
|
28
|
-
* <AlertDescription>Your
|
|
22
|
+
* <AlertDescription>Your changes have been saved.</AlertDescription>
|
|
29
23
|
* </AlertContainer>
|
|
30
24
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
25
|
+
* @example
|
|
26
|
+
* // Complete alert example
|
|
27
|
+
* <AlertContainer schema="success">
|
|
28
|
+
* <AlertIcon />
|
|
29
|
+
* <AlertContent>
|
|
30
|
+
* <AlertTitle>Success!</AlertTitle>
|
|
31
|
+
* <AlertDescription>
|
|
32
|
+
* You are premium user now!
|
|
33
|
+
* </AlertDescription>
|
|
34
|
+
* </AlertContent>
|
|
40
35
|
* </AlertContainer>
|
|
41
|
-
* ```
|
|
42
36
|
*/
|
|
43
37
|
function AlertTitle(props) {
|
|
44
38
|
const { className: baseClassName, ...rest } = props;
|
|
@@ -1,11 +1,25 @@
|
|
|
1
|
-
import { AudioHTMLAttributes } from "react";
|
|
1
|
+
import { AudioHTMLAttributes, JSX } from "react";
|
|
2
2
|
import "./styles.css";
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {Object} AudioInformationProps
|
|
5
|
+
* @property {number} currentTime - Current playback time in seconds
|
|
6
|
+
* @property {number} totalTime - Total duration of the audio in seconds
|
|
7
|
+
* @property {string} formattedCurrentTime - Formatted current time as MM:SS
|
|
8
|
+
* @property {string} formattedTotalTime - Formatted total time as MM:SS
|
|
9
|
+
*/
|
|
3
10
|
type AudioInformationProps = {
|
|
4
11
|
currentTime: number;
|
|
5
12
|
totalTime: number;
|
|
6
13
|
formattedCurrentTime: string;
|
|
7
14
|
formattedTotalTime: string;
|
|
8
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* @typedef {Object} AudioPlayerProps
|
|
18
|
+
* @property {string} src - Audio source URL (required)
|
|
19
|
+
* @property {boolean} [disabled] - Whether the audio player controls are disabled
|
|
20
|
+
* @property {function(AudioInformationProps): void} [onPlayAudio] - Callback fired when audio starts playing
|
|
21
|
+
* @property {function(AudioInformationProps): void} [onPauseAudio] - Callback fired when audio is paused
|
|
22
|
+
*/
|
|
9
23
|
type AudioPlayerProps = Omit<AudioHTMLAttributes<HTMLAudioElement>, "onEnded" | "src"> & {
|
|
10
24
|
src: string;
|
|
11
25
|
disabled?: boolean;
|
|
@@ -13,48 +27,33 @@ type AudioPlayerProps = Omit<AudioHTMLAttributes<HTMLAudioElement>, "onEnded" |
|
|
|
13
27
|
onPauseAudio?: (props: AudioInformationProps) => void;
|
|
14
28
|
};
|
|
15
29
|
/**
|
|
16
|
-
* AudioPlayer component
|
|
30
|
+
* AudioPlayer component
|
|
17
31
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* @param props.disabled - Whether the audio player is disabled. Default: false
|
|
21
|
-
* @param props.onPlayAudio - Callback function called when audio starts playing
|
|
22
|
-
* @param props.onPauseAudio - Callback function called when audio is paused
|
|
32
|
+
* A customizable audio player with play/pause controls, progress slider, and time display.
|
|
33
|
+
* Provides callbacks for play and pause events with detailed audio information.
|
|
23
34
|
*
|
|
24
|
-
*
|
|
35
|
+
* @component
|
|
25
36
|
*
|
|
26
|
-
* @
|
|
37
|
+
* @param {AudioPlayerProps} props - The component props
|
|
27
38
|
*
|
|
28
|
-
* @
|
|
29
|
-
* ```tsx
|
|
30
|
-
* // Basic audio player
|
|
31
|
-
* <AudioPlayer src="/audio/sample.mp3" />
|
|
39
|
+
* @returns {JSX.Element} The rendered audio player component
|
|
32
40
|
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* onPlayAudio={(info) => console.log('Playing:', info)}
|
|
37
|
-
* onPauseAudio={(info) => console.log('Paused:', info)}
|
|
38
|
-
* />
|
|
41
|
+
* @requires lucide-react - For Play and Pause icons
|
|
42
|
+
* @requires useSlider - For slider state management
|
|
43
|
+
* @requires slider - For the progress slider component
|
|
39
44
|
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* disabled
|
|
44
|
-
* />
|
|
45
|
+
* @example
|
|
46
|
+
* // Basic usage
|
|
47
|
+
* <AudioPlayer src="https://example.com/audio.mp3" />
|
|
45
48
|
*
|
|
46
|
-
*
|
|
49
|
+
* @example
|
|
50
|
+
* // With callbacks
|
|
47
51
|
* <AudioPlayer
|
|
48
|
-
* src="/audio
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* onPlayAudio={(info) => {
|
|
52
|
-
* console.log(`Current: ${info.formattedCurrentTime}`);
|
|
53
|
-
* console.log(`Total: ${info.formattedTotalTime}`);
|
|
54
|
-
* }}
|
|
52
|
+
* src="https://example.com/audio.mp3"
|
|
53
|
+
* onPlayAudio={(info) => console.log('Playing:', info.formattedCurrentTime)}
|
|
54
|
+
* onPauseAudio={(info) => console.log('Paused at:', info.formattedCurrentTime)}
|
|
55
55
|
* />
|
|
56
|
-
* ```
|
|
57
56
|
*/
|
|
58
|
-
declare function AudioPlayer(props: AudioPlayerProps):
|
|
57
|
+
declare function AudioPlayer(props: AudioPlayerProps): JSX.Element;
|
|
59
58
|
export { AudioPlayer };
|
|
60
59
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/audioPlayer/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAA+B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/audioPlayer/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,GAAG,EAA+B,MAAM,OAAO,CAAC;AAI9E,OAAO,cAAc,CAAC;AAEtB;;;;;;GAMG;AACH,KAAK,qBAAqB,GAAG;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF;;;;;;GAMG;AACH,KAAK,gBAAgB,GAAG,IAAI,CAC1B,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,SAAS,GAAG,KAAK,CAClB,GAAG;IACF,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACrD,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;CACvD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,iBAAS,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAoHzD;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -5,47 +5,32 @@ import { useSlider } from "../../hooks/useSlider";
|
|
|
5
5
|
import { Slider } from "../slider";
|
|
6
6
|
import "./styles.css";
|
|
7
7
|
/**
|
|
8
|
-
* AudioPlayer component
|
|
8
|
+
* AudioPlayer component
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* @param props.disabled - Whether the audio player is disabled. Default: false
|
|
13
|
-
* @param props.onPlayAudio - Callback function called when audio starts playing
|
|
14
|
-
* @param props.onPauseAudio - Callback function called when audio is paused
|
|
10
|
+
* A customizable audio player with play/pause controls, progress slider, and time display.
|
|
11
|
+
* Provides callbacks for play and pause events with detailed audio information.
|
|
15
12
|
*
|
|
16
|
-
*
|
|
13
|
+
* @component
|
|
17
14
|
*
|
|
18
|
-
* @
|
|
15
|
+
* @param {AudioPlayerProps} props - The component props
|
|
19
16
|
*
|
|
20
|
-
* @
|
|
21
|
-
* ```tsx
|
|
22
|
-
* // Basic audio player
|
|
23
|
-
* <AudioPlayer src="/audio/sample.mp3" />
|
|
17
|
+
* @returns {JSX.Element} The rendered audio player component
|
|
24
18
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* onPlayAudio={(info) => console.log('Playing:', info)}
|
|
29
|
-
* onPauseAudio={(info) => console.log('Paused:', info)}
|
|
30
|
-
* />
|
|
19
|
+
* @requires lucide-react - For Play and Pause icons
|
|
20
|
+
* @requires useSlider - For slider state management
|
|
21
|
+
* @requires slider - For the progress slider component
|
|
31
22
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* disabled
|
|
36
|
-
* />
|
|
23
|
+
* @example
|
|
24
|
+
* // Basic usage
|
|
25
|
+
* <AudioPlayer src="https://example.com/audio.mp3" />
|
|
37
26
|
*
|
|
38
|
-
*
|
|
27
|
+
* @example
|
|
28
|
+
* // With callbacks
|
|
39
29
|
* <AudioPlayer
|
|
40
|
-
* src="/audio
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* onPlayAudio={(info) => {
|
|
44
|
-
* console.log(`Current: ${info.formattedCurrentTime}`);
|
|
45
|
-
* console.log(`Total: ${info.formattedTotalTime}`);
|
|
46
|
-
* }}
|
|
30
|
+
* src="https://example.com/audio.mp3"
|
|
31
|
+
* onPlayAudio={(info) => console.log('Playing:', info.formattedCurrentTime)}
|
|
32
|
+
* onPauseAudio={(info) => console.log('Paused at:', info.formattedCurrentTime)}
|
|
47
33
|
* />
|
|
48
|
-
* ```
|
|
49
34
|
*/
|
|
50
35
|
function AudioPlayer(props) {
|
|
51
36
|
const { onPlayAudio, onPauseAudio, disabled, ...rest } = props;
|
|
@@ -15,7 +15,7 @@ import "./styles.css";
|
|
|
15
15
|
* @param props.enforceCharacterLimit - Whether to enforce the character limit strictly (default: false)
|
|
16
16
|
* @param props.onChangeCharactersCount - Callback function triggered when character count changes
|
|
17
17
|
* @param props.baseErrorMessage - Custom error message to display
|
|
18
|
-
* @param props.maxLimit - Maximum number of characters allowed (default:
|
|
18
|
+
* @param props.maxLimit - Maximum number of characters allowed (default: 10000)
|
|
19
19
|
* @param props.onChange - Callback function triggered when editor content changes
|
|
20
20
|
* @param props.isError - Whether the component should display in error state
|
|
21
21
|
* @param props.id - Custom ID for the editor element
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/richText/index.tsx"],"names":[],"mappings":"AA8BA,OAAO,EAEL,aAAa,EACd,MAAM,2BAA2B,CAAC;AAMnC,OAAO,cAAc,CAAC;AAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AAEH,iBAAS,QAAQ,CAAC,KAAK,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/richText/index.tsx"],"names":[],"mappings":"AA8BA,OAAO,EAEL,aAAa,EACd,MAAM,2BAA2B,CAAC;AAMnC,OAAO,cAAc,CAAC;AAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AAEH,iBAAS,QAAQ,CAAC,KAAK,EAAE,aAAa,2CA4LrC;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -34,7 +34,7 @@ import "./styles.css";
|
|
|
34
34
|
* @param props.enforceCharacterLimit - Whether to enforce the character limit strictly (default: false)
|
|
35
35
|
* @param props.onChangeCharactersCount - Callback function triggered when character count changes
|
|
36
36
|
* @param props.baseErrorMessage - Custom error message to display
|
|
37
|
-
* @param props.maxLimit - Maximum number of characters allowed (default:
|
|
37
|
+
* @param props.maxLimit - Maximum number of characters allowed (default: 10000)
|
|
38
38
|
* @param props.onChange - Callback function triggered when editor content changes
|
|
39
39
|
* @param props.isError - Whether the component should display in error state
|
|
40
40
|
* @param props.id - Custom ID for the editor element
|
|
@@ -81,7 +81,7 @@ import "./styles.css";
|
|
|
81
81
|
* converted to HTML using the provided utility functions.
|
|
82
82
|
*/
|
|
83
83
|
function RichText(props) {
|
|
84
|
-
const { name, hiddenButtons, imageConfig, defaultValue = "[]", enforceCharacterLimit = false, onChangeCharactersCount, baseErrorMessage, maxLimit =
|
|
84
|
+
const { name, hiddenButtons, imageConfig, defaultValue = "[]", enforceCharacterLimit = false, onChangeCharactersCount, baseErrorMessage, maxLimit = 10000, onChange, isError: baseIsError, label, showAsterisk, id, } = props;
|
|
85
85
|
const editor = useMemo(() => withHistory(withReact(createEditor())), []);
|
|
86
86
|
const { fieldErrors } = useForm();
|
|
87
87
|
function getDefaultNodes() {
|
|
@@ -136,7 +136,7 @@ function RichText(props) {
|
|
|
136
136
|
function buttonIsNotHidden(format) {
|
|
137
137
|
return !hiddenButtons?.includes(format);
|
|
138
138
|
}
|
|
139
|
-
return (_jsxs(FieldWrapper, { children: [label &&
|
|
139
|
+
return (_jsxs(FieldWrapper, { children: [label && _jsx(FieldLabel, { showAsterisk: showAsterisk, children: label }), _jsxs(Slate, { editor: editor, initialValue: getDefaultNodes(), onChange: handleChange, onValueChange: handleChange, children: [_jsxs("div", { className: className, children: [_jsxs(Toolbar, { children: [buttonIsNotHidden("headingOne") && (_jsx(BlockButton, { format: "headingOne", icon: Heading1 })), buttonIsNotHidden("headingTwo") && (_jsx(BlockButton, { format: "headingTwo", icon: Heading2 })), buttonIsNotHidden("blockQuote") && (_jsx(BlockButton, { format: "blockQuote", icon: Quote })), buttonIsNotHidden("bold") && (_jsx(MarkButton, { format: "bold", icon: Bold })), buttonIsNotHidden("italic") && (_jsx(MarkButton, { format: "italic", icon: Italic })), buttonIsNotHidden("underline") && (_jsx(MarkButton, { format: "underline", icon: Underline })), buttonIsNotHidden("code") && (_jsx(MarkButton, { format: "code", icon: Code })), buttonIsNotHidden("left") && (_jsx(BlockButton, { format: "left", icon: AlignLeft })), buttonIsNotHidden("right") && (_jsx(BlockButton, { format: "right", icon: AlignRight })), buttonIsNotHidden("center") && (_jsx(BlockButton, { format: "center", icon: AlignCenter })), buttonIsNotHidden("justify") && (_jsx(BlockButton, { format: "justify", icon: AlignJustify })), imageConfig && buttonIsNotHidden("image") && (_jsx(InsertImage, { ...imageConfig }))] }), _jsx(Editable, { className: "editorContainer", renderElement: renderElement, renderLeaf: renderLeaf, spellCheck: true, ref: ref, id: inputId, onFocus: () => setOnFocus(true), onBlur: () => setOnFocus(false), onKeyDown: (event) => {
|
|
140
140
|
for (const hotkey in hotKeys) {
|
|
141
141
|
if (isHotkey(hotkey, event)) {
|
|
142
142
|
event.preventDefault();
|