@llmnative/react 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +375 -0
  3. package/bin/cli.js +99 -0
  4. package/dist/index.css +1 -0
  5. package/dist/index.js +838 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/index.mjs +12161 -0
  8. package/dist/index.mjs.map +1 -0
  9. package/dist/types/src/App.d.ts +64 -0
  10. package/dist/types/src/Config.d.ts +65 -0
  11. package/dist/types/src/Global.d.ts +12 -0
  12. package/dist/types/src/Head.d.ts +193 -0
  13. package/dist/types/src/Theme.d.ts +335 -0
  14. package/dist/types/src/auth.d.ts +27 -0
  15. package/dist/types/src/components/Component.d.ts +55 -0
  16. package/dist/types/src/components/FormEnhancer.d.ts +26 -0
  17. package/dist/types/src/components/Template.d.ts +18 -0
  18. package/dist/types/src/components/blocks/Brand.d.ts +14 -0
  19. package/dist/types/src/components/blocks/Breadcrumbs.d.ts +8 -0
  20. package/dist/types/src/components/blocks/Carousel.d.ts +19 -0
  21. package/dist/types/src/components/blocks/Dropdown.d.ts +64 -0
  22. package/dist/types/src/components/blocks/Menu.d.ts +24 -0
  23. package/dist/types/src/components/blocks/Notifications.d.ts +15 -0
  24. package/dist/types/src/components/blocks/Search.d.ts +7 -0
  25. package/dist/types/src/components/index.d.ts +52 -0
  26. package/dist/types/src/components/types.d.ts +11 -0
  27. package/dist/types/src/components/ui/Alert.d.ts +13 -0
  28. package/dist/types/src/components/ui/Badge.d.ts +27 -0
  29. package/dist/types/src/components/ui/Buttons.d.ts +57 -0
  30. package/dist/types/src/components/ui/Card.d.ts +15 -0
  31. package/dist/types/src/components/ui/Code.d.ts +25 -0
  32. package/dist/types/src/components/ui/Gallery.d.ts +55 -0
  33. package/dist/types/src/components/ui/GridSystem.d.ts +21 -0
  34. package/dist/types/src/components/ui/Icon.d.ts +13 -0
  35. package/dist/types/src/components/ui/Image.d.ts +19 -0
  36. package/dist/types/src/components/ui/ImageAvatar.d.ts +16 -0
  37. package/dist/types/src/components/ui/LayoutBuilder.d.ts +19 -0
  38. package/dist/types/src/components/ui/Loader.d.ts +11 -0
  39. package/dist/types/src/components/ui/Modal.d.ts +39 -0
  40. package/dist/types/src/components/ui/Pagination.d.ts +18 -0
  41. package/dist/types/src/components/ui/Percentage.d.ts +19 -0
  42. package/dist/types/src/components/ui/Repeat.d.ts +18 -0
  43. package/dist/types/src/components/ui/Tab.d.ts +20 -0
  44. package/dist/types/src/components/ui/TabDynamic.d.ts +20 -0
  45. package/dist/types/src/components/ui/Table.d.ts +43 -0
  46. package/dist/types/src/components/ui/fields/AssistantAI.d.ts +23 -0
  47. package/dist/types/src/components/ui/fields/Command.d.ts +15 -0
  48. package/dist/types/src/components/ui/fields/Crop.d.ts +27 -0
  49. package/dist/types/src/components/ui/fields/ImageUrl.d.ts +7 -0
  50. package/dist/types/src/components/ui/fields/Input.d.ts +62 -0
  51. package/dist/types/src/components/ui/fields/Prompt.d.ts +31 -0
  52. package/dist/types/src/components/ui/fields/Select.d.ts +38 -0
  53. package/dist/types/src/components/ui/fields/Upload.d.ts +25 -0
  54. package/dist/types/src/components/ui/fields/UploadCSV.d.ts +26 -0
  55. package/dist/types/src/components/ui/useRecordSelection.d.ts +20 -0
  56. package/dist/types/src/components/ui/useStableRecordKey.d.ts +5 -0
  57. package/dist/types/src/components/widgets/Form.d.ts +129 -0
  58. package/dist/types/src/components/widgets/Grid.d.ts +6 -0
  59. package/dist/types/src/components/widgets/ImageEditor.d.ts +14 -0
  60. package/dist/types/src/components/widgets/MarkdownReader.d.ts +14 -0
  61. package/dist/types/src/components/widgets/Prompt.d.ts +31 -0
  62. package/dist/types/src/components/widgets/TabDynamic.d.ts +20 -0
  63. package/dist/types/src/components/widgets/grid-core/GridArray.d.ts +5 -0
  64. package/dist/types/src/components/widgets/grid-core/GridCore.d.ts +5 -0
  65. package/dist/types/src/components/widgets/grid-core/GridDB.d.ts +5 -0
  66. package/dist/types/src/components/widgets/grid-core/GridGalleryView.d.ts +5 -0
  67. package/dist/types/src/components/widgets/grid-core/GridTableView.d.ts +5 -0
  68. package/dist/types/src/components/widgets/grid-core/index.d.ts +7 -0
  69. package/dist/types/src/components/widgets/grid-core/resolveGridPathFromUrl.d.ts +1 -0
  70. package/dist/types/src/components/widgets/grid-core/types.d.ts +227 -0
  71. package/dist/types/src/components/widgets/grid-core/useGridActions.d.ts +49 -0
  72. package/dist/types/src/components/widgets/grid-core/useGridColumns.d.ts +10 -0
  73. package/dist/types/src/components/widgets/grid-core/useGridDBRecords.d.ts +10 -0
  74. package/dist/types/src/components/widgets/grid-core/useGridPreparedRecords.d.ts +10 -0
  75. package/dist/types/src/components/widgets/grid-core/useGridSelection.d.ts +13 -0
  76. package/dist/types/src/components/widgets/grid-core/utils.d.ts +14 -0
  77. package/dist/types/src/conf/Prompt.d.ts +84 -0
  78. package/dist/types/src/constant.d.ts +96 -0
  79. package/dist/types/src/index.d.ts +56 -0
  80. package/dist/types/src/libs/cache.d.ts +9 -0
  81. package/dist/types/src/libs/cn.d.ts +2 -0
  82. package/dist/types/src/libs/converter.d.ts +28 -0
  83. package/dist/types/src/libs/database.d.ts +3 -0
  84. package/dist/types/src/libs/email.d.ts +16 -0
  85. package/dist/types/src/libs/fetch.d.ts +9 -0
  86. package/dist/types/src/libs/imageBuilder.d.ts +112 -0
  87. package/dist/types/src/libs/index.d.ts +14 -0
  88. package/dist/types/src/libs/locale.d.ts +24 -0
  89. package/dist/types/src/libs/log.d.ts +2 -0
  90. package/dist/types/src/libs/order.d.ts +14 -0
  91. package/dist/types/src/libs/path.d.ts +26 -0
  92. package/dist/types/src/libs/sanitizer.d.ts +38 -0
  93. package/dist/types/src/libs/seo.d.ts +8 -0
  94. package/dist/types/src/libs/storage.d.ts +2 -0
  95. package/dist/types/src/libs/utils.d.ts +57 -0
  96. package/dist/types/src/motion.d.ts +38 -0
  97. package/dist/types/src/pages/Blog.d.ts +3 -0
  98. package/dist/types/src/pages/BlogPost.d.ts +16 -0
  99. package/dist/types/src/pages/Helper.d.ts +8 -0
  100. package/dist/types/src/pages/NotFound.d.ts +3 -0
  101. package/dist/types/src/pages/Users.d.ts +3 -0
  102. package/dist/types/src/pages/index.d.ts +3 -0
  103. package/dist/types/src/providers/ProviderConfiguration.d.ts +12 -0
  104. package/dist/types/src/providers/ai/index.d.ts +134 -0
  105. package/dist/types/src/providers/auth/AuthProvider.d.ts +22 -0
  106. package/dist/types/src/providers/auth/AuthProviderContext.d.ts +12 -0
  107. package/dist/types/src/providers/auth/dropbox/DropboxAuthProvider.d.ts +16 -0
  108. package/dist/types/src/providers/auth/google/GoogleAuth.d.ts +44 -0
  109. package/dist/types/src/providers/auth/google/GoogleAuthProvider.d.ts +12 -0
  110. package/dist/types/src/providers/auth/google/apis/auth.d.ts +4 -0
  111. package/dist/types/src/providers/auth/google/auth.d.ts +3 -0
  112. package/dist/types/src/providers/data/DataProvider.d.ts +58 -0
  113. package/dist/types/src/providers/data/DataProviderContext.d.ts +12 -0
  114. package/dist/types/src/providers/data/firebase.d.ts +21 -0
  115. package/dist/types/src/providers/data/mock.d.ts +20 -0
  116. package/dist/types/src/providers/data/supabase.d.ts +19 -0
  117. package/dist/types/src/providers/email/EmailProvider.d.ts +10 -0
  118. package/dist/types/src/providers/email/EmailProviderContext.d.ts +12 -0
  119. package/dist/types/src/providers/email/google/GmailEmailProvider.d.ts +7 -0
  120. package/dist/types/src/providers/email/google/apis/email.d.ts +7 -0
  121. package/dist/types/src/providers/email/google/email.d.ts +13 -0
  122. package/dist/types/src/providers/firebase-init.d.ts +10 -0
  123. package/dist/types/src/providers/icon/IconProvider.d.ts +10 -0
  124. package/dist/types/src/providers/icon/IconProviderContext.d.ts +48 -0
  125. package/dist/types/src/providers/icon/LucideIconProvider.d.ts +5 -0
  126. package/dist/types/src/providers/icon/PhosphorIconProvider.d.ts +10 -0
  127. package/dist/types/src/providers/icon/index.d.ts +6 -0
  128. package/dist/types/src/providers/manifest.d.ts +42 -0
  129. package/dist/types/src/providers/scrape/index.d.ts +10 -0
  130. package/dist/types/src/providers/seo/google/keyword.d.ts +14 -0
  131. package/dist/types/src/providers/seo/google/trend.d.ts +25 -0
  132. package/dist/types/src/providers/storage/StorageProvider.d.ts +7 -0
  133. package/dist/types/src/providers/storage/StorageProviderContext.d.ts +12 -0
  134. package/dist/types/src/providers/storage/dropbox.d.ts +48 -0
  135. package/dist/types/src/providers/storage/firebase.d.ts +13 -0
  136. package/dist/types/src/providers/storage/supabase.d.ts +19 -0
  137. package/dist/types/src/types/Block.d.ts +4 -0
  138. package/dist/types/src/types/FormFields.d.ts +33 -0
  139. package/dist/types/src/types/Layout.d.ts +9 -0
  140. package/dist/types/src/types/Section.d.ts +4 -0
  141. package/dist/types/themes/cyber.d.ts +7 -0
  142. package/dist/types/themes/default.d.ts +7 -0
  143. package/dist/types/themes/flat.d.ts +7 -0
  144. package/package.json +126 -0
  145. package/scripts/cli/create-section.js +65 -0
  146. package/scripts/cli/setup-devtools.js +85 -0
  147. package/scripts/cli/setup-project.js +484 -0
  148. package/themes/cyber.ts +405 -0
  149. package/themes/default.ts +405 -0
  150. package/themes/flat.ts +405 -0
@@ -0,0 +1,134 @@
1
+ import { Prompt, PROMPTS } from "../../conf/Prompt";
2
+ import { type ProviderConfigurationState } from "../ProviderConfiguration";
3
+ import { PromptVariables } from "../../conf/Prompt";
4
+ export default function fetchAI(provider?: string): (prompt: string, options?: {
5
+ model?: string;
6
+ temperature?: number;
7
+ }, strategy?: keyof typeof PROMPTS | undefined) => Promise<any>;
8
+ interface AIProvider {
9
+ name: string;
10
+ url: string;
11
+ model: string;
12
+ models: string[];
13
+ framework?: string;
14
+ frameworks?: string[];
15
+ temperature: number;
16
+ parseHeaders: () => Record<string, string>;
17
+ parseBody: (prompt: string, role: string, options: AIOptions) => Record<string, any>;
18
+ parseResponse: (response: any) => any;
19
+ }
20
+ interface AIOptions {
21
+ language?: string;
22
+ voice?: string;
23
+ style?: string;
24
+ role?: string;
25
+ model?: string;
26
+ temperature?: number;
27
+ }
28
+ export interface AIFetchConfig extends AIOptions {
29
+ provider?: keyof typeof PROVIDERS;
30
+ }
31
+ export declare const getAIProviderConfigurationState: (provider?: keyof typeof PROVIDERS) => ProviderConfigurationState;
32
+ declare const PROVIDERS: {
33
+ openai: {
34
+ name: string;
35
+ url: string;
36
+ model: string;
37
+ models: string[];
38
+ framework: string;
39
+ frameworks: string[];
40
+ temperature: number;
41
+ parseHeaders: () => {
42
+ 'Content-Type': string;
43
+ Authorization: string;
44
+ };
45
+ parseBody: (prompt: string, role: string, options: AIOptions) => {
46
+ model: string;
47
+ messages: {
48
+ role: string;
49
+ content: string;
50
+ }[];
51
+ temperature: number;
52
+ };
53
+ parseResponse: (response: any) => any;
54
+ };
55
+ gemini: {
56
+ name: string;
57
+ url: string;
58
+ model: string;
59
+ models: string[];
60
+ temperature: number;
61
+ parseHeaders: () => {
62
+ 'Content-Type': string;
63
+ Authorization: string;
64
+ };
65
+ parseBody: (prompt: string, role: string, options: AIOptions) => {
66
+ model: string;
67
+ instances: {
68
+ content: string;
69
+ }[];
70
+ temperature: number;
71
+ };
72
+ parseResponse: (response: any) => any;
73
+ };
74
+ anthropic: {
75
+ name: string;
76
+ url: string;
77
+ model: string;
78
+ models: string[];
79
+ temperature: number;
80
+ parseHeaders: () => {
81
+ 'Content-Type': string;
82
+ Authorization: string;
83
+ };
84
+ parseBody: (prompt: string, role: string, options: AIOptions) => {
85
+ model: string;
86
+ messages: {
87
+ role: string;
88
+ content: string;
89
+ }[];
90
+ temperature: number;
91
+ };
92
+ parseResponse: (response: any) => any;
93
+ };
94
+ mistral: {
95
+ name: string;
96
+ url: string;
97
+ model: string;
98
+ models: string[];
99
+ temperature: number;
100
+ parseHeaders: () => {
101
+ 'Content-Type': string;
102
+ Authorization: string;
103
+ };
104
+ parseBody: (prompt: string, role: string, options: AIOptions) => {
105
+ model: string;
106
+ messages: {
107
+ role: string;
108
+ content: string;
109
+ }[];
110
+ temperature: number;
111
+ };
112
+ parseResponse: (response: any) => any;
113
+ };
114
+ };
115
+ export declare class AI extends Prompt {
116
+ config: AIProvider;
117
+ options: AIOptions;
118
+ data?: PromptVariables;
119
+ static fetch(prompt: string, config: AIFetchConfig, data?: PromptVariables): Promise<any>;
120
+ static getModels(provider?: keyof typeof PROVIDERS): string[];
121
+ constructor(provider?: keyof typeof PROVIDERS);
122
+ setOptions(options: AIOptions): this;
123
+ setData(data?: PromptVariables): this;
124
+ static defaults(): {
125
+ model: string;
126
+ role: string;
127
+ language: string;
128
+ country: string;
129
+ voice: string;
130
+ style: string;
131
+ };
132
+ fetchAPI(prompt: string): Promise<any>;
133
+ }
134
+ export {};
@@ -0,0 +1,22 @@
1
+ import type { ProviderConfigurable } from '../ProviderConfiguration';
2
+ export interface UserProfile {
3
+ uid?: string;
4
+ email?: string;
5
+ displayName?: string;
6
+ photoURL?: string;
7
+ [key: string]: any;
8
+ }
9
+ export type AuthIntent = 'signIn' | 'connect' | 'signOut' | 'disconnect' | 'reauthorize';
10
+ export interface AuthSignInOptions {
11
+ scopes?: string[];
12
+ intent?: AuthIntent;
13
+ [key: string]: any;
14
+ }
15
+ export interface AuthProviderAdapter extends ProviderConfigurable {
16
+ getUser(): UserProfile | null;
17
+ signIn?(options?: AuthSignInOptions): Promise<UserProfile | null>;
18
+ signOut(): Promise<void>;
19
+ onAuthChange(callback: (user: UserProfile | null) => void): () => void;
20
+ getAccessToken?(scopes?: string[]): Promise<string>;
21
+ isAuthenticated?(): boolean;
22
+ }
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import type { AuthProviderAdapter } from './AuthProvider';
3
+ type AuthProviderContextValue = {
4
+ registry: Record<string, AuthProviderAdapter>;
5
+ defaultKey: string;
6
+ };
7
+ declare const AuthProviderContext: React.Context<AuthProviderContextValue | null>;
8
+ export declare const AuthProvider: ({ registry, defaultKey, children, }: AuthProviderContextValue & {
9
+ children: React.ReactNode;
10
+ }) => React.JSX.Element;
11
+ export declare const useAuthProvider: (name?: string) => AuthProviderAdapter;
12
+ export default AuthProviderContext;
@@ -0,0 +1,16 @@
1
+ import type { DropboxConfig } from '../../../Config';
2
+ import { type ProviderConfigurationState } from '../../ProviderConfiguration';
3
+ import type { AuthProviderAdapter, AuthSignInOptions, UserProfile } from '../AuthProvider';
4
+ export declare const DROPBOX_AUTH_SERVER = "www.dropbox.com/oauth2";
5
+ export declare class DropboxAuthProvider implements AuthProviderAdapter {
6
+ private readonly config;
7
+ constructor(config: DropboxConfig);
8
+ getConfigurationState(): ProviderConfigurationState;
9
+ isConfigured(): boolean;
10
+ getUser(): UserProfile | null;
11
+ signIn(options?: AuthSignInOptions): Promise<UserProfile | null>;
12
+ signOut(): Promise<void>;
13
+ onAuthChange(callback: (user: UserProfile | null) => void): () => void;
14
+ getAccessToken(): Promise<string>;
15
+ isAuthenticated(): boolean;
16
+ }
@@ -0,0 +1,44 @@
1
+ import React from "react";
2
+ declare global {
3
+ interface Window {
4
+ google: {
5
+ accounts: {
6
+ id: {
7
+ initialize: (options: any) => void;
8
+ prompt: (callback?: () => void) => void;
9
+ renderButton: (element: HTMLElement, options: any) => void;
10
+ disableAutoSelect: () => void;
11
+ revoke: (hint: string, callback?: () => void) => void;
12
+ };
13
+ oauth2: {
14
+ initTokenClient: (config: {
15
+ client_id: string;
16
+ scope: string;
17
+ callback: (response: TokenResponse) => void;
18
+ }) => {
19
+ requestAccessToken: () => void;
20
+ };
21
+ hasGrantedAllScopes?: (response: TokenResponse, ...scopes: string[]) => boolean;
22
+ };
23
+ };
24
+ };
25
+ handleGoogleSignIn: (response: {
26
+ credential: string;
27
+ }) => void;
28
+ }
29
+ }
30
+ interface GoogleAuthProps {
31
+ scope?: string;
32
+ iconLogout: string;
33
+ className?: string;
34
+ avatarClass?: string;
35
+ }
36
+ interface TokenResponse {
37
+ access_token: string;
38
+ expires_in: number;
39
+ scope: string;
40
+ token_type: string;
41
+ }
42
+ declare const GoogleAuth: ({ scope, iconLogout, className, avatarClass }: GoogleAuthProps) => React.JSX.Element;
43
+ export declare const googleGetAccessToken: (scopes: string[]) => Promise<string>;
44
+ export default GoogleAuth;
@@ -0,0 +1,12 @@
1
+ import { AuthProviderAdapter, AuthSignInOptions, UserProfile } from '../AuthProvider';
2
+ import { type ProviderConfigurationState } from '../../ProviderConfiguration';
3
+ export declare class GoogleAuthProvider implements AuthProviderAdapter {
4
+ getConfigurationState(): ProviderConfigurationState;
5
+ isConfigured(): boolean;
6
+ getUser(): UserProfile | null;
7
+ signIn(options?: AuthSignInOptions): Promise<UserProfile | null>;
8
+ signOut(): Promise<void>;
9
+ onAuthChange(callback: (user: UserProfile | null) => void): () => void;
10
+ getAccessToken(scopes?: string[]): Promise<string>;
11
+ isAuthenticated(): boolean;
12
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Ottiene un access token valido da Google utilizzando un Service Account.
3
+ */
4
+ export declare function getGoogleAccessToken(scope: string, userToImpersonate: string): Promise<string>;
@@ -0,0 +1,3 @@
1
+ import { GoogleConfig } from "../../../Config";
2
+ export declare const authConfig: <K extends keyof GoogleConfig>(key: K) => GoogleConfig[K] | undefined;
3
+ export declare const getGoogleCredential: () => import("firebase/auth").OAuthCredential | null;
@@ -0,0 +1,58 @@
1
+ import type { ProviderConfigurable } from '../ProviderConfiguration';
2
+ type FieldMap = Record<string, any>;
3
+ type RecordObject = Record<string, FieldMap>;
4
+ export type RecordProps = FieldMap & {
5
+ _key?: string;
6
+ _index?: number;
7
+ };
8
+ export type RecordArray = Array<RecordProps>;
9
+ type ScalarValue = string | number | boolean | null;
10
+ type RangeValue = string | number | boolean;
11
+ type ListValue = string[] | number[];
12
+ export type OperatorValue = ScalarValue | ListValue;
13
+ export type Condition = {
14
+ eq?: ScalarValue;
15
+ lt?: RangeValue;
16
+ lte?: RangeValue;
17
+ gt?: RangeValue;
18
+ gte?: RangeValue;
19
+ nin?: ListValue;
20
+ in?: ListValue;
21
+ };
22
+ export type WhereClause = {
23
+ [field: string]: Condition | OperatorValue;
24
+ };
25
+ export type OrderClause = {
26
+ [field: string]: "asc" | "desc";
27
+ };
28
+ export interface DatabaseOptions {
29
+ where?: WhereClause;
30
+ order?: OrderClause;
31
+ fieldMap?: Record<string, string>;
32
+ onLoad?: (data: RecordObject) => RecordObject;
33
+ }
34
+ export interface DBConfig extends DatabaseOptions {
35
+ path?: string;
36
+ }
37
+ export interface ReadOptions {
38
+ where?: WhereClause;
39
+ order?: OrderClause;
40
+ toArray?: boolean;
41
+ exception?: boolean;
42
+ }
43
+ export interface SetChunksOptions {
44
+ chunkSize?: number;
45
+ purge?: boolean;
46
+ onProgress?: (done: number, total: number, message: string) => void;
47
+ }
48
+ export interface DataProviderAdapter extends ProviderConfigurable {
49
+ read(path: string, options?: ReadOptions): Promise<any>;
50
+ set(path: string, data: object, exception?: boolean): Promise<void>;
51
+ update(path: string, data: object, exception?: boolean): Promise<void>;
52
+ remove(path: string, exception?: boolean): Promise<void>;
53
+ subscribe(path: string | undefined, setRecords: (records: RecordArray) => void, options?: DatabaseOptions): () => void;
54
+ count?(path: string): Promise<number>;
55
+ readShallow?(path: string, exception?: boolean): Promise<string[]>;
56
+ setChunks?(path: string, data: object, options?: SetChunksOptions): Promise<void>;
57
+ }
58
+ export {};
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import type { DataProviderAdapter } from './DataProvider';
3
+ type DataProviderContextValue = {
4
+ registry: Record<string, DataProviderAdapter>;
5
+ defaultKey: string;
6
+ };
7
+ declare const DataProviderContext: React.Context<DataProviderContextValue | null>;
8
+ export declare const DataProvider: ({ registry, defaultKey, children, }: DataProviderContextValue & {
9
+ children: React.ReactNode;
10
+ }) => React.JSX.Element;
11
+ export declare const useDataProvider: (name?: string) => DataProviderAdapter;
12
+ export default DataProviderContext;
@@ -0,0 +1,21 @@
1
+ import 'firebase/compat/database';
2
+ import { DataProviderAdapter, DatabaseOptions, ReadOptions, SetChunksOptions, RecordProps } from "./DataProvider";
3
+ import type { ProviderConfigurationState } from "../ProviderConfiguration";
4
+ export declare const SYSTEM_FIELDS: {
5
+ key: string;
6
+ value: string;
7
+ };
8
+ export declare class FirebaseDataProvider implements DataProviderAdapter {
9
+ getConfigurationState(): ProviderConfigurationState;
10
+ isConfigured(): boolean;
11
+ readShallow: (path: string, exception?: boolean) => Promise<string[]>;
12
+ read: (path: string, { where, order, toArray, exception }?: ReadOptions) => Promise<any>;
13
+ update: (path: string, data: any, exception?: boolean) => Promise<void>;
14
+ set: (path: string, data: any, exception?: boolean) => Promise<void>;
15
+ setChunks: (path: string, data: any, { chunkSize, purge, onProgress }?: SetChunksOptions) => Promise<void>;
16
+ remove: (path: string, exception?: boolean) => Promise<void>;
17
+ count: (path: string) => Promise<number>;
18
+ subscribe: <T extends RecordProps = RecordProps>(path: string | undefined, setRecords: (records: T[]) => void, { where, order, fieldMap, onLoad }?: DatabaseOptions) => (() => void);
19
+ }
20
+ declare const _default: FirebaseDataProvider;
21
+ export default _default;
@@ -0,0 +1,20 @@
1
+ import { DataProviderAdapter, DatabaseOptions, ReadOptions, RecordArray } from './DataProvider';
2
+ type CollectionStore = Record<string, Record<string, any>>;
3
+ export declare class MockDataProvider implements DataProviderAdapter {
4
+ private store;
5
+ private listeners;
6
+ constructor(initialData?: CollectionStore);
7
+ isConfigured(): boolean;
8
+ getConfigurationState(): {
9
+ configured: boolean;
10
+ };
11
+ private getCollection;
12
+ private resolvePath;
13
+ private notify;
14
+ read: (path: string, options?: ReadOptions) => Promise<any>;
15
+ set: (path: string, data: object) => Promise<void>;
16
+ update: (path: string, data: object) => Promise<void>;
17
+ remove: (path: string) => Promise<void>;
18
+ subscribe: (path: string | undefined, setRecords: (records: RecordArray) => void, options?: DatabaseOptions) => (() => void);
19
+ }
20
+ export {};
@@ -0,0 +1,19 @@
1
+ import { DataProviderAdapter, DatabaseOptions, ReadOptions, RecordArray } from "./DataProvider";
2
+ import { type ProviderConfigurationState } from "../ProviderConfiguration";
3
+ interface SupabaseConfig {
4
+ url: string;
5
+ anonKey: string;
6
+ }
7
+ export declare class SupabaseDataProvider implements DataProviderAdapter {
8
+ private config;
9
+ constructor(config: SupabaseConfig);
10
+ getConfigurationState(): ProviderConfigurationState;
11
+ isConfigured(): boolean;
12
+ read: (path: string, _options?: ReadOptions) => Promise<any>;
13
+ set: (path: string, data: object) => Promise<void>;
14
+ update: (path: string, data: object) => Promise<void>;
15
+ remove: (path: string) => Promise<void>;
16
+ subscribe: (path: string | undefined, setRecords: (records: RecordArray) => void, _options?: DatabaseOptions) => (() => void);
17
+ count: (path: string) => Promise<number>;
18
+ }
19
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { ProviderConfigurable } from '../ProviderConfiguration';
2
+ export interface EmailSendParams {
3
+ to: string | string[];
4
+ bcc?: string | string[];
5
+ subject: string;
6
+ message: string;
7
+ }
8
+ export interface EmailProviderAdapter extends ProviderConfigurable {
9
+ send(params: EmailSendParams): Promise<void>;
10
+ }
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import type { EmailProviderAdapter } from './EmailProvider';
3
+ type EmailProviderContextValue = {
4
+ registry: Record<string, EmailProviderAdapter>;
5
+ defaultKey: string;
6
+ };
7
+ declare const EmailProviderContext: React.Context<EmailProviderContextValue | null>;
8
+ export declare const EmailProvider: ({ registry, defaultKey, children, }: EmailProviderContextValue & {
9
+ children: React.ReactNode;
10
+ }) => React.JSX.Element;
11
+ export declare const useEmailProvider: (name?: string) => EmailProviderAdapter | null;
12
+ export default EmailProviderContext;
@@ -0,0 +1,7 @@
1
+ import { EmailProviderAdapter, EmailSendParams } from '../EmailProvider';
2
+ import { type ProviderConfigurationState } from '../../ProviderConfiguration';
3
+ export declare class GmailEmailProvider implements EmailProviderAdapter {
4
+ getConfigurationState(): ProviderConfigurationState;
5
+ isConfigured(): boolean;
6
+ send(params: EmailSendParams): Promise<void>;
7
+ }
@@ -0,0 +1,7 @@
1
+ interface SendEmailOptions {
2
+ to: string;
3
+ subject: string;
4
+ message: string;
5
+ }
6
+ export declare function sendEmail({ to, subject, message }: SendEmailOptions): Promise<import("googleapis").gmail_v1.Schema$Message>;
7
+ export {};
@@ -0,0 +1,13 @@
1
+ type SendEmailParams = {
2
+ to: string[];
3
+ bcc?: string[];
4
+ subject: string;
5
+ message: string;
6
+ };
7
+ type GmailSendResponse = {
8
+ id: string;
9
+ threadId: string;
10
+ labelIds?: string[];
11
+ };
12
+ export declare function sendEmail({ to, bcc, subject, message }: SendEmailParams): Promise<GmailSendResponse>;
13
+ export {};
@@ -0,0 +1,10 @@
1
+ import firebase from "firebase/compat/app";
2
+ import 'firebase/compat/database';
3
+ import { Auth } from "firebase/auth";
4
+ import { FirebaseConfig } from "../Config";
5
+ import { type ProviderConfigurationState } from "./ProviderConfiguration";
6
+ export declare const setFirebaseConfigState: (config: FirebaseConfig | undefined) => void;
7
+ export declare const getFirebaseConfigurationState: () => ProviderConfigurationState;
8
+ export declare const getSafeAuth: () => Auth | null;
9
+ declare const init: (config: FirebaseConfig) => Promise<firebase.app.App>;
10
+ export default init;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ export interface IconComponentProps {
3
+ size?: number;
4
+ className?: string;
5
+ [key: string]: unknown;
6
+ }
7
+ export interface IconProviderAdapter {
8
+ readonly id: string;
9
+ resolve(name: string): React.ComponentType<IconComponentProps> | null;
10
+ }
@@ -0,0 +1,48 @@
1
+ import React from 'react';
2
+ import type { IconProviderAdapter } from './IconProvider';
3
+ /** Built-in icon provider identifiers. */
4
+ export type BuiltInIconProviderId = 'lucide' | 'phosphor';
5
+ /**
6
+ * Configuration for the icon provider.
7
+ *
8
+ * - `BuiltInIconProviderId` string: selects a built-in provider (`'lucide'` | `'phosphor'`)
9
+ * - `IconProviderAdapter` instance: use a custom provider directly
10
+ * - object `{ provider, aliases? }`: custom provider with optional icon name aliases
11
+ *
12
+ * @example
13
+ * iconProvider="phosphor"
14
+ *
15
+ * @example
16
+ * iconProvider={new HeroIconProvider()}
17
+ *
18
+ * @example
19
+ * iconProvider={{ provider: new HeroIconProvider(), aliases: { delete: 'trash', edit: 'pencil' } }}
20
+ */
21
+ export type AppIconProviderConfig = BuiltInIconProviderId | IconProviderAdapter | {
22
+ /** The icon provider instance to use. */
23
+ provider: IconProviderAdapter;
24
+ /** Map icon name aliases to actual icon names in this provider (`{ delete: 'trash' }`). */
25
+ aliases?: Record<string, string>;
26
+ } | {
27
+ /** ID of the default provider to activate. Must be a key in `providers` or a built-in id. */
28
+ default: string;
29
+ /** Additional providers to register alongside the built-in ones. */
30
+ providers: Record<string, IconProviderAdapter>;
31
+ /** Map icon name aliases to actual icon names (`{ delete: 'trash' }`). */
32
+ aliases?: Record<string, string>;
33
+ };
34
+ export interface IconController {
35
+ providerId: string;
36
+ providers: Record<string, IconProviderAdapter>;
37
+ aliases: Record<string, string>;
38
+ setProvider: (id: string) => void;
39
+ registerProvider: (id: string, provider: IconProviderAdapter) => void;
40
+ resolve: IconProviderAdapter['resolve'];
41
+ }
42
+ export declare function IconProvider({ provider, config, children, }: {
43
+ provider?: IconProviderAdapter;
44
+ config?: AppIconProviderConfig;
45
+ children: React.ReactNode;
46
+ }): React.JSX.Element;
47
+ export declare function useIconProvider(): IconProviderAdapter | null;
48
+ export declare function useIconController(): IconController;
@@ -0,0 +1,5 @@
1
+ import type { IconProviderAdapter, IconComponentProps } from './IconProvider';
2
+ export declare class LucideIconProvider implements IconProviderAdapter {
3
+ readonly id: "lucide";
4
+ resolve(name: string): import('react').ComponentType<IconComponentProps> | null;
5
+ }
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { IconProviderAdapter, IconComponentProps } from './IconProvider';
3
+ export type PhosphorWeight = 'thin' | 'light' | 'regular' | 'bold' | 'fill' | 'duotone';
4
+ export declare class PhosphorIconProvider implements IconProviderAdapter {
5
+ private readonly weight;
6
+ readonly id: "phosphor";
7
+ private readonly _cache;
8
+ constructor(weight?: PhosphorWeight);
9
+ resolve(name: string): React.ComponentType<IconComponentProps> | null;
10
+ }
@@ -0,0 +1,6 @@
1
+ export type { IconProviderAdapter, IconComponentProps } from './IconProvider';
2
+ export { LucideIconProvider } from './LucideIconProvider';
3
+ export { PhosphorIconProvider } from './PhosphorIconProvider';
4
+ export type { PhosphorWeight } from './PhosphorIconProvider';
5
+ export { IconProvider, useIconProvider, useIconController } from './IconProviderContext';
6
+ export type { AppIconProviderConfig, IconController } from './IconProviderContext';
@@ -0,0 +1,42 @@
1
+ import { MockDataProvider } from './data/mock';
2
+ import type { DataProviderAdapter } from './data/DataProvider';
3
+ import type { StorageProviderAdapter } from './storage/StorageProvider';
4
+ import type { AuthProviderAdapter } from './auth/AuthProvider';
5
+ import type { EmailProviderAdapter } from './email/EmailProvider';
6
+ import type { DropboxConfig, FirebaseConfig, GoogleOAuth2, GoogleServiceAccount } from '../Config';
7
+ export type ServiceCategory = 'data' | 'storage' | 'auth' | 'email';
8
+ type AnyAdapter = DataProviderAdapter | StorageProviderAdapter | AuthProviderAdapter | EmailProviderAdapter;
9
+ export interface DriverDescriptor<TConfig = unknown> {
10
+ service: ServiceCategory;
11
+ create: (config: TConfig) => AnyAdapter;
12
+ }
13
+ export type DriverManifest<TConfig> = Record<string, DriverDescriptor<TConfig>>;
14
+ export type GoogleProviderConfig = GoogleOAuth2 & {
15
+ serviceAccount?: GoogleServiceAccount;
16
+ developerToken?: string;
17
+ };
18
+ export type SupabaseProviderConfig = {
19
+ url: string;
20
+ anonKey: string;
21
+ bucket?: string;
22
+ };
23
+ export type MockProviderConfig = {
24
+ data?: ConstructorParameters<typeof MockDataProvider>[0];
25
+ };
26
+ export declare const FIREBASE_MANIFEST: DriverManifest<FirebaseConfig>;
27
+ export declare const GOOGLE_MANIFEST: DriverManifest<GoogleProviderConfig>;
28
+ export declare const DROPBOX_MANIFEST: DriverManifest<DropboxConfig>;
29
+ export declare const SUPABASE_MANIFEST: DriverManifest<SupabaseProviderConfig>;
30
+ export declare const MOCK_MANIFEST: DriverManifest<MockProviderConfig>;
31
+ export declare const PROVIDER_MANIFESTS: Record<string, DriverManifest<any>>;
32
+ export type DataDriverName = 'dbRealtime' | 'supabaseDb' | 'mock';
33
+ export type StorageDriverName = 'firestorage' | 'supabaseStorage';
34
+ export type AuthDriverName = 'googleAuth' | 'dropboxAuth';
35
+ export type EmailDriverName = 'gmail';
36
+ export type ServicesConfig = {
37
+ data?: DataDriverName;
38
+ storage?: StorageDriverName;
39
+ auth?: AuthDriverName;
40
+ email?: EmailDriverName;
41
+ };
42
+ export {};
@@ -0,0 +1,10 @@
1
+ declare const fetchScrape: (caller?: any, storePaths?: string[]) => {
2
+ googleSearch: (search: string) => Promise<any>;
3
+ googleImages: (search: string) => Promise<any>;
4
+ googleAutocomplete: (search: string) => Promise<any>;
5
+ googleTrends: (search: string) => Promise<any>;
6
+ googleMaps: (search: string) => Promise<any>;
7
+ googleMapsPhotos: (search: string) => Promise<any>;
8
+ googleMapsReviews: (search: string) => Promise<any>;
9
+ };
10
+ export default fetchScrape;
@@ -0,0 +1,14 @@
1
+ export declare const DEFAULT_GEO_TARGET = "geoTargetConstants/2380";
2
+ export declare const DEFAULT_LANGUAGE = "languageConstants/1000";
3
+ export declare const GEO_TARGETS: Record<string, string>;
4
+ export declare const LANGUAGE_TARGETS: Record<string, string>;
5
+ export declare function getGeoTargetConstant(code: string): string;
6
+ export declare function getLanguageConstant(code: string): string;
7
+ type GetKeywordIdeasParams = {
8
+ keyword: string;
9
+ googleAdsAccountId: string;
10
+ geoCode?: string;
11
+ languageCode?: string;
12
+ };
13
+ export declare function getKeywordIdeas({ keyword, googleAdsAccountId, geoCode, languageCode, }: GetKeywordIdeasParams): Promise<any>;
14
+ export {};
@@ -0,0 +1,25 @@
1
+ export type TrendPoint = {
2
+ date: string;
3
+ value: number;
4
+ };
5
+ export type RelatedQuery = {
6
+ query: string;
7
+ value: number;
8
+ };
9
+ export type GoogleTrendsResponse = {
10
+ keyword: string;
11
+ timeline: TrendPoint[];
12
+ };
13
+ export type GoogleTrendsRelatedResponse = {
14
+ keyword: string;
15
+ top: RelatedQuery[];
16
+ rising: RelatedQuery[];
17
+ };
18
+ /**
19
+ * Ottiene i dati storici di trend per una keyword.
20
+ */
21
+ export declare function getGoogleTrendsData(keyword: string, geo?: string, timeRange?: string): Promise<GoogleTrendsResponse>;
22
+ /**
23
+ * Ottiene query correlate (top e rising) per una keyword.
24
+ */
25
+ export declare function getGoogleTrendsRelated(keyword: string, geo?: string, timeRange?: string): Promise<GoogleTrendsRelatedResponse>;
@@ -0,0 +1,7 @@
1
+ import type { ProviderConfigurable } from '../ProviderConfiguration';
2
+ export interface StorageProviderAdapter extends ProviderConfigurable {
3
+ upload(file: string, path: string): Promise<string | undefined>;
4
+ getURL(path: string): Promise<string | undefined>;
5
+ download(path: string): Promise<Blob | undefined>;
6
+ delete(path: string): Promise<boolean>;
7
+ }