UNPKG

react-native-mathjax-html-to-svg

Version:

React Native component to display mathematics in html using MathJax. Uses [MathJax](https://github.com/mathjax/)

95 lines (94 loc) 3.5 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __values = (this && this.__values) || function(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.MmlMfrac = void 0; var MmlNode_js_1 = require("../MmlNode.js"); var MmlMfrac = (function (_super) { __extends(MmlMfrac, _super); function MmlMfrac() { return _super !== null && _super.apply(this, arguments) || this; } Object.defineProperty(MmlMfrac.prototype, "kind", { get: function () { return 'mfrac'; }, enumerable: false, configurable: true }); Object.defineProperty(MmlMfrac.prototype, "arity", { get: function () { return 2; }, enumerable: false, configurable: true }); Object.defineProperty(MmlMfrac.prototype, "linebreakContainer", { get: function () { return true; }, enumerable: false, configurable: true }); MmlMfrac.prototype.setTeXclass = function (prev) { var e_1, _a; this.getPrevClass(prev); try { for (var _b = __values(this.childNodes), _c = _b.next(); !_c.done; _c = _b.next()) { var child = _c.value; child.setTeXclass(null); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_1) throw e_1.error; } } return this; }; MmlMfrac.prototype.setChildInheritedAttributes = function (attributes, display, level, prime) { if (!display || level > 0) { level++; } this.childNodes[0].setInheritedAttributes(attributes, false, level, prime); this.childNodes[1].setInheritedAttributes(attributes, false, level, true); }; MmlMfrac.defaults = __assign(__assign({}, MmlNode_js_1.AbstractMmlBaseNode.defaults), { linethickness: 'medium', numalign: 'center', denomalign: 'center', bevelled: false }); return MmlMfrac; }(MmlNode_js_1.AbstractMmlBaseNode)); exports.MmlMfrac = MmlMfrac;