Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: equation input undo regession #3923

Merged
merged 13 commits into from
Dec 27, 2024
5 changes: 5 additions & 0 deletions .changeset/rotten-cobras-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@udecode/plate-math': patch
---

fix: equation input undo history not working.
7 changes: 7 additions & 0 deletions apps/www/content/docs/en/components/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ Use the [CLI](https://platejs.org/docs/components/cli) to install the latest ver

## December 2024 #17

### December 27 #17.7

- `floating-toolbar`: add `inline-equation-toolbar-button`
- `turn-into-dropdown-menu`: Fix: after turn into other block, the editor should regain focus.
- `insert-dropdown-menu`: add `inline equation` and `equation` & fix the focus issue
- `slash-input-element`: add `equation` and `inline equation`

### December 25 #17.6

- `indent-list-toolbar-button`: Remove `IndentListToolbarButton` use `NumberedIndentListToolbarButton` and `BulletedIndentListToolbarButton` instead.
Expand Down
4 changes: 3 additions & 1 deletion apps/www/content/docs/en/equation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ docs:
title: Inline Equation Toolbar Button
---

<ComponentPreview name="equation-demo" />

<PackageInfo>

## Features
Expand Down Expand Up @@ -63,7 +65,7 @@ const components = {

### Plate UI

Work in progress.
Refer to the preview above.

### Plate Plus

Expand Down
1 change: 1 addition & 0 deletions apps/www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
"react-player": "2.16.0",
"react-resizable-panels": "^2.0.22",
"react-syntax-highlighter": "^15.5.0",
"react-textarea-autosize": "^8.5.5",
"react-tweet": "^3.2.1",
"react-wrap-balancer": "^1.1.1",
"remark-emoji": "5.0.1",
Expand Down
61 changes: 61 additions & 0 deletions apps/www/public/r/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,67 @@
],
"type": "registry:ui"
},
{
"dependencies": [
"@udecode/plate-math"
],
"doc": {
"description": "Displays a LaTeX equation element with an editable popover for inputting and rendering mathematical expressions.",
"docs": [
{
"route": "https://platejs.org/docs/equation",
"title": "Equation"
}
],
"examples": [
"equation-demo"
]
},
"files": [
{
"path": "plate-ui/equation-element.tsx",
"type": "registry:ui"
},
{
"path": "plate-ui/equation-popover.tsx",
"type": "registry:ui"
}
],
"name": "equation-element",
"registryDependencies": [
"popover"
],
"type": "registry:ui"
},
{
"dependencies": [
"@udecode/plate-math"
],
"doc": {
"description": "A toolbar button for inserting and editing inline equations.",
"docs": [
{
"route": "https://platejs.org/docs/equation",
"title": "Equation"
}
],
"examples": [
"equation-demo",
"floating-toolbar-demo"
]
},
"files": [
{
"path": "plate-ui/inline-equation-toolbar-button.tsx",
"type": "registry:ui"
}
],
"name": "inline-equation-toolbar-button",
"registryDependencies": [
"toolbar"
],
"type": "registry:ui"
},
{
"dependencies": [
"@udecode/plate-emoji"
Expand Down
4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/ai-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/align-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/autoformat-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/basic-elements-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/basic-marks-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/basic-nodes-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/block-menu-demo.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apps/www/public/r/styles/default/block-selection-demo.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/www/public/r/styles/default/color-dropdown-menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"type": "registry:ui"
},
{
"content": "'use client';\n\nimport React from 'react';\n\nimport { cn, withRef } from '@udecode/cn';\nimport { EraserIcon } from 'lucide-react';\n\nimport {\n type TColor,\n ColorDropdownMenuItems,\n} from './color-dropdown-menu-items';\nimport { ColorCustom } from './colors-custom';\nimport { DropdownMenuGroup, DropdownMenuItem } from './dropdown-menu';\n\nexport const ColorPickerContent = withRef<\n 'div',\n {\n clearColor: () => void;\n colors: TColor[];\n customColors: TColor[];\n updateColor: (color: string) => void;\n updateCustomColor: (color: string) => void;\n color?: string;\n }\n>(\n (\n {\n className,\n clearColor,\n color,\n colors,\n customColors,\n updateColor,\n updateCustomColor,\n ...props\n },\n ref\n ) => {\n return (\n <div ref={ref} className={cn('flex flex-col', className)} {...props}>\n <DropdownMenuGroup label=\"Custom Colors\">\n <ColorCustom\n color={color}\n className=\"px-2\"\n colors={colors}\n customColors={customColors}\n updateColor={updateColor}\n updateCustomColor={updateCustomColor}\n />\n </DropdownMenuGroup>\n <DropdownMenuGroup label=\"Default Colors\">\n <ColorDropdownMenuItems\n color={color}\n className=\"px-2\"\n colors={colors}\n updateColor={updateColor}\n />\n </DropdownMenuGroup>\n {color && (\n <DropdownMenuGroup>\n <DropdownMenuItem className=\"p-2\" onClick={clearColor}>\n <EraserIcon />\n <span>Clear</span>\n </DropdownMenuItem>\n </DropdownMenuGroup>\n )}\n </div>\n );\n }\n);\n\nexport const ColorPicker = React.memo(\n ColorPickerContent,\n (prev, next) =>\n prev.color === next.color &&\n prev.colors === next.colors &&\n prev.customColors === next.customColors\n);\n",
"content": "'use client';\n\nimport React from 'react';\n\nimport { cn, withRef } from '@udecode/cn';\nimport { EraserIcon } from 'lucide-react';\n\nimport {\n type TColor,\n ColorDropdownMenuItems,\n} from './color-dropdown-menu-items';\nimport { ColorCustom } from './colors-custom';\nimport {\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n} from './dropdown-menu';\n\nexport const ColorPickerContent = withRef<\n 'div',\n {\n clearColor: () => void;\n colors: TColor[];\n customColors: TColor[];\n updateColor: (color: string) => void;\n updateCustomColor: (color: string) => void;\n color?: string;\n }\n>(\n (\n {\n className,\n clearColor,\n color,\n colors,\n customColors,\n updateColor,\n updateCustomColor,\n ...props\n },\n ref\n ) => {\n return (\n <div ref={ref} className={cn('flex flex-col', className)} {...props}>\n <DropdownMenuGroup>\n <DropdownMenuLabel>Custom Colors</DropdownMenuLabel>\n <ColorCustom\n color={color}\n className=\"px-2\"\n colors={colors}\n customColors={customColors}\n updateColor={updateColor}\n updateCustomColor={updateCustomColor}\n />\n </DropdownMenuGroup>\n <DropdownMenuGroup>\n <DropdownMenuLabel>Default Colors</DropdownMenuLabel>\n <ColorDropdownMenuItems\n color={color}\n className=\"px-2\"\n colors={colors}\n updateColor={updateColor}\n />\n </DropdownMenuGroup>\n {color && (\n <DropdownMenuGroup>\n <DropdownMenuItem className=\"p-2\" onClick={clearColor}>\n <EraserIcon />\n <span>Clear</span>\n </DropdownMenuItem>\n </DropdownMenuGroup>\n )}\n </div>\n );\n }\n);\n\nexport const ColorPicker = React.memo(\n ColorPickerContent,\n (prev, next) =>\n prev.color === next.color &&\n prev.colors === next.colors &&\n prev.customColors === next.customColors\n);\n",
"path": "plate-ui/color-picker.tsx",
"target": "components/plate-ui/color-picker.tsx",
"type": "registry:ui"
Expand Down
Loading
Loading