@griddo/core 10.7.9 → 11.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/svg/Delete.d.ts +2 -2
- package/dist/assets/svg/Duplicate.d.ts +2 -2
- package/dist/autotypes.js +1 -1
- package/dist/autotypes.js.map +1 -1
- package/dist/components/CloudinaryBackgroundImage/index.d.ts +0 -2
- package/dist/components/CloudinaryImage/index.d.ts +5 -5
- package/dist/components/Component/ComponentWrapper/index.d.ts +1 -1
- package/dist/components/Component/index.d.ts +0 -2
- package/dist/components/GriddoBackgroundImage/index.d.ts +3 -2
- package/dist/components/GriddoImage/index.d.ts +1 -3
- package/dist/components/GriddoImageExp/types.d.ts +9 -8
- package/dist/components/GriddoImageExp/utils.d.ts +3 -3
- package/dist/components/GriddoLink/index.d.ts +8 -10
- package/dist/components/GriddoLink/utils.d.ts +6 -5
- package/dist/components/LdJson/index.d.ts +0 -2
- package/dist/components/Link/index.d.ts +1 -3
- package/dist/components/ModulePreview/index.d.ts +5 -5
- package/dist/components/Page/index.d.ts +6 -6
- package/dist/components/Preview/index.d.ts +3 -3
- package/dist/contexts/I18n/index.d.ts +1 -3
- package/dist/contexts/Navigation/index.d.ts +3 -3
- package/dist/contexts/Page/index.d.ts +1 -1
- package/dist/contexts/Session/index.d.ts +2 -2
- package/dist/contexts/Site/index.d.ts +6 -6
- package/dist/functions/autotypes/ascii.d.ts +3 -2
- package/dist/functions/autotypes/getTypeFromField.d.ts +3 -2
- package/dist/functions/autotypes/main.d.ts +2 -2
- package/dist/functions/autotypes/types.d.ts +9 -8
- package/dist/functions/image-utils.d.ts +5 -5
- package/dist/functions/index.d.ts +4 -4
- package/dist/functions/utils.d.ts +6 -6
- package/dist/hooks/__mocks__/page-provider-props.d.ts +1 -1
- package/dist/hooks/__mocks__/site-provider-props.d.ts +1 -1
- package/dist/hooks/themes/useGlobalTheme.d.ts +1 -1
- package/dist/hooks/themes/useTheme.d.ts +2 -2
- package/dist/hooks/themes/useThemeColors.d.ts +2 -2
- package/dist/hooks/themes/useThemeFont.d.ts +2 -2
- package/dist/hooks/themes/useThemePrimitives.d.ts +2 -2
- package/dist/hooks/themes/utils.d.ts +1 -1
- package/dist/hooks/useContentType.d.ts +1 -1
- package/dist/hooks/useContentTypeNavigation.d.ts +1 -1
- package/dist/hooks/useDataFilters.d.ts +2 -2
- package/dist/hooks/useGriddoImage.d.ts +1 -1
- package/dist/hooks/useGriddoImageExp.d.ts +1 -1
- package/dist/hooks/useI18n.d.ts +1 -1
- package/dist/hooks/useImage.d.ts +1 -1
- package/dist/hooks/useList.d.ts +4 -4
- package/dist/hooks/useListWithDefaultStaticPage.d.ts +3 -3
- package/dist/hooks/useLocaleDate.d.ts +1 -1
- package/dist/hooks/usePage.d.ts +1 -1
- package/dist/hooks/useReferenceFieldData.d.ts +1 -1
- package/dist/hooks/useSite.d.ts +1 -1
- package/dist/hooks/utils.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/node/index.js +4 -4
- package/dist/types/api-response-fields/index.d.ts +57 -57
- package/dist/types/core/index.d.ts +37 -37
- package/dist/types/global.d.ts +25 -15
- package/dist/types/schema-fields/base.d.ts +4 -4
- package/dist/types/schema-fields/page-content-type-fields.d.ts +37 -37
- package/dist/types/schema-fields/props.d.ts +37 -36
- package/dist/types/schema-fields/simple-content-type-fields.d.ts +3 -3
- package/dist/types/schema-fields/ui-fields.d.ts +2 -2
- package/dist/types/schema-fields/ui-template-fields.d.ts +3 -3
- package/dist/types/schemas/AutoTypes.d.ts +2 -1
- package/dist/types/schemas/Categories.d.ts +4 -3
- package/dist/types/schemas/ContentType.d.ts +4 -4
- package/dist/types/schemas/DamDefaults.d.ts +3 -2
- package/dist/types/schemas/DataPack.d.ts +3 -2
- package/dist/types/schemas/HeaderFooter.d.ts +5 -5
- package/dist/types/schemas/Languages.d.ts +3 -3
- package/dist/types/schemas/Menu.d.ts +5 -5
- package/dist/types/schemas/ModuleCategories.d.ts +3 -2
- package/dist/types/schemas/PageContentType.d.ts +6 -6
- package/dist/types/schemas/RichTextConfig.d.ts +2 -1
- package/dist/types/schemas/SimpleContentType.d.ts +6 -6
- package/dist/types/schemas/Themes.d.ts +4 -4
- package/dist/types/schemas/Translations.d.ts +3 -2
- package/dist/types/schemas/UI.d.ts +27 -19
- package/dist/types/schemas/base.d.ts +3 -3
- package/dist/types/schemas/index.d.ts +14 -14
- package/dist/types/schemas/props.d.ts +4 -4
- package/dist/types/theme/index.d.ts +10 -10
- package/dist/types/utilities.d.ts +7 -6
- package/package.json +32 -15
package/dist/node/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var v=Object.create;var m=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty;var k=(e,r)=>{for(var t in r)m(e,t,{get:r[t],enumerable:!0})},p=(e,r,t,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of A(r))!j.call(e,i)&&i!==t&&m(e,i,{get:()=>r[i],enumerable:!(s=b(r,i))||s.enumerable});return e};var w=(e,r,t)=>(t=e!=null?v(C(e)):{},p(r||!e||!e.__esModule?m(t,"default",{value:e,enumerable:!0}):t,e)),x=e=>p(m({},"__esModule",{value:!0}),e);var D={};k(D,{createThemes:()=>g});module.exports=x(D);var n=w(require("node:fs"));function u(e){return`/*
|
|
2
2
|
---------------------------------------------------
|
|
3
3
|
This file was generated by the Griddo theme parser.
|
|
4
4
|
Do not edit this file directly.
|
|
@@ -7,9 +7,9 @@ Do not edit this file directly.
|
|
|
7
7
|
Theme: ${e}
|
|
8
8
|
|
|
9
9
|
*/
|
|
10
|
-
`}function c(e){return e
|
|
10
|
+
`}function c(e){return e?.map(({name:r,values:t})=>`
|
|
11
11
|
/* ${r} */
|
|
12
|
-
${t.map(({cssVar:s,value:i})=>`${s}: ${i};`).join("")}`).join("")}function
|
|
12
|
+
${t.map(({cssVar:s,value:i})=>`${s}: ${i};`).join("")}`).join("")}function d(e){return Object.keys(e).map(r=>`@custom-media ${r} ${e[r]};`).join("")}function $(e){if(Array.isArray(e))return c(e);if(!Array.isArray(e)){let{common:r,light:t,dark:s}=e,i=r&&c(r),a=c(t),o=c(s);return`
|
|
13
13
|
${i?`/* Common */ ${i}`:""}
|
|
14
14
|
|
|
15
15
|
/* \u{1F315} Light color scheme */
|
|
@@ -23,7 +23,7 @@ Theme: ${e}
|
|
|
23
23
|
}`}return[]}function f(e,r){return`${r?`${r}${e.selector}, ${r}`:""} ${e.selector} {
|
|
24
24
|
${$(e.primitives)}
|
|
25
25
|
}`}function T(e){return`${e.selector} { ${$(e.primitives)} }`}function g(e,r){let t=e.global,s=e.themes,{outputDir:i}=r;if(!e||!r.outputDir)throw new Error("Set input theme and options");n.default.existsSync(i)||n.default.mkdirSync(i);let a=`${u(t.name)}
|
|
26
|
-
${t.customMedia?
|
|
26
|
+
${t.customMedia?d(t.customMedia):""}
|
|
27
27
|
|
|
28
28
|
${T(t)}
|
|
29
29
|
`;n.default.writeFileSync(`${i}/${t.id}.css`,a);for(let o of s){let h=[],S=`${u(o.name)}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { ImagePosition } from "../core";
|
|
2
|
-
import { FilterItemFromFilterEndPoint, HTMLHeadingTag } from "../global";
|
|
3
|
-
|
|
1
|
+
import type { ImagePosition } from "../core";
|
|
2
|
+
import type { FilterItemFromFilterEndPoint, HTMLHeadingTag } from "../global";
|
|
3
|
+
type ContentTypeName<T> = T extends {
|
|
4
4
|
__contentTypeName: string;
|
|
5
5
|
} ? T["__contentTypeName"] : T;
|
|
6
|
-
|
|
6
|
+
type RelatedContentTypeNames<T> = T extends {
|
|
7
7
|
__relatedContentTypeNames: string[];
|
|
8
8
|
} ? T["__relatedContentTypeNames"][number] : string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
type FieldsDivider = string;
|
|
10
|
+
type ArrayFieldGroup<Fields> = Array<Fields>;
|
|
11
|
+
type AsyncSelect<Relations, FromList, RelatedContentType, FromDistributor> = FromList extends true ? Relations extends true | "simple" ? {
|
|
12
12
|
id?: number;
|
|
13
13
|
label?: string;
|
|
14
14
|
} : Relations extends "full" ? {
|
|
@@ -19,18 +19,18 @@ export type AsyncSelect<Relations, FromList, RelatedContentType, FromDistributor
|
|
|
19
19
|
id?: number;
|
|
20
20
|
label?: string;
|
|
21
21
|
} : number;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
type CheckGroup<NameValues> = Array<NameValues>;
|
|
23
|
+
type ColorPicker = string;
|
|
24
|
+
type ColorPickerFixed = {
|
|
25
25
|
name: string;
|
|
26
26
|
hex: string;
|
|
27
27
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
type ComponentArray<ComponentProps> = Array<ComponentProps>;
|
|
29
|
+
type ComponentContainer<ComponentProps> = ComponentProps;
|
|
30
|
+
type Conditional<Values> = Values;
|
|
31
|
+
type Date = string;
|
|
32
|
+
type FieldGroup = string;
|
|
33
|
+
type File = {
|
|
34
34
|
/** file id */
|
|
35
35
|
id?: number;
|
|
36
36
|
/** site id */
|
|
@@ -76,13 +76,13 @@ export type File = {
|
|
|
76
76
|
folderName: string;
|
|
77
77
|
} | null;
|
|
78
78
|
};
|
|
79
|
-
|
|
79
|
+
type Heading<HeadingTagsType = HTMLHeadingTag> = {
|
|
80
80
|
/** Text content */
|
|
81
81
|
content?: string;
|
|
82
82
|
/** HTML tag used to render the content */
|
|
83
83
|
tag?: HeadingTagsType | null;
|
|
84
84
|
};
|
|
85
|
-
|
|
85
|
+
type Image = {
|
|
86
86
|
/** Image id */
|
|
87
87
|
id?: number;
|
|
88
88
|
/** Original image name */
|
|
@@ -129,7 +129,7 @@ export type Image = {
|
|
|
129
129
|
position?: ImagePosition;
|
|
130
130
|
};
|
|
131
131
|
/** Field of type where you can add a white list of modules to open them in a modal. */
|
|
132
|
-
|
|
132
|
+
type Link<ModalComponents = unknown> = {
|
|
133
133
|
/** Link text */
|
|
134
134
|
text?: string;
|
|
135
135
|
/** Type of link */
|
|
@@ -148,7 +148,7 @@ type MultiCheckSelectWithNoRelations<FromDistributor> = FromDistributor extends
|
|
|
148
148
|
id?: number;
|
|
149
149
|
label?: string;
|
|
150
150
|
} : number;
|
|
151
|
-
|
|
151
|
+
type MultiCheckSelect<Relations = false, FromList = false, RelatedContentType extends {
|
|
152
152
|
__contentTypeKind: string;
|
|
153
153
|
} = {
|
|
154
154
|
__contentTypeKind: string;
|
|
@@ -163,22 +163,22 @@ export type MultiCheckSelect<Relations = false, FromList = false, RelatedContent
|
|
|
163
163
|
value?: number;
|
|
164
164
|
title?: string;
|
|
165
165
|
}>;
|
|
166
|
-
|
|
166
|
+
type AsyncCheckGroup<Relations = false, FromList = false, RelatedContentType extends {
|
|
167
167
|
__contentTypeKind: string;
|
|
168
168
|
} = {
|
|
169
169
|
__contentTypeKind: string;
|
|
170
170
|
}, FromDistributor = false> = MultiCheckSelect<Relations, FromList, RelatedContentType, FromDistributor>;
|
|
171
|
-
|
|
171
|
+
type MultiCheckSelectGroup<T extends string, Relations = unknown, RelatedContentType extends {
|
|
172
172
|
__contentTypeKind: string;
|
|
173
173
|
} = {
|
|
174
174
|
__contentTypeKind: string;
|
|
175
175
|
}, FromDistributor = false> = {
|
|
176
176
|
[K in T]: MultiCheckSelect<Relations, unknown, RelatedContentType, FromDistributor>;
|
|
177
177
|
};
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
178
|
+
type Note = string;
|
|
179
|
+
type Number = number | null | "";
|
|
180
|
+
type RadioGroup<Values> = Values;
|
|
181
|
+
interface Reference<ContentType> {
|
|
182
182
|
mode?: "auto" | "manual" | "navigation";
|
|
183
183
|
fields?: Array<string>;
|
|
184
184
|
order?: string;
|
|
@@ -201,7 +201,7 @@ export interface Reference<ContentType> {
|
|
|
201
201
|
lang?: number;
|
|
202
202
|
site?: number;
|
|
203
203
|
}
|
|
204
|
-
|
|
204
|
+
interface Source<ContentType> {
|
|
205
205
|
structuredData: ContentTypeName<ContentType>;
|
|
206
206
|
filters?: Array<{
|
|
207
207
|
id: number;
|
|
@@ -210,24 +210,24 @@ export interface Source<ContentType> {
|
|
|
210
210
|
filterOperator?: "and" | "or" | "AND" | "OR";
|
|
211
211
|
globalOperator?: "and" | "or" | "AND" | "OR";
|
|
212
212
|
}
|
|
213
|
-
|
|
213
|
+
interface ReferenceNavigation {
|
|
214
214
|
order?: string;
|
|
215
215
|
quantity?: number;
|
|
216
216
|
fullRelations?: boolean;
|
|
217
217
|
/** The id of the ContentType */
|
|
218
218
|
referenceId?: number;
|
|
219
219
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
220
|
+
type RichText = string;
|
|
221
|
+
type ScrollableUniqueSelection = string;
|
|
222
|
+
type Select<Values> = Values;
|
|
223
|
+
type Slider = number;
|
|
224
|
+
type Tags = Array<string>;
|
|
225
|
+
type TextArea = string;
|
|
226
|
+
type Text = string;
|
|
227
|
+
type Time = string;
|
|
228
|
+
type Toggle = boolean;
|
|
229
|
+
type UniqueCheck = boolean;
|
|
230
|
+
type Url = {
|
|
231
231
|
href?: string;
|
|
232
232
|
title?: string;
|
|
233
233
|
linkToURL?: string;
|
|
@@ -237,9 +237,9 @@ export type Url = {
|
|
|
237
237
|
subSlug?: string;
|
|
238
238
|
anchor?: string;
|
|
239
239
|
};
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
240
|
+
type VisualUniqueSelection<Values> = Values;
|
|
241
|
+
type Wysiwyg = string;
|
|
242
|
+
type MenuItemsKind = {
|
|
243
243
|
link: {
|
|
244
244
|
config?: {
|
|
245
245
|
headerStyle?: string;
|
|
@@ -256,7 +256,7 @@ export type MenuItemsKind = {
|
|
|
256
256
|
url?: null;
|
|
257
257
|
};
|
|
258
258
|
};
|
|
259
|
-
|
|
259
|
+
type BaseLinkElement<IM extends MenuItemsKind> = {
|
|
260
260
|
/** Label */
|
|
261
261
|
label?: string;
|
|
262
262
|
/** Children */
|
|
@@ -276,13 +276,13 @@ export type BaseLinkElement<IM extends MenuItemsKind> = {
|
|
|
276
276
|
/**
|
|
277
277
|
* Griddo Menu Schema
|
|
278
278
|
*/
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
279
|
+
type MenuElement<IM extends MenuItemsKind> = BaseLinkElement<IM> & (IM["link"] | IM["group"]);
|
|
280
|
+
type LinkMenuElement<IM extends MenuItemsKind> = BaseLinkElement<IM> & IM["link"];
|
|
281
|
+
type GroupMenuElement<IM extends MenuItemsKind> = BaseLinkElement<IM> & IM["group"];
|
|
282
|
+
type Menu<IM extends MenuItemsKind> = {
|
|
283
283
|
elements?: Array<MenuElement<IM>>;
|
|
284
284
|
};
|
|
285
|
-
|
|
285
|
+
type TemplateSection<GriddoModule> = {
|
|
286
286
|
component: "Section";
|
|
287
287
|
name: string;
|
|
288
288
|
modules: Array<GriddoModule>;
|
|
@@ -291,7 +291,7 @@ export type TemplateSection<GriddoModule> = {
|
|
|
291
291
|
* Base ContentType interface to extends from in SimpleContentType and
|
|
292
292
|
* PageContentType types.
|
|
293
293
|
*/
|
|
294
|
-
|
|
294
|
+
interface BaseContentType<ContentType> {
|
|
295
295
|
/** Item Id */
|
|
296
296
|
id?: number;
|
|
297
297
|
/** ContentType content */
|
|
@@ -307,8 +307,8 @@ export interface BaseContentType<ContentType> {
|
|
|
307
307
|
language: number;
|
|
308
308
|
}>;
|
|
309
309
|
}
|
|
310
|
-
|
|
311
|
-
|
|
310
|
+
type SimpleContentType<ContentType> = BaseContentType<ContentType>;
|
|
311
|
+
interface PageContentType<ContentType> extends BaseContentType<ContentType> {
|
|
312
312
|
relatedPage?: {
|
|
313
313
|
pageId: number;
|
|
314
314
|
url?: string;
|
|
@@ -325,17 +325,17 @@ export interface PageContentType<ContentType> extends BaseContentType<ContentTyp
|
|
|
325
325
|
};
|
|
326
326
|
}
|
|
327
327
|
type ExtraContentTypePropsInAutoType = "__contentTypeKind";
|
|
328
|
-
|
|
328
|
+
type QueriedDataItem<ContentType = unknown> = ContentType extends {
|
|
329
329
|
__contentTypeKind: "pageContentType";
|
|
330
330
|
} ? PageContentType<Omit<ContentType, ExtraContentTypePropsInAutoType>> : SimpleContentType<Omit<ContentType, ExtraContentTypePropsInAutoType>>;
|
|
331
|
-
|
|
331
|
+
type QueriedNavigationDataItem<ContentType = unknown> = {
|
|
332
332
|
previous: Array<QueriedDataItem<ContentType>>;
|
|
333
333
|
next: Array<QueriedDataItem<ContentType>>;
|
|
334
334
|
error?: string;
|
|
335
335
|
};
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
336
|
+
type QueriedData<ContentType> = Array<QueriedDataItem<ContentType>>;
|
|
337
|
+
type QueriedNavigationData<ContentType> = QueriedNavigationDataItem<ContentType>;
|
|
338
|
+
type ExtraListTemplateProps = {
|
|
339
339
|
/** Full URL for the page */
|
|
340
340
|
baseLink?: string;
|
|
341
341
|
/** Total count of the ContentType items. Useful is you want to build a `n of totalItems` pagination. */
|
|
@@ -345,4 +345,4 @@ export type ExtraListTemplateProps = {
|
|
|
345
345
|
/** Total of pages, this is basically the totalQueriedItems/itemsPerPage that you could use in a pagination component */
|
|
346
346
|
totalPages?: number;
|
|
347
347
|
};
|
|
348
|
-
export {};
|
|
348
|
+
export type { ArrayFieldGroup, AsyncCheckGroup, AsyncSelect, BaseContentType, BaseLinkElement, CheckGroup, ColorPicker, ColorPickerFixed, ComponentArray, ComponentContainer, Conditional, ContentTypeName, Date, ExtraContentTypePropsInAutoType, ExtraListTemplateProps, FieldGroup, FieldsDivider, File, GroupMenuElement, Heading, Image, Link, LinkMenuElement, Menu, MenuElement, MenuItemsKind, MultiCheckSelect, MultiCheckSelectGroup, MultiCheckSelectWithNoRelations, MultiCheckSelectWithRelations, Note, Number, PageContentType, QueriedData, QueriedDataItem, QueriedNavigationData, QueriedNavigationDataItem, RadioGroup, Reference, ReferenceNavigation, RelatedContentTypeNames, RichText, ScrollableUniqueSelection, Select, SimpleContentType, Slider, Source, Tags, TemplateSection, Text, TextArea, Time, Toggle, UniqueCheck, Url, VisualUniqueSelection, Wysiwyg, };
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { CloudinaryImageProps } from "../../components/CloudinaryImage";
|
|
2
|
-
import { GriddoLinkProps } from "../../components/GriddoLink";
|
|
3
|
-
import { Image, Menu } from "../api-response-fields";
|
|
4
|
-
import locales from "../constants/locales";
|
|
5
|
-
import timezone from "../constants/timezone";
|
|
6
|
-
import { Replace } from "../utilities";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import type { CloudinaryImageProps } from "../../components/CloudinaryImage";
|
|
2
|
+
import type { GriddoLinkProps } from "../../components/GriddoLink";
|
|
3
|
+
import type { Image, Menu } from "../api-response-fields";
|
|
4
|
+
import type locales from "../constants/locales";
|
|
5
|
+
import type timezone from "../constants/timezone";
|
|
6
|
+
import type { Replace } from "../utilities";
|
|
7
|
+
type Renderers = "gatsby" | "editor" | "preview";
|
|
8
|
+
type ContentTypeRelations = "off" | "full" | "simple" | boolean;
|
|
9
|
+
type SocialName = "instagram" | "linkedIn" | "facebook" | "twitter" | "youTube" | "flickr" | "tiktok" | "snapchat" | "newsletter";
|
|
10
|
+
type Breadcrumb = Array<{
|
|
11
11
|
path?: string;
|
|
12
12
|
label: string;
|
|
13
13
|
fullPath: string;
|
|
14
14
|
}>;
|
|
15
|
-
|
|
15
|
+
interface PageLanguage {
|
|
16
16
|
id: number;
|
|
17
17
|
locale: string;
|
|
18
18
|
}
|
|
19
19
|
/** Descripbes a Griddo Language item */
|
|
20
|
-
|
|
20
|
+
interface SiteLanguage {
|
|
21
21
|
domain: {
|
|
22
22
|
id: number;
|
|
23
23
|
url: string;
|
|
@@ -31,7 +31,7 @@ export interface SiteLanguage {
|
|
|
31
31
|
locale: Locale;
|
|
32
32
|
path: string;
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
interface Page<ContentType = unknown> {
|
|
35
35
|
/** Private API url */
|
|
36
36
|
apiUrl?: string;
|
|
37
37
|
activeSectionBase?: string;
|
|
@@ -181,7 +181,7 @@ export interface Page<ContentType = unknown> {
|
|
|
181
181
|
url?: string;
|
|
182
182
|
workflowStatus?: unknown;
|
|
183
183
|
}
|
|
184
|
-
|
|
184
|
+
interface CloudinaryDefaults extends Partial<Pick<CloudinaryImageProps, "quality" | "crop" | "gravity" | "format" | "loading" | "decoding" | "sizes" | "responsive">> {
|
|
185
185
|
domain?: string;
|
|
186
186
|
uploadFolder?: string;
|
|
187
187
|
fallback404Image?: string;
|
|
@@ -189,7 +189,7 @@ export interface CloudinaryDefaults extends Partial<Pick<CloudinaryImageProps, "
|
|
|
189
189
|
src?: string;
|
|
190
190
|
srcSet?: string;
|
|
191
191
|
}
|
|
192
|
-
|
|
192
|
+
type GriddoDamDefaults = {
|
|
193
193
|
quality?: number;
|
|
194
194
|
crop?: ImageCropType;
|
|
195
195
|
loading?: ImageLoading;
|
|
@@ -198,7 +198,7 @@ export type GriddoDamDefaults = {
|
|
|
198
198
|
widths?: Array<string>;
|
|
199
199
|
};
|
|
200
200
|
/** Describe a Griddo site object for final Gatsby template */
|
|
201
|
-
|
|
201
|
+
interface Site {
|
|
202
202
|
apiUrl?: string;
|
|
203
203
|
bigAvatar?: string | null;
|
|
204
204
|
cloudinaryCloudName?: string;
|
|
@@ -242,19 +242,19 @@ export interface Site {
|
|
|
242
242
|
translations?: LocaleTranslations;
|
|
243
243
|
}
|
|
244
244
|
/** Type for fetch priority */
|
|
245
|
-
|
|
245
|
+
type FetchPriority = "auto" | "high" | "low";
|
|
246
246
|
/** Kind of Griddo image croping */
|
|
247
|
-
|
|
247
|
+
type ImageCropType = "cover" | "contain" | "fill" | "inside" | "outside";
|
|
248
248
|
/** Kind of image decoding */
|
|
249
|
-
|
|
249
|
+
type ImageDecoding = "auto" | "sync" | "async";
|
|
250
250
|
/** Griddo image formats */
|
|
251
|
-
|
|
251
|
+
type ImageFormats = "avif" | "webp" | "jpeg" | "jpg" | "png" | "gif" | "svg";
|
|
252
252
|
/** Kind of browser image load method */
|
|
253
|
-
|
|
253
|
+
type ImageLoading = "lazy" | "eager";
|
|
254
254
|
/** Image transforms for the Griddo cdn image provider */
|
|
255
|
-
|
|
255
|
+
type ImageTransform = "grayscale" | "flip" | "flop" | `blur(${string})`;
|
|
256
256
|
/** Background image type */
|
|
257
|
-
|
|
257
|
+
type BackgroundImageSizesProps = {
|
|
258
258
|
/** Breakpoint in px */
|
|
259
259
|
breakpoint: string;
|
|
260
260
|
/** Width of the image */
|
|
@@ -264,20 +264,20 @@ export type BackgroundImageSizesProps = {
|
|
|
264
264
|
quality?: number;
|
|
265
265
|
};
|
|
266
266
|
/** Image position for the Griddo cdn image provider */
|
|
267
|
-
|
|
267
|
+
type ImagePosition = "attention" | "bottom" | "center" | "entropy" | "left-bottom" | "left-top" | "left" | "right-bottom" | "right-top" | "right" | "top";
|
|
268
268
|
/** Type definition for a Griddo component or a module */
|
|
269
|
-
|
|
269
|
+
interface LibraryComponentProps {
|
|
270
270
|
component: Capitalize<string>;
|
|
271
271
|
[key: string]: unknown;
|
|
272
272
|
}
|
|
273
273
|
/** Custom object with value/keys containing static translations */
|
|
274
|
-
|
|
274
|
+
type LocaleTranslations = Partial<Record<(typeof locales)[number], Record<string, unknown>>>;
|
|
275
275
|
/** Locale zone codes */
|
|
276
|
-
|
|
277
|
-
|
|
276
|
+
type Locale = (typeof locales)[number];
|
|
277
|
+
type ISOLocale = Replace<Locale, "_", "-">;
|
|
278
278
|
/** Time zone codes */
|
|
279
|
-
|
|
280
|
-
|
|
279
|
+
type TimeZone = (typeof timezone)[number];
|
|
280
|
+
interface ResponsiveImageProps {
|
|
281
281
|
/** Breakpoint in px or null if its the first one (mobile) */
|
|
282
282
|
breakpoint?: null | string;
|
|
283
283
|
/** Width of the image */
|
|
@@ -293,7 +293,7 @@ export interface ResponsiveImageProps {
|
|
|
293
293
|
/** Kind of image position crop of Griddo DAM */
|
|
294
294
|
position?: ImagePosition;
|
|
295
295
|
}
|
|
296
|
-
|
|
296
|
+
interface FullPath {
|
|
297
297
|
/** Slug for the site with the format `/site-name` */
|
|
298
298
|
site?: string;
|
|
299
299
|
/** Slug for the domain with the format `/domain-name` */
|
|
@@ -307,7 +307,7 @@ export interface FullPath {
|
|
|
307
307
|
/** Slug for the compose url with the format `/language-name/` */
|
|
308
308
|
compose?: string;
|
|
309
309
|
}
|
|
310
|
-
|
|
310
|
+
type ListContentType<Item> = Item & {
|
|
311
311
|
id: number;
|
|
312
312
|
title: string;
|
|
313
313
|
url: string;
|
|
@@ -317,13 +317,13 @@ interface NavigationModule {
|
|
|
317
317
|
[key: string]: unknown;
|
|
318
318
|
menu: Menu<any>;
|
|
319
319
|
}
|
|
320
|
-
|
|
320
|
+
interface FooterModule extends Omit<NavigationModule, "component"> {
|
|
321
321
|
component: "Footer";
|
|
322
322
|
}
|
|
323
|
-
|
|
323
|
+
interface HeaderModule extends Omit<NavigationModule, "component"> {
|
|
324
324
|
component: "Header";
|
|
325
325
|
}
|
|
326
|
-
|
|
326
|
+
interface PageIntegration {
|
|
327
327
|
id: number;
|
|
328
328
|
name: string;
|
|
329
329
|
description: string;
|
|
@@ -335,8 +335,8 @@ export interface PageIntegration {
|
|
|
335
335
|
active: boolean;
|
|
336
336
|
type: "addon" | "analytics" | "datalayer";
|
|
337
337
|
}
|
|
338
|
-
|
|
338
|
+
interface ContentPresence {
|
|
339
339
|
presenceType: "page-specific" | "page-custom" | "page-manual" | "all";
|
|
340
340
|
relatedPages: Array<number> | null;
|
|
341
341
|
}
|
|
342
|
-
export {};
|
|
342
|
+
export type { BackgroundImageSizesProps, Breadcrumb, CloudinaryDefaults, ContentPresence, ContentTypeRelations, FetchPriority, FooterModule, FullPath, GriddoDamDefaults, HeaderModule, ImageCropType, ImageDecoding, ImageFormats, ImageLoading, ImagePosition, ImageTransform, ISOLocale, LibraryComponentProps, ListContentType, Locale, LocaleTranslations, NavigationModule, Page, PageIntegration, PageLanguage, Renderers, ResponsiveImageProps, Site, SiteLanguage, SocialName, TimeZone, };
|
package/dist/types/global.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { KeysOfUnion } from "./utilities";
|
|
2
|
-
import { Fields } from "../index";
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { KeysOfUnion } from "./utilities";
|
|
2
|
+
import type { Fields } from "../index";
|
|
3
|
+
type HTMLHeadingTag = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
4
|
+
interface SetQueryProps<ContentType> {
|
|
5
5
|
/** The ReferenceField prop */
|
|
6
6
|
data?: Fields.Reference<ContentType>;
|
|
7
7
|
/** The URL of the public API, if not provided, will be obtained from the context */
|
|
@@ -36,30 +36,40 @@ export interface SetQueryProps<ContentType> {
|
|
|
36
36
|
relations?: boolean | "off" | "simple" | "full";
|
|
37
37
|
/** Indicates if the query includes pending publish data */
|
|
38
38
|
includePending?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Indicates if we should limit results to one language
|
|
41
|
+
* @deprecated Now the hook uses `allLanguages` which comes in the ReferenceField (usually `data` prop)
|
|
42
|
+
*/
|
|
43
|
+
allLanguages?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Indicates if we should first return elements with same language as the page
|
|
46
|
+
* @deprecated Now the hook uses the `preferenceLanguage` which comes in the ReferenceField (usually `data` prop)
|
|
47
|
+
*/
|
|
48
|
+
preferenceLanguage?: boolean;
|
|
39
49
|
/** The id of a ContentType */
|
|
40
50
|
referenceId?: number;
|
|
41
51
|
/** Grouping Categories */
|
|
42
52
|
groupingCategories?: boolean;
|
|
43
53
|
}
|
|
44
|
-
|
|
54
|
+
interface Category {
|
|
45
55
|
id: number;
|
|
46
56
|
title: string;
|
|
47
57
|
code: string;
|
|
48
58
|
type: "category";
|
|
49
59
|
}
|
|
50
|
-
|
|
60
|
+
interface CategoryGroup {
|
|
51
61
|
id: number;
|
|
52
62
|
title: string;
|
|
53
63
|
type: "group";
|
|
54
64
|
children: Array<Category | CategoryGroup>;
|
|
55
65
|
}
|
|
56
|
-
|
|
66
|
+
interface ListApiQueryResponseProps<ContentTypeFields> {
|
|
57
67
|
page?: number;
|
|
58
68
|
items?: Array<ContentTypeFields>;
|
|
59
69
|
totalItems?: number;
|
|
60
70
|
totalPages?: number;
|
|
61
71
|
}
|
|
62
|
-
|
|
72
|
+
type FilterDataGroup = {
|
|
63
73
|
label: string;
|
|
64
74
|
id: number;
|
|
65
75
|
language: number;
|
|
@@ -67,13 +77,13 @@ export type FilterDataGroup = {
|
|
|
67
77
|
selectable: boolean;
|
|
68
78
|
children: Array<FilterDataItem | FilterDataGroup>;
|
|
69
79
|
};
|
|
70
|
-
|
|
80
|
+
type FilterDataItem = {
|
|
71
81
|
label: string;
|
|
72
82
|
id: number;
|
|
73
83
|
language: number;
|
|
74
84
|
type: "category";
|
|
75
85
|
};
|
|
76
|
-
|
|
86
|
+
type FiltersDataApiQueryResponseProps<ContentType> = ContentType extends {
|
|
77
87
|
__relatedContentTypeNames: Array<string>;
|
|
78
88
|
} ? {
|
|
79
89
|
[P in ContentType["__relatedContentTypeNames"][number]]: {
|
|
@@ -86,13 +96,13 @@ export type FiltersDataApiQueryResponseProps<ContentType> = ContentType extends
|
|
|
86
96
|
* // Pick the prop foo from T and rename it to bar
|
|
87
97
|
* PickRename<T, "foo", "bar">
|
|
88
98
|
*/
|
|
89
|
-
|
|
99
|
+
type PickRename<T, K extends keyof T, R extends PropertyKey> = Omit<T, K> & {
|
|
90
100
|
[P in R]: T[K];
|
|
91
101
|
};
|
|
92
102
|
/**
|
|
93
103
|
* Helper type for autotypes in order to 'manage' hideable state for schemas.
|
|
94
104
|
*/
|
|
95
|
-
|
|
105
|
+
type Hideable<T> = T | null;
|
|
96
106
|
/**
|
|
97
107
|
* Just for use temporally and get full type props information on hover.
|
|
98
108
|
|
|
@@ -100,7 +110,7 @@ export type Hideable<T> = T | null;
|
|
|
100
110
|
* const myVar = Pretty<SomeType> = ...
|
|
101
111
|
* // ^ hover `myVar` shows full detail of props from `SomeType`
|
|
102
112
|
*/
|
|
103
|
-
|
|
113
|
+
type Pretty<T> = {
|
|
104
114
|
[K in keyof T]: T[K];
|
|
105
115
|
} & {};
|
|
106
116
|
interface RawFilterItemFromFilterEndPoint {
|
|
@@ -111,5 +121,5 @@ interface RawFilterItemFromFilterEndPoint {
|
|
|
111
121
|
language: number;
|
|
112
122
|
}>;
|
|
113
123
|
}
|
|
114
|
-
|
|
115
|
-
export {};
|
|
124
|
+
type FilterItemFromFilterEndPoint = Pretty<RawFilterItemFromFilterEndPoint>;
|
|
125
|
+
export type { Category, CategoryGroup, FilterDataGroup, FilterDataItem, FilterItemFromFilterEndPoint, FiltersDataApiQueryResponseProps, Hideable, HTMLHeadingTag, ListApiQueryResponseProps, PickRename, Pretty, RawFilterItemFromFilterEndPoint, SetQueryProps, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Option, ThemeColors, ThemeFixedColors, ThemeVisualUniqueSelection, ThumbnailOption, WithDisabled, WithEntity, WithGroup, WithSource } from "./props";
|
|
2
|
-
import { HTMLHeadingTag } from "../global";
|
|
3
|
-
import { DistributiveOmit } from "../utilities";
|
|
1
|
+
import type { Option, ThemeColors, ThemeFixedColors, ThemeVisualUniqueSelection, ThumbnailOption, WithDisabled, WithEntity, WithGroup, WithSource } from "./props";
|
|
2
|
+
import type { HTMLHeadingTag } from "../global";
|
|
3
|
+
import type { DistributiveOmit } from "../utilities";
|
|
4
4
|
/** Type generator options */
|
|
5
5
|
type TypeGeneratorBase = {
|
|
6
6
|
/** Comment for the Types generator */
|
|
@@ -227,7 +227,7 @@ export interface BaseReferenceField extends GenericField {
|
|
|
227
227
|
/** Field that loads Structured Data (usually pure) from the database. It is usually used in distributor modules. */
|
|
228
228
|
type: "ReferenceField";
|
|
229
229
|
/** Selection types: manual, automatic or both. Default: ["auto", "manual"]. */
|
|
230
|
-
selectionType?: Array<"auto" | "manual">;
|
|
230
|
+
selectionType?: Array<"auto" | "manual" | "navigation">;
|
|
231
231
|
/** Only manual mode. */
|
|
232
232
|
maxItems?: number;
|
|
233
233
|
}
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { BaseArrayFieldGroup, BaseAsyncCheckGroup, BaseAsyncSelect, BaseCheckGroup, BaseColorPicker, BaseComponentArray, BaseComponentContainer, BaseConditionalField, BaseDateField, BaseFieldGroup, BaseFieldsDivider, BaseFileField, BaseHeadingField, BaseImageField, BaseLinkField, BaseMultiCheckSelect, BaseMultiCheckSelectGroup, BaseNoteField, BaseNumberField, BaseRadioGroup, BaseReferenceField, BaseRichText, BaseSelect, BaseSliderField, BaseTagsField, BaseTextArea, BaseTextField, BaseTimeField, BaseToggleField, BaseUniqueCheck, BaseUrlField, BaseVisualUniqueSelection, BaseWysiwyg } from "./base";
|
|
2
|
-
import { WithDataSources, WithFrom, WithIndexable, WithRelations_AutoTypes, WithShowList, WithWhiteList } from "./props";
|
|
1
|
+
import type { BaseArrayFieldGroup, BaseAsyncCheckGroup, BaseAsyncSelect, BaseCheckGroup, BaseColorPicker, BaseComponentArray, BaseComponentContainer, BaseConditionalField, BaseDateField, BaseFieldGroup, BaseFieldsDivider, BaseFileField, BaseHeadingField, BaseImageField, BaseLinkField, BaseMultiCheckSelect, BaseMultiCheckSelectGroup, BaseNoteField, BaseNumberField, BaseRadioGroup, BaseReferenceField, BaseRichText, BaseSelect, BaseSliderField, BaseTagsField, BaseTextArea, BaseTextField, BaseTimeField, BaseToggleField, BaseUniqueCheck, BaseUrlField, BaseVisualUniqueSelection, BaseWysiwyg } from "./base";
|
|
2
|
+
import type { WithDataSources, WithFrom, WithIndexable, WithRelations_AutoTypes, WithShowList, WithWhiteList } from "./props";
|
|
3
3
|
type Common = WithFrom & WithIndexable & WithShowList;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export {};
|
|
4
|
+
type ArrayFieldGroup = BaseArrayFieldGroup<PageContentTypeFields> & Common;
|
|
5
|
+
type ConditionalField = BaseConditionalField<PageContentTypeFields> & Common;
|
|
6
|
+
type FieldGroup = BaseFieldGroup<PageContentTypeFields> & Common;
|
|
7
|
+
type AsyncCheckGroup = BaseAsyncCheckGroup & Common;
|
|
8
|
+
type AsyncSelect = BaseAsyncSelect & Common;
|
|
9
|
+
type CheckGroup = BaseCheckGroup & Common;
|
|
10
|
+
type ColorPicker = BaseColorPicker & Common;
|
|
11
|
+
type ComponentArray = BaseComponentArray & WithWhiteList & Common;
|
|
12
|
+
type ComponentContainer = BaseComponentContainer & WithWhiteList & Common;
|
|
13
|
+
type DateField = BaseDateField & Common;
|
|
14
|
+
type FieldsDivider = BaseFieldsDivider & Common;
|
|
15
|
+
type FileField = BaseFileField & Common;
|
|
16
|
+
type HeadingField = BaseHeadingField & Common;
|
|
17
|
+
type ImageField = BaseImageField & Common;
|
|
18
|
+
type LinkField = BaseLinkField & WithWhiteList & Common;
|
|
19
|
+
type MultiCheckSelect = BaseMultiCheckSelect & WithRelations_AutoTypes & Common;
|
|
20
|
+
type MultiCheckSelectGroup = BaseMultiCheckSelectGroup & WithRelations_AutoTypes & Common;
|
|
21
|
+
type NoteField = BaseNoteField & Common;
|
|
22
|
+
type NumberField = BaseNumberField & Common;
|
|
23
|
+
type RadioGroup = BaseRadioGroup & Common;
|
|
24
|
+
type ReferenceField = BaseReferenceField & WithDataSources & Common;
|
|
25
|
+
type RichText = BaseRichText & Common;
|
|
26
|
+
type Select = BaseSelect & Common;
|
|
27
|
+
type SliderField = BaseSliderField & Common;
|
|
28
|
+
type TagsField = BaseTagsField & Common;
|
|
29
|
+
type TextArea = BaseTextArea & Common;
|
|
30
|
+
type TextField = BaseTextField & Common;
|
|
31
|
+
type TimeField = BaseTimeField & Common;
|
|
32
|
+
type ToggleField = BaseToggleField & Common;
|
|
33
|
+
type UniqueCheck = BaseUniqueCheck & Common;
|
|
34
|
+
type UrlField = BaseUrlField & Common;
|
|
35
|
+
type VisualUniqueSelection = BaseVisualUniqueSelection & Common;
|
|
36
|
+
type Wysiwyg = BaseWysiwyg & Common;
|
|
37
|
+
type PageContentTypeFields = ArrayFieldGroup | ConditionalField | FieldGroup | AsyncCheckGroup | AsyncSelect | CheckGroup | ColorPicker | ComponentArray | ComponentContainer | DateField | FieldsDivider | FileField | HeadingField | ImageField | LinkField | MultiCheckSelect | MultiCheckSelectGroup | NoteField | NumberField | RadioGroup | ReferenceField | RichText | Select | SliderField | TagsField | TextArea | TextField | TimeField | ToggleField | UniqueCheck | UrlField | VisualUniqueSelection | Wysiwyg;
|
|
38
|
+
export type { ArrayFieldGroup, ConditionalField, FieldGroup, AsyncCheckGroup, AsyncSelect, CheckGroup, ColorPicker, ComponentArray, ComponentContainer, DateField, FieldsDivider, FileField, HeadingField, ImageField, LinkField, MultiCheckSelect, MultiCheckSelectGroup, NoteField, NumberField, RadioGroup, ReferenceField, RichText, Select, SliderField, TagsField, TextArea, TextField, TimeField, ToggleField, UniqueCheck, UrlField, VisualUniqueSelection, Wysiwyg, PageContentTypeFields, };
|