@junbyeol/tiptap-editor 0.1.5 → 1.0.13

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.
Files changed (123) hide show
  1. package/README.md +103 -6
  2. package/dist/index.cjs +71 -164
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.mjs +29327 -26994
  5. package/dist/index.mjs.map +1 -0
  6. package/dist/style.css +1 -1
  7. package/dist/types/components/custom/blockquote-popover.d.ts +6 -0
  8. package/dist/types/components/custom/font-family-dropdown-menu/font-family-dropdown-menu.d.ts +9 -0
  9. package/dist/types/components/custom/font-family-dropdown-menu/index.d.ts +2 -0
  10. package/dist/types/components/custom/font-family-dropdown-menu/nanum-fonts.d.ts +31 -0
  11. package/dist/types/components/custom/font-size-dropdown-menu/font-size-dropdown-menu.d.ts +9 -0
  12. package/dist/types/components/custom/font-size-dropdown-menu/index.d.ts +1 -0
  13. package/dist/types/components/custom/hr-style-popover.d.ts +6 -0
  14. package/dist/types/components/custom/image-bubble-menu/image-bubble-menu.d.ts +5 -0
  15. package/dist/types/components/custom/image-bubble-menu/image-ratio-popover.d.ts +6 -0
  16. package/dist/types/components/custom/image-bubble-menu/index.d.ts +1 -0
  17. package/dist/types/components/custom/insert-table-popover.d.ts +6 -0
  18. package/dist/types/components/custom/list-style-popover.d.ts +6 -0
  19. package/dist/types/components/custom/table-bubble-menu/index.d.ts +1 -0
  20. package/dist/types/components/custom/table-bubble-menu/table-bubble-menu.d.ts +5 -0
  21. package/dist/types/components/custom/table-cell-background-color-popover.d.ts +6 -0
  22. package/dist/types/components/custom/text-style-dropdown-menu/index.d.ts +4 -0
  23. package/dist/types/components/custom/text-style-dropdown-menu/text-style-button.d.ts +14 -0
  24. package/dist/types/components/custom/text-style-dropdown-menu/text-style-dropdown-menu.d.ts +20 -0
  25. package/dist/types/components/custom/text-style-dropdown-menu/use-text-style-dropdown-menu.d.ts +26 -0
  26. package/dist/types/components/custom/text-style-dropdown-menu/use-text-style.d.ts +71 -0
  27. package/dist/types/components/custom/uploadable-dropdown-menu/index.d.ts +2 -0
  28. package/dist/types/components/custom/uploadable-dropdown-menu/uploadable-button.d.ts +17 -0
  29. package/dist/types/components/custom/uploadable-dropdown-menu/uploadable-dropdown-menu.d.ts +19 -0
  30. package/dist/types/components/tiptap-icons/align-center-icon.d.ts +1 -1
  31. package/dist/types/components/tiptap-icons/align-justify-icon.d.ts +1 -1
  32. package/dist/types/components/tiptap-icons/align-left-icon.d.ts +1 -1
  33. package/dist/types/components/tiptap-icons/align-right-icon.d.ts +1 -1
  34. package/dist/types/components/tiptap-icons/bold-icon.d.ts +1 -1
  35. package/dist/types/components/tiptap-icons/check-icon.d.ts +3 -0
  36. package/dist/types/components/tiptap-icons/chevron-down-icon.d.ts +1 -1
  37. package/dist/types/components/tiptap-icons/code2-icon.d.ts +1 -1
  38. package/dist/types/components/tiptap-icons/corner-down-left-icon.d.ts +3 -0
  39. package/dist/types/components/tiptap-icons/double-quotes-icon.d.ts +3 -0
  40. package/dist/types/components/tiptap-icons/external-link-icon.d.ts +3 -0
  41. package/dist/types/components/tiptap-icons/heading-five-icon.d.ts +1 -1
  42. package/dist/types/components/tiptap-icons/heading-four-icon.d.ts +1 -1
  43. package/dist/types/components/tiptap-icons/heading-icon.d.ts +1 -1
  44. package/dist/types/components/tiptap-icons/heading-one-icon.d.ts +1 -1
  45. package/dist/types/components/tiptap-icons/heading-six-icon.d.ts +1 -1
  46. package/dist/types/components/tiptap-icons/heading-three-icon.d.ts +1 -1
  47. package/dist/types/components/tiptap-icons/heading-two-icon.d.ts +1 -1
  48. package/dist/types/components/tiptap-icons/image-align-center.d.ts +3 -0
  49. package/dist/types/components/tiptap-icons/image-align-left.d.ts +3 -0
  50. package/dist/types/components/tiptap-icons/image-align-right.d.ts +3 -0
  51. package/dist/types/components/tiptap-icons/image-caption.d.ts +3 -0
  52. package/dist/types/components/tiptap-icons/image-ratio.d.ts +3 -0
  53. package/dist/types/components/tiptap-icons/italic-icon.d.ts +1 -1
  54. package/dist/types/components/tiptap-icons/link-icon.d.ts +3 -0
  55. package/dist/types/components/tiptap-icons/list-icon.d.ts +1 -1
  56. package/dist/types/components/tiptap-icons/list-ordered-icon.d.ts +1 -1
  57. package/dist/types/components/tiptap-icons/list-todo-icon.d.ts +1 -1
  58. package/dist/types/components/tiptap-icons/paragraph-icon.d.ts +3 -0
  59. package/dist/types/components/tiptap-icons/redo2-icon.d.ts +1 -1
  60. package/dist/types/components/tiptap-icons/separator-icon.d.ts +3 -0
  61. package/dist/types/components/tiptap-icons/strike-icon.d.ts +1 -1
  62. package/dist/types/components/tiptap-icons/subscript-icon.d.ts +1 -1
  63. package/dist/types/components/tiptap-icons/superscript-icon.d.ts +1 -1
  64. package/dist/types/components/tiptap-icons/table-icon.d.ts +3 -0
  65. package/dist/types/components/tiptap-icons/trash-icon.d.ts +3 -0
  66. package/dist/types/components/tiptap-icons/underline-icon.d.ts +1 -1
  67. package/dist/types/components/tiptap-icons/undo2-icon.d.ts +1 -1
  68. package/dist/types/components/tiptap-icons/uploadable-file-icon.d.ts +3 -0
  69. package/dist/types/components/tiptap-icons/uploadable-icon.d.ts +3 -0
  70. package/dist/types/components/tiptap-icons/uploadable-image-icon.d.ts +3 -0
  71. package/dist/types/components/tiptap-ui/heading-button/heading-button.d.ts +1 -1
  72. package/dist/types/components/tiptap-ui/heading-button/use-heading.d.ts +7 -7
  73. package/dist/types/components/tiptap-ui/heading-dropdown-menu/use-heading-dropdown-menu.d.ts +1 -1
  74. package/dist/types/components/tiptap-ui/link-popover/index.d.ts +2 -0
  75. package/dist/types/components/tiptap-ui/link-popover/link-popover.d.ts +57 -0
  76. package/dist/types/components/tiptap-ui/link-popover/use-link-popover.d.ts +117 -0
  77. package/dist/types/components/tiptap-ui/list-button/list-button.d.ts +1 -1
  78. package/dist/types/components/tiptap-ui/list-button/use-list.d.ts +4 -4
  79. package/dist/types/components/tiptap-ui/mark-button/mark-button.d.ts +1 -1
  80. package/dist/types/components/tiptap-ui/mark-button/use-mark.d.ts +8 -8
  81. package/dist/types/components/tiptap-ui/text-align-button/text-align-button.d.ts +1 -1
  82. package/dist/types/components/tiptap-ui/text-align-button/use-text-align.d.ts +5 -5
  83. package/dist/types/components/tiptap-ui/undo-redo-button/undo-redo-button.d.ts +1 -1
  84. package/dist/types/components/tiptap-ui/undo-redo-button/use-undo-redo.d.ts +3 -3
  85. package/dist/types/components/tiptap-ui-primitive/button/button.d.ts +0 -3
  86. package/dist/types/components/tiptap-ui-primitive/button-group/button-group.d.ts +10 -0
  87. package/dist/types/components/tiptap-ui-primitive/button-group/index.d.ts +1 -0
  88. package/dist/types/components/tiptap-ui-primitive/dropdown-menu/dropdown-menu.d.ts +2 -2
  89. package/dist/types/components/tiptap-ui-primitive/input/index.d.ts +1 -0
  90. package/dist/types/components/tiptap-ui-primitive/input/input.d.ts +2 -0
  91. package/dist/types/components/tiptap-ui-primitive/popover/popover.d.ts +3 -3
  92. package/dist/types/components/tiptap-ui-primitive/separator/separator.d.ts +2 -3
  93. package/dist/types/components/tiptap-ui-primitive/spacer/spacer.d.ts +1 -1
  94. package/dist/types/components/tiptap-ui-primitive/tooltip/tooltip.d.ts +1 -1
  95. package/dist/types/hooks/use-tiptap-editor.d.ts +1 -12
  96. package/dist/types/lib/fonts.d.ts +12 -0
  97. package/dist/types/lib/index.d.ts +6 -3
  98. package/dist/types/lib/tiptap-utils.d.ts +6 -1
  99. package/dist/types/tiptap/content.d.ts +6 -0
  100. package/dist/types/tiptap/contexts/FileHandlerContext.d.ts +7 -0
  101. package/dist/types/tiptap/extensions/BasicKit.d.ts +2 -0
  102. package/dist/types/tiptap/extensions/BlockquoteKit.d.ts +2 -0
  103. package/dist/types/tiptap/extensions/DefaultFileAttachmentComponent.d.ts +2 -0
  104. package/dist/types/tiptap/extensions/FigcaptionKit.d.ts +2 -0
  105. package/dist/types/tiptap/extensions/FigureKit.d.ts +16 -0
  106. package/dist/types/tiptap/extensions/FileAttachment.d.ts +13 -0
  107. package/dist/types/tiptap/extensions/FontFamilyKit.d.ts +10 -0
  108. package/dist/types/tiptap/extensions/FontSizeKit.d.ts +10 -0
  109. package/dist/types/tiptap/extensions/HrKit.d.ts +11 -0
  110. package/dist/types/tiptap/extensions/ImageKit.d.ts +1 -0
  111. package/dist/types/tiptap/extensions/Paragraph.d.ts +2 -0
  112. package/dist/types/tiptap/extensions/index.d.ts +8 -0
  113. package/dist/types/tiptap/extensions/table/index.d.ts +1 -0
  114. package/dist/types/tiptap/extensions/table/table-grip-menu.d.ts +13 -0
  115. package/dist/types/tiptap/extensions/table/table-kit.d.ts +3 -0
  116. package/dist/types/tiptap/extensions/table/table-row-column-utils.d.ts +16 -0
  117. package/dist/types/tiptap/extensions/table/table-view.d.ts +52 -0
  118. package/dist/types/tiptap/hooks/useFileHandler.d.ts +32 -0
  119. package/dist/types/tiptap/index.d.ts +10 -6
  120. package/dist/types/tiptap/menubar.d.ts +3 -2
  121. package/package.json +49 -26
  122. package/dist/types/tiptap/extensions/default-file-attachment.d.ts +0 -2
  123. package/dist/types/tiptap/extensions/file-attachment.d.ts +0 -13
@@ -24,10 +24,10 @@ export interface UseTextAlignConfig {
24
24
  }
25
25
  export declare const TEXT_ALIGN_SHORTCUT_KEYS: Record<TextAlign, string>;
26
26
  export declare const textAlignIcons: {
27
- left: import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react/jsx-runtime").JSX.Element>;
28
- center: import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react/jsx-runtime").JSX.Element>;
29
- right: import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react/jsx-runtime").JSX.Element>;
30
- justify: import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react/jsx-runtime").JSX.Element>;
27
+ left: import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
28
+ center: import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
29
+ right: import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
30
+ justify: import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
31
31
  };
32
32
  export declare const textAlignLabels: Record<TextAlign, string>;
33
33
  /**
@@ -97,5 +97,5 @@ export declare function useTextAlign(config: UseTextAlignConfig): {
97
97
  canAlign: boolean;
98
98
  label: string;
99
99
  shortcutKeys: string;
100
- Icon: import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react/jsx-runtime").JSX.Element> | import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react/jsx-runtime").JSX.Element> | import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react/jsx-runtime").JSX.Element> | import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react/jsx-runtime").JSX.Element>;
100
+ Icon: import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element> | import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element> | import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element> | import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
101
101
  };
@@ -14,7 +14,7 @@ export interface UndoRedoButtonProps extends Omit<ButtonProps, "type">, UseUndoR
14
14
  export declare function HistoryShortcutBadge({ action, shortcutKeys, }: {
15
15
  action: UndoRedoAction;
16
16
  shortcutKeys?: string;
17
- }): import("react/jsx-runtime").JSX.Element;
17
+ }): import("react").JSX.Element;
18
18
  /**
19
19
  * Button component for triggering undo/redo actions in a Tiptap editor.
20
20
  *
@@ -25,8 +25,8 @@ export interface UseUndoRedoConfig {
25
25
  export declare const UNDO_REDO_SHORTCUT_KEYS: Record<UndoRedoAction, string>;
26
26
  export declare const historyActionLabels: Record<UndoRedoAction, string>;
27
27
  export declare const historyIcons: {
28
- undo: import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react/jsx-runtime").JSX.Element>;
29
- redo: import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react/jsx-runtime").JSX.Element>;
28
+ undo: import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
29
+ redo: import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
30
30
  };
31
31
  /**
32
32
  * Checks if a history action can be executed
@@ -86,5 +86,5 @@ export declare function useUndoRedo(config: UseUndoRedoConfig): {
86
86
  canExecute: boolean;
87
87
  label: string;
88
88
  shortcutKeys: string;
89
- Icon: import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react/jsx-runtime").JSX.Element> | import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react/jsx-runtime").JSX.Element>;
89
+ Icon: import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element> | import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
90
90
  };
@@ -11,7 +11,4 @@ export declare const ShortcutDisplay: React.FC<{
11
11
  shortcuts: string[];
12
12
  }>;
13
13
  export declare const Button: import('react').ForwardRefExoticComponent<ButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
14
- export declare const ButtonGroup: import('react').ForwardRefExoticComponent<Omit<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & {
15
- orientation?: "horizontal" | "vertical";
16
- }, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
17
14
  export default Button;
@@ -0,0 +1,10 @@
1
+ import { useRender } from '@base-ui/react/use-render';
2
+ import { VariantProps } from 'class-variance-authority';
3
+ import { Separator } from '../separator';
4
+ declare const buttonGroupVariants: (props?: ({
5
+ orientation?: "horizontal" | "vertical" | null | undefined;
6
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
+ declare function ButtonGroup({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>): import("react").JSX.Element;
8
+ declare function ButtonGroupText({ className, render, ...props }: useRender.ComponentProps<"div">): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
9
+ declare function ButtonGroupSeparator({ className, orientation, ...props }: React.ComponentProps<typeof Separator>): import("react").JSX.Element;
10
+ export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants, };
@@ -0,0 +1 @@
1
+ export * from './button-group';
@@ -1,6 +1,6 @@
1
1
  import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
2
- declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
3
- declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
2
+ declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): import("react").JSX.Element;
3
+ declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): import("react").JSX.Element;
4
4
  declare const DropdownMenuTrigger: import('react').ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuTriggerProps & import('react').RefAttributes<HTMLButtonElement>, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
5
5
  declare const DropdownMenuGroup: import('react').ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & import('react').RefAttributes<HTMLDivElement>>;
6
6
  declare const DropdownMenuSub: import('react').FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
@@ -0,0 +1 @@
1
+ export * from './input';
@@ -0,0 +1,2 @@
1
+ declare function Input({ className, type, ...props }: React.ComponentProps<"input">): import("react").JSX.Element;
2
+ export { Input };
@@ -1,5 +1,5 @@
1
1
  import * as PopoverPrimitive from "@radix-ui/react-popover";
2
- declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
3
- declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
4
- declare function PopoverContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
2
+ declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): import("react").JSX.Element;
3
+ declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): import("react").JSX.Element;
4
+ declare function PopoverContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>): import("react").JSX.Element;
5
5
  export { Popover, PopoverTrigger, PopoverContent };
@@ -1,6 +1,5 @@
1
1
  export type Orientation = "horizontal" | "vertical";
2
- export interface SeparatorProps extends React.HTMLAttributes<HTMLDivElement> {
2
+ export declare function Separator({ decorative, orientation, className, ...props }: React.ComponentProps<"div"> & {
3
3
  orientation?: Orientation;
4
4
  decorative?: boolean;
5
- }
6
- export declare const Separator: import('react').ForwardRefExoticComponent<SeparatorProps & import('react').RefAttributes<HTMLDivElement>>;
5
+ }): import("react").JSX.Element;
@@ -3,4 +3,4 @@ export interface SpacerProps extends React.HTMLAttributes<HTMLDivElement> {
3
3
  orientation?: SpacerOrientation;
4
4
  size?: string | number;
5
5
  }
6
- export declare function Spacer({ orientation, size, style, ...props }: SpacerProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function Spacer({ orientation, size, style, ...props }: SpacerProps): import("react").JSX.Element;
@@ -19,7 +19,7 @@ interface TooltipContentProps extends Omit<React.HTMLProps<HTMLDivElement>, "ref
19
19
  portal?: boolean;
20
20
  portalProps?: Omit<React.ComponentProps<typeof FloatingPortal>, "children">;
21
21
  }
22
- export declare function Tooltip({ children, ...props }: TooltipProviderProps): import("react/jsx-runtime").JSX.Element;
22
+ export declare function Tooltip({ children, ...props }: TooltipProviderProps): import("react").JSX.Element;
23
23
  export declare namespace Tooltip {
24
24
  var displayName: string;
25
25
  }
@@ -1,15 +1,4 @@
1
- import { Editor } from '@tiptap/react';
2
- /**
3
- * Hook that provides access to a Tiptap editor instance.
4
- *
5
- * Accepts an optional editor instance directly, or falls back to retrieving
6
- * the editor from the Tiptap context if available. This allows components
7
- * to work both when given an editor directly and when used within a Tiptap
8
- * editor context.
9
- *
10
- * @param providedEditor - Optional editor instance to use instead of the context editor
11
- * @returns The provided editor or the editor from context, whichever is available
12
- */
1
+ import { Editor } from '@tiptap/core';
13
2
  export declare function useTiptapEditor(providedEditor?: Editor | null): {
14
3
  editor: Editor | null;
15
4
  editorState?: Editor["state"];
@@ -0,0 +1,12 @@
1
+ export type FontEntry = {
2
+ label: string;
3
+ family: string;
4
+ href: string;
5
+ };
6
+ export type FontLinkEntry = {
7
+ family: string;
8
+ href: string;
9
+ };
10
+ export declare const EDITOR_FONTS: FontEntry[];
11
+ export declare const EDITOR_FONT_LINKS: FontLinkEntry[];
12
+ export declare function EditorFontStylesheets(): import("react").JSX.Element[];
@@ -1,5 +1,8 @@
1
1
  export { default as TiptapEditor } from '../tiptap/index';
2
2
  export type { TiptapProps } from '../tiptap/index';
3
- export type { FileAttachmentAttributes } from '../tiptap/extensions/file-attachment';
4
- export { createFileAttachmentExtension } from '../tiptap/extensions/file-attachment';
5
- export { DefaultFileAttachmentComponent } from '../tiptap/extensions/default-file-attachment';
3
+ export { default as TiptapContent } from '../tiptap/content';
4
+ export type { TiptapContentProps } from '../tiptap/content';
5
+ export type { FileAttachmentAttributes } from '../tiptap/extensions/FileAttachment';
6
+ export { FileAttachment, FileAttachmentNode, } from '../tiptap/extensions/FileAttachment';
7
+ export { DefaultFileAttachmentComponent } from '../tiptap/extensions/DefaultFileAttachmentComponent';
8
+ export { EDITOR_FONTS, EDITOR_FONT_LINKS, EditorFontStylesheets, } from './fonts';
@@ -1,5 +1,6 @@
1
1
  import { Node as PMNode } from '@tiptap/pm/model';
2
2
  import { Transaction, Selection } from '@tiptap/pm/state';
3
+ import { ClassValue } from 'clsx';
3
4
  import { Editor, NodeWithPos } from '@tiptap/react';
4
5
  export declare const MAX_FILE_SIZE: number;
5
6
  export declare const MAC_SYMBOLS: Record<string, string>;
@@ -14,7 +15,7 @@ export declare const SR_ONLY: {
14
15
  readonly whiteSpace: "nowrap";
15
16
  readonly borderWidth: 0;
16
17
  };
17
- export declare function cn(...classes: (string | boolean | undefined | null)[]): string;
18
+ export declare function cn(...inputs: ClassValue[]): string;
18
19
  /**
19
20
  * Determines if the current platform is macOS
20
21
  * @returns boolean indicating if the current platform is Mac
@@ -164,5 +165,9 @@ export declare function selectCurrentBlockContent(editor: Editor): void;
164
165
  * @returns An array of objects containing the node and its position
165
166
  */
166
167
  export declare function getSelectedNodesOfType(selection: Selection, allowedNodeTypes: string[]): NodeWithPos[];
168
+ /**
169
+ * Clamps a value between min and max bounds
170
+ */
171
+ export declare function clamp(value: number, min: number, max: number): number;
167
172
  export declare function getSelectedBlockNodes(editor: Editor): PMNode[];
168
173
  export {};
@@ -0,0 +1,6 @@
1
+ export interface TiptapContentProps {
2
+ html: string;
3
+ className?: string;
4
+ }
5
+ declare const TiptapContent: ({ html, className }: TiptapContentProps) => import("react").JSX.Element;
6
+ export default TiptapContent;
@@ -0,0 +1,7 @@
1
+ import { useEditor } from '@tiptap/react';
2
+ export interface FileHandlerContextValue {
3
+ resolveFileUrl: (file: File) => Promise<string | null>;
4
+ insertFile: (editor: ReturnType<typeof useEditor>, file: File, url: string, pos: number) => void;
5
+ }
6
+ export declare const FileHandlerContext: import('react').Context<FileHandlerContextValue | null>;
7
+ export declare function useFileHandlerContext(): FileHandlerContextValue;
@@ -0,0 +1,2 @@
1
+ import { Extension } from '@tiptap/core';
2
+ export declare const BasicKit: Extension<any, any>;
@@ -0,0 +1,2 @@
1
+ export type BlockquoteStyle = "bar" | "quote" | "box";
2
+ export declare const BlockquoteKit: import('@tiptap/core').Node<import('@tiptap/extension-blockquote').BlockquoteOptions, any>;
@@ -0,0 +1,2 @@
1
+ import { FileAttachmentAttributes } from './FileAttachment';
2
+ export declare const DefaultFileAttachmentComponent: ({ name, url, }: FileAttachmentAttributes) => import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { Node } from '@tiptap/core';
2
+ export declare const FigcaptionKit: Node<any, any>;
@@ -0,0 +1,16 @@
1
+ import { Node } from '@tiptap/core';
2
+ export type FigureAlign = "left" | "center" | "right";
3
+ declare module "@tiptap/core" {
4
+ interface Commands<ReturnType> {
5
+ figure: {
6
+ insertFigure: (attrs: {
7
+ src: string;
8
+ alt?: string;
9
+ align?: FigureAlign;
10
+ }) => ReturnType;
11
+ setFigureAlign: (align: FigureAlign) => ReturnType;
12
+ toggleFigcaption: () => ReturnType;
13
+ };
14
+ }
15
+ }
16
+ export declare const FigureKit: Node<any, any>;
@@ -0,0 +1,13 @@
1
+ import { Node, Extension } from '@tiptap/core';
2
+ import { ComponentType } from 'react';
3
+ export interface FileAttachmentAttributes {
4
+ name: string;
5
+ mimeType: string;
6
+ url: string;
7
+ size: number;
8
+ }
9
+ export interface FileAttachmentOptions {
10
+ component: ComponentType<FileAttachmentAttributes>;
11
+ }
12
+ export declare const FileAttachmentNode: Node<FileAttachmentOptions, any>;
13
+ export declare const FileAttachment: Extension<FileAttachmentOptions, any>;
@@ -0,0 +1,10 @@
1
+ import { Extension } from '@tiptap/core';
2
+ declare module "@tiptap/core" {
3
+ interface Commands<ReturnType> {
4
+ fontFamily: {
5
+ setFontFamily: (family: string) => ReturnType;
6
+ unsetFontFamily: () => ReturnType;
7
+ };
8
+ }
9
+ }
10
+ export declare const FontFamilyKit: Extension<any, any>;
@@ -0,0 +1,10 @@
1
+ import { Extension } from '@tiptap/core';
2
+ declare module "@tiptap/core" {
3
+ interface Commands<ReturnType> {
4
+ fontSize: {
5
+ setFontSize: (size: string) => ReturnType;
6
+ unsetFontSize: () => ReturnType;
7
+ };
8
+ }
9
+ }
10
+ export declare const FontSizeKit: Extension<any, any>;
@@ -0,0 +1,11 @@
1
+ export type HrStyle = "thin" | "thick" | "dashed" | "short" | "dots" | "diamond" | "circle";
2
+ declare module "@tiptap/core" {
3
+ interface Commands<ReturnType> {
4
+ hr: {
5
+ setHr: (attrs?: {
6
+ style?: HrStyle;
7
+ }) => ReturnType;
8
+ };
9
+ }
10
+ }
11
+ export declare const Hr: import('@tiptap/core').Node<import('@tiptap/extension-horizontal-rule').HorizontalRuleOptions, any>;
@@ -0,0 +1 @@
1
+ export declare const ImageKit: import('@tiptap/core').Node<import('@tiptap/extension-image').ImageOptions, any>;
@@ -0,0 +1,2 @@
1
+ export type ParagraphSize = "small" | "normal" | "large";
2
+ export declare const Paragraph: import('@tiptap/core').Node<import('@tiptap/extension-paragraph').ParagraphOptions, any>;
@@ -0,0 +1,8 @@
1
+ export * from './BasicKit';
2
+ export * from './BlockquoteKit';
3
+ export * from './FigcaptionKit';
4
+ export * from './FigureKit';
5
+ export * from './FileAttachment';
6
+ export * from './HrKit';
7
+ export * from './Paragraph';
8
+ export * from './table';
@@ -0,0 +1 @@
1
+ export * from './table-kit';
@@ -0,0 +1,13 @@
1
+ import { EditorView } from '@tiptap/pm/view';
2
+ import { HoveredTableCell } from './table-row-column-utils';
3
+ export interface TableGripMenuHandle {
4
+ open: () => void;
5
+ }
6
+ export interface TableGripMenuProps {
7
+ view: EditorView;
8
+ target: "row" | "column";
9
+ getHovered: () => HoveredTableCell | null;
10
+ onOpenChange?: (open: boolean) => void;
11
+ onGripMouseDown?: (event: React.MouseEvent) => void;
12
+ }
13
+ export declare const TableGripMenu: import('react').ForwardRefExoticComponent<TableGripMenuProps & import('react').RefAttributes<TableGripMenuHandle>>;
@@ -0,0 +1,3 @@
1
+ import { Extension } from '@tiptap/core';
2
+ export declare const ExtendedTableCell: import('@tiptap/core').Node<import('@tiptap/extension-table').TableCellOptions, any>;
3
+ export declare const TableKit: Extension<any, any>;
@@ -0,0 +1,16 @@
1
+ import { TableMap } from '@tiptap/pm/tables';
2
+ import { Node as ProseMirrorNode } from '@tiptap/pm/model';
3
+ import { EditorView } from '@tiptap/pm/view';
4
+ export interface HoveredTableCell {
5
+ map: TableMap;
6
+ tableStart: number;
7
+ row: number;
8
+ col: number;
9
+ }
10
+ export declare function findHoveredCell(view: EditorView, clientX: number, clientY: number): HoveredTableCell | null;
11
+ export declare function selectTableRow(view: EditorView, { map, tableStart }: HoveredTableCell, row: number): void;
12
+ export declare function selectTableColumn(view: EditorView, { map, tableStart }: HoveredTableCell, col: number): void;
13
+ export declare function moveRow(view: EditorView, { tableStart }: HoveredTableCell, from: number, to: number): void;
14
+ export declare function moveColumn(view: EditorView, { tableStart }: HoveredTableCell, from: number, to: number): void;
15
+ export declare function addTableRow(view: EditorView, table: ProseMirrorNode, contentDOM: HTMLElement): void;
16
+ export declare function addTableColumn(view: EditorView, table: ProseMirrorNode, contentDOM: HTMLElement): void;
@@ -0,0 +1,52 @@
1
+ import { RefObject } from 'react';
2
+ import { Root } from 'react-dom/client';
3
+ import { TableView } from '@tiptap/pm/tables';
4
+ import { Node as ProseMirrorNode } from '@tiptap/pm/model';
5
+ import { EditorView, ViewMutationRecord } from '@tiptap/pm/view';
6
+ import { TableGripMenuHandle } from './table-grip-menu';
7
+ import { HoveredTableCell } from './table-row-column-utils';
8
+ interface DragState {
9
+ target: "row" | "column";
10
+ startIndex: number;
11
+ targetIndex: number;
12
+ startX: number;
13
+ startY: number;
14
+ hasMoved: boolean;
15
+ hovered: HoveredTableCell;
16
+ }
17
+ export declare class GripTableView extends TableView {
18
+ view: EditorView;
19
+ controls: HTMLDivElement;
20
+ rowHandle: HTMLDivElement;
21
+ columnHandle: HTMLDivElement;
22
+ addRowButton: HTMLButtonElement;
23
+ addColumnButton: HTMLButtonElement;
24
+ dropIndicator: HTMLDivElement;
25
+ rowHandleRoot: Root;
26
+ columnHandleRoot: Root;
27
+ rowMenuRef: RefObject<TableGripMenuHandle | null>;
28
+ columnMenuRef: RefObject<TableGripMenuHandle | null>;
29
+ hovered: HoveredTableCell | null;
30
+ rowMenuOpen: boolean;
31
+ columnMenuOpen: boolean;
32
+ dragState: DragState | null;
33
+ constructor(node: ProseMirrorNode, cellMinWidth: number, view: EditorView);
34
+ private handleMouseOver;
35
+ private handleMouseLeave;
36
+ private handleRowMenuOpenChange;
37
+ private handleColumnMenuOpenChange;
38
+ private handleAddRow;
39
+ private handleAddColumn;
40
+ private startDrag;
41
+ private handleDragMove;
42
+ private handleDragEnd;
43
+ private findClosestRowIndex;
44
+ private findClosestColumnIndex;
45
+ private getColumnBoundaries;
46
+ private updateDropIndicator;
47
+ private positionHandles;
48
+ private cellIndexAtColumn;
49
+ ignoreMutation(record: ViewMutationRecord): boolean;
50
+ destroy(): void;
51
+ }
52
+ export {};
@@ -0,0 +1,32 @@
1
+ import { useEditor } from '@tiptap/react';
2
+ export interface UseFileHandlerAttributes {
3
+ /**
4
+ * 제공 시: 파일을 CDN에 업로드하고 URL을 반환.
5
+ * 미제공 시: FileReader로 base64 변환 후 브라우저 메모리에 임시 저장.
6
+ */
7
+ uploadFile?: (file: File) => Promise<string>;
8
+ /**
9
+ * 파일이 업로드될 때 호출되는 콜백.
10
+ */
11
+ onUploadStart?: (file: File) => void;
12
+ /**
13
+ * 파일 업로드가 성공했을 때 호출되는 콜백.
14
+ */
15
+ onUploadSuccess?: (file: File) => void;
16
+ /**
17
+ * 파일 업로드가 실패했을 때 호출되는 콜백.
18
+ */
19
+ onUploadError?: (error: Error, file?: File) => void;
20
+ /**
21
+ * true 시 이미지 외 파일(PDF, Word 등)도 허용.
22
+ * FileAttachmentComponent가 함께 제공되어야 에디터에 렌더링됨.
23
+ */
24
+ allowNonImageFile?: boolean;
25
+ }
26
+ export declare const useFileHandler: ({ uploadFile, onUploadStart, onUploadSuccess, onUploadError, allowNonImageFile, }: UseFileHandlerAttributes) => {
27
+ handleDrop: (editor: import('@tiptap/core').Editor, files: File[], pos: number) => void;
28
+ handlePaste: (editor: import('@tiptap/core').Editor, files: File[], pasteContent?: string) => void;
29
+ allowedMimeTypes: string[] | undefined;
30
+ resolveFileUrl: (file: File) => Promise<string | null>;
31
+ insertFile: (currentEditor: ReturnType<typeof useEditor>, file: File, url: string, pos: number) => void;
32
+ };
@@ -1,5 +1,5 @@
1
1
  import { ComponentType } from 'react';
2
- import { FileAttachmentAttributes } from './extensions/file-attachment';
2
+ import { FileAttachmentAttributes } from './extensions';
3
3
  export interface TiptapProps {
4
4
  /**
5
5
  * 에디터의 초기 HTML 콘텐츠.
@@ -24,13 +24,17 @@ export interface TiptapProps {
24
24
  */
25
25
  uploadFile?: (file: File) => Promise<string>;
26
26
  /**
27
- * 파일이 에디터에 삽입될 때 호출되는 콜백.
27
+ * 파일이 업로드될 때 호출되는 콜백.
28
28
  */
29
- onFileInsert?: (file: File) => void;
29
+ onUploadStart?: (file: File) => void;
30
30
  /**
31
- * 파일 업로드 오류 호출되는 콜백.
31
+ * 파일이 업로드될 호출되는 콜백.
32
32
  */
33
- onFileError?: (error: Error) => void;
33
+ onUploadSuccess?: (file: File) => void;
34
+ /**
35
+ * 파일이 업로드 오류 시 호출되는 콜백.
36
+ */
37
+ onUploadError?: (error: Error) => void;
34
38
  /**
35
39
  * true 시 이미지 외 파일(PDF, Word 등)도 허용.
36
40
  * FileAttachmentComponent가 함께 제공되어야 에디터에 렌더링됨.
@@ -42,5 +46,5 @@ export interface TiptapProps {
42
46
  */
43
47
  FileAttachmentComponent?: ComponentType<FileAttachmentAttributes>;
44
48
  }
45
- declare const TiptapEditor: ({ defaultValue, onChange, minHeight, maxHeight, uploadFile, onFileInsert, onFileError, allowNonImageFile, FileAttachmentComponent, }: TiptapProps) => import("react/jsx-runtime").JSX.Element;
49
+ declare const TiptapEditor: ({ defaultValue, onChange, minHeight, maxHeight, uploadFile, onUploadStart, onUploadSuccess, onUploadError, allowNonImageFile, FileAttachmentComponent, }: TiptapProps) => import("react").JSX.Element;
46
50
  export default TiptapEditor;
@@ -1,4 +1,5 @@
1
1
  import { Editor } from '@tiptap/react';
2
- export default function menubar({ editor }: {
2
+ export type MenubarMode = "basic" | "expert";
3
+ export default function Menubar({ editor }: {
3
4
  editor: Editor;
4
- }): import("react/jsx-runtime").JSX.Element;
5
+ }): import("react").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@junbyeol/tiptap-editor",
3
- "version": "0.1.5",
3
+ "version": "1.0.13",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
@@ -21,46 +21,60 @@
21
21
  "files": [
22
22
  "dist"
23
23
  ],
24
- "scripts": {
25
- "dev": "vite",
26
- "build": "tsc -b && vite build",
27
- "build:lib": "vite build --config vite.lib.config.ts",
28
- "prepublishOnly": "yarn build:lib",
29
- "lint": "eslint .",
30
- "preview": "vite preview",
31
- "prettier": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css,md,scss}\"",
32
- "lint-staged": "lint-staged",
33
- "prepare": "husky"
34
- },
35
24
  "peerDependencies": {
36
25
  "react": "^19.0.0",
37
- "react-dom": "^19.0.0"
26
+ "react-dom": "^19.0.0",
27
+ "@tiptap/core": "^3.26.0",
28
+ "@tiptap/pm": "^3.26.0",
29
+ "@tiptap/react": "^3.26.0"
38
30
  },
39
31
  "dependencies": {
40
32
  "@floating-ui/react": "^0.27.19",
41
33
  "@radix-ui/react-dropdown-menu": "^2.1.16",
42
34
  "@radix-ui/react-popover": "^1.1.15",
43
35
  "@remixicon/react": "^4.9.0",
44
- "@tiptap/extension-file-handler": "^3.22.2",
45
- "@tiptap/extension-image": "^3.22.2",
46
- "@tiptap/extension-list": "^3.20.1",
47
- "@tiptap/extension-subscript": "^3.20.1",
48
- "@tiptap/extension-superscript": "^3.20.1",
49
- "@tiptap/extension-table": "^3.20.1",
50
- "@tiptap/extension-text-align": "^3.20.1",
51
- "@tiptap/extension-text-style": "^3.20.1",
52
- "@tiptap/extension-underline": "^3.20.1",
53
- "@tiptap/pm": "^3.20.1",
54
- "@tiptap/react": "^3.20.1",
55
- "@tiptap/starter-kit": "^3.20.1",
36
+ "@tiptap/extension-blockquote": "^3.26.0",
37
+ "@tiptap/extension-bold": "^3.26.0",
38
+ "@tiptap/extension-bubble-menu": "^3.26.0",
39
+ "@tiptap/extension-code": "^3.26.0",
40
+ "@tiptap/extension-code-block-lowlight": "^3.26.0",
41
+ "@tiptap/extension-details": "^3.26.0",
42
+ "@tiptap/extension-document": "^3.26.0",
43
+ "@tiptap/extension-dropcursor": "^3.26.0",
44
+ "@tiptap/extension-file-handler": "^3.26.0",
45
+ "@tiptap/extension-gapcursor": "^3.26.0",
46
+ "@tiptap/extension-heading": "^3.26.0",
47
+ "@tiptap/extension-highlight": "^3.26.0",
48
+ "@tiptap/extension-horizontal-rule": "^3.26.0",
49
+ "@tiptap/extension-image": "^3.26.0",
50
+ "@tiptap/extension-italic": "^3.26.0",
51
+ "@tiptap/extension-link": "^3.26.0",
52
+ "@tiptap/extension-list": "^3.26.0",
53
+ "@tiptap/extension-paragraph": "^3.26.0",
54
+ "@tiptap/extension-strike": "^3.26.0",
55
+ "@tiptap/extension-subscript": "^3.26.0",
56
+ "@tiptap/extension-superscript": "^3.26.0",
57
+ "@tiptap/extension-table": "^3.26.0",
58
+ "@tiptap/extension-text": "^3.26.0",
59
+ "@tiptap/extension-text-align": "^3.26.0",
60
+ "@tiptap/extension-text-style": "^3.26.0",
61
+ "@tiptap/extension-typography": "^3.26.0",
62
+ "@tiptap/extension-underline": "^3.26.0",
63
+ "@tiptap/extension-youtube": "^3.26.0",
64
+ "@tiptap/extensions": "^3.26.0",
65
+ "@tiptap/starter-kit": "^3.26.0",
66
+ "clsx": "^2.1.1",
67
+ "lowlight": "^3.3.0",
56
68
  "react-hotkeys-hook": "^5.2.4"
57
69
  },
58
70
  "devDependencies": {
71
+ "@base-ui/react": "^1.5.0",
59
72
  "@eslint/js": "^9.39.1",
60
73
  "@types/node": "^25.3.5",
61
74
  "@types/react": "^19.2.7",
62
75
  "@types/react-dom": "^19.2.3",
63
76
  "@vitejs/plugin-react-swc": "^4.2.2",
77
+ "class-variance-authority": "^0.7.1",
64
78
  "eslint": "^9.39.1",
65
79
  "eslint-config-prettier": "^10.1.8",
66
80
  "eslint-plugin-react-hooks": "^7.0.1",
@@ -83,5 +97,14 @@
83
97
  "prettier --write",
84
98
  "eslint --no-warn-ignored --max-warnings=0"
85
99
  ]
100
+ },
101
+ "scripts": {
102
+ "dev": "vite",
103
+ "build": "tsc -b && vite build",
104
+ "build:lib": "vite build --config vite.lib.config.ts",
105
+ "lint": "eslint .",
106
+ "preview": "vite preview",
107
+ "prettier": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css,md,scss}\"",
108
+ "lint-staged": "lint-staged"
86
109
  }
87
- }
110
+ }
@@ -1,2 +0,0 @@
1
- import { FileAttachmentAttributes } from './file-attachment';
2
- export declare const DefaultFileAttachmentComponent: ({ name, url, }: FileAttachmentAttributes) => import("react/jsx-runtime").JSX.Element;