@bluemarble/bm-components 2.5.2 → 2.6.0-rc

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
@@ -1,11 +1,13 @@
1
1
  import * as cookie from 'cookie';
2
- import * as React from 'react';
3
- import React__default, { PropsWithChildren, ReactNode, FC, Provider } from 'react';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
3
  import * as _mui_material from '@mui/material';
5
- import { TableCellProps, TableCell, TextFieldProps, StandardTextFieldProps, SelectProps as SelectProps$1, FormControlProps, InputLabelProps, AutocompleteProps as AutocompleteProps$1, AutocompleteRenderInputParams, CheckboxProps as CheckboxProps$1, FormControlLabelProps, SwitchProps as SwitchProps$1, RadioGroupProps, ButtonProps, CircularProgressProps, Theme, SxProps, TableSortLabelProps, BoxProps, PaperProps, TableProps, TableHeadProps, TableBodyProps, ModalProps, DialogProps, StackProps, IconButtonProps, TypographyProps, AlertColor } from '@mui/material';
6
- import * as _mui_material_OverridableComponent from '@mui/material/OverridableComponent';
7
- import { FactoryOpts } from 'imask';
4
+ import { AutocompleteProps as AutocompleteProps$1, AutocompleteRenderInputParams, TextFieldProps, StackProps, IconButtonProps, TypographyProps, ButtonProps, ModalProps, BoxProps, Theme, SxProps, TableCellProps, TableSortLabelProps, PaperProps, TableProps, TableHeadProps, TableBodyProps, CheckboxProps as CheckboxProps$1, FormControlLabelProps, DialogProps, TableCell, StandardTextFieldProps, CircularProgressProps, RadioGroupProps, SelectProps as SelectProps$1, FormControlProps, InputLabelProps, SwitchProps as SwitchProps$1, AlertColor } from '@mui/material';
5
+ import * as React from 'react';
6
+ import React__default, { ReactNode, PropsWithChildren, FC, Provider } from 'react';
7
+ import EditorJS, { BlockAPI, OutputData, OutputBlockData, EditorConfig, ToolConstructable, ToolSettings, API, BlockMutationEvent } from '@editorjs/editorjs';
8
8
  import { IconType } from 'react-icons';
9
+ import { FactoryOpts } from 'imask';
10
+ import * as _mui_material_OverridableComponent from '@mui/material/OverridableComponent';
9
11
  import { AxiosInstance } from 'axios';
10
12
  import { ZodSchema } from 'zod';
11
13
 
@@ -56,111 +58,6 @@ declare const nookies: {
56
58
  destroy: typeof destroyCookie;
57
59
  };
58
60
 
59
- /** @deprecated Use {@link ColumnsProps} from `BaseGrid` instead. */
60
- interface ColumnTitleProps {
61
- name: string;
62
- label: string;
63
- transformer?: (value: string | number | Date) => string;
64
- sx?: TableCellProps['sx'];
65
- }
66
- /** @deprecated Use {@link FilterProps} from `useFilter` instead. */
67
- interface FilterProps$1 {
68
- column: string;
69
- value: string;
70
- transformer?: (value: string | number | Date) => string;
71
- }
72
- /** @deprecated Use {@link FilterProps} from `useFilter` instead. */
73
- type IFilter = FilterProps$1;
74
- /** @deprecated */
75
- interface GridProps$1<T> {
76
- columnTitles: ColumnTitleProps[];
77
- defaultData: T[];
78
- tableData: T[];
79
- selectedFilters: FilterProps$1[];
80
- setSelectedFilters(value: FilterProps$1[]): void;
81
- setTableData(value: T[]): void;
82
- updateFilters(value: Record<string, any>[]): void;
83
- rowOptions?: number[];
84
- footer?: ReactNode;
85
- customButtons?: ReactNode;
86
- isLoading?: boolean;
87
- noFilterButtons?: boolean;
88
- noPagination?: boolean;
89
- noFilters?: boolean;
90
- primaryKey?: string;
91
- }
92
- /**
93
- * @deprecated Use {@link BaseGrid} with the {@link useGrid} or {@link useAsyncGrid} hook instead.
94
- * `BaseGrid` separates rendering from state management, eliminating the need to pass
95
- * `tableData`, `setTableData`, `selectedFilters`, and `updateFilters` as props.
96
- */
97
- declare const Grid: <ObjectType>(props: PropsWithChildren<GridProps$1<ObjectType>>) => React__default.JSX.Element;
98
-
99
- /** @deprecated Use the `useFilter` hook instead. */
100
- declare function filterData<T>(filters: FilterProps$1[], defaultData: {
101
- current: T[];
102
- }): T[];
103
-
104
- /** @deprecated Use `TableRow` from `@mui/material` directly. */
105
- declare const Tr: _mui_material_OverridableComponent.OverridableComponent<_mui_material.TableRowTypeMap<{}, "tr">>;
106
-
107
- /** @deprecated Use `TableCell` from `@mui/material` directly. */
108
- declare const Td: typeof TableCell;
109
-
110
- interface EditableTableCellProps extends TableCellProps {
111
- name: string;
112
- TextFieldProps?: TextFieldProps;
113
- type?: TextFieldProps['type'];
114
- fullWidth?: boolean;
115
- rowData?: Record<string, any>;
116
- mask?: FactoryOpts;
117
- bordered?: boolean;
118
- rowIndex?: string | number;
119
- formatCellValue?: (value: string) => string;
120
- formatInputDefautvalue?: (value: string) => string;
121
- onSave?: (props: OnSaveProps) => void;
122
- onCancel?: () => void;
123
- }
124
- interface OnSaveProps {
125
- name: string;
126
- event: FocusEvent;
127
- value: string;
128
- data: Record<string, any>;
129
- }
130
- declare const EditableTableCell: (allProps: EditableTableCellProps) => React__default.JSX.Element;
131
-
132
- interface InputProps extends StandardTextFieldProps {
133
- name: string;
134
- label: string;
135
- shrink?: boolean;
136
- withFormik?: boolean;
137
- }
138
- declare const Input: FC<InputProps>;
139
-
140
- interface InputMaskProps extends Partial<StandardTextFieldProps> {
141
- name: string;
142
- label: string;
143
- withFormik?: boolean;
144
- value?: string;
145
- mask: FactoryOpts;
146
- onChangeValue?: (value: string, unmaskedValue: string) => void;
147
- }
148
- declare function InputMask({ withFormik, ...rest }: InputMaskProps): React__default.JSX.Element;
149
-
150
- interface CustomInputLabelProps extends InputLabelProps {
151
- size?: 'small';
152
- }
153
- type MuiSelectPropsWithouVariant<T> = Omit<SelectProps$1<T>, 'variant'>;
154
- type SelectProps<T> = MuiSelectPropsWithouVariant<T> & {
155
- name: string;
156
- label: string;
157
- withFormik?: boolean;
158
- FormControlProps?: Partial<FormControlProps>;
159
- InputLabelProps?: Partial<CustomInputLabelProps>;
160
- helperText?: string;
161
- };
162
- declare function Select<T>({ withFormik, helperText, ...rest }: SelectProps<T>): React__default.JSX.Element;
163
-
164
61
  type MuiAutocompleteBaseProps<T> = Omit<AutocompleteProps$1<T, boolean, undefined, boolean>, 'renderInput' | 'getOptionLabel'>;
165
62
  interface AutocompleteWithoutProps<T> extends MuiAutocompleteBaseProps<T> {
166
63
  name?: never;
@@ -188,99 +85,92 @@ interface AutocompleteWithFormikProps<T> extends MuiAutocompleteBaseProps<T> {
188
85
  getOptionValue?: (option: T) => string | number;
189
86
  }
190
87
  type AutocompleteProps<T> = AutocompleteWithoutProps<T> | AutocompleteWithFormikProps<T>;
191
- declare function Autocomplete<T>({ withFormik, name, getOptionValue, ...rest }: AutocompleteProps<T>): React__default.JSX.Element;
88
+ declare function Autocomplete<T>({ withFormik, name, getOptionValue, ...rest }: AutocompleteProps<T>): react_jsx_runtime.JSX.Element;
192
89
 
193
- type CheckboxProps = CheckboxWithFormik | CheckboxWithoutFormik;
194
- interface CheckboxWithFormik extends CheckboxProps$1 {
195
- name: string;
196
- label?: string;
197
- helperText?: string;
198
- withFormik?: true;
199
- FormControlLabelProps?: Partial<FormControlLabelProps>;
200
- }
201
- interface CheckboxWithoutFormik extends CheckboxProps$1 {
202
- name?: never;
203
- label?: string;
204
- helperText?: string;
205
- withFormik: false;
206
- FormControlLabelProps?: Partial<FormControlLabelProps>;
90
+ interface DialogHeaderProps extends StackProps {
91
+ title: string;
92
+ IconButtonProps?: IconButtonProps;
93
+ TypographyProps?: TypographyProps;
94
+ onClose?: () => void;
207
95
  }
208
- declare const Checkbox: ({ withFormik, name, ...props }: CheckboxProps) => React__default.JSX.Element;
209
96
 
210
- type SwitchProps = SwitchWithFormik | SwitchWithoutFormik;
211
- interface SwitchWithFormik extends SwitchProps$1 {
212
- name: string;
213
- label?: string;
214
- helperText?: string;
215
- withFormik?: true;
216
- FormControlLabelProps?: Partial<FormControlLabelProps>;
217
- }
218
- interface SwitchWithoutFormik extends SwitchProps$1 {
219
- name?: never;
220
- label?: string;
221
- helperText?: string;
222
- withFormik: false;
223
- FormControlLabelProps?: Partial<FormControlLabelProps>;
97
+ interface IBaseDialogContext {
98
+ opened: symbol[];
99
+ isOpened(dialog: symbol): boolean;
100
+ toggle(dialog: symbol): boolean;
101
+ open(dialog: symbol): void;
102
+ close(dialog: symbol): void;
103
+ closeAll(): void;
224
104
  }
225
- declare const Switch: ({ withFormik, name, ...props }: SwitchProps) => React__default.JSX.Element;
226
105
 
227
- type RadioOptionProps = {
228
- value: string | number | boolean;
229
- label: string;
106
+ declare function useBaseDialog(): IBaseDialogContext;
107
+ declare function useBaseDialogInstance(): {
108
+ name: symbol;
109
+ actions: ReturnType<typeof useBaseDialog>;
230
110
  };
231
- type RadioOptionsProps = RadioWithFormik | RadioWithoutFormik;
232
- interface RadioWithFormik extends RadioGroupProps {
233
- name: string;
234
- label?: string;
235
- options: RadioOptionProps[];
236
- helperText?: string;
237
- withFormik?: true;
238
- }
239
- interface RadioWithoutFormik extends RadioGroupProps {
240
- name?: never;
241
- label?: string;
242
- options: RadioOptionProps[];
243
- helperText?: string;
244
- withFormik: false;
245
- }
246
- declare const Radio: ({ name, withFormik, ...rest }: RadioOptionsProps) => React__default.JSX.Element;
247
111
 
248
- interface LargeButtonProps extends ButtonProps {
249
- loading?: boolean;
250
- children: ReactNode;
251
- CircularProgressProps?: CircularProgressProps;
112
+ interface IBaseDialogInstanceProviderProps {
113
+ children: React__default.ReactNode;
114
+ name: symbol;
252
115
  }
253
- declare const LargeButton: ({ loading, children, CircularProgressProps, sx, ...rest }: LargeButtonProps) => React__default.JSX.Element;
254
116
 
255
- declare function getTabProps(index: string): {
256
- id: string;
257
- 'aria-controls': string;
258
- };
259
- interface TabPanelProps {
260
- children: React__default.ReactNode;
261
- value: number;
262
- index: number;
117
+ interface IBaseDialogContainerProps extends Omit<Partial<ModalProps>, 'open' | 'children'> {
118
+ BoxProps?: BoxProps;
119
+ children: React__default.ReactNode | ((props: {
120
+ close: () => void;
121
+ }) => React__default.ReactNode);
122
+ }
123
+ declare const BaseDialogContainer: ({ children, BoxProps, ...rest }: IBaseDialogContainerProps) => react_jsx_runtime.JSX.Element;
124
+ interface IBaseDialogBodyProps extends BoxProps {
125
+ }
126
+ declare const BaseDialogBody: (props: IBaseDialogBodyProps) => react_jsx_runtime.JSX.Element;
127
+ interface IBaseDialogTriggerProps extends Omit<ButtonProps, 'name'> {
128
+ name: symbol;
263
129
  }
264
- declare const TabPanel: (props: TabPanelProps) => React__default.JSX.Element;
130
+ declare const BaseDialogTrigger: ({ name, onClick, ...props }: IBaseDialogTriggerProps) => react_jsx_runtime.JSX.Element;
131
+ declare const BaseDialogCreate: (name?: symbol) => {
132
+ name: symbol;
133
+ Trigger: (props: Omit<IBaseDialogTriggerProps, "name">) => react_jsx_runtime.JSX.Element;
134
+ Root: (props: Omit<IBaseDialogInstanceProviderProps, "name">) => react_jsx_runtime.JSX.Element;
135
+ Container: ({ children, BoxProps, ...rest }: IBaseDialogContainerProps) => react_jsx_runtime.JSX.Element;
136
+ Header: ({ title, onClose, IconButtonProps, TypographyProps, ...props }: DialogHeaderProps) => react_jsx_runtime.JSX.Element;
137
+ Body: (props: IBaseDialogBodyProps) => react_jsx_runtime.JSX.Element;
138
+ };
139
+ declare const BaseDialog: {
140
+ Create: (name?: symbol) => {
141
+ name: symbol;
142
+ Trigger: (props: Omit<IBaseDialogTriggerProps, "name">) => react_jsx_runtime.JSX.Element;
143
+ Root: (props: Omit<IBaseDialogInstanceProviderProps, "name">) => react_jsx_runtime.JSX.Element;
144
+ Container: ({ children, BoxProps, ...rest }: IBaseDialogContainerProps) => react_jsx_runtime.JSX.Element;
145
+ Header: ({ title, onClose, IconButtonProps, TypographyProps, ...props }: DialogHeaderProps) => react_jsx_runtime.JSX.Element;
146
+ Body: (props: IBaseDialogBodyProps) => react_jsx_runtime.JSX.Element;
147
+ };
148
+ Trigger: ({ name, onClick, ...props }: IBaseDialogTriggerProps) => react_jsx_runtime.JSX.Element;
149
+ Provider: (props: any) => react_jsx_runtime.JSX.Element;
150
+ Root: (props: IBaseDialogInstanceProviderProps) => react_jsx_runtime.JSX.Element;
151
+ Container: ({ children, BoxProps, ...rest }: IBaseDialogContainerProps) => react_jsx_runtime.JSX.Element;
152
+ Header: ({ title, onClose, IconButtonProps, TypographyProps, ...props }: DialogHeaderProps) => react_jsx_runtime.JSX.Element;
153
+ Body: (props: IBaseDialogBodyProps) => react_jsx_runtime.JSX.Element;
154
+ };
265
155
 
266
156
  type FilterCompareType = 'gte' | 'lte' | 'lt' | 'gt' | 'equal' | 'valueIn' | 'in' | 'notEqual' | 'valueNotIn' | 'notIn';
267
- type FilterProps = {
157
+ type FilterProps$1 = {
268
158
  id?: string;
269
159
  prop: string;
270
160
  value: unknown;
271
161
  compareType: FilterCompareType;
272
162
  };
273
163
  interface IUseFilterProps {
274
- defaultFilters?: FilterProps[];
164
+ defaultFilters?: FilterProps$1[];
275
165
  }
276
166
  declare function useFilter(props?: IUseFilterProps): {
277
- filters: FilterProps[];
278
- filterBy: (newFilter: FilterProps) => void;
167
+ filters: FilterProps$1[];
168
+ filterBy: (newFilter: FilterProps$1) => void;
279
169
  removeFilter: (prop: string, isId?: boolean) => void;
280
170
  createFilter: typeof createFilter;
281
171
  clearAllFilters: () => void;
282
172
  };
283
- declare function createFilter<T extends Record<string, any>>(filters: FilterProps[]): {
173
+ declare function createFilter<T extends Record<string, any>>(filters: FilterProps$1[]): {
284
174
  apply: (item: T) => boolean;
285
175
  };
286
176
 
@@ -298,7 +188,7 @@ interface SearchOptions$1 {
298
188
  }
299
189
  interface UseGridProps$1<T> {
300
190
  columns: ColumnsProps[];
301
- filters?: FilterProps[];
191
+ filters?: FilterProps$1[];
302
192
  rowsPerPageOptions?: number[];
303
193
  search?: SearchOptions$1;
304
194
  defaultCurrentPage?: number;
@@ -334,7 +224,7 @@ interface ColumnsProps<T extends object = Theme> {
334
224
  canSort?: boolean;
335
225
  children?: ReactNode;
336
226
  }
337
- interface GridProps {
227
+ interface GridProps$1 {
338
228
  columns: ColumnsProps[];
339
229
  children: ReactNode;
340
230
  prependColumn?: ReactNode;
@@ -361,30 +251,787 @@ interface GridProps {
361
251
  isLoading?: boolean;
362
252
  hideFooter?: boolean;
363
253
  }
364
- declare function BaseGrid({ columns, children, paperProps, tableBodyProps, tableHeadProps, tableProps, sortedBy, onSortBy, dense, striped, bordered, currentPage, totalNumberOfPages, tableSortLabelProps, boxContainerProps, onPageChange, rowsPerPage, setRowsPerPage, rowsPerPageOptions, hideFooter, prependColumn, appendColumn, loadingColSpan, isLoading }: GridProps): React__default.JSX.Element;
254
+ declare function BaseGrid({ columns, children, paperProps, tableBodyProps, tableHeadProps, tableProps, sortedBy, onSortBy, dense, striped, bordered, currentPage, totalNumberOfPages, tableSortLabelProps, boxContainerProps, onPageChange, rowsPerPage, setRowsPerPage, rowsPerPageOptions, hideFooter, prependColumn, appendColumn, loadingColSpan, isLoading }: GridProps$1): react_jsx_runtime.JSX.Element;
365
255
 
366
256
  interface BaseGridAutoRowsProps<T> {
367
257
  columns: ColumnsProps<any>[];
368
258
  data: T[];
369
259
  rowKey: keyof T;
370
260
  }
371
- declare function BaseGridAutoRows<T>({ data, columns, rowKey }: BaseGridAutoRowsProps<T>): React__default.JSX.Element;
261
+ declare function BaseGridAutoRows<T>({ data, columns, rowKey }: BaseGridAutoRowsProps<T>): react_jsx_runtime.JSX.Element;
262
+
263
+ /** Formato salvo: { alignment } — compatível com editorjs-text-alignment-blocktune */
264
+ type AlignmentData = {
265
+ alignment: Alignment;
266
+ };
267
+ type Alignment = 'left' | 'center' | 'right';
268
+ declare class AlignmentTune {
269
+ private api;
270
+ private block;
271
+ private config;
272
+ private data;
273
+ private wrapper;
274
+ static get isTune(): boolean;
275
+ static get DEFAULT_ALIGNMENT(): Alignment;
276
+ constructor({ api, data, config, block }: any);
277
+ private defaultAlignment;
278
+ wrap(blockContent: HTMLElement): HTMLElement;
279
+ render(): {
280
+ icon: string;
281
+ title: string;
282
+ name: string;
283
+ toggle: string;
284
+ isActive: boolean;
285
+ onActivate: () => void;
286
+ }[];
287
+ private setAlignment;
288
+ save(): AlignmentData;
289
+ }
290
+
291
+ /** Formato salvo: { file, title } — compatível com @editorjs/attaches */
292
+ type AttachesData = {
293
+ file: Record<string, any>;
294
+ title: string;
295
+ };
296
+ declare class Attaches {
297
+ private api;
298
+ private block;
299
+ private readOnly;
300
+ private config;
301
+ private data;
302
+ private wrapper;
303
+ private titleField;
304
+ static get isReadOnlySupported(): boolean;
305
+ static get toolbox(): {
306
+ icon: string;
307
+ title: string;
308
+ };
309
+ static get sanitize(): {
310
+ title: {};
311
+ file: boolean;
312
+ };
313
+ /**
314
+ * Recebe qualquer arquivo colado que não seja imagem — o editor casa o mime type
315
+ * pelo tipo principal, então listar todos menos `image/*` evita conflito com o plugin de imagem.
316
+ */
317
+ static get pasteConfig(): {
318
+ files: {
319
+ mimeTypes: string[];
320
+ };
321
+ };
322
+ constructor({ data, config, api, block, readOnly }: any);
323
+ render(): HTMLElement;
324
+ private drawView;
325
+ private getExtension;
326
+ private createUploadButton;
327
+ private selectFile;
328
+ /** Sem `config.uploader.uploadByFile` o arquivo fica local (data URL + buffer). */
329
+ private upload;
330
+ onPaste(event: any): Promise<void>;
331
+ validate(data: AttachesData): boolean;
332
+ save(): AttachesData;
333
+ }
334
+
335
+ /** Formato salvo: { items: [{ text, checked }] } — compatível com @editorjs/checklist */
336
+ type ChecklistData = {
337
+ items: {
338
+ text: string;
339
+ checked: boolean;
340
+ }[];
341
+ };
342
+ declare class Checklist {
343
+ private api;
344
+ private readOnly;
345
+ private data;
346
+ private wrapper;
347
+ static get isReadOnlySupported(): boolean;
348
+ static get enableLineBreaks(): boolean;
349
+ static get toolbox(): {
350
+ icon: string;
351
+ title: string;
352
+ };
353
+ static get sanitize(): {
354
+ items: {
355
+ text: {};
356
+ checked: boolean;
357
+ };
358
+ };
359
+ static get conversionConfig(): {
360
+ export: (data: ChecklistData) => string;
361
+ import: (text: string) => {
362
+ items: {
363
+ text: string;
364
+ checked: boolean;
365
+ }[];
366
+ };
367
+ };
368
+ constructor({ data, api, readOnly }: any);
369
+ render(): HTMLElement;
370
+ private createItem;
371
+ private onKeyDown;
372
+ private appendItem;
373
+ /** Item vazio + Enter: sai da lista criando um parágrafo abaixo. */
374
+ private leaveList;
375
+ private onBackspace;
376
+ save(): ChecklistData;
377
+ }
378
+
379
+ /** Formato salvo: { code } — compatível com @editorjs/code */
380
+ type CodeData = {
381
+ code: string;
382
+ };
383
+ declare class Code {
384
+ private readOnly;
385
+ private placeholder;
386
+ private data;
387
+ private textarea;
388
+ static get isReadOnlySupported(): boolean;
389
+ static get enableLineBreaks(): boolean;
390
+ static get toolbox(): {
391
+ icon: string;
392
+ title: string;
393
+ };
394
+ static get sanitize(): {
395
+ code: boolean;
396
+ };
397
+ static get pasteConfig(): {
398
+ tags: string[];
399
+ };
400
+ static get conversionConfig(): {
401
+ export: string;
402
+ import: string;
403
+ };
404
+ constructor({ data, config, readOnly }: any);
405
+ render(): HTMLTextAreaElement;
406
+ rendered(): void;
407
+ private resize;
408
+ onPaste(event: any): void;
409
+ save(): CodeData;
410
+ }
411
+
412
+ /**
413
+ * Permite reordenar blocos arrastando o botão de configurações da toolbar.
414
+ * Substitui o editorjs-drag-drop.
415
+ *
416
+ * Blocos aninhados (@see nesting) viajam com o bloco arrastado: a subárvore é
417
+ * movida inteira e o recuo é recalculado a partir do alvo — soltar abaixo de um
418
+ * toggle aberto adota o bloco como filho dele, e soltar na raiz o desaninha.
419
+ */
420
+ declare class DragDrop {
421
+ private api;
422
+ private toolbar;
423
+ private holder;
424
+ private startBlock;
425
+ private dropBlock;
426
+ private subtree;
427
+ private observer;
428
+ /** `color` pinta o bloco arrastado e a linha do destino. */
429
+ constructor(editor: EditorJS, holder?: HTMLElement, color?: string);
430
+ destroy(): void;
431
+ /** O botão de configurações só existe depois que a toolbar é montada. */
432
+ private watchSettingsButton;
433
+ private initializeDragListener;
434
+ private getBlocks;
435
+ /**
436
+ * O alvo vem da posição do ponteiro, e não da classe `ce-block--drop-target`
437
+ * do editor: ela sobrevive ao `dragleave` em alguns casos e deixava mais de
438
+ * um bloco com a linha visível ao mesmo tempo.
439
+ */
440
+ private onDragOver;
441
+ /** A linha fica sempre abaixo do bloco sob o cursor. */
442
+ private highlightTarget;
443
+ private clearHighlight;
444
+ private onDrop;
445
+ /** Quantos blocos seguintes ao alvo estão escondidos por ele (toggle fechado). */
446
+ private getHiddenLength;
447
+ /**
448
+ * Solto abaixo de um toggle aberto o bloco vira o primeiro filho dele; nos
449
+ * demais casos ele assume o mesmo nível do alvo.
450
+ */
451
+ private reparent;
452
+ }
453
+
454
+ /** Formato salvo: { text, level } — compatível com @editorjs/header */
455
+ type HeaderData = {
456
+ text: string;
457
+ level: number;
458
+ };
459
+ declare class Header {
460
+ private api;
461
+ private block;
462
+ private readOnly;
463
+ private placeholder;
464
+ private defaultLevel;
465
+ private element;
466
+ private data;
467
+ static get isReadOnlySupported(): boolean;
468
+ static get toolbox(): {
469
+ icon: string;
470
+ title: string;
471
+ };
472
+ static get conversionConfig(): {
473
+ export: string;
474
+ import: string;
475
+ };
476
+ static get sanitize(): {
477
+ level: boolean;
478
+ text: {};
479
+ };
480
+ static get pasteConfig(): {
481
+ tags: string[];
482
+ };
483
+ constructor({ data, config, api, block, readOnly }: any);
484
+ render(): HTMLElement;
485
+ private drawView;
486
+ renderSettings(): {
487
+ icon: string;
488
+ title: string;
489
+ name: string;
490
+ toggle: string;
491
+ isActive: boolean;
492
+ onActivate: () => void;
493
+ }[];
494
+ private setLevel;
495
+ merge(data: HeaderData): void;
496
+ save(element: HTMLElement): HeaderData;
497
+ onPaste(event: any): void;
498
+ }
499
+
500
+ /**
501
+ * Ícones dos plugins.
502
+ *
503
+ * O Editor.js espera uma string de html, então os componentes do `react-icons`
504
+ * são serializados para svg uma única vez (sem `react-dom/server`).
505
+ * Use `iconToHtml` para trocar qualquer ícone por outro do `react-icons`.
506
+ */
507
+
508
+ /** Converte um ícone do `react-icons` em html, no formato aceito pelo Editor.js. */
509
+ declare function iconToHtml(icon: IconType, size?: number | string): string;
510
+ declare const icons: {
511
+ header: string;
512
+ headerLevel: (level: number) => string;
513
+ listUnordered: string;
514
+ listOrdered: string;
515
+ checklist: string;
516
+ table: string;
517
+ code: string;
518
+ image: string;
519
+ attaches: string;
520
+ underline: string;
521
+ strikethrough: string;
522
+ alignLeft: string;
523
+ alignCenter: string;
524
+ alignRight: string;
525
+ callOut: string;
526
+ citation: string;
527
+ details: string;
528
+ toggle: string;
529
+ row: string;
530
+ column: string;
531
+ plus: string;
532
+ trash: string;
533
+ stretch: string;
534
+ border: string;
535
+ caption: string;
536
+ background: string;
537
+ };
538
+ type Icons = typeof icons;
539
+
540
+ /**
541
+ * Formato salvo: { file, caption, withBorder, withBackground, stretched } — compatível com @editorjs/image.
542
+ * `withCaption` é um campo extra (controla a exibição da legenda) e é opcional na leitura.
543
+ */
544
+ type ImageData = {
545
+ file: Record<string, any>;
546
+ caption: string;
547
+ withBorder: boolean;
548
+ withBackground: boolean;
549
+ stretched: boolean;
550
+ withCaption: boolean;
551
+ };
552
+ declare class Image {
553
+ private api;
554
+ private block;
555
+ private readOnly;
556
+ private config;
557
+ private data;
558
+ private wrapper;
559
+ private captionField;
560
+ static get isReadOnlySupported(): boolean;
561
+ static get toolbox(): {
562
+ icon: string;
563
+ title: string;
564
+ };
565
+ static get sanitize(): {
566
+ caption: {};
567
+ file: boolean;
568
+ withBorder: boolean;
569
+ withBackground: boolean;
570
+ stretched: boolean;
571
+ withCaption: boolean;
572
+ };
573
+ static get pasteConfig(): {
574
+ tags: string[];
575
+ files: {
576
+ mimeTypes: string[];
577
+ };
578
+ };
579
+ constructor({ data, config, api, block, readOnly }: any);
580
+ render(): HTMLElement;
581
+ rendered(): void;
582
+ private drawView;
583
+ private createUploadButton;
584
+ private selectFile;
585
+ /** Sem `config.uploader.uploadByFile` o arquivo fica local (data URL + buffer). */
586
+ private upload;
587
+ private stretch;
588
+ renderSettings(): {
589
+ icon: string;
590
+ title: string;
591
+ name: string;
592
+ toggle: boolean;
593
+ isActive: boolean;
594
+ onActivate: () => void;
595
+ }[];
596
+ private toggleTune;
597
+ private getCaption;
598
+ onPaste(event: any): Promise<void>;
599
+ validate(data: ImageData): boolean;
600
+ save(): ImageData;
601
+ }
602
+
603
+ /** Formato salvo: { style, items: string[] } — compatível com @editorjs/list v1 */
604
+ type ListData = {
605
+ style: 'ordered' | 'unordered';
606
+ items: string[];
607
+ };
608
+ declare class List {
609
+ private api;
610
+ private block;
611
+ private readOnly;
612
+ private data;
613
+ private wrapper;
614
+ static get isReadOnlySupported(): boolean;
615
+ static get enableLineBreaks(): boolean;
616
+ static get toolbox(): {
617
+ icon: string;
618
+ title: string;
619
+ data: {
620
+ style: string;
621
+ };
622
+ }[];
623
+ static get conversionConfig(): {
624
+ export: (data: ListData) => string;
625
+ import: (text: string) => {
626
+ items: string[];
627
+ style: string;
628
+ };
629
+ };
630
+ static get sanitize(): {
631
+ style: boolean;
632
+ items: {
633
+ br: boolean;
634
+ };
635
+ };
636
+ static get pasteConfig(): {
637
+ tags: string[];
638
+ };
639
+ constructor({ data, api, block, readOnly }: any);
640
+ render(): HTMLElement;
641
+ private drawView;
642
+ private onEnter;
643
+ renderSettings(): {
644
+ icon: string;
645
+ title: string;
646
+ name: string;
647
+ toggle: string;
648
+ isActive: boolean;
649
+ onActivate: () => void;
650
+ }[];
651
+ private setStyle;
652
+ private getItems;
653
+ onPaste(event: any): void;
654
+ save(): ListData;
655
+ }
656
+
657
+ /** Inline tool que gera <s class="cdx-strikethrough"> — compatível com @sotaproject/strikethrough */
658
+ declare class Strikethrough {
659
+ private api;
660
+ private button;
661
+ static get isInline(): boolean;
662
+ static get title(): string;
663
+ static get sanitize(): {
664
+ s: {
665
+ class: string;
666
+ };
667
+ };
668
+ get shortcut(): string;
669
+ constructor({ api }: any);
670
+ render(): HTMLButtonElement;
671
+ surround(range: Range): void;
672
+ private wrap;
673
+ private unwrap;
674
+ checkState(): boolean;
675
+ }
676
+
677
+ /** Formato salvo: { withHeadings, content: string[][] } — compatível com @editorjs/table */
678
+ type TableData = {
679
+ withHeadings: boolean;
680
+ content: string[][];
681
+ };
682
+ declare class Table {
683
+ private api;
684
+ private block;
685
+ private readOnly;
686
+ private data;
687
+ private wrapper;
688
+ private table;
689
+ private selectedCell;
690
+ static get isReadOnlySupported(): boolean;
691
+ static get enableLineBreaks(): boolean;
692
+ static get toolbox(): {
693
+ icon: string;
694
+ title: string;
695
+ };
696
+ static get sanitize(): {
697
+ withHeadings: boolean;
698
+ content: {
699
+ br: boolean;
700
+ };
701
+ };
702
+ constructor({ data, config, api, block, readOnly }: any);
703
+ private emptyContent;
704
+ render(): HTMLElement;
705
+ private drawTable;
706
+ private createCell;
707
+ private onKeyDown;
708
+ private getPosition;
709
+ private moveTo;
710
+ private focusCell;
711
+ /** Índice da linha/coluna em foco (última linha/coluna quando nada estiver selecionado). */
712
+ private currentPosition;
713
+ private addRow;
714
+ private addColumn;
715
+ private deleteRow;
716
+ private deleteColumn;
717
+ private toggleHeadings;
718
+ renderSettings(): ({
719
+ icon: string;
720
+ title: string;
721
+ name: string;
722
+ toggle: boolean;
723
+ isActive: boolean;
724
+ onActivate: () => void;
725
+ } | {
726
+ icon: string;
727
+ title: string;
728
+ name: string;
729
+ onActivate: () => void;
730
+ toggle?: undefined;
731
+ isActive?: undefined;
732
+ })[];
733
+ private getContent;
734
+ save(): TableData;
735
+ }
736
+
737
+ /** Formato salvo: string ('' | 'call-out' | 'citation' | 'details') — compatível com @editorjs/text-variant-tune */
738
+ type TextVariant = '' | 'call-out' | 'citation' | 'details';
739
+ declare class TextVariantTune {
740
+ private api;
741
+ private block;
742
+ private data;
743
+ private wrapper;
744
+ static get isTune(): boolean;
745
+ constructor({ api, data, block }: any);
746
+ wrap(blockContent: HTMLElement): HTMLElement;
747
+ render(): {
748
+ icon: string;
749
+ title: string;
750
+ name: string;
751
+ toggle: string;
752
+ isActive: boolean;
753
+ onActivate: () => void;
754
+ }[];
755
+ private setVariant;
756
+ save(): "" | "details" | "call-out" | "citation";
757
+ }
758
+
759
+ /** Formato salvo: { text, status, fk, items } — compatível com editorjs-toggle-block. */
760
+ type ToggleData = {
761
+ text: string;
762
+ status: 'open' | 'closed';
763
+ fk: string;
764
+ items: number;
765
+ };
766
+ /**
767
+ * Os "filhos" do toggle são os blocos seguintes (a quantidade fica em `items`),
768
+ * apenas escondidos quando o toggle está fechado. Arrastar o toggle leva a
769
+ * subárvore junto (@see dragDrop).
770
+ */
771
+ declare class ToggleBlock {
772
+ private api;
773
+ private readOnly;
774
+ private placeholder;
775
+ private data;
776
+ private wrapper;
777
+ private input;
778
+ private icon;
779
+ private empty;
780
+ private redactor;
781
+ private adopted;
782
+ /** @internal usado pelo controlador de teclado */
783
+ block: BlockAPI;
784
+ static get isReadOnlySupported(): boolean;
785
+ static get enableLineBreaks(): boolean;
786
+ static get toolbox(): {
787
+ icon: string;
788
+ title: string;
789
+ };
790
+ static get sanitize(): {
791
+ text: {};
792
+ status: boolean;
793
+ fk: boolean;
794
+ items: boolean;
795
+ };
796
+ constructor({ data, config, api, block, readOnly }: any);
797
+ render(): HTMLElement;
798
+ /** Os blocos irmãos só existem depois que o editor termina de renderizar. */
799
+ rendered(): void;
800
+ destroy(): void;
801
+ private get index();
802
+ private get depth();
803
+ /**
804
+ * Ao carregar um conteúdo salvo os filhos são apenas os `items` blocos
805
+ * seguintes; a partir daí o vínculo vive no dataset, o que mantém a
806
+ * contagem correta mesmo se algum bloco for removido.
807
+ *
808
+ * Toggles aninhados renderizam depois do pai e reescrevem a marcação dos
809
+ * próprios filhos, aprofundando o nível.
810
+ */
811
+ private adopt;
812
+ /** Devolve os filhos diretos ao avô — usado quando o toggle é removido. */
813
+ private releaseChildren;
814
+ /** @internal reaplica visibilidade/contagem; os aninhados reaplicam o próprio estado. */
815
+ sync(): void;
816
+ /** @internal */
817
+ isCollapsed(): boolean;
818
+ /** @internal */
819
+ expand(): void;
820
+ /** @internal marca o editor como alterado após uma mudança estrutural. */
821
+ touch(): void;
822
+ private setStatus;
823
+ /** Enter (ou clique no item vazio) cria um filho e leva o cursor até ele. */
824
+ private createChild;
825
+ save(): ToggleData;
826
+ }
827
+
828
+ /** Inline tool que gera <u> — compatível com @editorjs/underline */
829
+ declare class Underline {
830
+ private api;
831
+ private button;
832
+ static get isInline(): boolean;
833
+ static get title(): string;
834
+ static get sanitize(): {
835
+ u: {};
836
+ };
837
+ get shortcut(): string;
838
+ constructor({ api }: any);
839
+ render(): HTMLButtonElement;
840
+ surround(): void;
841
+ checkState(): boolean;
842
+ }
372
843
 
373
- type TModalProps = {
374
- open: boolean;
375
- onClose: () => void;
376
- children: React__default.ReactNode;
377
- BoxProps?: BoxProps;
378
- } & Omit<ModalProps, 'children'>;
379
844
  /**
380
- * @deprecated Use `Dialog` or `BaseDialog` instead. `Modal` will be removed in a future release.
845
+ * Histórico de desfazer/refazer (CMD/CTRL+Z e CMD/CTRL+Y).
846
+ *
847
+ * O `onChange` do editor é debounced em 400ms e o timer reinicia a cada mutação,
848
+ * ou seja: enquanto se digita sem parar ele nunca dispara e o parágrafo inteiro
849
+ * vira um único ponto de histórico. Por isso aqui o gatilho principal é o
850
+ * `beforeinput` do holder (síncrono) e o `onChange` entra só como reforço para
851
+ * mudanças que não passam pelo teclado (tunes, tabela, upload, drag&drop).
381
852
  */
382
- declare const Modal: ({ open, onClose, BoxProps, ...rest }: TModalProps) => React__default.JSX.Element;
853
+ declare class Undo {
854
+ private editor;
855
+ private holder;
856
+ private maxLength;
857
+ private stack;
858
+ private position;
859
+ /** Último estado conhecido da tela, usado como base do diff. */
860
+ private lastSnapshot;
861
+ private timer;
862
+ private burstStart;
863
+ private caretBefore;
864
+ private muteUntil;
865
+ private destroyed;
866
+ /** Serializa saves/renders para que nada resolva fora de ordem. */
867
+ private chain;
868
+ constructor(editor: EditorJS, holder?: HTMLElement, maxLength?: number);
869
+ destroy(): void;
870
+ /** Define o estado inicial (evita desfazer para um editor vazio). */
871
+ initialize(data?: OutputData | OutputBlockData[]): void;
872
+ clear(): void;
873
+ /** Chamado pelo onChange do editor (tunes, tabela, upload, mover bloco...). */
874
+ registerChange(): void;
875
+ canUndo(): boolean;
876
+ canRedo(): boolean;
877
+ undo(): void;
878
+ redo(): void;
879
+ private reset;
880
+ private enqueue;
881
+ private onBeforeInput;
882
+ private onStructuralEvent;
883
+ /**
884
+ * Marca que houve edição. O primeiro toque de um burst guarda o cursor de
885
+ * antes da alteração; os seguintes só empurram o timer.
886
+ */
887
+ private touch;
888
+ /** Fecha o burst na pausa, mas nunca depois de MAX_BURST. */
889
+ private schedule;
890
+ private commit;
891
+ /** Antecipa um burst ainda pendente (usado antes de desfazer/refazer). */
892
+ private flushPending;
893
+ private snapshot;
894
+ private push;
895
+ private apply;
896
+ /**
897
+ * Atualiza só os blocos que mudaram. Um `blocks.render()` recria o documento
898
+ * inteiro (lento e perde o foco), então ele fica como fallback para quando a
899
+ * lista de blocos muda de tamanho, ordem ou tipo.
900
+ */
901
+ private patch;
902
+ private getCaret;
903
+ private setCaret;
904
+ private indexOf;
905
+ /** Reposiciona o cursor pelo offset de texto dentro do bloco. */
906
+ private applyOffset;
907
+ private onKeyDown;
908
+ }
383
909
 
384
- declare function GetInputLabel<T extends Array<Record<string, any>>, K extends T[number]['name']>(columns: T): (columnName: K) => {
385
- label: any;
386
- name: any;
910
+ type index_AlignmentData = AlignmentData;
911
+ type index_AlignmentTune = AlignmentTune;
912
+ declare const index_AlignmentTune: typeof AlignmentTune;
913
+ type index_Attaches = Attaches;
914
+ declare const index_Attaches: typeof Attaches;
915
+ type index_AttachesData = AttachesData;
916
+ type index_Checklist = Checklist;
917
+ declare const index_Checklist: typeof Checklist;
918
+ type index_ChecklistData = ChecklistData;
919
+ type index_Code = Code;
920
+ declare const index_Code: typeof Code;
921
+ type index_CodeData = CodeData;
922
+ type index_DragDrop = DragDrop;
923
+ declare const index_DragDrop: typeof DragDrop;
924
+ type index_Header = Header;
925
+ declare const index_Header: typeof Header;
926
+ type index_HeaderData = HeaderData;
927
+ type index_Icons = Icons;
928
+ type index_Image = Image;
929
+ declare const index_Image: typeof Image;
930
+ type index_ImageData = ImageData;
931
+ type index_List = List;
932
+ declare const index_List: typeof List;
933
+ type index_ListData = ListData;
934
+ type index_Strikethrough = Strikethrough;
935
+ declare const index_Strikethrough: typeof Strikethrough;
936
+ type index_Table = Table;
937
+ declare const index_Table: typeof Table;
938
+ type index_TableData = TableData;
939
+ type index_TextVariant = TextVariant;
940
+ type index_TextVariantTune = TextVariantTune;
941
+ declare const index_TextVariantTune: typeof TextVariantTune;
942
+ type index_ToggleBlock = ToggleBlock;
943
+ declare const index_ToggleBlock: typeof ToggleBlock;
944
+ type index_ToggleData = ToggleData;
945
+ type index_Underline = Underline;
946
+ declare const index_Underline: typeof Underline;
947
+ type index_Undo = Undo;
948
+ declare const index_Undo: typeof Undo;
949
+ declare const index_iconToHtml: typeof iconToHtml;
950
+ declare const index_icons: typeof icons;
951
+ declare namespace index {
952
+ export { type index_AlignmentData as AlignmentData, index_AlignmentTune as AlignmentTune, index_Attaches as Attaches, type index_AttachesData as AttachesData, index_Checklist as Checklist, type index_ChecklistData as ChecklistData, index_Code as Code, type index_CodeData as CodeData, index_DragDrop as DragDrop, index_Header as Header, type index_HeaderData as HeaderData, type index_Icons as Icons, index_Image as Image, type index_ImageData as ImageData, index_List as List, type index_ListData as ListData, index_Strikethrough as Strikethrough, index_Table as Table, type index_TableData as TableData, type index_TextVariant as TextVariant, index_TextVariantTune as TextVariantTune, index_ToggleBlock as ToggleBlock, type index_ToggleData as ToggleData, index_Underline as Underline, index_Undo as Undo, index_iconToHtml as iconToHtml, index_icons as icons };
953
+ }
954
+
955
+ type ToolEntry = ToolConstructable | ToolSettings;
956
+ type BlockEditorTools = Record<string, ToolEntry | false | null>;
957
+ type UploadResponse = {
958
+ success: number;
959
+ file: Record<string, any>;
960
+ };
961
+ type BlockEditorUploader = {
962
+ uploadByFile(file: File): Promise<UploadResponse>;
387
963
  };
964
+ type CreateToolsOptions = {
965
+ uploader?: BlockEditorUploader;
966
+ placeholder?: string;
967
+ headerPlaceholder?: string;
968
+ tools?: BlockEditorTools;
969
+ };
970
+ declare function mergeTools(defaults: Record<string, ToolEntry>, overrides?: BlockEditorTools): Record<string, ToolEntry>;
971
+ declare function createTools({ uploader, placeholder, headerPlaceholder, tools }?: CreateToolsOptions): Record<string, ToolEntry>;
972
+ type BlockEditorHandle = {
973
+ editor: EditorJS | null;
974
+ save(): Promise<OutputData | undefined>;
975
+ clear(): Promise<void>;
976
+ render(data: OutputData): Promise<void>;
977
+ focus(atEnd?: boolean): Promise<void>;
978
+ undo(): void;
979
+ redo(): void;
980
+ };
981
+ type BlockEditorProps = Omit<EditorConfig, 'holder' | 'holderId' | 'tools' | 'data' | 'onChange' | 'onReady' | 'style'> & CreateToolsOptions & {
982
+ defaultValue?: OutputData;
983
+ undo?: boolean;
984
+ dragDrop?: boolean;
985
+ holder?: string;
986
+ className?: string;
987
+ style?: React__default.CSSProperties;
988
+ nonce?: string;
989
+ onChange?(api: API, event: BlockMutationEvent | BlockMutationEvent[]): void;
990
+ onInitialize?(editor: EditorJS): void;
991
+ onReady?(editor: EditorJS): void;
992
+ };
993
+ declare const BlockEditor: React__default.ForwardRefExoticComponent<Omit<EditorConfig, "data" | "style" | "onChange" | "tools" | "holder" | "holderId" | "onReady"> & CreateToolsOptions & {
994
+ defaultValue?: OutputData;
995
+ undo?: boolean;
996
+ dragDrop?: boolean;
997
+ holder?: string;
998
+ className?: string;
999
+ style?: React__default.CSSProperties;
1000
+ nonce?: string;
1001
+ onChange?(api: API, event: BlockMutationEvent | BlockMutationEvent[]): void;
1002
+ onInitialize?(editor: EditorJS): void;
1003
+ onReady?(editor: EditorJS): void;
1004
+ } & React__default.RefAttributes<BlockEditorHandle>>;
1005
+ /** @deprecated use `BlockEditor` */
1006
+ declare const RichText: React__default.ForwardRefExoticComponent<Omit<EditorConfig, "data" | "style" | "onChange" | "tools" | "holder" | "holderId" | "onReady"> & CreateToolsOptions & {
1007
+ defaultValue?: OutputData;
1008
+ undo?: boolean;
1009
+ dragDrop?: boolean;
1010
+ holder?: string;
1011
+ className?: string;
1012
+ style?: React__default.CSSProperties;
1013
+ nonce?: string;
1014
+ onChange?(api: API, event: BlockMutationEvent | BlockMutationEvent[]): void;
1015
+ onInitialize?(editor: EditorJS): void;
1016
+ onReady?(editor: EditorJS): void;
1017
+ } & React__default.RefAttributes<BlockEditorHandle>>;
1018
+
1019
+ type CheckboxProps = CheckboxWithFormik | CheckboxWithoutFormik;
1020
+ interface CheckboxWithFormik extends CheckboxProps$1 {
1021
+ name: string;
1022
+ label?: string;
1023
+ helperText?: string;
1024
+ withFormik?: true;
1025
+ FormControlLabelProps?: Partial<FormControlLabelProps>;
1026
+ }
1027
+ interface CheckboxWithoutFormik extends CheckboxProps$1 {
1028
+ name?: never;
1029
+ label?: string;
1030
+ helperText?: string;
1031
+ withFormik: false;
1032
+ FormControlLabelProps?: Partial<FormControlLabelProps>;
1033
+ }
1034
+ declare const Checkbox: ({ withFormik, name, ...props }: CheckboxProps) => react_jsx_runtime.JSX.Element;
388
1035
 
389
1036
  interface DialogOptionsProps {
390
1037
  label: string;
@@ -398,22 +1045,37 @@ interface DialogCustomProps extends DialogProps {
398
1045
  options: DialogOptionsProps[];
399
1046
  loading: boolean;
400
1047
  }
401
- declare const Dialog: ({ open, title, loading, body, options, ...rest }: DialogCustomProps) => React__default.JSX.Element;
1048
+ declare const Dialog: ({ open, title, loading, body, options, ...rest }: DialogCustomProps) => react_jsx_runtime.JSX.Element;
402
1049
 
403
1050
  interface IDialogChildrenProps {
404
1051
  onConfirm: (fn: (...params: any[]) => Promise<void>) => (...params: any[]) => Promise<void>;
405
1052
  onCancel: () => void;
406
1053
  }
1054
+ type TDialogConfirmColor = Exclude<NonNullable<ButtonProps['color']>, 'inherit'>;
1055
+ type TDialogConfirmVariant = Extract<NonNullable<ButtonProps['variant']>, 'outlined' | 'contained'>;
407
1056
  interface IDialogConfirmProps {
408
1057
  icon?: IconType;
409
1058
  title?: string;
410
1059
  body?: string;
1060
+ /**
1061
+ * Cor da paleta aplicada ao ícone e ao botão de confirmação.
1062
+ * Sem valor, o ícone usa `warning` e o botão usa `primary`.
1063
+ */
1064
+ color?: TDialogConfirmColor;
1065
+ /** Estilo do botão de confirmação. */
1066
+ variant?: TDialogConfirmVariant;
411
1067
  children: (props: IDialogChildrenProps) => ReactNode;
412
1068
  confirmButtonText?: string;
413
1069
  cancelButtonText?: string;
414
1070
  }
415
1071
  type TUseDialogConfirm = ReturnType<typeof UseDialogConfirm>;
416
- declare function UseDialogConfirm(): {
1072
+ /**
1073
+ * Deve ser usado dentro de um `BaseDialog.Provider`.
1074
+ * Recebe o `name` de um `BaseDialog.Create()` para controlar o diálogo,
1075
+ * ou cria um nome próprio quando nenhum for informado.
1076
+ */
1077
+ declare function UseDialogConfirm(dialogName?: symbol): {
1078
+ name: symbol;
417
1079
  isLoading: boolean;
418
1080
  opened: boolean;
419
1081
  onConfirm: (fn: (...params: any) => Promise<any>) => (...params: any[]) => Promise<void>;
@@ -422,94 +1084,193 @@ declare function UseDialogConfirm(): {
422
1084
  onProceed: (event: any) => Promise<void>;
423
1085
  };
424
1086
 
425
- declare const DialogConfirm: (props: IDialogConfirmProps) => React__default.JSX.Element;
1087
+ declare const DialogConfirm: (props: IDialogConfirmProps) => react_jsx_runtime.JSX.Element;
426
1088
 
427
- interface DialogHeaderProps extends StackProps {
428
- title: string;
429
- IconButtonProps?: IconButtonProps;
430
- TypographyProps?: TypographyProps;
431
- onClose?: () => void;
1089
+ interface EditableTableCellProps extends TableCellProps {
1090
+ name: string;
1091
+ TextFieldProps?: TextFieldProps;
1092
+ type?: TextFieldProps['type'];
1093
+ fullWidth?: boolean;
1094
+ rowData?: Record<string, any>;
1095
+ mask?: FactoryOpts;
1096
+ bordered?: boolean;
1097
+ rowIndex?: string | number;
1098
+ formatCellValue?: (value: string) => string;
1099
+ formatInputDefautvalue?: (value: string) => string;
1100
+ onSave?: (props: OnSaveProps) => void;
1101
+ onCancel?: () => void;
1102
+ }
1103
+ interface OnSaveProps {
1104
+ name: string;
1105
+ event: FocusEvent;
1106
+ value: string;
1107
+ data: Record<string, any>;
432
1108
  }
1109
+ declare const EditableTableCell: (allProps: EditableTableCellProps) => react_jsx_runtime.JSX.Element;
433
1110
 
434
- interface IBaseDialogContext {
435
- opened: symbol[];
436
- isOpened(dialog: symbol): boolean;
437
- toggle(dialog: symbol): boolean;
438
- open(dialog: symbol): void;
439
- close(dialog: symbol): void;
440
- closeAll(): void;
1111
+ /** @deprecated Use {@link ColumnsProps} from `BaseGrid` instead. */
1112
+ interface ColumnTitleProps {
1113
+ name: string;
1114
+ label: string;
1115
+ transformer?: (value: string | number | Date) => string;
1116
+ sx?: TableCellProps['sx'];
1117
+ }
1118
+ /** @deprecated Use {@link FilterProps} from `useFilter` instead. */
1119
+ interface FilterProps {
1120
+ column: string;
1121
+ value: string;
1122
+ transformer?: (value: string | number | Date) => string;
1123
+ }
1124
+ /** @deprecated Use {@link FilterProps} from `useFilter` instead. */
1125
+ type IFilter = FilterProps;
1126
+ /** @deprecated */
1127
+ interface GridProps<T> {
1128
+ columnTitles: ColumnTitleProps[];
1129
+ defaultData: T[];
1130
+ tableData: T[];
1131
+ selectedFilters: FilterProps[];
1132
+ setSelectedFilters(value: FilterProps[]): void;
1133
+ setTableData(value: T[]): void;
1134
+ updateFilters(value: Record<string, any>[]): void;
1135
+ rowOptions?: number[];
1136
+ footer?: ReactNode;
1137
+ customButtons?: ReactNode;
1138
+ isLoading?: boolean;
1139
+ noFilterButtons?: boolean;
1140
+ noPagination?: boolean;
1141
+ noFilters?: boolean;
1142
+ primaryKey?: string;
441
1143
  }
1144
+ /**
1145
+ * @deprecated Use {@link BaseGrid} with the {@link useGrid} or {@link useAsyncGrid} hook instead.
1146
+ * `BaseGrid` separates rendering from state management, eliminating the need to pass
1147
+ * `tableData`, `setTableData`, `selectedFilters`, and `updateFilters` as props.
1148
+ */
1149
+ declare const Grid: <ObjectType>(props: PropsWithChildren<GridProps<ObjectType>>) => react_jsx_runtime.JSX.Element;
442
1150
 
443
- declare function useBaseDialog(): IBaseDialogContext;
444
- declare function useBaseDialogInstance(): {
445
- name: symbol;
446
- actions: ReturnType<typeof useBaseDialog>;
447
- };
1151
+ /** @deprecated Use `TableCell` from `@mui/material` directly. */
1152
+ declare const Td: typeof TableCell;
448
1153
 
449
- interface IBaseDialogInstanceProviderProps {
450
- children: React__default.ReactNode;
451
- name: symbol;
1154
+ /** @deprecated Use `TableRow` from `@mui/material` directly. */
1155
+ declare const Tr: _mui_material_OverridableComponent.OverridableComponent<_mui_material.TableRowTypeMap<{}, "tr">>;
1156
+
1157
+ /** @deprecated Use the `useFilter` hook instead. */
1158
+ declare function filterData<T>(filters: FilterProps[], defaultData: {
1159
+ current: T[];
1160
+ }): T[];
1161
+
1162
+ interface InputProps extends StandardTextFieldProps {
1163
+ name: string;
1164
+ label: string;
1165
+ shrink?: boolean;
1166
+ withFormik?: boolean;
1167
+ }
1168
+ declare const Input: FC<InputProps>;
1169
+
1170
+ interface InputMaskProps extends Partial<StandardTextFieldProps> {
1171
+ name: string;
1172
+ label: string;
1173
+ withFormik?: boolean;
1174
+ value?: string;
1175
+ mask: FactoryOpts;
1176
+ onChangeValue?: (value: string, unmaskedValue: string) => void;
1177
+ }
1178
+ declare function InputMask({ withFormik, ...rest }: InputMaskProps): react_jsx_runtime.JSX.Element;
1179
+
1180
+ interface LargeButtonProps extends ButtonProps {
1181
+ loading?: boolean;
1182
+ children: ReactNode;
1183
+ CircularProgressProps?: CircularProgressProps;
452
1184
  }
1185
+ declare const LargeButton: ({ loading, children, CircularProgressProps, sx, ...rest }: LargeButtonProps) => react_jsx_runtime.JSX.Element;
453
1186
 
454
- interface IBaseDialogContainerProps {
1187
+ type TModalProps = {
1188
+ open: boolean;
1189
+ onClose: () => void;
1190
+ children: React__default.ReactNode;
455
1191
  BoxProps?: BoxProps;
456
- children: React__default.ReactNode | ((props: {
457
- close: () => void;
458
- }) => React__default.ReactNode);
1192
+ } & Omit<ModalProps, 'children'>;
1193
+ /**
1194
+ * @deprecated Use `Dialog` or `BaseDialog` instead. `Modal` will be removed in a future release.
1195
+ */
1196
+ declare const Modal: ({ open, onClose, BoxProps, ...rest }: TModalProps) => react_jsx_runtime.JSX.Element;
1197
+
1198
+ type RadioOptionProps = {
1199
+ value: string | number | boolean;
1200
+ label: string;
1201
+ };
1202
+ type RadioOptionsProps = RadioWithFormik | RadioWithoutFormik;
1203
+ interface RadioWithFormik extends RadioGroupProps {
1204
+ name: string;
1205
+ label?: string;
1206
+ options: RadioOptionProps[];
1207
+ helperText?: string;
1208
+ withFormik?: true;
459
1209
  }
460
- declare const BaseDialogContainer: ({ children, BoxProps, ...rest }: IBaseDialogContainerProps) => React__default.JSX.Element;
461
- interface IBaseDialogBodyProps extends BoxProps {
1210
+ interface RadioWithoutFormik extends RadioGroupProps {
1211
+ name?: never;
1212
+ label?: string;
1213
+ options: RadioOptionProps[];
1214
+ helperText?: string;
1215
+ withFormik: false;
462
1216
  }
463
- declare const BaseDialogBody: (props: IBaseDialogBodyProps) => React__default.JSX.Element;
464
- interface IBaseDialogTriggerProps extends Omit<ButtonProps, 'name'> {
465
- name: symbol;
1217
+ declare const Radio: ({ name, withFormik, ...rest }: RadioOptionsProps) => react_jsx_runtime.JSX.Element;
1218
+
1219
+ interface CustomInputLabelProps extends InputLabelProps {
1220
+ size?: 'small';
466
1221
  }
467
- declare const BaseDialogTrigger: ({ name, onClick, ...props }: IBaseDialogTriggerProps) => React__default.JSX.Element;
468
- declare const BaseDialogCreate: (name?: symbol) => {
469
- name: symbol;
470
- Trigger: (props: Omit<IBaseDialogTriggerProps, "name">) => React__default.JSX.Element;
471
- Root: (props: Omit<IBaseDialogInstanceProviderProps, "name">) => React__default.JSX.Element;
472
- Container: ({ children, BoxProps, ...rest }: IBaseDialogContainerProps) => React__default.JSX.Element;
473
- Header: ({ title, onClose, IconButtonProps, TypographyProps, ...props }: DialogHeaderProps) => React__default.JSX.Element;
474
- Body: (props: IBaseDialogBodyProps) => React__default.JSX.Element;
475
- };
476
- declare const BaseDialog: {
477
- Create: (name?: symbol) => {
478
- name: symbol;
479
- Trigger: (props: Omit<IBaseDialogTriggerProps, "name">) => React__default.JSX.Element;
480
- Root: (props: Omit<IBaseDialogInstanceProviderProps, "name">) => React__default.JSX.Element;
481
- Container: ({ children, BoxProps, ...rest }: IBaseDialogContainerProps) => React__default.JSX.Element;
482
- Header: ({ title, onClose, IconButtonProps, TypographyProps, ...props }: DialogHeaderProps) => React__default.JSX.Element;
483
- Body: (props: IBaseDialogBodyProps) => React__default.JSX.Element;
484
- };
485
- Trigger: ({ name, onClick, ...props }: IBaseDialogTriggerProps) => React__default.JSX.Element;
486
- Provider: (props: any) => React__default.JSX.Element;
487
- Root: (props: IBaseDialogInstanceProviderProps) => React__default.JSX.Element;
488
- Container: ({ children, BoxProps, ...rest }: IBaseDialogContainerProps) => React__default.JSX.Element;
489
- Header: ({ title, onClose, IconButtonProps, TypographyProps, ...props }: DialogHeaderProps) => React__default.JSX.Element;
490
- Body: (props: IBaseDialogBodyProps) => React__default.JSX.Element;
1222
+ type MuiSelectPropsWithouVariant<T> = Omit<SelectProps$1<T>, 'variant'>;
1223
+ type SelectProps<T> = MuiSelectPropsWithouVariant<T> & {
1224
+ name: string;
1225
+ label: string;
1226
+ withFormik?: boolean;
1227
+ FormControlProps?: Partial<FormControlProps>;
1228
+ InputLabelProps?: Partial<CustomInputLabelProps>;
1229
+ helperText?: string;
491
1230
  };
1231
+ declare function Select<T>({ withFormik, helperText, ...rest }: SelectProps<T>): react_jsx_runtime.JSX.Element;
492
1232
 
493
- type FormHelperContextProps = {
494
- formatErrorMessage: (message: any) => string;
495
- api: AxiosInstance;
1233
+ type SwitchProps = SwitchWithFormik | SwitchWithoutFormik;
1234
+ interface SwitchWithFormik extends SwitchProps$1 {
1235
+ name: string;
1236
+ label?: string;
1237
+ helperText?: string;
1238
+ withFormik?: true;
1239
+ FormControlLabelProps?: Partial<FormControlLabelProps>;
1240
+ }
1241
+ interface SwitchWithoutFormik extends SwitchProps$1 {
1242
+ name?: never;
1243
+ label?: string;
1244
+ helperText?: string;
1245
+ withFormik: false;
1246
+ FormControlLabelProps?: Partial<FormControlLabelProps>;
1247
+ }
1248
+ declare const Switch: ({ withFormik, name, ...props }: SwitchProps) => react_jsx_runtime.JSX.Element;
1249
+
1250
+ declare function getTabProps(index: string): {
1251
+ id: string;
1252
+ 'aria-controls': string;
496
1253
  };
497
- declare const FormHelperContext: React__default.Context<FormHelperContextProps>;
498
- type FormHelperProviderProps = {
499
- formatErrorMessage: (message: any) => string;
500
- children: ReactNode;
501
- api: AxiosInstance;
1254
+ interface TabPanelProps {
1255
+ children: React__default.ReactNode;
1256
+ value: number;
1257
+ index: number;
1258
+ }
1259
+ declare const TabPanel: (props: TabPanelProps) => react_jsx_runtime.JSX.Element;
1260
+
1261
+ declare function GetInputLabel<T extends Array<Record<string, any>>, K extends T[number]['name']>(columns: T): (columnName: K) => {
1262
+ label: any;
1263
+ name: any;
502
1264
  };
503
- declare const FormHelperProvider: ({ formatErrorMessage, api, children }: FormHelperProviderProps) => React__default.JSX.Element;
504
1265
 
505
1266
  type AlertContextProps = {
506
1267
  createAlert(message: string, type: AlertColor): void;
507
1268
  };
508
- declare const AlertContext: React__default.Context<AlertContextProps>;
1269
+ declare const AlertContext: React.Context<AlertContextProps>;
509
1270
  type AlertProviderProps = {
510
1271
  children: ReactNode;
511
1272
  };
512
- declare const AlertProvider: ({ children }: AlertProviderProps) => React__default.JSX.Element;
1273
+ declare const AlertProvider: ({ children }: AlertProviderProps) => react_jsx_runtime.JSX.Element;
513
1274
 
514
1275
  type AuthenticateStatus = 'autenticated' | 'unauthenticated' | 'loading';
515
1276
  interface AuthContextProps<T> {
@@ -518,23 +1279,35 @@ interface AuthContextProps<T> {
518
1279
  signIn(credentials: Record<string, any>): Promise<boolean>;
519
1280
  signOut: () => Promise<void>;
520
1281
  }
521
- declare function createAuthContext<T>(): React__default.Context<AuthContextProps<T>>;
1282
+ declare function createAuthContext<T>(): React.Context<AuthContextProps<T>>;
522
1283
  declare function CreateAuthProvider<T>({ api, children, sessionTokenName, Provider }: {
523
1284
  Provider: Provider<AuthContextProps<T>>;
524
1285
  children: ReactNode;
525
1286
  api: AxiosInstance;
526
1287
  sessionTokenName: string;
527
- }): React__default.JSX.Element;
1288
+ }): react_jsx_runtime.JSX.Element;
528
1289
 
529
- declare class HttpError extends Error {
530
- status: number;
531
- constructor(status: number, message: any);
532
- }
1290
+ type FormHelperContextProps = {
1291
+ formatErrorMessage: (message: any) => string;
1292
+ api: AxiosInstance;
1293
+ };
1294
+ declare const FormHelperContext: React.Context<FormHelperContextProps>;
1295
+ type FormHelperProviderProps = {
1296
+ formatErrorMessage: (message: any) => string;
1297
+ children: ReactNode;
1298
+ api: AxiosInstance;
1299
+ };
1300
+ declare const FormHelperProvider: ({ formatErrorMessage, api, children }: FormHelperProviderProps) => react_jsx_runtime.JSX.Element;
533
1301
 
534
1302
  declare class DomainError extends Error {
535
1303
  constructor(message: any);
536
1304
  }
537
1305
 
1306
+ declare class HttpError extends Error {
1307
+ status: number;
1308
+ constructor(status: number, message: any);
1309
+ }
1310
+
538
1311
  interface BaseRequest {
539
1312
  method?: string;
540
1313
  }
@@ -694,6 +1467,10 @@ declare class AuthHelper {
694
1467
  invalidateCookies: (res: HelperResponse) => any;
695
1468
  }
696
1469
 
1470
+ declare const useAlert: () => {
1471
+ createAlert(message: string, type: _mui_material.AlertColor): void;
1472
+ };
1473
+
697
1474
  type SortedDirectionProps = 'asc' | 'desc';
698
1475
  interface SortedByProps {
699
1476
  prop: string;
@@ -706,7 +1483,7 @@ interface SearchOptions {
706
1483
  }
707
1484
  interface UseGridBaseProps<T> {
708
1485
  columns: ColumnsProps[];
709
- filters?: FilterProps[];
1486
+ filters?: FilterProps$1[];
710
1487
  rowsPerPageOptions?: number[];
711
1488
  search?: SearchOptions;
712
1489
  defaultCurrentPage?: number;
@@ -716,7 +1493,7 @@ interface UseGridBaseProps<T> {
716
1493
  }
717
1494
  type UseGridPropsOnRequest<T> = {
718
1495
  onRequest(props: {
719
- filters: FilterProps[];
1496
+ filters: FilterProps$1[];
720
1497
  page: number;
721
1498
  rowsPerPage: number;
722
1499
  search?: SearchOptions;
@@ -751,15 +1528,6 @@ declare function useAsyncGrid<T extends Record<string, any>>({ columns, filters,
751
1528
 
752
1529
  declare function useEvent(event: keyof WindowEventMap, handler: (ev: any) => void, passive?: boolean): void;
753
1530
 
754
- declare function useLoading<T = string>(): {
755
- isLoading: (prop: T) => boolean;
756
- setLoading: (prop: T, remove?: boolean) => void;
757
- };
758
-
759
- declare const useAlert: () => {
760
- createAlert(message: string, type: _mui_material.AlertColor): void;
761
- };
762
-
763
1531
  type Methods = 'get' | 'post' | 'put' | 'delete' | 'patch' | 'options';
764
1532
  type HandleProps = {
765
1533
  name: `${Methods}:${string}`;
@@ -772,4 +1540,9 @@ declare function useFormHelper(): {
772
1540
  createAlert(message: string, type: _mui_material.AlertColor): void;
773
1541
  };
774
1542
 
775
- export { AlertContext, AlertProvider, ApiHelper, type AuthContextProps, AuthHelper, Autocomplete, BaseDialog, BaseDialogBody, BaseDialogContainer, BaseDialogCreate, BaseDialogTrigger, BaseGrid, BaseGridAutoRows, type BaseRequest, type BaseResponse, Checkbox, type ColumnTitleProps, type ColumnsProps, CreateAuthProvider, Dialog, DialogConfirm, DomainError, EditableTableCell, type FilterCompareType, type FilterProps, FormHelperContext, FormHelperProvider, GetInputLabel, Grid, type HandlerProps, type HelperRequest, type HelperResponse, HttpError, type IBaseDialogBodyProps, type IBaseDialogContainerProps, type IBaseDialogTriggerProps, type IDialogConfirmProps, type IFilter, Input, InputMask, LargeButton, type MethodProps, type MiddlewaresProps, Modal, type NextHandlerApiRequest, type NookiesRequest, type NookiesResponse, Radio, Select, type ServerSidePropsContext, type SortedByProps$1 as SortedByProps, Switch, type TApiHelperProps, type TApiOptions, type TUseDialogConfirm, TabPanel, type TabPanelProps, Td, Tr, UseDialogConfirm, createApiHelper, createAuthContext, createFilter, destroyCookie, filterData, getTabProps, nookies, parseCookies, setCookie, useAlert, useAsyncGrid, useBaseDialog, useBaseDialogInstance, useEvent, useFilter, useFormHelper, useGrid, useLoading };
1543
+ declare function useLoading<T = string>(): {
1544
+ isLoading: (prop: T) => boolean;
1545
+ setLoading: (prop: T, remove?: boolean) => void;
1546
+ };
1547
+
1548
+ export { AlertContext, AlertProvider, ApiHelper, type AuthContextProps, AuthHelper, Autocomplete, BaseDialog, BaseDialogBody, BaseDialogContainer, BaseDialogCreate, BaseDialogTrigger, BaseGrid, BaseGridAutoRows, type BaseRequest, type BaseResponse, BlockEditor, type BlockEditorHandle, type BlockEditorProps, type BlockEditorTools, type BlockEditorUploader, Checkbox, type ColumnTitleProps, type ColumnsProps, CreateAuthProvider, type CreateToolsOptions, Dialog, DialogConfirm, DomainError, EditableTableCell, type FilterCompareType, type FilterProps$1 as FilterProps, FormHelperContext, FormHelperProvider, GetInputLabel, Grid, type HandlerProps, type HelperRequest, type HelperResponse, HttpError, type IBaseDialogBodyProps, type IBaseDialogContainerProps, type IBaseDialogTriggerProps, type IDialogConfirmProps, type IFilter, Input, InputMask, LargeButton, type MethodProps, type MiddlewaresProps, Modal, type NextHandlerApiRequest, type NookiesRequest, type NookiesResponse, Radio, RichText, Select, type ServerSidePropsContext, type SortedByProps$1 as SortedByProps, Switch, type TApiHelperProps, type TApiOptions, type TDialogConfirmColor, type TDialogConfirmVariant, type TUseDialogConfirm, TabPanel, type TabPanelProps, Td, type ToolEntry, Tr, type UploadResponse, UseDialogConfirm, icons as blockEditorIcons, index as blockEditorPlugins, createApiHelper, createAuthContext, createFilter, createTools, destroyCookie, filterData, getTabProps, iconToHtml, mergeTools, nookies, parseCookies, setCookie, useAlert, useAsyncGrid, useBaseDialog, useBaseDialogInstance, useEvent, useFilter, useFormHelper, useGrid, useLoading };