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.d.cts CHANGED
@@ -1,7 +1,9 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
- import { ReactNode } from 'react';
3
+ import { ReactNode, ComponentProps } from 'react';
4
4
  import { Editor } from '@tiptap/core';
5
+ import * as class_variance_authority_types from 'class-variance-authority/types';
6
+ import { VariantProps } from 'class-variance-authority';
5
7
 
6
8
  interface NotraEditorProps {
7
9
  /** Markdown content (source of truth) */
@@ -35,13 +37,6 @@ interface ToolbarSeparatorProps extends React.HTMLAttributes<HTMLDivElement> {
35
37
  }
36
38
  declare function ToolbarSeparator({ orientation, className, ...props }: ToolbarSeparatorProps): react_jsx_runtime.JSX.Element;
37
39
 
38
- interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
39
- variant?: 'default' | 'ghost' | 'primary';
40
- size?: 'small' | 'default' | 'large';
41
- active?: boolean;
42
- }
43
- declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
44
-
45
40
  type UndoRedoAction = 'undo' | 'redo';
46
41
 
47
42
  interface UndoRedoButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
@@ -60,14 +55,6 @@ interface DropdownMenuProps {
60
55
  }
61
56
  declare function DropdownMenu({ trigger, children, open: controlledOpen, onOpenChange }: DropdownMenuProps): react_jsx_runtime.JSX.Element;
62
57
 
63
- interface PopoverProps {
64
- trigger: ReactNode;
65
- children: ReactNode;
66
- open: boolean;
67
- onOpenChange: (open: boolean) => void;
68
- }
69
- declare function Popover({ trigger, children, open, onOpenChange }: PopoverProps): react_jsx_runtime.JSX.Element;
70
-
71
58
  type MarkType = 'bold' | 'italic' | 'strike' | 'code';
72
59
 
73
60
  interface MarkButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
@@ -78,19 +65,27 @@ declare const MarkButton: react.ForwardRefExoticComponent<MarkButtonProps & reac
78
65
 
79
66
  type HeadingLevel = 1 | 2 | 3 | 4;
80
67
 
81
- interface HeadingDropdownMenuProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
68
+ declare const buttonVariants: (props?: ({
69
+ variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link" | null | undefined;
70
+ size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
71
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
72
+ declare function Button({ className, variant, size, asChild, ...props }: react.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
73
+ asChild?: boolean;
74
+ }): react_jsx_runtime.JSX.Element;
75
+
76
+ interface HeadingDropdownMenuProps extends Omit<ComponentProps<typeof Button>, 'type'> {
82
77
  editor: Editor | null;
83
78
  levels?: HeadingLevel[];
84
79
  }
85
- declare const HeadingDropdownMenu: react.ForwardRefExoticComponent<HeadingDropdownMenuProps & react.RefAttributes<HTMLButtonElement>>;
80
+ declare const HeadingDropdownMenu: react.ForwardRefExoticComponent<Omit<HeadingDropdownMenuProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
86
81
 
87
82
  type ListType = 'bulletList' | 'orderedList' | 'taskList';
88
83
 
89
- interface ListDropdownMenuProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
84
+ interface ListDropdownMenuProps extends Omit<ComponentProps<typeof Button>, 'type'> {
90
85
  editor: Editor | null;
91
86
  types?: ListType[];
92
87
  }
93
- declare const ListDropdownMenu: react.ForwardRefExoticComponent<ListDropdownMenuProps & react.RefAttributes<HTMLButtonElement>>;
88
+ declare const ListDropdownMenu: react.ForwardRefExoticComponent<Omit<ListDropdownMenuProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
94
89
 
95
90
  interface BlockquoteButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
96
91
  editor: Editor | null;
@@ -107,4 +102,4 @@ interface LinkPopoverProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonEle
107
102
  }
108
103
  declare const LinkPopover: react.ForwardRefExoticComponent<LinkPopoverProps & react.RefAttributes<HTMLButtonElement>>;
109
104
 
110
- export { BlockquoteButton, type BlockquoteButtonProps, Button, type ButtonProps, CodeBlockButton, type CodeBlockButtonProps, DropdownMenu, type DropdownMenuProps, HeadingDropdownMenu, type HeadingDropdownMenuProps, LinkPopover, type LinkPopoverProps, ListDropdownMenu, type ListDropdownMenuProps, MarkButton, type MarkButtonProps, type MarkType, NotraEditor, type NotraEditorProps, NotraReader, type NotraReaderProps, Popover, type PopoverProps, Spacer, Toolbar, ToolbarGroup, type ToolbarProps, ToolbarSeparator, type ToolbarSeparatorProps, UndoRedoButton, type UndoRedoButtonProps };
105
+ export { BlockquoteButton, type BlockquoteButtonProps, CodeBlockButton, type CodeBlockButtonProps, DropdownMenu, type DropdownMenuProps, HeadingDropdownMenu, type HeadingDropdownMenuProps, LinkPopover, type LinkPopoverProps, ListDropdownMenu, type ListDropdownMenuProps, MarkButton, type MarkButtonProps, type MarkType, NotraEditor, type NotraEditorProps, NotraReader, type NotraReaderProps, Spacer, Toolbar, ToolbarGroup, type ToolbarProps, ToolbarSeparator, type ToolbarSeparatorProps, UndoRedoButton, type UndoRedoButtonProps };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
- import { ReactNode } from 'react';
3
+ import { ReactNode, ComponentProps } from 'react';
4
4
  import { Editor } from '@tiptap/core';
5
+ import * as class_variance_authority_types from 'class-variance-authority/types';
6
+ import { VariantProps } from 'class-variance-authority';
5
7
 
6
8
  interface NotraEditorProps {
7
9
  /** Markdown content (source of truth) */
@@ -35,13 +37,6 @@ interface ToolbarSeparatorProps extends React.HTMLAttributes<HTMLDivElement> {
35
37
  }
36
38
  declare function ToolbarSeparator({ orientation, className, ...props }: ToolbarSeparatorProps): react_jsx_runtime.JSX.Element;
37
39
 
38
- interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
39
- variant?: 'default' | 'ghost' | 'primary';
40
- size?: 'small' | 'default' | 'large';
41
- active?: boolean;
42
- }
43
- declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
44
-
45
40
  type UndoRedoAction = 'undo' | 'redo';
46
41
 
47
42
  interface UndoRedoButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
@@ -60,14 +55,6 @@ interface DropdownMenuProps {
60
55
  }
61
56
  declare function DropdownMenu({ trigger, children, open: controlledOpen, onOpenChange }: DropdownMenuProps): react_jsx_runtime.JSX.Element;
62
57
 
63
- interface PopoverProps {
64
- trigger: ReactNode;
65
- children: ReactNode;
66
- open: boolean;
67
- onOpenChange: (open: boolean) => void;
68
- }
69
- declare function Popover({ trigger, children, open, onOpenChange }: PopoverProps): react_jsx_runtime.JSX.Element;
70
-
71
58
  type MarkType = 'bold' | 'italic' | 'strike' | 'code';
72
59
 
73
60
  interface MarkButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
@@ -78,19 +65,27 @@ declare const MarkButton: react.ForwardRefExoticComponent<MarkButtonProps & reac
78
65
 
79
66
  type HeadingLevel = 1 | 2 | 3 | 4;
80
67
 
81
- interface HeadingDropdownMenuProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
68
+ declare const buttonVariants: (props?: ({
69
+ variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link" | null | undefined;
70
+ size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
71
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
72
+ declare function Button({ className, variant, size, asChild, ...props }: react.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
73
+ asChild?: boolean;
74
+ }): react_jsx_runtime.JSX.Element;
75
+
76
+ interface HeadingDropdownMenuProps extends Omit<ComponentProps<typeof Button>, 'type'> {
82
77
  editor: Editor | null;
83
78
  levels?: HeadingLevel[];
84
79
  }
85
- declare const HeadingDropdownMenu: react.ForwardRefExoticComponent<HeadingDropdownMenuProps & react.RefAttributes<HTMLButtonElement>>;
80
+ declare const HeadingDropdownMenu: react.ForwardRefExoticComponent<Omit<HeadingDropdownMenuProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
86
81
 
87
82
  type ListType = 'bulletList' | 'orderedList' | 'taskList';
88
83
 
89
- interface ListDropdownMenuProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
84
+ interface ListDropdownMenuProps extends Omit<ComponentProps<typeof Button>, 'type'> {
90
85
  editor: Editor | null;
91
86
  types?: ListType[];
92
87
  }
93
- declare const ListDropdownMenu: react.ForwardRefExoticComponent<ListDropdownMenuProps & react.RefAttributes<HTMLButtonElement>>;
88
+ declare const ListDropdownMenu: react.ForwardRefExoticComponent<Omit<ListDropdownMenuProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
94
89
 
95
90
  interface BlockquoteButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
96
91
  editor: Editor | null;
@@ -107,4 +102,4 @@ interface LinkPopoverProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonEle
107
102
  }
108
103
  declare const LinkPopover: react.ForwardRefExoticComponent<LinkPopoverProps & react.RefAttributes<HTMLButtonElement>>;
109
104
 
110
- export { BlockquoteButton, type BlockquoteButtonProps, Button, type ButtonProps, CodeBlockButton, type CodeBlockButtonProps, DropdownMenu, type DropdownMenuProps, HeadingDropdownMenu, type HeadingDropdownMenuProps, LinkPopover, type LinkPopoverProps, ListDropdownMenu, type ListDropdownMenuProps, MarkButton, type MarkButtonProps, type MarkType, NotraEditor, type NotraEditorProps, NotraReader, type NotraReaderProps, Popover, type PopoverProps, Spacer, Toolbar, ToolbarGroup, type ToolbarProps, ToolbarSeparator, type ToolbarSeparatorProps, UndoRedoButton, type UndoRedoButtonProps };
105
+ export { BlockquoteButton, type BlockquoteButtonProps, CodeBlockButton, type CodeBlockButtonProps, DropdownMenu, type DropdownMenuProps, HeadingDropdownMenu, type HeadingDropdownMenuProps, LinkPopover, type LinkPopoverProps, ListDropdownMenu, type ListDropdownMenuProps, MarkButton, type MarkButtonProps, type MarkType, NotraEditor, type NotraEditorProps, NotraReader, type NotraReaderProps, Spacer, Toolbar, ToolbarGroup, type ToolbarProps, ToolbarSeparator, type ToolbarSeparatorProps, UndoRedoButton, type UndoRedoButtonProps };