@griddo/core 12.11.0 → 12.11.1-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/autotypes.mjs +2 -1
  2. package/dist/autotypes.mjs.map +1 -1
  3. package/dist/bin-tools/autotypes/index.d.ts +1 -0
  4. package/dist/bin-tools/autotypes/misc/utils.d.ts +6 -3
  5. package/dist/bin-tools/autotypes/parser/index.d.ts +1 -1
  6. package/dist/components/CloudinaryImage/index.d.ts +1 -2
  7. package/dist/components/GriddoImage/index.d.ts +0 -1
  8. package/dist/components/GriddoImageExp/utils.d.ts +1 -1
  9. package/dist/components/GriddoLink/index.d.ts +1 -1
  10. package/dist/components/Page/index.d.ts +1 -1
  11. package/dist/contexts/Form/index.d.ts +1 -1
  12. package/dist/contexts/Navigation/index.d.ts +1 -1
  13. package/dist/contexts/Site/index.d.ts +1 -1
  14. package/dist/functions/index.d.ts +2 -2
  15. package/dist/hooks/index.d.ts +1 -1
  16. package/dist/hooks/useAiAnswers.d.ts +2 -2
  17. package/dist/hooks/useAiSearch.d.ts +2 -2
  18. package/dist/hooks/useReceiveInterests.d.ts +1 -1
  19. package/dist/index.d.ts +7 -7
  20. package/dist/index.js +3 -1
  21. package/dist/index.js.map +1 -1
  22. package/dist/types/api-response-fields/index.d.ts +1 -1
  23. package/dist/types/core/index.d.ts +1 -1
  24. package/dist/types/global.d.ts +1 -1
  25. package/dist/types/schema-fields/page-content-type-fields.d.ts +1 -1
  26. package/dist/types/schema-fields/props.d.ts +1 -1
  27. package/dist/types/schemas/ContentType.d.ts +1 -1
  28. package/dist/types/schemas/HeaderFooter.d.ts +1 -1
  29. package/dist/types/schemas/Menu.d.ts +1 -1
  30. package/dist/types/schemas/PageContentType.d.ts +2 -2
  31. package/dist/types/schemas/SimpleContentType.d.ts +2 -2
  32. package/dist/types/schemas/UI.d.ts +3 -3
  33. package/dist/types/schemas/base.d.ts +1 -1
  34. package/dist/types/schemas/props.d.ts +1 -1
  35. package/dist/types/theme/index.d.ts +1 -1
  36. package/dist/types/utilities.d.ts +1 -1
  37. package/dist/utils/index.d.ts +7 -1
  38. package/dist/vendor/react-aspect-ratio/index.d.ts +15 -0
  39. package/package.json +34 -73
  40. package/dist/autotypes.js +0 -2
  41. package/dist/autotypes.js.map +0 -1
  42. package/dist/components/GriddoImageExp/GriddoImageExp.stories.d.ts +0 -25
  43. package/dist/components/GriddoImageExp/GriddoImageExp.test.d.ts +0 -1
@@ -1,6 +1,6 @@
1
+ import type __AT__ from "@/autotypes";
1
2
  import type { ImagePosition } from "../core";
2
3
  import type { FilterItemFromFilterEndPoint, HTMLHeadingTag } from "../global";
3
- import type __AT__ from "@/autotypes";
4
4
  /** Return the `__contentTypeName` if it exists. */
5
5
  type ContentTypeName<T> = T extends {
6
6
  __contentTypeName: string;
@@ -499,4 +499,4 @@ interface Config {
499
499
  };
500
500
  };
501
501
  }
502
- export type { BackgroundImageSizesProps, Breadcrumb, CloudinaryDefaults, Config, ContentPresence, ContentTypeRelations, DeprecatedLlmsConfig, FetchPriority, FooterModule, FullPath, GriddoDamDefaults, HeaderModule, ImageCropType, ImageDecoding, ImageFormats, ImageLoading, ImagePosition, ImageTransform, ISOLocale, JsConversionOptions, JsPreprocessingOptions, LibraryComponentProps, ListContentType, LlmsConfig, LlmsImages, LlmsIndexConfig, LlmsMarkdownConfig, Locale, LocaleTranslations, NavigationModule, Page, PageIntegration, PageLanguage, Renderers, ResponsiveImageProps, Site, SiteLanguage, SocialName, TimeZone };
502
+ export type { BackgroundImageSizesProps, Breadcrumb, CloudinaryDefaults, Config, ContentPresence, ContentTypeRelations, DeprecatedLlmsConfig, FetchPriority, FooterModule, FullPath, GriddoDamDefaults, HeaderModule, ImageCropType, ImageDecoding, ImageFormats, ImageLoading, ImagePosition, ImageTransform, ISOLocale, JsConversionOptions, JsPreprocessingOptions, LibraryComponentProps, ListContentType, LlmsConfig, LlmsImages, LlmsIndexConfig, LlmsMarkdownConfig, Locale, LocaleTranslations, NavigationModule, Page, PageIntegration, PageLanguage, Renderers, ResponsiveImageProps, Site, SiteLanguage, SocialName, TimeZone, };
@@ -1,5 +1,5 @@
1
- import type { KeysOfUnion } from "./utilities";
2
1
  import type { Fields } from "../index";
2
+ import type { KeysOfUnion } from "./utilities";
3
3
  type HTMLHeadingTag = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
4
4
  interface SetQueryProps<ContentType> {
5
5
  /** The ReferenceField prop */
@@ -38,4 +38,4 @@ type Wysiwyg = BaseWysiwyg & Common;
38
38
  type CommonPageContentTypeFields = AIReferenceField | ArrayFieldGroup | ConditionalField | FieldGroup | AsyncCheckGroup | AsyncSelect | CheckGroup | ColorPicker | 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;
39
39
  type PageContentTypeFields = CommonPageContentTypeFields | ComponentArray;
40
40
  type PageContentTypeFieldsForArrayFieldGroup = CommonPageContentTypeFields;
41
- export type { AIReferenceField, 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, };
41
+ export type { AIReferenceField, ArrayFieldGroup, AsyncCheckGroup, AsyncSelect, CheckGroup, ColorPicker, ComponentArray, ComponentContainer, ConditionalField, DateField, FieldGroup, FieldsDivider, FileField, HeadingField, ImageField, LinkField, MultiCheckSelect, MultiCheckSelectGroup, NoteField, NumberField, PageContentTypeFields, RadioGroup, ReferenceField, RichText, Select, SliderField, TagsField, TextArea, TextField, TimeField, ToggleField, UniqueCheck, UrlField, VisualUniqueSelection, Wysiwyg, };
@@ -1,6 +1,6 @@
1
+ import type __AT__ from "@/autotypes";
1
2
  import type { Core } from "../..";
2
3
  import type { SimpleContentType, Source } from "../api-response-fields";
3
- import type __AT__ from "@/autotypes";
4
4
  type WithAuxText = {
5
5
  /** Sets a label text to show besides the toggle field control */
6
6
  auxText?: string;
@@ -1,4 +1,4 @@
1
1
  import type { Categories } from "./Categories";
2
2
  import type { PageContentType } from "./PageContentType";
3
3
  import type { SimpleContentType } from "./SimpleContentType";
4
- export type { PageContentType, SimpleContentType, Categories as CategoryContentType, };
4
+ export type { Categories as CategoryContentType, PageContentType, SimpleContentType, };
@@ -43,4 +43,4 @@ type Footer<T = unknown> = HeaderFooter & {
43
43
  type: "footer";
44
44
  } & TypedOrNotHeaderFooterDefault<T>;
45
45
  };
46
- export type { HeaderFooter, Header, Footer };
46
+ export type { Footer, Header, HeaderFooter };
@@ -17,4 +17,4 @@ interface MenuItem {
17
17
  };
18
18
  }
19
19
  type Menu = Array<MenuEntry>;
20
- export type { MenuEntry, MenuFields, MenuItem, Menu };
20
+ export type { Menu, MenuEntry, MenuFields, MenuItem };
@@ -1,7 +1,7 @@
1
- import type { BaseContentType } from "./base";
2
- import type { DataPacks, ExpirationData } from "./props";
3
1
  import type { PageContentTypeFields, TextField } from "../schema-fields/page-content-type-fields";
4
2
  import type { SearchFrom, WithSearchable } from "../schema-fields/props";
3
+ import type { BaseContentType } from "./base";
4
+ import type { DataPacks, ExpirationData } from "./props";
5
5
  type PageContentTypeProp = SearchFrom & {
6
6
  /** The name of the Reacttemplates to use with the page type Schema. */
7
7
  templates: Array<string>;
@@ -1,7 +1,7 @@
1
- import type { BaseContentType } from "./base";
2
- import type { DataPacks, ExpirationData } from "./props";
3
1
  import type { SearchFrom, WithSearchable } from "../schema-fields/props";
4
2
  import type { SimpleContentTypeFields, TextField } from "../schema-fields/simple-content-type-fields";
3
+ import type { BaseContentType } from "./base";
4
+ import type { DataPacks, ExpirationData } from "./props";
5
5
  type SimpleContentTypeProp<ContentType> = SearchFrom & {
6
6
  /** An array of Griddo fields. */
7
7
  fields: [
@@ -1,11 +1,11 @@
1
+ import type __AT__ from "@/autotypes";
1
2
  import type { Fields } from "../..";
2
3
  import type { FormFieldArray, Source } from "../api-response-fields";
4
+ import type { UIFormTemplateFields } from "../schema-fields/ui-form-template-fields";
5
+ import type { UITemplateFields } from "../schema-fields/ui-template-fields";
3
6
  import type { BaseUI } from "./base";
4
7
  import type { FormTemplateCategoryEntry } from "./FormCategories";
5
8
  import type { ConfigTabs, Dimension, Thumbnails } from "./props";
6
- import type { UIFormTemplateFields } from "../schema-fields/ui-form-template-fields";
7
- import type { UITemplateFields } from "../schema-fields/ui-template-fields";
8
- import type __AT__ from "@/autotypes";
9
9
  interface ComponentAndModuleBase extends BaseUI {
10
10
  /** Type of schema. */
11
11
  schemaType: "component" | "module" | "template" | "formComponent";
@@ -1,5 +1,5 @@
1
- import type { DataPacks, Thumbnails, _AutoTypes } from "./props";
2
1
  import type __AT__ from "@/autotypes";
2
+ import type { _AutoTypes, DataPacks, Thumbnails } from "./props";
3
3
  interface BaseContentType extends _AutoTypes {
4
4
  /** Title for the Content Type */
5
5
  title: string;
@@ -1,6 +1,6 @@
1
+ import type __AT__ from "@/autotypes";
1
2
  import type { UIFields } from "../schema-fields/ui-fields";
2
3
  import type { NonEmptyArray } from "../utilities";
3
- import type __AT__ from "@/autotypes";
4
4
  type DataPacks = {
5
5
  /** Sets the Data Packs to which this schema belongs. */
6
6
  dataPacks?: NonEmptyArray<__AT__.Datapacks> | null;
@@ -59,4 +59,4 @@ interface GriddoTheme {
59
59
  /** Instance themes array */
60
60
  themes: Array<Theme>;
61
61
  }
62
- export type { Primitive, PrimitivesObj, Primitives, BaseThemeBase, BaseThemeWithColorScheme, BaseThemeNormal, BaseTheme, GlobalTheme, Theme, GriddoTheme, };
62
+ export type { BaseTheme, BaseThemeBase, BaseThemeNormal, BaseThemeWithColorScheme, GlobalTheme, GriddoTheme, Primitive, Primitives, PrimitivesObj, Theme, };
@@ -6,4 +6,4 @@ type ContentTypeNameOfUnion<T> = T extends {
6
6
  __contentTypeName: string;
7
7
  } ? T["__contentTypeName"] : never;
8
8
  type Replace<S extends string, From extends string, To extends string> = From extends "" ? S : S extends `${infer Start}${From}${infer Rest}` ? `${Start}${To}${Replace<Rest, From, To>}` : S;
9
- export type { NonEmptyArray, DistributiveOmit, PartiallyRequired, KeysOfUnion, ContentTypeNameOfUnion, Replace, };
9
+ export type { ContentTypeNameOfUnion, DistributiveOmit, KeysOfUnion, NonEmptyArray, PartiallyRequired, Replace, };
@@ -17,4 +17,10 @@ declare function getLangFromLocalStorage(): number | null;
17
17
  * @returns a string with the params concatenated
18
18
  */
19
19
  declare function concatParams({ baseUrl, params }: ConcatParams): string;
20
- export { concatParams, getLangFromLocalStorage, getSiteID, getToken, isLocalStorageAvailable, };
20
+ /**
21
+ * A v4 UUID. `crypto.randomUUID` only exists in secure contexts (HTTPS or
22
+ * localhost) and in modern browsers, so fall back to `getRandomValues`, which
23
+ * is available everywhere.
24
+ */
25
+ declare function randomUUID(): string;
26
+ export { concatParams, getLangFromLocalStorage, getSiteID, getToken, isLocalStorageAvailable, randomUUID, };
@@ -0,0 +1,15 @@
1
+ /*! react-aspect-ratio 1.1.9 | MIT License | Copyright (c) 2017 Roderick Hsiao */
2
+ /**
3
+ * Vendored from react-aspect-ratio 1.1.9 (`AspectRatio`, the React >= 15.6
4
+ * export), MIT © Roderick Hsiao — see ./LICENSE.
5
+ * https://github.com/roderickhsiao/react-aspect-ratio
6
+ *
7
+ * Its 2.x line requires React 19, which core does not support yet.
8
+ */
9
+ import * as React from "react";
10
+ import "./aspect-ratio.css";
11
+ type AspectRatioProps = React.ComponentProps<"div"> & {
12
+ ratio?: string | number;
13
+ };
14
+ declare const AspectRatio: React.ForwardRefExoticComponent<Omit<AspectRatioProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
15
+ export { AspectRatio };
package/package.json CHANGED
@@ -1,16 +1,8 @@
1
1
  {
2
2
  "name": "@griddo/core",
3
- "description": "Reload version of Griddo Core",
3
+ "description": "Components, hooks and types for Griddo instances",
4
4
  "license": "UNLICENSED",
5
- "version": "12.11.0",
6
- "authors": [
7
- "Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
8
- "Diego M. Béjar <diego.bejar@secuoyas.com>",
9
- "Francis Vega <francis.vega@secuoyas.com>",
10
- "Gonzalo Hernández <gonzalo.hernandez@secuoyas.com>",
11
- "Sergio Ródenas <sergio.rodenas@secuoyas.com>",
12
- "Txema León <txema.leon@secuoyas.com>"
13
- ],
5
+ "version": "12.11.1-rc.0",
14
6
  "homepage": "https://griddo.io",
15
7
  "repository": {
16
8
  "type": "git",
@@ -19,7 +11,6 @@
19
11
  "main": "dist/index.js",
20
12
  "types": "dist/index.d.ts",
21
13
  "bin": {
22
- "griddo-autotypes-legacy": "dist/autotypes.js",
23
14
  "griddo-autotypes": "dist/autotypes.mjs"
24
15
  },
25
16
  "exports": {
@@ -30,75 +21,46 @@
30
21
  }
31
22
  },
32
23
  "scripts": {
33
- "// CORE (JSX) EXPORT": "",
34
- "build:core": "rollup -c --sourcemap --bundleConfigAsCjs",
35
- "prepare": "yarn build",
36
- "// MONOREPO SCRIPTS": "",
37
- "build": "npm run build:core",
24
+ "prepare": "npm run build",
25
+ "build": "rollup -c --sourcemap --bundleConfigAsCjs",
38
26
  "clean": "rm -rf ./dist",
39
- "// DEV": "",
40
27
  "watch": "rollup -cw --bundleConfigAsCjs",
41
- "// TEST": "",
42
28
  "test": "vitest run",
43
29
  "test:watch": "vitest",
44
30
  "test:coverage": "vitest run --coverage",
45
- "// TEST HOOKS": "",
46
- "test:hooks": "vitest run src/hooks/__tests__",
47
- "test:hooks:watch": "vitest src/hooks/__tests__",
48
- "test:hooks:coverage": "vitest run src/hooks/__tests__ --coverage",
49
- "// LINTER": "",
50
- "run:lint": "eslint .",
51
- "// FORMATTER": "",
52
- "run:format": "prettier --write ."
31
+ "lint": "biome check --write",
32
+ "format": "biome format --write"
53
33
  },
54
34
  "dependencies": {
55
- "kleur": "3.0.3",
56
- "prettier": "3.6.2",
57
- "react-aspect-ratio": "1.1.8",
58
- "tsx": "4.20.6"
35
+ "prettier": "3.9.9",
36
+ "tsx": "4.23.15"
59
37
  },
60
38
  "devDependencies": {
61
- "@babel/core": "7.26.0",
62
- "@babel/preset-env": "7.26.0",
63
- "@babel/preset-react": "7.26.3",
64
- "@eslint/js": "9.30.1",
65
- "@rollup/plugin-babel": "6.0.4",
66
- "@rollup/plugin-commonjs": "28.0.1",
39
+ "@biomejs/biome": "2.5.14",
40
+ "@rollup/plugin-commonjs": "29.0.3",
67
41
  "@rollup/plugin-json": "6.1.0",
68
- "@rollup/plugin-node-resolve": "15.3.0",
69
- "@rollup/plugin-replace": "6.0.1",
70
- "@rollup/plugin-terser": "0.4.4",
71
- "@rollup/plugin-typescript": "9.0.2",
72
- "@testing-library/jest-dom": "^6.6.3",
73
- "@testing-library/react": "13.4.0",
74
- "@types/node": "24.0.10",
75
- "@typescript-eslint/eslint-plugin": "^8.0.0",
76
- "@typescript-eslint/parser": "^8.0.0",
77
- "@vitest/coverage-v8": "^3.0.0",
78
- "babel-core": "6.26.3",
79
- "babel-preset-env": "1.7.0",
80
- "babel-preset-react": "6.24.1",
81
- "babel-preset-stage-0": "6.24.1",
82
- "cheerio": "1.0.0",
83
- "esbuild": "0.24.0",
84
- "eslint": "^9.0.0",
85
- "eslint-plugin-import": "2.31.0",
86
- "eslint-plugin-node": "11.1.0",
87
- "eslint-plugin-react": "7.37.4",
88
- "eslint-plugin-react-hooks": "^4.6.0",
89
- "eslint-plugin-testing-library": "^6.2.0",
90
- "globals": "^16.0.0",
91
- "jsdom": "^25.0.0",
92
- "pkg-dir": "6.0.1",
93
- "postcss": "8.4.49",
94
- "rollup": "3.29.5",
95
- "rollup-plugin-local-resolve": "1.0.7",
42
+ "@rollup/plugin-node-resolve": "16.0.3",
43
+ "@rollup/plugin-replace": "6.0.3",
44
+ "@rollup/plugin-terser": "1.0.0",
45
+ "@rollup/plugin-typescript": "12.3.0",
46
+ "@testing-library/dom": "10.4.2",
47
+ "@testing-library/jest-dom": "7.0.1",
48
+ "@testing-library/react": "16.3.3",
49
+ "@types/node": "24.19.0",
50
+ "@types/react": "18.2.79",
51
+ "@types/react-dom": "18.2.25",
52
+ "@vitest/coverage-v8": "5.0.2",
53
+ "jsdom": "29.1.1",
54
+ "postcss": "8.5.28",
55
+ "react": "18.2.0",
56
+ "react-dom": "18.2.0",
57
+ "rollup": "4.63.5",
96
58
  "rollup-plugin-postcss": "4.0.2",
97
- "rollup-plugin-preserve-shebang": "1.0.1",
98
- "typescript": "5.7.2",
99
- "uuid": "8.3.2",
100
- "vitest": "^3.0.0",
101
- "vitest-fetch-mock": "^0.4.0"
59
+ "tslib": "2.8.1",
60
+ "typescript": "6.0.3",
61
+ "vite": "8.3.1",
62
+ "vitest": "5.0.2",
63
+ "vitest-fetch-mock": "0.4.5"
102
64
  },
103
65
  "peerDependencies": {
104
66
  "@types/react": ">=18 <19",
@@ -107,17 +69,16 @@
107
69
  "react-dom": ">=18 <19"
108
70
  },
109
71
  "engines": {
110
- "node": ">=20"
72
+ "node": ">=24.12.0"
111
73
  },
112
74
  "files": [
113
75
  "dist"
114
76
  ],
115
77
  "keywords": [
116
- "griddo",
117
- "secuoyas"
78
+ "griddo"
118
79
  ],
119
80
  "publishConfig": {
120
81
  "access": "public"
121
82
  },
122
- "gitHead": "84947272b2aeecc017658fb0463be48c44895bb1"
83
+ "gitHead": "7ac7ef01e60f52a92be0b5414c50cd60e5f0714e"
123
84
  }
package/dist/autotypes.js DELETED
@@ -1,2 +0,0 @@
1
- import e from"node:fs";import t from"node:path";import{spawn as n}from"node:child_process";import{fileURLToPath as o}from"node:url";import r from"node:process";import i from"prettier";function s(e,t,n,o){return new(n||(n=Promise))(function(r,i){function s(e){try{l(o.next(e))}catch(e){i(e)}}function a(e){try{l(o.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}l((o=o.apply(e,t||[])).next())})}function a(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var l,c;"function"==typeof SuppressedError&&SuppressedError;var p=a(function(){if(c)return l;c=1;const{FORCE_COLOR:e,NODE_DISABLE_COLORS:t,TERM:n}=process.env,o={enabled:!t&&"dumb"!==n&&"0"!==e,reset:i(0,0),bold:i(1,22),dim:i(2,22),italic:i(3,23),underline:i(4,24),inverse:i(7,27),hidden:i(8,28),strikethrough:i(9,29),black:i(30,39),red:i(31,39),green:i(32,39),yellow:i(33,39),blue:i(34,39),magenta:i(35,39),cyan:i(36,39),white:i(37,39),gray:i(90,39),grey:i(90,39),bgBlack:i(40,49),bgRed:i(41,49),bgGreen:i(42,49),bgYellow:i(43,49),bgBlue:i(44,49),bgMagenta:i(45,49),bgCyan:i(46,49),bgWhite:i(47,49)};function r(e,t){let n,o=0,r="",i="";for(;o<e.length;o++)n=e[o],r+=n.open,i+=n.close,t.includes(n.close)&&(t=t.replace(n.rgx,n.close+n.open));return r+t+i}function i(e,t){let n={open:`[${e}m`,close:`[${t}m`,rgx:new RegExp(`\\x1b\\[${t}m`,"g")};return function(t){return void 0!==this&&void 0!==this.has?(this.has.includes(e)||(this.has.push(e),this.keys.push(n)),void 0===t?this:o.enabled?r(this.keys,t+""):t+""):void 0===t?function(e,t){let n={has:e,keys:t};return n.reset=o.reset.bind(n),n.bold=o.bold.bind(n),n.dim=o.dim.bind(n),n.italic=o.italic.bind(n),n.underline=o.underline.bind(n),n.inverse=o.inverse.bind(n),n.hidden=o.hidden.bind(n),n.strikethrough=o.strikethrough.bind(n),n.black=o.black.bind(n),n.red=o.red.bind(n),n.green=o.green.bind(n),n.yellow=o.yellow.bind(n),n.blue=o.blue.bind(n),n.magenta=o.magenta.bind(n),n.cyan=o.cyan.bind(n),n.white=o.white.bind(n),n.gray=o.gray.bind(n),n.grey=o.grey.bind(n),n.bgBlack=o.bgBlack.bind(n),n.bgRed=o.bgRed.bind(n),n.bgGreen=o.bgGreen.bind(n),n.bgYellow=o.bgYellow.bind(n),n.bgBlue=o.bgBlue.bind(n),n.bgMagenta=o.bgMagenta.bind(n),n.bgCyan=o.bgCyan.bind(n),n.bgWhite=o.bgWhite.bind(n),n}([e],[n]):o.enabled?r([n],t+""):t+""}}return l=o}());const u={directory:"isDirectory",file:"isFile"};const d=(e,t)=>t[u[e]]();function m(n,{cwd:i=r.cwd(),type:s="file",allowSymlinks:a=!0}={}){var l;!function(e){if(!Object.hasOwnProperty.call(u,e))throw new Error(`Invalid type specified: ${e}`)}(s),i=(l=i)instanceof URL?o(l):l;const c=a?e.statSync:e.lstatSync;for(const e of n)try{const n=c(t.resolve(i,e),{throwIfNoEntry:!1});if(!n)continue;if(d(s,n))return e}catch{}}const y=Symbol("findUpStop");function f(e,n={}){let r=t.resolve(((i=n.cwd)instanceof URL?o(i):i)||"");var i;const{root:s}=t.parse(r),a=n.stopAt||s,l=n.limit||Number.POSITIVE_INFINITY,c=[e].flat(),p=t=>{if("function"!=typeof e)return m(c,t);const n=e(t.cwd);return"string"==typeof n?m([n],t):n},u=[];for(;;){const e=p({...n,cwd:r});if(e===y)break;if(e&&u.push(t.resolve(r,e)),r===a||u.length>=l)break;r=t.dirname(r)}return u}function g({cwd:e}={}){const n=function(e,t={}){return f(e,{...t,limit:1})[0]}("package.json",{cwd:e});return n&&t.dirname(n)}const h="Props",$="ContentType",b="List",F=(e,t,n)=>`[ WARNING ]\nThe \`${e}\` with \`key: ${t}\` has no default value in the \`${n}\` schema.\nThe \`autotypes.d.ts\` file will be generated with incomplete information.\nPlease check the schema and add a default value for this field.\n`,v=e=>`[ WARNING ]\nThe field \`${e}\` has not been implemented yet.\nPlease check the schema and make sure the field name is correct.\n`,T=t.dirname(o(import.meta.url));function C(e){return{AIReferenceField:"Fields.AIReference",FormCategorySelect:"Fields.FormCategorySelect",FormContainer:"Fields.FormContainer",FormFieldArray:"Fields.FormFieldArray",ArrayFieldGroup:"Fields.ArrayFieldGroup",AsyncCheckGroup:"Fields.AsyncCheckGroup",AsyncSelect:"Fields.AsyncSelect",CheckGroup:"Fields.CheckGroup",ColorPicker:"Fields.ColorPicker",ComponentArray:"Fields.ComponentArray",ComponentContainer:"Fields.ComponentContainer",ConditionalField:"Fields.Conditional",DateField:"Fields.Date",FieldGroup:"Fields.FieldGroup",FieldsDivider:"Fields.FieldsDivider",FileField:"Fields.File",HeadingField:"Fields.Heading",ImageField:"Fields.Image",LinkField:"Fields.Link",MultiCheckSelect:"Fields.MultiCheckSelect",MultiCheckSelectGroup:"Fields.MultiCheckSelectGroup",NoteField:"Fields.Note",NumberField:"Fields.Number",RadioGroup:"Fields.RadioGroup",ReferenceField:"Fields.Reference",RichText:"Fields.RichText",Select:"Fields.Select",SliderField:"Fields.Slider",TagsField:"Fields.Tags",TextArea:"Fields.TextArea",TextField:"Fields.Text",TimeField:"Fields.Time",ToggleField:"Fields.Toggle",UniqueCheck:"Fields.UniqueCheck",UrlField:"Fields.Url",VisualUniqueSelection:"Fields.VisualUniqueSelection",Wysiwyg:"Fields.Wysiwyg"}[e]}function k(e,t){var n;const{returnTypeName:o,generic:r}=t||{},i="hideable"in e&&Boolean(e.hideable),s=r?`<${r}>`:"",a=`${o||C(e.type)}${s}`,l=i?`Hideable<${a}>`:`${a}`;return`\n\t\t${(null===(n=e._autoType)||void 0===n?void 0:n.doc)||""}\n\t\t${`${e.key}?: ${l}`}\n\t`}const P=T.includes("node_modules");function S(e,t,n){var o,r,i,s;const a=(null===(o=n.autotypesConfig)||void 0===o?void 0:o.interfaceSuffix)||h,l=(null===(r=n.autotypesConfig)||void 0===r?void 0:r.contentTypeSuffix)||$;if("FieldsDivider"===e.type)return"// FieldsDivider";if(null===(i=e._autoType)||void 0===i?void 0:i.ignore)return"// Ignored by AutoType.ignore";const{type:c,_autoType:p,key:u}=e,{hasDistributorData:d,getStaticData:m}=n;if(!c||!u)return"\n\t\t\t/** · (ノ-_-)ノ ミ ┴┴ You forgot to write the `type` | `key` or some mandatory prop */\n\t\t";if("DateField"===c||"FileField"===c||"ImageField"===c||"NoteField"===c||"NumberField"===c||"RichText"===c||"SliderField"===c||"TagsField"===c||"TextArea"===c||"TextField"===c||"TimeField"===c||"ToggleField"===c||"UniqueCheck"===c||"UrlField"===c||"Wysiwyg"===c)return k(e);if("MultiCheckSelect"===c){if("pageContentType"===t||"simpleContentType"===t){const t=`${e.source}${l}${a}`;return k(e,{generic:`Relations, FromList, ${t}<false, false>, FromDistributor`})}return k(e,{generic:"true"})}if("AsyncCheckGroup"===c){if("pageContentType"===t||"simpleContentType"===t){const t=`${e.source}${l}${a}`;return k(e,{generic:`Relations, FromList, ${t}<false, false>, FromDistributor`})}return k(e,{generic:"true"})}if("MultiCheckSelectGroup"===c){const t=[e.elements.map(e=>`"${e.key}"`).join("|"),null===(s=e._autoType)||void 0===s?void 0:s.relations].join(",");return k(e,{generic:t})}if("ColorPicker"===c)return e.isThemePalette?k(e,{returnTypeName:"Fields.ColorPickerFixed"}):k(e);if("HeadingField"===c||"RadioGroup"===c||"Select"===c){const{options:t}=e,n=function(e){return e.map(({value:e})=>"string"==typeof e?`"${e}"`:e).join("|")}(t);return k(e,{generic:n})}if("CheckGroup"===c){const{options:t}=e,n=function(e){return e.map(({name:e})=>"string"==typeof e?`"${e}"`:e).join("|")}(t);return k(e,{generic:n})}if("LinkField"===c){const{whiteList:t}=e;let o="";if(t.length>1&&"default"in n.schema){const t=n.schema.default[e.key].modal,r=Object.keys(t).map(e=>`${e}?: ${t[e].component}${a}`).join(",");o=`{${r}}`}else o=`${t[0]}${a}`;return k(e,{generic:o})}if("AsyncSelect"===c){if("entity"in e&&"menu_containers"===e.entity)return`\n${u}?: Menu`;if("pageContentType"===t||"simpleContentType"===t){const t=`${e.source}${l}${a}`;return k(e,{generic:`Relations, FromList, ${t}<false, false>, FromDistributor`})}return`\n${u}?: Fields.AsyncSelect;`}if("FieldGroup"===c)return`\n\t\t\t// << ${c}\n\t\t\t${e.fields.map(e=>S(e,t,n)).join("")}\n\t\t\t// end >>\n\t\t`;if("ArrayFieldGroup"===c){return`\n\t\t\t\n${(null==p?void 0:p.doc)||""}\n${u}?: Fields.ArrayFieldGroup<{${e.fields.map(e=>S(e,t,Object.assign(Object.assign({},n),{_from:"ArrayFieldGroup",_fromKey:u}))).join("")}}>\n\t\t`}if("ConditionalField"===c){const o=e.fields.map(e=>S(e,t,n)),r=(null==p?void 0:p.doc)||"",i="hideable"in e&&e.hideable,s=i?">":"";return`\n\t\t\t// << ${c}\n\t\t\t\n${r}\n${u}?: ${i?"Hideable<":""}${C(c)}<${e.options.map(e=>"string"==typeof e.value?`"${e.value}"`:e.value).join("|")}>${s};\n\t\t\t${o.join("")}\n\t\t\t// end >>\n\t\t`}if("FormFieldArray"===c){const o="template"===t||"pageContentType"===t?"TemplateSection":"formTemplate"===t?"FormFieldArray":"ComponentArray",r="template"===t?"":"?",{key:i,_autoType:s,whiteList:l}=e,c=(null==s?void 0:s.doc)||"",p=(e,t,n)=>e.filter(e=>e&&"schemaType"in e&&"module"===(null==e?void 0:e.schemaType)?(null==e?void 0:e.sectionList)&&!!(null==e?void 0:e.sectionList[t]):void 0).map(e=>({t:null==e?void 0:e.sectionList[t].filter(e=>e===n),m:null==e?void 0:e.component})).filter(e=>{var t;return null===(t=null==e?void 0:e.t)||void 0===t?void 0:t.length}).map(e=>null==e?void 0:e.m).filter(Boolean);let u="";"template"===t&&(u=p(n.moduleSchemas,n.schema.component,i).join("|"));return`\n${c}\n${i}${r}: Fields.${o}<${[...new Set([...u.split("|"),...l])].filter(Boolean).map(e=>`${e}${a}`).join("|")}>;`}if("ComponentArray"===c){const o="template"===t||"pageContentType"===t?"TemplateSection":"ComponentArray",r="template"===t?"":"?",i=e,{key:s,_autoType:l,whiteList:c}=i,p=(null==l?void 0:l.doc)||"",u=(e,t,n)=>e.filter(e=>{if(e&&"schemaType"in e&&"module"===(null==e?void 0:e.schemaType))return(null==e?void 0:e.sectionList)&&!!(null==e?void 0:e.sectionList[t])}).map(e=>({t:null==e?void 0:e.sectionList[t].filter(e=>e===n),m:null==e?void 0:e.component})).filter(e=>{var t;return null===(t=null==e?void 0:e.t)||void 0===t?void 0:t.length}).map(e=>null==e?void 0:e.m).filter(Boolean);let d="";"template"===t&&(d=u(n.moduleSchemas,n.schema.component,s).join("|"));return`\n${p}\n${s}${r}: Fields.${o}<${[...new Set([...d.split("|"),...c])].filter(Boolean).map(e=>`${e}${a}`).join("|")}>;`}if("ComponentContainer"===c&&("object"===t||"component"===t||"module"===t||"template"===t||"pageContentType"===t)){const t=e,{whiteList:o}=t;let r="";if(o.length>1&&"default"in n.schema)if("ArrayFieldGroup"===n._from){const t=n._fromKey;void 0===n.schema.default[t]&&console.warn(F(e.type,e.key,n.schema.component));r="{"+n.schema.default[t].map(t=>t[e.key]?Object.keys(t[e.key]).map(n=>`${n}?:${t[e.key][n].component}${a}`):(console.warn(F(e.type,e.key,n.schema.component)),"")).join("")+"}"}else if(void 0===n.schema.default[e.key])console.warn(F(e.type,e.key,n.schema.component)),r="";else{const t=n.schema.default[e.key],o=Object.keys(t).map(e=>`${e}?: ${t[e].component}${a};`).join("");r=`{${o}}`}else r=`${o[0]}${a}`;return k(e,{generic:r})}if("FormContainer"===c&&("object"===t||"component"===t||"module"===t||"template"===t||"pageContentType"===t)){return`\n${(null==p?void 0:p.doc)||""}\n${u}?: Fields.FormContainer<FormTemplates${a}>;`}if("ReferenceField"===c){const t=e.sources||[{structuredData:void 0}],n=Array.isArray(t)&&t.map(e=>e.structuredData?`${e.structuredData}${l}${a}`:"unknown").join("|")||"";return`\n\t\t \t${k(e,{generic:n})}\n\t\t \t${d||m?`queriedItems?: Fields.QueriedData<${n}>;`:""}\n\t\t `}if("VisualUniqueSelection"===c){const t=e.options[0],n=e.options[0];let o="";if(t.value){o=e.options.map(e=>`"${e.value}"`).join("|")}if(n.theme){o=e.options[0].options.map(e=>`"${e.value}"`).join("|")}return k(e,{generic:o})}return"FormCategorySelect"===c?`${u}?: Fields.FormCategorySelect<FormCategoryLabels>`:"AIReferenceField"===c?`${u}?: Fields.AIReference`:(console.warn(v(e.type)),"")}class j{setParser(e){this.parser=e}parse(e,t){var n;return(null===(n=this.parser)||void 0===n?void 0:n.parse(e,t))||""}}const x={ComponentsNameParser:class{parse(e){const t=Object.keys(e).map(e=>`"${e}"`);return t.length?`export type Components = ${t.join("|")}`:""}},DataPacksCategoryParser:class{parse(e){return e?`export type DatapacksCategories = ${Object.keys(e).map(e=>`"${e}"`).join("|")}`:""}},DataPacksParser:class{parse(e){return e?`export type Datapacks = ${Object.keys(e).map(e=>`"${e}"`).join("|")}`:""}},DataTemplatesNameParser:class{parse(e){const t=Object.keys(e).map(t=>"detail"===e[t].type.mode?`"${t}"`:"").filter(Boolean);return t.length?`export type DetailTemplates = ${t.join("|")}`:""}},FormCategoryNamesParser:class{parse(e){const t=e.map(({value:e})=>`"${e}"`);return t.length?`export type FormCategoryLabels = ${t.join("|")}`:""}},FormFieldsParser:class{parse(e,t){var n;const o=(null===(n=t.autotypes)||void 0===n?void 0:n.interfaceSuffix)||h,r=Object.keys(e).map(e=>`"${e}"`),i=Object.keys(e).map(e=>`${e}${o}`);return r.length?`export type FormFields = ${r.join("|")}\nexport type FormFields${o} = ${i.join("|")}\n`:""}},FormTemplatesParser:class{parse(e,t){var n;const o=(null===(n=t.autotypes)||void 0===n?void 0:n.interfaceSuffix)||h,r=Object.keys(e).map(e=>`"${e}"`),i=Object.keys(e).map(e=>`${e}${o}`);return r.length?`export type FormTemplates = ${r.join("|")}\nexport type FormTemplates${o} = ${i.join("|")}\n`:""}},LanguagesParser:class{parse(e){const t=Object.keys(e);return`\n\t\texport interface SiteLanguage {\n\t\t\tdomain: { id: number; url: string; slug: string };\n\t\t\thome: string;\n\t\t\tid: number;\n\t\t\tisDefault: boolean;\n\t\t\tlabel: ${t.map(t=>{var n;return`"${null===(n=e[t])||void 0===n?void 0:n.label}"`}).join("|")};\n\t\t\tlanguage: ${t.map(t=>{var n;return`"${null===(n=e[t])||void 0===n?void 0:n.name}"`}).join("|")};\n\t\t\tlocale: ${t.map(e=>`"${e}"`).join("|")}\n\t\t\tpath: string;\n\t\t}\n\t`}},MenuItemsParser:class{getMenuItemsProps(e,t){return e?e.map(e=>S(e,"object",{hasDistributorData:!1,getStaticData:!1,moduleSchemas:[],schema:{},allSchemas:{},autotypesConfig:t})).join(""):""}parse(e,t){var n,o;const r=null===(n=null==e?void 0:e.link)||void 0===n?void 0:n.fields,i=null===(o=null==e?void 0:e.group)||void 0===o?void 0:o.fields;return`\n\t\texport interface InstanceMenuItems {\n\t\t\tlink:{\n\t\t\t\t${this.getMenuItemsProps(r,t.autotypes)}\n\t\t\t\tconfig?: {\n\t\t\t\t\theaderStyle?: string;\n\t\t\t\t\tfooterStyle?: string;\n\t\t\t\t\ttype?: "link";\n\t\t\t\t};\n\t\t\t};\n\t\t\tgroup: {\n\t\t\t\turl?: null;\n\t\t\t\t${this.getMenuItemsProps(i,t.autotypes)}\n\t\t\t\tconfig?: {\n\t\t\t\t\theaderStyle?: string;\n\t\t\t\t\tfooterStyle?: string;\n\t\t\t\t\ttype?: "group";\n\t\t\t\t};\n\t\t\t};\n\t\t}\n\t\texport type LinkMenuElement = Fields.BaseLinkElement<InstanceMenuItems> & InstanceMenuItems["link"];\n\t\texport type GroupMenuElement = Fields.BaseLinkElement<InstanceMenuItems> & InstanceMenuItems["group"];\n\t\texport type MenuElement = LinkMenuElement | GroupMenuElement;\n\t\texport type Menu = Fields.Menu<InstanceMenuItems>;\n\t`}},ModuleCateogiresParser:class{parse(e){return e?`export type ModuleCategories = ${e.map(e=>`"${e.value}"`).join("|")}`:""}},ModulesNameParser:class{parse(e){const t=Object.keys(e).map(e=>`"${e}"`);return t.length?`export type Modules = ${t.join("|")}`:""}},PageContentTypeParser:class{parse(e){const t=Object.keys(e).map(e=>`"${e}"`);return t.length?`export type PageContentTypes = ${t.join("|")}`:""}},PageDataPropsParser:class{parse(e,t){var n,o;const r=(null===(n=t.autotypes)||void 0===n?void 0:n.contentTypeSuffix)||$,i=(null===(o=t.autotypes)||void 0===o?void 0:o.interfaceSuffix)||h,s=Object.keys(e).map(e=>`${e}${r}${i}`);return s.length?`export type Page${r}${i} = ${s.join("|")}`:""}},SimpleContentTypeParser:class{parse(e){const t=Object.keys(e).map(e=>`"${e}"`);return t.length?`export type SimpleContentTypes = ${t.join("|")}`:""}},SimpleDataPropsParser:class{parse(e,t){var n,o;const r=(null===(n=t.autotypes)||void 0===n?void 0:n.contentTypeSuffix)||$,i=(null===(o=t.autotypes)||void 0===o?void 0:o.interfaceSuffix)||h,s=Object.keys(e).map(e=>`${e}${r}${i}`);return s.length?`export type Simple${r}${i} = ${s.join("|")}`:""}},SubthemesParser:class{parse(e){return Array.isArray(e)&&e.length?`export type Subthemes = ${e.map(e=>`"${e}"`).join("|")}`:""}},TaxonomyParser:class{parse(e){const t=Object.keys(e).map(e=>`"${e}"`);return t.length?`export type TaxonomyContentTypes = ${t.join("|")}`:""}},TaxonomyPropsParser:class{parse(e,t){var n,o;const r=(null===(n=t.autotypes)||void 0===n?void 0:n.contentTypeSuffix)||$,i=(null===(o=t.autotypes)||void 0===o?void 0:o.interfaceSuffix)||h,s=Object.keys(e).map(e=>`${e}${r}${i}`);return s.length?`export type Taxonomy${r}${i} = ${s.join("|")}`:""}},TemplateSectionListParser:class{parse(e){const t=[];for(const n in e){const o=e[n],r=o.content.filter(e=>"ComponentArray"===e.type).map(({key:e})=>`"${e}"`).filter(Boolean),i=r&&(null==r?void 0:r.length)>0?`${o.component}?: NonEmptyArray<${r.join("|")}>;`:"";t.push(i)}return`\n\t\t\texport type SectionList = { ${t.join("")} }\n\t\t`}},TemplatesNameParser:class{parse(e){const t=Object.keys(e).map(e=>`"${e}"`);return t.length?`export type Templates = ${t.join("|")}`:""}},ThemesParser:class{parse(e){return Array.isArray(e)&&e.length?`export type Themes = ${e.map(e=>`"${e.value}"`).join("|")}`:""}},UIAndDataPropsParser:class{parse(e,t){var n;const o=(r=e,Object.keys(r).map(e=>Object.assign(Object.assign({},r[e]),{component:e})));var r;const i=(null===(n=t.autotypes)||void 0===n?void 0:n.interfaceSuffix)||h,{ARRAY_OF_MODULE_SCHEMAS:s}=function(e){const t=e.map(e=>{if("schemaType"in e&&"module"===e.schemaType)return e}).filter(Boolean);return{ARRAY_OF_MODULE_SCHEMAS:t}}(o);return o.map(e=>{var n;let o={kind:"component",contentTypeSuffixStr:"",contentTypeName:"",contentTypeKind:"",relatedContentTypeNames:"",componentName:"",hasDistributorData:!1,getStaticData:!1,interfaceForPublicAPI:"",relationsGeneric:(null===(n=e._autoType)||void 0===n?void 0:n.relations)?"<Relations = unknown, FromList = unknown, FromDistributor = true>":""};if(function(e){return"fromPage"in e}(e)){const n=function(e,t){var n,o,r;const i=[],s=[],a=[],l=e.fromPage?"pageContentType":"simpleContentType",c=(null===(n=t.autotypes)||void 0===n?void 0:n.contentTypeSuffix)||$,p=(null===(o=t.autotypes)||void 0===o?void 0:o.publicApiSuffix)||b,u=(null===(r=t.autotypes)||void 0===r?void 0:r.interfaceSuffix)||h;"pageContentType"===l&&i.push(`"${e.component}"`);"simpleContentType"!==l||e.taxonomy||s.push(`"${e.component}"`);"simpleContentType"===l&&e.taxonomy&&a.push(`"${e.component}"`);let d="";if("schema"in e){const t=e.schema.fields.map(e=>"source"in e&&(null==e?void 0:e.source)).filter(Boolean);d=t.length?`__relatedContentTypeNames: ${JSON.stringify(t)}`:""}const m="<Relations = unknown, FromList = unknown, FromDistributor = true>",y=`\n\t\t\t\t/** Type to be consumed by public API: useList(), etc.. */\n\t\t\t\texport type ${e.component}${c}${p}${u}<R extends Core.ContentTypeRelations = false> = ${e.component}${c}${u}<R, true>;\n\t\t\t\t`;return{kind:l,componentName:"",contentTypeName:`__contentTypeName: "${e.component}";`,contentTypeKind:`__contentTypeKind: "${l}";`,contentTypeSuffixStr:c,getStaticData:!1,hasDistributorData:!1,relatedContentTypeNames:d,relationsGeneric:m,interfaceForPublicAPI:y}}(e,t);o=Object.assign(Object.assign({},o),n)}if(function(e){return"schemaType"in e}(e)){const t=function(e){return{kind:e.schemaType,componentName:`component: "${e.component}"`,contentTypeName:"",contentTypeKind:"",contentTypeSuffixStr:"",relatedContentTypeNames:"",relationsGeneric:"",interfaceForPublicAPI:"",hasDistributorData:!!e.default.hasDistributorData,getStaticData:!!e.default.getStaticData}}(e);o=Object.assign(Object.assign({},o),t)}const r=function(e,t,n,o,r){return function(e){if("fromPage"in e)return e.taxonomy?[]:e.schema.fields;if("template"===e.schemaType){return[...e.content||[],...e.config||[]]}if("formTemplate"===e.schemaType){return[...e.content||[],...e.config||[]]}if("component"===e.schemaType||"module"===e.schemaType||"formComponent"===e.schemaType)return e.configTabs.flatMap(e=>e.fields);throw new Error(`Wrong schema ${JSON.stringify(e,null,2)}`)}(e).map(i=>S(i,o.kind,{hasDistributorData:o.hasDistributorData,getStaticData:o.getStaticData,moduleSchemas:t,schema:e,allSchemas:n,autotypesConfig:r})).filter(Boolean).join("")}(e,s,e,o,t.autotypes);return`\n\t\t\t\texport interface ${e.component}${o.contentTypeSuffixStr}${i}${o.relationsGeneric} ${function(e){const t=function(e){return"schemaType"in e&&"template"===e.schemaType&&("list"===e.type.mode||"paginated-data"===e.type.mode)}(e)?"Fields.ExtraListTemplateProps":"";return n=[t],n.filter(e=>e.length).length<1?"":`extends ${n.join(", ")}`;var n}(e)} {\n\t\t\t\t\t${o.contentTypeName}\n\t\t\t\t\t${o.contentTypeKind}\n\t\t\t\t\t${o.relatedContentTypeNames}\n\t\t\t\t\t${o.componentName}\n\t\t\t\t\t${r}\n\t\t\t\t\t${function(e){return"fromPage"in e&&!e.fromPage&&!0===e.taxonomy}(e)?"title?: string; code?: string":""}\n\t\t\t\t}\n\t\t\t\t${o.interfaceForPublicAPI}\n\t\t\t`}).join("")}}};s(void 0,void 0,void 0,function*(){try{const r=function(){const e=T,n=P?"../../../":"../griddo-components";return t.resolve(g({cwd:e}),n)}(),a=t.join(r,"griddo.config.ts");let l;try{const e=yield(o=a,new Promise((e,r)=>{const i=t.resolve(o),s=n(process.execPath,["--import","tsx","-e",`import('${i}').then(m => console.log(JSON.stringify(m.default ?? m)))`],{stdio:["ignore","pipe","inherit"]});let a="";s.stdout.on("data",e=>{a+=e}),s.on("error",r),s.on("close",t=>{if(0!==t)return r(new Error(`Config process exited with code ${t}`));try{e(JSON.parse(a))}catch(e){r(e)}})}));l=e&&"object"==typeof e&&"default"in e?e.default:e}catch(e){console.error("Failed to load griddo.config.ts:",e),process.exit(1)}const{schemas:{config:{languages:c,menuItems:u,themes:d,subthemes:m,moduleCategories:y},contentTypes:{dataPacks:f,dataPacksCategories:h,structuredData:$},ui:{components:b,modules:F,templates:v},forms:C}}=l,{categoryContentTypes:k,pageContentTypes:S,simpleContentTypes:_}=function(e){return{categoryContentTypes:function(e){const t={};for(const n in e){const o=e[n];!o.fromPage&&o.taxonomy&&(t[n]=o)}return t}(e),pageContentTypes:function(e){const t={};for(const n in e){const o=e[n];o.fromPage&&(t[n]=o)}return t}(e),simpleContentTypes:function(e){const t={};for(const n in e){const o=e[n];o.fromPage||o.taxonomy||(t[n]=o)}return t}(e)}}(l.schemas.contentTypes.structuredData),A=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},b),F),v),$),(null==C?void 0:C.templates)||{}),(null==C?void 0:C.fields)||{}),D=function(e){const t=new j;return e.map(e=>(t.setParser(new e.parser),t.parse(e.schema,e.config)))}([{schema:u,parser:x.MenuItemsParser,config:l},{schema:c,parser:x.LanguagesParser,config:l},{schema:A,parser:x.UIAndDataPropsParser,config:l},{schema:m||{},parser:x.SubthemesParser,config:l},{schema:S,parser:x.PageContentTypeParser,config:l},{schema:_,parser:x.SimpleContentTypeParser,config:l},{schema:k,parser:x.TaxonomyParser,config:l},{schema:b,parser:x.ComponentsNameParser,config:l},{schema:F,parser:x.ModulesNameParser,config:l},{schema:(null==C?void 0:C.templates)||{},parser:x.FormTemplatesParser,config:l},{schema:(null==C?void 0:C.fields)||{},parser:x.FormFieldsParser,config:l},{schema:(null==C?void 0:C.categories)||[],parser:x.FormCategoryNamesParser,config:l},{schema:v,parser:x.TemplatesNameParser,config:l},{schema:v,parser:x.DataTemplatesNameParser,config:l},{schema:v,parser:x.TemplateSectionListParser,config:l},{schema:y,parser:x.ModuleCateogiresParser,config:l},{schema:f,parser:x.DataPacksParser,config:l},{schema:h,parser:x.DataPacksCategoryParser,config:l},{schema:k,parser:x.TaxonomyPropsParser,config:l},{schema:_,parser:x.SimpleDataPropsParser,config:l},{schema:S,parser:x.PageDataPropsParser,config:l},{schema:d,parser:x.ThemesParser,config:l}]),w=yield function(e){return s(this,void 0,void 0,function*(){return(yield i.format(e,{useTabs:!0,printWidth:120,parser:"typescript"})).replace(/^\s*\n/gm,"")})}(`\n\t\t\t/* eslint-disable @typescript-eslint/ban-types */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable no-use-before-define */\n//\n//\n// ' ____\n// /\\ \\\n// º / /\\ \\\n// ' / / \\ _>\n// ' _\\ \\__> \\__\n// ' O ( __;·;______ ) AutoTypes\n// O º, | , , \\ \\\\ ·..~~.·~.·\n// ,,, /| , , /\\ <\\\\\n// \\''\\-' ⎩, <\\/\\ \\ \\\n// \\_/ /\\_____⎩/ > > >\n// '___' <_(_)__> / \\ <\n// / / ´ \\ | \\___//\\\\\n// / / | / > > \\\\\n// · ··~~~~·~·~~~~~~~·~··~~~~~·~·~~·~~~~·~~~~~·· · ·\n//\n// Embrace the beauty of effortless typing by indulging in the benefits of them\n// sans the actual typing!\n//\n// Behold! These dynamically generated types were conjured from the schemas\n// nestled within this repository. However, should you yearn to expand upon\n// these types, kindly abstain from doing so in this file, lest AutoTypes'\n// magic shall smite your changes with each schema modification.\n//\n// Check out the details of Griddo AutoTypes in:\n// https://griddoio.notion.site/Griddo-AutoTypes-e7420867dd2e489c8da34a493b763cd8>\n//\n// Happy magic types!\n//\nimport { Core, Fields, Hideable, NonEmptyArray } from "@griddo/core"\n//\n\n\t\t\t${D.join("\n")}\n\t\t`),O=t.join(r,"autotypes.d.ts");e.writeFileSync(O,w),console.log(`${p.green(" ✔")} AutoTypes`)}catch(e){console.log(`${p.red(" ✘")} AutoTypes`),console.log(e)}var o});
2
- //# sourceMappingURL=autotypes.js.map