index int64 0 0 | repo_id stringlengths 16 181 | file_path stringlengths 28 270 | content stringlengths 1 11.6M | __index_level_0__ int64 0 10k |
|---|---|---|---|---|
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/list-element.tsx | import React from 'react';
import { PlateElement, PlateElementProps } from '@udecode/plate-common';
import { cva, VariantProps } from 'class-variance-authority';
import { cn } from '@/lib/utils';
const listVariants = cva('m-0 ps-6', {
variants: {
variant: {
ul: 'list-disc [&_ul]:list-[circle] [&_ul_ul]:li... | 1,000 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/list-toolbar-button.tsx | import React from 'react';
import {
ELEMENT_UL,
useListToolbarButton,
useListToolbarButtonState,
} from '@udecode/plate-list';
import { Icons } from '@/components/icons';
import { ToolbarButton } from './toolbar';
export function ListToolbarButton({
nodeType = ELEMENT_UL,
}: {
nodeType?: string;
}) {
con... | 1,001 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/mark-toolbar-button.tsx | 'use client';
import React from 'react';
import {
useMarkToolbarButton,
useMarkToolbarButtonState,
} from '@udecode/plate-common';
import { ToolbarButton, ToolbarButtonProps } from './toolbar';
export interface MarkToolbarButtonProps
extends Pick<ToolbarButtonProps, 'tooltip' | 'children'> {
nodeType: string... | 1,002 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/media-embed-element.tsx | import React from 'react';
import { PlateElement, PlateElementProps, Value } from '@udecode/plate-common';
import {
ELEMENT_MEDIA_EMBED,
parseTwitterUrl,
parseVideoUrl,
TMediaEmbedElement,
useMediaState,
} from '@udecode/plate-media';
import { useResizableStore } from '@udecode/plate-resizable';
import LiteYo... | 1,003 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/media-popover.tsx | import React, { useEffect } from 'react';
import {
isCollapsed,
useEditorState,
useElement,
useRemoveNodeButton,
} from '@udecode/plate-common';
import {
floatingMediaActions,
FloatingMedia as FloatingMediaPrimitive,
useFloatingMediaSelectors,
} from '@udecode/plate-media';
import { useReadOnly, useSelect... | 1,004 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/media-toolbar-button.tsx | import React from 'react';
import {
ELEMENT_IMAGE,
ELEMENT_MEDIA_EMBED,
useMediaToolbarButton,
} from '@udecode/plate-media';
import { Icons } from '@/components/icons';
import { ToolbarButton } from './toolbar';
export function MediaToolbarButton({
nodeType,
}: {
nodeType?: typeof ELEMENT_IMAGE | typeof E... | 1,005 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/mention-combobox.tsx | import React from 'react';
import { ComboboxProps, Data, NoData } from '@udecode/plate-combobox';
import { getPluginOptions, useEditorRef } from '@udecode/plate-common';
import {
ELEMENT_MENTION,
getMentionOnSelectItem,
MentionPlugin,
} from '@udecode/plate-mention';
import { Combobox } from './combobox';
expor... | 1,006 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/mention-element.tsx | import React, { forwardRef } from 'react';
import {
getHandler,
PlateElement,
PlateElementProps,
Value,
} from '@udecode/plate-common';
import { TMentionElement } from '@udecode/plate-mention';
import { useFocused, useSelected } from 'slate-react';
import { cn } from '@/lib/utils';
export interface MentionEle... | 1,007 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/mention-input-element.tsx | import React from 'react';
import {
getHandler,
PlateElement,
PlateElementProps,
Value,
} from '@udecode/plate-common';
import { TMentionElement } from '@udecode/plate-mention';
import { useFocused, useSelected } from 'slate-react';
import { cn } from '@/lib/utils';
export interface MentionInputElementProps
... | 1,008 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/mode-dropdown-menu.tsx | import React from 'react';
import { DropdownMenuProps } from '@radix-ui/react-dropdown-menu';
import {
focusEditor,
useEditorReadOnly,
useEditorState,
usePlateStore,
} from '@udecode/plate-common';
import { Icons } from '@/components/icons';
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuRadioG... | 1,009 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/more-dropdown-menu.tsx | import React from 'react';
import { DropdownMenuProps } from '@radix-ui/react-dropdown-menu';
import { MARK_SUBSCRIPT, MARK_SUPERSCRIPT } from '@udecode/plate-basic-marks';
import { focusEditor, toggleMark, useEditorState } from '@udecode/plate-common';
import { Icons } from '@/components/icons';
import {
DropdownM... | 1,010 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/outdent-toolbar-button.tsx | import React from 'react';
import { useOutdentButton } from '@udecode/plate-indent';
import { Icons } from '@/components/icons';
import { ToolbarButton } from './toolbar';
export function OutdentToolbarButton() {
const { props } = useOutdentButton();
return (
<ToolbarButton tooltip="Outdent" {...props}>
... | 1,011 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/paragraph-element.tsx | import React from 'react';
import { PlateElement, PlateElementProps } from '@udecode/plate-common';
import { cn } from '@/lib/utils';
const ParagraphElement = React.forwardRef<
React.ElementRef<typeof PlateElement>,
PlateElementProps
>(({ className, children, ...props }: PlateElementProps, ref) => {
return (
... | 1,012 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/placeholder.tsx | import React from 'react';
import {
createNodeHOC,
createNodesHOC,
PlaceholderProps,
usePlaceholderState,
} from '@udecode/plate-common';
import { ELEMENT_H1 } from '@udecode/plate-heading';
import { ELEMENT_PARAGRAPH } from '@udecode/plate-paragraph';
import { cn } from '@/lib/utils';
export const Placeholde... | 1,013 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/popover.tsx | 'use client';
import * as React from 'react';
import * as PopoverPrimitive from '@radix-ui/react-popover';
import { cva } from 'class-variance-authority';
import { cn } from '@/lib/utils';
const Popover = PopoverPrimitive.Root;
const PopoverTrigger = PopoverPrimitive.Trigger;
const PopoverAnchor = PopoverPrimitive.... | 1,014 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/resizable.tsx | 'use client';
import React, { ComponentProps } from 'react';
import {
Resizable as ResizablePrimitive,
ResizeHandle as ResizeHandlePrimitive,
} from '@udecode/plate-resizable';
import { cva, VariantProps } from 'class-variance-authority';
import { cn } from '@/lib/utils';
export const mediaResizeHandleVariants =... | 1,015 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/search-highlight-leaf.tsx | import React from 'react';
import { PlateLeaf, PlateLeafProps } from '@udecode/plate-common';
import { cn } from '@/lib/utils';
export function SearchHighlightLeaf({ className, ...props }: PlateLeafProps) {
return <PlateLeaf className={cn('bg-yellow-100', className)} {...props} />;
}
| 1,016 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/separator.tsx | 'use client';
import * as React from 'react';
import * as SeparatorPrimitive from '@radix-ui/react-separator';
import { cn } from '@/lib/utils';
const Separator = React.forwardRef<
React.ElementRef<typeof SeparatorPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
>(
(
{ classN... | 1,017 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/table-cell-element.tsx | import React from 'react';
import { PlateElement, PlateElementProps, Value } from '@udecode/plate-common';
import {
TTableCellElement,
useTableCellElement,
useTableCellElementResizable,
useTableCellElementResizableState,
useTableCellElementState,
} from '@udecode/plate-table';
import { cn } from '@/lib/utils... | 1,018 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/table-dropdown-menu.tsx | import React from 'react';
import { DropdownMenuProps } from '@radix-ui/react-dropdown-menu';
import { focusEditor, someNode, useEditorState } from '@udecode/plate-common';
import {
deleteColumn,
deleteRow,
deleteTable,
ELEMENT_TABLE,
insertTable,
insertTableColumn,
insertTableRow,
} from '@udecode/plate-... | 1,019 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/table-element.tsx | import React, { forwardRef } from 'react';
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
import { PopoverAnchor, PopoverContentProps } from '@radix-ui/react-popover';
import {
isCollapsed,
PlateElement,
PlateElementProps,
useEditorState,
useElement,
useRemoveNodeButton,
} from '@ud... | 1,020 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/table-row-element.tsx | import React from 'react';
import { PlateElement, PlateElementProps } from '@udecode/plate-common';
import { cn } from '@/lib/utils';
export interface PlateTableRowElementProps extends PlateElementProps {
hideBorder?: boolean;
}
const TableRowElement = React.forwardRef<
React.ElementRef<typeof PlateElement>,
P... | 1,021 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/todo-list-element.tsx | import React from 'react';
import { PlateElement, PlateElementProps, Value } from '@udecode/plate-common';
import {
TTodoListItemElement,
useTodoListElement,
useTodoListElementState,
} from '@udecode/plate-list';
import { cn } from '@/lib/utils';
import { Checkbox } from './checkbox';
export type TodoListEleme... | 1,022 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/toggle.tsx | 'use client';
import * as React from 'react';
import * as TogglePrimitive from '@radix-ui/react-toggle';
import { cva, VariantProps } from 'class-variance-authority';
import { cn } from '@/lib/utils';
const toggleVariants = cva(
cn(
'inline-flex items-center justify-center rounded-md text-sm font-medium ring-o... | 1,023 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/toolbar.tsx | 'use client';
import * as React from 'react';
import { ReactNode } from 'react';
import * as ToolbarPrimitive from '@radix-ui/react-toolbar';
import { cva, VariantProps } from 'class-variance-authority';
import { cn } from '@/lib/utils';
import { Icons } from '@/components/icons';
import { Separator } from './separa... | 1,024 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/tooltip.tsx | 'use client';
import * as React from 'react';
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
import { cn } from '@/lib/utils';
const TooltipProvider = TooltipPrimitive.Provider;
const Tooltip = TooltipPrimitive.Root;
const TooltipTrigger = TooltipPrimitive.Trigger;
const TooltipPortal = TooltipPrimi... | 1,025 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/turn-into-dropdown-menu.tsx | import React from 'react';
import { DropdownMenuProps } from '@radix-ui/react-dropdown-menu';
import { ELEMENT_BLOCKQUOTE } from '@udecode/plate-block-quote';
import {
collapseSelection,
findNode,
focusEditor,
isBlock,
isCollapsed,
TElement,
toggleNodeType,
useEditorState,
} from '@udecode/plate-common'... | 1,026 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/plate-ui/with-draggables.tsx | import { FC } from 'react';
import { ELEMENT_BLOCKQUOTE } from '@udecode/plate-block-quote';
import { ELEMENT_CODE_BLOCK } from '@udecode/plate-code-block';
import { createNodesWithHOC } from '@udecode/plate-common';
import {
WithDraggableOptions,
withDraggable as withDraggablePrimitive,
} from '@udecode/plate-dnd'... | 1,027 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/site/main-nav.tsx | import * as React from 'react';
import Link from 'next/link';
import { NavItem } from '@/types/nav';
import { siteConfig } from '@/config/site';
import { cn } from '@/lib/utils';
import { Icons } from '@/components/icons';
interface MainNavProps {
items?: NavItem[];
}
export function MainNav({ items }: MainNavProp... | 1,028 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/site/site-header.tsx | import Link from 'next/link';
import { siteConfig } from '@/config/site';
import { Icons } from '@/components/icons';
import { buttonVariants } from '@/components/plate-ui/button';
import { MainNav } from '@/components/site/main-nav';
import { ThemeToggle } from '@/components/site/theme-toggle';
export function SiteH... | 1,029 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/site/tailwind-indicator.tsx | export function TailwindIndicator() {
if (process.env.NODE_ENV === 'production') return null;
return (
<div className="fixed bottom-1 left-1 z-50 flex h-6 w-6 items-center justify-center rounded-full bg-gray-800 p-3 font-mono text-xs text-white">
<div className="block sm:hidden">xs</div>
<div class... | 1,030 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/site/theme-provider.tsx | 'use client';
import * as React from 'react';
import { ThemeProvider as NextThemesProvider } from 'next-themes';
import { ThemeProviderProps } from 'next-themes/dist/types';
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
return <NextThemesProvider {...props}>{children}</NextThemesProvid... | 1,031 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/components | petrpan-code/udecode/plate/templates/plate-playground-template/src/components/site/theme-toggle.tsx | 'use client';
import * as React from 'react';
import { useTheme } from 'next-themes';
import { Icons } from '@/components/icons';
import { Button } from '@/components/plate-ui/button';
export function ThemeToggle() {
const { setTheme, theme } = useTheme();
return (
<Button
variant="ghost"
size="... | 1,032 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src | petrpan-code/udecode/plate/templates/plate-playground-template/src/config/site.ts | export type SiteConfig = typeof siteConfig;
export const siteConfig = {
name: 'Next.js',
description:
'Rich-text editor components built with Radix UI and Tailwind CSS.',
mainNav: [
{
title: 'Home',
href: '/',
},
],
links: {
twitter: 'https://twitter.com/zbeyens',
github: 'htt... | 1,033 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src | petrpan-code/udecode/plate/templates/plate-playground-template/src/lib/fonts.ts | import {
JetBrains_Mono as FontMono,
Inter as FontSans,
} from 'next/font/google';
export const fontSans = FontSans({
subsets: ['latin'],
variable: '--font-sans',
});
export const fontMono = FontMono({
subsets: ['latin'],
variable: '--font-mono',
});
| 1,034 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src | petrpan-code/udecode/plate/templates/plate-playground-template/src/lib/utils.ts | import { clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
import type { ClassValue } from 'clsx';
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
| 1,035 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/lib | petrpan-code/udecode/plate/templates/plate-playground-template/src/lib/plate/autoformatBlocks.ts | import { AutoformatRule } from '@udecode/plate-autoformat';
import { ELEMENT_BLOCKQUOTE } from '@udecode/plate-block-quote';
import {
ELEMENT_CODE_BLOCK,
insertEmptyCodeBlock,
} from '@udecode/plate-code-block';
import { ELEMENT_DEFAULT, insertNodes, setNodes } from '@udecode/plate-common';
import {
ELEMENT_H1,
... | 1,036 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/lib | petrpan-code/udecode/plate/templates/plate-playground-template/src/lib/plate/autoformatIndentLists.ts | import { AutoformatRule } from '@udecode/plate-autoformat';
import { ListStyleType, toggleIndentList } from '@udecode/plate-indent-list';
export const autoformatIndentLists: AutoformatRule[] = [
{
mode: 'block',
type: 'list',
match: ['* ', '- '],
format: (editor) => {
toggleIndentList(editor, {... | 1,037 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/lib | petrpan-code/udecode/plate/templates/plate-playground-template/src/lib/plate/autoformatLists.ts | import { AutoformatRule } from '@udecode/plate-autoformat';
import { isBlock, setNodes } from '@udecode/plate-common';
import {
ELEMENT_LI,
ELEMENT_OL,
ELEMENT_TODO_LI,
ELEMENT_UL,
TTodoListItemElement,
} from '@udecode/plate-list';
import { formatList, preFormat } from '@/lib/plate/autoformatUtils';
export... | 1,038 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/lib | petrpan-code/udecode/plate/templates/plate-playground-template/src/lib/plate/autoformatMarks.ts | import {
MARK_BOLD,
MARK_CODE,
MARK_ITALIC,
MARK_STRIKETHROUGH,
MARK_SUBSCRIPT,
MARK_SUPERSCRIPT,
MARK_UNDERLINE,
} from '@udecode/plate-basic-marks';
import { MARK_HIGHLIGHT } from '@udecode/plate-highlight';
import { MyAutoformatRule } from '@/lib/plate/plate-types';
export const autoformatMarks: MyAu... | 1,039 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/lib | petrpan-code/udecode/plate/templates/plate-playground-template/src/lib/plate/autoformatPlugin.ts | import { AutoformatPlugin } from '@udecode/plate-autoformat';
import { PlatePlugin } from '@udecode/plate-common';
import { autoformatRules } from '@/lib/plate/autoformatRules';
export const autoformatPlugin: Partial<PlatePlugin<AutoformatPlugin>> = {
options: {
rules: autoformatRules as any,
enableUndoOnDe... | 1,040 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/lib | petrpan-code/udecode/plate/templates/plate-playground-template/src/lib/plate/autoformatRules.ts | import {
autoformatArrow,
autoformatLegal,
autoformatLegalHtml,
autoformatMath,
autoformatPunctuation,
autoformatSmartQuotes,
} from '@udecode/plate-autoformat';
import { autoformatBlocks } from '@/lib/plate/autoformatBlocks';
import { autoformatIndentLists } from '@/lib/plate/autoformatIndentLists';
impor... | 1,041 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/lib | petrpan-code/udecode/plate/templates/plate-playground-template/src/lib/plate/autoformatUtils.ts | import { AutoformatBlockRule } from '@udecode/plate-autoformat';
import {
ELEMENT_CODE_BLOCK,
ELEMENT_CODE_LINE,
} from '@udecode/plate-code-block';
import {
getParentNode,
isElement,
isType,
PlateEditor,
} from '@udecode/plate-common';
import { toggleList, unwrapList } from '@udecode/plate-list';
export c... | 1,042 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/lib | petrpan-code/udecode/plate/templates/plate-playground-template/src/lib/plate/comments.ts | export const commentsUsers = {
1: {
id: '1',
name: 'zbeyens',
avatarUrl: 'https://avatars.githubusercontent.com/u/19695832?s=96&v=4',
},
};
export const myUserId = '1';
| 1,043 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/lib | petrpan-code/udecode/plate/templates/plate-playground-template/src/lib/plate/dragOverCursorPlugin.ts | import { findEventRange, PlatePlugin } from '@udecode/plate-common';
import { cursorStore } from '@/components/plate-ui/cursor-overlay';
export const KEY_DRAG_OVER_CURSOR = 'dragOverCursor';
export const dragOverCursorPlugin: PlatePlugin = {
key: KEY_DRAG_OVER_CURSOR,
handlers: {
onDragOver: (editor) => (eve... | 1,044 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/lib | petrpan-code/udecode/plate/templates/plate-playground-template/src/lib/plate/mentionables.ts | import { TComboboxItem } from '@udecode/plate-combobox';
export const MENTIONABLES: TComboboxItem[] = [
{ key: '0', text: 'Aayla Secura' },
{ key: '1', text: 'Adi Gallia' },
{
key: '2',
text: 'Admiral Dodd Rancit',
},
{
key: '3',
text: 'Admiral Firmus Piett',
},
{
key: '4',
text: ... | 1,045 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/lib | petrpan-code/udecode/plate/templates/plate-playground-template/src/lib/plate/plate-plugins.ts | import { createAlignPlugin } from '@udecode/plate-alignment';
import { createAutoformatPlugin } from '@udecode/plate-autoformat';
import {
createBoldPlugin,
createCodePlugin,
createItalicPlugin,
createStrikethroughPlugin,
createSubscriptPlugin,
createSuperscriptPlugin,
createUnderlinePlugin,
MARK_BOLD,
... | 1,046 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src/lib | petrpan-code/udecode/plate/templates/plate-playground-template/src/lib/plate/plate-types.ts | import React from 'react';
import { AutoformatRule } from '@udecode/plate-autoformat';
import { ELEMENT_BLOCKQUOTE } from '@udecode/plate-block-quote';
import {
ELEMENT_CODE_BLOCK,
ELEMENT_CODE_LINE,
} from '@udecode/plate-code-block';
import { TCommentText } from '@udecode/plate-comments';
import {
createPlateEd... | 1,047 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src | petrpan-code/udecode/plate/templates/plate-playground-template/src/styles/globals.css | @tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
:root {
--background: 0 0% 100%;
--foreground: 222.2 84% 4.9%;
--muted: 210 40% 96.1%;
--muted-foreground: 215.4 16.3% 46.9%;
--popover: 0 0% 100%;
--popover-foreground: 222.2 84% 4.9%;
--card: 0 0% 100%;
--ca... | 1,048 |
0 | petrpan-code/udecode/plate/templates/plate-playground-template/src | petrpan-code/udecode/plate/templates/plate-playground-template/src/types/nav.ts | export interface NavItem {
title: string;
href?: string;
disabled?: boolean;
external?: boolean;
}
| 1,049 |
0 | petrpan-code/udecode/plate/templates | petrpan-code/udecode/plate/templates/plate-template/.editorconfig | # editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
| 1,050 |
0 | petrpan-code/udecode/plate/templates | petrpan-code/udecode/plate/templates/plate-template/.eslintignore | dist/*
.cache
public
node_modules
*.esm.js
| 1,051 |
0 | petrpan-code/udecode/plate/templates | petrpan-code/udecode/plate/templates/plate-template/.eslintrc.js | const prettierConfig = require('./prettier.config.js');
module.exports = {
$schema: 'https://json.schemastore.org/eslintrc',
root: true,
extends: [
'next/core-web-vitals',
'prettier',
'plugin:tailwindcss/recommended',
],
plugins: ['tailwindcss', 'unused-imports', 'prettier'],
rules: {
'@nex... | 1,052 |
0 | petrpan-code/udecode/plate/templates | petrpan-code/udecode/plate/templates/plate-template/.prettierignore | cache
.cache
package.json
package-lock.json
public
CHANGELOG.md
.yarn
dist
node_modules
.next
build
.contentlayer | 1,053 |
0 | petrpan-code/udecode/plate/templates | petrpan-code/udecode/plate/templates/plate-template/LICENSE | The MIT License (MIT)
Copyright (c) Ziad Beyens, Dylan Schiemann, Joe Anderson, shadcn
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights... | 1,054 |
0 | petrpan-code/udecode/plate/templates | petrpan-code/udecode/plate/templates/plate-template/README.md | # Playground Template
A minimal template for building rich-text editors with [Plate](https://platejs.org/) and Next.js 13.
## Usage
```bash
pnpm create next-app -e https://github.com/udecode/plate-template
```
## Features
- Next.js 13 App Directory
- [Plate](https://platejs.org/) Editor
- [shadcn/ui](https://ui.sh... | 1,055 |
0 | petrpan-code/udecode/plate/templates | petrpan-code/udecode/plate/templates/plate-template/components.json | {
"$schema": "https://platejs.org/schema.json",
"style": "default",
"rsc": true,
"tailwind": {
"config": "tailwind.config.js",
"css": "src/styles/globals.css",
"baseColor": "slate",
"cssVariables": true
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils"
}
} | 1,056 |
0 | petrpan-code/udecode/plate/templates | petrpan-code/udecode/plate/templates/plate-template/next-env.d.ts | /// <reference types="next" />
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
| 1,057 |
0 | petrpan-code/udecode/plate/templates | petrpan-code/udecode/plate/templates/plate-template/next.config.mjs | /** @type {import('next').NextConfig} */
const nextConfig = {};
export default nextConfig;
| 1,058 |
0 | petrpan-code/udecode/plate/templates | petrpan-code/udecode/plate/templates/plate-template/package.json | {
"name": "plate-template",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"lint:fix": "next lint --fix",
"preview": "next build && next start",
"typecheck": "tsc --noEmit"
},
"dependencies":... | 1,059 |
0 | petrpan-code/udecode/plate/templates | petrpan-code/udecode/plate/templates/plate-template/pnpm-lock.yaml | lockfileVersion: '6.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
dependencies:
'@radix-ui/react-slot':
specifier: ^1.0.2
version: 1.0.2(@types/react@18.2.21)(react@18.2.0)
'@radix-ui/react-tooltip':
specifier: ^1.0.6
version: 1.0.6(@types/react-dom@18.2.7)(@types/react@1... | 1,060 |
0 | petrpan-code/udecode/plate/templates | petrpan-code/udecode/plate/templates/plate-template/postcss.config.js | module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
| 1,061 |
0 | petrpan-code/udecode/plate/templates | petrpan-code/udecode/plate/templates/plate-template/prettier.config.js | /** @type {import('prettier').Config} */
module.exports = {
endOfLine: 'lf',
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'es5',
importOrder: [
'^(react/(.*)$)|^(react$)',
'^(next/(.*)$)|^(next$)',
'<THIRD_PARTY_MODULES>',
'',
'^types$',
'^@/types/(.*)$',
'^@/config... | 1,062 |
0 | petrpan-code/udecode/plate/templates | petrpan-code/udecode/plate/templates/plate-template/tailwind.config.js | const { fontFamily } = require('tailwindcss/defaultTheme');
/** @type {import('tailwindcss').Config} */
module.exports = {
darkMode: ['class'],
content: ['src/**/*.{ts,tsx}'],
theme: {
container: {
center: true,
padding: '2rem',
screens: {
'2xl': '1400px',
},
},
extend... | 1,063 |
0 | petrpan-code/udecode/plate/templates | petrpan-code/udecode/plate/templates/plate-template/tsconfig.json | {
"compilerOptions": {
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"incremental": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"r... | 1,064 |
0 | petrpan-code/udecode/plate/templates/plate-template | petrpan-code/udecode/plate/templates/plate-template/public/next.svg | <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="... | 1,065 |
0 | petrpan-code/udecode/plate/templates/plate-template | petrpan-code/udecode/plate/templates/plate-template/public/thirteen.svg | <svg xmlns="http://www.w3.org/2000/svg" width="40" height="31" fill="none"><g opacity=".9"><path fill="url(#a)" d="M13 .4v29.3H7V6.3h-.2L0 10.5V5L7.2.4H13Z"/><path fill="url(#b)" d="M28.8 30.1c-2.2 0-4-.3-5.7-1-1.7-.8-3-1.8-4-3.1a7.7 7.7 0 0 1-1.4-4.6h6.2c0 .8.3 1.4.7 2 .4.5 1 .9 1.7 1.2.7.3 1.6.4 2.5.4 1 0 1.7-.2 2.5-... | 1,066 |
0 | petrpan-code/udecode/plate/templates/plate-template | petrpan-code/udecode/plate/templates/plate-template/public/vercel.svg | <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 283 64"><path fill="black" d="M141 16c-11 0-19 7-19 18s9 18 20 18c7 0 13-3 16-7l-7-5c-2 3-6 4-9 4-5 0-9-3-10-7h28v-3c0-11-8-18-19-18zm-9 15c1-4 4-7 9-7s8 3 9 7h-18zm117-15c-11 0-19 7-19 18s9 18 20 18c6 0 12-3 16-7l-8-5c-2 3-5 4-8 4-5 0-9-3-11-7h28l1-3c0-1... | 1,067 |
0 | petrpan-code/udecode/plate/templates/plate-template/src | petrpan-code/udecode/plate/templates/plate-template/src/app/layout.tsx | import { siteConfig } from '@/config/site';
import { fontSans } from '@/lib/fonts';
import { cn } from '@/lib/utils';
import { TooltipProvider } from '@/components/plate-ui/tooltip';
import { SiteHeader } from '@/components/site/site-header';
import { TailwindIndicator } from '@/components/site/tailwind-indicator';
imp... | 1,068 |
0 | petrpan-code/udecode/plate/templates/plate-template/src | petrpan-code/udecode/plate/templates/plate-template/src/app/page.tsx | import Link from 'next/link';
import { siteConfig } from '@/config/site';
import { PlateEditor } from '@/components/plate-editor';
import { buttonVariants } from '@/components/plate-ui/button';
export default function IndexPage() {
return (
<section className="container grid items-center gap-6 pb-8 pt-6 md:py-1... | 1,069 |
0 | petrpan-code/udecode/plate/templates/plate-template/src | petrpan-code/udecode/plate/templates/plate-template/src/components/icons.tsx | import React from 'react';
import { cva } from 'class-variance-authority';
import {
AlignCenter,
AlignJustify,
AlignLeft,
AlignRight,
Baseline,
Bold,
Check,
ChevronDown,
ChevronRight,
ChevronsUpDown,
Code2,
Edit2,
ExternalLink,
Eye,
FileCode,
GripVertical,
Heading1,
Heading2,
Headi... | 1,070 |
0 | petrpan-code/udecode/plate/templates/plate-template/src | petrpan-code/udecode/plate/templates/plate-template/src/components/plate-editor.tsx | 'use client';
import { createPlugins, Plate } from '@udecode/plate-common';
import { Editor } from '@/components/plate-ui/editor';
const plugins = createPlugins([], {
components: {},
});
const initialValue = [
{
id: 1,
type: 'p',
children: [{ text: '' }],
},
];
export function PlateEditor() {
r... | 1,071 |
0 | petrpan-code/udecode/plate/templates/plate-template/src/components | petrpan-code/udecode/plate/templates/plate-template/src/components/plate-ui/button.tsx | import * as React from 'react';
import { Slot } from '@radix-ui/react-slot';
import { cva, VariantProps } from 'class-variance-authority';
import { cn } from '@/lib/utils';
const buttonVariants = cva(
'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background tr... | 1,072 |
0 | petrpan-code/udecode/plate/templates/plate-template/src/components | petrpan-code/udecode/plate/templates/plate-template/src/components/plate-ui/editor.tsx | import React from 'react';
import { PlateContent } from '@udecode/plate-common';
import { cva } from 'class-variance-authority';
import { cn } from '@/lib/utils';
import type { PlateContentProps } from '@udecode/plate-common';
import type { VariantProps } from 'class-variance-authority';
const editorVariants = cva(
... | 1,073 |
0 | petrpan-code/udecode/plate/templates/plate-template/src/components | petrpan-code/udecode/plate/templates/plate-template/src/components/plate-ui/tooltip.tsx | 'use client';
import * as React from 'react';
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
import { cn } from '@/lib/utils';
const TooltipProvider = TooltipPrimitive.Provider;
const Tooltip = TooltipPrimitive.Root;
const TooltipTrigger = TooltipPrimitive.Trigger;
const TooltipPortal = TooltipPrimi... | 1,074 |
0 | petrpan-code/udecode/plate/templates/plate-template/src/components | petrpan-code/udecode/plate/templates/plate-template/src/components/site/main-nav.tsx | import * as React from 'react';
import Link from 'next/link';
import { NavItem } from '@/types/nav';
import { siteConfig } from '@/config/site';
import { cn } from '@/lib/utils';
import { Icons } from '@/components/icons';
interface MainNavProps {
items?: NavItem[];
}
export function MainNav({ items }: MainNavProp... | 1,075 |
0 | petrpan-code/udecode/plate/templates/plate-template/src/components | petrpan-code/udecode/plate/templates/plate-template/src/components/site/site-header.tsx | import Link from 'next/link';
import { siteConfig } from '@/config/site';
import { Icons } from '@/components/icons';
import { buttonVariants } from '@/components/plate-ui/button';
import { MainNav } from '@/components/site/main-nav';
import { ThemeToggle } from '@/components/site/theme-toggle';
export function SiteH... | 1,076 |
0 | petrpan-code/udecode/plate/templates/plate-template/src/components | petrpan-code/udecode/plate/templates/plate-template/src/components/site/tailwind-indicator.tsx | export function TailwindIndicator() {
if (process.env.NODE_ENV === 'production') return null;
return (
<div className="fixed bottom-1 left-1 z-50 flex h-6 w-6 items-center justify-center rounded-full bg-gray-800 p-3 font-mono text-xs text-white">
<div className="block sm:hidden">xs</div>
<div class... | 1,077 |
0 | petrpan-code/udecode/plate/templates/plate-template/src/components | petrpan-code/udecode/plate/templates/plate-template/src/components/site/theme-provider.tsx | 'use client';
import * as React from 'react';
import { ThemeProvider as NextThemesProvider } from 'next-themes';
import { ThemeProviderProps } from 'next-themes/dist/types';
export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
return <NextThemesProvider {...props}>{children}</NextThemesProvid... | 1,078 |
0 | petrpan-code/udecode/plate/templates/plate-template/src/components | petrpan-code/udecode/plate/templates/plate-template/src/components/site/theme-toggle.tsx | 'use client';
import * as React from 'react';
import { useTheme } from 'next-themes';
import { Icons } from '@/components/icons';
import { Button } from '@/components/plate-ui/button';
export function ThemeToggle() {
const { setTheme, theme } = useTheme();
return (
<Button
variant="ghost"
size="... | 1,079 |
0 | petrpan-code/udecode/plate/templates/plate-template/src | petrpan-code/udecode/plate/templates/plate-template/src/config/site.ts | export type SiteConfig = typeof siteConfig;
export const siteConfig = {
name: 'Next.js',
description:
'Rich-text editor components built with Radix UI and Tailwind CSS.',
mainNav: [
{
title: 'Home',
href: '/',
},
],
links: {
twitter: 'https://twitter.com/zbeyens',
github: 'htt... | 1,080 |
0 | petrpan-code/udecode/plate/templates/plate-template/src | petrpan-code/udecode/plate/templates/plate-template/src/lib/fonts.ts | import {
JetBrains_Mono as FontMono,
Inter as FontSans,
} from 'next/font/google';
export const fontSans = FontSans({
subsets: ['latin'],
variable: '--font-sans',
});
export const fontMono = FontMono({
subsets: ['latin'],
variable: '--font-mono',
});
| 1,081 |
0 | petrpan-code/udecode/plate/templates/plate-template/src | petrpan-code/udecode/plate/templates/plate-template/src/lib/utils.ts | import { clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
import type { ClassValue } from 'clsx';
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
| 1,082 |
0 | petrpan-code/udecode/plate/templates/plate-template/src | petrpan-code/udecode/plate/templates/plate-template/src/styles/globals.css | @tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
:root {
--background: 0 0% 100%;
--foreground: 222.2 84% 4.9%;
--muted: 210 40% 96.1%;
--muted-foreground: 215.4 16.3% 46.9%;
--popover: 0 0% 100%;
--popover-foreground: 222.2 84% 4.9%;
--card: 0 0% 100%;
... | 1,083 |
0 | petrpan-code/udecode/plate/templates/plate-template/src | petrpan-code/udecode/plate/templates/plate-template/src/types/nav.ts | export interface NavItem {
title: string;
href?: string;
disabled?: boolean;
external?: boolean;
}
| 1,084 |
0 | petrpan-code/thebuilder | petrpan-code/thebuilder/react-intersection-observer/.eslintignore | .idea
node_modules
# production
/build
/dist
/storybook/storybook-static
| 1,085 |
0 | petrpan-code/thebuilder | petrpan-code/thebuilder/react-intersection-observer/.eslintrc.js | /**
* Based on: eslint-config-react-app
* */
module.exports = {
env: {
browser: true,
commonjs: true,
es6: true,
node: true,
},
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
settings: {
react: {
version: 'detect',
... | 1,086 |
0 | petrpan-code/thebuilder | petrpan-code/thebuilder/react-intersection-observer/.npmignore | # Mac OSX Files
.DS_Store
.Trashes
.LSOverride
# Node Modules
node_modules
npm-debug.log
# General Files
.sass-cache
.hg
.idea
.svn
.cache
.project
.tmp
.eslintignore
.flowconfig
.editorconfig
storybook/.storybook
pnpm-lock.yaml
# Project files
coverage
storybook/stories
tests
example
jest-setup.js
__tests__ | 1,087 |
0 | petrpan-code/thebuilder | petrpan-code/thebuilder/react-intersection-observer/.prettierignore | dist/
lib/
example/
package.json
coverage | 1,088 |
0 | petrpan-code/thebuilder | petrpan-code/thebuilder/react-intersection-observer/CONTRIBUTING.md | # Contribution Guidelines
Welcome to `react-intersection-observer`! I'm thrilled that you're interested in
contributing. Here are some guidelines to help you get started.
The codebase is written in TypeScript, and split into two packages using PNPM
workspaces:
- `react-intersection-observer` - The main package, whic... | 1,089 |
0 | petrpan-code/thebuilder | petrpan-code/thebuilder/react-intersection-observer/LICENSE | The MIT License (MIT)
Copyright (c) 2023 React Intersection Observer authors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, c... | 1,090 |
0 | petrpan-code/thebuilder | petrpan-code/thebuilder/react-intersection-observer/README.md | # react-intersection-observer
[![Version Badge][npm-version-svg]][package-url]
[![GZipped size][npm-minzip-svg]][bundlephobia-url]
[![Test][test-image]][test-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
React implementation of the
[Intersection Observer API](https://dev... | 1,091 |
0 | petrpan-code/thebuilder | petrpan-code/thebuilder/react-intersection-observer/package.json | {
"name": "react-intersection-observer",
"version": "8.26.1",
"description": "Monitor if a component is inside the viewport, using IntersectionObserver API",
"source": "./src/index.tsx",
"main": "./dist/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/index.d.ts",
"exports": {
"./test-ut... | 1,092 |
0 | petrpan-code/thebuilder | petrpan-code/thebuilder/react-intersection-observer/pnpm-lock.yaml | lockfileVersion: '6.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
importers:
.:
devDependencies:
'@size-limit/preset-small-lib':
specifier: ^8.2.4
version: 8.2.4(size-limit@8.2.4)
'@testing-library/jest-dom':
specifier: ^5.16.5
version: 5.16... | 1,093 |
0 | petrpan-code/thebuilder | petrpan-code/thebuilder/react-intersection-observer/pnpm-workspace.yaml | packages:
- 'storybook'
- '.' | 1,094 |
0 | petrpan-code/thebuilder | petrpan-code/thebuilder/react-intersection-observer/tsconfig.json | {
"compilerOptions": {
"module": "esnext",
"target": "ESNext",
"lib": ["es6", "es7", "esnext", "dom"],
"types": ["vitest/globals", "@types/jest"],
"jsx": "react",
"moduleResolution": "node",
"noImplicitReturns": true,
"strict": true,
"strictFunctionTypes": true,
"noUnusedLocals... | 1,095 |
0 | petrpan-code/thebuilder | petrpan-code/thebuilder/react-intersection-observer/tsconfig.test.json | {
"extends": "./tsconfig",
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"declaration": true,
"emitDeclarationOnly": false,
"outDir": "dist",
"noEmit": false
},
"files": ["src/test-utils.ts"]
}
| 1,096 |
0 | petrpan-code/thebuilder | petrpan-code/thebuilder/react-intersection-observer/tsup.config.ts | import { defineConfig } from 'tsup';
export default defineConfig({
minify: false,
sourcemap: true,
dts: true,
clean: true,
target: 'es2018',
external: ['react'],
format: ['esm', 'cjs'],
});
| 1,097 |
0 | petrpan-code/thebuilder | petrpan-code/thebuilder/react-intersection-observer/vitest.config.js | import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
environment: 'jsdom',
globals: true,
},
});
| 1,098 |
0 | petrpan-code/thebuilder/react-intersection-observer | petrpan-code/thebuilder/react-intersection-observer/.codesandbox/ci.json | {
"sandboxes": [
"useinview-ud2vo",
"inview-render-props-hvhcb",
"inview-plain-children-vv51y"
],
"publishDirectory": {
"react-intersection-observer": "dist"
},
"node": "18"
}
| 1,099 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.