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

feat: render custom server emojis on editor #579

Merged
merged 3 commits into from
Dec 27, 2022

Conversation

userquin
Copy link
Member

@userquin userquin commented Dec 27, 2022

It is a custom extension for @tiptap/extension-image (doesn't support set custom attrs on the image).

Added checking custom server emojis stored on local storage when parsing html.

@stackblitz
Copy link

stackblitz bot commented Dec 27, 2022

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@netlify
Copy link

netlify bot commented Dec 27, 2022

Deploy Preview for elk-zone ready!

Name Link
🔨 Latest commit 14a2cc8
🔍 Latest deploy log https://app.netlify.com/sites/elk-zone/deploys/63ab3a7f105304000856de6d
😎 Deploy Preview https://deploy-preview-579--elk-zone.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.

@@ -1,6 +1,7 @@
import type { Emoji } from 'masto'
import type { Node } from 'ultrahtml'
import { TEXT_NODE, parse, render, walkSync } from 'ultrahtml'
import { currentCustomEmojisObject } from '~/composables/emojis'
Copy link
Member

Choose a reason for hiding this comment

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

This moudle should avoid referenceing any runtime logic to keep the function pure.

Copy link
Member Author

@userquin userquin Dec 27, 2022

Choose a reason for hiding this comment

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

ok, I'll move logic to ContentRich.setup.ts module, but the registry will be on each instance...

Copy link
Member

Choose a reason for hiding this comment

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

Under what case this is needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

when we receive custom emojis from another server: check the video on elk editor room

@antfu antfu merged commit 4d21d27 into main Dec 27, 2022
@antfu antfu deleted the userquin/fix-render-custom-emojis-on-editor branch December 27, 2022 18:38
/**
* Add an emoji.
*/
setEmoji: (options: { src: string; alt?: string; title?: string }) => ReturnType
Copy link
Member Author

Choose a reason for hiding this comment

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

should add width, height and data-emoji-id here

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.

2 participants