-
Notifications
You must be signed in to change notification settings - Fork 350
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
[NOT READY FOR REVIEW!!] Introduce EditorWithLayout #1257
base: main
Are you sure you want to change the base?
Conversation
Size Change: -402 B (0%) Total Size: 835 kB
ℹ️ View Unchanged
|
GeraldRequired Reviewers
Don't want to be involved in this pull request? Comment |
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (c5eb659) and published it to npm. You Example: yarn add @khanacademy/perseus@PR1257 If you are working in Khan Academy's webapp, you can run: ./dev/tools/bump_perseus_version.sh -t PR1257 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1257 +/- ##
==========================================
+ Coverage 68.75% 70.23% +1.48%
==========================================
Files 468 477 +9
Lines 100702 101506 +804
Branches 7141 10271 +3130
==========================================
+ Hits 69233 71289 +2056
+ Misses 31354 30217 -1137
+ Partials 115 0 -115
... and 151 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
THIS PR IS NOT IN DRAFT STATE BECAUSE I WANTED AN NPM SNAPSHOT.
!!NOT READY FOR REVIEWING YET!!
Summary:
This PR introduces a new Perseus Editor component that allows the host to control layout of individual editor pieces. It does this by using a callback function for the
children
prop. This is a similar approach to how theMultiRenderer
works today.The associated Story for the
EditrorWithLayout
component provides an example of placing each piece of the editor wherever is needed.What's next?
This PR can be thought of as a proof-of-concept for how this could be built. There are components that are nested inside other, high-level components (such as inside the
Editor
) that would need to be raised up to theEditorWithLayout
so that they can be exposed individually.The preview component
IframeContentRenderer
is also likely to be problematic as it uses an iframe that is typically pointed at production webapp. The LEMS team has ticket https://khanacademy.atlassian.net/browse/LEMS-1809 to fix this, but it is not on our near-term roadmap. We could adjust that if necessary.Issue: LEMS-1972
Test plan:
yarn
yarn start
Navigate to http://localhost:6006/?path=/story/perseuseditor-editorwithlayout--controlled and test things out.
Open
packages/perseus-editor/src/__stories__/editor-with-layout.stories.tsx
and move things around and note that the layout can be adjusted without making any changes to theEditorWithLayout
component.