diff --git a/apps/www/content/docs/components/changelog.mdx b/apps/www/content/docs/components/changelog.mdx index d14974e2aa..d56099a7c9 100644 --- a/apps/www/content/docs/components/changelog.mdx +++ b/apps/www/content/docs/components/changelog.mdx @@ -10,6 +10,10 @@ Use the [CLI](https://platejs.org/docs/components/cli) to install the latest ver ## July 2024 #12 +### July 30 #12.3 + +- **MoreDropdownMenu**: Fixed the toggling behavior for Superscript and Subscript marks. + ### July 14 #12.2 - fix `cursor`: Show selection rect/caret if cursor data is undefined. @@ -132,6 +136,7 @@ export const TableElement = withHOC( - import `withProps` from `@udecode/cn` instead of `@udecode/plate-common ` + - all components using `forwardRef` are now using `withRef`. `withProps`, `withCn` and `withVariants` are also used to reduce boilerplate. - add `withCn` to ESLint `settings.tailwindcss.callees` and `classAttributes` in your IDE settings diff --git a/apps/www/src/components/plate-ui/playground-more-dropdown-menu.tsx b/apps/www/src/components/plate-ui/playground-more-dropdown-menu.tsx index ece1669f6a..ea686c43d5 100644 --- a/apps/www/src/components/plate-ui/playground-more-dropdown-menu.tsx +++ b/apps/www/src/components/plate-ui/playground-more-dropdown-menu.tsx @@ -67,7 +67,7 @@ export function PlaygroundMoreDropdownMenu(props: DropdownMenuProps) { { toggleMark(editor, { - clear: MARK_SUBSCRIPT, + clear: [MARK_SUBSCRIPT, MARK_SUPERSCRIPT], key: MARK_SUPERSCRIPT, }); focusEditor(editor); @@ -80,7 +80,7 @@ export function PlaygroundMoreDropdownMenu(props: DropdownMenuProps) { { toggleMark(editor, { - clear: MARK_SUPERSCRIPT, + clear: [MARK_SUPERSCRIPT, MARK_SUBSCRIPT], key: MARK_SUBSCRIPT, }); focusEditor(editor); diff --git a/apps/www/src/registry/default/plate-ui/more-dropdown-menu.tsx b/apps/www/src/registry/default/plate-ui/more-dropdown-menu.tsx index 1aef721eb3..1ba3af0c1b 100644 --- a/apps/www/src/registry/default/plate-ui/more-dropdown-menu.tsx +++ b/apps/www/src/registry/default/plate-ui/more-dropdown-menu.tsx @@ -35,8 +35,8 @@ export function MoreDropdownMenu(props: DropdownMenuProps) { { toggleMark(editor, { - clear: MARK_SUPERSCRIPT, - key: MARK_SUBSCRIPT, + clear: [MARK_SUBSCRIPT, MARK_SUPERSCRIPT], + key: MARK_SUPERSCRIPT, }); focusEditor(editor); }} @@ -48,8 +48,8 @@ export function MoreDropdownMenu(props: DropdownMenuProps) { { toggleMark(editor, { - clear: MARK_SUBSCRIPT, - key: MARK_SUPERSCRIPT, + clear: [MARK_SUPERSCRIPT, MARK_SUBSCRIPT], + key: MARK_SUBSCRIPT, }); focusEditor(editor); }} diff --git a/packages/selection/src/queries/index.ts b/packages/selection/src/queries/index.ts index 1372569caf..867c9bd8b8 100644 --- a/packages/selection/src/queries/index.ts +++ b/packages/selection/src/queries/index.ts @@ -3,4 +3,4 @@ */ export * from './getSelectedBlocks'; -export * from "./isNodeBlockSelected"; +export * from './isNodeBlockSelected'; diff --git a/templates/plate-playground-template/src/components/plate-ui/more-dropdown-menu.tsx b/templates/plate-playground-template/src/components/plate-ui/more-dropdown-menu.tsx index 78729ac458..6c14ad527a 100644 --- a/templates/plate-playground-template/src/components/plate-ui/more-dropdown-menu.tsx +++ b/templates/plate-playground-template/src/components/plate-ui/more-dropdown-menu.tsx @@ -33,8 +33,8 @@ export function MoreDropdownMenu(props: DropdownMenuProps) { { toggleMark(editor, { - key: MARK_SUBSCRIPT, - clear: MARK_SUPERSCRIPT, + clear: [MARK_SUBSCRIPT, MARK_SUPERSCRIPT], + key: MARK_SUPERSCRIPT, }); focusEditor(editor); }} @@ -46,8 +46,8 @@ export function MoreDropdownMenu(props: DropdownMenuProps) { { toggleMark(editor, { - key: MARK_SUPERSCRIPT, - clear: MARK_SUBSCRIPT, + clear: [MARK_SUPERSCRIPT, MARK_SUBSCRIPT], + key: MARK_SUBSCRIPT, }); focusEditor(editor); }}