-
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
Enable parsePerseusItem to handle all published Perseus content #2082
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
e4d0aae
Use discriminated union instead of union for locked figures parser
benchristel be7f550
Default LockedLine.showPoint1 and showPoint2 to false
benchristel f6ae4f9
Allow null coords in grapher widget
benchristel ac099af
Refactor and fix type errors
benchristel 3de38ed
Improve parse failure message when widget ID is invalid
benchristel d9d536f
Handle Interaction elements with missing keys
benchristel 11a458b
Inline single-use constants
benchristel 6bf445e
Fix lint
benchristel b4e6140
Remove PerseusCSProgramWidgetOptions.width
benchristel 36cf207
Default snapsPerLine and scaleY when parsing Plotter widgets
benchristel 86653d3
Default measurer image
benchristel 97adbcf
Default iframe allowFullScreen to false
benchristel 81722b0
Update snapshots
benchristel 7176268
Make iframe widget settings optional
benchristel cd0765a
docs(changeset): Internal: Enable parsePerseusItem to handle all publ…
benchristel 7a1cf04
Rename 'widget key' concept to 'widget ID'
benchristel d97eda5
Fix lint
benchristel 681b079
Include perseus-core in changeset
benchristel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@khanacademy/perseus": minor | ||
"@khanacademy/perseus-core": minor | ||
--- | ||
|
||
Enable parsePerseusItem to parse all published content, upgrading old formats to the current one. |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,14 @@ import type {MeasurerWidget} from "@khanacademy/perseus-core"; | |
export const parseMeasurerWidget: Parser<MeasurerWidget> = parseWidget( | ||
constant("measurer"), | ||
object({ | ||
image: parsePerseusImageBackground, | ||
// The default value for image comes from measurer.tsx. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for adding these comments in! I think they'll be really helpful going forward. |
||
// See parse-perseus-json/README.md for why we want to duplicate the | ||
// defaults here. | ||
image: defaulted(parsePerseusImageBackground, () => ({ | ||
url: null, | ||
top: 0, | ||
left: 0, | ||
})), | ||
showProtractor: boolean, | ||
showRuler: boolean, | ||
rulerLabel: string, | ||
|
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
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 previously thought we could default
coords
here, but thought better of it. This default isn't appropriate if the graph's X and Y ranges aren't the defaults ([-10, 10]).