doclific 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +17 -0
- package/dist/bin/doclific.js +36 -8
- package/package.json +11 -4
- package/readme.md +77 -0
- package/.gitattributes +0 -2
- package/.prettierignore +0 -5
- package/.prettierrc +0 -9
- package/.vscode/settings.json +0 -13
- package/frontend/components.json +0 -24
- package/frontend/eslint.config.js +0 -23
- package/frontend/index.html +0 -25
- package/frontend/package-lock.json +0 -15754
- package/frontend/public/logo.svg +0 -1
- package/frontend/src/App.tsx +0 -21
- package/frontend/src/components/app-sidebar.tsx +0 -393
- package/frontend/src/components/editor/editor-base-kit.tsx +0 -43
- package/frontend/src/components/editor/editor-kit.tsx +0 -93
- package/frontend/src/components/editor/plugins/align-base-kit.tsx +0 -16
- package/frontend/src/components/editor/plugins/align-kit.tsx +0 -18
- package/frontend/src/components/editor/plugins/autoformat-kit.tsx +0 -236
- package/frontend/src/components/editor/plugins/basic-blocks-base-kit.tsx +0 -35
- package/frontend/src/components/editor/plugins/basic-blocks-kit.tsx +0 -88
- package/frontend/src/components/editor/plugins/basic-marks-base-kit.tsx +0 -27
- package/frontend/src/components/editor/plugins/basic-marks-kit.tsx +0 -41
- package/frontend/src/components/editor/plugins/basic-nodes-kit.tsx +0 -6
- package/frontend/src/components/editor/plugins/block-menu-kit.tsx +0 -14
- package/frontend/src/components/editor/plugins/block-placeholder-kit.tsx +0 -17
- package/frontend/src/components/editor/plugins/block-selection-kit.tsx +0 -32
- package/frontend/src/components/editor/plugins/callout-base-kit.tsx +0 -7
- package/frontend/src/components/editor/plugins/callout-kit.tsx +0 -7
- package/frontend/src/components/editor/plugins/code-block-base-kit.tsx +0 -23
- package/frontend/src/components/editor/plugins/code-block-kit.tsx +0 -26
- package/frontend/src/components/editor/plugins/codebase-kit.tsx +0 -23
- package/frontend/src/components/editor/plugins/column-base-kit.tsx +0 -11
- package/frontend/src/components/editor/plugins/column-kit.tsx +0 -10
- package/frontend/src/components/editor/plugins/comment-base-kit.tsx +0 -7
- package/frontend/src/components/editor/plugins/comment-kit.tsx +0 -97
- package/frontend/src/components/editor/plugins/cursor-overlay-kit.tsx +0 -13
- package/frontend/src/components/editor/plugins/date-base-kit.tsx +0 -5
- package/frontend/src/components/editor/plugins/date-kit.tsx +0 -7
- package/frontend/src/components/editor/plugins/discussion-kit.tsx +0 -148
- package/frontend/src/components/editor/plugins/dnd-kit.tsx +0 -28
- package/frontend/src/components/editor/plugins/docx-kit.tsx +0 -6
- package/frontend/src/components/editor/plugins/emoji-kit.tsx +0 -13
- package/frontend/src/components/editor/plugins/excalidraw-kit.tsx +0 -9
- package/frontend/src/components/editor/plugins/exit-break-kit.tsx +0 -12
- package/frontend/src/components/editor/plugins/floating-toolbar-kit.tsx +0 -19
- package/frontend/src/components/editor/plugins/font-base-kit.tsx +0 -20
- package/frontend/src/components/editor/plugins/font-kit.tsx +0 -29
- package/frontend/src/components/editor/plugins/indent-base-kit.tsx +0 -19
- package/frontend/src/components/editor/plugins/indent-kit.tsx +0 -22
- package/frontend/src/components/editor/plugins/line-height-base-kit.tsx +0 -14
- package/frontend/src/components/editor/plugins/line-height-kit.tsx +0 -16
- package/frontend/src/components/editor/plugins/link-base-kit.tsx +0 -5
- package/frontend/src/components/editor/plugins/link-kit.tsx +0 -15
- package/frontend/src/components/editor/plugins/list-base-kit.tsx +0 -23
- package/frontend/src/components/editor/plugins/list-kit.tsx +0 -26
- package/frontend/src/components/editor/plugins/markdown-kit.tsx +0 -46
- package/frontend/src/components/editor/plugins/math-base-kit.tsx +0 -11
- package/frontend/src/components/editor/plugins/math-kit.tsx +0 -13
- package/frontend/src/components/editor/plugins/media-base-kit.tsx +0 -31
- package/frontend/src/components/editor/plugins/media-kit.tsx +0 -43
- package/frontend/src/components/editor/plugins/mention-base-kit.tsx +0 -7
- package/frontend/src/components/editor/plugins/mention-kit.tsx +0 -15
- package/frontend/src/components/editor/plugins/slash-kit.tsx +0 -18
- package/frontend/src/components/editor/plugins/suggestion-base-kit.tsx +0 -7
- package/frontend/src/components/editor/plugins/suggestion-kit.tsx +0 -90
- package/frontend/src/components/editor/plugins/table-base-kit.tsx +0 -20
- package/frontend/src/components/editor/plugins/table-kit.tsx +0 -22
- package/frontend/src/components/editor/plugins/toc-base-kit.tsx +0 -5
- package/frontend/src/components/editor/plugins/toc-kit.tsx +0 -14
- package/frontend/src/components/editor/plugins/toggle-base-kit.tsx +0 -7
- package/frontend/src/components/editor/plugins/toggle-kit.tsx +0 -11
- package/frontend/src/components/editor/transforms.ts +0 -194
- package/frontend/src/components/markdown-to-slate-demo.tsx +0 -50
- package/frontend/src/components/mode-toggle.tsx +0 -15
- package/frontend/src/components/theme-provider.tsx +0 -73
- package/frontend/src/components/ui/alert-dialog.tsx +0 -155
- package/frontend/src/components/ui/align-toolbar-button.tsx +0 -84
- package/frontend/src/components/ui/avatar.tsx +0 -51
- package/frontend/src/components/ui/block-context-menu.tsx +0 -199
- package/frontend/src/components/ui/block-discussion.tsx +0 -365
- package/frontend/src/components/ui/block-draggable.tsx +0 -512
- package/frontend/src/components/ui/block-list-static.tsx +0 -80
- package/frontend/src/components/ui/block-list.tsx +0 -87
- package/frontend/src/components/ui/block-selection.tsx +0 -42
- package/frontend/src/components/ui/block-suggestion.tsx +0 -473
- package/frontend/src/components/ui/blockquote-node-static.tsx +0 -11
- package/frontend/src/components/ui/blockquote-node.tsx +0 -13
- package/frontend/src/components/ui/button.tsx +0 -62
- package/frontend/src/components/ui/calendar.tsx +0 -218
- package/frontend/src/components/ui/callout-node-static.tsx +0 -36
- package/frontend/src/components/ui/callout-node.tsx +0 -63
- package/frontend/src/components/ui/caption.tsx +0 -63
- package/frontend/src/components/ui/checkbox.tsx +0 -30
- package/frontend/src/components/ui/code-block-node-static.tsx +0 -35
- package/frontend/src/components/ui/code-block-node.tsx +0 -287
- package/frontend/src/components/ui/code-node-static.tsx +0 -15
- package/frontend/src/components/ui/code-node.tsx +0 -17
- package/frontend/src/components/ui/codebase-snippet-node.tsx +0 -237
- package/frontend/src/components/ui/column-node-static.tsx +0 -29
- package/frontend/src/components/ui/column-node.tsx +0 -317
- package/frontend/src/components/ui/command.tsx +0 -182
- package/frontend/src/components/ui/comment-node-static.tsx +0 -15
- package/frontend/src/components/ui/comment-node.tsx +0 -45
- package/frontend/src/components/ui/comment-toolbar-button.tsx +0 -24
- package/frontend/src/components/ui/comment.tsx +0 -618
- package/frontend/src/components/ui/context-menu.tsx +0 -250
- package/frontend/src/components/ui/cursor-overlay.tsx +0 -66
- package/frontend/src/components/ui/date-node-static.tsx +0 -45
- package/frontend/src/components/ui/date-node.tsx +0 -93
- package/frontend/src/components/ui/dialog.tsx +0 -143
- package/frontend/src/components/ui/dropdown-menu.tsx +0 -255
- package/frontend/src/components/ui/dynamic-icon.tsx +0 -12
- package/frontend/src/components/ui/editor-static.tsx +0 -53
- package/frontend/src/components/ui/editor.tsx +0 -130
- package/frontend/src/components/ui/emoji-node.tsx +0 -69
- package/frontend/src/components/ui/emoji-toolbar-button.tsx +0 -628
- package/frontend/src/components/ui/equation-node-static.tsx +0 -98
- package/frontend/src/components/ui/equation-node.tsx +0 -235
- package/frontend/src/components/ui/equation-toolbar-button.tsx +0 -25
- package/frontend/src/components/ui/excalidraw-node.tsx +0 -36
- package/frontend/src/components/ui/export-toolbar-button.tsx +0 -174
- package/frontend/src/components/ui/file-selector.tsx +0 -339
- package/frontend/src/components/ui/floating-toolbar-buttons.tsx +0 -73
- package/frontend/src/components/ui/floating-toolbar.tsx +0 -85
- package/frontend/src/components/ui/font-color-toolbar-button.tsx +0 -831
- package/frontend/src/components/ui/font-size-toolbar-button.tsx +0 -152
- package/frontend/src/components/ui/heading-node-static.tsx +0 -68
- package/frontend/src/components/ui/heading-node.tsx +0 -58
- package/frontend/src/components/ui/highlight-node-static.tsx +0 -11
- package/frontend/src/components/ui/highlight-node.tsx +0 -13
- package/frontend/src/components/ui/history-toolbar-button.tsx +0 -50
- package/frontend/src/components/ui/hr-node-static.tsx +0 -20
- package/frontend/src/components/ui/hr-node.tsx +0 -33
- package/frontend/src/components/ui/import-toolbar-button.tsx +0 -97
- package/frontend/src/components/ui/indent-toolbar-button.tsx +0 -30
- package/frontend/src/components/ui/inline-combobox.tsx +0 -414
- package/frontend/src/components/ui/input.tsx +0 -21
- package/frontend/src/components/ui/insert-toolbar-button.tsx +0 -254
- package/frontend/src/components/ui/kbd-node-static.tsx +0 -15
- package/frontend/src/components/ui/kbd-node.tsx +0 -17
- package/frontend/src/components/ui/layout-header.tsx +0 -35
- package/frontend/src/components/ui/line-height-toolbar-button.tsx +0 -68
- package/frontend/src/components/ui/link-node-static.tsx +0 -21
- package/frontend/src/components/ui/link-node.tsx +0 -39
- package/frontend/src/components/ui/link-toolbar-button.tsx +0 -22
- package/frontend/src/components/ui/link-toolbar.tsx +0 -206
- package/frontend/src/components/ui/list-toolbar-button.tsx +0 -204
- package/frontend/src/components/ui/mark-toolbar-button.tsx +0 -19
- package/frontend/src/components/ui/media-audio-node-static.tsx +0 -17
- package/frontend/src/components/ui/media-audio-node.tsx +0 -39
- package/frontend/src/components/ui/media-embed-node.tsx +0 -136
- package/frontend/src/components/ui/media-file-node-static.tsx +0 -29
- package/frontend/src/components/ui/media-file-node.tsx +0 -47
- package/frontend/src/components/ui/media-image-node-static.tsx +0 -39
- package/frontend/src/components/ui/media-image-node.tsx +0 -80
- package/frontend/src/components/ui/media-placeholder-node.tsx +0 -249
- package/frontend/src/components/ui/media-preview-dialog.tsx +0 -152
- package/frontend/src/components/ui/media-toolbar-button.tsx +0 -225
- package/frontend/src/components/ui/media-toolbar.tsx +0 -115
- package/frontend/src/components/ui/media-upload-toast.tsx +0 -66
- package/frontend/src/components/ui/media-video-node-static.tsx +0 -30
- package/frontend/src/components/ui/media-video-node.tsx +0 -121
- package/frontend/src/components/ui/mention-node-static.tsx +0 -36
- package/frontend/src/components/ui/mention-node.tsx +0 -194
- package/frontend/src/components/ui/mode-toolbar-button.tsx +0 -123
- package/frontend/src/components/ui/more-toolbar-button.tsx +0 -80
- package/frontend/src/components/ui/paragraph-node-static.tsx +0 -13
- package/frontend/src/components/ui/paragraph-node.tsx +0 -15
- package/frontend/src/components/ui/popover.tsx +0 -46
- package/frontend/src/components/ui/resize-handle.tsx +0 -87
- package/frontend/src/components/ui/separator.tsx +0 -28
- package/frontend/src/components/ui/sheet.tsx +0 -139
- package/frontend/src/components/ui/sidebar.tsx +0 -726
- package/frontend/src/components/ui/skeleton.tsx +0 -13
- package/frontend/src/components/ui/slash-node.tsx +0 -233
- package/frontend/src/components/ui/sonner.tsx +0 -38
- package/frontend/src/components/ui/suggestion-node-static.tsx +0 -35
- package/frontend/src/components/ui/suggestion-node.tsx +0 -162
- package/frontend/src/components/ui/suggestion-toolbar-button.tsx +0 -25
- package/frontend/src/components/ui/table-icons.tsx +0 -862
- package/frontend/src/components/ui/table-node-static.tsx +0 -98
- package/frontend/src/components/ui/table-node.tsx +0 -656
- package/frontend/src/components/ui/table-toolbar-button.tsx +0 -264
- package/frontend/src/components/ui/toc-node-static.tsx +0 -92
- package/frontend/src/components/ui/toc-node.tsx +0 -55
- package/frontend/src/components/ui/toggle-node-static.tsx +0 -18
- package/frontend/src/components/ui/toggle-node.tsx +0 -36
- package/frontend/src/components/ui/toggle-toolbar-button.tsx +0 -22
- package/frontend/src/components/ui/toolbar.tsx +0 -387
- package/frontend/src/components/ui/tooltip.tsx +0 -59
- package/frontend/src/components/ui/turn-into-toolbar-button.tsx +0 -188
- package/frontend/src/hooks/use-debounce.ts +0 -18
- package/frontend/src/hooks/use-is-touch-device.ts +0 -24
- package/frontend/src/hooks/use-mobile.ts +0 -19
- package/frontend/src/hooks/use-mounted.ts +0 -11
- package/frontend/src/hooks/use-upload-file.ts +0 -128
- package/frontend/src/index.css +0 -128
- package/frontend/src/layout.tsx +0 -42
- package/frontend/src/lib/markdown-joiner-transform.ts +0 -239
- package/frontend/src/lib/orpc.ts +0 -13
- package/frontend/src/lib/uploadthing.ts +0 -19
- package/frontend/src/lib/utils.ts +0 -6
- package/frontend/src/main.tsx +0 -13
- package/frontend/src/pages/editor.tsx +0 -44
- package/frontend/src/types/docs.d.ts +0 -6
- package/frontend/src/types/global.d.ts +0 -9
- package/frontend/src/types/router.d.ts +0 -4
- package/frontend/tsconfig.app.json +0 -33
- package/frontend/tsconfig.json +0 -10
- package/frontend/tsconfig.node.json +0 -26
- package/frontend/vite.config.ts +0 -14
- package/src/bin/doclific.ts +0 -47
- package/src/core/codebase.ts +0 -39
- package/src/core/docs.ts +0 -90
- package/src/core/git.ts +0 -48
- package/src/server/index.ts +0 -55
- package/src/server/router.ts +0 -65
- package/tsconfig.json +0 -15
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import {
|
|
3
|
-
ChevronDownIcon,
|
|
4
|
-
ChevronLeftIcon,
|
|
5
|
-
ChevronRightIcon,
|
|
6
|
-
} from "lucide-react"
|
|
7
|
-
import {
|
|
8
|
-
DayPicker,
|
|
9
|
-
getDefaultClassNames,
|
|
10
|
-
type DayButton,
|
|
11
|
-
} from "react-day-picker"
|
|
12
|
-
|
|
13
|
-
import { cn } from "@/lib/utils"
|
|
14
|
-
import { Button, buttonVariants } from "@/components/ui/button"
|
|
15
|
-
|
|
16
|
-
function Calendar({
|
|
17
|
-
className,
|
|
18
|
-
classNames,
|
|
19
|
-
showOutsideDays = true,
|
|
20
|
-
captionLayout = "label",
|
|
21
|
-
buttonVariant = "ghost",
|
|
22
|
-
formatters,
|
|
23
|
-
components,
|
|
24
|
-
...props
|
|
25
|
-
}: React.ComponentProps<typeof DayPicker> & {
|
|
26
|
-
buttonVariant?: React.ComponentProps<typeof Button>["variant"]
|
|
27
|
-
}) {
|
|
28
|
-
const defaultClassNames = getDefaultClassNames()
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<DayPicker
|
|
32
|
-
showOutsideDays={showOutsideDays}
|
|
33
|
-
className={cn(
|
|
34
|
-
"bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
35
|
-
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
36
|
-
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
37
|
-
className
|
|
38
|
-
)}
|
|
39
|
-
captionLayout={captionLayout}
|
|
40
|
-
formatters={{
|
|
41
|
-
formatMonthDropdown: (date) =>
|
|
42
|
-
date.toLocaleString("default", { month: "short" }),
|
|
43
|
-
...formatters,
|
|
44
|
-
}}
|
|
45
|
-
classNames={{
|
|
46
|
-
root: cn("w-fit", defaultClassNames.root),
|
|
47
|
-
months: cn(
|
|
48
|
-
"flex gap-4 flex-col md:flex-row relative",
|
|
49
|
-
defaultClassNames.months
|
|
50
|
-
),
|
|
51
|
-
month: cn("flex flex-col w-full gap-4", defaultClassNames.month),
|
|
52
|
-
nav: cn(
|
|
53
|
-
"flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",
|
|
54
|
-
defaultClassNames.nav
|
|
55
|
-
),
|
|
56
|
-
button_previous: cn(
|
|
57
|
-
buttonVariants({ variant: buttonVariant }),
|
|
58
|
-
"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
|
|
59
|
-
defaultClassNames.button_previous
|
|
60
|
-
),
|
|
61
|
-
button_next: cn(
|
|
62
|
-
buttonVariants({ variant: buttonVariant }),
|
|
63
|
-
"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
|
|
64
|
-
defaultClassNames.button_next
|
|
65
|
-
),
|
|
66
|
-
month_caption: cn(
|
|
67
|
-
"flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",
|
|
68
|
-
defaultClassNames.month_caption
|
|
69
|
-
),
|
|
70
|
-
dropdowns: cn(
|
|
71
|
-
"w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",
|
|
72
|
-
defaultClassNames.dropdowns
|
|
73
|
-
),
|
|
74
|
-
dropdown_root: cn(
|
|
75
|
-
"relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",
|
|
76
|
-
defaultClassNames.dropdown_root
|
|
77
|
-
),
|
|
78
|
-
dropdown: cn(
|
|
79
|
-
"absolute bg-popover inset-0 opacity-0",
|
|
80
|
-
defaultClassNames.dropdown
|
|
81
|
-
),
|
|
82
|
-
caption_label: cn(
|
|
83
|
-
"select-none font-medium",
|
|
84
|
-
captionLayout === "label"
|
|
85
|
-
? "text-sm"
|
|
86
|
-
: "rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",
|
|
87
|
-
defaultClassNames.caption_label
|
|
88
|
-
),
|
|
89
|
-
table: "w-full border-collapse",
|
|
90
|
-
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
91
|
-
weekday: cn(
|
|
92
|
-
"text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",
|
|
93
|
-
defaultClassNames.weekday
|
|
94
|
-
),
|
|
95
|
-
week: cn("flex w-full mt-2", defaultClassNames.week),
|
|
96
|
-
week_number_header: cn(
|
|
97
|
-
"select-none w-(--cell-size)",
|
|
98
|
-
defaultClassNames.week_number_header
|
|
99
|
-
),
|
|
100
|
-
week_number: cn(
|
|
101
|
-
"text-[0.8rem] select-none text-muted-foreground",
|
|
102
|
-
defaultClassNames.week_number
|
|
103
|
-
),
|
|
104
|
-
day: cn(
|
|
105
|
-
"relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",
|
|
106
|
-
props.showWeekNumber
|
|
107
|
-
? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md"
|
|
108
|
-
: "[&:first-child[data-selected=true]_button]:rounded-l-md",
|
|
109
|
-
defaultClassNames.day
|
|
110
|
-
),
|
|
111
|
-
range_start: cn(
|
|
112
|
-
"rounded-l-md bg-accent",
|
|
113
|
-
defaultClassNames.range_start
|
|
114
|
-
),
|
|
115
|
-
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
116
|
-
range_end: cn("rounded-r-md bg-accent", defaultClassNames.range_end),
|
|
117
|
-
today: cn(
|
|
118
|
-
"bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",
|
|
119
|
-
defaultClassNames.today
|
|
120
|
-
),
|
|
121
|
-
outside: cn(
|
|
122
|
-
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
123
|
-
defaultClassNames.outside
|
|
124
|
-
),
|
|
125
|
-
disabled: cn(
|
|
126
|
-
"text-muted-foreground opacity-50",
|
|
127
|
-
defaultClassNames.disabled
|
|
128
|
-
),
|
|
129
|
-
hidden: cn("invisible", defaultClassNames.hidden),
|
|
130
|
-
...classNames,
|
|
131
|
-
}}
|
|
132
|
-
components={{
|
|
133
|
-
Root: ({ className, rootRef, ...props }) => {
|
|
134
|
-
return (
|
|
135
|
-
<div
|
|
136
|
-
data-slot="calendar"
|
|
137
|
-
ref={rootRef}
|
|
138
|
-
className={cn(className)}
|
|
139
|
-
{...props}
|
|
140
|
-
/>
|
|
141
|
-
)
|
|
142
|
-
},
|
|
143
|
-
Chevron: ({ className, orientation, ...props }) => {
|
|
144
|
-
if (orientation === "left") {
|
|
145
|
-
return (
|
|
146
|
-
<ChevronLeftIcon className={cn("size-4", className)} {...props} />
|
|
147
|
-
)
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if (orientation === "right") {
|
|
151
|
-
return (
|
|
152
|
-
<ChevronRightIcon
|
|
153
|
-
className={cn("size-4", className)}
|
|
154
|
-
{...props}
|
|
155
|
-
/>
|
|
156
|
-
)
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
return (
|
|
160
|
-
<ChevronDownIcon className={cn("size-4", className)} {...props} />
|
|
161
|
-
)
|
|
162
|
-
},
|
|
163
|
-
DayButton: CalendarDayButton,
|
|
164
|
-
WeekNumber: ({ children, ...props }) => {
|
|
165
|
-
return (
|
|
166
|
-
<td {...props}>
|
|
167
|
-
<div className="flex size-(--cell-size) items-center justify-center text-center">
|
|
168
|
-
{children}
|
|
169
|
-
</div>
|
|
170
|
-
</td>
|
|
171
|
-
)
|
|
172
|
-
},
|
|
173
|
-
...components,
|
|
174
|
-
}}
|
|
175
|
-
{...props}
|
|
176
|
-
/>
|
|
177
|
-
)
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
function CalendarDayButton({
|
|
181
|
-
className,
|
|
182
|
-
day,
|
|
183
|
-
modifiers,
|
|
184
|
-
...props
|
|
185
|
-
}: React.ComponentProps<typeof DayButton>) {
|
|
186
|
-
const defaultClassNames = getDefaultClassNames()
|
|
187
|
-
|
|
188
|
-
const ref = React.useRef<HTMLButtonElement>(null)
|
|
189
|
-
React.useEffect(() => {
|
|
190
|
-
if (modifiers.focused) ref.current?.focus()
|
|
191
|
-
}, [modifiers.focused])
|
|
192
|
-
|
|
193
|
-
return (
|
|
194
|
-
<Button
|
|
195
|
-
ref={ref}
|
|
196
|
-
variant="ghost"
|
|
197
|
-
size="icon"
|
|
198
|
-
data-day={day.date.toLocaleDateString()}
|
|
199
|
-
data-selected-single={
|
|
200
|
-
modifiers.selected &&
|
|
201
|
-
!modifiers.range_start &&
|
|
202
|
-
!modifiers.range_end &&
|
|
203
|
-
!modifiers.range_middle
|
|
204
|
-
}
|
|
205
|
-
data-range-start={modifiers.range_start}
|
|
206
|
-
data-range-end={modifiers.range_end}
|
|
207
|
-
data-range-middle={modifiers.range_middle}
|
|
208
|
-
className={cn(
|
|
209
|
-
"data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",
|
|
210
|
-
defaultClassNames.day,
|
|
211
|
-
className
|
|
212
|
-
)}
|
|
213
|
-
{...props}
|
|
214
|
-
/>
|
|
215
|
-
)
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
export { Calendar, CalendarDayButton }
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { SlateElementProps } from 'platejs/static';
|
|
2
|
-
|
|
3
|
-
import { SlateElement } from 'platejs/static';
|
|
4
|
-
|
|
5
|
-
import { cn } from '@/lib/utils';
|
|
6
|
-
|
|
7
|
-
export function CalloutElementStatic({
|
|
8
|
-
children,
|
|
9
|
-
className,
|
|
10
|
-
...props
|
|
11
|
-
}: SlateElementProps) {
|
|
12
|
-
return (
|
|
13
|
-
<SlateElement
|
|
14
|
-
className={cn('my-1 flex rounded-sm bg-muted p-4 pl-3', className)}
|
|
15
|
-
style={{
|
|
16
|
-
backgroundColor: props.element.backgroundColor as any,
|
|
17
|
-
}}
|
|
18
|
-
{...props}
|
|
19
|
-
>
|
|
20
|
-
<div className="flex w-full gap-2 rounded-md">
|
|
21
|
-
<div
|
|
22
|
-
className="size-6 select-none text-[18px]"
|
|
23
|
-
style={{
|
|
24
|
-
fontFamily:
|
|
25
|
-
'"Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", EmojiSymbols',
|
|
26
|
-
}}
|
|
27
|
-
>
|
|
28
|
-
<span data-plate-prevent-deserialization>
|
|
29
|
-
{(props.element.icon as any) || '💡'}
|
|
30
|
-
</span>
|
|
31
|
-
</div>
|
|
32
|
-
<div className="w-full">{children}</div>
|
|
33
|
-
</div>
|
|
34
|
-
</SlateElement>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { useCalloutEmojiPicker } from '@platejs/callout/react';
|
|
4
|
-
import { useEmojiDropdownMenuState } from '@platejs/emoji/react';
|
|
5
|
-
import { PlateElement } from 'platejs/react';
|
|
6
|
-
|
|
7
|
-
import { Button } from '@/components/ui/button';
|
|
8
|
-
import { cn } from '@/lib/utils';
|
|
9
|
-
|
|
10
|
-
import { EmojiPicker, EmojiPopover } from './emoji-toolbar-button';
|
|
11
|
-
|
|
12
|
-
export function CalloutElement({
|
|
13
|
-
attributes,
|
|
14
|
-
children,
|
|
15
|
-
className,
|
|
16
|
-
...props
|
|
17
|
-
}: React.ComponentProps<typeof PlateElement>) {
|
|
18
|
-
const { emojiPickerState, isOpen, setIsOpen } = useEmojiDropdownMenuState({
|
|
19
|
-
closeOnSelect: true,
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
const { emojiToolbarDropdownProps, props: calloutProps } =
|
|
23
|
-
useCalloutEmojiPicker({
|
|
24
|
-
isOpen,
|
|
25
|
-
setIsOpen,
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<PlateElement
|
|
30
|
-
className={cn('my-1 flex rounded-sm bg-muted p-4 pl-3', className)}
|
|
31
|
-
style={{
|
|
32
|
-
backgroundColor: props.element.backgroundColor as any,
|
|
33
|
-
}}
|
|
34
|
-
attributes={{
|
|
35
|
-
...attributes,
|
|
36
|
-
'data-plate-open-context-menu': true,
|
|
37
|
-
}}
|
|
38
|
-
{...props}
|
|
39
|
-
>
|
|
40
|
-
<div className="flex w-full gap-2 rounded-md">
|
|
41
|
-
<EmojiPopover
|
|
42
|
-
{...emojiToolbarDropdownProps}
|
|
43
|
-
control={
|
|
44
|
-
<Button
|
|
45
|
-
variant="ghost"
|
|
46
|
-
className="size-6 select-none p-1 text-[18px] hover:bg-muted-foreground/15"
|
|
47
|
-
style={{
|
|
48
|
-
fontFamily:
|
|
49
|
-
'"Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", EmojiSymbols',
|
|
50
|
-
}}
|
|
51
|
-
contentEditable={false}
|
|
52
|
-
>
|
|
53
|
-
{(props.element.icon as any) || '💡'}
|
|
54
|
-
</Button>
|
|
55
|
-
}
|
|
56
|
-
>
|
|
57
|
-
<EmojiPicker {...emojiPickerState} {...calloutProps} />
|
|
58
|
-
</EmojiPopover>
|
|
59
|
-
<div className="w-full">{children}</div>
|
|
60
|
-
</div>
|
|
61
|
-
</PlateElement>
|
|
62
|
-
);
|
|
63
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import type { VariantProps } from 'class-variance-authority';
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
Caption as CaptionPrimitive,
|
|
7
|
-
CaptionTextarea as CaptionTextareaPrimitive,
|
|
8
|
-
useCaptionButton,
|
|
9
|
-
useCaptionButtonState,
|
|
10
|
-
} from '@platejs/caption/react';
|
|
11
|
-
import { createPrimitiveComponent } from '@udecode/cn';
|
|
12
|
-
import { cva } from 'class-variance-authority';
|
|
13
|
-
|
|
14
|
-
import { Button } from '@/components/ui/button';
|
|
15
|
-
import { cn } from '@/lib/utils';
|
|
16
|
-
|
|
17
|
-
const captionVariants = cva('max-w-full', {
|
|
18
|
-
defaultVariants: {
|
|
19
|
-
align: 'center',
|
|
20
|
-
},
|
|
21
|
-
variants: {
|
|
22
|
-
align: {
|
|
23
|
-
center: 'mx-auto',
|
|
24
|
-
left: 'mr-auto',
|
|
25
|
-
right: 'ml-auto',
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
export function Caption({
|
|
31
|
-
align,
|
|
32
|
-
className,
|
|
33
|
-
...props
|
|
34
|
-
}: React.ComponentProps<typeof CaptionPrimitive> &
|
|
35
|
-
VariantProps<typeof captionVariants>) {
|
|
36
|
-
return (
|
|
37
|
-
<CaptionPrimitive
|
|
38
|
-
{...props}
|
|
39
|
-
className={cn(captionVariants({ align }), className)}
|
|
40
|
-
/>
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function CaptionTextarea(
|
|
45
|
-
props: React.ComponentProps<typeof CaptionTextareaPrimitive>
|
|
46
|
-
) {
|
|
47
|
-
return (
|
|
48
|
-
<CaptionTextareaPrimitive
|
|
49
|
-
{...props}
|
|
50
|
-
className={cn(
|
|
51
|
-
'mt-2 w-full resize-none border-none bg-inherit p-0 font-[inherit] text-inherit',
|
|
52
|
-
'focus:outline-none focus:[&::placeholder]:opacity-0',
|
|
53
|
-
'text-center print:placeholder:text-transparent',
|
|
54
|
-
props.className
|
|
55
|
-
)}
|
|
56
|
-
/>
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export const CaptionButton = createPrimitiveComponent(Button)({
|
|
61
|
-
propsHook: useCaptionButton,
|
|
62
|
-
stateHook: useCaptionButtonState,
|
|
63
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
|
|
3
|
-
import { CheckIcon } from "lucide-react"
|
|
4
|
-
|
|
5
|
-
import { cn } from "@/lib/utils"
|
|
6
|
-
|
|
7
|
-
function Checkbox({
|
|
8
|
-
className,
|
|
9
|
-
...props
|
|
10
|
-
}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
|
|
11
|
-
return (
|
|
12
|
-
<CheckboxPrimitive.Root
|
|
13
|
-
data-slot="checkbox"
|
|
14
|
-
className={cn(
|
|
15
|
-
"peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
16
|
-
className
|
|
17
|
-
)}
|
|
18
|
-
{...props}
|
|
19
|
-
>
|
|
20
|
-
<CheckboxPrimitive.Indicator
|
|
21
|
-
data-slot="checkbox-indicator"
|
|
22
|
-
className="grid place-content-center text-current transition-none"
|
|
23
|
-
>
|
|
24
|
-
<CheckIcon className="size-3.5" />
|
|
25
|
-
</CheckboxPrimitive.Indicator>
|
|
26
|
-
</CheckboxPrimitive.Root>
|
|
27
|
-
)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export { Checkbox }
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { TCodeBlockElement } from 'platejs';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
type SlateElementProps,
|
|
5
|
-
type SlateLeafProps,
|
|
6
|
-
SlateElement,
|
|
7
|
-
SlateLeaf,
|
|
8
|
-
} from 'platejs/static';
|
|
9
|
-
|
|
10
|
-
export function CodeBlockElementStatic(
|
|
11
|
-
props: SlateElementProps<TCodeBlockElement>
|
|
12
|
-
) {
|
|
13
|
-
return (
|
|
14
|
-
<SlateElement
|
|
15
|
-
className="py-1 **:[.hljs-addition]:bg-[#f0fff4] **:[.hljs-addition]:text-[#22863a] dark:**:[.hljs-addition]:bg-[#3c5743] dark:**:[.hljs-addition]:text-[#ceead5] **:[.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable]:text-[#005cc5] dark:**:[.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable]:text-[#6596cf] **:[.hljs-built\\\\_in,.hljs-symbol]:text-[#e36209] dark:**:[.hljs-built\\\\_in,.hljs-symbol]:text-[#c3854e] **:[.hljs-bullet]:text-[#735c0f] **:[.hljs-comment,.hljs-code,.hljs-formula]:text-[#6a737d] dark:**:[.hljs-comment,.hljs-code,.hljs-formula]:text-[#6a737d] **:[.hljs-deletion]:bg-[#ffeef0] **:[.hljs-deletion]:text-[#b31d28] dark:**:[.hljs-deletion]:bg-[#473235] dark:**:[.hljs-deletion]:text-[#e7c7cb] **:[.hljs-emphasis]:italic **:[.hljs-keyword,.hljs-doctag,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language\\\\_]:text-[#d73a49] dark:**:[.hljs-keyword,.hljs-doctag,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language\\\\_]:text-[#ee6960] **:[.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo]:text-[#22863a] dark:**:[.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo]:text-[#36a84f] **:[.hljs-regexp,.hljs-string,.hljs-meta_.hljs-string]:text-[#032f62] dark:**:[.hljs-regexp,.hljs-string,.hljs-meta_.hljs-string]:text-[#3593ff] **:[.hljs-section]:font-bold **:[.hljs-section]:text-[#005cc5] dark:**:[.hljs-section]:text-[#61a5f2] **:[.hljs-strong]:font-bold **:[.hljs-title,.hljs-title.class\\\\_,.hljs-title.class\\\\_.inherited\\\\_\\\\_,.hljs-title.function\\\\_]:text-[#6f42c1] dark:**:[.hljs-title,.hljs-title.class\\\\_,.hljs-title.class\\\\_.inherited\\\\_\\\\_,.hljs-title.function\\\\_]:text-[#a77bfa]"
|
|
16
|
-
{...props}
|
|
17
|
-
>
|
|
18
|
-
<div className="relative rounded-md bg-muted/50">
|
|
19
|
-
<pre className="overflow-x-auto p-8 pr-4 font-mono text-sm leading-[normal] [tab-size:2] print:break-inside-avoid">
|
|
20
|
-
<code>{props.children}</code>
|
|
21
|
-
</pre>
|
|
22
|
-
</div>
|
|
23
|
-
</SlateElement>
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function CodeLineElementStatic(props: SlateElementProps) {
|
|
28
|
-
return <SlateElement {...props} />;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function CodeSyntaxLeafStatic(props: SlateLeafProps) {
|
|
32
|
-
const tokenClassName = props.leaf.className as string;
|
|
33
|
-
|
|
34
|
-
return <SlateLeaf className={tokenClassName} {...props} />;
|
|
35
|
-
}
|