Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zbeyens authored Sep 30, 2024
1 parent 8070409 commit 3a313f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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 { PlateElement, useElement } from '@udecode/plate-common/react';\nimport { useFocused, useSelected } from 'slate-react';\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\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 {prefix}\n {renderLabel ? renderLabel(element) : element.value}\n {children}\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 { getHandler } from '@udecode/plate-common';\nimport { PlateElement, useElement } from '@udecode/plate-common/react';\nimport { IS_APPLE } from '@udecode/utils';\nimport { useFocused, useSelected } from 'slate-react';\n\nimport { useMounted } from '@/hooks/use-mounted';\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
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6525,7 +6525,7 @@ __metadata:
languageName: unknown
linkType: soft

"@udecode/plate-markdown@npm:38.0.1, @udecode/plate-markdown@workspace:^, @udecode/plate-markdown@workspace:packages/markdown":
"@udecode/plate-markdown@npm:38.0.13, @udecode/plate-markdown@workspace:^, @udecode/plate-markdown@workspace:packages/markdown":
version: 0.0.0-use.local
resolution: "@udecode/plate-markdown@workspace:packages/markdown"
dependencies:
Expand Down Expand Up @@ -6928,7 +6928,7 @@ __metadata:
"@udecode/plate-line-height": "npm:38.0.1"
"@udecode/plate-link": "npm:38.0.6"
"@udecode/plate-list": "npm:38.0.1"
"@udecode/plate-markdown": "npm:38.0.1"
"@udecode/plate-markdown": "npm:38.0.13"
"@udecode/plate-media": "npm:38.0.6"
"@udecode/plate-mention": "npm:38.0.1"
"@udecode/plate-node-id": "npm:38.0.1"
Expand Down

0 comments on commit 3a313f5

Please sign in to comment.