diff --git a/apps/www/public/r/styles/default/editor.json b/apps/www/public/r/styles/default/editor.json index b6090825c9..3f163fef07 100644 --- a/apps/www/public/r/styles/default/editor.json +++ b/apps/www/public/r/styles/default/editor.json @@ -7,11 +7,15 @@ "route": "https://pro.platejs.org/docs/components/editor" } ], - "examples": ["editor-default", "editor-disabled", "editor-full-width"] + "examples": [ + "editor-default", + "editor-disabled", + "editor-full-width" + ] }, "files": [ { - "content": "'use client';\n\nimport React from 'react';\n\nimport type { PlateContentProps } from '@udecode/plate-common/react';\nimport type { VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@udecode/cn';\nimport {\n PlateContent,\n useEditorContainerRef,\n useEditorRef,\n} from '@udecode/plate-common/react';\nimport { cva } from 'class-variance-authority';\n\nconst editorContainerVariants = cva(\n 'relative w-full cursor-text overflow-y-auto caret-primary selection:bg-brand/25 [&_.slate-selection-area]:border [&_.slate-selection-area]:border-brand/25 [&_.slate-selection-area]:bg-brand/15',\n {\n defaultVariants: {\n variant: 'default',\n },\n variants: {\n variant: {\n default: 'h-full',\n demo: 'h-[650px]',\n },\n },\n }\n);\n\nexport const EditorContainer = ({\n className,\n variant,\n ...props\n}: React.HTMLAttributes &\n VariantProps) => {\n const editor = useEditorRef();\n const containerRef = useEditorContainerRef();\n\n return (\n \n );\n};\n\nEditorContainer.displayName = 'EditorContainer';\n\nconst editorVariants = cva(\n cn(\n 'group/editor',\n 'relative w-full overflow-x-hidden whitespace-pre-wrap break-words',\n 'rounded-md ring-offset-background placeholder:text-muted-foreground/80 focus-visible:outline-none',\n '[&_[data-slate-placeholder]]:text-muted-foreground/80 [&_[data-slate-placeholder]]:!opacity-100',\n '[&_[data-slate-placeholder]]:top-[auto_!important]',\n '[&_strong]:font-bold'\n ),\n {\n defaultVariants: {\n variant: 'default',\n },\n variants: {\n disabled: {\n true: 'cursor-not-allowed opacity-50',\n },\n focused: {\n true: 'ring-2 ring-ring ring-offset-2',\n },\n variant: {\n ai: 'w-full px-0 text-base md:text-sm',\n aiChat:\n 'max-h-[min(70vh,320px)] w-full max-w-[700px] overflow-y-auto px-3 py-2 text-base md:text-sm',\n default:\n 'size-full px-16 pb-72 pt-4 text-base sm:px-[max(64px,calc(50%-350px))]',\n demo: 'size-full px-16 pb-72 pt-4 text-base sm:px-[max(64px,calc(50%-350px))]',\n fullWidth: 'size-full px-16 pb-72 pt-4 text-base sm:px-24',\n none: '',\n },\n },\n }\n);\n\nexport type EditorProps = PlateContentProps &\n VariantProps;\n\nexport const Editor = React.forwardRef(\n ({ className, disabled, focused, variant, ...props }, ref) => {\n return (\n \n );\n }\n);\n\nEditor.displayName = 'Editor';\n", + "content": "'use client';\n\nimport React from 'react';\n\nimport type { PlateContentProps } from '@udecode/plate-common/react';\nimport type { VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@udecode/cn';\nimport {\n PlateContent,\n useEditorContainerRef,\n useEditorRef,\n} from '@udecode/plate-common/react';\nimport { cva } from 'class-variance-authority';\n\nconst editorContainerVariants = cva(\n 'relative w-full cursor-text overflow-y-auto caret-primary selection:bg-brand/25 [&_.slate-selection-area]:border [&_.slate-selection-area]:border-brand/25 [&_.slate-selection-area]:bg-brand/15',\n {\n defaultVariants: {\n variant: 'default',\n },\n variants: {\n variant: {\n default: 'h-full',\n demo: 'h-[650px]',\n select: cn(\n 'group rounded-md border border-input ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2',\n 'has-[[data-readonly]]:w-fit has-[[data-readonly]]:cursor-default has-[[data-readonly]]:border-transparent has-[[data-readonly]]:focus-within:ring-0'\n ),\n },\n },\n }\n);\n\nexport const EditorContainer = ({\n className,\n variant,\n ...props\n}: React.HTMLAttributes &\n VariantProps) => {\n const editor = useEditorRef();\n const containerRef = useEditorContainerRef();\n\n return (\n \n );\n};\n\nEditorContainer.displayName = 'EditorContainer';\n\nconst editorVariants = cva(\n cn(\n 'group/editor',\n 'relative w-full overflow-x-hidden whitespace-pre-wrap break-words',\n 'rounded-md ring-offset-background placeholder:text-muted-foreground/80 focus-visible:outline-none',\n '[&_[data-slate-placeholder]]:text-muted-foreground/80 [&_[data-slate-placeholder]]:!opacity-100',\n '[&_[data-slate-placeholder]]:top-[auto_!important]',\n '[&_strong]:font-bold'\n ),\n {\n defaultVariants: {\n variant: 'default',\n },\n variants: {\n disabled: {\n true: 'cursor-not-allowed opacity-50',\n },\n focused: {\n true: 'ring-2 ring-ring ring-offset-2',\n },\n variant: {\n ai: 'w-full px-0 text-base md:text-sm',\n aiChat:\n 'max-h-[min(70vh,320px)] w-full max-w-[700px] overflow-y-auto px-3 py-2 text-base md:text-sm',\n default:\n 'size-full px-16 pb-72 pt-4 text-base sm:px-[max(64px,calc(50%-350px))]',\n demo: 'size-full px-16 pb-72 pt-4 text-base sm:px-[max(64px,calc(50%-350px))]',\n fullWidth: 'size-full px-16 pb-72 pt-4 text-base sm:px-24',\n none: '',\n select: 'px-3 py-2 text-base data-[readonly]:w-fit',\n },\n },\n }\n);\n\nexport type EditorProps = PlateContentProps &\n VariantProps;\n\nexport const Editor = React.forwardRef(\n ({ className, disabled, focused, variant, ...props }, ref) => {\n return (\n \n );\n }\n);\n\nEditor.displayName = 'Editor';\n", "path": "plate-ui/editor.tsx", "target": "components/plate-ui/editor.tsx", "type": "registry:ui" @@ -20,4 +24,4 @@ "name": "editor", "registryDependencies": [], "type": "registry:ui" -} +} \ No newline at end of file diff --git a/apps/www/src/__registry__/index.tsx b/apps/www/src/__registry__/index.tsx index 739ef98042..8375e46f8e 100644 --- a/apps/www/src/__registry__/index.tsx +++ b/apps/www/src/__registry__/index.tsx @@ -546,7 +546,11 @@ export const Index: Record = { description: "", type: "registry:ui", registryDependencies: ["plate-element"], - files: ["registry/default/plate-ui/tag-element.tsx"], + files: [{ + path: "src/registry/default/plate-ui/tag-element.tsx", + type: "registry:ui", + target: "" + }], component: React.lazy(() => import("@/registry/default/plate-ui/tag-element.tsx")), source: "", category: "", @@ -750,7 +754,11 @@ export const Index: Record = { description: "", type: "registry:ui", registryDependencies: ["label"], - files: ["registry/default/plate-ui/form.tsx"], + files: [{ + path: "src/registry/default/plate-ui/form.tsx", + type: "registry:ui", + target: "" + }], component: React.lazy(() => import("@/registry/default/plate-ui/form.tsx")), source: "", category: "", @@ -778,7 +786,11 @@ export const Index: Record = { description: "", type: "registry:ui", registryDependencies: [], - files: ["registry/default/plate-ui/label.tsx"], + files: [{ + path: "src/registry/default/plate-ui/label.tsx", + type: "registry:ui", + target: "" + }], component: React.lazy(() => import("@/registry/default/plate-ui/label.tsx")), source: "", category: "", @@ -1122,7 +1134,11 @@ export const Index: Record = { description: "", type: "registry:ui", registryDependencies: ["editor","command","popover","tag-element"], - files: ["registry/default/plate-ui/select-editor.tsx"], + files: [{ + path: "src/registry/default/plate-ui/select-editor.tsx", + type: "registry:ui", + target: "" + }], component: React.lazy(() => import("@/registry/default/plate-ui/select-editor.tsx")), source: "", category: "", @@ -3190,7 +3206,11 @@ export const Index: Record = { description: "", type: "registry:example", registryDependencies: ["form","button","select-editor"], - files: ["registry/default/example/select-editor-demo.tsx"], + files: [{ + path: "src/registry/default/example/select-editor-demo.tsx", + type: "registry:example", + target: "" + }], component: React.lazy(() => import("@/registry/default/example/select-editor-demo.tsx")), source: "", category: "", diff --git a/apps/www/src/registry/registry-examples.ts b/apps/www/src/registry/registry-examples.ts index f5c82d5a69..1d12bb15e6 100644 --- a/apps/www/src/registry/registry-examples.ts +++ b/apps/www/src/registry/registry-examples.ts @@ -1184,7 +1184,9 @@ export const docExamples: Registry = [ description: 'A form with a select editor component for managing labels.', title: 'Select Editor Form', }, - files: ['example/select-editor-demo.tsx'], + files: [ + { path: 'example/select-editor-demo.tsx', type: 'registry:example' }, + ], name: 'select-editor-demo', registryDependencies: ['form', 'button', 'select-editor'], type: 'registry:example', diff --git a/apps/www/src/registry/registry-ui.ts b/apps/www/src/registry/registry-ui.ts index 79ddcbf003..2ea62a1d74 100644 --- a/apps/www/src/registry/registry-ui.ts +++ b/apps/www/src/registry/registry-ui.ts @@ -290,7 +290,7 @@ import { withDraggables } from './withDraggables';`, examples: ['select-editor-demo'], label: 'New', }, - files: ['plate-ui/select-editor.tsx'], + files: [{ path: 'plate-ui/select-editor.tsx', type: 'registry:ui' }], name: 'select-editor', registryDependencies: ['editor', 'command', 'popover', 'tag-element'], type: 'registry:ui', @@ -1421,7 +1421,7 @@ export const uiNodes: Registry = [ ], examples: ['select-editor-demo'], }, - files: ['plate-ui/tag-element.tsx'], + files: [{ path: 'plate-ui/tag-element.tsx', type: 'registry:ui' }], name: 'tag-element', registryDependencies: ['plate-element'], type: 'registry:ui', @@ -1613,7 +1613,7 @@ export const uiPrimitives: Registry = [ doc: 'https://ui.shadcn.com/docs/components/form', }, }, - files: ['plate-ui/form.tsx'], + files: [{ path: 'plate-ui/form.tsx', type: 'registry:ui' }], name: 'form', registryDependencies: ['label'], type: 'registry:ui', @@ -1640,7 +1640,7 @@ export const uiPrimitives: Registry = [ doc: 'https://ui.shadcn.com/docs/components/label', }, }, - files: ['plate-ui/label.tsx'], + files: [{ path: 'plate-ui/label.tsx', type: 'registry:ui' }], name: 'label', registryDependencies: [], type: 'registry:ui', diff --git a/yarn.lock b/yarn.lock index 5d8aae2e0e..e8dbef9df2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6088,14 +6088,14 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-basic-elements@npm:40.0.2, @udecode/plate-basic-elements@workspace:^, @udecode/plate-basic-elements@workspace:packages/basic-elements": +"@udecode/plate-basic-elements@npm:40.2.6, @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:40.0.0" "@udecode/plate-code-block": "npm:40.0.0" "@udecode/plate-common": "workspace:^" - "@udecode/plate-heading": "npm:40.0.2" + "@udecode/plate-heading": "npm:40.2.6" peerDependencies: "@udecode/plate-common": ">=40.0.3" react: ">=16.8.0" @@ -6415,12 +6415,12 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-docx@npm:40.2.4, @udecode/plate-docx@workspace:^, @udecode/plate-docx@workspace:packages/docx": +"@udecode/plate-docx@npm:40.2.6, @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:40.0.2" + "@udecode/plate-heading": "npm:40.2.6" "@udecode/plate-indent": "npm:40.0.0" "@udecode/plate-indent-list": "npm:40.0.0" "@udecode/plate-media": "npm:40.2.4" @@ -6529,7 +6529,7 @@ __metadata: languageName: unknown linkType: soft -"@udecode/plate-heading@npm:40.0.2, @udecode/plate-heading@workspace:^, @udecode/plate-heading@workspace:packages/heading": +"@udecode/plate-heading@npm:40.2.6, @udecode/plate-heading@workspace:^, @udecode/plate-heading@workspace:packages/heading": version: 0.0.0-use.local resolution: "@udecode/plate-heading@workspace:packages/heading" dependencies: @@ -7126,7 +7126,7 @@ __metadata: dependencies: "@udecode/plate-alignment": "npm:40.0.0" "@udecode/plate-autoformat": "npm:40.0.0" - "@udecode/plate-basic-elements": "npm:40.0.2" + "@udecode/plate-basic-elements": "npm:40.2.6" "@udecode/plate-basic-marks": "npm:40.0.0" "@udecode/plate-block-quote": "npm:40.0.0" "@udecode/plate-break": "npm:40.0.0" @@ -7136,11 +7136,11 @@ __metadata: "@udecode/plate-common": "npm:40.0.3" "@udecode/plate-csv": "npm:40.0.0" "@udecode/plate-diff": "npm:40.0.0" - "@udecode/plate-docx": "npm:40.2.4" + "@udecode/plate-docx": "npm:40.2.6" "@udecode/plate-find-replace": "npm:40.0.0" "@udecode/plate-floating": "npm:40.0.0" "@udecode/plate-font": "npm:40.0.0" - "@udecode/plate-heading": "npm:40.0.2" + "@udecode/plate-heading": "npm:40.2.6" "@udecode/plate-highlight": "npm:40.0.0" "@udecode/plate-horizontal-rule": "npm:40.0.0" "@udecode/plate-html": "npm:40.0.0"