-
-
Notifications
You must be signed in to change notification settings - Fork 755
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5e7ccdd
commit e4aabdb
Showing
71 changed files
with
1,791 additions
and
655 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
templates/plate-playground-template/src/components/plate-ui/blockquote-element-static.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from 'react'; | ||
|
||
import type { SlateElementProps } from '@udecode/plate-common'; | ||
|
||
import { cn } from '@udecode/cn'; | ||
import { SlateElement } from '@udecode/plate-common'; | ||
|
||
export const BlockquoteElementStatic = ({ | ||
children, | ||
className, | ||
...props | ||
}: SlateElementProps) => { | ||
return ( | ||
<SlateElement | ||
as="blockquote" | ||
className={cn(className, 'my-1 border-l-2 pl-6 italic')} | ||
{...props} | ||
> | ||
{children} | ||
</SlateElement> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
templates/plate-playground-template/src/components/plate-ui/checkbox-static.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import * as React from 'react'; | ||
|
||
import { cn } from '@udecode/cn'; | ||
import { Check } from 'lucide-react'; | ||
|
||
export function CheckboxStatic({ | ||
className, | ||
...props | ||
}: { | ||
checked: boolean; | ||
className?: string; | ||
style?: React.CSSProperties; | ||
}) { | ||
return ( | ||
<button | ||
className={cn( | ||
'peer size-4 shrink-0 rounded-sm border border-primary bg-background ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground', | ||
className | ||
)} | ||
data-state={props.checked ? 'checked' : 'unchecked'} | ||
type="button" | ||
{...props} | ||
> | ||
<div className={cn('flex items-center justify-center text-current')}> | ||
{props.checked && <Check className="size-4" />} | ||
</div> | ||
</button> | ||
); | ||
} |
30 changes: 30 additions & 0 deletions
30
templates/plate-playground-template/src/components/plate-ui/code-block-element-static.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from 'react'; | ||
|
||
import type { TCodeBlockElement } from '@udecode/plate-code-block'; | ||
import type { SlateElementProps } from '@udecode/plate-common'; | ||
|
||
import { cn } from '@udecode/cn'; | ||
import { SlateElement } from '@udecode/plate-common'; | ||
|
||
export const CodeBlockElementStatic = ({ | ||
children, | ||
className, | ||
...props | ||
}: SlateElementProps<TCodeBlockElement>) => { | ||
const { element } = props; | ||
|
||
const codeClassName = element?.lang | ||
? `${element.lang} language-${element.lang}` | ||
: ''; | ||
|
||
return ( | ||
<SlateElement | ||
className={cn(className, 'relative py-1', codeClassName)} | ||
{...props} | ||
> | ||
<pre className="overflow-x-auto rounded-md bg-muted px-6 py-8 font-mono text-sm leading-[normal] [tab-size:2]"> | ||
<code>{children}</code> | ||
</pre> | ||
</SlateElement> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
templates/plate-playground-template/src/components/plate-ui/code-leaf-static.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React from 'react'; | ||
|
||
import type { SlateLeafProps } from '@udecode/plate-common'; | ||
|
||
import { cn } from '@udecode/cn'; | ||
import { SlateLeaf } from '@udecode/plate-common'; | ||
|
||
export const CodeLeafStatic = ({ | ||
children, | ||
className, | ||
...props | ||
}: SlateLeafProps) => { | ||
return ( | ||
<SlateLeaf | ||
as="code" | ||
className={cn( | ||
className, | ||
'whitespace-pre-wrap rounded-md bg-muted px-[0.3em] py-[0.2em] font-mono text-sm' | ||
)} | ||
{...props} | ||
> | ||
{children} | ||
</SlateLeaf> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
templates/plate-playground-template/src/components/plate-ui/code-line-element-static.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
|
||
import type { SlateElementProps } from '@udecode/plate-common'; | ||
|
||
import { SlateElement } from '@udecode/plate-common'; | ||
|
||
export const CodeLineElementStatic = ({ | ||
children, | ||
...props | ||
}: SlateElementProps) => { | ||
return <SlateElement {...props}>{children}</SlateElement>; | ||
}; |
20 changes: 20 additions & 0 deletions
20
templates/plate-playground-template/src/components/plate-ui/code-syntax-leaf-static.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react'; | ||
|
||
import type { SlateLeafProps } from '@udecode/plate-common'; | ||
|
||
import { cn } from '@udecode/cn'; | ||
import { SlateLeaf } from '@udecode/plate-common'; | ||
|
||
export function CodeSyntaxLeafStatic({ | ||
children, | ||
className, | ||
...props | ||
}: SlateLeafProps) { | ||
const syntaxClassName = `prism-token token ${props.leaf.tokenType}`; | ||
|
||
return ( | ||
<SlateLeaf className={cn(className, syntaxClassName)} {...props}> | ||
{children} | ||
</SlateLeaf> | ||
); | ||
} |
25 changes: 25 additions & 0 deletions
25
templates/plate-playground-template/src/components/plate-ui/column-element-static.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React from 'react'; | ||
|
||
import type { SlateElementProps } from '@udecode/plate-common'; | ||
import type { TColumnElement } from '@udecode/plate-layout'; | ||
|
||
import { cn } from '@udecode/cn'; | ||
import { SlateElement } from '@udecode/plate-common'; | ||
|
||
export function ColumnElementStatic({ | ||
children, | ||
className, | ||
...props | ||
}: SlateElementProps) { | ||
const { width } = props.element as TColumnElement; | ||
|
||
return ( | ||
<SlateElement | ||
className={cn(className, 'border border-transparent p-1.5')} | ||
style={{ width: width ?? '100%' }} | ||
{...props} | ||
> | ||
{children} | ||
</SlateElement> | ||
); | ||
} |
Oops, something went wrong.