-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move default editor props for NumberLine (#2147)
## Summary: This one is a little tricky because it's called `showTooltip` in the data schema but was called `showTooltips` in the editor. I think it was a bug? So I tried to strengthen the types a little. Issue: LEMS-2737 ## Test plan: NumberLine should continue to be editable and the widgets the editor makes should be rendered correctly. Author: handeyeco Reviewers: handeyeco, jeremywiebe Required Reviewers: Approved By: jeremywiebe Checks: ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x) Pull Request URL: #2147
- Loading branch information
Showing
7 changed files
with
80 additions
and
43 deletions.
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-core": minor | ||
"@khanacademy/perseus-editor": patch | ||
--- | ||
|
||
Move upgrade logic for NumberLine to Perseus Core |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import type {PerseusNumberLineWidgetOptions} from "../../data-schema"; | ||
import type {WidgetLogic} from "../logic-export.types"; | ||
|
||
export type NumberLineDefaultWidgetOptions = Pick< | ||
PerseusNumberLineWidgetOptions, | ||
| "range" | ||
| "labelRange" | ||
| "labelStyle" | ||
| "labelTicks" | ||
| "divisionRange" | ||
| "numDivisions" | ||
| "snapDivisions" | ||
| "tickStep" | ||
| "correctRel" | ||
| "correctX" | ||
| "initialX" | ||
| "showTooltips" | ||
>; | ||
|
||
const defaultWidgetOptions: NumberLineDefaultWidgetOptions = { | ||
range: [0, 10], | ||
|
||
labelRange: [null, null], | ||
labelStyle: "decimal", | ||
labelTicks: true, | ||
|
||
divisionRange: [1, 12], | ||
numDivisions: 5, | ||
snapDivisions: 2, | ||
|
||
tickStep: null, | ||
correctRel: "eq", | ||
correctX: null, | ||
initialX: null, | ||
|
||
showTooltips: false, | ||
}; | ||
|
||
const numberLineWidgetLogic: WidgetLogic = { | ||
name: "number-line", | ||
defaultWidgetOptions, | ||
}; | ||
|
||
export default numberLineWidgetLogic; |
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