forlogic-core 1.15.2 → 1.15.4

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.
Files changed (198) hide show
  1. package/dist/assets/index.d.ts +6 -0
  2. package/dist/auth/components/ProtectedRoute.d.ts +6 -0
  3. package/dist/auth/components/UserInfo.d.ts +10 -0
  4. package/dist/auth/contexts/AuthContext.d.ts +84 -0
  5. package/dist/auth/pages/CallbackPage.d.ts +1 -0
  6. package/dist/auth/pages/LoginPage.d.ts +2 -0
  7. package/dist/auth/services/AuthService.d.ts +40 -0
  8. package/dist/auth/services/SupabaseTokenService.d.ts +3 -0
  9. package/dist/auth/services/TokenManager.d.ts +51 -0
  10. package/dist/auth/services/TokenRegenerationService.d.ts +12 -0
  11. package/dist/auth/services/TokenService.d.ts +42 -0
  12. package/dist/auth/utils/AuthUtils.d.ts +4 -0
  13. package/dist/auth/utils/ErrorInterceptor.d.ts +15 -0
  14. package/dist/components/ErrorBoundary.d.ts +19 -0
  15. package/dist/components/layout/AppHeader.d.ts +63 -0
  16. package/dist/components/layout/AppLayout.d.ts +10 -0
  17. package/dist/components/layout/AppSidebar.d.ts +10 -0
  18. package/dist/components/layout/BodyContent.d.ts +60 -0
  19. package/dist/components/layout/SidebarActionTrigger.d.ts +34 -0
  20. package/dist/components/layout/SidebarHeader.d.ts +5 -0
  21. package/dist/components/layout/sidebar-utils.d.ts +12 -0
  22. package/dist/components/modules/ModuleGrid.d.ts +9 -0
  23. package/dist/components/modules/ModulesDialog.d.ts +3 -0
  24. package/dist/components/modules/icons/ModulesCardIcons.d.ts +19 -0
  25. package/dist/components/modules/index.d.ts +4 -0
  26. package/dist/components/modules/modulesData.d.ts +6 -0
  27. package/dist/components/modules/types.d.ts +35 -0
  28. package/dist/components/ui/accordion.d.ts +7 -0
  29. package/dist/components/ui/action-button.d.ts +43 -0
  30. package/dist/components/ui/alert-dialog.d.ts +20 -0
  31. package/dist/components/ui/alert.d.ts +12 -0
  32. package/dist/components/ui/avatar.d.ts +6 -0
  33. package/dist/components/ui/badge.d.ts +9 -0
  34. package/dist/components/ui/breadcrumb.d.ts +19 -0
  35. package/dist/components/ui/button-group.d.ts +9 -0
  36. package/dist/components/ui/button.d.ts +11 -0
  37. package/dist/components/ui/calendar.d.ts +8 -0
  38. package/dist/components/ui/card.d.ts +8 -0
  39. package/dist/components/ui/chart.d.ts +62 -0
  40. package/dist/components/ui/checkbox.d.ts +4 -0
  41. package/dist/components/ui/collapsible.d.ts +5 -0
  42. package/dist/components/ui/color-picker.d.ts +8 -0
  43. package/dist/components/ui/combobox.d.ts +33 -0
  44. package/dist/components/ui/command.d.ts +23 -0
  45. package/dist/components/ui/context-menu.d.ts +27 -0
  46. package/dist/components/ui/data-list.d.ts +86 -0
  47. package/dist/components/ui/date-picker.d.ts +9 -0
  48. package/dist/components/ui/dialog.d.ts +36 -0
  49. package/dist/components/ui/disabled-menu-item.d.ts +25 -0
  50. package/dist/components/ui/drawer.d.ts +22 -0
  51. package/dist/components/ui/dropdown-menu.d.ts +27 -0
  52. package/dist/components/ui/empty-state.d.ts +79 -0
  53. package/dist/components/ui/form.d.ts +23 -0
  54. package/dist/components/ui/grid.d.ts +53 -0
  55. package/dist/components/ui/hover-card.d.ts +6 -0
  56. package/dist/components/ui/icon-picker.d.ts +8 -0
  57. package/dist/components/ui/input-group.d.ts +97 -0
  58. package/dist/components/ui/input.d.ts +37 -0
  59. package/dist/components/ui/label.d.ts +23 -0
  60. package/dist/components/ui/loading-state.d.ts +52 -0
  61. package/dist/components/ui/menubar.d.ts +33 -0
  62. package/dist/components/ui/navigation-menu.d.ts +12 -0
  63. package/dist/components/ui/onboarding-dialog.d.ts +43 -0
  64. package/dist/components/ui/page-breadcrumb.d.ts +77 -0
  65. package/dist/components/ui/pagination.d.ts +28 -0
  66. package/dist/components/ui/popover.d.ts +49 -0
  67. package/dist/components/ui/progress.d.ts +22 -0
  68. package/dist/components/ui/radio-group.d.ts +63 -0
  69. package/dist/components/ui/resizable.d.ts +23 -0
  70. package/dist/components/ui/rich-text-editor.d.ts +45 -0
  71. package/dist/components/ui/scroll-area.d.ts +37 -0
  72. package/dist/components/ui/select.d.ts +16 -0
  73. package/dist/components/ui/separator.d.ts +4 -0
  74. package/dist/components/ui/sheet.d.ts +32 -0
  75. package/dist/components/ui/sidebar.d.ts +66 -0
  76. package/dist/components/ui/skeleton-variants.d.ts +16 -0
  77. package/dist/components/ui/skeleton.d.ts +2 -0
  78. package/dist/components/ui/slider.d.ts +4 -0
  79. package/dist/components/ui/sonner.d.ts +3 -0
  80. package/dist/components/ui/spinner.d.ts +6 -0
  81. package/dist/components/ui/split-button.d.ts +70 -0
  82. package/dist/components/ui/stack.d.ts +12 -0
  83. package/dist/components/ui/step-selector.d.ts +39 -0
  84. package/dist/components/ui/switch.d.ts +4 -0
  85. package/dist/components/ui/tab-page-layout.d.ts +19 -0
  86. package/dist/components/ui/table-resize-handle.d.ts +15 -0
  87. package/dist/components/ui/table.d.ts +10 -0
  88. package/dist/components/ui/tabs.d.ts +7 -0
  89. package/dist/components/ui/textarea.d.ts +5 -0
  90. package/dist/components/ui/toggle-group.d.ts +12 -0
  91. package/dist/components/ui/toggle.d.ts +12 -0
  92. package/dist/components/ui/tooltip.d.ts +7 -0
  93. package/dist/components/ui/truncated-cell.d.ts +7 -0
  94. package/dist/components/ui/typography.d.ts +16 -0
  95. package/dist/config/index.d.ts +53 -0
  96. package/dist/contexts/LocaleContext.d.ts +15 -0
  97. package/dist/contexts/ModalStateContext.d.ts +57 -0
  98. package/dist/contexts/NavigationContext.d.ts +13 -0
  99. package/dist/contexts/PageMetadataContext.d.ts +43 -0
  100. package/dist/crud/components/ActionMenuItems.d.ts +17 -0
  101. package/dist/crud/components/BaseForm.d.ts +6 -0
  102. package/dist/crud/components/ContextMenu.d.ts +21 -0
  103. package/dist/crud/components/CrudActionBar.d.ts +38 -0
  104. package/dist/crud/components/CrudGrid.d.ts +43 -0
  105. package/dist/crud/components/CrudPagination.d.ts +12 -0
  106. package/dist/crud/components/CrudTable.d.ts +41 -0
  107. package/dist/crud/components/FilterBar.d.ts +136 -0
  108. package/dist/crud/components/TableFooter.d.ts +14 -0
  109. package/dist/crud/components/TableRowActions.d.ts +14 -0
  110. package/dist/crud/createCrudPage.d.ts +99 -0
  111. package/dist/crud/createSimpleService.d.ts +85 -0
  112. package/dist/crud/generateCrudConfig.d.ts +73 -0
  113. package/dist/crud/hooks/useBaseForm.d.ts +8 -0
  114. package/dist/crud/hooks/useCrud.d.ts +117 -0
  115. package/dist/crud/primitives/ActionMenu.d.ts +28 -0
  116. package/dist/crud/primitives/FilterBar.d.ts +24 -0
  117. package/dist/crud/primitives/Pagination.d.ts +24 -0
  118. package/dist/crud/primitives/Table.d.ts +26 -0
  119. package/dist/crud/primitives/index.d.ts +11 -0
  120. package/dist/crud/primitives/types.d.ts +76 -0
  121. package/dist/crud/utils/routingHelpers.d.ts +30 -0
  122. package/dist/exports/crud.d.ts +21 -0
  123. package/dist/exports/integrations.d.ts +13 -0
  124. package/dist/exports/ui.d.ts +73 -0
  125. package/dist/hooks/useActiveModules.d.ts +45 -0
  126. package/dist/hooks/useColumnResize.d.ts +21 -0
  127. package/dist/hooks/useDebounce.d.ts +56 -0
  128. package/dist/hooks/useI18nFormatters.d.ts +40 -0
  129. package/dist/hooks/usePageTitle.d.ts +4 -0
  130. package/dist/hooks/usePermissionQuery.d.ts +49 -0
  131. package/dist/hooks/useRowResize.d.ts +19 -0
  132. package/dist/hooks/useSidebarResize.d.ts +19 -0
  133. package/dist/hooks/useWizard.d.ts +40 -0
  134. package/dist/i18n/DatabaseBackend.d.ts +9 -0
  135. package/dist/i18n/components/TranslationLoader.d.ts +10 -0
  136. package/dist/i18n/config.d.ts +2 -0
  137. package/dist/i18n/constants.d.ts +126 -0
  138. package/dist/i18n/index.d.ts +21 -0
  139. package/dist/index.d.ts +83 -0
  140. package/dist/index.esm.js +1 -1
  141. package/dist/index.js +1 -1
  142. package/dist/leadership/components/LeaderRow.d.ts +9 -0
  143. package/dist/leadership/components/LeadershipDialog.d.ts +10 -0
  144. package/dist/leadership/components/LeadershipForm.d.ts +8 -0
  145. package/dist/leadership/components/LeadershipPage.d.ts +1 -0
  146. package/dist/leadership/hooks/useLeadershipApi.d.ts +2 -0
  147. package/dist/leadership/hooks/useLeadershipMutations.d.ts +30 -0
  148. package/dist/leadership/index.d.ts +14 -0
  149. package/dist/leadership/types.d.ts +17 -0
  150. package/dist/leadership/utils/leadershipUtils.d.ts +8 -0
  151. package/dist/media/components/ImageEditor.d.ts +22 -0
  152. package/dist/media/components/ImageRenderer.d.ts +23 -0
  153. package/dist/media/components/VideoEditor.d.ts +22 -0
  154. package/dist/media/components/VideoRenderer.d.ts +8 -0
  155. package/dist/media/hooks/useMediaUpload.d.ts +20 -0
  156. package/dist/media/index.d.ts +49 -0
  157. package/dist/media/types.d.ts +66 -0
  158. package/dist/media/utils/imageHelpers.d.ts +28 -0
  159. package/dist/media/utils/videoHelpers.d.ts +35 -0
  160. package/dist/places/components/ManageAccessModal.d.ts +11 -0
  161. package/dist/places/components/PlaceCard.d.ts +12 -0
  162. package/dist/places/components/PlacesList.d.ts +12 -0
  163. package/dist/places/index.d.ts +8 -0
  164. package/dist/places/services/PlaceService.d.ts +9 -0
  165. package/dist/places/types.d.ts +10 -0
  166. package/dist/providers/CoreProviders.d.ts +66 -0
  167. package/dist/providers/index.d.ts +2 -0
  168. package/dist/qualiex/components/QualiexUserField.d.ts +125 -0
  169. package/dist/qualiex/hooks/useQualiexUsers.d.ts +51 -0
  170. package/dist/qualiex/services/qualiexApi.d.ts +21 -0
  171. package/dist/qualiex/utils/QualiexErrorInterceptor.d.ts +15 -0
  172. package/dist/qualiex/utils/userPlaceUtils.d.ts +16 -0
  173. package/dist/services/BaseService.d.ts +51 -0
  174. package/dist/services/EmailService.d.ts +110 -0
  175. package/dist/services/ErrorService.d.ts +19 -0
  176. package/dist/services/QualiexEnrichmentService.d.ts +65 -0
  177. package/dist/services/QualiexFieldHelpers.d.ts +17 -0
  178. package/dist/services/TranslationService.d.ts +20 -0
  179. package/dist/setup.d.ts +14 -0
  180. package/dist/sign/components/D4SignWidget.d.ts +2 -0
  181. package/dist/sign/components/DocumentSigner.d.ts +2 -0
  182. package/dist/sign/components/SignConfigForm.d.ts +2 -0
  183. package/dist/sign/components/SignWidget.d.ts +21 -0
  184. package/dist/sign/hooks/useSignConfig.d.ts +6 -0
  185. package/dist/sign/index.d.ts +7 -0
  186. package/dist/sign/services/signService.d.ts +23 -0
  187. package/dist/sign/types.d.ts +53 -0
  188. package/dist/supabase/SupabaseSingleton.d.ts +3 -0
  189. package/dist/supabase/client.d.ts +2 -0
  190. package/dist/supabase/publicClient.d.ts +2 -0
  191. package/dist/supabase/types.d.ts +377 -0
  192. package/dist/types/sidebar.d.ts +49 -0
  193. package/dist/types.d.ts +499 -0
  194. package/dist/utils/formatters/currencyFormatters.d.ts +1 -0
  195. package/dist/utils/formatters/dateFormatters.d.ts +52 -0
  196. package/dist/utils/index.d.ts +8 -0
  197. package/dist/utils/linkHelpers.d.ts +4 -0
  198. package/package.json +1 -1
@@ -0,0 +1,9 @@
1
+ import { LeaderNode, Leader } from '../types';
2
+ interface LeaderRowProps {
3
+ leader: LeaderNode;
4
+ expandedIds: Set<string>;
5
+ onToggleExpand: (id: string) => void;
6
+ onEdit: (leader: Leader) => void;
7
+ }
8
+ export declare function LeaderRow({ leader, expandedIds, onToggleExpand, onEdit }: LeaderRowProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,10 @@
1
+ import { Leader } from '../types';
2
+ interface LeadershipDialogProps {
3
+ open: boolean;
4
+ onOpenChange: (open: boolean) => void;
5
+ leader?: Leader;
6
+ prefilledLeaderId?: string | null;
7
+ title: string;
8
+ }
9
+ export declare function LeadershipDialog({ open, onOpenChange, leader, prefilledLeaderId, title }: LeadershipDialogProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,8 @@
1
+ import { Leader } from '../types';
2
+ interface LeadershipFormProps {
3
+ leader?: Leader;
4
+ prefilledLeaderId?: string | null;
5
+ onSuccess?: () => void;
6
+ }
7
+ export declare function LeadershipForm({ leader, prefilledLeaderId, onSuccess }: LeadershipFormProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1 @@
1
+ export declare function LeadershipPage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { LeaderNode } from '../types';
2
+ export declare function useLeadershipApi(): import("@tanstack/react-query").UseQueryResult<LeaderNode[], Error>;
@@ -0,0 +1,30 @@
1
+ interface CreateLeaderData {
2
+ id_user: string;
3
+ id_leader: string | null;
4
+ }
5
+ interface CreateMultipleLeadersData {
6
+ id_leader: string | null;
7
+ users: Array<{
8
+ id_user: string;
9
+ }>;
10
+ }
11
+ interface UpdateLeaderData {
12
+ id: string;
13
+ id_leader: string | null;
14
+ }
15
+ export declare function useCreateLeaderMutation(): import("@tanstack/react-query").UseMutationResult<any, Error, CreateLeaderData, unknown>;
16
+ export declare function useCreateSingleLeaderMutation(): import("@tanstack/react-query").UseMutationResult<any, Error, CreateLeaderData, unknown>;
17
+ export declare function useCreateMultipleLeadersMutation(): import("@tanstack/react-query").UseMutationResult<any, Error, CreateMultipleLeadersData, unknown>;
18
+ export declare function useUpdateLeaderMutation(): import("@tanstack/react-query").UseMutationResult<any, Error, UpdateLeaderData, unknown>;
19
+ export declare function useRemoveLeaderMutation(): import("@tanstack/react-query").UseMutationResult<void, Error, string, unknown>;
20
+ export declare function useSyncSubordinatesMutation(): import("@tanstack/react-query").UseMutationResult<{
21
+ unlinked: number;
22
+ updated: number;
23
+ created: number;
24
+ }, Error, {
25
+ leaderUserId: string;
26
+ selectedUsers: Array<{
27
+ id_user: string;
28
+ }>;
29
+ }, unknown>;
30
+ export {};
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Leadership Module
3
+ *
4
+ * Componente hierárquico de liderança reutilizável para gerenciar
5
+ * relações de liderança entre usuários do Qualiex.
6
+ */
7
+ export * from './types';
8
+ export * from './utils/leadershipUtils';
9
+ export * from './hooks/useLeadershipApi';
10
+ export * from './hooks/useLeadershipMutations';
11
+ export * from './components/LeadershipPage';
12
+ export * from './components/LeaderRow';
13
+ export * from './components/LeadershipDialog';
14
+ export * from './components/LeadershipForm';
@@ -0,0 +1,17 @@
1
+ export interface Leader {
2
+ id: string;
3
+ alias: string;
4
+ id_user: string;
5
+ id_leader: string | null;
6
+ is_removed: boolean;
7
+ is_active: boolean;
8
+ created_at: string;
9
+ updated_at: string;
10
+ name?: string;
11
+ email?: string;
12
+ subordinatesCount?: number;
13
+ }
14
+ export interface LeaderNode extends Leader {
15
+ children: LeaderNode[];
16
+ level: number;
17
+ }
@@ -0,0 +1,8 @@
1
+ import { Leader, LeaderNode } from '../types';
2
+ /**
3
+ * Filtra líderes inválidos (sem nome enriquecido) e promove seus filhos
4
+ * para o ancestral válido mais próximo ou para a raiz
5
+ */
6
+ export declare function filterAndPromoteOrphans(leaders: Leader[], validUserIds: Set<string>): Leader[];
7
+ export declare function buildHierarchy(leaders: Leader[]): LeaderNode[];
8
+ export declare function flattenTree(nodes: LeaderNode[]): LeaderNode[];
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Image Editor Component
3
+ *
4
+ * Editor genérico de imagem para forlogic-core.
5
+ * Suporta URL e upload de arquivos.
6
+ *
7
+ * @example
8
+ * ```tsx
9
+ * import { ImageEditor } from 'forlogic-core';
10
+ *
11
+ * <ImageEditor
12
+ * value={imageData}
13
+ * onChange={setImageData}
14
+ * onSubmit={handleSave}
15
+ * onCancel={handleCancel}
16
+ * uploadFunction={myUploadFunction}
17
+ * uploadOptions={{ bucket: 'images', folder: 'content' }}
18
+ * />
19
+ * ```
20
+ */
21
+ import type { MediaEditorProps, ImageBlockContent } from '../types';
22
+ export declare function ImageEditor({ value, onChange, onSubmit, onCancel, uploadFunction, deleteFunction, uploadOptions }: MediaEditorProps<ImageBlockContent>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Image Renderer Component
3
+ *
4
+ * Renderizador genérico de imagem para forlogic-core.
5
+ * Suporta alinhamento, legenda, alt text e download.
6
+ *
7
+ * @example
8
+ * ```tsx
9
+ * import { ImageRenderer } from 'forlogic-core';
10
+ *
11
+ * <ImageRenderer
12
+ * content={{
13
+ * imageUrl: 'https://example.com/image.jpg',
14
+ * caption: 'Minha imagem',
15
+ * alt: 'Descrição da imagem',
16
+ * alignment: 'center',
17
+ * allowDownload: true
18
+ * }}
19
+ * />
20
+ * ```
21
+ */
22
+ import type { MediaRendererProps, ImageBlockContent } from '../types';
23
+ export declare function ImageRenderer({ content, className, style }: MediaRendererProps<ImageBlockContent>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Video Editor Component
3
+ *
4
+ * Editor genérico de vídeo para forlogic-core.
5
+ * Suporta URL, upload e código embed.
6
+ *
7
+ * @example
8
+ * ```tsx
9
+ * import { VideoEditor } from 'forlogic-core';
10
+ *
11
+ * <VideoEditor
12
+ * value={videoData}
13
+ * onChange={setVideoData}
14
+ * onSubmit={handleSave}
15
+ * onCancel={handleCancel}
16
+ * uploadFunction={myUploadFunction}
17
+ * uploadOptions={{ bucket: 'videos', folder: 'content' }}
18
+ * />
19
+ * ```
20
+ */
21
+ import type { MediaEditorProps, VideoBlockContent } from '../types';
22
+ export declare function VideoEditor({ value, onChange, onSubmit, onCancel, uploadFunction, deleteFunction, uploadOptions }: MediaEditorProps<VideoBlockContent>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Video Renderer Component
3
+ *
4
+ * Renderizador genérico de vídeo para forlogic-core.
5
+ * Suporta YouTube, Vimeo e arquivos diretos.
6
+ */
7
+ import type { MediaRendererProps, VideoBlockContent } from '../types';
8
+ export declare function VideoRenderer({ content, className, style }: MediaRendererProps<VideoBlockContent>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Generic Media Upload Hook
3
+ *
4
+ * Hook genérico para upload de mídia (imagens, vídeos, arquivos).
5
+ * Requer que o projeto forneça uma função de upload via props.
6
+ */
7
+ import type { UploadResult, UploadFunction, UploadOptions, DeleteFunction } from '../types';
8
+ export interface UseMediaUploadOptions {
9
+ uploadFunction?: UploadFunction;
10
+ deleteFunction?: DeleteFunction;
11
+ defaultOptions?: UploadOptions;
12
+ onSuccess?: (result: UploadResult) => void;
13
+ onError?: (error: Error) => void;
14
+ }
15
+ export declare function useMediaUpload(options?: UseMediaUploadOptions): {
16
+ upload: (file: File, uploadOptions?: UploadOptions) => Promise<UploadResult>;
17
+ deleteMedia: (path: string, bucket?: string) => Promise<void>;
18
+ uploading: boolean;
19
+ progress: number;
20
+ };
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Media Module
3
+ *
4
+ * Módulo genérico para gerenciamento de mídia (vídeo, imagem, áudio).
5
+ * Componentes reutilizáveis e independentes de contexto.
6
+ *
7
+ * @example Importar componentes
8
+ * ```tsx
9
+ * import { VideoEditor, VideoRenderer } from 'forlogic-core';
10
+ * ```
11
+ *
12
+ * @example Usar com função de upload customizada
13
+ * ```tsx
14
+ * import { VideoEditor } from 'forlogic-core';
15
+ * import { myUploadService } from './services/upload';
16
+ *
17
+ * function MyComponent() {
18
+ * const uploadFunction = async (file, options) => {
19
+ * const result = await myUploadService.upload(file, options.bucket, options.folder);
20
+ * return {
21
+ * url: result.publicUrl,
22
+ * name: file.name,
23
+ * size: file.size,
24
+ * type: file.type,
25
+ * path: result.path
26
+ * };
27
+ * };
28
+ *
29
+ * return (
30
+ * <VideoEditor
31
+ * value={videoData}
32
+ * uploadFunction={uploadFunction}
33
+ * uploadOptions={{ bucket: 'videos', folder: 'content' }}
34
+ * onSubmit={handleSave}
35
+ * onCancel={handleCancel}
36
+ * />
37
+ * );
38
+ * }
39
+ * ```
40
+ */
41
+ export type { UploadResult, UploadOptions, UploadFunction, DeleteFunction, VideoInputType, VideoProvider, VideoBlockContent, ImageBlockContent, MediaEditorProps, MediaRendererProps } from './types';
42
+ export { VideoEditor } from './components/VideoEditor';
43
+ export { VideoRenderer } from './components/VideoRenderer';
44
+ export { ImageEditor } from './components/ImageEditor';
45
+ export { ImageRenderer } from './components/ImageRenderer';
46
+ export { useMediaUpload } from './hooks/useMediaUpload';
47
+ export type { UseMediaUploadOptions } from './hooks/useMediaUpload';
48
+ export { extractYouTubeId, normalizeYouTubeUrl, extractVimeoId, normalizeVimeoUrl, parseIframeSrc, detectVideoProvider, normalizeVideoUrl } from './utils/videoHelpers';
49
+ export { calculateAspectRatio, resizeKeepingAspect, isImageUrl, extractImageFileName, formatFileSize } from './utils/imageHelpers';
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Media Module Types
3
+ *
4
+ * Tipos genéricos para gerenciamento de mídia (vídeo, imagem, áudio)
5
+ * em aplicações que utilizam forlogic-core.
6
+ */
7
+ export interface UploadResult {
8
+ url: string;
9
+ name: string;
10
+ size: number;
11
+ type: string;
12
+ path: string;
13
+ bucket?: string;
14
+ }
15
+ export interface UploadOptions {
16
+ bucket?: string;
17
+ folder?: string;
18
+ maxSize?: number;
19
+ allowedTypes?: string[];
20
+ }
21
+ export type UploadFunction = (file: File, options?: UploadOptions) => Promise<UploadResult>;
22
+ export interface DeleteFunction {
23
+ (path: string, bucket?: string): Promise<void>;
24
+ }
25
+ export type VideoInputType = 'url' | 'upload' | 'embed';
26
+ export type VideoProvider = 'youtube' | 'vimeo' | 'file' | 'embed';
27
+ export interface VideoBlockContent {
28
+ inputType?: VideoInputType;
29
+ videoUrl?: string;
30
+ videoFile?: string;
31
+ videoPath?: string;
32
+ videoSize?: number;
33
+ embedCode?: string;
34
+ thumbnail?: string;
35
+ thumbnailFile?: string;
36
+ thumbnailPath?: string;
37
+ title?: string;
38
+ autoplay?: boolean;
39
+ controls?: boolean;
40
+ }
41
+ export interface ImageBlockContent {
42
+ imageUrl?: string;
43
+ imageFile?: string;
44
+ imagePath?: string;
45
+ imageSize?: number;
46
+ caption?: string;
47
+ alt?: string;
48
+ width?: number;
49
+ height?: number;
50
+ alignment?: 'left' | 'center' | 'right';
51
+ allowDownload?: boolean;
52
+ }
53
+ export interface MediaEditorProps<T> {
54
+ value: T;
55
+ onChange: (value: T) => void;
56
+ onSubmit: (value: T) => void;
57
+ onCancel: () => void;
58
+ uploadFunction?: UploadFunction;
59
+ deleteFunction?: DeleteFunction;
60
+ uploadOptions?: UploadOptions;
61
+ }
62
+ export interface MediaRendererProps<T> {
63
+ content: T;
64
+ className?: string;
65
+ style?: React.CSSProperties;
66
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Image Helpers
3
+ *
4
+ * Funções utilitárias para manipulação de imagens
5
+ */
6
+ /**
7
+ * Calcula a proporção (aspect ratio) de uma imagem
8
+ */
9
+ export declare function calculateAspectRatio(width: number, height: number): number;
10
+ /**
11
+ * Redimensiona mantendo a proporção
12
+ */
13
+ export declare function resizeKeepingAspect(originalWidth: number, originalHeight: number, targetWidth?: number, targetHeight?: number): {
14
+ width: number;
15
+ height: number;
16
+ };
17
+ /**
18
+ * Verifica se uma URL é de imagem baseado na extensão
19
+ */
20
+ export declare function isImageUrl(url: string): boolean;
21
+ /**
22
+ * Extrai o nome do arquivo de uma URL
23
+ */
24
+ export declare function extractImageFileName(url: string): string;
25
+ /**
26
+ * Formata tamanho de arquivo em bytes para string legível
27
+ */
28
+ export declare function formatFileSize(bytes: number): string;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Video Helpers
3
+ *
4
+ * Funções utilitárias para manipulação de URLs de vídeo
5
+ * (YouTube, Vimeo, etc.)
6
+ */
7
+ import { VideoProvider } from '../types';
8
+ /**
9
+ * Extrai o ID de um vídeo do YouTube a partir de várias URLs possíveis
10
+ */
11
+ export declare function extractYouTubeId(url: string): string | null;
12
+ /**
13
+ * Normaliza URL do YouTube para formato embed
14
+ */
15
+ export declare function normalizeYouTubeUrl(urlOrId: string, autoplay?: boolean): string;
16
+ /**
17
+ * Extrai o ID de um vídeo do Vimeo
18
+ */
19
+ export declare function extractVimeoId(url: string): string | null;
20
+ /**
21
+ * Normaliza URL do Vimeo para formato embed
22
+ */
23
+ export declare function normalizeVimeoUrl(urlOrId: string, autoplay?: boolean): string;
24
+ /**
25
+ * Extrai URL do src de um código iframe embed
26
+ */
27
+ export declare function parseIframeSrc(embedCode?: string): string | undefined;
28
+ /**
29
+ * Detecta o provider de um vídeo baseado na URL
30
+ */
31
+ export declare function detectVideoProvider(url: string): VideoProvider;
32
+ /**
33
+ * Normaliza URL de vídeo baseado no provider detectado
34
+ */
35
+ export declare function normalizeVideoUrl(url: string, provider?: VideoProvider, autoplay?: boolean): string;
@@ -0,0 +1,11 @@
1
+ export interface ManageAccessModalProps {
2
+ open: boolean;
3
+ onOpenChange: (open: boolean) => void;
4
+ placeId: string;
5
+ placeName: string;
6
+ onMakeManager?: (userId: string, placeId: string) => void | Promise<void>;
7
+ onMakeMembers?: (userIds: string[], placeId: string) => void | Promise<void>;
8
+ currentManagerId?: string;
9
+ currentMemberIds?: string[];
10
+ }
11
+ export declare function ManageAccessModal({ open, onOpenChange, placeId, placeName, onMakeManager, onMakeMembers, currentManagerId, currentMemberIds }: ManageAccessModalProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { Place } from '../types';
2
+ export interface PlaceCardProps {
3
+ place: Place;
4
+ level?: number;
5
+ manageAccessConfig?: {
6
+ onMakeManager?: (userId: string, placeId: string) => void | Promise<void>;
7
+ onMakeMembers?: (userIds: string[], placeId: string) => void | Promise<void>;
8
+ getCurrentManagerId?: (placeId: string) => string | undefined;
9
+ getCurrentMemberIds?: (placeId: string) => string[] | undefined;
10
+ };
11
+ }
12
+ export declare function PlaceCard({ place, level, manageAccessConfig }: PlaceCardProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { Place } from '../types';
2
+ export interface PlacesListProps {
3
+ places: Place[];
4
+ isLoading: boolean;
5
+ manageAccessConfig?: {
6
+ onMakeManager?: (userId: string, placeId: string) => void | Promise<void>;
7
+ onMakeMembers?: (userIds: string[], placeId: string) => void | Promise<void>;
8
+ getCurrentManagerId?: (placeId: string) => string | undefined;
9
+ getCurrentMemberIds?: (placeId: string) => string[] | undefined;
10
+ };
11
+ }
12
+ export declare function PlacesList({ places, isLoading, manageAccessConfig }: PlacesListProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ export { PlacesList } from './components/PlacesList';
2
+ export { PlaceCard } from './components/PlaceCard';
3
+ export { ManageAccessModal } from './components/ManageAccessModal';
4
+ export { placeService } from './services/PlaceService';
5
+ export type { Place } from './types';
6
+ export type { ManageAccessModalProps } from './components/ManageAccessModal';
7
+ export type { PlacesListProps } from './components/PlacesList';
8
+ export type { PlaceCardProps } from './components/PlaceCard';
@@ -0,0 +1,9 @@
1
+ import { Place } from '../types';
2
+ declare class PlaceService {
3
+ private baseUrl;
4
+ private makeApiCall;
5
+ private buildHierarchy;
6
+ getPlaces(alias: string, companyId: string): Promise<Place[]>;
7
+ }
8
+ export declare const placeService: PlaceService;
9
+ export {};
@@ -0,0 +1,10 @@
1
+ export interface Place {
2
+ id: string;
3
+ name: string;
4
+ usersCount?: number;
5
+ hasChild?: boolean;
6
+ isActive?: boolean;
7
+ parentId?: string;
8
+ parentName?: string;
9
+ subPlaces?: Place[];
10
+ }
@@ -0,0 +1,66 @@
1
+ import { ReactNode } from 'react';
2
+ import { QueryClient } from '@tanstack/react-query';
3
+ /**
4
+ * Props for CoreProviders component
5
+ */
6
+ export interface CoreProvidersProps {
7
+ /**
8
+ * Child components to be wrapped by providers
9
+ */
10
+ children: ReactNode;
11
+ /**
12
+ * Optional custom QueryClient instance
13
+ * If not provided, a default QueryClient will be created
14
+ */
15
+ queryClient?: QueryClient;
16
+ }
17
+ /**
18
+ * CoreProviders - Encapsulates all essential providers for forlogic-core applications
19
+ *
20
+ * This component wraps your application with all necessary providers:
21
+ * - ErrorBoundary (error handling)
22
+ * - I18nextProvider (internationalization)
23
+ * - QueryClientProvider (data fetching)
24
+ * - AuthProvider (authentication)
25
+ * - LocaleProvider (locale management)
26
+ * - TranslationLoader (removed - translations now loaded from local JSON)
27
+ *
28
+ * @example
29
+ * ```tsx
30
+ * import { CoreProviders } from 'forlogic-core';
31
+ * import { BrowserRouter } from 'react-router-dom';
32
+ *
33
+ * function App() {
34
+ * return (
35
+ * <CoreProviders>
36
+ * <BrowserRouter>
37
+ * <Routes>
38
+ * {/* Your routes here *\/}
39
+ * </Routes>
40
+ * </BrowserRouter>
41
+ * </CoreProviders>
42
+ * );
43
+ * }
44
+ * ```
45
+ *
46
+ * @example With custom QueryClient
47
+ * ```tsx
48
+ * import { CoreProviders } from 'forlogic-core';
49
+ * import { QueryClient } from '@tanstack/react-query';
50
+ *
51
+ * const queryClient = new QueryClient({
52
+ * defaultOptions: {
53
+ * queries: { staleTime: 10 * 60 * 1000 },
54
+ * },
55
+ * });
56
+ *
57
+ * function App() {
58
+ * return (
59
+ * <CoreProviders queryClient={queryClient}>
60
+ * {/* Your app *\/}
61
+ * </CoreProviders>
62
+ * );
63
+ * }
64
+ * ```
65
+ */
66
+ export declare function CoreProviders({ children, queryClient }: CoreProvidersProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { CoreProviders } from './CoreProviders';
2
+ export type { CoreProvidersProps } from './CoreProviders';
@@ -0,0 +1,125 @@
1
+ import React from 'react';
2
+ import { QualiexUser } from '../../types';
3
+ /**
4
+ * Formato de exibição do usuário no campo
5
+ */
6
+ export type QualiexUserDisplayFormat = 'name' | 'name-email' | 'name-role' | 'custom';
7
+ /**
8
+ * QualiexUserField - Campo de seleção de usuários da plataforma Qualiex
9
+ *
10
+ * Este componente fornece uma interface completa para selecionar usuários cadastrados
11
+ * na plataforma Qualiex, com busca, loading states, tratamento de erros e suporte
12
+ * a múltipla seleção, display customizado e filtros.
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * // Uso básico
17
+ * <QualiexUserField
18
+ * value={userId}
19
+ * onChange={setUserId}
20
+ * />
21
+ *
22
+ * // Seleção múltipla com label
23
+ * <QualiexUserField
24
+ * multiple
25
+ * label="Avaliadores"
26
+ * required
27
+ * value={evaluatorIds}
28
+ * onChange={setEvaluatorIds}
29
+ * />
30
+ *
31
+ * // Exibindo nome + email
32
+ * <QualiexUserField
33
+ * displayFormat="name-email"
34
+ * value={userId}
35
+ * onChange={setUserId}
36
+ * />
37
+ *
38
+ * // Filtrando apenas admins
39
+ * <QualiexUserField
40
+ * filterFn={(user) => user.roleName === 'Admin'}
41
+ * value={adminId}
42
+ * onChange={setAdminId}
43
+ * />
44
+ *
45
+ * // Dentro de um Dialog
46
+ * <QualiexUserField
47
+ * popoverContainer={dialogContentRef.current}
48
+ * value={userId}
49
+ * onChange={setUserId}
50
+ * />
51
+ *
52
+ * // Display customizado
53
+ * <QualiexUserField
54
+ * displayFormat="custom"
55
+ * customDisplayFn={(user) => `${user.userName} - ${user.placeName || 'Sem local'}`}
56
+ * value={userId}
57
+ * onChange={setUserId}
58
+ * />
59
+ * ```
60
+ *
61
+ * @param value - ID(s) do(s) usuário(s) selecionado(s) (userId do Qualiex)
62
+ * @param onChange - Callback chamado quando o usuário seleciona um item
63
+ * @param multiple - Modo de seleção múltipla (default: false)
64
+ * @param label - Label do campo
65
+ * @param required - Adiciona asterisco ao label
66
+ * @param placeholder - Texto exibido quando nenhum usuário está selecionado
67
+ * @param disabled - Desabilita o campo (não permite interação)
68
+ * @param className - Classes CSS adicionais para customização
69
+ * @param enabled - Controla se o hook deve buscar dados da API (default: true)
70
+ * @param displayFormat - Formato de exibição: 'name' | 'name-email' | 'name-role' | 'custom'
71
+ * @param customDisplayFn - Função customizada para exibição (usado com displayFormat='custom')
72
+ * @param filterFn - Função para filtrar usuários antes da exibição
73
+ * @param icon - Ícone Lucide React para exibir no campo
74
+ * @param maxDisplayedBadges - Limite de badges no modo múltiplo
75
+ * @param popoverContainer - Container HTML para portal (útil em Dialog/Modal)
76
+ * @param sortOptions - Ordena usuários alfabeticamente (default: true)
77
+ * @param onOpen - Callback ao abrir o popover
78
+ * @param onClose - Callback ao fechar o popover
79
+ *
80
+ * @requires QualiexConfig configurado no projeto (apiUrl e apiToken)
81
+ * @see useQualiexUsers - Hook que busca os usuários da API
82
+ * @see Combobox - Componente base de seleção com busca
83
+ */
84
+ interface QualiexUserFieldProps {
85
+ /** ID(s) do(s) usuário(s) selecionado(s) - string para single, string[] para multiple */
86
+ value?: string | string[];
87
+ /** Callback chamado quando a seleção muda */
88
+ onChange?: (value: string | string[]) => void;
89
+ /** Habilita seleção múltipla (default: false) */
90
+ multiple?: boolean;
91
+ /** Label do campo */
92
+ label?: string;
93
+ /** Marca campo como obrigatório (adiciona asterisco) */
94
+ required?: boolean;
95
+ /** Placeholder quando nenhum item selecionado */
96
+ placeholder?: string;
97
+ /** Ícone Lucide React para exibir no campo */
98
+ icon?: React.ComponentType<{
99
+ className?: string;
100
+ }>;
101
+ /** Limite de badges exibidos no modo múltiplo */
102
+ maxDisplayedBadges?: number;
103
+ /** Classes CSS adicionais */
104
+ className?: string;
105
+ /** Desabilita o campo */
106
+ disabled?: boolean;
107
+ /** Controla se o hook deve buscar dados da API (default: true) */
108
+ enabled?: boolean;
109
+ /** Formato de exibição do usuário: 'name' | 'name-email' | 'name-role' | 'custom' */
110
+ displayFormat?: QualiexUserDisplayFormat;
111
+ /** Função customizada para exibição (requer displayFormat='custom') */
112
+ customDisplayFn?: (user: QualiexUser) => string;
113
+ /** Função para filtrar usuários antes da exibição */
114
+ filterFn?: (user: QualiexUser) => boolean;
115
+ /** Ordena usuários alfabeticamente (default: true) */
116
+ sortOptions?: boolean;
117
+ /** Container HTML para portal do popover (útil em Dialog/Modal) */
118
+ popoverContainer?: HTMLElement | null;
119
+ /** Callback ao abrir o popover */
120
+ onOpen?: () => void;
121
+ /** Callback ao fechar o popover */
122
+ onClose?: () => void;
123
+ }
124
+ export declare const QualiexUserField: React.FC<QualiexUserFieldProps>;
125
+ export {};