-
Notifications
You must be signed in to change notification settings - Fork 22
Resolves #159, #158: add custom renderers config for images and texts #161
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
Merged
Fabilin
merged 26 commits into
theopenconversationkit:master
from
Fabilin:159-158-custom-renderers
Apr 26, 2024
Merged
Resolves #159, #158: add custom renderers config for images and texts #161
Fabilin
merged 26 commits into
theopenconversationkit:master
from
Fabilin:159-158-custom-renderers
Apr 26, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- replace Babel with SWC for Storybook - switch to React 17+ JSX transform - enable Emotion "css" prop
This partially reverts commit b910b9c.
# Conflicts: # README.md # package.json # rollup.config.mjs # src/components/Card/Card.tsx # src/components/ChatInput/ChatInput.tsx # src/components/Conversation/Conversation.tsx # src/components/Image/Image.tsx # src/components/QuickReply/QuickReply.tsx # src/components/QuickReply/QuickReplyImage.tsx # src/components/buttons/ButtonList/ButtonList.tsx # yarn.lock
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR's main purpose is to add a highly flexible renderer configuration to the
tock-react-kit, to allow advanced clientside processing of image and text fragments without reimplementing the entire interface.The new features are documented in the README: https://github.com/Fabilin/tock-react-kit/blob/159-158-custom-renderers/README.md#configure-custom-renderers
In order to allow arbitrary image rendering while preserving styling capabilities, this PR starts using the emotion CSS prop for easier style composition. This requires some changes to the build settings, so I took the opportunity to upgrade our tooling. Notably, this PR switches to the new React 17 JSX transform, which improves performance and removes the need for a
Reactimport in every file. I also updated Typescript, and switched Storybook's compiler from Babel to SWC.I also added a new
useMessageMetadatahook, which provides access to the surrounding message's metadata for custom renderers. This allows the renderer to use message-specific extra data sent by the backend.Closes #158
Closes #159