@griddo/core 11.7.10 → 11.7.12-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.
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Fields } from "../..";
3
2
  import type { FetchPriority, ImageCropType, ImageDecoding, ImageFormats, ImageLoading, ImagePosition, ImageTransform } from "../../types/core";
4
3
  interface Source {
@@ -14,23 +14,23 @@ declare function useThemeColors(themeFile: Theme.GriddoTheme, props?: UseThemeCo
14
14
  id: string;
15
15
  name: string;
16
16
  selector: string;
17
- description?: string | undefined;
17
+ description?: string;
18
18
  } | {
19
19
  primitives: Theme.Primitives;
20
- preferColorScheme?: false | undefined;
20
+ preferColorScheme?: false;
21
21
  id: string;
22
22
  name: string;
23
23
  selector: string;
24
- description?: string | undefined;
24
+ description?: string;
25
25
  })[];
26
26
  preferColorScheme: true;
27
27
  id: string;
28
28
  name: string;
29
29
  selector: string;
30
- description?: string | undefined;
30
+ description?: string;
31
31
  customMedia?: {
32
32
  [key: `--${string}`]: string;
33
- } | undefined;
33
+ };
34
34
  } | {
35
35
  primitives: Theme.Primitives;
36
36
  subthemes: ({
@@ -39,23 +39,23 @@ declare function useThemeColors(themeFile: Theme.GriddoTheme, props?: UseThemeCo
39
39
  id: string;
40
40
  name: string;
41
41
  selector: string;
42
- description?: string | undefined;
42
+ description?: string;
43
43
  } | {
44
44
  primitives: Theme.Primitives;
45
- preferColorScheme?: false | undefined;
45
+ preferColorScheme?: false;
46
46
  id: string;
47
47
  name: string;
48
48
  selector: string;
49
- description?: string | undefined;
49
+ description?: string;
50
50
  })[];
51
- preferColorScheme?: false | undefined;
51
+ preferColorScheme?: false;
52
52
  id: string;
53
53
  name: string;
54
54
  selector: string;
55
- description?: string | undefined;
55
+ description?: string;
56
56
  customMedia?: {
57
57
  [key: `--${string}`]: string;
58
- } | undefined;
58
+ };
59
59
  } | {
60
60
  primitives: Theme.Primitives;
61
61
  subthemes: ({
@@ -64,20 +64,20 @@ declare function useThemeColors(themeFile: Theme.GriddoTheme, props?: UseThemeCo
64
64
  id: string;
65
65
  name: string;
66
66
  selector: string;
67
- description?: string | undefined;
67
+ description?: string;
68
68
  } | {
69
69
  primitives: Theme.Primitives;
70
- preferColorScheme?: false | undefined;
70
+ preferColorScheme?: false;
71
71
  id: string;
72
72
  name: string;
73
73
  selector: string;
74
- description?: string | undefined;
74
+ description?: string;
75
75
  })[];
76
76
  preferColorScheme: true;
77
77
  id: string;
78
78
  name: string;
79
79
  selector: string;
80
- description?: string | undefined;
80
+ description?: string;
81
81
  } | {
82
82
  primitives: Theme.Primitives;
83
83
  subthemes: ({
@@ -86,19 +86,19 @@ declare function useThemeColors(themeFile: Theme.GriddoTheme, props?: UseThemeCo
86
86
  id: string;
87
87
  name: string;
88
88
  selector: string;
89
- description?: string | undefined;
89
+ description?: string;
90
90
  } | {
91
91
  primitives: Theme.Primitives;
92
- preferColorScheme?: false | undefined;
92
+ preferColorScheme?: false;
93
93
  id: string;
94
94
  name: string;
95
95
  selector: string;
96
- description?: string | undefined;
96
+ description?: string;
97
97
  })[];
98
- preferColorScheme?: false | undefined;
98
+ preferColorScheme?: false;
99
99
  id: string;
100
100
  name: string;
101
101
  selector: string;
102
- description?: string | undefined;
102
+ description?: string;
103
103
  })[];
104
104
  export { useThemeColors };
@@ -14,23 +14,23 @@ declare function useThemeFont(themeFile: Theme.GriddoTheme, props?: UseThemeFont
14
14
  id: string;
15
15
  name: string;
16
16
  selector: string;
17
- description?: string | undefined;
17
+ description?: string;
18
18
  } | {
19
19
  primitives: Theme.Primitives;
20
- preferColorScheme?: false | undefined;
20
+ preferColorScheme?: false;
21
21
  id: string;
22
22
  name: string;
23
23
  selector: string;
24
- description?: string | undefined;
24
+ description?: string;
25
25
  })[];
26
26
  preferColorScheme: true;
27
27
  id: string;
28
28
  name: string;
29
29
  selector: string;
30
- description?: string | undefined;
30
+ description?: string;
31
31
  customMedia?: {
32
32
  [key: `--${string}`]: string;
33
- } | undefined;
33
+ };
34
34
  } | {
35
35
  primitives: Theme.Primitives;
36
36
  subthemes: ({
@@ -39,23 +39,23 @@ declare function useThemeFont(themeFile: Theme.GriddoTheme, props?: UseThemeFont
39
39
  id: string;
40
40
  name: string;
41
41
  selector: string;
42
- description?: string | undefined;
42
+ description?: string;
43
43
  } | {
44
44
  primitives: Theme.Primitives;
45
- preferColorScheme?: false | undefined;
45
+ preferColorScheme?: false;
46
46
  id: string;
47
47
  name: string;
48
48
  selector: string;
49
- description?: string | undefined;
49
+ description?: string;
50
50
  })[];
51
- preferColorScheme?: false | undefined;
51
+ preferColorScheme?: false;
52
52
  id: string;
53
53
  name: string;
54
54
  selector: string;
55
- description?: string | undefined;
55
+ description?: string;
56
56
  customMedia?: {
57
57
  [key: `--${string}`]: string;
58
- } | undefined;
58
+ };
59
59
  } | {
60
60
  primitives: Theme.Primitives;
61
61
  subthemes: ({
@@ -64,20 +64,20 @@ declare function useThemeFont(themeFile: Theme.GriddoTheme, props?: UseThemeFont
64
64
  id: string;
65
65
  name: string;
66
66
  selector: string;
67
- description?: string | undefined;
67
+ description?: string;
68
68
  } | {
69
69
  primitives: Theme.Primitives;
70
- preferColorScheme?: false | undefined;
70
+ preferColorScheme?: false;
71
71
  id: string;
72
72
  name: string;
73
73
  selector: string;
74
- description?: string | undefined;
74
+ description?: string;
75
75
  })[];
76
76
  preferColorScheme: true;
77
77
  id: string;
78
78
  name: string;
79
79
  selector: string;
80
- description?: string | undefined;
80
+ description?: string;
81
81
  } | {
82
82
  primitives: Theme.Primitives;
83
83
  subthemes: ({
@@ -86,19 +86,19 @@ declare function useThemeFont(themeFile: Theme.GriddoTheme, props?: UseThemeFont
86
86
  id: string;
87
87
  name: string;
88
88
  selector: string;
89
- description?: string | undefined;
89
+ description?: string;
90
90
  } | {
91
91
  primitives: Theme.Primitives;
92
- preferColorScheme?: false | undefined;
92
+ preferColorScheme?: false;
93
93
  id: string;
94
94
  name: string;
95
95
  selector: string;
96
- description?: string | undefined;
96
+ description?: string;
97
97
  })[];
98
- preferColorScheme?: false | undefined;
98
+ preferColorScheme?: false;
99
99
  id: string;
100
100
  name: string;
101
101
  selector: string;
102
- description?: string | undefined;
102
+ description?: string;
103
103
  })[];
104
104
  export { useThemeFont };
@@ -14,23 +14,23 @@ declare function useThemePrimitives(themeFile: Theme.GriddoTheme, props: UseThem
14
14
  id: string;
15
15
  name: string;
16
16
  selector: string;
17
- description?: string | undefined;
17
+ description?: string;
18
18
  } | {
19
19
  primitives: Theme.Primitives;
20
- preferColorScheme?: false | undefined;
20
+ preferColorScheme?: false;
21
21
  id: string;
22
22
  name: string;
23
23
  selector: string;
24
- description?: string | undefined;
24
+ description?: string;
25
25
  })[];
26
26
  preferColorScheme: true;
27
27
  id: string;
28
28
  name: string;
29
29
  selector: string;
30
- description?: string | undefined;
30
+ description?: string;
31
31
  customMedia?: {
32
32
  [key: `--${string}`]: string;
33
- } | undefined;
33
+ };
34
34
  } | {
35
35
  primitives: Theme.Primitives;
36
36
  subthemes: ({
@@ -39,23 +39,23 @@ declare function useThemePrimitives(themeFile: Theme.GriddoTheme, props: UseThem
39
39
  id: string;
40
40
  name: string;
41
41
  selector: string;
42
- description?: string | undefined;
42
+ description?: string;
43
43
  } | {
44
44
  primitives: Theme.Primitives;
45
- preferColorScheme?: false | undefined;
45
+ preferColorScheme?: false;
46
46
  id: string;
47
47
  name: string;
48
48
  selector: string;
49
- description?: string | undefined;
49
+ description?: string;
50
50
  })[];
51
- preferColorScheme?: false | undefined;
51
+ preferColorScheme?: false;
52
52
  id: string;
53
53
  name: string;
54
54
  selector: string;
55
- description?: string | undefined;
55
+ description?: string;
56
56
  customMedia?: {
57
57
  [key: `--${string}`]: string;
58
- } | undefined;
58
+ };
59
59
  } | {
60
60
  primitives: Theme.Primitives;
61
61
  subthemes: ({
@@ -64,20 +64,20 @@ declare function useThemePrimitives(themeFile: Theme.GriddoTheme, props: UseThem
64
64
  id: string;
65
65
  name: string;
66
66
  selector: string;
67
- description?: string | undefined;
67
+ description?: string;
68
68
  } | {
69
69
  primitives: Theme.Primitives;
70
- preferColorScheme?: false | undefined;
70
+ preferColorScheme?: false;
71
71
  id: string;
72
72
  name: string;
73
73
  selector: string;
74
- description?: string | undefined;
74
+ description?: string;
75
75
  })[];
76
76
  preferColorScheme: true;
77
77
  id: string;
78
78
  name: string;
79
79
  selector: string;
80
- description?: string | undefined;
80
+ description?: string;
81
81
  } | {
82
82
  primitives: Theme.Primitives;
83
83
  subthemes: ({
@@ -86,19 +86,19 @@ declare function useThemePrimitives(themeFile: Theme.GriddoTheme, props: UseThem
86
86
  id: string;
87
87
  name: string;
88
88
  selector: string;
89
- description?: string | undefined;
89
+ description?: string;
90
90
  } | {
91
91
  primitives: Theme.Primitives;
92
- preferColorScheme?: false | undefined;
92
+ preferColorScheme?: false;
93
93
  id: string;
94
94
  name: string;
95
95
  selector: string;
96
- description?: string | undefined;
96
+ description?: string;
97
97
  })[];
98
- preferColorScheme?: false | undefined;
98
+ preferColorScheme?: false;
99
99
  id: string;
100
100
  name: string;
101
101
  selector: string;
102
- description?: string | undefined;
102
+ description?: string;
103
103
  })[];
104
104
  export { useThemePrimitives };
@@ -7,23 +7,23 @@ export declare const filterThemePrimitivesByType: (themes: Array<Theme.GlobalThe
7
7
  id: string;
8
8
  name: string;
9
9
  selector: string;
10
- description?: string | undefined;
10
+ description?: string;
11
11
  } | {
12
12
  primitives: Theme.Primitives;
13
- preferColorScheme?: false | undefined;
13
+ preferColorScheme?: false;
14
14
  id: string;
15
15
  name: string;
16
16
  selector: string;
17
- description?: string | undefined;
17
+ description?: string;
18
18
  })[];
19
19
  preferColorScheme: true;
20
20
  id: string;
21
21
  name: string;
22
22
  selector: string;
23
- description?: string | undefined;
23
+ description?: string;
24
24
  customMedia?: {
25
25
  [key: `--${string}`]: string;
26
- } | undefined;
26
+ };
27
27
  } | {
28
28
  primitives: Theme.Primitives;
29
29
  subthemes: ({
@@ -32,23 +32,23 @@ export declare const filterThemePrimitivesByType: (themes: Array<Theme.GlobalThe
32
32
  id: string;
33
33
  name: string;
34
34
  selector: string;
35
- description?: string | undefined;
35
+ description?: string;
36
36
  } | {
37
37
  primitives: Theme.Primitives;
38
- preferColorScheme?: false | undefined;
38
+ preferColorScheme?: false;
39
39
  id: string;
40
40
  name: string;
41
41
  selector: string;
42
- description?: string | undefined;
42
+ description?: string;
43
43
  })[];
44
- preferColorScheme?: false | undefined;
44
+ preferColorScheme?: false;
45
45
  id: string;
46
46
  name: string;
47
47
  selector: string;
48
- description?: string | undefined;
48
+ description?: string;
49
49
  customMedia?: {
50
50
  [key: `--${string}`]: string;
51
- } | undefined;
51
+ };
52
52
  } | {
53
53
  primitives: Theme.Primitives;
54
54
  subthemes: ({
@@ -57,20 +57,20 @@ export declare const filterThemePrimitivesByType: (themes: Array<Theme.GlobalThe
57
57
  id: string;
58
58
  name: string;
59
59
  selector: string;
60
- description?: string | undefined;
60
+ description?: string;
61
61
  } | {
62
62
  primitives: Theme.Primitives;
63
- preferColorScheme?: false | undefined;
63
+ preferColorScheme?: false;
64
64
  id: string;
65
65
  name: string;
66
66
  selector: string;
67
- description?: string | undefined;
67
+ description?: string;
68
68
  })[];
69
69
  preferColorScheme: true;
70
70
  id: string;
71
71
  name: string;
72
72
  selector: string;
73
- description?: string | undefined;
73
+ description?: string;
74
74
  } | {
75
75
  primitives: Theme.Primitives;
76
76
  subthemes: ({
@@ -79,20 +79,20 @@ export declare const filterThemePrimitivesByType: (themes: Array<Theme.GlobalThe
79
79
  id: string;
80
80
  name: string;
81
81
  selector: string;
82
- description?: string | undefined;
82
+ description?: string;
83
83
  } | {
84
84
  primitives: Theme.Primitives;
85
- preferColorScheme?: false | undefined;
85
+ preferColorScheme?: false;
86
86
  id: string;
87
87
  name: string;
88
88
  selector: string;
89
- description?: string | undefined;
89
+ description?: string;
90
90
  })[];
91
- preferColorScheme?: false | undefined;
91
+ preferColorScheme?: false;
92
92
  id: string;
93
93
  name: string;
94
94
  selector: string;
95
- description?: string | undefined;
95
+ description?: string;
96
96
  })[];
97
97
  export declare const filterThemePrimitivesByColor: (themes: Array<Theme.GlobalTheme | Theme.Theme>, subtheme?: string) => ({
98
98
  primitives: Theme.Primitives;
@@ -102,23 +102,23 @@ export declare const filterThemePrimitivesByColor: (themes: Array<Theme.GlobalTh
102
102
  id: string;
103
103
  name: string;
104
104
  selector: string;
105
- description?: string | undefined;
105
+ description?: string;
106
106
  } | {
107
107
  primitives: Theme.Primitives;
108
- preferColorScheme?: false | undefined;
108
+ preferColorScheme?: false;
109
109
  id: string;
110
110
  name: string;
111
111
  selector: string;
112
- description?: string | undefined;
112
+ description?: string;
113
113
  })[];
114
114
  preferColorScheme: true;
115
115
  id: string;
116
116
  name: string;
117
117
  selector: string;
118
- description?: string | undefined;
118
+ description?: string;
119
119
  customMedia?: {
120
120
  [key: `--${string}`]: string;
121
- } | undefined;
121
+ };
122
122
  } | {
123
123
  primitives: Theme.Primitives;
124
124
  subthemes: ({
@@ -127,23 +127,23 @@ export declare const filterThemePrimitivesByColor: (themes: Array<Theme.GlobalTh
127
127
  id: string;
128
128
  name: string;
129
129
  selector: string;
130
- description?: string | undefined;
130
+ description?: string;
131
131
  } | {
132
132
  primitives: Theme.Primitives;
133
- preferColorScheme?: false | undefined;
133
+ preferColorScheme?: false;
134
134
  id: string;
135
135
  name: string;
136
136
  selector: string;
137
- description?: string | undefined;
137
+ description?: string;
138
138
  })[];
139
- preferColorScheme?: false | undefined;
139
+ preferColorScheme?: false;
140
140
  id: string;
141
141
  name: string;
142
142
  selector: string;
143
- description?: string | undefined;
143
+ description?: string;
144
144
  customMedia?: {
145
145
  [key: `--${string}`]: string;
146
- } | undefined;
146
+ };
147
147
  } | {
148
148
  primitives: Theme.Primitives;
149
149
  subthemes: ({
@@ -152,20 +152,20 @@ export declare const filterThemePrimitivesByColor: (themes: Array<Theme.GlobalTh
152
152
  id: string;
153
153
  name: string;
154
154
  selector: string;
155
- description?: string | undefined;
155
+ description?: string;
156
156
  } | {
157
157
  primitives: Theme.Primitives;
158
- preferColorScheme?: false | undefined;
158
+ preferColorScheme?: false;
159
159
  id: string;
160
160
  name: string;
161
161
  selector: string;
162
- description?: string | undefined;
162
+ description?: string;
163
163
  })[];
164
164
  preferColorScheme: true;
165
165
  id: string;
166
166
  name: string;
167
167
  selector: string;
168
- description?: string | undefined;
168
+ description?: string;
169
169
  } | {
170
170
  primitives: Theme.Primitives;
171
171
  subthemes: ({
@@ -174,18 +174,18 @@ export declare const filterThemePrimitivesByColor: (themes: Array<Theme.GlobalTh
174
174
  id: string;
175
175
  name: string;
176
176
  selector: string;
177
- description?: string | undefined;
177
+ description?: string;
178
178
  } | {
179
179
  primitives: Theme.Primitives;
180
- preferColorScheme?: false | undefined;
180
+ preferColorScheme?: false;
181
181
  id: string;
182
182
  name: string;
183
183
  selector: string;
184
- description?: string | undefined;
184
+ description?: string;
185
185
  })[];
186
- preferColorScheme?: false | undefined;
186
+ preferColorScheme?: false;
187
187
  id: string;
188
188
  name: string;
189
189
  selector: string;
190
- description?: string | undefined;
190
+ description?: string;
191
191
  })[];
@@ -15,6 +15,6 @@ export interface UseI18nProps {
15
15
  */
16
16
  declare function useI18n(props?: UseI18nProps): {
17
17
  getTranslation: <T = string>(key: string, defaultString?: string) => T;
18
- getNestedTranslation: <T_1 = string>(key: string, defaultString?: string) => T_1;
18
+ getNestedTranslation: <T = string>(key: string, defaultString?: string) => T;
19
19
  };
20
20
  export { useI18n };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  /**
3
2
  * `useLink()`
4
3
  *
@@ -29,5 +29,5 @@ export declare function usePageRelatedContent(): readonly [{
29
29
  msg: string;
30
30
  };
31
31
  readonly isFirstFetch: boolean;
32
- }, (options?: Options | undefined) => void] | undefined;
32
+ }, (options?: Options) => void] | undefined;
33
33
  export {};
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Schema } from "../..";
3
2
  import type { CloudinaryImageProps } from "../../components/CloudinaryImage";
4
3
  import type { GriddoLinkProps } from "../../components/GriddoLink";
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@griddo/core",
3
3
  "description": "Reload version of Griddo Core",
4
4
  "license": "UNLICENSED",
5
- "version": "11.7.10",
5
+ "version": "11.7.12-rc.0",
6
6
  "authors": [
7
7
  "Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
8
8
  "Diego M. Béjar <diego.bejar@secuoyas.com>",
@@ -19,32 +19,21 @@
19
19
  "main": "dist/index.js",
20
20
  "types": "dist/index.d.ts",
21
21
  "bin": {
22
- "griddo-autotypes-legacy": "dist/autotypes-legacy.js",
23
- "griddo-autotypes": "dist/autotypes.js",
24
- "griddo-react-svg-library": "dist/react-svg-library.js"
22
+ "griddo-autotypes": "dist/autotypes.js"
25
23
  },
26
24
  "exports": {
27
25
  ".": {
28
26
  "types": "./dist/index.d.ts",
29
27
  "import": "./dist/index.js",
30
28
  "require": "./dist/index.js"
31
- },
32
- "./node": {
33
- "types": "./dist/node/index.d.ts",
34
- "import": "./dist/node/index.js",
35
- "require": "./dist/node/index.js"
36
29
  }
37
30
  },
38
31
  "scripts": {
39
- "// NODE": "",
40
- "build:node-types": "../../node_modules/.bin/tsc --emitDeclarationOnly --declaration --outDir dist --project ./tsconfig.node.json",
41
- "build:node-js": "esbuild ./src/node/index.ts --bundle --platform=node --minify --outfile=./dist/node/index.js",
42
- "build:node": "npm run build:node-js && npm run build:node-types",
43
32
  "// CORE (JSX) EXPORT": "",
44
33
  "build:core": "rollup -c --sourcemap --bundleConfigAsCjs",
45
34
  "prepare": "yarn build",
46
35
  "// MONOREPO SCRIPTS": "",
47
- "build": "npm run build:core && npm run build:node",
36
+ "build": "npm run build:core",
48
37
  "clean": "rm -rf ./dist",
49
38
  "// DEV": "",
50
39
  "watch": "rollup -cw --bundleConfigAsCjs",
@@ -65,8 +54,7 @@
65
54
  },
66
55
  "dependencies": {
67
56
  "camelcase": "8.0.0",
68
- "react-aspect-ratio": "1.1.8",
69
- "svgo": "3.3.2"
57
+ "react-aspect-ratio": "1.1.8"
70
58
  },
71
59
  "devDependencies": {
72
60
  "@babel/core": "7.26.0",
@@ -128,5 +116,5 @@
128
116
  "publishConfig": {
129
117
  "access": "public"
130
118
  },
131
- "gitHead": "4ce667004353325a0a481f74cab77e75ee55cd7b"
119
+ "gitHead": "c7e40c899abb683a6c53cbe36f1bd19135c9670e"
132
120
  }
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- /**
2
- * Returns the instance or monorepo paths.
3
- */
4
- declare function resolveComponentsPath(): string;
5
- export { resolveComponentsPath };
File without changes
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,2 +0,0 @@
1
- import{execSync as e}from"child_process";import n from"node:fs";import t from"node:path";import o from"prettier";import r from"path";import{fileURLToPath as s}from"node:url";import c from"node:process";function i(e,n,t,o){return new(t||(t=Promise))(function(r,s){function c(e){try{a(o.next(e))}catch(e){s(e)}}function i(e){try{a(o.throw(e))}catch(e){s(e)}}function a(e){var n;e.done?r(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(c,i)}a((o=o.apply(e,n||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const a=/[\p{Lu}]/u,l=/[\p{Ll}]/u,p=/^[\p{Lu}](?![\p{Lu}])/gu,f=/([\p{Alpha}\p{N}_]|$)/u,u=/[_.\- ]+/,m=new RegExp("^"+u.source),d=new RegExp(u.source+f.source,"gu"),g=new RegExp("\\d+"+f.source,"gu");function y(e,n){if("string"!=typeof e&&!Array.isArray(e))throw new TypeError("Expected the input to be `string | string[]`");if(n={pascalCase:!1,preserveConsecutiveUppercase:!1,...n},0===(e=Array.isArray(e)?e.map(e=>e.trim()).filter(e=>e.length).join("-"):e.trim()).length)return"";const t=!1===n.locale?e=>e.toLowerCase():e=>e.toLocaleLowerCase(n.locale),o=!1===n.locale?e=>e.toUpperCase():e=>e.toLocaleUpperCase(n.locale);if(1===e.length)return u.test(e)?"":n.pascalCase?o(e):t(e);return e!==t(e)&&(e=((e,n,t,o)=>{let r=!1,s=!1,c=!1,i=!1;for(let p=0;p<e.length;p++){const f=e[p];i=!(p>2)||"-"===e[p-3],r&&a.test(f)?(e=e.slice(0,p)+"-"+e.slice(p),r=!1,c=s,s=!0,p++):s&&c&&l.test(f)&&(!i||o)?(e=e.slice(0,p-1)+"-"+e.slice(p-1),c=s,s=!1,r=!0):(r=n(f)===f&&t(f)!==f,c=s,s=t(f)===f&&n(f)!==f)}return e})(e,t,o,n.preserveConsecutiveUppercase)),e=e.replace(m,""),e=n.preserveConsecutiveUppercase?((e,n)=>(p.lastIndex=0,e.replaceAll(p,e=>n(e))))(e,t):t(e),n.pascalCase&&(e=o(e.charAt(0))+e.slice(1)),((e,n)=>(d.lastIndex=0,g.lastIndex=0,e.replaceAll(g,(t,o,r)=>["_","-"].includes(e.charAt(r+t.length))?t:n(t)).replaceAll(d,(e,t)=>n(t))))(e,o)}const h={directory:"isDirectory",file:"isFile"};const v=(e,n)=>n[h[e]]();function w(e,{cwd:o=c.cwd(),type:r="file",allowSymlinks:i=!0}={}){var a;!function(e){if(!Object.hasOwnProperty.call(h,e))throw new Error(`Invalid type specified: ${e}`)}(r),o=(a=o)instanceof URL?s(a):a;const l=i?n.statSync:n.lstatSync;for(const n of e)try{const e=l(t.resolve(o,n),{throwIfNoEntry:!1});if(!e)continue;if(v(r,e))return n}catch{}}const x=Symbol("findUpStop");function $(e,n={}){let o=t.resolve(((r=n.cwd)instanceof URL?s(r):r)||"");var r;const{root:c}=t.parse(o),i=n.stopAt||c,a=n.limit||Number.POSITIVE_INFINITY,l=[e].flat(),p=n=>{if("function"!=typeof e)return w(l,n);const t=e(n.cwd);return"string"==typeof t?w([t],n):t},f=[];for(;;){const e=p({...n,cwd:o});if(e===x)break;if(e&&f.push(t.resolve(o,e)),o===i||f.length>=a)break;o=t.dirname(o)}return f}function S({cwd:e}={}){const n=function(e,n={}){return $(e,{...n,limit:1})[0]}("package.json",{cwd:e});return n&&t.dirname(n)}const j=__dirname.includes("node_modules");const C=process.argv.splice(2);1!==C.length&&(console.error("No arguments provided or too many arguments."),process.exit(1));const I=C[0],A=`${t.dirname(I)}/.svgs`,E=t.join(function(){const e=__dirname,n=j?"../../../":"../griddo-components";return r.resolve(S({cwd:e}),n)}(),"svgo.config.js"),L=n.existsSync(E),_=L?`--config ${E}`:"";L||(console.warn("\nsvgo.config.js file not found. Continuing without it.\nYou can create a svgo.config.js file in the root of the project with the\nfollowing content to start:"),console.log('\n/** @type {import("svgo").Config} */\nmodule.exports = {\n plugins: [\n {\n name: "preset-default",\n params: {\n overrides: {\n cleanupIds: false,\n removeTitle: false,\n removeDesc: false,\n },\n },\n },\n "removeDimensions",\n "removeXMLNS",\n ],\n};\n')),n.existsSync(I)||(console.error("Source path does not exist."),process.exit(1));const b=e=>{let t=[];return n.readdirSync(e).forEach(o=>{const r=`${e}/${o}`,s=n.statSync(r);s&&s.isDirectory()?t=t.concat(b(r)):t.push(r)}),t},U=b(I).filter(e=>".svg"===t.extname(e)),N=U.map(e=>t.relative(I,e)),R=U.map(e=>t.basename(e,t.extname(e))).map(e=>y(e));!function(){i(this,void 0,void 0,function*(){const t=yield o.resolveConfig(".prettierrc.json");e(`./node_modules/.bin/svgo -q -r ${_} --folder ${I} --output ${A}`);const r=`import * as React from 'react'\n\n${`${R.map((e,n)=>`const ${e} = React.lazy(() => import('./${N[n]}'))`).join(";")}`}\n\n${`export {\n\t${R.map(e=>`${e}`).join(",")}\n}`}\n`;n.existsSync(A)||n.mkdirSync(A),n.writeFile(`${A}/index.tsx`,yield o.format(r,Object.assign(Object.assign({},t),{parser:"typescript"})),e=>{if(e)throw e}),console.log("🦄 Icons ✓")})}();
2
- //# sourceMappingURL=react-svg-library.js.map