Skip to content

Commit

Permalink
Merge pull request #178 from pie-framework/fix/math-rendering-accessible
Browse files Browse the repository at this point in the history
fix: add back math-rendering-accessible
  • Loading branch information
andreeapescar authored Sep 26, 2024
2 parents 0cbf359 + 4bbb967 commit 4207985
Show file tree
Hide file tree
Showing 7 changed files with 10,501 additions and 39 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@material/tab-bar": "^2.2.0",
"@pie-framework/pie-configure-events": "^1.4.1",
"@pie-framework/pie-player-events": "^0.1.0",
"@pie-lib/pie-toolbox-math-rendering-module": "1.21.0",
"@pie-lib/pie-toolbox-math-rendering-module": "2.0.6",
"async-retry": "^1.2.3",
"lodash": "^4.17.15",
"parse-package-name": "^0.1.0"
Expand Down
8 changes: 2 additions & 6 deletions src/components/pie-author/pie-author.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import {
} from "@pie-framework/pie-configure-events";

import {
_dll_pie_lib__pie_toolbox_math_rendering,
// _dll_pie_lib__pie_toolbox_math_rendering_accessible
_dll_pie_lib__pie_toolbox_math_rendering_accessible
} from "@pie-lib/pie-toolbox-math-rendering-module/module";
import {Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch} from "@stencil/core";
import cloneDeep from "lodash/cloneDeep";
Expand Down Expand Up @@ -740,10 +739,7 @@ export class Author {
}

private renderMath() {
setTimeout(() => {
_dll_pie_lib__pie_toolbox_math_rendering.renderMath(this.el);
// _dll_pie_lib__pie_toolbox_math_rendering_accessible.renderMath(this.el);
}, 50);
_dll_pie_lib__pie_toolbox_math_rendering_accessible.renderMath(this.el);
}

async afterRender() {
Expand Down
4 changes: 2 additions & 2 deletions src/components/pie-player/__tests__/pie-player.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ describe("pie-player", () => {
await page.setContent(`<div id="player-holder"></div>`);
setupInterceptPieCloud(page, "@pie-element/multiple-choice");
await page.evaluate(loadPie, JSON.stringify(advancedPieMock));
const loadCompleteSpy = await page.spyOnEvent("load-complete");
// const loadCompleteSpy = await page.spyOnEvent("load-complete");
const sessionChangedSpy = await page.spyOnEvent("session-changed");
await page.waitForChanges();
await page.waitFor(200);
expect(loadCompleteSpy).toHaveReceivedEventTimes(1);
// expect(loadCompleteSpy).toHaveReceivedEventTimes(1);
expect(sessionChangedSpy).toHaveReceivedEventTimes(0);
});

Expand Down
8 changes: 2 additions & 6 deletions src/components/pie-player/pie-player.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {SessionChangedEvent} from "@pie-framework/pie-player-events";
import {
_dll_pie_lib__pie_toolbox_math_rendering,
// _dll_pie_lib__pie_toolbox_math_rendering_accessible
_dll_pie_lib__pie_toolbox_math_rendering_accessible
} from "@pie-lib/pie-toolbox-math-rendering-module/module";
import {
Component,
Expand Down Expand Up @@ -397,10 +396,7 @@ export class Player {
}

private renderMath() {
setTimeout(() => {
_dll_pie_lib__pie_toolbox_math_rendering.renderMath(this.el);
// _dll_pie_lib__pie_toolbox_math_rendering_accessible.renderMath(this.el);
}, 50);
_dll_pie_lib__pie_toolbox_math_rendering_accessible.renderMath(this.el);
}

private addBottomBorder(tags: string[]) {
Expand Down
10,469 changes: 10,469 additions & 0 deletions src/demo/NIB-multi-items-players.html

Large diffs are not rendered by default.

41 changes: 21 additions & 20 deletions src/demo/author-proxy-prod.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,38 @@
<script nomodule src="/build/pie-player-components.js"></script>
<script type="module" src="/build/pie-player-components.esm.js"></script>

<!-- <script-->
<!-- type="module"-->
<!-- src="https://unpkg.com/@pie-framework/pie-player-components@latest/dist/pie-player-components/pie-player-components.esm.js"-->
<!-- ></script>-->
<!-- <script-->
<!-- type="module"-->
<!-- src="https://unpkg.com/@pie-framework/pie-player-components@3.0.0/dist/pie-player-components/pie-player-components.esm.js"-->
<!-- ></script>-->
</head>
<body>
<pie-author id="author" add-preview="true"></pie-author>

<script>
const author = document.getElementById('author');

const endpoints = {
bundleBase: "https://pits-cdn.pie-api.io/bundles/",
buildServiceBase: "https://proxy.pie-api.com/bundles/",
};

author.bundleEndpoints = endpoints;


author.config = {
"models": [
id: "p-00000000",
elements: {
"pie-explicit-constructed-response": "@pie-element/explicit-constructed-response@next"
},
models: [
{
"id": "p-9c9ded01",
"element": "pp-pie-element-complex-rubric"
id: "p-00000000",
element: "pie-explicit-constructed-response",
disabled: false,
mode: "gather",
prompt: "<div>This is the prompt</div>",
shuffle: true,
choices: {
0: [{ label: "foo", value: "foo" }]
},
markup: "<div>This is slate markup {{0}}</div>"
}
],
"elements": {
"pp-pie-element-complex-rubric": "@pie-element/complex-rubric"
},
"id": "1",
"markup": "<pp-pie-element-complex-rubric id=\"p-9c9ded01\"></pp-pie-element-complex-rubric>"
markup: '<span data-latex=\"\" data-raw=\"\\Sigma\\sin\\theta\">\\Sigma\\sin\\theta</span><span data-latex=\"\" data-raw=\"\\times\\longdiv{\\theta}\">\\times\\longdiv{\\theta}</span>' +
'<pie-explicit-constructed-response id="p-00000000"></pie-explicit-constructed-response><div style="width: 75%"></div>'
};
</script>
</body>
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1054,10 +1054,10 @@
resolved "https://registry.yarnpkg.com/@pie-framework/pie-player-events/-/pie-player-events-0.1.0.tgz#0150904118fd604559982ab658967811c053ffe3"
integrity sha512-6H1tlRGmcZ3Wt+8HMqu5KugVcwwyNrMylfI5rIpvOSt0T82QDmjRj+2sPgQG5zos/w6MtwUqn/QZ+8Rq2EXSOA==

"@pie-lib/pie-toolbox-math-rendering-module@1.21.0":
version "1.21.0"
resolved "https://registry.yarnpkg.com/@pie-lib/pie-toolbox-math-rendering-module/-/pie-toolbox-math-rendering-module-1.21.0.tgz#b1c143c7d3b2693cf93ad1129aa2702f22ba2c3e"
integrity sha512-77PTBtOaaSpcEsQmV/oy4uDHszFrjjo9RlovuL7VVzVyHoBYqGTltYKXjTxPkJ6igJzt4DgnRsgjLXn1NOnV7Q==
"@pie-lib/pie-toolbox-math-rendering-module@2.0.6":
version "2.0.6"
resolved "https://registry.yarnpkg.com/@pie-lib/pie-toolbox-math-rendering-module/-/pie-toolbox-math-rendering-module-2.0.6.tgz#76b1d0fd076ea48731dedd8f5d1ec2a1cb971c45"
integrity sha512-S55tRHkomiYsEbJLyo1eo0unL0vhxSP009fRBERJ7ABQxOWIfmM+U6NecLuUJLcTCuo34re7lp2zqBu8JNnjUg==

"@release-it/conventional-changelog@^1.0.0":
version "1.1.4"
Expand Down

0 comments on commit 4207985

Please sign in to comment.