@panneau/core 4.1.1 → 5.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +83 -0
  2. package/dist/definition/abilities.d.ts +21 -0
  3. package/dist/definition/abilities.d.ts.map +1 -0
  4. package/dist/definition/abilities.js +47 -0
  5. package/dist/definition/abilities.js.map +1 -0
  6. package/dist/definition/form.d.ts +31 -0
  7. package/dist/definition/form.d.ts.map +1 -0
  8. package/dist/definition/form.js +54 -0
  9. package/dist/definition/form.js.map +1 -0
  10. package/dist/definition/list.d.ts +44 -0
  11. package/dist/definition/list.d.ts.map +1 -0
  12. package/dist/definition/list.js +70 -0
  13. package/dist/definition/list.js.map +1 -0
  14. package/dist/definition/resource.d.ts +21 -0
  15. package/dist/definition/resource.d.ts.map +1 -0
  16. package/dist/definition/resource.js +24 -0
  17. package/dist/definition/resource.js.map +1 -0
  18. package/dist/form/form.d.ts +148 -0
  19. package/dist/form/form.d.ts.map +1 -0
  20. package/dist/form/form.js +239 -0
  21. package/dist/form/form.js.map +1 -0
  22. package/dist/form/messages.d.ts +7 -0
  23. package/dist/form/messages.d.ts.map +1 -0
  24. package/dist/form/messages.js +25 -0
  25. package/dist/form/messages.js.map +1 -0
  26. package/dist/form/problem.d.ts +16 -0
  27. package/dist/form/problem.d.ts.map +1 -0
  28. package/dist/form/problem.js +34 -0
  29. package/dist/form/problem.js.map +1 -0
  30. package/dist/form/selectors.d.ts +16 -0
  31. package/dist/form/selectors.d.ts.map +1 -0
  32. package/dist/form/selectors.js +27 -0
  33. package/dist/form/selectors.js.map +1 -0
  34. package/dist/form/store.d.ts +19 -0
  35. package/dist/form/store.d.ts.map +1 -0
  36. package/dist/form/store.js +29 -0
  37. package/dist/form/store.js.map +1 -0
  38. package/dist/index.d.ts +17 -692
  39. package/dist/index.d.ts.map +1 -0
  40. package/dist/index.js +17 -536
  41. package/dist/list/list.d.ts +68 -0
  42. package/dist/list/list.d.ts.map +1 -0
  43. package/dist/list/list.js +191 -0
  44. package/dist/list/list.js.map +1 -0
  45. package/dist/list/router.d.ts +26 -0
  46. package/dist/list/router.d.ts.map +1 -0
  47. package/dist/list/router.js +54 -0
  48. package/dist/list/router.js.map +1 -0
  49. package/dist/plugins.d.ts +73 -0
  50. package/dist/plugins.d.ts.map +1 -0
  51. package/dist/plugins.js +54 -0
  52. package/dist/plugins.js.map +1 -0
  53. package/dist/react/provider.d.ts +38 -0
  54. package/dist/react/provider.d.ts.map +1 -0
  55. package/dist/react/provider.js +63 -0
  56. package/dist/react/provider.js.map +1 -0
  57. package/dist/react/useForm.d.ts +26 -0
  58. package/dist/react/useForm.d.ts.map +1 -0
  59. package/dist/react/useForm.js +115 -0
  60. package/dist/react/useForm.js.map +1 -0
  61. package/dist/react/useList.d.ts +11 -0
  62. package/dist/react/useList.d.ts.map +1 -0
  63. package/dist/react/useList.js +47 -0
  64. package/dist/react/useList.js.map +1 -0
  65. package/dist/values.d.ts +12 -0
  66. package/dist/values.d.ts.map +1 -0
  67. package/dist/values.js +44 -0
  68. package/dist/values.js.map +1 -0
  69. package/package.json +19 -81
  70. package/dist/contexts.d.ts +0 -667
  71. package/dist/contexts.js +0 -1772
  72. package/dist/hooks.d.ts +0 -512
  73. package/dist/hooks.js +0 -2146
  74. package/dist/utils.d.ts +0 -457
  75. package/dist/utils.js +0 -557
@@ -1,667 +0,0 @@
1
- import * as react from 'react';
2
- import { ElementType, ReactNode, ComponentProps, MouseEvent, ComponentType } from 'react';
3
- import { MessageDescriptor, FormattedMessage } from 'react-intl';
4
- export { RoutesContext, RoutesProvider, useRoutes, useUrlGenerator } from '@folklore/routes';
5
- export { TrackingContext } from '@folklore/tracking';
6
-
7
- /**
8
- * Core UI Types
9
- */
10
-
11
- /**
12
- * Internationalization message definition
13
- */
14
- type Message = MessageDescriptor;
15
- /**
16
- * Values that can be interpolated in an internationalization message
17
- * (the `values` prop of FormattedMessage)
18
- */
19
- type MessageValues = NonNullable<ComponentProps<typeof FormattedMessage>['values']>;
20
- type MessageValue = MessageValues[string];
21
- /**
22
- * Label can be either a message object or any React node
23
- */
24
- type Label = Message | ReactNode;
25
- /**
26
- * Map of components, can be nested by namespace (ex: { fields: { text: TextField } })
27
- */
28
- interface ComponentsMap {
29
- [name: string]: ElementType | ComponentsMap;
30
- }
31
- /**
32
- * Menu item definition
33
- */
34
- interface MenuItem {
35
- id?: number | string;
36
- label?: Label;
37
- url?: string;
38
- href?: string | null;
39
- external?: boolean;
40
- active?: boolean;
41
- type?: string;
42
- component?: string;
43
- className?: string | null;
44
- linkClassName?: string | null;
45
- onClick?: ((e: MouseEvent) => void) | null;
46
- items?: MenuItem[] | null;
47
- dropdown?: MenuItem[] | null;
48
- }
49
- /**
50
- * Form control size
51
- */
52
- type ControlSize = 'lg' | 'sm' | null;
53
- /**
54
- * Font definition
55
- */
56
- interface Font {
57
- name: string;
58
- }
59
- /**
60
- * Generic definition
61
- */
62
- interface Definition$1 {
63
- id: string;
64
- component?: string | ElementType;
65
- [key: string]: unknown;
66
- }
67
- interface RouteDefinition {
68
- path?: string;
69
- route?: string;
70
- component: string | ElementType;
71
- [key: string]: unknown;
72
- }
73
- interface PageDefinition {
74
- component: string | ElementType;
75
- }
76
-
77
- /**
78
- * Form Types
79
- * TypeScript interfaces for form-related components
80
- */
81
-
82
- /**
83
- * Field definition
84
- */
85
- interface Field {
86
- name?: string;
87
- type?: string;
88
- label?: Label;
89
- component?: string;
90
- size?: ControlSize;
91
- [key: string]: unknown;
92
- }
93
- interface FieldDefinition extends Omit<Field, 'component'>, Definition$1 {
94
- }
95
- /**
96
- * Form definition
97
- */
98
- interface Form {
99
- title?: ReactNode;
100
- fields?: Field[];
101
- method?: string | null;
102
- action?: string | null;
103
- submitButtonLabel?: Label | null;
104
- [key: string]: unknown;
105
- }
106
- interface FormDefinition extends Form, Definition$1 {
107
- }
108
-
109
- /**
110
- * Resource Types
111
- * TypeScript interfaces for resources, items, users, media, and other entities
112
- */
113
-
114
- /**
115
- * Table column definition
116
- */
117
- type TableColumn = string | Column;
118
- interface Column extends Record<string, unknown> {
119
- id?: string | null;
120
- name?: string | null;
121
- label?: unknown;
122
- path?: string;
123
- valueKey?: string;
124
- component?: string | ElementType | null;
125
- field?: Field | string | null;
126
- actions?: ActionDefinition[] | null;
127
- }
128
- interface Action {
129
- id?: string;
130
- component?: string;
131
- label?: string | null;
132
- icon?: string | null;
133
- href?: string | null;
134
- external?: boolean;
135
- theme?: string;
136
- target?: string;
137
- onClick?: (() => void) | null;
138
- endpoint?: string | null;
139
- withoutConfirmation?: boolean;
140
- [key: string]: unknown;
141
- }
142
- type ActionDefinition = string | Action;
143
- interface ResourceIntlValues {
144
- a_singular?: string;
145
- a_plural?: string;
146
- [key: string]: MessageValue;
147
- }
148
- /**
149
- * Internationalization configuration
150
- */
151
- interface ResourceIntl {
152
- messages?: Record<string, string>;
153
- values?: ResourceIntlValues;
154
- }
155
- /**
156
- * Resource definition
157
- */
158
- interface ResourceIndex {
159
- filters?: Filter[];
160
- columns?: TableColumn[];
161
- actions?: ActionDefinition[];
162
- fields?: Field[];
163
- [key: string]: unknown;
164
- }
165
- /**
166
- * Overrides of the built-in resource pages, ex: `{ show: { component: 'my-page' } }`.
167
- * Used on a resource (`resource.pages`) and on the panneau definition (`definition.pages`),
168
- * the resource taking precedence.
169
- */
170
- interface ResourcePages {
171
- index?: PageDefinition;
172
- show?: PageDefinition;
173
- create?: PageDefinition;
174
- edit?: PageDefinition;
175
- delete?: PageDefinition;
176
- duplicate?: PageDefinition;
177
- /** @deprecated Legacy resource keys, use `index`, `show`, `create`, etc. */
178
- resourceIndexPage?: PageDefinition;
179
- resourceShowPage?: PageDefinition;
180
- resourceCreatePage?: PageDefinition;
181
- resourceEditPage?: PageDefinition;
182
- resourceDeletePage?: PageDefinition;
183
- resourceDuplicatePage?: PageDefinition;
184
- /** @deprecated Legacy panneau keys, use `index`, `show`, `create`, etc. */
185
- indexPage?: PageDefinition;
186
- showPage?: PageDefinition;
187
- createPage?: PageDefinition;
188
- editPage?: PageDefinition;
189
- deletePage?: PageDefinition;
190
- duplicatePage?: PageDefinition;
191
- [key: string]: PageDefinition | undefined;
192
- }
193
- /**
194
- * Form definition of a resource (the id is optional, the form is identified by its key)
195
- */
196
- interface ResourceForm extends Form {
197
- id?: string;
198
- component?: string | ElementType;
199
- }
200
- interface ResourceForms {
201
- default?: ResourceForm | null;
202
- create?: ResourceForm | null;
203
- edit?: ResourceForm | null;
204
- delete?: ResourceForm | null;
205
- duplicate?: ResourceForm | null;
206
- modal?: ResourceForm | null;
207
- [key: string]: ResourceForm | null | undefined;
208
- }
209
- /**
210
- * Resource type (sub-type of a resource, ex: page types)
211
- */
212
- interface ResourceType {
213
- id?: string;
214
- name?: string;
215
- fields?: Field[];
216
- settings?: {
217
- canCreate?: boolean;
218
- [key: string]: unknown;
219
- };
220
- }
221
- interface Resource {
222
- id: string;
223
- name: string;
224
- intl?: ResourceIntl;
225
- fields?: Field[];
226
- index?: ResourceIndex;
227
- forms?: ResourceForms;
228
- settings?: Record<string, unknown>;
229
- extraRoutes?: RouteDefinition[];
230
- pages?: ResourcePages;
231
- types?: ResourceType[];
232
- }
233
- /**
234
- * Filter definition
235
- */
236
- interface Filter {
237
- id?: string;
238
- component?: string;
239
- [key: string]: unknown;
240
- }
241
-
242
- /**
243
- * Panneau Definition Types
244
- * TypeScript interfaces for main Panneau configuration and definitions
245
- */
246
-
247
- /**
248
- * Panneau route configuration
249
- */
250
- interface Routes {
251
- 'resources.index'?: RouteDefinition | string;
252
- 'resources.create'?: RouteDefinition | string;
253
- 'resources.store'?: RouteDefinition | string;
254
- 'resources.show'?: RouteDefinition | string;
255
- 'resources.edit'?: RouteDefinition | string;
256
- 'resources.update'?: RouteDefinition | string;
257
- 'resources.delete'?: RouteDefinition | string;
258
- 'resources.destroy'?: RouteDefinition | string;
259
- 'resources.duplicate'?: RouteDefinition | string;
260
- 'resources.clone'?: RouteDefinition | string;
261
- 'resources.restore'?: RouteDefinition | string;
262
- [key: string]: RouteDefinition | string;
263
- }
264
- interface PanneauTheme {
265
- colorScheme?: string | null;
266
- [key: string]: unknown;
267
- }
268
- interface PanneauComponents {
269
- [key: string]: string | {
270
- component: string;
271
- [key: string]: unknown;
272
- };
273
- }
274
- interface PanneauIntlValues {
275
- [key: string]: string;
276
- }
277
- interface PanneauIntl {
278
- locale?: string;
279
- locales?: string[];
280
- messages?: Record<string, string>;
281
- /** @deprecated Not used: set the values of each resource in `resources[].intl.values` */
282
- values?: PanneauIntlValues;
283
- }
284
- interface PanneauPages extends ResourcePages {
285
- home?: PageDefinition;
286
- login?: PageDefinition;
287
- account?: PageDefinition;
288
- error?: PageDefinition;
289
- }
290
- /**
291
- * Menu item in a Panneau menu: a menu item definition or a special item id
292
- * (ex: 'resources', 'account', 'separator')
293
- */
294
- type PanneauMenuItem = MenuItem | string;
295
- interface PanneauMenus {
296
- main?: PanneauMenuItem[] | null;
297
- guest?: PanneauMenuItem[] | null;
298
- [key: string]: PanneauMenuItem[] | null | undefined;
299
- }
300
- /**
301
- * Links shown on the login page: `true` for the default url, or the url of the page
302
- */
303
- interface PanneauAuth {
304
- /** "Forgot your password?" link (default url: /forgot-password) */
305
- forgotPassword?: boolean | string;
306
- /** "Create account" link (default url: /register) */
307
- register?: boolean | string;
308
- [key: string]: unknown;
309
- }
310
- /**
311
- * Panneau definition (main configuration)
312
- */
313
- interface PanneauDefinition {
314
- name?: string;
315
- resources?: Resource[];
316
- routes?: Routes;
317
- pages?: PanneauPages;
318
- intl?: PanneauIntl;
319
- theme?: PanneauTheme;
320
- /** @deprecated Not used: give the custom components to the `components` prop of the container */
321
- components?: PanneauComponents;
322
- settings?: Record<string, unknown>;
323
- forms?: FormDefinition[];
324
- fields?: FieldDefinition[];
325
- menus?: PanneauMenus;
326
- auth?: PanneauAuth;
327
- }
328
- /**
329
- * Tracking variables
330
- */
331
- type TrackingVariables = Record<string, unknown>;
332
-
333
- declare class ComponentsManager {
334
- components: Record<string, ElementType>;
335
- constructor(components?: ComponentsMap);
336
- addComponent(name: string, component: ElementType, namespace?: string | null): this;
337
- addComponents(components: Record<string, ElementType>, namespace?: string | null): this;
338
- merge(manager: ComponentsManager, namespace?: string | null): this;
339
- addNamespace(namespace: string | null): this;
340
- getComponent(name: string | ElementType, namespace?: string | null): ElementType | null;
341
- getComponents(namespace?: string | null): Record<string, ElementType> | null;
342
- hasComponent(name: string, namespace?: string | null): boolean;
343
- }
344
-
345
- interface Definition {
346
- id: string;
347
- component?: unknown;
348
- [key: string]: unknown;
349
- }
350
- declare class DefinitionsManager<T extends Definition = Definition> {
351
- definitions: T[];
352
- constructor(definitions?: T[]);
353
- addDefinition(definition: T | T[]): this;
354
- addDefinitions(definitions: T[]): this;
355
- merge(manager: DefinitionsManager<T>): this;
356
- getDefinition(id: string | null): T | null;
357
- getDefinitions(): T[];
358
- hasDefinition(id: string): boolean;
359
- getComponent(id: string): unknown;
360
- getComponents(): Record<string, unknown>;
361
- }
362
-
363
- declare class FieldsManager extends DefinitionsManager<FieldDefinition> {
364
- }
365
-
366
- declare class FormsManager extends DefinitionsManager<FormDefinition> {
367
- }
368
-
369
- declare const MODALS_NAMESPACE = "modals";
370
- declare const FIELDS_NAMESPACE = "fields";
371
- declare const FORMS_NAMESPACE = "forms";
372
- declare const FILTERS_NAMESPACE = "filters";
373
- declare const LISTS_NAMESPACE = "lists";
374
- declare const DISPLAYS_NAMESPACE = "displays";
375
- declare const ACTIONS_NAMESPACE = "actions";
376
- declare const BUTTONS_NAMESPACE = "buttons";
377
- declare const PAGES_NAMESPACE = "pages";
378
- declare const PREVIEWS_NAMESPACE = "previews";
379
- declare const APP_NAMESPACE = "app";
380
- declare const ComponentsContext: react.Context<ComponentsManager>;
381
- /**
382
- * Hooks
383
- */
384
- declare function useComponentsManager(namespace?: string | null): ComponentsManager;
385
- declare function useComponents(namespace?: string | null, defaultComponents?: Record<string, ElementType>): Record<string, ElementType>;
386
- declare function useComponent(name: string | ElementType | null, defaultComponent?: ElementType | null, namespace?: string | null): ElementType | null;
387
- /**
388
- * Fields hooks
389
- */
390
- declare function useFieldsComponentsManager(): ComponentsManager;
391
- declare function useFieldsComponents(defaultComponents?: {}): Record<string, ElementType>;
392
- declare function useFieldComponent(name: any, defaultComponent?: any): ElementType;
393
- /**
394
- * Forms hooks
395
- */
396
- declare function useFormsComponentsManager(): ComponentsManager;
397
- declare function useFormsComponents(defaultComponents?: {}): Record<string, ElementType>;
398
- declare function useFormComponent(name: any, defaultComponent?: any): ElementType;
399
- /**
400
- * Modals hooks
401
- */
402
- declare function useModalsComponentsManager(): ComponentsManager;
403
- declare function useModalsComponents(defaultComponents?: {}): Record<string, ElementType>;
404
- declare function useModalComponent(name: any, defaultComponent?: any): ElementType;
405
- /**
406
- * Filters hooks
407
- */
408
- declare function useFiltersComponentsManager(): ComponentsManager;
409
- declare function useFiltersComponents(defaultComponents?: {}): Record<string, ElementType>;
410
- declare function useFilterComponent(name: any, defaultComponent?: any): ElementType;
411
- /**
412
- * Lists hooks
413
- */
414
- declare function useListsComponentsManager(): ComponentsManager;
415
- declare function useListsComponents(defaultComponents?: {}): Record<string, ElementType>;
416
- declare function useListComponent(name: any, defaultComponent?: any): ElementType;
417
- /**
418
- * Displays hooks
419
- */
420
- declare function useDisplaysComponentsManager(): ComponentsManager;
421
- declare function useDisplaysComponents(defaultComponents?: {}): Record<string, ElementType>;
422
- declare function useDisplayComponent(name: any, defaultComponent?: any): ElementType;
423
- /**
424
- * Actions hooks
425
- */
426
- declare function useActionsComponentsManager(): ComponentsManager;
427
- declare function useActionsComponents(defaultComponents?: {}): Record<string, ElementType>;
428
- declare function useActionComponent(name: any, defaultComponent?: any): ElementType;
429
- /**
430
- * Buttons hooks
431
- */
432
- declare function useButtonsComponentsManager(): ComponentsManager;
433
- declare function useButtonsComponents(defaultComponents?: {}): Record<string, ElementType>;
434
- declare function useButtonComponent(name: any, defaultComponent?: any): ElementType;
435
- /**
436
- * Pages hooks
437
- */
438
- declare function usePagesComponentsManager(): ComponentsManager;
439
- declare function usePagesComponents(defaultComponents?: {}): Record<string, ElementType>;
440
- declare function usePageComponent(name: any, defaultComponent?: any): ElementType;
441
- /**
442
- * Previews hooks
443
- */
444
- declare function usePreviewsComponentsManager(): ComponentsManager;
445
- declare function usePreviewsComponents(defaultComponents?: {}): Record<string, ElementType>;
446
- declare function usePreviewComponent(name: any, defaultComponent?: any): ElementType;
447
- /**
448
- * App hooks
449
- */
450
- declare function useAppComponentsManager(): ComponentsManager;
451
- declare function useAppComponents(defaultComponents?: {}): Record<string, ElementType>;
452
- declare function useAppComponent(name: any, defaultComponent?: any): ElementType;
453
- /**
454
- * Provider
455
- */
456
- interface ComponentsProviderProps {
457
- children: ReactNode;
458
- namespace?: string | null;
459
- manager?: ComponentsManager | null;
460
- components?: ComponentsMap;
461
- }
462
- declare function ComponentsProvider({ components, manager, namespace, children, }: ComponentsProviderProps): react.JSX.Element;
463
-
464
- declare function useDefinitionContext(): Definition$1 | null;
465
- declare function useDefinition(): Definition$1 | null;
466
- interface DefinitionProviderProps {
467
- definition: Definition$1;
468
- children: ReactNode;
469
- }
470
- declare function DefinitionProvider({ definition, children }: DefinitionProviderProps): react.JSX.Element;
471
-
472
- declare const FieldsContext: react.Context<FieldsManager>;
473
- declare function useFieldsManager(): FieldsManager | null;
474
- declare function useFieldDefinition(id: string): FieldDefinition | null;
475
- declare function useFieldDefinitions(): FieldDefinition[];
476
- interface FieldsProviderProps {
477
- fields?: FieldDefinition[] | null;
478
- manager?: FieldsManager | null;
479
- children: ReactNode;
480
- }
481
- declare function FieldsProvider({ fields, manager, children }: FieldsProviderProps): react.JSX.Element;
482
-
483
- interface FontsContextValue {
484
- systemFonts: (Font | string)[] | null;
485
- googleFonts: (Font | string)[] | null;
486
- customFonts: (Font | string)[] | null;
487
- setGoogleFonts?: ((fonts: Font[]) => void) | null;
488
- }
489
- declare const FontsContext: react.Context<FontsContextValue>;
490
- declare function useGoogleFonts({ disabled, setFonts, }?: {
491
- disabled?: boolean;
492
- setFonts?: ((fonts: Font[]) => void) | null;
493
- }): Font[] | null;
494
- declare function useFonts({ withoutGoogleFonts, }?: {
495
- withoutGoogleFonts?: boolean;
496
- }): FontsContextValue;
497
- interface FontsProviderProps {
498
- children: ReactNode;
499
- systemFonts?: (Font | string)[] | null;
500
- customFonts?: (Font | string)[] | null;
501
- }
502
- declare function FontsProvider({ systemFonts, customFonts, children, }: FontsProviderProps): react.JSX.Element;
503
-
504
- interface FormContextValue {
505
- value: Record<string, unknown>;
506
- setValue: (value: Record<string, unknown>) => void;
507
- }
508
- declare function useFormContext(): FormContextValue | null;
509
- declare function useFormValue(): Record<string, unknown>;
510
- declare function useFormSetValue(): (value: Record<string, unknown>) => void;
511
- interface FormProviderProps {
512
- value: Record<string, unknown>;
513
- setValue: (value: Record<string, unknown>) => void;
514
- children: ReactNode;
515
- }
516
- declare function FormProvider({ value, setValue, children }: FormProviderProps): react.JSX.Element;
517
-
518
- declare const FormsContext: react.Context<FormsManager>;
519
- declare function useFormsManager(): FormsManager | null;
520
- declare function useFormDefinition(id: string): FormDefinition | null;
521
- declare function useFormDefinitions(): FormDefinition[];
522
- interface FormsProviderProps {
523
- forms?: FormDefinition[] | null;
524
- manager?: FormsManager | null;
525
- children: ReactNode;
526
- }
527
- declare function FormsProvider({ forms, manager, children }: FormsProviderProps): react.JSX.Element;
528
-
529
- declare const GoogleApiClientContext: react.Context<any>;
530
- declare function useGoogleApiClient(): any | null;
531
- declare function withGoogleApiClient(WrappedComponent: ComponentType<any>): {
532
- (props: any): react.JSX.Element;
533
- displayName: string;
534
- };
535
- interface GoogleApiClientProviderProps {
536
- children: ReactNode;
537
- }
538
- declare function GoogleApiClientProvider({ children }: GoogleApiClientProviderProps): react.JSX.Element;
539
-
540
- interface GoogleKeysContextValue {
541
- apiKey: string | null;
542
- }
543
- declare const GoogleKeysContext: react.Context<GoogleKeysContextValue>;
544
- declare function useGoogleKeys(): GoogleKeysContextValue;
545
- interface GoogleKeysProviderProps {
546
- children: ReactNode;
547
- apiKey?: string | null;
548
- }
549
- declare function GoogleKeysProvider({ children, apiKey }: GoogleKeysProviderProps): react.JSX.Element;
550
-
551
- declare const GoogleMapsClientContext: react.Context<any>;
552
- declare function useGoogleMapsClient(): any | null;
553
- declare function withGoogleMapsClient(WrappedComponent: ComponentType<any>): {
554
- (props: any): react.JSX.Element;
555
- displayName: string;
556
- };
557
- interface GoogleMapsClientProviderProps {
558
- children: ReactNode;
559
- locale?: string;
560
- libraries?: string[] | null;
561
- }
562
- declare function GoogleMapsClientProvider({ children, locale, libraries, }: GoogleMapsClientProviderProps): react.JSX.Element;
563
-
564
- interface LocalesContextValue {
565
- locales: string[];
566
- }
567
- declare const LocalesContext: react.Context<LocalesContextValue>;
568
- declare function useLocalesContext(): LocalesContextValue;
569
- declare function useLocales(): string[];
570
- declare function useOtherLocales(): string[];
571
- interface LocalesProviderProps {
572
- locales?: string[];
573
- children: ReactNode;
574
- }
575
- declare function LocalesProvider({ locales, children }: LocalesProviderProps): react.JSX.Element;
576
-
577
- interface ModalData {
578
- id: string;
579
- requestClose?: (() => void) | null;
580
- withoutBackdrop?: boolean;
581
- [key: string]: unknown;
582
- }
583
- type ModalContainer = Element | DocumentFragment;
584
- interface ModalContextValue {
585
- modals: ModalData[];
586
- container: ModalContainer | null;
587
- setContainer: (container: ModalContainer | null) => void;
588
- register: (id: string, data?: Record<string, unknown> | null) => void;
589
- unregister: (id?: string | null) => void;
590
- closeModal: (id: string) => void;
591
- closeLastModal: () => void;
592
- getModalById: (modalId: string) => ModalData | null;
593
- }
594
- declare const ModalContext: react.Context<ModalContextValue>;
595
- declare function useModal(): ModalContextValue;
596
- interface ModalProviderProps {
597
- children: ReactNode;
598
- container?: ModalContainer | null;
599
- }
600
- declare function ModalProvider({ children, container: initialContainer }: ModalProviderProps): react.JSX.Element;
601
-
602
- interface PanelData {
603
- id: string;
604
- [key: string]: unknown;
605
- }
606
- interface PanelsContextValue {
607
- panels: PanelData[];
608
- container: unknown | null;
609
- setContainer: (container: unknown) => void;
610
- register: (id: string, data?: Record<string, unknown> | null) => void;
611
- unregister: (id: string) => void;
612
- }
613
- declare const PanelsContext: react.Context<PanelsContextValue>;
614
- declare function usePanels(): PanelsContextValue;
615
- declare function withPanels(WrappedComponent: ComponentType<any>): {
616
- (props: any): react.JSX.Element;
617
- displayName: string;
618
- };
619
- interface PanelsProviderProps {
620
- children: ReactNode;
621
- container?: unknown | null;
622
- }
623
- declare function PanelsProvider({ children, container: initialContainer }: PanelsProviderProps): react.JSX.Element;
624
-
625
- declare function usePanneau(): PanneauDefinition | null;
626
- declare function usePanneauResources(): Resource[];
627
- declare function usePanneauResource(id: Resource | string | null): Resource | null;
628
- declare function usePanneauColorScheme(): {
629
- theme: string;
630
- background: 'light' | 'dark' | null;
631
- text: 'light' | 'dark' | null;
632
- sidebarPosition?: string | null;
633
- };
634
- /** @deprecated The `components` key of the definition is not supported */
635
- declare function usePanneauComponents(): Record<string, unknown>;
636
- /** @deprecated The `components` key of the definition is not supported */
637
- declare function usePanneauComponent(namespace: string | null, name: string): string | null;
638
- declare function usePanneauAuth(): PanneauAuth;
639
- declare function usePanneauSettings(): Record<string, unknown>;
640
- interface PanneauProviderProps {
641
- definition: PanneauDefinition;
642
- children: ReactNode;
643
- }
644
- declare function PanneauProvider({ definition, children }: PanneauProviderProps): react.JSX.Element;
645
-
646
- declare function useResource(): Resource | null;
647
- interface ResourceProviderProps {
648
- resource: Resource;
649
- children: ReactNode;
650
- }
651
- declare function ResourceProvider({ resource, children }: ResourceProviderProps): react.JSX.Element;
652
-
653
- declare function useRoutePush(): (route: string | {
654
- pathname?: string | null;
655
- search?: string | null;
656
- }, data?: Record<string, unknown> | null, ...args: unknown[]) => void;
657
- declare function useRouteBack(): () => void;
658
-
659
- declare function useTracking(): any;
660
- interface TrackingProviderProps {
661
- children: ReactNode;
662
- variables?: TrackingVariables | null;
663
- }
664
- declare function TrackingProvider({ variables, children }: TrackingProviderProps): react.JSX.Element;
665
-
666
- export { ACTIONS_NAMESPACE, APP_NAMESPACE, BUTTONS_NAMESPACE, ComponentsContext, ComponentsProvider, DISPLAYS_NAMESPACE, DefinitionProvider, FIELDS_NAMESPACE, FILTERS_NAMESPACE, FORMS_NAMESPACE, FieldsContext, FieldsProvider, FontsContext, FontsProvider, FormProvider, FormsContext, FormsProvider, GoogleApiClientContext, GoogleApiClientProvider, GoogleKeysContext, GoogleKeysProvider, GoogleMapsClientContext, GoogleMapsClientProvider, LISTS_NAMESPACE, LocalesContext, LocalesProvider, MODALS_NAMESPACE, ModalContext, ModalProvider, PAGES_NAMESPACE, PREVIEWS_NAMESPACE, PanelsContext, PanelsProvider, PanneauProvider, ResourceProvider, TrackingProvider, useActionComponent, useActionsComponents, useActionsComponentsManager, useAppComponent, useAppComponents, useAppComponentsManager, useButtonComponent, useButtonsComponents, useButtonsComponentsManager, useComponent, useComponents, useComponentsManager, useDefinition, useDefinitionContext, useDisplayComponent, useDisplaysComponents, useDisplaysComponentsManager, useFieldComponent, useFieldDefinition, useFieldDefinitions, useFieldsComponents, useFieldsComponentsManager, useFieldsManager, useFilterComponent, useFiltersComponents, useFiltersComponentsManager, useFonts, useFormComponent, useFormContext, useFormDefinition, useFormDefinitions, useFormSetValue, useFormValue, useFormsComponents, useFormsComponentsManager, useFormsManager, useGoogleApiClient, useGoogleFonts, useGoogleKeys, useGoogleMapsClient, useListComponent, useListsComponents, useListsComponentsManager, useLocales, useLocalesContext, useModal, useModalComponent, useModalsComponents, useModalsComponentsManager, useOtherLocales, usePageComponent, usePagesComponents, usePagesComponentsManager, usePanels, usePanneau, usePanneauAuth, usePanneauColorScheme, usePanneauComponent, usePanneauComponents, usePanneauResource, usePanneauResources, usePanneauSettings, usePreviewComponent, usePreviewsComponents, usePreviewsComponentsManager, useResource, useRouteBack, useRoutePush, useTracking, withGoogleApiClient, withGoogleMapsClient, withPanels };
667
- export type { ModalContainer, ModalContextValue, ModalData };