fix: link (#115)

* start

* .

* seeding connections

* .

* wip

* wip: learning state

* wip: notes section

* wip: many

* topics

* chore: update schema

* update package

* update sidebar

* update page section

* feat: profile

* fix: remove z index

* fix: wrong type

* add avatar

* add avatar

* wip

* .

* store page section key

* remove atom page section

* fix rerender

* fix rerender

* fix rerender

* fix rerender

* fix link

* search light/dark mode

* bubble menu ui

* .

* fix: remove unecessary code

* chore: mark as old for old schema

* chore: adapt new schema

* fix: add topic schema but null for now

* fix: add icon on personal link

* fix: list item

* fix: set url fetched when editing

* fix: remove image

* feat: add icon to link

* feat: custom url zod validation

* fix: metadata test

* chore: update utils

* fix: link

* fix: url fetcher

* .

* .

* fix: add link, section

* chore: seeder

* .

* .

* .

* .

* fix: change checkbox to learning state

* fix: click outside editing form

* feat: constant

* chore: move to master folder

* chore: adapt new schema

* chore: cli for new schema

* fix: new schema for dev seed

* fix: seeding

* update package

* chore: forcegraph seed

* bottombar

* if isEdit delete icon

* showCreate X button

* .

* options

* chore: implement topic from public global group

* chore: update learning state

* fix: change implementation for outside click

* chore: implement new form param

* chore: update env example

* feat: link form refs exception

* new page button layout, link topic search fixed

* chore: enable topic

* chore: update seed

* profile

* chore: move framer motion package from root to web and add nuqs

* chore: add LearningStateValue

* chore: implement active state

* profile

* chore: use fancy switch and update const

* feat: filter implementation

* dropdown menu

* .

* sidebar topics

* topic selected color

* feat: topic detail

* fix: collapsible page

* pages - sorted by, layout, visible mode

* .

* .

* .

* topic status sidebar

* topic button and count

* fix: topic

* page delete/topic buttons

* search ui

* selected topic for page

* selected topic status sidebar

* removed footer

* update package

* .

---------

Co-authored-by: Nikita <github@nikiv.dev>
Co-authored-by: marshennikovaolga <marshennikova@gmail.com>
Co-authored-by: Kisuyo <ig.intr3st@gmail.com>
This commit is contained in:
Aslam
2024-08-26 19:35:00 +07:00
committed by GitHub
parent 7cbfcc705b
commit 2d270706a5
77 changed files with 3002 additions and 1327 deletions

View File

@@ -5,6 +5,7 @@ import { BubbleMenu as TiptapBubbleMenu, Editor } from "@tiptap/react"
import { ToolbarButton } from "../ui/toolbar-button"
import { Icon } from "../ui/icon"
import * as React from "react"
import { Keybind } from "@/components/ui/Keybind"
export type BubbleMenuProps = {
editor: Editor
@@ -14,38 +15,93 @@ export const BubbleMenu = ({ editor }: BubbleMenuProps) => {
const commands = useTextmenuCommands(editor)
const states = useTextmenuStates(editor)
const toolbarButtonClassname =
"hover:opacity-100 transition-all dark:border-slate-500/10 border-gray-400 hover:border-b-2 active:translate-y-0 hover:translate-y-[-1.5px] hover:bg-zinc-300 dark:hover:bg-neutral-800 shadow-md rounded-[10px]"
return (
<TiptapBubbleMenu
tippyOptions={{
// duration: [0, 999999],
popperOptions: { placement: "top-start" }
}}
className="flex h-[40px] min-h-[40px] items-center rounded-[14px] shadow-md"
editor={editor}
pluginKey="textMenu"
shouldShow={states.shouldShow}
updateDelay={100}
>
<PopoverWrapper className="flex items-center overflow-x-auto p-1">
<div className="space-x-1">
<ToolbarButton value="bold" aria-label="Bold" onPressedChange={commands.onBold} isActive={states.isBold}>
<Icon name="Bold" strokeWidth={2.5} />
</ToolbarButton>
<ToolbarButton value="italic" aria-label="Italic" onClick={commands.onItalic}>
<Icon name="Italic" strokeWidth={2.5} />
</ToolbarButton>
<ToolbarButton value="strikethrough" aria-label="Strikethrough" onClick={commands.onStrike}>
<Icon name="Strikethrough" strokeWidth={2.5} />
</ToolbarButton>
<PopoverWrapper
className="flex items-center rounded-[14px] border border-slate-400/10 bg-gray-100 p-[4px] dark:bg-[#121212]"
style={{
boxShadow: "inset 0px 0px 5px 3px var(--boxShadow)"
}}
>
<div className="flex space-x-1">
<Keybind keys={["Ctrl", "I"]}>
<ToolbarButton
className={toolbarButtonClassname}
value="bold"
aria-label="Bold"
onPressedChange={commands.onBold}
isActive={states.isBold}
>
<Icon name="Bold" strokeWidth={2.5} />
</ToolbarButton>
</Keybind>
<Keybind keys={["Ctrl", "U"]}>
<ToolbarButton
className={toolbarButtonClassname}
value="italic"
aria-label="Italic"
onClick={commands.onItalic}
isActive={states.isItalic}
>
<Icon name="Italic" strokeWidth={2.5} />
</ToolbarButton>
</Keybind>
<Keybind keys={["Ctrl", "S"]}>
<ToolbarButton
className={toolbarButtonClassname}
value="strikethrough"
aria-label="Strikethrough"
onClick={commands.onStrike}
isActive={states.isStrike}
>
<Icon name="Strikethrough" strokeWidth={2.5} />
</ToolbarButton>
</Keybind>
{/* <ToolbarButton value="link" aria-label="Link">
<Icon name="Link" strokeWidth={2.5} />
</ToolbarButton> */}
<ToolbarButton value="quote" aria-label="Quote" onClick={commands.onCode}>
<Icon name="Quote" strokeWidth={2.5} />
</ToolbarButton>
<ToolbarButton value="inline code" aria-label="Inline code" onClick={commands.onCode}>
<Icon name="Braces" strokeWidth={2.5} />
</ToolbarButton>
<ToolbarButton value="code block" aria-label="Code block" onClick={commands.onCodeBlock}>
<Keybind keys={["cmd", "K"]}>
<ToolbarButton
className={toolbarButtonClassname}
value="quote"
aria-label="Quote"
onClick={commands.onCode}
isActive={states.isCode}
>
<Icon name="Quote" strokeWidth={2.5} />
</ToolbarButton>
</Keybind>
<Keybind keys={["Ctrl", "O"]}>
<ToolbarButton
className={toolbarButtonClassname}
value="inline code"
aria-label="Inline code"
onClick={commands.onCode}
isActive={states.isCode}
>
<Icon name="Braces" strokeWidth={2.5} />
</ToolbarButton>
</Keybind>
<ToolbarButton
className={toolbarButtonClassname}
value="code block"
aria-label="Code block"
onClick={commands.onCodeBlock}
>
<Icon name="Code" strokeWidth={2.5} />
</ToolbarButton>
{/* <ToolbarButton value="list" aria-label="List">