Skip to content

Commit

Permalink
Merge pull request #3588 from udecode/registry
Browse files Browse the repository at this point in the history
Update Registry
  • Loading branch information
felixfeng33 authored Sep 29, 2024
2 parents d736eba + 3b113c3 commit 898c967
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion apps/www/public/r/styles/default/heading-element.json
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof HeadingElementVariants>(\n ({ children, isFirstBlock, variant = 'h1', ...props }, ref) => {\n const { editor, element } = props;\n\n const Element = variant!;\n\n return (\n <HeadingElementVariants\n ref={ref}\n asChild\n variant={variant}\n isFirstBlock={element === editor.children[0]}\n {...props}\n >\n <Element>{children}</Element>\n </HeadingElementVariants>\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<typeof HeadingElementVariants>(\n ({ children, isFirstBlock, variant = 'h1', ...props }, ref) => {\n const { editor, element } = props;\n\n const Element = variant!;\n\n return (\n <HeadingElementVariants\n ref={ref}\n asChild\n variant={variant}\n isFirstBlock={element === editor.children[0]}\n {...props}\n >\n <Element>{children}</Element>\n </HeadingElementVariants>\n );\n }\n);\n",
"path": "plate-ui/heading-element.tsx",
"target": "",
"type": "registry:ui"
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down

0 comments on commit 898c967

Please sign in to comment.