fulldev-ui 0.6.0-beta.6 → 0.6.0-beta.8
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/.vscode/settings.json +2 -0
- package/astro.config.ts +1 -3
- package/cloudcannon.config.yml +2 -3
- package/package.json +1 -1
- package/src/blocks/Banner.astro +3 -3
- package/src/blocks/Colleagues1.astro +16 -16
- package/src/blocks/Contact1.astro +5 -10
- package/src/blocks/Content1.astro +22 -39
- package/src/blocks/Content2.astro +21 -45
- package/src/blocks/Content3.astro +36 -31
- package/src/blocks/Content4.astro +28 -35
- package/src/blocks/Content5.astro +72 -0
- package/src/blocks/Cta1.astro +6 -6
- package/src/blocks/Features1.astro +9 -5
- package/src/blocks/Footer.astro +13 -5
- package/src/blocks/Header.astro +19 -15
- package/src/blocks/Hero1.astro +8 -5
- package/src/blocks/Industries1.astro +86 -0
- package/src/blocks/Intro1.astro +7 -9
- package/src/blocks/Jobs1.astro +28 -24
- package/src/blocks/Logos1.astro +4 -4
- package/src/blocks/Products1.astro +4 -4
- package/src/blocks/Projects1.astro +103 -0
- package/src/blocks/Reviews1.astro +9 -7
- package/src/{components → blocks}/Subheader.astro +1 -2
- package/src/components/Badge.astro +8 -20
- package/src/components/Badges.astro +3 -3
- package/src/components/Block.astro +1 -1
- package/src/components/Button.astro +9 -18
- package/src/components/Cart.astro +6 -6
- package/src/components/CartSummary.astro +1 -0
- package/src/components/Channel.astro +9 -3
- package/src/components/Channels.astro +11 -42
- package/src/components/Checkbox.astro +8 -14
- package/src/components/Element.astro +2 -1
- package/src/components/Form.astro +1 -2
- package/src/components/Gallery.astro +6 -5
- package/src/components/Head.astro +14 -4
- package/src/components/Heading.astro +21 -17
- package/src/components/Icon.astro +2 -3
- package/src/components/Image.astro +6 -2
- package/src/components/Input.astro +11 -14
- package/src/components/Label.astro +6 -6
- package/src/components/Link.astro +13 -16
- package/src/components/Links.astro +1 -2
- package/src/components/List.astro +3 -5
- package/src/components/Logo.astro +9 -16
- package/src/components/Menu.astro +7 -3
- package/src/components/Paragraph.astro +6 -7
- package/src/components/Price.astro +1 -4
- package/src/components/Rating.astro +4 -2
- package/src/components/Search.astro +1 -6
- package/src/components/Select.astro +3 -4
- package/src/components/Sidebar.astro +6 -6
- package/src/components/Social.astro +3 -1
- package/src/components/Socials.astro +18 -34
- package/src/components/Switch.astro +4 -69
- package/src/components/Table.astro +2 -3
- package/src/components/Tagline.astro +6 -7
- package/src/components/Textarea.astro +5 -5
- package/src/components/Themer.astro +3 -3
- package/src/components/Toc.astro +7 -11
- package/src/components/Toggle.astro +45 -0
- package/src/components/{Breadcrumb.astro → _Breadcrumb.astro} +3 -3
- package/src/components/_Image.astro +2 -2
- package/src/components/docs/Props.astro +21 -0
- package/src/content/layouts/base.yml +131 -19
- package/src/content/pages/base/toggle.mdx +28 -0
- package/src/content/pages/{blocks → docs/blocks}/banner.mdx +1 -0
- package/src/content/pages/docs/blocks/colleagues.mdx +49 -0
- package/src/content/pages/docs/blocks/content.mdx +155 -0
- package/src/content/pages/docs/blocks/cta.mdx +16 -0
- package/src/content/pages/docs/blocks/feature.mdx +17 -0
- package/src/content/pages/docs/blocks/features.mdx +35 -0
- package/src/content/pages/docs/blocks/footer.mdx +46 -0
- package/src/content/pages/docs/blocks/header.mdx +60 -0
- package/src/content/pages/docs/blocks/hero.mdx +18 -0
- package/src/content/pages/docs/blocks/intro.mdx +16 -0
- package/src/content/pages/docs/blocks/logos.mdx +37 -0
- package/src/content/pages/docs/blocks/projects.mdx +36 -0
- package/src/content/pages/docs/blocks/reviews.mdx +65 -0
- package/src/content/pages/docs/blocks.mdx +45 -20
- package/src/content/pages/docs/collections/pages.mdx +2 -2
- package/src/content/pages/docs/components/{table.mdx → _table.mdx} +2 -4
- package/src/content/pages/docs/components/{themer.mdx → _themer.mdx} +2 -4
- package/src/content/pages/docs/components/_toggle.mdx +2 -2
- package/src/content/pages/docs/components/badge.mdx +2 -4
- package/src/content/pages/docs/components/badges.mdx +3 -4
- package/src/content/pages/docs/components/button.mdx +2 -4
- package/src/content/pages/docs/components/buttons.mdx +3 -4
- package/src/content/pages/docs/components/channel.mdx +2 -4
- package/src/content/pages/docs/components/channels.mdx +3 -2
- package/src/content/pages/docs/components/checkbox.mdx +2 -4
- package/src/content/pages/docs/components/heading.mdx +11 -21
- package/src/content/pages/docs/components/icon.mdx +2 -4
- package/src/content/pages/docs/components/image.mdx +3 -9
- package/src/content/pages/docs/components/input.mdx +2 -4
- package/src/content/pages/docs/components/label.mdx +2 -4
- package/src/content/pages/docs/components/link.mdx +2 -4
- package/src/content/pages/docs/components/links.mdx +3 -4
- package/src/content/pages/docs/components/list.mdx +2 -4
- package/src/content/pages/docs/components/logo.mdx +9 -21
- package/src/content/pages/docs/components/menu.mdx +20 -48
- package/src/content/pages/docs/components/paragraph.mdx +44 -0
- package/src/content/pages/docs/components/rating.mdx +9 -42
- package/src/content/pages/docs/components/select.mdx +2 -4
- package/src/content/pages/docs/components/social.mdx +2 -4
- package/src/content/pages/docs/components/socials.mdx +3 -2
- package/src/content/pages/docs/components/switch.mdx +2 -4
- package/src/content/pages/docs/components/tagline.mdx +2 -6
- package/src/content/pages/docs/components/textarea.mdx +2 -4
- package/src/content/pages/docs/components.mdx +3 -4
- package/src/content/pages/docs/customization.mdx +52 -20
- package/src/content/pages/docs/frameworks.mdx +12 -11
- package/src/content/pages/docs/index.mdx +3 -2
- package/src/content/pages/docs/installation.mdx +9 -6
- package/src/content/pages/docs/layouts/doc.mdx +15 -0
- package/src/content/pages/docs/layouts/page.mdx +15 -0
- package/src/content/pages/docs/layouts.mdx +66 -19
- package/src/content/pages/docs/{generating-pages.mdx → pages.mdx} +1 -0
- package/src/content/pages/docs/{components → structures}/_card.mdx +6 -6
- package/src/content/pages/docs/{components → structures}/_drawer.mdx +1 -1
- package/src/content/pages/docs/structures/card.mdx +15 -0
- package/src/content/pages/docs/{components → structures}/code.mdx +4 -7
- package/src/content/pages/docs/structures/container.mdx +15 -0
- package/src/content/pages/docs/structures/drawer.mdx +15 -0
- package/src/content/pages/docs/structures/group.mdx +15 -0
- package/src/content/pages/docs/structures/layout.mdx +15 -0
- package/src/content/pages/docs/structures/masonry.mdx +15 -0
- package/src/content/pages/docs/structures/matrix.mdx +15 -0
- package/src/content/pages/docs/structures/panel.mdx +15 -0
- package/src/content/pages/docs/{components → structures}/prose.mdx +3 -6
- package/src/content/pages/docs/structures/section.mdx +15 -0
- package/src/content/pages/docs/structures/stack.mdx +15 -0
- package/src/content/pages/docs/structures/writeup.mdx +15 -0
- package/src/content/pages/docs/structures.mdx +7 -0
- package/src/content/pages/index.mdx +7 -4
- package/src/content/pages/showcase.mdx +1 -4
- package/src/css/theme.css +9 -42
- package/src/integration/index.ts +1 -3
- package/src/layouts/Block.astro +81 -0
- package/src/layouts/Category.astro +6 -6
- package/src/layouts/Doc.astro +50 -24
- package/src/layouts/Job.astro +5 -7
- package/src/layouts/Jobs.astro +14 -14
- package/src/layouts/Page.astro +4 -4
- package/src/layouts/Post.astro +7 -6
- package/src/layouts/Product.astro +3 -2
- package/src/schemas/badge.ts +14 -0
- package/src/schemas/block.ts +58 -0
- package/src/schemas/{components/button.ts → button.ts} +3 -7
- package/src/schemas/channel.ts +14 -0
- package/src/schemas/checkbox.ts +13 -0
- package/src/schemas/footer.ts +17 -0
- package/src/schemas/{components/head.ts → head.ts} +5 -5
- package/src/schemas/header.ts +21 -0
- package/src/schemas/{components/image.ts → image.ts} +22 -9
- package/src/schemas/input.ts +13 -0
- package/src/schemas/link.ts +14 -0
- package/src/schemas/logo.ts +13 -0
- package/src/schemas/menu.ts +11 -0
- package/src/schemas/page.ts +11 -14
- package/src/schemas/{utils/pathSchema.ts → path.ts} +1 -1
- package/src/schemas/textarea.ts +11 -0
- package/src/stores/cart.svelte.ts +0 -1
- package/src/{components → structures}/Card.astro +5 -1
- package/src/{components → structures}/Code.astro +7 -6
- package/src/{components → structures}/Container.astro +1 -1
- package/src/{components → structures}/Drawer.astro +4 -4
- package/src/{components → structures}/Layout.astro +2 -3
- package/src/structures/Matrix.astro +39 -0
- package/src/{components → structures}/Prose.astro +17 -6
- package/src/structures/Sidebar.astro +37 -0
- package/src/{components → structures}/Stack.astro +1 -1
- package/src/{components → structures}/Writeup.astro +9 -1
- package/src/structures/_Bento.astro +34 -0
- package/src/utils/cart.ts +1 -1
- package/tailwind.config.ts +5 -7
- package/tsconfig.json +3 -1
- package/public/favicon/favicon-16x16-dark.png +0 -0
- package/public/favicon/favicon-32x32-dark.png +0 -0
- package/public/favicon/favicon-48x48-dark.png +0 -0
- package/public/favicon/favicon-dark.ico +0 -0
- package/src/blocks/Feature1.astro +0 -61
- package/src/components/Avatar.astro +0 -45
- package/src/components/Avatars.astro +0 -36
- package/src/components/Cards.astro +0 -133
- package/src/components/Dialog.astro +0 -67
- package/src/components/DrawerOld.astro +0 -143
- package/src/components/Grid.astro +0 -39
- package/src/components/Header.astro +0 -32
- package/src/components/Navigation.astro +0 -39
- package/src/components/_Author.astro +0 -90
- package/src/components/_Header.astro +0 -129
- package/src/components/_Prose copy.astro +0 -172
- package/src/components/_Sidebar copy.astro +0 -87
- package/src/components/docs/DecorativeBox.astro +0 -15
- package/src/components/docs/PropsTable.astro +0 -49
- package/src/components/experimental/Video.astro +0 -32
- package/src/components/experimental/Window.astro +0 -122
- package/src/content/pages/blocks/_footer.mdx +0 -75
- package/src/content/pages/blocks/_header.mdx +0 -183
- package/src/content/pages/blocks/_prices.mdx +0 -122
- package/src/content/pages/blocks/_product.mdx +0 -97
- package/src/content/pages/blocks/_products.mdx +0 -52
- package/src/content/pages/blocks/colleagues.mdx +0 -37
- package/src/content/pages/blocks/content.mdx +0 -77
- package/src/content/pages/blocks/cta.mdx +0 -159
- package/src/content/pages/blocks/features.mdx +0 -128
- package/src/content/pages/blocks/hero.mdx +0 -94
- package/src/content/pages/blocks/intro.mdx +0 -124
- package/src/content/pages/blocks/reviews.mdx +0 -251
- package/src/content/pages/categories/category.md +0 -7
- package/src/content/pages/docs/_internationalization.mdx +0 -55
- package/src/content/pages/docs/_using-blocks.mdx +0 -33
- package/src/content/pages/docs/_using-presets.mdx +0 -49
- package/src/content/pages/docs/collections.mdx +0 -42
- package/src/content/pages/docs/components/_switch.mdx +0 -31
- package/src/content/pages/docs/components/avatar.mdx +0 -34
- package/src/content/pages/docs/components/section.mdx +0 -35
- package/src/content/pages/docs/components/text.mdx +0 -48
- package/src/content/pages/products/product.md +0 -20
- package/src/css/color.css +0 -76
- package/src/css/size.css +0 -131
- package/src/images/favicon/android-chrome-192x192.png +0 -0
- package/src/images/favicon/android-chrome-512x512.png +0 -0
- package/src/images/favicon/apple-touch-icon.png +0 -0
- package/src/images/favicon/browserconfig.xml +0 -9
- package/src/images/favicon/favicon-16x16.png +0 -0
- package/src/images/favicon/favicon-32x32.png +0 -0
- package/src/images/favicon/favicon-48x48.png +0 -0
- package/src/images/favicon/favicon.ico +0 -0
- package/src/images/favicon/favicon.svg +0 -16
- package/src/images/favicon/manifest.webmanifest +0 -30
- package/src/images/favicon/mstile-150x150.png +0 -0
- package/src/images/favicon/safari-pinned-tab.svg +0 -16
- package/src/images/favicon/yandex-browser-50x50.png +0 -0
- package/src/images/favicon/yandex-browser-manifest.json +0 -9
- package/src/pages/test.astro +0 -35
- package/src/schemas/components/avatar.ts +0 -6
- package/src/schemas/components/badge.ts +0 -18
- package/src/schemas/components/block.ts +0 -61
- package/src/schemas/components/channel.ts +0 -19
- package/src/schemas/components/footer.ts +0 -19
- package/src/schemas/components/header.ts +0 -23
- package/src/schemas/components/heading.ts +0 -9
- package/src/schemas/components/icon.ts +0 -9
- package/src/schemas/components/link.ts +0 -17
- package/src/schemas/components/logo.ts +0 -13
- package/src/schemas/components/menu.ts +0 -14
- package/src/schemas/components/navigation.ts +0 -10
- package/src/schemas/components/paragraph.ts +0 -9
- package/src/schemas/components/price.ts +0 -9
- package/src/schemas/components/rating.ts +0 -10
- package/src/schemas/components/sidebar.ts +0 -18
- package/src/schemas/components/social.ts +0 -18
- package/src/schemas/components/tagline.ts +0 -9
- package/src/schemas/imageSchema.ts +0 -41
- package/src/schemas/utils/component.ts +0 -17
- package/src/types/global-props.ts +0 -7
- package/src/utils/_archive/Childmorphic.ts +0 -8
- package/src/utils/_archive/getAllCollections.ts +0 -10
- package/src/utils/_archive/getCollectionCascade.ts +0 -33
- package/src/utils/_archive/getPathname.ts +0 -18
- package/src/utils/_archive/mergeEntries.ts +0 -28
- package/src/utils/_archive/staticPageSchema.ts +0 -124
- package/src/utils/_archive/transform/transform.ts +0 -25
- package/src/utils/_archive/transform/transformCasing.ts +0 -24
- package/src/utils/_archive/transform/transformReferences.ts +0 -54
- package/src/utils/_archive/transform/transformSelfs.ts +0 -20
- package/src/utils/_archive/transform/transformUnderscores.ts +0 -19
- package/src/utils/formatEntries.ts +0 -8
- package/src/utils/formatEntry.ts +0 -29
- package/src/utils/getDeepReferenceChildren.ts +0 -14
- package/src/utils/getFolderChildren.ts +0 -18
- package/src/utils/getReferenceChildren.ts +0 -14
- package/src/utils/getSiblingPages.ts +0 -14
- package/src/utils/setTheme.ts +0 -18
- /package/{src → public}/images/anti-slip-profiles.webp +0 -0
- /package/{src → public}/images/avatar-1.jpeg +0 -0
- /package/{src → public}/images/avatar-2.jpeg +0 -0
- /package/{src → public}/images/avatar-3.jpeg +0 -0
- /package/{src → public}/images/avatar-4.jpeg +0 -0
- /package/{src → public}/images/avatar-placeholder.jpg +0 -0
- /package/{src → public}/images/block-code.png +0 -0
- /package/{src → public}/images/component-code.png +0 -0
- /package/{src → public}/images/favicon.svg +0 -0
- /package/{src → public}/images/fulldev-ui.webp +0 -0
- /package/{src → public}/images/lavis-detailing.webp +0 -0
- /package/{src → public}/images/leren-trainingsacteren.webp +0 -0
- /package/{src → public}/images/logo-1.svg +0 -0
- /package/{src → public}/images/logo-2.svg +0 -0
- /package/{src → public}/images/logo-basic.svg +0 -0
- /package/{src → public}/images/logo-simple.svg +0 -0
- /package/{src → public}/images/logo-thin.svg +0 -0
- /package/{src → public}/images/logo.svg +0 -0
- /package/{src → public}/images/logofat.svg +0 -0
- /package/{src → public}/images/miele-witgoedcenter-amsterdam.webp +0 -0
- /package/{src → public}/images/og-image.png +0 -0
- /package/{src → public}/images/placeholder-center.webp +0 -0
- /package/{src → public}/images/placeholder-landscape-dark.png +0 -0
- /package/{src → public}/images/placeholder-landscape.webp +0 -0
- /package/{src → public}/images/placeholder-portrait.webp +0 -0
- /package/{src → public}/images/placeholder-right.webp +0 -0
- /package/{src → public}/images/placeholder.webp +0 -0
- /package/{src → public}/images/sloepverhuur-bolsward.webp +0 -0
- /package/{src → public}/images/stark-vulcanising-products.webp +0 -0
- /package/{src → public}/images/the-gym-haren.webp +0 -0
- /package/{src → public}/images/van-dillen-antieke-bouwmaterialen.webp +0 -0
- /package/src/components/{LocaleSwitcher.astro → _LocaleSwitcher.astro} +0 -0
- /package/src/content/pages/{showcase → _showcase}/anti-slip-profiles.md +0 -0
- /package/src/content/pages/{showcase → _showcase}/fulldev-ui.md +0 -0
- /package/src/content/pages/{showcase → _showcase}/lavis-detailing.md +0 -0
- /package/src/content/pages/{showcase → _showcase}/leren-trainingsacteren.md +0 -0
- /package/src/content/pages/{showcase → _showcase}/miele-witgoedcenter-amsterdam.md +0 -0
- /package/src/content/pages/{showcase → _showcase}/sloepverhuur-bolsward.md +0 -0
- /package/src/content/pages/{showcase → _showcase}/stark-vulcanising-products.md +0 -0
- /package/src/content/pages/{showcase → _showcase}/the-gym-haren.md +0 -0
- /package/src/content/pages/{showcase → _showcase}/van-dillen-antieke-bouwmaterialen.md +0 -0
- /package/src/content/pages/{blocks → docs/blocks}/_categories.mdx +0 -0
- /package/src/content/pages/{blocks/contact.mdx → docs/blocks/_contact.mdx} +0 -0
- /package/src/content/pages/{blocks → docs/blocks}/_jobs.mdx +0 -0
- /package/src/content/pages/{blocks/posts.mdx → docs/blocks/_posts.mdx} +0 -0
- /package/src/content/pages/{blocks → docs/blocks}/_stats.mdx +0 -0
- /package/src/content/pages/docs/{components → structures}/_dialog.mdx +0 -0
- /package/src/{components → structures}/Carousel.astro +0 -0
- /package/src/{components → structures}/Group.astro +0 -0
- /package/src/{components → structures}/Masonry.astro +0 -0
- /package/src/{components → structures}/Panel.astro +0 -0
- /package/src/{components → structures}/Section.astro +0 -0
- /package/{src/types/virtual.d.ts → virtual.d.ts} +0 -0
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { z } from 'astro:content'
|
|
2
|
-
import { logoSchema } from '../components/logo'
|
|
3
|
-
import { headingSchema } from './heading'
|
|
4
|
-
import { linkSchema } from './link'
|
|
5
|
-
import { menuSchema } from './menu'
|
|
6
|
-
|
|
7
|
-
export const sidebarSchema = z
|
|
8
|
-
.object({
|
|
9
|
-
company: z.string().optional(),
|
|
10
|
-
logo: logoSchema.optional(),
|
|
11
|
-
heading: headingSchema.shape.text,
|
|
12
|
-
themer: z.boolean().optional(),
|
|
13
|
-
menus: menuSchema.array().optional(),
|
|
14
|
-
links: linkSchema.array().optional(),
|
|
15
|
-
})
|
|
16
|
-
.strict()
|
|
17
|
-
|
|
18
|
-
export type SidebarSchema = z.infer<typeof sidebarSchema>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { z } from 'astro:content'
|
|
2
|
-
import { iconSchema } from './icon'
|
|
3
|
-
|
|
4
|
-
export const socialSchema = z
|
|
5
|
-
.object({
|
|
6
|
-
icon: iconSchema.optional(),
|
|
7
|
-
text: z.string().optional(),
|
|
8
|
-
href: z.string().optional(),
|
|
9
|
-
target: z.literal('_blank').default('_blank').optional(),
|
|
10
|
-
size: z.enum(['sm', 'md', 'lg']).default('sm').optional(),
|
|
11
|
-
variant: z
|
|
12
|
-
.enum(['primary', 'secondary', 'outline', 'ghost'])
|
|
13
|
-
.default('secondary')
|
|
14
|
-
.optional(),
|
|
15
|
-
})
|
|
16
|
-
.strict()
|
|
17
|
-
|
|
18
|
-
export type ButtonSchema = z.infer<typeof socialSchema>
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { z } from 'astro:content'
|
|
2
|
-
|
|
3
|
-
export const imageSchema = z
|
|
4
|
-
.object({
|
|
5
|
-
id: z.string(),
|
|
6
|
-
src: z.string(),
|
|
7
|
-
alt: z.string().default(''),
|
|
8
|
-
width: z.number().optional(),
|
|
9
|
-
height: z.number().optional(),
|
|
10
|
-
format: z.string().optional(),
|
|
11
|
-
})
|
|
12
|
-
.passthrough()
|
|
13
|
-
|
|
14
|
-
export type ImageSchema = z.infer<typeof imageSchema>
|
|
15
|
-
|
|
16
|
-
export const imageLoader = async () => {
|
|
17
|
-
const files = import.meta.glob('/src/images/**/*.{webp,png,jpg,jpeg,svg}', {
|
|
18
|
-
eager: true,
|
|
19
|
-
})
|
|
20
|
-
const entries = import.meta.glob('/src/images/**/*.{yml,yaml,json}', {
|
|
21
|
-
eager: true,
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
const allImages = Object.entries(files).map(([src, file]) => {
|
|
25
|
-
const id = src.split('/images/').pop()
|
|
26
|
-
const matchPath = Object.keys(entries).find(
|
|
27
|
-
(entry) => entry.split('.').shift() === src
|
|
28
|
-
) as any
|
|
29
|
-
const matchFile = entries[matchPath]
|
|
30
|
-
const matchData = matchFile ? (matchFile as any).default : {}
|
|
31
|
-
const fileData = file ? (file as any).default : {}
|
|
32
|
-
return {
|
|
33
|
-
id,
|
|
34
|
-
...fileData,
|
|
35
|
-
src,
|
|
36
|
-
...matchData,
|
|
37
|
-
}
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
return allImages as any
|
|
41
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { z } from 'astro:content'
|
|
2
|
-
import { mapKeys } from 'radash'
|
|
3
|
-
|
|
4
|
-
export default z.string().refine(
|
|
5
|
-
(value) => {
|
|
6
|
-
const packageComponents = import.meta.glob('../../**/*.astro')
|
|
7
|
-
const userComponents = import.meta.glob('/src/**/*.astro')
|
|
8
|
-
const mapBlockKeys = (blocks: any) =>
|
|
9
|
-
mapKeys(blocks, (key: any) => key.split('/').pop().split('.').shift())
|
|
10
|
-
const mergedComponents = {
|
|
11
|
-
...mapBlockKeys(packageComponents),
|
|
12
|
-
...mapBlockKeys(userComponents),
|
|
13
|
-
}
|
|
14
|
-
return mergedComponents[value] !== undefined
|
|
15
|
-
},
|
|
16
|
-
(value) => ({ message: `component: the component "${value}" does not exist` })
|
|
17
|
-
)
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// import type { CollectionKey } from 'astro:content'
|
|
2
|
-
// import { getCollection } from 'astro:content'
|
|
3
|
-
|
|
4
|
-
// export const getAllCollections = async (names: CollectionKey[]) => {
|
|
5
|
-
// const promises = names.map((name) => getCollection(name))
|
|
6
|
-
// const resolved = await Promise.all(promises)
|
|
7
|
-
// const flattened = resolved.flat()
|
|
8
|
-
// const filtered = flattened.filter(Boolean)
|
|
9
|
-
// return filtered
|
|
10
|
-
// }
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// import {
|
|
2
|
-
// getCollection,
|
|
3
|
-
// type CollectionEntry,
|
|
4
|
-
// type CollectionKey,
|
|
5
|
-
// type ContentCollectionKey,
|
|
6
|
-
// type DataCollectionKey,
|
|
7
|
-
// } from 'astro:content'
|
|
8
|
-
// import { unflatten } from 'flat'
|
|
9
|
-
// import { objectify } from 'radash'
|
|
10
|
-
// import { mapValues } from 'remeda'
|
|
11
|
-
|
|
12
|
-
// export type CollectionCascade = {
|
|
13
|
-
// [Key in ContentCollectionKey]: {
|
|
14
|
-
// [Key in CollectionEntry<ContentCollectionKey>['slug']]: any
|
|
15
|
-
// }
|
|
16
|
-
// } & {
|
|
17
|
-
// [Key in DataCollectionKey]: {
|
|
18
|
-
// [Key in CollectionEntry<DataCollectionKey>['id']]: any
|
|
19
|
-
// }
|
|
20
|
-
// }
|
|
21
|
-
|
|
22
|
-
// export const getCollectionCascade = async (collectionKeys: CollectionKey[]) => {
|
|
23
|
-
// const promises = collectionKeys.map((key) => getCollection(key))
|
|
24
|
-
// const resolved = await Promise.all(promises)
|
|
25
|
-
// const flattened = resolved.flat()
|
|
26
|
-
// const object = objectify(
|
|
27
|
-
// flattened,
|
|
28
|
-
// ({ collection, slug, id }) => `${collection}.${slug || id}`
|
|
29
|
-
// )
|
|
30
|
-
// const mapped = mapValues(object, (value) => value.data)
|
|
31
|
-
// const unflattened = unflatten(mapped)
|
|
32
|
-
// return unflattened as CollectionCascade
|
|
33
|
-
// }
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// import type { AstroGlobal } from 'astro'
|
|
2
|
-
// import type { CollectionEntry, ContentCollectionKey } from 'astro:content'
|
|
3
|
-
|
|
4
|
-
// export const getPathname = ({
|
|
5
|
-
// slug,
|
|
6
|
-
// collection,
|
|
7
|
-
// data,
|
|
8
|
-
// }: CollectionEntry<ContentCollectionKey>):
|
|
9
|
-
// | AstroGlobal['url']['pathname']
|
|
10
|
-
// | undefined => {
|
|
11
|
-
// if (!slug) return
|
|
12
|
-
// if (data.draft) return
|
|
13
|
-
// if (data.output === false) return
|
|
14
|
-
// if (collection === 'pages' && slug === 'index') return '/'
|
|
15
|
-
// if (collection === 'pages') return `/${slug}`
|
|
16
|
-
// if (slug === 'index') return `/${collection}`
|
|
17
|
-
// return `/${collection}/${slug}`
|
|
18
|
-
// }
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// import { getEntry } from 'astro:content'
|
|
2
|
-
// import { assign } from 'radash'
|
|
3
|
-
|
|
4
|
-
// export const mergeEntries = async (entry: any) => {
|
|
5
|
-
// if (!entry) return entry
|
|
6
|
-
// const { data, slug } = entry
|
|
7
|
-
// const baseSettings = await getEntry('layouts', 'base')
|
|
8
|
-
// const enSettings = await getEntry('layouts', 'en')
|
|
9
|
-
// const deSettings = await getEntry('layouts', 'de')
|
|
10
|
-
// const frSettings = await getEntry('layouts', 'fr')
|
|
11
|
-
// const pageSettings = data.settings && (await getEntry(data.settings))
|
|
12
|
-
// const i18nSettings = data.i18n && (await getEntry(data.i18n))
|
|
13
|
-
|
|
14
|
-
// let merged = {}
|
|
15
|
-
// merged = assign(merged, baseSettings?.data ?? {})
|
|
16
|
-
// slug?.startsWith('en') && (merged = assign(merged, enSettings?.data ?? {}))
|
|
17
|
-
// slug?.startsWith('de') && (merged = assign(merged, deSettings?.data ?? {}))
|
|
18
|
-
// slug?.startsWith('fr') && (merged = assign(merged, frSettings?.data ?? {}))
|
|
19
|
-
// merged = assign(merged, i18nSettings?.data ?? {})
|
|
20
|
-
// merged = assign(merged, pageSettings?.data ?? {})
|
|
21
|
-
// merged = assign(merged, data)
|
|
22
|
-
|
|
23
|
-
// const newEntry = {
|
|
24
|
-
// ...entry,
|
|
25
|
-
// data: merged,
|
|
26
|
-
// }
|
|
27
|
-
// return newEntry
|
|
28
|
-
// }
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
// import {
|
|
2
|
-
// getCollection,
|
|
3
|
-
// getEntry,
|
|
4
|
-
// z,
|
|
5
|
-
// type CollectionEntry,
|
|
6
|
-
// type CollectionKey,
|
|
7
|
-
// } from 'astro:content'
|
|
8
|
-
// import { flatten, unflatten } from 'flat'
|
|
9
|
-
// import { all, camel, construct, get, isString, mapValues } from 'radash'
|
|
10
|
-
// import { mapKeys, merge } from 'remeda'
|
|
11
|
-
|
|
12
|
-
// interface Options {
|
|
13
|
-
// casing: boolean
|
|
14
|
-
// layouts: boolean
|
|
15
|
-
// references: boolean
|
|
16
|
-
// selfs: boolean
|
|
17
|
-
// }
|
|
18
|
-
|
|
19
|
-
// const defaults: Options = {
|
|
20
|
-
// casing: true,
|
|
21
|
-
// layouts: true,
|
|
22
|
-
// references: true,
|
|
23
|
-
// selfs: true,
|
|
24
|
-
// }
|
|
25
|
-
|
|
26
|
-
// const transformReferences = async (data: object) =>
|
|
27
|
-
// await all(
|
|
28
|
-
// mapValues(flatten(data) as any, async (value) => {
|
|
29
|
-
// if (!isString(value)) return value
|
|
30
|
-
// const parts = (value as string).split(' ')
|
|
31
|
-
// const results = await all(
|
|
32
|
-
// parts.map(async (valuePart) => {
|
|
33
|
-
// if (!valuePart.startsWith('$')) return valuePart
|
|
34
|
-
// if (valuePart.startsWith('$self')) return valuePart
|
|
35
|
-
|
|
36
|
-
// const reference = valuePart.split('.')[0].replace('$', '')
|
|
37
|
-
// const collection = reference.split('/')[0]
|
|
38
|
-
// const slug = reference.split('/').slice(1).join('/')
|
|
39
|
-
// const path = valuePart.split('.').slice(1).join('.')
|
|
40
|
-
|
|
41
|
-
// if (collection && slug) {
|
|
42
|
-
// let response = await getEntry(collection as CollectionKey, slug)
|
|
43
|
-
// const result = get(response?.data, path)
|
|
44
|
-
// return result
|
|
45
|
-
// } else if (collection) {
|
|
46
|
-
// const response = await getCollection(collection as CollectionKey)
|
|
47
|
-
// const result = response?.map((entry: any) => get(entry?.data, path))
|
|
48
|
-
// return result
|
|
49
|
-
// }
|
|
50
|
-
|
|
51
|
-
// return valuePart
|
|
52
|
-
// })
|
|
53
|
-
// )
|
|
54
|
-
// if (results.length == 1) return results[0]
|
|
55
|
-
// return results.join(' ')
|
|
56
|
-
// })
|
|
57
|
-
// )
|
|
58
|
-
|
|
59
|
-
// const transformLayouts = (data: object) => {
|
|
60
|
-
// const flat: any = flatten(data)
|
|
61
|
-
// let store: any = {}
|
|
62
|
-
// let i: number = 0
|
|
63
|
-
|
|
64
|
-
// const merged = mapKeys(flat, (key) => {
|
|
65
|
-
// if (!isString(key)) return key
|
|
66
|
-
// const parts = key.split('.')
|
|
67
|
-
// const result = parts.map((part) => {
|
|
68
|
-
// return part.replace(/^_+/, '')
|
|
69
|
-
// })
|
|
70
|
-
// const filtered = result.filter(Boolean)
|
|
71
|
-
// const joined = filtered.join('.')
|
|
72
|
-
// return joined
|
|
73
|
-
// })
|
|
74
|
-
// const nested = construct(merged)
|
|
75
|
-
// return nested
|
|
76
|
-
// }
|
|
77
|
-
|
|
78
|
-
// const transformSelfs = (data: object) => {
|
|
79
|
-
// const flat = flatten(data) as any
|
|
80
|
-
// const mapped = mapValues(flat, (value) => {
|
|
81
|
-
// if (!isString(value)) return value
|
|
82
|
-
// const parts = (value as string).split(' ')
|
|
83
|
-
// const result = parts.map((part) => {
|
|
84
|
-
// if (!part.startsWith('$self')) return part
|
|
85
|
-
// const pathParts = part.split('.').slice(1)
|
|
86
|
-
// const camelCased = pathParts.map((part) => camel(part))
|
|
87
|
-
// const path = camelCased.join('.')
|
|
88
|
-
// const result = get(data, path)
|
|
89
|
-
// return result ? result : part
|
|
90
|
-
// })
|
|
91
|
-
// return result.join(' ')
|
|
92
|
-
// })
|
|
93
|
-
// return unflatten(mapped)
|
|
94
|
-
// }
|
|
95
|
-
|
|
96
|
-
// const transformCasing = (object: object) => {
|
|
97
|
-
// const flat = flatten(object)
|
|
98
|
-
// const mapped = mapKeys(flat, (key) => {
|
|
99
|
-
// if (!isString(key)) return key
|
|
100
|
-
// const parts = (key as string).split('.')
|
|
101
|
-
// const result = parts.map((part) => camel(part))
|
|
102
|
-
// return result.join('.')
|
|
103
|
-
// })
|
|
104
|
-
// return unflatten(mapped)
|
|
105
|
-
// }
|
|
106
|
-
|
|
107
|
-
// export const pageSchema = (options: Partial<Options> = {}) =>
|
|
108
|
-
// z.any().transform(async (data: CollectionEntry<CollectionKey>['data']) => {
|
|
109
|
-
// const { layouts, casing, references, selfs } = merge(defaults, options)
|
|
110
|
-
|
|
111
|
-
// if (references) data = await transformReferences(data)
|
|
112
|
-
// // console.log('references', JSON.stringify(data, null, 2))
|
|
113
|
-
|
|
114
|
-
// if (layouts) data = transformLayouts(data)
|
|
115
|
-
// // console.log('layouts', data)
|
|
116
|
-
|
|
117
|
-
// if (casing) data = transformCasing(data)
|
|
118
|
-
// // console.log('casing', data)
|
|
119
|
-
|
|
120
|
-
// if (selfs) data = transformSelfs(data)
|
|
121
|
-
// // console.log('selfs', data)
|
|
122
|
-
|
|
123
|
-
// return data
|
|
124
|
-
// })
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// import type { CollectionEntry, CollectionKey } from 'astro:content'
|
|
2
|
-
// import { transformCasing } from './transformCasing'
|
|
3
|
-
// import { transformReferences } from './transformReferences'
|
|
4
|
-
// import { transformSelfs } from './transformSelfs'
|
|
5
|
-
// import { transformUnderscores } from './transformUnderscores'
|
|
6
|
-
|
|
7
|
-
// export const transform = async (
|
|
8
|
-
// entry: CollectionEntry<CollectionKey>
|
|
9
|
-
// ): Promise<any> => {
|
|
10
|
-
// // console.log('entry', entry.data)
|
|
11
|
-
|
|
12
|
-
// entry = await transformReferences(entry)
|
|
13
|
-
// // console.log('references', entry)
|
|
14
|
-
|
|
15
|
-
// entry = transformUnderscores(entry)
|
|
16
|
-
// // console.log('underscores', entry)
|
|
17
|
-
|
|
18
|
-
// entry = transformCasing(entry)
|
|
19
|
-
// // console.log('casing', entry)
|
|
20
|
-
|
|
21
|
-
// entry = transformSelfs(entry)
|
|
22
|
-
// // console.log('selfs', entry)
|
|
23
|
-
|
|
24
|
-
// return entry
|
|
25
|
-
// }
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// import { flatten, unflatten } from 'flat'
|
|
2
|
-
// import { camel, isObject } from 'radash'
|
|
3
|
-
// import { isArray, isString, mapKeys } from 'remeda'
|
|
4
|
-
|
|
5
|
-
// export const transformCasing = (data: any) => {
|
|
6
|
-
// if (!isObject(data) && !isArray(data)) return data
|
|
7
|
-
|
|
8
|
-
// const flat: any = flatten(data)
|
|
9
|
-
// const transformedData = mapKeys(flat, (key) => {
|
|
10
|
-
// if (!isString(key)) return key
|
|
11
|
-
// const parts = (key as string).split('.')
|
|
12
|
-
// const result = parts.map((part) => {
|
|
13
|
-
// const leadingUnderscores = part.match(/^_+/) || ['']
|
|
14
|
-
// const withoutLeadingUnderscores = part.replace(/^_+/, '')
|
|
15
|
-
// const camelCased = camel(withoutLeadingUnderscores)
|
|
16
|
-
// const result = leadingUnderscores + camelCased
|
|
17
|
-
// return result
|
|
18
|
-
// })
|
|
19
|
-
// return result.join('.')
|
|
20
|
-
// })
|
|
21
|
-
|
|
22
|
-
// const nested = unflatten(transformedData)
|
|
23
|
-
// return nested
|
|
24
|
-
// }
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
// import { getCollection, getEntry, type CollectionKey } from 'astro:content'
|
|
2
|
-
// import { flatten, unflatten } from 'flat'
|
|
3
|
-
// import { all, get, isString, mapValues } from 'radash'
|
|
4
|
-
// import { getPathname } from '../getPathname'
|
|
5
|
-
// import { transform } from './transform'
|
|
6
|
-
|
|
7
|
-
// export const transformReferences = async (data: object): Promise<any> => {
|
|
8
|
-
// const flat = flatten(data)
|
|
9
|
-
// const mappedValues = await all(
|
|
10
|
-
// mapValues(flat as any, async (value) => {
|
|
11
|
-
// if (!isString(value)) return value
|
|
12
|
-
// const parts = (value as string).split(' ')
|
|
13
|
-
// const mappedParts = await all(
|
|
14
|
-
// parts.map(async (valuePart) => {
|
|
15
|
-
// if (!valuePart.startsWith('$/')) return valuePart
|
|
16
|
-
|
|
17
|
-
// const reference = valuePart.split('.')[0].replace('$/', '')
|
|
18
|
-
// const collection = reference.split('/')[0]
|
|
19
|
-
// const slug = reference.split('/').slice(1).join('/')
|
|
20
|
-
// const path = valuePart.split('.').slice(1).join('.')
|
|
21
|
-
|
|
22
|
-
// if (collection && slug) {
|
|
23
|
-
// let response = await getEntry(collection as CollectionKey, slug)
|
|
24
|
-
// if (!response)
|
|
25
|
-
// throw new Error(`Entry not found: ${collection}/${slug}`)
|
|
26
|
-
// const transformed = await transform(response as any)
|
|
27
|
-
// const result = get(transformed?.data, path)
|
|
28
|
-
// if (!path)
|
|
29
|
-
// return {
|
|
30
|
-
// ...transformed?.data,
|
|
31
|
-
// pathname: getPathname(transformed),
|
|
32
|
-
// }
|
|
33
|
-
// return result ? result : valuePart
|
|
34
|
-
// } else if (collection) {
|
|
35
|
-
// const response = await getCollection(collection as CollectionKey)
|
|
36
|
-
// if (!response)
|
|
37
|
-
// throw new Error(`Entry not found: ${collection}/${slug}`)
|
|
38
|
-
// const mapped = response?.map(async (entry: any) => {
|
|
39
|
-
// const transformed = await transform(entry?.data)
|
|
40
|
-
// return get(transformed, path)
|
|
41
|
-
// })
|
|
42
|
-
// const result = await all(mapped)
|
|
43
|
-
// return result ? result : valuePart
|
|
44
|
-
// }
|
|
45
|
-
|
|
46
|
-
// return valuePart
|
|
47
|
-
// })
|
|
48
|
-
// )
|
|
49
|
-
// if (mappedParts.length == 1) return mappedParts[0]
|
|
50
|
-
// else return mappedParts.join(' ')
|
|
51
|
-
// })
|
|
52
|
-
// )
|
|
53
|
-
// return unflatten(mappedValues)
|
|
54
|
-
// }
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// import { flatten, unflatten } from 'flat'
|
|
2
|
-
// import { camel, get, isString, mapValues } from 'radash'
|
|
3
|
-
|
|
4
|
-
// export const transformSelfs = (data: any): any => {
|
|
5
|
-
// const flat = flatten(data) as any
|
|
6
|
-
// const mapped = mapValues(flat, (value) => {
|
|
7
|
-
// if (!isString(value)) return value
|
|
8
|
-
// const parts = (value as string).split(' ')
|
|
9
|
-
// const result = parts.map((part) => {
|
|
10
|
-
// if (!part.startsWith('$.')) return part
|
|
11
|
-
// const pathParts = part.replace('$.', '').split('.')
|
|
12
|
-
// const camelCased = pathParts.map((part) => camel(part))
|
|
13
|
-
// const path = 'data.' + camelCased.join('.')
|
|
14
|
-
// const result = get(data, path)
|
|
15
|
-
// return result ? result : part
|
|
16
|
-
// })
|
|
17
|
-
// return result.join(' ')
|
|
18
|
-
// })
|
|
19
|
-
// return unflatten(mapped)
|
|
20
|
-
// }
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// import { flatten, unflatten } from 'flat'
|
|
2
|
-
// import { isString } from 'radash'
|
|
3
|
-
// import { mapKeys } from 'remeda'
|
|
4
|
-
|
|
5
|
-
// export const transformUnderscores = (data: any): any => {
|
|
6
|
-
// const flat: any = flatten(data)
|
|
7
|
-
// const merged = mapKeys(flat, (key) => {
|
|
8
|
-
// if (!isString(key)) return key
|
|
9
|
-
// const parts = key.split('.')
|
|
10
|
-
// const result = parts.map((part) => {
|
|
11
|
-
// return part.replace(/^_+/, '')
|
|
12
|
-
// })
|
|
13
|
-
// const filtered = result.filter(Boolean)
|
|
14
|
-
// const joined = filtered.join('.')
|
|
15
|
-
// return joined
|
|
16
|
-
// })
|
|
17
|
-
// const nested = unflatten(merged)
|
|
18
|
-
// return nested
|
|
19
|
-
// }
|
package/src/utils/formatEntry.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { CollectionEntry, ContentCollectionKey } from 'astro:content'
|
|
2
|
-
|
|
3
|
-
const routes: {
|
|
4
|
-
[key in ContentCollectionKey]: string
|
|
5
|
-
} = {
|
|
6
|
-
categories: 'categorieen',
|
|
7
|
-
docs: 'docs',
|
|
8
|
-
pages: '',
|
|
9
|
-
posts: 'blog',
|
|
10
|
-
products: 'producten',
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const formatEntry = ({
|
|
14
|
-
data,
|
|
15
|
-
slug,
|
|
16
|
-
...rest
|
|
17
|
-
}: CollectionEntry<ContentCollectionKey>) => {
|
|
18
|
-
let href
|
|
19
|
-
if (slug !== 'index') href = `/${routes[rest.collection]}/${slug}/`
|
|
20
|
-
|
|
21
|
-
href?.replace('//', '/')
|
|
22
|
-
|
|
23
|
-
return {
|
|
24
|
-
href,
|
|
25
|
-
slug,
|
|
26
|
-
...rest,
|
|
27
|
-
...data,
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { getCollection, type CollectionEntry } from 'astro:content'
|
|
2
|
-
|
|
3
|
-
// Pages that reference the current page
|
|
4
|
-
export const getDeepReferenceChildren = async (
|
|
5
|
-
slug: CollectionEntry<'pages'>['slug']
|
|
6
|
-
) =>
|
|
7
|
-
(
|
|
8
|
-
await getCollection('pages', (page) =>
|
|
9
|
-
page.data?.categories?.some((p: any) => p.slug.includes(slug))
|
|
10
|
-
)
|
|
11
|
-
)?.map(({ slug, data }) => ({
|
|
12
|
-
...data,
|
|
13
|
-
href: `/${slug}/`,
|
|
14
|
-
}))
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { getCollection, type CollectionEntry } from 'astro:content'
|
|
2
|
-
|
|
3
|
-
// Records that are in a folder with the current page's slug
|
|
4
|
-
export const getFolderChildren = async (
|
|
5
|
-
slug: CollectionEntry<'pages'>['slug']
|
|
6
|
-
) =>
|
|
7
|
-
(
|
|
8
|
-
await getCollection(
|
|
9
|
-
'pages',
|
|
10
|
-
(page) =>
|
|
11
|
-
page.slug.startsWith(slug) &&
|
|
12
|
-
page.slug !== slug &&
|
|
13
|
-
!page.slug.replace(`${slug}/`, '').includes('/')
|
|
14
|
-
)
|
|
15
|
-
)?.map(({ slug, data }) => ({
|
|
16
|
-
...data,
|
|
17
|
-
href: `/${slug}/`,
|
|
18
|
-
}))
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { getCollection, type CollectionEntry } from 'astro:content'
|
|
2
|
-
|
|
3
|
-
// Pages that reference the current page
|
|
4
|
-
export const getReferenceChildren = async (
|
|
5
|
-
slug: CollectionEntry<'pages'>['slug']
|
|
6
|
-
) =>
|
|
7
|
-
(
|
|
8
|
-
await getCollection('pages', (page) =>
|
|
9
|
-
page.data?.categories?.some((p: any) => p.slug === slug)
|
|
10
|
-
)
|
|
11
|
-
)?.map(({ slug, data }) => ({
|
|
12
|
-
...data,
|
|
13
|
-
href: `/${slug}/`,
|
|
14
|
-
}))
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { getCollection, type CollectionEntry } from 'astro:content'
|
|
2
|
-
|
|
3
|
-
// Pages that are in the same folder as the current page
|
|
4
|
-
export const getSiblingPages = async (slug: CollectionEntry<'pages'>['slug']) =>
|
|
5
|
-
(
|
|
6
|
-
await getCollection('pages', (page) => {
|
|
7
|
-
const currentPageFolder = slug.split('/').slice(0, -1).join('/')
|
|
8
|
-
const pageFolder = page.slug.split('/').slice(0, -1).join('/')
|
|
9
|
-
return page.slug !== slug && pageFolder === currentPageFolder
|
|
10
|
-
})
|
|
11
|
-
)?.map(({ slug, data }) => ({
|
|
12
|
-
...data,
|
|
13
|
-
href: `/${slug}/`,
|
|
14
|
-
}))
|
package/src/utils/setTheme.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export default function setTheme(newValue?: string) {
|
|
2
|
-
newValue && localStorage.setItem('theme', newValue)
|
|
3
|
-
const value = localStorage.getItem('theme')
|
|
4
|
-
|
|
5
|
-
const isDark =
|
|
6
|
-
value === 'dark' ||
|
|
7
|
-
(value === 'system' &&
|
|
8
|
-
window.matchMedia('(prefers-color-scheme: dark)').matches)
|
|
9
|
-
|
|
10
|
-
document.documentElement.classList.toggle('dark', isDark)
|
|
11
|
-
|
|
12
|
-
document.querySelectorAll('.themer').forEach((themer) => {
|
|
13
|
-
themer.classList.toggle('dark', isDark)
|
|
14
|
-
themer?.querySelectorAll('option').forEach((option) => {
|
|
15
|
-
option.selected = option.value === value
|
|
16
|
-
})
|
|
17
|
-
})
|
|
18
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|