Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
zbeyens committed Nov 5, 2024
1 parent 42dde6a commit 9f7d52f
Show file tree
Hide file tree
Showing 36 changed files with 90 additions and 77 deletions.
9 changes: 6 additions & 3 deletions apps/www/public/r/styles/default/ai-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/align-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/basic-elements-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/basic-marks-demo.json

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions apps/www/public/r/styles/default/basic-nodes-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/block-menu-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/block-selection-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/column-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/comment-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/copilot-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/date-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/dnd-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/emoji-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/excalidraw-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/floating-toolbar-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/font-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/highlight-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/hr-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/indent-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/kbd-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/line-height-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/link-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/list-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/media-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/mention-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/mode-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/placeholder-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/playground-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/resizable-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/slash-command-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/table-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/toc-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/toggle-demo.json

Large diffs are not rendered by default.

17 changes: 12 additions & 5 deletions apps/www/public/r/styles/default/toggle-element.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"dependencies": ["@udecode/plate-toggle"],
"dependencies": [
"@udecode/plate-toggle"
],
"doc": {
"description": "A collapsible component for toggling content visibility.",
"docs": [
Expand All @@ -8,17 +10,22 @@
"title": "Toggle"
}
],
"examples": ["toggle-demo"]
"examples": [
"toggle-demo"
]
},
"files": [
{
"content": "'use client';\n\nimport { cn, withRef } from '@udecode/cn';\nimport { useElement } from '@udecode/plate-common/react';\nimport {\n useToggleButton,\n useToggleButtonState,\n} from '@udecode/plate-toggle/react';\nimport { ChevronDown, ChevronRight } from 'lucide-react';\n\nimport { Button } from './button';\nimport { PlateElement } from './plate-element';\n\nexport const ToggleElement = withRef<typeof PlateElement>(\n ({ children, className, ...props }, ref) => {\n const element = useElement();\n const state = useToggleButtonState(element.id as string);\n const { buttonProps, open } = useToggleButton(state);\n\n return (\n <PlateElement\n ref={ref}\n className={cn('relative pl-6', className)}\n {...props}\n >\n <Button\n size=\"icon\"\n variant=\"ghost\"\n className=\"absolute -left-0.5 top-0 size-6 cursor-pointer select-none items-center justify-center rounded-md p-px text-muted-foreground transition-colors hover:bg-accent [&_svg]:size-4\"\n contentEditable={false}\n {...buttonProps}\n >\n {open ? <ChevronDown /> : <ChevronRight />}\n </Button>\n {children}\n </PlateElement>\n );\n }\n);\n",
"content": "'use client';\n\nimport { cn, withRef } from '@udecode/cn';\nimport { useElement } from '@udecode/plate-common/react';\nimport {\n useToggleButton,\n useToggleButtonState,\n} from '@udecode/plate-toggle/react';\nimport { ChevronRight } from 'lucide-react';\n\nimport { Button } from './button';\nimport { PlateElement } from './plate-element';\n\nexport const ToggleElement = withRef<typeof PlateElement>(\n ({ children, className, ...props }, ref) => {\n const element = useElement();\n const state = useToggleButtonState(element.id as string);\n const { buttonProps, open } = useToggleButton(state);\n\n return (\n <PlateElement\n ref={ref}\n className={cn('relative pl-6', className)}\n {...props}\n >\n <Button\n size=\"icon\"\n variant=\"ghost\"\n className=\"absolute -left-0.5 top-0 size-6 cursor-pointer select-none items-center justify-center rounded-md p-px text-muted-foreground transition-colors hover:bg-accent [&_svg]:size-4\"\n contentEditable={false}\n {...buttonProps}\n >\n <ChevronRight\n className={cn(\n 'transition-transform duration-75',\n open ? 'rotate-90' : 'rotate-0'\n )}\n />\n </Button>\n {children}\n </PlateElement>\n );\n }\n);\n",
"path": "plate-ui/toggle-element.tsx",
"target": "components/plate-ui/toggle-element.tsx",
"type": "registry:ui"
}
],
"name": "toggle-element",
"registryDependencies": ["button", "plate-element"],
"registryDependencies": [
"button",
"plate-element"
],
"type": "registry:ui"
}
}
4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/toolbar-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/upload-demo.json

Large diffs are not rendered by default.

0 comments on commit 9f7d52f

Please sign in to comment.