diff --git a/apps/www/public/r/styles/default/heading-element.json b/apps/www/public/r/styles/default/heading-element.json index d303d0196e..8af1132a16 100644 --- a/apps/www/public/r/styles/default/heading-element.json +++ b/apps/www/public/r/styles/default/heading-element.json @@ -4,7 +4,7 @@ ], "files": [ { - "content": "import React from 'react';\n\nimport { withRef, withVariants } from '@udecode/cn';\nimport { PlateElement } from '@udecode/plate-common/react';\nimport { cva } from 'class-variance-authority';\n\nconst headingVariants = cva('', {\n variants: {\n isFirstBlock: {\n false: '',\n true: 'mt-0',\n },\n variant: {\n h1: 'mb-1 mt-[2em] font-heading text-4xl font-bold',\n h2: 'mb-px mt-[1.4em] font-heading text-2xl font-semibold tracking-tight',\n h3: 'mb-px mt-[1em] font-heading text-xl font-semibold tracking-tight',\n h4: 'mt-[0.75em] font-heading text-lg font-semibold tracking-tight',\n h5: 'mt-[0.75em] text-lg font-semibold tracking-tight',\n h6: 'mt-[0.75em] text-base font-semibold tracking-tight',\n },\n },\n});\n\nconst HeadingElementVariants = withVariants(PlateElement, headingVariants, [\n 'isFirstBlock',\n 'variant',\n]);\n\nexport const HeadingElement = withRef(\n ({ children, isFirstBlock, variant = 'h1', ...props }, ref) => {\n const { editor, element } = props;\n\n const Element = variant!;\n\n return (\n \n {children}\n \n );\n }\n);\n", + "content": "import React from 'react';\n\nimport { withRef, withVariants } from '@udecode/cn';\nimport { PlateElement } from '@udecode/plate-common/react';\nimport { cva } from 'class-variance-authority';\n\nconst headingVariants = cva('relative mb-1', {\n variants: {\n variant: {\n h1: 'mt-[1.6em] pb-1 font-heading text-4xl font-bold',\n h2: 'mt-[1.4em] pb-px font-heading text-2xl font-semibold tracking-tight',\n h3: 'mt-[1em] pb-px font-heading text-xl font-semibold tracking-tight',\n h4: 'mt-[0.75em] font-heading text-lg font-semibold tracking-tight',\n h5: 'mt-[0.75em] text-lg font-semibold tracking-tight',\n h6: 'mt-[0.75em] text-base font-semibold tracking-tight',\n },\n },\n});\n\nconst blockVariants = cva('', {\n variants: {\n isFirstBlock: {\n false: '',\n true: 'mt-0',\n },\n },\n});\n\nconst HeadingElementVariants = withVariants(\n withVariants(PlateElement, headingVariants, ['variant']),\n blockVariants,\n ['isFirstBlock']\n);\n\nexport const HeadingElement = withRef(\n ({ children, isFirstBlock, variant = 'h1', ...props }, ref) => {\n const { editor, element } = props;\n\n const Element = variant!;\n\n return (\n \n {children}\n \n );\n }\n);\n", "path": "plate-ui/heading-element.tsx", "target": "", "type": "registry:ui" diff --git a/yarn.lock b/yarn.lock index e1e47a8326..931eeeb610 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5904,14 +5904,14 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-basic-elements@npm:38.0.1, @udecode/plate-basic-elements@workspace:^, @udecode/plate-basic-elements@workspace:packages/basic-elements": +"@udecode/plate-basic-elements@npm:38.0.12, @udecode/plate-basic-elements@workspace:^, @udecode/plate-basic-elements@workspace:packages/basic-elements": version: 0.0.0-use.local resolution: "@udecode/plate-basic-elements@workspace:packages/basic-elements" dependencies: "@udecode/plate-block-quote": "npm:38.0.1" "@udecode/plate-code-block": "npm:38.0.1" "@udecode/plate-common": "workspace:^" - "@udecode/plate-heading": "npm:38.0.1" + "@udecode/plate-heading": "npm:38.0.12" peerDependencies: "@udecode/plate-common": ">=38.0.6" react: ">=16.8.0" @@ -6215,12 +6215,12 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-docx@npm:38.0.10, @udecode/plate-docx@workspace:^, @udecode/plate-docx@workspace:packages/docx": +"@udecode/plate-docx@npm:38.0.12, @udecode/plate-docx@workspace:^, @udecode/plate-docx@workspace:packages/docx": version: 0.0.0-use.local resolution: "@udecode/plate-docx@workspace:packages/docx" dependencies: "@udecode/plate-common": "workspace:^" - "@udecode/plate-heading": "npm:38.0.1" + "@udecode/plate-heading": "npm:38.0.12" "@udecode/plate-indent": "npm:38.0.1" "@udecode/plate-indent-list": "npm:38.0.10" "@udecode/plate-media": "npm:38.0.6" @@ -6323,7 +6323,7 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-heading@npm:38.0.1, @udecode/plate-heading@workspace:^, @udecode/plate-heading@workspace:packages/heading": +"@udecode/plate-heading@npm:38.0.12, @udecode/plate-heading@workspace:^, @udecode/plate-heading@workspace:packages/heading": version: 0.0.0-use.local resolution: "@udecode/plate-heading@workspace:packages/heading" dependencies: @@ -6903,7 +6903,7 @@ __metadata: dependencies: "@udecode/plate-alignment": "npm:38.0.1" "@udecode/plate-autoformat": "npm:38.0.1" - "@udecode/plate-basic-elements": "npm:38.0.1" + "@udecode/plate-basic-elements": "npm:38.0.12" "@udecode/plate-basic-marks": "npm:38.0.1" "@udecode/plate-block-quote": "npm:38.0.1" "@udecode/plate-break": "npm:38.0.1" @@ -6913,11 +6913,11 @@ __metadata: "@udecode/plate-common": "npm:38.0.6" "@udecode/plate-csv": "npm:38.0.8" "@udecode/plate-diff": "npm:38.0.0" - "@udecode/plate-docx": "npm:38.0.10" + "@udecode/plate-docx": "npm:38.0.12" "@udecode/plate-find-replace": "npm:38.0.0" "@udecode/plate-floating": "npm:38.0.1" "@udecode/plate-font": "npm:38.0.1" - "@udecode/plate-heading": "npm:38.0.1" + "@udecode/plate-heading": "npm:38.0.12" "@udecode/plate-highlight": "npm:38.0.1" "@udecode/plate-horizontal-rule": "npm:38.0.1" "@udecode/plate-html": "npm:38.0.1"