((props, ref) => {
- const { className, children } = props;
+ const { className, children, ...rest } = props;
+
+ assertEmpty(rest);
return (
diff --git a/packages/mantine/src/panel/PanelTextInput.tsx b/packages/mantine/src/panel/PanelTextInput.tsx
index 59f6f9b884..e68efaf18e 100644
--- a/packages/mantine/src/panel/PanelTextInput.tsx
+++ b/packages/mantine/src/panel/PanelTextInput.tsx
@@ -1,5 +1,6 @@
import * as Mantine from "@mantine/core";
+import { assertEmpty } from "@blocknote/core";
import { ComponentProps } from "@blocknote/react";
import { forwardRef } from "react";
@@ -7,7 +8,9 @@ export const PanelTextInput = forwardRef<
HTMLInputElement,
ComponentProps["ImagePanel"]["TextInput"]
>((props, ref) => {
- const { className, value, placeholder, onKeyDown, onChange } = props;
+ const { className, value, placeholder, onKeyDown, onChange, ...rest } = props;
+
+ assertEmpty(rest);
return (
{
- const { children, opened, position } = props;
+ const { children, opened, position, ...rest } = props;
+
+ assertEmpty(rest);
return (
{
- const { children } = props;
+ const { children, ...rest } = props;
+
+ assertEmpty(rest);
return {children};
};
@@ -31,7 +36,14 @@ export const PopoverContent = forwardRef<
HTMLDivElement,
ComponentProps["Generic"]["Popover"]["Content"]
>((props, ref) => {
- const { className, children } = props;
+ const {
+ className,
+ children,
+ variant, // unused
+ ...rest
+ } = props;
+
+ assertEmpty(rest);
return (
diff --git a/packages/mantine/src/sideMenu/SideMenu.tsx b/packages/mantine/src/sideMenu/SideMenu.tsx
index 7a233730d8..91313ad206 100644
--- a/packages/mantine/src/sideMenu/SideMenu.tsx
+++ b/packages/mantine/src/sideMenu/SideMenu.tsx
@@ -1,5 +1,6 @@
import * as Mantine from "@mantine/core";
+import { assertEmpty } from "@blocknote/core";
import { ComponentProps } from "@blocknote/react";
import { forwardRef } from "react";
@@ -7,7 +8,9 @@ export const SideMenu = forwardRef<
HTMLDivElement,
ComponentProps["SideMenu"]["Root"]
>((props, ref) => {
- const { className, children } = props;
+ const { className, children, ...rest } = props;
+
+ assertEmpty(rest);
return (
diff --git a/packages/mantine/src/sideMenu/SideMenuButton.tsx b/packages/mantine/src/sideMenu/SideMenuButton.tsx
index 329f0baf4f..cb1f21a1a6 100644
--- a/packages/mantine/src/sideMenu/SideMenuButton.tsx
+++ b/packages/mantine/src/sideMenu/SideMenuButton.tsx
@@ -1,5 +1,6 @@
import * as Mantine from "@mantine/core";
+import { assertEmpty } from "@blocknote/core";
import { ComponentProps } from "@blocknote/react";
import { forwardRef } from "react";
@@ -7,7 +8,21 @@ export const SideMenuButton = forwardRef<
HTMLButtonElement,
ComponentProps["SideMenu"]["Button"]
>((props, ref) => {
- const { className, children, icon, onClick, ...rest } = props;
+ const {
+ className,
+ children,
+ icon,
+ onClick,
+ onDragEnd,
+ onDragStart,
+ draggable,
+ label,
+ ...rest
+ } = props;
+
+ // false, because rest props can be added by mantine when button is used as a trigger
+ // assertEmpty in this case is only used at typescript level, not runtime level
+ assertEmpty(rest, false);
if (icon) {
return (
@@ -16,6 +31,10 @@ export const SideMenuButton = forwardRef<
className={className}
ref={ref}
onClick={onClick}
+ onDragEnd={onDragEnd}
+ onDragStart={onDragStart}
+ draggable={draggable}
+ aria-label={label}
{...rest}>
{icon}
@@ -23,7 +42,15 @@ export const SideMenuButton = forwardRef<
}
return (
-
+
{children}
);
diff --git a/packages/mantine/src/style.css b/packages/mantine/src/style.css
index dd22c7f316..962b836a7c 100644
--- a/packages/mantine/src/style.css
+++ b/packages/mantine/src/style.css
@@ -5,227 +5,228 @@
/* Mantine Badge component base styles */
.bn-container .mantine-Badge-root {
- background-color: var(--bn-colors-tooltip-background);
- color: var(--bn-colors-tooltip-text);
+ background-color: var(--bn-colors-tooltip-background);
+ color: var(--bn-colors-tooltip-text);
}
/* Mantine FileInput component base styles */
.bn-container .mantine-FileInput-input {
- align-items: center;
- background-color: var(--bn-colors-menu-background);
- border: none;
- border-radius: 4px;
- color: var(--bn-colors-menu-text);
- display: flex;
- flex-direction: row;
- justify-content: center;
+ align-items: center;
+ background-color: var(--bn-colors-menu-background);
+ border: none;
+ border-radius: 4px;
+ color: var(--bn-colors-menu-text);
+ display: flex;
+ flex-direction: row;
+ justify-content: center;
}
.bn-container .mantine-FileInput-input:hover {
- background-color: var(--bn-colors-hovered-background);
+ background-color: var(--bn-colors-hovered-background);
}
.bn-container .mantine-FileInput-wrapper {
- border: solid var(--bn-colors-border) 1px;
- border-radius: 4px;
+ border: solid var(--bn-colors-border) 1px;
+ border-radius: 4px;
}
.bn-container .mantine-InputPlaceholder-placeholder {
- color: var(--bn-colors-menu-text);
- font-weight: 600;
+ color: var(--bn-colors-menu-text);
+ font-weight: 600;
}
/* Mantine Menu component base styles */
.bn-container .mantine-Menu-dropdown {
- background-color: var(--bn-colors-menu-background);
- border: var(--bn-border);
- border-radius: var(--bn-border-radius-medium);
- box-shadow: var(--bn-shadow-medium);
- box-sizing: border-box;
- color: var(--bn-colors-menu-text);
- padding: 2px;
- overflow: auto;
+ background-color: var(--bn-colors-menu-background);
+ border: var(--bn-border);
+ border-radius: var(--bn-border-radius-medium);
+ box-shadow: var(--bn-shadow-medium);
+ box-sizing: border-box;
+ color: var(--bn-colors-menu-text);
+ padding: 2px;
+ overflow: auto;
}
.bn-container .mantine-Menu-label {
- background-color: var(--bn-colors-menu-background);
- color: var(--bn-colors-menu-text);
+ background-color: var(--bn-colors-menu-background);
+ color: var(--bn-colors-menu-text);
}
.bn-container .mantine-Menu-item {
- background-color: var(--bn-colors-menu-background);
- border: none;
- border-radius: var(--bn-border-radius-small);
- color: var(--bn-colors-menu-text);
+ background-color: var(--bn-colors-menu-background);
+ border: none;
+ border-radius: var(--bn-border-radius-small);
+ color: var(--bn-colors-menu-text);
}
-.bn-container .mantine-Menu-item[data-hovered] {
- background-color: var(--bn-colors-hovered-background);
- border: none;
- color: var(--bn-colors-hovered-text);
+.bn-container .mantine-Menu-item[aria-selected="true"],
+.bn-container .mantine-Menu-item:hover {
+ background-color: var(--bn-colors-hovered-background);
+ border: none;
+ color: var(--bn-colors-hovered-text);
}
/* Mantine Popover component base styles */
.bn-container .mantine-Popover-dropdown {
- background-color: transparent;
- border: none;
- border-radius: 0;
- box-shadow: none;
- padding: 0;
+ background-color: transparent;
+ border: none;
+ border-radius: 0;
+ box-shadow: none;
+ padding: 0;
}
/* Mantine Tabs component base styles */
.bn-container .mantine-Tabs-root {
- width: 100%;
- background-color: var(--bn-colors-menu-background);
+ width: 100%;
+ background-color: var(--bn-colors-menu-background);
}
.bn-container .mantine-Tabs-list:before {
- border-color: var(--bn-colors-hovered-background);
+ border-color: var(--bn-colors-hovered-background);
}
.bn-container .mantine-Tabs-tab {
- color: var(--bn-colors-menu-text);
- border-color: var(--bn-colors-hovered-background);
+ color: var(--bn-colors-menu-text);
+ border-color: var(--bn-colors-hovered-background);
}
.bn-container .mantine-Tabs-tab:hover {
- background-color: var(--bn-colors-hovered-background);
- border-color: var(--bn-colors-hovered-background);
- color: var(--bn-colors-hovered-text);
+ background-color: var(--bn-colors-hovered-background);
+ border-color: var(--bn-colors-hovered-background);
+ color: var(--bn-colors-hovered-text);
}
.bn-container .mantine-Tabs-tab[data-active],
.bn-container .mantine-Tabs-tab[data-active]:hover {
- border-color: var(--bn-colors-menu-text);
- color: var(--bn-colors-menu-text);
+ border-color: var(--bn-colors-menu-text);
+ color: var(--bn-colors-menu-text);
}
.bn-container .mantine-Tabs-panel {
- padding: 8px;
+ padding: 8px;
}
/* Mantine TextInput component base styles */
.bn-container .mantine-TextInput-input {
- background-color: var(--bn-colors-menu-background);
- border: solid var(--bn-colors-border) 1px;
- border-radius: 4px;
- color: var(--bn-colors-menu-text);
- height: 32px;
+ background-color: var(--bn-colors-menu-background);
+ border: solid var(--bn-colors-border) 1px;
+ border-radius: 4px;
+ color: var(--bn-colors-menu-text);
+ height: 32px;
}
/* Mantine Tooltip component base styles */
.bn-container .mantine-Tooltip-tooltip {
- background-color: transparent;
- border: none;
- border-radius: 0;
- box-shadow: none;
- padding: 0;
+ background-color: transparent;
+ border: none;
+ border-radius: 0;
+ box-shadow: none;
+ padding: 0;
}
/* UI element styling */
/* Select styling */
.bn-select {
- overflow: auto;
+ overflow: auto;
}
/* Toolbar styling */
.bn-toolbar {
- background-color: var(--bn-colors-menu-background);
- border: var(--bn-border);
- border-radius: var(--bn-border-radius-medium);
- box-shadow: var(--bn-shadow-medium);
- flex-wrap: nowrap;
- gap: 2px;
- padding: 2px;
- width: fit-content;
+ background-color: var(--bn-colors-menu-background);
+ border: var(--bn-border);
+ border-radius: var(--bn-border-radius-medium);
+ box-shadow: var(--bn-shadow-medium);
+ flex-wrap: nowrap;
+ gap: 2px;
+ padding: 2px;
+ width: fit-content;
}
.bn-toolbar:empty {
- display: none;
+ display: none;
}
.bn-toolbar .mantine-Button-root,
.bn-toolbar .mantine-ActionIcon-root {
- background-color: var(--bn-colors-menu-background);
- border: none;
- border-radius: var(--bn-border-radius-small);
- color: var(--bn-colors-menu-text);
+ background-color: var(--bn-colors-menu-background);
+ border: none;
+ border-radius: var(--bn-border-radius-small);
+ color: var(--bn-colors-menu-text);
}
.bn-toolbar .mantine-Button-root:hover,
.bn-toolbar .mantine-ActionIcon-root:hover {
- background-color: var(--bn-colors-hovered-background);
- border: none;
- color: var(--bn-colors-hovered-text);
+ background-color: var(--bn-colors-hovered-background);
+ border: none;
+ color: var(--bn-colors-hovered-text);
}
.bn-toolbar .mantine-Button-root[data-selected],
.bn-toolbar .mantine-ActionIcon-root[data-selected] {
- background-color: var(--bn-colors-selected-background);
- border: none;
- color: var(--bn-colors-selected-text);
+ background-color: var(--bn-colors-selected-background);
+ border: none;
+ color: var(--bn-colors-selected-text);
}
.bn-toolbar .mantine-Button-root[data-disabled],
-.bn-toolbar .mantine-ActionIcon-root[data-disabled] {
- background-color: var(--bn-colors-disabled-background);
- border: none;
- color: var(--bn-colors-disabled-text);
+.bn-toolbar .mantine-ActionIcon-root[data-disabled] {
+ background-color: var(--bn-colors-disabled-background);
+ border: none;
+ color: var(--bn-colors-disabled-text);
}
.bn-toolbar .mantine-Menu-item {
- font-size: 12px;
- height: 30px;
+ font-size: 12px;
+ height: 30px;
}
.bn-toolbar .mantine-Menu-item:hover {
- background-color: var(--bn-colors-hovered-background);
+ background-color: var(--bn-colors-hovered-background);
}
.bn-container .bn-form-popover {
- background-color: var(--bn-colors-menu-background);
- border: var(--bn-border);
- border-radius: var(--bn-border-radius-medium);
- box-shadow: var(--bn-shadow-medium);
- color: var(--bn-colors-menu-text);
- gap: 4px;
- min-width: 145px;
- padding: 2px;
+ background-color: var(--bn-colors-menu-background);
+ border: var(--bn-border);
+ border-radius: var(--bn-border-radius-medium);
+ box-shadow: var(--bn-shadow-medium);
+ color: var(--bn-colors-menu-text);
+ gap: 4px;
+ min-width: 145px;
+ padding: 2px;
}
.bn-form-popover .mantine-TextInput-root,
.bn-form-popover .mantine-FileInput-root {
- width: 300px;
+ width: 300px;
}
.bn-form-popover .mantine-TextInput-wrapper,
.bn-form-popover .mantine-FileInput-wrapper {
- padding: 0;
- border-radius: 4px;
+ padding: 0;
+ border-radius: 4px;
}
.bn-form-popover .mantine-TextInput-wrapper:hover {
- background-color: var(--bn-colors-hovered-background);
+ background-color: var(--bn-colors-hovered-background);
}
.bn-form-popover .mantine-TextInput-input,
.bn-form-popover .mantine-FileInput-input {
- border: none;
- font-size: 12px;
+ border: none;
+ font-size: 12px;
}
.bn-form-popover .mantine-FileInput-input:hover {
- background-color: var(--bn-colors-hovered-background);
+ background-color: var(--bn-colors-hovered-background);
}
.bn-form-popover .mantine-FileInput-section[data-position="left"] {
- color: var(--bn-colors-menu-text);
+ color: var(--bn-colors-menu-text);
}
.bn-form-popover .mantine-FileInput-placeholder {
- color: var(--bn-colors-menu-text);
+ color: var(--bn-colors-menu-text);
}
/* Suggestion Menu styling*/
@@ -235,254 +236,255 @@
own. */
/* https://github.com/mantinedev/mantine/blob/e3e3bb834de1f2f75a27dbc757dc0a2fc6a6cba8/packages/%40mantine/core/src/components/Menu/Menu.module.css */
.bn-suggestion-menu {
- max-height: 100%;
- position: relative;
- box-shadow: var(--mantine-shadow-md);
- border: calc(0.0625rem * var(--mantine-scale)) solid
+ max-height: 100%;
+ position: relative;
+ box-shadow: var(--mantine-shadow-md);
+ border: calc(0.0625rem * var(--mantine-scale)) solid
var(--mantine-color-gray-2);
- border-radius: var(--mantine-radius-default);
- padding: 4px;
+ border-radius: var(--mantine-radius-default);
+ padding: 4px;
}
.bn-suggestion-menu-label {
- color: var(--mantine-color-dimmed);
- font-weight: 500;
- font-size: var(--mantine-font-size-xs);
- padding: calc(var(--mantine-spacing-xs) / 2) var(--mantine-spacing-sm);
- cursor: default;
+ color: var(--mantine-color-dimmed);
+ font-weight: 500;
+ font-size: var(--mantine-font-size-xs);
+ padding: calc(var(--mantine-spacing-xs) / 2) var(--mantine-spacing-sm);
+ cursor: default;
}
.bn-suggestion-menu-item {
- font-size: var(--mantine-font-size-sm);
- width: 100%;
- padding: calc(var(--mantine-spacing-xs) / 1.5) var(--mantine-spacing-sm);
- border-radius: var(--popover-radius, var(--mantine-radius-default));
- color: var(--menu-item-color, var(--mantine-color-text));
- display: flex;
- align-items: center;
- user-select: none;
-
- &:where([data-disabled], :disabled) {
- color: var(--mantine-color-dimmed);
- opacity: 0.6;
- pointer-events: none;
- }
-
- &:where([data-hovered]) {
- }
+ font-size: var(--mantine-font-size-sm);
+ width: 100%;
+ padding: calc(var(--mantine-spacing-xs) / 1.5) var(--mantine-spacing-sm);
+ border-radius: var(--popover-radius, var(--mantine-radius-default));
+ color: var(--menu-item-color, var(--mantine-color-text));
+ display: flex;
+ align-items: center;
+ user-select: none;
+
+ &:where([data-disabled], :disabled) {
+ color: var(--mantine-color-dimmed);
+ opacity: 0.6;
+ pointer-events: none;
+ }
}
/* Additional Suggestion Menu styling*/
.bn-mt-suggestion-menu-item-body {
- flex: 1;
+ flex: 1;
}
.bn-mt-suggestion-menu-item-section {
- display: flex;
- justify-content: center;
- align-items: center;
+ display: flex;
+ justify-content: center;
+ align-items: center;
- &:where([data-position="left"]) {
- margin-inline-end: var(--mantine-spacing-xs);
- }
+ &:where([data-position="left"]) {
+ margin-inline-end: var(--mantine-spacing-xs);
+ }
- &:where([data-position="right"]) {
- margin-inline-start: var(--mantine-spacing-xs);
- }
+ &:where([data-position="right"]) {
+ margin-inline-start: var(--mantine-spacing-xs);
+ }
}
.bn-suggestion-menu {
- background-color: var(--bn-colors-menu-background);
- border: var(--bn-border);
- border-radius: var(--bn-border-radius-medium);
- box-shadow: var(--bn-shadow-medium);
- box-sizing: border-box;
- color: var(--bn-colors-menu-text);
- overflow-y: auto;
- padding: 2px;
+ background-color: var(--bn-colors-menu-background);
+ border: var(--bn-border);
+ border-radius: var(--bn-border-radius-medium);
+ box-shadow: var(--bn-shadow-medium);
+ box-sizing: border-box;
+ color: var(--bn-colors-menu-text);
+ overflow-y: auto;
+ padding: 2px;
}
.bn-suggestion-menu-item {
- cursor: pointer;
- height: 52px;
+ cursor: pointer;
+ height: 52px;
}
-.bn-suggestion-menu-item[data-hovered] {
- background-color: var(--bn-colors-hovered-background);
+.bn-suggestion-menu-item[aria-selected="true"],
+.bn-suggestion-menu-item:hover {
+ background-color: var(--bn-colors-hovered-background);
}
.bn-mt-suggestion-menu-item-section {
- color: var(--bn-colors-tooltip-text);
+ color: var(--bn-colors-tooltip-text);
}
.bn-mt-suggestion-menu-item-section[data-position="left"] {
- background-color: var(--bn-colors-tooltip-background);
- border-radius: var(--bn-border-radius-small);
- padding: 8px;
+ background-color: var(--bn-colors-tooltip-background);
+ border-radius: var(--bn-border-radius-small);
+ padding: 8px;
}
.bn-mt-suggestion-menu-item-body {
- align-items: stretch;
- color: var(--bn-colors-menu-text);
- display: flex;
- flex: 1;
- flex-direction: column;
- justify-content: flex-start;
- padding-right: 16px;
+ align-items: stretch;
+ color: var(--bn-colors-menu-text);
+ display: flex;
+ flex: 1;
+ flex-direction: column;
+ justify-content: flex-start;
+ padding-right: 16px;
}
.bn-mt-suggestion-menu-item-title {
- line-height: 20px;
- font-weight: 500;
- font-size: 14px;
- margin: 0;
- padding: 0;
+ line-height: 20px;
+ font-weight: 500;
+ font-size: 14px;
+ margin: 0;
+ padding: 0;
}
.bn-mt-suggestion-menu-item-subtitle {
- line-height: 16px;
- font-size: 10px;
- margin: 0;
- padding: 0;
+ line-height: 16px;
+ font-size: 10px;
+ margin: 0;
+ padding: 0;
}
.bn-suggestion-menu-label {
- color: var(--bn-colors-hovered-text);
+ color: var(--bn-colors-hovered-text);
}
.bn-suggestion-menu-loader {
- height: 20px;
- width: 100%;
+ height: 20px;
+ width: 100%;
}
.bn-suggestion-menu-loader span {
- background-color: var(--bn-colors-side-menu);
+ background-color: var(--bn-colors-side-menu);
}
/* Side Menu styling */
.bn-side-menu {
- background-color: transparent;
- overflow: visible;
+ background-color: transparent;
+ overflow: visible;
}
-.bn-side-menu .mantine-Menu-item, .bn-table-handle-menu .mantine-Menu-item {
- font-size: 12px;
- height: 30px;
+.bn-side-menu .mantine-Menu-item,
+.bn-table-handle-menu .mantine-Menu-item {
+ font-size: 12px;
+ height: 30px;
}
.bn-side-menu .mantine-UnstyledButton-root:not(.mantine-Menu-item) {
- background-color: transparent;
+ background-color: transparent;
}
.bn-side-menu .mantine-UnstyledButton-root:hover {
- background-color: var(--bn-colors-hovered-background);
+ background-color: var(--bn-colors-hovered-background);
}
.bn-side-menu .mantine-UnstyledButton-root:not(.mantine-Menu-item) svg {
- background-color: transparent;
- color: var(--bn-colors-side-menu);
- height: 22px;
- width: 22px;
+ background-color: transparent;
+ color: var(--bn-colors-side-menu);
+ height: 22px;
+ width: 22px;
}
.bn-side-menu > [draggable="true"] {
- display: flex;
+ display: flex;
}
.bn-side-menu .mantine-Menu-dropdown {
- min-width: 100px;
- padding: 2px;
- position: absolute;
+ min-width: 100px;
+ padding: 2px;
+ position: absolute;
}
/* Image Panel styling*/
.bn-panel {
- background-color: var(--bn-colors-menu-background);
- border: var(--bn-border);
- border-radius: var(--bn-border-radius-medium);
- box-shadow: var(--bn-shadow-medium);
- padding: 2px;
- width: 500px;
+ background-color: var(--bn-colors-menu-background);
+ border: var(--bn-border);
+ border-radius: var(--bn-border-radius-medium);
+ box-shadow: var(--bn-shadow-medium);
+ padding: 2px;
+ width: 500px;
}
.bn-panel .bn-tab-panel {
- align-items: center;
- display: flex;
- flex-direction: column;
- gap: 8px;
- width: 100%;
+ align-items: center;
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+ width: 100%;
}
.bn-panel .mantine-TextInput-root,
.bn-panel .mantine-FileInput-root {
- width: 100%;
+ width: 100%;
}
.bn-panel .mantine-Button-root {
- background-color: var(--bn-colors-menu-background);
- border: solid var(--bn-colors-border) 1px;
- border-radius: var(--bn-border-radius-small);
- color: var(--bn-colors-menu-text);
- height: 32px;
- width: 60%;
+ background-color: var(--bn-colors-menu-background);
+ border: solid var(--bn-colors-border) 1px;
+ border-radius: var(--bn-border-radius-small);
+ color: var(--bn-colors-menu-text);
+ height: 32px;
+ width: 60%;
}
.bn-panel .mantine-Button-root:hover {
- background-color: var(--bn-colors-hovered-background);
+ background-color: var(--bn-colors-hovered-background);
}
.bn-panel.mantine-Text-root {
- text-align: center;
+ text-align: center;
}
/* Table Handle styling */
.bn-table-handle {
- align-items: center;
- background-color: var(--bn-colors-menu-background);
- border: var(--bn-border);
- border-radius: var(--bn-border-radius-small);
- box-shadow: var(--bn-shadow-light);
- color: var(--bn-colors-side-menu);
- cursor: pointer;
- display: flex;
- justify-content: center;
- overflow: visible;
- padding: 0;
+ align-items: center;
+ background-color: var(--bn-colors-menu-background);
+ border: var(--bn-border);
+ border-radius: var(--bn-border-radius-small);
+ box-shadow: var(--bn-shadow-light);
+ color: var(--bn-colors-side-menu);
+ cursor: pointer;
+ display: flex;
+ justify-content: center;
+ overflow: visible;
+ padding: 0;
}
.bn-table-handle svg {
- margin-inline: -4px;
+ margin-inline: -4px;
}
.bn-table-handle:hover,
.bn-table-handle-dragging {
- background-color: var(--bn-colors-hovered-background);
+ background-color: var(--bn-colors-hovered-background);
}
/* Drag Handle & Table Handle Menu styling */
.bn-container .bn-drag-handle-menu {
- overflow: visible;
+ overflow: visible;
}
/* Tooltip styling */
.bn-tooltip {
- background-color: var(--bn-colors-tooltip-background);
- border: var(--bn-border);
- border-radius: var(--bn-border-radius-medium);
- box-shadow: var(--bn-shadow-medium);
- color: var(--bn-colors-tooltip-text);
- padding: 4px 10px;
- text-align: center;
+ background-color: var(--bn-colors-tooltip-background);
+ border: var(--bn-border);
+ border-radius: var(--bn-border-radius-medium);
+ box-shadow: var(--bn-shadow-medium);
+ color: var(--bn-colors-tooltip-text);
+ padding: 4px 10px;
+ text-align: center;
}
/* Additional menu styles */
.bn-tick-space {
- padding: 0;
- width: 20px;
+ padding: 0;
+ width: 20px;
}
-.bn-mt-sub-menu-item > .mantine-Menu-itemLabel > div:not(.mantine-Menu-dropdown) {
- align-items: center;
- display: flex;
- justify-content: space-between;
+.bn-mt-sub-menu-item
+ > .mantine-Menu-itemLabel
+ > div:not(.mantine-Menu-dropdown) {
+ align-items: center;
+ display: flex;
+ justify-content: space-between;
}
diff --git a/packages/mantine/src/suggestionMenu/SuggestionMenu.tsx b/packages/mantine/src/suggestionMenu/SuggestionMenu.tsx
index 4c0e5a6db7..8d9a2ea257 100644
--- a/packages/mantine/src/suggestionMenu/SuggestionMenu.tsx
+++ b/packages/mantine/src/suggestionMenu/SuggestionMenu.tsx
@@ -1,5 +1,6 @@
import * as Mantine from "@mantine/core";
+import { assertEmpty } from "@blocknote/core";
import { ComponentProps } from "@blocknote/react";
import { forwardRef } from "react";
@@ -7,10 +8,17 @@ export const SuggestionMenu = forwardRef<
HTMLDivElement,
ComponentProps["SuggestionMenu"]["Root"]
>((props, ref) => {
- const { className, children } = props;
+ const { className, children, id, ...rest } = props;
+
+ assertEmpty(rest);
return (
-
+
{children}
);
diff --git a/packages/mantine/src/suggestionMenu/SuggestionMenuEmptyItem.tsx b/packages/mantine/src/suggestionMenu/SuggestionMenuEmptyItem.tsx
index 3e88792d86..990a285590 100644
--- a/packages/mantine/src/suggestionMenu/SuggestionMenuEmptyItem.tsx
+++ b/packages/mantine/src/suggestionMenu/SuggestionMenuEmptyItem.tsx
@@ -1,5 +1,6 @@
import * as Mantine from "@mantine/core";
+import { assertEmpty } from "@blocknote/core";
import { ComponentProps } from "@blocknote/react";
import { forwardRef } from "react";
@@ -7,7 +8,9 @@ export const SuggestionMenuEmptyItem = forwardRef<
HTMLDivElement,
ComponentProps["SuggestionMenu"]["EmptyItem"]
>((props, ref) => {
- const { className, children } = props;
+ const { className, children, ...rest } = props;
+
+ assertEmpty(rest);
return (
diff --git a/packages/mantine/src/suggestionMenu/SuggestionMenuItem.tsx b/packages/mantine/src/suggestionMenu/SuggestionMenuItem.tsx
index bc622bb073..bf67bf71fc 100644
--- a/packages/mantine/src/suggestionMenu/SuggestionMenuItem.tsx
+++ b/packages/mantine/src/suggestionMenu/SuggestionMenuItem.tsx
@@ -1,65 +1,45 @@
import * as Mantine from "@mantine/core";
+import { assertEmpty } from "@blocknote/core";
import { ComponentProps } from "@blocknote/react";
-import { forwardRef, useCallback } from "react";
+import { forwardRef } from "react";
export const SuggestionMenuItem = forwardRef<
HTMLDivElement,
ComponentProps["SuggestionMenu"]["Item"]
>((props, ref) => {
- const {
- className,
- title,
- subtext,
- // group,
- icon,
- badge,
- // aliases,
- // onItemClick,
- isSelected,
- setSelected,
- onClick,
- } = props;
+ const { className, isSelected, onClick, item, id, ...rest } = props;
- const handleMouseLeave = useCallback(() => {
- setSelected?.(false);
- }, [setSelected]);
-
- const handleMouseEnter = useCallback(() => {
- setSelected?.(true);
- }, [setSelected]);
+ assertEmpty(rest);
return (
- {icon && (
+ id={id}
+ role="option"
+ aria-selected={isSelected || undefined}>
+ {item.icon && (
- {icon}
+ {item.icon}
)}
- {title}
+ {item.title}
- {subtext}
+ {item.subtext}
- {badge && (
+ {item.badge && (
- {badge}
+ {item.badge}
)}
diff --git a/packages/mantine/src/suggestionMenu/SuggestionMenuLabel.tsx b/packages/mantine/src/suggestionMenu/SuggestionMenuLabel.tsx
index 9c7178cc9b..a913f3f5eb 100644
--- a/packages/mantine/src/suggestionMenu/SuggestionMenuLabel.tsx
+++ b/packages/mantine/src/suggestionMenu/SuggestionMenuLabel.tsx
@@ -1,5 +1,6 @@
import * as Mantine from "@mantine/core";
+import { assertEmpty } from "@blocknote/core";
import { ComponentProps } from "@blocknote/react";
import { forwardRef } from "react";
@@ -7,7 +8,9 @@ export const SuggestionMenuLabel = forwardRef<
HTMLDivElement,
ComponentProps["SuggestionMenu"]["Label"]
>((props, ref) => {
- const { className, children } = props;
+ const { className, children, ...rest } = props;
+
+ assertEmpty(rest);
return (
diff --git a/packages/mantine/src/suggestionMenu/SuggestionMenuLoader.tsx b/packages/mantine/src/suggestionMenu/SuggestionMenuLoader.tsx
index 252a2682db..1d3e7fd99d 100644
--- a/packages/mantine/src/suggestionMenu/SuggestionMenuLoader.tsx
+++ b/packages/mantine/src/suggestionMenu/SuggestionMenuLoader.tsx
@@ -1,5 +1,6 @@
import * as Mantine from "@mantine/core";
+import { assertEmpty } from "@blocknote/core";
import { ComponentProps } from "@blocknote/react";
import { forwardRef } from "react";
@@ -9,8 +10,11 @@ export const SuggestionMenuLoader = forwardRef<
>((props, ref) => {
const {
className,
- // children
+ children, // unused, using "dots" instead
+ ...rest
} = props;
+ assertEmpty(rest);
+
return ;
});
diff --git a/packages/mantine/src/tableHandle/TableHandle.tsx b/packages/mantine/src/tableHandle/TableHandle.tsx
index 08ed50271e..2e172542a7 100644
--- a/packages/mantine/src/tableHandle/TableHandle.tsx
+++ b/packages/mantine/src/tableHandle/TableHandle.tsx
@@ -1,3 +1,4 @@
+import { assertEmpty } from "@blocknote/core";
import { ComponentProps } from "@blocknote/react";
import { forwardRef } from "react";
@@ -12,13 +13,19 @@ export const TableHandle = forwardRef<
onDragStart,
onDragEnd,
style,
+ label,
...rest
} = props;
+ // false, because rest props can be added by mantine when button is used as a trigger
+ // assertEmpty in this case is only used at typescript level, not runtime level
+ assertEmpty(rest, false);
+
return (