From 15c233f5baa3909041a2d3291046a8e78f91ff25 Mon Sep 17 00:00:00 2001 From: maksim hodasevich <47758224+dogfrogfog@users.noreply.github.com> Date: Thu, 7 Nov 2024 14:04:24 +0100 Subject: [PATCH] feature/remove unnestext fields (#50) * remove text from carousel * simplify carousel component * add new sections to rich text * add cookie banner * update presets * update stories and cli command to pull it * add missing types * rename type generation scripts * stage documentation * change repo name, add docs, update stories, create landing --- README.md | 246 +- apps/sanity/.env | 2 +- apps/sanity/.env.initial | 2 +- apps/sanity/.env.local.example | 2 +- apps/sanity/package.json | 2 +- .../components/Footer/templates/footer.json | 14 +- .../src/contentSections/Carousel/index.tsx | 19 +- .../src/contentSections/Carousel/schema.ts | 30 +- .../src/generated/extracted-schema.json | 36 +- apps/sanity/src/generated/extracted-types.ts | 20 +- apps/sanity/src/lib/renderRichText.tsx | 10 + apps/storyblok/.env | 2 +- apps/storyblok/.env.local.example | 2 +- apps/storyblok/CLI/services/storyblok.mjs | 2 +- apps/storyblok/package.json | 3 +- apps/storyblok/src/app/layout.tsx | 7 +- .../src/contentSections/Carousel/index.tsx | 13 +- .../generated/backup/stories/513794103.json | 1512 ---- .../generated/backup/stories/522530935.json | 303 - .../src/generated/components.production.json | 236 +- .../{ => dump}/backup/stories/560303235.json | 1 + .../{ => dump}/backup/stories/560303238.json | 4 +- .../{ => dump}/backup/stories/560303250.json | 2 + .../{ => dump}/backup/stories/560836300.json | 1 + .../{ => dump}/backup/stories/560836303.json | 2 + .../{ => dump}/backup/stories/560838689.json | 2 + .../backup/stories/571196664.json} | 2008 ++++- .../dump/backup/stories/575494741.json | 2184 +++++ .../src/generated/extracted-types.ts | 17 +- .../src/generated/presets.production.json | 7355 +++++++++++------ apps/storyblok/src/lib/renderRichText.tsx | 16 + package.json | 2 +- .../ui/components/sections/carousel/index.tsx | 4 +- .../sections/cookieBanner/index.tsx | 30 +- .../sections/pricingTable/index.tsx | 6 +- .../components/sections/stepGuide/index.tsx | 2 +- .../components/ui/GenericCarousel/index.tsx | 10 +- packages/ui/components/ui/link/index.tsx | 2 +- 38 files changed, 8976 insertions(+), 5135 deletions(-) delete mode 100644 apps/storyblok/src/generated/backup/stories/513794103.json delete mode 100644 apps/storyblok/src/generated/backup/stories/522530935.json rename apps/storyblok/src/generated/{ => dump}/backup/stories/560303235.json (97%) rename apps/storyblok/src/generated/{ => dump}/backup/stories/560303238.json (98%) rename apps/storyblok/src/generated/{ => dump}/backup/stories/560303250.json (98%) rename apps/storyblok/src/generated/{ => dump}/backup/stories/560836300.json (97%) rename apps/storyblok/src/generated/{ => dump}/backup/stories/560836303.json (99%) rename apps/storyblok/src/generated/{ => dump}/backup/stories/560838689.json (98%) rename apps/storyblok/src/generated/{backup/stories/552320906.json => dump/backup/stories/571196664.json} (76%) create mode 100644 apps/storyblok/src/generated/dump/backup/stories/575494741.json diff --git a/README.md b/README.md index 0152d18..cb4278c 100644 --- a/README.md +++ b/README.md @@ -1,126 +1,222 @@ -# CMS-Kit +# CMS-Kit πŸ”§ An endeavor accumulating the experience and best practices collected at [Focus Reactive](https://focusreactive.com/). The project serves the idea of making Headless CMS-based development accessible, comfortable, and fast. -## Quick start - Storyblok +## Quick start + +### What you get + +1. New Storyblok space, set up with vercel deployments +2. 10+ ready to use components with different presets(styles) +3. New Vercel project, deployed and configured with your new Storyblok space +4. Multiple ready pages in different styles + +### Storyblok + +1. Create a new repository using this template by clicking the "Use this template" button at the top of the repository page. + ![Screenshot 2024-11-07 at 13 38 48](https://github.com/user-attachments/assets/9a159ebd-d810-4b6d-ab79-ab453da6ab9c) + +2. Clone your new repository: + + ```bash + git clone + ``` + +3. Navigate to the project directory: + + ```bash + cd + ``` + +4. Install dependencies using pnpm: -1. Create a new repo based on [cms-kit template](https://github.com/focusreactive/turbo-cms-kit) -![Screenshot 2024-10-24 at 17 52 54](https://github.com/user-attachments/assets/b4773c54-bf7f-4697-ae7e-ada6e5163bf0) -2. Pull repo locally -3. Install packages ```bash pnpm install ``` -4. Go to CLI folder + +5. Navigate to the Storyblok CLI directory: + ```bash - cd apps/storyblok/cli + cd apps/storyblok/CLI ``` -5. Execute command + +6. Run the setup script: + ```bash node sb.mjs ``` -7. Follow steps -### Showcase +7. Follow the interactive prompts in the CLI tool to: + - Enter your Storyblok Personal Access Token + - Enter your Vercel Personal Auth Token + - Select your Vercel team + - Choose a project name + - Complete the space creation and configuration process + +### [TODO]: add video example -## Demo πŸ‘€ ### Sanity -- [Demo Landing](https://turbo-cms-kit-sanity.vercel.app/) -- [CMS](https://turbo-cms-kit-sanity.vercel.app/studio) -### Storyblok -- [Demo Landing](https://turbo-cms-kit-storyblok.vercel.app/) -- [CMS](https://app.storyblok.com/#/me/spaces/293915/) +soon -## Features 🌟 +## Demo πŸ‘€ -- πŸš€ Monorepo using **Turborepo** -- πŸ“ New `/app` dir -- πŸ—‚οΈ Routing, Layouts, Nested Layouts and Layout Groups -- 🌎 Data Fetching, Caching and Mutation -- πŸ› οΈ Server and Client Components -- 🧩 UI Components built using **Radix UI** -- 🎨 Styled using **Tailwind CSS** -- πŸ‘·πŸΌβ€β™‚οΈ Written in **TypeScript** +- [Sanity landing](https://cms-kit-sanity.vercel.app/) +- [Storyblok Landing](https://cms-kit-storyblok.vercel.app/) -## What's inside? +## Core Features -This turborepo uses [pnpm](https://pnpm.io) as a package manager. It includes the following packages/apps: +- Monorepo using **Turborepo** +- **Multiple CMS** support +- New `/app` dir +- Routing, layouts, nested layouts +- Data fetching, **caching** and **revalidation** +- Server and client components +- Reusable UI components built using **Radix UI** +- Styled using **tailwind CSS** +- Written in **TypeScript** +- Types and components **generation** +- **CLI** to create new set up project +- **Themes** using CSS variables +- **Predefined** structure -### Apps and Packages +## Repo structure -- `storyblok`: CMS app -- `sanity`: CMS app -- `ui`: a stub React component library shared by both `web` and `docs` applications -- `eslint-config`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`) -- `ts-config`: `tsconfig.json`s used throughout the monorepo -- `tailwind-config`: `tsconfig.json`s used throughout the monorepo +- `apps/storyblok`: CMS app +- `apps/sanity`: CMS app +- `packages/ui`: UI components library, shared between both CMS apps +- `packages/eslint-config`: shared `eslint` configurations +- `packages/ts-config`: shared `ts-config` configuration +- `packages/tailwind-config`: shared `tailwind` configuration -Each package/app is 100% [TypeScript](https://www.typescriptlang.org/). +### Types of components -### Utilities +- **UI component** - universal and sharable component between multiple CMSs +- **Controller component** - takes data from CMS, convert it to UI component format, and use UI component with converted props. Each CMS has it's own controller component for each UI component. +- All **controller components** have common propertiers to change style, such as margin, background, alignment etc. -This turborepo has some additional tools already setup: +### Components composition and hierarchy -- [TypeScript](https://www.typescriptlang.org/) for static type checking -- [ESLint](https://eslint.org/) for code linting -- [Prettier](https://prettier.io) for code formatting +The website structure follows a clear hierarchical composition: -### Build +1. Pages -To build all apps and packages, run the following command: + - Top-level components that represent entire web pages + - Each page contains multiple sections, SEO properties and theme -``` -pnpm run build -``` +2. Sections -### Develop + - Container components that organize content into distinct areas + - Can be configured with settings like margin, background, width, alignment etc. + - Hold and arrange other components -Setup environment variables: -Link Vercel projects: -``` -vercel login -vercel link --repo -``` +3. Base Components -Pull environment variables from Vercel: -``` -vercel env --cwd apps/sanity --environment development pull -vercel env --cwd apps/storyblok --environment development pull + - Components like **link**, **image**, and **rich text** + - Combination of multiple functional components like **card** + - Can be combined and reused across different sections + +**RichText** component has additional functionality. It allows to add sections inside, which gives ability to combine sections with text. + +### New component + +1. Create new component using generators + +```bash +pnpm gen ``` -To develop all apps and packages, run the following command: +2. Select type of component to create +```bash +- UI: Create a new UI component +- Storyblok: Create a new content section +- Sanity: Create a new content section ``` -pnpm run dev + +3. Enter name of the component +4. Update properties and design +5. Generate types for new properties + +```bash +pnpm gen:types ``` -### Remote Caching +## Start project in dev mode + +### Instalation + +1. Clone repository + ```bash + git clone https://github.com/focusreactive/cms-kit + ``` +2. Go to project directory + ```bash + cd cms-kit + ``` +3. Install dependencies + ```bash + pnpm install + ``` + +### Environment variables -Turborepo can use a technique known as [Remote Caching](https://turborepo.org/docs/core-concepts/remote-caching) to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines. +#### Storyblok project -By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can [create one](https://vercel.com/signup), then enter the following commands: +Create `.env` and `.env.local` files in the root of your project and add the following variables: +.env + +```bash +REPO_PROD_BRANCH="main" +REPO_TYPE="github" +REPO_ID="[repo id]" +REPO_NAME="[nickname]/[repo name]" ``` -pnpm dlx turbo login + +.env.local + +```bash +# Created by Vercel CLI +NEXT_PUBLIC_API_GATE="https://api.storyblok.com/v2/cdn" +NEXT_PUBLIC_DOMAIN="https://localhost:4050" +NEXT_PUBLIC_IS_PREVIEW="true" +NEXT_PUBLIC_SB_REGION="EU" +NEXT_PUBLIC_URL="https://localhost:4050" +SB_PREVIEW_TOKEN="[storyblok space preview token]" +SB_WEBHOOK_REVALIDATE_SECRET="[storyblok webhook revalidate key]" ``` -This will authenticate the Turborepo CLI with your [Vercel account](https://vercel.com/docs/concepts/personal-accounts/overview). +#### Sanity -Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your turborepo: +.env -``` -pnpm dlx turbo link +```bash +REPO_PROD_BRANCH="main" +REPO_TYPE="github" +REPO_ID="[repo id]" +REPO_NAME="[nickname]/[repo name]" ``` -## Useful Links +.env.local +**tbd** -Learn more about the power of Turborepo: +4. Create a new repo based on [cms-kit template](https://github.com/focusreactive/cms-kit) + ![Screenshot 2024-10-24 at 17 52 54](https://github.com/user-attachments/assets/b4773c54-bf7f-4697-ae7e-ada6e5163bf0) +5. Pull repo locally +6. Install packages + ```bash + pnpm install + ``` +7. Go to CLI folder + ```bash + cd apps/storyblok/cli + ``` +8. Execute command + ```bash + node sb.mjs + ``` +9. Follow steps -- [Pipelines](https://turborepo.org/docs/core-concepts/pipelines) -- [Caching](https://turborepo.org/docs/core-concepts/caching) -- [Remote Caching](https://turborepo.org/docs/core-concepts/remote-caching) -- [Scoped Tasks](https://turborepo.org/docs/core-concepts/scopes) -- [Configuration Options](https://turborepo.org/docs/reference/configuration) -- [CLI Usage](https://turborepo.org/docs/reference/command-line-reference) +Happy hacking πŸ‘Ύ diff --git a/apps/sanity/.env b/apps/sanity/.env index ff3ab17..c3dda6e 100644 --- a/apps/sanity/.env +++ b/apps/sanity/.env @@ -1,4 +1,4 @@ REPO_PROD_BRANCH="main" REPO_TYPE="github" REPO_ID="826312493" -REPO_NAME="focusreactive/turbo-cms-kit" +REPO_NAME="focusreactive/cms-kit" diff --git a/apps/sanity/.env.initial b/apps/sanity/.env.initial index 7265aac..b1ef89c 100644 --- a/apps/sanity/.env.initial +++ b/apps/sanity/.env.initial @@ -8,7 +8,7 @@ SANITY_API_WRITE_TOKEN= NEXT_PUBLIC_SANITY_PROJECT_TITLE="Next.js Personal Website with Sanity.io" # Initial env REPO_ID=826312493 -REPO_NAME=focusreactive/turbo-cms-kit +REPO_NAME=focusreactive/cms-kit MAX_NUMBER_OF_PROJECTS=5 REPO_PROD_BRANCH=main # Local env diff --git a/apps/sanity/.env.local.example b/apps/sanity/.env.local.example index 6388620..6f621ec 100644 --- a/apps/sanity/.env.local.example +++ b/apps/sanity/.env.local.example @@ -13,7 +13,7 @@ SANITY_API_READ_TOKEN= NEXT_PUBLIC_SANITY_PROJECT_TITLE="Next.js Personal Website with Sanity.io" # Initial env REPO_ID=826312493 -REPO_NAME=focusreactive/turbo-cms-kit +REPO_NAME=focusreactive/cms-kit MAX_NUMBER_OF_PROJECTS=5 REPO_PROD_BRANCH=main # Local env diff --git a/apps/sanity/package.json b/apps/sanity/package.json index 0fd9f93..04b96d6 100644 --- a/apps/sanity/package.json +++ b/apps/sanity/package.json @@ -9,7 +9,7 @@ "start": "next start", "rollout": "./src/lib/rollout-tools/local/cli.mjs", "extract-schema": "pnpm sanity schema extract --path src/generated/extracted-schema.json --enforce-required-fields", - "generate-types": "pnpm extract-schema && pnpm sanity typegen generate" + "gen:types": "pnpm extract-schema && pnpm sanity typegen generate" }, "dependencies": { "@portabletext/react": "^3.1.0", diff --git a/apps/sanity/src/components/Footer/templates/footer.json b/apps/sanity/src/components/Footer/templates/footer.json index 8b58efd..07ae6eb 100644 --- a/apps/sanity/src/components/Footer/templates/footer.json +++ b/apps/sanity/src/components/Footer/templates/footer.json @@ -3,49 +3,49 @@ "copywriteText": "Flowbiteβ„’. All Rights Reserved.", "links": [ { - "href": "https://github.com/focusreactive/turbo-cms-kit", + "href": "https://github.com/focusreactive/cms-kit", "target": "_self", "text": "About", "type": "url", "variant": "footerNav" }, { - "href": "https://github.com/focusreactive/turbo-cms-kit", + "href": "https://github.com/focusreactive/cms-kit", "target": "_self", "text": "Premium", "type": "url", "variant": "footerNav" }, { - "href": "https://github.com/focusreactive/turbo-cms-kit", + "href": "https://github.com/focusreactive/cms-kit", "target": "_self", "text": "Campaigns", "type": "url", "variant": "footerNav" }, { - "href": "https://github.com/focusreactive/turbo-cms-kit", + "href": "https://github.com/focusreactive/cms-kit", "target": "_self", "text": "Blog", "type": "url", "variant": "footerNav" }, { - "href": "https://github.com/focusreactive/turbo-cms-kit", + "href": "https://github.com/focusreactive/cms-kit", "target": "_self", "text": "Affiliate Program", "type": "url", "variant": "footerNav" }, { - "href": "https://github.com/focusreactive/turbo-cms-kit", + "href": "https://github.com/focusreactive/cms-kit", "target": "_self", "text": "FAQs", "type": "url", "variant": "footerNav" }, { - "href": "https://github.com/focusreactive/turbo-cms-kit", + "href": "https://github.com/focusreactive/cms-kit", "target": "_self", "text": "Contact", "type": "url", diff --git a/apps/sanity/src/contentSections/Carousel/index.tsx b/apps/sanity/src/contentSections/Carousel/index.tsx index 15fb0d9..ef1684d 100644 --- a/apps/sanity/src/contentSections/Carousel/index.tsx +++ b/apps/sanity/src/contentSections/Carousel/index.tsx @@ -12,12 +12,10 @@ import type { ICarouselProps } from "./types"; export default function Carousel({ data }: ICarouselProps) { if (!data) return null; - const { text, slides, params } = data; + const { slides, loop, slidesPerView } = data; const effect = stegaClean(data.effect); - const { loop, slidesPerView, spaceBetween } = params || {}; - if (!slides || slides.length === 0) - return ; + if (!slides || slides.length === 0) return ; const carouselSlides = slides.map((slide) => ({ image: prepareImageProps(slide.image), @@ -25,6 +23,12 @@ export default function Carousel({ data }: ICarouselProps) { effect, })); + const carouselParams = { + loop, + slidesPerView, + spaceBetween: 20, + }; + return ( ); diff --git a/apps/sanity/src/contentSections/Carousel/schema.ts b/apps/sanity/src/contentSections/Carousel/schema.ts index ac32b24..a5231ef 100644 --- a/apps/sanity/src/contentSections/Carousel/schema.ts +++ b/apps/sanity/src/contentSections/Carousel/schema.ts @@ -45,9 +45,11 @@ export default { groups: commonGroups, fields: [ defineField({ + name: "slidesPerView", + type: "number", group: CommonGroup.Content, - name: "text", - type: "customRichText", + initialValue: 3, + validation: (Rule) => Rule.required(), }), defineField({ group: CommonGroup.Content, @@ -59,7 +61,7 @@ export default { defineField({ name: "effect", type: "string", - group: CommonGroup.Style, + group: CommonGroup.Content, options: { list: [ { title: "Slide", value: "slide" }, @@ -72,25 +74,13 @@ export default { layout: "radio", }, initialValue: "slide", + validation: (Rule) => Rule.required(), }), defineField({ - name: "params", - type: "object", - group: CommonGroup.Style, - fields: [ - defineField({ - name: "loop", - type: "boolean", - }), - defineField({ - name: "slidesPerView", - type: "number", - }), - defineField({ - name: "spaceBetween", - type: "number", - }), - ], + name: "loop", + type: "boolean", + group: CommonGroup.Content, + initialValue: false, }), ...sectionCommonFields, ], diff --git a/apps/sanity/src/generated/extracted-schema.json b/apps/sanity/src/generated/extracted-schema.json index 0daac95..f3b1481 100644 --- a/apps/sanity/src/generated/extracted-schema.json +++ b/apps/sanity/src/generated/extracted-schema.json @@ -1173,13 +1173,12 @@ "value": "section.carousel" } }, - "text": { + "slidesPerView": { "type": "objectAttribute", "value": { - "type": "inline", - "name": "customRichText" + "type": "number" }, - "optional": true + "optional": false }, "slides": { "type": "objectAttribute", @@ -1234,35 +1233,12 @@ } ] }, - "optional": true + "optional": false }, - "params": { + "loop": { "type": "objectAttribute", "value": { - "type": "object", - "attributes": { - "loop": { - "type": "objectAttribute", - "value": { - "type": "boolean" - }, - "optional": true - }, - "slidesPerView": { - "type": "objectAttribute", - "value": { - "type": "number" - }, - "optional": true - }, - "spaceBetween": { - "type": "objectAttribute", - "value": { - "type": "number" - }, - "optional": true - } - } + "type": "boolean" }, "optional": true }, diff --git a/apps/sanity/src/generated/extracted-types.ts b/apps/sanity/src/generated/extracted-types.ts index 5b73e66..4c0b089 100644 --- a/apps/sanity/src/generated/extracted-types.ts +++ b/apps/sanity/src/generated/extracted-types.ts @@ -172,18 +172,14 @@ export type SectionHero = { export type SectionCarousel = { _type: "section.carousel"; - text?: CustomRichText; + slidesPerView: number; slides: Array< { _key: string; } & CarouselCard >; - effect?: "slide" | "coverflow" | "cube" | "fade" | "flip" | "cards"; - params?: { - loop?: boolean; - slidesPerView?: number; - spaceBetween?: number; - }; + effect: "slide" | "coverflow" | "cube" | "fade" | "flip" | "cards"; + loop?: boolean; marginTop: "none" | "base" | "lg"; marginBottom: "none" | "base" | "lg"; maxWidth: "none" | "base" | "small"; @@ -898,18 +894,14 @@ export type PAGE_BY_SLUG_QUERYResult = { | { _key: string; _type: "section.carousel"; - text?: CustomRichText; + slidesPerView: number; slides: Array< { _key: string; } & CarouselCard >; - effect?: "cards" | "coverflow" | "cube" | "fade" | "flip" | "slide"; - params?: { - loop?: boolean; - slidesPerView?: number; - spaceBetween?: number; - }; + effect: "cards" | "coverflow" | "cube" | "fade" | "flip" | "slide"; + loop?: boolean; marginTop: "base" | "lg" | "none"; marginBottom: "base" | "lg" | "none"; maxWidth: "base" | "none" | "small"; diff --git a/apps/sanity/src/lib/renderRichText.tsx b/apps/sanity/src/lib/renderRichText.tsx index 4bb277c..7a7b1ef 100644 --- a/apps/sanity/src/lib/renderRichText.tsx +++ b/apps/sanity/src/lib/renderRichText.tsx @@ -1,6 +1,8 @@ import CardsGrid from "@/contentSections/CardsGrid"; +import Carousel from "@/contentSections/Carousel"; import LinksList from "@/contentSections/LinksList"; import Logos from "@/contentSections/Logos"; +import PricingTable from "@/contentSections/PricingTable"; import StepGuide from "@/contentSections/StepGuide"; import ThreeDElement from "@/contentSections/ThreeDElement"; import type { CustomImage } from "@/generated/extracted-types"; @@ -59,6 +61,14 @@ const COMPONENTS = { "section.threeDElement": ({ value }: { value: any }) => { return ; }, + + "section.pricingTable": ({ value }: { value: any }) => { + return ; + }, + + "section.carousel": ({ value }: { value: any }) => { + return ; + }, }, marks: { diff --git a/apps/storyblok/.env b/apps/storyblok/.env index ff3ab17..c3dda6e 100644 --- a/apps/storyblok/.env +++ b/apps/storyblok/.env @@ -1,4 +1,4 @@ REPO_PROD_BRANCH="main" REPO_TYPE="github" REPO_ID="826312493" -REPO_NAME="focusreactive/turbo-cms-kit" +REPO_NAME="focusreactive/cms-kit" diff --git a/apps/storyblok/.env.local.example b/apps/storyblok/.env.local.example index 27c59b4..bba818e 100644 --- a/apps/storyblok/.env.local.example +++ b/apps/storyblok/.env.local.example @@ -1,6 +1,6 @@ # Created by Vercel CLI NEXT_PUBLIC_API_GATE="https://api.storyblok.com/v2/cdn" -NEXT_PUBLIC_DOMAIN="https://turbo-cms-kit-storyblok.vercel.app" +NEXT_PUBLIC_DOMAIN="https://cms-kit-storyblok.vercel.app" NEXT_PUBLIC_IS_PREVIEW="true" NEXT_PUBLIC_SB_REGION="EU" NEXT_PUBLIC_URL="http://localhost:4040" diff --git a/apps/storyblok/CLI/services/storyblok.mjs b/apps/storyblok/CLI/services/storyblok.mjs index ea7cf20..eac619d 100644 --- a/apps/storyblok/CLI/services/storyblok.mjs +++ b/apps/storyblok/CLI/services/storyblok.mjs @@ -221,7 +221,7 @@ export async function uploadBackupStories(spaceId) { // Get directory path relative to current file const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); - const backupDir = join(__dirname, "../../src/generated/backup/stories"); + const backupDir = join(__dirname, "../../src/generated/dump/backup/stories"); // Read all story files from backup directory const storyFiles = await readdir(backupDir); diff --git a/apps/storyblok/package.json b/apps/storyblok/package.json index abd523c..ac6e911 100644 --- a/apps/storyblok/package.json +++ b/apps/storyblok/package.json @@ -9,8 +9,9 @@ "lint": "next lint", "sb-login": "pnpm storyblok login", "pull-schemas": "pnpm storyblok pull-components --space 293915 --file-name production --path src/generated/", + "pull-stories": "pnpm storyblok-backup --token 7jqEMtHw7bhVlA9AgyrqXQtt-178697-Dxizdg-gJ66mEWQMH299 --space 293915 --types stories --with-asset-files --output-dir ./src/generated/dump --force --verbose", "push-schemas": "pnpm storyblok push-components src/generated/components.production.json --presets-source src/generated/presets.production.json --space", - "generate-types": "pnpm pull-schemas && storyblok generate-typescript-typedefs --sourceFilePaths ./src/generated/components.production.json --destinationFilePath src/generated/extracted-types.ts" + "gen:types": "pnpm pull-schemas && storyblok generate-typescript-typedefs --sourceFilePaths ./src/generated/components.production.json --destinationFilePath src/generated/extracted-types.ts" }, "dependencies": { "@shared/ui": "workspace:*", diff --git a/apps/storyblok/src/app/layout.tsx b/apps/storyblok/src/app/layout.tsx index ddb239e..5ba5d09 100644 --- a/apps/storyblok/src/app/layout.tsx +++ b/apps/storyblok/src/app/layout.tsx @@ -4,8 +4,6 @@ import { apiPlugin, storyblokInit } from "@storyblok/react/rsc"; import "./globals.css"; import "@shared/ui/styles/global.css"; -import { CookieBanner } from "@shared/ui"; - storyblokInit({ accessToken: process.env.storyblokApiToken, use: [apiPlugin], @@ -26,10 +24,7 @@ export default function RootLayout({ }) { return ( - - {children} - - + {children} ); } diff --git a/apps/storyblok/src/contentSections/Carousel/index.tsx b/apps/storyblok/src/contentSections/Carousel/index.tsx index 23296ba..32f627f 100644 --- a/apps/storyblok/src/contentSections/Carousel/index.tsx +++ b/apps/storyblok/src/contentSections/Carousel/index.tsx @@ -9,8 +9,7 @@ import SectionContainer from "@/components/SectionContainer"; import type { ICarouselProps } from "./types"; export default function Carousel({ blok }: ICarouselProps) { - const { text, slides, effect, fullWidth, params } = blok; - const { loop, slidesPerView, spaceBetween } = params?.[0] || {}; + const { slides, effect, fullWidth, loop, slidesPerView } = blok; if (!slides || slides.length === 0) return ; @@ -20,14 +19,11 @@ export default function Carousel({ blok }: ICarouselProps) { text: prepareRichTextProps(slide.text?.[0]), effect, })); + const carouselParams = { loop, - slidesPerView: slidesPerView - ? parseInt(slidesPerView) - : effect === "cards" - ? 1 - : 3, - spaceBetween: spaceBetween ? parseInt(spaceBetween) : 20, + slidesPerView: parseInt(slidesPerView), + spaceBetween: 20, }; return ( @@ -39,7 +35,6 @@ export default function Carousel({ blok }: ICarouselProps) { }} > ); }, + + pricingTable: (props) => { + return ( + + ); + }, + + carousel: (props) => { + return ( + + ); + }, }, }); } diff --git a/package.json b/package.json index f477e0e..0774c48 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "turbo-cms-kit", + "name": "cms-kit", "version": "0.0.0", "private": true, "workspaces": [ diff --git a/packages/ui/components/sections/carousel/index.tsx b/packages/ui/components/sections/carousel/index.tsx index 0851cc2..9acacc5 100644 --- a/packages/ui/components/sections/carousel/index.tsx +++ b/packages/ui/components/sections/carousel/index.tsx @@ -67,7 +67,6 @@ const ArrowButton = React.forwardRef( ); export function Carousel({ - text, slides, customModules, customModulesParams, @@ -94,7 +93,7 @@ export function Carousel({ }, [prevButtonRef, nextButtonRef]); return ( -
+
({ children: (({ isNext, diff --git a/packages/ui/components/sections/cookieBanner/index.tsx b/packages/ui/components/sections/cookieBanner/index.tsx index 32df541..57685a7 100644 --- a/packages/ui/components/sections/cookieBanner/index.tsx +++ b/packages/ui/components/sections/cookieBanner/index.tsx @@ -2,6 +2,9 @@ import { useEffect, useState } from "react"; +import { LinkVariantsClassNames } from "../../ui/link"; +import { LinkVariant } from "../../ui/link/types"; + export function CookieBanner() { const [isVisible, setIsVisible] = useState(false); @@ -20,17 +23,20 @@ export function CookieBanner() { if (!isVisible) return null; return ( -
-

- We use cookies to improve your experience. By using our site, you agree - to our use of cookies. -

- -
+ <> +
+

+ We use cookies to improve your experience. By using our site, you + agree to our use of cookies. +

+ +
+