@websolutespa/payload-plugin-bowl 0.0.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.
@@ -0,0 +1,765 @@
1
+ import { Endpoint, Config } from 'payload/config';
2
+ import { Resource } from 'i18next';
3
+ import * as payload_dist_fields_config_types from 'payload/dist/fields/config/types';
4
+ import { Field, FieldHookArgs, Tab, FieldAffectingData, HookName, FieldHook as FieldHook$1, FieldBase, UIField } from 'payload/dist/fields/config/types';
5
+ import * as payload_types from 'payload/types';
6
+ import { PayloadRequest, Block, CollectionConfig, GlobalConfig, RichTextField, RelationshipField, CheckboxField, BlockField, DateField, TextField, GroupField, Field as Field$1, UploadField, ArrayField, SelectField, FieldHook, CollectionAfterChangeHook, CollectionAfterDeleteHook, CollapsibleField, RowField, TabsField } from 'payload/types';
7
+ import * as payload_dist_admin_components_forms_FieldDescription_types from 'payload/dist/admin/components/forms/FieldDescription/types';
8
+ import * as React from 'react';
9
+ import React__default from 'react';
10
+ import { Props } from 'payload/components/views/Cell';
11
+ import { Props as Props$1 } from 'payload/components/fields/Text';
12
+ import { FieldTypes } from 'payload/dist/admin/components/forms/field-types';
13
+
14
+ type ICache<T = any> = {
15
+ timestamp: number;
16
+ data: T;
17
+ };
18
+ type InMemoryCacheOptions = {
19
+ duration?: number;
20
+ };
21
+ declare class InMemoryCache<T = any> {
22
+ duration: number;
23
+ cache: Map<string, ICache<T>>;
24
+ constructor(options?: InMemoryCacheOptions);
25
+ has(key: string): boolean;
26
+ get(key: string): T;
27
+ set(key: string, data: T): void;
28
+ }
29
+ declare function keyWithRequest(key: string, req: PayloadRequest<any>): string;
30
+
31
+ declare const collectionGet: ((slug: string) => Endpoint);
32
+
33
+ declare function getLocale(req: PayloadRequest<any>): Promise<ILocale[]>;
34
+ declare const localeGet: Endpoint;
35
+ type ILocale = {
36
+ id: string;
37
+ title?: string;
38
+ isActive?: boolean;
39
+ isDefault?: boolean;
40
+ };
41
+
42
+ declare function getRoutes(req: PayloadRequest<any>): Promise<IRoute[]>;
43
+ declare function getRoute(req: PayloadRequest<any>, id: string): Promise<IRoute>;
44
+ type IRoute = {
45
+ id: string;
46
+ market: string;
47
+ locale: string;
48
+ category: string;
49
+ page: string;
50
+ schema: string;
51
+ template?: string;
52
+ };
53
+ type IMarket = {
54
+ id: string;
55
+ title?: string;
56
+ isActive?: boolean;
57
+ isDefault?: boolean;
58
+ countries?: string[];
59
+ languages?: string[];
60
+ defaultLanguage?: string;
61
+ };
62
+ type ICategory = {
63
+ id: string;
64
+ slug?: ILocalizedString | string;
65
+ title?: ILocalizedString | string;
66
+ media?: IMedia;
67
+ schema?: string;
68
+ page?: string;
69
+ categoryId?: string;
70
+ category?: ICategory;
71
+ };
72
+ type ICategoryItem = ICategory & {
73
+ items: ICategory[];
74
+ };
75
+ type ICategorized = {
76
+ id: string;
77
+ slug?: ILocalizedString | string;
78
+ title?: ILocalizedString | string;
79
+ media?: IMedia;
80
+ category?: ICategory;
81
+ categoryId?: string;
82
+ };
83
+ type IMediaType = 'image' | 'video' | string;
84
+ type IMedia = {
85
+ src: string;
86
+ type: IMediaType;
87
+ alt?: string;
88
+ title?: string;
89
+ abstract?: string;
90
+ width?: number;
91
+ height?: number;
92
+ };
93
+ type ILocalizedString = {
94
+ [key: string]: string;
95
+ };
96
+ type IPage = {
97
+ id: string;
98
+ content: {
99
+ value: string;
100
+ relationTo: string;
101
+ };
102
+ createdAt: Date;
103
+ updatedAt: Date;
104
+ };
105
+ type IPageFull = {
106
+ id: string;
107
+ content: {
108
+ value: {
109
+ id: string;
110
+ slug: string | ILocalizedString;
111
+ category: string;
112
+ category_index?: boolean;
113
+ markets: string[];
114
+ template: string;
115
+ title: string | ILocalizedString;
116
+ _status: string;
117
+ createdAt: Date;
118
+ updatedAt: Date;
119
+ };
120
+ relationTo: string;
121
+ };
122
+ createdAt: Date;
123
+ updatedAt: Date;
124
+ };
125
+ type ICollectionItem = {
126
+ id: string;
127
+ category: string;
128
+ isDefault?: boolean;
129
+ slug: string | ILocalizedString;
130
+ markets: string[];
131
+ template: string;
132
+ title: string | ILocalizedString;
133
+ _status: string;
134
+ createdAt: Date;
135
+ updatedAt: Date;
136
+ };
137
+ declare const routeGet: Endpoint;
138
+
139
+ type IStore = {
140
+ [key: string]: any[];
141
+ };
142
+ declare function getStore(req: PayloadRequest): Promise<IStore>;
143
+ declare function getApiUrl(req: PayloadRequest): string;
144
+ declare function getSearchUrl(req: PayloadRequest, overrideQuery?: {}): string;
145
+ declare function fetchEndpoint<T>(req: PayloadRequest, endpoint: string, query?: {}): Promise<T>;
146
+ declare function fetchCollection<T = any>(req: PayloadRequest, slug: string, query?: {}): Promise<{
147
+ docs: T[];
148
+ }>;
149
+ declare function fetchGlobal<T = any>(req: PayloadRequest, slug: string, query?: {}): Promise<{
150
+ items: T[];
151
+ }>;
152
+ declare function fetchCollectionItems<T = any>(req: PayloadRequest<T>, slug: string, query?: {}): Promise<T[]>;
153
+ declare function fetchGlobalItems<T = any>(req: PayloadRequest, slug: string, query?: {}): Promise<T[]>;
154
+ declare const storeGet: Endpoint;
155
+
156
+ type WithBlockProps = (Omit<Block, 'fields'> & {
157
+ fields: BowlField[];
158
+ });
159
+ type WithBlock = WithBlockProps & {
160
+ type: 'withBlock';
161
+ };
162
+ declare const BlockDefaults: Partial<Block>;
163
+ /**
164
+ *
165
+ * @param {Block} config
166
+ * @returns {Block} Return a `Block` with inherited fields: `id`, `createdAt`, `updatedAt`.
167
+ */
168
+ declare const withBlock: (options: BowlBlock) => Block;
169
+
170
+ type WithCollectionProps = (Omit<CollectionConfig, 'fields'> & {
171
+ fields: BowlField[];
172
+ });
173
+ type WithCollection = WithCollectionProps & {
174
+ type: 'withCollection';
175
+ };
176
+ declare const CollectionDefault: Partial<CollectionConfig>;
177
+ /**
178
+ *
179
+ * @param {CollectionConfig} config
180
+ * @returns {CollectionConfig} Return a `CollectionConfig` with inherited fields: `id`, `createdAt`, `updatedAt`.
181
+ */
182
+ declare const withCollection: (config: WithCollectionProps) => CollectionConfig;
183
+
184
+ type WithGlobalProps = (Omit<GlobalConfig, 'fields'> & {
185
+ fields: BowlField[];
186
+ });
187
+ type WithGlobal = WithGlobalProps & {
188
+ type: 'withGlobal';
189
+ fields: BowlField[];
190
+ };
191
+ declare const GlobalDefault: Partial<GlobalConfig>;
192
+ /**
193
+ *
194
+ * @param {GlobalConfig} config
195
+ * @returns {GlobalConfig} Return a `GlobalConfig` with inherited fields: `id`, `createdAt`, `updatedAt`.
196
+ */
197
+ declare const withGlobal: (config: WithGlobalProps) => GlobalConfig;
198
+
199
+ type WithPageProps = (Omit<CollectionConfig, 'fields'> & {
200
+ fields: BowlField[];
201
+ });
202
+ type WithPage = WithPageProps & {
203
+ type: 'withPage';
204
+ };
205
+ declare const PageDefault: Partial<CollectionConfig>;
206
+ /**
207
+ *
208
+ * @param {CollectionConfig} config
209
+ * @returns {CollectionConfig} Return a `CollectionConfig` with inherited fields: `id`, `title`, `slug`, `category`, `markets`, `template`, `meta`, `status`, `createdAt`, `updatedAt`.
210
+ */
211
+ declare const withPage: (config: CollectionConfig) => CollectionConfig;
212
+
213
+ type WithStaticProps = (Omit<CollectionConfig, 'fields'> & StaticCollectionConfig & {
214
+ fields: BowlField[];
215
+ });
216
+ type WithStatic = WithStaticProps & {
217
+ type: 'withStatic';
218
+ };
219
+ type IEntity = {
220
+ id: string | number;
221
+ };
222
+ type Option = {
223
+ id: string;
224
+ name: string;
225
+ [key: string]: unknown;
226
+ };
227
+ type KeyMapper = {
228
+ [key: string]: string;
229
+ };
230
+ type StaticCollectionSrc = string | Option[] | ((config: CollectionConfig) => Option[]) | ((config: CollectionConfig) => Promise<Option[]>);
231
+ type StaticCollectionConfig = {
232
+ src: StaticCollectionSrc;
233
+ map?: KeyMapper;
234
+ };
235
+ declare function getObjectParam(value: unknown): {} | undefined;
236
+ declare function getNumericParam(value: unknown): number | undefined;
237
+ declare function getStringParam(value: unknown): string | undefined;
238
+ declare function whereCollection<T = IEntity>(items: T[], where?: {
239
+ [key: string]: any;
240
+ }): Promise<T[]>;
241
+ declare function populateStaticFields<T = IEntity>(item: T, fields: Field[], locale?: string): Promise<T>;
242
+ declare function localizeCollection<T = IEntity>(items: T[], localizedFields: string[], locale?: string): Promise<T[]>;
243
+ declare function getStaticLoader(slug: string): any;
244
+ declare const StaticCollectionDefault: Partial<CollectionConfig>;
245
+ /**
246
+ * @param {CollectionConfig & StaticCollectionConfig} config
247
+ * @returns {CollectionConfig} Return a `CollectionConfig` from static or remote dataset.
248
+ */
249
+ declare const withStaticCollection: ({ src, map, ...config }: WithStaticProps) => CollectionConfig;
250
+
251
+ type WithAbstractProps = (Omit<RichTextField, 'type' | 'name'> & {
252
+ name?: string;
253
+ });
254
+ type WithAbstract = WithAbstractProps & {
255
+ type: 'withAbstract';
256
+ };
257
+ declare const withAbstract: (options?: WithAbstractProps) => RichTextField;
258
+ declare const withAbstractRequired: (options?: WithAbstractProps) => RichTextField;
259
+
260
+ type WithCategoryProps = (Omit<RelationshipField, 'type' | 'name' | 'relationTo'> & {
261
+ name?: string;
262
+ });
263
+ type WithCategory = WithCategoryProps & {
264
+ type: 'withCategory';
265
+ };
266
+ declare const CategoryDefaults: RelationshipField;
267
+ declare const withCategory: (options?: WithCategoryProps) => RelationshipField;
268
+ declare const withCategoryRequired: (options?: WithCategoryProps) => RelationshipField;
269
+
270
+ type WithCheckboxProps = (Omit<CheckboxField, 'type' | 'name'> & {
271
+ name?: string;
272
+ });
273
+ type WithCheckbox = WithCheckboxProps & {
274
+ type: 'withCheckbox';
275
+ };
276
+ declare const CheckboxDefaults: CheckboxField;
277
+ declare const withCheckbox: (options?: WithCheckboxProps) => CheckboxField;
278
+ declare const withCheckboxRequired: (options?: WithCheckboxProps) => CheckboxField;
279
+
280
+ type WithComponentsProps = Omit<Partial<BlockField>, 'type' | 'name' | 'blocks'> & {
281
+ name?: string;
282
+ blocks: BowlBlock[];
283
+ };
284
+ type WithComponents = WithComponentsProps & {
285
+ type: 'withComponents';
286
+ };
287
+ declare const ComponentsDefaults: BlockField;
288
+ declare const withComponents: (options: WithComponentsProps) => BlockField;
289
+
290
+ type WithDateProps = (Omit<DateField, 'type' | 'name'> & {
291
+ name?: string;
292
+ });
293
+ type WithDate = WithDateProps & {
294
+ type: 'withDate';
295
+ };
296
+ declare const DateDefaults: DateField;
297
+ declare const withDate: (options?: WithDateProps) => DateField;
298
+ declare const withDateRequired: (options?: WithDateProps) => DateField;
299
+
300
+ type WithDescriptionProps = (Omit<RichTextField, 'type' | 'name'> & {
301
+ name?: string;
302
+ });
303
+ type WithDescription = WithDescriptionProps & {
304
+ type: 'withDescription';
305
+ };
306
+ declare const withDescription: (options?: WithDescriptionProps) => RichTextField;
307
+ declare const withDescriptionRequired: (options?: WithDescriptionProps) => RichTextField;
308
+
309
+ type WithIdProps = (Omit<TextField, 'type' | 'name'> & {
310
+ name?: string;
311
+ });
312
+ type WithId = WithIdProps & {
313
+ type: 'withId';
314
+ };
315
+ declare const withId: (options?: WithIdProps) => TextField;
316
+ declare const withIdRequired: (options?: WithIdProps) => TextField;
317
+
318
+ type WithIsActiveProps = (Omit<CheckboxField, 'type' | 'name'> & {
319
+ name?: string;
320
+ });
321
+ type WithIsActive = WithIsActiveProps & {
322
+ type: 'withIsActive';
323
+ };
324
+ declare const withIsActive: (options?: WithIsActiveProps) => CheckboxField;
325
+ declare const withIsActiveRequired: (options?: WithIsActiveProps) => CheckboxField;
326
+
327
+ type WithIsDefaultProps = (Omit<CheckboxField, 'type' | 'name'> & {
328
+ name?: string;
329
+ });
330
+ type WithIsDefault = WithIsDefaultProps & {
331
+ type: 'withIsDefault';
332
+ };
333
+ declare const withIsDefault: (options?: WithIsDefaultProps) => CheckboxField;
334
+ declare const withIsDefaultRequired: (options?: WithIsDefaultProps) => CheckboxField;
335
+
336
+ type WithLinkOptions = {
337
+ appearances?: string[] | false;
338
+ disableLabel?: boolean;
339
+ };
340
+ type WithLinkProps = Omit<GroupField, 'type' | 'name' | 'fields'> & WithLinkOptions;
341
+ type WithLink = WithLinkProps & {
342
+ type: 'withLink';
343
+ };
344
+ declare const appearanceOptions: {
345
+ text: {
346
+ label: string;
347
+ value: string;
348
+ };
349
+ primaryButton: {
350
+ label: string;
351
+ value: string;
352
+ };
353
+ secondaryButton: {
354
+ label: string;
355
+ value: string;
356
+ };
357
+ };
358
+ declare const withLink: ({ appearances, disableLabel, ...props }?: WithLinkProps) => payload_dist_fields_config_types.FieldBase & {
359
+ type: "group";
360
+ fields: Field$1[];
361
+ admin?: {
362
+ position?: "sidebar";
363
+ width?: string;
364
+ style?: React.CSSProperties;
365
+ className?: string;
366
+ readOnly?: boolean;
367
+ disabled?: boolean;
368
+ condition?: payload_dist_fields_config_types.Condition<any, any>;
369
+ description?: payload_dist_admin_components_forms_FieldDescription_types.Description;
370
+ components?: {
371
+ Filter?: React.ComponentType<any>;
372
+ Cell?: React.ComponentType<any>;
373
+ Field?: React.ComponentType<any>;
374
+ };
375
+ hidden?: boolean;
376
+ } & {
377
+ hideGutter?: boolean;
378
+ };
379
+ };
380
+
381
+ type WithMarketsProps = (Omit<RelationshipField, 'type' | 'name' | 'relationTo'> & {
382
+ name?: string;
383
+ });
384
+ type WithMarkets = WithMarketsProps & {
385
+ type: 'withMarkets';
386
+ };
387
+ declare const MarketDefaults: RelationshipField;
388
+ declare const withMarkets: (options?: WithMarketsProps) => RelationshipField;
389
+ declare const withMarketsRequired: (options?: WithMarketsProps) => RelationshipField;
390
+
391
+ type WithMediaProps = (Omit<UploadField, 'type' | 'name' | 'relationTo'> & {
392
+ name?: string;
393
+ });
394
+ type WithMedia = WithMediaProps & {
395
+ type: 'withMedia';
396
+ };
397
+ declare const MediaDefaults: UploadField;
398
+ declare const withMedia: (options?: WithMediaProps) => UploadField;
399
+ declare const withMediaRequired: (options?: WithMediaProps) => UploadField;
400
+
401
+ type WithMediasProps = (Omit<ArrayField, 'type' | 'name' | 'fields'> & {
402
+ name?: string;
403
+ });
404
+ type WithMedias = WithMediasProps & {
405
+ type: 'withMedias';
406
+ };
407
+ declare const MediasDefaults: ArrayField;
408
+ declare const withMedias: (options?: WithMediasProps) => ArrayField;
409
+ declare const withMediasRequired: (options?: WithMediasProps) => ArrayField;
410
+
411
+ type WithNameProps = (Omit<TextField, 'type' | 'name'> & {
412
+ name?: string;
413
+ });
414
+ type WithName = WithNameProps & {
415
+ type: 'withName';
416
+ };
417
+ declare const withName: (options?: WithNameProps) => TextField;
418
+ declare const withNameRequired: (options?: WithNameProps) => TextField;
419
+
420
+ type WithRelatedProps = Omit<Partial<BlockField>, 'type' | 'name' | 'blocks'> & {
421
+ name?: string;
422
+ blocks: BowlBlock[];
423
+ };
424
+ type WithRelated = WithRelatedProps & {
425
+ type: 'withRelated';
426
+ };
427
+ declare const RelatedDefaults: BlockField;
428
+ declare const withRelated: (options: WithRelatedProps) => BlockField;
429
+
430
+ type WithRichTextProps = (Omit<RichTextField, 'type' | 'name'> & {
431
+ name?: string;
432
+ });
433
+ type WithRichText = WithRichTextProps & {
434
+ type: 'withRichText';
435
+ };
436
+ declare const richTextAfterReadHook: (args: FieldHookArgs<any, any[], any>) => string | any[];
437
+ declare const RichTextDefaults: RichTextField;
438
+ declare const withRichText: (options?: Partial<RichTextField>) => RichTextField;
439
+ declare const withRichTextRequired: (options?: Partial<RichTextField>) => RichTextField;
440
+ declare function richTextSerialize(children?: any[]): string;
441
+
442
+ type WithSelectProps = (Omit<SelectField, 'type' | 'name'> & {
443
+ name?: string;
444
+ });
445
+ type WithSelect = WithSelectProps & {
446
+ type: 'withSelect';
447
+ };
448
+ declare const SelectDefaults: SelectField;
449
+ declare const withSelect: (options?: Partial<SelectField>) => SelectField;
450
+ declare const withSelectRequired: (options?: Partial<SelectField>) => SelectField;
451
+
452
+ type WithSlugProps = (Omit<TextField, 'type' | 'name'> & {
453
+ fieldToUse: string;
454
+ });
455
+ type WithSlug = WithSlugProps & {
456
+ type: 'withSlug';
457
+ };
458
+ declare const withSlug: ({ fieldToUse, ...options }?: WithSlugProps) => TextField;
459
+ declare const withSlugRequired: ({ fieldToUse, ...options }?: WithSlugProps) => TextField;
460
+
461
+ type WithTemplateProps = (Omit<RelationshipField, 'type' | 'name' | 'relationTo'> & {
462
+ slugToUse: string;
463
+ });
464
+ type WithTemplate = WithTemplateProps & {
465
+ type: 'withTemplate';
466
+ };
467
+ declare const TemplateDefaults: RelationshipField;
468
+ declare const withTemplate: ({ slugToUse, ...options }: WithTemplateProps) => RelationshipField;
469
+ declare const withTemplateRequired: ({ slugToUse, ...options }: WithTemplateProps) => RelationshipField;
470
+
471
+ type WithTextProps = (Omit<TextField, 'type' | 'name'> & {
472
+ name?: string;
473
+ });
474
+ type WithText = WithTextProps & {
475
+ type: 'withText';
476
+ };
477
+ declare const TextDefaults: TextField;
478
+ declare const withText: (options?: WithTextProps) => TextField;
479
+ declare const withTextRequired: (options?: WithTextProps) => TextField;
480
+
481
+ type WithTitleProps = (Omit<TextField, 'type' | 'name'> & {
482
+ name?: string;
483
+ });
484
+ type WithTitle = WithTitleProps & {
485
+ type: 'withTitle';
486
+ };
487
+ declare const withTitle: (options?: WithTitleProps) => TextField;
488
+ declare const withTitleRequired: (options?: WithTitleProps) => TextField;
489
+
490
+ declare const defaultSlug: BowlSlug;
491
+ declare const defaultGroup: BowlGroup;
492
+ declare const defaultLocales: string[];
493
+ declare const defaultLocale = "en";
494
+ declare const options: BowlOptions;
495
+ declare const internalSlugs: string[];
496
+
497
+ type Locale = typeof options.locales[number];
498
+ type LocalizedText = {
499
+ [key in Locale]?: string;
500
+ };
501
+ declare function getTranslation(path: string, defaultText: string | undefined, locale: Locale, node?: {
502
+ [key: string]: any;
503
+ }, fullPath?: string): string;
504
+ declare function getTranslations(path: string, defaultText?: string): LocalizedText;
505
+ declare function slugToLabels(slug: string): {
506
+ singular: LocalizedText;
507
+ plural: LocalizedText;
508
+ };
509
+ declare function slugToLabel(slug: string): LocalizedText;
510
+ declare function translateTab(tab: Tab): Tab;
511
+ declare function translateTabs(tabs: Tab[]): Tab[];
512
+ declare function translateBlock(block: Block): Block;
513
+ declare function translateBlocks(blocks: Block[]): Block[];
514
+ declare function translateField(field: Field$1): payload_types.UIField | payload_types.TextField | payload_types.NumberField | payload_types.EmailField | payload_types.TextareaField | payload_types.CheckboxField | payload_types.DateField | BlockField | payload_types.GroupField | payload_types.RadioField | payload_types.RelationshipField | payload_types.ArrayField | payload_types.RichTextField | payload_types.SelectField | payload_types.UploadField | payload_types.CodeField | payload_types.PointField | payload_types.RowField | payload_types.CollapsibleField | payload_types.TabsField;
515
+ declare function translateFields(fields: Field$1[]): Field$1[];
516
+ declare function translateCollection(config: CollectionConfig): CollectionConfig;
517
+ declare function translateGlobal(config: GlobalConfig): GlobalConfig;
518
+ declare function logMissingTranslations(): void;
519
+
520
+ /**
521
+ * Simple object check.
522
+ * @param item
523
+ * @returns {boolean}
524
+ */
525
+ declare function isObject(item: unknown): boolean;
526
+ /**
527
+ * Deep merge two objects.
528
+ * @param target
529
+ * @param ...sources
530
+ */
531
+ declare function deepMerge<T, R = T>(target: Partial<T>, source: Partial<R>): T & R;
532
+
533
+ declare const formatSlug: (fallback: string) => FieldHook;
534
+
535
+ declare function withCollectionHook(config: CollectionConfig, name: string, hook: (...args: any[]) => unknown | Promise<unknown>): CollectionConfig;
536
+ declare function withGlobalHook(config: GlobalConfig, name: string, hook: (...args: any[]) => unknown | Promise<unknown>): GlobalConfig;
537
+ declare function withFieldHook(field: FieldAffectingData, name: HookName, hook: FieldHook$1): FieldAffectingData;
538
+
539
+ /**
540
+ * Create a record of the pages collection related to the created document.
541
+ */
542
+ declare const afterPageChangeHook: CollectionAfterChangeHook;
543
+ /**
544
+ * Delete records of the pages collection related to the deleted document.
545
+ */
546
+ declare const afterPageDeleteHook: CollectionAfterDeleteHook;
547
+
548
+ type WithColorProps = (Omit<TextField, 'type' | 'name'> & {
549
+ name?: string;
550
+ });
551
+ type WithColor = WithColorProps & {
552
+ type: 'withColor';
553
+ };
554
+ declare const validateHexColor: (value?: string) => true | string;
555
+ declare const ColorConfig: TextField;
556
+ declare const withColor: (options?: WithColorProps) => TextField;
557
+ declare const withColorRequired: (options?: WithColorProps) => TextField;
558
+
559
+ declare const ColorCell: React__default.FC<Props>;
560
+
561
+ declare const ColorField: React__default.FC<Props$1>;
562
+
563
+ type FieldPermissions$3 = {
564
+ create: {
565
+ permission: boolean;
566
+ };
567
+ read: {
568
+ permission: boolean;
569
+ };
570
+ update: {
571
+ permission: boolean;
572
+ };
573
+ fields?: {
574
+ [field: string]: FieldPermissions$3;
575
+ };
576
+ };
577
+ type DebugFieldType = FieldBase & {
578
+ type: keyof FieldTypes;
579
+ };
580
+ type DebugFieldProps = DebugFieldType & {
581
+ path?: string;
582
+ fieldTypes: FieldTypes;
583
+ permissions: FieldPermissions$3;
584
+ detectLoop?: boolean;
585
+ };
586
+
587
+ declare const debugField: (options?: Partial<DebugFieldType>) => DebugFieldType;
588
+
589
+ declare const DebugField: React__default.FC<DebugFieldProps>;
590
+
591
+ type FieldPermissions$2 = {
592
+ create: {
593
+ permission: boolean;
594
+ };
595
+ read: {
596
+ permission: boolean;
597
+ };
598
+ update: {
599
+ permission: boolean;
600
+ };
601
+ fields?: {
602
+ [field: string]: FieldPermissions$2;
603
+ };
604
+ };
605
+ type LocalizedFieldType = FieldBase & {
606
+ type: keyof FieldTypes;
607
+ };
608
+ type LocalizedFieldProps = LocalizedFieldType & {
609
+ path?: string;
610
+ fieldTypes: FieldTypes;
611
+ permissions: FieldPermissions$2;
612
+ };
613
+
614
+ declare const localizedField: (options: FieldAffectingData) => LocalizedFieldType;
615
+ type FieldsConfig = {
616
+ fields: Field[];
617
+ };
618
+ declare const withLocalized: <T extends Partial<FieldsConfig> = {}>(config: T, first?: boolean) => T;
619
+
620
+ declare const LocalizedField: React__default.FC<LocalizedFieldProps>;
621
+
622
+ type FieldPermissions$1 = {
623
+ create: {
624
+ permission: boolean;
625
+ };
626
+ read: {
627
+ permission: boolean;
628
+ };
629
+ update: {
630
+ permission: boolean;
631
+ };
632
+ fields?: {
633
+ [field: string]: FieldPermissions$1;
634
+ };
635
+ };
636
+ type ILanguages = FieldBase & {
637
+ type: keyof FieldTypes;
638
+ };
639
+ type LanguagesProps = ILanguages & {
640
+ path?: string;
641
+ fieldTypes: FieldTypes;
642
+ permissions: FieldPermissions$1;
643
+ };
644
+ type LanguagesField = UIField & {};
645
+
646
+ declare const withUILanguages: (options?: Partial<UIField>) => LanguagesField;
647
+
648
+ declare const UILanguagesCell: React__default.FC<Props>;
649
+
650
+ declare const UILanguagesField: React__default.FC<LanguagesProps>;
651
+
652
+ type FieldPermissions = {
653
+ create: {
654
+ permission: boolean;
655
+ };
656
+ read: {
657
+ permission: boolean;
658
+ };
659
+ update: {
660
+ permission: boolean;
661
+ };
662
+ fields?: {
663
+ [field: string]: FieldPermissions;
664
+ };
665
+ };
666
+ type IStatic = FieldBase & {
667
+ type: keyof FieldTypes;
668
+ };
669
+ type StaticProps = IStatic & {
670
+ path?: string;
671
+ fieldTypes: FieldTypes;
672
+ permissions: FieldPermissions;
673
+ };
674
+ type StaticField = UIField & {};
675
+
676
+ declare const withUIStatic: (options?: Partial<UIField>) => StaticField;
677
+
678
+ declare const UIStaticCell: React__default.FC<Props>;
679
+
680
+ declare const UIStaticField: React__default.FC<StaticProps>;
681
+
682
+ type BowlTab = Omit<Tab, 'fields'> & {
683
+ fields: BowlField[];
684
+ };
685
+ type BowlArrayField = Omit<ArrayField, 'fields'> & {
686
+ fields: BowlField[];
687
+ };
688
+ type BowlBlockField = Omit<BlockField, 'blocks'> & {
689
+ blocks: BowlBlock[];
690
+ };
691
+ type BowlCollapsibleField = Omit<CollapsibleField, 'fields'> & {
692
+ fields: BowlField[];
693
+ };
694
+ type BowlGroupField = Omit<GroupField, 'fields'> & {
695
+ fields: BowlField[];
696
+ };
697
+ type BowlRowField = Omit<RowField, 'fields'> & {
698
+ fields: BowlField[];
699
+ };
700
+ type BowlTabsField = Omit<TabsField, 'tabs'> & {
701
+ tabs: BowlTab[];
702
+ };
703
+ type BowlField = Field$1 | BowlArrayField | BowlBlockField | BowlCollapsibleField | BowlGroupField | BowlRowField | BowlTabsField | WithAbstract | WithCategory | WithCheckbox | WithColor | WithComponents | WithDate | WithDescription | WithId | WithIsActive | WithIsDefault | WithLink | WithMarkets | WithMedia | WithMedias | WithName | WithRelated | WithRichText | WithSelect | WithSlug | WithTemplate | WithText | WithTitle;
704
+ type BowlBlock = Block | WithBlock;
705
+ type BowlCollection = WithCollection | WithPage | WithStatic | CollectionConfig & {
706
+ type?: string;
707
+ };
708
+ type BowlGlobal = WithGlobal | GlobalConfig & {
709
+ type?: string;
710
+ };
711
+ type CollectionHelper = (options: BowlOptions) => BowlCollection;
712
+ type GlobalHelper = (options: BowlOptions) => BowlGlobal;
713
+ type BowlConfig = (Omit<Config, 'collections' | 'globals'> & {
714
+ collections?: BowlCollection[];
715
+ globals?: BowlGlobal[];
716
+ });
717
+ type BowlSlug = {
718
+ category: string;
719
+ label: string;
720
+ locale: string;
721
+ market: string;
722
+ media: string;
723
+ page: string;
724
+ template: string;
725
+ continent: string;
726
+ country: string;
727
+ countryZone: string;
728
+ language: string;
729
+ municipality: string;
730
+ province: string;
731
+ region: string;
732
+ subContinent: string;
733
+ [key: string]: string;
734
+ };
735
+ type BowlGroup = {
736
+ content: string;
737
+ nav: string;
738
+ config: string;
739
+ i18n: string;
740
+ admin: string;
741
+ [key: string]: string;
742
+ };
743
+ type BowlOptions = {
744
+ collections: string[];
745
+ pages: string[];
746
+ slug: BowlSlug;
747
+ group: BowlGroup;
748
+ locales: string[];
749
+ defaultLocale: string;
750
+ translations: Resource;
751
+ };
752
+ type BowlInitOptions = {
753
+ slug?: Partial<BowlSlug>;
754
+ group?: Partial<BowlGroup>;
755
+ };
756
+
757
+ declare const bowl: (sourceOptions?: BowlInitOptions) => (sourceConfig: BowlConfig) => Config;
758
+
759
+ declare function toCollection(collection: BowlCollection): CollectionConfig;
760
+ declare function toGlobal(collection: BowlGlobal): GlobalConfig;
761
+ declare function toField(item: BowlField): Field$1;
762
+ declare function toBlock(item: BowlBlock): Block;
763
+ declare function toTab(item: BowlTab): Tab;
764
+
765
+ export { BlockDefaults, BowlArrayField, BowlBlock, BowlBlockField, BowlCollapsibleField, BowlCollection, BowlConfig, BowlField, BowlGlobal, BowlGroup, BowlGroupField, BowlInitOptions, BowlOptions, BowlRowField, BowlSlug, BowlTab, BowlTabsField, CategoryDefaults, CheckboxDefaults, CollectionDefault, CollectionHelper, ColorCell, ColorConfig, ColorField, ComponentsDefaults, DateDefaults, DebugField, FieldsConfig, GlobalDefault, GlobalHelper, ICache, ICategorized, ICategory, ICategoryItem, ICollectionItem, IEntity, ILocale, ILocalizedString, IMarket, IMedia, IMediaType, IPage, IPageFull, IRoute, IStore, InMemoryCache, InMemoryCacheOptions, LocalizedField, MarketDefaults, MediaDefaults, MediasDefaults, Option, PageDefault, RelatedDefaults, RichTextDefaults, SelectDefaults, StaticCollectionConfig, StaticCollectionDefault, TemplateDefaults, TextDefaults, UILanguagesCell, UILanguagesField, UIStaticCell, UIStaticField, WithAbstract, WithAbstractProps, WithBlock, WithBlockProps, WithCategory, WithCategoryProps, WithCheckbox, WithCheckboxProps, WithCollection, WithCollectionProps, WithColor, WithColorProps, WithComponents, WithComponentsProps, WithDate, WithDateProps, WithDescription, WithDescriptionProps, WithGlobal, WithGlobalProps, WithId, WithIdProps, WithIsActive, WithIsActiveProps, WithIsDefault, WithIsDefaultProps, WithLink, WithLinkOptions, WithLinkProps, WithMarkets, WithMarketsProps, WithMedia, WithMediaProps, WithMedias, WithMediasProps, WithName, WithNameProps, WithPage, WithPageProps, WithRelated, WithRelatedProps, WithRichText, WithRichTextProps, WithSelect, WithSelectProps, WithSlug, WithSlugProps, WithStatic, WithStaticProps, WithTemplate, WithTemplateProps, WithText, WithTextProps, WithTitle, WithTitleProps, afterPageChangeHook, afterPageDeleteHook, appearanceOptions, bowl, collectionGet, debugField, deepMerge, bowl as default, defaultGroup, defaultLocale, defaultLocales, defaultSlug, fetchCollection, fetchCollectionItems, fetchEndpoint, fetchGlobal, fetchGlobalItems, formatSlug, getApiUrl, getLocale, getNumericParam, getObjectParam, getRoute, getRoutes, getSearchUrl, getStaticLoader, getStore, getStringParam, getTranslation, getTranslations, internalSlugs, isObject, keyWithRequest, localeGet, localizeCollection, localizedField, logMissingTranslations, options, populateStaticFields, richTextAfterReadHook, richTextSerialize, routeGet, slugToLabel, slugToLabels, storeGet, toBlock, toCollection, toField, toGlobal, toTab, translateBlock, translateBlocks, translateCollection, translateField, translateFields, translateGlobal, translateTab, translateTabs, validateHexColor, whereCollection, withAbstract, withAbstractRequired, withBlock, withCategory, withCategoryRequired, withCheckbox, withCheckboxRequired, withCollection, withCollectionHook, withColor, withColorRequired, withComponents, withDate, withDateRequired, withDescription, withDescriptionRequired, withFieldHook, withGlobal, withGlobalHook, withId, withIdRequired, withIsActive, withIsActiveRequired, withIsDefault, withIsDefaultRequired, withLink, withLocalized, withMarkets, withMarketsRequired, withMedia, withMediaRequired, withMedias, withMediasRequired, withName, withNameRequired, withPage, withRelated, withRichText, withRichTextRequired, withSelect, withSelectRequired, withSlug, withSlugRequired, withStaticCollection, withTemplate, withTemplateRequired, withText, withTextRequired, withTitle, withTitleRequired, withUILanguages, withUIStatic };