fulldev-ui 0.5.0-beta.1 → 0.5.0-beta.3
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/astro.config.ts +0 -1
- package/package.json +3 -3
- package/pnpm-lock.yaml +23 -58
- package/src/content/pages/index.mdx +0 -1
- package/src/content/presets/docs.yml +4 -5
- package/src/integration/index.ts +31 -33
- package/src/layouts/Layout.astro +5 -2
- package/src/layouts/OverviewLayout.astro +11 -9
- package/src/schemas/pageSchema.ts +18 -7
- package/src/schemas/presetSchema.ts +2 -2
- package/src/utils/{getChildPages.ts → getFolderChildren.ts} +3 -1
- package/src/utils/{getCategoryPages.ts → getReferenceChildren.ts} +2 -2
- package/src/content/pages/layouts/pagelayout.mdx +0 -21
- package/src/layouts/ContentLayout.astro +0 -16
- package/src/layouts/PageLayout.astro +0 -15
- package/src/layouts/PostLayout.astro +0 -21
- /package/src/content/pages/layouts/{layout.mdx → _layout.mdx} +0 -0
- /package/src/schemas/utils/{categories.ts → parents.ts} +0 -0
package/astro.config.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fulldev-ui",
|
|
3
|
-
"version": "0.5.0-beta.
|
|
3
|
+
"version": "0.5.0-beta.3",
|
|
4
4
|
"description": "A component library built for Astro",
|
|
5
5
|
"homepage": "https://ui.full.dev",
|
|
6
6
|
"bugs": "https://github.com/fulldotdev/ui/issues",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"@astrolib/seo": "1.0.0-beta.8",
|
|
43
43
|
"@iconify-json/tabler": "^1.2.5",
|
|
44
44
|
"@radix-ui/colors": "^3.0.0",
|
|
45
|
+
"@rollup/plugin-yaml": "^4.1.2",
|
|
45
46
|
"@types/js-yaml": "^4.0.9",
|
|
46
47
|
"@unocss/reset": "^0.63.4",
|
|
47
48
|
"astro": "^4.16.6",
|
|
@@ -66,8 +67,7 @@
|
|
|
66
67
|
"url": "^0.11.4",
|
|
67
68
|
"vite-plugin-virtual": "^0.3.0",
|
|
68
69
|
"zod": "^3.23.8",
|
|
69
|
-
"zod-to-ts": "^1.2.0"
|
|
70
|
-
"@rollup/plugin-yaml": "^4.1.2"
|
|
70
|
+
"zod-to-ts": "^1.2.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@astrojs/check": "^0.9.4",
|
package/pnpm-lock.yaml
CHANGED
|
@@ -20,6 +20,9 @@ dependencies:
|
|
|
20
20
|
'@radix-ui/colors':
|
|
21
21
|
specifier: ^3.0.0
|
|
22
22
|
version: 3.0.0
|
|
23
|
+
'@rollup/plugin-yaml':
|
|
24
|
+
specifier: ^4.1.2
|
|
25
|
+
version: 4.1.2
|
|
23
26
|
'@types/js-yaml':
|
|
24
27
|
specifier: ^4.0.9
|
|
25
28
|
version: 4.0.9
|
|
@@ -82,13 +85,13 @@ dependencies:
|
|
|
82
85
|
version: 5.6.3
|
|
83
86
|
unocss:
|
|
84
87
|
specifier: ^0.63.4
|
|
85
|
-
version: 0.63.4(postcss@8.4.45)(vite@5.4.
|
|
88
|
+
version: 0.63.4(postcss@8.4.45)(vite@5.4.9)
|
|
86
89
|
url:
|
|
87
90
|
specifier: ^0.11.4
|
|
88
91
|
version: 0.11.4
|
|
89
92
|
vite-plugin-virtual:
|
|
90
93
|
specifier: ^0.3.0
|
|
91
|
-
version: 0.3.0(vite@5.4.
|
|
94
|
+
version: 0.3.0(vite@5.4.9)
|
|
92
95
|
zod:
|
|
93
96
|
specifier: ^3.23.8
|
|
94
97
|
version: 3.23.8
|
|
@@ -100,9 +103,6 @@ devDependencies:
|
|
|
100
103
|
'@astrojs/check':
|
|
101
104
|
specifier: ^0.9.4
|
|
102
105
|
version: 0.9.4(prettier-plugin-astro@0.14.1)(prettier@3.3.3)(typescript@5.6.3)
|
|
103
|
-
'@rollup/plugin-yaml':
|
|
104
|
-
specifier: ^4.1.2
|
|
105
|
-
version: 4.1.2
|
|
106
106
|
prettier:
|
|
107
107
|
specifier: 3.3.3
|
|
108
108
|
version: 3.3.3
|
|
@@ -1523,7 +1523,7 @@ packages:
|
|
|
1523
1523
|
'@rollup/pluginutils': 5.1.0
|
|
1524
1524
|
js-yaml: 4.1.0
|
|
1525
1525
|
tosource: 2.0.0-alpha.3
|
|
1526
|
-
dev:
|
|
1526
|
+
dev: false
|
|
1527
1527
|
|
|
1528
1528
|
/@rollup/pluginutils@5.1.0:
|
|
1529
1529
|
resolution: {integrity: sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==}
|
|
@@ -1537,7 +1537,7 @@ packages:
|
|
|
1537
1537
|
'@types/estree': 1.0.5
|
|
1538
1538
|
estree-walker: 2.0.2
|
|
1539
1539
|
picomatch: 2.3.1
|
|
1540
|
-
dev:
|
|
1540
|
+
dev: false
|
|
1541
1541
|
|
|
1542
1542
|
/@rollup/pluginutils@5.1.2:
|
|
1543
1543
|
resolution: {integrity: sha512-/FIdS3PyZ39bjZlwqFnWqCOVnW7o963LtKMwQOD0NhQqw22gSr2YY1afu3FxRip4ZCZNsD5jq6Aaz6QV3D/Njw==}
|
|
@@ -1771,6 +1771,7 @@ packages:
|
|
|
1771
1771
|
|
|
1772
1772
|
/@types/estree@1.0.5:
|
|
1773
1773
|
resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==}
|
|
1774
|
+
dev: false
|
|
1774
1775
|
|
|
1775
1776
|
/@types/hast@3.0.4:
|
|
1776
1777
|
resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==}
|
|
@@ -1824,7 +1825,7 @@ packages:
|
|
|
1824
1825
|
resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==}
|
|
1825
1826
|
dev: false
|
|
1826
1827
|
|
|
1827
|
-
/@unocss/astro@0.63.4(vite@5.4.
|
|
1828
|
+
/@unocss/astro@0.63.4(vite@5.4.9):
|
|
1828
1829
|
resolution: {integrity: sha512-qu1uMDUT8lXU3mm5EjZpnizvjSYtfY0TTDivR5QNm1i3Xd+ErHfdfOpXdJ2mYvxv+X7C570//KUugkTI3Mb3kQ==}
|
|
1829
1830
|
peerDependencies:
|
|
1830
1831
|
vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0
|
|
@@ -1834,8 +1835,8 @@ packages:
|
|
|
1834
1835
|
dependencies:
|
|
1835
1836
|
'@unocss/core': 0.63.4
|
|
1836
1837
|
'@unocss/reset': 0.63.4
|
|
1837
|
-
'@unocss/vite': 0.63.4(vite@5.4.
|
|
1838
|
-
vite: 5.4.
|
|
1838
|
+
'@unocss/vite': 0.63.4(vite@5.4.9)
|
|
1839
|
+
vite: 5.4.9(sass@1.80.2)
|
|
1839
1840
|
transitivePeerDependencies:
|
|
1840
1841
|
- rollup
|
|
1841
1842
|
- supports-color
|
|
@@ -2008,7 +2009,7 @@ packages:
|
|
|
2008
2009
|
'@unocss/core': 0.63.4
|
|
2009
2010
|
dev: false
|
|
2010
2011
|
|
|
2011
|
-
/@unocss/vite@0.63.4(vite@5.4.
|
|
2012
|
+
/@unocss/vite@0.63.4(vite@5.4.9):
|
|
2012
2013
|
resolution: {integrity: sha512-YK0L177GD8Kx+JtfiCJy4YyBYckAXo4ogC8LZ+pYVNXDMN+F+XItpGI/ofLRaGIaewNg+MJgGY+CQZceABEAfg==}
|
|
2013
2014
|
peerDependencies:
|
|
2014
2015
|
vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0
|
|
@@ -2021,7 +2022,7 @@ packages:
|
|
|
2021
2022
|
chokidar: 3.6.0
|
|
2022
2023
|
magic-string: 0.30.11
|
|
2023
2024
|
tinyglobby: 0.2.9
|
|
2024
|
-
vite: 5.4.
|
|
2025
|
+
vite: 5.4.9(sass@1.80.2)
|
|
2025
2026
|
transitivePeerDependencies:
|
|
2026
2027
|
- rollup
|
|
2027
2028
|
- supports-color
|
|
@@ -2226,6 +2227,7 @@ packages:
|
|
|
2226
2227
|
|
|
2227
2228
|
/argparse@2.0.1:
|
|
2228
2229
|
resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
|
|
2230
|
+
dev: false
|
|
2229
2231
|
|
|
2230
2232
|
/aria-query@5.3.2:
|
|
2231
2233
|
resolution: {integrity: sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==}
|
|
@@ -3020,6 +3022,7 @@ packages:
|
|
|
3020
3022
|
|
|
3021
3023
|
/estree-walker@2.0.2:
|
|
3022
3024
|
resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==}
|
|
3025
|
+
dev: false
|
|
3023
3026
|
|
|
3024
3027
|
/estree-walker@3.0.3:
|
|
3025
3028
|
resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==}
|
|
@@ -3660,6 +3663,7 @@ packages:
|
|
|
3660
3663
|
hasBin: true
|
|
3661
3664
|
dependencies:
|
|
3662
3665
|
argparse: 2.0.1
|
|
3666
|
+
dev: false
|
|
3663
3667
|
|
|
3664
3668
|
/jsesc@3.0.2:
|
|
3665
3669
|
resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==}
|
|
@@ -5693,7 +5697,7 @@ packages:
|
|
|
5693
5697
|
/tosource@2.0.0-alpha.3:
|
|
5694
5698
|
resolution: {integrity: sha512-KAB2lrSS48y91MzFPFuDg4hLbvDiyTjOVgaK7Erw+5AmZXNq4sFRVn8r6yxSLuNs15PaokrDRpS61ERY9uZOug==}
|
|
5695
5699
|
engines: {node: '>=10'}
|
|
5696
|
-
dev:
|
|
5700
|
+
dev: false
|
|
5697
5701
|
|
|
5698
5702
|
/totalist@3.0.1:
|
|
5699
5703
|
resolution: {integrity: sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==}
|
|
@@ -5858,7 +5862,7 @@ packages:
|
|
|
5858
5862
|
unist-util-visit-parents: 6.0.1
|
|
5859
5863
|
dev: false
|
|
5860
5864
|
|
|
5861
|
-
/unocss@0.63.4(postcss@8.4.45)(vite@5.4.
|
|
5865
|
+
/unocss@0.63.4(postcss@8.4.45)(vite@5.4.9):
|
|
5862
5866
|
resolution: {integrity: sha512-MQ/ktuJ2MoXBsd117DEONFubJRQN6Og4mQJLbT+0nna2aTW4jYJESJ479mJYWq/ajonxEaM+zrf8M92VIWxzEw==}
|
|
5863
5867
|
engines: {node: '>=14'}
|
|
5864
5868
|
peerDependencies:
|
|
@@ -5870,7 +5874,7 @@ packages:
|
|
|
5870
5874
|
vite:
|
|
5871
5875
|
optional: true
|
|
5872
5876
|
dependencies:
|
|
5873
|
-
'@unocss/astro': 0.63.4(vite@5.4.
|
|
5877
|
+
'@unocss/astro': 0.63.4(vite@5.4.9)
|
|
5874
5878
|
'@unocss/cli': 0.63.4
|
|
5875
5879
|
'@unocss/core': 0.63.4
|
|
5876
5880
|
'@unocss/postcss': 0.63.4(postcss@8.4.45)
|
|
@@ -5886,8 +5890,8 @@ packages:
|
|
|
5886
5890
|
'@unocss/transformer-compile-class': 0.63.4
|
|
5887
5891
|
'@unocss/transformer-directives': 0.63.4
|
|
5888
5892
|
'@unocss/transformer-variant-group': 0.63.4
|
|
5889
|
-
'@unocss/vite': 0.63.4(vite@5.4.
|
|
5890
|
-
vite: 5.4.
|
|
5893
|
+
'@unocss/vite': 0.63.4(vite@5.4.9)
|
|
5894
|
+
vite: 5.4.9(sass@1.80.2)
|
|
5891
5895
|
transitivePeerDependencies:
|
|
5892
5896
|
- postcss
|
|
5893
5897
|
- rollup
|
|
@@ -5938,51 +5942,12 @@ packages:
|
|
|
5938
5942
|
vfile-message: 4.0.2
|
|
5939
5943
|
dev: false
|
|
5940
5944
|
|
|
5941
|
-
/vite-plugin-virtual@0.3.0(vite@5.4.
|
|
5945
|
+
/vite-plugin-virtual@0.3.0(vite@5.4.9):
|
|
5942
5946
|
resolution: {integrity: sha512-TOtrWw6jKrJNXfxhGRUiQzfAP1gRkYkVzMkJNjHUJ8idLuxf8eeeDKZKZHhdeYfaCc/87rv+KvWE2iCy1QInWA==}
|
|
5943
5947
|
peerDependencies:
|
|
5944
5948
|
vite: ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0
|
|
5945
5949
|
dependencies:
|
|
5946
|
-
vite: 5.4.
|
|
5947
|
-
dev: false
|
|
5948
|
-
|
|
5949
|
-
/vite@5.4.3(sass@1.80.2):
|
|
5950
|
-
resolution: {integrity: sha512-IH+nl64eq9lJjFqU+/yrRnrHPVTlgy42/+IzbOdaFDVlyLgI/wDlf+FCobXLX1cT0X5+7LMyH1mIy2xJdLfo8Q==}
|
|
5951
|
-
engines: {node: ^18.0.0 || >=20.0.0}
|
|
5952
|
-
hasBin: true
|
|
5953
|
-
peerDependencies:
|
|
5954
|
-
'@types/node': ^18.0.0 || >=20.0.0
|
|
5955
|
-
less: '*'
|
|
5956
|
-
lightningcss: ^1.21.0
|
|
5957
|
-
sass: '*'
|
|
5958
|
-
sass-embedded: '*'
|
|
5959
|
-
stylus: '*'
|
|
5960
|
-
sugarss: '*'
|
|
5961
|
-
terser: ^5.4.0
|
|
5962
|
-
peerDependenciesMeta:
|
|
5963
|
-
'@types/node':
|
|
5964
|
-
optional: true
|
|
5965
|
-
less:
|
|
5966
|
-
optional: true
|
|
5967
|
-
lightningcss:
|
|
5968
|
-
optional: true
|
|
5969
|
-
sass:
|
|
5970
|
-
optional: true
|
|
5971
|
-
sass-embedded:
|
|
5972
|
-
optional: true
|
|
5973
|
-
stylus:
|
|
5974
|
-
optional: true
|
|
5975
|
-
sugarss:
|
|
5976
|
-
optional: true
|
|
5977
|
-
terser:
|
|
5978
|
-
optional: true
|
|
5979
|
-
dependencies:
|
|
5980
|
-
esbuild: 0.21.5
|
|
5981
|
-
postcss: 8.4.45
|
|
5982
|
-
rollup: 4.21.2
|
|
5983
|
-
sass: 1.80.2
|
|
5984
|
-
optionalDependencies:
|
|
5985
|
-
fsevents: 2.3.3
|
|
5950
|
+
vite: 5.4.9(sass@1.80.2)
|
|
5986
5951
|
dev: false
|
|
5987
5952
|
|
|
5988
5953
|
/vite@5.4.9(sass@1.80.2):
|
|
@@ -49,11 +49,10 @@ navigation:
|
|
|
49
49
|
- blocks/intro
|
|
50
50
|
- blocks/posts
|
|
51
51
|
- blocks/reviews
|
|
52
|
-
- heading: Layouts
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
- layouts/docslayout
|
|
52
|
+
# - heading: Layouts
|
|
53
|
+
# buttons:
|
|
54
|
+
# - layouts/layout
|
|
55
|
+
# - layouts/docslayout
|
|
57
56
|
- heading: Schemas
|
|
58
57
|
buttons:
|
|
59
58
|
- schemas/page
|
package/src/integration/index.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import viteYaml from '@rollup/plugin-yaml'
|
|
2
2
|
import type { AstroIntegration } from 'astro'
|
|
3
3
|
import favicons from 'astro-favicons'
|
|
4
|
+
import type { CollectionEntry } from 'astro:content'
|
|
4
5
|
import merge from 'deepmerge'
|
|
5
|
-
import fs from 'fs/promises'
|
|
6
|
-
import yaml from 'js-yaml'
|
|
7
|
-
import path from 'path'
|
|
8
6
|
import virtual from 'vite-plugin-virtual'
|
|
9
7
|
import { generateRadixColors } from './generate-colors'
|
|
10
8
|
|
|
@@ -18,9 +16,9 @@ interface Config {
|
|
|
18
16
|
favicon?: string
|
|
19
17
|
company?: string
|
|
20
18
|
css?: string
|
|
19
|
+
basePreset?: CollectionEntry<'presets'>['id']
|
|
21
20
|
injectRoutes?: boolean
|
|
22
|
-
|
|
23
|
-
generateImageEntries?: boolean
|
|
21
|
+
// generateImageEntries?: boolean
|
|
24
22
|
colors: {
|
|
25
23
|
theme: 'light' | 'dark'
|
|
26
24
|
light?: Color | undefined
|
|
@@ -37,7 +35,7 @@ const defaultConfig: Config = {
|
|
|
37
35
|
brand: '#000',
|
|
38
36
|
},
|
|
39
37
|
},
|
|
40
|
-
generateImageEntries: false,
|
|
38
|
+
// generateImageEntries: false,
|
|
41
39
|
}
|
|
42
40
|
|
|
43
41
|
export default function fulldevIntegration(
|
|
@@ -173,33 +171,33 @@ export default function fulldevIntegration(
|
|
|
173
171
|
// ----------------------
|
|
174
172
|
// Generate image YAML files
|
|
175
173
|
// ----------------------
|
|
176
|
-
if (config.generateImageEntries) {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}
|
|
174
|
+
// if (config.generateImageEntries) {
|
|
175
|
+
// const srcDir = path.join(process.cwd(), 'src')
|
|
176
|
+
// const filesDir = path.join(srcDir, 'images')
|
|
177
|
+
// const entriesDir = path.join(srcDir, 'content', 'images')
|
|
178
|
+
|
|
179
|
+
// try {
|
|
180
|
+
// await fs.mkdir(filesDir, { recursive: true })
|
|
181
|
+
// await fs.mkdir(entriesDir, { recursive: true })
|
|
182
|
+
|
|
183
|
+
// const files = await fs.readdir(filesDir)
|
|
184
|
+
// files.forEach(async (file) => {
|
|
185
|
+
// const filename = path.parse(file).name
|
|
186
|
+
// const yamlPath = path.join(entriesDir, `${filename}.yml`)
|
|
187
|
+
|
|
188
|
+
// try {
|
|
189
|
+
// await fs.access(yamlPath)
|
|
190
|
+
// } catch {
|
|
191
|
+
// const yamlContent = yaml.dump({
|
|
192
|
+
// alt: '',
|
|
193
|
+
// })
|
|
194
|
+
// await fs.writeFile(yamlPath, yamlContent, 'utf8')
|
|
195
|
+
// }
|
|
196
|
+
// })
|
|
197
|
+
// } catch (error) {
|
|
198
|
+
// console.error('Error generating image YAML files:', error)
|
|
199
|
+
// }
|
|
200
|
+
// }
|
|
203
201
|
|
|
204
202
|
// ----------------------
|
|
205
203
|
// Inject routes
|
package/src/layouts/Layout.astro
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import type { ComponentProps, HTMLAttributes } from 'astro/types'
|
|
3
3
|
import type { CollectionEntry } from 'astro:content'
|
|
4
|
+
import Article from 'fulldev-ui/blocks/Article.astro'
|
|
4
5
|
import Banner from 'fulldev-ui/blocks/Banner.astro'
|
|
5
6
|
import Footer from 'fulldev-ui/blocks/Footer.astro'
|
|
6
7
|
import Element from 'fulldev-ui/components/Element.astro'
|
|
@@ -77,8 +78,10 @@ const {
|
|
|
77
78
|
/>
|
|
78
79
|
</slot>
|
|
79
80
|
<main data-pagefind-body>
|
|
80
|
-
<slot
|
|
81
|
-
|
|
81
|
+
<slot>
|
|
82
|
+
<Article />
|
|
83
|
+
<Sections {sections} />
|
|
84
|
+
</slot>
|
|
82
85
|
</main>
|
|
83
86
|
<slot name="toc">
|
|
84
87
|
<Toc
|
|
@@ -6,27 +6,29 @@ import Intro from 'fulldev-ui/blocks/Intro.astro'
|
|
|
6
6
|
import Products from 'fulldev-ui/blocks/Products.astro'
|
|
7
7
|
import Sections from 'fulldev-ui/components/sections.astro'
|
|
8
8
|
import Layout from 'fulldev-ui/layouts/Layout.astro'
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { getFolderChildren } from 'fulldev-ui/utils/getFolderChildren.ts'
|
|
10
|
+
import { getReferenceChildren } from 'fulldev-ui/utils/getReferenceChildren'
|
|
11
11
|
|
|
12
12
|
type Props = ComponentProps<typeof Layout>
|
|
13
13
|
|
|
14
|
-
const { slug,
|
|
14
|
+
const { slug, sections, title, description } = Astro.props
|
|
15
15
|
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
// const siblingPages = await getSiblingPages(slug)
|
|
16
|
+
const folderChildren = await getFolderChildren(slug)
|
|
17
|
+
const referenceChildren = await getReferenceChildren(slug)
|
|
19
18
|
---
|
|
20
19
|
|
|
21
20
|
<Layout {...Astro.props}>
|
|
22
|
-
<Intro
|
|
21
|
+
<Intro
|
|
22
|
+
heading={title}
|
|
23
|
+
text={description}
|
|
24
|
+
/>
|
|
23
25
|
<Categories
|
|
24
|
-
|
|
26
|
+
cards={folderChildren}
|
|
25
27
|
structure="grid"
|
|
26
28
|
panel
|
|
27
29
|
/>
|
|
28
30
|
<Products
|
|
29
|
-
|
|
31
|
+
cards={referenceChildren}
|
|
30
32
|
structure="grid"
|
|
31
33
|
/>
|
|
32
34
|
<Article style={{ '--screen': '768px' }} />
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { getEntries, getEntry, z } from 'astro:content'
|
|
2
2
|
import { assign } from 'radash'
|
|
3
|
+
import fulldevConfig from 'virtual:fulldev-ui/config'
|
|
3
4
|
import image from './components/image'
|
|
5
|
+
import images from './components/images'
|
|
4
6
|
import sections from './components/sections'
|
|
5
|
-
import categories from './utils/categories'
|
|
6
7
|
import component from './utils/component'
|
|
7
8
|
import navigation from './utils/navigation'
|
|
9
|
+
import parents from './utils/parents'
|
|
8
10
|
import pathSchema from './utils/pathSchema'
|
|
9
11
|
|
|
10
12
|
const i18n = z
|
|
@@ -25,12 +27,20 @@ const presets = z
|
|
|
25
27
|
})
|
|
26
28
|
.passthrough()
|
|
27
29
|
.transform(async ({ presets, ...rest }) => {
|
|
28
|
-
if (!presets) return rest
|
|
29
|
-
const entries = await getEntries(presets)
|
|
30
30
|
let mergedData = {}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
|
|
32
|
+
if (fulldevConfig.basePreset) {
|
|
33
|
+
const baseEntry = await getEntry('presets', fulldevConfig.basePreset)
|
|
34
|
+
mergedData = assign(mergedData, baseEntry?.data || {})
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (presets) {
|
|
38
|
+
const entries = await getEntries(presets)
|
|
39
|
+
entries.forEach(
|
|
40
|
+
(preset: any) => (mergedData = assign(mergedData, preset.data))
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
34
44
|
mergedData = assign(mergedData, rest)
|
|
35
45
|
return mergedData as typeof rest
|
|
36
46
|
})
|
|
@@ -39,7 +49,7 @@ export default i18n.pipe(presets).pipe(
|
|
|
39
49
|
z
|
|
40
50
|
.object({
|
|
41
51
|
component,
|
|
42
|
-
|
|
52
|
+
parents,
|
|
43
53
|
theme: z.enum(['light', 'dark']),
|
|
44
54
|
lang: z.string(),
|
|
45
55
|
seo: z
|
|
@@ -51,6 +61,7 @@ export default i18n.pipe(presets).pipe(
|
|
|
51
61
|
title: z.string(),
|
|
52
62
|
description: z.string().optional(),
|
|
53
63
|
image,
|
|
64
|
+
images,
|
|
54
65
|
sections,
|
|
55
66
|
header: z.any(),
|
|
56
67
|
footer: z.any(),
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { z } from 'astro:content'
|
|
2
2
|
import image from './components/image'
|
|
3
3
|
import sections from './components/sections'
|
|
4
|
-
import categories from './utils/categories'
|
|
5
4
|
import component from './utils/component'
|
|
5
|
+
import parents from './utils/parents'
|
|
6
6
|
|
|
7
7
|
export default z
|
|
8
8
|
.object({
|
|
9
9
|
component,
|
|
10
|
-
|
|
10
|
+
parents,
|
|
11
11
|
theme: z.enum(['light', 'dark']),
|
|
12
12
|
lang: z.string(),
|
|
13
13
|
seo: z
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { getCollection, type CollectionEntry } from 'astro:content'
|
|
2
2
|
|
|
3
3
|
// Records that are in a folder with the current page's slug
|
|
4
|
-
export const
|
|
4
|
+
export const getFolderChildren = async (
|
|
5
|
+
slug: CollectionEntry<'pages'>['slug']
|
|
6
|
+
) =>
|
|
5
7
|
(
|
|
6
8
|
await getCollection(
|
|
7
9
|
'pages',
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { getCollection, type CollectionEntry } from 'astro:content'
|
|
2
2
|
|
|
3
3
|
// Pages that reference the current page
|
|
4
|
-
export const
|
|
4
|
+
export const getReferenceChildren = async (
|
|
5
5
|
slug: CollectionEntry<'pages'>['slug']
|
|
6
6
|
) =>
|
|
7
7
|
(
|
|
8
8
|
await getCollection('pages', (page) =>
|
|
9
|
-
page.data?.
|
|
9
|
+
page.data?.parents?.some((p: any) => p.slug === slug)
|
|
10
10
|
)
|
|
11
11
|
)?.map((page) => page.data)
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
presets: [docs, blocks]
|
|
3
|
-
|
|
4
|
-
title: PageLayout
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
```astro live
|
|
8
|
-
---
|
|
9
|
-
import Hero from 'fulldev-ui/blocks/Hero.astro'
|
|
10
|
-
import PageLayout from 'fulldev-ui/layouts/PageLayout.astro'
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
<PageLayout>
|
|
14
|
-
<Hero
|
|
15
|
-
heading="PageLayout"
|
|
16
|
-
text="The PageLayout component is used to wrap the content of a page."
|
|
17
|
-
align="center"
|
|
18
|
-
frame="viewport"
|
|
19
|
-
/>
|
|
20
|
-
</PageLayout>
|
|
21
|
-
```
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { ComponentProps } from 'astro/types'
|
|
3
|
-
import Article from 'fulldev-ui/blocks/Article.astro'
|
|
4
|
-
import Layout from 'fulldev-ui/layouts/Layout.astro'
|
|
5
|
-
|
|
6
|
-
type Props = ComponentProps<typeof Layout>
|
|
7
|
-
|
|
8
|
-
const { sections, ...rest } = Astro.props
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
<Layout
|
|
12
|
-
class:list="content-layout"
|
|
13
|
-
{...rest}
|
|
14
|
-
>
|
|
15
|
-
<Article />
|
|
16
|
-
</Layout>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { ComponentProps } from 'astro/types'
|
|
3
|
-
import Layout from 'fulldev-ui/layouts/Layout.astro'
|
|
4
|
-
|
|
5
|
-
type Props = ComponentProps<typeof Layout>
|
|
6
|
-
|
|
7
|
-
const { ...rest } = Astro.props
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
<Layout
|
|
11
|
-
class:list="page-layout"
|
|
12
|
-
{...rest}
|
|
13
|
-
>
|
|
14
|
-
<slot />
|
|
15
|
-
</Layout>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { ComponentProps } from 'astro/types'
|
|
3
|
-
import Article from 'fulldev-ui/blocks/Article.astro'
|
|
4
|
-
import Intro from 'fulldev-ui/blocks/Intro.astro'
|
|
5
|
-
import Sections from 'fulldev-ui/components/sections.astro'
|
|
6
|
-
import Layout from 'fulldev-ui/layouts/Layout.astro'
|
|
7
|
-
|
|
8
|
-
type Props = ComponentProps<typeof Layout>
|
|
9
|
-
|
|
10
|
-
const { render, sections, ...rest } = Astro.props
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
<Layout {...Astro.props}>
|
|
14
|
-
<Intro
|
|
15
|
-
align="start"
|
|
16
|
-
{...rest}
|
|
17
|
-
/>
|
|
18
|
-
<Article />
|
|
19
|
-
<Sections {sections} />
|
|
20
|
-
<slot />
|
|
21
|
-
</Layout>
|
|
File without changes
|
|
File without changes
|