@pie-element/math-templated 2.22.5-next.42 → 2.22.5-next.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@
8
8
  "dependencies": {
9
9
  "@material-ui/core": "^3.9.2",
10
10
  "@pie-framework/pie-configure-events": "^1.3.0",
11
- "@pie-lib/pie-toolbox": "1.31.4",
11
+ "@pie-lib/pie-toolbox": "1.31.5-next.4",
12
12
  "debug": "^3.1.0",
13
13
  "lodash": "^4.17.15",
14
14
  "prop-types": "^15.6.2",
@@ -7,7 +7,7 @@
7
7
  "module": "src/index.js",
8
8
  "dependencies": {
9
9
  "@pie-framework/math-validation": "^1.2.2",
10
- "@pie-lib/pie-toolbox": "1.31.4",
10
+ "@pie-lib/pie-toolbox": "1.31.5-next.4",
11
11
  "debug": "^3.1.0",
12
12
  "lodash": "^4.17.15"
13
13
  },
@@ -43057,7 +43057,7 @@ mathjaxScript.initializeMathJax = mathjaxScript.MathJaxVersion = void 0;
43057
43057
  var _renderMath = renderMath$1;
43058
43058
  var MathJaxVersion = '3.2.2';
43059
43059
  mathjaxScript.MathJaxVersion = MathJaxVersion;
43060
- var initializeMathJax = function initializeMathJax(renderOpts) {
43060
+ var initializeMathJax = function initializeMathJax(renderOpts, callback) {
43061
43061
  if (renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar) {
43062
43062
  console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
43063
43063
  }
@@ -43099,11 +43099,17 @@ var initializeMathJax = function initializeMathJax(renderOpts) {
43099
43099
  MathJax.startup.defaultReady();
43100
43100
  var globalObj = (0, _renderMath.getGlobal)();
43101
43101
  globalObj.instance = MathJax;
43102
- resolve();
43102
+ window.mathjaxIsInitialised = true;
43103
+ if (callback) {
43104
+ callback();
43105
+ } else {
43106
+ resolve();
43107
+ }
43103
43108
  }
43104
43109
  },
43105
43110
  loader: {
43106
- load: ['input/mml']
43111
+ load: ['input/mml'],
43112
+ preLoad: function preLoad() {}
43107
43113
  },
43108
43114
  tex: texConfig,
43109
43115
  chtml: {
@@ -102816,11 +102822,36 @@ getDefaultExportFromCjs(mathRendering);
102816
102822
  fixMathElements(executeOn);
102817
102823
  adjustMathMLStyle(executeOn);
102818
102824
  var mathJaxCustomKey = getMathJaxCustomKey();
102825
+ var workingWithMathJax = function workingWithMathJax() {
102826
+ var mathJaxInstance = getGlobal().instance;
102827
+ if (mathJaxInstance) {
102828
+ mathJaxInstance.texReset();
102829
+ mathJaxInstance.typesetClear();
102830
+ mathJaxInstance.typesetPromise([executeOn]).then(function () {
102831
+ try {
102832
+ removeExcessMjxContainers(executeOn);
102833
+ removePlaceholdersAndRestoreDisplay();
102834
+ var updatedDocument = mathJaxInstance.startup.document;
102835
+ var list = updatedDocument.math.list;
102836
+ for (var item = list.next; (0, _typeof2["default"])(item.data) !== 'symbol'; item = item.next) {
102837
+ var mathMl = toMMl(item.data.root);
102838
+ var parsedMathMl = mathMl.replaceAll('\n', '');
102839
+ item.data.typesetRoot.setAttribute('data-mathml', parsedMathMl);
102840
+ }
102841
+ } catch (e) {
102842
+ console.error('Error post-processing MathJax typesetting:', e.toString());
102843
+ }
102844
+ mathJaxInstance.startup.document.clear();
102845
+ })["catch"](function (error) {
102846
+ console.error('Error in typesetting with MathJax:', error);
102847
+ });
102848
+ }
102849
+ };
102819
102850
  if ((!window.MathJax || window.MathJax.version !== _mathjaxScript.MathJaxVersion) && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
102820
102851
  renderOpts = renderOpts || defaultOpts();
102821
- (0, _mathjaxScript.initializeMathJax)(renderOpts);
102852
+ (0, _mathjaxScript.initializeMathJax)(renderOpts, workingWithMathJax);
102822
102853
  }
102823
- if (isString && window.MathJax && window.mathjaxLoadedP) {
102854
+ if (isString && window.MathJax && window.mathjaxIsInitialised) {
102824
102855
  try {
102825
102856
  MathJax.texReset();
102826
102857
  MathJax.typesetClear();
@@ -102835,34 +102866,8 @@ getDefaultExportFromCjs(mathRendering);
102835
102866
  console.error('Error rendering math:', error.message);
102836
102867
  }
102837
102868
  }
102838
- if (window.mathjaxLoadedP) {
102839
- window.mathjaxLoadedP.then(function () {
102840
- var mathJaxInstance = getGlobal().instance;
102841
- if (mathJaxInstance) {
102842
- mathJaxInstance.texReset();
102843
- mathJaxInstance.typesetClear();
102844
- mathJaxInstance.typesetPromise([executeOn]).then(function () {
102845
- try {
102846
- removeExcessMjxContainers(executeOn);
102847
- removePlaceholdersAndRestoreDisplay();
102848
- var _updatedDocument = mathJaxInstance.startup.document;
102849
- var _list = _updatedDocument.math.list;
102850
- for (var _item = _list.next; (0, _typeof2["default"])(_item.data) !== 'symbol'; _item = _item.next) {
102851
- var _mathMl = toMMl(_item.data.root);
102852
- var _parsedMathMl = _mathMl.replaceAll('\n', '');
102853
- _item.data.typesetRoot.setAttribute('data-mathml', _parsedMathMl);
102854
- }
102855
- } catch (e) {
102856
- console.error('Error post-processing MathJax typesetting:', e.toString());
102857
- }
102858
- mathJaxInstance.startup.document.clear();
102859
- })["catch"](function (error) {
102860
- console.error('Error in typesetting with MathJax:', error);
102861
- });
102862
- }
102863
- })["catch"](function (error) {
102864
- console.error('Error in initializing MathJax:', error);
102865
- });
102869
+ if (window.mathjaxIsInitialised) {
102870
+ workingWithMathJax();
102866
102871
  }
102867
102872
  };
102868
102873
  if (skipWaitForMathRenderingLib) {
package/module/element.js CHANGED
@@ -21852,7 +21852,7 @@ mathjaxScript.initializeMathJax = mathjaxScript.MathJaxVersion = void 0;
21852
21852
  var _renderMath = renderMath$2;
21853
21853
  var MathJaxVersion = '3.2.2';
21854
21854
  mathjaxScript.MathJaxVersion = MathJaxVersion;
21855
- var initializeMathJax = function initializeMathJax(renderOpts) {
21855
+ var initializeMathJax = function initializeMathJax(renderOpts, callback) {
21856
21856
  if (renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar) {
21857
21857
  console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
21858
21858
  }
@@ -21894,11 +21894,17 @@ var initializeMathJax = function initializeMathJax(renderOpts) {
21894
21894
  MathJax.startup.defaultReady();
21895
21895
  var globalObj = (0, _renderMath.getGlobal)();
21896
21896
  globalObj.instance = MathJax;
21897
- resolve();
21897
+ window.mathjaxIsInitialised = true;
21898
+ if (callback) {
21899
+ callback();
21900
+ } else {
21901
+ resolve();
21902
+ }
21898
21903
  }
21899
21904
  },
21900
21905
  loader: {
21901
- load: ['input/mml']
21906
+ load: ['input/mml'],
21907
+ preLoad: function preLoad() {}
21902
21908
  },
21903
21909
  tex: texConfig,
21904
21910
  chtml: {
@@ -81751,11 +81757,36 @@ getDefaultExportFromCjs(mathRendering);
81751
81757
  fixMathElements(executeOn);
81752
81758
  adjustMathMLStyle(executeOn);
81753
81759
  var mathJaxCustomKey = getMathJaxCustomKey();
81760
+ var workingWithMathJax = function workingWithMathJax() {
81761
+ var mathJaxInstance = getGlobal().instance;
81762
+ if (mathJaxInstance) {
81763
+ mathJaxInstance.texReset();
81764
+ mathJaxInstance.typesetClear();
81765
+ mathJaxInstance.typesetPromise([executeOn]).then(function () {
81766
+ try {
81767
+ removeExcessMjxContainers(executeOn);
81768
+ removePlaceholdersAndRestoreDisplay();
81769
+ var updatedDocument = mathJaxInstance.startup.document;
81770
+ var list = updatedDocument.math.list;
81771
+ for (var item = list.next; (0, _typeof2["default"])(item.data) !== 'symbol'; item = item.next) {
81772
+ var mathMl = toMMl(item.data.root);
81773
+ var parsedMathMl = mathMl.replaceAll('\n', '');
81774
+ item.data.typesetRoot.setAttribute('data-mathml', parsedMathMl);
81775
+ }
81776
+ } catch (e) {
81777
+ console.error('Error post-processing MathJax typesetting:', e.toString());
81778
+ }
81779
+ mathJaxInstance.startup.document.clear();
81780
+ })["catch"](function (error) {
81781
+ console.error('Error in typesetting with MathJax:', error);
81782
+ });
81783
+ }
81784
+ };
81754
81785
  if ((!window.MathJax || window.MathJax.version !== _mathjaxScript.MathJaxVersion) && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
81755
81786
  renderOpts = renderOpts || defaultOpts();
81756
- (0, _mathjaxScript.initializeMathJax)(renderOpts);
81787
+ (0, _mathjaxScript.initializeMathJax)(renderOpts, workingWithMathJax);
81757
81788
  }
81758
- if (isString && window.MathJax && window.mathjaxLoadedP) {
81789
+ if (isString && window.MathJax && window.mathjaxIsInitialised) {
81759
81790
  try {
81760
81791
  MathJax.texReset();
81761
81792
  MathJax.typesetClear();
@@ -81770,34 +81801,8 @@ getDefaultExportFromCjs(mathRendering);
81770
81801
  console.error('Error rendering math:', error.message);
81771
81802
  }
81772
81803
  }
81773
- if (window.mathjaxLoadedP) {
81774
- window.mathjaxLoadedP.then(function () {
81775
- var mathJaxInstance = getGlobal().instance;
81776
- if (mathJaxInstance) {
81777
- mathJaxInstance.texReset();
81778
- mathJaxInstance.typesetClear();
81779
- mathJaxInstance.typesetPromise([executeOn]).then(function () {
81780
- try {
81781
- removeExcessMjxContainers(executeOn);
81782
- removePlaceholdersAndRestoreDisplay();
81783
- var _updatedDocument = mathJaxInstance.startup.document;
81784
- var _list = _updatedDocument.math.list;
81785
- for (var _item = _list.next; (0, _typeof2["default"])(_item.data) !== 'symbol'; _item = _item.next) {
81786
- var _mathMl = toMMl(_item.data.root);
81787
- var _parsedMathMl = _mathMl.replaceAll('\n', '');
81788
- _item.data.typesetRoot.setAttribute('data-mathml', _parsedMathMl);
81789
- }
81790
- } catch (e) {
81791
- console.error('Error post-processing MathJax typesetting:', e.toString());
81792
- }
81793
- mathJaxInstance.startup.document.clear();
81794
- })["catch"](function (error) {
81795
- console.error('Error in typesetting with MathJax:', error);
81796
- });
81797
- }
81798
- })["catch"](function (error) {
81799
- console.error('Error in initializing MathJax:', error);
81800
- });
81804
+ if (window.mathjaxIsInitialised) {
81805
+ workingWithMathJax();
81801
81806
  }
81802
81807
  };
81803
81808
  if (skipWaitForMathRenderingLib) {
package/module/print.js CHANGED
@@ -21815,7 +21815,7 @@ mathjaxScript.initializeMathJax = mathjaxScript.MathJaxVersion = void 0;
21815
21815
  var _renderMath = renderMath$3;
21816
21816
  var MathJaxVersion = '3.2.2';
21817
21817
  mathjaxScript.MathJaxVersion = MathJaxVersion;
21818
- var initializeMathJax = function initializeMathJax(renderOpts) {
21818
+ var initializeMathJax = function initializeMathJax(renderOpts, callback) {
21819
21819
  if (renderOpts !== null && renderOpts !== void 0 && renderOpts.useSingleDollar) {
21820
21820
  console.warn('[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)');
21821
21821
  }
@@ -21857,11 +21857,17 @@ var initializeMathJax = function initializeMathJax(renderOpts) {
21857
21857
  MathJax.startup.defaultReady();
21858
21858
  var globalObj = (0, _renderMath.getGlobal)();
21859
21859
  globalObj.instance = MathJax;
21860
- resolve();
21860
+ window.mathjaxIsInitialised = true;
21861
+ if (callback) {
21862
+ callback();
21863
+ } else {
21864
+ resolve();
21865
+ }
21861
21866
  }
21862
21867
  },
21863
21868
  loader: {
21864
- load: ['input/mml']
21869
+ load: ['input/mml'],
21870
+ preLoad: function preLoad() {}
21865
21871
  },
21866
21872
  tex: texConfig,
21867
21873
  chtml: {
@@ -81714,11 +81720,36 @@ getDefaultExportFromCjs(mathRendering);
81714
81720
  fixMathElements(executeOn);
81715
81721
  adjustMathMLStyle(executeOn);
81716
81722
  var mathJaxCustomKey = getMathJaxCustomKey();
81723
+ var workingWithMathJax = function workingWithMathJax() {
81724
+ var mathJaxInstance = getGlobal().instance;
81725
+ if (mathJaxInstance) {
81726
+ mathJaxInstance.texReset();
81727
+ mathJaxInstance.typesetClear();
81728
+ mathJaxInstance.typesetPromise([executeOn]).then(function () {
81729
+ try {
81730
+ removeExcessMjxContainers(executeOn);
81731
+ removePlaceholdersAndRestoreDisplay();
81732
+ var updatedDocument = mathJaxInstance.startup.document;
81733
+ var list = updatedDocument.math.list;
81734
+ for (var item = list.next; (0, _typeof2["default"])(item.data) !== 'symbol'; item = item.next) {
81735
+ var mathMl = toMMl(item.data.root);
81736
+ var parsedMathMl = mathMl.replaceAll('\n', '');
81737
+ item.data.typesetRoot.setAttribute('data-mathml', parsedMathMl);
81738
+ }
81739
+ } catch (e) {
81740
+ console.error('Error post-processing MathJax typesetting:', e.toString());
81741
+ }
81742
+ mathJaxInstance.startup.document.clear();
81743
+ })["catch"](function (error) {
81744
+ console.error('Error in typesetting with MathJax:', error);
81745
+ });
81746
+ }
81747
+ };
81717
81748
  if ((!window.MathJax || window.MathJax.version !== _mathjaxScript.MathJaxVersion) && !window.mathjaxLoadedP || mathJaxCustomKey && mathJaxCustomKey !== mathRenderingAccessibleKEY) {
81718
81749
  renderOpts = renderOpts || defaultOpts();
81719
- (0, _mathjaxScript.initializeMathJax)(renderOpts);
81750
+ (0, _mathjaxScript.initializeMathJax)(renderOpts, workingWithMathJax);
81720
81751
  }
81721
- if (isString && window.MathJax && window.mathjaxLoadedP) {
81752
+ if (isString && window.MathJax && window.mathjaxIsInitialised) {
81722
81753
  try {
81723
81754
  MathJax.texReset();
81724
81755
  MathJax.typesetClear();
@@ -81733,34 +81764,8 @@ getDefaultExportFromCjs(mathRendering);
81733
81764
  console.error('Error rendering math:', error.message);
81734
81765
  }
81735
81766
  }
81736
- if (window.mathjaxLoadedP) {
81737
- window.mathjaxLoadedP.then(function () {
81738
- var mathJaxInstance = getGlobal().instance;
81739
- if (mathJaxInstance) {
81740
- mathJaxInstance.texReset();
81741
- mathJaxInstance.typesetClear();
81742
- mathJaxInstance.typesetPromise([executeOn]).then(function () {
81743
- try {
81744
- removeExcessMjxContainers(executeOn);
81745
- removePlaceholdersAndRestoreDisplay();
81746
- var _updatedDocument = mathJaxInstance.startup.document;
81747
- var _list = _updatedDocument.math.list;
81748
- for (var _item = _list.next; (0, _typeof2["default"])(_item.data) !== 'symbol'; _item = _item.next) {
81749
- var _mathMl = toMMl(_item.data.root);
81750
- var _parsedMathMl = _mathMl.replaceAll('\n', '');
81751
- _item.data.typesetRoot.setAttribute('data-mathml', _parsedMathMl);
81752
- }
81753
- } catch (e) {
81754
- console.error('Error post-processing MathJax typesetting:', e.toString());
81755
- }
81756
- mathJaxInstance.startup.document.clear();
81757
- })["catch"](function (error) {
81758
- console.error('Error in typesetting with MathJax:', error);
81759
- });
81760
- }
81761
- })["catch"](function (error) {
81762
- console.error('Error in initializing MathJax:', error);
81763
- });
81767
+ if (window.mathjaxIsInitialised) {
81768
+ workingWithMathJax();
81764
81769
  }
81765
81770
  };
81766
81771
  if (skipWaitForMathRenderingLib) {
package/package.json CHANGED
@@ -4,19 +4,19 @@
4
4
  "access": "public"
5
5
  },
6
6
  "repository": "pie-framework/pie-elements",
7
- "version": "2.22.5-next.42+2171996d6",
7
+ "version": "2.22.5-next.44+a2e933cd2",
8
8
  "description": "",
9
9
  "dependencies": {
10
10
  "@material-ui/core": "^3.9.2",
11
11
  "@pie-framework/pie-player-events": "^0.1.0",
12
- "@pie-lib/pie-toolbox": "1.31.4",
12
+ "@pie-lib/pie-toolbox": "1.31.5-next.4",
13
13
  "prop-types": "^15.6.1",
14
14
  "react": "^16.8.1",
15
15
  "react-dom": "^16.8.1"
16
16
  },
17
17
  "author": "",
18
18
  "license": "ISC",
19
- "gitHead": "2171996d6514e8391df9e95b87e56cb2c53229bd",
19
+ "gitHead": "a2e933cd27bb052046e245672d3e01cb5ba1b518",
20
20
  "scripts": {
21
21
  "postpublish": "../../scripts/postpublish"
22
22
  },