semantics.js 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. "use strict";
  2. var __extends = (this && this.__extends) || (function () {
  3. var extendStatics = function (d, b) {
  4. extendStatics = Object.setPrototypeOf ||
  5. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  6. function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  7. return extendStatics(d, b);
  8. };
  9. return function (d, b) {
  10. if (typeof b !== "function" && b !== null)
  11. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  12. extendStatics(d, b);
  13. function __() { this.constructor = d; }
  14. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  15. };
  16. })();
  17. Object.defineProperty(exports, "__esModule", { value: true });
  18. exports.CHTMLxml = exports.CHTMLannotationXML = exports.CHTMLannotation = exports.CHTMLsemantics = void 0;
  19. var Wrapper_js_1 = require("../Wrapper.js");
  20. var semantics_js_1 = require("../../common/Wrappers/semantics.js");
  21. var semantics_js_2 = require("../../../core/MmlTree/MmlNodes/semantics.js");
  22. var MmlNode_js_1 = require("../../../core/MmlTree/MmlNode.js");
  23. var CHTMLsemantics = (function (_super) {
  24. __extends(CHTMLsemantics, _super);
  25. function CHTMLsemantics() {
  26. return _super !== null && _super.apply(this, arguments) || this;
  27. }
  28. CHTMLsemantics.prototype.toCHTML = function (parent) {
  29. var chtml = this.standardCHTMLnode(parent);
  30. if (this.childNodes.length) {
  31. this.childNodes[0].toCHTML(chtml);
  32. }
  33. };
  34. CHTMLsemantics.kind = semantics_js_2.MmlSemantics.prototype.kind;
  35. return CHTMLsemantics;
  36. }((0, semantics_js_1.CommonSemanticsMixin)(Wrapper_js_1.CHTMLWrapper)));
  37. exports.CHTMLsemantics = CHTMLsemantics;
  38. var CHTMLannotation = (function (_super) {
  39. __extends(CHTMLannotation, _super);
  40. function CHTMLannotation() {
  41. return _super !== null && _super.apply(this, arguments) || this;
  42. }
  43. CHTMLannotation.prototype.toCHTML = function (parent) {
  44. _super.prototype.toCHTML.call(this, parent);
  45. };
  46. CHTMLannotation.prototype.computeBBox = function () {
  47. return this.bbox;
  48. };
  49. CHTMLannotation.kind = semantics_js_2.MmlAnnotation.prototype.kind;
  50. return CHTMLannotation;
  51. }(Wrapper_js_1.CHTMLWrapper));
  52. exports.CHTMLannotation = CHTMLannotation;
  53. var CHTMLannotationXML = (function (_super) {
  54. __extends(CHTMLannotationXML, _super);
  55. function CHTMLannotationXML() {
  56. return _super !== null && _super.apply(this, arguments) || this;
  57. }
  58. CHTMLannotationXML.kind = semantics_js_2.MmlAnnotationXML.prototype.kind;
  59. CHTMLannotationXML.styles = {
  60. 'mjx-annotation-xml': {
  61. 'font-family': 'initial',
  62. 'line-height': 'normal'
  63. }
  64. };
  65. return CHTMLannotationXML;
  66. }(Wrapper_js_1.CHTMLWrapper));
  67. exports.CHTMLannotationXML = CHTMLannotationXML;
  68. var CHTMLxml = (function (_super) {
  69. __extends(CHTMLxml, _super);
  70. function CHTMLxml() {
  71. return _super !== null && _super.apply(this, arguments) || this;
  72. }
  73. CHTMLxml.prototype.toCHTML = function (parent) {
  74. this.chtml = this.adaptor.append(parent, this.adaptor.clone(this.node.getXML()));
  75. };
  76. CHTMLxml.prototype.computeBBox = function (bbox, _recompute) {
  77. if (_recompute === void 0) { _recompute = false; }
  78. var _a = this.jax.measureXMLnode(this.node.getXML()), w = _a.w, h = _a.h, d = _a.d;
  79. bbox.w = w;
  80. bbox.h = h;
  81. bbox.d = d;
  82. };
  83. CHTMLxml.prototype.getStyles = function () { };
  84. CHTMLxml.prototype.getScale = function () { };
  85. CHTMLxml.prototype.getVariant = function () { };
  86. CHTMLxml.kind = MmlNode_js_1.XMLNode.prototype.kind;
  87. CHTMLxml.autoStyle = false;
  88. return CHTMLxml;
  89. }(Wrapper_js_1.CHTMLWrapper));
  90. exports.CHTMLxml = CHTMLxml;
  91. //# sourceMappingURL=semantics.js.map