Skip to content
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

Remove MultiRenderer #1955

Merged
merged 8 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/cool-taxis-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@khanacademy/perseus": major
"@khanacademy/perseus-editor": major
---

Remove support for MultiRenderer
11 changes: 0 additions & 11 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,6 @@ with a short description and the main Perseus data type it accepts.
article, but the scoring is not available outside of the renderer.
</td>
</tr>
<tr>
<td><code>MultiItemRenderer</code></td>
<td> <code>{ _multi: any }</code></td>
<td>
The `MultiItemRenderer` is a more advanced renderer. It accepts an
object representing a tree of `PerseusRenderer` objects. A `Shape`
object defines the structure of the tree and you must provide a
"callback" object of the same structure which defines how and where
to render each `PerseusRenderer` that appears in the tree.
</td>
</tr>
<tr>
<td><code>Renderer</code></td>
<td><code>PerseusRenderer</code></td>
Expand Down
23 changes: 0 additions & 23 deletions packages/perseus-editor/src/__tests__/i18n.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,27 +475,4 @@ describe("i18n", () => {
});
});
});

describe("Multi-item image finding", () => {
it("should find all of the images in each leaf node", () => {
const foundImages = i18n.findImagesInItemData({
_multi: {
question: {
__type: "content",
...exerciseImagesEverywhere.question,
},
hints: exerciseImagesEverywhere.hints.map((hint) => ({
__type: "hint",
...hint,
})),
},
});

expect(foundImages.length <= allImages.length).toBeTruthy();

_.each(allImages, (image) => {
expect(foundImages.indexOf(image) !== -1).toBeTruthy();
});
});
});
});
2 changes: 0 additions & 2 deletions packages/perseus-editor/src/components/graph-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ const GraphSettings = createReactClass({
},

UNSAFE_componentWillReceiveProps: function (nextProps) {
// Make sure that state updates when switching
// between different items in a multi-item editor.
if (
!_.isEqual(this.props.labels, nextProps.labels) ||
!_.isEqual(this.props.gridStep, nextProps.gridStep) ||
Expand Down
Loading
Loading