Skip to content

Commit

Permalink
Merge pull request #176 from pie-framework/feat/mra-property
Browse files Browse the repository at this point in the history
Feat/mra property
  • Loading branch information
andreeapescar authored Sep 24, 2024
2 parents 26b49fd + 3c3bfe1 commit d4dbbde
Show file tree
Hide file tree
Showing 7 changed files with 20,992 additions and 11 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.1",
"async-retry": "^1.2.3",
"lodash": "^4.17.15",
"parse-package-name": "^0.1.0"
Expand Down
16 changes: 16 additions & 0 deletions src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<any>;
'version': string;
}
Expand Down Expand Up @@ -154,6 +158,10 @@ export namespace Components {
* @param update the updated model
*/
'updateElementModel': (update: PieModel) => Promise<void>;
/**
* 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 {}
Expand Down Expand Up @@ -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 {}
Expand Down Expand Up @@ -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 {
Expand Down
16 changes: 13 additions & 3 deletions src/components/pie-author/pie-author.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
}

Expand Down
16 changes: 13 additions & 3 deletions src/components/pie-player/pie-player.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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);
}

Expand Down
Loading

0 comments on commit d4dbbde

Please sign in to comment.