notra-editor 0.2.0 → 0.3.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/dist/index.cjs +640 -1444
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -21
- package/dist/index.d.ts +16 -21
- package/dist/index.mjs +645 -1440
- package/dist/index.mjs.map +1 -1
- package/dist/styles/globals.css +1141 -0
- package/dist/themes/default/editor.css +0 -116
- package/package.json +17 -5
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/notra-editor.tsx","../src/components/blockquote-button/blockquote-button.tsx","../src/icons/blockquote-icon.tsx","../src/components/button/button.tsx","../src/components/code-block-button/code-block-button.tsx","../src/icons/code-block-icon.tsx","../src/components/heading-dropdown-menu/heading-dropdown-menu.tsx","../src/components/heading-dropdown-menu/heading-button.tsx","../src/components/heading-dropdown-menu/use-heading.ts","../src/icons/heading-1-icon.tsx","../src/icons/heading-2-icon.tsx","../src/icons/heading-3-icon.tsx","../src/icons/heading-4-icon.tsx","../src/icons/heading-icon.tsx","../src/icons/check-icon.tsx","../src/icons/chevron-down-icon.tsx","../src/components/ui-primitive/dropdown-menu.tsx","../src/components/link-popover/link-popover.tsx","../src/components/link-popover/use-link-popover.ts","../src/icons/corner-down-left-icon.tsx","../src/icons/external-link-icon.tsx","../src/icons/link-icon.tsx","../src/icons/trash-icon.tsx","../src/components/toolbar/toolbar.tsx","../src/components/ui-primitive/card.tsx","../src/components/ui-primitive/input.tsx","../src/components/ui-primitive/popover.tsx","../src/components/list-dropdown-menu/list-dropdown-menu.tsx","../src/components/list-dropdown-menu/list-button.tsx","../src/components/list-dropdown-menu/use-list.ts","../src/icons/bullet-list-icon.tsx","../src/icons/ordered-list-icon.tsx","../src/icons/task-list-icon.tsx","../src/components/mark-button/mark-button.tsx","../src/components/mark-button/use-mark.ts","../src/icons/bold-icon.tsx","../src/icons/code-icon.tsx","../src/icons/italic-icon.tsx","../src/icons/strikethrough-icon.tsx","../src/components/ui-primitive/spacer.tsx","../src/components/undo-redo-button/undo-redo-button.tsx","../src/components/undo-redo-button/use-undo-redo.ts","../src/icons/redo-icon.tsx","../src/icons/undo-icon.tsx","../src/hooks/use-markdown-editor.ts","../src/extensions/shared.ts","../src/extensions/editor.ts","../src/notra-reader.tsx","../src/utils/markdown-to-json.ts"],"sourcesContent":["export { NotraEditor } from './notra-editor';\nexport type { NotraEditorProps } from './notra-editor';\n\nexport { NotraReader } from './notra-reader';\nexport type { NotraReaderProps } from './notra-reader';\n\nexport {\n\tToolbar,\n\tToolbarGroup,\n\tToolbarSeparator\n} from './components/toolbar/toolbar';\nexport type {\n\tToolbarProps,\n\tToolbarSeparatorProps\n} from './components/toolbar/toolbar';\n\nexport { Button } from './components/button/button';\nexport type { ButtonProps } from './components/button/button';\n\nexport { UndoRedoButton } from './components/undo-redo-button/undo-redo-button';\nexport type { UndoRedoButtonProps } from './components/undo-redo-button/undo-redo-button';\n\nexport { Spacer } from './components/ui-primitive/spacer';\nexport { DropdownMenu } from './components/ui-primitive/dropdown-menu';\nexport type { DropdownMenuProps } from './components/ui-primitive/dropdown-menu';\nexport { Popover } from './components/ui-primitive/popover';\nexport type { PopoverProps } from './components/ui-primitive/popover';\n\nexport { MarkButton } from './components/mark-button/mark-button';\nexport type { MarkButtonProps } from './components/mark-button/mark-button';\nexport type { MarkType } from './components/mark-button/use-mark';\n\nexport { HeadingDropdownMenu } from './components/heading-dropdown-menu/heading-dropdown-menu';\nexport type { HeadingDropdownMenuProps } from './components/heading-dropdown-menu/heading-dropdown-menu';\n\nexport { ListDropdownMenu } from './components/list-dropdown-menu/list-dropdown-menu';\nexport type { ListDropdownMenuProps } from './components/list-dropdown-menu/list-dropdown-menu';\n\nexport { BlockquoteButton } from './components/blockquote-button/blockquote-button';\nexport type { BlockquoteButtonProps } from './components/blockquote-button/blockquote-button';\n\nexport { CodeBlockButton } from './components/code-block-button/code-block-button';\nexport type { CodeBlockButtonProps } from './components/code-block-button/code-block-button';\n\nexport { LinkPopover } from './components/link-popover/link-popover';\nexport type { LinkPopoverProps } from './components/link-popover/link-popover';\n","import { EditorContent } from '@tiptap/react';\n\nimport { BlockquoteButton } from './components/blockquote-button/blockquote-button';\nimport { CodeBlockButton } from './components/code-block-button/code-block-button';\nimport { HeadingDropdownMenu } from './components/heading-dropdown-menu/heading-dropdown-menu';\nimport { LinkPopover } from './components/link-popover/link-popover';\nimport { ListDropdownMenu } from './components/list-dropdown-menu/list-dropdown-menu';\nimport { MarkButton } from './components/mark-button/mark-button';\nimport {\n\tToolbar,\n\tToolbarGroup,\n\tToolbarSeparator\n} from './components/toolbar/toolbar';\nimport { Spacer } from './components/ui-primitive/spacer';\nimport { UndoRedoButton } from './components/undo-redo-button/undo-redo-button';\nimport { useMarkdownEditor } from './hooks/use-markdown-editor';\n\nexport interface NotraEditorProps {\n\t/** Markdown content (source of truth) */\n\tvalue: string;\n\t/** Called when content changes, receives updated Markdown */\n\tonChange: (value: string) => void;\n\t/** Placeholder text shown when editor is empty */\n\tplaceholder?: string;\n\t/** Disable editing */\n\treadOnly?: boolean;\n\t/** Additional CSS class on the wrapper element */\n\tclassName?: string;\n}\n\nexport function NotraEditor({\n\tvalue,\n\tonChange,\n\tplaceholder,\n\treadOnly = false,\n\tclassName\n}: NotraEditorProps) {\n\tconst { editor } = useMarkdownEditor({\n\t\tvalue,\n\t\tonChange,\n\t\tplaceholder,\n\t\teditable: !readOnly\n\t});\n\n\tconst classNames = ['notra', 'notra-editor', className]\n\t\t.filter(Boolean)\n\t\t.join(' ');\n\n\treturn (\n\t\t<div className={classNames}>\n\t\t\t<Toolbar variant=\"fixed\">\n\t\t\t\t<Spacer />\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<UndoRedoButton action=\"undo\" editor={editor} />\n\t\t\t\t\t<UndoRedoButton action=\"redo\" editor={editor} />\n\t\t\t\t</ToolbarGroup>\n\t\t\t\t<ToolbarSeparator />\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<HeadingDropdownMenu editor={editor} levels={[1, 2, 3, 4]} />\n\t\t\t\t\t<ListDropdownMenu\n\t\t\t\t\t\teditor={editor}\n\t\t\t\t\t\ttypes={['bulletList', 'orderedList', 'taskList']}\n\t\t\t\t\t/>\n\t\t\t\t\t<BlockquoteButton editor={editor} />\n\t\t\t\t\t<CodeBlockButton editor={editor} />\n\t\t\t\t</ToolbarGroup>\n\t\t\t\t<ToolbarSeparator />\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<MarkButton editor={editor} type=\"bold\" />\n\t\t\t\t\t<MarkButton editor={editor} type=\"italic\" />\n\t\t\t\t\t<MarkButton editor={editor} type=\"strike\" />\n\t\t\t\t\t<MarkButton editor={editor} type=\"code\" />\n\t\t\t\t\t<LinkPopover editor={editor} />\n\t\t\t\t</ToolbarGroup>\n\t\t\t\t<Spacer />\n\t\t\t</Toolbar>\n\t\t\t<EditorContent className=\"notra-editor-content\" editor={editor} />\n\t\t</div>\n\t);\n}\n","import { forwardRef, useCallback, useEffect, useState } from 'react';\n\nimport { BlockquoteIcon } from '../../icons/blockquote-icon';\nimport { Button } from '../button/button';\n\nimport type { Editor } from '@tiptap/core';\n\nexport interface BlockquoteButtonProps extends Omit<\n\tReact.ButtonHTMLAttributes<HTMLButtonElement>,\n\t'type'\n> {\n\teditor: Editor | null;\n}\n\nfunction canToggleBlockquote(editor: Editor | null): boolean {\n\tif (!editor || !editor.isEditable) return false;\n\n\treturn editor.can().toggleWrap('blockquote') || editor.can().clearNodes();\n}\n\nexport const BlockquoteButton = forwardRef<\n\tHTMLButtonElement,\n\tBlockquoteButtonProps\n>(({ editor, onClick, ...buttonProps }, ref) => {\n\tconst [isActive, setIsActive] = useState(false);\n\tconst [canToggle, setCanToggle] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\n\t\tconst update = () => {\n\t\t\tsetIsActive(editor.isActive('blockquote'));\n\t\t\tsetCanToggle(canToggleBlockquote(editor));\n\t\t};\n\n\t\tupdate();\n\n\t\teditor.on('selectionUpdate', update);\n\t\teditor.on('transaction', update);\n\n\t\treturn () => {\n\t\t\teditor.off('selectionUpdate', update);\n\t\t\teditor.off('transaction', update);\n\t\t};\n\t}, [editor]);\n\n\tconst handleClick = useCallback(\n\t\t(event: React.MouseEvent<HTMLButtonElement>) => {\n\t\t\tonClick?.(event);\n\n\t\t\tif (event.defaultPrevented) return;\n\n\t\t\tif (!editor) return;\n\n\t\t\tif (editor.isActive('blockquote')) {\n\t\t\t\teditor.chain().focus().lift('blockquote').run();\n\t\t\t} else {\n\t\t\t\t// clearNodes first to convert any block type to paragraph,\n\t\t\t\t// then wrap in blockquote\n\t\t\t\teditor.chain().focus().clearNodes().wrapIn('blockquote').run();\n\t\t\t}\n\t\t},\n\t\t[editor, onClick]\n\t);\n\n\treturn (\n\t\t<Button\n\t\t\tref={ref}\n\t\t\taria-label=\"Blockquote\"\n\t\t\taria-pressed={isActive}\n\t\t\tdata-active-state={isActive ? 'on' : 'off'}\n\t\t\tdisabled={!canToggle}\n\t\t\ttabIndex={-1}\n\t\t\ttype=\"button\"\n\t\t\tvariant=\"ghost\"\n\t\t\tonClick={handleClick}\n\t\t\t{...buttonProps}\n\t\t>\n\t\t\t<BlockquoteIcon className=\"tiptap-button-icon\" />\n\t\t</Button>\n\t);\n});\n\nBlockquoteButton.displayName = 'BlockquoteButton';\n","import { memo } from 'react';\n\ntype SvgProps = React.ComponentPropsWithoutRef<'svg'>;\n\nexport const BlockquoteIcon = memo(({ className, ...props }: SvgProps) => {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tfill=\"currentColor\"\n\t\t\theight=\"24\"\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\twidth=\"24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M8 6C8 5.44772 8.44772 5 9 5H16C16.5523 5 17 5.44772 17 6C17 6.55228 16.5523 7 16 7H9C8.44772 7 8 6.55228 8 6Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M4 3C4.55228 3 5 3.44772 5 4L5 20C5 20.5523 4.55229 21 4 21C3.44772 21 3 20.5523 3 20L3 4C3 3.44772 3.44772 3 4 3Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M8 12C8 11.4477 8.44772 11 9 11H20C20.5523 11 21 11.4477 21 12C21 12.5523 20.5523 13 20 13H9C8.44772 13 8 12.5523 8 12Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M8 18C8 17.4477 8.44772 17 9 17H16C16.5523 17 17 17.4477 17 18C17 18.5523 16.5523 19 16 19H9C8.44772 19 8 18.5523 8 18Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t</svg>\n\t);\n});\n\nBlockquoteIcon.displayName = 'BlockquoteIcon';\n","import { forwardRef } from 'react';\n\nexport interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n\tvariant?: 'default' | 'ghost' | 'primary';\n\tsize?: 'small' | 'default' | 'large';\n\tactive?: boolean;\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n\t(\n\t\t{\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tvariant = 'ghost',\n\t\t\tsize = 'default',\n\t\t\tactive,\n\t\t\t...props\n\t\t},\n\t\tref\n\t) => {\n\t\tconst classNames = ['tiptap-button', className].filter(Boolean).join(' ');\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\tref={ref}\n\t\t\t\tclassName={classNames}\n\t\t\t\tdata-active-state={active ? 'on' : undefined}\n\t\t\t\tdata-size={size !== 'default' ? size : undefined}\n\t\t\t\tdata-style={variant !== 'default' ? variant : undefined}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</button>\n\t\t);\n\t}\n);\n\nButton.displayName = 'Button';\n","import { forwardRef, useCallback, useEffect, useState } from 'react';\n\nimport { CodeBlockIcon } from '../../icons/code-block-icon';\nimport { Button } from '../button/button';\n\nimport type { Editor } from '@tiptap/core';\n\nexport interface CodeBlockButtonProps extends Omit<\n\tReact.ButtonHTMLAttributes<HTMLButtonElement>,\n\t'type'\n> {\n\teditor: Editor | null;\n}\n\nfunction canToggleCodeBlock(editor: Editor | null): boolean {\n\tif (!editor || !editor.isEditable) return false;\n\n\treturn (\n\t\teditor.can().toggleNode('codeBlock', 'paragraph') ||\n\t\teditor.can().clearNodes()\n\t);\n}\n\nexport const CodeBlockButton = forwardRef<\n\tHTMLButtonElement,\n\tCodeBlockButtonProps\n>(({ editor, onClick, ...buttonProps }, ref) => {\n\tconst [isActive, setIsActive] = useState(false);\n\tconst [canToggle, setCanToggle] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\n\t\tconst update = () => {\n\t\t\tsetIsActive(editor.isActive('codeBlock'));\n\t\t\tsetCanToggle(canToggleCodeBlock(editor));\n\t\t};\n\n\t\tupdate();\n\n\t\teditor.on('selectionUpdate', update);\n\t\teditor.on('transaction', update);\n\n\t\treturn () => {\n\t\t\teditor.off('selectionUpdate', update);\n\t\t\teditor.off('transaction', update);\n\t\t};\n\t}, [editor]);\n\n\tconst handleClick = useCallback(\n\t\t(event: React.MouseEvent<HTMLButtonElement>) => {\n\t\t\tonClick?.(event);\n\n\t\t\tif (event.defaultPrevented) return;\n\n\t\t\tif (!editor) return;\n\n\t\t\tif (editor.isActive('codeBlock')) {\n\t\t\t\teditor.chain().focus().setNode('paragraph').run();\n\t\t\t} else {\n\t\t\t\t// clearNodes first to convert any block type to paragraph,\n\t\t\t\t// then toggle to codeBlock\n\t\t\t\teditor\n\t\t\t\t\t.chain()\n\t\t\t\t\t.focus()\n\t\t\t\t\t.clearNodes()\n\t\t\t\t\t.toggleNode('codeBlock', 'paragraph')\n\t\t\t\t\t.run();\n\t\t\t}\n\t\t},\n\t\t[editor, onClick]\n\t);\n\n\treturn (\n\t\t<Button\n\t\t\tref={ref}\n\t\t\taria-label=\"Code Block\"\n\t\t\taria-pressed={isActive}\n\t\t\tdata-active-state={isActive ? 'on' : 'off'}\n\t\t\tdisabled={!canToggle}\n\t\t\ttabIndex={-1}\n\t\t\ttype=\"button\"\n\t\t\tvariant=\"ghost\"\n\t\t\tonClick={handleClick}\n\t\t\t{...buttonProps}\n\t\t>\n\t\t\t<CodeBlockIcon className=\"tiptap-button-icon\" />\n\t\t</Button>\n\t);\n});\n\nCodeBlockButton.displayName = 'CodeBlockButton';\n","import { memo } from 'react';\n\ntype SvgProps = React.ComponentPropsWithoutRef<'svg'>;\n\nexport const CodeBlockIcon = memo(({ className, ...props }: SvgProps) => {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tfill=\"currentColor\"\n\t\t\theight=\"24\"\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\twidth=\"24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M6.70711 2.29289C7.09763 2.68342 7.09763 3.31658 6.70711 3.70711L4.41421 6L6.70711 8.29289C7.09763 8.68342 7.09763 9.31658 6.70711 9.70711C6.31658 10.0976 5.68342 10.0976 5.29289 9.70711L2.29289 6.70711C1.90237 6.31658 1.90237 5.68342 2.29289 5.29289L5.29289 2.29289C5.68342 1.90237 6.31658 1.90237 6.70711 2.29289Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M10.2929 2.29289C10.6834 1.90237 11.3166 1.90237 11.7071 2.29289L14.7071 5.29289C15.0976 5.68342 15.0976 6.31658 14.7071 6.70711L11.7071 9.70711C11.3166 10.0976 10.6834 10.0976 10.2929 9.70711C9.90237 9.31658 9.90237 8.68342 10.2929 8.29289L12.5858 6L10.2929 3.70711C9.90237 3.31658 9.90237 2.68342 10.2929 2.29289Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M17 4C17 3.44772 17.4477 3 18 3H19C20.6569 3 22 4.34315 22 6V18C22 19.6569 20.6569 21 19 21H5C3.34315 21 2 19.6569 2 18V12C2 11.4477 2.44772 11 3 11C3.55228 11 4 11.4477 4 12V18C4 18.5523 4.44772 19 5 19H19C19.5523 19 20 18.5523 20 18V6C20 5.44772 19.5523 5 19 5H18C17.4477 5 17 4.55228 17 4Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t</svg>\n\t);\n});\n\nCodeBlockIcon.displayName = 'CodeBlockIcon';\n","import { forwardRef } from 'react';\n\nimport { HeadingButton } from './heading-button';\nimport { getHeadingTriggerIcon, useActiveHeadingLevel } from './use-heading';\nimport { ChevronDownIcon } from '../../icons/chevron-down-icon';\nimport { Button } from '../button/button';\nimport { DropdownMenu } from '../ui-primitive/dropdown-menu';\n\nimport type { HeadingLevel } from './use-heading';\nimport type { Editor } from '@tiptap/core';\n\nexport interface HeadingDropdownMenuProps extends Omit<\n\tReact.ButtonHTMLAttributes<HTMLButtonElement>,\n\t'type'\n> {\n\teditor: Editor | null;\n\tlevels?: HeadingLevel[];\n}\n\nexport const HeadingDropdownMenu = forwardRef<\n\tHTMLButtonElement,\n\tHeadingDropdownMenuProps\n>(({ editor, levels = [1, 2, 3, 4], ...buttonProps }, ref) => {\n\tconst activeLevel = useActiveHeadingLevel(editor, levels);\n\tconst TriggerIcon = getHeadingTriggerIcon(activeLevel);\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\ttrigger={\n\t\t\t\t<Button\n\t\t\t\t\tref={ref}\n\t\t\t\t\taria-label=\"Heading\"\n\t\t\t\t\tdata-active-state={activeLevel !== null ? 'on' : 'off'}\n\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t{...buttonProps}\n\t\t\t\t>\n\t\t\t\t\t<TriggerIcon className=\"tiptap-button-icon\" />\n\t\t\t\t\t<ChevronDownIcon className=\"tiptap-button-dropdown-arrows\" />\n\t\t\t\t</Button>\n\t\t\t}\n\t\t>\n\t\t\t{levels.map((level) => (\n\t\t\t\t<HeadingButton key={level} editor={editor} level={level} />\n\t\t\t))}\n\t\t</DropdownMenu>\n\t);\n});\n\nHeadingDropdownMenu.displayName = 'HeadingDropdownMenu';\n","import { forwardRef, useCallback } from 'react';\n\nimport { useHeading } from './use-heading';\nimport { CheckIcon } from '../../icons/check-icon';\nimport { Button } from '../button/button';\n\nimport type { HeadingLevel } from './use-heading';\nimport type { Editor } from '@tiptap/core';\n\nexport interface HeadingButtonProps extends Omit<\n\tReact.ButtonHTMLAttributes<HTMLButtonElement>,\n\t'type'\n> {\n\teditor: Editor | null;\n\tlevel: HeadingLevel;\n}\n\nexport const HeadingButton = forwardRef<HTMLButtonElement, HeadingButtonProps>(\n\t({ editor, level, onClick, ...buttonProps }, ref) => {\n\t\tconst { isActive, canToggle, handleToggle, label, Icon } = useHeading({\n\t\t\teditor,\n\t\t\tlevel\n\t\t});\n\n\t\tconst handleClick = useCallback(\n\t\t\t(event: React.MouseEvent<HTMLButtonElement>) => {\n\t\t\t\tonClick?.(event);\n\n\t\t\t\tif (event.defaultPrevented) return;\n\n\t\t\t\thandleToggle();\n\t\t\t},\n\t\t\t[handleToggle, onClick]\n\t\t);\n\n\t\treturn (\n\t\t\t<Button\n\t\t\t\tref={ref}\n\t\t\t\taria-label={label}\n\t\t\t\taria-pressed={isActive}\n\t\t\t\tdata-active-state={isActive ? 'on' : 'off'}\n\t\t\t\tdisabled={!canToggle}\n\t\t\t\trole=\"menuitem\"\n\t\t\t\ttabIndex={-1}\n\t\t\t\ttype=\"button\"\n\t\t\t\tvariant=\"ghost\"\n\t\t\t\tonClick={handleClick}\n\t\t\t\t{...buttonProps}\n\t\t\t>\n\t\t\t\t<Icon className=\"tiptap-button-icon\" />\n\t\t\t\t<span className=\"tiptap-button-text\">{label}</span>\n\t\t\t\t{isActive && <CheckIcon />}\n\t\t\t</Button>\n\t\t);\n\t}\n);\n\nHeadingButton.displayName = 'HeadingButton';\n","import { useCallback, useEffect, useState } from 'react';\n\nimport { Heading1Icon } from '../../icons/heading-1-icon';\nimport { Heading2Icon } from '../../icons/heading-2-icon';\nimport { Heading3Icon } from '../../icons/heading-3-icon';\nimport { Heading4Icon } from '../../icons/heading-4-icon';\nimport { HeadingIcon } from '../../icons/heading-icon';\n\nimport type { Editor } from '@tiptap/core';\nimport type { ComponentPropsWithoutRef } from 'react';\n\nexport type HeadingLevel = 1 | 2 | 3 | 4;\n\ntype IconComponent = React.ComponentType<ComponentPropsWithoutRef<'svg'>>;\n\nconst headingIcons: Record<HeadingLevel, IconComponent> = {\n\t1: Heading1Icon,\n\t2: Heading2Icon,\n\t3: Heading3Icon,\n\t4: Heading4Icon\n};\n\nconst headingLabels: Record<HeadingLevel, string> = {\n\t1: 'Heading 1',\n\t2: 'Heading 2',\n\t3: 'Heading 3',\n\t4: 'Heading 4'\n};\n\nfunction canToggleHeading(editor: Editor | null, level: HeadingLevel): boolean {\n\tif (!editor || !editor.isEditable) return false;\n\n\treturn (\n\t\teditor.can().setNode('heading', { level }) || editor.can().clearNodes()\n\t);\n}\n\nexport function useHeading({\n\teditor,\n\tlevel\n}: {\n\teditor: Editor | null;\n\tlevel: HeadingLevel;\n}) {\n\tconst [isActive, setIsActive] = useState(false);\n\tconst [canToggle, setCanToggle] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\n\t\tconst handleUpdate = () => {\n\t\t\tsetIsActive(editor.isActive('heading', { level }));\n\t\t\tsetCanToggle(canToggleHeading(editor, level));\n\t\t};\n\n\t\thandleUpdate();\n\n\t\teditor.on('selectionUpdate', handleUpdate);\n\t\teditor.on('transaction', handleUpdate);\n\n\t\treturn () => {\n\t\t\teditor.off('selectionUpdate', handleUpdate);\n\t\t\teditor.off('transaction', handleUpdate);\n\t\t};\n\t}, [editor, level]);\n\n\tconst handleToggle = useCallback(() => {\n\t\tif (!editor || !editor.isEditable) return false;\n\n\t\tif (editor.isActive('heading', { level })) {\n\t\t\treturn editor.chain().focus().setNode('paragraph').run();\n\t\t}\n\n\t\t// clearNodes first to convert any block type to paragraph,\n\t\t// then set heading\n\t\treturn editor\n\t\t\t.chain()\n\t\t\t.focus()\n\t\t\t.clearNodes()\n\t\t\t.setNode('heading', { level })\n\t\t\t.run();\n\t}, [editor, level]);\n\n\treturn {\n\t\tisActive,\n\t\tcanToggle,\n\t\thandleToggle,\n\t\tlabel: headingLabels[level],\n\t\tIcon: headingIcons[level]\n\t};\n}\n\nexport function useActiveHeadingLevel(\n\teditor: Editor | null,\n\tlevels: HeadingLevel[]\n): HeadingLevel | null {\n\tconst [activeLevel, setActiveLevel] = useState<HeadingLevel | null>(null);\n\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\n\t\tconst handleUpdate = () => {\n\t\t\tconst found = levels.find((level) =>\n\t\t\t\teditor.isActive('heading', { level })\n\t\t\t);\n\n\t\t\tsetActiveLevel(found ?? null);\n\t\t};\n\n\t\thandleUpdate();\n\n\t\teditor.on('selectionUpdate', handleUpdate);\n\t\teditor.on('transaction', handleUpdate);\n\n\t\treturn () => {\n\t\t\teditor.off('selectionUpdate', handleUpdate);\n\t\t\teditor.off('transaction', handleUpdate);\n\t\t};\n\t}, [editor, levels]);\n\n\treturn activeLevel;\n}\n\nexport function getHeadingTriggerIcon(\n\tactiveLevel: HeadingLevel | null\n): IconComponent {\n\tif (activeLevel === null) return HeadingIcon;\n\n\treturn headingIcons[activeLevel];\n}\n","import { memo } from 'react';\n\ntype SvgProps = React.ComponentPropsWithoutRef<'svg'>;\n\nexport const Heading1Icon = memo(({ className, ...props }: SvgProps) => {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tfill=\"currentColor\"\n\t\t\theight=\"24\"\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\twidth=\"24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\td=\"M5 6C5 5.44772 4.55228 5 4 5C3.44772 5 3 5.44772 3 6V18C3 18.5523 3.44772 19 4 19C4.55228 19 5 18.5523 5 18V13H11V18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18V6C13 5.44772 12.5523 5 12 5C11.4477 5 11 5.44772 11 6V11H5V6Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M21.0001 10C21.0001 9.63121 20.7971 9.29235 20.472 9.11833C20.1468 8.94431 19.7523 8.96338 19.4454 9.16795L16.4454 11.168C15.9859 11.4743 15.8617 12.0952 16.1681 12.5547C16.4744 13.0142 17.0953 13.1384 17.5548 12.8321L19.0001 11.8685V18C19.0001 18.5523 19.4478 19 20.0001 19C20.5524 19 21.0001 18.5523 21.0001 18V10Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t/>\n\t\t</svg>\n\t);\n});\n\nHeading1Icon.displayName = 'Heading1Icon';\n","import { memo } from 'react';\n\ntype SvgProps = React.ComponentPropsWithoutRef<'svg'>;\n\nexport const Heading2Icon = memo(({ className, ...props }: SvgProps) => {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tfill=\"currentColor\"\n\t\t\theight=\"24\"\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\twidth=\"24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\td=\"M5 6C5 5.44772 4.55228 5 4 5C3.44772 5 3 5.44772 3 6V18C3 18.5523 3.44772 19 4 19C4.55228 19 5 18.5523 5 18V13H11V18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18V6C13 5.44772 12.5523 5 12 5C11.4477 5 11 5.44772 11 6V11H5V6Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M22.0001 12C22.0001 10.7611 21.1663 9.79297 20.0663 9.42632C18.9547 9.05578 17.6171 9.28724 16.4001 10.2C15.9582 10.5314 15.8687 11.1582 16.2001 11.6C16.5314 12.0418 17.1582 12.1314 17.6001 11.8C18.383 11.2128 19.0455 11.1942 19.4338 11.3237C19.8339 11.457 20.0001 11.7389 20.0001 12C20.0001 12.4839 19.8554 12.7379 19.6537 12.9481C19.4275 13.1837 19.1378 13.363 18.7055 13.6307C18.6313 13.6767 18.553 13.7252 18.4701 13.777C17.9572 14.0975 17.3128 14.5261 16.8163 15.2087C16.3007 15.9177 16.0001 16.8183 16.0001 18C16.0001 18.5523 16.4478 19 17.0001 19H21.0001C21.5523 19 22.0001 18.5523 22.0001 18C22.0001 17.4477 21.5523 17 21.0001 17H18.131C18.21 16.742 18.3176 16.5448 18.4338 16.385C18.6873 16.0364 19.0429 15.7775 19.5301 15.473C19.5898 15.4357 19.6536 15.3966 19.7205 15.3556C20.139 15.0992 20.6783 14.7687 21.0964 14.3332C21.6447 13.7621 22.0001 13.0161 22.0001 12Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t/>\n\t\t</svg>\n\t);\n});\n\nHeading2Icon.displayName = 'Heading2Icon';\n","import { memo } from 'react';\n\ntype SvgProps = React.ComponentPropsWithoutRef<'svg'>;\n\nexport const Heading3Icon = memo(({ className, ...props }: SvgProps) => {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tfill=\"currentColor\"\n\t\t\theight=\"24\"\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\twidth=\"24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\td=\"M4 5C4.55228 5 5 5.44772 5 6V11H11V6C11 5.44772 11.4477 5 12 5C12.5523 5 13 5.44772 13 6V18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18V13H5V18C5 18.5523 4.55228 19 4 19C3.44772 19 3 18.5523 3 18V6C3 5.44772 3.44772 5 4 5Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M19.4608 11.2169C19.1135 11.0531 18.5876 11.0204 18.0069 11.3619C17.5309 11.642 16.918 11.4831 16.638 11.007C16.358 10.531 16.5169 9.91809 16.9929 9.63807C18.1123 8.97962 19.3364 8.94691 20.314 9.40808C21.2839 9.86558 21.9999 10.818 21.9999 12C21.9999 12.7957 21.6838 13.5587 21.1212 14.1213C20.5586 14.6839 19.7956 15 18.9999 15C18.4476 15 17.9999 14.5523 17.9999 14C17.9999 13.4477 18.4476 13 18.9999 13C19.2651 13 19.5195 12.8947 19.707 12.7071C19.8946 12.5196 19.9999 12.2652 19.9999 12C19.9999 11.6821 19.8159 11.3844 19.4608 11.2169Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M18.0001 14C18.0001 13.4477 18.4478 13 19.0001 13C19.7957 13 20.5588 13.3161 21.1214 13.8787C21.684 14.4413 22.0001 15.2043 22.0001 16C22.0001 17.2853 21.2767 18.3971 20.1604 18.8994C19.0257 19.41 17.642 19.2315 16.4001 18.3C15.9582 17.9686 15.8687 17.3418 16.2001 16.9C16.5314 16.4582 17.1582 16.3686 17.6001 16.7C18.3581 17.2685 18.9744 17.24 19.3397 17.0756C19.7234 16.9029 20.0001 16.5147 20.0001 16C20.0001 15.7348 19.8947 15.4804 19.7072 15.2929C19.5196 15.1054 19.2653 15 19.0001 15C18.4478 15 18.0001 14.5523 18.0001 14Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t</svg>\n\t);\n});\n\nHeading3Icon.displayName = 'Heading3Icon';\n","import { memo } from 'react';\n\ntype SvgProps = React.ComponentPropsWithoutRef<'svg'>;\n\nexport const Heading4Icon = memo(({ className, ...props }: SvgProps) => {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tfill=\"currentColor\"\n\t\t\theight=\"24\"\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\twidth=\"24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\td=\"M4 5C4.55228 5 5 5.44772 5 6V11H11V6C11 5.44772 11.4477 5 12 5C12.5523 5 13 5.44772 13 6V18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18V13H5V18C5 18.5523 4.55228 19 4 19C3.44772 19 3 18.5523 3 18V6C3 5.44772 3.44772 5 4 5Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M17 9C17.5523 9 18 9.44772 18 10V13H20V10C20 9.44772 20.4477 9 21 9C21.5523 9 22 9.44772 22 10V18C22 18.5523 21.5523 19 21 19C20.4477 19 20 18.5523 20 18V15H17C16.4477 15 16 14.5523 16 14V10C16 9.44772 16.4477 9 17 9Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t/>\n\t\t</svg>\n\t);\n});\n\nHeading4Icon.displayName = 'Heading4Icon';\n","import { memo } from 'react';\n\ntype SvgProps = React.ComponentPropsWithoutRef<'svg'>;\n\nexport const HeadingIcon = memo(({ className, ...props }: SvgProps) => {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tfill=\"currentColor\"\n\t\t\theight=\"24\"\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\twidth=\"24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\td=\"M6 3C6.55228 3 7 3.44772 7 4V11H17V4C17 3.44772 17.4477 3 18 3C18.5523 3 19 3.44772 19 4V20C19 20.5523 18.5523 21 18 21C17.4477 21 17 20.5523 17 20V13H7V20C7 20.5523 6.55228 21 6 21C5.44772 21 5 20.5523 5 20V4C5 3.44772 5.44772 3 6 3Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t/>\n\t\t</svg>\n\t);\n});\n\nHeadingIcon.displayName = 'HeadingIcon';\n","import { memo } from 'react';\n\ntype SvgProps = React.ComponentPropsWithoutRef<'svg'>;\n\nexport const CheckIcon = memo(({ className, ...props }: SvgProps) => {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tfill=\"currentColor\"\n\t\t\theight=\"24\"\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\twidth=\"24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M20.7071 5.29289C21.0976 5.68342 21.0976 6.31658 20.7071 6.70711L9.70711 17.7071C9.31658 18.0976 8.68342 18.0976 8.29289 17.7071L3.29289 12.7071C2.90237 12.3166 2.90237 11.6834 3.29289 11.2929C3.68342 10.9024 4.31658 10.9024 4.70711 11.2929L9 15.5858L19.2929 5.29289C19.6834 4.90237 20.3166 4.90237 20.7071 5.29289Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t</svg>\n\t);\n});\n\nCheckIcon.displayName = 'CheckIcon';\n","import { memo } from 'react';\n\ntype SvgProps = React.ComponentPropsWithoutRef<'svg'>;\n\nexport const ChevronDownIcon = memo(({ className, ...props }: SvgProps) => {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tfill=\"currentColor\"\n\t\t\theight=\"24\"\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\twidth=\"24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M5.29289 8.29289C5.68342 7.90237 6.31658 7.90237 6.70711 8.29289L12 13.5858L17.2929 8.29289C17.6834 7.90237 18.3166 7.90237 18.7071 8.29289C19.0976 8.68342 19.0976 9.31658 18.7071 9.70711L12.7071 15.7071C12.3166 16.0976 11.6834 16.0976 11.2929 15.7071L5.29289 9.70711C4.90237 9.31658 4.90237 8.68342 5.29289 8.29289Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t</svg>\n\t);\n});\n\nChevronDownIcon.displayName = 'ChevronDownIcon';\n","import { useEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport type { ReactNode } from 'react';\n\nexport interface DropdownMenuProps {\n\ttrigger: ReactNode;\n\tchildren: ReactNode;\n\topen?: boolean;\n\tonOpenChange?: (open: boolean) => void;\n}\n\nexport function DropdownMenu({\n\ttrigger,\n\tchildren,\n\topen: controlledOpen,\n\tonOpenChange\n}: DropdownMenuProps) {\n\tconst isControlled = controlledOpen !== undefined;\n\tconst [uncontrolledOpen, setUncontrolledOpen] = useState(false);\n\tconst open = isControlled ? controlledOpen : uncontrolledOpen;\n\tconst triggerRef = useRef<HTMLDivElement>(null);\n\tconst contentRef = useRef<HTMLDivElement>(null);\n\tconst [position, setPosition] = useState({ top: 0, left: 0 });\n\n\tconst setOpen = (value: boolean) => {\n\t\tif (!isControlled) {\n\t\t\tsetUncontrolledOpen(value);\n\t\t}\n\n\t\tonOpenChange?.(value);\n\t};\n\n\t// Compute position from trigger bounding rect\n\tuseEffect(() => {\n\t\tif (!open || !triggerRef.current) return;\n\n\t\tconst updatePosition = () => {\n\t\t\tif (!triggerRef.current) return;\n\n\t\t\tconst rect = triggerRef.current.getBoundingClientRect();\n\n\t\t\tsetPosition({\n\t\t\t\ttop: rect.bottom + 4,\n\t\t\t\tleft: rect.left + rect.width / 2\n\t\t\t});\n\t\t};\n\n\t\tupdatePosition();\n\n\t\twindow.addEventListener('scroll', updatePosition, true);\n\t\twindow.addEventListener('resize', updatePosition);\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener('scroll', updatePosition, true);\n\t\t\twindow.removeEventListener('resize', updatePosition);\n\t\t};\n\t}, [open]);\n\n\t// Close on click outside\n\tuseEffect(() => {\n\t\tif (!open) return;\n\n\t\tconst handleMouseDown = (event: MouseEvent) => {\n\t\t\tconst target = event.target as Node;\n\n\t\t\tif (\n\t\t\t\ttriggerRef.current?.contains(target) ||\n\t\t\t\tcontentRef.current?.contains(target)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetOpen(false);\n\t\t};\n\n\t\tdocument.addEventListener('mousedown', handleMouseDown);\n\n\t\treturn () => document.removeEventListener('mousedown', handleMouseDown);\n\t}, [open]);\n\n\t// Close on Escape key\n\tuseEffect(() => {\n\t\tif (!open) return;\n\n\t\tconst handleKeyDown = (event: KeyboardEvent) => {\n\t\t\tif (event.key === 'Escape') {\n\t\t\t\tsetOpen(false);\n\t\t\t}\n\t\t};\n\n\t\tdocument.addEventListener('keydown', handleKeyDown);\n\n\t\treturn () => document.removeEventListener('keydown', handleKeyDown);\n\t}, [open]);\n\n\treturn (\n\t\t<>\n\t\t\t<div ref={triggerRef} onClick={() => setOpen(!open)}>\n\t\t\t\t{trigger}\n\t\t\t</div>\n\t\t\t{open &&\n\t\t\t\tcreatePortal(\n\t\t\t\t\t<div className=\"notra-editor\">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={contentRef}\n\t\t\t\t\t\t\tclassName=\"tiptap-dropdown-menu-content\"\n\t\t\t\t\t\t\tdata-state=\"open\"\n\t\t\t\t\t\t\trole=\"menu\"\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tposition: 'fixed',\n\t\t\t\t\t\t\t\ttop: position.top,\n\t\t\t\t\t\t\t\tleft: position.left\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName=\"tiptap-dropdown-menu-group\"\n\t\t\t\t\t\t\t\tonClick={() => setOpen(false)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>,\n\t\t\t\t\tdocument.body\n\t\t\t\t)}\n\t\t</>\n\t);\n}\n","import { forwardRef, useCallback, useEffect, useState } from 'react';\n\nimport { useLinkPopover } from './use-link-popover';\nimport { CornerDownLeftIcon } from '../../icons/corner-down-left-icon';\nimport { ExternalLinkIcon } from '../../icons/external-link-icon';\nimport { LinkIcon } from '../../icons/link-icon';\nimport { TrashIcon } from '../../icons/trash-icon';\nimport { Button } from '../button/button';\nimport { ToolbarSeparator } from '../toolbar/toolbar';\nimport { Card, CardBody, CardItemGroup } from '../ui-primitive/card';\nimport { Input } from '../ui-primitive/input';\nimport { Popover } from '../ui-primitive/popover';\n\nimport type { Editor } from '@tiptap/core';\n\nexport interface LinkPopoverProps extends Omit<\n\tReact.ButtonHTMLAttributes<HTMLButtonElement>,\n\t'type'\n> {\n\teditor: Editor | null;\n}\n\nexport const LinkPopover = forwardRef<HTMLButtonElement, LinkPopoverProps>(\n\t({ editor, ...buttonProps }, ref) => {\n\t\tconst [isOpen, setIsOpen] = useState(false);\n\n\t\tconst { url, setUrl, isActive, canSet, setLink, removeLink, openLink } =\n\t\t\tuseLinkPopover({ editor });\n\n\t\t// Auto-open popover when a link becomes active\n\t\tuseEffect(() => {\n\t\t\tif (isActive) {\n\t\t\t\tsetIsOpen(true);\n\t\t\t}\n\t\t}, [isActive]);\n\n\t\tconst handleSetLink = useCallback(() => {\n\t\t\tsetLink();\n\t\t\tsetIsOpen(false);\n\t\t}, [setLink]);\n\n\t\tconst handleRemoveLink = useCallback(() => {\n\t\t\tremoveLink();\n\t\t\tsetIsOpen(false);\n\t\t}, [removeLink]);\n\n\t\tconst handleKeyDown = useCallback(\n\t\t\t(event: React.KeyboardEvent<HTMLInputElement>) => {\n\t\t\t\tif (event.key === 'Enter') {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\thandleSetLink();\n\t\t\t\t}\n\t\t\t},\n\t\t\t[handleSetLink]\n\t\t);\n\n\t\treturn (\n\t\t\t<Popover\n\t\t\t\topen={isOpen}\n\t\t\t\ttrigger={\n\t\t\t\t\t<Button\n\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\taria-label=\"Link\"\n\t\t\t\t\t\taria-pressed={isActive}\n\t\t\t\t\t\tdata-active-state={isActive ? 'on' : 'off'}\n\t\t\t\t\t\tdisabled={!canSet}\n\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\tonClick={() => setIsOpen((prev) => !prev)}\n\t\t\t\t\t\t{...buttonProps}\n\t\t\t\t\t>\n\t\t\t\t\t\t<LinkIcon className=\"tiptap-button-icon\" />\n\t\t\t\t\t</Button>\n\t\t\t\t}\n\t\t\t\tonOpenChange={setIsOpen}\n\t\t\t>\n\t\t\t\t<Card>\n\t\t\t\t\t<CardBody>\n\t\t\t\t\t\t<CardItemGroup orientation=\"horizontal\">\n\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\tautoFocus\n\t\t\t\t\t\t\t\tclassName=\"tiptap-link-input\"\n\t\t\t\t\t\t\t\tplaceholder=\"Paste a link...\"\n\t\t\t\t\t\t\t\ttype=\"url\"\n\t\t\t\t\t\t\t\tvalue={url}\n\t\t\t\t\t\t\t\tonChange={(e) => setUrl(e.target.value)}\n\t\t\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\taria-label=\"Apply link\"\n\t\t\t\t\t\t\t\tdisabled={!url && !isActive}\n\t\t\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\t\t\tonClick={handleSetLink}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<CornerDownLeftIcon className=\"tiptap-button-icon\" />\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t<ToolbarSeparator />\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\taria-label=\"Open link in new window\"\n\t\t\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\t\t\tonClick={openLink}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ExternalLinkIcon className=\"tiptap-button-icon\" />\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\taria-label=\"Remove link\"\n\t\t\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\t\t\tonClick={handleRemoveLink}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<TrashIcon className=\"tiptap-button-icon\" />\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</CardItemGroup>\n\t\t\t\t\t</CardBody>\n\t\t\t\t</Card>\n\t\t\t</Popover>\n\t\t);\n\t}\n);\n\nLinkPopover.displayName = 'LinkPopover';\n","import { useCallback, useEffect, useState } from 'react';\n\nimport type { Editor } from '@tiptap/core';\n\nexport interface UseLinkPopoverConfig {\n\teditor: Editor | null;\n}\n\nexport function useLinkPopover({ editor }: UseLinkPopoverConfig) {\n\tconst [url, setUrl] = useState('');\n\tconst [isActive, setIsActive] = useState(false);\n\tconst [canSet, setCanSet] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\n\t\tconst handleUpdate = () => {\n\t\t\tconst active = editor.isActive('link');\n\n\t\t\tsetIsActive(active);\n\t\t\tsetCanSet(editor.isEditable);\n\n\t\t\tif (active) {\n\t\t\t\tsetUrl(editor.getAttributes('link').href ?? '');\n\t\t\t}\n\t\t};\n\n\t\thandleUpdate();\n\n\t\teditor.on('selectionUpdate', handleUpdate);\n\t\teditor.on('transaction', handleUpdate);\n\n\t\treturn () => {\n\t\t\teditor.off('selectionUpdate', handleUpdate);\n\t\t\teditor.off('transaction', handleUpdate);\n\t\t};\n\t}, [editor]);\n\n\tconst setLink = useCallback(() => {\n\t\tif (!editor) return;\n\n\t\tif (!url) {\n\t\t\teditor.chain().focus().extendMarkRange('link').unsetLink().run();\n\n\t\t\treturn;\n\t\t}\n\n\t\teditor.chain().focus().extendMarkRange('link').setLink({ href: url }).run();\n\t}, [editor, url]);\n\n\tconst removeLink = useCallback(() => {\n\t\tif (!editor) return;\n\n\t\teditor.chain().focus().extendMarkRange('link').unsetLink().run();\n\t\tsetUrl('');\n\t}, [editor]);\n\n\tconst openLink = useCallback(() => {\n\t\tif (!url) return;\n\n\t\tconst sanitized = /^https?:\\/\\//i.test(url) ? url : `https://${url}`;\n\n\t\twindow.open(sanitized, '_blank', 'noopener,noreferrer');\n\t}, [url]);\n\n\treturn { url, setUrl, isActive, canSet, setLink, removeLink, openLink };\n}\n","import { memo } from 'react';\n\ntype SvgProps = React.ComponentPropsWithoutRef<'svg'>;\n\nexport const CornerDownLeftIcon = memo(({ className, ...props }: SvgProps) => {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tfill=\"currentColor\"\n\t\t\theight=\"24\"\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\twidth=\"24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M21 4C21 3.44772 20.5523 3 20 3C19.4477 3 19 3.44772 19 4V11C19 11.7956 18.6839 12.5587 18.1213 13.1213C17.5587 13.6839 16.7956 14 16 14H6.41421L9.70711 10.7071C10.0976 10.3166 10.0976 9.68342 9.70711 9.29289C9.31658 8.90237 8.68342 8.90237 8.29289 9.29289L3.29289 14.2929C2.90237 14.6834 2.90237 15.3166 3.29289 15.7071L8.29289 20.7071C8.68342 21.0976 9.31658 21.0976 9.70711 20.7071C10.0976 20.3166 10.0976 19.6834 9.70711 19.2929L6.41421 16H16C17.3261 16 18.5979 15.4732 19.5355 14.5355C20.4732 13.5979 21 12.3261 21 11V4Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t</svg>\n\t);\n});\n\nCornerDownLeftIcon.displayName = 'CornerDownLeftIcon';\n","import { memo } from 'react';\n\ntype SvgProps = React.ComponentPropsWithoutRef<'svg'>;\n\nexport const ExternalLinkIcon = memo(({ className, ...props }: SvgProps) => {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tfill=\"currentColor\"\n\t\t\theight=\"24\"\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\twidth=\"24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\td=\"M14 3C14 2.44772 14.4477 2 15 2H21C21.5523 2 22 2.44772 22 3V9C22 9.55228 21.5523 10 21 10C20.4477 10 20 9.55228 20 9V5.41421L10.7071 14.7071C10.3166 15.0976 9.68342 15.0976 9.29289 14.7071C8.90237 14.3166 8.90237 13.6834 9.29289 13.2929L18.5858 4H15C14.4477 4 14 3.55228 14 3Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M4.29289 7.29289C4.48043 7.10536 4.73478 7 5 7H11C11.5523 7 12 6.55228 12 6C12 5.44772 11.5523 5 11 5H5C4.20435 5 3.44129 5.31607 2.87868 5.87868C2.31607 6.44129 2 7.20435 2 8V19C2 19.7957 2.31607 20.5587 2.87868 21.1213C3.44129 21.6839 4.20435 22 5 22H16C16.7957 22 17.5587 21.6839 18.1213 21.1213C18.6839 20.5587 19 19.7957 19 19V13C19 12.4477 18.5523 12 18 12C17.4477 12 17 12.4477 17 13V19C17 19.2652 16.8946 19.5196 16.7071 19.7071C16.5196 19.8946 16.2652 20 16 20H5C4.73478 20 4.48043 19.8946 4.29289 19.7071C4.10536 19.5196 4 19.2652 4 19V8C4 7.73478 4.10536 7.48043 4.29289 7.29289Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t/>\n\t\t</svg>\n\t);\n});\n\nExternalLinkIcon.displayName = 'ExternalLinkIcon';\n","import { memo } from 'react';\n\ntype SvgProps = React.ComponentPropsWithoutRef<'svg'>;\n\nexport const LinkIcon = memo(({ className, ...props }: SvgProps) => {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tfill=\"currentColor\"\n\t\t\theight=\"24\"\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\twidth=\"24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\td=\"M16.9958 1.06669C15.4226 1.05302 13.907 1.65779 12.7753 2.75074L12.765 2.76086L11.045 4.47086C10.6534 4.86024 10.6515 5.49341 11.0409 5.88507C11.4303 6.27673 12.0634 6.27858 12.4551 5.88919L14.1697 4.18456C14.9236 3.45893 15.9319 3.05752 16.9784 3.06662C18.0272 3.07573 19.0304 3.49641 19.772 4.23804C20.5137 4.97967 20.9344 5.98292 20.9435 7.03171C20.9526 8.07776 20.5515 9.08563 19.8265 9.83941L16.833 12.8329C16.4274 13.2386 15.9393 13.5524 15.4019 13.7529C14.8645 13.9533 14.2903 14.0359 13.7181 13.9949C13.146 13.9539 12.5894 13.7904 12.0861 13.5154C11.5827 13.2404 11.1444 12.8604 10.8008 12.401C10.47 11.9588 9.84333 11.8685 9.40108 12.1993C8.95883 12.5301 8.86849 13.1568 9.1993 13.599C9.71464 14.288 10.3721 14.858 11.1272 15.2705C11.8822 15.683 12.7171 15.9283 13.5753 15.9898C14.4334 16.0513 15.2948 15.9274 16.1009 15.6267C16.907 15.326 17.639 14.8555 18.2473 14.247L21.2472 11.2471L21.2593 11.2347C22.3523 10.1031 22.9571 8.58751 22.9434 7.01433C22.9297 5.44115 22.2987 3.93628 21.1863 2.82383C20.0738 1.71138 18.5689 1.08036 16.9958 1.06669Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M10.4247 8.0102C9.56657 7.94874 8.70522 8.07256 7.89911 8.37326C7.09305 8.67395 6.36096 9.14458 5.75272 9.753L2.75285 12.7529L2.74067 12.7653C1.64772 13.8969 1.04295 15.4125 1.05662 16.9857C1.07029 18.5589 1.70131 20.0637 2.81376 21.1762C3.9262 22.2886 5.43108 22.9196 7.00426 22.9333C8.57744 22.947 10.0931 22.3422 11.2247 21.2493L11.2371 21.2371L12.9471 19.5271C13.3376 19.1366 13.3376 18.5034 12.9471 18.1129C12.5565 17.7223 11.9234 17.7223 11.5328 18.1129L9.82932 19.8164C9.07555 20.5414 8.06768 20.9425 7.02164 20.9334C5.97285 20.9243 4.9696 20.5036 4.22797 19.762C3.48634 19.0203 3.06566 18.0171 3.05655 16.9683C3.04746 15.9222 3.44851 14.9144 4.17355 14.1606L7.16719 11.167C7.5727 10.7613 8.06071 10.4476 8.59811 10.2471C9.13552 10.0467 9.70976 9.96412 10.2819 10.0051C10.854 10.0461 11.4106 10.2096 11.9139 10.4846C12.4173 10.7596 12.8556 11.1397 13.1992 11.599C13.53 12.0412 14.1567 12.1316 14.5989 11.8007C15.0412 11.4699 15.1315 10.8433 14.8007 10.401C14.2854 9.71205 13.6279 9.14198 12.8729 8.72948C12.1178 8.31697 11.2829 8.07166 10.4247 8.0102Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t/>\n\t\t</svg>\n\t);\n});\n\nLinkIcon.displayName = 'LinkIcon';\n","import { memo } from 'react';\n\ntype SvgProps = React.ComponentPropsWithoutRef<'svg'>;\n\nexport const TrashIcon = memo(({ className, ...props }: SvgProps) => {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tfill=\"currentColor\"\n\t\t\theight=\"24\"\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\twidth=\"24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M7 5V4C7 3.17477 7.40255 2.43324 7.91789 1.91789C8.43324 1.40255 9.17477 1 10 1H14C14.8252 1 15.5668 1.40255 16.0821 1.91789C16.5975 2.43324 17 3.17477 17 4V5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H20V20C20 20.8252 19.5975 21.5668 19.0821 22.0821C18.5668 22.5975 17.8252 23 17 23H7C6.17477 23 5.43324 22.5975 4.91789 22.0821C4.40255 21.5668 4 20.8252 4 20V7H3C2.44772 7 2 6.55228 2 6C2 5.44772 2.44772 5 3 5H7ZM9 4C9 3.82523 9.09745 3.56676 9.33211 3.33211C9.56676 3.09745 9.82523 3 10 3H14C14.1748 3 14.4332 3.09745 14.6679 3.33211C14.9025 3.56676 15 3.82523 15 4V5H9V4ZM6 7V20C6 20.1748 6.09745 20.4332 6.33211 20.6679C6.56676 20.9025 6.82523 21 7 21H17C17.1748 21 17.4332 20.9025 17.6679 20.6679C17.9025 20.4332 18 20.1748 18 20V7H6Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t</svg>\n\t);\n});\n\nTrashIcon.displayName = 'TrashIcon';\n","import { forwardRef } from 'react';\n\nexport interface ToolbarProps extends React.HTMLAttributes<HTMLDivElement> {\n\tvariant?: 'fixed' | 'floating';\n}\n\nexport const Toolbar = forwardRef<HTMLDivElement, ToolbarProps>(\n\t({ children, className, variant = 'fixed', ...props }, ref) => {\n\t\tconst classNames = ['tiptap-toolbar', className].filter(Boolean).join(' ');\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\taria-label=\"toolbar\"\n\t\t\t\tclassName={classNames}\n\t\t\t\tdata-variant={variant}\n\t\t\t\trole=\"toolbar\"\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t}\n);\n\nToolbar.displayName = 'Toolbar';\n\nexport function ToolbarGroup({\n\tchildren,\n\tclassName,\n\t...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n\tconst classNames = ['tiptap-toolbar-group', className]\n\t\t.filter(Boolean)\n\t\t.join(' ');\n\n\treturn (\n\t\t<div className={classNames} role=\"group\" {...props}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n\nexport interface ToolbarSeparatorProps extends React.HTMLAttributes<HTMLDivElement> {\n\torientation?: 'horizontal' | 'vertical';\n}\n\nexport function ToolbarSeparator({\n\torientation = 'vertical',\n\tclassName,\n\t...props\n}: ToolbarSeparatorProps) {\n\tconst classNames = ['tiptap-separator', className].filter(Boolean).join(' ');\n\n\treturn (\n\t\t<div\n\t\t\taria-orientation={orientation === 'vertical' ? orientation : undefined}\n\t\t\tclassName={classNames}\n\t\t\tdata-orientation={orientation}\n\t\t\trole=\"separator\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n","import { forwardRef } from 'react';\n\nexport interface CardProps extends React.HTMLAttributes<HTMLDivElement> {\n\tstyle?: React.CSSProperties;\n}\n\nexport const Card = forwardRef<HTMLDivElement, CardProps>(\n\t({ className, style, ...props }, ref) => {\n\t\tconst classNames = ['tiptap-card', className].filter(Boolean).join(' ');\n\n\t\treturn <div ref={ref} className={classNames} style={style} {...props} />;\n\t}\n);\n\nCard.displayName = 'Card';\n\nexport interface CardBodyProps extends React.HTMLAttributes<HTMLDivElement> {\n\tstyle?: React.CSSProperties;\n}\n\nexport const CardBody = forwardRef<HTMLDivElement, CardBodyProps>(\n\t({ className, style, ...props }, ref) => {\n\t\tconst classNames = ['tiptap-card-body', className]\n\t\t\t.filter(Boolean)\n\t\t\t.join(' ');\n\n\t\treturn <div ref={ref} className={classNames} style={style} {...props} />;\n\t}\n);\n\nCardBody.displayName = 'CardBody';\n\nexport interface CardItemGroupProps extends React.HTMLAttributes<HTMLDivElement> {\n\torientation?: 'horizontal' | 'vertical';\n\tstyle?: React.CSSProperties;\n}\n\nexport const CardItemGroup = forwardRef<HTMLDivElement, CardItemGroupProps>(\n\t({ className, orientation = 'vertical', style, ...props }, ref) => {\n\t\tconst classNames = ['tiptap-card-item-group', className]\n\t\t\t.filter(Boolean)\n\t\t\t.join(' ');\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tclassName={classNames}\n\t\t\t\tdata-orientation={orientation}\n\t\t\t\tstyle={style}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t}\n);\n\nCardItemGroup.displayName = 'CardItemGroup';\n","import React from 'react';\n\nexport function Input({ className, ...props }: React.ComponentProps<'input'>) {\n\tconst classNames = ['tiptap-input', className].filter(Boolean).join(' ');\n\n\treturn <input className={classNames} {...props} />;\n}\n","import { useEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport type { ReactNode } from 'react';\n\nexport interface PopoverProps {\n\ttrigger: ReactNode;\n\tchildren: ReactNode;\n\topen: boolean;\n\tonOpenChange: (open: boolean) => void;\n}\n\nexport function Popover({\n\ttrigger,\n\tchildren,\n\topen,\n\tonOpenChange\n}: PopoverProps) {\n\tconst triggerRef = useRef<HTMLDivElement>(null);\n\tconst contentRef = useRef<HTMLDivElement>(null);\n\tconst [position, setPosition] = useState({ top: 0, left: 0 });\n\n\t// Compute position from trigger bounding rect\n\tuseEffect(() => {\n\t\tif (!open || !triggerRef.current) return;\n\n\t\tconst updatePosition = () => {\n\t\t\tif (!triggerRef.current) return;\n\n\t\t\tconst rect = triggerRef.current.getBoundingClientRect();\n\n\t\t\tsetPosition({\n\t\t\t\ttop: rect.bottom + 4,\n\t\t\t\tleft: rect.left + rect.width / 2\n\t\t\t});\n\t\t};\n\n\t\tupdatePosition();\n\n\t\twindow.addEventListener('scroll', updatePosition, true);\n\t\twindow.addEventListener('resize', updatePosition);\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener('scroll', updatePosition, true);\n\t\t\twindow.removeEventListener('resize', updatePosition);\n\t\t};\n\t}, [open]);\n\n\t// Close on click outside\n\tuseEffect(() => {\n\t\tif (!open) return;\n\n\t\tconst handleMouseDown = (event: MouseEvent) => {\n\t\t\tconst target = event.target as Node;\n\n\t\t\tif (\n\t\t\t\ttriggerRef.current?.contains(target) ||\n\t\t\t\tcontentRef.current?.contains(target)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonOpenChange(false);\n\t\t};\n\n\t\tdocument.addEventListener('mousedown', handleMouseDown);\n\n\t\treturn () => document.removeEventListener('mousedown', handleMouseDown);\n\t}, [open, onOpenChange]);\n\n\t// Close on Escape key\n\tuseEffect(() => {\n\t\tif (!open) return;\n\n\t\tconst handleKeyDown = (event: KeyboardEvent) => {\n\t\t\tif (event.key === 'Escape') {\n\t\t\t\tonOpenChange(false);\n\t\t\t}\n\t\t};\n\n\t\tdocument.addEventListener('keydown', handleKeyDown);\n\n\t\treturn () => document.removeEventListener('keydown', handleKeyDown);\n\t}, [open, onOpenChange]);\n\n\treturn (\n\t\t<>\n\t\t\t<div ref={triggerRef}>{trigger}</div>\n\t\t\t{open &&\n\t\t\t\tcreatePortal(\n\t\t\t\t\t<div className=\"notra-editor\">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={contentRef}\n\t\t\t\t\t\t\tclassName=\"tiptap-popover-content\"\n\t\t\t\t\t\t\tdata-state=\"open\"\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tposition: 'fixed',\n\t\t\t\t\t\t\t\ttop: position.top,\n\t\t\t\t\t\t\t\tleft: position.left\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>,\n\t\t\t\t\tdocument.body\n\t\t\t\t)}\n\t\t</>\n\t);\n}\n","import { forwardRef } from 'react';\n\nimport { ListButton } from './list-button';\nimport { getListTriggerIcon, useActiveListType } from './use-list';\nimport { ChevronDownIcon } from '../../icons/chevron-down-icon';\nimport { Button } from '../button/button';\nimport { DropdownMenu } from '../ui-primitive/dropdown-menu';\n\nimport type { ListType } from './use-list';\nimport type { Editor } from '@tiptap/core';\n\nexport interface ListDropdownMenuProps extends Omit<\n\tReact.ButtonHTMLAttributes<HTMLButtonElement>,\n\t'type'\n> {\n\teditor: Editor | null;\n\ttypes?: ListType[];\n}\n\nexport const ListDropdownMenu = forwardRef<\n\tHTMLButtonElement,\n\tListDropdownMenuProps\n>(\n\t(\n\t\t{\n\t\t\teditor,\n\t\t\ttypes = ['bulletList', 'orderedList', 'taskList'],\n\t\t\t...buttonProps\n\t\t},\n\t\tref\n\t) => {\n\t\tconst activeType = useActiveListType(editor, types);\n\t\tconst TriggerIcon = getListTriggerIcon(activeType);\n\n\t\treturn (\n\t\t\t<DropdownMenu\n\t\t\t\ttrigger={\n\t\t\t\t\t<Button\n\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\taria-label=\"List\"\n\t\t\t\t\t\tdata-active-state={activeType !== null ? 'on' : 'off'}\n\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\t{...buttonProps}\n\t\t\t\t\t>\n\t\t\t\t\t\t<TriggerIcon className=\"tiptap-button-icon\" />\n\t\t\t\t\t\t<ChevronDownIcon className=\"tiptap-button-dropdown-arrows\" />\n\t\t\t\t\t</Button>\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t{types.map((type) => (\n\t\t\t\t\t<ListButton key={type} editor={editor} listType={type} />\n\t\t\t\t))}\n\t\t\t</DropdownMenu>\n\t\t);\n\t}\n);\n\nListDropdownMenu.displayName = 'ListDropdownMenu';\n","import { forwardRef, useCallback } from 'react';\n\nimport { useList } from './use-list';\nimport { CheckIcon } from '../../icons/check-icon';\nimport { Button } from '../button/button';\n\nimport type { ListType } from './use-list';\nimport type { Editor } from '@tiptap/core';\n\nexport interface ListButtonProps extends Omit<\n\tReact.ButtonHTMLAttributes<HTMLButtonElement>,\n\t'type'\n> {\n\teditor: Editor | null;\n\tlistType: ListType;\n}\n\nexport const ListButton = forwardRef<HTMLButtonElement, ListButtonProps>(\n\t({ editor, listType, onClick, ...buttonProps }, ref) => {\n\t\tconst { isActive, canToggle, handleToggle, label, Icon } = useList({\n\t\t\teditor,\n\t\t\ttype: listType\n\t\t});\n\n\t\tconst handleClick = useCallback(\n\t\t\t(event: React.MouseEvent<HTMLButtonElement>) => {\n\t\t\t\tonClick?.(event);\n\n\t\t\t\tif (event.defaultPrevented) return;\n\n\t\t\t\thandleToggle();\n\t\t\t},\n\t\t\t[handleToggle, onClick]\n\t\t);\n\n\t\treturn (\n\t\t\t<Button\n\t\t\t\tref={ref}\n\t\t\t\taria-label={label}\n\t\t\t\taria-pressed={isActive}\n\t\t\t\tdata-active-state={isActive ? 'on' : 'off'}\n\t\t\t\tdisabled={!canToggle}\n\t\t\t\trole=\"menuitem\"\n\t\t\t\ttabIndex={-1}\n\t\t\t\ttype=\"button\"\n\t\t\t\tvariant=\"ghost\"\n\t\t\t\tonClick={handleClick}\n\t\t\t\t{...buttonProps}\n\t\t\t>\n\t\t\t\t<Icon className=\"tiptap-button-icon\" />\n\t\t\t\t<span className=\"tiptap-button-text\">{label}</span>\n\t\t\t\t{isActive && <CheckIcon />}\n\t\t\t</Button>\n\t\t);\n\t}\n);\n\nListButton.displayName = 'ListButton';\n","import { useCallback, useEffect, useState } from 'react';\n\nimport { BulletListIcon } from '../../icons/bullet-list-icon';\nimport { OrderedListIcon } from '../../icons/ordered-list-icon';\nimport { TaskListIcon } from '../../icons/task-list-icon';\n\nimport type { Editor } from '@tiptap/core';\nimport type { ComponentPropsWithoutRef } from 'react';\n\nexport type ListType = 'bulletList' | 'orderedList' | 'taskList';\n\ntype IconComponent = React.ComponentType<ComponentPropsWithoutRef<'svg'>>;\n\nconst listIcons: Record<ListType, IconComponent> = {\n\tbulletList: BulletListIcon,\n\torderedList: OrderedListIcon,\n\ttaskList: TaskListIcon\n};\n\nconst listLabels: Record<ListType, string> = {\n\tbulletList: 'Bullet List',\n\torderedList: 'Ordered List',\n\ttaskList: 'Task List'\n};\n\nconst listItemTypes: Record<ListType, string> = {\n\tbulletList: 'listItem',\n\torderedList: 'listItem',\n\ttaskList: 'taskItem'\n};\n\nfunction canToggleList(editor: Editor | null): boolean {\n\tif (!editor || !editor.isEditable) return false;\n\n\treturn (\n\t\teditor.can().toggleList('bulletList', 'listItem') ||\n\t\teditor.can().clearNodes()\n\t);\n}\n\nexport function useList({\n\teditor,\n\ttype\n}: {\n\teditor: Editor | null;\n\ttype: ListType;\n}) {\n\tconst [isActive, setIsActive] = useState(false);\n\tconst [canToggle, setCanToggle] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\n\t\tconst handleUpdate = () => {\n\t\t\tsetIsActive(editor.isActive(type));\n\t\t\tsetCanToggle(canToggleList(editor));\n\t\t};\n\n\t\thandleUpdate();\n\n\t\teditor.on('selectionUpdate', handleUpdate);\n\t\teditor.on('transaction', handleUpdate);\n\n\t\treturn () => {\n\t\t\teditor.off('selectionUpdate', handleUpdate);\n\t\t\teditor.off('transaction', handleUpdate);\n\t\t};\n\t}, [editor, type]);\n\n\tconst handleToggle = useCallback(() => {\n\t\tif (!editor || !editor.isEditable) return false;\n\n\t\tconst itemType = listItemTypes[type];\n\n\t\tif (editor.isActive(type)) {\n\t\t\t// Currently this list type → convert back to paragraph\n\t\t\treturn editor.chain().focus().clearNodes().run();\n\t\t}\n\n\t\t// clearNodes first to convert any block type to paragraph,\n\t\t// then toggle list\n\t\treturn editor.chain().focus().clearNodes().toggleList(type, itemType).run();\n\t}, [editor, type]);\n\n\treturn {\n\t\tisActive,\n\t\tcanToggle,\n\t\thandleToggle,\n\t\tlabel: listLabels[type],\n\t\tIcon: listIcons[type]\n\t};\n}\n\nexport function useActiveListType(\n\teditor: Editor | null,\n\ttypes: ListType[]\n): ListType | null {\n\tconst [activeType, setActiveType] = useState<ListType | null>(null);\n\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\n\t\tconst handleUpdate = () => {\n\t\t\tconst found = types.find((type) => editor.isActive(type));\n\n\t\t\tsetActiveType(found ?? null);\n\t\t};\n\n\t\thandleUpdate();\n\n\t\teditor.on('selectionUpdate', handleUpdate);\n\t\teditor.on('transaction', handleUpdate);\n\n\t\treturn () => {\n\t\t\teditor.off('selectionUpdate', handleUpdate);\n\t\t\teditor.off('transaction', handleUpdate);\n\t\t};\n\t}, [editor, types]);\n\n\treturn activeType;\n}\n\nexport function getListTriggerIcon(activeType: ListType | null): IconComponent {\n\tif (activeType === null) return BulletListIcon;\n\n\treturn listIcons[activeType];\n}\n","import { memo } from 'react';\n\ntype SvgProps = React.ComponentPropsWithoutRef<'svg'>;\n\nexport const BulletListIcon = memo(({ className, ...props }: SvgProps) => {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tfill=\"currentColor\"\n\t\t\theight=\"24\"\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\twidth=\"24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M7 6C7 5.44772 7.44772 5 8 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H8C7.44772 7 7 6.55228 7 6Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M7 12C7 11.4477 7.44772 11 8 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H8C7.44772 13 7 12.5523 7 12Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M7 18C7 17.4477 7.44772 17 8 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H8C7.44772 19 7 18.5523 7 18Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M2 6C2 5.44772 2.44772 5 3 5H3.01C3.56228 5 4.01 5.44772 4.01 6C4.01 6.55228 3.56228 7 3.01 7H3C2.44772 7 2 6.55228 2 6Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M2 12C2 11.4477 2.44772 11 3 11H3.01C3.56228 11 4.01 11.4477 4.01 12C4.01 12.5523 3.56228 13 3.01 13H3C2.44772 13 2 12.5523 2 12Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M2 18C2 17.4477 2.44772 17 3 17H3.01C3.56228 17 4.01 17.4477 4.01 18C4.01 18.5523 3.56228 19 3.01 19H3C2.44772 19 2 18.5523 2 18Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t</svg>\n\t);\n});\n\nBulletListIcon.displayName = 'BulletListIcon';\n","import { memo } from 'react';\n\ntype SvgProps = React.ComponentPropsWithoutRef<'svg'>;\n\nexport const OrderedListIcon = memo(({ className, ...props }: SvgProps) => {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tfill=\"currentColor\"\n\t\t\theight=\"24\"\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\twidth=\"24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M9 6C9 5.44772 9.44772 5 10 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H10C9.44772 7 9 6.55228 9 6Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M9 12C9 11.4477 9.44772 11 10 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H10C9.44772 13 9 12.5523 9 12Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M9 18C9 17.4477 9.44772 17 10 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H10C9.44772 19 9 18.5523 9 18Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M3 6C3 5.44772 3.44772 5 4 5H5C5.55228 5 6 5.44772 6 6V10C6 10.5523 5.55228 11 5 11C4.44772 11 4 10.5523 4 10V7C3.44772 7 3 6.55228 3 6Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M3 10C3 9.44772 3.44772 9 4 9H6C6.55228 9 7 9.44772 7 10C7 10.5523 6.55228 11 6 11H4C3.44772 11 3 10.5523 3 10Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M5.82219 13.0431C6.54543 13.4047 6.99997 14.1319 6.99997 15C6.99997 15.5763 6.71806 16.0426 6.48747 16.35C6.31395 16.5814 6.1052 16.8044 5.91309 17H5.99997C6.55226 17 6.99997 17.4477 6.99997 18C6.99997 18.5523 6.55226 19 5.99997 19H3.99997C3.44769 19 2.99997 18.5523 2.99997 18C2.99997 17.4237 3.28189 16.9575 3.51247 16.65C3.74323 16.3424 4.03626 16.0494 4.26965 15.8161C4.27745 15.8083 4.2852 15.8006 4.29287 15.7929C4.55594 15.5298 4.75095 15.3321 4.88748 15.15C4.96287 15.0495 4.99021 14.9922 4.99911 14.9714C4.99535 14.9112 4.9803 14.882 4.9739 14.8715C4.96613 14.8588 4.95382 14.845 4.92776 14.8319C4.87723 14.8067 4.71156 14.7623 4.44719 14.8944C3.95321 15.1414 3.35254 14.9412 3.10555 14.4472C2.85856 13.9533 3.05878 13.3526 3.55276 13.1056C4.28839 12.7378 5.12272 12.6934 5.82219 13.0431Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t</svg>\n\t);\n});\n\nOrderedListIcon.displayName = 'OrderedListIcon';\n","import { memo } from 'react';\n\ntype SvgProps = React.ComponentPropsWithoutRef<'svg'>;\n\nexport const TaskListIcon = memo(({ className, ...props }: SvgProps) => {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tfill=\"currentColor\"\n\t\t\theight=\"24\"\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\twidth=\"24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M2 6C2 4.89543 2.89543 4 4 4H8C9.10457 4 10 4.89543 10 6V10C10 11.1046 9.10457 12 8 12H4C2.89543 12 2 11.1046 2 10V6ZM8 6H4V10H8V6Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M9.70711 14.2929C10.0976 14.6834 10.0976 15.3166 9.70711 15.7071L5.70711 19.7071C5.31658 20.0976 4.68342 20.0976 4.29289 19.7071L2.29289 17.7071C1.90237 17.3166 1.90237 16.6834 2.29289 16.2929C2.68342 15.9024 3.31658 15.9024 3.70711 16.2929L5 17.5858L8.29289 14.2929C8.68342 13.9024 9.31658 13.9024 9.70711 14.2929Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M12 6C12 5.44772 12.4477 5 13 5H21C21.5523 5 22 5.44772 22 6C22 6.55228 21.5523 7 21 7H13C12.4477 7 12 6.55228 12 6Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M12 12C12 11.4477 12.4477 11 13 11H21C21.5523 11 22 11.4477 22 12C22 12.5523 21.5523 13 21 13H13C12.4477 13 12 12.5523 12 12Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M12 18C12 17.4477 12.4477 17 13 17H21C21.5523 17 22 17.4477 22 18C22 18.5523 21.5523 19 21 19H13C12.4477 19 12 18.5523 12 18Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t</svg>\n\t);\n});\n\nTaskListIcon.displayName = 'TaskListIcon';\n","import { forwardRef, useCallback } from 'react';\n\nimport { useMark } from './use-mark';\nimport { Button } from '../button/button';\n\nimport type { MarkType } from './use-mark';\nimport type { Editor } from '@tiptap/core';\n\nexport interface MarkButtonProps extends Omit<\n\tReact.ButtonHTMLAttributes<HTMLButtonElement>,\n\t'type'\n> {\n\teditor: Editor | null;\n\ttype: MarkType;\n}\n\nexport const MarkButton = forwardRef<HTMLButtonElement, MarkButtonProps>(\n\t({ editor, type, onClick, ...buttonProps }, ref) => {\n\t\tconst { isActive, canToggle, handleToggle, label, Icon } = useMark({\n\t\t\teditor,\n\t\t\ttype\n\t\t});\n\n\t\tconst handleClick = useCallback(\n\t\t\t(event: React.MouseEvent<HTMLButtonElement>) => {\n\t\t\t\tonClick?.(event);\n\n\t\t\t\tif (event.defaultPrevented) return;\n\n\t\t\t\thandleToggle();\n\t\t\t},\n\t\t\t[handleToggle, onClick]\n\t\t);\n\n\t\treturn (\n\t\t\t<Button\n\t\t\t\tref={ref}\n\t\t\t\taria-label={label}\n\t\t\t\taria-pressed={isActive}\n\t\t\t\tdata-active-state={isActive ? 'on' : 'off'}\n\t\t\t\tdisabled={!canToggle}\n\t\t\t\ttabIndex={-1}\n\t\t\t\ttype=\"button\"\n\t\t\t\tvariant=\"ghost\"\n\t\t\t\tonClick={handleClick}\n\t\t\t\t{...buttonProps}\n\t\t\t>\n\t\t\t\t<Icon className=\"tiptap-button-icon\" />\n\t\t\t</Button>\n\t\t);\n\t}\n);\n\nMarkButton.displayName = 'MarkButton';\n","import { useCallback, useEffect, useState } from 'react';\n\nimport { BoldIcon } from '../../icons/bold-icon';\nimport { CodeIcon } from '../../icons/code-icon';\nimport { ItalicIcon } from '../../icons/italic-icon';\nimport { StrikethroughIcon } from '../../icons/strikethrough-icon';\n\nimport type { Editor } from '@tiptap/core';\n\nexport type MarkType = 'bold' | 'italic' | 'strike' | 'code';\n\nexport interface UseMarkConfig {\n\teditor: Editor | null;\n\ttype: MarkType;\n}\n\nconst markLabels: Record<MarkType, string> = {\n\tbold: 'Bold',\n\titalic: 'Italic',\n\tstrike: 'Strikethrough',\n\tcode: 'Code'\n};\n\nconst markIcons = {\n\tbold: BoldIcon,\n\titalic: ItalicIcon,\n\tstrike: StrikethroughIcon,\n\tcode: CodeIcon\n};\n\nexport function useMark({ editor, type }: UseMarkConfig) {\n\tconst [isActive, setIsActive] = useState(false);\n\tconst [canToggle, setCanToggle] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\n\t\tconst handleUpdate = () => {\n\t\t\tsetIsActive(editor.isActive(type));\n\t\t\tsetCanToggle(editor.isEditable && editor.can().toggleMark(type));\n\t\t};\n\n\t\thandleUpdate();\n\n\t\teditor.on('selectionUpdate', handleUpdate);\n\t\teditor.on('transaction', handleUpdate);\n\n\t\treturn () => {\n\t\t\teditor.off('selectionUpdate', handleUpdate);\n\t\t\teditor.off('transaction', handleUpdate);\n\t\t};\n\t}, [editor, type]);\n\n\tconst handleToggle = useCallback(() => {\n\t\tif (!editor || !editor.isEditable) return false;\n\n\t\treturn editor.chain().focus().toggleMark(type).run();\n\t}, [editor, type]);\n\n\treturn {\n\t\tisActive,\n\t\tcanToggle,\n\t\thandleToggle,\n\t\tlabel: markLabels[type],\n\t\tIcon: markIcons[type]\n\t};\n}\n","import { memo } from 'react';\n\ntype SvgProps = React.ComponentPropsWithoutRef<'svg'>;\n\nexport const BoldIcon = memo(({ className, ...props }: SvgProps) => {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tfill=\"currentColor\"\n\t\t\theight=\"24\"\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\twidth=\"24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M6 2.5C5.17157 2.5 4.5 3.17157 4.5 4V20C4.5 20.8284 5.17157 21.5 6 21.5H15C16.4587 21.5 17.8576 20.9205 18.8891 19.8891C19.9205 18.8576 20.5 17.4587 20.5 16C20.5 14.5413 19.9205 13.1424 18.8891 12.1109C18.6781 11.9 18.4518 11.7079 18.2128 11.5359C19.041 10.5492 19.5 9.29829 19.5 8C19.5 6.54131 18.9205 5.14236 17.8891 4.11091C16.8576 3.07946 15.4587 2.5 14 2.5H6ZM14 10.5C14.663 10.5 15.2989 10.2366 15.7678 9.76777C16.2366 9.29893 16.5 8.66304 16.5 8C16.5 7.33696 16.2366 6.70107 15.7678 6.23223C15.2989 5.76339 14.663 5.5 14 5.5H7.5V10.5H14ZM7.5 18.5V13.5H15C15.663 13.5 16.2989 13.7634 16.7678 14.2322C17.2366 14.7011 17.5 15.337 17.5 16C17.5 16.663 17.2366 17.2989 16.7678 17.7678C16.2989 18.2366 15.663 18.5 15 18.5H7.5Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t</svg>\n\t);\n});\n\nBoldIcon.displayName = 'BoldIcon';\n","import { memo } from 'react';\n\ntype SvgProps = React.ComponentPropsWithoutRef<'svg'>;\n\nexport const CodeIcon = memo(({ className, ...props }: SvgProps) => {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tfill=\"currentColor\"\n\t\t\theight=\"24\"\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\twidth=\"24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\td=\"M15.4545 4.2983C15.6192 3.77115 15.3254 3.21028 14.7983 3.04554C14.2712 2.88081 13.7103 3.1746 13.5455 3.70175L8.54554 19.7017C8.38081 20.2289 8.6746 20.7898 9.20175 20.9545C9.72889 21.1192 10.2898 20.8254 10.4545 20.2983L15.4545 4.2983Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M6.70711 7.29289C7.09763 7.68342 7.09763 8.31658 6.70711 8.70711L3.41421 12L6.70711 15.2929C7.09763 15.6834 7.09763 16.3166 6.70711 16.7071C6.31658 17.0976 5.68342 17.0976 5.29289 16.7071L1.29289 12.7071C0.902369 12.3166 0.902369 11.6834 1.29289 11.2929L5.29289 7.29289C5.68342 6.90237 6.31658 6.90237 6.70711 7.29289Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M17.2929 7.29289C17.6834 6.90237 18.3166 6.90237 18.7071 7.29289L22.7071 11.2929C23.0976 11.6834 23.0976 12.3166 22.7071 12.7071L18.7071 16.7071C18.3166 17.0976 17.6834 17.0976 17.2929 16.7071C16.9024 16.3166 16.9024 15.6834 17.2929 15.2929L20.5858 12L17.2929 8.70711C16.9024 8.31658 16.9024 7.68342 17.2929 7.29289Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t/>\n\t\t</svg>\n\t);\n});\n\nCodeIcon.displayName = 'CodeIcon';\n","import { memo } from 'react';\n\ntype SvgProps = React.ComponentPropsWithoutRef<'svg'>;\n\nexport const ItalicIcon = memo(({ className, ...props }: SvgProps) => {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tfill=\"currentColor\"\n\t\t\theight=\"24\"\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\twidth=\"24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\td=\"M15.0222 3H19C19.5523 3 20 3.44772 20 4C20 4.55228 19.5523 5 19 5H15.693L10.443 19H14C14.5523 19 15 19.4477 15 20C15 20.5523 14.5523 21 14 21H9.02418C9.00802 21.0004 8.99181 21.0004 8.97557 21H5C4.44772 21 4 20.5523 4 20C4 19.4477 4.44772 19 5 19H8.30704L13.557 5H10C9.44772 5 9 4.55228 9 4C9 3.44772 9.44772 3 10 3H14.9782C14.9928 2.99968 15.0075 2.99967 15.0222 3Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t/>\n\t\t</svg>\n\t);\n});\n\nItalicIcon.displayName = 'ItalicIcon';\n","import { memo } from 'react';\n\ntype SvgProps = React.ComponentPropsWithoutRef<'svg'>;\n\nexport const StrikethroughIcon = memo(({ className, ...props }: SvgProps) => {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tfill=\"currentColor\"\n\t\t\theight=\"24\"\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\twidth=\"24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\td=\"M9.00039 3H16.0001C16.5524 3 17.0001 3.44772 17.0001 4C17.0001 4.55229 16.5524 5 16.0001 5H9.00011C8.68006 4.99983 8.36412 5.07648 8.07983 5.22349C7.79555 5.37051 7.55069 5.5836 7.36585 5.84487C7.181 6.10614 7.06155 6.40796 7.01754 6.72497C6.97352 7.04198 7.00623 7.36492 7.11292 7.66667C7.29701 8.18737 7.02414 8.75872 6.50344 8.94281C5.98274 9.1269 5.4114 8.85403 5.2273 8.33333C5.01393 7.72984 4.94851 7.08396 5.03654 6.44994C5.12456 5.81592 5.36346 5.21229 5.73316 4.68974C6.10285 4.1672 6.59256 3.74101 7.16113 3.44698C7.72955 3.15303 8.36047 2.99975 9.00039 3Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M18 13H20C20.5523 13 21 12.5523 21 12C21 11.4477 20.5523 11 20 11H4C3.44772 11 3 11.4477 3 12C3 12.5523 3.44772 13 4 13H14C14.7956 13 15.5587 13.3161 16.1213 13.8787C16.6839 14.4413 17 15.2044 17 16C17 16.7956 16.6839 17.5587 16.1213 18.1213C15.5587 18.6839 14.7956 19 14 19H6C5.44772 19 5 19.4477 5 20C5 20.5523 5.44772 21 6 21H14C15.3261 21 16.5979 20.4732 17.5355 19.5355C18.4732 18.5979 19 17.3261 19 16C19 14.9119 18.6453 13.8604 18 13Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t/>\n\t\t</svg>\n\t);\n});\n\nStrikethroughIcon.displayName = 'StrikethroughIcon';\n","export function Spacer() {\n\treturn <div style={{ flex: 1 }} />;\n}\n","import { forwardRef, useCallback } from 'react';\n\nimport { useUndoRedo } from './use-undo-redo';\nimport { Button } from '../button/button';\n\nimport type { UndoRedoAction } from './use-undo-redo';\nimport type { Editor } from '@tiptap/core';\n\nexport interface UndoRedoButtonProps extends Omit<\n\tReact.ButtonHTMLAttributes<HTMLButtonElement>,\n\t'type'\n> {\n\teditor: Editor | null;\n\taction: UndoRedoAction;\n}\n\nexport const UndoRedoButton = forwardRef<\n\tHTMLButtonElement,\n\tUndoRedoButtonProps\n>(({ editor, action, onClick, ...buttonProps }, ref) => {\n\tconst { canExecute, handleAction, label, Icon } = useUndoRedo({\n\t\teditor,\n\t\taction\n\t});\n\n\tconst handleClick = useCallback(\n\t\t(event: React.MouseEvent<HTMLButtonElement>) => {\n\t\t\tonClick?.(event);\n\n\t\t\tif (event.defaultPrevented) return;\n\n\t\t\thandleAction();\n\t\t},\n\t\t[handleAction, onClick]\n\t);\n\n\treturn (\n\t\t<Button\n\t\t\tref={ref}\n\t\t\taria-label={label}\n\t\t\tdisabled={!canExecute}\n\t\t\ttabIndex={-1}\n\t\t\ttype=\"button\"\n\t\t\tvariant=\"ghost\"\n\t\t\tonClick={handleClick}\n\t\t\t{...buttonProps}\n\t\t>\n\t\t\t<Icon className=\"tiptap-button-icon\" />\n\t\t</Button>\n\t);\n});\n\nUndoRedoButton.displayName = 'UndoRedoButton';\n","import { useCallback, useEffect, useState } from 'react';\n\nimport { RedoIcon } from '../../icons/redo-icon';\nimport { UndoIcon } from '../../icons/undo-icon';\n\nimport type { Editor } from '@tiptap/core';\n\nexport type UndoRedoAction = 'undo' | 'redo';\n\nexport interface UseUndoRedoConfig {\n\teditor: Editor | null;\n\taction: UndoRedoAction;\n}\n\nconst actionLabels: Record<UndoRedoAction, string> = {\n\tundo: 'Undo',\n\tredo: 'Redo'\n};\n\nconst actionIcons = {\n\tundo: UndoIcon,\n\tredo: RedoIcon\n};\n\nfunction canExecuteAction(\n\teditor: Editor | null,\n\taction: UndoRedoAction\n): boolean {\n\tif (!editor || !editor.isEditable) return false;\n\n\treturn action === 'undo' ? editor.can().undo() : editor.can().redo();\n}\n\nexport function useUndoRedo({ editor, action }: UseUndoRedoConfig) {\n\tconst [canExecute, setCanExecute] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\n\t\tconst handleUpdate = () => {\n\t\t\tsetCanExecute(canExecuteAction(editor, action));\n\t\t};\n\n\t\thandleUpdate();\n\n\t\teditor.on('transaction', handleUpdate);\n\n\t\treturn () => {\n\t\t\teditor.off('transaction', handleUpdate);\n\t\t};\n\t}, [editor, action]);\n\n\tconst handleAction = useCallback(() => {\n\t\tif (!editor || !editor.isEditable) return false;\n\n\t\tif (!canExecuteAction(editor, action)) return false;\n\n\t\tconst chain = editor.chain().focus();\n\n\t\treturn action === 'undo' ? chain.undo().run() : chain.redo().run();\n\t}, [editor, action]);\n\n\treturn {\n\t\tcanExecute,\n\t\thandleAction,\n\t\tlabel: actionLabels[action],\n\t\tIcon: actionIcons[action]\n\t};\n}\n","import { memo } from 'react';\n\ntype SvgProps = React.ComponentPropsWithoutRef<'svg'>;\n\nexport const RedoIcon = memo(({ className, ...props }: SvgProps) => {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tfill=\"currentColor\"\n\t\t\theight=\"24\"\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\twidth=\"24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M15.7071 2.29289C15.3166 1.90237 14.6834 1.90237 14.2929 2.29289C13.9024 2.68342 13.9024 3.31658 14.2929 3.70711L17.5858 7H9.5C7.77609 7 6.12279 7.68482 4.90381 8.90381C3.68482 10.1228 3 11.7761 3 13.5C3 14.3536 3.16813 15.1988 3.49478 15.9874C3.82144 16.7761 4.30023 17.4926 4.90381 18.0962C6.12279 19.3152 7.77609 20 9.5 20H13C13.5523 20 14 19.5523 14 19C14 18.4477 13.5523 18 13 18H9.5C8.30653 18 7.16193 17.5259 6.31802 16.682C5.90016 16.2641 5.56869 15.768 5.34254 15.2221C5.1164 14.6761 5 14.0909 5 13.5C5 12.3065 5.47411 11.1619 6.31802 10.318C7.16193 9.47411 8.30653 9 9.5 9H17.5858L14.2929 12.2929C13.9024 12.6834 13.9024 13.3166 14.2929 13.7071C14.6834 14.0976 15.3166 14.0976 15.7071 13.7071L20.7071 8.70711C21.0976 8.31658 21.0976 7.68342 20.7071 7.29289L15.7071 2.29289Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t</svg>\n\t);\n});\n\nRedoIcon.displayName = 'RedoIcon';\n","import { memo } from 'react';\n\ntype SvgProps = React.ComponentPropsWithoutRef<'svg'>;\n\nexport const UndoIcon = memo(({ className, ...props }: SvgProps) => {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tfill=\"currentColor\"\n\t\t\theight=\"24\"\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\twidth=\"24\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M9.70711 3.70711C10.0976 3.31658 10.0976 2.68342 9.70711 2.29289C9.31658 1.90237 8.68342 1.90237 8.29289 2.29289L3.29289 7.29289C2.90237 7.68342 2.90237 8.31658 3.29289 8.70711L8.29289 13.7071C8.68342 14.0976 9.31658 14.0976 9.70711 13.7071C10.0976 13.3166 10.0976 12.6834 9.70711 12.2929L6.41421 9H14.5C15.0909 9 15.6761 9.1164 16.2221 9.34254C16.768 9.56869 17.2641 9.90016 17.682 10.318C18.0998 10.7359 18.4313 11.232 18.6575 11.7779C18.8836 12.3239 19 12.9091 19 13.5C19 14.0909 18.8836 14.6761 18.6575 15.2221C18.4313 15.768 18.0998 16.2641 17.682 16.682C17.2641 17.0998 16.768 17.4313 16.2221 17.6575C15.6761 17.8836 15.0909 18 14.5 18H11C10.4477 18 10 18.4477 10 19C10 19.5523 10.4477 20 11 20H14.5C15.3536 20 16.1988 19.8319 16.9874 19.5052C17.7761 19.1786 18.4926 18.6998 19.0962 18.0962C19.6998 17.4926 20.1786 16.7761 20.5052 15.9874C20.8319 15.1988 21 14.3536 21 13.5C21 12.6464 20.8319 11.8012 20.5052 11.0126C20.1786 10.2239 19.6998 9.50739 19.0962 8.90381C18.4926 8.30022 17.7761 7.82144 16.9874 7.49478C16.1988 7.16813 15.3536 7 14.5 7H6.41421L9.70711 3.70711Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t</svg>\n\t);\n});\n\nUndoIcon.displayName = 'UndoIcon';\n","import { EditorState } from '@tiptap/pm/state';\nimport { useEditor } from '@tiptap/react';\nimport { useEffect, useRef } from 'react';\n\nimport { editorExtensions } from '../extensions';\n\nimport type { MarkdownStorage } from 'tiptap-markdown';\n\nexport interface UseMarkdownEditorOptions {\n\tvalue: string;\n\tonChange: (value: string) => void;\n\tplaceholder?: string;\n\teditable?: boolean;\n}\n\nfunction getMarkdown(storage: Record<string, unknown>): string {\n\treturn (storage.markdown as MarkdownStorage).getMarkdown();\n}\n\nexport function useMarkdownEditor({\n\tvalue,\n\tonChange,\n\teditable = true\n}: UseMarkdownEditorOptions) {\n\tconst externalValue = useRef(value);\n\tconst onChangeRef = useRef(onChange);\n\n\tonChangeRef.current = onChange;\n\n\tconst editor = useEditor({\n\t\textensions: editorExtensions,\n\t\teditable,\n\t\tcontent: value,\n\t\tonUpdate({ editor }) {\n\t\t\tconst md = getMarkdown(\n\t\t\t\teditor.storage as unknown as Record<string, unknown>\n\t\t\t);\n\n\t\t\texternalValue.current = md;\n\t\t\tonChangeRef.current(md);\n\t\t},\n\t\tonCreate({ editor }) {\n\t\t\t// Browser-specific behaviors (MutationObserver, DOM reconciliation)\n\t\t\t// may create unwanted transactions during mount, polluting the history\n\t\t\t// and making undo available before the user has made any changes.\n\t\t\t// Reset the editor state after initialization to ensure a clean history.\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (editor.isDestroyed) return;\n\n\t\t\t\tconst { state } = editor;\n\t\t\t\tconst freshState = EditorState.create({\n\t\t\t\t\tdoc: state.doc,\n\t\t\t\t\tselection: state.selection,\n\t\t\t\t\tplugins: state.plugins\n\t\t\t\t});\n\n\t\t\t\teditor.view.updateState(freshState);\n\t\t\t\t// Dispatch empty transaction to notify state listeners (undo/redo buttons)\n\t\t\t\teditor.view.dispatch(editor.view.state.tr);\n\t\t\t}, 0);\n\t\t}\n\t});\n\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\n\t\tif (value === externalValue.current) return;\n\n\t\texternalValue.current = value;\n\t\teditor.commands.setContent(value);\n\t}, [value, editor]);\n\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\n\t\teditor.setEditable(editable);\n\t}, [editable, editor]);\n\n\treturn { editor };\n}\n","import { ListKit } from '@tiptap/extension-list';\nimport StarterKit, { type StarterKitOptions } from '@tiptap/starter-kit';\n\n// Shared StarterKit config: content nodes/marks, no lists (use ListKit instead)\nexport const starterKitBaseConfig: Partial<StarterKitOptions> = {\n\theading: { levels: [1, 2, 3, 4, 5, 6] },\n\tlink: {\n\t\topenOnClick: false,\n\t\tautolink: true\n\t},\n\t// Disable StarterKit's built-in list handling; use @tiptap/extension-list instead\n\tbulletList: false,\n\torderedList: false,\n\tlistItem: false,\n\tlistKeymap: false\n};\n\n// Content model extensions — shared by editor and reader\n// No interactive features (dropcursor, gapcursor, undoRedo, trailingNode)\nexport const sharedExtensions = [\n\tStarterKit.configure({\n\t\t...starterKitBaseConfig,\n\t\tdropcursor: false,\n\t\tgapcursor: false,\n\t\tundoRedo: false,\n\t\ttrailingNode: false\n\t}),\n\tListKit\n];\n","import { ListKit } from '@tiptap/extension-list';\nimport StarterKit from '@tiptap/starter-kit';\nimport { Markdown } from 'tiptap-markdown';\n\nimport { starterKitBaseConfig } from './shared';\n\n// Editor extensions = shared content model + interactive features + Markdown\nexport const editorExtensions = [\n\tStarterKit.configure(starterKitBaseConfig),\n\tListKit,\n\tMarkdown.configure({\n\t\thtml: false,\n\t\ttransformPastedText: true,\n\t\ttransformCopiedText: true\n\t})\n];\n","import { renderToReactElement } from '@tiptap/static-renderer/pm/react';\n\nimport { sharedExtensions } from './extensions';\nimport { markdownToJSON } from './utils/markdown-to-json';\n\nexport interface NotraReaderProps {\n\t/** Markdown content to render */\n\tcontent: string;\n\t/** Additional CSS class on the wrapper element */\n\tclassName?: string;\n}\n\nexport function NotraReader({ content, className }: NotraReaderProps) {\n\tconst json = markdownToJSON(content);\n\n\tconst rendered = renderToReactElement({\n\t\textensions: sharedExtensions,\n\t\tcontent: json\n\t});\n\n\tconst classNames = ['notra', 'notra-reader', className]\n\t\t.filter(Boolean)\n\t\t.join(' ');\n\n\treturn <div className={classNames}>{rendered}</div>;\n}\n","import { Editor } from '@tiptap/core';\nimport { Markdown } from 'tiptap-markdown';\n\nimport { sharedExtensions } from '../extensions';\n\n// Parser needs shared content model + Markdown for markdown→JSON conversion\n// No clipboard features needed (transformPastedText/transformCopiedText are editor-only)\nconst parserExtensions = [\n\t...sharedExtensions,\n\tMarkdown.configure({ html: false })\n];\n\nlet parserEditor: Editor | null = null;\n\nfunction getParserEditor(): Editor {\n\tif (!parserEditor) {\n\t\tparserEditor = new Editor({\n\t\t\textensions: parserExtensions,\n\t\t\tcontent: ''\n\t\t});\n\t}\n\n\treturn parserEditor;\n}\n\n/**\n * Convert a Markdown string to Tiptap-compatible JSON (ProseMirror document).\n * Uses a singleton headless Tiptap editor for parsing.\n */\nexport function markdownToJSON(markdown: string): Record<string, unknown> {\n\tconst editor = getParserEditor();\n\n\teditor.commands.setContent(markdown);\n\n\treturn editor.getJSON() as Record<string, unknown>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,iBAA8B;;;ACA9B,IAAAC,gBAA6D;;;ACA7D,mBAAqB;AAMnB;AAFK,IAAM,qBAAiB,mBAAK,CAAC,EAAE,WAAW,GAAG,MAAM,MAAgB;AACzE,SACC;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACA,MAAK;AAAA,MACL,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,OAAM;AAAA,MACN,OAAM;AAAA,MACL,GAAG;AAAA,MAEJ;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,UAAS;AAAA,YACT,GAAE;AAAA,YACF,MAAK;AAAA,YACL,UAAS;AAAA;AAAA,QACV;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACA,UAAS;AAAA,YACT,GAAE;AAAA,YACF,MAAK;AAAA,YACL,UAAS;AAAA;AAAA,QACV;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACA,UAAS;AAAA,YACT,GAAE;AAAA,YACF,MAAK;AAAA,YACL,UAAS;AAAA;AAAA,QACV;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACA,U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AO,OAAO,QAAQ;AACvB;;;ADXQ,IAAAC,uBAAA;AAZD,SAAS,YAAY,EAAE,SAAS,UAAU,GAAqB;AACrE,QAAM,OAAO,eAAe,OAAO;AAEnC,QAAM,eAAW,qCAAqB;AAAA,IACrC,YAAY;AAAA,IACZ,SAAS;AAAA,EACV,CAAC;AAED,QAAM,aAAa,CAAC,SAAS,gBAAgB,SAAS,EACpD,OAAO,OAAO,EACd,KAAK,GAAG;AAEV,SAAO,8CAAC,SAAI,WAAW,YAAa,oBAAS;AAC9C;","names":["import_react","import_react","import_react","import_jsx_runtime","import_jsx_runtime","import_react","import_react","import_jsx_runtime","import_jsx_runtime","import_react","import_react","import_react","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_react","import_react","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_react","import_react_dom","import_jsx_runtime","import_jsx_runtime","import_react","import_react","import_react","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_react","import_react","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_react","import_react","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_react","StarterKit","import_extension_list","import_starter_kit","StarterKit","editor","import_jsx_runtime","import_react","import_tiptap_markdown","import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/notra-editor.tsx","../src/components/blockquote-button/blockquote-button.tsx","../src/components/ui/button.tsx","../src/lib/utils.ts","../src/components/code-block-button/code-block-button.tsx","../src/components/heading-dropdown-menu/heading-dropdown-menu.tsx","../src/components/heading-dropdown-menu/heading-menu-item.tsx","../src/components/heading-dropdown-menu/use-heading.ts","../src/components/ui/dropdown-menu.tsx","../src/components/link-popover/link-popover.tsx","../src/components/link-popover/use-link-popover.ts","../src/components/ui/input.tsx","../src/components/ui/popover.tsx","../src/components/ui/separator.tsx","../src/components/list-dropdown-menu/list-dropdown-menu.tsx","../src/components/list-dropdown-menu/list-menu-item.tsx","../src/components/list-dropdown-menu/use-list.ts","../src/components/mark-button/mark-button.tsx","../src/components/mark-button/use-mark.ts","../src/components/toolbar/toolbar.tsx","../src/components/ui-primitive/spacer.tsx","../src/components/undo-redo-button/undo-redo-button.tsx","../src/components/undo-redo-button/use-undo-redo.ts","../src/hooks/use-markdown-editor.ts","../src/extensions/shared.ts","../src/extensions/editor.ts","../src/notra-reader.tsx","../src/utils/markdown-to-json.ts","../src/components/ui-primitive/dropdown-menu.tsx"],"sourcesContent":["import './styles/globals.css';\n\nexport { NotraEditor } from './notra-editor';\nexport type { NotraEditorProps } from './notra-editor';\n\nexport { NotraReader } from './notra-reader';\nexport type { NotraReaderProps } from './notra-reader';\n\nexport {\n\tToolbar,\n\tToolbarGroup,\n\tToolbarSeparator\n} from './components/toolbar/toolbar';\nexport type {\n\tToolbarProps,\n\tToolbarSeparatorProps\n} from './components/toolbar/toolbar';\n\nexport { UndoRedoButton } from './components/undo-redo-button/undo-redo-button';\nexport type { UndoRedoButtonProps } from './components/undo-redo-button/undo-redo-button';\n\nexport { Spacer } from './components/ui-primitive/spacer';\nexport { DropdownMenu } from './components/ui-primitive/dropdown-menu';\nexport type { DropdownMenuProps } from './components/ui-primitive/dropdown-menu';\n\nexport { MarkButton } from './components/mark-button/mark-button';\nexport type { MarkButtonProps } from './components/mark-button/mark-button';\nexport type { MarkType } from './components/mark-button/use-mark';\n\nexport { HeadingDropdownMenu } from './components/heading-dropdown-menu/heading-dropdown-menu';\nexport type { HeadingDropdownMenuProps } from './components/heading-dropdown-menu/heading-dropdown-menu';\n\nexport { ListDropdownMenu } from './components/list-dropdown-menu/list-dropdown-menu';\nexport type { ListDropdownMenuProps } from './components/list-dropdown-menu/list-dropdown-menu';\n\nexport { BlockquoteButton } from './components/blockquote-button/blockquote-button';\nexport type { BlockquoteButtonProps } from './components/blockquote-button/blockquote-button';\n\nexport { CodeBlockButton } from './components/code-block-button/code-block-button';\nexport type { CodeBlockButtonProps } from './components/code-block-button/code-block-button';\n\nexport { LinkPopover } from './components/link-popover/link-popover';\nexport type { LinkPopoverProps } from './components/link-popover/link-popover';\n","import { EditorContent } from '@tiptap/react';\n\nimport { BlockquoteButton } from './components/blockquote-button/blockquote-button';\nimport { CodeBlockButton } from './components/code-block-button/code-block-button';\nimport { HeadingDropdownMenu } from './components/heading-dropdown-menu/heading-dropdown-menu';\nimport { LinkPopover } from './components/link-popover/link-popover';\nimport { ListDropdownMenu } from './components/list-dropdown-menu/list-dropdown-menu';\nimport { MarkButton } from './components/mark-button/mark-button';\nimport {\n\tToolbar,\n\tToolbarGroup,\n\tToolbarSeparator\n} from './components/toolbar/toolbar';\nimport { Spacer } from './components/ui-primitive/spacer';\nimport { UndoRedoButton } from './components/undo-redo-button/undo-redo-button';\nimport { useMarkdownEditor } from './hooks/use-markdown-editor';\n\nexport interface NotraEditorProps {\n\t/** Markdown content (source of truth) */\n\tvalue: string;\n\t/** Called when content changes, receives updated Markdown */\n\tonChange: (value: string) => void;\n\t/** Placeholder text shown when editor is empty */\n\tplaceholder?: string;\n\t/** Disable editing */\n\treadOnly?: boolean;\n\t/** Additional CSS class on the wrapper element */\n\tclassName?: string;\n}\n\nexport function NotraEditor({\n\tvalue,\n\tonChange,\n\tplaceholder,\n\treadOnly = false,\n\tclassName\n}: NotraEditorProps) {\n\tconst { editor } = useMarkdownEditor({\n\t\tvalue,\n\t\tonChange,\n\t\tplaceholder,\n\t\teditable: !readOnly\n\t});\n\n\tconst classNames = ['notra', 'notra-editor', className]\n\t\t.filter(Boolean)\n\t\t.join(' ');\n\n\treturn (\n\t\t<div className={classNames}>\n\t\t\t<Toolbar variant=\"fixed\">\n\t\t\t\t<Spacer />\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<UndoRedoButton action=\"undo\" editor={editor} />\n\t\t\t\t\t<UndoRedoButton action=\"redo\" editor={editor} />\n\t\t\t\t</ToolbarGroup>\n\t\t\t\t<ToolbarSeparator />\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<HeadingDropdownMenu editor={editor} levels={[1, 2, 3, 4]} />\n\t\t\t\t\t<ListDropdownMenu\n\t\t\t\t\t\teditor={editor}\n\t\t\t\t\t\ttypes={['bulletList', 'orderedList', 'taskList']}\n\t\t\t\t\t/>\n\t\t\t\t\t<BlockquoteButton editor={editor} />\n\t\t\t\t\t<CodeBlockButton editor={editor} />\n\t\t\t\t</ToolbarGroup>\n\t\t\t\t<ToolbarSeparator />\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<MarkButton editor={editor} type=\"bold\" />\n\t\t\t\t\t<MarkButton editor={editor} type=\"italic\" />\n\t\t\t\t\t<MarkButton editor={editor} type=\"strike\" />\n\t\t\t\t\t<MarkButton editor={editor} type=\"code\" />\n\t\t\t\t\t<LinkPopover editor={editor} />\n\t\t\t\t</ToolbarGroup>\n\t\t\t\t<Spacer />\n\t\t\t</Toolbar>\n\t\t\t<EditorContent className=\"notra-editor-content\" editor={editor} />\n\t\t</div>\n\t);\n}\n","import { TextQuote } from 'lucide-react';\nimport { forwardRef, useCallback, useEffect, useState } from 'react';\n\nimport { Button } from '../ui/button';\n\nimport type { Editor } from '@tiptap/core';\n\nexport interface BlockquoteButtonProps extends Omit<\n\tReact.ButtonHTMLAttributes<HTMLButtonElement>,\n\t'type'\n> {\n\teditor: Editor | null;\n}\n\nfunction canToggleBlockquote(editor: Editor | null): boolean {\n\tif (!editor || !editor.isEditable) return false;\n\n\treturn editor.can().toggleWrap('blockquote') || editor.can().clearNodes();\n}\n\nexport const BlockquoteButton = forwardRef<\n\tHTMLButtonElement,\n\tBlockquoteButtonProps\n>(({ editor, onClick, ...buttonProps }, ref) => {\n\tconst [isActive, setIsActive] = useState(false);\n\tconst [canToggle, setCanToggle] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\n\t\tconst update = () => {\n\t\t\tsetIsActive(editor.isActive('blockquote'));\n\t\t\tsetCanToggle(canToggleBlockquote(editor));\n\t\t};\n\n\t\tupdate();\n\n\t\teditor.on('selectionUpdate', update);\n\t\teditor.on('transaction', update);\n\n\t\treturn () => {\n\t\t\teditor.off('selectionUpdate', update);\n\t\t\teditor.off('transaction', update);\n\t\t};\n\t}, [editor]);\n\n\tconst handleClick = useCallback(\n\t\t(event: React.MouseEvent<HTMLButtonElement>) => {\n\t\t\tonClick?.(event);\n\n\t\t\tif (event.defaultPrevented) return;\n\n\t\t\tif (!editor) return;\n\n\t\t\tif (editor.isActive('blockquote')) {\n\t\t\t\teditor.chain().focus().lift('blockquote').run();\n\t\t\t} else {\n\t\t\t\t// clearNodes first to convert any block type to paragraph,\n\t\t\t\t// then wrap in blockquote\n\t\t\t\teditor.chain().focus().clearNodes().wrapIn('blockquote').run();\n\t\t\t}\n\t\t},\n\t\t[editor, onClick]\n\t);\n\n\treturn (\n\t\t<Button\n\t\t\tref={ref}\n\t\t\taria-label=\"Blockquote\"\n\t\t\taria-pressed={isActive}\n\t\t\tdata-active-state={isActive ? 'on' : 'off'}\n\t\t\tdisabled={!canToggle}\n\t\t\tsize=\"icon\"\n\t\t\ttabIndex={-1}\n\t\t\ttype=\"button\"\n\t\t\tvariant=\"ghost\"\n\t\t\tonClick={handleClick}\n\t\t\t{...buttonProps}\n\t\t>\n\t\t\t<TextQuote\n\t\t\t\tclassName={isActive ? 'nt:text-[var(--tt-brand-color-500)]' : undefined}\n\t\t\t/>\n\t\t</Button>\n\t);\n});\n\nBlockquoteButton.displayName = 'BlockquoteButton';\n","import { cva, type VariantProps } from 'class-variance-authority';\nimport { Slot } from 'radix-ui';\nimport * as React from 'react';\n\nimport { cn } from '../../lib/utils';\n\nconst buttonVariants = cva(\n\t'nt:group/button nt:inline-flex nt:shrink-0 nt:items-center nt:justify-center nt:rounded-lg nt:border nt:border-transparent nt:bg-clip-padding nt:text-sm nt:font-medium nt:whitespace-nowrap nt:transition-all nt:outline-none nt:select-none nt:focus-visible:border-ring nt:focus-visible:ring-3 nt:focus-visible:ring-ring/50 nt:active:not-aria-[haspopup]:translate-y-px nt:disabled:pointer-events-none nt:disabled:opacity-50 nt:aria-invalid:border-destructive nt:aria-invalid:ring-3 nt:aria-invalid:ring-destructive/20 nt:dark:aria-invalid:border-destructive/50 nt:dark:aria-invalid:ring-destructive/40 nt:[&_svg]:pointer-events-none nt:[&_svg]:shrink-0 nt:[&_svg:not([class*=size-])]:size-4',\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault:\n\t\t\t\t\t'nt:bg-primary nt:text-primary-foreground nt:[a]:hover:bg-primary/80',\n\t\t\t\toutline:\n\t\t\t\t\t'nt:border-border nt:bg-background nt:hover:bg-muted nt:hover:text-foreground nt:aria-expanded:bg-muted nt:aria-expanded:text-foreground nt:dark:border-input nt:dark:bg-input/30 nt:dark:hover:bg-input/50',\n\t\t\t\tsecondary:\n\t\t\t\t\t'nt:bg-secondary nt:text-secondary-foreground nt:hover:bg-secondary/80 nt:aria-expanded:bg-secondary nt:aria-expanded:text-secondary-foreground',\n\t\t\t\tghost:\n\t\t\t\t\t'nt:hover:bg-muted nt:hover:text-foreground nt:aria-expanded:bg-muted nt:aria-expanded:text-foreground nt:dark:hover:bg-muted/50',\n\t\t\t\tdestructive:\n\t\t\t\t\t'nt:bg-destructive/10 nt:text-destructive nt:hover:bg-destructive/20 nt:focus-visible:border-destructive/40 nt:focus-visible:ring-destructive/20 nt:dark:bg-destructive/20 nt:dark:hover:bg-destructive/30 nt:dark:focus-visible:ring-destructive/40',\n\t\t\t\tlink: 'nt:text-primary nt:underline-offset-4 nt:hover:underline'\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\tdefault:\n\t\t\t\t\t'nt:h-8 nt:gap-1.5 nt:px-2.5 nt:has-data-[icon=inline-end]:pr-2 nt:has-data-[icon=inline-start]:pl-2',\n\t\t\t\txs: 'nt:h-6 nt:gap-1 nt:rounded-[min(var(--radius-md),10px)] nt:px-2 nt:text-xs nt:in-data-[slot=button-group]:rounded-lg nt:has-data-[icon=inline-end]:pr-1.5 nt:has-data-[icon=inline-start]:pl-1.5 nt:[&_svg:not([class*=size-])]:size-3',\n\t\t\t\tsm: 'nt:h-7 nt:gap-1 nt:rounded-[min(var(--radius-md),12px)] nt:px-2.5 nt:text-[0.8rem] nt:in-data-[slot=button-group]:rounded-lg nt:has-data-[icon=inline-end]:pr-1.5 nt:has-data-[icon=inline-start]:pl-1.5 nt:[&_svg:not([class*=size-])]:size-3.5',\n\t\t\t\tlg: 'nt:h-9 nt:gap-1.5 nt:px-2.5 nt:has-data-[icon=inline-end]:pr-2 nt:has-data-[icon=inline-start]:pl-2',\n\t\t\t\ticon: 'nt:size-8',\n\t\t\t\t'icon-xs':\n\t\t\t\t\t'nt:size-6 nt:rounded-[min(var(--radius-md),10px)] nt:in-data-[slot=button-group]:rounded-lg nt:[&_svg:not([class*=size-])]:size-3',\n\t\t\t\t'icon-sm':\n\t\t\t\t\t'nt:size-7 nt:rounded-[min(var(--radius-md),12px)] nt:in-data-[slot=button-group]:rounded-lg',\n\t\t\t\t'icon-lg': 'nt:size-9'\n\t\t\t}\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tvariant: 'default',\n\t\t\tsize: 'default'\n\t\t}\n\t}\n);\n\nfunction Button({\n\tclassName,\n\tvariant = 'default',\n\tsize = 'default',\n\tasChild = false,\n\t...props\n}: React.ComponentProps<'button'> &\n\tVariantProps<typeof buttonVariants> & {\n\t\tasChild?: boolean;\n\t}) {\n\tconst Comp = asChild ? Slot.Root : 'button';\n\n\treturn (\n\t\t<Comp\n\t\t\tclassName={cn(buttonVariants({ variant, size, className }))}\n\t\t\tdata-size={size}\n\t\t\tdata-slot=\"button\"\n\t\t\tdata-variant={variant}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Button, buttonVariants };\n","import { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","import { SquareCode } from 'lucide-react';\nimport { forwardRef, useCallback, useEffect, useState } from 'react';\n\nimport { Button } from '../ui/button';\n\nimport type { Editor } from '@tiptap/core';\n\nexport interface CodeBlockButtonProps extends Omit<\n\tReact.ButtonHTMLAttributes<HTMLButtonElement>,\n\t'type'\n> {\n\teditor: Editor | null;\n}\n\nfunction canToggleCodeBlock(editor: Editor | null): boolean {\n\tif (!editor || !editor.isEditable) return false;\n\n\treturn (\n\t\teditor.can().toggleNode('codeBlock', 'paragraph') ||\n\t\teditor.can().clearNodes()\n\t);\n}\n\nexport const CodeBlockButton = forwardRef<\n\tHTMLButtonElement,\n\tCodeBlockButtonProps\n>(({ editor, onClick, ...buttonProps }, ref) => {\n\tconst [isActive, setIsActive] = useState(false);\n\tconst [canToggle, setCanToggle] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\n\t\tconst update = () => {\n\t\t\tsetIsActive(editor.isActive('codeBlock'));\n\t\t\tsetCanToggle(canToggleCodeBlock(editor));\n\t\t};\n\n\t\tupdate();\n\n\t\teditor.on('selectionUpdate', update);\n\t\teditor.on('transaction', update);\n\n\t\treturn () => {\n\t\t\teditor.off('selectionUpdate', update);\n\t\t\teditor.off('transaction', update);\n\t\t};\n\t}, [editor]);\n\n\tconst handleClick = useCallback(\n\t\t(event: React.MouseEvent<HTMLButtonElement>) => {\n\t\t\tonClick?.(event);\n\n\t\t\tif (event.defaultPrevented) return;\n\n\t\t\tif (!editor) return;\n\n\t\t\tif (editor.isActive('codeBlock')) {\n\t\t\t\teditor.chain().focus().setNode('paragraph').run();\n\t\t\t} else {\n\t\t\t\t// clearNodes first to convert any block type to paragraph,\n\t\t\t\t// then toggle to codeBlock\n\t\t\t\teditor\n\t\t\t\t\t.chain()\n\t\t\t\t\t.focus()\n\t\t\t\t\t.clearNodes()\n\t\t\t\t\t.toggleNode('codeBlock', 'paragraph')\n\t\t\t\t\t.run();\n\t\t\t}\n\t\t},\n\t\t[editor, onClick]\n\t);\n\n\treturn (\n\t\t<Button\n\t\t\tref={ref}\n\t\t\taria-label=\"Code Block\"\n\t\t\taria-pressed={isActive}\n\t\t\tdata-active-state={isActive ? 'on' : 'off'}\n\t\t\tdisabled={!canToggle}\n\t\t\tsize=\"icon\"\n\t\t\ttabIndex={-1}\n\t\t\ttype=\"button\"\n\t\t\tvariant=\"ghost\"\n\t\t\tonClick={handleClick}\n\t\t\t{...buttonProps}\n\t\t>\n\t\t\t<SquareCode\n\t\t\t\tclassName={isActive ? 'nt:text-[var(--tt-brand-color-500)]' : undefined}\n\t\t\t/>\n\t\t</Button>\n\t);\n});\n\nCodeBlockButton.displayName = 'CodeBlockButton';\n","import { ChevronDown } from 'lucide-react';\nimport { forwardRef } from 'react';\n\nimport { HeadingMenuItem } from './heading-menu-item';\nimport {\n\tgetHeadingTriggerIcon,\n\tuseActiveHeadingLevel,\n\ttype HeadingLevel\n} from './use-heading';\nimport { Button } from '../ui/button';\nimport {\n\tDropdownMenu,\n\tDropdownMenuTrigger,\n\tDropdownMenuContent,\n\tDropdownMenuGroup\n} from '../ui/dropdown-menu';\n\nimport type { Editor } from '@tiptap/core';\nimport type { ComponentProps } from 'react';\n\nexport interface HeadingDropdownMenuProps extends Omit<\n\tComponentProps<typeof Button>,\n\t'type'\n> {\n\teditor: Editor | null;\n\tlevels?: HeadingLevel[];\n}\n\nexport const HeadingDropdownMenu = forwardRef<\n\tHTMLButtonElement,\n\tHeadingDropdownMenuProps\n>(({ editor, levels = [1, 2, 3, 4], ...buttonProps }, ref) => {\n\tconst activeLevel = useActiveHeadingLevel(editor, levels);\n\tconst TriggerIcon = getHeadingTriggerIcon(activeLevel);\n\n\treturn (\n\t\t<DropdownMenu>\n\t\t\t<DropdownMenuTrigger asChild>\n\t\t\t\t<Button\n\t\t\t\t\tref={ref}\n\t\t\t\t\taria-label=\"Heading\"\n\t\t\t\t\tclassName=\"nt:gap-1 nt:px-2\"\n\t\t\t\t\tdata-active-state={activeLevel !== null ? 'on' : 'off'}\n\t\t\t\t\tsize=\"default\"\n\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t{...buttonProps}\n\t\t\t\t>\n\t\t\t\t\t<TriggerIcon\n\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\tactiveLevel !== null\n\t\t\t\t\t\t\t\t? 'nt:text-[var(--tt-brand-color-500)]'\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<ChevronDown className=\"nt:size-3\" />\n\t\t\t\t</Button>\n\t\t\t</DropdownMenuTrigger>\n\t\t\t<DropdownMenuContent align=\"start\">\n\t\t\t\t<DropdownMenuGroup>\n\t\t\t\t\t{levels.map((level) => (\n\t\t\t\t\t\t<HeadingMenuItem key={level} editor={editor} level={level} />\n\t\t\t\t\t))}\n\t\t\t\t</DropdownMenuGroup>\n\t\t\t</DropdownMenuContent>\n\t\t</DropdownMenu>\n\t);\n});\n\nHeadingDropdownMenu.displayName = 'HeadingDropdownMenu';\n","import { forwardRef } from 'react';\n\nimport { useHeading, type HeadingLevel } from './use-heading';\nimport { DropdownMenuItem } from '../ui/dropdown-menu';\n\nimport type { Editor } from '@tiptap/core';\n\nexport interface HeadingMenuItemProps {\n\teditor: Editor | null;\n\tlevel: HeadingLevel;\n}\n\nexport const HeadingMenuItem = forwardRef<HTMLDivElement, HeadingMenuItemProps>(\n\t({ editor, level }, ref) => {\n\t\tconst { isActive, canToggle, handleToggle, label, Icon } = useHeading({\n\t\t\teditor,\n\t\t\tlevel\n\t\t});\n\n\t\treturn (\n\t\t\t<DropdownMenuItem\n\t\t\t\tref={ref}\n\t\t\t\taria-label={label}\n\t\t\t\tclassName=\"nt:data-[active-state=on]:bg-accent nt:data-[active-state=on]:text-[var(--tt-brand-color-500)]\"\n\t\t\t\tdata-active-state={isActive ? 'on' : 'off'}\n\t\t\t\tdisabled={!canToggle}\n\t\t\t\tonSelect={handleToggle}\n\t\t\t>\n\t\t\t\t<Icon />\n\t\t\t\t<span>{label}</span>\n\t\t\t</DropdownMenuItem>\n\t\t);\n\t}\n);\n\nHeadingMenuItem.displayName = 'HeadingMenuItem';\n","import { Heading, Heading1, Heading2, Heading3, Heading4 } from 'lucide-react';\nimport { useCallback, useEffect, useState } from 'react';\n\nimport type { Editor } from '@tiptap/core';\nimport type { LucideIcon } from 'lucide-react';\n\nexport type HeadingLevel = 1 | 2 | 3 | 4;\n\ntype IconComponent = LucideIcon;\n\nconst headingIcons: Record<HeadingLevel, IconComponent> = {\n\t1: Heading1,\n\t2: Heading2,\n\t3: Heading3,\n\t4: Heading4\n};\n\nconst headingLabels: Record<HeadingLevel, string> = {\n\t1: 'Heading 1',\n\t2: 'Heading 2',\n\t3: 'Heading 3',\n\t4: 'Heading 4'\n};\n\nfunction canToggleHeading(editor: Editor | null, level: HeadingLevel): boolean {\n\tif (!editor || !editor.isEditable) return false;\n\n\treturn (\n\t\teditor.can().setNode('heading', { level }) || editor.can().clearNodes()\n\t);\n}\n\nexport function useHeading({\n\teditor,\n\tlevel\n}: {\n\teditor: Editor | null;\n\tlevel: HeadingLevel;\n}) {\n\tconst [isActive, setIsActive] = useState(false);\n\tconst [canToggle, setCanToggle] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\n\t\tconst handleUpdate = () => {\n\t\t\tsetIsActive(editor.isActive('heading', { level }));\n\t\t\tsetCanToggle(canToggleHeading(editor, level));\n\t\t};\n\n\t\thandleUpdate();\n\n\t\teditor.on('selectionUpdate', handleUpdate);\n\t\teditor.on('transaction', handleUpdate);\n\n\t\treturn () => {\n\t\t\teditor.off('selectionUpdate', handleUpdate);\n\t\t\teditor.off('transaction', handleUpdate);\n\t\t};\n\t}, [editor, level]);\n\n\tconst handleToggle = useCallback(() => {\n\t\tif (!editor || !editor.isEditable) return false;\n\n\t\tif (editor.isActive('heading', { level })) {\n\t\t\treturn editor.chain().focus().setNode('paragraph').run();\n\t\t}\n\n\t\t// clearNodes first to convert any block type to paragraph,\n\t\t// then set heading\n\t\treturn editor\n\t\t\t.chain()\n\t\t\t.focus()\n\t\t\t.clearNodes()\n\t\t\t.setNode('heading', { level })\n\t\t\t.run();\n\t}, [editor, level]);\n\n\treturn {\n\t\tisActive,\n\t\tcanToggle,\n\t\thandleToggle,\n\t\tlabel: headingLabels[level],\n\t\tIcon: headingIcons[level]\n\t};\n}\n\nexport function useActiveHeadingLevel(\n\teditor: Editor | null,\n\tlevels: HeadingLevel[]\n): HeadingLevel | null {\n\tconst [activeLevel, setActiveLevel] = useState<HeadingLevel | null>(null);\n\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\n\t\tconst handleUpdate = () => {\n\t\t\tconst found = levels.find((level) =>\n\t\t\t\teditor.isActive('heading', { level })\n\t\t\t);\n\n\t\t\tsetActiveLevel(found ?? null);\n\t\t};\n\n\t\thandleUpdate();\n\n\t\teditor.on('selectionUpdate', handleUpdate);\n\t\teditor.on('transaction', handleUpdate);\n\n\t\treturn () => {\n\t\t\teditor.off('selectionUpdate', handleUpdate);\n\t\t\teditor.off('transaction', handleUpdate);\n\t\t};\n\t}, [editor, levels]);\n\n\treturn activeLevel;\n}\n\nexport function getHeadingTriggerIcon(\n\tactiveLevel: HeadingLevel | null\n): IconComponent {\n\tif (activeLevel === null) return Heading;\n\n\treturn headingIcons[activeLevel];\n}\n","import { CheckIcon, ChevronRightIcon } from 'lucide-react';\nimport { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { cn } from '../../lib/utils';\n\nfunction DropdownMenu({\n\t...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n\treturn <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nfunction DropdownMenuPortal({\n\t...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n\treturn (\n\t\t<DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />\n\t);\n}\n\nfunction DropdownMenuTrigger({\n\t...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n\treturn (\n\t\t<DropdownMenuPrimitive.Trigger\n\t\t\tdata-slot=\"dropdown-menu-trigger\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DropdownMenuContent({\n\tclassName,\n\talign = 'start',\n\tsideOffset = 4,\n\t...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n\treturn (\n\t\t<DropdownMenuPrimitive.Portal>\n\t\t\t<DropdownMenuPrimitive.Content\n\t\t\t\talign={align}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'nt:z-50 nt:max-h-(--radix-dropdown-menu-content-available-height) nt:w-(--radix-dropdown-menu-trigger-width) nt:min-w-32 nt:origin-(--radix-dropdown-menu-content-transform-origin) nt:overflow-x-hidden nt:overflow-y-auto nt:rounded-lg nt:bg-popover nt:p-1 nt:text-popover-foreground nt:shadow-md nt:ring-1 nt:ring-foreground/10 nt:duration-100 nt:data-[side=bottom]:slide-in-from-top-2 nt:data-[side=left]:slide-in-from-right-2 nt:data-[side=right]:slide-in-from-left-2 nt:data-[side=top]:slide-in-from-bottom-2 nt:data-[state=closed]:overflow-hidden nt:data-open:animate-in nt:data-open:fade-in-0 nt:data-open:zoom-in-95 nt:data-closed:animate-out nt:data-closed:fade-out-0 nt:data-closed:zoom-out-95',\n\t\t\t\t\tclassName\n\t\t\t\t)}\n\t\t\t\tdata-slot=\"dropdown-menu-content\"\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</DropdownMenuPrimitive.Portal>\n\t);\n}\n\nfunction DropdownMenuGroup({\n\t...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n\treturn (\n\t\t<DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />\n\t);\n}\n\nfunction DropdownMenuItem({\n\tclassName,\n\tinset,\n\tvariant = 'default',\n\t...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n\tinset?: boolean;\n\tvariant?: 'default' | 'destructive';\n}) {\n\treturn (\n\t\t<DropdownMenuPrimitive.Item\n\t\t\tclassName={cn(\n\t\t\t\t'nt:group/dropdown-menu-item nt:relative nt:flex nt:cursor-default nt:items-center nt:gap-1.5 nt:rounded-md nt:px-1.5 nt:py-1 nt:text-sm nt:outline-hidden nt:select-none nt:focus:bg-accent nt:focus:text-accent-foreground nt:not-data-[variant=destructive]:focus:**:text-accent-foreground nt:data-inset:pl-7 nt:data-[variant=destructive]:text-destructive nt:data-[variant=destructive]:focus:bg-destructive/10 nt:data-[variant=destructive]:focus:text-destructive nt:dark:data-[variant=destructive]:focus:bg-destructive/20 nt:data-disabled:pointer-events-none nt:data-disabled:opacity-50 nt:[&_svg]:pointer-events-none nt:[&_svg]:shrink-0 nt:[&_svg:not([class*=size-])]:size-4 nt:data-[variant=destructive]:*:[svg]:text-destructive',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-inset={inset}\n\t\t\tdata-slot=\"dropdown-menu-item\"\n\t\t\tdata-variant={variant}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DropdownMenuCheckboxItem({\n\tclassName,\n\tchildren,\n\tchecked,\n\tinset,\n\t...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem> & {\n\tinset?: boolean;\n}) {\n\treturn (\n\t\t<DropdownMenuPrimitive.CheckboxItem\n\t\t\tchecked={checked}\n\t\t\tclassName={cn(\n\t\t\t\t'nt:relative nt:flex nt:cursor-default nt:items-center nt:gap-1.5 nt:rounded-md nt:py-1 nt:pr-8 nt:pl-1.5 nt:text-sm nt:outline-hidden nt:select-none nt:focus:bg-accent nt:focus:text-accent-foreground nt:focus:**:text-accent-foreground nt:data-inset:pl-7 nt:data-disabled:pointer-events-none nt:data-disabled:opacity-50 nt:[&_svg]:pointer-events-none nt:[&_svg]:shrink-0 nt:[&_svg:not([class*=size-])]:size-4',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-inset={inset}\n\t\t\tdata-slot=\"dropdown-menu-checkbox-item\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<span\n\t\t\t\tclassName=\"nt:pointer-events-none nt:absolute nt:right-2 nt:flex nt:items-center nt:justify-center\"\n\t\t\t\tdata-slot=\"dropdown-menu-checkbox-item-indicator\"\n\t\t\t>\n\t\t\t\t<DropdownMenuPrimitive.ItemIndicator>\n\t\t\t\t\t<CheckIcon />\n\t\t\t\t</DropdownMenuPrimitive.ItemIndicator>\n\t\t\t</span>\n\t\t\t{children}\n\t\t</DropdownMenuPrimitive.CheckboxItem>\n\t);\n}\n\nfunction DropdownMenuRadioGroup({\n\t...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n\treturn (\n\t\t<DropdownMenuPrimitive.RadioGroup\n\t\t\tdata-slot=\"dropdown-menu-radio-group\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DropdownMenuRadioItem({\n\tclassName,\n\tchildren,\n\tinset,\n\t...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem> & {\n\tinset?: boolean;\n}) {\n\treturn (\n\t\t<DropdownMenuPrimitive.RadioItem\n\t\t\tclassName={cn(\n\t\t\t\t'nt:relative nt:flex nt:cursor-default nt:items-center nt:gap-1.5 nt:rounded-md nt:py-1 nt:pr-8 nt:pl-1.5 nt:text-sm nt:outline-hidden nt:select-none nt:focus:bg-accent nt:focus:text-accent-foreground nt:focus:**:text-accent-foreground nt:data-inset:pl-7 nt:data-disabled:pointer-events-none nt:data-disabled:opacity-50 nt:[&_svg]:pointer-events-none nt:[&_svg]:shrink-0 nt:[&_svg:not([class*=size-])]:size-4',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-inset={inset}\n\t\t\tdata-slot=\"dropdown-menu-radio-item\"\n\t\t\t{...props}\n\t\t>\n\t\t\t<span\n\t\t\t\tclassName=\"nt:pointer-events-none nt:absolute nt:right-2 nt:flex nt:items-center nt:justify-center\"\n\t\t\t\tdata-slot=\"dropdown-menu-radio-item-indicator\"\n\t\t\t>\n\t\t\t\t<DropdownMenuPrimitive.ItemIndicator>\n\t\t\t\t\t<CheckIcon />\n\t\t\t\t</DropdownMenuPrimitive.ItemIndicator>\n\t\t\t</span>\n\t\t\t{children}\n\t\t</DropdownMenuPrimitive.RadioItem>\n\t);\n}\n\nfunction DropdownMenuLabel({\n\tclassName,\n\tinset,\n\t...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n\tinset?: boolean;\n}) {\n\treturn (\n\t\t<DropdownMenuPrimitive.Label\n\t\t\tclassName={cn(\n\t\t\t\t'nt:px-1.5 nt:py-1 nt:text-xs nt:font-medium nt:text-muted-foreground nt:data-inset:pl-7',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-inset={inset}\n\t\t\tdata-slot=\"dropdown-menu-label\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DropdownMenuSeparator({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n\treturn (\n\t\t<DropdownMenuPrimitive.Separator\n\t\t\tclassName={cn('nt:-mx-1 nt:my-1 nt:h-px nt:bg-border', className)}\n\t\t\tdata-slot=\"dropdown-menu-separator\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DropdownMenuShortcut({\n\tclassName,\n\t...props\n}: React.ComponentProps<'span'>) {\n\treturn (\n\t\t<span\n\t\t\tclassName={cn(\n\t\t\t\t'nt:ml-auto nt:text-xs nt:tracking-widest nt:text-muted-foreground nt:group-focus/dropdown-menu-item:text-accent-foreground',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"dropdown-menu-shortcut\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DropdownMenuSub({\n\t...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n\treturn <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nfunction DropdownMenuSubTrigger({\n\tclassName,\n\tinset,\n\tchildren,\n\t...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n\tinset?: boolean;\n}) {\n\treturn (\n\t\t<DropdownMenuPrimitive.SubTrigger\n\t\t\tclassName={cn(\n\t\t\t\t'nt:flex nt:cursor-default nt:items-center nt:gap-1.5 nt:rounded-md nt:px-1.5 nt:py-1 nt:text-sm nt:outline-hidden nt:select-none nt:focus:bg-accent nt:focus:text-accent-foreground nt:not-data-[variant=destructive]:focus:**:text-accent-foreground nt:data-inset:pl-7 nt:data-open:bg-accent nt:data-open:text-accent-foreground nt:[&_svg]:pointer-events-none nt:[&_svg]:shrink-0 nt:[&_svg:not([class*=size-])]:size-4',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-inset={inset}\n\t\t\tdata-slot=\"dropdown-menu-sub-trigger\"\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t<ChevronRightIcon className=\"nt:ml-auto\" />\n\t\t</DropdownMenuPrimitive.SubTrigger>\n\t);\n}\n\nfunction DropdownMenuSubContent({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n\treturn (\n\t\t<DropdownMenuPrimitive.SubContent\n\t\t\tclassName={cn(\n\t\t\t\t'nt:z-50 nt:min-w-[96px] nt:origin-(--radix-dropdown-menu-content-transform-origin) nt:overflow-hidden nt:rounded-lg nt:bg-popover nt:p-1 nt:text-popover-foreground nt:shadow-lg nt:ring-1 nt:ring-foreground/10 nt:duration-100 nt:data-[side=bottom]:slide-in-from-top-2 nt:data-[side=left]:slide-in-from-right-2 nt:data-[side=right]:slide-in-from-left-2 nt:data-[side=top]:slide-in-from-bottom-2 nt:data-open:animate-in nt:data-open:fade-in-0 nt:data-open:zoom-in-95 nt:data-closed:animate-out nt:data-closed:fade-out-0 nt:data-closed:zoom-out-95',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"dropdown-menu-sub-content\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tDropdownMenu,\n\tDropdownMenuPortal,\n\tDropdownMenuTrigger,\n\tDropdownMenuContent,\n\tDropdownMenuGroup,\n\tDropdownMenuLabel,\n\tDropdownMenuItem,\n\tDropdownMenuCheckboxItem,\n\tDropdownMenuRadioGroup,\n\tDropdownMenuRadioItem,\n\tDropdownMenuSeparator,\n\tDropdownMenuShortcut,\n\tDropdownMenuSub,\n\tDropdownMenuSubTrigger,\n\tDropdownMenuSubContent\n};\n","import {\n\tCornerDownLeft,\n\tExternalLink,\n\tLink as LinkIcon,\n\tTrash2\n} from 'lucide-react';\nimport { forwardRef, useCallback, useEffect, useState } from 'react';\n\nimport { useLinkPopover } from './use-link-popover';\nimport { Button } from '../ui/button';\nimport { Input } from '../ui/input';\nimport { Popover, PopoverContent, PopoverTrigger } from '../ui/popover';\nimport { Separator } from '../ui/separator';\n\nimport type { Editor } from '@tiptap/core';\n\nexport interface LinkPopoverProps extends Omit<\n\tReact.ButtonHTMLAttributes<HTMLButtonElement>,\n\t'type'\n> {\n\teditor: Editor | null;\n}\n\nexport const LinkPopover = forwardRef<HTMLButtonElement, LinkPopoverProps>(\n\t({ editor, ...buttonProps }, ref) => {\n\t\tconst [isOpen, setIsOpen] = useState(false);\n\n\t\tconst { url, setUrl, isActive, canSet, setLink, removeLink, openLink } =\n\t\t\tuseLinkPopover({ editor });\n\n\t\t// Auto-open popover when a link becomes active\n\t\tuseEffect(() => {\n\t\t\tif (isActive) {\n\t\t\t\tsetIsOpen(true);\n\t\t\t}\n\t\t}, [isActive]);\n\n\t\tconst handleSetLink = useCallback(() => {\n\t\t\tsetLink();\n\t\t\tsetIsOpen(false);\n\t\t}, [setLink]);\n\n\t\tconst handleRemoveLink = useCallback(() => {\n\t\t\tremoveLink();\n\t\t\tsetIsOpen(false);\n\t\t}, [removeLink]);\n\n\t\tconst handleKeyDown = useCallback(\n\t\t\t(event: React.KeyboardEvent<HTMLInputElement>) => {\n\t\t\t\tif (event.key === 'Enter') {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\thandleSetLink();\n\t\t\t\t}\n\t\t\t},\n\t\t\t[handleSetLink]\n\t\t);\n\n\t\treturn (\n\t\t\t<Popover open={isOpen} onOpenChange={setIsOpen}>\n\t\t\t\t<PopoverTrigger asChild>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\taria-label=\"Link\"\n\t\t\t\t\t\taria-pressed={isActive}\n\t\t\t\t\t\tdata-active-state={isActive ? 'on' : 'off'}\n\t\t\t\t\t\tdisabled={!canSet}\n\t\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\t{...buttonProps}\n\t\t\t\t\t>\n\t\t\t\t\t\t<LinkIcon\n\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\tisActive ? 'nt:text-[var(--tt-brand-color-500)]' : undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Button>\n\t\t\t\t</PopoverTrigger>\n\t\t\t\t<PopoverContent\n\t\t\t\t\talign=\"start\"\n\t\t\t\t\tclassName=\"nt:flex nt:w-auto nt:items-center nt:gap-1 nt:p-1\"\n\t\t\t\t>\n\t\t\t\t\t<Input\n\t\t\t\t\t\tautoFocus\n\t\t\t\t\t\tclassName=\"nt:h-7 nt:min-w-48 nt:border-none nt:shadow-none nt:focus-visible:ring-0\"\n\t\t\t\t\t\tplaceholder=\"Paste a link...\"\n\t\t\t\t\t\ttype=\"url\"\n\t\t\t\t\t\tvalue={url}\n\t\t\t\t\t\tonChange={(e) => setUrl(e.target.value)}\n\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t/>\n\t\t\t\t\t<Button\n\t\t\t\t\t\taria-label=\"Apply link\"\n\t\t\t\t\t\tdisabled={!url && !isActive}\n\t\t\t\t\t\tsize=\"icon-sm\"\n\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\tonClick={handleSetLink}\n\t\t\t\t\t>\n\t\t\t\t\t\t<CornerDownLeft />\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Separator className=\"nt:h-5\" orientation=\"vertical\" />\n\t\t\t\t\t<Button\n\t\t\t\t\t\taria-label=\"Open link in new window\"\n\t\t\t\t\t\tsize=\"icon-sm\"\n\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\tonClick={openLink}\n\t\t\t\t\t>\n\t\t\t\t\t\t<ExternalLink />\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\taria-label=\"Remove link\"\n\t\t\t\t\t\tsize=\"icon-sm\"\n\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\tonClick={handleRemoveLink}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Trash2 />\n\t\t\t\t\t</Button>\n\t\t\t\t</PopoverContent>\n\t\t\t</Popover>\n\t\t);\n\t}\n);\n\nLinkPopover.displayName = 'LinkPopover';\n","import { useCallback, useEffect, useState } from 'react';\n\nimport type { Editor } from '@tiptap/core';\n\nexport interface UseLinkPopoverConfig {\n\teditor: Editor | null;\n}\n\nexport function useLinkPopover({ editor }: UseLinkPopoverConfig) {\n\tconst [url, setUrl] = useState('');\n\tconst [isActive, setIsActive] = useState(false);\n\tconst [canSet, setCanSet] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\n\t\tconst handleUpdate = () => {\n\t\t\tconst active = editor.isActive('link');\n\n\t\t\tsetIsActive(active);\n\t\t\tsetCanSet(editor.isEditable);\n\n\t\t\tif (active) {\n\t\t\t\tsetUrl(editor.getAttributes('link').href ?? '');\n\t\t\t}\n\t\t};\n\n\t\thandleUpdate();\n\n\t\teditor.on('selectionUpdate', handleUpdate);\n\t\teditor.on('transaction', handleUpdate);\n\n\t\treturn () => {\n\t\t\teditor.off('selectionUpdate', handleUpdate);\n\t\t\teditor.off('transaction', handleUpdate);\n\t\t};\n\t}, [editor]);\n\n\tconst setLink = useCallback(() => {\n\t\tif (!editor) return;\n\n\t\tif (!url) {\n\t\t\teditor.chain().focus().extendMarkRange('link').unsetLink().run();\n\n\t\t\treturn;\n\t\t}\n\n\t\teditor.chain().focus().extendMarkRange('link').setLink({ href: url }).run();\n\t}, [editor, url]);\n\n\tconst removeLink = useCallback(() => {\n\t\tif (!editor) return;\n\n\t\teditor.chain().focus().extendMarkRange('link').unsetLink().run();\n\t\tsetUrl('');\n\t}, [editor]);\n\n\tconst openLink = useCallback(() => {\n\t\tif (!url) return;\n\n\t\tconst sanitized = /^https?:\\/\\//i.test(url) ? url : `https://${url}`;\n\n\t\twindow.open(sanitized, '_blank', 'noopener,noreferrer');\n\t}, [url]);\n\n\treturn { url, setUrl, isActive, canSet, setLink, removeLink, openLink };\n}\n","import * as React from 'react';\n\nimport { cn } from '../../lib/utils';\n\nfunction Input({ className, type, ...props }: React.ComponentProps<'input'>) {\n\treturn (\n\t\t<input\n\t\t\tclassName={cn(\n\t\t\t\t'nt:flex nt:h-9 nt:w-full nt:min-w-0 nt:rounded-md nt:border nt:border-input nt:bg-transparent nt:px-3 nt:py-1 nt:text-base nt:shadow-xs nt:transition-[color,box-shadow] nt:outline-none nt:file:inline-flex nt:file:h-7 nt:file:border-0 nt:file:bg-transparent nt:file:text-sm nt:file:font-medium nt:file:text-foreground nt:placeholder:text-muted-foreground nt:selection:bg-primary nt:selection:text-primary-foreground nt:dark:bg-input/30 nt:md:text-sm nt:focus-visible:border-ring nt:focus-visible:ring-3 nt:focus-visible:ring-ring/50 nt:aria-invalid:border-destructive nt:aria-invalid:ring-3 nt:aria-invalid:ring-destructive/20 nt:dark:aria-invalid:ring-destructive/40 nt:disabled:cursor-not-allowed nt:disabled:opacity-50',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"input\"\n\t\t\ttype={type}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Input };\n","import { Popover as PopoverPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { cn } from '../../lib/utils';\n\nfunction Popover({\n\t...props\n}: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n\treturn <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\nfunction PopoverTrigger({\n\t...props\n}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {\n\treturn <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props} />;\n}\n\nfunction PopoverAnchor({\n\t...props\n}: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {\n\treturn <PopoverPrimitive.Anchor data-slot=\"popover-anchor\" {...props} />;\n}\n\nfunction PopoverContent({\n\tclassName,\n\talign = 'center',\n\tsideOffset = 4,\n\t...props\n}: React.ComponentProps<typeof PopoverPrimitive.Content>) {\n\treturn (\n\t\t<PopoverPrimitive.Portal>\n\t\t\t<PopoverPrimitive.Content\n\t\t\t\talign={align}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'nt:z-50 nt:w-72 nt:origin-(--radix-popover-content-transform-origin) nt:rounded-lg nt:bg-popover nt:p-4 nt:text-popover-foreground nt:shadow-md nt:ring-1 nt:ring-foreground/10 nt:outline-none nt:data-[side=bottom]:slide-in-from-top-2 nt:data-[side=left]:slide-in-from-right-2 nt:data-[side=right]:slide-in-from-left-2 nt:data-[side=top]:slide-in-from-bottom-2 nt:data-open:animate-in nt:data-open:fade-in-0 nt:data-open:zoom-in-95 nt:data-closed:animate-out nt:data-closed:fade-out-0 nt:data-closed:zoom-out-95',\n\t\t\t\t\tclassName\n\t\t\t\t)}\n\t\t\t\tdata-slot=\"popover-content\"\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</PopoverPrimitive.Portal>\n\t);\n}\n\nexport { Popover, PopoverAnchor, PopoverContent, PopoverTrigger };\n","import { Separator as SeparatorPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { cn } from '../../lib/utils';\n\nfunction Separator({\n\tclassName,\n\torientation = 'horizontal',\n\tdecorative = true,\n\t...props\n}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {\n\treturn (\n\t\t<SeparatorPrimitive.Root\n\t\t\tclassName={cn(\n\t\t\t\t'nt:shrink-0 nt:bg-border nt:data-[orientation=horizontal]:h-px nt:data-[orientation=horizontal]:w-full nt:data-[orientation=vertical]:h-full nt:data-[orientation=vertical]:w-px',\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\tdata-slot=\"separator\"\n\t\t\tdecorative={decorative}\n\t\t\torientation={orientation}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Separator };\n","import { ChevronDown } from 'lucide-react';\nimport { forwardRef } from 'react';\n\nimport { ListMenuItem } from './list-menu-item';\nimport {\n\tgetListTriggerIcon,\n\tuseActiveListType,\n\ttype ListType\n} from './use-list';\nimport { Button } from '../ui/button';\nimport {\n\tDropdownMenu,\n\tDropdownMenuTrigger,\n\tDropdownMenuContent,\n\tDropdownMenuGroup\n} from '../ui/dropdown-menu';\n\nimport type { Editor } from '@tiptap/core';\nimport type { ComponentProps } from 'react';\n\nexport interface ListDropdownMenuProps extends Omit<\n\tComponentProps<typeof Button>,\n\t'type'\n> {\n\teditor: Editor | null;\n\ttypes?: ListType[];\n}\n\nexport const ListDropdownMenu = forwardRef<\n\tHTMLButtonElement,\n\tListDropdownMenuProps\n>(\n\t(\n\t\t{\n\t\t\teditor,\n\t\t\ttypes = ['bulletList', 'orderedList', 'taskList'],\n\t\t\t...buttonProps\n\t\t},\n\t\tref\n\t) => {\n\t\tconst activeType = useActiveListType(editor, types);\n\t\tconst TriggerIcon = getListTriggerIcon(activeType);\n\n\t\treturn (\n\t\t\t<DropdownMenu>\n\t\t\t\t<DropdownMenuTrigger asChild>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\taria-label=\"List\"\n\t\t\t\t\t\tclassName=\"nt:gap-1 nt:px-2\"\n\t\t\t\t\t\tdata-active-state={activeType !== null ? 'on' : 'off'}\n\t\t\t\t\t\tsize=\"default\"\n\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\t{...buttonProps}\n\t\t\t\t\t>\n\t\t\t\t\t\t<TriggerIcon\n\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\tactiveType !== null\n\t\t\t\t\t\t\t\t\t? 'nt:text-[var(--tt-brand-color-500)]'\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ChevronDown className=\"nt:size-3\" />\n\t\t\t\t\t</Button>\n\t\t\t\t</DropdownMenuTrigger>\n\t\t\t\t<DropdownMenuContent align=\"start\">\n\t\t\t\t\t<DropdownMenuGroup>\n\t\t\t\t\t\t{types.map((type) => (\n\t\t\t\t\t\t\t<ListMenuItem key={type} editor={editor} listType={type} />\n\t\t\t\t\t\t))}\n\t\t\t\t\t</DropdownMenuGroup>\n\t\t\t\t</DropdownMenuContent>\n\t\t\t</DropdownMenu>\n\t\t);\n\t}\n);\n\nListDropdownMenu.displayName = 'ListDropdownMenu';\n","import { forwardRef } from 'react';\n\nimport { useList, type ListType } from './use-list';\nimport { DropdownMenuItem } from '../ui/dropdown-menu';\n\nimport type { Editor } from '@tiptap/core';\n\nexport interface ListMenuItemProps {\n\teditor: Editor | null;\n\tlistType: ListType;\n}\n\nexport const ListMenuItem = forwardRef<HTMLDivElement, ListMenuItemProps>(\n\t({ editor, listType }, ref) => {\n\t\tconst { isActive, canToggle, handleToggle, label, Icon } = useList({\n\t\t\teditor,\n\t\t\ttype: listType\n\t\t});\n\n\t\treturn (\n\t\t\t<DropdownMenuItem\n\t\t\t\tref={ref}\n\t\t\t\taria-label={label}\n\t\t\t\tclassName=\"nt:data-[active-state=on]:bg-accent nt:data-[active-state=on]:text-[var(--tt-brand-color-500)]\"\n\t\t\t\tdata-active-state={isActive ? 'on' : 'off'}\n\t\t\t\tdisabled={!canToggle}\n\t\t\t\tonSelect={handleToggle}\n\t\t\t>\n\t\t\t\t<Icon />\n\t\t\t\t<span>{label}</span>\n\t\t\t</DropdownMenuItem>\n\t\t);\n\t}\n);\n\nListMenuItem.displayName = 'ListMenuItem';\n","import { List, ListOrdered, ListTodo } from 'lucide-react';\nimport { useCallback, useEffect, useState } from 'react';\n\nimport type { Editor } from '@tiptap/core';\nimport type { LucideIcon } from 'lucide-react';\n\nexport type ListType = 'bulletList' | 'orderedList' | 'taskList';\n\ntype IconComponent = LucideIcon;\n\nconst listIcons: Record<ListType, IconComponent> = {\n\tbulletList: List,\n\torderedList: ListOrdered,\n\ttaskList: ListTodo\n};\n\nconst listLabels: Record<ListType, string> = {\n\tbulletList: 'Bullet List',\n\torderedList: 'Ordered List',\n\ttaskList: 'Task List'\n};\n\nconst listItemTypes: Record<ListType, string> = {\n\tbulletList: 'listItem',\n\torderedList: 'listItem',\n\ttaskList: 'taskItem'\n};\n\nfunction canToggleList(editor: Editor | null): boolean {\n\tif (!editor || !editor.isEditable) return false;\n\n\treturn (\n\t\teditor.can().toggleList('bulletList', 'listItem') ||\n\t\teditor.can().clearNodes()\n\t);\n}\n\nexport function useList({\n\teditor,\n\ttype\n}: {\n\teditor: Editor | null;\n\ttype: ListType;\n}) {\n\tconst [isActive, setIsActive] = useState(false);\n\tconst [canToggle, setCanToggle] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\n\t\tconst handleUpdate = () => {\n\t\t\tsetIsActive(editor.isActive(type));\n\t\t\tsetCanToggle(canToggleList(editor));\n\t\t};\n\n\t\thandleUpdate();\n\n\t\teditor.on('selectionUpdate', handleUpdate);\n\t\teditor.on('transaction', handleUpdate);\n\n\t\treturn () => {\n\t\t\teditor.off('selectionUpdate', handleUpdate);\n\t\t\teditor.off('transaction', handleUpdate);\n\t\t};\n\t}, [editor, type]);\n\n\tconst handleToggle = useCallback(() => {\n\t\tif (!editor || !editor.isEditable) return false;\n\n\t\tconst itemType = listItemTypes[type];\n\n\t\tif (editor.isActive(type)) {\n\t\t\t// Currently this list type → convert back to paragraph\n\t\t\treturn editor.chain().focus().clearNodes().run();\n\t\t}\n\n\t\t// clearNodes first to convert any block type to paragraph,\n\t\t// then toggle list\n\t\treturn editor.chain().focus().clearNodes().toggleList(type, itemType).run();\n\t}, [editor, type]);\n\n\treturn {\n\t\tisActive,\n\t\tcanToggle,\n\t\thandleToggle,\n\t\tlabel: listLabels[type],\n\t\tIcon: listIcons[type]\n\t};\n}\n\nexport function useActiveListType(\n\teditor: Editor | null,\n\ttypes: ListType[]\n): ListType | null {\n\tconst [activeType, setActiveType] = useState<ListType | null>(null);\n\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\n\t\tconst handleUpdate = () => {\n\t\t\tconst found = types.find((type) => editor.isActive(type));\n\n\t\t\tsetActiveType(found ?? null);\n\t\t};\n\n\t\thandleUpdate();\n\n\t\teditor.on('selectionUpdate', handleUpdate);\n\t\teditor.on('transaction', handleUpdate);\n\n\t\treturn () => {\n\t\t\teditor.off('selectionUpdate', handleUpdate);\n\t\t\teditor.off('transaction', handleUpdate);\n\t\t};\n\t}, [editor, types]);\n\n\treturn activeType;\n}\n\nexport function getListTriggerIcon(activeType: ListType | null): IconComponent {\n\tif (activeType === null) return List;\n\n\treturn listIcons[activeType];\n}\n","import { forwardRef, useCallback } from 'react';\n\nimport { useMark } from './use-mark';\nimport { Button } from '../ui/button';\n\nimport type { MarkType } from './use-mark';\nimport type { Editor } from '@tiptap/core';\n\nexport interface MarkButtonProps extends Omit<\n\tReact.ButtonHTMLAttributes<HTMLButtonElement>,\n\t'type'\n> {\n\teditor: Editor | null;\n\ttype: MarkType;\n}\n\nexport const MarkButton = forwardRef<HTMLButtonElement, MarkButtonProps>(\n\t({ editor, type, onClick, ...buttonProps }, ref) => {\n\t\tconst { isActive, canToggle, handleToggle, label, Icon } = useMark({\n\t\t\teditor,\n\t\t\ttype\n\t\t});\n\n\t\tconst handleClick = useCallback(\n\t\t\t(event: React.MouseEvent<HTMLButtonElement>) => {\n\t\t\t\tonClick?.(event);\n\n\t\t\t\tif (event.defaultPrevented) return;\n\n\t\t\t\thandleToggle();\n\t\t\t},\n\t\t\t[handleToggle, onClick]\n\t\t);\n\n\t\treturn (\n\t\t\t<Button\n\t\t\t\tref={ref}\n\t\t\t\taria-label={label}\n\t\t\t\taria-pressed={isActive}\n\t\t\t\tdata-active-state={isActive ? 'on' : 'off'}\n\t\t\t\tdisabled={!canToggle}\n\t\t\t\tsize=\"icon\"\n\t\t\t\ttabIndex={-1}\n\t\t\t\ttype=\"button\"\n\t\t\t\tvariant=\"ghost\"\n\t\t\t\tonClick={handleClick}\n\t\t\t\t{...buttonProps}\n\t\t\t>\n\t\t\t\t<Icon\n\t\t\t\t\tclassName={\n\t\t\t\t\t\tisActive ? 'nt:text-[var(--tt-brand-color-500)]' : undefined\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</Button>\n\t\t);\n\t}\n);\n\nMarkButton.displayName = 'MarkButton';\n","import { Bold, Code, Italic, Strikethrough } from 'lucide-react';\nimport { useCallback, useEffect, useState } from 'react';\n\nimport type { Editor } from '@tiptap/core';\nimport type { LucideIcon } from 'lucide-react';\n\nexport type MarkType = 'bold' | 'italic' | 'strike' | 'code';\n\nexport interface UseMarkConfig {\n\teditor: Editor | null;\n\ttype: MarkType;\n}\n\nconst markLabels: Record<MarkType, string> = {\n\tbold: 'Bold',\n\titalic: 'Italic',\n\tstrike: 'Strikethrough',\n\tcode: 'Code'\n};\n\nconst markIcons: Record<MarkType, LucideIcon> = {\n\tbold: Bold,\n\titalic: Italic,\n\tstrike: Strikethrough,\n\tcode: Code\n};\n\nexport function useMark({ editor, type }: UseMarkConfig) {\n\tconst [isActive, setIsActive] = useState(false);\n\tconst [canToggle, setCanToggle] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\n\t\tconst handleUpdate = () => {\n\t\t\tsetIsActive(editor.isActive(type));\n\t\t\tsetCanToggle(editor.isEditable && editor.can().toggleMark(type));\n\t\t};\n\n\t\thandleUpdate();\n\n\t\teditor.on('selectionUpdate', handleUpdate);\n\t\teditor.on('transaction', handleUpdate);\n\n\t\treturn () => {\n\t\t\teditor.off('selectionUpdate', handleUpdate);\n\t\t\teditor.off('transaction', handleUpdate);\n\t\t};\n\t}, [editor, type]);\n\n\tconst handleToggle = useCallback(() => {\n\t\tif (!editor || !editor.isEditable) return false;\n\n\t\treturn editor.chain().focus().toggleMark(type).run();\n\t}, [editor, type]);\n\n\treturn {\n\t\tisActive,\n\t\tcanToggle,\n\t\thandleToggle,\n\t\tlabel: markLabels[type],\n\t\tIcon: markIcons[type]\n\t};\n}\n","import { forwardRef } from 'react';\n\nexport interface ToolbarProps extends React.HTMLAttributes<HTMLDivElement> {\n\tvariant?: 'fixed' | 'floating';\n}\n\nexport const Toolbar = forwardRef<HTMLDivElement, ToolbarProps>(\n\t({ children, className, variant = 'fixed', ...props }, ref) => {\n\t\tconst classNames = ['tiptap-toolbar', className].filter(Boolean).join(' ');\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\taria-label=\"toolbar\"\n\t\t\t\tclassName={classNames}\n\t\t\t\tdata-variant={variant}\n\t\t\t\trole=\"toolbar\"\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t}\n);\n\nToolbar.displayName = 'Toolbar';\n\nexport function ToolbarGroup({\n\tchildren,\n\tclassName,\n\t...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n\tconst classNames = ['tiptap-toolbar-group', className]\n\t\t.filter(Boolean)\n\t\t.join(' ');\n\n\treturn (\n\t\t<div className={classNames} role=\"group\" {...props}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n\nexport interface ToolbarSeparatorProps extends React.HTMLAttributes<HTMLDivElement> {\n\torientation?: 'horizontal' | 'vertical';\n}\n\nexport function ToolbarSeparator({\n\torientation = 'vertical',\n\tclassName,\n\t...props\n}: ToolbarSeparatorProps) {\n\tconst classNames = ['tiptap-separator', className].filter(Boolean).join(' ');\n\n\treturn (\n\t\t<div\n\t\t\taria-orientation={orientation === 'vertical' ? orientation : undefined}\n\t\t\tclassName={classNames}\n\t\t\tdata-orientation={orientation}\n\t\t\trole=\"separator\"\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n","export function Spacer() {\n\treturn <div style={{ flex: 1 }} />;\n}\n","import { forwardRef, useCallback } from 'react';\n\nimport { useUndoRedo } from './use-undo-redo';\nimport { Button } from '../ui/button';\n\nimport type { UndoRedoAction } from './use-undo-redo';\nimport type { Editor } from '@tiptap/core';\n\nexport interface UndoRedoButtonProps extends Omit<\n\tReact.ButtonHTMLAttributes<HTMLButtonElement>,\n\t'type'\n> {\n\teditor: Editor | null;\n\taction: UndoRedoAction;\n}\n\nexport const UndoRedoButton = forwardRef<\n\tHTMLButtonElement,\n\tUndoRedoButtonProps\n>(({ editor, action, onClick, ...buttonProps }, ref) => {\n\tconst { canExecute, handleAction, label, Icon } = useUndoRedo({\n\t\teditor,\n\t\taction\n\t});\n\n\tconst handleClick = useCallback(\n\t\t(event: React.MouseEvent<HTMLButtonElement>) => {\n\t\t\tonClick?.(event);\n\n\t\t\tif (event.defaultPrevented) return;\n\n\t\t\thandleAction();\n\t\t},\n\t\t[handleAction, onClick]\n\t);\n\n\treturn (\n\t\t<Button\n\t\t\tref={ref}\n\t\t\taria-label={label}\n\t\t\tdisabled={!canExecute}\n\t\t\tsize=\"icon\"\n\t\t\ttabIndex={-1}\n\t\t\ttype=\"button\"\n\t\t\tvariant=\"ghost\"\n\t\t\tonClick={handleClick}\n\t\t\t{...buttonProps}\n\t\t>\n\t\t\t<Icon />\n\t\t</Button>\n\t);\n});\n\nUndoRedoButton.displayName = 'UndoRedoButton';\n","import { Undo2, Redo2 } from 'lucide-react';\nimport { useCallback, useEffect, useState } from 'react';\n\nimport type { Editor } from '@tiptap/core';\n\nexport type UndoRedoAction = 'undo' | 'redo';\n\nexport interface UseUndoRedoConfig {\n\teditor: Editor | null;\n\taction: UndoRedoAction;\n}\n\nconst actionLabels: Record<UndoRedoAction, string> = {\n\tundo: 'Undo',\n\tredo: 'Redo'\n};\n\nconst actionIcons = {\n\tundo: Undo2,\n\tredo: Redo2\n};\n\nfunction canExecuteAction(\n\teditor: Editor | null,\n\taction: UndoRedoAction\n): boolean {\n\tif (!editor || !editor.isEditable) return false;\n\n\treturn action === 'undo' ? editor.can().undo() : editor.can().redo();\n}\n\nexport function useUndoRedo({ editor, action }: UseUndoRedoConfig) {\n\tconst [canExecute, setCanExecute] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\n\t\tconst handleUpdate = () => {\n\t\t\tsetCanExecute(canExecuteAction(editor, action));\n\t\t};\n\n\t\thandleUpdate();\n\n\t\teditor.on('transaction', handleUpdate);\n\n\t\treturn () => {\n\t\t\teditor.off('transaction', handleUpdate);\n\t\t};\n\t}, [editor, action]);\n\n\tconst handleAction = useCallback(() => {\n\t\tif (!editor || !editor.isEditable) return false;\n\n\t\tif (!canExecuteAction(editor, action)) return false;\n\n\t\tconst chain = editor.chain().focus();\n\n\t\treturn action === 'undo' ? chain.undo().run() : chain.redo().run();\n\t}, [editor, action]);\n\n\treturn {\n\t\tcanExecute,\n\t\thandleAction,\n\t\tlabel: actionLabels[action],\n\t\tIcon: actionIcons[action]\n\t};\n}\n","import { EditorState } from '@tiptap/pm/state';\nimport { useEditor } from '@tiptap/react';\nimport { useEffect, useRef } from 'react';\n\nimport { editorExtensions } from '../extensions';\n\nimport type { MarkdownStorage } from 'tiptap-markdown';\n\nexport interface UseMarkdownEditorOptions {\n\tvalue: string;\n\tonChange: (value: string) => void;\n\tplaceholder?: string;\n\teditable?: boolean;\n}\n\nfunction getMarkdown(storage: Record<string, unknown>): string {\n\treturn (storage.markdown as MarkdownStorage).getMarkdown();\n}\n\nexport function useMarkdownEditor({\n\tvalue,\n\tonChange,\n\teditable = true\n}: UseMarkdownEditorOptions) {\n\tconst externalValue = useRef(value);\n\tconst onChangeRef = useRef(onChange);\n\n\tonChangeRef.current = onChange;\n\n\tconst editor = useEditor({\n\t\textensions: editorExtensions,\n\t\teditable,\n\t\tcontent: value,\n\t\tonUpdate({ editor }) {\n\t\t\tconst md = getMarkdown(\n\t\t\t\teditor.storage as unknown as Record<string, unknown>\n\t\t\t);\n\n\t\t\texternalValue.current = md;\n\t\t\tonChangeRef.current(md);\n\t\t},\n\t\tonCreate({ editor }) {\n\t\t\t// Browser-specific behaviors (MutationObserver, DOM reconciliation)\n\t\t\t// may create unwanted transactions during mount, polluting the history\n\t\t\t// and making undo available before the user has made any changes.\n\t\t\t// Reset the editor state after initialization to ensure a clean history.\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (editor.isDestroyed) return;\n\n\t\t\t\tconst { state } = editor;\n\t\t\t\tconst freshState = EditorState.create({\n\t\t\t\t\tdoc: state.doc,\n\t\t\t\t\tselection: state.selection,\n\t\t\t\t\tplugins: state.plugins\n\t\t\t\t});\n\n\t\t\t\teditor.view.updateState(freshState);\n\t\t\t\t// Dispatch empty transaction to notify state listeners (undo/redo buttons)\n\t\t\t\teditor.view.dispatch(editor.view.state.tr);\n\t\t\t}, 0);\n\t\t}\n\t});\n\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\n\t\tif (value === externalValue.current) return;\n\n\t\texternalValue.current = value;\n\t\teditor.commands.setContent(value);\n\t}, [value, editor]);\n\n\tuseEffect(() => {\n\t\tif (!editor) return;\n\n\t\teditor.setEditable(editable);\n\t}, [editable, editor]);\n\n\treturn { editor };\n}\n","import { ListKit } from '@tiptap/extension-list';\nimport StarterKit, { type StarterKitOptions } from '@tiptap/starter-kit';\n\n// Shared StarterKit config: content nodes/marks, no lists (use ListKit instead)\nexport const starterKitBaseConfig: Partial<StarterKitOptions> = {\n\theading: { levels: [1, 2, 3, 4, 5, 6] },\n\tlink: {\n\t\topenOnClick: false,\n\t\tautolink: true\n\t},\n\t// Disable StarterKit's built-in list handling; use @tiptap/extension-list instead\n\tbulletList: false,\n\torderedList: false,\n\tlistItem: false,\n\tlistKeymap: false\n};\n\n// Content model extensions — shared by editor and reader\n// No interactive features (dropcursor, gapcursor, undoRedo, trailingNode)\nexport const sharedExtensions = [\n\tStarterKit.configure({\n\t\t...starterKitBaseConfig,\n\t\tdropcursor: false,\n\t\tgapcursor: false,\n\t\tundoRedo: false,\n\t\ttrailingNode: false\n\t}),\n\tListKit\n];\n","import { ListKit } from '@tiptap/extension-list';\nimport StarterKit from '@tiptap/starter-kit';\nimport { Markdown } from 'tiptap-markdown';\n\nimport { starterKitBaseConfig } from './shared';\n\n// Editor extensions = shared content model + interactive features + Markdown\nexport const editorExtensions = [\n\tStarterKit.configure(starterKitBaseConfig),\n\tListKit,\n\tMarkdown.configure({\n\t\thtml: false,\n\t\ttransformPastedText: true,\n\t\ttransformCopiedText: true\n\t})\n];\n","import { renderToReactElement } from '@tiptap/static-renderer/pm/react';\n\nimport { sharedExtensions } from './extensions';\nimport { markdownToJSON } from './utils/markdown-to-json';\n\nexport interface NotraReaderProps {\n\t/** Markdown content to render */\n\tcontent: string;\n\t/** Additional CSS class on the wrapper element */\n\tclassName?: string;\n}\n\nexport function NotraReader({ content, className }: NotraReaderProps) {\n\tconst json = markdownToJSON(content);\n\n\tconst rendered = renderToReactElement({\n\t\textensions: sharedExtensions,\n\t\tcontent: json\n\t});\n\n\tconst classNames = ['notra', 'notra-reader', className]\n\t\t.filter(Boolean)\n\t\t.join(' ');\n\n\treturn <div className={classNames}>{rendered}</div>;\n}\n","import { Editor } from '@tiptap/core';\nimport { Markdown } from 'tiptap-markdown';\n\nimport { sharedExtensions } from '../extensions';\n\n// Parser needs shared content model + Markdown for markdown→JSON conversion\n// No clipboard features needed (transformPastedText/transformCopiedText are editor-only)\nconst parserExtensions = [\n\t...sharedExtensions,\n\tMarkdown.configure({ html: false })\n];\n\nlet parserEditor: Editor | null = null;\n\nfunction getParserEditor(): Editor {\n\tif (!parserEditor) {\n\t\tparserEditor = new Editor({\n\t\t\textensions: parserExtensions,\n\t\t\tcontent: ''\n\t\t});\n\t}\n\n\treturn parserEditor;\n}\n\n/**\n * Convert a Markdown string to Tiptap-compatible JSON (ProseMirror document).\n * Uses a singleton headless Tiptap editor for parsing.\n */\nexport function markdownToJSON(markdown: string): Record<string, unknown> {\n\tconst editor = getParserEditor();\n\n\teditor.commands.setContent(markdown);\n\n\treturn editor.getJSON() as Record<string, unknown>;\n}\n","import { useEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport type { ReactNode } from 'react';\n\nexport interface DropdownMenuProps {\n\ttrigger: ReactNode;\n\tchildren: ReactNode;\n\topen?: boolean;\n\tonOpenChange?: (open: boolean) => void;\n}\n\nexport function DropdownMenu({\n\ttrigger,\n\tchildren,\n\topen: controlledOpen,\n\tonOpenChange\n}: DropdownMenuProps) {\n\tconst isControlled = controlledOpen !== undefined;\n\tconst [uncontrolledOpen, setUncontrolledOpen] = useState(false);\n\tconst open = isControlled ? controlledOpen : uncontrolledOpen;\n\tconst triggerRef = useRef<HTMLDivElement>(null);\n\tconst contentRef = useRef<HTMLDivElement>(null);\n\tconst [position, setPosition] = useState({ top: 0, left: 0 });\n\n\tconst setOpen = (value: boolean) => {\n\t\tif (!isControlled) {\n\t\t\tsetUncontrolledOpen(value);\n\t\t}\n\n\t\tonOpenChange?.(value);\n\t};\n\n\t// Compute position from trigger bounding rect\n\tuseEffect(() => {\n\t\tif (!open || !triggerRef.current) return;\n\n\t\tconst updatePosition = () => {\n\t\t\tif (!triggerRef.current) return;\n\n\t\t\tconst rect = triggerRef.current.getBoundingClientRect();\n\n\t\t\tsetPosition({\n\t\t\t\ttop: rect.bottom + 4,\n\t\t\t\tleft: rect.left + rect.width / 2\n\t\t\t});\n\t\t};\n\n\t\tupdatePosition();\n\n\t\twindow.addEventListener('scroll', updatePosition, true);\n\t\twindow.addEventListener('resize', updatePosition);\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener('scroll', updatePosition, true);\n\t\t\twindow.removeEventListener('resize', updatePosition);\n\t\t};\n\t}, [open]);\n\n\t// Close on click outside\n\tuseEffect(() => {\n\t\tif (!open) return;\n\n\t\tconst handleMouseDown = (event: MouseEvent) => {\n\t\t\tconst target = event.target as Node;\n\n\t\t\tif (\n\t\t\t\ttriggerRef.current?.contains(target) ||\n\t\t\t\tcontentRef.current?.contains(target)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetOpen(false);\n\t\t};\n\n\t\tdocument.addEventListener('mousedown', handleMouseDown);\n\n\t\treturn () => document.removeEventListener('mousedown', handleMouseDown);\n\t}, [open]);\n\n\t// Close on Escape key\n\tuseEffect(() => {\n\t\tif (!open) return;\n\n\t\tconst handleKeyDown = (event: KeyboardEvent) => {\n\t\t\tif (event.key === 'Escape') {\n\t\t\t\tsetOpen(false);\n\t\t\t}\n\t\t};\n\n\t\tdocument.addEventListener('keydown', handleKeyDown);\n\n\t\treturn () => document.removeEventListener('keydown', handleKeyDown);\n\t}, [open]);\n\n\treturn (\n\t\t<>\n\t\t\t<div ref={triggerRef} onClick={() => setOpen(!open)}>\n\t\t\t\t{trigger}\n\t\t\t</div>\n\t\t\t{open &&\n\t\t\t\tcreatePortal(\n\t\t\t\t\t<div className=\"notra-editor\">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={contentRef}\n\t\t\t\t\t\t\tclassName=\"tiptap-dropdown-menu-content\"\n\t\t\t\t\t\t\tdata-state=\"open\"\n\t\t\t\t\t\t\trole=\"menu\"\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tposition: 'fixed',\n\t\t\t\t\t\t\t\ttop: position.top,\n\t\t\t\t\t\t\t\tleft: position.left\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName=\"tiptap-dropdown-menu-group\"\n\t\t\t\t\t\t\t\tonClick={() => setOpen(false)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>,\n\t\t\t\t\tdocument.body\n\t\t\t\t)}\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAO;;;ACAP,IAAAC,iBAA8B;;;ACA9B,0BAA0B;AAC1B,mBAA6D;;;ACD7D,sCAAuC;AACvC,sBAAqB;;;ACDrB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC3C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC5B;;;ADoDE;AAnDF,IAAM,qBAAiB;AAAA,EACtB;AAAA,EACA;AAAA,IACC,UAAU;AAAA,MACT,SAAS;AAAA,QACR,SACC;AAAA,QACD,SACC;AAAA,QACD,WACC;AAAA,QACD,OACC;AAAA,QACD,aACC;AAAA,QACD,MAAM;AAAA,MAC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A,aAAS,iBAAiB,aAAa,eAAe;AAEtD,WAAO,MAAM,SAAS,oBAAoB,aAAa,eAAe;AAAA,EACvE,GAAG,CAAC,IAAI,CAAC;AAGT,gCAAU,MAAM;AACf,QAAI,CAAC,KAAM;AAEX,UAAM,gBAAgB,CAAC,UAAyB;AAC/C,UAAI,MAAM,QAAQ,UAAU;AAC3B,gBAAQ,KAAK;AAAA,MACd;AAAA,IACD;AAEA,aAAS,iBAAiB,WAAW,aAAa;AAElD,WAAO,MAAM,SAAS,oBAAoB,WAAW,aAAa;AAAA,EACnE,GAAG,CAAC,IAAI,CAAC;AAET,SACC,gFACC;AAAA,kDAAC,SAAI,KAAK,YAAY,SAAS,MAAM,QAAQ,CAAC,IAAI,GAChD,mBACF;AAAA,IACC,YACA;AAAA,MACC,8CAAC,SAAI,WAAU,gBACd;AAAA,QAAC;AAAA;AAAA,UACA,KAAK;AAAA,UACL,WAAU;AAAA,UACV,cAAW;AAAA,UACX,MAAK;AAAA,UACL,OAAO;AAAA,YACN,UAAU;AAAA,YACV,KAAK,SAAS;AAAA,YACd,MAAM,SAAS;AAAA,UAChB;AAAA,UAEA;AAAA,YAAC;AAAA;AAAA,cACA,WAAU;AAAA,cACV,SAAS,MAAM,QAAQ,KAAK;AAAA,cAE3B;AAAA;AAAA,UACF;AAAA;AAAA,MACD,GACD;AAAA,MACA,SAAS;AAAA,IACV;AAAA,KACF;AAEF;","names":["DropdownMenu","import_react","import_jsx_runtime","import_lucide_react","import_react","import_jsx_runtime","import_lucide_react","import_react","import_react","import_lucide_react","import_react","import_lucide_react","import_radix_ui","import_jsx_runtime","DropdownMenuPrimitive","DropdownMenuPrimitive","import_jsx_runtime","import_jsx_runtime","import_lucide_react","import_react","import_react","import_jsx_runtime","import_radix_ui","import_jsx_runtime","PopoverPrimitive","PopoverPrimitive","import_radix_ui","import_jsx_runtime","SeparatorPrimitive","import_jsx_runtime","LinkIcon","import_lucide_react","import_react","import_react","import_lucide_react","import_react","import_jsx_runtime","import_jsx_runtime","import_react","import_lucide_react","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_react","import_lucide_react","import_react","import_jsx_runtime","import_react","StarterKit","import_extension_list","import_starter_kit","StarterKit","editor","import_jsx_runtime","import_react","import_tiptap_markdown","import_jsx_runtime","import_react","import_jsx_runtime","DropdownMenu"]}
|