diff --git a/package.json b/package.json index 0e95f5b..7bde28f 100644 --- a/package.json +++ b/package.json @@ -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.1", "async-retry": "^1.2.3", "lodash": "^4.17.15", "parse-package-name": "^0.1.0" diff --git a/src/components.d.ts b/src/components.d.ts index 614c627..7b741ba 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -95,6 +95,10 @@ export namespace Components { * external providers can set this if they need to upload the assets to the cloud etc. by default we use data urls */ 'uploadSoundSupport': ExternalUploadSoundSupport; + /** + * Enables math-rendering accessibility support for the Player. Set to TRUE only if you're using item types that include the math-rendering accessibility fix. For safe version compatibility, refer to the following link: TODO (https://illuminate.atlassian.net/wiki/x/zIBkFwQ). + */ + 'useMathRenderingAccessible': boolean; 'validateModels': () => Promise; 'version': string; } @@ -154,6 +158,10 @@ export namespace Components { * @param update the updated model */ 'updateElementModel': (update: PieModel) => Promise; + /** + * Enables math-rendering accessibility support for the Player. Set to TRUE only if you're using item types that include the math-rendering accessibility fix. For safe version compatibility, refer to the following link: TODO (https://illuminate.atlassian.net/wiki/x/zIBkFwQ). + */ + 'useMathRenderingAccessible': boolean; 'version': string; } interface PiePreviewControl {} @@ -290,6 +298,10 @@ declare namespace LocalJSX { * external providers can set this if they need to upload the assets to the cloud etc. by default we use data urls */ 'uploadSoundSupport'?: ExternalUploadSoundSupport; + /** + * Enables math-rendering accessibility support for the Player. Set to TRUE only if you're using item types that include the math-rendering accessibility fix. For safe version compatibility, refer to the following link: TODO (https://illuminate.atlassian.net/wiki/x/zIBkFwQ). + */ + 'useMathRenderingAccessible'?: boolean; 'version'?: string; } interface PieEmbed {} @@ -358,6 +370,10 @@ declare namespace LocalJSX { * In evaluate mode, add a bottom border to visually separate each item in the case of a multi-item */ 'showBottomBorder'?: boolean; + /** + * Enables math-rendering accessibility support for the Player. Set to TRUE only if you're using item types that include the math-rendering accessibility fix. For safe version compatibility, refer to the following link: TODO (https://illuminate.atlassian.net/wiki/x/zIBkFwQ). + */ + 'useMathRenderingAccessible'?: boolean; 'version'?: string; } interface PiePreviewControl { diff --git a/src/components/pie-author/pie-author.tsx b/src/components/pie-author/pie-author.tsx index bb9966b..e2c7373 100644 --- a/src/components/pie-author/pie-author.tsx +++ b/src/components/pie-author/pie-author.tsx @@ -9,7 +9,7 @@ import { 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"; @@ -121,6 +121,13 @@ export class Author { */ @Prop() isInsidePieApiAuthor?: boolean = false; + /** + * Enables math-rendering accessibility support for the Player. + * Set to TRUE only if you're using item types that include the math-rendering accessibility fix. + * For safe version compatibility, refer to the following link: TODO (https://illuminate.atlassian.net/wiki/x/zIBkFwQ). + */ + @Prop() useMathRenderingAccessible: boolean = false; + pieContentModel: PieContent; pieLoader = new PieLoader(); @@ -741,8 +748,11 @@ 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); + if (this.useMathRenderingAccessible) { + _dll_pie_lib__pie_toolbox_math_rendering_accessible.renderMath(this.el); + } else { + _dll_pie_lib__pie_toolbox_math_rendering.renderMath(this.el); + } }, 50); } diff --git a/src/components/pie-player/pie-player.tsx b/src/components/pie-player/pie-player.tsx index de418f0..4c3536f 100644 --- a/src/components/pie-player/pie-player.tsx +++ b/src/components/pie-player/pie-player.tsx @@ -1,7 +1,7 @@ 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, @@ -162,6 +162,13 @@ export class Player { @Prop({mutable: false, reflect: false}) version: string = VERSION; + /** + * Enables math-rendering accessibility support for the Player. + * Set to TRUE only if you're using item types that include the math-rendering accessibility fix. + * For safe version compatibility, refer to the following link: TODO (https://illuminate.atlassian.net/wiki/x/zIBkFwQ). + */ + @Prop() useMathRenderingAccessible: boolean = false; + /** * Allow to resize pie-stimulus layout * Set this property to false to not render the resizer. @@ -398,8 +405,11 @@ 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); + if (this.useMathRenderingAccessible) { + _dll_pie_lib__pie_toolbox_math_rendering_accessible.renderMath(this.el); + } else { + _dll_pie_lib__pie_toolbox_math_rendering.renderMath(this.el); + } }, 50); } diff --git a/src/demo/NIB-multi-items-players-latest.html b/src/demo/NIB-multi-items-players-latest.html new file mode 100644 index 0000000..fbe55b1 --- /dev/null +++ b/src/demo/NIB-multi-items-players-latest.html @@ -0,0 +1,10486 @@ + + + + + + + + + MathJax Example + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/src/demo/NIB-multi-items-players.html b/src/demo/NIB-multi-items-players.html new file mode 100644 index 0000000..95c3dfa --- /dev/null +++ b/src/demo/NIB-multi-items-players.html @@ -0,0 +1,10459 @@ + + + + + + + + + MathJax Example + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/yarn.lock b/yarn.lock index 9f5cdbf..4285b06 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@pie-lib/pie-toolbox-math-rendering-module/-/pie-toolbox-math-rendering-module-2.0.1.tgz#130092a523b7374f5fbb3a0fd22878b0c547e608" + integrity sha512-TwMEPcTTWa0ESqf14LkAmltYX8zVyjh3NQI7RE8tb8qXMN8FuNDa1glFUHSbNl/xE1dxzgcVWp9S2e7rdZ0Jpg== "@release-it/conventional-changelog@^1.0.0": version "1.1.4"