doclific 0.1.0
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/.gitattributes +2 -0
- package/.prettierignore +5 -0
- package/.prettierrc +9 -0
- package/.vscode/settings.json +13 -0
- package/dist/bin/doclific.d.ts +3 -0
- package/dist/bin/doclific.d.ts.map +1 -0
- package/dist/bin/doclific.js +11 -0
- package/dist/core/codebase.js +31 -0
- package/dist/core/docs.js +75 -0
- package/dist/core/git.js +47 -0
- package/dist/server/index.d.ts +2 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +46 -0
- package/dist/server/router.d.ts +9 -0
- package/dist/server/router.d.ts.map +1 -0
- package/dist/server/router.js +55 -0
- package/frontend/README.md +73 -0
- package/frontend/components.json +24 -0
- package/frontend/eslint.config.js +23 -0
- package/frontend/index.html +25 -0
- package/frontend/package-lock.json +15754 -0
- package/frontend/package.json +122 -0
- package/frontend/public/logo.svg +1 -0
- package/frontend/src/App.tsx +21 -0
- package/frontend/src/components/app-sidebar.tsx +393 -0
- package/frontend/src/components/editor/editor-base-kit.tsx +43 -0
- package/frontend/src/components/editor/editor-kit.tsx +93 -0
- package/frontend/src/components/editor/plugins/align-base-kit.tsx +16 -0
- package/frontend/src/components/editor/plugins/align-kit.tsx +18 -0
- package/frontend/src/components/editor/plugins/autoformat-kit.tsx +236 -0
- package/frontend/src/components/editor/plugins/basic-blocks-base-kit.tsx +35 -0
- package/frontend/src/components/editor/plugins/basic-blocks-kit.tsx +88 -0
- package/frontend/src/components/editor/plugins/basic-marks-base-kit.tsx +27 -0
- package/frontend/src/components/editor/plugins/basic-marks-kit.tsx +41 -0
- package/frontend/src/components/editor/plugins/basic-nodes-kit.tsx +6 -0
- package/frontend/src/components/editor/plugins/block-menu-kit.tsx +14 -0
- package/frontend/src/components/editor/plugins/block-placeholder-kit.tsx +17 -0
- package/frontend/src/components/editor/plugins/block-selection-kit.tsx +32 -0
- package/frontend/src/components/editor/plugins/callout-base-kit.tsx +7 -0
- package/frontend/src/components/editor/plugins/callout-kit.tsx +7 -0
- package/frontend/src/components/editor/plugins/code-block-base-kit.tsx +23 -0
- package/frontend/src/components/editor/plugins/code-block-kit.tsx +26 -0
- package/frontend/src/components/editor/plugins/codebase-kit.tsx +23 -0
- package/frontend/src/components/editor/plugins/column-base-kit.tsx +11 -0
- package/frontend/src/components/editor/plugins/column-kit.tsx +10 -0
- package/frontend/src/components/editor/plugins/comment-base-kit.tsx +7 -0
- package/frontend/src/components/editor/plugins/comment-kit.tsx +97 -0
- package/frontend/src/components/editor/plugins/cursor-overlay-kit.tsx +13 -0
- package/frontend/src/components/editor/plugins/date-base-kit.tsx +5 -0
- package/frontend/src/components/editor/plugins/date-kit.tsx +7 -0
- package/frontend/src/components/editor/plugins/discussion-kit.tsx +148 -0
- package/frontend/src/components/editor/plugins/dnd-kit.tsx +28 -0
- package/frontend/src/components/editor/plugins/docx-kit.tsx +6 -0
- package/frontend/src/components/editor/plugins/emoji-kit.tsx +13 -0
- package/frontend/src/components/editor/plugins/excalidraw-kit.tsx +9 -0
- package/frontend/src/components/editor/plugins/exit-break-kit.tsx +12 -0
- package/frontend/src/components/editor/plugins/floating-toolbar-kit.tsx +19 -0
- package/frontend/src/components/editor/plugins/font-base-kit.tsx +20 -0
- package/frontend/src/components/editor/plugins/font-kit.tsx +29 -0
- package/frontend/src/components/editor/plugins/indent-base-kit.tsx +19 -0
- package/frontend/src/components/editor/plugins/indent-kit.tsx +22 -0
- package/frontend/src/components/editor/plugins/line-height-base-kit.tsx +14 -0
- package/frontend/src/components/editor/plugins/line-height-kit.tsx +16 -0
- package/frontend/src/components/editor/plugins/link-base-kit.tsx +5 -0
- package/frontend/src/components/editor/plugins/link-kit.tsx +15 -0
- package/frontend/src/components/editor/plugins/list-base-kit.tsx +23 -0
- package/frontend/src/components/editor/plugins/list-kit.tsx +26 -0
- package/frontend/src/components/editor/plugins/markdown-kit.tsx +46 -0
- package/frontend/src/components/editor/plugins/math-base-kit.tsx +11 -0
- package/frontend/src/components/editor/plugins/math-kit.tsx +13 -0
- package/frontend/src/components/editor/plugins/media-base-kit.tsx +31 -0
- package/frontend/src/components/editor/plugins/media-kit.tsx +43 -0
- package/frontend/src/components/editor/plugins/mention-base-kit.tsx +7 -0
- package/frontend/src/components/editor/plugins/mention-kit.tsx +15 -0
- package/frontend/src/components/editor/plugins/slash-kit.tsx +18 -0
- package/frontend/src/components/editor/plugins/suggestion-base-kit.tsx +7 -0
- package/frontend/src/components/editor/plugins/suggestion-kit.tsx +90 -0
- package/frontend/src/components/editor/plugins/table-base-kit.tsx +20 -0
- package/frontend/src/components/editor/plugins/table-kit.tsx +22 -0
- package/frontend/src/components/editor/plugins/toc-base-kit.tsx +5 -0
- package/frontend/src/components/editor/plugins/toc-kit.tsx +14 -0
- package/frontend/src/components/editor/plugins/toggle-base-kit.tsx +7 -0
- package/frontend/src/components/editor/plugins/toggle-kit.tsx +11 -0
- package/frontend/src/components/editor/transforms.ts +194 -0
- package/frontend/src/components/markdown-to-slate-demo.tsx +50 -0
- package/frontend/src/components/mode-toggle.tsx +15 -0
- package/frontend/src/components/theme-provider.tsx +73 -0
- package/frontend/src/components/ui/alert-dialog.tsx +155 -0
- package/frontend/src/components/ui/align-toolbar-button.tsx +84 -0
- package/frontend/src/components/ui/avatar.tsx +51 -0
- package/frontend/src/components/ui/block-context-menu.tsx +199 -0
- package/frontend/src/components/ui/block-discussion.tsx +365 -0
- package/frontend/src/components/ui/block-draggable.tsx +512 -0
- package/frontend/src/components/ui/block-list-static.tsx +80 -0
- package/frontend/src/components/ui/block-list.tsx +87 -0
- package/frontend/src/components/ui/block-selection.tsx +42 -0
- package/frontend/src/components/ui/block-suggestion.tsx +473 -0
- package/frontend/src/components/ui/blockquote-node-static.tsx +11 -0
- package/frontend/src/components/ui/blockquote-node.tsx +13 -0
- package/frontend/src/components/ui/button.tsx +62 -0
- package/frontend/src/components/ui/calendar.tsx +218 -0
- package/frontend/src/components/ui/callout-node-static.tsx +36 -0
- package/frontend/src/components/ui/callout-node.tsx +63 -0
- package/frontend/src/components/ui/caption.tsx +63 -0
- package/frontend/src/components/ui/checkbox.tsx +30 -0
- package/frontend/src/components/ui/code-block-node-static.tsx +35 -0
- package/frontend/src/components/ui/code-block-node.tsx +287 -0
- package/frontend/src/components/ui/code-node-static.tsx +15 -0
- package/frontend/src/components/ui/code-node.tsx +17 -0
- package/frontend/src/components/ui/codebase-snippet-node.tsx +237 -0
- package/frontend/src/components/ui/column-node-static.tsx +29 -0
- package/frontend/src/components/ui/column-node.tsx +317 -0
- package/frontend/src/components/ui/command.tsx +182 -0
- package/frontend/src/components/ui/comment-node-static.tsx +15 -0
- package/frontend/src/components/ui/comment-node.tsx +45 -0
- package/frontend/src/components/ui/comment-toolbar-button.tsx +24 -0
- package/frontend/src/components/ui/comment.tsx +618 -0
- package/frontend/src/components/ui/context-menu.tsx +250 -0
- package/frontend/src/components/ui/cursor-overlay.tsx +66 -0
- package/frontend/src/components/ui/date-node-static.tsx +45 -0
- package/frontend/src/components/ui/date-node.tsx +93 -0
- package/frontend/src/components/ui/dialog.tsx +143 -0
- package/frontend/src/components/ui/dropdown-menu.tsx +255 -0
- package/frontend/src/components/ui/dynamic-icon.tsx +12 -0
- package/frontend/src/components/ui/editor-static.tsx +53 -0
- package/frontend/src/components/ui/editor.tsx +130 -0
- package/frontend/src/components/ui/emoji-node.tsx +69 -0
- package/frontend/src/components/ui/emoji-toolbar-button.tsx +628 -0
- package/frontend/src/components/ui/equation-node-static.tsx +98 -0
- package/frontend/src/components/ui/equation-node.tsx +235 -0
- package/frontend/src/components/ui/equation-toolbar-button.tsx +25 -0
- package/frontend/src/components/ui/excalidraw-node.tsx +36 -0
- package/frontend/src/components/ui/export-toolbar-button.tsx +174 -0
- package/frontend/src/components/ui/file-selector.tsx +339 -0
- package/frontend/src/components/ui/floating-toolbar-buttons.tsx +73 -0
- package/frontend/src/components/ui/floating-toolbar.tsx +85 -0
- package/frontend/src/components/ui/font-color-toolbar-button.tsx +831 -0
- package/frontend/src/components/ui/font-size-toolbar-button.tsx +152 -0
- package/frontend/src/components/ui/heading-node-static.tsx +68 -0
- package/frontend/src/components/ui/heading-node.tsx +58 -0
- package/frontend/src/components/ui/highlight-node-static.tsx +11 -0
- package/frontend/src/components/ui/highlight-node.tsx +13 -0
- package/frontend/src/components/ui/history-toolbar-button.tsx +50 -0
- package/frontend/src/components/ui/hr-node-static.tsx +20 -0
- package/frontend/src/components/ui/hr-node.tsx +33 -0
- package/frontend/src/components/ui/import-toolbar-button.tsx +97 -0
- package/frontend/src/components/ui/indent-toolbar-button.tsx +30 -0
- package/frontend/src/components/ui/inline-combobox.tsx +414 -0
- package/frontend/src/components/ui/input.tsx +21 -0
- package/frontend/src/components/ui/insert-toolbar-button.tsx +254 -0
- package/frontend/src/components/ui/kbd-node-static.tsx +15 -0
- package/frontend/src/components/ui/kbd-node.tsx +17 -0
- package/frontend/src/components/ui/layout-header.tsx +35 -0
- package/frontend/src/components/ui/line-height-toolbar-button.tsx +68 -0
- package/frontend/src/components/ui/link-node-static.tsx +21 -0
- package/frontend/src/components/ui/link-node.tsx +39 -0
- package/frontend/src/components/ui/link-toolbar-button.tsx +22 -0
- package/frontend/src/components/ui/link-toolbar.tsx +206 -0
- package/frontend/src/components/ui/list-toolbar-button.tsx +204 -0
- package/frontend/src/components/ui/mark-toolbar-button.tsx +19 -0
- package/frontend/src/components/ui/media-audio-node-static.tsx +17 -0
- package/frontend/src/components/ui/media-audio-node.tsx +39 -0
- package/frontend/src/components/ui/media-embed-node.tsx +136 -0
- package/frontend/src/components/ui/media-file-node-static.tsx +29 -0
- package/frontend/src/components/ui/media-file-node.tsx +47 -0
- package/frontend/src/components/ui/media-image-node-static.tsx +39 -0
- package/frontend/src/components/ui/media-image-node.tsx +80 -0
- package/frontend/src/components/ui/media-placeholder-node.tsx +249 -0
- package/frontend/src/components/ui/media-preview-dialog.tsx +152 -0
- package/frontend/src/components/ui/media-toolbar-button.tsx +225 -0
- package/frontend/src/components/ui/media-toolbar.tsx +115 -0
- package/frontend/src/components/ui/media-upload-toast.tsx +66 -0
- package/frontend/src/components/ui/media-video-node-static.tsx +30 -0
- package/frontend/src/components/ui/media-video-node.tsx +121 -0
- package/frontend/src/components/ui/mention-node-static.tsx +36 -0
- package/frontend/src/components/ui/mention-node.tsx +194 -0
- package/frontend/src/components/ui/mode-toolbar-button.tsx +123 -0
- package/frontend/src/components/ui/more-toolbar-button.tsx +80 -0
- package/frontend/src/components/ui/paragraph-node-static.tsx +13 -0
- package/frontend/src/components/ui/paragraph-node.tsx +15 -0
- package/frontend/src/components/ui/popover.tsx +46 -0
- package/frontend/src/components/ui/resize-handle.tsx +87 -0
- package/frontend/src/components/ui/separator.tsx +28 -0
- package/frontend/src/components/ui/sheet.tsx +139 -0
- package/frontend/src/components/ui/sidebar.tsx +726 -0
- package/frontend/src/components/ui/skeleton.tsx +13 -0
- package/frontend/src/components/ui/slash-node.tsx +233 -0
- package/frontend/src/components/ui/sonner.tsx +38 -0
- package/frontend/src/components/ui/suggestion-node-static.tsx +35 -0
- package/frontend/src/components/ui/suggestion-node.tsx +162 -0
- package/frontend/src/components/ui/suggestion-toolbar-button.tsx +25 -0
- package/frontend/src/components/ui/table-icons.tsx +862 -0
- package/frontend/src/components/ui/table-node-static.tsx +98 -0
- package/frontend/src/components/ui/table-node.tsx +656 -0
- package/frontend/src/components/ui/table-toolbar-button.tsx +264 -0
- package/frontend/src/components/ui/toc-node-static.tsx +92 -0
- package/frontend/src/components/ui/toc-node.tsx +55 -0
- package/frontend/src/components/ui/toggle-node-static.tsx +18 -0
- package/frontend/src/components/ui/toggle-node.tsx +36 -0
- package/frontend/src/components/ui/toggle-toolbar-button.tsx +22 -0
- package/frontend/src/components/ui/toolbar.tsx +387 -0
- package/frontend/src/components/ui/tooltip.tsx +59 -0
- package/frontend/src/components/ui/turn-into-toolbar-button.tsx +188 -0
- package/frontend/src/hooks/use-debounce.ts +18 -0
- package/frontend/src/hooks/use-is-touch-device.ts +24 -0
- package/frontend/src/hooks/use-mobile.ts +19 -0
- package/frontend/src/hooks/use-mounted.ts +11 -0
- package/frontend/src/hooks/use-upload-file.ts +128 -0
- package/frontend/src/index.css +128 -0
- package/frontend/src/layout.tsx +42 -0
- package/frontend/src/lib/markdown-joiner-transform.ts +239 -0
- package/frontend/src/lib/orpc.ts +13 -0
- package/frontend/src/lib/uploadthing.ts +19 -0
- package/frontend/src/lib/utils.ts +6 -0
- package/frontend/src/main.tsx +13 -0
- package/frontend/src/pages/editor.tsx +44 -0
- package/frontend/src/types/docs.d.ts +6 -0
- package/frontend/src/types/global.d.ts +9 -0
- package/frontend/src/types/router.d.ts +4 -0
- package/frontend/tsconfig.app.json +33 -0
- package/frontend/tsconfig.json +10 -0
- package/frontend/tsconfig.node.json +26 -0
- package/frontend/vite.config.ts +14 -0
- package/package.json +30 -0
- package/src/bin/doclific.ts +17 -0
- package/src/core/codebase.ts +39 -0
- package/src/core/docs.ts +90 -0
- package/src/core/git.ts +48 -0
- package/src/server/index.ts +55 -0
- package/src/server/router.ts +65 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { orpcTs } from "@/lib/orpc"
|
|
2
|
+
import { useQuery } from "@tanstack/react-query"
|
|
3
|
+
import { useLocation } from "react-router"
|
|
4
|
+
import type { FolderStructure } from "@/types/docs"
|
|
5
|
+
|
|
6
|
+
export function LayoutHeader() {
|
|
7
|
+
// get the current path
|
|
8
|
+
const path = useLocation()
|
|
9
|
+
|
|
10
|
+
const pathArray = path.pathname.split("/").filter(Boolean)
|
|
11
|
+
|
|
12
|
+
// get docs query
|
|
13
|
+
const docsQuery = useQuery({
|
|
14
|
+
...orpcTs.docs.getDocs.queryOptions(),
|
|
15
|
+
enabled: true,
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
// recursively loop through docsQuery.data and find the item that matches the path
|
|
19
|
+
const findItem = (items: FolderStructure[], path: string[], index: number) => {
|
|
20
|
+
for (const item of items) {
|
|
21
|
+
if (item.name === path[index] && index !== path.length - 1) {
|
|
22
|
+
return findItem(item.children, path, index + 1)
|
|
23
|
+
} else if (item.name === path[index] && index === path.length - 1) {
|
|
24
|
+
return item
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return null
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const item = findItem(docsQuery.data || [], pathArray, 0)
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<h1 className="text-base font-medium">{item?.title || "Doclific"}</h1>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import type { DropdownMenuProps } from '@radix-ui/react-dropdown-menu';
|
|
4
|
+
|
|
5
|
+
import { LineHeightPlugin } from '@platejs/basic-styles/react';
|
|
6
|
+
import { DropdownMenuItemIndicator } from '@radix-ui/react-dropdown-menu';
|
|
7
|
+
import { CheckIcon, WrapText } from 'lucide-react';
|
|
8
|
+
import { useEditorRef, useSelectionFragmentProp } from 'platejs/react';
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
DropdownMenu,
|
|
12
|
+
DropdownMenuContent,
|
|
13
|
+
DropdownMenuRadioGroup,
|
|
14
|
+
DropdownMenuRadioItem,
|
|
15
|
+
DropdownMenuTrigger,
|
|
16
|
+
} from '@/components/ui/dropdown-menu';
|
|
17
|
+
|
|
18
|
+
import { ToolbarButton } from './toolbar';
|
|
19
|
+
|
|
20
|
+
export function LineHeightToolbarButton(props: DropdownMenuProps) {
|
|
21
|
+
const editor = useEditorRef();
|
|
22
|
+
const { defaultNodeValue, validNodeValues: values = [] } =
|
|
23
|
+
editor.getInjectProps(LineHeightPlugin);
|
|
24
|
+
|
|
25
|
+
const value = useSelectionFragmentProp({
|
|
26
|
+
defaultValue: defaultNodeValue,
|
|
27
|
+
getProp: (node) => node.lineHeight,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const [open, setOpen] = React.useState(false);
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<DropdownMenu open={open} onOpenChange={setOpen} modal={false} {...props}>
|
|
34
|
+
<DropdownMenuTrigger asChild>
|
|
35
|
+
<ToolbarButton pressed={open} tooltip="Line height" isDropdown>
|
|
36
|
+
<WrapText />
|
|
37
|
+
</ToolbarButton>
|
|
38
|
+
</DropdownMenuTrigger>
|
|
39
|
+
|
|
40
|
+
<DropdownMenuContent className="min-w-0" align="start">
|
|
41
|
+
<DropdownMenuRadioGroup
|
|
42
|
+
value={value}
|
|
43
|
+
onValueChange={(newValue) => {
|
|
44
|
+
editor
|
|
45
|
+
.getTransforms(LineHeightPlugin)
|
|
46
|
+
.lineHeight.setNodes(Number(newValue));
|
|
47
|
+
editor.tf.focus();
|
|
48
|
+
}}
|
|
49
|
+
>
|
|
50
|
+
{values.map((value) => (
|
|
51
|
+
<DropdownMenuRadioItem
|
|
52
|
+
key={value}
|
|
53
|
+
className="min-w-[180px] pl-2 *:first:[span]:hidden"
|
|
54
|
+
value={value}
|
|
55
|
+
>
|
|
56
|
+
<span className="pointer-events-none absolute right-2 flex size-3.5 items-center justify-center">
|
|
57
|
+
<DropdownMenuItemIndicator>
|
|
58
|
+
<CheckIcon />
|
|
59
|
+
</DropdownMenuItemIndicator>
|
|
60
|
+
</span>
|
|
61
|
+
{value}
|
|
62
|
+
</DropdownMenuRadioItem>
|
|
63
|
+
))}
|
|
64
|
+
</DropdownMenuRadioGroup>
|
|
65
|
+
</DropdownMenuContent>
|
|
66
|
+
</DropdownMenu>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { TLinkElement } from 'platejs';
|
|
2
|
+
import type { SlateElementProps } from 'platejs/static';
|
|
3
|
+
|
|
4
|
+
import { getLinkAttributes } from '@platejs/link';
|
|
5
|
+
import { SlateElement } from 'platejs/static';
|
|
6
|
+
|
|
7
|
+
export function LinkElementStatic(props: SlateElementProps<TLinkElement>) {
|
|
8
|
+
return (
|
|
9
|
+
<SlateElement
|
|
10
|
+
{...props}
|
|
11
|
+
as="a"
|
|
12
|
+
className="font-medium text-primary underline decoration-primary underline-offset-4"
|
|
13
|
+
attributes={{
|
|
14
|
+
...props.attributes,
|
|
15
|
+
...getLinkAttributes(props.editor, props.element),
|
|
16
|
+
}}
|
|
17
|
+
>
|
|
18
|
+
{props.children}
|
|
19
|
+
</SlateElement>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import type { TInlineSuggestionData, TLinkElement } from 'platejs';
|
|
4
|
+
import type { PlateElementProps } from 'platejs/react';
|
|
5
|
+
|
|
6
|
+
import { getLinkAttributes } from '@platejs/link';
|
|
7
|
+
import { SuggestionPlugin } from '@platejs/suggestion/react';
|
|
8
|
+
import { PlateElement } from 'platejs/react';
|
|
9
|
+
|
|
10
|
+
import { cn } from '@/lib/utils';
|
|
11
|
+
|
|
12
|
+
export function LinkElement(props: PlateElementProps<TLinkElement>) {
|
|
13
|
+
const suggestionData = props.editor
|
|
14
|
+
.getApi(SuggestionPlugin)
|
|
15
|
+
.suggestion.suggestionData(props.element) as
|
|
16
|
+
| TInlineSuggestionData
|
|
17
|
+
| undefined;
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<PlateElement
|
|
21
|
+
{...props}
|
|
22
|
+
as="a"
|
|
23
|
+
className={cn(
|
|
24
|
+
'font-medium text-primary underline decoration-primary underline-offset-4',
|
|
25
|
+
suggestionData?.type === 'remove' && 'bg-red-100 text-red-700',
|
|
26
|
+
suggestionData?.type === 'insert' && 'bg-emerald-100 text-emerald-700'
|
|
27
|
+
)}
|
|
28
|
+
attributes={{
|
|
29
|
+
...props.attributes,
|
|
30
|
+
...getLinkAttributes(props.editor, props.element),
|
|
31
|
+
onMouseOver: (e) => {
|
|
32
|
+
e.stopPropagation();
|
|
33
|
+
},
|
|
34
|
+
}}
|
|
35
|
+
>
|
|
36
|
+
{props.children}
|
|
37
|
+
</PlateElement>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
useLinkToolbarButton,
|
|
5
|
+
useLinkToolbarButtonState,
|
|
6
|
+
} from '@platejs/link/react';
|
|
7
|
+
import { Link } from 'lucide-react';
|
|
8
|
+
|
|
9
|
+
import { ToolbarButton } from './toolbar';
|
|
10
|
+
|
|
11
|
+
export function LinkToolbarButton(
|
|
12
|
+
props: React.ComponentProps<typeof ToolbarButton>
|
|
13
|
+
) {
|
|
14
|
+
const state = useLinkToolbarButtonState();
|
|
15
|
+
const { props: buttonProps } = useLinkToolbarButton(state);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<ToolbarButton {...props} {...buttonProps} data-plate-focus tooltip="Link">
|
|
19
|
+
<Link />
|
|
20
|
+
</ToolbarButton>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import type { TLinkElement } from 'platejs';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
type UseVirtualFloatingOptions,
|
|
7
|
+
flip,
|
|
8
|
+
offset,
|
|
9
|
+
} from '@platejs/floating';
|
|
10
|
+
import { getLinkAttributes } from '@platejs/link';
|
|
11
|
+
import {
|
|
12
|
+
type LinkFloatingToolbarState,
|
|
13
|
+
FloatingLinkUrlInput,
|
|
14
|
+
useFloatingLinkEdit,
|
|
15
|
+
useFloatingLinkEditState,
|
|
16
|
+
useFloatingLinkInsert,
|
|
17
|
+
useFloatingLinkInsertState,
|
|
18
|
+
} from '@platejs/link/react';
|
|
19
|
+
import { cva } from 'class-variance-authority';
|
|
20
|
+
import { ExternalLink, Link, Text, Unlink } from 'lucide-react';
|
|
21
|
+
import { KEYS } from 'platejs';
|
|
22
|
+
import {
|
|
23
|
+
useEditorRef,
|
|
24
|
+
useEditorSelection,
|
|
25
|
+
useFormInputProps,
|
|
26
|
+
usePluginOption,
|
|
27
|
+
} from 'platejs/react';
|
|
28
|
+
|
|
29
|
+
import { buttonVariants } from '@/components/ui/button';
|
|
30
|
+
import { Separator } from '@/components/ui/separator';
|
|
31
|
+
|
|
32
|
+
const popoverVariants = cva(
|
|
33
|
+
'z-50 w-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md outline-hidden'
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const inputVariants = cva(
|
|
37
|
+
'flex h-[28px] w-full rounded-md border-none bg-transparent px-1.5 py-1 text-base placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-transparent md:text-sm'
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
export function LinkFloatingToolbar({
|
|
41
|
+
state,
|
|
42
|
+
}: {
|
|
43
|
+
state?: LinkFloatingToolbarState;
|
|
44
|
+
}) {
|
|
45
|
+
const activeCommentId = usePluginOption({ key: KEYS.comment }, 'activeId');
|
|
46
|
+
const activeSuggestionId = usePluginOption(
|
|
47
|
+
{ key: KEYS.suggestion },
|
|
48
|
+
'activeId'
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const floatingOptions: UseVirtualFloatingOptions = React.useMemo(
|
|
52
|
+
() => ({
|
|
53
|
+
middleware: [
|
|
54
|
+
offset(8),
|
|
55
|
+
flip({
|
|
56
|
+
fallbackPlacements: ['bottom-end', 'top-start', 'top-end'],
|
|
57
|
+
padding: 12,
|
|
58
|
+
}),
|
|
59
|
+
],
|
|
60
|
+
placement:
|
|
61
|
+
activeSuggestionId || activeCommentId ? 'top-start' : 'bottom-start',
|
|
62
|
+
}),
|
|
63
|
+
[activeCommentId, activeSuggestionId]
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
const insertState = useFloatingLinkInsertState({
|
|
67
|
+
...state,
|
|
68
|
+
floatingOptions: {
|
|
69
|
+
...floatingOptions,
|
|
70
|
+
...state?.floatingOptions,
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
const {
|
|
74
|
+
hidden,
|
|
75
|
+
props: insertProps,
|
|
76
|
+
ref: insertRef,
|
|
77
|
+
textInputProps,
|
|
78
|
+
} = useFloatingLinkInsert(insertState);
|
|
79
|
+
|
|
80
|
+
const editState = useFloatingLinkEditState({
|
|
81
|
+
...state,
|
|
82
|
+
floatingOptions: {
|
|
83
|
+
...floatingOptions,
|
|
84
|
+
...state?.floatingOptions,
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
const {
|
|
88
|
+
editButtonProps,
|
|
89
|
+
props: editProps,
|
|
90
|
+
ref: editRef,
|
|
91
|
+
unlinkButtonProps,
|
|
92
|
+
} = useFloatingLinkEdit(editState);
|
|
93
|
+
const inputProps = useFormInputProps({
|
|
94
|
+
preventDefaultOnEnterKeydown: true,
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
if (hidden) return null;
|
|
98
|
+
|
|
99
|
+
const input = (
|
|
100
|
+
<div className="flex w-[330px] flex-col" {...inputProps}>
|
|
101
|
+
<div className="flex items-center">
|
|
102
|
+
<div className="flex items-center pr-1 pl-2 text-muted-foreground">
|
|
103
|
+
<Link className="size-4" />
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
<FloatingLinkUrlInput
|
|
107
|
+
className={inputVariants()}
|
|
108
|
+
placeholder="Paste link"
|
|
109
|
+
data-plate-focus
|
|
110
|
+
/>
|
|
111
|
+
</div>
|
|
112
|
+
<Separator className="my-1" />
|
|
113
|
+
<div className="flex items-center">
|
|
114
|
+
<div className="flex items-center pr-1 pl-2 text-muted-foreground">
|
|
115
|
+
<Text className="size-4" />
|
|
116
|
+
</div>
|
|
117
|
+
<input
|
|
118
|
+
className={inputVariants()}
|
|
119
|
+
placeholder="Text to display"
|
|
120
|
+
data-plate-focus
|
|
121
|
+
{...textInputProps}
|
|
122
|
+
/>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
const editContent = editState.isEditing ? (
|
|
128
|
+
input
|
|
129
|
+
) : (
|
|
130
|
+
<div className="box-content flex items-center">
|
|
131
|
+
<button
|
|
132
|
+
className={buttonVariants({ size: 'sm', variant: 'ghost' })}
|
|
133
|
+
type="button"
|
|
134
|
+
{...editButtonProps}
|
|
135
|
+
>
|
|
136
|
+
Edit link
|
|
137
|
+
</button>
|
|
138
|
+
|
|
139
|
+
<Separator orientation="vertical" />
|
|
140
|
+
|
|
141
|
+
<LinkOpenButton />
|
|
142
|
+
|
|
143
|
+
<Separator orientation="vertical" />
|
|
144
|
+
|
|
145
|
+
<button
|
|
146
|
+
className={buttonVariants({
|
|
147
|
+
size: 'sm',
|
|
148
|
+
variant: 'ghost',
|
|
149
|
+
})}
|
|
150
|
+
type="button"
|
|
151
|
+
{...unlinkButtonProps}
|
|
152
|
+
>
|
|
153
|
+
<Unlink width={18} />
|
|
154
|
+
</button>
|
|
155
|
+
</div>
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
return (
|
|
159
|
+
<>
|
|
160
|
+
<div ref={insertRef} className={popoverVariants()} {...insertProps}>
|
|
161
|
+
{input}
|
|
162
|
+
</div>
|
|
163
|
+
|
|
164
|
+
<div ref={editRef} className={popoverVariants()} {...editProps}>
|
|
165
|
+
{editContent}
|
|
166
|
+
</div>
|
|
167
|
+
</>
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function LinkOpenButton() {
|
|
172
|
+
const editor = useEditorRef();
|
|
173
|
+
const selection = useEditorSelection();
|
|
174
|
+
|
|
175
|
+
const attributes = React.useMemo(
|
|
176
|
+
() => {
|
|
177
|
+
const entry = editor.api.node<TLinkElement>({
|
|
178
|
+
match: { type: editor.getType(KEYS.link) },
|
|
179
|
+
});
|
|
180
|
+
if (!entry) {
|
|
181
|
+
return {};
|
|
182
|
+
}
|
|
183
|
+
const [element] = entry;
|
|
184
|
+
return getLinkAttributes(editor, element);
|
|
185
|
+
},
|
|
186
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
187
|
+
[editor, selection]
|
|
188
|
+
);
|
|
189
|
+
|
|
190
|
+
return (
|
|
191
|
+
<a
|
|
192
|
+
{...attributes}
|
|
193
|
+
className={buttonVariants({
|
|
194
|
+
size: 'sm',
|
|
195
|
+
variant: 'ghost',
|
|
196
|
+
})}
|
|
197
|
+
onMouseOver={(e) => {
|
|
198
|
+
e.stopPropagation();
|
|
199
|
+
}}
|
|
200
|
+
aria-label="Open link in a new tab"
|
|
201
|
+
target="_blank"
|
|
202
|
+
>
|
|
203
|
+
<ExternalLink width={18} />
|
|
204
|
+
</a>
|
|
205
|
+
);
|
|
206
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { ListStyleType, someList, toggleList } from '@platejs/list';
|
|
4
|
+
import {
|
|
5
|
+
useIndentTodoToolBarButton,
|
|
6
|
+
useIndentTodoToolBarButtonState,
|
|
7
|
+
} from '@platejs/list/react';
|
|
8
|
+
import { List, ListOrdered, ListTodoIcon } from 'lucide-react';
|
|
9
|
+
import { useEditorRef, useEditorSelector } from 'platejs/react';
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
DropdownMenu,
|
|
13
|
+
DropdownMenuContent,
|
|
14
|
+
DropdownMenuGroup,
|
|
15
|
+
DropdownMenuItem,
|
|
16
|
+
DropdownMenuTrigger,
|
|
17
|
+
} from '@/components/ui/dropdown-menu';
|
|
18
|
+
|
|
19
|
+
import {
|
|
20
|
+
ToolbarButton,
|
|
21
|
+
ToolbarSplitButton,
|
|
22
|
+
ToolbarSplitButtonPrimary,
|
|
23
|
+
ToolbarSplitButtonSecondary,
|
|
24
|
+
} from './toolbar';
|
|
25
|
+
|
|
26
|
+
export function BulletedListToolbarButton() {
|
|
27
|
+
const editor = useEditorRef();
|
|
28
|
+
const [open, setOpen] = React.useState(false);
|
|
29
|
+
|
|
30
|
+
const pressed = useEditorSelector(
|
|
31
|
+
(editor) =>
|
|
32
|
+
someList(editor, [
|
|
33
|
+
ListStyleType.Disc,
|
|
34
|
+
ListStyleType.Circle,
|
|
35
|
+
ListStyleType.Square,
|
|
36
|
+
]),
|
|
37
|
+
[]
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<ToolbarSplitButton pressed={open}>
|
|
42
|
+
<ToolbarSplitButtonPrimary
|
|
43
|
+
className="data-[state=on]:bg-accent data-[state=on]:text-accent-foreground"
|
|
44
|
+
onClick={() => {
|
|
45
|
+
toggleList(editor, {
|
|
46
|
+
listStyleType: ListStyleType.Disc,
|
|
47
|
+
});
|
|
48
|
+
}}
|
|
49
|
+
data-state={pressed ? 'on' : 'off'}
|
|
50
|
+
>
|
|
51
|
+
<List className="size-4" />
|
|
52
|
+
</ToolbarSplitButtonPrimary>
|
|
53
|
+
|
|
54
|
+
<DropdownMenu open={open} onOpenChange={setOpen} modal={false}>
|
|
55
|
+
<DropdownMenuTrigger asChild>
|
|
56
|
+
<ToolbarSplitButtonSecondary />
|
|
57
|
+
</DropdownMenuTrigger>
|
|
58
|
+
|
|
59
|
+
<DropdownMenuContent align="start" alignOffset={-32}>
|
|
60
|
+
<DropdownMenuGroup>
|
|
61
|
+
<DropdownMenuItem
|
|
62
|
+
onClick={() =>
|
|
63
|
+
toggleList(editor, {
|
|
64
|
+
listStyleType: ListStyleType.Disc,
|
|
65
|
+
})
|
|
66
|
+
}
|
|
67
|
+
>
|
|
68
|
+
<div className="flex items-center gap-2">
|
|
69
|
+
<div className="size-2 rounded-full border border-current bg-current" />
|
|
70
|
+
Default
|
|
71
|
+
</div>
|
|
72
|
+
</DropdownMenuItem>
|
|
73
|
+
<DropdownMenuItem
|
|
74
|
+
onClick={() =>
|
|
75
|
+
toggleList(editor, {
|
|
76
|
+
listStyleType: ListStyleType.Circle,
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
>
|
|
80
|
+
<div className="flex items-center gap-2">
|
|
81
|
+
<div className="size-2 rounded-full border border-current" />
|
|
82
|
+
Circle
|
|
83
|
+
</div>
|
|
84
|
+
</DropdownMenuItem>
|
|
85
|
+
<DropdownMenuItem
|
|
86
|
+
onClick={() =>
|
|
87
|
+
toggleList(editor, {
|
|
88
|
+
listStyleType: ListStyleType.Square,
|
|
89
|
+
})
|
|
90
|
+
}
|
|
91
|
+
>
|
|
92
|
+
<div className="flex items-center gap-2">
|
|
93
|
+
<div className="size-2 border border-current bg-current" />
|
|
94
|
+
Square
|
|
95
|
+
</div>
|
|
96
|
+
</DropdownMenuItem>
|
|
97
|
+
</DropdownMenuGroup>
|
|
98
|
+
</DropdownMenuContent>
|
|
99
|
+
</DropdownMenu>
|
|
100
|
+
</ToolbarSplitButton>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function NumberedListToolbarButton() {
|
|
105
|
+
const editor = useEditorRef();
|
|
106
|
+
const [open, setOpen] = React.useState(false);
|
|
107
|
+
|
|
108
|
+
const pressed = useEditorSelector(
|
|
109
|
+
(editor) =>
|
|
110
|
+
someList(editor, [
|
|
111
|
+
ListStyleType.Decimal,
|
|
112
|
+
ListStyleType.LowerAlpha,
|
|
113
|
+
ListStyleType.UpperAlpha,
|
|
114
|
+
ListStyleType.LowerRoman,
|
|
115
|
+
ListStyleType.UpperRoman,
|
|
116
|
+
]),
|
|
117
|
+
[]
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
return (
|
|
121
|
+
<ToolbarSplitButton pressed={open}>
|
|
122
|
+
<ToolbarSplitButtonPrimary
|
|
123
|
+
className="data-[state=on]:bg-accent data-[state=on]:text-accent-foreground"
|
|
124
|
+
onClick={() =>
|
|
125
|
+
toggleList(editor, {
|
|
126
|
+
listStyleType: ListStyleType.Decimal,
|
|
127
|
+
})
|
|
128
|
+
}
|
|
129
|
+
data-state={pressed ? 'on' : 'off'}
|
|
130
|
+
>
|
|
131
|
+
<ListOrdered className="size-4" />
|
|
132
|
+
</ToolbarSplitButtonPrimary>
|
|
133
|
+
|
|
134
|
+
<DropdownMenu open={open} onOpenChange={setOpen} modal={false}>
|
|
135
|
+
<DropdownMenuTrigger asChild>
|
|
136
|
+
<ToolbarSplitButtonSecondary />
|
|
137
|
+
</DropdownMenuTrigger>
|
|
138
|
+
|
|
139
|
+
<DropdownMenuContent align="start" alignOffset={-32}>
|
|
140
|
+
<DropdownMenuGroup>
|
|
141
|
+
<DropdownMenuItem
|
|
142
|
+
onSelect={() =>
|
|
143
|
+
toggleList(editor, {
|
|
144
|
+
listStyleType: ListStyleType.Decimal,
|
|
145
|
+
})
|
|
146
|
+
}
|
|
147
|
+
>
|
|
148
|
+
Decimal (1, 2, 3)
|
|
149
|
+
</DropdownMenuItem>
|
|
150
|
+
<DropdownMenuItem
|
|
151
|
+
onSelect={() =>
|
|
152
|
+
toggleList(editor, {
|
|
153
|
+
listStyleType: ListStyleType.LowerAlpha,
|
|
154
|
+
})
|
|
155
|
+
}
|
|
156
|
+
>
|
|
157
|
+
Lower Alpha (a, b, c)
|
|
158
|
+
</DropdownMenuItem>
|
|
159
|
+
<DropdownMenuItem
|
|
160
|
+
onSelect={() =>
|
|
161
|
+
toggleList(editor, {
|
|
162
|
+
listStyleType: ListStyleType.UpperAlpha,
|
|
163
|
+
})
|
|
164
|
+
}
|
|
165
|
+
>
|
|
166
|
+
Upper Alpha (A, B, C)
|
|
167
|
+
</DropdownMenuItem>
|
|
168
|
+
<DropdownMenuItem
|
|
169
|
+
onSelect={() =>
|
|
170
|
+
toggleList(editor, {
|
|
171
|
+
listStyleType: ListStyleType.LowerRoman,
|
|
172
|
+
})
|
|
173
|
+
}
|
|
174
|
+
>
|
|
175
|
+
Lower Roman (i, ii, iii)
|
|
176
|
+
</DropdownMenuItem>
|
|
177
|
+
<DropdownMenuItem
|
|
178
|
+
onSelect={() =>
|
|
179
|
+
toggleList(editor, {
|
|
180
|
+
listStyleType: ListStyleType.UpperRoman,
|
|
181
|
+
})
|
|
182
|
+
}
|
|
183
|
+
>
|
|
184
|
+
Upper Roman (I, II, III)
|
|
185
|
+
</DropdownMenuItem>
|
|
186
|
+
</DropdownMenuGroup>
|
|
187
|
+
</DropdownMenuContent>
|
|
188
|
+
</DropdownMenu>
|
|
189
|
+
</ToolbarSplitButton>
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export function TodoListToolbarButton(
|
|
194
|
+
props: React.ComponentProps<typeof ToolbarButton>
|
|
195
|
+
) {
|
|
196
|
+
const state = useIndentTodoToolBarButtonState({ nodeType: 'todo' });
|
|
197
|
+
const { props: buttonProps } = useIndentTodoToolBarButton(state);
|
|
198
|
+
|
|
199
|
+
return (
|
|
200
|
+
<ToolbarButton {...props} {...buttonProps} tooltip="Todo">
|
|
201
|
+
<ListTodoIcon />
|
|
202
|
+
</ToolbarButton>
|
|
203
|
+
);
|
|
204
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import { useMarkToolbarButton, useMarkToolbarButtonState } from 'platejs/react';
|
|
4
|
+
|
|
5
|
+
import { ToolbarButton } from './toolbar';
|
|
6
|
+
|
|
7
|
+
export function MarkToolbarButton({
|
|
8
|
+
clear,
|
|
9
|
+
nodeType,
|
|
10
|
+
...props
|
|
11
|
+
}: React.ComponentProps<typeof ToolbarButton> & {
|
|
12
|
+
nodeType: string;
|
|
13
|
+
clear?: string[] | string;
|
|
14
|
+
}) {
|
|
15
|
+
const state = useMarkToolbarButtonState({ clear, nodeType });
|
|
16
|
+
const { props: buttonProps } = useMarkToolbarButton(state);
|
|
17
|
+
|
|
18
|
+
return <ToolbarButton {...props} {...buttonProps} />;
|
|
19
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { TAudioElement } from 'platejs';
|
|
2
|
+
import type { SlateElementProps } from 'platejs/static';
|
|
3
|
+
|
|
4
|
+
import { SlateElement } from 'platejs/static';
|
|
5
|
+
|
|
6
|
+
export function AudioElementStatic(props: SlateElementProps<TAudioElement>) {
|
|
7
|
+
return (
|
|
8
|
+
<SlateElement {...props} className="mb-1">
|
|
9
|
+
<figure className="group relative cursor-default">
|
|
10
|
+
<div className="h-16">
|
|
11
|
+
<audio className="size-full" src={props.element.url} controls />
|
|
12
|
+
</div>
|
|
13
|
+
</figure>
|
|
14
|
+
{props.children}
|
|
15
|
+
</SlateElement>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import type { TAudioElement } from 'platejs';
|
|
4
|
+
import type { PlateElementProps } from 'platejs/react';
|
|
5
|
+
|
|
6
|
+
import { useMediaState } from '@platejs/media/react';
|
|
7
|
+
import { ResizableProvider } from '@platejs/resizable';
|
|
8
|
+
import { PlateElement, withHOC } from 'platejs/react';
|
|
9
|
+
|
|
10
|
+
import { Caption, CaptionTextarea } from './caption';
|
|
11
|
+
|
|
12
|
+
export const AudioElement = withHOC(
|
|
13
|
+
ResizableProvider,
|
|
14
|
+
function AudioElement(props: PlateElementProps<TAudioElement>) {
|
|
15
|
+
const { align = 'center', readOnly, unsafeUrl } = useMediaState();
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<PlateElement {...props} className="mb-1">
|
|
19
|
+
<figure
|
|
20
|
+
className="group relative cursor-default"
|
|
21
|
+
contentEditable={false}
|
|
22
|
+
>
|
|
23
|
+
<div className="h-16">
|
|
24
|
+
<audio className="size-full" src={unsafeUrl} controls />
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<Caption style={{ width: '100%' }} align={align}>
|
|
28
|
+
<CaptionTextarea
|
|
29
|
+
className="h-20"
|
|
30
|
+
readOnly={readOnly}
|
|
31
|
+
placeholder="Write a caption..."
|
|
32
|
+
/>
|
|
33
|
+
</Caption>
|
|
34
|
+
</figure>
|
|
35
|
+
{props.children}
|
|
36
|
+
</PlateElement>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
);
|