-
Notifications
You must be signed in to change notification settings - Fork 23
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
KDS-1416 Migrate RTE & Co #4255
Conversation
🦋 Changeset detectedLatest commit: b275bcf The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just left a few comments some stories, more around uplift and things we could improve the docs later but the migration looks hunky dory to me so giving this a ✅
<Canvas of={RichTextEditorStories.DefaultValue} /> | ||
|
||
#### Malformed Content | ||
If your default value does not conform correctly, the RTE will throw an error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also callout the onDataError
callback that's available to consumers if they want to catch and handle malformed data
|
||
type Story = StoryObj<typeof meta> | ||
|
||
export const Playground: Story = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential improvement later is to add a drop down for controls
to let our consumer add items to the toolbar in the playground story
parameters: { | ||
docs: { | ||
canvas: { | ||
sourceState: "shown", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One call out that Dale mentioned a while back was that when he first used the RTE, it was that it wasn't clear to him that handleOnChange
would need to setter with editorState.toJSON().doc.content
.
Something we could either document later or expose in the source code of the canvas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can do a hardcode here again 👍
|
||
## API | ||
|
||
<DocsStory of={RichTextEditorStories.Controls} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to circle back later and add more to this in terms of current controls available and how to handle grouping
Might pause this and wait for the RTT to be migrated first, then we won't be shipping a massive RTE and the peer dep wouldn't be necessary |
Why
Migrate RichTextEditor, RichTextContent, EditableRichTextContent from
kaizen-legacy
Notes
@cultureamp/rich-text-toolkit
added as an optional Peer Dep, meaning consumers can choose not to install the package if they do not use RTE. This does break the circular dependency as we are no longer trying to bundle RTT, however Ideally we would want to move towards removing this peer dep altogether.