-
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.
Change KaTeXErrorView to TeXErrorView and use PhosphorIcons (#814)
## Summary: This PR updates the `KaTeXErrroView` to be just `TeXErrorView` (now that we've moved to MathJax). It also moves us to use Phosphor icons (as per the ooooold comment) and updates the component to use Wonder Blocks `View`'s instead of raw divs. Oh, and also directs folks to the right place to ask for help if they encounter TeX errors. Lastly, this PR forced a few Typescript config changes to get everything to work. I copied how the WB repository provides type definitions (`*.d.ts`) by symlinks and did away with the `typeRoots` config option... as that was causing issues during `yarn build:types` (Typescript didn't find those type definitions). <img width="600" alt="image" src="https://github.com/Khan/perseus/assets/77138/2e362119-43b8-417b-ad64-5a2e58962344"> Issue: "none" ## Test plan: Run Storybook and check out the component. Author: jeremywiebe Reviewers: benchristel, jeremywiebe, Myranae Required Reviewers: Approved By: benchristel Checks: ✅ codecov/project, ✅ codecov/patch, ✅ Upload Coverage, ✅ Publish npm snapshot (ubuntu-latest, 16.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 16.x), ✅ Extract i18n strings (ubuntu-latest, 16.x), ✅ Cypress (ubuntu-latest, 16.x), ✅ Jest Coverage (ubuntu-latest, 16.x), ✅ Check builds for changes in size (ubuntu-latest, 16.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 16.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 16.x), ✅ gerald Pull Request URL: #814
- Loading branch information
1 parent
89cb5d7
commit 105d206
Showing
44 changed files
with
765 additions
and
500 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,5 @@ | ||
--- | ||
"@khanacademy/perseus-editor": minor | ||
--- | ||
|
||
Change KaTeXErrorView to TeXErrorView and adopt Phosphor Icons in it |
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,14 @@ | ||
--- | ||
"@khanacademy/kas": patch | ||
"@khanacademy/kmath": patch | ||
"@khanacademy/math-input": patch | ||
"@khanacademy/perseus": patch | ||
"@khanacademy/perseus-core": patch | ||
"@khanacademy/perseus-editor": patch | ||
"@khanacademy/perseus-error": patch | ||
"@khanacademy/perseus-linter": patch | ||
"@khanacademy/pure-markdown": patch | ||
"@khanacademy/simple-markdown": patch | ||
--- | ||
|
||
Minor build change to how we provide Typescript type definitions (should be no change to build output). |
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 |
---|---|---|
@@ -1,13 +1,19 @@ | ||
**/node_modules | ||
node_modules | ||
coverage | ||
coverage-ts | ||
**/dist | ||
storybook-static | ||
|
||
packages/**/build | ||
**/dist | ||
**/*.template | ||
**/package.json | ||
**/*.md | ||
vendor | ||
LICENSE | ||
**/__genfiles__ | ||
storybook-static | ||
cypress/ | ||
|
||
**/*.json | ||
**/*.jpg | ||
**/*.png | ||
**/*.svg |
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 was deleted.
Oops, something went wrong.
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 @@ | ||
../../types/ |
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 @@ | ||
../../types/ |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
../../types/ |
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 @@ | ||
../../types/ |
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
26 changes: 26 additions & 0 deletions
26
packages/perseus-editor/src/__stories__/tex-error-view.stories.tsx
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,26 @@ | ||
import TexErrorView from "../tex-error-view"; | ||
|
||
import type {Meta, StoryObj} from "@storybook/react"; | ||
|
||
const meta: Meta<typeof TexErrorView> = { | ||
component: TexErrorView, | ||
title: "Perseus/Editor/TexErrorView", | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof TexErrorView>; | ||
|
||
export const Primary: Story = { | ||
args: { | ||
errorList: [ | ||
{ | ||
math: "\\x^2", | ||
message: "TeX parse error: Undefined control sequence: \\x", | ||
}, | ||
{ | ||
math: "\\y^2", | ||
message: "TeX parse error: Undefined control sequence: \\y", | ||
}, | ||
], | ||
}, | ||
}; |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.