@gaddario98/react-core 2.0.2 → 2.0.3

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.
@@ -0,0 +1,1827 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as _gaddario98_react_form from '@gaddario98/react-form';
3
+ import { FieldValues, FormManagerConfig, Submit, SetValueFunction, FormManager, SubmitKeysArg, FormElements } from '@gaddario98/react-form';
4
+ import { QueriesArray, MultipleQueryResponse, AllMutation, QueryDefinition, MutationConfig, QueryProps, QueryAtIndex, ExtractQuery } from '@gaddario98/react-queries';
5
+ import { DeepKeys, DeepValue } from '@tanstack/react-form';
6
+ import { ComponentProps } from 'react';
7
+ import * as _gaddario98_react_state from '@gaddario98/react-state';
8
+ import { AuthState } from '@gaddario98/react-auth';
9
+ import * as jotai_family from 'jotai-family';
10
+ import * as jotai from 'jotai';
11
+
12
+ /**
13
+ * Metadata Configuration Types
14
+ * Custom metadata system replacing react-helmet-async
15
+ * Platform-agnostic: works on web, React Native, and SSR
16
+ */
17
+
18
+ /**
19
+ * Context passed to dynamic metadata evaluator functions
20
+ * Provides access to form values, queries, and page state
21
+ */
22
+ type MetadataEvaluatorContext<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray> = FunctionProps<F, Q>;
23
+ interface MetaTag {
24
+ /** For <meta name="..." content="..." /> */
25
+ name?: string;
26
+ /** For <meta property="og:..." content="..." /> */
27
+ property?: string;
28
+ /** For <meta http-equiv="..." content="..." /> */
29
+ httpEquiv?: string;
30
+ /** Meta tag content */
31
+ content: string;
32
+ /** Unique identifier for updating existing tags */
33
+ id?: string;
34
+ }
35
+ /**
36
+ * Open Graph Image Configuration
37
+ */
38
+ interface OpenGraphImage {
39
+ /** Absolute URL to the image */
40
+ url: string;
41
+ /** Alt text for the image */
42
+ alt?: string;
43
+ /** Image width in pixels */
44
+ width?: number;
45
+ /** Image height in pixels */
46
+ height?: number;
47
+ /** MIME type (e.g., "image/jpeg", "image/png") */
48
+ type?: string;
49
+ }
50
+ /**
51
+ * Open Graph Article Configuration (when type='article')
52
+ */
53
+ interface OpenGraphArticle {
54
+ /** ISO 8601 date string */
55
+ publishedTime?: string;
56
+ /** ISO 8601 date string */
57
+ modifiedTime?: string;
58
+ /** ISO 8601 date string */
59
+ expirationTime?: string;
60
+ /** Author name or URL */
61
+ author?: string | Array<string>;
62
+ /** Article section/category */
63
+ section?: string;
64
+ /** Article tags */
65
+ tags?: Array<string>;
66
+ }
67
+ /**
68
+ * Open Graph Configuration (Facebook, LinkedIn, etc.)
69
+ */
70
+ interface OpenGraphConfig<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray> {
71
+ type?: 'website' | 'article' | 'product' | 'profile';
72
+ title?: string | ((context: MetadataEvaluatorContext<F, Q>) => string);
73
+ description?: string | ((context: MetadataEvaluatorContext<F, Q>) => string);
74
+ /** Single image URL or full image config */
75
+ image?: string | OpenGraphImage | ((context: MetadataEvaluatorContext<F, Q>) => string | OpenGraphImage);
76
+ /** Multiple images for the page */
77
+ images?: Array<OpenGraphImage> | ((context: MetadataEvaluatorContext<F, Q>) => Array<OpenGraphImage>);
78
+ /** Canonical URL */
79
+ url?: string | ((context: MetadataEvaluatorContext<F, Q>) => string);
80
+ siteName?: string;
81
+ /** Locale (e.g., "en_US", "it_IT") */
82
+ locale?: string;
83
+ /** Article-specific metadata (when type='article') */
84
+ article?: OpenGraphArticle;
85
+ }
86
+ /**
87
+ * Twitter Card Configuration
88
+ */
89
+ interface TwitterCardConfig<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray> {
90
+ /** Card type */
91
+ card?: 'summary' | 'summary_large_image' | 'app' | 'player';
92
+ /** @username of the website */
93
+ site?: string;
94
+ /** @username of the content creator */
95
+ creator?: string;
96
+ /** Title (falls back to og:title then page title) */
97
+ title?: string | ((context: MetadataEvaluatorContext<F, Q>) => string);
98
+ /** Description (falls back to og:description then page description) */
99
+ description?: string | ((context: MetadataEvaluatorContext<F, Q>) => string);
100
+ /** Image URL (falls back to og:image) */
101
+ image?: string | ((context: MetadataEvaluatorContext<F, Q>) => string);
102
+ /** Alt text for the image */
103
+ imageAlt?: string | ((context: MetadataEvaluatorContext<F, Q>) => string);
104
+ }
105
+ /**
106
+ * Alternate languages/URLs configuration for i18n SEO
107
+ */
108
+ interface AlternatesConfig {
109
+ /** Canonical URL for this page */
110
+ canonical?: string;
111
+ /** Map of locale → URL for hreflang tags (e.g., { "en": "/en/page", "it": "/it/page" }) */
112
+ languages?: Record<string, string>;
113
+ /** Media-specific alternates (e.g., mobile version) */
114
+ media?: Record<string, string>;
115
+ /** RSS/Atom feed alternates */
116
+ types?: Record<string, Array<{
117
+ url: string;
118
+ title?: string;
119
+ }>>;
120
+ }
121
+ /**
122
+ * Icon configuration
123
+ */
124
+ interface IconConfig {
125
+ /** URL to the icon */
126
+ url: string;
127
+ /** Icon type (e.g., "image/png", "image/svg+xml") */
128
+ type?: string;
129
+ /** Icon sizes (e.g., "32x32", "192x192") */
130
+ sizes?: string;
131
+ /** Color for SVG mask icons */
132
+ color?: string;
133
+ }
134
+ /**
135
+ * Icons & PWA configuration
136
+ */
137
+ interface IconsConfig {
138
+ /** Standard favicon(s) - link[rel="icon"] */
139
+ icon?: string | IconConfig | Array<IconConfig>;
140
+ /** Apple touch icon(s) - link[rel="apple-touch-icon"] */
141
+ apple?: string | IconConfig | Array<IconConfig>;
142
+ /** Shortcut icon (legacy) */
143
+ shortcut?: string;
144
+ }
145
+ /**
146
+ * Structured Data Configuration (schema.org JSON-LD)
147
+ */
148
+ interface StructuredDataConfig<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray> {
149
+ type: 'Article' | 'Product' | 'WebPage' | 'FAQPage' | 'Organization' | 'Person' | 'WebSite' | 'BreadcrumbList';
150
+ schema: Record<string, unknown> | ((context: MetadataEvaluatorContext<F, Q>) => Record<string, unknown>);
151
+ }
152
+ /**
153
+ * AI Crawler Hints (for AI search engines and LLMs)
154
+ */
155
+ interface AIHintsConfig<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray> {
156
+ /** Content classification (e.g., "documentation", "tutorial", "reference") */
157
+ contentClassification?: string | ((context: MetadataEvaluatorContext<F, Q>) => string);
158
+ /** Hints for AI models (e.g., ["code-heavy", "technical"]) */
159
+ modelHints?: Array<string> | ((context: MetadataEvaluatorContext<F, Q>) => Array<string>);
160
+ /** Additional context for AI understanding */
161
+ contextualInfo?: string | ((context: MetadataEvaluatorContext<F, Q>) => string);
162
+ /** Exclude this page from AI crawler indexing */
163
+ excludeFromIndexing?: boolean;
164
+ }
165
+ /**
166
+ * Robots Configuration (indexing directives)
167
+ */
168
+ interface RobotsConfig {
169
+ /** Prevent indexing */
170
+ noindex?: boolean;
171
+ /** Don't follow links */
172
+ nofollow?: boolean;
173
+ /** Don't cache page */
174
+ noarchive?: boolean;
175
+ /** Don't show snippets in search results */
176
+ nosnippet?: boolean;
177
+ /** Image preview size in search results */
178
+ maxImagePreview?: 'none' | 'standard' | 'large';
179
+ /** Max snippet length in search results */
180
+ maxSnippet?: number;
181
+ }
182
+ /**
183
+ * Resolved Metadata - all dynamic functions have been evaluated.
184
+ * This is the output of resolveMetadata() and is what gets applied to the DOM
185
+ * or passed to framework helpers (toNextMetadata, etc.).
186
+ */
187
+ interface ResolvedMetadata {
188
+ title?: string;
189
+ description?: string;
190
+ canonical?: string;
191
+ lang?: string;
192
+ keywords?: Array<string>;
193
+ author?: string;
194
+ viewport?: string;
195
+ themeColor?: string;
196
+ openGraph?: {
197
+ type?: 'website' | 'article' | 'product' | 'profile';
198
+ title?: string;
199
+ description?: string;
200
+ image?: string | OpenGraphImage;
201
+ images?: Array<OpenGraphImage>;
202
+ url?: string;
203
+ siteName?: string;
204
+ locale?: string;
205
+ article?: OpenGraphArticle;
206
+ };
207
+ twitter?: {
208
+ card?: 'summary' | 'summary_large_image' | 'app' | 'player';
209
+ site?: string;
210
+ creator?: string;
211
+ title?: string;
212
+ description?: string;
213
+ image?: string;
214
+ imageAlt?: string;
215
+ };
216
+ alternates?: AlternatesConfig;
217
+ icons?: IconsConfig;
218
+ /** Web app manifest URL */
219
+ manifest?: string;
220
+ structuredData?: {
221
+ type: string;
222
+ schema: Record<string, unknown>;
223
+ };
224
+ aiHints?: {
225
+ contentClassification?: string;
226
+ modelHints?: Array<string>;
227
+ contextualInfo?: string;
228
+ excludeFromIndexing?: boolean;
229
+ };
230
+ robots?: RobotsConfig;
231
+ disableIndexing?: boolean;
232
+ customMeta?: Array<MetaTag>;
233
+ }
234
+ /**
235
+ * Complete Metadata Configuration (Generic over F and Q for dynamic metadata)
236
+ * This is the "input" type — values can be strings or evaluator functions.
237
+ * Use resolveMetadata() to convert this to ResolvedMetadata.
238
+ */
239
+ interface MetadataConfig<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray> {
240
+ /** Page title - sets document.title on web */
241
+ title?: string | ((context: MetadataEvaluatorContext<F, Q>) => string);
242
+ /** Page description meta tag */
243
+ description?: string | ((context: MetadataEvaluatorContext<F, Q>) => string);
244
+ /** Canonical URL for the page */
245
+ canonical?: string | ((context: MetadataEvaluatorContext<F, Q>) => string);
246
+ /** HTML lang attribute (e.g., "en", "it") */
247
+ lang?: string;
248
+ /**
249
+ * @deprecated Use `lang` instead. Will be removed in a future version.
250
+ */
251
+ documentLang?: string;
252
+ /** Keywords for SEO */
253
+ keywords?: Array<string> | ((context: MetadataEvaluatorContext<F, Q>) => Array<string>);
254
+ openGraph?: OpenGraphConfig<F, Q>;
255
+ twitter?: TwitterCardConfig<F, Q>;
256
+ alternates?: AlternatesConfig;
257
+ icons?: IconsConfig;
258
+ /** Web app manifest URL */
259
+ manifest?: string;
260
+ structuredData?: StructuredDataConfig<F, Q>;
261
+ aiHints?: AIHintsConfig<F, Q>;
262
+ robots?: RobotsConfig;
263
+ customMeta?: Array<MetaTag> | ((context: MetadataEvaluatorContext<F, Q>) => Array<MetaTag>);
264
+ disableIndexing?: boolean;
265
+ /** Author meta tag */
266
+ author?: string;
267
+ /** Viewport meta tag (defaults to "width=device-width, initial-scale=1") */
268
+ viewport?: string;
269
+ /** Theme color for browser UI */
270
+ themeColor?: string;
271
+ }
272
+ /**
273
+ * Request-scoped metadata store.
274
+ * In SSR each request gets its own store to avoid cross-request leaks.
275
+ * On the client, a single global store is used.
276
+ */
277
+ interface MetadataStore {
278
+ /** Get current resolved metadata */
279
+ getMetadata: () => ResolvedMetadata;
280
+ /** Set (merge) resolved metadata into the store */
281
+ setMetadata: (meta: ResolvedMetadata) => void;
282
+ /** Reset store to empty */
283
+ reset: () => void;
284
+ }
285
+ interface MetadataProvider {
286
+ /** Apply metadata configuration to the page */
287
+ setMetadata: (config: MetadataConfig) => void;
288
+ /** Get current metadata configuration */
289
+ getMetadata: () => MetadataConfig;
290
+ /** Reset all metadata to defaults */
291
+ resetMetadata: () => void;
292
+ }
293
+ /**
294
+ * Configuration for lazy loading and code splitting behavior
295
+ * Enables deferred component loading to reduce initial bundle size
296
+ */
297
+ interface LazyLoadingConfig<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray> {
298
+ /** Enable lazy loading (default: true) */
299
+ enabled?: boolean;
300
+ /** Preload on hover for interactive elements (default: false) */
301
+ preloadOnHover?: boolean;
302
+ /** Preload on focus for keyboard navigation (default: false) */
303
+ preloadOnFocus?: boolean;
304
+ /** Preload after render with delay (in ms, default: undefined - no delay) */
305
+ preloadAfterRender?: number;
306
+ /** Fallback component to show while loading (default: null) */
307
+ suspenseFallback?: React.ReactNode;
308
+ /** Custom error boundary component for lazy-loaded modules */
309
+ errorBoundary?: React.ComponentType<{
310
+ error: Error;
311
+ retry: () => void;
312
+ }>;
313
+ /** Maximum time to wait before showing error state (in ms, default: 30000) */
314
+ timeout?: number;
315
+ /** Log performance metrics for lazy loading (development only) */
316
+ logMetrics?: boolean;
317
+ /** IntersectionObserver threshold (0-1, default: 0.1) - alias for intersectionThreshold */
318
+ threshold?: number | Array<number>;
319
+ /** IntersectionObserver threshold (0-1, default: 0.1) */
320
+ intersectionThreshold?: number | Array<number>;
321
+ /** IntersectionObserver root margin (default: "100px") - alias for intersectionRootMargin */
322
+ rootMargin?: string;
323
+ /** IntersectionObserver root margin (default: "100px") */
324
+ intersectionRootMargin?: string;
325
+ /** Trigger type for lazy loading: viewport (IntersectionObserver), interaction (manual), or conditional (based on function) */
326
+ trigger?: 'viewport' | 'interaction' | 'conditional';
327
+ /** Conditional function to determine if content should load (for trigger: "conditional") */
328
+ condition?: (context: MetadataEvaluatorContext<F, Q>) => boolean;
329
+ /** Placeholder component to show before lazy content loads */
330
+ placeholder?: React.ReactNode;
331
+ }
332
+ /**
333
+ * Entry for the llms.txt file
334
+ */
335
+ interface LlmsTxtEntry {
336
+ /** URL of the page */
337
+ url: string;
338
+ /** Short title / label for this page */
339
+ title: string;
340
+ /** Brief description for the LLM */
341
+ description?: string;
342
+ }
343
+ /**
344
+ * Configuration for llms.txt generation
345
+ */
346
+ interface LlmsTxtConfig {
347
+ /** Site title / name shown at the top of llms.txt */
348
+ siteName: string;
349
+ /** Brief description of the site */
350
+ siteDescription?: string;
351
+ /** Curated list of pages to expose in llms.txt */
352
+ entries: Array<LlmsTxtEntry>;
353
+ }
354
+
355
+ /**
356
+ * Metadata Store, DOM Application, and Server Collection
357
+ *
358
+ * Architecture:
359
+ * - `createMetadataStore()` → request-scoped store (SSR-safe)
360
+ * - `applyMetadataToDom(resolved)` → client-side DOM manipulation
361
+ * - `collectMetadataToHtml(resolved)` → server-side HTML string collection
362
+ * - `setMetadata / getMetadata / resetMetadata` → backward-compatible global API
363
+ *
364
+ * @module config/metadata
365
+ */
366
+
367
+ /**
368
+ * Create a new request-scoped metadata store.
369
+ * In SSR, each incoming request should create its own store
370
+ * to avoid cross-request data leaks.
371
+ * On the client, a single global store is used (see below).
372
+ */
373
+ declare function createMetadataStore(): MetadataStore;
374
+ /**
375
+ * Apply resolved metadata to the document `<head>`.
376
+ * Client-only: this function does nothing if `document` is not available.
377
+ * Covers: title, description, canonical, lang, keywords, author, viewport,
378
+ * themeColor, Open Graph (advanced), Twitter Card, alternates/hreflang,
379
+ * icons, manifest, structured data JSON-LD, AI hints, robots, customMeta.
380
+ */
381
+ declare function applyMetadataToDom(resolved: ResolvedMetadata): void;
382
+ /**
383
+ * Collect resolved metadata as an HTML string for SSR injection into `<head>`.
384
+ * Pure function — no DOM, no side effects.
385
+ */
386
+ declare function collectMetadataToHtml(resolved: ResolvedMetadata): string;
387
+ /**
388
+ * Apply metadata configuration to the page.
389
+ * Merges with existing metadata in the global store.
390
+ * On web: also applies changes to the DOM.
391
+ *
392
+ * @deprecated Prefer using `MetadataStoreProvider` + `resolveMetadata` + `applyMetadataToDom`
393
+ * for SSR-safe, request-scoped metadata management.
394
+ */
395
+ declare const setMetadata: (config: MetadataConfig) => void;
396
+ /**
397
+ * Get current metadata from the global store.
398
+ * @deprecated Prefer using `MetadataStoreProvider` context in SSR.
399
+ */
400
+ declare const getMetadata: () => MetadataConfig;
401
+ /**
402
+ * Reset all metadata in the global store.
403
+ * @deprecated Prefer using `MetadataStoreProvider` context in SSR.
404
+ */
405
+ declare const resetMetadata: () => void;
406
+
407
+ /**
408
+ * resolveMetadata — Pure function that evaluates dynamic MetadataConfig into ResolvedMetadata.
409
+ *
410
+ * All evaluator functions (title, description, og fields, twitter fields, etc.)
411
+ * are called with the provided context. The result is a plain object with no functions.
412
+ *
413
+ * This function has NO side effects: no DOM, no global state.
414
+ *
415
+ * @module config/resolveMetadata
416
+ */
417
+
418
+ /**
419
+ * Resolve a MetadataConfig (which may contain evaluator functions)
420
+ * into a plain ResolvedMetadata object.
421
+ *
422
+ * @param meta - The metadata configuration (static or with dynamic functions)
423
+ * @param ctx - The context providing get/set accessors for queries, form, state
424
+ * @returns Fully resolved metadata with all functions evaluated
425
+ */
426
+ declare function resolveMetadata<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray>(meta: MetadataConfig<F, Q>, ctx: MetadataEvaluatorContext<F, Q>): ResolvedMetadata;
427
+
428
+ interface MetadataStoreProviderProps {
429
+ /** Optional pre-created store. If not provided, a new one is created. */
430
+ store?: MetadataStore;
431
+ children: React.ReactNode;
432
+ }
433
+ /**
434
+ * Provides a request-scoped MetadataStore via React Context.
435
+ *
436
+ * @example SSR (one per request)
437
+ * ```tsx
438
+ * import { createMetadataStore, MetadataStoreProvider } from '@/core/pages';
439
+ *
440
+ * function handleRequest(req, res) {
441
+ * const store = createMetadataStore();
442
+ * const html = renderToString(
443
+ * <MetadataStoreProvider store={store}>
444
+ * <App />
445
+ * </MetadataStoreProvider>
446
+ * );
447
+ * const headHtml = collectMetadataToHtml(store.getMetadata());
448
+ * // inject headHtml into <head>
449
+ * }
450
+ * ```
451
+ */
452
+ declare function MetadataStoreProvider({ store, children, }: MetadataStoreProviderProps): react_jsx_runtime.JSX.Element;
453
+ /**
454
+ * Access the nearest request-scoped MetadataStore.
455
+ * Returns `null` if no provider is found (falls back to global store in consumers).
456
+ */
457
+ declare function useMetadataStore(): MetadataStore | null;
458
+
459
+ /**
460
+ * Optional dev-only metadata logging.
461
+ *
462
+ * Tracks what metadata was resolved and applied, useful for debugging
463
+ * metadata issues during development.
464
+ *
465
+ * Logging is a no-op in production builds.
466
+ *
467
+ * @module config/metadataLogger
468
+ */
469
+
470
+ interface MetadataLogEntry {
471
+ pageId: string;
472
+ action: 'resolve' | 'apply-dom' | 'apply-store' | 'translate';
473
+ metadata: ResolvedMetadata;
474
+ timestamp: number;
475
+ }
476
+ /**
477
+ * Enable or disable metadata logging.
478
+ * Only effective in development mode.
479
+ */
480
+ declare function setMetadataLogging(enabled: boolean): void;
481
+ /**
482
+ * Log a metadata action (resolve, apply, translate).
483
+ * No-op in production or when logging is disabled.
484
+ */
485
+ declare function logMetadata(pageId: string, action: MetadataLogEntry['action'], metadata: ResolvedMetadata): void;
486
+ /**
487
+ * Get all logged metadata entries (dev only).
488
+ * Useful for inspecting metadata in browser devtools.
489
+ */
490
+ declare function getMetadataLog(): Array<MetadataLogEntry>;
491
+ /**
492
+ * Clear the metadata log.
493
+ */
494
+ declare function clearMetadataLog(): void;
495
+
496
+ interface DefaultContainerProps<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> {
497
+ children?: Array<React.JSX.Element>;
498
+ allContents: Array<ContentItem<F, Q, V> | FormManagerConfig<F> | Submit<F>>;
499
+ handleRefresh?: () => void;
500
+ viewSettings?: ViewSettings;
501
+ pageId?: string;
502
+ }
503
+ type PageAuthState = {
504
+ id: string;
505
+ accountVerified?: boolean;
506
+ isLogged?: boolean;
507
+ token?: string;
508
+ phoneNumber?: string;
509
+ email?: string;
510
+ };
511
+ interface PageTranslationOptions {
512
+ [key: string]: string | number | boolean | undefined;
513
+ ns?: string;
514
+ }
515
+ interface PageConfigProps {
516
+ HeaderContainer: <F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray, V extends Record<string, unknown> = Record<string, unknown>>(props: Omit<DefaultContainerProps<F, Q, V>, 'viewSettings'> & ViewSettings['header']) => React.ReactNode;
517
+ FooterContainer: <F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray, V extends Record<string, unknown> = Record<string, unknown>>(props: Omit<DefaultContainerProps<F, Q, V>, 'viewSettings'> & ViewSettings['footer']) => React.ReactNode;
518
+ BodyContainer: <F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray, V extends Record<string, unknown> = Record<string, unknown>>(props: DefaultContainerProps<F, Q, V>) => React.ReactNode;
519
+ authPageImage: string;
520
+ authPageProps: PageProps;
521
+ isLogged: (val: AuthState | null) => boolean;
522
+ ItemsContainer: (props: {
523
+ children: React.ReactNode;
524
+ }) => React.ReactNode;
525
+ LoaderComponent?: (props: {
526
+ loading?: boolean;
527
+ message?: string;
528
+ ns?: string;
529
+ }) => React.ReactNode;
530
+ PageContainer: (props: {
531
+ children: React.ReactNode;
532
+ id: string;
533
+ }) => React.ReactNode;
534
+ meta?: {
535
+ title?: string;
536
+ description?: string;
537
+ };
538
+ defaultMetadata: MetadataConfig;
539
+ setMetadata: (config: MetadataConfig) => void;
540
+ getMetadata: () => MetadataConfig;
541
+ resetMetadata: () => void;
542
+ lazyLoading: LazyLoadingConfig;
543
+ authValues?: PageAuthState | null;
544
+ locale?: string;
545
+ translateText?: (key: string, options?: PageTranslationOptions) => string;
546
+ }
547
+ declare function getPageConfig(): PageConfigProps;
548
+ declare const pageConfigAtom: _gaddario98_react_state.PrimitiveAtom<PageConfigProps>;
549
+ declare const usePageConfigValue: () => PageConfigProps;
550
+ declare const usePageConfigState: () => [PageConfigProps, (value: PageConfigProps) => void];
551
+ declare const usePageConfigReset: () => () => void;
552
+
553
+ type StringKey<T> = Extract<keyof T, string>;
554
+ type VariableTopKey<V> = StringKey<V>;
555
+ type VariableValue<V, K extends VariableTopKey<V>> = V[K];
556
+ type QueryTopKey<Q extends QueriesArray> = StringKey<MultipleQueryResponse<Q>>;
557
+ type QuerySubKey<Q extends QueriesArray, K extends QueryTopKey<Q>> = StringKey<MultipleQueryResponse<Q>[K]>;
558
+ type QueryCompositeKey<Q extends QueriesArray> = {
559
+ [K in QueryTopKey<Q>]: K | `${K}.${QuerySubKey<Q, K>}`;
560
+ }[QueryTopKey<Q>];
561
+ type QueryValue<Q extends QueriesArray, K extends QueryCompositeKey<Q>> = K extends `${infer Top}.${infer Sub}` ? Top extends QueryTopKey<Q> ? Sub extends QuerySubKey<Q, Top> ? MultipleQueryResponse<Q>[Top][Sub] : never : never : K extends QueryTopKey<Q> ? MultipleQueryResponse<Q>[K] : never;
562
+ type MutationTopKey<Q extends QueriesArray> = StringKey<AllMutation<Q>>;
563
+ type MutationSubKey<Q extends QueriesArray, K extends MutationTopKey<Q>> = StringKey<AllMutation<Q>[K]>;
564
+ type MutationCompositeKey<Q extends QueriesArray> = {
565
+ [K in MutationTopKey<Q>]: K | `${K}.${MutationSubKey<Q, K>}`;
566
+ }[MutationTopKey<Q>];
567
+ type MutationValue<Q extends QueriesArray, K extends MutationCompositeKey<Q>> = K extends `${infer Top}.${infer Sub}` ? Top extends MutationTopKey<Q> ? Sub extends MutationSubKey<Q, Top> ? AllMutation<Q>[Top][Sub] : never : never : K extends MutationTopKey<Q> ? AllMutation<Q>[K] : never;
568
+ type GetFunction<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = {
569
+ <K extends QueryTopKey<Q>>(type: 'query', key: K): MultipleQueryResponse<Q>[K];
570
+ <K extends QueryCompositeKey<Q>>(type: 'query', key: K): QueryValue<Q, K>;
571
+ <K extends QueryCompositeKey<Q>>(type: 'query', key: K, defaultValue: unknown): NonNullable<QueryValue<Q, K>>;
572
+ <K extends QueryTopKey<Q>>(type: 'query', key: K, defaultValue: MultipleQueryResponse<Q>[K]['data']): MultipleQueryResponse<Q>[K]['data'];
573
+ <K extends QueryCompositeKey<Q>>(type: 'query', key: K, defaultValue: QueryValue<Q, K>): NonNullable<QueryValue<Q, K>>;
574
+ <K extends MutationTopKey<Q>>(type: 'mutation', key: K): AllMutation<Q>[K];
575
+ <K extends MutationCompositeKey<Q>>(type: 'mutation', key: K): MutationValue<Q, K>;
576
+ <K extends MutationCompositeKey<Q>>(type: 'mutation', key: K, defaultValue: unknown): NonNullable<MutationValue<Q, K>>;
577
+ <K extends MutationTopKey<Q>>(type: 'mutation', key: K, defaultValue: AllMutation<Q>[K]['data']): AllMutation<Q>[K]['data'];
578
+ <K extends MutationCompositeKey<Q>>(type: 'mutation', key: K, defaultValue: MutationValue<Q, K>): NonNullable<MutationValue<Q, K>>;
579
+ <K extends VariableTopKey<V>>(type: 'state', key: K): VariableValue<V, K>;
580
+ <K extends VariableTopKey<V>>(type: 'state', key: K, defaultValue: VariableValue<V, K>): NonNullable<VariableValue<V, K>>;
581
+ <TField extends DeepKeys<F>>(type: 'form', key: TField): DeepValue<F, TField> | undefined;
582
+ <TField extends DeepKeys<F>>(type: 'form', key: TField, defaultValue: DeepValue<F, TField>): NonNullable<DeepValue<F, TField>>;
583
+ };
584
+ type SetFunction<F extends FieldValues, V extends Record<string, unknown> = Record<string, unknown>> = {
585
+ (type: 'form'): SetValueFunction<F>;
586
+ (type: 'state'): <K extends VariableTopKey<V>>(key: K, value: VariableValue<V, K>) => void;
587
+ };
588
+ type FunctionProps<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = {
589
+ /**
590
+ * Read the current query/mutation value by key.
591
+ * Example: get('query', 'bookings')
592
+ */
593
+ get: GetFunction<F, Q, V>;
594
+ /**
595
+ * Generic setter accessor.
596
+ * - set('form') returns `setValue`
597
+ * - set('state') returns state setter
598
+ */
599
+ set: SetFunction<F, V>;
600
+ };
601
+ type MappedItemsFunction<F extends FieldValues, Q extends QueriesArray, ComponentType, V extends Record<string, unknown> = Record<string, unknown>> = (props: FunctionProps<F, Q, V>) => ComponentType;
602
+ /**
603
+ * Context passed to lifecycle callbacks
604
+ * Provides access to form, queries, mutations, and utilities
605
+ */
606
+ type LifecycleContext<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = FunctionProps<F, Q, V> & {
607
+ ns?: string;
608
+ pageId?: string;
609
+ pageConfig?: PageProps<F, Q, V>;
610
+ };
611
+ type Items<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = {
612
+ type: 'custom';
613
+ component: React.JSX.Element | ((props: FunctionProps<F, Q, V>) => React.JSX.Element);
614
+ index?: number;
615
+ usedBoxes?: number;
616
+ renderInFooter?: boolean;
617
+ renderInHeader?: boolean;
618
+ hidden?: boolean | MappedItemsFunction<F, Q, boolean, V>;
619
+ isDraggable?: boolean;
620
+ isInDraggableView?: boolean;
621
+ key?: string;
622
+ lazy?: boolean;
623
+ lazyTrigger?: 'viewport' | 'interaction' | 'conditional';
624
+ lazyCondition?: MappedItemsFunction<F, Q, boolean, V>;
625
+ };
626
+ type ContainerItem<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = {
627
+ type: 'container';
628
+ component?: PageConfigProps['ItemsContainer'];
629
+ items: ContentItemsType<F, Q, V>;
630
+ index?: number;
631
+ usedBoxes?: number;
632
+ renderInFooter?: boolean;
633
+ renderInHeader?: boolean;
634
+ hidden?: boolean | MappedItemsFunction<F, Q, boolean, V>;
635
+ isDraggable?: boolean;
636
+ isInDraggableView?: boolean;
637
+ key?: string;
638
+ lazy?: boolean;
639
+ lazyTrigger?: 'viewport' | 'interaction' | 'conditional';
640
+ lazyCondition?: MappedItemsFunction<F, Q, boolean, V>;
641
+ };
642
+ type ContentItem<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = Items<F, Q, V> | ContainerItem<F, Q, V>;
643
+ type MappedContents<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = MappedItemsFunction<F, Q, Array<ContentItem<F, Q, V>>, V>;
644
+ type ContentItemsType<F extends FieldValues, Q extends QueriesArray = QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = Array<ContentItem<F, Q, V>> | MappedContents<F, Q, V>;
645
+ type FormPageProps<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = Omit<ComponentProps<typeof FormManager<F>>, 'updateFormValues' | 'submit' | 'data'> & {
646
+ defaultValueQueryKey?: Array<string>;
647
+ defaultValueQueryMap?: (props: ExtractQuery<Q>['response']) => DeepValue<F, DeepKeys<F>>;
648
+ submit?: Array<Submit<F>> | MappedItemsFunction<F, Q, Array<Submit<F>>, V>;
649
+ index?: number;
650
+ data?: Array<FormManagerConfig<F> | MappedItemsFunction<F, Q, FormManagerConfig<F>, V>>;
651
+ debounceDelay?: number;
652
+ hidden?: boolean | MappedItemsFunction<F, Q, boolean, V>;
653
+ };
654
+ type SingleQueryConfig<F extends FieldValues, Q extends QueryDefinition<any, any, any, any, any>, V extends Record<string, unknown> = Record<string, unknown>> = Q extends QueryDefinition<infer K, infer T, infer P, infer R, infer C> ? T extends 'mutation' ? {
655
+ type: 'mutation';
656
+ mutationConfig: (<Qa extends QueriesArray>(props: FunctionProps<F, Qa, V>) => MutationConfig<P, R, C>) | MutationConfig<P, R, C>;
657
+ key: K;
658
+ } : {
659
+ type: 'query';
660
+ queryConfig?: (<Qa extends QueriesArray>(props: FunctionProps<F, Qa, V>) => Omit<QueryProps<K, R>, 'keyToMap'>) | Omit<QueryProps<K, R>, 'keyToMap'>;
661
+ key: K;
662
+ } : never;
663
+ type QueryPageConfigArray<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = {
664
+ [I in keyof Q]: SingleQueryConfig<F, QueryAtIndex<Q, I>, V>;
665
+ };
666
+ interface PageProps<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> {
667
+ id: string;
668
+ ns?: string;
669
+ contents?: ContentItemsType<F, Q, V>;
670
+ queries?: QueryPageConfigArray<F, Q, V>;
671
+ form?: FormPageProps<F, Q, V>;
672
+ variables?: V;
673
+ viewSettings?: MappedItemsFunction<F, Q, ViewSettings, V> | ViewSettings;
674
+ meta?: MetadataConfig<F, Q>;
675
+ lazyLoading?: LazyLoadingConfig;
676
+ platformOverrides?: PlatformOverrides<F, Q, V>;
677
+ lifecycleCallbacks?: {
678
+ onMountComplete?: (context: LifecycleContext<F, Q, V>) => void | Promise<void>;
679
+ onQuerySuccess?: (context: LifecycleContext<F, Q, V>, queryKey: string, data: unknown) => void | Promise<void>;
680
+ onQueryError?: (context: LifecycleContext<F, Q, V>, queryKey: string, error: Error) => void | Promise<void>;
681
+ onFormSubmit?: (context: LifecycleContext<F, Q, V>, result: unknown) => void | Promise<void>;
682
+ onValuesChange?: MappedItemsFunction<F, Q, void, V>;
683
+ };
684
+ enableAuthControl?: boolean;
685
+ }
686
+ /**
687
+ * Platform-specific configuration overrides (proper type with PageProps reference)
688
+ * Allows different behavior on web vs React Native
689
+ */
690
+ type PlatformOverrides<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = {
691
+ /** Web-specific overrides (React DOM) */
692
+ web?: Partial<PageProps<F, Q, V>>;
693
+ /** React Native-specific overrides */
694
+ native?: Partial<PageProps<F, Q, V>>;
695
+ };
696
+ type ViewSettings = {
697
+ withoutPadding?: boolean;
698
+ header?: {
699
+ withoutPadding?: boolean;
700
+ };
701
+ footer?: {
702
+ withoutPadding?: boolean;
703
+ };
704
+ disableRefreshing?: boolean;
705
+ layoutComponent?: <F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray, V extends Record<string, unknown> = Record<string, unknown>>(props: DefaultContainerProps<F, Q, V> & Record<string, unknown>) => React.ReactNode;
706
+ layoutProps?: Record<string, unknown>;
707
+ pageContainerComponent?: React.ComponentType<{
708
+ children: React.ReactNode;
709
+ id: string;
710
+ } & Record<string, unknown>>;
711
+ pageContainerProps?: Record<string, unknown>;
712
+ /** @deprecated Use layoutComponent instead */
713
+ customLayoutComponent?: PageConfigProps['BodyContainer'];
714
+ /** @deprecated Use pageContainerComponent instead */
715
+ customPageContainer?: PageConfigProps['PageContainer'];
716
+ };
717
+ /**
718
+ * Dependency Graph Node
719
+ * Tracks which queries, form values, and mutations a component depends on
720
+ */
721
+ interface DependencyNode {
722
+ componentId: string;
723
+ parentComponent: string | null;
724
+ childComponents: Array<string>;
725
+ }
726
+ /**
727
+ * Dependency Graph
728
+ * Maps component IDs to their dependency nodes for selective re-rendering
729
+ */
730
+ interface DependencyGraph {
731
+ nodes: Map<string, DependencyNode>;
732
+ addNode: (node: DependencyNode) => void;
733
+ getNode: (componentId: string) => DependencyNode | undefined;
734
+ getAffectedComponents: (changedKeys: Array<string>) => Array<string>;
735
+ }
736
+ /**
737
+ * Memoization Cache Types
738
+ * For tracking memoized computations and their cache hits
739
+ */
740
+ interface MemoizationCacheStats {
741
+ hits: number;
742
+ misses: number;
743
+ size: number;
744
+ maxSize: number;
745
+ }
746
+ interface RenderComponentsProps<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> {
747
+ content: ContentItem<F, Q, V>;
748
+ ns: string;
749
+ pageId: string;
750
+ key: string;
751
+ }
752
+
753
+ declare const PageGenerator: <F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray, V extends Record<string, unknown> = Record<string, unknown>>({ enableAuthControl, meta, variables, ...props }: PageProps<F, Q, V>) => react_jsx_runtime.JSX.Element;
754
+
755
+ declare const RenderComponents: <F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>>(props: RenderComponentsProps<F, Q, V>) => react_jsx_runtime.JSX.Element;
756
+
757
+ interface Props<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> {
758
+ content: ContentItem<F, Q, V>;
759
+ ns: string;
760
+ pageId: string;
761
+ }
762
+ interface ContentProps<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> extends Omit<Props<F, Q, V>, 'content'> {
763
+ content: Items<F, Q, V>;
764
+ pageId: string;
765
+ }
766
+ interface ItemContainerProps<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> extends Omit<Props<F, Q, V>, 'content'> {
767
+ content: ContainerItem<F, Q, V>;
768
+ }
769
+
770
+ /**
771
+ * Metadata Configuration Types
772
+ * Custom metadata system replacing react-helmet-async
773
+ * Platform-agnostic: works on web, React Native, and SSR
774
+ */
775
+
776
+ /**
777
+ * Context passed to dynamic metadata evaluator functions
778
+ * Provides access to form values, queries, and page state
779
+ */
780
+ type MetadataEvaluatorContext$1<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray> = FunctionProps$1<F, Q>;
781
+ interface MetaTag$1 {
782
+ /** For <meta name="..." content="..." /> */
783
+ name?: string;
784
+ /** For <meta property="og:..." content="..." /> */
785
+ property?: string;
786
+ /** For <meta http-equiv="..." content="..." /> */
787
+ httpEquiv?: string;
788
+ /** Meta tag content */
789
+ content: string;
790
+ /** Unique identifier for updating existing tags */
791
+ id?: string;
792
+ }
793
+ /**
794
+ * Open Graph Image Configuration
795
+ */
796
+ interface OpenGraphImage$1 {
797
+ /** Absolute URL to the image */
798
+ url: string;
799
+ /** Alt text for the image */
800
+ alt?: string;
801
+ /** Image width in pixels */
802
+ width?: number;
803
+ /** Image height in pixels */
804
+ height?: number;
805
+ /** MIME type (e.g., "image/jpeg", "image/png") */
806
+ type?: string;
807
+ }
808
+ /**
809
+ * Open Graph Article Configuration (when type='article')
810
+ */
811
+ interface OpenGraphArticle$1 {
812
+ /** ISO 8601 date string */
813
+ publishedTime?: string;
814
+ /** ISO 8601 date string */
815
+ modifiedTime?: string;
816
+ /** ISO 8601 date string */
817
+ expirationTime?: string;
818
+ /** Author name or URL */
819
+ author?: string | Array<string>;
820
+ /** Article section/category */
821
+ section?: string;
822
+ /** Article tags */
823
+ tags?: Array<string>;
824
+ }
825
+ /**
826
+ * Open Graph Configuration (Facebook, LinkedIn, etc.)
827
+ */
828
+ interface OpenGraphConfig$1<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray> {
829
+ type?: 'website' | 'article' | 'product' | 'profile';
830
+ title?: string | ((context: MetadataEvaluatorContext$1<F, Q>) => string);
831
+ description?: string | ((context: MetadataEvaluatorContext$1<F, Q>) => string);
832
+ /** Single image URL or full image config */
833
+ image?: string | OpenGraphImage$1 | ((context: MetadataEvaluatorContext$1<F, Q>) => string | OpenGraphImage$1);
834
+ /** Multiple images for the page */
835
+ images?: Array<OpenGraphImage$1> | ((context: MetadataEvaluatorContext$1<F, Q>) => Array<OpenGraphImage$1>);
836
+ /** Canonical URL */
837
+ url?: string | ((context: MetadataEvaluatorContext$1<F, Q>) => string);
838
+ siteName?: string;
839
+ /** Locale (e.g., "en_US", "it_IT") */
840
+ locale?: string;
841
+ /** Article-specific metadata (when type='article') */
842
+ article?: OpenGraphArticle$1;
843
+ }
844
+ /**
845
+ * Twitter Card Configuration
846
+ */
847
+ interface TwitterCardConfig$1<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray> {
848
+ /** Card type */
849
+ card?: 'summary' | 'summary_large_image' | 'app' | 'player';
850
+ /** @username of the website */
851
+ site?: string;
852
+ /** @username of the content creator */
853
+ creator?: string;
854
+ /** Title (falls back to og:title then page title) */
855
+ title?: string | ((context: MetadataEvaluatorContext$1<F, Q>) => string);
856
+ /** Description (falls back to og:description then page description) */
857
+ description?: string | ((context: MetadataEvaluatorContext$1<F, Q>) => string);
858
+ /** Image URL (falls back to og:image) */
859
+ image?: string | ((context: MetadataEvaluatorContext$1<F, Q>) => string);
860
+ /** Alt text for the image */
861
+ imageAlt?: string | ((context: MetadataEvaluatorContext$1<F, Q>) => string);
862
+ }
863
+ /**
864
+ * Alternate languages/URLs configuration for i18n SEO
865
+ */
866
+ interface AlternatesConfig$1 {
867
+ /** Canonical URL for this page */
868
+ canonical?: string;
869
+ /** Map of locale → URL for hreflang tags (e.g., { "en": "/en/page", "it": "/it/page" }) */
870
+ languages?: Record<string, string>;
871
+ /** Media-specific alternates (e.g., mobile version) */
872
+ media?: Record<string, string>;
873
+ /** RSS/Atom feed alternates */
874
+ types?: Record<string, Array<{
875
+ url: string;
876
+ title?: string;
877
+ }>>;
878
+ }
879
+ /**
880
+ * Icon configuration
881
+ */
882
+ interface IconConfig$1 {
883
+ /** URL to the icon */
884
+ url: string;
885
+ /** Icon type (e.g., "image/png", "image/svg+xml") */
886
+ type?: string;
887
+ /** Icon sizes (e.g., "32x32", "192x192") */
888
+ sizes?: string;
889
+ /** Color for SVG mask icons */
890
+ color?: string;
891
+ }
892
+ /**
893
+ * Icons & PWA configuration
894
+ */
895
+ interface IconsConfig$1 {
896
+ /** Standard favicon(s) - link[rel="icon"] */
897
+ icon?: string | IconConfig$1 | Array<IconConfig$1>;
898
+ /** Apple touch icon(s) - link[rel="apple-touch-icon"] */
899
+ apple?: string | IconConfig$1 | Array<IconConfig$1>;
900
+ /** Shortcut icon (legacy) */
901
+ shortcut?: string;
902
+ }
903
+ /**
904
+ * Structured Data Configuration (schema.org JSON-LD)
905
+ */
906
+ interface StructuredDataConfig$1<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray> {
907
+ type: 'Article' | 'Product' | 'WebPage' | 'FAQPage' | 'Organization' | 'Person' | 'WebSite' | 'BreadcrumbList';
908
+ schema: Record<string, unknown> | ((context: MetadataEvaluatorContext$1<F, Q>) => Record<string, unknown>);
909
+ }
910
+ /**
911
+ * AI Crawler Hints (for AI search engines and LLMs)
912
+ */
913
+ interface AIHintsConfig$1<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray> {
914
+ /** Content classification (e.g., "documentation", "tutorial", "reference") */
915
+ contentClassification?: string | ((context: MetadataEvaluatorContext$1<F, Q>) => string);
916
+ /** Hints for AI models (e.g., ["code-heavy", "technical"]) */
917
+ modelHints?: Array<string> | ((context: MetadataEvaluatorContext$1<F, Q>) => Array<string>);
918
+ /** Additional context for AI understanding */
919
+ contextualInfo?: string | ((context: MetadataEvaluatorContext$1<F, Q>) => string);
920
+ /** Exclude this page from AI crawler indexing */
921
+ excludeFromIndexing?: boolean;
922
+ }
923
+ /**
924
+ * Robots Configuration (indexing directives)
925
+ */
926
+ interface RobotsConfig$1 {
927
+ /** Prevent indexing */
928
+ noindex?: boolean;
929
+ /** Don't follow links */
930
+ nofollow?: boolean;
931
+ /** Don't cache page */
932
+ noarchive?: boolean;
933
+ /** Don't show snippets in search results */
934
+ nosnippet?: boolean;
935
+ /** Image preview size in search results */
936
+ maxImagePreview?: 'none' | 'standard' | 'large';
937
+ /** Max snippet length in search results */
938
+ maxSnippet?: number;
939
+ }
940
+ /**
941
+ * Complete Metadata Configuration (Generic over F and Q for dynamic metadata)
942
+ * This is the "input" type — values can be strings or evaluator functions.
943
+ * Use resolveMetadata() to convert this to ResolvedMetadata.
944
+ */
945
+ interface MetadataConfig$1<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray> {
946
+ /** Page title - sets document.title on web */
947
+ title?: string | ((context: MetadataEvaluatorContext$1<F, Q>) => string);
948
+ /** Page description meta tag */
949
+ description?: string | ((context: MetadataEvaluatorContext$1<F, Q>) => string);
950
+ /** Canonical URL for the page */
951
+ canonical?: string | ((context: MetadataEvaluatorContext$1<F, Q>) => string);
952
+ /** HTML lang attribute (e.g., "en", "it") */
953
+ lang?: string;
954
+ /**
955
+ * @deprecated Use `lang` instead. Will be removed in a future version.
956
+ */
957
+ documentLang?: string;
958
+ /** Keywords for SEO */
959
+ keywords?: Array<string> | ((context: MetadataEvaluatorContext$1<F, Q>) => Array<string>);
960
+ openGraph?: OpenGraphConfig$1<F, Q>;
961
+ twitter?: TwitterCardConfig$1<F, Q>;
962
+ alternates?: AlternatesConfig$1;
963
+ icons?: IconsConfig$1;
964
+ /** Web app manifest URL */
965
+ manifest?: string;
966
+ structuredData?: StructuredDataConfig$1<F, Q>;
967
+ aiHints?: AIHintsConfig$1<F, Q>;
968
+ robots?: RobotsConfig$1;
969
+ customMeta?: Array<MetaTag$1> | ((context: MetadataEvaluatorContext$1<F, Q>) => Array<MetaTag$1>);
970
+ disableIndexing?: boolean;
971
+ /** Author meta tag */
972
+ author?: string;
973
+ /** Viewport meta tag (defaults to "width=device-width, initial-scale=1") */
974
+ viewport?: string;
975
+ /** Theme color for browser UI */
976
+ themeColor?: string;
977
+ }
978
+ /**
979
+ * Configuration for lazy loading and code splitting behavior
980
+ * Enables deferred component loading to reduce initial bundle size
981
+ */
982
+ interface LazyLoadingConfig$1<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray> {
983
+ /** Enable lazy loading (default: true) */
984
+ enabled?: boolean;
985
+ /** Preload on hover for interactive elements (default: false) */
986
+ preloadOnHover?: boolean;
987
+ /** Preload on focus for keyboard navigation (default: false) */
988
+ preloadOnFocus?: boolean;
989
+ /** Preload after render with delay (in ms, default: undefined - no delay) */
990
+ preloadAfterRender?: number;
991
+ /** Fallback component to show while loading (default: null) */
992
+ suspenseFallback?: React.ReactNode;
993
+ /** Custom error boundary component for lazy-loaded modules */
994
+ errorBoundary?: React.ComponentType<{
995
+ error: Error;
996
+ retry: () => void;
997
+ }>;
998
+ /** Maximum time to wait before showing error state (in ms, default: 30000) */
999
+ timeout?: number;
1000
+ /** Log performance metrics for lazy loading (development only) */
1001
+ logMetrics?: boolean;
1002
+ /** IntersectionObserver threshold (0-1, default: 0.1) - alias for intersectionThreshold */
1003
+ threshold?: number | Array<number>;
1004
+ /** IntersectionObserver threshold (0-1, default: 0.1) */
1005
+ intersectionThreshold?: number | Array<number>;
1006
+ /** IntersectionObserver root margin (default: "100px") - alias for intersectionRootMargin */
1007
+ rootMargin?: string;
1008
+ /** IntersectionObserver root margin (default: "100px") */
1009
+ intersectionRootMargin?: string;
1010
+ /** Trigger type for lazy loading: viewport (IntersectionObserver), interaction (manual), or conditional (based on function) */
1011
+ trigger?: 'viewport' | 'interaction' | 'conditional';
1012
+ /** Conditional function to determine if content should load (for trigger: "conditional") */
1013
+ condition?: (context: MetadataEvaluatorContext$1<F, Q>) => boolean;
1014
+ /** Placeholder component to show before lazy content loads */
1015
+ placeholder?: React.ReactNode;
1016
+ }
1017
+
1018
+ interface DefaultContainerProps$1<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> {
1019
+ children?: Array<React.JSX.Element>;
1020
+ allContents: Array<ContentItem$1<F, Q, V> | FormManagerConfig<F> | Submit<F>>;
1021
+ handleRefresh?: () => void;
1022
+ viewSettings?: ViewSettings$1;
1023
+ pageId?: string;
1024
+ }
1025
+ type PageAuthState$1 = {
1026
+ id: string;
1027
+ accountVerified?: boolean;
1028
+ isLogged?: boolean;
1029
+ token?: string;
1030
+ phoneNumber?: string;
1031
+ email?: string;
1032
+ };
1033
+ interface PageTranslationOptions$1 {
1034
+ [key: string]: string | number | boolean | undefined;
1035
+ ns?: string;
1036
+ }
1037
+ interface PageConfigProps$1 {
1038
+ HeaderContainer: <F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray, V extends Record<string, unknown> = Record<string, unknown>>(props: Omit<DefaultContainerProps$1<F, Q, V>, 'viewSettings'> & ViewSettings$1['header']) => React.ReactNode;
1039
+ FooterContainer: <F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray, V extends Record<string, unknown> = Record<string, unknown>>(props: Omit<DefaultContainerProps$1<F, Q, V>, 'viewSettings'> & ViewSettings$1['footer']) => React.ReactNode;
1040
+ BodyContainer: <F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray, V extends Record<string, unknown> = Record<string, unknown>>(props: DefaultContainerProps$1<F, Q, V>) => React.ReactNode;
1041
+ authPageImage: string;
1042
+ authPageProps: PageProps$1;
1043
+ isLogged: (val: AuthState | null) => boolean;
1044
+ ItemsContainer: (props: {
1045
+ children: React.ReactNode;
1046
+ }) => React.ReactNode;
1047
+ LoaderComponent?: (props: {
1048
+ loading?: boolean;
1049
+ message?: string;
1050
+ ns?: string;
1051
+ }) => React.ReactNode;
1052
+ PageContainer: (props: {
1053
+ children: React.ReactNode;
1054
+ id: string;
1055
+ }) => React.ReactNode;
1056
+ meta?: {
1057
+ title?: string;
1058
+ description?: string;
1059
+ };
1060
+ defaultMetadata: MetadataConfig$1;
1061
+ setMetadata: (config: MetadataConfig$1) => void;
1062
+ getMetadata: () => MetadataConfig$1;
1063
+ resetMetadata: () => void;
1064
+ lazyLoading: LazyLoadingConfig$1;
1065
+ authValues?: PageAuthState$1 | null;
1066
+ locale?: string;
1067
+ translateText?: (key: string, options?: PageTranslationOptions$1) => string;
1068
+ }
1069
+
1070
+ type StringKey$1<T> = Extract<keyof T, string>;
1071
+ type VariableTopKey$1<V> = StringKey$1<V>;
1072
+ type VariableValue$1<V, K extends VariableTopKey$1<V>> = V[K];
1073
+ type QueryTopKey$1<Q extends QueriesArray> = StringKey$1<MultipleQueryResponse<Q>>;
1074
+ type QuerySubKey$1<Q extends QueriesArray, K extends QueryTopKey$1<Q>> = StringKey$1<MultipleQueryResponse<Q>[K]>;
1075
+ type QueryCompositeKey$1<Q extends QueriesArray> = {
1076
+ [K in QueryTopKey$1<Q>]: K | `${K}.${QuerySubKey$1<Q, K>}`;
1077
+ }[QueryTopKey$1<Q>];
1078
+ type QueryValue$1<Q extends QueriesArray, K extends QueryCompositeKey$1<Q>> = K extends `${infer Top}.${infer Sub}` ? Top extends QueryTopKey$1<Q> ? Sub extends QuerySubKey$1<Q, Top> ? MultipleQueryResponse<Q>[Top][Sub] : never : never : K extends QueryTopKey$1<Q> ? MultipleQueryResponse<Q>[K] : never;
1079
+ type MutationTopKey$1<Q extends QueriesArray> = StringKey$1<AllMutation<Q>>;
1080
+ type MutationSubKey$1<Q extends QueriesArray, K extends MutationTopKey$1<Q>> = StringKey$1<AllMutation<Q>[K]>;
1081
+ type MutationCompositeKey$1<Q extends QueriesArray> = {
1082
+ [K in MutationTopKey$1<Q>]: K | `${K}.${MutationSubKey$1<Q, K>}`;
1083
+ }[MutationTopKey$1<Q>];
1084
+ type MutationValue$1<Q extends QueriesArray, K extends MutationCompositeKey$1<Q>> = K extends `${infer Top}.${infer Sub}` ? Top extends MutationTopKey$1<Q> ? Sub extends MutationSubKey$1<Q, Top> ? AllMutation<Q>[Top][Sub] : never : never : K extends MutationTopKey$1<Q> ? AllMutation<Q>[K] : never;
1085
+ type GetFunction$1<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = {
1086
+ <K extends QueryTopKey$1<Q>>(type: 'query', key: K): MultipleQueryResponse<Q>[K];
1087
+ <K extends QueryCompositeKey$1<Q>>(type: 'query', key: K): QueryValue$1<Q, K>;
1088
+ <K extends QueryCompositeKey$1<Q>>(type: 'query', key: K, defaultValue: unknown): NonNullable<QueryValue$1<Q, K>>;
1089
+ <K extends QueryTopKey$1<Q>>(type: 'query', key: K, defaultValue: MultipleQueryResponse<Q>[K]['data']): MultipleQueryResponse<Q>[K]['data'];
1090
+ <K extends QueryCompositeKey$1<Q>>(type: 'query', key: K, defaultValue: QueryValue$1<Q, K>): NonNullable<QueryValue$1<Q, K>>;
1091
+ <K extends MutationTopKey$1<Q>>(type: 'mutation', key: K): AllMutation<Q>[K];
1092
+ <K extends MutationCompositeKey$1<Q>>(type: 'mutation', key: K): MutationValue$1<Q, K>;
1093
+ <K extends MutationCompositeKey$1<Q>>(type: 'mutation', key: K, defaultValue: unknown): NonNullable<MutationValue$1<Q, K>>;
1094
+ <K extends MutationTopKey$1<Q>>(type: 'mutation', key: K, defaultValue: AllMutation<Q>[K]['data']): AllMutation<Q>[K]['data'];
1095
+ <K extends MutationCompositeKey$1<Q>>(type: 'mutation', key: K, defaultValue: MutationValue$1<Q, K>): NonNullable<MutationValue$1<Q, K>>;
1096
+ <K extends VariableTopKey$1<V>>(type: 'state', key: K): VariableValue$1<V, K>;
1097
+ <K extends VariableTopKey$1<V>>(type: 'state', key: K, defaultValue: VariableValue$1<V, K>): NonNullable<VariableValue$1<V, K>>;
1098
+ <TField extends DeepKeys<F>>(type: 'form', key: TField): DeepValue<F, TField> | undefined;
1099
+ <TField extends DeepKeys<F>>(type: 'form', key: TField, defaultValue: DeepValue<F, TField>): NonNullable<DeepValue<F, TField>>;
1100
+ };
1101
+ type SetFunction$1<F extends FieldValues, V extends Record<string, unknown> = Record<string, unknown>> = {
1102
+ (type: 'form'): SetValueFunction<F>;
1103
+ (type: 'state'): <K extends VariableTopKey$1<V>>(key: K, value: VariableValue$1<V, K>) => void;
1104
+ };
1105
+ type FunctionProps$1<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = {
1106
+ /**
1107
+ * Read the current query/mutation value by key.
1108
+ * Example: get('query', 'bookings')
1109
+ */
1110
+ get: GetFunction$1<F, Q, V>;
1111
+ /**
1112
+ * Generic setter accessor.
1113
+ * - set('form') returns `setValue`
1114
+ * - set('state') returns state setter
1115
+ */
1116
+ set: SetFunction$1<F, V>;
1117
+ };
1118
+ type MappedItemsFunction$1<F extends FieldValues, Q extends QueriesArray, ComponentType, V extends Record<string, unknown> = Record<string, unknown>> = (props: FunctionProps$1<F, Q, V>) => ComponentType;
1119
+ /**
1120
+ * Context passed to lifecycle callbacks
1121
+ * Provides access to form, queries, mutations, and utilities
1122
+ */
1123
+ type LifecycleContext$1<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = FunctionProps$1<F, Q, V> & {
1124
+ ns?: string;
1125
+ pageId?: string;
1126
+ pageConfig?: PageProps$1<F, Q, V>;
1127
+ };
1128
+ type Items$1<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = {
1129
+ type: 'custom';
1130
+ component: React.JSX.Element | ((props: FunctionProps$1<F, Q, V>) => React.JSX.Element);
1131
+ index?: number;
1132
+ usedBoxes?: number;
1133
+ renderInFooter?: boolean;
1134
+ renderInHeader?: boolean;
1135
+ hidden?: boolean | MappedItemsFunction$1<F, Q, boolean, V>;
1136
+ isDraggable?: boolean;
1137
+ isInDraggableView?: boolean;
1138
+ key?: string;
1139
+ lazy?: boolean;
1140
+ lazyTrigger?: 'viewport' | 'interaction' | 'conditional';
1141
+ lazyCondition?: MappedItemsFunction$1<F, Q, boolean, V>;
1142
+ };
1143
+ type ContainerItem$1<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = {
1144
+ type: 'container';
1145
+ component?: PageConfigProps$1['ItemsContainer'];
1146
+ items: ContentItemsType$1<F, Q, V>;
1147
+ index?: number;
1148
+ usedBoxes?: number;
1149
+ renderInFooter?: boolean;
1150
+ renderInHeader?: boolean;
1151
+ hidden?: boolean | MappedItemsFunction$1<F, Q, boolean, V>;
1152
+ isDraggable?: boolean;
1153
+ isInDraggableView?: boolean;
1154
+ key?: string;
1155
+ lazy?: boolean;
1156
+ lazyTrigger?: 'viewport' | 'interaction' | 'conditional';
1157
+ lazyCondition?: MappedItemsFunction$1<F, Q, boolean, V>;
1158
+ };
1159
+ type ContentItem$1<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = Items$1<F, Q, V> | ContainerItem$1<F, Q, V>;
1160
+ type MappedContents$1<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = MappedItemsFunction$1<F, Q, Array<ContentItem$1<F, Q, V>>, V>;
1161
+ type ContentItemsType$1<F extends FieldValues, Q extends QueriesArray = QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = Array<ContentItem$1<F, Q, V>> | MappedContents$1<F, Q, V>;
1162
+ type FormPageProps$1<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = Omit<ComponentProps<typeof FormManager<F>>, 'updateFormValues' | 'submit' | 'data'> & {
1163
+ defaultValueQueryKey?: Array<string>;
1164
+ defaultValueQueryMap?: (props: ExtractQuery<Q>['response']) => DeepValue<F, DeepKeys<F>>;
1165
+ submit?: Array<Submit<F>> | MappedItemsFunction$1<F, Q, Array<Submit<F>>, V>;
1166
+ index?: number;
1167
+ data?: Array<FormManagerConfig<F> | MappedItemsFunction$1<F, Q, FormManagerConfig<F>, V>>;
1168
+ debounceDelay?: number;
1169
+ hidden?: boolean | MappedItemsFunction$1<F, Q, boolean, V>;
1170
+ };
1171
+ type SingleQueryConfig$1<F extends FieldValues, Q extends QueryDefinition<any, any, any, any, any>, V extends Record<string, unknown> = Record<string, unknown>> = Q extends QueryDefinition<infer K, infer T, infer P, infer R, infer C> ? T extends 'mutation' ? {
1172
+ type: 'mutation';
1173
+ mutationConfig: (<Qa extends QueriesArray>(props: FunctionProps$1<F, Qa, V>) => MutationConfig<P, R, C>) | MutationConfig<P, R, C>;
1174
+ key: K;
1175
+ } : {
1176
+ type: 'query';
1177
+ queryConfig?: (<Qa extends QueriesArray>(props: FunctionProps$1<F, Qa, V>) => Omit<QueryProps<K, R>, 'keyToMap'>) | Omit<QueryProps<K, R>, 'keyToMap'>;
1178
+ key: K;
1179
+ } : never;
1180
+ type QueryPageConfigArray$1<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = {
1181
+ [I in keyof Q]: SingleQueryConfig$1<F, QueryAtIndex<Q, I>, V>;
1182
+ };
1183
+ interface PageProps$1<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> {
1184
+ id: string;
1185
+ ns?: string;
1186
+ contents?: ContentItemsType$1<F, Q, V>;
1187
+ queries?: QueryPageConfigArray$1<F, Q, V>;
1188
+ form?: FormPageProps$1<F, Q, V>;
1189
+ variables?: V;
1190
+ viewSettings?: MappedItemsFunction$1<F, Q, ViewSettings$1, V> | ViewSettings$1;
1191
+ meta?: MetadataConfig$1<F, Q>;
1192
+ lazyLoading?: LazyLoadingConfig$1;
1193
+ platformOverrides?: PlatformOverrides$1<F, Q, V>;
1194
+ lifecycleCallbacks?: {
1195
+ onMountComplete?: (context: LifecycleContext$1<F, Q, V>) => void | Promise<void>;
1196
+ onQuerySuccess?: (context: LifecycleContext$1<F, Q, V>, queryKey: string, data: unknown) => void | Promise<void>;
1197
+ onQueryError?: (context: LifecycleContext$1<F, Q, V>, queryKey: string, error: Error) => void | Promise<void>;
1198
+ onFormSubmit?: (context: LifecycleContext$1<F, Q, V>, result: unknown) => void | Promise<void>;
1199
+ onValuesChange?: MappedItemsFunction$1<F, Q, void, V>;
1200
+ };
1201
+ enableAuthControl?: boolean;
1202
+ }
1203
+ /**
1204
+ * Platform-specific configuration overrides (proper type with PageProps reference)
1205
+ * Allows different behavior on web vs React Native
1206
+ */
1207
+ type PlatformOverrides$1<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> = {
1208
+ /** Web-specific overrides (React DOM) */
1209
+ web?: Partial<PageProps$1<F, Q, V>>;
1210
+ /** React Native-specific overrides */
1211
+ native?: Partial<PageProps$1<F, Q, V>>;
1212
+ };
1213
+ type ViewSettings$1 = {
1214
+ withoutPadding?: boolean;
1215
+ header?: {
1216
+ withoutPadding?: boolean;
1217
+ };
1218
+ footer?: {
1219
+ withoutPadding?: boolean;
1220
+ };
1221
+ disableRefreshing?: boolean;
1222
+ layoutComponent?: <F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray, V extends Record<string, unknown> = Record<string, unknown>>(props: DefaultContainerProps$1<F, Q, V> & Record<string, unknown>) => React.ReactNode;
1223
+ layoutProps?: Record<string, unknown>;
1224
+ pageContainerComponent?: React.ComponentType<{
1225
+ children: React.ReactNode;
1226
+ id: string;
1227
+ } & Record<string, unknown>>;
1228
+ pageContainerProps?: Record<string, unknown>;
1229
+ /** @deprecated Use layoutComponent instead */
1230
+ customLayoutComponent?: PageConfigProps$1['BodyContainer'];
1231
+ /** @deprecated Use pageContainerComponent instead */
1232
+ customPageContainer?: PageConfigProps$1['PageContainer'];
1233
+ };
1234
+
1235
+ declare const usePageConfig: <F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>>({ queries, form, ns, viewSettings, meta, lazyLoading, variables, pageId, }: {
1236
+ queries: QueryPageConfigArray<F, Q, V>;
1237
+ form?: FormPageProps<F, Q, V>;
1238
+ ns: string;
1239
+ viewSettings?: MappedItemsFunction<F, Q, ViewSettings, V> | ViewSettings;
1240
+ meta?: MetadataConfig<F, Q>;
1241
+ lazyLoading?: LazyLoadingConfig;
1242
+ variables?: V;
1243
+ pageId: string;
1244
+ }) => {
1245
+ formData: {
1246
+ formContents: (_gaddario98_react_form.Submit<F, _gaddario98_react_form.SubmitKeysArg<F>> | _gaddario98_react_form.FormManagerConfig<F>)[];
1247
+ elements: _gaddario98_react_form.FormElements[];
1248
+ errors: any[];
1249
+ formValues: F;
1250
+ setValue: _gaddario98_react_form.SetValueFunction<F>;
1251
+ };
1252
+ form: FormPageProps<F, Q, V> | undefined;
1253
+ mappedViewSettings: ViewSettings;
1254
+ meta: MetadataConfig<F, Q> | undefined;
1255
+ lazyLoading: LazyLoadingConfig<FieldValues, QueriesArray> | undefined;
1256
+ globalConfig: PageConfigProps$1;
1257
+ };
1258
+
1259
+ interface GenerateContentProps<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> {
1260
+ pageId: string;
1261
+ ns?: string;
1262
+ contents: ContentItemsType<F, Q, V>;
1263
+ pageConfig: ReturnType<typeof usePageConfig<F, Q, V>>;
1264
+ }
1265
+ declare const useGenerateContent: <F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>>({ pageId, ns, contents, pageConfig, }: GenerateContentProps<F, Q, V>) => {
1266
+ header: react_jsx_runtime.JSX.Element[];
1267
+ body: react_jsx_runtime.JSX.Element[];
1268
+ footer: react_jsx_runtime.JSX.Element[];
1269
+ allContents: (ContentItem$1<F, Q, V> | _gaddario98_react_form.Submit<F, _gaddario98_react_form.SubmitKeysArg<F>> | _gaddario98_react_form.FormManagerConfig<F>)[];
1270
+ };
1271
+
1272
+ interface GenerateContentRenderProps<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>> {
1273
+ contents?: ContentItemsType<F, Q, V>;
1274
+ ns?: string;
1275
+ pageId: string;
1276
+ formData: {
1277
+ formContents: Array<Submit<F, SubmitKeysArg<F>> | FormManagerConfig<F>>;
1278
+ elements: Array<FormElements>;
1279
+ errors: Array<unknown>;
1280
+ formValues: F;
1281
+ setValue: SetValueFunction<F>;
1282
+ };
1283
+ }
1284
+ interface Elements {
1285
+ index: number;
1286
+ element: JSX.Element;
1287
+ renderInFooter: boolean;
1288
+ renderInHeader: boolean;
1289
+ key: string;
1290
+ }
1291
+ declare const useGenerateContentRender: <F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>>({ pageId, ns, contents, formData, }: GenerateContentRenderProps<F, Q, V>) => {
1292
+ components: {
1293
+ element: react_jsx_runtime.JSX.Element;
1294
+ index: number;
1295
+ renderInFooter: boolean;
1296
+ renderInHeader: boolean;
1297
+ key: string;
1298
+ }[];
1299
+ allContents: (ContentItem<F, Q, V> | Submit<F, SubmitKeysArg<F>> | FormManagerConfig<F>)[];
1300
+ };
1301
+
1302
+ /**
1303
+ * Specialized hook for managing view settings
1304
+ * Optimized to prevent unnecessary re-renders
1305
+ * @param viewSettings - View settings configuration (static or function)
1306
+ * @param allQuery - All query results
1307
+ * @param allMutation - All mutation handlers
1308
+ * @param formValues - Current form values
1309
+ * @param setValue - Form setValue function
1310
+ * @returns Processed view settings
1311
+ */
1312
+ declare function useViewSettings<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>>({ viewSettings, pageId, }: {
1313
+ viewSettings?: MappedItemsFunction<F, Q, ViewSettings, V> | ViewSettings;
1314
+ pageId: string;
1315
+ }): ViewSettings;
1316
+
1317
+ /**
1318
+ * Specialized hook for managing form data processing
1319
+ * Uses useMemo to prevent unnecessary re-computation
1320
+ * @param form - Form configuration
1321
+ * @param isAllQueryMapped - Whether all queries are mapped
1322
+ * @param formValues - Current form values
1323
+ * @param extractMutationsHandle - Extracted mutations
1324
+ * @param extractQueryHandle - Extracted queries
1325
+ * @param setValue - Form setValue function
1326
+ * @returns Processed form data and submit handlers
1327
+ */
1328
+ declare function useFormData<F extends FieldValues, Q extends QueriesArray, V extends Record<string, unknown> = Record<string, unknown>>({ form, pageId }: {
1329
+ form?: FormPageProps<F, Q, V>;
1330
+ pageId: string;
1331
+ }): {
1332
+ mappedFormData: FormManagerConfig<F>[];
1333
+ formSubmit: Submit<F, _gaddario98_react_form.SubmitKeysArg<F>>[];
1334
+ };
1335
+
1336
+ /**
1337
+ * useMetadata Hook
1338
+ * Evaluates dynamic metadata with query data and form values
1339
+ * Integrates i18n for metadata translation
1340
+ * Uses resolveMetadata + applyMetadataToDom for clean separation
1341
+ *
1342
+ * @module hooks/useMetadata
1343
+ */
1344
+
1345
+ /**
1346
+ * Props for useMetadata hook
1347
+ */
1348
+ interface UseMetadataProps<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray> {
1349
+ /** Base metadata configuration (static or dynamic function) */
1350
+ meta?: MetadataConfig<F, Q> | MappedItemsFunction<F, Q, MetadataConfig>;
1351
+ /** Namespace for i18n translations */
1352
+ ns?: string;
1353
+ /** Whether to automatically apply metadata (default: true) */
1354
+ autoApply?: boolean;
1355
+ pageId: string;
1356
+ }
1357
+ /**
1358
+ * Hook for evaluating and managing dynamic metadata.
1359
+ *
1360
+ * Pipeline:
1361
+ * 1. Evaluate `meta` (if it's a MappedItemsFunction, call it with get/set)
1362
+ * 2. Resolve all dynamic functions via `resolveMetadata()`
1363
+ * 3. Translate strings via i18n
1364
+ * 4. Auto-apply to DOM (client) or store (SSR) via `applyMetadataToDom` / MetadataStore
1365
+ *
1366
+ * @returns Resolved and translated metadata
1367
+ */
1368
+ declare function useMetadata<F extends FieldValues = FieldValues, Q extends QueriesArray = QueriesArray>({ meta, autoApply, pageId }: UseMetadataProps<F, Q>): ResolvedMetadata;
1369
+ /**
1370
+ * Hook to manually apply metadata (when autoApply is false)
1371
+ * @returns Function to apply resolved metadata to the DOM
1372
+ */
1373
+ declare function useApplyMetadata(): (meta: ResolvedMetadata) => void;
1374
+
1375
+ /**
1376
+ * Optimized shallow equality check for objects and functions
1377
+ * @param objA - First object to compare
1378
+ * @param objB - Second object to compare
1379
+ * @returns True if objects are shallow equal
1380
+ */
1381
+ declare function shallowEqual(objA: any, objB: any): boolean;
1382
+ /**
1383
+ * Checks if a value is stable for React dependency arrays
1384
+ * @param value - Value to check for stability
1385
+ * @returns True if value is considered stable
1386
+ */
1387
+ declare function isStableValue(value: any): boolean;
1388
+ /**
1389
+ * Creates an optimized dependency array by filtering unstable values
1390
+ * @param deps - Array of dependencies to optimize
1391
+ * @returns Filtered array of stable dependencies
1392
+ */
1393
+ declare function optimizeDeps(deps: Array<any>): Array<any>;
1394
+ /**
1395
+ * Custom prop comparator for React.memo() to prevent unnecessary re-renders
1396
+ * Compares props shallowly and ignores function references if they have the same name
1397
+ * @param prevProps - Previous component props
1398
+ * @param nextProps - Next component props
1399
+ * @returns True if props are equal (component should NOT re-render)
1400
+ */
1401
+ declare function memoPropsComparator<P extends Record<string, any>>(prevProps: Readonly<P>, nextProps: Readonly<P>): boolean;
1402
+ /**
1403
+ * Deep equality check for complex objects
1404
+ * Use sparingly - prefer shallow equality for performance
1405
+ * Uses fast-deep-equal library for optimized deep comparison with circular reference protection
1406
+ * @param objA - First object
1407
+ * @param objB - Second object
1408
+ * @returns True if objects are deeply equal
1409
+ */
1410
+ declare function deepEqual(objA: any, objB: any): boolean;
1411
+ /**
1412
+ * Memoization cache for expensive computations
1413
+ * Simple LRU cache with configurable size
1414
+ */
1415
+ declare class MemoizationCache<K, V> {
1416
+ private cache;
1417
+ private maxSize;
1418
+ constructor(maxSize?: number);
1419
+ get(key: K): V | undefined;
1420
+ set(key: K, value: V): void;
1421
+ has(key: K): boolean;
1422
+ clear(): void;
1423
+ }
1424
+ /**
1425
+ * Creates a memoized function with custom cache key generator
1426
+ * @param fn - Function to memoize
1427
+ * @param cacheKeyFn - Optional function to generate cache key from arguments
1428
+ * @returns Memoized function
1429
+ */
1430
+ declare function memoize<Args extends Array<any>, Result>(fn: (...args: Args) => Result, cacheKeyFn?: (...args: Args) => string): (...args: Args) => Result;
1431
+
1432
+ declare const pageVariablesAtomFamily: jotai_family.AtomFamily<string, jotai.PrimitiveAtom<Record<string, unknown>> & {
1433
+ init: Record<string, unknown>;
1434
+ }>;
1435
+ /**
1436
+ * Global atom storing all page variables.
1437
+ * Key format: "scopeId:pageId"
1438
+ */
1439
+ declare const pageVariablesAtom: jotai.PrimitiveAtom<Record<string, Record<string, unknown>>> & {
1440
+ init: Record<string, Record<string, unknown>>;
1441
+ };
1442
+ /**
1443
+ * Helper to generate composite keys for page variables.
1444
+ */
1445
+ declare const getPageVariablesCompositeKey: (scopeId: string, key: string) => string;
1446
+ /**
1447
+ * Creates a derived atom for accessing page variables of a specific scope.
1448
+ */
1449
+ declare const createScopePageVariablesAtom: (scopeId: string) => jotai.WritableAtom<Record<string, Record<string, unknown>>, [update: Record<string, Record<string, unknown>>], void>;
1450
+
1451
+ /**
1452
+ * Next.js Integration Helpers
1453
+ *
1454
+ * Provides helpers for using the pages metadata system with Next.js:
1455
+ * - `toNextMetadata()` — App Router (`generateMetadata`)
1456
+ * - `NextHeadFromMetadata` — Pages Router (`next/head`)
1457
+ *
1458
+ * @module integrations/next
1459
+ */
1460
+
1461
+ /**
1462
+ * Subset of Next.js Metadata type that we map to.
1463
+ * Consumers can use this directly as the return type of `generateMetadata`.
1464
+ */
1465
+ interface NextMetadata {
1466
+ title?: string;
1467
+ description?: string;
1468
+ keywords?: Array<string>;
1469
+ authors?: Array<{
1470
+ name?: string;
1471
+ url?: string;
1472
+ }>;
1473
+ viewport?: string;
1474
+ themeColor?: string;
1475
+ robots?: string | {
1476
+ index?: boolean;
1477
+ follow?: boolean;
1478
+ noarchive?: boolean;
1479
+ nosnippet?: boolean;
1480
+ 'max-image-preview'?: 'none' | 'standard' | 'large';
1481
+ 'max-snippet'?: number;
1482
+ };
1483
+ alternates?: {
1484
+ canonical?: string;
1485
+ languages?: Record<string, string>;
1486
+ media?: Record<string, string>;
1487
+ types?: Record<string, string>;
1488
+ };
1489
+ openGraph?: {
1490
+ title?: string;
1491
+ description?: string;
1492
+ url?: string;
1493
+ siteName?: string;
1494
+ locale?: string;
1495
+ type?: string;
1496
+ images?: Array<{
1497
+ url: string;
1498
+ alt?: string;
1499
+ width?: number;
1500
+ height?: number;
1501
+ type?: string;
1502
+ }>;
1503
+ publishedTime?: string;
1504
+ modifiedTime?: string;
1505
+ authors?: Array<string>;
1506
+ section?: string;
1507
+ tags?: Array<string>;
1508
+ };
1509
+ twitter?: {
1510
+ card?: 'summary' | 'summary_large_image' | 'app' | 'player';
1511
+ site?: string;
1512
+ creator?: string;
1513
+ title?: string;
1514
+ description?: string;
1515
+ images?: Array<string | {
1516
+ url: string;
1517
+ alt?: string;
1518
+ }>;
1519
+ };
1520
+ icons?: {
1521
+ icon?: Array<{
1522
+ url: string;
1523
+ type?: string;
1524
+ sizes?: string;
1525
+ }>;
1526
+ apple?: Array<{
1527
+ url: string;
1528
+ type?: string;
1529
+ sizes?: string;
1530
+ }>;
1531
+ shortcut?: string;
1532
+ };
1533
+ manifest?: string;
1534
+ other?: Record<string, string>;
1535
+ }
1536
+ /**
1537
+ * Convert ResolvedMetadata into a Next.js Metadata object
1538
+ * for use with App Router's `generateMetadata` or `metadata` export.
1539
+ *
1540
+ * @example
1541
+ * ```ts
1542
+ * // app/page.tsx
1543
+ * import { resolveMetadata, toNextMetadata } from '@/core/pages';
1544
+ *
1545
+ * export async function generateMetadata() {
1546
+ * const resolved = resolveMetadata(pageConfig.meta, context);
1547
+ * return toNextMetadata(resolved);
1548
+ * }
1549
+ * ```
1550
+ */
1551
+ declare function toNextMetadata(resolved: ResolvedMetadata): NextMetadata;
1552
+ /**
1553
+ * Convert ResolvedMetadata into an array of React-compatible head tag descriptors
1554
+ * for use with `next/head` in the Pages Router.
1555
+ *
1556
+ * @example
1557
+ * ```tsx
1558
+ * // pages/index.tsx
1559
+ * import Head from 'next/head';
1560
+ * import { toNextHeadTags, resolveMetadata } from '@/core/pages';
1561
+ *
1562
+ * export default function Page() {
1563
+ * const resolved = resolveMetadata(pageConfig.meta, context);
1564
+ * const tags = toNextHeadTags(resolved);
1565
+ * return (
1566
+ * <>
1567
+ * <Head>{tags.map(t => t.html)}</Head>
1568
+ * <PageContent />
1569
+ * </>
1570
+ * );
1571
+ * }
1572
+ * ```
1573
+ *
1574
+ * Each tag has a `key` (for React list rendering) and `html` (raw HTML string).
1575
+ * For a JSX-based approach, use `collectMetadataToHtml` and inject via dangerouslySetInnerHTML.
1576
+ */
1577
+ interface HeadTag {
1578
+ key: string;
1579
+ tag: string;
1580
+ attributes: Record<string, string>;
1581
+ content?: string;
1582
+ }
1583
+ declare function toNextHeadTags(resolved: ResolvedMetadata): Array<HeadTag>;
1584
+
1585
+ /**
1586
+ * Sitemap & Robots.txt Generation Helpers
1587
+ *
1588
+ * Provides functions for generating sitemap.xml and robots.txt content
1589
+ * from page metadata. Useful for:
1590
+ * - Next.js App Router `app/sitemap.ts` and `app/robots.ts`
1591
+ * - Any SSR/SSG framework that needs sitemap generation
1592
+ *
1593
+ * @module integrations/sitemap
1594
+ */
1595
+ interface SitemapEntry {
1596
+ /** Absolute URL of the page */
1597
+ url: string;
1598
+ /** Last modification date (ISO 8601) */
1599
+ lastModified?: string | Date;
1600
+ /** Change frequency hint */
1601
+ changeFrequency?: 'always' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' | 'never';
1602
+ /** Priority (0.0 to 1.0, default 0.5) */
1603
+ priority?: number;
1604
+ /** Alternate language URLs */
1605
+ alternates?: Record<string, string>;
1606
+ }
1607
+ /**
1608
+ * Generate a sitemap.xml string from a list of entries.
1609
+ *
1610
+ * @example
1611
+ * ```ts
1612
+ * // app/sitemap.ts (Next.js App Router)
1613
+ * import { generateSitemapXml } from '@/core/pages/integrations/sitemap';
1614
+ *
1615
+ * export default function sitemap() {
1616
+ * return generateSitemapEntries([
1617
+ * { url: 'https://example.com', changeFrequency: 'daily', priority: 1.0 },
1618
+ * { url: 'https://example.com/about', changeFrequency: 'monthly', priority: 0.8 },
1619
+ * ]);
1620
+ * }
1621
+ * ```
1622
+ */
1623
+ declare function generateSitemapXml(entries: Array<SitemapEntry>): string;
1624
+ /**
1625
+ * Generate structured sitemap entries compatible with Next.js App Router `sitemap()`.
1626
+ * Returns plain objects that Next.js can serialize.
1627
+ */
1628
+ declare function generateSitemapEntries(entries: Array<SitemapEntry>): Array<{
1629
+ url: string;
1630
+ lastModified?: Date;
1631
+ changeFrequency?: string;
1632
+ priority?: number;
1633
+ }>;
1634
+ interface RobotsTxtConfig {
1635
+ /** Rules for specific or all user agents */
1636
+ rules: Array<{
1637
+ /** User agent string (e.g., "*", "Googlebot") */
1638
+ userAgent: string | Array<string>;
1639
+ /** Allowed paths */
1640
+ allow?: Array<string>;
1641
+ /** Disallowed paths */
1642
+ disallow?: Array<string>;
1643
+ /** Crawl delay in seconds */
1644
+ crawlDelay?: number;
1645
+ }>;
1646
+ /** Sitemap URLs to reference */
1647
+ sitemap?: string | Array<string>;
1648
+ /** Host directive */
1649
+ host?: string;
1650
+ }
1651
+ /**
1652
+ * Generate a robots.txt string from configuration.
1653
+ *
1654
+ * @example
1655
+ * ```ts
1656
+ * // app/robots.ts (Next.js App Router)
1657
+ * import { generateRobotsTxt } from '@/core/pages/integrations/sitemap';
1658
+ *
1659
+ * export default function robots() {
1660
+ * return generateRobotsTxt({
1661
+ * rules: [
1662
+ * { userAgent: '*', allow: ['/'], disallow: ['/admin'] },
1663
+ * { userAgent: 'Googlebot', allow: ['/'] },
1664
+ * ],
1665
+ * sitemap: 'https://example.com/sitemap.xml',
1666
+ * });
1667
+ * }
1668
+ * ```
1669
+ */
1670
+ declare function generateRobotsTxt(config: RobotsTxtConfig): string;
1671
+
1672
+ /**
1673
+ * JSON-LD Structured Data Builders
1674
+ *
1675
+ * Helpers to build valid schema.org JSON-LD objects for common types.
1676
+ * These can be passed to MetadataConfig.structuredData.schema or used
1677
+ * directly in a <script type="application/ld+json"> tag.
1678
+ *
1679
+ * @module integrations/jsonld
1680
+ */
1681
+ interface OrganizationJsonLdInput {
1682
+ name: string;
1683
+ url: string;
1684
+ logo?: string;
1685
+ description?: string;
1686
+ sameAs?: Array<string>;
1687
+ contactPoint?: {
1688
+ telephone?: string;
1689
+ contactType?: string;
1690
+ email?: string;
1691
+ areaServed?: string | Array<string>;
1692
+ availableLanguage?: string | Array<string>;
1693
+ };
1694
+ }
1695
+ declare function buildOrganizationJsonLd(input: OrganizationJsonLdInput): Record<string, unknown>;
1696
+ interface WebSiteJsonLdInput {
1697
+ name: string;
1698
+ url: string;
1699
+ description?: string;
1700
+ /** Enable sitelinks searchbox */
1701
+ potentialAction?: {
1702
+ /** URL template for search, e.g., "https://example.com/search?q={search_term_string}" */
1703
+ target: string;
1704
+ queryInput: string;
1705
+ };
1706
+ }
1707
+ declare function buildWebSiteJsonLd(input: WebSiteJsonLdInput): Record<string, unknown>;
1708
+ interface BreadcrumbItem {
1709
+ name: string;
1710
+ url: string;
1711
+ }
1712
+ declare function buildBreadcrumbListJsonLd(items: Array<BreadcrumbItem>): Record<string, unknown>;
1713
+ interface ArticleJsonLdInput {
1714
+ headline: string;
1715
+ description?: string;
1716
+ image?: string | Array<string>;
1717
+ datePublished?: string;
1718
+ dateModified?: string;
1719
+ author?: {
1720
+ name: string;
1721
+ url?: string;
1722
+ } | Array<{
1723
+ name: string;
1724
+ url?: string;
1725
+ }>;
1726
+ publisher?: {
1727
+ name: string;
1728
+ logo?: string;
1729
+ };
1730
+ url?: string;
1731
+ mainEntityOfPage?: string;
1732
+ }
1733
+ declare function buildArticleJsonLd(input: ArticleJsonLdInput): Record<string, unknown>;
1734
+ interface FAQItem {
1735
+ question: string;
1736
+ answer: string;
1737
+ }
1738
+ declare function buildFAQPageJsonLd(items: Array<FAQItem>): Record<string, unknown>;
1739
+ interface ProductJsonLdInput {
1740
+ name: string;
1741
+ description?: string;
1742
+ image?: string | Array<string>;
1743
+ brand?: string;
1744
+ sku?: string;
1745
+ offers?: {
1746
+ price: number;
1747
+ priceCurrency: string;
1748
+ availability?: 'InStock' | 'OutOfStock' | 'PreOrder' | 'SoldOut' | 'BackOrder';
1749
+ url?: string;
1750
+ priceValidUntil?: string;
1751
+ };
1752
+ aggregateRating?: {
1753
+ ratingValue: number;
1754
+ reviewCount: number;
1755
+ bestRating?: number;
1756
+ worstRating?: number;
1757
+ };
1758
+ }
1759
+ declare function buildProductJsonLd(input: ProductJsonLdInput): Record<string, unknown>;
1760
+
1761
+ /**
1762
+ * LLMs.txt Generation Support
1763
+ *
1764
+ * Generates `llms.txt` and `llms-full.txt` content following the
1765
+ * llms.txt specification (https://llmstxt.org/).
1766
+ *
1767
+ * The llms.txt file helps LLMs and AI agents discover what a site offers
1768
+ * and where to find key documentation/content.
1769
+ *
1770
+ * @module integrations/llms
1771
+ */
1772
+
1773
+ /**
1774
+ * Generate llms.txt content from configuration.
1775
+ *
1776
+ * Format (per spec):
1777
+ * ```
1778
+ * # Site Name
1779
+ *
1780
+ * > Brief description of the site
1781
+ *
1782
+ * ## Docs
1783
+ *
1784
+ * - [Title](url): Description
1785
+ * - [Title](url): Description
1786
+ * ```
1787
+ *
1788
+ * @example
1789
+ * ```ts
1790
+ * const content = generateLlmsTxt({
1791
+ * siteName: 'My App',
1792
+ * siteDescription: 'A great application for doing things.',
1793
+ * entries: [
1794
+ * { url: '/docs/getting-started', title: 'Getting Started', description: 'How to set up My App' },
1795
+ * { url: '/docs/api', title: 'API Reference', description: 'Complete API documentation' },
1796
+ * ],
1797
+ * });
1798
+ * // Write `content` to /llms.txt
1799
+ * ```
1800
+ */
1801
+ declare function generateLlmsTxt(config: LlmsTxtConfig): string;
1802
+ /**
1803
+ * Generate a full markdown version (llms-full.txt) that includes
1804
+ * more detailed content for each entry.
1805
+ *
1806
+ * This is useful for providing LLMs with the complete documentation
1807
+ * in a single file.
1808
+ */
1809
+ declare function generateLlmsFullTxt(config: LlmsTxtConfig, pageContents: Array<{
1810
+ entry: LlmsTxtEntry;
1811
+ markdown: string;
1812
+ }>): string;
1813
+ /**
1814
+ * Helper to convert a ResolvedMetadata + page text into a clean markdown
1815
+ * representation suitable for llms-full.txt or standalone .md endpoints.
1816
+ *
1817
+ * Strips HTML chrome, keeps headings coherent, and prepends metadata summary.
1818
+ */
1819
+ declare function pageToMarkdown(options: {
1820
+ title: string;
1821
+ description?: string;
1822
+ url: string;
1823
+ content: string;
1824
+ }): string;
1825
+
1826
+ export { MemoizationCache, MetadataStoreProvider, PageGenerator, RenderComponents, applyMetadataToDom, buildArticleJsonLd, buildBreadcrumbListJsonLd, buildFAQPageJsonLd, buildOrganizationJsonLd, buildProductJsonLd, buildWebSiteJsonLd, clearMetadataLog, collectMetadataToHtml, createMetadataStore, createScopePageVariablesAtom, deepEqual, generateLlmsFullTxt, generateLlmsTxt, generateRobotsTxt, generateSitemapEntries, generateSitemapXml, getMetadata, getMetadataLog, getPageConfig, getPageVariablesCompositeKey, isStableValue, logMetadata, memoPropsComparator, memoize, optimizeDeps, pageConfigAtom, pageToMarkdown, pageVariablesAtom, pageVariablesAtomFamily, resetMetadata, resolveMetadata, setMetadata, setMetadataLogging, shallowEqual, toNextHeadTags, toNextMetadata, useApplyMetadata, useFormData, useGenerateContent, useGenerateContentRender, useMetadata, useMetadataStore, usePageConfig, usePageConfigReset, usePageConfigState, usePageConfigValue, useViewSettings };
1827
+ export type { AIHintsConfig, AlternatesConfig, ArticleJsonLdInput, BreadcrumbItem, ContainerItem, ContentItem, ContentItemsType, ContentProps, DefaultContainerProps, DependencyGraph, DependencyNode, Elements, FAQItem, FormPageProps, FunctionProps, GenerateContentProps, GenerateContentRenderProps, GetFunction, HeadTag, IconConfig, IconsConfig, ItemContainerProps, Items, LazyLoadingConfig, LlmsTxtConfig, LlmsTxtEntry, MappedContents, MappedItemsFunction, MemoizationCacheStats, MetaTag, MetadataConfig, MetadataProvider, MetadataStore, NextMetadata, OpenGraphArticle, OpenGraphConfig, OpenGraphImage, OrganizationJsonLdInput, PageAuthState, PageConfigProps, MetadataConfig as PageMetadataProps, PageProps, PageTranslationOptions, PlatformOverrides, ProductJsonLdInput, Props, QueryPageConfigArray, RenderComponentsProps, ResolvedMetadata, RobotsConfig, RobotsTxtConfig, SetFunction, SitemapEntry, StructuredDataConfig, TwitterCardConfig, UseMetadataProps, ViewSettings, WebSiteJsonLdInput };