Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zbeyens committed Oct 13, 2021
1 parent ebfe871 commit 7ee2135
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 9 deletions.
22 changes: 22 additions & 0 deletions .changeset/core-minor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
'@udecode/plate-core': minor
---

feat:
- `PlatePlugin`
- new field: `overrideProps`
- used by
- Overrides rendered node props (shallow merge).
- This enables controlling the props of any node component (use cases: indent, align,...).
- new dependency: `clsx`
- new types:
- `OverrideProps`
- `PlatePluginEditor`
- `PlatePluginSerialize`
- `PlatePluginNode`
- `PlatePluginElement`
- `PlatePluginLeaf`
- `getRenderElement` and `getRenderLeaf`:
- plugins `overrideProps` are used to override the props
- `getRenderNodeProps`:
- computes slate class and `nodeProps`
5 changes: 5 additions & 0 deletions .changeset/indent-minor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@udecode/plate-indent': minor
---

new package
11 changes: 3 additions & 8 deletions docs/src/live/config/Toolbars.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ import { ELEMENT_CODE_BLOCK } from '@udecode/plate-code-block';
import { ToolbarCodeBlock } from '@udecode/plate-code-block-ui';
import { useEventEditorId } from '@udecode/plate-core';
import { MARK_HIGHLIGHT } from '@udecode/plate-highlight';
import { getPreventDefaultHandler } from '../../../../packages/common/src/utils/getPreventDefaultHandler';

export const ToolbarButtonsBasicElements = () => {
const editor = useStoreEditorRef(useEventEditorId('focus'));
Expand Down Expand Up @@ -124,17 +125,11 @@ export const ToolbarButtonsIndent = () => {
return (
<>
<ToolbarButton
onMouseDown={(e) => {
e.preventDefault();
outdent(editor);
}}
onMouseDown={editor && getPreventDefaultHandler(outdent, editor)}
icon={<FormatIndentDecrease />}
/>
<ToolbarButton
onMouseDown={(e) => {
e.preventDefault();
indent(editor);
}}
onMouseDown={editor && getPreventDefaultHandler(indent, editor)}
icon={<FormatIndentIncrease />}
/>
</>
Expand Down
2 changes: 1 addition & 1 deletion packages/select/src/createSelectOnBackspacePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const withSelectOnBackspace = (
});
if (prevNode) {
const [prevCell] = Editor.nodes<TNode>(editor, {
match: (node) => queryNode([node, prevNode.path], query),
match: (node) => queryNode([node as TNode, prevNode.path], query),
at: prevNode,
});

Expand Down

0 comments on commit 7ee2135

Please sign in to comment.