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: update typings for node view decorations #3783

Merged
merged 4 commits into from Feb 27, 2023
Merged

Conversation

bdbch
Copy link
Contributor

@bdbch bdbch commented Feb 23, 2023

This PR should close #3772 by adding a new type called DecorationWithType which includes the default Decoration type coming from @tiptap/pm/view but includes the NodeType.

This way people can access the decoration.type property without experiencing typing issues.

@bdbch bdbch self-assigned this Feb 23, 2023
@netlify
Copy link

netlify bot commented Feb 23, 2023

Deploy Preview for tiptap-embed ready!

Name Link
🔨 Latest commit cc22bae
🔍 Latest deploy log https://app.netlify.com/sites/tiptap-embed/deploys/63fcf9fa5f09430008f26300
😎 Deploy Preview https://deploy-preview-3783--tiptap-embed.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Contributor

@svenadlung svenadlung left a comment

Choose a reason for hiding this comment

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

Please check tests:

Error: Webpack Compilation Error
[tsl] ERROR in /home/runner/work/tiptap/tiptap/packages/core/src/NodeView.ts(41,5)
TS2322: Type 'Decoration[]' is not assignable to type 'DecorationWithType[]'.
Type 'Decoration' is not assignable to type 'DecorationWithType'.
Property 'type' is missing in type 'Decoration' but required in type '{ type: NodeType; }'.

@bdbch bdbch merged commit f869507 into main Feb 27, 2023
@bdbch bdbch deleted the fix/decoration-typings branch February 27, 2023 20:23
aliasliao pushed a commit to aliasliao/tiptap that referenced this pull request May 24, 2023
* fix: update typings for node view decorations

* fix(core): update types for NodeView

* fix(core): declare props.decorations as decorationWithType
andrewlu0 pushed a commit to trybaseplate/tiptap that referenced this pull request Oct 20, 2023
* fix: update typings for node view decorations

* fix(core): update types for NodeView

* fix(core): declare props.decorations as decorationWithType
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Decoration Types doesnt match what gets passed for node views
2 participants