Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zbeyens authored Oct 16, 2024
1 parent 277f739 commit 8bdb978
Showing 1 changed file with 1 addition and 1 deletion.
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

0 comments on commit 8bdb978

Please sign in to comment.