diff --git a/.eslintrc.cjs b/.eslintrc.cjs index f364cb7ea3..93b2410194 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -34,7 +34,7 @@ module.exports = { '.out', '**/*.mdx', '**/__registry__', - '**/scripts/build-registry.mts', + '**/scripts/*.mts', ], overrides: [ { diff --git a/apps/www/content/docs/components/cloud.mdx b/apps/www/content/docs/components/cloud.mdx deleted file mode 100644 index 13e822cad7..0000000000 --- a/apps/www/content/docs/components/cloud.mdx +++ /dev/null @@ -1,108 +0,0 @@ ---- -title: Cloud -description: Integrate cloud functionality to enable seamless access to cloud-based resources. -component: true -docs: - - route: /docs/cloud - title: Cloud ---- - -## Installation - - - - -CLI -Manual - - - -```bash -npx shadcx@latest add cloud -r plate-ui -``` - - - - - - - - - -Install the following dependencies: - -- [Cloud](/docs/cloud) - - - - - -Copy and paste the following code into your project. - - - - - - - - - - - -Update the import paths to match your project setup. - - - - - - - - - -## Examples - - - -### Usage - -```tsx -const plugins = createMyPlugins( - [ - ...basicNodesPlugins, - createCloudPlugin({ - options: {}, - }), - createCloudAttachmentPlugin(), - createCloudImagePlugin({ - options: { - maxInitialWidth: 320, - maxInitialHeight: 320, - minResizeWidth: 100, - maxResizeWidth: 720, - }, - }), - ], - { - components: { - ...plateUI, - [CloudAttachmentPlugin.key]: CloudAttachmentElement, - [CloudImagePlugin.key]: CloudImageElement, - }, - } -); -``` - -### Demo - -```tsx -export default function CloudDemo() { - return ( - plugins={plugins} initialValue={cloudValue}> - - - - - - ); -} -``` diff --git a/apps/www/content/docs/components/code-block-element.mdx b/apps/www/content/docs/components/code-block-element.mdx index 735374ef33..ab837ebde6 100644 --- a/apps/www/content/docs/components/code-block-element.mdx +++ b/apps/www/content/docs/components/code-block-element.mdx @@ -45,7 +45,8 @@ Copy and paste the following code into your project. - + + diff --git a/apps/www/content/docs/components/color-dropdown-menu.mdx b/apps/www/content/docs/components/color-dropdown-menu.mdx index 0d8d615e8b..697360de59 100644 --- a/apps/www/content/docs/components/color-dropdown-menu.mdx +++ b/apps/www/content/docs/components/color-dropdown-menu.mdx @@ -56,11 +56,11 @@ Copy and paste the following code into your project. - - - - - + + + + + diff --git a/apps/www/content/docs/components/comments-popover.mdx b/apps/www/content/docs/components/comments-popover.mdx index 107b4e7e71..9c8ac6b1da 100644 --- a/apps/www/content/docs/components/comments-popover.mdx +++ b/apps/www/content/docs/components/comments-popover.mdx @@ -51,14 +51,15 @@ Copy and paste the following code into your project. - - - - - - - + + + + + + + + diff --git a/apps/www/content/docs/components/emoji-dropdown-menu.mdx b/apps/www/content/docs/components/emoji-dropdown-menu.mdx index 752483bf62..de64eaa4ec 100644 --- a/apps/www/content/docs/components/emoji-dropdown-menu.mdx +++ b/apps/www/content/docs/components/emoji-dropdown-menu.mdx @@ -49,13 +49,13 @@ Copy and paste the following code into your project. - - - - - - - + + + + + + + diff --git a/apps/www/content/docs/components/emoji-toolbar-dropdown.mdx b/apps/www/content/docs/components/emoji-toolbar-dropdown.mdx index b00166407b..367447e887 100644 --- a/apps/www/content/docs/components/emoji-toolbar-dropdown.mdx +++ b/apps/www/content/docs/components/emoji-toolbar-dropdown.mdx @@ -40,7 +40,7 @@ Copy and paste the following code into your project. - + diff --git a/apps/www/contentlayer.config.js b/apps/www/contentlayer.config.js index cce45c5605..94dc5fae42 100644 --- a/apps/www/contentlayer.config.js +++ b/apps/www/contentlayer.config.js @@ -1,10 +1,9 @@ -import { getHighlighter, loadTheme } from '@shikijs/compat'; +import { getHighlighter } from '@shikijs/compat'; import { defineDocumentType, defineNestedType, makeSource, } from 'contentlayer2/source-files'; -import path from 'node:path'; import rehypeAutolinkHeadings from 'rehype-autolink-headings'; import rehypePrettyCode from 'rehype-pretty-code'; import rehypeSlug from 'rehype-slug'; @@ -130,13 +129,8 @@ export default makeSource({ [ rehypePrettyCode, { - getHighlighter: async () => { - const theme = await loadTheme( - path.join(process.cwd(), '/src/lib/highlighter-theme.json') - ); - - return await getHighlighter({ theme }); - }, + getHighlighter, + theme: 'github-dark', onVisitHighlightedLine(node) { node.properties.className.push('line--highlighted'); }, diff --git a/apps/www/package.json b/apps/www/package.json index 688e0b0b88..2d47c49b38 100644 --- a/apps/www/package.json +++ b/apps/www/package.json @@ -178,6 +178,7 @@ "glob": "^11.0.0", "mdast-util-toc": "^7.1.0", "postcss": "^8.4.45", + "puppeteer": "^23.6.0", "rehype": "^12.0.1", "rehype-autolink-headings": "^6.1.1", "rehype-pretty-code": "^0.6.0", diff --git a/apps/www/public/r/index.json b/apps/www/public/r/index.json index fcfdd4ebd0..b527c62e39 100644 --- a/apps/www/public/r/index.json +++ b/apps/www/public/r/index.json @@ -39,40 +39,6 @@ ], "type": "registry:ui" }, - { - "dependencies": [ - "@udecode/plate-cloud" - ], - "files": [ - { - "path": "plate-ui/cloud.tsx", - "type": "registry:ui" - }, - { - "path": "plate-ui/cloud-attachment-element.tsx", - "type": "registry:ui" - }, - { - "path": "plate-ui/cloud-image-element.tsx", - "type": "registry:ui" - }, - { - "path": "plate-ui/cloud-resize-controls.tsx", - "type": "registry:ui" - }, - { - "path": "plate-ui/cloud-status-bar.tsx", - "type": "registry:ui" - }, - { - "path": "plate-ui/cloud-toolbar-buttons.tsx", - "type": "registry:ui" - } - ], - "name": "cloud", - "registryDependencies": [], - "type": "registry:ui" - }, { "dependencies": [ "@udecode/plate-code-block" diff --git a/apps/www/public/r/styles/default/align-dropdown-menu.json b/apps/www/public/r/styles/default/align-dropdown-menu.json index c7021beead..f0df4bc6ae 100644 --- a/apps/www/public/r/styles/default/align-dropdown-menu.json +++ b/apps/www/public/r/styles/default/align-dropdown-menu.json @@ -6,7 +6,7 @@ { "content": "'use client';\n\nimport React from 'react';\n\nimport type { DropdownMenuProps } from '@radix-ui/react-dropdown-menu';\n\nimport {\n useAlignDropdownMenu,\n useAlignDropdownMenuState,\n} from '@udecode/plate-alignment/react';\n\nimport { Icons, iconVariants } from '@/components/icons';\n\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuTrigger,\n useOpenState,\n} from './dropdown-menu';\nimport { ToolbarButton } from './toolbar';\n\nconst items = [\n {\n icon: Icons.alignLeft,\n value: 'left',\n },\n {\n icon: Icons.alignCenter,\n value: 'center',\n },\n {\n icon: Icons.alignRight,\n value: 'right',\n },\n {\n icon: Icons.alignJustify,\n value: 'justify',\n },\n];\n\nexport function AlignDropdownMenu({ children, ...props }: DropdownMenuProps) {\n const state = useAlignDropdownMenuState();\n const { radioGroupProps } = useAlignDropdownMenu(state);\n\n const openState = useOpenState();\n const IconValue =\n items.find((item) => item.value === radioGroupProps.value)?.icon ??\n Icons.alignLeft;\n\n return (\n \n \n \n \n \n \n\n \n \n {items.map(({ icon: Icon, value: itemValue }) => (\n \n \n \n ))}\n \n \n \n );\n}\n", "path": "plate-ui/align-dropdown-menu.tsx", - "target": "", + "target": "components/plate-ui/align-dropdown-menu.tsx", "type": "registry:ui" } ], diff --git a/apps/www/public/r/styles/default/avatar.json b/apps/www/public/r/styles/default/avatar.json index 70bcfc351e..3d3afc6d89 100644 --- a/apps/www/public/r/styles/default/avatar.json +++ b/apps/www/public/r/styles/default/avatar.json @@ -6,7 +6,7 @@ { "content": "'use client';\n\nimport * as AvatarPrimitive from '@radix-ui/react-avatar';\nimport { withCn } from '@udecode/cn';\n\nexport const Avatar = withCn(\n AvatarPrimitive.Root,\n 'relative flex size-10 shrink-0 overflow-hidden rounded-full'\n);\n\nexport const AvatarImage = withCn(\n AvatarPrimitive.Image,\n 'aspect-square size-full'\n);\n\nexport const AvatarFallback = withCn(\n AvatarPrimitive.Fallback,\n 'flex size-full items-center justify-center rounded-full bg-muted'\n);\n", "path": "plate-ui/avatar.tsx", - "target": "", + "target": "components/plate-ui/avatar.tsx", "type": "registry:ui" } ], diff --git a/apps/www/public/r/styles/default/basic-editor-default-demo.json b/apps/www/public/r/styles/default/basic-editor-default-demo.json new file mode 100644 index 0000000000..52c8118a84 --- /dev/null +++ b/apps/www/public/r/styles/default/basic-editor-default-demo.json @@ -0,0 +1,13 @@ +{ + "files": [ + { + "content": "import React from 'react';\n\nimport {\n Plate,\n PlateContent,\n usePlateEditor,\n} from '@udecode/plate-common/react';\n\nexport default function BasicEditorDefaultDemo() {\n const editor = usePlateEditor();\n\n return (\n \n \n \n );\n}\n", + "path": "example/basic-editor-default-demo.tsx", + "target": "components/basic-editor-default-demo.tsx", + "type": "registry:example" + } + ], + "name": "basic-editor-default-demo", + "registryDependencies": [], + "type": "registry:example" +} \ No newline at end of file diff --git a/apps/www/public/r/styles/default/basic-editor-handler-demo.json b/apps/www/public/r/styles/default/basic-editor-handler-demo.json new file mode 100644 index 0000000000..219a4083f7 --- /dev/null +++ b/apps/www/public/r/styles/default/basic-editor-handler-demo.json @@ -0,0 +1,13 @@ +{ + "files": [ + { + "content": "import React, { useState } from 'react';\n\nimport type { Value } from '@udecode/plate-common';\n\nimport { Plate, usePlateEditor } from '@udecode/plate-common/react';\n\nimport {\n Accordion,\n AccordionContent,\n AccordionItem,\n AccordionTrigger,\n} from '@/components/ui/accordion';\nimport { editableProps } from '@/plate/demo/editableProps';\nimport { Editor } from '@/components/plate-ui/editor';\n\nconst value = [\n {\n children: [\n {\n text: 'This is editable plain text with react and history plugins, just like a textarea!',\n },\n ],\n type: 'p',\n },\n];\n\nexport default function BasicEditorHandlerDemo() {\n const [debugValue, setDebugValue] = useState(value);\n\n const localValue =\n typeof window !== 'undefined' && localStorage.getItem('editorContent');\n\n const editor = usePlateEditor({\n value: localValue ? JSON.parse(localValue) : value,\n });\n\n return (\n {\n localStorage.setItem('editorContent', JSON.stringify(value));\n setDebugValue(value);\n }}\n editor={editor}\n >\n \n\n \n \n Debug Value\n {JSON.stringify(debugValue)}\n \n \n \n );\n}\n", + "path": "example/basic-editor-handler-demo.tsx", + "target": "components/basic-editor-handler-demo.tsx", + "type": "registry:example" + } + ], + "name": "basic-editor-handler-demo", + "registryDependencies": [], + "type": "registry:example" +} \ No newline at end of file diff --git a/apps/www/public/r/styles/default/basic-editor-styling-demo.json b/apps/www/public/r/styles/default/basic-editor-styling-demo.json new file mode 100644 index 0000000000..60cc9f6608 --- /dev/null +++ b/apps/www/public/r/styles/default/basic-editor-styling-demo.json @@ -0,0 +1,13 @@ +{ + "files": [ + { + "content": "import React from 'react';\n\nimport { Plate, usePlateEditor } from '@udecode/plate-common/react';\n\nimport { Editor } from '@/components/plate-ui/editor';\n\nexport default function BasicEditorStylingDemo() {\n const editor = usePlateEditor();\n\n return (\n \n \n \n );\n}\n", + "path": "example/basic-editor-styling-demo.tsx", + "target": "components/basic-editor-styling-demo.tsx", + "type": "registry:example" + } + ], + "name": "basic-editor-styling-demo", + "registryDependencies": [], + "type": "registry:example" +} \ No newline at end of file diff --git a/apps/www/public/r/styles/default/basic-editor-value-demo.json b/apps/www/public/r/styles/default/basic-editor-value-demo.json new file mode 100644 index 0000000000..0e6cddbfb7 --- /dev/null +++ b/apps/www/public/r/styles/default/basic-editor-value-demo.json @@ -0,0 +1,13 @@ +{ + "files": [ + { + "content": "import React from 'react';\n\nimport { Plate, usePlateEditor } from '@udecode/plate-common/react';\n\nimport { editableProps } from '@/plate/demo/editableProps';\nimport { Editor } from '@/components/plate-ui/editor';\n\nconst value = [\n {\n children: [\n {\n text: 'This is editable plain text with react and history plugins, just like a