Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Registry #3639

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/www/public/r/styles/default/mention-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 type { TMentionElement } from '@udecode/plate-mention';\n\nimport { cn, withRef } from '@udecode/cn';\nimport { getHandler } from '@udecode/plate-common';\nimport { useElement } from '@udecode/plate-common/react';\nimport { IS_APPLE } from '@udecode/utils';\nimport { useFocused, useSelected } from 'slate-react';\n\nimport { useMounted } from '@/registry/default/hooks/use-mounted';\n\nimport { PlateElement } from './plate-element';\n\nexport const MentionElement = withRef<\n typeof PlateElement,\n {\n prefix?: string;\n renderLabel?: (mentionable: TMentionElement) => string;\n onClick?: (mentionNode: any) => void;\n }\n>(({ children, className, prefix, renderLabel, onClick, ...props }, ref) => {\n const element = useElement<TMentionElement>();\n const selected = useSelected();\n const focused = useFocused();\n const mounted = useMounted();\n\n return (\n <PlateElement\n ref={ref}\n className={cn(\n 'inline-block cursor-pointer rounded-md bg-muted px-1.5 py-0.5 align-baseline text-sm font-medium',\n selected && focused && 'ring-2 ring-ring',\n element.children[0].bold === true && 'font-bold',\n element.children[0].italic === true && 'italic',\n element.children[0].underline === true && 'underline',\n className\n )}\n onClick={getHandler(onClick, element)}\n data-slate-value={element.value}\n contentEditable={false}\n {...props}\n >\n {mounted && IS_APPLE ? (\n // Mac OS IME https://github.com/ianstormtaylor/slate/issues/3490\n <React.Fragment>\n {children}\n {prefix}\n {renderLabel ? renderLabel(element) : element.value}\n </React.Fragment>\n ) : (\n // Others like Android https://github.com/ianstormtaylor/slate/pull/5360\n <React.Fragment>\n {prefix}\n {renderLabel ? renderLabel(element) : element.value}\n {children}\n </React.Fragment>\n )}\n </PlateElement>\n );\n});\n",
"content": "import React from 'react';\n\nimport type { TMentionElement } from '@udecode/plate-mention';\n\nimport { cn, withRef } from '@udecode/cn';\nimport { IS_APPLE, getHandler } from '@udecode/plate-common';\nimport { useElement } from '@udecode/plate-common/react';\nimport { useFocused, useSelected } from 'slate-react';\n\nimport { useMounted } from '@/registry/default/hooks/use-mounted';\n\nimport { PlateElement } from './plate-element';\n\nexport const MentionElement = withRef<\n typeof PlateElement,\n {\n prefix?: string;\n renderLabel?: (mentionable: TMentionElement) => string;\n onClick?: (mentionNode: any) => void;\n }\n>(({ children, className, prefix, renderLabel, onClick, ...props }, ref) => {\n const element = useElement<TMentionElement>();\n const selected = useSelected();\n const focused = useFocused();\n const mounted = useMounted();\n\n return (\n <PlateElement\n ref={ref}\n className={cn(\n 'inline-block cursor-pointer rounded-md bg-muted px-1.5 py-0.5 align-baseline text-sm font-medium',\n selected && focused && 'ring-2 ring-ring',\n element.children[0].bold === true && 'font-bold',\n element.children[0].italic === true && 'italic',\n element.children[0].underline === true && 'underline',\n className\n )}\n onClick={getHandler(onClick, element)}\n data-slate-value={element.value}\n contentEditable={false}\n {...props}\n >\n {mounted && IS_APPLE ? (\n // Mac OS IME https://github.com/ianstormtaylor/slate/issues/3490\n <React.Fragment>\n {children}\n {prefix}\n {renderLabel ? renderLabel(element) : element.value}\n </React.Fragment>\n ) : (\n // Others like Android https://github.com/ianstormtaylor/slate/pull/5360\n <React.Fragment>\n {prefix}\n {renderLabel ? renderLabel(element) : element.value}\n {children}\n </React.Fragment>\n )}\n </PlateElement>\n );\n});\n",
"path": "plate-ui/mention-element.tsx",
"target": "",
"type": "registry:ui"
Expand Down