fulldev-ui 0.6.0-beta.3 → 0.6.0-beta.6
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 +1 -7
- package/cloudcannon.config.yml +269 -0
- package/package.json +1 -1
- package/src/blocks/Banner.astro +33 -0
- package/src/blocks/Colleagues1.astro +73 -0
- package/src/blocks/Contact1.astro +12 -4
- package/src/blocks/Content1.astro +79 -0
- package/src/blocks/Content2.astro +94 -0
- package/src/blocks/Content3.astro +70 -0
- package/src/blocks/Content4.astro +75 -0
- package/src/blocks/Cta1.astro +35 -34
- package/src/blocks/Feature1.astro +20 -26
- package/src/blocks/Features1.astro +66 -0
- package/src/blocks/Footer.astro +27 -52
- package/src/blocks/Header.astro +154 -0
- package/src/blocks/Hero1.astro +41 -41
- package/src/blocks/Intro1.astro +32 -18
- package/src/blocks/Jobs1.astro +73 -0
- package/src/blocks/Logos1.astro +55 -0
- package/src/blocks/Products1.astro +4 -4
- package/src/blocks/Reviews1.astro +79 -0
- package/src/components/Badges.astro +12 -35
- package/src/components/Block.astro +5 -24
- package/src/components/Button.astro +1 -2
- package/src/components/Buttons.astro +12 -43
- package/src/components/Cart.astro +6 -12
- package/src/components/Drawer.astro +1 -2
- package/src/components/Form.astro +3 -3
- package/src/components/Grid.astro +39 -0
- package/src/components/{Banner.astro → Group.astro} +5 -6
- package/src/components/Heading.astro +5 -1
- package/src/components/Icon.astro +0 -1
- package/src/components/Image.astro +15 -50
- package/src/components/Layout.astro +35 -0
- package/src/components/Links.astro +14 -35
- package/src/components/Logo.astro +5 -7
- package/src/components/Masonry.astro +42 -0
- package/src/components/Menu.astro +17 -38
- package/src/components/Menus.astro +20 -0
- package/src/components/Panel.astro +1 -1
- package/src/components/Paragraph.astro +8 -8
- package/src/components/Prose.astro +15 -7
- package/src/components/Search.astro +1 -1
- package/src/components/Section.astro +1 -1
- package/src/components/Sidebar.astro +11 -42
- package/src/components/Stack.astro +25 -0
- package/src/components/Tagline.astro +1 -1
- package/src/components/Toc.astro +22 -30
- package/src/components/Writeup.astro +59 -0
- package/src/components/_Image.astro +79 -0
- package/src/content/config.ts +2 -28
- package/src/content/layouts/base.yml +4 -3
- package/src/content/{docs → pages/docs}/_internationalization.mdx +1 -0
- package/src/content/{docs → pages/docs}/_using-blocks.mdx +1 -0
- package/src/content/{docs → pages/docs}/_using-presets.mdx +1 -0
- package/src/content/{docs → pages/docs}/blocks.mdx +1 -0
- package/src/content/{docs → pages/docs}/collections/images.mdx +1 -0
- package/src/content/{docs → pages/docs}/collections/pages.mdx +1 -0
- package/src/content/{docs → pages/docs}/collections/presets.mdx +1 -0
- package/src/content/{docs → pages/docs}/collections.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/_card.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/_dialog.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/_drawer.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/_localeswitcher.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/_switch.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/_tagline.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/_toggle.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/avatar.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/badge.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/badges.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/button.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/buttons.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/channel.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/channels.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/checkbox.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/code.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/heading.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/icon.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/image.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/input.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/label.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/link.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/links.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/list.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/logo.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/menu.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/prose.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/rating.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/section.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/select.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/social.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/socials.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/switch.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/table.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/tagline.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/text.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/textarea.mdx +1 -0
- package/src/content/{docs → pages/docs}/components/themer.mdx +1 -0
- package/src/content/{docs → pages/docs}/components.mdx +1 -0
- package/src/content/{docs → pages/docs}/customization.mdx +1 -0
- package/src/content/{docs → pages/docs}/frameworks.mdx +1 -0
- package/src/content/{docs → pages/docs}/generating-pages.mdx +1 -0
- package/src/content/{docs → pages/docs}/index.mdx +1 -0
- package/src/content/{docs → pages/docs}/installation.mdx +1 -0
- package/src/content/{docs → pages/docs}/layouts.mdx +1 -0
- package/src/content/pages/index.mdx +3 -3
- package/src/content/{products → pages/products}/product.md +2 -2
- package/src/integration/index.ts +38 -16
- package/src/layouts/{CategoryLayout.astro → Category.astro} +19 -20
- package/src/layouts/Doc.astro +70 -0
- package/src/layouts/Job.astro +62 -0
- package/src/layouts/Jobs.astro +72 -0
- package/src/layouts/Page.astro +29 -0
- package/src/layouts/Post.astro +52 -0
- package/src/layouts/{ProductLayout.astro → Product.astro} +20 -11
- package/src/pages/[...page].astro +36 -4
- package/src/pages/test.astro +25 -1
- package/src/schemas/components/block.ts +58 -15
- package/src/schemas/components/button.ts +1 -0
- package/src/schemas/components/image.ts +32 -18
- package/src/schemas/components/menu.ts +1 -0
- package/src/schemas/imageSchema.ts +3 -3
- package/src/schemas/page.ts +40 -0
- package/src/utils/getHref.ts +4 -21
- package/tailwind.config.ts +4 -0
- package/src/blocks/Banner1.astro +0 -35
- package/src/blocks/Header1.astro +0 -192
- package/src/content/layouts/docs.yml +0 -2
- package/src/layouts/DocLayout.astro +0 -59
- package/src/layouts/Layout.astro +0 -107
- package/src/layouts/PageLayout.astro +0 -27
- package/src/layouts/PostLayout.astro +0 -22
- package/src/pages/[...category].astro +0 -17
- package/src/pages/[...doc].astro +0 -17
- package/src/pages/[...post].astro +0 -17
- package/src/pages/[...product].astro +0 -17
- package/src/schemas/blocks/banner.ts +0 -10
- package/src/schemas/blocks/categories.ts +0 -14
- package/src/schemas/blocks/contact.ts +0 -18
- package/src/schemas/blocks/cta.ts +0 -18
- package/src/schemas/blocks/feature.ts +0 -18
- package/src/schemas/blocks/hero.ts +0 -20
- package/src/schemas/blocks/intro.ts +0 -16
- package/src/schemas/blocks/products.ts +0 -14
- package/src/schemas/categorySchema.ts +0 -16
- package/src/schemas/docSchema.ts +0 -14
- package/src/schemas/layoutSchema.ts +0 -22
- package/src/schemas/pageSchema.ts +0 -17
- package/src/schemas/postSchema.ts +0 -14
- package/src/schemas/productSchema.ts +0 -22
- /package/src/content/{categories → pages/categories}/category.md +0 -0
- /package/src/content/{posts → pages/posts}/post.md +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
head:
|
|
3
3
|
title: Fulldev UI - Astro component and block library, open-source
|
|
4
4
|
description: Make websites rapidly with pre-built components and blocks.
|
|
5
|
-
image: og-image.png
|
|
5
|
+
image: /og-image.png
|
|
6
6
|
|
|
7
7
|
title: Home
|
|
8
8
|
|
|
@@ -25,7 +25,7 @@ blocks:
|
|
|
25
25
|
tagline: Blocks
|
|
26
26
|
heading: Use pre-built blocks with just props
|
|
27
27
|
paragraph: We created a great gallery of blocks to build content sites with a modern look and feel, all of our blocks are build with components from the library to achieve a consistent look.
|
|
28
|
-
image: block-code.png
|
|
28
|
+
image: /block-code.png
|
|
29
29
|
buttons:
|
|
30
30
|
- href: /blocks/
|
|
31
31
|
icon: layout
|
|
@@ -35,7 +35,7 @@ blocks:
|
|
|
35
35
|
tagline: Components
|
|
36
36
|
heading: Or build your own, with easy to use components
|
|
37
37
|
paragraph: Our rich set of components make it easy to build your own blocks with great customizability through props and global theming.
|
|
38
|
-
image: component-code.png
|
|
38
|
+
image: /component-code.png
|
|
39
39
|
buttons:
|
|
40
40
|
- text: View components
|
|
41
41
|
href: /components/badge/
|
package/src/integration/index.ts
CHANGED
|
@@ -5,9 +5,14 @@ import favicons from 'astro-favicons'
|
|
|
5
5
|
import liveCode from 'astro-live-code'
|
|
6
6
|
import robotsTxt from 'astro-robots-txt'
|
|
7
7
|
import { envField } from 'astro/config'
|
|
8
|
+
import fs from 'fs'
|
|
9
|
+
import yaml from 'js-yaml'
|
|
10
|
+
import path from 'path'
|
|
11
|
+
import { assign } from 'radash'
|
|
8
12
|
import tailwindcss from 'tailwindcss'
|
|
9
13
|
import tailwindcssNesting from 'tailwindcss/nesting'
|
|
10
14
|
import { loadEnv } from 'vite'
|
|
15
|
+
import virtual from 'vite-plugin-virtual'
|
|
11
16
|
import tailwindConfig from '../../tailwind.config.ts'
|
|
12
17
|
|
|
13
18
|
interface Config {
|
|
@@ -15,6 +20,8 @@ interface Config {
|
|
|
15
20
|
company?: string
|
|
16
21
|
css?: string
|
|
17
22
|
injectRoutes?: boolean
|
|
23
|
+
cloudcannon?: boolean
|
|
24
|
+
cart?: boolean
|
|
18
25
|
overrides?: {
|
|
19
26
|
[k: string]: string
|
|
20
27
|
}
|
|
@@ -72,6 +79,11 @@ export default function fulldevIntegration(
|
|
|
72
79
|
...config?.overrides,
|
|
73
80
|
},
|
|
74
81
|
},
|
|
82
|
+
plugins: [
|
|
83
|
+
virtual({
|
|
84
|
+
'virtual:fulldev-ui/config': config ?? {},
|
|
85
|
+
}),
|
|
86
|
+
],
|
|
75
87
|
css: {
|
|
76
88
|
postcss: {
|
|
77
89
|
plugins: [tailwindcss(tailwindConfig), tailwindcssNesting],
|
|
@@ -105,22 +117,6 @@ export default function fulldevIntegration(
|
|
|
105
117
|
pattern: '/[...page]',
|
|
106
118
|
entrypoint: 'fulldev-ui/pages/[...page].astro',
|
|
107
119
|
})
|
|
108
|
-
injectRoute({
|
|
109
|
-
pattern: '/[...doc]',
|
|
110
|
-
entrypoint: 'fulldev-ui/pages/[...doc].astro',
|
|
111
|
-
})
|
|
112
|
-
injectRoute({
|
|
113
|
-
pattern: '/[...category]',
|
|
114
|
-
entrypoint: 'fulldev-ui/pages/[...category].astro',
|
|
115
|
-
})
|
|
116
|
-
injectRoute({
|
|
117
|
-
pattern: '/[...post]',
|
|
118
|
-
entrypoint: 'fulldev-ui/pages/[...post].astro',
|
|
119
|
-
})
|
|
120
|
-
injectRoute({
|
|
121
|
-
pattern: '/[...product]',
|
|
122
|
-
entrypoint: 'fulldev-ui/pages/[...product].astro',
|
|
123
|
-
})
|
|
124
120
|
}
|
|
125
121
|
|
|
126
122
|
// ----------------------
|
|
@@ -128,6 +124,10 @@ export default function fulldevIntegration(
|
|
|
128
124
|
// ----------------------
|
|
129
125
|
config?.css && injectScript('page-ssr', `import "${config?.css}";`)
|
|
130
126
|
|
|
127
|
+
// ----------------------
|
|
128
|
+
// merge Cloudcannon configs
|
|
129
|
+
// ----------------------
|
|
130
|
+
|
|
131
131
|
// ----------------------
|
|
132
132
|
// Generate image YAML files
|
|
133
133
|
// ----------------------
|
|
@@ -159,6 +159,28 @@ export default function fulldevIntegration(
|
|
|
159
159
|
// }
|
|
160
160
|
// }
|
|
161
161
|
},
|
|
162
|
+
'astro:build:done': async () => {
|
|
163
|
+
if (config?.cloudcannon) {
|
|
164
|
+
const __dirname = path.dirname(new URL(import.meta.url).pathname)
|
|
165
|
+
const libDir = path.join(__dirname, '../../cloudcannon.config.yml')
|
|
166
|
+
const userDir = path.join(process.cwd(), 'cloudcannon.config.yml')
|
|
167
|
+
|
|
168
|
+
console.log({ libDir, userDir })
|
|
169
|
+
|
|
170
|
+
const libConfig = yaml.load(
|
|
171
|
+
fs.readFileSync(path.resolve(libDir), 'utf8')
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
const userConfig = yaml.load(
|
|
175
|
+
fs.readFileSync(path.resolve(userDir), 'utf8')
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
const mergedConfig = assign(libConfig || {}, userConfig || {})
|
|
179
|
+
const yamlContent = yaml.dump(mergedConfig)
|
|
180
|
+
|
|
181
|
+
await fs.promises.writeFile(userDir, yamlContent, 'utf8')
|
|
182
|
+
}
|
|
183
|
+
},
|
|
162
184
|
},
|
|
163
185
|
}
|
|
164
186
|
}
|
|
@@ -1,32 +1,28 @@
|
|
|
1
1
|
---
|
|
2
|
+
import type { ComponentProps } from 'astro/types'
|
|
2
3
|
import type { CollectionEntry } from 'astro:content'
|
|
3
|
-
import { getCollection
|
|
4
|
-
import Intro1 from 'fulldev-ui/blocks/Intro1.astro'
|
|
4
|
+
import { getCollection } from 'astro:content'
|
|
5
5
|
import Products1 from 'fulldev-ui/blocks/Products1.astro'
|
|
6
6
|
import Carousel from 'fulldev-ui/components/Carousel.astro'
|
|
7
7
|
import Element from 'fulldev-ui/components/Element.astro'
|
|
8
|
+
import Layout from 'fulldev-ui/components/Layout.astro'
|
|
8
9
|
import Prose from 'fulldev-ui/components/Prose.astro'
|
|
9
10
|
import Select from 'fulldev-ui/components/Select.astro'
|
|
10
|
-
import
|
|
11
|
-
import { getHref } from 'fulldev-ui/utils/getHref'
|
|
12
|
-
import { mergeDeep } from 'remeda'
|
|
11
|
+
import type { PageSchema } from 'fulldev-ui/schemas/page.ts'
|
|
12
|
+
import { getHref } from 'fulldev-ui/utils/getHref.ts'
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
interface Props extends ComponentProps<typeof Layout>, PageSchema {
|
|
15
|
+
render: CollectionEntry<'pages'>['render']
|
|
16
|
+
slug: CollectionEntry<'pages'>['slug']
|
|
17
|
+
}
|
|
15
18
|
|
|
16
|
-
const
|
|
17
|
-
const merged = mergeDeep(layout || {}, Astro.props)
|
|
19
|
+
const { render, slug, title, description } = Astro.props
|
|
18
20
|
|
|
19
|
-
const {
|
|
20
|
-
render,
|
|
21
|
-
slug,
|
|
22
|
-
data: { title, description },
|
|
23
|
-
} = merged
|
|
24
|
-
|
|
25
|
-
const categories = await getCollection('categories', ({ data }) =>
|
|
21
|
+
const categories = await getCollection('pages', ({ data }) =>
|
|
26
22
|
data.categories?.some((c) => c.slug.includes(slug))
|
|
27
23
|
)
|
|
28
24
|
|
|
29
|
-
const products = await getCollection('
|
|
25
|
+
const products = await getCollection('pages', ({ data }) =>
|
|
30
26
|
data.categories?.some((c) => c.slug.includes(slug))
|
|
31
27
|
)
|
|
32
28
|
|
|
@@ -77,18 +73,21 @@ const sorts = [
|
|
|
77
73
|
})
|
|
78
74
|
</script>
|
|
79
75
|
|
|
80
|
-
<Layout
|
|
81
|
-
|
|
76
|
+
<Layout
|
|
77
|
+
class:list="category"
|
|
78
|
+
{...Astro.props}
|
|
79
|
+
>
|
|
80
|
+
<!-- <Intro1
|
|
82
81
|
heading={title}
|
|
83
82
|
text={description}
|
|
84
|
-
/>
|
|
83
|
+
/> -->
|
|
85
84
|
<Carousel>
|
|
86
85
|
{
|
|
87
86
|
categories.map((category) => (
|
|
88
87
|
<Element
|
|
89
88
|
as="a"
|
|
90
89
|
class:list="item"
|
|
91
|
-
href={getHref(
|
|
90
|
+
href={getHref(category.slug)}
|
|
92
91
|
>
|
|
93
92
|
{category.data.title}
|
|
94
93
|
</Element>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps } from 'astro/types'
|
|
3
|
+
import type { CollectionEntry } from 'astro:content'
|
|
4
|
+
import Footer from 'fulldev-ui/blocks/Footer.astro'
|
|
5
|
+
import Header from 'fulldev-ui/blocks/Header.astro'
|
|
6
|
+
import Container from 'fulldev-ui/components/Container.astro'
|
|
7
|
+
import Element from 'fulldev-ui/components/Element.astro'
|
|
8
|
+
import Heading from 'fulldev-ui/components/Heading.astro'
|
|
9
|
+
import Layout from 'fulldev-ui/components/Layout.astro'
|
|
10
|
+
import Paragraph from 'fulldev-ui/components/Paragraph.astro'
|
|
11
|
+
import Prose from 'fulldev-ui/components/Prose.astro'
|
|
12
|
+
import Sidebar from 'fulldev-ui/components/Sidebar.astro'
|
|
13
|
+
import Toc from 'fulldev-ui/components/Toc.astro'
|
|
14
|
+
import type { PageSchema } from 'fulldev-ui/schemas/page.ts'
|
|
15
|
+
|
|
16
|
+
interface Props extends ComponentProps<typeof Layout>, PageSchema {
|
|
17
|
+
render: CollectionEntry<'pages'>['render']
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const { header, sidebar, render, title, description, footer } = Astro.props
|
|
21
|
+
|
|
22
|
+
const { Content } = await render()
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
<Layout
|
|
26
|
+
class:list="doc"
|
|
27
|
+
{...Astro.props}
|
|
28
|
+
>
|
|
29
|
+
<Header
|
|
30
|
+
{...sidebar}
|
|
31
|
+
{...header}
|
|
32
|
+
/>
|
|
33
|
+
<Container class:list="doc-container">
|
|
34
|
+
<Sidebar {...sidebar} />
|
|
35
|
+
<Element
|
|
36
|
+
class:list="doc-main"
|
|
37
|
+
as="main"
|
|
38
|
+
>
|
|
39
|
+
<Prose>
|
|
40
|
+
<Heading
|
|
41
|
+
as="h1"
|
|
42
|
+
size="4xl"
|
|
43
|
+
text={title}
|
|
44
|
+
/>
|
|
45
|
+
<Paragraph
|
|
46
|
+
muted
|
|
47
|
+
size="lg"
|
|
48
|
+
text={description}
|
|
49
|
+
/>
|
|
50
|
+
<Content />
|
|
51
|
+
</Prose>
|
|
52
|
+
<Toc {render} />
|
|
53
|
+
</Element>
|
|
54
|
+
</Container>
|
|
55
|
+
<Footer {...footer} />
|
|
56
|
+
</Layout>
|
|
57
|
+
|
|
58
|
+
<style is:global>
|
|
59
|
+
@layer fulldev {
|
|
60
|
+
.doc {
|
|
61
|
+
.doc-container {
|
|
62
|
+
@apply flex gap-x-gutter;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.doc-main {
|
|
66
|
+
@apply flex grow justify-evenly gap-x-gutter;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
</style>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps } from 'astro/types'
|
|
3
|
+
import type { CollectionEntry } from 'astro:content'
|
|
4
|
+
import { getEntries } from 'astro:content'
|
|
5
|
+
import Content3 from 'fulldev-ui/blocks/Content3.astro'
|
|
6
|
+
import Footer from 'fulldev-ui/blocks/Footer.astro'
|
|
7
|
+
import Header from 'fulldev-ui/blocks/Header.astro'
|
|
8
|
+
import Block from 'fulldev-ui/components/Block.astro'
|
|
9
|
+
import Element from 'fulldev-ui/components/Element.astro'
|
|
10
|
+
import Layout from 'fulldev-ui/components/Layout.astro'
|
|
11
|
+
import type { PageSchema } from 'fulldev-ui/schemas/page.ts'
|
|
12
|
+
import { getHref } from 'fulldev-ui/utils/getHref.ts'
|
|
13
|
+
|
|
14
|
+
interface Props extends ComponentProps<typeof Layout>, PageSchema {
|
|
15
|
+
render: CollectionEntry<'pages'>['render']
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const {
|
|
19
|
+
title,
|
|
20
|
+
description,
|
|
21
|
+
list,
|
|
22
|
+
button,
|
|
23
|
+
buttons,
|
|
24
|
+
header,
|
|
25
|
+
sidebar,
|
|
26
|
+
render,
|
|
27
|
+
parents,
|
|
28
|
+
blocks,
|
|
29
|
+
footer,
|
|
30
|
+
} = Astro.props
|
|
31
|
+
|
|
32
|
+
const parentEntries = parents && (await getEntries(parents))
|
|
33
|
+
|
|
34
|
+
const { Content } = await render()
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
<Layout
|
|
38
|
+
class:list="job"
|
|
39
|
+
{...Astro.props}
|
|
40
|
+
>
|
|
41
|
+
<Header
|
|
42
|
+
{...sidebar}
|
|
43
|
+
{...header}
|
|
44
|
+
/>
|
|
45
|
+
<Element as="main">
|
|
46
|
+
<Content3
|
|
47
|
+
badges={parentEntries?.map((parent) => ({
|
|
48
|
+
text: parent.data.title,
|
|
49
|
+
href: getHref(parent.slug),
|
|
50
|
+
}))}
|
|
51
|
+
heading={title}
|
|
52
|
+
paragraph={description}
|
|
53
|
+
{list}
|
|
54
|
+
{button}
|
|
55
|
+
{buttons}
|
|
56
|
+
>
|
|
57
|
+
<Content />
|
|
58
|
+
</Content3>
|
|
59
|
+
{blocks?.map((block) => <Block {...block} />)}
|
|
60
|
+
</Element>
|
|
61
|
+
<Footer {...footer} />
|
|
62
|
+
</Layout>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps } from 'astro/types'
|
|
3
|
+
import type { CollectionEntry } from 'astro:content'
|
|
4
|
+
import { getCollection } from 'astro:content'
|
|
5
|
+
import Footer from 'fulldev-ui/blocks/Footer.astro'
|
|
6
|
+
import Header from 'fulldev-ui/blocks/Header.astro'
|
|
7
|
+
import Intro1 from 'fulldev-ui/blocks/Intro1.astro'
|
|
8
|
+
import Jobs1 from 'fulldev-ui/blocks/Jobs1.astro'
|
|
9
|
+
import Container from 'fulldev-ui/components/Container.astro'
|
|
10
|
+
import Element from 'fulldev-ui/components/Element.astro'
|
|
11
|
+
import Layout from 'fulldev-ui/components/Layout.astro'
|
|
12
|
+
import Prose from 'fulldev-ui/components/Prose.astro'
|
|
13
|
+
import Sidebar from 'fulldev-ui/components/Sidebar.astro'
|
|
14
|
+
import type { PageSchema } from 'fulldev-ui/schemas/page.ts'
|
|
15
|
+
|
|
16
|
+
interface Props extends ComponentProps<typeof Layout>, PageSchema {
|
|
17
|
+
slug: CollectionEntry<'pages'>['slug']
|
|
18
|
+
render: CollectionEntry<'pages'>['render']
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const { slug, header, sidebar, render, title, description, footer } =
|
|
22
|
+
Astro.props
|
|
23
|
+
|
|
24
|
+
const { Content } = await render()
|
|
25
|
+
|
|
26
|
+
const children = (
|
|
27
|
+
await getCollection('pages', ({ data }) =>
|
|
28
|
+
data.parents?.some((p) => p.slug.includes(slug))
|
|
29
|
+
)
|
|
30
|
+
)?.map(({ collection, slug }) => ({ collection, slug }))
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
<Layout
|
|
34
|
+
class:list="jobs"
|
|
35
|
+
{...Astro.props}
|
|
36
|
+
>
|
|
37
|
+
<Header
|
|
38
|
+
{...sidebar}
|
|
39
|
+
{...header}
|
|
40
|
+
/>
|
|
41
|
+
<Container class:list="jobs-container">
|
|
42
|
+
<Sidebar {...sidebar} />
|
|
43
|
+
<Element
|
|
44
|
+
class:list="jobs-main"
|
|
45
|
+
as="main"
|
|
46
|
+
>
|
|
47
|
+
<Intro1
|
|
48
|
+
heading={title}
|
|
49
|
+
paragraph={description}
|
|
50
|
+
/>
|
|
51
|
+
<Jobs1 pages={children} />
|
|
52
|
+
<Prose>
|
|
53
|
+
<Content />
|
|
54
|
+
</Prose>
|
|
55
|
+
</Element>
|
|
56
|
+
</Container>
|
|
57
|
+
</Layout>
|
|
58
|
+
<Footer {...footer} />
|
|
59
|
+
|
|
60
|
+
<style is:global>
|
|
61
|
+
@layer fulldev {
|
|
62
|
+
.jobs {
|
|
63
|
+
.jobs-container {
|
|
64
|
+
@apply flex !pr-0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.jobs-main {
|
|
68
|
+
@apply flex w-full flex-col;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
</style>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps } from 'astro/types'
|
|
3
|
+
import Banner from 'fulldev-ui/blocks/Banner.astro'
|
|
4
|
+
import Footer from 'fulldev-ui/blocks/Footer.astro'
|
|
5
|
+
import Header from 'fulldev-ui/blocks/Header.astro'
|
|
6
|
+
import Block from 'fulldev-ui/components/Block.astro'
|
|
7
|
+
import Element from 'fulldev-ui/components/Element.astro'
|
|
8
|
+
import Layout from 'fulldev-ui/components/Layout.astro'
|
|
9
|
+
import type { PageSchema } from 'fulldev-ui/schemas/page.ts'
|
|
10
|
+
|
|
11
|
+
interface Props extends ComponentProps<typeof Layout>, PageSchema {}
|
|
12
|
+
|
|
13
|
+
const { banner, sidebar, header, blocks, footer } = Astro.props
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
<Layout
|
|
17
|
+
class:list="page"
|
|
18
|
+
{...Astro.props}
|
|
19
|
+
>
|
|
20
|
+
<Banner {...banner} />
|
|
21
|
+
<Header
|
|
22
|
+
{...sidebar}
|
|
23
|
+
{...header}
|
|
24
|
+
/>
|
|
25
|
+
<Element as="main">
|
|
26
|
+
{blocks?.map((block) => <Block {...block} />)}
|
|
27
|
+
</Element>
|
|
28
|
+
<Footer {...footer} />
|
|
29
|
+
</Layout>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { ComponentProps } from 'astro/types'
|
|
3
|
+
import type { CollectionEntry } from 'astro:content'
|
|
4
|
+
import Content1 from 'fulldev-ui/blocks/Content1.astro'
|
|
5
|
+
import Footer from 'fulldev-ui/blocks/Footer.astro'
|
|
6
|
+
import Header from 'fulldev-ui/blocks/Header.astro'
|
|
7
|
+
import Block from 'fulldev-ui/components/Block.astro'
|
|
8
|
+
import Element from 'fulldev-ui/components/Element.astro'
|
|
9
|
+
import Layout from 'fulldev-ui/components/Layout.astro'
|
|
10
|
+
import type { PageSchema } from 'fulldev-ui/schemas/page'
|
|
11
|
+
|
|
12
|
+
interface Props extends ComponentProps<typeof Layout>, PageSchema {
|
|
13
|
+
render: CollectionEntry<'pages'>['render']
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const {
|
|
17
|
+
title,
|
|
18
|
+
description,
|
|
19
|
+
list,
|
|
20
|
+
button,
|
|
21
|
+
header,
|
|
22
|
+
sidebar,
|
|
23
|
+
blocks,
|
|
24
|
+
footer,
|
|
25
|
+
render,
|
|
26
|
+
} = Astro.props
|
|
27
|
+
|
|
28
|
+
const { Content, headings } = await render()
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
<Layout
|
|
32
|
+
class:list="post"
|
|
33
|
+
{...Astro.props}
|
|
34
|
+
>
|
|
35
|
+
<Header
|
|
36
|
+
{...sidebar}
|
|
37
|
+
{...header}
|
|
38
|
+
/>
|
|
39
|
+
<Element as="main">
|
|
40
|
+
<Content1
|
|
41
|
+
heading={title}
|
|
42
|
+
paragraph={description}
|
|
43
|
+
{list}
|
|
44
|
+
{button}
|
|
45
|
+
{headings}
|
|
46
|
+
>
|
|
47
|
+
<Content />
|
|
48
|
+
</Content1>
|
|
49
|
+
{blocks?.map((block) => <Block {...block} />)}
|
|
50
|
+
</Element>
|
|
51
|
+
<Footer {...footer} />
|
|
52
|
+
</Layout>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
import type { ComponentProps } from 'astro/types'
|
|
2
3
|
import { getImage } from 'astro:assets'
|
|
3
4
|
import type { CollectionEntry } from 'astro:content'
|
|
4
5
|
import { getCollection, getEntry } from 'astro:content'
|
|
@@ -7,21 +8,26 @@ import CartForm from 'fulldev-ui/components/CartForm.svelte'
|
|
|
7
8
|
import Element from 'fulldev-ui/components/Element.astro'
|
|
8
9
|
import Gallery from 'fulldev-ui/components/Gallery.astro'
|
|
9
10
|
import Heading from 'fulldev-ui/components/Heading.astro'
|
|
11
|
+
import Layout from 'fulldev-ui/components/Layout.astro'
|
|
10
12
|
import List from 'fulldev-ui/components/List.astro'
|
|
11
13
|
import Paragraph from 'fulldev-ui/components/Paragraph.astro'
|
|
12
14
|
import Prose from 'fulldev-ui/components/Prose.astro'
|
|
13
|
-
import
|
|
14
|
-
import { mergeDeep } from 'remeda'
|
|
15
|
+
import type { PageSchema } from 'fulldev-ui/schemas/page'
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const merged = mergeDeep(layout || {}, Astro.props)
|
|
17
|
+
interface Props extends ComponentProps<typeof Layout>, PageSchema {
|
|
18
|
+
render: CollectionEntry<'pages'>['render']
|
|
19
|
+
}
|
|
20
20
|
|
|
21
21
|
const {
|
|
22
22
|
render,
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
title,
|
|
24
|
+
price,
|
|
25
|
+
images,
|
|
26
|
+
description,
|
|
27
|
+
soldout,
|
|
28
|
+
categories,
|
|
29
|
+
variants,
|
|
30
|
+
} = Astro.props
|
|
25
31
|
|
|
26
32
|
const slug = Astro.url.pathname.replace(/^\/|\/$/g, '') || 'index'
|
|
27
33
|
const imageId = images?.[0]?.id
|
|
@@ -40,7 +46,10 @@ const relatedProducts = await getCollection('products', (product) =>
|
|
|
40
46
|
const baseLayout = await getEntry('layouts', 'base')
|
|
41
47
|
---
|
|
42
48
|
|
|
43
|
-
<Layout
|
|
49
|
+
<Layout
|
|
50
|
+
class:list="product"
|
|
51
|
+
{...Astro.props}
|
|
52
|
+
>
|
|
44
53
|
<Element
|
|
45
54
|
class:list="product"
|
|
46
55
|
as="section"
|
|
@@ -59,10 +68,10 @@ const baseLayout = await getEntry('layouts', 'base')
|
|
|
59
68
|
/>
|
|
60
69
|
<Paragraph text={description} />
|
|
61
70
|
</Element>
|
|
62
|
-
<CartForm
|
|
71
|
+
<!-- <CartForm
|
|
63
72
|
product={Astro.props}
|
|
64
73
|
client:load
|
|
65
|
-
/>
|
|
74
|
+
/> -->
|
|
66
75
|
<List
|
|
67
76
|
size="sm"
|
|
68
77
|
items={baseLayout.data.banner?.split('|')}
|
|
@@ -1,17 +1,49 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { getCollection } from 'astro:content'
|
|
3
|
-
import PageLayout from 'fulldev-ui/layouts/PageLayout.astro'
|
|
2
|
+
import { getCollection, getEntry } from 'astro:content'
|
|
4
3
|
import { getHref } from 'fulldev-ui/utils/getHref.ts'
|
|
4
|
+
import { dash, pascal } from 'radash'
|
|
5
|
+
import { mergeDeep } from 'remeda'
|
|
5
6
|
|
|
6
7
|
export async function getStaticPaths() {
|
|
7
8
|
const collection = await getCollection('pages')
|
|
8
9
|
return collection.map((entry) => ({
|
|
9
10
|
params: {
|
|
10
|
-
page: getHref(entry.
|
|
11
|
+
page: getHref(entry.slug),
|
|
11
12
|
},
|
|
12
13
|
props: entry,
|
|
13
14
|
}))
|
|
14
15
|
}
|
|
16
|
+
|
|
17
|
+
const layoutName = Astro.props.data._layout ?? 'Page'
|
|
18
|
+
const layoutComponentName = pascal(layoutName)
|
|
19
|
+
|
|
20
|
+
const layoutsComponents = {
|
|
21
|
+
...import.meta.glob('/src/layouts/**/*.astro'),
|
|
22
|
+
...import.meta.glob('../layouts/**/*.astro'),
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const layoutComponentPath = Object.keys(layoutsComponents).find(
|
|
26
|
+
(path) => path.split('/').pop()?.split('.')[0] === layoutComponentName
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
const LayoutComponent =
|
|
30
|
+
layoutComponentPath &&
|
|
31
|
+
(await (layoutsComponents[layoutComponentPath] as any)()).default
|
|
32
|
+
|
|
33
|
+
const layoutEntryName = dash(layoutName)
|
|
34
|
+
const layoutEntry = await getEntry('layouts', layoutEntryName)
|
|
35
|
+
const baseLayout = await getEntry('layouts', 'base')
|
|
36
|
+
const mergedLayouts = mergeDeep(baseLayout || {}, layoutEntry || {})
|
|
37
|
+
const merged = mergeDeep(mergedLayouts, Astro.props)
|
|
38
|
+
|
|
39
|
+
const { data, ...rest } = merged
|
|
15
40
|
---
|
|
16
41
|
|
|
17
|
-
|
|
42
|
+
{
|
|
43
|
+
LayoutComponent && (
|
|
44
|
+
<LayoutComponent
|
|
45
|
+
{...data}
|
|
46
|
+
{...rest}
|
|
47
|
+
/>
|
|
48
|
+
)
|
|
49
|
+
}
|
package/src/pages/test.astro
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
import Hero1 from 'fulldev-ui/blocks/Hero1.astro'
|
|
3
|
-
import Layout from 'fulldev-ui/
|
|
3
|
+
import Layout from 'fulldev-ui/components/Layout.astro'
|
|
4
|
+
|
|
5
|
+
import { $cart } from 'fulldev-ui/stores/cart'
|
|
6
|
+
|
|
7
|
+
const value = $cart.get()
|
|
4
8
|
---
|
|
5
9
|
|
|
6
10
|
<Layout>
|
|
@@ -8,4 +12,24 @@ import Layout from 'fulldev-ui/layouts/Layout.astro'
|
|
|
8
12
|
heading="hello world"
|
|
9
13
|
class="hoi"
|
|
10
14
|
/>
|
|
15
|
+
{value}
|
|
16
|
+
|
|
17
|
+
<button id="myyy-button">Add item</button>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
import { addItem } from 'fulldev-ui/stores/cart'
|
|
21
|
+
|
|
22
|
+
const button = document.querySelector('#myyy-button')
|
|
23
|
+
button?.addEventListener('click', () => {
|
|
24
|
+
console.log('clicked')
|
|
25
|
+
addItem({
|
|
26
|
+
slug: 'test',
|
|
27
|
+
title: 'title',
|
|
28
|
+
price: 10,
|
|
29
|
+
quantity: 10,
|
|
30
|
+
image: '',
|
|
31
|
+
variants: [],
|
|
32
|
+
})
|
|
33
|
+
})
|
|
34
|
+
</script>
|
|
11
35
|
</Layout>
|