hazo_ui 2.2.6 → 2.3.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.
package/dist/index.d.cts CHANGED
@@ -105,89 +105,61 @@ interface HazoUiFlexInputProps extends Omit<InputProps, "type"> {
105
105
  declare const HazoUiFlexInput: React.ForwardRefExoticComponent<HazoUiFlexInputProps & React.RefAttributes<HTMLInputElement>>;
106
106
 
107
107
  /**
108
- * Type definitions for HazoRichtextEditor component
108
+ * Hazo UI Rich Text Editor - Type Definitions
109
109
  *
110
- * Contains all TypeScript interfaces and types used throughout the rich text editor.
110
+ * Type definitions for the rich text editor component including
111
+ * attachments, variables, and editor output interfaces.
111
112
  */
112
-
113
113
  /**
114
- * Variable definition for template variables
114
+ * Represents a file attachment stored as base64
115
115
  */
116
- interface Variable {
117
- /** The variable identifier (e.g., "user_name") */
118
- text: string;
119
- /** Human-readable description (e.g., "Recipient's full name") */
120
- description: string;
121
- /** Optional category for grouping (e.g., "Template Variables", "System Variables") */
122
- category?: string;
116
+ interface RteAttachment {
117
+ filename: string;
118
+ mime_type: string;
119
+ data: string;
123
120
  }
124
121
  /**
125
- * File attachment result from upload
122
+ * Represents a template variable that can be inserted into the editor
126
123
  */
127
- interface FileAttachment {
128
- /** File name */
124
+ interface RteVariable {
129
125
  name: string;
130
- /** File type/mime type */
131
- type: string;
132
- /** File size in bytes */
133
- size: number;
134
- /** URL to the file (either data URL or uploaded URL) */
135
- url: string;
126
+ description: string;
136
127
  }
137
128
  /**
138
- * Attachment stored as base64
129
+ * Output structure returned by the editor on change
139
130
  */
140
- interface Attachment {
141
- /** Unique identifier */
142
- id: string;
143
- /** File name */
144
- name: string;
145
- /** File type/mime type */
146
- type: string;
147
- /** File size in bytes */
148
- size: number;
149
- /** Base64 encoded data (includes data URL prefix) */
150
- data: string;
131
+ interface RteOutput {
132
+ html: string;
133
+ plain_text: string;
134
+ attachments: RteAttachment[];
151
135
  }
152
136
  /**
153
- * Main props for the HazoRichtextEditor component
137
+ * Props for the HazoUiRte component
154
138
  */
155
- interface HazoRichtextEditorProps {
156
- /** Initial HTML content for the editor */
157
- initial_html?: string;
158
- /** Initial plain text content (used if initial_html is not provided) */
159
- initial_text?: string;
160
- /** Array of variables available for insertion */
161
- variables?: Variable[];
162
- /** Initial attachments array */
163
- initial_attachments?: Attachment[];
164
- /** Callback fired when save button is clicked - includes attachments array */
165
- on_save?: (html: string, text: string, attachments: Attachment[]) => void;
166
- /** Callback fired on content change */
167
- on_change?: (html: string, text: string) => void;
168
- /** Callback fired when attachments change */
169
- on_attachments_change?: (attachments: Attachment[]) => void;
170
- /** Callback fired when a file is attached for image embed - return the URL to use for the file */
171
- on_file_attach?: (file: File) => Promise<string>;
172
- /** Placeholder text when editor is empty */
139
+ interface HazoUiRteProps {
140
+ html?: string;
141
+ plain_text?: string;
142
+ attachments?: RteAttachment[];
143
+ variables?: RteVariable[];
144
+ on_change?: (output: RteOutput) => void;
173
145
  placeholder?: string;
174
- /** Minimum height of the editor area */
175
146
  min_height?: string;
176
- /** Maximum height of the editor area */
177
147
  max_height?: string;
178
- /** Whether the editor is read-only */
179
- read_only?: boolean;
180
- /** Whether to show the save button */
181
- show_save_button?: boolean;
182
- /** Custom text for the save button */
183
- save_button_text?: string;
184
- /** Additional CSS class for the container */
148
+ disabled?: boolean;
185
149
  className?: string;
150
+ show_output_viewer?: boolean;
186
151
  }
187
152
 
188
153
  /**
189
- * HazoRichtextEditor - A feature-rich rich text editor component
154
+ * Hazo UI Rich Text Editor Component
155
+ *
156
+ * A comprehensive rich text editor for email template generation with
157
+ * variable insertion support, file attachments, and full formatting controls.
158
+ */
159
+
160
+ /**
161
+ * HazoUiRte - Rich Text Editor Component
190
162
  */
191
- declare function HazoRichtextEditor({ initial_html, initial_text, variables, initial_attachments, on_save, on_change, on_attachments_change, on_file_attach, placeholder, min_height, max_height, read_only, show_save_button, save_button_text, className, }: HazoRichtextEditorProps): react_jsx_runtime.JSX.Element;
163
+ declare const HazoUiRte: React.FC<HazoUiRteProps>;
192
164
 
193
- export { type FilterConfig, type FilterField, HazoRichtextEditor, type FileAttachment as HazoRichtextEditorFileAttachment, type HazoRichtextEditorProps, type Variable as HazoRichtextEditorVariable, HazoUiFlexInput, type HazoUiFlexInputProps, HazoUiFlexRadio, type HazoUiFlexRadioItem, type HazoUiFlexRadioProps, HazoUiMultiFilterDialog, HazoUiMultiSortDialog, type SortConfig, type SortField };
165
+ export { type FilterConfig, type FilterField, HazoUiFlexInput, type HazoUiFlexInputProps, HazoUiFlexRadio, type HazoUiFlexRadioItem, type HazoUiFlexRadioProps, HazoUiMultiFilterDialog, HazoUiMultiSortDialog, HazoUiRte, type HazoUiRteProps, type RteAttachment, type RteOutput, type RteVariable, type SortConfig, type SortField };
package/dist/index.d.ts CHANGED
@@ -105,89 +105,61 @@ interface HazoUiFlexInputProps extends Omit<InputProps, "type"> {
105
105
  declare const HazoUiFlexInput: React.ForwardRefExoticComponent<HazoUiFlexInputProps & React.RefAttributes<HTMLInputElement>>;
106
106
 
107
107
  /**
108
- * Type definitions for HazoRichtextEditor component
108
+ * Hazo UI Rich Text Editor - Type Definitions
109
109
  *
110
- * Contains all TypeScript interfaces and types used throughout the rich text editor.
110
+ * Type definitions for the rich text editor component including
111
+ * attachments, variables, and editor output interfaces.
111
112
  */
112
-
113
113
  /**
114
- * Variable definition for template variables
114
+ * Represents a file attachment stored as base64
115
115
  */
116
- interface Variable {
117
- /** The variable identifier (e.g., "user_name") */
118
- text: string;
119
- /** Human-readable description (e.g., "Recipient's full name") */
120
- description: string;
121
- /** Optional category for grouping (e.g., "Template Variables", "System Variables") */
122
- category?: string;
116
+ interface RteAttachment {
117
+ filename: string;
118
+ mime_type: string;
119
+ data: string;
123
120
  }
124
121
  /**
125
- * File attachment result from upload
122
+ * Represents a template variable that can be inserted into the editor
126
123
  */
127
- interface FileAttachment {
128
- /** File name */
124
+ interface RteVariable {
129
125
  name: string;
130
- /** File type/mime type */
131
- type: string;
132
- /** File size in bytes */
133
- size: number;
134
- /** URL to the file (either data URL or uploaded URL) */
135
- url: string;
126
+ description: string;
136
127
  }
137
128
  /**
138
- * Attachment stored as base64
129
+ * Output structure returned by the editor on change
139
130
  */
140
- interface Attachment {
141
- /** Unique identifier */
142
- id: string;
143
- /** File name */
144
- name: string;
145
- /** File type/mime type */
146
- type: string;
147
- /** File size in bytes */
148
- size: number;
149
- /** Base64 encoded data (includes data URL prefix) */
150
- data: string;
131
+ interface RteOutput {
132
+ html: string;
133
+ plain_text: string;
134
+ attachments: RteAttachment[];
151
135
  }
152
136
  /**
153
- * Main props for the HazoRichtextEditor component
137
+ * Props for the HazoUiRte component
154
138
  */
155
- interface HazoRichtextEditorProps {
156
- /** Initial HTML content for the editor */
157
- initial_html?: string;
158
- /** Initial plain text content (used if initial_html is not provided) */
159
- initial_text?: string;
160
- /** Array of variables available for insertion */
161
- variables?: Variable[];
162
- /** Initial attachments array */
163
- initial_attachments?: Attachment[];
164
- /** Callback fired when save button is clicked - includes attachments array */
165
- on_save?: (html: string, text: string, attachments: Attachment[]) => void;
166
- /** Callback fired on content change */
167
- on_change?: (html: string, text: string) => void;
168
- /** Callback fired when attachments change */
169
- on_attachments_change?: (attachments: Attachment[]) => void;
170
- /** Callback fired when a file is attached for image embed - return the URL to use for the file */
171
- on_file_attach?: (file: File) => Promise<string>;
172
- /** Placeholder text when editor is empty */
139
+ interface HazoUiRteProps {
140
+ html?: string;
141
+ plain_text?: string;
142
+ attachments?: RteAttachment[];
143
+ variables?: RteVariable[];
144
+ on_change?: (output: RteOutput) => void;
173
145
  placeholder?: string;
174
- /** Minimum height of the editor area */
175
146
  min_height?: string;
176
- /** Maximum height of the editor area */
177
147
  max_height?: string;
178
- /** Whether the editor is read-only */
179
- read_only?: boolean;
180
- /** Whether to show the save button */
181
- show_save_button?: boolean;
182
- /** Custom text for the save button */
183
- save_button_text?: string;
184
- /** Additional CSS class for the container */
148
+ disabled?: boolean;
185
149
  className?: string;
150
+ show_output_viewer?: boolean;
186
151
  }
187
152
 
188
153
  /**
189
- * HazoRichtextEditor - A feature-rich rich text editor component
154
+ * Hazo UI Rich Text Editor Component
155
+ *
156
+ * A comprehensive rich text editor for email template generation with
157
+ * variable insertion support, file attachments, and full formatting controls.
158
+ */
159
+
160
+ /**
161
+ * HazoUiRte - Rich Text Editor Component
190
162
  */
191
- declare function HazoRichtextEditor({ initial_html, initial_text, variables, initial_attachments, on_save, on_change, on_attachments_change, on_file_attach, placeholder, min_height, max_height, read_only, show_save_button, save_button_text, className, }: HazoRichtextEditorProps): react_jsx_runtime.JSX.Element;
163
+ declare const HazoUiRte: React.FC<HazoUiRteProps>;
192
164
 
193
- export { type FilterConfig, type FilterField, HazoRichtextEditor, type FileAttachment as HazoRichtextEditorFileAttachment, type HazoRichtextEditorProps, type Variable as HazoRichtextEditorVariable, HazoUiFlexInput, type HazoUiFlexInputProps, HazoUiFlexRadio, type HazoUiFlexRadioItem, type HazoUiFlexRadioProps, HazoUiMultiFilterDialog, HazoUiMultiSortDialog, type SortConfig, type SortField };
165
+ export { type FilterConfig, type FilterField, HazoUiFlexInput, type HazoUiFlexInputProps, HazoUiFlexRadio, type HazoUiFlexRadioItem, type HazoUiFlexRadioProps, HazoUiMultiFilterDialog, HazoUiMultiSortDialog, HazoUiRte, type HazoUiRteProps, type RteAttachment, type RteOutput, type RteVariable, type SortConfig, type SortField };