ms.js 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. var __read = (this && this.__read) || function (o, n) {
  18. var m = typeof Symbol === "function" && o[Symbol.iterator];
  19. if (!m) return o;
  20. var i = m.call(o), r, ar = [], e;
  21. try {
  22. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  23. }
  24. catch (error) { e = { error: error }; }
  25. finally {
  26. try {
  27. if (r && !r.done && (m = i["return"])) m.call(i);
  28. }
  29. finally { if (e) throw e.error; }
  30. }
  31. return ar;
  32. };
  33. var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
  34. if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
  35. if (ar || !(i in from)) {
  36. if (!ar) ar = Array.prototype.slice.call(from, 0, i);
  37. ar[i] = from[i];
  38. }
  39. }
  40. return to.concat(ar || Array.prototype.slice.call(from));
  41. };
  42. Object.defineProperty(exports, "__esModule", { value: true });
  43. exports.CommonMsMixin = void 0;
  44. function CommonMsMixin(Base) {
  45. return (function (_super) {
  46. __extends(class_1, _super);
  47. function class_1() {
  48. var args = [];
  49. for (var _i = 0; _i < arguments.length; _i++) {
  50. args[_i] = arguments[_i];
  51. }
  52. var _this = _super.apply(this, __spreadArray([], __read(args), false)) || this;
  53. var attributes = _this.node.attributes;
  54. var quotes = attributes.getList('lquote', 'rquote');
  55. if (_this.variant !== 'monospace') {
  56. if (!attributes.isSet('lquote') && quotes.lquote === '"')
  57. quotes.lquote = '\u201C';
  58. if (!attributes.isSet('rquote') && quotes.rquote === '"')
  59. quotes.rquote = '\u201D';
  60. }
  61. _this.childNodes.unshift(_this.createText(quotes.lquote));
  62. _this.childNodes.push(_this.createText(quotes.rquote));
  63. return _this;
  64. }
  65. class_1.prototype.createText = function (text) {
  66. var node = this.wrap(this.mmlText(text));
  67. node.parent = this;
  68. return node;
  69. };
  70. return class_1;
  71. }(Base));
  72. }
  73. exports.CommonMsMixin = CommonMsMixin;
  74. //# sourceMappingURL=ms.js.map