@blocknote/shadcn 0.30.0 → 0.31.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.
Files changed (51) hide show
  1. package/dist/blocknote-shadcn.cjs +1 -1
  2. package/dist/blocknote-shadcn.cjs.map +1 -1
  3. package/dist/blocknote-shadcn.js +550 -498
  4. package/dist/blocknote-shadcn.js.map +1 -1
  5. package/dist/style.css +1 -1
  6. package/dist/webpack-stats.json +1 -1
  7. package/package.json +5 -4
  8. package/src/BlockNoteView.tsx +2 -2
  9. package/src/badge/Badge.tsx +8 -7
  10. package/src/comments/Card.tsx +9 -6
  11. package/src/comments/Comment.tsx +10 -5
  12. package/src/comments/Editor.tsx +3 -2
  13. package/src/components/ui/avatar.tsx +3 -3
  14. package/src/components/ui/badge.tsx +1 -1
  15. package/src/components/ui/button.tsx +2 -2
  16. package/src/components/ui/card.tsx +2 -2
  17. package/src/components/ui/dropdown-menu.tsx +14 -11
  18. package/src/components/ui/form.tsx +6 -5
  19. package/src/components/ui/input.tsx +2 -2
  20. package/src/components/ui/label.tsx +1 -1
  21. package/src/components/ui/popover.tsx +1 -1
  22. package/src/components/ui/select.tsx +19 -13
  23. package/src/components/ui/skeleton.tsx +1 -1
  24. package/src/components/ui/tabs.tsx +3 -3
  25. package/src/components/ui/toggle.tsx +1 -1
  26. package/src/components/ui/tooltip.tsx +1 -1
  27. package/src/form/TextInput.tsx +34 -31
  28. package/src/menu/Button.tsx +2 -1
  29. package/src/menu/Menu.tsx +18 -11
  30. package/src/panel/Panel.tsx +2 -1
  31. package/src/panel/PanelButton.tsx +2 -1
  32. package/src/panel/PanelTab.tsx +3 -2
  33. package/src/popover/popover.tsx +5 -4
  34. package/src/sideMenu/SideMenuButton.tsx +2 -1
  35. package/src/style.css +5 -0
  36. package/src/suggestionMenu/SuggestionMenu.tsx +3 -2
  37. package/src/suggestionMenu/SuggestionMenuEmptyItem.tsx +3 -2
  38. package/src/suggestionMenu/SuggestionMenuItem.tsx +32 -6
  39. package/src/suggestionMenu/SuggestionMenuLabel.tsx +2 -1
  40. package/src/suggestionMenu/SuggestionMenuLoader.tsx +14 -3
  41. package/src/suggestionMenu/gridSuggestionMenu/GridSuggestionMenu.tsx +2 -1
  42. package/src/suggestionMenu/gridSuggestionMenu/GridSuggestionMenuEmptyItem.tsx +2 -1
  43. package/src/suggestionMenu/gridSuggestionMenu/GridSuggestionMenuItem.tsx +3 -2
  44. package/src/suggestionMenu/gridSuggestionMenu/GridSuggestionMenuLoader.tsx +2 -1
  45. package/src/tableHandle/ExtendButton.tsx +3 -2
  46. package/src/tableHandle/TableHandle.tsx +2 -1
  47. package/src/tailwindStyles.css +25 -25
  48. package/src/toolbar/Toolbar.tsx +19 -15
  49. package/types/src/form/TextInput.d.ts +5 -1
  50. package/types/src/suggestionMenu/SuggestionMenuItem.d.ts +1 -1
  51. package/types/src/suggestionMenu/SuggestionMenuLoader.d.ts +0 -1
@@ -37,22 +37,22 @@
37
37
  -moz-tab-size: 4; /* 3 */
38
38
  tab-size: 4; /* 3 */
39
39
  font-family: theme(
40
- "fontFamily.sans",
41
- ui-sans-serif,
42
- system-ui,
43
- sans-serif,
44
- "Apple Color Emoji",
45
- "Segoe UI Emoji",
46
- "Segoe UI Symbol",
47
- "Noto Color Emoji"
40
+ "fontFamily.sans",
41
+ ui-sans-serif,
42
+ system-ui,
43
+ sans-serif,
44
+ "Apple Color Emoji",
45
+ "Segoe UI Emoji",
46
+ "Segoe UI Symbol",
47
+ "Noto Color Emoji"
48
48
  ); /* 4 */
49
49
  font-feature-settings: theme(
50
- "fontFamily.sans[1].fontFeatureSettings",
51
- normal
50
+ "fontFamily.sans[1].fontFeatureSettings",
51
+ normal
52
52
  ); /* 5 */
53
53
  font-variation-settings: theme(
54
- "fontFamily.sans[1].fontVariationSettings",
55
- normal
54
+ "fontFamily.sans[1].fontVariationSettings",
55
+ normal
56
56
  ); /* 6 */
57
57
  -webkit-tap-highlight-color: transparent; /* 7 */
58
58
  }
@@ -131,23 +131,23 @@
131
131
  samp,
132
132
  pre {
133
133
  font-family: theme(
134
- "fontFamily.mono",
135
- ui-monospace,
136
- SFMono-Regular,
137
- Menlo,
138
- Monaco,
139
- Consolas,
140
- "Liberation Mono",
141
- "Courier New",
142
- monospace
134
+ "fontFamily.mono",
135
+ ui-monospace,
136
+ SFMono-Regular,
137
+ Menlo,
138
+ Monaco,
139
+ Consolas,
140
+ "Liberation Mono",
141
+ "Courier New",
142
+ monospace
143
143
  ); /* 1 */
144
144
  font-feature-settings: theme(
145
- "fontFamily.mono[1].fontFeatureSettings",
146
- normal
145
+ "fontFamily.mono[1].fontFeatureSettings",
146
+ normal
147
147
  ); /* 2 */
148
148
  font-variation-settings: theme(
149
- "fontFamily.mono[1].fontVariationSettings",
150
- normal
149
+ "fontFamily.mono[1].fontVariationSettings",
150
+ normal
151
151
  ); /* 3 */
152
152
  font-size: 1em; /* 4 */
153
153
  }
@@ -5,8 +5,7 @@ import { forwardRef } from "react";
5
5
  import { cn } from "../lib/utils.js";
6
6
  import { useShadCNComponentsContext } from "../ShadCNComponentsContext.js";
7
7
 
8
- type ToolbarProps = ComponentProps["FormattingToolbar"]["Root"] &
9
- ComponentProps["LinkToolbar"]["Root"];
8
+ type ToolbarProps = ComponentProps["Generic"]["Toolbar"]["Root"];
10
9
 
11
10
  export const Toolbar = forwardRef<HTMLDivElement, ToolbarProps>(
12
11
  (props, ref) => {
@@ -29,20 +28,20 @@ export const Toolbar = forwardRef<HTMLDivElement, ToolbarProps>(
29
28
  className={cn(
30
29
  className,
31
30
  "bn-flex bn-gap-1 bn-p-1 bn-bg-popover bn-text-popover-foreground bn-border bn-rounded-lg bn-shadow-md bn-h-fit",
32
- variant === "action-toolbar" ? "bn-w-fit" : ""
31
+ variant === "action-toolbar" ? "bn-w-fit" : "",
33
32
  )}
34
33
  ref={ref}
35
34
  onMouseEnter={onMouseEnter}
36
- onMouseLeave={onMouseLeave}>
35
+ onMouseLeave={onMouseLeave}
36
+ >
37
37
  {children}
38
38
  </div>
39
39
  </ShadCNComponents.Tooltip.TooltipProvider>
40
40
  );
41
- }
41
+ },
42
42
  );
43
43
 
44
- type ToolbarButtonProps = ComponentProps["FormattingToolbar"]["Button"] &
45
- ComponentProps["LinkToolbar"]["Button"];
44
+ type ToolbarButtonProps = ComponentProps["Generic"]["Toolbar"]["Button"];
46
45
 
47
46
  export const ToolbarButton = forwardRef<HTMLButtonElement, ToolbarButtonProps>(
48
47
  (props, ref) => {
@@ -71,7 +70,7 @@ export const ToolbarButton = forwardRef<HTMLButtonElement, ToolbarButtonProps>(
71
70
  <ShadCNComponents.Button.Button
72
71
  className={cn(
73
72
  className,
74
- variant === "compact" ? "bn-h-6 bn-min-w-6 bn-p-0" : ""
73
+ variant === "compact" ? "bn-h-6 bn-min-w-6 bn-p-0" : "",
75
74
  )}
76
75
  variant="ghost"
77
76
  size={variant === "compact" ? "sm" : "default"}
@@ -79,7 +78,8 @@ export const ToolbarButton = forwardRef<HTMLButtonElement, ToolbarButtonProps>(
79
78
  onClick={onClick}
80
79
  ref={ref}
81
80
  aria-label={label}
82
- {...rest}>
81
+ {...rest}
82
+ >
83
83
  {icon}
84
84
  {children}
85
85
  </ShadCNComponents.Button.Button>
@@ -88,7 +88,7 @@ export const ToolbarButton = forwardRef<HTMLButtonElement, ToolbarButtonProps>(
88
88
  className={cn(
89
89
  className,
90
90
  "data-[state=open]:bg-accent data-[state=closed]:text-accent-foreground",
91
- variant === "compact" ? "bn-h-6 bn-min-w-6 bn-p-0" : ""
91
+ variant === "compact" ? "bn-h-6 bn-min-w-6 bn-p-0" : "",
92
92
  )}
93
93
  size={variant === "compact" ? "sm" : "default"}
94
94
  aria-label={label}
@@ -98,7 +98,8 @@ export const ToolbarButton = forwardRef<HTMLButtonElement, ToolbarButtonProps>(
98
98
  data-state={isSelected ? "on" : "off"}
99
99
  data-disabled={isDisabled}
100
100
  ref={ref}
101
- {...rest}>
101
+ {...rest}
102
+ >
102
103
  {icon}
103
104
  {children}
104
105
  </ShadCNComponents.Toggle.Toggle>
@@ -112,13 +113,14 @@ export const ToolbarButton = forwardRef<HTMLButtonElement, ToolbarButtonProps>(
112
113
  <ShadCNComponents.Tooltip.TooltipContent
113
114
  className={
114
115
  "bn-flex bn-flex-col bn-items-center bn-whitespace-pre-wrap"
115
- }>
116
+ }
117
+ >
116
118
  <span>{mainTooltip}</span>
117
119
  {secondaryTooltip && <span>{secondaryTooltip}</span>}
118
120
  </ShadCNComponents.Tooltip.TooltipContent>
119
121
  </ShadCNComponents.Tooltip.Tooltip>
120
122
  );
121
- }
123
+ },
122
124
  );
123
125
 
124
126
  export const ToolbarSelect = forwardRef<
@@ -151,7 +153,8 @@ export const ToolbarSelect = forwardRef<
151
153
  onValueChange={(value) =>
152
154
  items.find((item) => item.text === value)!.onClick?.()
153
155
  }
154
- disabled={isDisabled}>
156
+ disabled={isDisabled}
157
+ >
155
158
  <ShadCNComponents.Select.SelectTrigger className={"bn-border-none"}>
156
159
  <ShadCNComponents.Select.SelectValue />
157
160
  </ShadCNComponents.Select.SelectTrigger>
@@ -160,7 +163,8 @@ export const ToolbarSelect = forwardRef<
160
163
  <ShadCNComponents.Select.SelectItem
161
164
  disabled={item.isDisabled}
162
165
  key={item.text}
163
- value={item.text}>
166
+ value={item.text}
167
+ >
164
168
  <SelectItemContent {...item} />
165
169
  </ShadCNComponents.Select.SelectItem>
166
170
  ))}
@@ -2,11 +2,15 @@ export declare const TextInput: import("react").ForwardRefExoticComponent<{
2
2
  className?: string;
3
3
  name: string;
4
4
  label?: string;
5
+ variant?: "default" | "large";
5
6
  icon: import("react").ReactNode;
7
+ rightSection?: import("react").ReactNode;
6
8
  autoFocus?: boolean;
7
- placeholder: string;
9
+ placeholder?: string;
10
+ disabled?: boolean;
8
11
  value: string;
9
12
  onKeyDown: (event: import("react").KeyboardEvent<HTMLInputElement>) => void;
10
13
  onChange: (event: import("react").ChangeEvent<HTMLInputElement>) => void;
11
14
  onSubmit?: () => void;
15
+ autoComplete?: import("react").HTMLInputAutoCompleteAttribute;
12
16
  } & import("react").RefAttributes<HTMLInputElement>>;
@@ -3,5 +3,5 @@ export declare const SuggestionMenuItem: import("react").ForwardRefExoticCompone
3
3
  id: string;
4
4
  isSelected: boolean;
5
5
  onClick: () => void;
6
- item: import("@blocknote/react").DefaultReactSuggestionItem;
6
+ item: Omit<import("@blocknote/react").DefaultReactSuggestionItem, "onItemClick">;
7
7
  } & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,4 +1,3 @@
1
1
  export declare const SuggestionMenuLoader: import("react").ForwardRefExoticComponent<{
2
2
  className?: string;
3
- children?: import("react").ReactNode;
4
3
  } & import("react").RefAttributes<HTMLDivElement>>;