- Default Colors
+
+>(({ label, ...props }, ref) => {
+ return (
+ <>
+
+
+
+ {label && {label}}
+ {props.children}
+
+ >
+ );
+});
export const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
diff --git a/apps/www/src/registry/default/plate-ui/insert-dropdown-menu.tsx b/apps/www/src/registry/default/plate-ui/insert-dropdown-menu.tsx
index c629858e4f..11dc5499d5 100644
--- a/apps/www/src/registry/default/plate-ui/insert-dropdown-menu.tsx
+++ b/apps/www/src/registry/default/plate-ui/insert-dropdown-menu.tsx
@@ -59,9 +59,7 @@ import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuGroup,
- DropdownMenuPortal,
- DropdownMenuRadioGroup,
- DropdownMenuRadioItem,
+ DropdownMenuItem,
DropdownMenuTrigger,
useOpenState,
} from './dropdown-menu';
@@ -253,44 +251,28 @@ export function InsertDropdownMenu(props: DropdownMenuProps) {
-
-
-
- {groups.map(({ group, items: nestedItems }) => (
-
- {
- const item = nestedItems.find((i) => i.value === value);
-
- if (item) {
- const { focusEditor: isFocusEditor = true, onSelect } =
- item;
-
- onSelect(editor, value);
- isFocusEditor && focusEditor(editor);
- }
- }}
- label={group}
- >
- {nestedItems.map(({ icon, label, value }) => (
-
- {icon}
- {label}
-
- ))}
-
-
+
+ {groups.map(({ group, items: nestedItems }) => (
+
+ {nestedItems.map(({ icon, label, value, onSelect }) => (
+ {
+ onSelect(editor, value);
+ focusEditor(editor);
+ }}
+ >
+ {icon}
+ {label}
+
))}
-
-
-
+
+ ))}
+
);
}
diff --git a/apps/www/src/registry/default/plate-ui/turn-into-dropdown-menu.tsx b/apps/www/src/registry/default/plate-ui/turn-into-dropdown-menu.tsx
index 2d4117cdad..f9d42791ed 100644
--- a/apps/www/src/registry/default/plate-ui/turn-into-dropdown-menu.tsx
+++ b/apps/www/src/registry/default/plate-ui/turn-into-dropdown-menu.tsx
@@ -38,8 +38,6 @@ import {
import {
DropdownMenu,
DropdownMenuContent,
- DropdownMenuGroup,
- DropdownMenuPortal,
DropdownMenuRadioGroup,
DropdownMenuRadioItem,
DropdownMenuTrigger,
@@ -140,36 +138,33 @@ export function TurnIntoDropdownMenu(props: DropdownMenuProps) {
-
-
-
-
- {
- setBlockType(editor, type);
- focusEditor(editor);
- }}
- label="Turn into"
- >
- {turnIntoItems.map(({ icon, label, value: itemValue }) => (
-
- {icon}
- {label}
-
- ))}
-
-
-
-
-
+ {
+ e.preventDefault();
+ focusEditor(editor);
+ }}
+ align="start"
+ >
+ {
+ setBlockType(editor, type);
+ }}
+ label="Turn into"
+ >
+ {turnIntoItems.map(({ icon, label, value: itemValue }) => (
+
+ {icon}
+ {label}
+
+ ))}
+
+
);
}
diff --git a/templates/plate-playground-template/package.json b/templates/plate-playground-template/package.json
index 350577a949..fe9e13e41f 100644
--- a/templates/plate-playground-template/package.json
+++ b/templates/plate-playground-template/package.json
@@ -61,7 +61,7 @@
"@udecode/plate-line-height": "41.0.0",
"@udecode/plate-link": "41.0.0",
"@udecode/plate-markdown": "41.0.0",
- "@udecode/plate-math": "41.0.4",
+ "@udecode/plate-math": "41.0.11",
"@udecode/plate-media": "41.0.0",
"@udecode/plate-mention": "41.0.0",
"@udecode/plate-node-id": "41.0.0",
@@ -75,7 +75,6 @@
"@udecode/plate-toggle": "41.0.0",
"@udecode/plate-trailing-block": "41.0.0",
"@uploadthing/react": "7.1.0",
- "react-textarea-autosize": "^8.5.5",
"ai": "^4.0.21",
"class-variance-authority": "0.7.1",
"clsx": "^2.1.1",
@@ -94,6 +93,7 @@
"react-lite-youtube-embed": "^2.4.0",
"react-player": "^2.16.0",
"react-resizable-panels": "^2.1.7",
+ "react-textarea-autosize": "^8.5.6",
"react-tweet": "^3.2.1",
"slate": "^0.112.0",
"slate-dom": "^0.111.0",
diff --git a/templates/plate-playground-template/pnpm-lock.yaml b/templates/plate-playground-template/pnpm-lock.yaml
index 1a8ce2f9c3..ba579231ef 100644
--- a/templates/plate-playground-template/pnpm-lock.yaml
+++ b/templates/plate-playground-template/pnpm-lock.yaml
@@ -153,8 +153,8 @@ importers:
specifier: 41.0.0
version: 41.0.0(@udecode/plate-common@41.0.5(@types/react@18.3.12)(immer@10.1.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(scheduler@0.25.0)(slate-dom@0.111.0(slate@0.112.0))(slate-history@0.110.3(slate@0.112.0))(slate-hyperscript@0.100.0(slate@0.112.0))(slate-react@0.112.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-dom@0.111.0(slate@0.112.0))(slate@0.112.0))(slate@0.112.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-dom@0.111.0(slate@0.112.0))(slate-history@0.110.3(slate@0.112.0))(slate-hyperscript@0.100.0(slate@0.112.0))(slate-react@0.112.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-dom@0.111.0(slate@0.112.0))(slate@0.112.0))(slate@0.112.0)
'@udecode/plate-math':
- specifier: 41.0.4
- version: 41.0.4(@udecode/plate-common@41.0.5(@types/react@18.3.12)(immer@10.1.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(scheduler@0.25.0)(slate-dom@0.111.0(slate@0.112.0))(slate-history@0.110.3(slate@0.112.0))(slate-hyperscript@0.100.0(slate@0.112.0))(slate-react@0.112.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-dom@0.111.0(slate@0.112.0))(slate@0.112.0))(slate@0.112.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-dom@0.111.0(slate@0.112.0))(slate-history@0.110.3(slate@0.112.0))(slate-hyperscript@0.100.0(slate@0.112.0))(slate-react@0.112.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-dom@0.111.0(slate@0.112.0))(slate@0.112.0))(slate@0.112.0)
+ specifier: 41.0.11
+ version: 41.0.11(@udecode/plate-common@41.0.5(@types/react@18.3.12)(immer@10.1.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(scheduler@0.25.0)(slate-dom@0.111.0(slate@0.112.0))(slate-history@0.110.3(slate@0.112.0))(slate-hyperscript@0.100.0(slate@0.112.0))(slate-react@0.112.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-dom@0.111.0(slate@0.112.0))(slate@0.112.0))(slate@0.112.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-dom@0.111.0(slate@0.112.0))(slate-history@0.110.3(slate@0.112.0))(slate-hyperscript@0.100.0(slate@0.112.0))(slate-react@0.112.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-dom@0.111.0(slate@0.112.0))(slate@0.112.0))(slate@0.112.0)
'@udecode/plate-media':
specifier: 41.0.0
version: 41.0.0(@udecode/plate-common@41.0.5(@types/react@18.3.12)(immer@10.1.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(scheduler@0.25.0)(slate-dom@0.111.0(slate@0.112.0))(slate-history@0.110.3(slate@0.112.0))(slate-hyperscript@0.100.0(slate@0.112.0))(slate-react@0.112.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-dom@0.111.0(slate@0.112.0))(slate@0.112.0))(slate@0.112.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-dom@0.111.0(slate@0.112.0))(slate-history@0.110.3(slate@0.112.0))(slate-hyperscript@0.100.0(slate@0.112.0))(slate-react@0.112.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-dom@0.111.0(slate@0.112.0))(slate@0.112.0))(slate@0.112.0)
@@ -249,7 +249,7 @@ importers:
specifier: ^2.1.7
version: 2.1.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
react-textarea-autosize:
- specifier: ^8.5.5
+ specifier: ^8.5.6
version: 8.5.6(@types/react@18.3.12)(react@18.3.1)
react-tweet:
specifier: ^3.2.1
@@ -1871,10 +1871,10 @@ packages:
slate-hyperscript: '>=0.66.0'
slate-react: '>=0.111.0'
- '@udecode/plate-math@41.0.4':
- resolution: {integrity: sha512-VSrUaQFkE5A5WjaHYZL01B9wP6xLaFhXvq1EQg1nChx9ueC40RixSdQTgSk1zzODh3pJYvf5kMb035n5lMY+PQ==}
+ '@udecode/plate-math@41.0.11':
+ resolution: {integrity: sha512-X2zAlskM9evdZTe0I6INPBBbHR+ED5WsR0fu2JaQYNAAr33RBsogl+aftQkC7u+TaZ12cJ5lF6iMW+zLSeg5pQ==}
peerDependencies:
- '@udecode/plate-common': '>=41.0.2'
+ '@udecode/plate-common': '>=41.0.5'
react: '>=16.8.0'
react-dom: '>=16.8.0'
slate: '>=0.112.0'
@@ -6134,7 +6134,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
- '@udecode/plate-math@41.0.4(@udecode/plate-common@41.0.5(@types/react@18.3.12)(immer@10.1.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(scheduler@0.25.0)(slate-dom@0.111.0(slate@0.112.0))(slate-history@0.110.3(slate@0.112.0))(slate-hyperscript@0.100.0(slate@0.112.0))(slate-react@0.112.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-dom@0.111.0(slate@0.112.0))(slate@0.112.0))(slate@0.112.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-dom@0.111.0(slate@0.112.0))(slate-history@0.110.3(slate@0.112.0))(slate-hyperscript@0.100.0(slate@0.112.0))(slate-react@0.112.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-dom@0.111.0(slate@0.112.0))(slate@0.112.0))(slate@0.112.0)':
+ '@udecode/plate-math@41.0.11(@udecode/plate-common@41.0.5(@types/react@18.3.12)(immer@10.1.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(scheduler@0.25.0)(slate-dom@0.111.0(slate@0.112.0))(slate-history@0.110.3(slate@0.112.0))(slate-hyperscript@0.100.0(slate@0.112.0))(slate-react@0.112.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-dom@0.111.0(slate@0.112.0))(slate@0.112.0))(slate@0.112.0))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-dom@0.111.0(slate@0.112.0))(slate-history@0.110.3(slate@0.112.0))(slate-hyperscript@0.100.0(slate@0.112.0))(slate-react@0.112.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-dom@0.111.0(slate@0.112.0))(slate@0.112.0))(slate@0.112.0)':
dependencies:
'@udecode/plate-common': 41.0.5(@types/react@18.3.12)(immer@10.1.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(scheduler@0.25.0)(slate-dom@0.111.0(slate@0.112.0))(slate-history@0.110.3(slate@0.112.0))(slate-hyperscript@0.100.0(slate@0.112.0))(slate-react@0.112.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(slate-dom@0.111.0(slate@0.112.0))(slate@0.112.0))(slate@0.112.0)
katex: 0.16.11
diff --git a/templates/plate-playground-template/src/components/editor/plugins/equation-plugins.ts b/templates/plate-playground-template/src/components/editor/plugins/equation-plugins.ts
index 70f9c06067..008ccbbeb2 100644
--- a/templates/plate-playground-template/src/components/editor/plugins/equation-plugins.ts
+++ b/templates/plate-playground-template/src/components/editor/plugins/equation-plugins.ts
@@ -1,3 +1,4 @@
+'use client';
import {
EquationPlugin,
InlineEquationPlugin,
diff --git a/templates/plate-playground-template/src/components/plate-ui/color-picker.tsx b/templates/plate-playground-template/src/components/plate-ui/color-picker.tsx
index 45eea1a651..e51c8dc533 100644
--- a/templates/plate-playground-template/src/components/plate-ui/color-picker.tsx
+++ b/templates/plate-playground-template/src/components/plate-ui/color-picker.tsx
@@ -10,11 +10,7 @@ import {
ColorDropdownMenuItems,
} from './color-dropdown-menu-items';
import { ColorCustom } from './colors-custom';
-import {
- DropdownMenuGroup,
- DropdownMenuItem,
- DropdownMenuLabel,
-} from './dropdown-menu';
+import { DropdownMenuGroup, DropdownMenuItem } from './dropdown-menu';
export const ColorPickerContent = withRef<
'div',
@@ -42,8 +38,7 @@ export const ColorPickerContent = withRef<
) => {
return (
-
- Custom Colors
+
-
- Default Colors
+
+>(({ label, ...props }, ref) => {
+ return (
+ <>
+
+
+
+ {label && {label}}
+ {props.children}
+
+ >
+ );
+});
export const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
diff --git a/templates/plate-playground-template/src/components/plate-ui/insert-dropdown-menu.tsx b/templates/plate-playground-template/src/components/plate-ui/insert-dropdown-menu.tsx
index 391c349065..b53ca0a4eb 100644
--- a/templates/plate-playground-template/src/components/plate-ui/insert-dropdown-menu.tsx
+++ b/templates/plate-playground-template/src/components/plate-ui/insert-dropdown-menu.tsx
@@ -19,10 +19,6 @@ import { TocPlugin } from '@udecode/plate-heading/react';
import { HorizontalRulePlugin } from '@udecode/plate-horizontal-rule/react';
import { INDENT_LIST_KEYS, ListStyleType } from '@udecode/plate-indent-list';
import { LinkPlugin } from '@udecode/plate-link/react';
-import {
- EquationPlugin,
- InlineEquationPlugin,
-} from '@udecode/plate-math/react';
import { ImagePlugin, MediaEmbedPlugin } from '@udecode/plate-media/react';
import { TablePlugin } from '@udecode/plate-table/react';
import { TogglePlugin } from '@udecode/plate-toggle/react';
@@ -44,7 +40,6 @@ import {
PilcrowIcon,
PlusIcon,
QuoteIcon,
- RadicalIcon,
SquareIcon,
TableIcon,
TableOfContentsIcon,
@@ -59,9 +54,7 @@ import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuGroup,
- DropdownMenuPortal,
- DropdownMenuRadioGroup,
- DropdownMenuRadioItem,
+ DropdownMenuItem,
DropdownMenuTrigger,
useOpenState,
} from './dropdown-menu';
@@ -199,12 +192,12 @@ const groups: Group[] = [
label: '3 columns',
value: 'action_three_columns',
},
- {
- focusEditor: false,
- icon: ,
- label: 'Equation',
- value: EquationPlugin.key,
- },
+ // {
+ // focusEditor: false,
+ // icon: ,
+ // label: 'Equation',
+ // value: EquationPlugin.key,
+ // },
].map((item) => ({
...item,
onSelect: (editor, value) => {
@@ -226,12 +219,12 @@ const groups: Group[] = [
label: 'Date',
value: DatePlugin.key,
},
- {
- focusEditor: false,
- icon: ,
- label: 'Inline Equation',
- value: InlineEquationPlugin.key,
- },
+ // {
+ // focusEditor: false,
+ // icon: ,
+ // label: 'Inline Equation',
+ // value: InlineEquationPlugin.key,
+ // },
].map((item) => ({
...item,
onSelect: (editor, value) => {
@@ -253,44 +246,28 @@ export function InsertDropdownMenu(props: DropdownMenuProps) {
-
-
-
- {groups.map(({ group, items: nestedItems }) => (
-
- {
- const item = nestedItems.find((i) => i.value === value);
-
- if (item) {
- const { focusEditor: isFocusEditor = true, onSelect } =
- item;
-
- onSelect(editor, value);
- isFocusEditor && focusEditor(editor);
- }
- }}
- label={group}
- >
- {nestedItems.map(({ icon, label, value }) => (
-
- {icon}
- {label}
-
- ))}
-
-
+
+ {groups.map(({ group, items: nestedItems }) => (
+
+ {nestedItems.map(({ icon, label, value, onSelect }) => (
+ {
+ onSelect(editor, value);
+ focusEditor(editor);
+ }}
+ >
+ {icon}
+ {label}
+
))}
-
-
-
+
+ ))}
+
);
}
diff --git a/templates/plate-playground-template/src/components/plate-ui/turn-into-dropdown-menu.tsx b/templates/plate-playground-template/src/components/plate-ui/turn-into-dropdown-menu.tsx
index 090d34a7f1..8bf34187d9 100644
--- a/templates/plate-playground-template/src/components/plate-ui/turn-into-dropdown-menu.tsx
+++ b/templates/plate-playground-template/src/components/plate-ui/turn-into-dropdown-menu.tsx
@@ -38,8 +38,6 @@ import {
import {
DropdownMenu,
DropdownMenuContent,
- DropdownMenuGroup,
- DropdownMenuPortal,
DropdownMenuRadioGroup,
DropdownMenuRadioItem,
DropdownMenuTrigger,
@@ -140,36 +138,33 @@ export function TurnIntoDropdownMenu(props: DropdownMenuProps) {
-
-
-
-
- {
- setBlockType(editor, type);
- focusEditor(editor);
- }}
- label="Turn into"
- >
- {turnIntoItems.map(({ icon, label, value: itemValue }) => (
-
- {icon}
- {label}
-
- ))}
-
-
-
-
-
+ {
+ e.preventDefault();
+ focusEditor(editor);
+ }}
+ align="start"
+ >
+ {
+ setBlockType(editor, type);
+ }}
+ label="Turn into"
+ >
+ {turnIntoItems.map(({ icon, label, value: itemValue }) => (
+
+ {icon}
+ {label}
+
+ ))}
+
+
);
}