Skip to content

Commit

Permalink
refactor(portable-text-editor): change plugin callstack
Browse files Browse the repository at this point in the history
The order was called in the reverse order of the order intended
  • Loading branch information
skogsmaskin committed Mar 24, 2022
1 parent a4941ea commit 304964b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export const PortableTextEditable = forwardRef(function PortableTextEditable(
)

// Update the Slate instance's plugins which are dependent on props for Editable
useMemo(() => withHotKeys(withInsertData(withEditableAPI(withReact(slateEditor)))), [
useMemo(() => withReact(withEditableAPI(withInsertData(withHotKeys(slateEditor)))), [
slateEditor,
withEditableAPI,
withHotKeys,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,12 @@ export const withPortableText = <T extends Editor>(
const withPortableTextSelections = createWithPortableTextSelections(change$)

// Ordering is important here, selection dealing last, data manipulation in the middle and core model stuff first.
return withPortableTextSelections(
withPatches(
withUndoRedo(
withMaxBlocks(
withUtils(
withPortableTextLists(
withPortableTextBlockStyle(
withPortableTextMarkModel(withObjectKeys(withSchemaTypes(e)))
)
)
return withSchemaTypes(
withObjectKeys(
withPortableTextMarkModel(
withPortableTextBlockStyle(
withPortableTextLists(
withUtils(withMaxBlocks(withUndoRedo(withPatches(withPortableTextSelections(e)))))
)
)
)
Expand Down

3 comments on commit 304964b

@vercel
Copy link

@vercel vercel bot commented on 304964b Mar 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

studio-workshop – ./dev/workshop

studio-workshop.sanity.build
studio-workshop-git-next.sanity.build

@vercel
Copy link

@vercel vercel bot commented on 304964b Mar 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

test-studio – ./

test-studio-git-next.sanity.build
test-studio.sanity.build

@vercel
Copy link

@vercel vercel bot commented on 304964b Mar 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

perf-studio – ./

perf-studio.sanity.build
perf-studio-git-next.sanity.build

Please sign in to comment.