@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.
- package/LICENSE +201 -0
- package/README.md +375 -0
- package/bin/cli.js +99 -0
- package/dist/index.css +1 -0
- package/dist/index.js +838 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +12161 -0
- package/dist/index.mjs.map +1 -0
- package/dist/types/src/App.d.ts +64 -0
- package/dist/types/src/Config.d.ts +65 -0
- package/dist/types/src/Global.d.ts +12 -0
- package/dist/types/src/Head.d.ts +193 -0
- package/dist/types/src/Theme.d.ts +335 -0
- package/dist/types/src/auth.d.ts +27 -0
- package/dist/types/src/components/Component.d.ts +55 -0
- package/dist/types/src/components/FormEnhancer.d.ts +26 -0
- package/dist/types/src/components/Template.d.ts +18 -0
- package/dist/types/src/components/blocks/Brand.d.ts +14 -0
- package/dist/types/src/components/blocks/Breadcrumbs.d.ts +8 -0
- package/dist/types/src/components/blocks/Carousel.d.ts +19 -0
- package/dist/types/src/components/blocks/Dropdown.d.ts +64 -0
- package/dist/types/src/components/blocks/Menu.d.ts +24 -0
- package/dist/types/src/components/blocks/Notifications.d.ts +15 -0
- package/dist/types/src/components/blocks/Search.d.ts +7 -0
- package/dist/types/src/components/index.d.ts +52 -0
- package/dist/types/src/components/types.d.ts +11 -0
- package/dist/types/src/components/ui/Alert.d.ts +13 -0
- package/dist/types/src/components/ui/Badge.d.ts +27 -0
- package/dist/types/src/components/ui/Buttons.d.ts +57 -0
- package/dist/types/src/components/ui/Card.d.ts +15 -0
- package/dist/types/src/components/ui/Code.d.ts +25 -0
- package/dist/types/src/components/ui/Gallery.d.ts +55 -0
- package/dist/types/src/components/ui/GridSystem.d.ts +21 -0
- package/dist/types/src/components/ui/Icon.d.ts +13 -0
- package/dist/types/src/components/ui/Image.d.ts +19 -0
- package/dist/types/src/components/ui/ImageAvatar.d.ts +16 -0
- package/dist/types/src/components/ui/LayoutBuilder.d.ts +19 -0
- package/dist/types/src/components/ui/Loader.d.ts +11 -0
- package/dist/types/src/components/ui/Modal.d.ts +39 -0
- package/dist/types/src/components/ui/Pagination.d.ts +18 -0
- package/dist/types/src/components/ui/Percentage.d.ts +19 -0
- package/dist/types/src/components/ui/Repeat.d.ts +18 -0
- package/dist/types/src/components/ui/Tab.d.ts +20 -0
- package/dist/types/src/components/ui/TabDynamic.d.ts +20 -0
- package/dist/types/src/components/ui/Table.d.ts +43 -0
- package/dist/types/src/components/ui/fields/AssistantAI.d.ts +23 -0
- package/dist/types/src/components/ui/fields/Command.d.ts +15 -0
- package/dist/types/src/components/ui/fields/Crop.d.ts +27 -0
- package/dist/types/src/components/ui/fields/ImageUrl.d.ts +7 -0
- package/dist/types/src/components/ui/fields/Input.d.ts +62 -0
- package/dist/types/src/components/ui/fields/Prompt.d.ts +31 -0
- package/dist/types/src/components/ui/fields/Select.d.ts +38 -0
- package/dist/types/src/components/ui/fields/Upload.d.ts +25 -0
- package/dist/types/src/components/ui/fields/UploadCSV.d.ts +26 -0
- package/dist/types/src/components/ui/useRecordSelection.d.ts +20 -0
- package/dist/types/src/components/ui/useStableRecordKey.d.ts +5 -0
- package/dist/types/src/components/widgets/Form.d.ts +129 -0
- package/dist/types/src/components/widgets/Grid.d.ts +6 -0
- package/dist/types/src/components/widgets/ImageEditor.d.ts +14 -0
- package/dist/types/src/components/widgets/MarkdownReader.d.ts +14 -0
- package/dist/types/src/components/widgets/Prompt.d.ts +31 -0
- package/dist/types/src/components/widgets/TabDynamic.d.ts +20 -0
- package/dist/types/src/components/widgets/grid-core/GridArray.d.ts +5 -0
- package/dist/types/src/components/widgets/grid-core/GridCore.d.ts +5 -0
- package/dist/types/src/components/widgets/grid-core/GridDB.d.ts +5 -0
- package/dist/types/src/components/widgets/grid-core/GridGalleryView.d.ts +5 -0
- package/dist/types/src/components/widgets/grid-core/GridTableView.d.ts +5 -0
- package/dist/types/src/components/widgets/grid-core/index.d.ts +7 -0
- package/dist/types/src/components/widgets/grid-core/resolveGridPathFromUrl.d.ts +1 -0
- package/dist/types/src/components/widgets/grid-core/types.d.ts +227 -0
- package/dist/types/src/components/widgets/grid-core/useGridActions.d.ts +49 -0
- package/dist/types/src/components/widgets/grid-core/useGridColumns.d.ts +10 -0
- package/dist/types/src/components/widgets/grid-core/useGridDBRecords.d.ts +10 -0
- package/dist/types/src/components/widgets/grid-core/useGridPreparedRecords.d.ts +10 -0
- package/dist/types/src/components/widgets/grid-core/useGridSelection.d.ts +13 -0
- package/dist/types/src/components/widgets/grid-core/utils.d.ts +14 -0
- package/dist/types/src/conf/Prompt.d.ts +84 -0
- package/dist/types/src/constant.d.ts +96 -0
- package/dist/types/src/index.d.ts +56 -0
- package/dist/types/src/libs/cache.d.ts +9 -0
- package/dist/types/src/libs/cn.d.ts +2 -0
- package/dist/types/src/libs/converter.d.ts +28 -0
- package/dist/types/src/libs/database.d.ts +3 -0
- package/dist/types/src/libs/email.d.ts +16 -0
- package/dist/types/src/libs/fetch.d.ts +9 -0
- package/dist/types/src/libs/imageBuilder.d.ts +112 -0
- package/dist/types/src/libs/index.d.ts +14 -0
- package/dist/types/src/libs/locale.d.ts +24 -0
- package/dist/types/src/libs/log.d.ts +2 -0
- package/dist/types/src/libs/order.d.ts +14 -0
- package/dist/types/src/libs/path.d.ts +26 -0
- package/dist/types/src/libs/sanitizer.d.ts +38 -0
- package/dist/types/src/libs/seo.d.ts +8 -0
- package/dist/types/src/libs/storage.d.ts +2 -0
- package/dist/types/src/libs/utils.d.ts +57 -0
- package/dist/types/src/motion.d.ts +38 -0
- package/dist/types/src/pages/Blog.d.ts +3 -0
- package/dist/types/src/pages/BlogPost.d.ts +16 -0
- package/dist/types/src/pages/Helper.d.ts +8 -0
- package/dist/types/src/pages/NotFound.d.ts +3 -0
- package/dist/types/src/pages/Users.d.ts +3 -0
- package/dist/types/src/pages/index.d.ts +3 -0
- package/dist/types/src/providers/ProviderConfiguration.d.ts +12 -0
- package/dist/types/src/providers/ai/index.d.ts +134 -0
- package/dist/types/src/providers/auth/AuthProvider.d.ts +22 -0
- package/dist/types/src/providers/auth/AuthProviderContext.d.ts +12 -0
- package/dist/types/src/providers/auth/dropbox/DropboxAuthProvider.d.ts +16 -0
- package/dist/types/src/providers/auth/google/GoogleAuth.d.ts +44 -0
- package/dist/types/src/providers/auth/google/GoogleAuthProvider.d.ts +12 -0
- package/dist/types/src/providers/auth/google/apis/auth.d.ts +4 -0
- package/dist/types/src/providers/auth/google/auth.d.ts +3 -0
- package/dist/types/src/providers/data/DataProvider.d.ts +58 -0
- package/dist/types/src/providers/data/DataProviderContext.d.ts +12 -0
- package/dist/types/src/providers/data/firebase.d.ts +21 -0
- package/dist/types/src/providers/data/mock.d.ts +20 -0
- package/dist/types/src/providers/data/supabase.d.ts +19 -0
- package/dist/types/src/providers/email/EmailProvider.d.ts +10 -0
- package/dist/types/src/providers/email/EmailProviderContext.d.ts +12 -0
- package/dist/types/src/providers/email/google/GmailEmailProvider.d.ts +7 -0
- package/dist/types/src/providers/email/google/apis/email.d.ts +7 -0
- package/dist/types/src/providers/email/google/email.d.ts +13 -0
- package/dist/types/src/providers/firebase-init.d.ts +10 -0
- package/dist/types/src/providers/icon/IconProvider.d.ts +10 -0
- package/dist/types/src/providers/icon/IconProviderContext.d.ts +48 -0
- package/dist/types/src/providers/icon/LucideIconProvider.d.ts +5 -0
- package/dist/types/src/providers/icon/PhosphorIconProvider.d.ts +10 -0
- package/dist/types/src/providers/icon/index.d.ts +6 -0
- package/dist/types/src/providers/manifest.d.ts +42 -0
- package/dist/types/src/providers/scrape/index.d.ts +10 -0
- package/dist/types/src/providers/seo/google/keyword.d.ts +14 -0
- package/dist/types/src/providers/seo/google/trend.d.ts +25 -0
- package/dist/types/src/providers/storage/StorageProvider.d.ts +7 -0
- package/dist/types/src/providers/storage/StorageProviderContext.d.ts +12 -0
- package/dist/types/src/providers/storage/dropbox.d.ts +48 -0
- package/dist/types/src/providers/storage/firebase.d.ts +13 -0
- package/dist/types/src/providers/storage/supabase.d.ts +19 -0
- package/dist/types/src/types/Block.d.ts +4 -0
- package/dist/types/src/types/FormFields.d.ts +33 -0
- package/dist/types/src/types/Layout.d.ts +9 -0
- package/dist/types/src/types/Section.d.ts +4 -0
- package/dist/types/themes/cyber.d.ts +7 -0
- package/dist/types/themes/default.d.ts +7 -0
- package/dist/types/themes/flat.d.ts +7 -0
- package/package.json +126 -0
- package/scripts/cli/create-section.js +65 -0
- package/scripts/cli/setup-devtools.js +85 -0
- package/scripts/cli/setup-project.js +484 -0
- package/themes/cyber.ts +405 -0
- package/themes/default.ts +405 -0
- package/themes/flat.ts +405 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import './globals.css';
|
|
2
|
+
export { default as App } from './App';
|
|
3
|
+
export { useMenu } from './App';
|
|
4
|
+
export type { AppProps, AppProvidersConfig } from './App';
|
|
5
|
+
export type { ServicesConfig, SupabaseProviderConfig, GoogleProviderConfig, MockProviderConfig, DataDriverName, StorageDriverName, AuthDriverName, EmailDriverName, } from './providers/manifest';
|
|
6
|
+
export { Head, HeadProvider, DEFAULT_DOCUMENT_HEAD, DEFAULT_HEAD_APP_NAME, DEFAULT_LANGUAGE_HEAD, useAssetsHead, useDocumentHead, useHead, useHeadLinks, useLanguageHead, usePaginationHead, usePwaHead, useSchemaOrgHead, useSocialHead, } from './Head';
|
|
7
|
+
export type { HeadController, AssetsHeadState, DocumentBaseHead, DocumentHeadState, DocumentHttpEquivMeta, HeadFontAsset, HeadLinkDescriptor, HeadLinksState, HeadMetaAttributes, HeadProviderProps, HeadScriptAsset, HeadStyleAsset, LanguageAlternateLink, LanguageHeadState, OpenGraphHeadState, PageMetadataState, PaginationHeadState, PwaIconLink, PwaHeadState, SchemaOrgHeadState, SchemaOrgJson, SocialHeadState, TwitterHeadState, } from './Head';
|
|
8
|
+
export { useTheme, useThemeController, BUILT_IN_THEMES, BUILT_IN_THEME_IDS } from './Theme';
|
|
9
|
+
export type { AppThemeProviderConfig, BuiltInThemeId, CardTheme, ColorScale, GalleryTheme, MenuTheme, ModalTheme, TableTheme, Theme, ThemeConfig, ThemeController, ThemeMode, ThemeDefinition, ThemePresetConfig, } from './Theme';
|
|
10
|
+
export { AuthButton, useAccessToken, getAccessToken } from './auth';
|
|
11
|
+
export { useGlobalVars, getGlobalVars, setGlobalVars, removeGlobalVars } from './Global';
|
|
12
|
+
export type { DataProviderAdapter, RecordProps, RecordArray, DatabaseOptions, DBConfig, ReadOptions, WhereClause, OrderClause, Condition } from './providers/data/DataProvider';
|
|
13
|
+
export type { OrderConfig, OrderDirection } from './libs/order';
|
|
14
|
+
export { Order } from './libs/order';
|
|
15
|
+
export type { TableHeaderProp, TableReorderHandler, TableReorderMeta, TableSelectionChangeHandler, TableSelectionState } from './components/ui/Table';
|
|
16
|
+
export type { GallerySelectionChangeHandler, GallerySelectionState } from './components/ui/Gallery';
|
|
17
|
+
export type { GridAction, GridActions, GridAfterActionArgs, GridAfterActionHandler, GridArrayProps, GridColumn, GridCoreProps, GridDBPath, GridDBQuery, GridDBProps, GridFooterContext, GridFormContext, GridGalleryViewProps, GridHeaderContext, GridLayout, GridMutationDeleteArgs, GridMutationDeleteHandler, GridMutationSaveArgs, GridMutationSaveHandler, GridReorderHandler, GridReorderMeta, GridRecordKey, GridProps, GridSelectionChangeHandler, GridSelectionMode, GridSelectionState, GridSticky, GridTableViewProps, } from './components/widgets/Grid';
|
|
18
|
+
export type { ProviderConfigurable, ProviderConfigurationState } from './providers/ProviderConfiguration';
|
|
19
|
+
export { getProviderConfigurationState } from './providers/ProviderConfiguration';
|
|
20
|
+
export type { MotionEffect, MotionReference, MotionRegistry, MotionStyle, MotionTransition, ReducedMotionMode, ResolvedMotionEffect } from './motion';
|
|
21
|
+
export { createMotionTransition, resolveMotionEffect, useEnterMotion, useMotionEffect, useMotionState, usePressMotion } from './motion';
|
|
22
|
+
export { FirebaseDataProvider } from './providers/data/firebase';
|
|
23
|
+
export { SupabaseDataProvider } from './providers/data/supabase';
|
|
24
|
+
export { MockDataProvider } from './providers/data/mock';
|
|
25
|
+
export { useDataProvider, DataProvider } from './providers/data/DataProviderContext';
|
|
26
|
+
export type { StorageProviderAdapter } from './providers/storage/StorageProvider';
|
|
27
|
+
export { FirebaseStorageProvider } from './providers/storage/firebase';
|
|
28
|
+
export { SupabaseStorageProvider } from './providers/storage/supabase';
|
|
29
|
+
export { useStorageProvider, StorageProvider } from './providers/storage/StorageProviderContext';
|
|
30
|
+
export type { AuthProviderAdapter, AuthIntent, AuthSignInOptions, UserProfile } from './providers/auth/AuthProvider';
|
|
31
|
+
export { useAuthProvider, AuthProvider } from './providers/auth/AuthProviderContext';
|
|
32
|
+
export { GoogleAuthProvider } from './providers/auth/google/GoogleAuthProvider';
|
|
33
|
+
export { DropboxAuthProvider } from './providers/auth/dropbox/DropboxAuthProvider';
|
|
34
|
+
export type { EmailProviderAdapter, EmailSendParams } from './providers/email/EmailProvider';
|
|
35
|
+
export type { IconProviderAdapter, IconComponentProps } from './providers/icon/IconProvider';
|
|
36
|
+
export { LucideIconProvider } from './providers/icon/LucideIconProvider';
|
|
37
|
+
export { PhosphorIconProvider } from './providers/icon/PhosphorIconProvider';
|
|
38
|
+
export type { PhosphorWeight } from './providers/icon/PhosphorIconProvider';
|
|
39
|
+
export { IconProvider, useIconProvider, useIconController } from './providers/icon/IconProviderContext';
|
|
40
|
+
export type { AppIconProviderConfig, IconController } from './providers/icon/IconProviderContext';
|
|
41
|
+
export { useEmailProvider, EmailProvider } from './providers/email/EmailProviderContext';
|
|
42
|
+
export { GmailEmailProvider } from './providers/email/google/GmailEmailProvider';
|
|
43
|
+
export type { AIFetchConfig } from './providers/ai';
|
|
44
|
+
export { getAIProviderConfigurationState } from './providers/ai';
|
|
45
|
+
export { googleGetAccessToken } from './providers/auth/google/GoogleAuth';
|
|
46
|
+
export { sendEmail } from './providers/email/google/email';
|
|
47
|
+
export { getKeywordIdeas } from './providers/seo/google/keyword';
|
|
48
|
+
export { getGoogleTrendsData, getGoogleTrendsRelated } from './providers/seo/google/trend';
|
|
49
|
+
export { default as db } from './providers/data/firebase';
|
|
50
|
+
export { default as storage } from './providers/storage/firebase';
|
|
51
|
+
export { dropBox, useDropBoxConnect, DropBoxConnectButton } from './providers/storage/dropbox';
|
|
52
|
+
export { AI } from './providers/ai';
|
|
53
|
+
export { default as scrape } from './providers/scrape';
|
|
54
|
+
export * from './components';
|
|
55
|
+
export * from './libs';
|
|
56
|
+
export * from './pages';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface CacheOptions {
|
|
2
|
+
callLabel: string;
|
|
3
|
+
callKey: string;
|
|
4
|
+
callBasePath: string;
|
|
5
|
+
callService: string;
|
|
6
|
+
callFunc: Function;
|
|
7
|
+
callOptions: Object;
|
|
8
|
+
}
|
|
9
|
+
export declare const cache: (search: any, strategy: any, { callLabel, callKey, callBasePath, callService, callFunc, callOptions }: CacheOptions, caller?: any, storePaths?: string[]) => Promise<any>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
type ConverterFunction = (value: string | number | Date, format?: string) => string;
|
|
2
|
+
interface ConverterCore {
|
|
3
|
+
toDate: ConverterFunction;
|
|
4
|
+
toTime: ConverterFunction;
|
|
5
|
+
toDateTime: ConverterFunction;
|
|
6
|
+
toCamel: (str: string, separator?: string, delimiter?: string[]) => string;
|
|
7
|
+
toUpper: (str: string) => string;
|
|
8
|
+
toLower: (str: string) => string;
|
|
9
|
+
toSlug: (str: string) => string;
|
|
10
|
+
subStringCount: (str: string, subStr: string) => number;
|
|
11
|
+
}
|
|
12
|
+
interface Converter extends ConverterCore {
|
|
13
|
+
parse: (values: Record<string, any>, pattern: string, target?: {
|
|
14
|
+
key: string;
|
|
15
|
+
value: any;
|
|
16
|
+
hideEmpty: boolean;
|
|
17
|
+
}) => string;
|
|
18
|
+
truncate: (str: string, length?: number) => string;
|
|
19
|
+
splitLast: (str: string, seps: string | string[], regException?: RegExp) => [string, string];
|
|
20
|
+
splitFirst: (str: string, seps: string | string[], regException?: RegExp) => [string, string];
|
|
21
|
+
padLeft: (str: string, length: number, char?: string, regex?: RegExp) => string;
|
|
22
|
+
padRight: (str: string, length: number, char?: string, regex?: RegExp) => string;
|
|
23
|
+
toQueryString: (params: Record<string, string>, startWith?: string, fill?: string) => string;
|
|
24
|
+
fillObject: <T>(obj: Record<string, T>, value?: any) => Record<string, any>;
|
|
25
|
+
[key: string]: ConverterCore[keyof ConverterCore] | any;
|
|
26
|
+
}
|
|
27
|
+
export declare const converter: Converter;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type Recipient = {
|
|
2
|
+
email: string;
|
|
3
|
+
name?: string;
|
|
4
|
+
};
|
|
5
|
+
type EmailContent = string | React.ReactNode;
|
|
6
|
+
export declare function sendEmail({ to, bcc, subject, message, }: {
|
|
7
|
+
to: string | string[] | Recipient | Recipient[];
|
|
8
|
+
bcc?: string | string[];
|
|
9
|
+
subject: string;
|
|
10
|
+
message?: EmailContent;
|
|
11
|
+
}): Promise<{
|
|
12
|
+
id: string;
|
|
13
|
+
threadId: string;
|
|
14
|
+
labelIds?: string[];
|
|
15
|
+
}[]>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface FetchOptions {
|
|
2
|
+
method?: "GET" | "POST" | "PUT" | "DELETE" | "HEAD" | "PATCH";
|
|
3
|
+
headers?: Record<string, string>;
|
|
4
|
+
body?: Record<string, any> | string;
|
|
5
|
+
}
|
|
6
|
+
export declare function fetchRest(url: string, options?: FetchOptions | null): Promise<any>;
|
|
7
|
+
export declare function fetchJson(url: string, options?: FetchOptions | null): Promise<any>;
|
|
8
|
+
export declare function fetchWithRetry(url: string, options?: RequestInit, maxRetries?: number, statusNoRetry?: number[]): Promise<any | Response>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* imageBuilder — pure utility for generating SEO/performance-optimised <img> tags
|
|
3
|
+
* with srcset support. Does NOT resize images; assumes variant files already exist.
|
|
4
|
+
*
|
|
5
|
+
* Two srcset modes:
|
|
6
|
+
* density — fixed-size images (logos, avatars): 1x / 2x / 3x descriptors
|
|
7
|
+
* naming: image.jpg → image@2x.jpg, image@3x.jpg
|
|
8
|
+
* width — responsive/fluid images (hero, content): width descriptors + sizes
|
|
9
|
+
* naming: image.jpg → image-400w.jpg, image-800w.jpg …
|
|
10
|
+
*/
|
|
11
|
+
export type ImgFit = 'cover' | 'contain' | 'fill' | 'scale-down' | 'none';
|
|
12
|
+
export interface ImageBuilderConfig {
|
|
13
|
+
/** URL, relative path, or data URI of the source image (used as src and as the 1x/base variant in srcset). */
|
|
14
|
+
src: string;
|
|
15
|
+
/** Alt text — required for SEO and accessibility. */
|
|
16
|
+
alt: string;
|
|
17
|
+
title?: string;
|
|
18
|
+
/** Intrinsic display width in px. Prevents CLS (Core Web Vitals). */
|
|
19
|
+
width?: number;
|
|
20
|
+
/** Intrinsic display height in px. Prevents CLS (Core Web Vitals). */
|
|
21
|
+
height?: number;
|
|
22
|
+
fit?: ImgFit;
|
|
23
|
+
position?: string;
|
|
24
|
+
/**
|
|
25
|
+
* loading="lazy" for below-the-fold images.
|
|
26
|
+
* Do NOT use on LCP images — use priority=true instead.
|
|
27
|
+
* Default: 'lazy'.
|
|
28
|
+
*/
|
|
29
|
+
loading?: 'lazy' | 'eager';
|
|
30
|
+
/**
|
|
31
|
+
* Marks this as the LCP (Largest Contentful Paint) image.
|
|
32
|
+
* Sets fetchpriority="high" and loading="eager". Overrides `loading`.
|
|
33
|
+
*/
|
|
34
|
+
priority?: boolean;
|
|
35
|
+
/** Default: 'async' — frees the main thread from image decoding. */
|
|
36
|
+
decoding?: 'async' | 'sync' | 'auto';
|
|
37
|
+
className?: string;
|
|
38
|
+
crossorigin?: 'anonymous' | 'use-credentials';
|
|
39
|
+
referrerpolicy?: string;
|
|
40
|
+
}
|
|
41
|
+
/** Density-based srcset: best for fixed-size images (logos, avatars, icons). */
|
|
42
|
+
export interface SrcsetDensityConfig {
|
|
43
|
+
mode: 'density';
|
|
44
|
+
/** Pixel-density multipliers. Include 1 to make the 1x variant explicit. Default: [1, 2]. */
|
|
45
|
+
densities?: number[];
|
|
46
|
+
/**
|
|
47
|
+
* Override the suffix inserted before the extension for each density.
|
|
48
|
+
* Default: density === 1 → no suffix (uses src as-is), density > 1 → '@{d}x'
|
|
49
|
+
* Example: (2) => '-2x' to get image-2x.jpg instead of image@2x.jpg
|
|
50
|
+
*/
|
|
51
|
+
suffix?: (density: number) => string;
|
|
52
|
+
}
|
|
53
|
+
/** Width-based srcset: best for responsive/fluid images (hero, content, cards). */
|
|
54
|
+
export interface SrcsetWidthConfig {
|
|
55
|
+
mode: 'width';
|
|
56
|
+
/** Image widths in pixels, ascending order. Example: [400, 800, 1200]. */
|
|
57
|
+
widths: number[];
|
|
58
|
+
/**
|
|
59
|
+
* Override the suffix inserted before the extension for each width.
|
|
60
|
+
* Default: (w) => `-${w}w` → image-400w.jpg
|
|
61
|
+
*/
|
|
62
|
+
suffix?: (width: number) => string;
|
|
63
|
+
/**
|
|
64
|
+
* CSS sizes attribute — tells the browser how wide the image renders at each breakpoint.
|
|
65
|
+
* Required for width-mode srcset to work correctly.
|
|
66
|
+
* Example: '(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 33vw'
|
|
67
|
+
*/
|
|
68
|
+
sizes?: string;
|
|
69
|
+
}
|
|
70
|
+
export type SrcsetConfig = SrcsetDensityConfig | SrcsetWidthConfig;
|
|
71
|
+
/** JSON-serialisable representation of all <img> attributes. */
|
|
72
|
+
export interface ImageParams {
|
|
73
|
+
src: string;
|
|
74
|
+
alt: string;
|
|
75
|
+
title?: string;
|
|
76
|
+
width?: number;
|
|
77
|
+
height?: number;
|
|
78
|
+
srcset?: string;
|
|
79
|
+
sizes?: string;
|
|
80
|
+
style?: string;
|
|
81
|
+
loading?: 'lazy' | 'eager';
|
|
82
|
+
decoding?: 'async' | 'sync' | 'auto';
|
|
83
|
+
fetchpriority?: 'high' | 'low' | 'auto';
|
|
84
|
+
class?: string;
|
|
85
|
+
crossorigin?: string;
|
|
86
|
+
referrerpolicy?: string;
|
|
87
|
+
}
|
|
88
|
+
export interface UseImageResult {
|
|
89
|
+
/** Generates the <img> HTML string with all SEO/performance attributes. */
|
|
90
|
+
toHtml: (srcset?: SrcsetConfig) => string;
|
|
91
|
+
/** Generates a JSON string of all img attributes — for CMS, SSR or metadata. */
|
|
92
|
+
toJson: (srcset?: SrcsetConfig) => string;
|
|
93
|
+
/** Returns the raw ImageParams object for custom serialisation. */
|
|
94
|
+
params: (srcset?: SrcsetConfig) => ImageParams;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Returns toHtml / toJson / params helpers bound to the given image config.
|
|
98
|
+
* Does NOT resize images — assumes variant files already exist on the server.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* const img = useImage({ src: 'hero.jpg', alt: 'Hero', width: 800, height: 450, priority: true })
|
|
102
|
+
*
|
|
103
|
+
* // Responsive HTML with width-based srcset (files: hero-400w.jpg, hero-800w.jpg, hero-1200w.jpg)
|
|
104
|
+
* img.toHtml({ mode: 'width', widths: [400, 800, 1200], sizes: '(max-width: 640px) 100vw, 800px' })
|
|
105
|
+
*
|
|
106
|
+
* // Fixed-size HTML with density srcset (files: hero.jpg, hero@2x.jpg, hero@3x.jpg)
|
|
107
|
+
* img.toHtml({ mode: 'density', densities: [1, 2, 3] })
|
|
108
|
+
*
|
|
109
|
+
* // JSON params for CMS or SSR
|
|
110
|
+
* img.toJson({ mode: 'width', widths: [400, 800, 1200], sizes: '100vw' })
|
|
111
|
+
*/
|
|
112
|
+
export declare function useImage(config: ImageBuilderConfig): UseImageResult;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { default as db } from './database';
|
|
2
|
+
export { default as storage } from './storage';
|
|
3
|
+
export { default as path } from './path';
|
|
4
|
+
export { default as log } from './log';
|
|
5
|
+
export { default as seo } from './seo';
|
|
6
|
+
export * from './converter';
|
|
7
|
+
export * from './sanitizer';
|
|
8
|
+
export * from './email';
|
|
9
|
+
export * from './fetch';
|
|
10
|
+
export * from './utils';
|
|
11
|
+
export * from './order';
|
|
12
|
+
export { cn } from './cn';
|
|
13
|
+
export { useImage } from './imageBuilder';
|
|
14
|
+
export type { UseImageResult, ImageBuilderConfig, SrcsetConfig, SrcsetDensityConfig, SrcsetWidthConfig, ImageParams, ImgFit } from './imageBuilder';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const COUNTRIES: {
|
|
2
|
+
US: string;
|
|
3
|
+
CN: string;
|
|
4
|
+
IT: string;
|
|
5
|
+
FR: string;
|
|
6
|
+
DE: string;
|
|
7
|
+
ES: string;
|
|
8
|
+
PT: string;
|
|
9
|
+
RU: string;
|
|
10
|
+
JP: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const LANGS: {
|
|
13
|
+
it: string;
|
|
14
|
+
en: string;
|
|
15
|
+
fr: string;
|
|
16
|
+
de: string;
|
|
17
|
+
es: string;
|
|
18
|
+
pt: string;
|
|
19
|
+
ru: string;
|
|
20
|
+
ja: string;
|
|
21
|
+
ko: string;
|
|
22
|
+
};
|
|
23
|
+
export declare const currentCountry: (code?: boolean) => string;
|
|
24
|
+
export declare const currentLang: (code?: boolean) => string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { RecordProps } from '../providers/data/DataProvider';
|
|
2
|
+
export type OrderDirection = 'asc' | 'desc';
|
|
3
|
+
export type OrderConfig = {
|
|
4
|
+
field: string;
|
|
5
|
+
dir?: OrderDirection;
|
|
6
|
+
};
|
|
7
|
+
export declare const DEFAULT_ORDER: Required<OrderConfig>;
|
|
8
|
+
export declare const Order: {
|
|
9
|
+
normalize(order?: OrderConfig | null): Required<OrderConfig> | undefined;
|
|
10
|
+
toggle(current: OrderConfig | undefined, field: string): Required<OrderConfig>;
|
|
11
|
+
compareValues(a: unknown, b: unknown, dir?: OrderDirection): number;
|
|
12
|
+
compareRecords<T extends RecordProps>(a: T, b: T, order: OrderConfig): number;
|
|
13
|
+
records<T extends RecordProps>(records: T[] | undefined, order?: OrderConfig | null): T[] | undefined;
|
|
14
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
interface PathUtils {
|
|
2
|
+
basename(path: string): string;
|
|
3
|
+
extname(path: string): string;
|
|
4
|
+
dirname(path: string): string;
|
|
5
|
+
filename(path: string): string;
|
|
6
|
+
parentBasename(path: string): string;
|
|
7
|
+
parentDirname(path: string): string;
|
|
8
|
+
parentFilename(path: string): string;
|
|
9
|
+
append(path: string, suffix: string): string;
|
|
10
|
+
prepend(path: string, prefix: string): string;
|
|
11
|
+
changeFilename(path: string, options?: {
|
|
12
|
+
prefix?: string;
|
|
13
|
+
suffix?: string;
|
|
14
|
+
ext?: string | null;
|
|
15
|
+
}): string;
|
|
16
|
+
join(...paths: string[]): string;
|
|
17
|
+
parse(path: string): {
|
|
18
|
+
root: string;
|
|
19
|
+
dir: string;
|
|
20
|
+
base: string;
|
|
21
|
+
ext: string;
|
|
22
|
+
name: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
declare const path: PathUtils;
|
|
26
|
+
export default path;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { converter } from "./converter";
|
|
2
|
+
interface ExclusionItem {
|
|
3
|
+
phrase: string;
|
|
4
|
+
}
|
|
5
|
+
interface Transformation {
|
|
6
|
+
pattern: string;
|
|
7
|
+
replace: string;
|
|
8
|
+
}
|
|
9
|
+
type ConverterMask = keyof typeof converter | {
|
|
10
|
+
func: keyof typeof converter;
|
|
11
|
+
arg?: string;
|
|
12
|
+
};
|
|
13
|
+
export interface SanitizerRule {
|
|
14
|
+
description?: string;
|
|
15
|
+
exclusions?: ExclusionItem[];
|
|
16
|
+
transformations?: Transformation[];
|
|
17
|
+
mask?: ConverterMask[];
|
|
18
|
+
}
|
|
19
|
+
export type SanitizerConfig = Record<string, SanitizerRule>;
|
|
20
|
+
/** Map of field patterns → rule names */
|
|
21
|
+
export interface SanitizerMatch {
|
|
22
|
+
pattern: string;
|
|
23
|
+
use: keyof SanitizerConfig;
|
|
24
|
+
}
|
|
25
|
+
export declare const NORMALIZE_MAP: Record<string, string>;
|
|
26
|
+
export declare function normalizeVisualChars(input: string): string;
|
|
27
|
+
export declare class Sanitizer {
|
|
28
|
+
private config;
|
|
29
|
+
private matches;
|
|
30
|
+
constructor(config?: SanitizerConfig, matches?: SanitizerMatch[]);
|
|
31
|
+
apply(ruleName: keyof SanitizerConfig, value: any, autoCast?: boolean): any;
|
|
32
|
+
applyMatches<T extends Record<string, any>>(obj: T, autoCast?: boolean): T;
|
|
33
|
+
getOptions(): Record<string, string>[];
|
|
34
|
+
addRule(name: keyof SanitizerConfig, rule: SanitizerRule): void;
|
|
35
|
+
addMatch(pattern: string, use: keyof SanitizerConfig): void;
|
|
36
|
+
private wildcardToRegExp;
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { getKeywordIdeas } from "../providers/seo/google/keyword";
|
|
2
|
+
import { getGoogleTrendsData } from "../providers/seo/google/trend";
|
|
3
|
+
declare const seo: {
|
|
4
|
+
keyword: typeof getKeywordIdeas;
|
|
5
|
+
trend: typeof getGoogleTrendsData;
|
|
6
|
+
serp: null;
|
|
7
|
+
};
|
|
8
|
+
export default seo;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RecordProps } from '../providers/data/DataProvider';
|
|
3
|
+
export declare const decodeJWT: (token: string) => any;
|
|
4
|
+
export declare const copyToClipboard: (text: string) => void;
|
|
5
|
+
export declare const trimPath: (path?: string) => string;
|
|
6
|
+
export declare const normalizePath: (path?: string) => string;
|
|
7
|
+
export declare const trimSlash: (path?: string | number | boolean) => string;
|
|
8
|
+
export declare const normalizeKey: (key?: string | number | boolean) => string;
|
|
9
|
+
export declare const dirname: (path: string) => string;
|
|
10
|
+
export declare function sleep(ms: number): Promise<void>;
|
|
11
|
+
export declare function proxy(url: string, format?: string): string;
|
|
12
|
+
export declare function generateUniqueId(name?: null): string;
|
|
13
|
+
export declare function eventClosest(e: Event, tagName: string): HTMLElement | null;
|
|
14
|
+
export declare const substrCount: (str: string, sub: string) => number;
|
|
15
|
+
export declare const replacePlaceholders: (pattern: string, arrPath: string[]) => string;
|
|
16
|
+
export declare const checkConditions: (conds: Array<{
|
|
17
|
+
key: string;
|
|
18
|
+
value: string;
|
|
19
|
+
operator: string;
|
|
20
|
+
}>, metaObject: {
|
|
21
|
+
[key: string]: string | undefined;
|
|
22
|
+
}, tokens: string[]) => boolean;
|
|
23
|
+
export declare const crc32: (str: string) => number;
|
|
24
|
+
export declare const ucfirst: (str?: string) => string;
|
|
25
|
+
export declare const loadScripts: (scriptData: Array<{
|
|
26
|
+
src: string;
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
}>) => void;
|
|
29
|
+
export declare const intersectObjects: (obj1: {
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
}, obj2: {
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
}) => {
|
|
34
|
+
[key: string]: any;
|
|
35
|
+
};
|
|
36
|
+
export declare const replaceVariables: (pattern: string, metaObject: {
|
|
37
|
+
[key: string]: string | undefined;
|
|
38
|
+
}) => string;
|
|
39
|
+
export declare const arrayUnique: <T>(array: T[], key?: keyof T) => T[];
|
|
40
|
+
export declare const isEmpty: (data: any) => boolean;
|
|
41
|
+
export declare function safeClone<T>(obj: T): T;
|
|
42
|
+
export declare function base64Encode(input: string | Buffer | ArrayBuffer): string;
|
|
43
|
+
export declare function arraysEqual(a: any[], b: any[]): boolean;
|
|
44
|
+
export declare function sanitizeKey(str: string): string;
|
|
45
|
+
/**
|
|
46
|
+
* Checks if the event target or any of its parent elements is an interactive element
|
|
47
|
+
* (link, button, input, textarea, or select)
|
|
48
|
+
* @param e The event to check
|
|
49
|
+
* @returns true if the target or any parent is an interactive element
|
|
50
|
+
*/
|
|
51
|
+
export declare function isInteractiveElement(e: Event | React.MouseEvent, exclude?: string): boolean;
|
|
52
|
+
export declare const render2Base64: (arrayBuffer: ArrayBuffer) => string;
|
|
53
|
+
export declare const base64ToBlob: (base64: string, type: string) => Blob | undefined;
|
|
54
|
+
export declare const base64ToUrl: (base64: string, type: string) => string | undefined;
|
|
55
|
+
export declare const getRecordValue: (record?: RecordProps, name?: string) => any;
|
|
56
|
+
export declare const cleanRecord: (record: RecordProps | undefined) => RecordProps;
|
|
57
|
+
export declare const smartTypeCast: (value: any) => string | number | boolean | null | undefined;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type ReducedMotionMode = 'respect-user' | 'always' | 'never';
|
|
3
|
+
export type MotionStyle = React.CSSProperties;
|
|
4
|
+
export type MotionReference = string | MotionEffect | false;
|
|
5
|
+
export interface MotionTransition {
|
|
6
|
+
duration?: number;
|
|
7
|
+
easing?: string;
|
|
8
|
+
delay?: number;
|
|
9
|
+
properties?: string[];
|
|
10
|
+
}
|
|
11
|
+
export interface MotionEffect {
|
|
12
|
+
from?: MotionStyle;
|
|
13
|
+
to?: MotionStyle;
|
|
14
|
+
transition?: MotionTransition;
|
|
15
|
+
reducedMotion?: ReducedMotionMode;
|
|
16
|
+
}
|
|
17
|
+
export type MotionRegistry = Record<string, MotionEffect>;
|
|
18
|
+
export interface ResolvedMotionEffect {
|
|
19
|
+
from: MotionStyle;
|
|
20
|
+
to: MotionStyle;
|
|
21
|
+
transition: Required<MotionTransition>;
|
|
22
|
+
reducedMotion: ReducedMotionMode;
|
|
23
|
+
transitionValue: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const createMotionTransition: (transition: Required<MotionTransition>) => string;
|
|
26
|
+
export declare const resolveMotionEffect: (reference: MotionReference | undefined, registry?: MotionRegistry, fallback?: MotionReference) => ResolvedMotionEffect;
|
|
27
|
+
export declare const useMotionEffect: (reference?: MotionReference, fallback?: MotionReference) => ResolvedMotionEffect;
|
|
28
|
+
export declare const useMotionState: (active: boolean, reference?: MotionReference, fallback?: MotionReference, baseStyle?: React.CSSProperties) => React.CSSProperties;
|
|
29
|
+
export declare const usePressMotion: (disabled?: boolean, baseStyle?: React.CSSProperties, reference?: MotionReference, fallback?: MotionReference) => {
|
|
30
|
+
style: React.CSSProperties;
|
|
31
|
+
pressHandlers: {
|
|
32
|
+
onMouseDown: () => false | void;
|
|
33
|
+
onMouseUp: () => void;
|
|
34
|
+
onMouseLeave: () => void;
|
|
35
|
+
onBlur: () => void;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export declare const useEnterMotion: (baseStyle?: React.CSSProperties, reference?: MotionReference, fallback?: MotionReference) => React.CSSProperties;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PROMPTS } from '../conf/Prompt';
|
|
3
|
+
type PromptKey = keyof typeof PROMPTS;
|
|
4
|
+
interface ConfigVariables {
|
|
5
|
+
lang: string;
|
|
6
|
+
voice: string;
|
|
7
|
+
style: string;
|
|
8
|
+
limit: string;
|
|
9
|
+
}
|
|
10
|
+
export default function BlogPost({ data, promptTopic, onChange, value }: {
|
|
11
|
+
data?: ConfigVariables;
|
|
12
|
+
promptTopic?: PromptKey;
|
|
13
|
+
onChange?: (e: any) => void;
|
|
14
|
+
value?: any;
|
|
15
|
+
}): React.JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ProviderConfigurationState {
|
|
2
|
+
configured: boolean;
|
|
3
|
+
reason?: string;
|
|
4
|
+
missingKeys?: string[];
|
|
5
|
+
}
|
|
6
|
+
export interface ProviderConfigurable {
|
|
7
|
+
isConfigured?(): boolean;
|
|
8
|
+
getConfigurationState?(): ProviderConfigurationState;
|
|
9
|
+
}
|
|
10
|
+
export declare const getMissingKeys: (config: Record<string, unknown> | undefined, keys: string[], prefix?: string) => string[];
|
|
11
|
+
export declare const createConfigurationState: (provider: string, missingKeys: string[]) => ProviderConfigurationState;
|
|
12
|
+
export declare const getProviderConfigurationState: (provider: ProviderConfigurable | null | undefined, fallbackName?: string) => ProviderConfigurationState;
|