stuff
This commit is contained in:
parent
bc92231240
commit
b8225c639e
11904 changed files with 1472749 additions and 133 deletions
19
node_modules/mathjax-full/js/a11y/assistive-mml.d.ts
generated
vendored
Normal file
19
node_modules/mathjax-full/js/a11y/assistive-mml.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { Handler } from '../core/Handler.js';
|
||||
import { MathDocument, AbstractMathDocument, MathDocumentConstructor } from '../core/MathDocument.js';
|
||||
import { MathItem, AbstractMathItem } from '../core/MathItem.js';
|
||||
import { MmlNode } from '../core/MmlTree/MmlNode.js';
|
||||
import { SerializedMmlVisitor } from '../core/MmlTree/SerializedMmlVisitor.js';
|
||||
export declare class LimitedMmlVisitor extends SerializedMmlVisitor {
|
||||
protected getAttributes(node: MmlNode): string;
|
||||
}
|
||||
export declare type Constructor<T> = new (...args: any[]) => T;
|
||||
export interface AssistiveMmlMathItem<N, T, D> extends MathItem<N, T, D> {
|
||||
assistiveMml(document: MathDocument<N, T, D>, force?: boolean): void;
|
||||
}
|
||||
export declare function AssistiveMmlMathItemMixin<N, T, D, B extends Constructor<AbstractMathItem<N, T, D>>>(BaseMathItem: B): Constructor<AssistiveMmlMathItem<N, T, D>> & B;
|
||||
export interface AssistiveMmlMathDocument<N, T, D> extends AbstractMathDocument<N, T, D> {
|
||||
toMML: (node: MmlNode) => string;
|
||||
assistiveMml(): AssistiveMmlMathDocument<N, T, D>;
|
||||
}
|
||||
export declare function AssistiveMmlMathDocumentMixin<N, T, D, B extends MathDocumentConstructor<AbstractMathDocument<N, T, D>>>(BaseDocument: B): MathDocumentConstructor<AssistiveMmlMathDocument<N, T, D>> & B;
|
||||
export declare function AssistiveMmlHandler<N, T, D>(handler: Handler<N, T, D>): Handler<N, T, D>;
|
||||
195
node_modules/mathjax-full/js/a11y/assistive-mml.js
generated
vendored
Normal file
195
node_modules/mathjax-full/js/a11y/assistive-mml.js
generated
vendored
Normal file
|
|
@ -0,0 +1,195 @@
|
|||
"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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
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 __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
};
|
||||
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.AssistiveMmlHandler = exports.AssistiveMmlMathDocumentMixin = exports.AssistiveMmlMathItemMixin = exports.LimitedMmlVisitor = void 0;
|
||||
var MathItem_js_1 = require("../core/MathItem.js");
|
||||
var SerializedMmlVisitor_js_1 = require("../core/MmlTree/SerializedMmlVisitor.js");
|
||||
var Options_js_1 = require("../util/Options.js");
|
||||
var LimitedMmlVisitor = (function (_super) {
|
||||
__extends(LimitedMmlVisitor, _super);
|
||||
function LimitedMmlVisitor() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
LimitedMmlVisitor.prototype.getAttributes = function (node) {
|
||||
return _super.prototype.getAttributes.call(this, node).replace(/ ?id=".*?"/, '');
|
||||
};
|
||||
return LimitedMmlVisitor;
|
||||
}(SerializedMmlVisitor_js_1.SerializedMmlVisitor));
|
||||
exports.LimitedMmlVisitor = LimitedMmlVisitor;
|
||||
(0, MathItem_js_1.newState)('ASSISTIVEMML', 153);
|
||||
function AssistiveMmlMathItemMixin(BaseMathItem) {
|
||||
return (function (_super) {
|
||||
__extends(class_1, _super);
|
||||
function class_1() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
class_1.prototype.assistiveMml = function (document, force) {
|
||||
if (force === void 0) { force = false; }
|
||||
if (this.state() >= MathItem_js_1.STATE.ASSISTIVEMML)
|
||||
return;
|
||||
if (!this.isEscaped && (document.options.enableAssistiveMml || force)) {
|
||||
var adaptor = document.adaptor;
|
||||
var mml = document.toMML(this.root).replace(/\n */g, '').replace(/<!--.*?-->/g, '');
|
||||
var mmlNodes = adaptor.firstChild(adaptor.body(adaptor.parse(mml, 'text/html')));
|
||||
var node = adaptor.node('mjx-assistive-mml', {
|
||||
unselectable: 'on', display: (this.display ? 'block' : 'inline')
|
||||
}, [mmlNodes]);
|
||||
adaptor.setAttribute(adaptor.firstChild(this.typesetRoot), 'aria-hidden', 'true');
|
||||
adaptor.setStyle(this.typesetRoot, 'position', 'relative');
|
||||
adaptor.append(this.typesetRoot, node);
|
||||
}
|
||||
this.state(MathItem_js_1.STATE.ASSISTIVEMML);
|
||||
};
|
||||
return class_1;
|
||||
}(BaseMathItem));
|
||||
}
|
||||
exports.AssistiveMmlMathItemMixin = AssistiveMmlMathItemMixin;
|
||||
function AssistiveMmlMathDocumentMixin(BaseDocument) {
|
||||
var _a;
|
||||
return _a = (function (_super) {
|
||||
__extends(BaseClass, _super);
|
||||
function BaseClass() {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
var _this = _super.apply(this, __spreadArray([], __read(args), false)) || this;
|
||||
var CLASS = _this.constructor;
|
||||
var ProcessBits = CLASS.ProcessBits;
|
||||
if (!ProcessBits.has('assistive-mml')) {
|
||||
ProcessBits.allocate('assistive-mml');
|
||||
}
|
||||
_this.visitor = new LimitedMmlVisitor(_this.mmlFactory);
|
||||
_this.options.MathItem =
|
||||
AssistiveMmlMathItemMixin(_this.options.MathItem);
|
||||
if ('addStyles' in _this) {
|
||||
_this.addStyles(CLASS.assistiveStyles);
|
||||
}
|
||||
return _this;
|
||||
}
|
||||
BaseClass.prototype.toMML = function (node) {
|
||||
return this.visitor.visitTree(node);
|
||||
};
|
||||
BaseClass.prototype.assistiveMml = function () {
|
||||
var e_1, _a;
|
||||
if (!this.processed.isSet('assistive-mml')) {
|
||||
try {
|
||||
for (var _b = __values(this.math), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var math = _c.value;
|
||||
math.assistiveMml(this);
|
||||
}
|
||||
}
|
||||
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; }
|
||||
}
|
||||
this.processed.set('assistive-mml');
|
||||
}
|
||||
return this;
|
||||
};
|
||||
BaseClass.prototype.state = function (state, restore) {
|
||||
if (restore === void 0) { restore = false; }
|
||||
_super.prototype.state.call(this, state, restore);
|
||||
if (state < MathItem_js_1.STATE.ASSISTIVEMML) {
|
||||
this.processed.clear('assistive-mml');
|
||||
}
|
||||
return this;
|
||||
};
|
||||
return BaseClass;
|
||||
}(BaseDocument)),
|
||||
_a.OPTIONS = __assign(__assign({}, BaseDocument.OPTIONS), { enableAssistiveMml: true, renderActions: (0, Options_js_1.expandable)(__assign(__assign({}, BaseDocument.OPTIONS.renderActions), { assistiveMml: [MathItem_js_1.STATE.ASSISTIVEMML] })) }),
|
||||
_a.assistiveStyles = {
|
||||
'mjx-assistive-mml': {
|
||||
position: 'absolute !important',
|
||||
top: '0px', left: '0px',
|
||||
clip: 'rect(1px, 1px, 1px, 1px)',
|
||||
padding: '1px 0px 0px 0px !important',
|
||||
border: '0px !important',
|
||||
display: 'block !important',
|
||||
width: 'auto !important',
|
||||
overflow: 'hidden !important',
|
||||
'-webkit-touch-callout': 'none',
|
||||
'-webkit-user-select': 'none',
|
||||
'-khtml-user-select': 'none',
|
||||
'-moz-user-select': 'none',
|
||||
'-ms-user-select': 'none',
|
||||
'user-select': 'none'
|
||||
},
|
||||
'mjx-assistive-mml[display="block"]': {
|
||||
width: '100% !important'
|
||||
}
|
||||
},
|
||||
_a;
|
||||
}
|
||||
exports.AssistiveMmlMathDocumentMixin = AssistiveMmlMathDocumentMixin;
|
||||
function AssistiveMmlHandler(handler) {
|
||||
handler.documentClass =
|
||||
AssistiveMmlMathDocumentMixin(handler.documentClass);
|
||||
return handler;
|
||||
}
|
||||
exports.AssistiveMmlHandler = AssistiveMmlHandler;
|
||||
//# sourceMappingURL=assistive-mml.js.map
|
||||
1
node_modules/mathjax-full/js/a11y/assistive-mml.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/a11y/assistive-mml.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"assistive-mml.js","sourceRoot":"","sources":["../../ts/a11y/assistive-mml.ts"],"names":[],"mappings":"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"}
|
||||
19
node_modules/mathjax-full/js/a11y/complexity.d.ts
generated
vendored
Normal file
19
node_modules/mathjax-full/js/a11y/complexity.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { Handler } from '../core/Handler.js';
|
||||
import { MathDocumentConstructor } from '../core/MathDocument.js';
|
||||
import { MathML } from '../input/mathml.js';
|
||||
import { MmlNode } from '../core/MmlTree/MmlNode.js';
|
||||
import { EnrichedMathItem, EnrichedMathDocument } from './semantic-enrich.js';
|
||||
export declare type Constructor<T> = new (...args: any[]) => T;
|
||||
export declare type EMItemC<N, T, D> = Constructor<EnrichedMathItem<N, T, D>>;
|
||||
export declare type CMItemC<N, T, D> = Constructor<ComplexityMathItem<N, T, D>>;
|
||||
export declare type EMDocC<N, T, D> = MathDocumentConstructor<EnrichedMathDocument<N, T, D>>;
|
||||
export declare type CMDocC<N, T, D> = Constructor<ComplexityMathDocument<N, T, D>>;
|
||||
export interface ComplexityMathItem<N, T, D> extends EnrichedMathItem<N, T, D> {
|
||||
complexity(document: ComplexityMathDocument<N, T, D>, force?: boolean): void;
|
||||
}
|
||||
export declare function ComplexityMathItemMixin<N, T, D, B extends EMItemC<N, T, D>>(BaseMathItem: B, computeComplexity: (node: MmlNode) => void): CMItemC<N, T, D> & B;
|
||||
export interface ComplexityMathDocument<N, T, D> extends EnrichedMathDocument<N, T, D> {
|
||||
complexity(): ComplexityMathDocument<N, T, D>;
|
||||
}
|
||||
export declare function ComplexityMathDocumentMixin<N, T, D, B extends EMDocC<N, T, D>>(BaseDocument: B): CMDocC<N, T, D> & B;
|
||||
export declare function ComplexityHandler<N, T, D>(handler: Handler<N, T, D>, MmlJax?: MathML<N, T, D>): Handler<N, T, D>;
|
||||
157
node_modules/mathjax-full/js/a11y/complexity.js
generated
vendored
Normal file
157
node_modules/mathjax-full/js/a11y/complexity.js
generated
vendored
Normal file
|
|
@ -0,0 +1,157 @@
|
|||
"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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
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 __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
};
|
||||
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.ComplexityHandler = exports.ComplexityMathDocumentMixin = exports.ComplexityMathItemMixin = void 0;
|
||||
var MathItem_js_1 = require("../core/MathItem.js");
|
||||
var semantic_enrich_js_1 = require("./semantic-enrich.js");
|
||||
var visitor_js_1 = require("./complexity/visitor.js");
|
||||
var Options_js_1 = require("../util/Options.js");
|
||||
(0, MathItem_js_1.newState)('COMPLEXITY', 40);
|
||||
function ComplexityMathItemMixin(BaseMathItem, computeComplexity) {
|
||||
return (function (_super) {
|
||||
__extends(class_1, _super);
|
||||
function class_1() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
class_1.prototype.complexity = function (document, force) {
|
||||
if (force === void 0) { force = false; }
|
||||
if (this.state() >= MathItem_js_1.STATE.COMPLEXITY)
|
||||
return;
|
||||
if (!this.isEscaped && (document.options.enableComplexity || force)) {
|
||||
this.enrich(document, true);
|
||||
computeComplexity(this.root);
|
||||
}
|
||||
this.state(MathItem_js_1.STATE.COMPLEXITY);
|
||||
};
|
||||
return class_1;
|
||||
}(BaseMathItem));
|
||||
}
|
||||
exports.ComplexityMathItemMixin = ComplexityMathItemMixin;
|
||||
function ComplexityMathDocumentMixin(BaseDocument) {
|
||||
var _a;
|
||||
return _a = (function (_super) {
|
||||
__extends(class_2, _super);
|
||||
function class_2() {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
var _this = _super.apply(this, __spreadArray([], __read(args), false)) || this;
|
||||
var ProcessBits = _this.constructor.ProcessBits;
|
||||
if (!ProcessBits.has('complexity')) {
|
||||
ProcessBits.allocate('complexity');
|
||||
}
|
||||
var visitorOptions = (0, Options_js_1.selectOptionsFromKeys)(_this.options, _this.options.ComplexityVisitor.OPTIONS);
|
||||
_this.complexityVisitor = new _this.options.ComplexityVisitor(_this.mmlFactory, visitorOptions);
|
||||
var computeComplexity = (function (node) { return _this.complexityVisitor.visitTree(node); });
|
||||
_this.options.MathItem =
|
||||
ComplexityMathItemMixin(_this.options.MathItem, computeComplexity);
|
||||
return _this;
|
||||
}
|
||||
class_2.prototype.complexity = function () {
|
||||
var e_1, _a;
|
||||
if (!this.processed.isSet('complexity')) {
|
||||
if (this.options.enableComplexity) {
|
||||
try {
|
||||
for (var _b = __values(this.math), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var math = _c.value;
|
||||
math.complexity(this);
|
||||
}
|
||||
}
|
||||
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; }
|
||||
}
|
||||
}
|
||||
this.processed.set('complexity');
|
||||
}
|
||||
return this;
|
||||
};
|
||||
class_2.prototype.state = function (state, restore) {
|
||||
if (restore === void 0) { restore = false; }
|
||||
_super.prototype.state.call(this, state, restore);
|
||||
if (state < MathItem_js_1.STATE.COMPLEXITY) {
|
||||
this.processed.clear('complexity');
|
||||
}
|
||||
return this;
|
||||
};
|
||||
return class_2;
|
||||
}(BaseDocument)),
|
||||
_a.OPTIONS = __assign(__assign(__assign({}, BaseDocument.OPTIONS), visitor_js_1.ComplexityVisitor.OPTIONS), { enableComplexity: true, ComplexityVisitor: visitor_js_1.ComplexityVisitor, renderActions: (0, Options_js_1.expandable)(__assign(__assign({}, BaseDocument.OPTIONS.renderActions), { complexity: [MathItem_js_1.STATE.COMPLEXITY] })) }),
|
||||
_a;
|
||||
}
|
||||
exports.ComplexityMathDocumentMixin = ComplexityMathDocumentMixin;
|
||||
function ComplexityHandler(handler, MmlJax) {
|
||||
if (MmlJax === void 0) { MmlJax = null; }
|
||||
if (!handler.documentClass.prototype.enrich && MmlJax) {
|
||||
handler = (0, semantic_enrich_js_1.EnrichHandler)(handler, MmlJax);
|
||||
}
|
||||
handler.documentClass = ComplexityMathDocumentMixin(handler.documentClass);
|
||||
return handler;
|
||||
}
|
||||
exports.ComplexityHandler = ComplexityHandler;
|
||||
//# sourceMappingURL=complexity.js.map
|
||||
1
node_modules/mathjax-full/js/a11y/complexity.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/a11y/complexity.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"complexity.js","sourceRoot":"","sources":["../../ts/a11y/complexity.ts"],"names":[],"mappings":"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"}
|
||||
33
node_modules/mathjax-full/js/a11y/complexity/collapse.d.ts
generated
vendored
Normal file
33
node_modules/mathjax-full/js/a11y/complexity/collapse.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import { MmlNode } from '../../core/MmlTree/MmlNode.js';
|
||||
import { ComplexityVisitor } from './visitor.js';
|
||||
export declare type CollapseFunction = (node: MmlNode, complexity: number) => number;
|
||||
export declare type CollapseFunctionMap = Map<string, CollapseFunction>;
|
||||
export declare type TypeRole<T> = {
|
||||
[type: string]: T | {
|
||||
[role: string]: T;
|
||||
};
|
||||
};
|
||||
export declare class Collapse {
|
||||
static NOCOLLAPSE: number;
|
||||
complexity: ComplexityVisitor;
|
||||
cutoff: TypeRole<number>;
|
||||
marker: TypeRole<string>;
|
||||
collapse: CollapseFunctionMap;
|
||||
private idCount;
|
||||
constructor(visitor: ComplexityVisitor);
|
||||
check(node: MmlNode, complexity: number): number;
|
||||
protected defaultCheck(node: MmlNode, complexity: number, type: string): number;
|
||||
protected recordCollapse(node: MmlNode, complexity: number, text: string): number;
|
||||
protected unrecordCollapse(node: MmlNode): void;
|
||||
protected canUncollapse(node: MmlNode, n: number, m?: number): MmlNode | null;
|
||||
protected uncollapseChild(complexity: number, node: MmlNode, n: number, m?: number): number;
|
||||
protected splitAttribute(node: MmlNode, id: string): string[];
|
||||
protected getText(node: MmlNode): string;
|
||||
protected findChildText(node: MmlNode, id: string): string;
|
||||
protected findChild(node: MmlNode, id: string): MmlNode | null;
|
||||
makeCollapse(node: MmlNode): void;
|
||||
makeActions(nodes: MmlNode[]): void;
|
||||
private makeId;
|
||||
makeAction(node: MmlNode): void;
|
||||
addMrow(node: MmlNode): MmlNode;
|
||||
}
|
||||
363
node_modules/mathjax-full/js/a11y/complexity/collapse.js
generated
vendored
Normal file
363
node_modules/mathjax-full/js/a11y/complexity/collapse.js
generated
vendored
Normal file
|
|
@ -0,0 +1,363 @@
|
|||
"use strict";
|
||||
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.Collapse = void 0;
|
||||
var Collapse = (function () {
|
||||
function Collapse(visitor) {
|
||||
var _this = this;
|
||||
this.cutoff = {
|
||||
identifier: 3,
|
||||
number: 3,
|
||||
text: 10,
|
||||
infixop: 15,
|
||||
relseq: 15,
|
||||
multirel: 15,
|
||||
fenced: 18,
|
||||
bigop: 20,
|
||||
integral: 20,
|
||||
fraction: 12,
|
||||
sqrt: 9,
|
||||
root: 12,
|
||||
vector: 15,
|
||||
matrix: 15,
|
||||
cases: 15,
|
||||
superscript: 9,
|
||||
subscript: 9,
|
||||
subsup: 9,
|
||||
punctuated: {
|
||||
endpunct: Collapse.NOCOLLAPSE,
|
||||
startpunct: Collapse.NOCOLLAPSE,
|
||||
value: 12
|
||||
}
|
||||
};
|
||||
this.marker = {
|
||||
identifier: 'x',
|
||||
number: '#',
|
||||
text: '...',
|
||||
appl: {
|
||||
'limit function': 'lim',
|
||||
value: 'f()'
|
||||
},
|
||||
fraction: '/',
|
||||
sqrt: '\u221A',
|
||||
root: '\u221A',
|
||||
superscript: '\u25FD\u02D9',
|
||||
subscript: '\u25FD.',
|
||||
subsup: '\u25FD:',
|
||||
vector: {
|
||||
binomial: '(:)',
|
||||
determinant: '|:|',
|
||||
value: '\u27E8:\u27E9'
|
||||
},
|
||||
matrix: {
|
||||
squarematrix: '[::]',
|
||||
rowvector: '\u27E8\u22EF\u27E9',
|
||||
columnvector: '\u27E8\u22EE\u27E9',
|
||||
determinant: '|::|',
|
||||
value: '(::)'
|
||||
},
|
||||
cases: '{:',
|
||||
infixop: {
|
||||
addition: '+',
|
||||
subtraction: '\u2212',
|
||||
multiplication: '\u22C5',
|
||||
implicit: '\u22C5',
|
||||
value: '+'
|
||||
},
|
||||
punctuated: {
|
||||
text: '...',
|
||||
value: ','
|
||||
}
|
||||
};
|
||||
this.collapse = new Map([
|
||||
['fenced', function (node, complexity) {
|
||||
complexity = _this.uncollapseChild(complexity, node, 1);
|
||||
if (complexity > _this.cutoff.fenced && node.attributes.get('data-semantic-role') === 'leftright') {
|
||||
complexity = _this.recordCollapse(node, complexity, _this.getText(node.childNodes[0]) +
|
||||
_this.getText(node.childNodes[node.childNodes.length - 1]));
|
||||
}
|
||||
return complexity;
|
||||
}],
|
||||
['appl', function (node, complexity) {
|
||||
if (_this.canUncollapse(node, 2, 2)) {
|
||||
complexity = _this.complexity.visitNode(node, false);
|
||||
var marker = _this.marker.appl;
|
||||
var text = marker[node.attributes.get('data-semantic-role')] || marker.value;
|
||||
complexity = _this.recordCollapse(node, complexity, text);
|
||||
}
|
||||
return complexity;
|
||||
}],
|
||||
['sqrt', function (node, complexity) {
|
||||
complexity = _this.uncollapseChild(complexity, node, 0);
|
||||
if (complexity > _this.cutoff.sqrt) {
|
||||
complexity = _this.recordCollapse(node, complexity, _this.marker.sqrt);
|
||||
}
|
||||
return complexity;
|
||||
}],
|
||||
['root', function (node, complexity) {
|
||||
complexity = _this.uncollapseChild(complexity, node, 0, 2);
|
||||
if (complexity > _this.cutoff.sqrt) {
|
||||
complexity = _this.recordCollapse(node, complexity, _this.marker.sqrt);
|
||||
}
|
||||
return complexity;
|
||||
}],
|
||||
['enclose', function (node, complexity) {
|
||||
if (_this.splitAttribute(node, 'children').length === 1) {
|
||||
var child = _this.canUncollapse(node, 1);
|
||||
if (child) {
|
||||
var marker = child.getProperty('collapse-marker');
|
||||
_this.unrecordCollapse(child);
|
||||
complexity = _this.recordCollapse(node, _this.complexity.visitNode(node, false), marker);
|
||||
}
|
||||
}
|
||||
return complexity;
|
||||
}],
|
||||
['bigop', function (node, complexity) {
|
||||
if (complexity > _this.cutoff.bigop || !node.isKind('mo')) {
|
||||
var id = _this.splitAttribute(node, 'content').pop();
|
||||
var op = _this.findChildText(node, id);
|
||||
complexity = _this.recordCollapse(node, complexity, op);
|
||||
}
|
||||
return complexity;
|
||||
}],
|
||||
['integral', function (node, complexity) {
|
||||
if (complexity > _this.cutoff.integral || !node.isKind('mo')) {
|
||||
var id = _this.splitAttribute(node, 'content').pop();
|
||||
var op = _this.findChildText(node, id);
|
||||
complexity = _this.recordCollapse(node, complexity, op);
|
||||
}
|
||||
return complexity;
|
||||
}],
|
||||
['relseq', function (node, complexity) {
|
||||
if (complexity > _this.cutoff.relseq) {
|
||||
var id = _this.splitAttribute(node, 'content')[0];
|
||||
var text = _this.findChildText(node, id);
|
||||
complexity = _this.recordCollapse(node, complexity, text);
|
||||
}
|
||||
return complexity;
|
||||
}],
|
||||
['multirel', function (node, complexity) {
|
||||
if (complexity > _this.cutoff.relseq) {
|
||||
var id = _this.splitAttribute(node, 'content')[0];
|
||||
var text = _this.findChildText(node, id) + '\u22EF';
|
||||
complexity = _this.recordCollapse(node, complexity, text);
|
||||
}
|
||||
return complexity;
|
||||
}],
|
||||
['superscript', function (node, complexity) {
|
||||
complexity = _this.uncollapseChild(complexity, node, 0, 2);
|
||||
if (complexity > _this.cutoff.superscript) {
|
||||
complexity = _this.recordCollapse(node, complexity, _this.marker.superscript);
|
||||
}
|
||||
return complexity;
|
||||
}],
|
||||
['subscript', function (node, complexity) {
|
||||
complexity = _this.uncollapseChild(complexity, node, 0, 2);
|
||||
if (complexity > _this.cutoff.subscript) {
|
||||
complexity = _this.recordCollapse(node, complexity, _this.marker.subscript);
|
||||
}
|
||||
return complexity;
|
||||
}],
|
||||
['subsup', function (node, complexity) {
|
||||
complexity = _this.uncollapseChild(complexity, node, 0, 3);
|
||||
if (complexity > _this.cutoff.subsup) {
|
||||
complexity = _this.recordCollapse(node, complexity, _this.marker.subsup);
|
||||
}
|
||||
return complexity;
|
||||
}]
|
||||
]);
|
||||
this.idCount = 0;
|
||||
this.complexity = visitor;
|
||||
}
|
||||
Collapse.prototype.check = function (node, complexity) {
|
||||
var type = node.attributes.get('data-semantic-type');
|
||||
if (this.collapse.has(type)) {
|
||||
return this.collapse.get(type).call(this, node, complexity);
|
||||
}
|
||||
if (this.cutoff.hasOwnProperty(type)) {
|
||||
return this.defaultCheck(node, complexity, type);
|
||||
}
|
||||
return complexity;
|
||||
};
|
||||
Collapse.prototype.defaultCheck = function (node, complexity, type) {
|
||||
var role = node.attributes.get('data-semantic-role');
|
||||
var check = this.cutoff[type];
|
||||
var cutoff = (typeof check === 'number' ? check : check[role] || check.value);
|
||||
if (complexity > cutoff) {
|
||||
var marker = this.marker[type] || '??';
|
||||
var text = (typeof marker === 'string' ? marker : marker[role] || marker.value);
|
||||
complexity = this.recordCollapse(node, complexity, text);
|
||||
}
|
||||
return complexity;
|
||||
};
|
||||
Collapse.prototype.recordCollapse = function (node, complexity, text) {
|
||||
text = '\u25C2' + text + '\u25B8';
|
||||
node.setProperty('collapse-marker', text);
|
||||
node.setProperty('collapse-complexity', complexity);
|
||||
return text.length * this.complexity.complexity.text;
|
||||
};
|
||||
Collapse.prototype.unrecordCollapse = function (node) {
|
||||
var complexity = node.getProperty('collapse-complexity');
|
||||
if (complexity != null) {
|
||||
node.attributes.set('data-semantic-complexity', complexity);
|
||||
node.removeProperty('collapse-complexity');
|
||||
node.removeProperty('collapse-marker');
|
||||
}
|
||||
};
|
||||
Collapse.prototype.canUncollapse = function (node, n, m) {
|
||||
if (m === void 0) { m = 1; }
|
||||
if (this.splitAttribute(node, 'children').length === m) {
|
||||
var mml = (node.childNodes.length === 1 &&
|
||||
node.childNodes[0].isInferred ? node.childNodes[0] : node);
|
||||
if (mml && mml.childNodes[n]) {
|
||||
var child = mml.childNodes[n];
|
||||
if (child.getProperty('collapse-marker')) {
|
||||
return child;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
Collapse.prototype.uncollapseChild = function (complexity, node, n, m) {
|
||||
if (m === void 0) { m = 1; }
|
||||
var child = this.canUncollapse(node, n, m);
|
||||
if (child) {
|
||||
this.unrecordCollapse(child);
|
||||
if (child.parent !== node) {
|
||||
child.parent.attributes.set('data-semantic-complexity', undefined);
|
||||
}
|
||||
complexity = this.complexity.visitNode(node, false);
|
||||
}
|
||||
return complexity;
|
||||
};
|
||||
Collapse.prototype.splitAttribute = function (node, id) {
|
||||
return (node.attributes.get('data-semantic-' + id) || '').split(/,/);
|
||||
};
|
||||
Collapse.prototype.getText = function (node) {
|
||||
var _this = this;
|
||||
if (node.isToken)
|
||||
return node.getText();
|
||||
return node.childNodes.map(function (n) { return _this.getText(n); }).join('');
|
||||
};
|
||||
Collapse.prototype.findChildText = function (node, id) {
|
||||
var child = this.findChild(node, id);
|
||||
return this.getText(child.coreMO() || child);
|
||||
};
|
||||
Collapse.prototype.findChild = function (node, id) {
|
||||
var e_1, _a;
|
||||
if (!node || node.attributes.get('data-semantic-id') === id)
|
||||
return node;
|
||||
if (!node.isToken) {
|
||||
try {
|
||||
for (var _b = __values(node.childNodes), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var mml = _c.value;
|
||||
var child = this.findChild(mml, id);
|
||||
if (child)
|
||||
return child;
|
||||
}
|
||||
}
|
||||
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 null;
|
||||
};
|
||||
Collapse.prototype.makeCollapse = function (node) {
|
||||
var nodes = [];
|
||||
node.walkTree(function (child) {
|
||||
if (child.getProperty('collapse-marker')) {
|
||||
nodes.push(child);
|
||||
}
|
||||
});
|
||||
this.makeActions(nodes);
|
||||
};
|
||||
Collapse.prototype.makeActions = function (nodes) {
|
||||
var e_2, _a;
|
||||
try {
|
||||
for (var nodes_1 = __values(nodes), nodes_1_1 = nodes_1.next(); !nodes_1_1.done; nodes_1_1 = nodes_1.next()) {
|
||||
var node = nodes_1_1.value;
|
||||
this.makeAction(node);
|
||||
}
|
||||
}
|
||||
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (nodes_1_1 && !nodes_1_1.done && (_a = nodes_1.return)) _a.call(nodes_1);
|
||||
}
|
||||
finally { if (e_2) throw e_2.error; }
|
||||
}
|
||||
};
|
||||
Collapse.prototype.makeId = function () {
|
||||
return 'mjx-collapse-' + this.idCount++;
|
||||
};
|
||||
Collapse.prototype.makeAction = function (node) {
|
||||
if (node.isKind('math')) {
|
||||
node = this.addMrow(node);
|
||||
}
|
||||
var factory = this.complexity.factory;
|
||||
var marker = node.getProperty('collapse-marker');
|
||||
var parent = node.parent;
|
||||
var maction = factory.create('maction', {
|
||||
actiontype: 'toggle',
|
||||
selection: 2,
|
||||
'data-collapsible': true,
|
||||
id: this.makeId(),
|
||||
'data-semantic-complexity': node.attributes.get('data-semantic-complexity')
|
||||
}, [
|
||||
factory.create('mtext', { mathcolor: 'blue' }, [
|
||||
factory.create('text').setText(marker)
|
||||
])
|
||||
]);
|
||||
maction.inheritAttributesFrom(node);
|
||||
node.attributes.set('data-semantic-complexity', node.getProperty('collapse-complexity'));
|
||||
node.removeProperty('collapse-marker');
|
||||
node.removeProperty('collapse-complexity');
|
||||
parent.replaceChild(maction, node);
|
||||
maction.appendChild(node);
|
||||
};
|
||||
Collapse.prototype.addMrow = function (node) {
|
||||
var e_3, _a;
|
||||
var mrow = this.complexity.factory.create('mrow', null, node.childNodes[0].childNodes);
|
||||
node.childNodes[0].setChildren([mrow]);
|
||||
var attributes = node.attributes.getAllAttributes();
|
||||
try {
|
||||
for (var _b = __values(Object.keys(attributes)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var name_1 = _c.value;
|
||||
if (name_1.substr(0, 14) === 'data-semantic-') {
|
||||
mrow.attributes.set(name_1, attributes[name_1]);
|
||||
delete attributes[name_1];
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_3) throw e_3.error; }
|
||||
}
|
||||
mrow.setProperty('collapse-marker', node.getProperty('collapse-marker'));
|
||||
mrow.setProperty('collapse-complexity', node.getProperty('collapse-complexity'));
|
||||
node.removeProperty('collapse-marker');
|
||||
node.removeProperty('collapse-complexity');
|
||||
return mrow;
|
||||
};
|
||||
Collapse.NOCOLLAPSE = 10000000;
|
||||
return Collapse;
|
||||
}());
|
||||
exports.Collapse = Collapse;
|
||||
//# sourceMappingURL=collapse.js.map
|
||||
1
node_modules/mathjax-full/js/a11y/complexity/collapse.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/a11y/complexity/collapse.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
42
node_modules/mathjax-full/js/a11y/complexity/visitor.d.ts
generated
vendored
Normal file
42
node_modules/mathjax-full/js/a11y/complexity/visitor.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
import { MmlNode } from '../../core/MmlTree/MmlNode.js';
|
||||
import { MmlMroot } from '../../core/MmlTree/MmlNodes/mroot.js';
|
||||
import { MmlMaction } from '../../core/MmlTree/MmlNodes/maction.js';
|
||||
import { MmlMsubsup, MmlMsub, MmlMsup } from '../../core/MmlTree/MmlNodes/msubsup.js';
|
||||
import { MmlMunderover, MmlMunder, MmlMover } from '../../core/MmlTree/MmlNodes/munderover.js';
|
||||
import { MmlVisitor } from '../../core/MmlTree/MmlVisitor.js';
|
||||
import { MmlFactory } from '../../core/MmlTree/MmlFactory.js';
|
||||
import { Collapse } from './collapse.js';
|
||||
import { OptionList } from '../../util/Options.js';
|
||||
export declare class ComplexityVisitor extends MmlVisitor {
|
||||
static OPTIONS: OptionList;
|
||||
complexity: {
|
||||
[name: string]: number;
|
||||
};
|
||||
collapse: Collapse;
|
||||
factory: MmlFactory;
|
||||
options: OptionList;
|
||||
constructor(factory: MmlFactory, options: OptionList);
|
||||
visitTree(node: MmlNode): void;
|
||||
visitNode(node: MmlNode, save: boolean): any;
|
||||
visitDefault(node: MmlNode, save: boolean): number;
|
||||
protected visitMfracNode(node: MmlNode, save: boolean): number;
|
||||
protected visitMsqrtNode(node: MmlNode, save: boolean): number;
|
||||
protected visitMrootNode(node: MmlMroot, save: boolean): number;
|
||||
protected visitMphantomNode(node: MmlNode, save: boolean): number;
|
||||
protected visitMsNode(node: MmlNode, save: boolean): number;
|
||||
protected visitMsubsupNode(node: MmlMsubsup, save: boolean): number;
|
||||
protected visitMsubNode(node: MmlMsub, save: boolean): number;
|
||||
protected visitMsupNode(node: MmlMsup, save: boolean): number;
|
||||
protected visitMunderoverNode(node: MmlMunderover, save: boolean): number;
|
||||
protected visitMunderNode(node: MmlMunder, save: boolean): number;
|
||||
protected visitMoverNode(node: MmlMover, save: boolean): number;
|
||||
protected visitMencloseNode(node: MmlNode, save: boolean): number;
|
||||
protected visitMactionNode(node: MmlMaction, save: boolean): number;
|
||||
protected visitMsemanticsNode(node: MmlNode, save: boolean): number;
|
||||
protected visitAnnotationNode(node: MmlNode, save: boolean): number;
|
||||
protected visitAnnotation_xmlNode(node: MmlNode, save: boolean): number;
|
||||
protected visitMglyphNode(node: MmlNode, save: boolean): number;
|
||||
getComplexity(node: MmlNode): number;
|
||||
protected setComplexity(node: MmlNode, complexity: number, save: boolean): number;
|
||||
protected childrenComplexity(node: MmlNode): number;
|
||||
}
|
||||
209
node_modules/mathjax-full/js/a11y/complexity/visitor.js
generated
vendored
Normal file
209
node_modules/mathjax-full/js/a11y/complexity/visitor.js
generated
vendored
Normal file
|
|
@ -0,0 +1,209 @@
|
|||
"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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
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.ComplexityVisitor = void 0;
|
||||
var MmlVisitor_js_1 = require("../../core/MmlTree/MmlVisitor.js");
|
||||
var collapse_js_1 = require("./collapse.js");
|
||||
var Options_js_1 = require("../../util/Options.js");
|
||||
var ComplexityVisitor = (function (_super) {
|
||||
__extends(ComplexityVisitor, _super);
|
||||
function ComplexityVisitor(factory, options) {
|
||||
var _this = _super.call(this, factory) || this;
|
||||
_this.complexity = {
|
||||
text: .5,
|
||||
token: .5,
|
||||
child: 1,
|
||||
script: .8,
|
||||
sqrt: 2,
|
||||
subsup: 2,
|
||||
underover: 2,
|
||||
fraction: 2,
|
||||
enclose: 2,
|
||||
action: 2,
|
||||
phantom: 0,
|
||||
xml: 2,
|
||||
glyph: 2
|
||||
};
|
||||
var CLASS = _this.constructor;
|
||||
_this.options = (0, Options_js_1.userOptions)((0, Options_js_1.defaultOptions)({}, CLASS.OPTIONS), options);
|
||||
_this.collapse = new _this.options.Collapse(_this);
|
||||
_this.factory = factory;
|
||||
return _this;
|
||||
}
|
||||
ComplexityVisitor.prototype.visitTree = function (node) {
|
||||
_super.prototype.visitTree.call(this, node, true);
|
||||
if (this.options.makeCollapsible) {
|
||||
this.collapse.makeCollapse(node);
|
||||
}
|
||||
};
|
||||
ComplexityVisitor.prototype.visitNode = function (node, save) {
|
||||
if (node.attributes.get('data-semantic-complexity'))
|
||||
return;
|
||||
return _super.prototype.visitNode.call(this, node, save);
|
||||
};
|
||||
ComplexityVisitor.prototype.visitDefault = function (node, save) {
|
||||
var complexity;
|
||||
if (node.isToken) {
|
||||
var text = node.getText();
|
||||
complexity = this.complexity.text * text.length + this.complexity.token;
|
||||
}
|
||||
else {
|
||||
complexity = this.childrenComplexity(node);
|
||||
}
|
||||
return this.setComplexity(node, complexity, save);
|
||||
};
|
||||
ComplexityVisitor.prototype.visitMfracNode = function (node, save) {
|
||||
var complexity = this.childrenComplexity(node) * this.complexity.script + this.complexity.fraction;
|
||||
return this.setComplexity(node, complexity, save);
|
||||
};
|
||||
ComplexityVisitor.prototype.visitMsqrtNode = function (node, save) {
|
||||
var complexity = this.childrenComplexity(node) + this.complexity.sqrt;
|
||||
return this.setComplexity(node, complexity, save);
|
||||
};
|
||||
ComplexityVisitor.prototype.visitMrootNode = function (node, save) {
|
||||
var complexity = this.childrenComplexity(node) + this.complexity.sqrt
|
||||
- (1 - this.complexity.script) * this.getComplexity(node.childNodes[1]);
|
||||
return this.setComplexity(node, complexity, save);
|
||||
};
|
||||
ComplexityVisitor.prototype.visitMphantomNode = function (node, save) {
|
||||
return this.setComplexity(node, this.complexity.phantom, save);
|
||||
};
|
||||
ComplexityVisitor.prototype.visitMsNode = function (node, save) {
|
||||
var text = node.attributes.get('lquote')
|
||||
+ node.getText()
|
||||
+ node.attributes.get('rquote');
|
||||
var complexity = text.length * this.complexity.text;
|
||||
return this.setComplexity(node, complexity, save);
|
||||
};
|
||||
ComplexityVisitor.prototype.visitMsubsupNode = function (node, save) {
|
||||
_super.prototype.visitDefault.call(this, node, true);
|
||||
var sub = node.childNodes[node.sub];
|
||||
var sup = node.childNodes[node.sup];
|
||||
var base = node.childNodes[node.base];
|
||||
var complexity = Math.max(sub ? this.getComplexity(sub) : 0, sup ? this.getComplexity(sup) : 0) * this.complexity.script;
|
||||
complexity += this.complexity.child * ((sub ? 1 : 0) + (sup ? 1 : 0));
|
||||
complexity += (base ? this.getComplexity(base) + this.complexity.child : 0);
|
||||
complexity += this.complexity.subsup;
|
||||
return this.setComplexity(node, complexity, save);
|
||||
};
|
||||
ComplexityVisitor.prototype.visitMsubNode = function (node, save) {
|
||||
return this.visitMsubsupNode(node, save);
|
||||
};
|
||||
ComplexityVisitor.prototype.visitMsupNode = function (node, save) {
|
||||
return this.visitMsubsupNode(node, save);
|
||||
};
|
||||
ComplexityVisitor.prototype.visitMunderoverNode = function (node, save) {
|
||||
_super.prototype.visitDefault.call(this, node, true);
|
||||
var under = node.childNodes[node.under];
|
||||
var over = node.childNodes[node.over];
|
||||
var base = node.childNodes[node.base];
|
||||
var complexity = Math.max(under ? this.getComplexity(under) : 0, over ? this.getComplexity(over) : 0) * this.complexity.script;
|
||||
if (base) {
|
||||
complexity = Math.max(this.getComplexity(base), complexity);
|
||||
}
|
||||
complexity += this.complexity.child * ((under ? 1 : 0) + (over ? 1 : 0) + (base ? 1 : 0));
|
||||
complexity += this.complexity.underover;
|
||||
return this.setComplexity(node, complexity, save);
|
||||
};
|
||||
ComplexityVisitor.prototype.visitMunderNode = function (node, save) {
|
||||
return this.visitMunderoverNode(node, save);
|
||||
};
|
||||
ComplexityVisitor.prototype.visitMoverNode = function (node, save) {
|
||||
return this.visitMunderoverNode(node, save);
|
||||
};
|
||||
ComplexityVisitor.prototype.visitMencloseNode = function (node, save) {
|
||||
var complexity = this.childrenComplexity(node) + this.complexity.enclose;
|
||||
return this.setComplexity(node, complexity, save);
|
||||
};
|
||||
ComplexityVisitor.prototype.visitMactionNode = function (node, save) {
|
||||
this.childrenComplexity(node);
|
||||
var complexity = this.getComplexity(node.selected);
|
||||
return this.setComplexity(node, complexity, save);
|
||||
};
|
||||
ComplexityVisitor.prototype.visitMsemanticsNode = function (node, save) {
|
||||
var child = node.childNodes[0];
|
||||
var complexity = 0;
|
||||
if (child) {
|
||||
this.visitNode(child, true);
|
||||
complexity = this.getComplexity(child);
|
||||
}
|
||||
return this.setComplexity(node, complexity, save);
|
||||
};
|
||||
ComplexityVisitor.prototype.visitAnnotationNode = function (node, save) {
|
||||
return this.setComplexity(node, this.complexity.xml, save);
|
||||
};
|
||||
ComplexityVisitor.prototype.visitAnnotation_xmlNode = function (node, save) {
|
||||
return this.setComplexity(node, this.complexity.xml, save);
|
||||
};
|
||||
ComplexityVisitor.prototype.visitMglyphNode = function (node, save) {
|
||||
return this.setComplexity(node, this.complexity.glyph, save);
|
||||
};
|
||||
ComplexityVisitor.prototype.getComplexity = function (node) {
|
||||
var collapsed = node.getProperty('collapsedComplexity');
|
||||
return (collapsed != null ? collapsed : node.attributes.get('data-semantic-complexity'));
|
||||
};
|
||||
ComplexityVisitor.prototype.setComplexity = function (node, complexity, save) {
|
||||
if (save) {
|
||||
if (this.options.identifyCollapsible) {
|
||||
complexity = this.collapse.check(node, complexity);
|
||||
}
|
||||
node.attributes.set('data-semantic-complexity', complexity);
|
||||
}
|
||||
return complexity;
|
||||
};
|
||||
ComplexityVisitor.prototype.childrenComplexity = function (node) {
|
||||
var e_1, _a;
|
||||
_super.prototype.visitDefault.call(this, node, true);
|
||||
var complexity = 0;
|
||||
try {
|
||||
for (var _b = __values(node.childNodes), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var child = _c.value;
|
||||
complexity += this.getComplexity(child);
|
||||
}
|
||||
}
|
||||
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; }
|
||||
}
|
||||
if (node.childNodes.length > 1) {
|
||||
complexity += node.childNodes.length * this.complexity.child;
|
||||
}
|
||||
return complexity;
|
||||
};
|
||||
ComplexityVisitor.OPTIONS = {
|
||||
identifyCollapsible: true,
|
||||
makeCollapsible: true,
|
||||
Collapse: collapse_js_1.Collapse
|
||||
};
|
||||
return ComplexityVisitor;
|
||||
}(MmlVisitor_js_1.MmlVisitor));
|
||||
exports.ComplexityVisitor = ComplexityVisitor;
|
||||
//# sourceMappingURL=visitor.js.map
|
||||
1
node_modules/mathjax-full/js/a11y/complexity/visitor.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/a11y/complexity/visitor.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
34
node_modules/mathjax-full/js/a11y/explorer.d.ts
generated
vendored
Normal file
34
node_modules/mathjax-full/js/a11y/explorer.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import { Handler } from '../core/Handler.js';
|
||||
import { MmlNode } from '../core/MmlTree/MmlNode.js';
|
||||
import { MathML } from '../input/mathml.js';
|
||||
import { EnrichedMathItem, EnrichedMathDocument } from './semantic-enrich.js';
|
||||
import { MathDocumentConstructor } from '../core/MathDocument.js';
|
||||
import { LiveRegion, ToolTip, HoverRegion } from './explorer/Region.js';
|
||||
export declare type Constructor<T> = new (...args: any[]) => T;
|
||||
export declare type HANDLER = Handler<HTMLElement, Text, Document>;
|
||||
export declare type HTMLDOCUMENT = EnrichedMathDocument<HTMLElement, Text, Document>;
|
||||
export declare type HTMLMATHITEM = EnrichedMathItem<HTMLElement, Text, Document>;
|
||||
export declare type MATHML = MathML<HTMLElement, Text, Document>;
|
||||
export interface ExplorerMathItem extends HTMLMATHITEM {
|
||||
explorable(document: HTMLDOCUMENT, force?: boolean): void;
|
||||
attachExplorers(document: HTMLDOCUMENT): void;
|
||||
}
|
||||
export declare function ExplorerMathItemMixin<B extends Constructor<HTMLMATHITEM>>(BaseMathItem: B, toMathML: (node: MmlNode) => string): Constructor<ExplorerMathItem> & B;
|
||||
export interface ExplorerMathDocument extends HTMLDOCUMENT {
|
||||
explorerRegions: ExplorerRegions;
|
||||
explorable(): HTMLDOCUMENT;
|
||||
}
|
||||
export declare function ExplorerMathDocumentMixin<B extends MathDocumentConstructor<HTMLDOCUMENT>>(BaseDocument: B): MathDocumentConstructor<ExplorerMathDocument> & B;
|
||||
export declare function ExplorerHandler(handler: HANDLER, MmlJax?: MATHML): HANDLER;
|
||||
export declare type ExplorerRegions = {
|
||||
speechRegion?: LiveRegion;
|
||||
brailleRegion?: LiveRegion;
|
||||
magnifier?: HoverRegion;
|
||||
tooltip1?: ToolTip;
|
||||
tooltip2?: ToolTip;
|
||||
tooltip3?: ToolTip;
|
||||
};
|
||||
export declare function setA11yOptions(document: HTMLDOCUMENT, options: {
|
||||
[key: string]: any;
|
||||
}): void;
|
||||
export declare function setA11yOption(document: HTMLDOCUMENT, option: string, value: string | boolean): void;
|
||||
612
node_modules/mathjax-full/js/a11y/explorer.js
generated
vendored
Normal file
612
node_modules/mathjax-full/js/a11y/explorer.js
generated
vendored
Normal file
|
|
@ -0,0 +1,612 @@
|
|||
"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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
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.");
|
||||
};
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.setA11yOption = exports.setA11yOptions = exports.ExplorerHandler = exports.ExplorerMathDocumentMixin = exports.ExplorerMathItemMixin = void 0;
|
||||
var MathItem_js_1 = require("../core/MathItem.js");
|
||||
var semantic_enrich_js_1 = require("./semantic-enrich.js");
|
||||
var Options_js_1 = require("../util/Options.js");
|
||||
var SerializedMmlVisitor_js_1 = require("../core/MmlTree/SerializedMmlVisitor.js");
|
||||
var MJContextMenu_js_1 = require("../ui/menu/MJContextMenu.js");
|
||||
var ke = __importStar(require("./explorer/KeyExplorer.js"));
|
||||
var me = __importStar(require("./explorer/MouseExplorer.js"));
|
||||
var TreeExplorer_js_1 = require("./explorer/TreeExplorer.js");
|
||||
var Region_js_1 = require("./explorer/Region.js");
|
||||
var sre_js_1 = __importDefault(require("./sre.js"));
|
||||
(0, MathItem_js_1.newState)('EXPLORER', 160);
|
||||
function ExplorerMathItemMixin(BaseMathItem, toMathML) {
|
||||
return (function (_super) {
|
||||
__extends(class_1, _super);
|
||||
function class_1() {
|
||||
var _this = _super !== null && _super.apply(this, arguments) || this;
|
||||
_this.explorers = {};
|
||||
_this.attached = [];
|
||||
_this.restart = [];
|
||||
_this.refocus = false;
|
||||
_this.savedId = null;
|
||||
return _this;
|
||||
}
|
||||
class_1.prototype.explorable = function (document, force) {
|
||||
if (force === void 0) { force = false; }
|
||||
if (this.state() >= MathItem_js_1.STATE.EXPLORER)
|
||||
return;
|
||||
if (!this.isEscaped && (document.options.enableExplorer || force)) {
|
||||
var node = this.typesetRoot;
|
||||
var mml = toMathML(this.root);
|
||||
if (this.savedId) {
|
||||
this.typesetRoot.setAttribute('sre-explorer-id', this.savedId);
|
||||
this.savedId = null;
|
||||
}
|
||||
this.explorers = initExplorers(document, node, mml);
|
||||
this.attachExplorers(document);
|
||||
}
|
||||
this.state(MathItem_js_1.STATE.EXPLORER);
|
||||
};
|
||||
class_1.prototype.attachExplorers = function (document) {
|
||||
var e_1, _a, e_2, _b;
|
||||
this.attached = [];
|
||||
var keyExplorers = [];
|
||||
try {
|
||||
for (var _c = __values(Object.keys(this.explorers)), _d = _c.next(); !_d.done; _d = _c.next()) {
|
||||
var key = _d.value;
|
||||
var explorer = this.explorers[key];
|
||||
if (explorer instanceof ke.AbstractKeyExplorer) {
|
||||
explorer.AddEvents();
|
||||
explorer.stoppable = false;
|
||||
keyExplorers.unshift(explorer);
|
||||
}
|
||||
if (document.options.a11y[key]) {
|
||||
explorer.Attach();
|
||||
this.attached.push(key);
|
||||
}
|
||||
else {
|
||||
explorer.Detach();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
try {
|
||||
for (var keyExplorers_1 = __values(keyExplorers), keyExplorers_1_1 = keyExplorers_1.next(); !keyExplorers_1_1.done; keyExplorers_1_1 = keyExplorers_1.next()) {
|
||||
var explorer = keyExplorers_1_1.value;
|
||||
if (explorer.attached) {
|
||||
explorer.stoppable = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (keyExplorers_1_1 && !keyExplorers_1_1.done && (_b = keyExplorers_1.return)) _b.call(keyExplorers_1);
|
||||
}
|
||||
finally { if (e_2) throw e_2.error; }
|
||||
}
|
||||
};
|
||||
class_1.prototype.rerender = function (document, start) {
|
||||
var e_3, _a;
|
||||
if (start === void 0) { start = MathItem_js_1.STATE.RERENDER; }
|
||||
this.savedId = this.typesetRoot.getAttribute('sre-explorer-id');
|
||||
this.refocus = (window.document.activeElement === this.typesetRoot);
|
||||
try {
|
||||
for (var _b = __values(this.attached), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var key = _c.value;
|
||||
var explorer = this.explorers[key];
|
||||
if (explorer.active) {
|
||||
this.restart.push(key);
|
||||
explorer.Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_3) throw e_3.error; }
|
||||
}
|
||||
_super.prototype.rerender.call(this, document, start);
|
||||
};
|
||||
class_1.prototype.updateDocument = function (document) {
|
||||
var _this = this;
|
||||
_super.prototype.updateDocument.call(this, document);
|
||||
this.refocus && this.typesetRoot.focus();
|
||||
this.restart.forEach(function (x) { return _this.explorers[x].Start(); });
|
||||
this.restart = [];
|
||||
this.refocus = false;
|
||||
};
|
||||
return class_1;
|
||||
}(BaseMathItem));
|
||||
}
|
||||
exports.ExplorerMathItemMixin = ExplorerMathItemMixin;
|
||||
function ExplorerMathDocumentMixin(BaseDocument) {
|
||||
var _a;
|
||||
return _a = (function (_super) {
|
||||
__extends(class_2, _super);
|
||||
function class_2() {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
var _this = _super.apply(this, __spreadArray([], __read(args), false)) || this;
|
||||
var ProcessBits = _this.constructor.ProcessBits;
|
||||
if (!ProcessBits.has('explorer')) {
|
||||
ProcessBits.allocate('explorer');
|
||||
}
|
||||
var visitor = new SerializedMmlVisitor_js_1.SerializedMmlVisitor(_this.mmlFactory);
|
||||
var toMathML = (function (node) { return visitor.visitTree(node); });
|
||||
_this.options.MathItem = ExplorerMathItemMixin(_this.options.MathItem, toMathML);
|
||||
_this.explorerRegions = initExplorerRegions(_this);
|
||||
return _this;
|
||||
}
|
||||
class_2.prototype.explorable = function () {
|
||||
var e_4, _a;
|
||||
if (!this.processed.isSet('explorer')) {
|
||||
if (this.options.enableExplorer) {
|
||||
try {
|
||||
for (var _b = __values(this.math), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var math = _c.value;
|
||||
math.explorable(this);
|
||||
}
|
||||
}
|
||||
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_4) throw e_4.error; }
|
||||
}
|
||||
}
|
||||
this.processed.set('explorer');
|
||||
}
|
||||
return this;
|
||||
};
|
||||
class_2.prototype.state = function (state, restore) {
|
||||
if (restore === void 0) { restore = false; }
|
||||
_super.prototype.state.call(this, state, restore);
|
||||
if (state < MathItem_js_1.STATE.EXPLORER) {
|
||||
this.processed.clear('explorer');
|
||||
}
|
||||
return this;
|
||||
};
|
||||
return class_2;
|
||||
}(BaseDocument)),
|
||||
_a.OPTIONS = __assign(__assign({}, BaseDocument.OPTIONS), { enableExplorer: true, renderActions: (0, Options_js_1.expandable)(__assign(__assign({}, BaseDocument.OPTIONS.renderActions), { explorable: [MathItem_js_1.STATE.EXPLORER] })), sre: (0, Options_js_1.expandable)(__assign(__assign({}, BaseDocument.OPTIONS.sre), { speech: 'shallow' })), a11y: {
|
||||
align: 'top',
|
||||
backgroundColor: 'Blue',
|
||||
backgroundOpacity: 20,
|
||||
braille: false,
|
||||
flame: false,
|
||||
foregroundColor: 'Black',
|
||||
foregroundOpacity: 100,
|
||||
highlight: 'None',
|
||||
hover: false,
|
||||
infoPrefix: false,
|
||||
infoRole: false,
|
||||
infoType: false,
|
||||
keyMagnifier: false,
|
||||
magnification: 'None',
|
||||
magnify: '400%',
|
||||
mouseMagnifier: false,
|
||||
speech: true,
|
||||
subtitles: true,
|
||||
treeColoring: false,
|
||||
viewBraille: false
|
||||
} }),
|
||||
_a;
|
||||
}
|
||||
exports.ExplorerMathDocumentMixin = ExplorerMathDocumentMixin;
|
||||
function ExplorerHandler(handler, MmlJax) {
|
||||
if (MmlJax === void 0) { MmlJax = null; }
|
||||
if (!handler.documentClass.prototype.enrich && MmlJax) {
|
||||
handler = (0, semantic_enrich_js_1.EnrichHandler)(handler, MmlJax);
|
||||
}
|
||||
handler.documentClass = ExplorerMathDocumentMixin(handler.documentClass);
|
||||
return handler;
|
||||
}
|
||||
exports.ExplorerHandler = ExplorerHandler;
|
||||
function initExplorerRegions(document) {
|
||||
return {
|
||||
speechRegion: new Region_js_1.LiveRegion(document),
|
||||
brailleRegion: new Region_js_1.LiveRegion(document),
|
||||
magnifier: new Region_js_1.HoverRegion(document),
|
||||
tooltip1: new Region_js_1.ToolTip(document),
|
||||
tooltip2: new Region_js_1.ToolTip(document),
|
||||
tooltip3: new Region_js_1.ToolTip(document)
|
||||
};
|
||||
}
|
||||
var allExplorers = {
|
||||
speech: function (doc, node) {
|
||||
var _a;
|
||||
var rest = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
rest[_i - 2] = arguments[_i];
|
||||
}
|
||||
var explorer = (_a = ke.SpeechExplorer).create.apply(_a, __spreadArray([doc, doc.explorerRegions.speechRegion, node], __read(rest), false));
|
||||
explorer.speechGenerator.setOptions({
|
||||
locale: doc.options.sre.locale, domain: doc.options.sre.domain,
|
||||
style: doc.options.sre.style, modality: 'speech'
|
||||
});
|
||||
var locale = explorer.speechGenerator.getOptions().locale;
|
||||
if (locale !== sre_js_1.default.engineSetup().locale) {
|
||||
doc.options.sre.locale = sre_js_1.default.engineSetup().locale;
|
||||
explorer.speechGenerator.setOptions({ locale: doc.options.sre.locale });
|
||||
}
|
||||
explorer.showRegion = 'subtitles';
|
||||
return explorer;
|
||||
},
|
||||
braille: function (doc, node) {
|
||||
var _a;
|
||||
var rest = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
rest[_i - 2] = arguments[_i];
|
||||
}
|
||||
var explorer = (_a = ke.SpeechExplorer).create.apply(_a, __spreadArray([doc, doc.explorerRegions.brailleRegion, node], __read(rest), false));
|
||||
explorer.speechGenerator.setOptions({ locale: 'nemeth', domain: 'default',
|
||||
style: 'default', modality: 'braille' });
|
||||
explorer.showRegion = 'viewBraille';
|
||||
return explorer;
|
||||
},
|
||||
keyMagnifier: function (doc, node) {
|
||||
var _a;
|
||||
var rest = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
rest[_i - 2] = arguments[_i];
|
||||
}
|
||||
return (_a = ke.Magnifier).create.apply(_a, __spreadArray([doc, doc.explorerRegions.magnifier, node], __read(rest), false));
|
||||
},
|
||||
mouseMagnifier: function (doc, node) {
|
||||
var _rest = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
_rest[_i - 2] = arguments[_i];
|
||||
}
|
||||
return me.ContentHoverer.create(doc, doc.explorerRegions.magnifier, node, function (x) { return x.hasAttribute('data-semantic-type'); }, function (x) { return x; });
|
||||
},
|
||||
hover: function (doc, node) {
|
||||
var _rest = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
_rest[_i - 2] = arguments[_i];
|
||||
}
|
||||
return me.FlameHoverer.create(doc, null, node);
|
||||
},
|
||||
infoType: function (doc, node) {
|
||||
var _rest = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
_rest[_i - 2] = arguments[_i];
|
||||
}
|
||||
return me.ValueHoverer.create(doc, doc.explorerRegions.tooltip1, node, function (x) { return x.hasAttribute('data-semantic-type'); }, function (x) { return x.getAttribute('data-semantic-type'); });
|
||||
},
|
||||
infoRole: function (doc, node) {
|
||||
var _rest = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
_rest[_i - 2] = arguments[_i];
|
||||
}
|
||||
return me.ValueHoverer.create(doc, doc.explorerRegions.tooltip2, node, function (x) { return x.hasAttribute('data-semantic-role'); }, function (x) { return x.getAttribute('data-semantic-role'); });
|
||||
},
|
||||
infoPrefix: function (doc, node) {
|
||||
var _rest = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
_rest[_i - 2] = arguments[_i];
|
||||
}
|
||||
return me.ValueHoverer.create(doc, doc.explorerRegions.tooltip3, node, function (x) { return x.hasAttribute('data-semantic-prefix'); }, function (x) { return x.getAttribute('data-semantic-prefix'); });
|
||||
},
|
||||
flame: function (doc, node) {
|
||||
var _rest = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
_rest[_i - 2] = arguments[_i];
|
||||
}
|
||||
return TreeExplorer_js_1.FlameColorer.create(doc, null, node);
|
||||
},
|
||||
treeColoring: function (doc, node) {
|
||||
var rest = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
rest[_i - 2] = arguments[_i];
|
||||
}
|
||||
return TreeExplorer_js_1.TreeColorer.create.apply(TreeExplorer_js_1.TreeColorer, __spreadArray([doc, null, node], __read(rest), false));
|
||||
}
|
||||
};
|
||||
function initExplorers(document, node, mml) {
|
||||
var e_5, _a;
|
||||
var explorers = {};
|
||||
try {
|
||||
for (var _b = __values(Object.keys(allExplorers)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var key = _c.value;
|
||||
explorers[key] = allExplorers[key](document, node, mml);
|
||||
}
|
||||
}
|
||||
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_5) throw e_5.error; }
|
||||
}
|
||||
return explorers;
|
||||
}
|
||||
function setA11yOptions(document, options) {
|
||||
var e_6, _a;
|
||||
var sreOptions = sre_js_1.default.engineSetup();
|
||||
for (var key in options) {
|
||||
if (document.options.a11y[key] !== undefined) {
|
||||
setA11yOption(document, key, options[key]);
|
||||
if (key === 'locale') {
|
||||
document.options.sre[key] = options[key];
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (sreOptions[key] !== undefined) {
|
||||
document.options.sre[key] = options[key];
|
||||
}
|
||||
}
|
||||
try {
|
||||
for (var _b = __values(document.math), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var item = _c.value;
|
||||
item.attachExplorers(document);
|
||||
}
|
||||
}
|
||||
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_6) throw e_6.error; }
|
||||
}
|
||||
}
|
||||
exports.setA11yOptions = setA11yOptions;
|
||||
function setA11yOption(document, option, value) {
|
||||
switch (option) {
|
||||
case 'magnification':
|
||||
switch (value) {
|
||||
case 'None':
|
||||
document.options.a11y.magnification = value;
|
||||
document.options.a11y.keyMagnifier = false;
|
||||
document.options.a11y.mouseMagnifier = false;
|
||||
break;
|
||||
case 'Keyboard':
|
||||
document.options.a11y.magnification = value;
|
||||
document.options.a11y.keyMagnifier = true;
|
||||
document.options.a11y.mouseMagnifier = false;
|
||||
break;
|
||||
case 'Mouse':
|
||||
document.options.a11y.magnification = value;
|
||||
document.options.a11y.keyMagnifier = false;
|
||||
document.options.a11y.mouseMagnifier = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'highlight':
|
||||
switch (value) {
|
||||
case 'None':
|
||||
document.options.a11y.highlight = value;
|
||||
document.options.a11y.hover = false;
|
||||
document.options.a11y.flame = false;
|
||||
break;
|
||||
case 'Hover':
|
||||
document.options.a11y.highlight = value;
|
||||
document.options.a11y.hover = true;
|
||||
document.options.a11y.flame = false;
|
||||
break;
|
||||
case 'Flame':
|
||||
document.options.a11y.highlight = value;
|
||||
document.options.a11y.hover = false;
|
||||
document.options.a11y.flame = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
document.options.a11y[option] = value;
|
||||
}
|
||||
}
|
||||
exports.setA11yOption = setA11yOption;
|
||||
var csPrefsSetting = {};
|
||||
var csPrefsVariables = function (menu, prefs) {
|
||||
var e_7, _a;
|
||||
var srVariable = menu.pool.lookup('speechRules');
|
||||
var _loop_1 = function (pref) {
|
||||
if (csPrefsSetting[pref])
|
||||
return "continue";
|
||||
menu.factory.get('variable')(menu.factory, {
|
||||
name: 'csprf_' + pref,
|
||||
setter: function (value) {
|
||||
csPrefsSetting[pref] = value;
|
||||
srVariable.setValue('clearspeak-' +
|
||||
sre_js_1.default.clearspeakPreferences.addPreference(sre_js_1.default.clearspeakStyle(), pref, value));
|
||||
},
|
||||
getter: function () { return csPrefsSetting[pref] || 'Auto'; }
|
||||
}, menu.pool);
|
||||
};
|
||||
try {
|
||||
for (var prefs_1 = __values(prefs), prefs_1_1 = prefs_1.next(); !prefs_1_1.done; prefs_1_1 = prefs_1.next()) {
|
||||
var pref = prefs_1_1.value;
|
||||
_loop_1(pref);
|
||||
}
|
||||
}
|
||||
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (prefs_1_1 && !prefs_1_1.done && (_a = prefs_1.return)) _a.call(prefs_1);
|
||||
}
|
||||
finally { if (e_7) throw e_7.error; }
|
||||
}
|
||||
};
|
||||
var csSelectionBox = function (menu, locale) {
|
||||
var e_8, _a;
|
||||
var prefs = sre_js_1.default.clearspeakPreferences.getLocalePreferences();
|
||||
var props = prefs[locale];
|
||||
if (!props) {
|
||||
var csEntry = menu.findID('Accessibility', 'Speech', 'Clearspeak');
|
||||
if (csEntry) {
|
||||
csEntry.disable();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
csPrefsVariables(menu, Object.keys(props));
|
||||
var items = [];
|
||||
var _loop_2 = function (prop) {
|
||||
items.push({
|
||||
'title': prop,
|
||||
'values': props[prop].map(function (x) { return x.replace(RegExp('^' + prop + '_'), ''); }),
|
||||
'variable': 'csprf_' + prop
|
||||
});
|
||||
};
|
||||
try {
|
||||
for (var _b = __values(Object.getOwnPropertyNames(props)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var prop = _c.value;
|
||||
_loop_2(prop);
|
||||
}
|
||||
}
|
||||
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_8) throw e_8.error; }
|
||||
}
|
||||
var sb = menu.factory.get('selectionBox')(menu.factory, {
|
||||
'title': 'Clearspeak Preferences',
|
||||
'signature': '',
|
||||
'order': 'alphabetic',
|
||||
'grid': 'square',
|
||||
'selections': items
|
||||
}, menu);
|
||||
return { 'type': 'command',
|
||||
'id': 'ClearspeakPreferences',
|
||||
'content': 'Select Preferences',
|
||||
'action': function () { return sb.post(0, 0); } };
|
||||
};
|
||||
var csMenu = function (menu, sub) {
|
||||
var locale = menu.pool.lookup('locale').getValue();
|
||||
var box = csSelectionBox(menu, locale);
|
||||
var items = [];
|
||||
try {
|
||||
items = sre_js_1.default.clearspeakPreferences.smartPreferences(menu.mathItem, locale);
|
||||
}
|
||||
catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
if (box) {
|
||||
items.splice(2, 0, box);
|
||||
}
|
||||
return menu.factory.get('subMenu')(menu.factory, {
|
||||
items: items,
|
||||
id: 'Clearspeak'
|
||||
}, sub);
|
||||
};
|
||||
MJContextMenu_js_1.MJContextMenu.DynamicSubmenus.set('Clearspeak', csMenu);
|
||||
var language = function (menu, sub) {
|
||||
var e_9, _a;
|
||||
var radios = [];
|
||||
try {
|
||||
for (var _b = __values(sre_js_1.default.locales.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var lang = _c.value;
|
||||
if (lang === 'nemeth')
|
||||
continue;
|
||||
radios.push({ type: 'radio', id: lang,
|
||||
content: sre_js_1.default.locales.get(lang) || lang, variable: 'locale' });
|
||||
}
|
||||
}
|
||||
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_9) throw e_9.error; }
|
||||
}
|
||||
radios.sort(function (x, y) { return x.content.localeCompare(y.content, 'en'); });
|
||||
return menu.factory.get('subMenu')(menu.factory, {
|
||||
items: radios, id: 'Language'
|
||||
}, sub);
|
||||
};
|
||||
MJContextMenu_js_1.MJContextMenu.DynamicSubmenus.set('A11yLanguage', language);
|
||||
//# sourceMappingURL=explorer.js.map
|
||||
1
node_modules/mathjax-full/js/a11y/explorer.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/a11y/explorer.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
37
node_modules/mathjax-full/js/a11y/explorer/Explorer.d.ts
generated
vendored
Normal file
37
node_modules/mathjax-full/js/a11y/explorer/Explorer.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
import { A11yDocument, Region } from './Region.js';
|
||||
import Sre from '../sre.js';
|
||||
export interface Explorer {
|
||||
active: boolean;
|
||||
stoppable: boolean;
|
||||
Attach(): void;
|
||||
Detach(): void;
|
||||
Start(): void;
|
||||
Stop(): void;
|
||||
AddEvents(): void;
|
||||
RemoveEvents(): void;
|
||||
Update(force?: boolean): void;
|
||||
}
|
||||
export declare class AbstractExplorer<T> implements Explorer {
|
||||
document: A11yDocument;
|
||||
protected region: Region<T>;
|
||||
protected node: HTMLElement;
|
||||
stoppable: boolean;
|
||||
protected events: [string, (x: Event) => void][];
|
||||
protected highlighter: Sre.highlighter;
|
||||
private _active;
|
||||
protected static stopEvent(event: Event): void;
|
||||
static create<T>(document: A11yDocument, region: Region<T>, node: HTMLElement, ...rest: any[]): Explorer;
|
||||
protected constructor(document: A11yDocument, region: Region<T>, node: HTMLElement, ..._rest: any[]);
|
||||
protected Events(): [string, (x: Event) => void][];
|
||||
get active(): boolean;
|
||||
set active(flag: boolean);
|
||||
Attach(): void;
|
||||
Detach(): void;
|
||||
Start(): void;
|
||||
Stop(): void;
|
||||
AddEvents(): void;
|
||||
RemoveEvents(): void;
|
||||
Update(force?: boolean): void;
|
||||
protected getHighlighter(): Sre.highlighter;
|
||||
protected stopEvent(event: Event): void;
|
||||
}
|
||||
162
node_modules/mathjax-full/js/a11y/explorer/Explorer.js
generated
vendored
Normal file
162
node_modules/mathjax-full/js/a11y/explorer/Explorer.js
generated
vendored
Normal file
|
|
@ -0,0 +1,162 @@
|
|||
"use strict";
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
};
|
||||
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.");
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AbstractExplorer = void 0;
|
||||
var sre_js_1 = __importDefault(require("../sre.js"));
|
||||
var AbstractExplorer = (function () {
|
||||
function AbstractExplorer(document, region, node) {
|
||||
var _rest = [];
|
||||
for (var _i = 3; _i < arguments.length; _i++) {
|
||||
_rest[_i - 3] = arguments[_i];
|
||||
}
|
||||
this.document = document;
|
||||
this.region = region;
|
||||
this.node = node;
|
||||
this.stoppable = true;
|
||||
this.events = [];
|
||||
this.highlighter = this.getHighlighter();
|
||||
this._active = false;
|
||||
}
|
||||
AbstractExplorer.stopEvent = function (event) {
|
||||
if (event.preventDefault) {
|
||||
event.preventDefault();
|
||||
}
|
||||
else {
|
||||
event.returnValue = false;
|
||||
}
|
||||
if (event.stopImmediatePropagation) {
|
||||
event.stopImmediatePropagation();
|
||||
}
|
||||
else if (event.stopPropagation) {
|
||||
event.stopPropagation();
|
||||
}
|
||||
event.cancelBubble = true;
|
||||
};
|
||||
AbstractExplorer.create = function (document, region, node) {
|
||||
var rest = [];
|
||||
for (var _i = 3; _i < arguments.length; _i++) {
|
||||
rest[_i - 3] = arguments[_i];
|
||||
}
|
||||
var explorer = new (this.bind.apply(this, __spreadArray([void 0, document, region, node], __read(rest), false)))();
|
||||
return explorer;
|
||||
};
|
||||
AbstractExplorer.prototype.Events = function () {
|
||||
return this.events;
|
||||
};
|
||||
Object.defineProperty(AbstractExplorer.prototype, "active", {
|
||||
get: function () {
|
||||
return this._active;
|
||||
},
|
||||
set: function (flag) {
|
||||
this._active = flag;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
AbstractExplorer.prototype.Attach = function () {
|
||||
this.AddEvents();
|
||||
};
|
||||
AbstractExplorer.prototype.Detach = function () {
|
||||
this.RemoveEvents();
|
||||
};
|
||||
AbstractExplorer.prototype.Start = function () {
|
||||
this.highlighter = this.getHighlighter();
|
||||
this.active = true;
|
||||
};
|
||||
AbstractExplorer.prototype.Stop = function () {
|
||||
if (this.active) {
|
||||
this.region.Clear();
|
||||
this.region.Hide();
|
||||
this.active = false;
|
||||
}
|
||||
};
|
||||
AbstractExplorer.prototype.AddEvents = function () {
|
||||
var e_1, _a;
|
||||
try {
|
||||
for (var _b = __values(this.events), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var _d = __read(_c.value, 2), eventkind = _d[0], eventfunc = _d[1];
|
||||
this.node.addEventListener(eventkind, eventfunc);
|
||||
}
|
||||
}
|
||||
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; }
|
||||
}
|
||||
};
|
||||
AbstractExplorer.prototype.RemoveEvents = function () {
|
||||
var e_2, _a;
|
||||
try {
|
||||
for (var _b = __values(this.events), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var _d = __read(_c.value, 2), eventkind = _d[0], eventfunc = _d[1];
|
||||
this.node.removeEventListener(eventkind, eventfunc);
|
||||
}
|
||||
}
|
||||
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_2) throw e_2.error; }
|
||||
}
|
||||
};
|
||||
AbstractExplorer.prototype.Update = function (force) {
|
||||
if (force === void 0) { force = false; }
|
||||
};
|
||||
AbstractExplorer.prototype.getHighlighter = function () {
|
||||
var opts = this.document.options.a11y;
|
||||
var foreground = { color: opts.foregroundColor.toLowerCase(),
|
||||
alpha: opts.foregroundOpacity / 100 };
|
||||
var background = { color: opts.backgroundColor.toLowerCase(),
|
||||
alpha: opts.backgroundOpacity / 100 };
|
||||
return sre_js_1.default.getHighlighter(background, foreground, { renderer: this.document.outputJax.name, browser: 'v3' });
|
||||
};
|
||||
AbstractExplorer.prototype.stopEvent = function (event) {
|
||||
if (this.stoppable) {
|
||||
AbstractExplorer.stopEvent(event);
|
||||
}
|
||||
};
|
||||
return AbstractExplorer;
|
||||
}());
|
||||
exports.AbstractExplorer = AbstractExplorer;
|
||||
//# sourceMappingURL=Explorer.js.map
|
||||
1
node_modules/mathjax-full/js/a11y/explorer/Explorer.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/a11y/explorer/Explorer.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"Explorer.js","sourceRoot":"","sources":["../../../ts/a11y/explorer/Explorer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,qDAA4B;AAyE5B;IAqEE,0BACS,QAAsB,EACnB,MAAiB,EACjB,IAAiB;QAAE,eAAe;aAAf,UAAe,EAAf,qBAAe,EAAf,IAAe;YAAf,8BAAe;;QAFrC,aAAQ,GAAR,QAAQ,CAAc;QACnB,WAAM,GAAN,MAAM,CAAW;QACjB,SAAI,GAAJ,IAAI,CAAa;QAnEtB,cAAS,GAAY,IAAI,CAAC;QAMvB,WAAM,GAAmC,EAAE,CAAC;QAM5C,gBAAW,GAAoB,IAAI,CAAC,cAAc,EAAE,CAAC;QAMvD,YAAO,GAAY,KAAK,CAAC;IAmDjC,CAAC;IA7CgB,0BAAS,GAA1B,UAA2B,KAAY;QACrC,IAAI,KAAK,CAAC,cAAc,EAAE;YACxB,KAAK,CAAC,cAAc,EAAE,CAAC;SACxB;aAAM;YACL,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC;SAC3B;QACD,IAAI,KAAK,CAAC,wBAAwB,EAAE;YAClC,KAAK,CAAC,wBAAwB,EAAE,CAAC;SAClC;aAAM,IAAI,KAAK,CAAC,eAAe,EAAE;YAChC,KAAK,CAAC,eAAe,EAAE,CAAC;SACzB;QACD,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;IAC5B,CAAC;IAYa,uBAAM,GAApB,UACE,QAAsB,EACtB,MAAiB,EACjB,IAAiB;QAAE,cAAc;aAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;YAAd,6BAAc;;QAEjC,IAAI,QAAQ,QAAO,IAAI,YAAJ,IAAI,yBAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,UAAK,IAAI,aAAC,CAAC;QACzD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAqBS,iCAAM,GAAhB;QACE,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAMD,sBAAW,oCAAM;aAAjB;YACE,OAAO,IAAI,CAAC,OAAO,CAAC;QACtB,CAAC;aAKD,UAAkB,IAAa;YAC7B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACtB,CAAC;;;OAPA;IAYM,iCAAM,GAAb;QACE,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAKM,iCAAM,GAAb;QACE,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAKM,gCAAK,GAAZ;QACE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACrB,CAAC;IAKM,+BAAI,GAAX;QACE,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YACpB,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACnB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;SACrB;IACH,CAAC;IAKM,oCAAS,GAAhB;;;YACE,KAAoC,IAAA,KAAA,SAAA,IAAI,CAAC,MAAM,CAAA,gBAAA,4BAAE;gBAAxC,IAAA,KAAA,mBAAsB,EAArB,SAAS,QAAA,EAAE,SAAS,QAAA;gBAC5B,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;aAClD;;;;;;;;;IACH,CAAC;IAKM,uCAAY,GAAnB;;;YACE,KAAoC,IAAA,KAAA,SAAA,IAAI,CAAC,MAAM,CAAA,gBAAA,4BAAE;gBAAxC,IAAA,KAAA,mBAAsB,EAArB,SAAS,QAAA,EAAE,SAAS,QAAA;gBAC5B,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;aACrD;;;;;;;;;IACH,CAAC;IAMM,iCAAM,GAAb,UAAc,KAAsB;QAAtB,sBAAA,EAAA,aAAsB;IAAS,CAAC;IAMpC,yCAAc,GAAxB;QACE,IAAI,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC;QACtC,IAAI,UAAU,GAAG,EAAC,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE;YACzC,KAAK,EAAE,IAAI,CAAC,iBAAiB,GAAG,GAAG,EAAC,CAAC;QACvD,IAAI,UAAU,GAAG,EAAC,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE;YACzC,KAAK,EAAE,IAAI,CAAC,iBAAiB,GAAG,GAAG,EAAC,CAAC;QACvD,OAAO,gBAAG,CAAC,cAAc,CACvB,UAAU,EAAE,UAAU,EACtB,EAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;IAC7D,CAAC;IAMS,oCAAS,GAAnB,UAAoB,KAAY;QAC9B,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,gBAAgB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;SACnC;IACH,CAAC;IAEH,uBAAC;AAAD,CAAC,AAtLD,IAsLC;AAtLY,4CAAgB"}
|
||||
55
node_modules/mathjax-full/js/a11y/explorer/KeyExplorer.d.ts
generated
vendored
Normal file
55
node_modules/mathjax-full/js/a11y/explorer/KeyExplorer.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
import { A11yDocument, Region } from './Region.js';
|
||||
import { Explorer, AbstractExplorer } from './Explorer.js';
|
||||
import Sre from '../sre.js';
|
||||
export interface KeyExplorer extends Explorer {
|
||||
KeyDown(event: KeyboardEvent): void;
|
||||
FocusIn(event: FocusEvent): void;
|
||||
FocusOut(event: FocusEvent): void;
|
||||
}
|
||||
export declare abstract class AbstractKeyExplorer<T> extends AbstractExplorer<T> implements KeyExplorer {
|
||||
attached: boolean;
|
||||
protected walker: Sre.walker;
|
||||
private eventsAttached;
|
||||
protected events: [string, (x: Event) => void][];
|
||||
private oldIndex;
|
||||
abstract KeyDown(event: KeyboardEvent): void;
|
||||
FocusIn(_event: FocusEvent): void;
|
||||
FocusOut(_event: FocusEvent): void;
|
||||
Update(force?: boolean): void;
|
||||
Attach(): void;
|
||||
AddEvents(): void;
|
||||
Detach(): void;
|
||||
Stop(): void;
|
||||
}
|
||||
export declare class SpeechExplorer extends AbstractKeyExplorer<string> {
|
||||
document: A11yDocument;
|
||||
protected region: Region<string>;
|
||||
protected node: HTMLElement;
|
||||
private mml;
|
||||
private static updatePromise;
|
||||
speechGenerator: Sre.speechGenerator;
|
||||
showRegion: string;
|
||||
private init;
|
||||
private restarted;
|
||||
constructor(document: A11yDocument, region: Region<string>, node: HTMLElement, mml: string);
|
||||
Start(): void;
|
||||
Update(force?: boolean): void;
|
||||
Speech(walker: Sre.walker): void;
|
||||
KeyDown(event: KeyboardEvent): void;
|
||||
protected triggerLink(code: number): boolean;
|
||||
Move(key: number): void;
|
||||
private initWalker;
|
||||
private getOptions;
|
||||
}
|
||||
export declare class Magnifier extends AbstractKeyExplorer<HTMLElement> {
|
||||
document: A11yDocument;
|
||||
protected region: Region<HTMLElement>;
|
||||
protected node: HTMLElement;
|
||||
private mml;
|
||||
constructor(document: A11yDocument, region: Region<HTMLElement>, node: HTMLElement, mml: string);
|
||||
Update(force?: boolean): void;
|
||||
Start(): void;
|
||||
private showFocus;
|
||||
Move(key: number): void;
|
||||
KeyDown(event: KeyboardEvent): void;
|
||||
}
|
||||
313
node_modules/mathjax-full/js/a11y/explorer/KeyExplorer.js
generated
vendored
Normal file
313
node_modules/mathjax-full/js/a11y/explorer/KeyExplorer.js
generated
vendored
Normal file
|
|
@ -0,0 +1,313 @@
|
|||
"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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (_) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Magnifier = exports.SpeechExplorer = exports.AbstractKeyExplorer = void 0;
|
||||
var Explorer_js_1 = require("./Explorer.js");
|
||||
var sre_js_1 = __importDefault(require("../sre.js"));
|
||||
var AbstractKeyExplorer = (function (_super) {
|
||||
__extends(AbstractKeyExplorer, _super);
|
||||
function AbstractKeyExplorer() {
|
||||
var _this = _super !== null && _super.apply(this, arguments) || this;
|
||||
_this.attached = false;
|
||||
_this.eventsAttached = false;
|
||||
_this.events = _super.prototype.Events.call(_this).concat([['keydown', _this.KeyDown.bind(_this)],
|
||||
['focusin', _this.FocusIn.bind(_this)],
|
||||
['focusout', _this.FocusOut.bind(_this)]]);
|
||||
_this.oldIndex = null;
|
||||
return _this;
|
||||
}
|
||||
AbstractKeyExplorer.prototype.FocusIn = function (_event) {
|
||||
};
|
||||
AbstractKeyExplorer.prototype.FocusOut = function (_event) {
|
||||
this.Stop();
|
||||
};
|
||||
AbstractKeyExplorer.prototype.Update = function (force) {
|
||||
if (force === void 0) { force = false; }
|
||||
if (!this.active && !force)
|
||||
return;
|
||||
this.highlighter.unhighlight();
|
||||
var nodes = this.walker.getFocus(true).getNodes();
|
||||
if (!nodes.length) {
|
||||
this.walker.refocus();
|
||||
nodes = this.walker.getFocus().getNodes();
|
||||
}
|
||||
this.highlighter.highlight(nodes);
|
||||
};
|
||||
AbstractKeyExplorer.prototype.Attach = function () {
|
||||
_super.prototype.Attach.call(this);
|
||||
this.attached = true;
|
||||
this.oldIndex = this.node.tabIndex;
|
||||
this.node.tabIndex = 1;
|
||||
this.node.setAttribute('role', 'application');
|
||||
};
|
||||
AbstractKeyExplorer.prototype.AddEvents = function () {
|
||||
if (!this.eventsAttached) {
|
||||
_super.prototype.AddEvents.call(this);
|
||||
this.eventsAttached = true;
|
||||
}
|
||||
};
|
||||
AbstractKeyExplorer.prototype.Detach = function () {
|
||||
if (this.active) {
|
||||
this.node.tabIndex = this.oldIndex;
|
||||
this.oldIndex = null;
|
||||
this.node.removeAttribute('role');
|
||||
}
|
||||
this.attached = false;
|
||||
};
|
||||
AbstractKeyExplorer.prototype.Stop = function () {
|
||||
if (this.active) {
|
||||
this.highlighter.unhighlight();
|
||||
this.walker.deactivate();
|
||||
}
|
||||
_super.prototype.Stop.call(this);
|
||||
};
|
||||
return AbstractKeyExplorer;
|
||||
}(Explorer_js_1.AbstractExplorer));
|
||||
exports.AbstractKeyExplorer = AbstractKeyExplorer;
|
||||
var SpeechExplorer = (function (_super) {
|
||||
__extends(SpeechExplorer, _super);
|
||||
function SpeechExplorer(document, region, node, mml) {
|
||||
var _this = _super.call(this, document, region, node) || this;
|
||||
_this.document = document;
|
||||
_this.region = region;
|
||||
_this.node = node;
|
||||
_this.mml = mml;
|
||||
_this.showRegion = 'subtitles';
|
||||
_this.init = false;
|
||||
_this.restarted = false;
|
||||
_this.initWalker();
|
||||
return _this;
|
||||
}
|
||||
SpeechExplorer.prototype.Start = function () {
|
||||
var _this = this;
|
||||
if (!this.attached)
|
||||
return;
|
||||
var options = this.getOptions();
|
||||
if (!this.init) {
|
||||
this.init = true;
|
||||
SpeechExplorer.updatePromise = SpeechExplorer.updatePromise.then(function () { return __awaiter(_this, void 0, void 0, function () {
|
||||
var _this = this;
|
||||
return __generator(this, function (_a) {
|
||||
return [2, sre_js_1.default.sreReady()
|
||||
.then(function () { return sre_js_1.default.setupEngine({ locale: options.locale }); })
|
||||
.then(function () {
|
||||
_this.Speech(_this.walker);
|
||||
_this.Start();
|
||||
})];
|
||||
});
|
||||
}); })
|
||||
.catch(function (error) { return console.log(error.message); });
|
||||
return;
|
||||
}
|
||||
_super.prototype.Start.call(this);
|
||||
this.speechGenerator = sre_js_1.default.getSpeechGenerator('Direct');
|
||||
this.speechGenerator.setOptions(options);
|
||||
this.walker = sre_js_1.default.getWalker('table', this.node, this.speechGenerator, this.highlighter, this.mml);
|
||||
this.walker.activate();
|
||||
this.Update();
|
||||
if (this.document.options.a11y[this.showRegion]) {
|
||||
SpeechExplorer.updatePromise.then(function () { return _this.region.Show(_this.node, _this.highlighter); });
|
||||
}
|
||||
this.restarted = true;
|
||||
};
|
||||
SpeechExplorer.prototype.Update = function (force) {
|
||||
var _this = this;
|
||||
if (force === void 0) { force = false; }
|
||||
_super.prototype.Update.call(this, force);
|
||||
var options = this.speechGenerator.getOptions();
|
||||
if (options.modality === 'speech') {
|
||||
this.document.options.sre.domain = options.domain;
|
||||
this.document.options.sre.style = options.style;
|
||||
this.document.options.a11y.speechRules =
|
||||
options.domain + '-' + options.style;
|
||||
}
|
||||
SpeechExplorer.updatePromise = SpeechExplorer.updatePromise.then(function () { return __awaiter(_this, void 0, void 0, function () {
|
||||
var _this = this;
|
||||
return __generator(this, function (_a) {
|
||||
return [2, sre_js_1.default.sreReady()
|
||||
.then(function () { return sre_js_1.default.setupEngine({ modality: options.modality,
|
||||
locale: options.locale }); })
|
||||
.then(function () { return _this.region.Update(_this.walker.speech()); })];
|
||||
});
|
||||
}); });
|
||||
};
|
||||
SpeechExplorer.prototype.Speech = function (walker) {
|
||||
var _this = this;
|
||||
SpeechExplorer.updatePromise.then(function () {
|
||||
walker.speech();
|
||||
_this.node.setAttribute('hasspeech', 'true');
|
||||
_this.Update();
|
||||
if (_this.restarted && _this.document.options.a11y[_this.showRegion]) {
|
||||
_this.region.Show(_this.node, _this.highlighter);
|
||||
}
|
||||
});
|
||||
};
|
||||
SpeechExplorer.prototype.KeyDown = function (event) {
|
||||
var code = event.keyCode;
|
||||
this.walker.modifier = event.shiftKey;
|
||||
if (code === 27) {
|
||||
this.Stop();
|
||||
this.stopEvent(event);
|
||||
return;
|
||||
}
|
||||
if (this.active) {
|
||||
this.Move(code);
|
||||
if (this.triggerLink(code))
|
||||
return;
|
||||
this.stopEvent(event);
|
||||
return;
|
||||
}
|
||||
if (code === 32 && event.shiftKey || code === 13) {
|
||||
this.Start();
|
||||
this.stopEvent(event);
|
||||
}
|
||||
};
|
||||
SpeechExplorer.prototype.triggerLink = function (code) {
|
||||
var _a, _b;
|
||||
if (code !== 13) {
|
||||
return false;
|
||||
}
|
||||
var node = (_a = this.walker.getFocus().getNodes()) === null || _a === void 0 ? void 0 : _a[0];
|
||||
var focus = (_b = node === null || node === void 0 ? void 0 : node.getAttribute('data-semantic-postfix')) === null || _b === void 0 ? void 0 : _b.match(/(^| )link($| )/);
|
||||
if (focus) {
|
||||
node.parentNode.dispatchEvent(new MouseEvent('click'));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
SpeechExplorer.prototype.Move = function (key) {
|
||||
this.walker.move(key);
|
||||
this.Update();
|
||||
};
|
||||
SpeechExplorer.prototype.initWalker = function () {
|
||||
this.speechGenerator = sre_js_1.default.getSpeechGenerator('Tree');
|
||||
var dummy = sre_js_1.default.getWalker('dummy', this.node, this.speechGenerator, this.highlighter, this.mml);
|
||||
this.walker = dummy;
|
||||
};
|
||||
SpeechExplorer.prototype.getOptions = function () {
|
||||
var options = this.speechGenerator.getOptions();
|
||||
var sreOptions = this.document.options.sre;
|
||||
if (options.modality === 'speech' &&
|
||||
(options.locale !== sreOptions.locale ||
|
||||
options.domain !== sreOptions.domain ||
|
||||
options.style !== sreOptions.style)) {
|
||||
options.domain = sreOptions.domain;
|
||||
options.style = sreOptions.style;
|
||||
options.locale = sreOptions.locale;
|
||||
this.walker.update(options);
|
||||
}
|
||||
return options;
|
||||
};
|
||||
SpeechExplorer.updatePromise = Promise.resolve();
|
||||
return SpeechExplorer;
|
||||
}(AbstractKeyExplorer));
|
||||
exports.SpeechExplorer = SpeechExplorer;
|
||||
var Magnifier = (function (_super) {
|
||||
__extends(Magnifier, _super);
|
||||
function Magnifier(document, region, node, mml) {
|
||||
var _this = _super.call(this, document, region, node) || this;
|
||||
_this.document = document;
|
||||
_this.region = region;
|
||||
_this.node = node;
|
||||
_this.mml = mml;
|
||||
_this.walker = sre_js_1.default.getWalker('table', _this.node, sre_js_1.default.getSpeechGenerator('Dummy'), _this.highlighter, _this.mml);
|
||||
return _this;
|
||||
}
|
||||
Magnifier.prototype.Update = function (force) {
|
||||
if (force === void 0) { force = false; }
|
||||
_super.prototype.Update.call(this, force);
|
||||
this.showFocus();
|
||||
};
|
||||
Magnifier.prototype.Start = function () {
|
||||
_super.prototype.Start.call(this);
|
||||
if (!this.attached)
|
||||
return;
|
||||
this.region.Show(this.node, this.highlighter);
|
||||
this.walker.activate();
|
||||
this.Update();
|
||||
};
|
||||
Magnifier.prototype.showFocus = function () {
|
||||
var node = this.walker.getFocus().getNodes()[0];
|
||||
this.region.Show(node, this.highlighter);
|
||||
};
|
||||
Magnifier.prototype.Move = function (key) {
|
||||
var result = this.walker.move(key);
|
||||
if (result) {
|
||||
this.Update();
|
||||
}
|
||||
};
|
||||
Magnifier.prototype.KeyDown = function (event) {
|
||||
var code = event.keyCode;
|
||||
this.walker.modifier = event.shiftKey;
|
||||
if (code === 27) {
|
||||
this.Stop();
|
||||
this.stopEvent(event);
|
||||
return;
|
||||
}
|
||||
if (this.active && code !== 13) {
|
||||
this.Move(code);
|
||||
this.stopEvent(event);
|
||||
return;
|
||||
}
|
||||
if (code === 32 && event.shiftKey || code === 13) {
|
||||
this.Start();
|
||||
this.stopEvent(event);
|
||||
}
|
||||
};
|
||||
return Magnifier;
|
||||
}(AbstractKeyExplorer));
|
||||
exports.Magnifier = Magnifier;
|
||||
//# sourceMappingURL=KeyExplorer.js.map
|
||||
1
node_modules/mathjax-full/js/a11y/explorer/KeyExplorer.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/a11y/explorer/KeyExplorer.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
33
node_modules/mathjax-full/js/a11y/explorer/MouseExplorer.d.ts
generated
vendored
Normal file
33
node_modules/mathjax-full/js/a11y/explorer/MouseExplorer.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import { A11yDocument, Region } from './Region.js';
|
||||
import { Explorer, AbstractExplorer } from './Explorer.js';
|
||||
import '../sre.js';
|
||||
export interface MouseExplorer extends Explorer {
|
||||
MouseOver(event: MouseEvent): void;
|
||||
MouseOut(event: MouseEvent): void;
|
||||
}
|
||||
export declare abstract class AbstractMouseExplorer<T> extends AbstractExplorer<T> implements MouseExplorer {
|
||||
protected events: [string, (x: Event) => void][];
|
||||
MouseOver(_event: MouseEvent): void;
|
||||
MouseOut(_event: MouseEvent): void;
|
||||
}
|
||||
export declare abstract class Hoverer<T> extends AbstractMouseExplorer<T> {
|
||||
document: A11yDocument;
|
||||
protected region: Region<T>;
|
||||
protected node: HTMLElement;
|
||||
protected nodeQuery: (node: HTMLElement) => boolean;
|
||||
protected nodeAccess: (node: HTMLElement) => T;
|
||||
protected coord: [number, number];
|
||||
protected constructor(document: A11yDocument, region: Region<T>, node: HTMLElement, nodeQuery: (node: HTMLElement) => boolean, nodeAccess: (node: HTMLElement) => T);
|
||||
MouseOut(event: MouseEvent): void;
|
||||
MouseOver(event: MouseEvent): void;
|
||||
getNode(node: HTMLElement): [HTMLElement, T];
|
||||
}
|
||||
export declare class ValueHoverer extends Hoverer<string> {
|
||||
}
|
||||
export declare class ContentHoverer extends Hoverer<HTMLElement> {
|
||||
}
|
||||
export declare class FlameHoverer extends Hoverer<void> {
|
||||
document: A11yDocument;
|
||||
protected node: HTMLElement;
|
||||
protected constructor(document: A11yDocument, _ignore: any, node: HTMLElement);
|
||||
}
|
||||
139
node_modules/mathjax-full/js/a11y/explorer/MouseExplorer.js
generated
vendored
Normal file
139
node_modules/mathjax-full/js/a11y/explorer/MouseExplorer.js
generated
vendored
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
"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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FlameHoverer = exports.ContentHoverer = exports.ValueHoverer = exports.Hoverer = exports.AbstractMouseExplorer = void 0;
|
||||
var Region_js_1 = require("./Region.js");
|
||||
var Explorer_js_1 = require("./Explorer.js");
|
||||
require("../sre.js");
|
||||
var AbstractMouseExplorer = (function (_super) {
|
||||
__extends(AbstractMouseExplorer, _super);
|
||||
function AbstractMouseExplorer() {
|
||||
var _this = _super !== null && _super.apply(this, arguments) || this;
|
||||
_this.events = _super.prototype.Events.call(_this).concat([
|
||||
['mouseover', _this.MouseOver.bind(_this)],
|
||||
['mouseout', _this.MouseOut.bind(_this)]
|
||||
]);
|
||||
return _this;
|
||||
}
|
||||
AbstractMouseExplorer.prototype.MouseOver = function (_event) {
|
||||
this.Start();
|
||||
};
|
||||
AbstractMouseExplorer.prototype.MouseOut = function (_event) {
|
||||
this.Stop();
|
||||
};
|
||||
return AbstractMouseExplorer;
|
||||
}(Explorer_js_1.AbstractExplorer));
|
||||
exports.AbstractMouseExplorer = AbstractMouseExplorer;
|
||||
var Hoverer = (function (_super) {
|
||||
__extends(Hoverer, _super);
|
||||
function Hoverer(document, region, node, nodeQuery, nodeAccess) {
|
||||
var _this = _super.call(this, document, region, node) || this;
|
||||
_this.document = document;
|
||||
_this.region = region;
|
||||
_this.node = node;
|
||||
_this.nodeQuery = nodeQuery;
|
||||
_this.nodeAccess = nodeAccess;
|
||||
return _this;
|
||||
}
|
||||
Hoverer.prototype.MouseOut = function (event) {
|
||||
if (event.clientX === this.coord[0] &&
|
||||
event.clientY === this.coord[1]) {
|
||||
return;
|
||||
}
|
||||
this.highlighter.unhighlight();
|
||||
this.region.Hide();
|
||||
_super.prototype.MouseOut.call(this, event);
|
||||
};
|
||||
Hoverer.prototype.MouseOver = function (event) {
|
||||
_super.prototype.MouseOver.call(this, event);
|
||||
var target = event.target;
|
||||
this.coord = [event.clientX, event.clientY];
|
||||
var _a = __read(this.getNode(target), 2), node = _a[0], kind = _a[1];
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
this.highlighter.unhighlight();
|
||||
this.highlighter.highlight([node]);
|
||||
this.region.Update(kind);
|
||||
this.region.Show(node, this.highlighter);
|
||||
};
|
||||
Hoverer.prototype.getNode = function (node) {
|
||||
var original = node;
|
||||
while (node && node !== this.node) {
|
||||
if (this.nodeQuery(node)) {
|
||||
return [node, this.nodeAccess(node)];
|
||||
}
|
||||
node = node.parentNode;
|
||||
}
|
||||
node = original;
|
||||
while (node) {
|
||||
if (this.nodeQuery(node)) {
|
||||
return [node, this.nodeAccess(node)];
|
||||
}
|
||||
var child = node.childNodes[0];
|
||||
node = (child && child.tagName === 'defs') ?
|
||||
node.childNodes[1] : child;
|
||||
}
|
||||
return [null, null];
|
||||
};
|
||||
return Hoverer;
|
||||
}(AbstractMouseExplorer));
|
||||
exports.Hoverer = Hoverer;
|
||||
var ValueHoverer = (function (_super) {
|
||||
__extends(ValueHoverer, _super);
|
||||
function ValueHoverer() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
return ValueHoverer;
|
||||
}(Hoverer));
|
||||
exports.ValueHoverer = ValueHoverer;
|
||||
var ContentHoverer = (function (_super) {
|
||||
__extends(ContentHoverer, _super);
|
||||
function ContentHoverer() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
return ContentHoverer;
|
||||
}(Hoverer));
|
||||
exports.ContentHoverer = ContentHoverer;
|
||||
var FlameHoverer = (function (_super) {
|
||||
__extends(FlameHoverer, _super);
|
||||
function FlameHoverer(document, _ignore, node) {
|
||||
var _this = _super.call(this, document, new Region_js_1.DummyRegion(document), node, function (x) { return _this.highlighter.isMactionNode(x); }, function () { }) || this;
|
||||
_this.document = document;
|
||||
_this.node = node;
|
||||
return _this;
|
||||
}
|
||||
return FlameHoverer;
|
||||
}(Hoverer));
|
||||
exports.FlameHoverer = FlameHoverer;
|
||||
//# sourceMappingURL=MouseExplorer.js.map
|
||||
1
node_modules/mathjax-full/js/a11y/explorer/MouseExplorer.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/a11y/explorer/MouseExplorer.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"MouseExplorer.js","sourceRoot":"","sources":["../../../ts/a11y/explorer/MouseExplorer.ts"],"names":[],"mappings":"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"}
|
||||
69
node_modules/mathjax-full/js/a11y/explorer/Region.d.ts
generated
vendored
Normal file
69
node_modules/mathjax-full/js/a11y/explorer/Region.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
import { MathDocument } from '../../core/MathDocument.js';
|
||||
import { CssStyles } from '../../util/StyleList.js';
|
||||
import Sre from '../sre.js';
|
||||
export declare type A11yDocument = MathDocument<HTMLElement, Text, Document>;
|
||||
export interface Region<T> {
|
||||
AddStyles(): void;
|
||||
AddElement(): void;
|
||||
Show(node: HTMLElement, highlighter: Sre.highlighter): void;
|
||||
Hide(): void;
|
||||
Clear(): void;
|
||||
Update(content: T): void;
|
||||
}
|
||||
export declare abstract class AbstractRegion<T> implements Region<T> {
|
||||
document: A11yDocument;
|
||||
protected static className: string;
|
||||
protected static styleAdded: boolean;
|
||||
protected static style: CssStyles;
|
||||
protected div: HTMLElement;
|
||||
protected inner: HTMLElement;
|
||||
protected CLASS: typeof AbstractRegion;
|
||||
constructor(document: A11yDocument);
|
||||
AddStyles(): void;
|
||||
AddElement(): void;
|
||||
Show(node: HTMLElement, highlighter: Sre.highlighter): void;
|
||||
protected abstract position(node: HTMLElement): void;
|
||||
protected abstract highlight(highlighter: Sre.highlighter): void;
|
||||
Hide(): void;
|
||||
abstract Clear(): void;
|
||||
abstract Update(content: T): void;
|
||||
protected stackRegions(node: HTMLElement): void;
|
||||
}
|
||||
export declare class DummyRegion extends AbstractRegion<void> {
|
||||
Clear(): void;
|
||||
Update(): void;
|
||||
Hide(): void;
|
||||
Show(): void;
|
||||
AddElement(): void;
|
||||
AddStyles(): void;
|
||||
position(): void;
|
||||
highlight(_highlighter: Sre.highlighter): void;
|
||||
}
|
||||
export declare class StringRegion extends AbstractRegion<string> {
|
||||
Clear(): void;
|
||||
Update(speech: string): void;
|
||||
protected position(node: HTMLElement): void;
|
||||
protected highlight(highlighter: Sre.highlighter): void;
|
||||
}
|
||||
export declare class ToolTip extends StringRegion {
|
||||
protected static className: string;
|
||||
protected static style: CssStyles;
|
||||
}
|
||||
export declare class LiveRegion extends StringRegion {
|
||||
document: A11yDocument;
|
||||
protected static className: string;
|
||||
protected static style: CssStyles;
|
||||
constructor(document: A11yDocument);
|
||||
}
|
||||
export declare class HoverRegion extends AbstractRegion<HTMLElement> {
|
||||
document: A11yDocument;
|
||||
protected static className: string;
|
||||
protected static style: CssStyles;
|
||||
constructor(document: A11yDocument);
|
||||
protected position(node: HTMLElement): void;
|
||||
protected highlight(highlighter: Sre.highlighter): void;
|
||||
Show(node: HTMLElement, highlighter: Sre.highlighter): void;
|
||||
Clear(): void;
|
||||
Update(node: HTMLElement): void;
|
||||
private cloneNode;
|
||||
}
|
||||
267
node_modules/mathjax-full/js/a11y/explorer/Region.js
generated
vendored
Normal file
267
node_modules/mathjax-full/js/a11y/explorer/Region.js
generated
vendored
Normal file
|
|
@ -0,0 +1,267 @@
|
|||
"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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var _a, _b, _c;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.HoverRegion = exports.LiveRegion = exports.ToolTip = exports.StringRegion = exports.DummyRegion = exports.AbstractRegion = void 0;
|
||||
var StyleList_js_1 = require("../../util/StyleList.js");
|
||||
var AbstractRegion = (function () {
|
||||
function AbstractRegion(document) {
|
||||
this.document = document;
|
||||
this.CLASS = this.constructor;
|
||||
this.AddStyles();
|
||||
this.AddElement();
|
||||
}
|
||||
AbstractRegion.prototype.AddStyles = function () {
|
||||
if (this.CLASS.styleAdded) {
|
||||
return;
|
||||
}
|
||||
var node = this.document.adaptor.node('style');
|
||||
node.innerHTML = this.CLASS.style.cssText;
|
||||
this.document.adaptor.head(this.document.adaptor.document).
|
||||
appendChild(node);
|
||||
this.CLASS.styleAdded = true;
|
||||
};
|
||||
AbstractRegion.prototype.AddElement = function () {
|
||||
var element = this.document.adaptor.node('div');
|
||||
element.classList.add(this.CLASS.className);
|
||||
element.style.backgroundColor = 'white';
|
||||
this.div = element;
|
||||
this.inner = this.document.adaptor.node('div');
|
||||
this.div.appendChild(this.inner);
|
||||
this.document.adaptor.
|
||||
body(this.document.adaptor.document).
|
||||
appendChild(this.div);
|
||||
};
|
||||
AbstractRegion.prototype.Show = function (node, highlighter) {
|
||||
this.position(node);
|
||||
this.highlight(highlighter);
|
||||
this.div.classList.add(this.CLASS.className + '_Show');
|
||||
};
|
||||
AbstractRegion.prototype.Hide = function () {
|
||||
this.div.classList.remove(this.CLASS.className + '_Show');
|
||||
};
|
||||
AbstractRegion.prototype.stackRegions = function (node) {
|
||||
var rect = node.getBoundingClientRect();
|
||||
var baseBottom = 0;
|
||||
var baseLeft = Number.POSITIVE_INFINITY;
|
||||
var regions = this.document.adaptor.document.getElementsByClassName(this.CLASS.className + '_Show');
|
||||
for (var i = 0, region = void 0; region = regions[i]; i++) {
|
||||
if (region !== this.div) {
|
||||
baseBottom = Math.max(region.getBoundingClientRect().bottom, baseBottom);
|
||||
baseLeft = Math.min(region.getBoundingClientRect().left, baseLeft);
|
||||
}
|
||||
}
|
||||
var bot = (baseBottom ? baseBottom : rect.bottom + 10) + window.pageYOffset;
|
||||
var left = (baseLeft < Number.POSITIVE_INFINITY ? baseLeft : rect.left) + window.pageXOffset;
|
||||
this.div.style.top = bot + 'px';
|
||||
this.div.style.left = left + 'px';
|
||||
};
|
||||
AbstractRegion.styleAdded = false;
|
||||
return AbstractRegion;
|
||||
}());
|
||||
exports.AbstractRegion = AbstractRegion;
|
||||
var DummyRegion = (function (_super) {
|
||||
__extends(DummyRegion, _super);
|
||||
function DummyRegion() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
DummyRegion.prototype.Clear = function () { };
|
||||
DummyRegion.prototype.Update = function () { };
|
||||
DummyRegion.prototype.Hide = function () { };
|
||||
DummyRegion.prototype.Show = function () { };
|
||||
DummyRegion.prototype.AddElement = function () { };
|
||||
DummyRegion.prototype.AddStyles = function () { };
|
||||
DummyRegion.prototype.position = function () { };
|
||||
DummyRegion.prototype.highlight = function (_highlighter) { };
|
||||
return DummyRegion;
|
||||
}(AbstractRegion));
|
||||
exports.DummyRegion = DummyRegion;
|
||||
var StringRegion = (function (_super) {
|
||||
__extends(StringRegion, _super);
|
||||
function StringRegion() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
StringRegion.prototype.Clear = function () {
|
||||
this.Update('');
|
||||
this.inner.style.top = '';
|
||||
this.inner.style.backgroundColor = '';
|
||||
};
|
||||
StringRegion.prototype.Update = function (speech) {
|
||||
this.inner.textContent = '';
|
||||
this.inner.textContent = speech;
|
||||
};
|
||||
StringRegion.prototype.position = function (node) {
|
||||
this.stackRegions(node);
|
||||
};
|
||||
StringRegion.prototype.highlight = function (highlighter) {
|
||||
var color = highlighter.colorString();
|
||||
this.inner.style.backgroundColor = color.background;
|
||||
this.inner.style.color = color.foreground;
|
||||
};
|
||||
return StringRegion;
|
||||
}(AbstractRegion));
|
||||
exports.StringRegion = StringRegion;
|
||||
var ToolTip = (function (_super) {
|
||||
__extends(ToolTip, _super);
|
||||
function ToolTip() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
ToolTip.className = 'MJX_ToolTip';
|
||||
ToolTip.style = new StyleList_js_1.CssStyles((_a = {},
|
||||
_a['.' + ToolTip.className] = {
|
||||
position: 'absolute', display: 'inline-block',
|
||||
height: '1px', width: '1px'
|
||||
},
|
||||
_a['.' + ToolTip.className + '_Show'] = {
|
||||
width: 'auto', height: 'auto', opacity: 1, 'text-align': 'center',
|
||||
'border-radius': '6px', padding: '0px 0px',
|
||||
'border-bottom': '1px dotted black', position: 'absolute',
|
||||
'z-index': 202
|
||||
},
|
||||
_a));
|
||||
return ToolTip;
|
||||
}(StringRegion));
|
||||
exports.ToolTip = ToolTip;
|
||||
var LiveRegion = (function (_super) {
|
||||
__extends(LiveRegion, _super);
|
||||
function LiveRegion(document) {
|
||||
var _this = _super.call(this, document) || this;
|
||||
_this.document = document;
|
||||
_this.div.setAttribute('aria-live', 'assertive');
|
||||
return _this;
|
||||
}
|
||||
LiveRegion.className = 'MJX_LiveRegion';
|
||||
LiveRegion.style = new StyleList_js_1.CssStyles((_b = {},
|
||||
_b['.' + LiveRegion.className] = {
|
||||
position: 'absolute', top: '0', height: '1px', width: '1px',
|
||||
padding: '1px', overflow: 'hidden'
|
||||
},
|
||||
_b['.' + LiveRegion.className + '_Show'] = {
|
||||
top: '0', position: 'absolute', width: 'auto', height: 'auto',
|
||||
padding: '0px 0px', opacity: 1, 'z-index': '202',
|
||||
left: 0, right: 0, 'margin': '0 auto',
|
||||
'background-color': 'rgba(0, 0, 255, 0.2)', 'box-shadow': '0px 10px 20px #888',
|
||||
border: '2px solid #CCCCCC'
|
||||
},
|
||||
_b));
|
||||
return LiveRegion;
|
||||
}(StringRegion));
|
||||
exports.LiveRegion = LiveRegion;
|
||||
var HoverRegion = (function (_super) {
|
||||
__extends(HoverRegion, _super);
|
||||
function HoverRegion(document) {
|
||||
var _this = _super.call(this, document) || this;
|
||||
_this.document = document;
|
||||
_this.inner.style.lineHeight = '0';
|
||||
return _this;
|
||||
}
|
||||
HoverRegion.prototype.position = function (node) {
|
||||
var nodeRect = node.getBoundingClientRect();
|
||||
var divRect = this.div.getBoundingClientRect();
|
||||
var xCenter = nodeRect.left + (nodeRect.width / 2);
|
||||
var left = xCenter - (divRect.width / 2);
|
||||
left = (left < 0) ? 0 : left;
|
||||
left = left + window.pageXOffset;
|
||||
var top;
|
||||
switch (this.document.options.a11y.align) {
|
||||
case 'top':
|
||||
top = nodeRect.top - divRect.height - 10;
|
||||
break;
|
||||
case 'bottom':
|
||||
top = nodeRect.bottom + 10;
|
||||
break;
|
||||
case 'center':
|
||||
default:
|
||||
var yCenter = nodeRect.top + (nodeRect.height / 2);
|
||||
top = yCenter - (divRect.height / 2);
|
||||
}
|
||||
top = top + window.pageYOffset;
|
||||
top = (top < 0) ? 0 : top;
|
||||
this.div.style.top = top + 'px';
|
||||
this.div.style.left = left + 'px';
|
||||
};
|
||||
HoverRegion.prototype.highlight = function (highlighter) {
|
||||
if (this.inner.firstChild &&
|
||||
!this.inner.firstChild.hasAttribute('sre-highlight')) {
|
||||
return;
|
||||
}
|
||||
var color = highlighter.colorString();
|
||||
this.inner.style.backgroundColor = color.background;
|
||||
this.inner.style.color = color.foreground;
|
||||
};
|
||||
HoverRegion.prototype.Show = function (node, highlighter) {
|
||||
this.div.style.fontSize = this.document.options.a11y.magnify;
|
||||
this.Update(node);
|
||||
_super.prototype.Show.call(this, node, highlighter);
|
||||
};
|
||||
HoverRegion.prototype.Clear = function () {
|
||||
this.inner.textContent = '';
|
||||
this.inner.style.top = '';
|
||||
this.inner.style.backgroundColor = '';
|
||||
};
|
||||
HoverRegion.prototype.Update = function (node) {
|
||||
this.Clear();
|
||||
var mjx = this.cloneNode(node);
|
||||
this.inner.appendChild(mjx);
|
||||
};
|
||||
HoverRegion.prototype.cloneNode = function (node) {
|
||||
var mjx = node.cloneNode(true);
|
||||
if (mjx.nodeName !== 'MJX-CONTAINER') {
|
||||
if (mjx.nodeName !== 'g') {
|
||||
mjx.style.marginLeft = mjx.style.marginRight = '0';
|
||||
}
|
||||
var container = node;
|
||||
while (container && container.nodeName !== 'MJX-CONTAINER') {
|
||||
container = container.parentNode;
|
||||
}
|
||||
if (mjx.nodeName !== 'MJX-MATH' && mjx.nodeName !== 'svg') {
|
||||
var child = container.firstChild;
|
||||
mjx = child.cloneNode(false).appendChild(mjx).parentNode;
|
||||
if (mjx.nodeName === 'svg') {
|
||||
mjx.firstChild.setAttribute('transform', 'matrix(1 0 0 -1 0 0)');
|
||||
var W = parseFloat(mjx.getAttribute('viewBox').split(/ /)[2]);
|
||||
var w = parseFloat(mjx.getAttribute('width'));
|
||||
var _a = node.getBBox(), x = _a.x, y = _a.y, width = _a.width, height = _a.height;
|
||||
mjx.setAttribute('viewBox', [x, -(y + height), width, height].join(' '));
|
||||
mjx.removeAttribute('style');
|
||||
mjx.setAttribute('width', (w / W * width) + 'ex');
|
||||
mjx.setAttribute('height', (w / W * height) + 'ex');
|
||||
container.setAttribute('sre-highlight', 'false');
|
||||
}
|
||||
}
|
||||
mjx = container.cloneNode(false).appendChild(mjx).parentNode;
|
||||
mjx.style.margin = '0';
|
||||
}
|
||||
return mjx;
|
||||
};
|
||||
HoverRegion.className = 'MJX_HoverRegion';
|
||||
HoverRegion.style = new StyleList_js_1.CssStyles((_c = {},
|
||||
_c['.' + HoverRegion.className] = {
|
||||
position: 'absolute', height: '1px', width: '1px',
|
||||
padding: '1px', overflow: 'hidden'
|
||||
},
|
||||
_c['.' + HoverRegion.className + '_Show'] = {
|
||||
position: 'absolute', width: 'max-content', height: 'auto',
|
||||
padding: '0px 0px', opacity: 1, 'z-index': '202', 'margin': '0 auto',
|
||||
'background-color': 'rgba(0, 0, 255, 0.2)',
|
||||
'box-shadow': '0px 10px 20px #888', border: '2px solid #CCCCCC'
|
||||
},
|
||||
_c));
|
||||
return HoverRegion;
|
||||
}(AbstractRegion));
|
||||
exports.HoverRegion = HoverRegion;
|
||||
//# sourceMappingURL=Region.js.map
|
||||
1
node_modules/mathjax-full/js/a11y/explorer/Region.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/a11y/explorer/Region.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
22
node_modules/mathjax-full/js/a11y/explorer/TreeExplorer.d.ts
generated
vendored
Normal file
22
node_modules/mathjax-full/js/a11y/explorer/TreeExplorer.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import { A11yDocument, Region } from './Region.js';
|
||||
import { Explorer, AbstractExplorer } from './Explorer.js';
|
||||
export interface TreeExplorer extends Explorer {
|
||||
}
|
||||
export declare class AbstractTreeExplorer extends AbstractExplorer<void> {
|
||||
document: A11yDocument;
|
||||
protected region: Region<void>;
|
||||
protected node: HTMLElement;
|
||||
protected mml: HTMLElement;
|
||||
protected constructor(document: A11yDocument, region: Region<void>, node: HTMLElement, mml: HTMLElement);
|
||||
readonly stoppable = false;
|
||||
Attach(): void;
|
||||
Detach(): void;
|
||||
}
|
||||
export declare class FlameColorer extends AbstractTreeExplorer {
|
||||
Start(): void;
|
||||
Stop(): void;
|
||||
}
|
||||
export declare class TreeColorer extends AbstractTreeExplorer {
|
||||
Start(): void;
|
||||
Stop(): void;
|
||||
}
|
||||
91
node_modules/mathjax-full/js/a11y/explorer/TreeExplorer.js
generated
vendored
Normal file
91
node_modules/mathjax-full/js/a11y/explorer/TreeExplorer.js
generated
vendored
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
"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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.TreeColorer = exports.FlameColorer = exports.AbstractTreeExplorer = void 0;
|
||||
var Explorer_js_1 = require("./Explorer.js");
|
||||
var sre_js_1 = __importDefault(require("../sre.js"));
|
||||
var AbstractTreeExplorer = (function (_super) {
|
||||
__extends(AbstractTreeExplorer, _super);
|
||||
function AbstractTreeExplorer(document, region, node, mml) {
|
||||
var _this = _super.call(this, document, null, node) || this;
|
||||
_this.document = document;
|
||||
_this.region = region;
|
||||
_this.node = node;
|
||||
_this.mml = mml;
|
||||
_this.stoppable = false;
|
||||
return _this;
|
||||
}
|
||||
AbstractTreeExplorer.prototype.Attach = function () {
|
||||
_super.prototype.Attach.call(this);
|
||||
this.Start();
|
||||
};
|
||||
AbstractTreeExplorer.prototype.Detach = function () {
|
||||
this.Stop();
|
||||
_super.prototype.Detach.call(this);
|
||||
};
|
||||
return AbstractTreeExplorer;
|
||||
}(Explorer_js_1.AbstractExplorer));
|
||||
exports.AbstractTreeExplorer = AbstractTreeExplorer;
|
||||
var FlameColorer = (function (_super) {
|
||||
__extends(FlameColorer, _super);
|
||||
function FlameColorer() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
FlameColorer.prototype.Start = function () {
|
||||
if (this.active)
|
||||
return;
|
||||
this.active = true;
|
||||
this.highlighter.highlightAll(this.node);
|
||||
};
|
||||
FlameColorer.prototype.Stop = function () {
|
||||
if (this.active) {
|
||||
this.highlighter.unhighlightAll();
|
||||
}
|
||||
this.active = false;
|
||||
};
|
||||
return FlameColorer;
|
||||
}(AbstractTreeExplorer));
|
||||
exports.FlameColorer = FlameColorer;
|
||||
var TreeColorer = (function (_super) {
|
||||
__extends(TreeColorer, _super);
|
||||
function TreeColorer() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
TreeColorer.prototype.Start = function () {
|
||||
if (this.active)
|
||||
return;
|
||||
this.active = true;
|
||||
var generator = sre_js_1.default.getSpeechGenerator('Color');
|
||||
if (!this.node.hasAttribute('hasforegroundcolor')) {
|
||||
generator.generateSpeech(this.node, this.mml);
|
||||
this.node.setAttribute('hasforegroundcolor', 'true');
|
||||
}
|
||||
this.highlighter.colorizeAll(this.node);
|
||||
};
|
||||
TreeColorer.prototype.Stop = function () {
|
||||
if (this.active) {
|
||||
this.highlighter.uncolorizeAll(this.node);
|
||||
}
|
||||
this.active = false;
|
||||
};
|
||||
return TreeColorer;
|
||||
}(AbstractTreeExplorer));
|
||||
exports.TreeColorer = TreeColorer;
|
||||
//# sourceMappingURL=TreeExplorer.js.map
|
||||
1
node_modules/mathjax-full/js/a11y/explorer/TreeExplorer.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/a11y/explorer/TreeExplorer.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"TreeExplorer.js","sourceRoot":"","sources":["../../../ts/a11y/explorer/TreeExplorer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AA2BA,6CAAyD;AACzD,qDAA4B;AAO5B;IAA0C,wCAAsB;IAK9D,8BAA6B,QAAsB,EACnB,MAAoB,EACpB,IAAiB,EACjB,GAAgB;QAHhD,YAIE,kBAAM,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,SAC5B;QAL4B,cAAQ,GAAR,QAAQ,CAAc;QACnB,YAAM,GAAN,MAAM,CAAc;QACpB,UAAI,GAAJ,IAAI,CAAa;QACjB,SAAG,GAAH,GAAG,CAAa;QAOhC,eAAS,GAAG,KAAK,CAAC;;IALlC,CAAC;IAWM,qCAAM,GAAb;QACE,iBAAM,MAAM,WAAE,CAAC;QACf,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAKM,qCAAM,GAAb;QACE,IAAI,CAAC,IAAI,EAAE,CAAC;QACZ,iBAAM,MAAM,WAAE,CAAC;IACjB,CAAC;IAEH,2BAAC;AAAD,CAAC,AAlCD,CAA0C,8BAAgB,GAkCzD;AAlCY,oDAAoB;AAqCjC;IAAkC,gCAAoB;IAAtD;;IAqBA,CAAC;IAhBQ,4BAAK,GAAZ;QACE,IAAI,IAAI,CAAC,MAAM;YAAE,OAAO;QACxB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAKM,2BAAI,GAAX;QACE,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC;SACnC;QACD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAEH,mBAAC;AAAD,CAAC,AArBD,CAAkC,oBAAoB,GAqBrD;AArBY,oCAAY;AAwBzB;IAAiC,+BAAoB;IAArD;;IA2BA,CAAC;IAtBQ,2BAAK,GAAZ;QACE,IAAI,IAAI,CAAC,MAAM;YAAE,OAAO;QACxB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,SAAS,GAAG,gBAAG,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAChD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,oBAAoB,CAAC,EAAE;YACjD,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;YAC9C,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;SACtD;QAEA,IAAI,CAAC,WAAmB,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;IAKM,0BAAI,GAAX;QACE,IAAI,IAAI,CAAC,MAAM,EAAE;YACd,IAAI,CAAC,WAAmB,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACpD;QACD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAEH,kBAAC;AAAD,CAAC,AA3BD,CAAiC,oBAAoB,GA2BpD;AA3BY,kCAAW"}
|
||||
4
node_modules/mathjax-full/js/a11y/mathmaps.d.ts
generated
vendored
Normal file
4
node_modules/mathjax-full/js/a11y/mathmaps.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
declare const MathMaps: Map<string, {
|
||||
[path: string]: any;
|
||||
}>;
|
||||
export default MathMaps;
|
||||
5
node_modules/mathjax-full/js/a11y/mathmaps.js
generated
vendored
Normal file
5
node_modules/mathjax-full/js/a11y/mathmaps.js
generated
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var MathMaps = new Map();
|
||||
exports.default = MathMaps;
|
||||
//# sourceMappingURL=mathmaps.js.map
|
||||
1
node_modules/mathjax-full/js/a11y/mathmaps.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/a11y/mathmaps.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"mathmaps.js","sourceRoot":"","sources":["../../ts/a11y/mathmaps.ts"],"names":[],"mappings":";;AAwBA,IAAM,QAAQ,GAAuC,IAAI,GAAG,EAAE,CAAC;AAE/D,kBAAe,QAAQ,CAAC"}
|
||||
18
node_modules/mathjax-full/js/a11y/semantic-enrich.d.ts
generated
vendored
Normal file
18
node_modules/mathjax-full/js/a11y/semantic-enrich.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import { Handler } from '../core/Handler.js';
|
||||
import { MathDocument, AbstractMathDocument, MathDocumentConstructor } from '../core/MathDocument.js';
|
||||
import { MathItem, AbstractMathItem } from '../core/MathItem.js';
|
||||
import { MmlNode } from '../core/MmlTree/MmlNode.js';
|
||||
import { MathML } from '../input/mathml.js';
|
||||
export declare type Constructor<T> = new (...args: any[]) => T;
|
||||
export interface EnrichedMathItem<N, T, D> extends MathItem<N, T, D> {
|
||||
enrich(document: MathDocument<N, T, D>, force?: boolean): void;
|
||||
attachSpeech(document: MathDocument<N, T, D>): void;
|
||||
}
|
||||
export declare function EnrichedMathItemMixin<N, T, D, B extends Constructor<AbstractMathItem<N, T, D>>>(BaseMathItem: B, MmlJax: MathML<N, T, D>, toMathML: (node: MmlNode) => string): Constructor<EnrichedMathItem<N, T, D>> & B;
|
||||
export interface EnrichedMathDocument<N, T, D> extends AbstractMathDocument<N, T, D> {
|
||||
enrich(): EnrichedMathDocument<N, T, D>;
|
||||
attachSpeech(): EnrichedMathDocument<N, T, D>;
|
||||
enrichError(doc: EnrichedMathDocument<N, T, D>, math: EnrichedMathItem<N, T, D>, err: Error): void;
|
||||
}
|
||||
export declare function EnrichedMathDocumentMixin<N, T, D, B extends MathDocumentConstructor<AbstractMathDocument<N, T, D>>>(BaseDocument: B, MmlJax: MathML<N, T, D>): MathDocumentConstructor<EnrichedMathDocument<N, T, D>> & B;
|
||||
export declare function EnrichHandler<N, T, D>(handler: Handler<N, T, D>, MmlJax: MathML<N, T, D>): Handler<N, T, D>;
|
||||
269
node_modules/mathjax-full/js/a11y/semantic-enrich.js
generated
vendored
Normal file
269
node_modules/mathjax-full/js/a11y/semantic-enrich.js
generated
vendored
Normal file
|
|
@ -0,0 +1,269 @@
|
|||
"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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
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.");
|
||||
};
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.EnrichHandler = exports.EnrichedMathDocumentMixin = exports.EnrichedMathItemMixin = void 0;
|
||||
var mathjax_js_1 = require("../mathjax.js");
|
||||
var MathItem_js_1 = require("../core/MathItem.js");
|
||||
var SerializedMmlVisitor_js_1 = require("../core/MmlTree/SerializedMmlVisitor.js");
|
||||
var Options_js_1 = require("../util/Options.js");
|
||||
var sre_js_1 = __importDefault(require("./sre.js"));
|
||||
var currentSpeech = 'none';
|
||||
(0, MathItem_js_1.newState)('ENRICHED', 30);
|
||||
(0, MathItem_js_1.newState)('ATTACHSPEECH', 155);
|
||||
function EnrichedMathItemMixin(BaseMathItem, MmlJax, toMathML) {
|
||||
return (function (_super) {
|
||||
__extends(class_1, _super);
|
||||
function class_1() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
class_1.prototype.serializeMml = function (node) {
|
||||
if ('outerHTML' in node) {
|
||||
return node.outerHTML;
|
||||
}
|
||||
if (typeof Element !== 'undefined' && typeof window !== 'undefined' && node instanceof Element) {
|
||||
var div = window.document.createElement('div');
|
||||
div.appendChild(node);
|
||||
return div.innerHTML;
|
||||
}
|
||||
return node.toString();
|
||||
};
|
||||
class_1.prototype.enrich = function (document, force) {
|
||||
if (force === void 0) { force = false; }
|
||||
if (this.state() >= MathItem_js_1.STATE.ENRICHED)
|
||||
return;
|
||||
if (!this.isEscaped && (document.options.enableEnrichment || force)) {
|
||||
if (document.options.sre.speech !== currentSpeech) {
|
||||
currentSpeech = document.options.sre.speech;
|
||||
mathjax_js_1.mathjax.retryAfter(sre_js_1.default.setupEngine(document.options.sre).then(function () { return sre_js_1.default.sreReady(); }));
|
||||
}
|
||||
var math = new document.options.MathItem('', MmlJax);
|
||||
try {
|
||||
var mml = this.inputData.originalMml = toMathML(this.root);
|
||||
math.math = this.serializeMml(sre_js_1.default.toEnriched(mml));
|
||||
math.display = this.display;
|
||||
math.compile(document);
|
||||
this.root = math.root;
|
||||
this.inputData.enrichedMml = math.math;
|
||||
}
|
||||
catch (err) {
|
||||
document.options.enrichError(document, this, err);
|
||||
}
|
||||
}
|
||||
this.state(MathItem_js_1.STATE.ENRICHED);
|
||||
};
|
||||
class_1.prototype.attachSpeech = function (document) {
|
||||
var e_1, _a;
|
||||
if (this.state() >= MathItem_js_1.STATE.ATTACHSPEECH)
|
||||
return;
|
||||
var attributes = this.root.attributes;
|
||||
var speech = (attributes.get('aria-label') ||
|
||||
this.getSpeech(this.root));
|
||||
if (speech) {
|
||||
var adaptor = document.adaptor;
|
||||
var node = this.typesetRoot;
|
||||
adaptor.setAttribute(node, 'aria-label', speech);
|
||||
try {
|
||||
for (var _b = __values(adaptor.childNodes(node)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var child = _c.value;
|
||||
adaptor.setAttribute(child, 'aria-hidden', 'true');
|
||||
}
|
||||
}
|
||||
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; }
|
||||
}
|
||||
}
|
||||
this.state(MathItem_js_1.STATE.ATTACHSPEECH);
|
||||
};
|
||||
class_1.prototype.getSpeech = function (node) {
|
||||
var e_2, _a;
|
||||
var attributes = node.attributes;
|
||||
if (!attributes)
|
||||
return '';
|
||||
var speech = attributes.getExplicit('data-semantic-speech');
|
||||
if (!attributes.getExplicit('data-semantic-parent') && speech) {
|
||||
return speech;
|
||||
}
|
||||
try {
|
||||
for (var _b = __values(node.childNodes), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var child = _c.value;
|
||||
var value = this.getSpeech(child);
|
||||
if (value != null) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_2) throw e_2.error; }
|
||||
}
|
||||
return '';
|
||||
};
|
||||
return class_1;
|
||||
}(BaseMathItem));
|
||||
}
|
||||
exports.EnrichedMathItemMixin = EnrichedMathItemMixin;
|
||||
function EnrichedMathDocumentMixin(BaseDocument, MmlJax) {
|
||||
var _a;
|
||||
return _a = (function (_super) {
|
||||
__extends(class_2, _super);
|
||||
function class_2() {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
var _this = _super.apply(this, __spreadArray([], __read(args), false)) || this;
|
||||
MmlJax.setMmlFactory(_this.mmlFactory);
|
||||
var ProcessBits = _this.constructor.ProcessBits;
|
||||
if (!ProcessBits.has('enriched')) {
|
||||
ProcessBits.allocate('enriched');
|
||||
ProcessBits.allocate('attach-speech');
|
||||
}
|
||||
var visitor = new SerializedMmlVisitor_js_1.SerializedMmlVisitor(_this.mmlFactory);
|
||||
var toMathML = (function (node) { return visitor.visitTree(node); });
|
||||
_this.options.MathItem =
|
||||
EnrichedMathItemMixin(_this.options.MathItem, MmlJax, toMathML);
|
||||
return _this;
|
||||
}
|
||||
class_2.prototype.attachSpeech = function () {
|
||||
var e_3, _a;
|
||||
if (!this.processed.isSet('attach-speech')) {
|
||||
try {
|
||||
for (var _b = __values(this.math), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var math = _c.value;
|
||||
math.attachSpeech(this);
|
||||
}
|
||||
}
|
||||
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_3) throw e_3.error; }
|
||||
}
|
||||
this.processed.set('attach-speech');
|
||||
}
|
||||
return this;
|
||||
};
|
||||
class_2.prototype.enrich = function () {
|
||||
var e_4, _a;
|
||||
if (!this.processed.isSet('enriched')) {
|
||||
if (this.options.enableEnrichment) {
|
||||
try {
|
||||
for (var _b = __values(this.math), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var math = _c.value;
|
||||
math.enrich(this);
|
||||
}
|
||||
}
|
||||
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_4) throw e_4.error; }
|
||||
}
|
||||
}
|
||||
this.processed.set('enriched');
|
||||
}
|
||||
return this;
|
||||
};
|
||||
class_2.prototype.enrichError = function (_doc, _math, err) {
|
||||
console.warn('Enrichment error:', err);
|
||||
};
|
||||
class_2.prototype.state = function (state, restore) {
|
||||
if (restore === void 0) { restore = false; }
|
||||
_super.prototype.state.call(this, state, restore);
|
||||
if (state < MathItem_js_1.STATE.ENRICHED) {
|
||||
this.processed.clear('enriched');
|
||||
}
|
||||
return this;
|
||||
};
|
||||
return class_2;
|
||||
}(BaseDocument)),
|
||||
_a.OPTIONS = __assign(__assign({}, BaseDocument.OPTIONS), { enableEnrichment: true, enrichError: function (doc, math, err) { return doc.enrichError(doc, math, err); }, renderActions: (0, Options_js_1.expandable)(__assign(__assign({}, BaseDocument.OPTIONS.renderActions), { enrich: [MathItem_js_1.STATE.ENRICHED], attachSpeech: [MathItem_js_1.STATE.ATTACHSPEECH] })), sre: (0, Options_js_1.expandable)({
|
||||
speech: 'none',
|
||||
domain: 'mathspeak',
|
||||
style: 'default',
|
||||
locale: 'en'
|
||||
}) }),
|
||||
_a;
|
||||
}
|
||||
exports.EnrichedMathDocumentMixin = EnrichedMathDocumentMixin;
|
||||
function EnrichHandler(handler, MmlJax) {
|
||||
MmlJax.setAdaptor(handler.adaptor);
|
||||
handler.documentClass =
|
||||
EnrichedMathDocumentMixin(handler.documentClass, MmlJax);
|
||||
return handler;
|
||||
}
|
||||
exports.EnrichHandler = EnrichHandler;
|
||||
//# sourceMappingURL=semantic-enrich.js.map
|
||||
1
node_modules/mathjax-full/js/a11y/semantic-enrich.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/a11y/semantic-enrich.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
27
node_modules/mathjax-full/js/a11y/sre.d.ts
generated
vendored
Normal file
27
node_modules/mathjax-full/js/a11y/sre.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import * as Api from 'speech-rule-engine/js/common/system.js';
|
||||
import { Walker } from 'speech-rule-engine/js/walker/walker.js';
|
||||
import * as WalkerFactory from 'speech-rule-engine/js/walker/walker_factory.js';
|
||||
import * as SpeechGeneratorFactory from 'speech-rule-engine/js/speech_generator/speech_generator_factory.js';
|
||||
import { ClearspeakPreferences } from 'speech-rule-engine/js/speech_rules/clearspeak_preferences.js';
|
||||
import { Highlighter } from 'speech-rule-engine/js/highlighter/highlighter.js';
|
||||
import * as HighlighterFactory from 'speech-rule-engine/js/highlighter/highlighter_factory.js';
|
||||
import { SpeechGenerator } from 'speech-rule-engine/js/speech_generator/speech_generator.js';
|
||||
export declare namespace Sre {
|
||||
type highlighter = Highlighter;
|
||||
type speechGenerator = SpeechGenerator;
|
||||
type walker = Walker;
|
||||
const locales: Map<string, string>;
|
||||
const sreReady: typeof Api.engineReady;
|
||||
const setupEngine: typeof Api.setupEngine;
|
||||
const engineSetup: typeof Api.engineSetup;
|
||||
const toEnriched: typeof Api.toEnriched;
|
||||
const toSpeech: typeof Api.toSpeech;
|
||||
const clearspeakPreferences: typeof ClearspeakPreferences;
|
||||
const getHighlighter: typeof HighlighterFactory.highlighter;
|
||||
const getSpeechGenerator: typeof SpeechGeneratorFactory.generator;
|
||||
const getWalker: typeof WalkerFactory.walker;
|
||||
const clearspeakStyle: () => string;
|
||||
const preloadLocales: (locale: string) => Promise<unknown>;
|
||||
}
|
||||
export declare const sreReady: typeof Api.engineReady;
|
||||
export default Sre;
|
||||
104
node_modules/mathjax-full/js/a11y/sre.js
generated
vendored
Normal file
104
node_modules/mathjax-full/js/a11y/sre.js
generated
vendored
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (_) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.sreReady = exports.Sre = void 0;
|
||||
var Api = __importStar(require("speech-rule-engine/js/common/system.js"));
|
||||
var WalkerFactory = __importStar(require("speech-rule-engine/js/walker/walker_factory.js"));
|
||||
var SpeechGeneratorFactory = __importStar(require("speech-rule-engine/js/speech_generator/speech_generator_factory.js"));
|
||||
var EngineConst = __importStar(require("speech-rule-engine/js/common/engine_const.js"));
|
||||
var engine_js_1 = __importDefault(require("speech-rule-engine/js/common/engine.js"));
|
||||
var clearspeak_preferences_js_1 = require("speech-rule-engine/js/speech_rules/clearspeak_preferences.js");
|
||||
var HighlighterFactory = __importStar(require("speech-rule-engine/js/highlighter/highlighter_factory.js"));
|
||||
var variables_js_1 = require("speech-rule-engine/js/common/variables.js");
|
||||
var mathmaps_js_1 = __importDefault(require("./mathmaps.js"));
|
||||
var Sre;
|
||||
(function (Sre) {
|
||||
Sre.locales = variables_js_1.Variables.LOCALES;
|
||||
Sre.sreReady = Api.engineReady;
|
||||
Sre.setupEngine = Api.setupEngine;
|
||||
Sre.engineSetup = Api.engineSetup;
|
||||
Sre.toEnriched = Api.toEnriched;
|
||||
Sre.toSpeech = Api.toSpeech;
|
||||
Sre.clearspeakPreferences = clearspeak_preferences_js_1.ClearspeakPreferences;
|
||||
Sre.getHighlighter = HighlighterFactory.highlighter;
|
||||
Sre.getSpeechGenerator = SpeechGeneratorFactory.generator;
|
||||
Sre.getWalker = WalkerFactory.walker;
|
||||
Sre.clearspeakStyle = function () {
|
||||
return EngineConst.DOMAIN_TO_STYLES['clearspeak'];
|
||||
};
|
||||
Sre.preloadLocales = function (locale) {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var json;
|
||||
return __generator(this, function (_a) {
|
||||
json = mathmaps_js_1.default.get(locale);
|
||||
return [2, json ? new Promise(function (res, _rej) { return res(JSON.stringify(json)); }) :
|
||||
Api.localeLoader()(locale)];
|
||||
});
|
||||
});
|
||||
};
|
||||
})(Sre = exports.Sre || (exports.Sre = {}));
|
||||
exports.sreReady = Sre.sreReady;
|
||||
engine_js_1.default.getInstance().delay = true;
|
||||
exports.default = Sre;
|
||||
//# sourceMappingURL=sre.js.map
|
||||
1
node_modules/mathjax-full/js/a11y/sre.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/a11y/sre.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"sre.js","sourceRoot":"","sources":["../../ts/a11y/sre.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,0EAA8D;AAE9D,4FAAgF;AAChF,yHAA6G;AAC7G,wFAA4E;AAC5E,qFAA4D;AAC5D,0GAAmG;AAEnG,2GAA+F;AAE/F,0EAAoE;AACpE,8DAAqC;AAErC,IAAiB,GAAG,CA2CnB;AA3CD,WAAiB,GAAG;IASL,WAAO,GAAG,wBAAS,CAAC,OAAO,CAAC;IAE5B,YAAQ,GAAG,GAAG,CAAC,WAAW,CAAC;IAE3B,eAAW,GAAG,GAAG,CAAC,WAAW,CAAC;IAE9B,eAAW,GAAG,GAAG,CAAC,WAAW,CAAC;IAE9B,cAAU,GAAG,GAAG,CAAC,UAAU,CAAC;IAE5B,YAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;IAExB,yBAAqB,GAAG,iDAAqB,CAAC;IAE9C,kBAAc,GAAG,kBAAkB,CAAC,WAAW,CAAC;IAEhD,sBAAkB,GAAG,sBAAsB,CAAC,SAAS,CAAC;IAEtD,aAAS,GAAG,aAAa,CAAC,MAAM,CAAC;IAEjC,mBAAe,GAAG;QAC7B,OAAO,WAAW,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;IACpD,CAAC,CAAC;IAMW,kBAAc,GAAG,UAAe,MAAc;;;;gBACnD,IAAI,GAAG,qBAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;gBAClC,WAAO,IAAI,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,UAAC,GAAG,EAAE,IAAI,IAAK,OAAA,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,EAAzB,CAAyB,CAAC,CAAC,CAAC;wBACnE,GAAG,CAAC,YAAY,EAAE,CAAC,MAAM,CAAC,EAAC;;;KAC9B,CAAC;AAEJ,CAAC,EA3CgB,GAAG,GAAH,WAAG,KAAH,WAAG,QA2CnB;AAQY,QAAA,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAKrC,mBAAM,CAAC,WAAW,EAAE,CAAC,KAAK,GAAG,IAAI,CAAC;AAElC,kBAAe,GAAG,CAAC"}
|
||||
146
node_modules/mathjax-full/js/adaptors/HTMLAdaptor.d.ts
generated
vendored
Normal file
146
node_modules/mathjax-full/js/adaptors/HTMLAdaptor.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
import { OptionList } from '../util/Options.js';
|
||||
import { AttributeData, AbstractDOMAdaptor, DOMAdaptor } from '../core/DOMAdaptor.js';
|
||||
export interface MinDocument<N, T> {
|
||||
documentElement: N;
|
||||
head: N;
|
||||
body: N;
|
||||
title: string;
|
||||
doctype: {
|
||||
name: string;
|
||||
};
|
||||
createElement(kind: string): N;
|
||||
createElementNS(ns: string, kind: string): N;
|
||||
createTextNode(text: string): T;
|
||||
querySelectorAll(selector: string): ArrayLike<N>;
|
||||
}
|
||||
export interface MinHTMLElement<N, T> {
|
||||
nodeType: number;
|
||||
nodeName: string;
|
||||
nodeValue: string;
|
||||
textContent: string;
|
||||
innerHTML: string;
|
||||
outerHTML: string;
|
||||
parentNode: N | Node;
|
||||
nextSibling: N | T | Node;
|
||||
previousSibling: N | T | Node;
|
||||
offsetWidth: number;
|
||||
offsetHeight: number;
|
||||
attributes: AttributeData[] | NamedNodeMap;
|
||||
className: string;
|
||||
classList: DOMTokenList;
|
||||
style: OptionList;
|
||||
sheet?: {
|
||||
insertRule: (rule: string, index?: number) => void;
|
||||
};
|
||||
childNodes: (N | T)[] | NodeList;
|
||||
firstChild: N | T | Node;
|
||||
lastChild: N | T | Node;
|
||||
getElementsByTagName(name: string): N[] | HTMLCollectionOf<Element>;
|
||||
getElementsByTagNameNS(ns: string, name: string): N[] | HTMLCollectionOf<Element>;
|
||||
contains(child: N | T): boolean;
|
||||
appendChild(child: N | T): N | T | Node;
|
||||
removeChild(child: N | T): N | T | Node;
|
||||
replaceChild(nnode: N | T, onode: N | T): N | T | Node;
|
||||
insertBefore(nchild: N | T, ochild: N | T): void;
|
||||
cloneNode(deep: boolean): N | Node;
|
||||
setAttribute(name: string, value: string): void;
|
||||
setAttributeNS(ns: string, name: string, value: string): void;
|
||||
getAttribute(name: string): string;
|
||||
removeAttribute(name: string): void;
|
||||
hasAttribute(name: string): boolean;
|
||||
getBoundingClientRect(): Object;
|
||||
getBBox?(): {
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
};
|
||||
}
|
||||
export interface MinText<N, T> {
|
||||
nodeType: number;
|
||||
nodeName: string;
|
||||
nodeValue: string;
|
||||
parentNode: N | Node;
|
||||
nextSibling: N | T | Node;
|
||||
previousSibling: N | T | Node;
|
||||
splitText(n: number): T;
|
||||
}
|
||||
export interface MinDOMParser<D> {
|
||||
parseFromString(text: string, format?: string): D;
|
||||
}
|
||||
export interface MinXMLSerializer<N> {
|
||||
serializeToString(node: N): string;
|
||||
}
|
||||
export interface MinWindow<N, D> {
|
||||
document: D;
|
||||
DOMParser: {
|
||||
new (): MinDOMParser<D>;
|
||||
};
|
||||
XMLSerializer: {
|
||||
new (): MinXMLSerializer<N>;
|
||||
};
|
||||
NodeList: any;
|
||||
HTMLCollection: any;
|
||||
HTMLElement: any;
|
||||
DocumentFragment: any;
|
||||
Document: any;
|
||||
getComputedStyle(node: N): any;
|
||||
}
|
||||
export interface MinHTMLAdaptor<N, T, D> extends DOMAdaptor<N, T, D> {
|
||||
window: MinWindow<N, D>;
|
||||
}
|
||||
export declare class HTMLAdaptor<N extends MinHTMLElement<N, T>, T extends MinText<N, T>, D extends MinDocument<N, T>> extends AbstractDOMAdaptor<N, T, D> implements MinHTMLAdaptor<N, T, D> {
|
||||
window: MinWindow<N, D>;
|
||||
parser: MinDOMParser<D>;
|
||||
constructor(window: MinWindow<N, D>);
|
||||
parse(text: string, format?: string): D;
|
||||
protected create(kind: string, ns?: string): N;
|
||||
text(text: string): T;
|
||||
head(doc: D): N;
|
||||
body(doc: D): N;
|
||||
root(doc: D): N;
|
||||
doctype(doc: D): string;
|
||||
tags(node: N, name: string, ns?: string): N[];
|
||||
getElements(nodes: (string | N | N[])[], _document: D): N[];
|
||||
contains(container: N, node: N | T): boolean;
|
||||
parent(node: N | T): N;
|
||||
append(node: N, child: N | T): N | T;
|
||||
insert(nchild: N | T, ochild: N | T): void;
|
||||
remove(child: N | T): N | T;
|
||||
replace(nnode: N | T, onode: N | T): N | T;
|
||||
clone(node: N): N;
|
||||
split(node: T, n: number): T;
|
||||
next(node: N | T): N | T;
|
||||
previous(node: N | T): N | T;
|
||||
firstChild(node: N): N | T;
|
||||
lastChild(node: N): N | T;
|
||||
childNodes(node: N): (N | T)[];
|
||||
childNode(node: N, i: number): N | T;
|
||||
kind(node: N | T): string;
|
||||
value(node: N | T): string;
|
||||
textContent(node: N): string;
|
||||
innerHTML(node: N): string;
|
||||
outerHTML(node: N): string;
|
||||
serializeXML(node: N): string;
|
||||
setAttribute(node: N, name: string, value: string, ns?: string): void;
|
||||
getAttribute(node: N, name: string): string;
|
||||
removeAttribute(node: N, name: string): void;
|
||||
hasAttribute(node: N, name: string): boolean;
|
||||
allAttributes(node: N): AttributeData[];
|
||||
addClass(node: N, name: string): void;
|
||||
removeClass(node: N, name: string): void;
|
||||
hasClass(node: N, name: string): boolean;
|
||||
setStyle(node: N, name: string, value: string): void;
|
||||
getStyle(node: N, name: string): any;
|
||||
allStyles(node: N): any;
|
||||
insertRules(node: N, rules: string[]): void;
|
||||
fontSize(node: N): number;
|
||||
fontFamily(node: N): any;
|
||||
nodeSize(node: N, em?: number, local?: boolean): [number, number];
|
||||
nodeBBox(node: N): {
|
||||
left: number;
|
||||
right: number;
|
||||
top: number;
|
||||
bottom: number;
|
||||
};
|
||||
}
|
||||
257
node_modules/mathjax-full/js/adaptors/HTMLAdaptor.js
generated
vendored
Normal file
257
node_modules/mathjax-full/js/adaptors/HTMLAdaptor.js
generated
vendored
Normal file
|
|
@ -0,0 +1,257 @@
|
|||
"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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
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.HTMLAdaptor = void 0;
|
||||
var DOMAdaptor_js_1 = require("../core/DOMAdaptor.js");
|
||||
var HTMLAdaptor = (function (_super) {
|
||||
__extends(HTMLAdaptor, _super);
|
||||
function HTMLAdaptor(window) {
|
||||
var _this = _super.call(this, window.document) || this;
|
||||
_this.window = window;
|
||||
_this.parser = new window.DOMParser();
|
||||
return _this;
|
||||
}
|
||||
HTMLAdaptor.prototype.parse = function (text, format) {
|
||||
if (format === void 0) { format = 'text/html'; }
|
||||
return this.parser.parseFromString(text, format);
|
||||
};
|
||||
HTMLAdaptor.prototype.create = function (kind, ns) {
|
||||
return (ns ?
|
||||
this.document.createElementNS(ns, kind) :
|
||||
this.document.createElement(kind));
|
||||
};
|
||||
HTMLAdaptor.prototype.text = function (text) {
|
||||
return this.document.createTextNode(text);
|
||||
};
|
||||
HTMLAdaptor.prototype.head = function (doc) {
|
||||
return doc.head || doc;
|
||||
};
|
||||
HTMLAdaptor.prototype.body = function (doc) {
|
||||
return doc.body || doc;
|
||||
};
|
||||
HTMLAdaptor.prototype.root = function (doc) {
|
||||
return doc.documentElement || doc;
|
||||
};
|
||||
HTMLAdaptor.prototype.doctype = function (doc) {
|
||||
return (doc.doctype ? "<!DOCTYPE ".concat(doc.doctype.name, ">") : '');
|
||||
};
|
||||
HTMLAdaptor.prototype.tags = function (node, name, ns) {
|
||||
if (ns === void 0) { ns = null; }
|
||||
var nodes = (ns ? node.getElementsByTagNameNS(ns, name) : node.getElementsByTagName(name));
|
||||
return Array.from(nodes);
|
||||
};
|
||||
HTMLAdaptor.prototype.getElements = function (nodes, _document) {
|
||||
var e_1, _a;
|
||||
var containers = [];
|
||||
try {
|
||||
for (var nodes_1 = __values(nodes), nodes_1_1 = nodes_1.next(); !nodes_1_1.done; nodes_1_1 = nodes_1.next()) {
|
||||
var node = nodes_1_1.value;
|
||||
if (typeof (node) === 'string') {
|
||||
containers = containers.concat(Array.from(this.document.querySelectorAll(node)));
|
||||
}
|
||||
else if (Array.isArray(node)) {
|
||||
containers = containers.concat(Array.from(node));
|
||||
}
|
||||
else if (node instanceof this.window.NodeList || node instanceof this.window.HTMLCollection) {
|
||||
containers = containers.concat(Array.from(node));
|
||||
}
|
||||
else {
|
||||
containers.push(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (nodes_1_1 && !nodes_1_1.done && (_a = nodes_1.return)) _a.call(nodes_1);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
return containers;
|
||||
};
|
||||
HTMLAdaptor.prototype.contains = function (container, node) {
|
||||
return container.contains(node);
|
||||
};
|
||||
HTMLAdaptor.prototype.parent = function (node) {
|
||||
return node.parentNode;
|
||||
};
|
||||
HTMLAdaptor.prototype.append = function (node, child) {
|
||||
return node.appendChild(child);
|
||||
};
|
||||
HTMLAdaptor.prototype.insert = function (nchild, ochild) {
|
||||
return this.parent(ochild).insertBefore(nchild, ochild);
|
||||
};
|
||||
HTMLAdaptor.prototype.remove = function (child) {
|
||||
return this.parent(child).removeChild(child);
|
||||
};
|
||||
HTMLAdaptor.prototype.replace = function (nnode, onode) {
|
||||
return this.parent(onode).replaceChild(nnode, onode);
|
||||
};
|
||||
HTMLAdaptor.prototype.clone = function (node) {
|
||||
return node.cloneNode(true);
|
||||
};
|
||||
HTMLAdaptor.prototype.split = function (node, n) {
|
||||
return node.splitText(n);
|
||||
};
|
||||
HTMLAdaptor.prototype.next = function (node) {
|
||||
return node.nextSibling;
|
||||
};
|
||||
HTMLAdaptor.prototype.previous = function (node) {
|
||||
return node.previousSibling;
|
||||
};
|
||||
HTMLAdaptor.prototype.firstChild = function (node) {
|
||||
return node.firstChild;
|
||||
};
|
||||
HTMLAdaptor.prototype.lastChild = function (node) {
|
||||
return node.lastChild;
|
||||
};
|
||||
HTMLAdaptor.prototype.childNodes = function (node) {
|
||||
return Array.from(node.childNodes);
|
||||
};
|
||||
HTMLAdaptor.prototype.childNode = function (node, i) {
|
||||
return node.childNodes[i];
|
||||
};
|
||||
HTMLAdaptor.prototype.kind = function (node) {
|
||||
var n = node.nodeType;
|
||||
return (n === 1 || n === 3 || n === 8 ? node.nodeName.toLowerCase() : '');
|
||||
};
|
||||
HTMLAdaptor.prototype.value = function (node) {
|
||||
return node.nodeValue || '';
|
||||
};
|
||||
HTMLAdaptor.prototype.textContent = function (node) {
|
||||
return node.textContent;
|
||||
};
|
||||
HTMLAdaptor.prototype.innerHTML = function (node) {
|
||||
return node.innerHTML;
|
||||
};
|
||||
HTMLAdaptor.prototype.outerHTML = function (node) {
|
||||
return node.outerHTML;
|
||||
};
|
||||
HTMLAdaptor.prototype.serializeXML = function (node) {
|
||||
var serializer = new this.window.XMLSerializer();
|
||||
return serializer.serializeToString(node);
|
||||
};
|
||||
HTMLAdaptor.prototype.setAttribute = function (node, name, value, ns) {
|
||||
if (ns === void 0) { ns = null; }
|
||||
if (!ns) {
|
||||
return node.setAttribute(name, value);
|
||||
}
|
||||
name = ns.replace(/.*\//, '') + ':' + name.replace(/^.*:/, '');
|
||||
return node.setAttributeNS(ns, name, value);
|
||||
};
|
||||
HTMLAdaptor.prototype.getAttribute = function (node, name) {
|
||||
return node.getAttribute(name);
|
||||
};
|
||||
HTMLAdaptor.prototype.removeAttribute = function (node, name) {
|
||||
return node.removeAttribute(name);
|
||||
};
|
||||
HTMLAdaptor.prototype.hasAttribute = function (node, name) {
|
||||
return node.hasAttribute(name);
|
||||
};
|
||||
HTMLAdaptor.prototype.allAttributes = function (node) {
|
||||
return Array.from(node.attributes).map(function (x) {
|
||||
return { name: x.name, value: x.value };
|
||||
});
|
||||
};
|
||||
HTMLAdaptor.prototype.addClass = function (node, name) {
|
||||
if (node.classList) {
|
||||
node.classList.add(name);
|
||||
}
|
||||
else {
|
||||
node.className = (node.className + ' ' + name).trim();
|
||||
}
|
||||
};
|
||||
HTMLAdaptor.prototype.removeClass = function (node, name) {
|
||||
if (node.classList) {
|
||||
node.classList.remove(name);
|
||||
}
|
||||
else {
|
||||
node.className = node.className.split(/ /).filter(function (c) { return c !== name; }).join(' ');
|
||||
}
|
||||
};
|
||||
HTMLAdaptor.prototype.hasClass = function (node, name) {
|
||||
if (node.classList) {
|
||||
return node.classList.contains(name);
|
||||
}
|
||||
return node.className.split(/ /).indexOf(name) >= 0;
|
||||
};
|
||||
HTMLAdaptor.prototype.setStyle = function (node, name, value) {
|
||||
node.style[name] = value;
|
||||
};
|
||||
HTMLAdaptor.prototype.getStyle = function (node, name) {
|
||||
return node.style[name];
|
||||
};
|
||||
HTMLAdaptor.prototype.allStyles = function (node) {
|
||||
return node.style.cssText;
|
||||
};
|
||||
HTMLAdaptor.prototype.insertRules = function (node, rules) {
|
||||
var e_2, _a;
|
||||
try {
|
||||
for (var _b = __values(rules.reverse()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var rule = _c.value;
|
||||
try {
|
||||
node.sheet.insertRule(rule, 0);
|
||||
}
|
||||
catch (e) {
|
||||
console.warn("MathJax: can't insert css rule '".concat(rule, "': ").concat(e.message));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_2) throw e_2.error; }
|
||||
}
|
||||
};
|
||||
HTMLAdaptor.prototype.fontSize = function (node) {
|
||||
var style = this.window.getComputedStyle(node);
|
||||
return parseFloat(style.fontSize);
|
||||
};
|
||||
HTMLAdaptor.prototype.fontFamily = function (node) {
|
||||
var style = this.window.getComputedStyle(node);
|
||||
return style.fontFamily || '';
|
||||
};
|
||||
HTMLAdaptor.prototype.nodeSize = function (node, em, local) {
|
||||
if (em === void 0) { em = 1; }
|
||||
if (local === void 0) { local = false; }
|
||||
if (local && node.getBBox) {
|
||||
var _a = node.getBBox(), width = _a.width, height = _a.height;
|
||||
return [width / em, height / em];
|
||||
}
|
||||
return [node.offsetWidth / em, node.offsetHeight / em];
|
||||
};
|
||||
HTMLAdaptor.prototype.nodeBBox = function (node) {
|
||||
var _a = node.getBoundingClientRect(), left = _a.left, right = _a.right, top = _a.top, bottom = _a.bottom;
|
||||
return { left: left, right: right, top: top, bottom: bottom };
|
||||
};
|
||||
return HTMLAdaptor;
|
||||
}(DOMAdaptor_js_1.AbstractDOMAdaptor));
|
||||
exports.HTMLAdaptor = HTMLAdaptor;
|
||||
//# sourceMappingURL=HTMLAdaptor.js.map
|
||||
1
node_modules/mathjax-full/js/adaptors/HTMLAdaptor.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/adaptors/HTMLAdaptor.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
6
node_modules/mathjax-full/js/adaptors/NodeMixin.d.ts
generated
vendored
Normal file
6
node_modules/mathjax-full/js/adaptors/NodeMixin.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import { DOMAdaptor } from '../core/DOMAdaptor.js';
|
||||
import { OptionList } from '../util/Options.js';
|
||||
export declare type Constructor<T> = (new (...args: any[]) => T);
|
||||
export declare type AdaptorConstructor<N, T, D> = Constructor<DOMAdaptor<N, T, D>>;
|
||||
export declare const NodeMixinOptions: OptionList;
|
||||
export declare function NodeMixin<N, T, D, A extends AdaptorConstructor<N, T, D>>(Base: A, options?: typeof NodeMixinOptions): A;
|
||||
106
node_modules/mathjax-full/js/adaptors/NodeMixin.js
generated
vendored
Normal file
106
node_modules/mathjax-full/js/adaptors/NodeMixin.js
generated
vendored
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
"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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
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);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.NodeMixin = exports.NodeMixinOptions = void 0;
|
||||
var Options_js_1 = require("../util/Options.js");
|
||||
exports.NodeMixinOptions = {
|
||||
badCSS: true,
|
||||
badSizes: true,
|
||||
};
|
||||
function NodeMixin(Base, options) {
|
||||
var _a;
|
||||
if (options === void 0) { options = {}; }
|
||||
options = (0, Options_js_1.userOptions)((0, Options_js_1.defaultOptions)({}, exports.NodeMixinOptions), options);
|
||||
return _a = (function (_super) {
|
||||
__extends(NodeAdaptor, _super);
|
||||
function NodeAdaptor() {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
var _this = _super.call(this, args[0]) || this;
|
||||
var CLASS = _this.constructor;
|
||||
_this.options = (0, Options_js_1.userOptions)((0, Options_js_1.defaultOptions)({}, CLASS.OPTIONS), args[1]);
|
||||
return _this;
|
||||
}
|
||||
NodeAdaptor.prototype.fontSize = function (node) {
|
||||
return (options.badCSS ? this.options.fontSize : _super.prototype.fontSize.call(this, node));
|
||||
};
|
||||
NodeAdaptor.prototype.fontFamily = function (node) {
|
||||
return (options.badCSS ? this.options.fontFamily : _super.prototype.fontFamily.call(this, node));
|
||||
};
|
||||
NodeAdaptor.prototype.nodeSize = function (node, em, local) {
|
||||
if (em === void 0) { em = 1; }
|
||||
if (local === void 0) { local = null; }
|
||||
if (!options.badSizes) {
|
||||
return _super.prototype.nodeSize.call(this, node, em, local);
|
||||
}
|
||||
var text = this.textContent(node);
|
||||
var non = Array.from(text.replace(NodeAdaptor.cjkPattern, '')).length;
|
||||
var CJK = Array.from(text).length - non;
|
||||
return [
|
||||
CJK * this.options.cjkCharWidth + non * this.options.unknownCharWidth,
|
||||
this.options.unknownCharHeight
|
||||
];
|
||||
};
|
||||
NodeAdaptor.prototype.nodeBBox = function (node) {
|
||||
return (options.badSizes ? { left: 0, right: 0, top: 0, bottom: 0 } : _super.prototype.nodeBBox.call(this, node));
|
||||
};
|
||||
return NodeAdaptor;
|
||||
}(Base)),
|
||||
_a.OPTIONS = __assign(__assign({}, (options.badCSS ? {
|
||||
fontSize: 16,
|
||||
fontFamily: 'Times',
|
||||
} : {})), (options.badSizes ? {
|
||||
cjkCharWidth: 1,
|
||||
unknownCharWidth: .6,
|
||||
unknownCharHeight: .8,
|
||||
} : {})),
|
||||
_a.cjkPattern = new RegExp([
|
||||
'[',
|
||||
'\u1100-\u115F',
|
||||
'\u2329\u232A',
|
||||
'\u2E80-\u303E',
|
||||
'\u3040-\u3247',
|
||||
'\u3250-\u4DBF',
|
||||
'\u4E00-\uA4C6',
|
||||
'\uA960-\uA97C',
|
||||
'\uAC00-\uD7A3',
|
||||
'\uF900-\uFAFF',
|
||||
'\uFE10-\uFE19',
|
||||
'\uFE30-\uFE6B',
|
||||
'\uFF01-\uFF60\uFFE0-\uFFE6',
|
||||
"\uD82C\uDC00-\uD82C\uDC01",
|
||||
"\uD83C\uDE00-\uD83C\uDE51",
|
||||
"\uD840\uDC00-\uD8BF\uDFFD",
|
||||
']'
|
||||
].join(''), 'gu'),
|
||||
_a;
|
||||
}
|
||||
exports.NodeMixin = NodeMixin;
|
||||
//# sourceMappingURL=NodeMixin.js.map
|
||||
1
node_modules/mathjax-full/js/adaptors/NodeMixin.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/adaptors/NodeMixin.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"NodeMixin.js","sourceRoot":"","sources":["../../ts/adaptors/NodeMixin.ts"],"names":[],"mappings":"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"}
|
||||
13
node_modules/mathjax-full/js/adaptors/browserAdaptor.d.ts
generated
vendored
Normal file
13
node_modules/mathjax-full/js/adaptors/browserAdaptor.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { HTMLAdaptor } from './HTMLAdaptor.js';
|
||||
declare global {
|
||||
interface Window {
|
||||
Document: typeof Document;
|
||||
DOMParser: typeof DOMParser;
|
||||
XMLSerializer: typeof XMLSerializer;
|
||||
HTMLElement: typeof HTMLElement;
|
||||
HTMLCollection: typeof HTMLCollection;
|
||||
NodeList: typeof NodeList;
|
||||
DocumentFragment: typeof DocumentFragment;
|
||||
}
|
||||
}
|
||||
export declare function browserAdaptor(): HTMLAdaptor<HTMLElement, Text, Document>;
|
||||
9
node_modules/mathjax-full/js/adaptors/browserAdaptor.js
generated
vendored
Normal file
9
node_modules/mathjax-full/js/adaptors/browserAdaptor.js
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.browserAdaptor = void 0;
|
||||
var HTMLAdaptor_js_1 = require("./HTMLAdaptor.js");
|
||||
function browserAdaptor() {
|
||||
return new HTMLAdaptor_js_1.HTMLAdaptor(window);
|
||||
}
|
||||
exports.browserAdaptor = browserAdaptor;
|
||||
//# sourceMappingURL=browserAdaptor.js.map
|
||||
1
node_modules/mathjax-full/js/adaptors/browserAdaptor.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/adaptors/browserAdaptor.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"browserAdaptor.js","sourceRoot":"","sources":["../../ts/adaptors/browserAdaptor.ts"],"names":[],"mappings":";;;AAuBA,mDAA6C;AAsB7C,SAAgB,cAAc;IAC5B,OAAO,IAAI,4BAAW,CAA8B,MAAM,CAAC,CAAC;AAC9D,CAAC;AAFD,wCAEC"}
|
||||
3
node_modules/mathjax-full/js/adaptors/chooseAdaptor.d.ts
generated
vendored
Normal file
3
node_modules/mathjax-full/js/adaptors/chooseAdaptor.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import { liteAdaptor } from './liteAdaptor.js';
|
||||
import { browserAdaptor } from './browserAdaptor.js';
|
||||
export declare const chooseAdaptor: typeof browserAdaptor | typeof liteAdaptor;
|
||||
15
node_modules/mathjax-full/js/adaptors/chooseAdaptor.js
generated
vendored
Normal file
15
node_modules/mathjax-full/js/adaptors/chooseAdaptor.js
generated
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.chooseAdaptor = void 0;
|
||||
var liteAdaptor_js_1 = require("./liteAdaptor.js");
|
||||
var browserAdaptor_js_1 = require("./browserAdaptor.js");
|
||||
var choose;
|
||||
try {
|
||||
document;
|
||||
choose = browserAdaptor_js_1.browserAdaptor;
|
||||
}
|
||||
catch (e) {
|
||||
choose = liteAdaptor_js_1.liteAdaptor;
|
||||
}
|
||||
exports.chooseAdaptor = choose;
|
||||
//# sourceMappingURL=chooseAdaptor.js.map
|
||||
1
node_modules/mathjax-full/js/adaptors/chooseAdaptor.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/adaptors/chooseAdaptor.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"chooseAdaptor.js","sourceRoot":"","sources":["../../ts/adaptors/chooseAdaptor.ts"],"names":[],"mappings":";;;AAuBA,mDAA6C;AAC7C,yDAAmD;AAEnD,IAAI,MAAM,CAAC;AAEX,IAAI;IACF,QAAQ,CAAC;IACT,MAAM,GAAG,kCAAc,CAAC;CACzB;AAAC,OAAO,CAAC,EAAE;IACV,MAAM,GAAG,4BAAW,CAAC;CACtB;AAKY,QAAA,aAAa,GAAG,MAAM,CAAC"}
|
||||
9
node_modules/mathjax-full/js/adaptors/jsdomAdaptor.d.ts
generated
vendored
Normal file
9
node_modules/mathjax-full/js/adaptors/jsdomAdaptor.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import { HTMLAdaptor } from './HTMLAdaptor.js';
|
||||
import { Constructor } from './NodeMixin.js';
|
||||
import { OptionList } from '../util/Options.js';
|
||||
export declare type HTMLAdaptorConstructor = Constructor<HTMLAdaptor<HTMLElement, Text, Document>>;
|
||||
declare const JsdomAdaptor_base: HTMLAdaptorConstructor;
|
||||
export declare class JsdomAdaptor extends JsdomAdaptor_base {
|
||||
}
|
||||
export declare function jsdomAdaptor(JSDOM: any, options?: OptionList): JsdomAdaptor;
|
||||
export {};
|
||||
34
node_modules/mathjax-full/js/adaptors/jsdomAdaptor.js
generated
vendored
Normal file
34
node_modules/mathjax-full/js/adaptors/jsdomAdaptor.js
generated
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
"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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.jsdomAdaptor = exports.JsdomAdaptor = void 0;
|
||||
var HTMLAdaptor_js_1 = require("./HTMLAdaptor.js");
|
||||
var NodeMixin_js_1 = require("./NodeMixin.js");
|
||||
var JsdomAdaptor = (function (_super) {
|
||||
__extends(JsdomAdaptor, _super);
|
||||
function JsdomAdaptor() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
return JsdomAdaptor;
|
||||
}((0, NodeMixin_js_1.NodeMixin)(HTMLAdaptor_js_1.HTMLAdaptor)));
|
||||
exports.JsdomAdaptor = JsdomAdaptor;
|
||||
function jsdomAdaptor(JSDOM, options) {
|
||||
if (options === void 0) { options = null; }
|
||||
return new JsdomAdaptor(new JSDOM().window, options);
|
||||
}
|
||||
exports.jsdomAdaptor = jsdomAdaptor;
|
||||
//# sourceMappingURL=jsdomAdaptor.js.map
|
||||
1
node_modules/mathjax-full/js/adaptors/jsdomAdaptor.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/adaptors/jsdomAdaptor.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"jsdomAdaptor.js","sourceRoot":"","sources":["../../ts/adaptors/jsdomAdaptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAuBA,mDAA6C;AAC7C,+CAAsD;AAWtD;IAAkC,gCAA2E;IAA7G;;IAA+G,CAAC;IAAD,mBAAC;AAAD,CAAC,AAAhH,CAAkC,IAAA,wBAAS,EAAsD,4BAAW,CAAC,GAAG;AAAnG,oCAAY;AAQzB,SAAgB,YAAY,CAAC,KAAU,EAAE,OAA0B;IAA1B,wBAAA,EAAA,cAA0B;IACjE,OAAO,IAAI,YAAY,CAAC,IAAI,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACvD,CAAC;AAFD,oCAEC"}
|
||||
11
node_modules/mathjax-full/js/adaptors/linkedomAdaptor.d.ts
generated
vendored
Normal file
11
node_modules/mathjax-full/js/adaptors/linkedomAdaptor.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { HTMLAdaptor } from './HTMLAdaptor.js';
|
||||
import { Constructor } from './NodeMixin.js';
|
||||
import { OptionList } from '../util/Options.js';
|
||||
export declare type HTMLAdaptorConstructor = Constructor<HTMLAdaptor<HTMLElement, Text, Document>>;
|
||||
declare const LinkedomAdaptor_base: HTMLAdaptorConstructor;
|
||||
export declare class LinkedomAdaptor extends LinkedomAdaptor_base {
|
||||
parse(text: string, format?: string): Document;
|
||||
serializeXML(node: HTMLElement): string;
|
||||
}
|
||||
export declare function linkedomAdaptor(parseHTML: any, options?: OptionList): LinkedomAdaptor;
|
||||
export {};
|
||||
49
node_modules/mathjax-full/js/adaptors/linkedomAdaptor.js
generated
vendored
Normal file
49
node_modules/mathjax-full/js/adaptors/linkedomAdaptor.js
generated
vendored
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
"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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.linkedomAdaptor = exports.LinkedomAdaptor = void 0;
|
||||
var HTMLAdaptor_js_1 = require("./HTMLAdaptor.js");
|
||||
var NodeMixin_js_1 = require("./NodeMixin.js");
|
||||
var LinkedomAdaptor = (function (_super) {
|
||||
__extends(LinkedomAdaptor, _super);
|
||||
function LinkedomAdaptor() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
LinkedomAdaptor.prototype.parse = function (text, format) {
|
||||
if (format === void 0) { format = 'text/html'; }
|
||||
if (!text.match(/^(?:\s|\n)*</))
|
||||
text = '<html>' + text + '</html>';
|
||||
return this.parser.parseFromString(text, format);
|
||||
};
|
||||
LinkedomAdaptor.prototype.serializeXML = function (node) {
|
||||
return this.outerHTML(node);
|
||||
};
|
||||
return LinkedomAdaptor;
|
||||
}((0, NodeMixin_js_1.NodeMixin)(HTMLAdaptor_js_1.HTMLAdaptor)));
|
||||
exports.LinkedomAdaptor = LinkedomAdaptor;
|
||||
function linkedomAdaptor(parseHTML, options) {
|
||||
if (options === void 0) { options = null; }
|
||||
var window = parseHTML('<html></html>');
|
||||
window.constructor.prototype.HTMLCollection = (function () {
|
||||
function HTMLCollection() {
|
||||
}
|
||||
return HTMLCollection;
|
||||
}());
|
||||
return new LinkedomAdaptor(window, options);
|
||||
}
|
||||
exports.linkedomAdaptor = linkedomAdaptor;
|
||||
//# sourceMappingURL=linkedomAdaptor.js.map
|
||||
1
node_modules/mathjax-full/js/adaptors/linkedomAdaptor.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/adaptors/linkedomAdaptor.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"linkedomAdaptor.js","sourceRoot":"","sources":["../../ts/adaptors/linkedomAdaptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAuBA,mDAA6C;AAC7C,+CAAsD;AAWtD;IAAqC,mCAA2E;IAAhH;;IAuBA,CAAC;IAlBQ,+BAAK,GAAZ,UAAa,IAAY,EAAE,MAA4B;QAA5B,uBAAA,EAAA,oBAA4B;QAIrD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC;YAAE,IAAI,GAAG,QAAQ,GAAG,IAAI,GAAG,SAAS,CAAC;QACpE,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACnD,CAAC;IAQM,sCAAY,GAAnB,UAAoB,IAAiB;QACnC,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAEH,sBAAC;AAAD,CAAC,AAvBD,CAAqC,IAAA,wBAAS,EAAsD,4BAAW,CAAC,GAuB/G;AAvBY,0CAAe;AA+B5B,SAAgB,eAAe,CAAC,SAAc,EAAE,OAA0B;IAA1B,wBAAA,EAAA,cAA0B;IACxE,IAAM,MAAM,GAAG,SAAS,CAAC,eAAe,CAAC,CAAC;IAC1C,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc;QAAG;QAAO,CAAC;QAAD,qBAAC;IAAD,CAAC,AAAR,GAAQ,CAAC;IACvD,OAAO,IAAI,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC;AAJD,0CAIC"}
|
||||
9
node_modules/mathjax-full/js/adaptors/lite/Document.d.ts
generated
vendored
Normal file
9
node_modules/mathjax-full/js/adaptors/lite/Document.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import { LiteElement } from './Element.js';
|
||||
export declare class LiteDocument {
|
||||
root: LiteElement;
|
||||
head: LiteElement;
|
||||
body: LiteElement;
|
||||
type: string;
|
||||
get kind(): string;
|
||||
constructor();
|
||||
}
|
||||
23
node_modules/mathjax-full/js/adaptors/lite/Document.js
generated
vendored
Normal file
23
node_modules/mathjax-full/js/adaptors/lite/Document.js
generated
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LiteDocument = void 0;
|
||||
var Element_js_1 = require("./Element.js");
|
||||
var LiteDocument = (function () {
|
||||
function LiteDocument() {
|
||||
this.root = new Element_js_1.LiteElement('html', {}, [
|
||||
this.head = new Element_js_1.LiteElement('head'),
|
||||
this.body = new Element_js_1.LiteElement('body')
|
||||
]);
|
||||
this.type = '';
|
||||
}
|
||||
Object.defineProperty(LiteDocument.prototype, "kind", {
|
||||
get: function () {
|
||||
return '#document';
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
return LiteDocument;
|
||||
}());
|
||||
exports.LiteDocument = LiteDocument;
|
||||
//# sourceMappingURL=Document.js.map
|
||||
1
node_modules/mathjax-full/js/adaptors/lite/Document.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/adaptors/lite/Document.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"Document.js","sourceRoot":"","sources":["../../../ts/adaptors/lite/Document.ts"],"names":[],"mappings":";;;AAuBA,2CAAyC;AAMzC;IA6BE;QACE,IAAI,CAAC,IAAI,GAAG,IAAI,wBAAW,CAAC,MAAM,EAAE,EAAE,EAAE;YACtC,IAAI,CAAC,IAAI,GAAG,IAAI,wBAAW,CAAC,MAAM,CAAC;YACnC,IAAI,CAAC,IAAI,GAAG,IAAI,wBAAW,CAAC,MAAM,CAAC;SACpC,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;IACjB,CAAC;IAbD,sBAAW,8BAAI;aAAf;YACE,OAAO,WAAW,CAAC;QACrB,CAAC;;;OAAA;IAYH,mBAAC;AAAD,CAAC,AApCD,IAoCC;AApCY,oCAAY"}
|
||||
13
node_modules/mathjax-full/js/adaptors/lite/Element.d.ts
generated
vendored
Normal file
13
node_modules/mathjax-full/js/adaptors/lite/Element.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { OptionList } from '../../util/Options.js';
|
||||
import { Styles } from '../../util/Styles.js';
|
||||
import { LiteText } from './Text.js';
|
||||
export declare type LiteAttributeList = OptionList;
|
||||
export declare type LiteNode = LiteElement | LiteText;
|
||||
export declare class LiteElement {
|
||||
kind: string;
|
||||
attributes: LiteAttributeList;
|
||||
children: LiteNode[];
|
||||
parent: LiteElement;
|
||||
styles: Styles;
|
||||
constructor(kind: string, attributes?: LiteAttributeList, children?: LiteNode[]);
|
||||
}
|
||||
77
node_modules/mathjax-full/js/adaptors/lite/Element.js
generated
vendored
Normal file
77
node_modules/mathjax-full/js/adaptors/lite/Element.js
generated
vendored
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
"use strict";
|
||||
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 __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
};
|
||||
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.LiteElement = void 0;
|
||||
var LiteElement = (function () {
|
||||
function LiteElement(kind, attributes, children) {
|
||||
var e_1, _a;
|
||||
if (attributes === void 0) { attributes = {}; }
|
||||
if (children === void 0) { children = []; }
|
||||
this.kind = kind;
|
||||
this.attributes = __assign({}, attributes);
|
||||
this.children = __spreadArray([], __read(children), false);
|
||||
try {
|
||||
for (var _b = __values(this.children), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var child = _c.value;
|
||||
child.parent = this;
|
||||
}
|
||||
}
|
||||
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; }
|
||||
}
|
||||
this.styles = null;
|
||||
}
|
||||
return LiteElement;
|
||||
}());
|
||||
exports.LiteElement = LiteElement;
|
||||
//# sourceMappingURL=Element.js.map
|
||||
1
node_modules/mathjax-full/js/adaptors/lite/Element.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/adaptors/lite/Element.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"Element.js","sourceRoot":"","sources":["../../../ts/adaptors/lite/Element.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA;IAgCE,qBAAY,IAAY,EAAE,UAAkC,EAAE,QAAyB;;QAA7D,2BAAA,EAAA,eAAkC;QAAE,yBAAA,EAAA,aAAyB;QACrF,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,UAAU,gBAAO,UAAU,CAAC,CAAC;QAClC,IAAI,CAAC,QAAQ,4BAAO,QAAQ,SAAC,CAAC;;YAC9B,KAAoB,IAAA,KAAA,SAAA,IAAI,CAAC,QAAQ,CAAA,gBAAA,4BAAE;gBAA9B,IAAM,KAAK,WAAA;gBACd,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;aACrB;;;;;;;;;QACD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACrB,CAAC;IACH,kBAAC;AAAD,CAAC,AAzCD,IAyCC;AAzCY,kCAAW"}
|
||||
7
node_modules/mathjax-full/js/adaptors/lite/List.d.ts
generated
vendored
Normal file
7
node_modules/mathjax-full/js/adaptors/lite/List.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import { LiteNode } from './Element.js';
|
||||
export declare class LiteList<N> {
|
||||
nodes: N[];
|
||||
constructor(children: N[]);
|
||||
append(node: N): void;
|
||||
[Symbol.iterator](): Iterator<LiteNode>;
|
||||
}
|
||||
50
node_modules/mathjax-full/js/adaptors/lite/List.js
generated
vendored
Normal file
50
node_modules/mathjax-full/js/adaptors/lite/List.js
generated
vendored
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
"use strict";
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LiteList = void 0;
|
||||
var LiteList = (function () {
|
||||
function LiteList(children) {
|
||||
this.nodes = [];
|
||||
this.nodes = __spreadArray([], __read(children), false);
|
||||
}
|
||||
LiteList.prototype.append = function (node) {
|
||||
this.nodes.push(node);
|
||||
};
|
||||
LiteList.prototype[Symbol.iterator] = function () {
|
||||
var i = 0;
|
||||
return {
|
||||
next: function () {
|
||||
return (i === this.nodes.length ?
|
||||
{ value: null, done: true } :
|
||||
{ value: this.nodes[i++], done: false });
|
||||
}
|
||||
};
|
||||
};
|
||||
return LiteList;
|
||||
}());
|
||||
exports.LiteList = LiteList;
|
||||
//# sourceMappingURL=List.js.map
|
||||
1
node_modules/mathjax-full/js/adaptors/lite/List.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/adaptors/lite/List.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"List.js","sourceRoot":"","sources":["../../../ts/adaptors/lite/List.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA;IAUE,kBAAY,QAAa;QANlB,UAAK,GAAQ,EAAE,CAAC;QAOrB,IAAI,CAAC,KAAK,4BAAO,QAAQ,SAAC,CAAC;IAC7B,CAAC;IAKM,yBAAM,GAAb,UAAc,IAAO;QACnB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAKM,mBAAC,MAAM,CAAC,QAAQ,CAAC,GAAxB;QACE,IAAI,CAAC,GAAG,CAAC,CAAC;QACV,OAAO;YAIL,IAAI,EAAJ;gBACE,OAAO,CAAC,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;oBACzB,EAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;oBAC3B,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAC,CAAC,CAAC;YACjD,CAAC;SACF,CAAC;IACJ,CAAC;IAEH,eAAC;AAAD,CAAC,AAtCD,IAsCC;AAtCY,4BAAQ"}
|
||||
43
node_modules/mathjax-full/js/adaptors/lite/Parser.d.ts
generated
vendored
Normal file
43
node_modules/mathjax-full/js/adaptors/lite/Parser.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
import { MinDOMParser } from '../HTMLAdaptor.js';
|
||||
import { LiteDocument } from './Document.js';
|
||||
import { LiteElement } from './Element.js';
|
||||
import { LiteText, LiteComment } from './Text.js';
|
||||
import { LiteAdaptor } from '../liteAdaptor.js';
|
||||
export declare namespace PATTERNS {
|
||||
const TAGNAME = "[a-z][^\\s\\n>]*";
|
||||
const ATTNAME = "[a-z][^\\s\\n>=]*";
|
||||
const VALUE = "(?:'[^']*'|\"[^\"]*\"|[^\\s\\n]+)";
|
||||
const VALUESPLIT = "(?:'([^']*)'|\"([^\"]*)\"|([^\\s\\n]+))";
|
||||
const SPACE = "(?:\\s|\\n)+";
|
||||
const OPTIONALSPACE = "(?:\\s|\\n)*";
|
||||
const ATTRIBUTE: string;
|
||||
const ATTRIBUTESPLIT: string;
|
||||
const TAG: string;
|
||||
const tag: RegExp;
|
||||
const attr: RegExp;
|
||||
const attrsplit: RegExp;
|
||||
}
|
||||
export declare class LiteParser implements MinDOMParser<LiteDocument> {
|
||||
static SELF_CLOSING: {
|
||||
[name: string]: boolean;
|
||||
};
|
||||
static PCDATA: {
|
||||
[name: string]: boolean;
|
||||
};
|
||||
static CDATA_ATTR: {
|
||||
[name: string]: boolean;
|
||||
};
|
||||
parseFromString(text: string, _format?: string, adaptor?: LiteAdaptor): LiteDocument;
|
||||
protected addText(adaptor: LiteAdaptor, node: LiteElement, text: string): LiteText;
|
||||
protected addComment(adaptor: LiteAdaptor, node: LiteElement, comment: string): LiteComment;
|
||||
protected closeTag(adaptor: LiteAdaptor, node: LiteElement, tag: string): LiteElement;
|
||||
protected openTag(adaptor: LiteAdaptor, node: LiteElement, tag: string, parts: string[]): LiteElement;
|
||||
protected addAttributes(adaptor: LiteAdaptor, node: LiteElement, attributes: string[]): void;
|
||||
protected handlePCDATA(adaptor: LiteAdaptor, node: LiteElement, kind: string, parts: string[]): void;
|
||||
protected checkDocument(adaptor: LiteAdaptor, root: LiteDocument): void;
|
||||
protected getOnlyChild(adaptor: LiteAdaptor, body: LiteElement): LiteElement;
|
||||
serialize(adaptor: LiteAdaptor, node: LiteElement, xml?: boolean): string;
|
||||
serializeInner(adaptor: LiteAdaptor, node: LiteElement, xml?: boolean): string;
|
||||
protectAttribute(text: string): string;
|
||||
protectHTML(text: string): string;
|
||||
}
|
||||
326
node_modules/mathjax-full/js/adaptors/lite/Parser.js
generated
vendored
Normal file
326
node_modules/mathjax-full/js/adaptors/lite/Parser.js
generated
vendored
Normal file
|
|
@ -0,0 +1,326 @@
|
|||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
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.LiteParser = exports.PATTERNS = void 0;
|
||||
var Entities = __importStar(require("../../util/Entities.js"));
|
||||
var Element_js_1 = require("./Element.js");
|
||||
var Text_js_1 = require("./Text.js");
|
||||
var PATTERNS;
|
||||
(function (PATTERNS) {
|
||||
PATTERNS.TAGNAME = '[a-z][^\\s\\n>]*';
|
||||
PATTERNS.ATTNAME = '[a-z][^\\s\\n>=]*';
|
||||
PATTERNS.VALUE = "(?:'[^']*'|\"[^\"]*\"|[^\\s\\n]+)";
|
||||
PATTERNS.VALUESPLIT = "(?:'([^']*)'|\"([^\"]*)\"|([^\\s\\n]+))";
|
||||
PATTERNS.SPACE = '(?:\\s|\\n)+';
|
||||
PATTERNS.OPTIONALSPACE = '(?:\\s|\\n)*';
|
||||
PATTERNS.ATTRIBUTE = PATTERNS.ATTNAME + '(?:' + PATTERNS.OPTIONALSPACE + '=' + PATTERNS.OPTIONALSPACE + PATTERNS.VALUE + ')?';
|
||||
PATTERNS.ATTRIBUTESPLIT = '(' + PATTERNS.ATTNAME + ')(?:' + PATTERNS.OPTIONALSPACE + '=' + PATTERNS.OPTIONALSPACE + PATTERNS.VALUESPLIT + ')?';
|
||||
PATTERNS.TAG = '(<(?:' + PATTERNS.TAGNAME + '(?:' + PATTERNS.SPACE + PATTERNS.ATTRIBUTE + ')*'
|
||||
+ PATTERNS.OPTIONALSPACE + '/?|/' + PATTERNS.TAGNAME + '|!--[^]*?--|![^]*?)(?:>|$))';
|
||||
PATTERNS.tag = new RegExp(PATTERNS.TAG, 'i');
|
||||
PATTERNS.attr = new RegExp(PATTERNS.ATTRIBUTE, 'i');
|
||||
PATTERNS.attrsplit = new RegExp(PATTERNS.ATTRIBUTESPLIT, 'i');
|
||||
})(PATTERNS = exports.PATTERNS || (exports.PATTERNS = {}));
|
||||
var LiteParser = (function () {
|
||||
function LiteParser() {
|
||||
}
|
||||
LiteParser.prototype.parseFromString = function (text, _format, adaptor) {
|
||||
if (_format === void 0) { _format = 'text/html'; }
|
||||
if (adaptor === void 0) { adaptor = null; }
|
||||
var root = adaptor.createDocument();
|
||||
var node = adaptor.body(root);
|
||||
var parts = text.replace(/<\?.*?\?>/g, '').split(PATTERNS.tag);
|
||||
while (parts.length) {
|
||||
var text_1 = parts.shift();
|
||||
var tag = parts.shift();
|
||||
if (text_1) {
|
||||
this.addText(adaptor, node, text_1);
|
||||
}
|
||||
if (tag && tag.charAt(tag.length - 1) === '>') {
|
||||
if (tag.charAt(1) === '!') {
|
||||
this.addComment(adaptor, node, tag);
|
||||
}
|
||||
else if (tag.charAt(1) === '/') {
|
||||
node = this.closeTag(adaptor, node, tag);
|
||||
}
|
||||
else {
|
||||
node = this.openTag(adaptor, node, tag, parts);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.checkDocument(adaptor, root);
|
||||
return root;
|
||||
};
|
||||
LiteParser.prototype.addText = function (adaptor, node, text) {
|
||||
text = Entities.translate(text);
|
||||
return adaptor.append(node, adaptor.text(text));
|
||||
};
|
||||
LiteParser.prototype.addComment = function (adaptor, node, comment) {
|
||||
return adaptor.append(node, new Text_js_1.LiteComment(comment));
|
||||
};
|
||||
LiteParser.prototype.closeTag = function (adaptor, node, tag) {
|
||||
var kind = tag.slice(2, tag.length - 1).toLowerCase();
|
||||
while (adaptor.parent(node) && adaptor.kind(node) !== kind) {
|
||||
node = adaptor.parent(node);
|
||||
}
|
||||
return adaptor.parent(node);
|
||||
};
|
||||
LiteParser.prototype.openTag = function (adaptor, node, tag, parts) {
|
||||
var PCDATA = this.constructor.PCDATA;
|
||||
var SELF_CLOSING = this.constructor.SELF_CLOSING;
|
||||
var kind = tag.match(/<(.*?)[\s\n>\/]/)[1].toLowerCase();
|
||||
var child = adaptor.node(kind);
|
||||
var attributes = tag.replace(/^<.*?[\s\n>]/, '').split(PATTERNS.attrsplit);
|
||||
if (attributes.pop().match(/>$/) || attributes.length < 5) {
|
||||
this.addAttributes(adaptor, child, attributes);
|
||||
adaptor.append(node, child);
|
||||
if (!SELF_CLOSING[kind] && !tag.match(/\/>$/)) {
|
||||
if (PCDATA[kind]) {
|
||||
this.handlePCDATA(adaptor, child, kind, parts);
|
||||
}
|
||||
else {
|
||||
node = child;
|
||||
}
|
||||
}
|
||||
}
|
||||
return node;
|
||||
};
|
||||
LiteParser.prototype.addAttributes = function (adaptor, node, attributes) {
|
||||
var CDATA_ATTR = this.constructor.CDATA_ATTR;
|
||||
while (attributes.length) {
|
||||
var _a = __read(attributes.splice(0, 5), 5), name_1 = _a[1], v1 = _a[2], v2 = _a[3], v3 = _a[4];
|
||||
var value = v1 || v2 || v3 || '';
|
||||
if (!CDATA_ATTR[name_1]) {
|
||||
value = Entities.translate(value);
|
||||
}
|
||||
adaptor.setAttribute(node, name_1, value);
|
||||
}
|
||||
};
|
||||
LiteParser.prototype.handlePCDATA = function (adaptor, node, kind, parts) {
|
||||
var pcdata = [];
|
||||
var etag = '</' + kind + '>';
|
||||
var ptag = '';
|
||||
while (parts.length && ptag !== etag) {
|
||||
pcdata.push(ptag);
|
||||
pcdata.push(parts.shift());
|
||||
ptag = parts.shift();
|
||||
}
|
||||
adaptor.append(node, adaptor.text(pcdata.join('')));
|
||||
};
|
||||
LiteParser.prototype.checkDocument = function (adaptor, root) {
|
||||
var e_1, _a, e_2, _b;
|
||||
var node = this.getOnlyChild(adaptor, adaptor.body(root));
|
||||
if (!node)
|
||||
return;
|
||||
try {
|
||||
for (var _c = __values(adaptor.childNodes(adaptor.body(root))), _d = _c.next(); !_d.done; _d = _c.next()) {
|
||||
var child = _d.value;
|
||||
if (child === node) {
|
||||
break;
|
||||
}
|
||||
if (child instanceof Text_js_1.LiteComment && child.value.match(/^<!DOCTYPE/)) {
|
||||
root.type = child.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
switch (adaptor.kind(node)) {
|
||||
case 'html':
|
||||
try {
|
||||
for (var _e = __values(node.children), _f = _e.next(); !_f.done; _f = _e.next()) {
|
||||
var child = _f.value;
|
||||
switch (adaptor.kind(child)) {
|
||||
case 'head':
|
||||
root.head = child;
|
||||
break;
|
||||
case 'body':
|
||||
root.body = child;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
||||
}
|
||||
finally { if (e_2) throw e_2.error; }
|
||||
}
|
||||
root.root = node;
|
||||
adaptor.remove(node);
|
||||
if (adaptor.parent(root.body) !== node) {
|
||||
adaptor.append(node, root.body);
|
||||
}
|
||||
if (adaptor.parent(root.head) !== node) {
|
||||
adaptor.insert(root.head, root.body);
|
||||
}
|
||||
break;
|
||||
case 'head':
|
||||
root.head = adaptor.replace(node, root.head);
|
||||
break;
|
||||
case 'body':
|
||||
root.body = adaptor.replace(node, root.body);
|
||||
break;
|
||||
}
|
||||
};
|
||||
LiteParser.prototype.getOnlyChild = function (adaptor, body) {
|
||||
var e_3, _a;
|
||||
var node = null;
|
||||
try {
|
||||
for (var _b = __values(adaptor.childNodes(body)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var child = _c.value;
|
||||
if (child instanceof Element_js_1.LiteElement) {
|
||||
if (node)
|
||||
return null;
|
||||
node = child;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_3) throw e_3.error; }
|
||||
}
|
||||
return node;
|
||||
};
|
||||
LiteParser.prototype.serialize = function (adaptor, node, xml) {
|
||||
var _this = this;
|
||||
if (xml === void 0) { xml = false; }
|
||||
var SELF_CLOSING = this.constructor.SELF_CLOSING;
|
||||
var CDATA = this.constructor.CDATA_ATTR;
|
||||
var tag = adaptor.kind(node);
|
||||
var attributes = adaptor.allAttributes(node).map(function (x) { return x.name + '="' + (CDATA[x.name] ? x.value : _this.protectAttribute(x.value)) + '"'; }).join(' ');
|
||||
var content = this.serializeInner(adaptor, node, xml);
|
||||
var html = '<' + tag + (attributes ? ' ' + attributes : '')
|
||||
+ ((!xml || content) && !SELF_CLOSING[tag] ? ">".concat(content, "</").concat(tag, ">") : xml ? '/>' : '>');
|
||||
return html;
|
||||
};
|
||||
LiteParser.prototype.serializeInner = function (adaptor, node, xml) {
|
||||
var _this = this;
|
||||
if (xml === void 0) { xml = false; }
|
||||
var PCDATA = this.constructor.PCDATA;
|
||||
if (PCDATA.hasOwnProperty(node.kind)) {
|
||||
return adaptor.childNodes(node).map(function (x) { return adaptor.value(x); }).join('');
|
||||
}
|
||||
return adaptor.childNodes(node).map(function (x) {
|
||||
var kind = adaptor.kind(x);
|
||||
return (kind === '#text' ? _this.protectHTML(adaptor.value(x)) :
|
||||
kind === '#comment' ? x.value :
|
||||
_this.serialize(adaptor, x, xml));
|
||||
}).join('');
|
||||
};
|
||||
LiteParser.prototype.protectAttribute = function (text) {
|
||||
if (typeof text !== 'string') {
|
||||
text = String(text);
|
||||
}
|
||||
return text.replace(/"/g, '"');
|
||||
};
|
||||
LiteParser.prototype.protectHTML = function (text) {
|
||||
return text.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>');
|
||||
};
|
||||
LiteParser.SELF_CLOSING = {
|
||||
area: true,
|
||||
base: true,
|
||||
br: true,
|
||||
col: true,
|
||||
command: true,
|
||||
embed: true,
|
||||
hr: true,
|
||||
img: true,
|
||||
input: true,
|
||||
keygen: true,
|
||||
link: true,
|
||||
menuitem: true,
|
||||
meta: true,
|
||||
param: true,
|
||||
source: true,
|
||||
track: true,
|
||||
wbr: true
|
||||
};
|
||||
LiteParser.PCDATA = {
|
||||
option: true,
|
||||
textarea: true,
|
||||
fieldset: true,
|
||||
title: true,
|
||||
style: true,
|
||||
script: true
|
||||
};
|
||||
LiteParser.CDATA_ATTR = {
|
||||
style: true,
|
||||
datafld: true,
|
||||
datasrc: true,
|
||||
href: true,
|
||||
src: true,
|
||||
longdesc: true,
|
||||
usemap: true,
|
||||
cite: true,
|
||||
datetime: true,
|
||||
action: true,
|
||||
axis: true,
|
||||
profile: true,
|
||||
content: true,
|
||||
scheme: true
|
||||
};
|
||||
return LiteParser;
|
||||
}());
|
||||
exports.LiteParser = LiteParser;
|
||||
//# sourceMappingURL=Parser.js.map
|
||||
1
node_modules/mathjax-full/js/adaptors/lite/Parser.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/adaptors/lite/Parser.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
10
node_modules/mathjax-full/js/adaptors/lite/Text.d.ts
generated
vendored
Normal file
10
node_modules/mathjax-full/js/adaptors/lite/Text.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import { LiteElement } from './Element.js';
|
||||
export declare class LiteText {
|
||||
value: string;
|
||||
parent: LiteElement;
|
||||
get kind(): string;
|
||||
constructor(text?: string);
|
||||
}
|
||||
export declare class LiteComment extends LiteText {
|
||||
get kind(): string;
|
||||
}
|
||||
49
node_modules/mathjax-full/js/adaptors/lite/Text.js
generated
vendored
Normal file
49
node_modules/mathjax-full/js/adaptors/lite/Text.js
generated
vendored
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
"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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LiteComment = exports.LiteText = void 0;
|
||||
var LiteText = (function () {
|
||||
function LiteText(text) {
|
||||
if (text === void 0) { text = ''; }
|
||||
this.value = text;
|
||||
}
|
||||
Object.defineProperty(LiteText.prototype, "kind", {
|
||||
get: function () {
|
||||
return '#text';
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
return LiteText;
|
||||
}());
|
||||
exports.LiteText = LiteText;
|
||||
var LiteComment = (function (_super) {
|
||||
__extends(LiteComment, _super);
|
||||
function LiteComment() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
Object.defineProperty(LiteComment.prototype, "kind", {
|
||||
get: function () {
|
||||
return '#comment';
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
return LiteComment;
|
||||
}(LiteText));
|
||||
exports.LiteComment = LiteComment;
|
||||
//# sourceMappingURL=Text.js.map
|
||||
1
node_modules/mathjax-full/js/adaptors/lite/Text.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/adaptors/lite/Text.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"Text.js","sourceRoot":"","sources":["../../../ts/adaptors/lite/Text.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA6BA;IAsBE,kBAAY,IAAiB;QAAjB,qBAAA,EAAA,SAAiB;QAC3B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAVD,sBAAW,0BAAI;aAAf;YACE,OAAO,OAAO,CAAC;QACjB,CAAC;;;OAAA;IASH,eAAC;AAAD,CAAC,AAzBD,IAyBC;AAzBY,4BAAQ;AA+BrB;IAAiC,+BAAQ;IAAzC;;IAIA,CAAC;IAHC,sBAAW,6BAAI;aAAf;YACE,OAAO,UAAU,CAAC;QACpB,CAAC;;;OAAA;IACH,kBAAC;AAAD,CAAC,AAJD,CAAiC,QAAQ,GAIxC;AAJY,kCAAW"}
|
||||
14
node_modules/mathjax-full/js/adaptors/lite/Window.d.ts
generated
vendored
Normal file
14
node_modules/mathjax-full/js/adaptors/lite/Window.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { LiteElement } from './Element.js';
|
||||
import { LiteDocument } from './Document.js';
|
||||
import { LiteList } from './List.js';
|
||||
import { LiteParser } from './Parser.js';
|
||||
export declare class LiteWindow {
|
||||
document: LiteDocument;
|
||||
DOMParser: typeof LiteParser;
|
||||
NodeList: typeof LiteList;
|
||||
HTMLCollection: typeof LiteList;
|
||||
HTMLElement: typeof LiteElement;
|
||||
DocumentFragment: typeof LiteList;
|
||||
Document: typeof LiteDocument;
|
||||
constructor();
|
||||
}
|
||||
21
node_modules/mathjax-full/js/adaptors/lite/Window.js
generated
vendored
Normal file
21
node_modules/mathjax-full/js/adaptors/lite/Window.js
generated
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LiteWindow = void 0;
|
||||
var Element_js_1 = require("./Element.js");
|
||||
var Document_js_1 = require("./Document.js");
|
||||
var List_js_1 = require("./List.js");
|
||||
var Parser_js_1 = require("./Parser.js");
|
||||
var LiteWindow = (function () {
|
||||
function LiteWindow() {
|
||||
this.DOMParser = Parser_js_1.LiteParser;
|
||||
this.NodeList = List_js_1.LiteList;
|
||||
this.HTMLCollection = List_js_1.LiteList;
|
||||
this.HTMLElement = Element_js_1.LiteElement;
|
||||
this.DocumentFragment = List_js_1.LiteList;
|
||||
this.Document = Document_js_1.LiteDocument;
|
||||
this.document = new Document_js_1.LiteDocument();
|
||||
}
|
||||
return LiteWindow;
|
||||
}());
|
||||
exports.LiteWindow = LiteWindow;
|
||||
//# sourceMappingURL=Window.js.map
|
||||
1
node_modules/mathjax-full/js/adaptors/lite/Window.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/adaptors/lite/Window.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"Window.js","sourceRoot":"","sources":["../../../ts/adaptors/lite/Window.ts"],"names":[],"mappings":";;;AAuBA,2CAAyC;AACzC,6CAA2C;AAC3C,qCAAmC;AACnC,yCAAuC;AAMvC;IAiCE;QAzBO,cAAS,GAAsB,sBAAU,CAAC;QAI1C,aAAQ,GAAoB,kBAAQ,CAAC;QAIrC,mBAAc,GAAoB,kBAAQ,CAAC;QAI3C,gBAAW,GAAuB,wBAAW,CAAC;QAI9C,qBAAgB,GAAqB,kBAAQ,CAAC;QAI9C,aAAQ,GAAyB,0BAAY,CAAC;QAMnD,IAAI,CAAC,QAAQ,GAAG,IAAI,0BAAY,EAAE,CAAC;IACrC,CAAC;IACH,iBAAC;AAAD,CAAC,AApCD,IAoCC;AApCY,gCAAU"}
|
||||
77
node_modules/mathjax-full/js/adaptors/liteAdaptor.d.ts
generated
vendored
Normal file
77
node_modules/mathjax-full/js/adaptors/liteAdaptor.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
import { AbstractDOMAdaptor } from '../core/DOMAdaptor.js';
|
||||
import { Constructor } from './NodeMixin.js';
|
||||
import { LiteDocument } from './lite/Document.js';
|
||||
import { LiteElement, LiteNode } from './lite/Element.js';
|
||||
import { LiteText, LiteComment } from './lite/Text.js';
|
||||
import { LiteWindow } from './lite/Window.js';
|
||||
import { LiteParser } from './lite/Parser.js';
|
||||
import { OptionList } from '../util/Options.js';
|
||||
export declare class LiteBase extends AbstractDOMAdaptor<LiteElement, LiteText, LiteDocument> {
|
||||
document: LiteDocument;
|
||||
window: LiteWindow;
|
||||
parser: LiteParser;
|
||||
constructor();
|
||||
parse(text: string, format?: string): LiteDocument;
|
||||
protected create(kind: string, _ns?: string): LiteElement;
|
||||
text(text: string): LiteText;
|
||||
comment(text: string): LiteComment;
|
||||
createDocument(): LiteDocument;
|
||||
head(doc: LiteDocument): LiteElement;
|
||||
body(doc: LiteDocument): LiteElement;
|
||||
root(doc: LiteDocument): LiteElement;
|
||||
doctype(doc: LiteDocument): string;
|
||||
tags(node: LiteElement, name: string, ns?: string): LiteElement[];
|
||||
elementById(node: LiteElement, id: string): LiteElement;
|
||||
elementsByClass(node: LiteElement, name: string): LiteElement[];
|
||||
getElements(nodes: (string | LiteElement | LiteElement[])[], document: LiteDocument): LiteElement[];
|
||||
contains(container: LiteNode, node: LiteNode | LiteText): boolean;
|
||||
parent(node: LiteNode): LiteElement;
|
||||
childIndex(node: LiteNode): number;
|
||||
append(node: LiteElement, child: LiteNode): LiteNode;
|
||||
insert(nchild: LiteNode, ochild: LiteNode): void;
|
||||
remove(child: LiteNode): LiteNode;
|
||||
replace(nnode: LiteNode, onode: LiteNode): LiteNode;
|
||||
clone(node: LiteElement): LiteElement;
|
||||
split(node: LiteText, n: number): LiteText;
|
||||
next(node: LiteNode): LiteNode;
|
||||
previous(node: LiteNode): LiteNode;
|
||||
firstChild(node: LiteElement): LiteNode;
|
||||
lastChild(node: LiteElement): LiteNode;
|
||||
childNodes(node: LiteElement): LiteNode[];
|
||||
childNode(node: LiteElement, i: number): LiteNode;
|
||||
kind(node: LiteNode): string;
|
||||
value(node: LiteNode | LiteText): string;
|
||||
textContent(node: LiteElement): string;
|
||||
innerHTML(node: LiteElement): string;
|
||||
outerHTML(node: LiteElement): string;
|
||||
serializeXML(node: LiteElement): string;
|
||||
setAttribute(node: LiteElement, name: string, value: string | number, ns?: string): void;
|
||||
getAttribute(node: LiteElement, name: string): any;
|
||||
removeAttribute(node: LiteElement, name: string): void;
|
||||
hasAttribute(node: LiteElement, name: string): boolean;
|
||||
allAttributes(node: LiteElement): {
|
||||
name: string;
|
||||
value: string;
|
||||
}[];
|
||||
addClass(node: LiteElement, name: string): void;
|
||||
removeClass(node: LiteElement, name: string): void;
|
||||
hasClass(node: LiteElement, name: string): boolean;
|
||||
setStyle(node: LiteElement, name: string, value: string): void;
|
||||
getStyle(node: LiteElement, name: string): string;
|
||||
allStyles(node: LiteElement): any;
|
||||
insertRules(node: LiteElement, rules: string[]): void;
|
||||
fontSize(_node: LiteElement): number;
|
||||
fontFamily(_node: LiteElement): string;
|
||||
nodeSize(_node: LiteElement, _em?: number, _local?: boolean): [number, number];
|
||||
nodeBBox(_node: LiteElement): {
|
||||
left: number;
|
||||
right: number;
|
||||
top: number;
|
||||
bottom: number;
|
||||
};
|
||||
}
|
||||
declare const LiteAdaptor_base: Constructor<LiteBase>;
|
||||
export declare class LiteAdaptor extends LiteAdaptor_base {
|
||||
}
|
||||
export declare function liteAdaptor(options?: OptionList): LiteAdaptor;
|
||||
export {};
|
||||
445
node_modules/mathjax-full/js/adaptors/liteAdaptor.js
generated
vendored
Normal file
445
node_modules/mathjax-full/js/adaptors/liteAdaptor.js
generated
vendored
Normal file
|
|
@ -0,0 +1,445 @@
|
|||
"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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
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.");
|
||||
};
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.liteAdaptor = exports.LiteAdaptor = exports.LiteBase = void 0;
|
||||
var DOMAdaptor_js_1 = require("../core/DOMAdaptor.js");
|
||||
var NodeMixin_js_1 = require("./NodeMixin.js");
|
||||
var Document_js_1 = require("./lite/Document.js");
|
||||
var Element_js_1 = require("./lite/Element.js");
|
||||
var Text_js_1 = require("./lite/Text.js");
|
||||
var Window_js_1 = require("./lite/Window.js");
|
||||
var Parser_js_1 = require("./lite/Parser.js");
|
||||
var Styles_js_1 = require("../util/Styles.js");
|
||||
var LiteBase = (function (_super) {
|
||||
__extends(LiteBase, _super);
|
||||
function LiteBase() {
|
||||
var _this = _super.call(this) || this;
|
||||
_this.parser = new Parser_js_1.LiteParser();
|
||||
_this.window = new Window_js_1.LiteWindow();
|
||||
return _this;
|
||||
}
|
||||
LiteBase.prototype.parse = function (text, format) {
|
||||
return this.parser.parseFromString(text, format, this);
|
||||
};
|
||||
LiteBase.prototype.create = function (kind, _ns) {
|
||||
if (_ns === void 0) { _ns = null; }
|
||||
return new Element_js_1.LiteElement(kind);
|
||||
};
|
||||
LiteBase.prototype.text = function (text) {
|
||||
return new Text_js_1.LiteText(text);
|
||||
};
|
||||
LiteBase.prototype.comment = function (text) {
|
||||
return new Text_js_1.LiteComment(text);
|
||||
};
|
||||
LiteBase.prototype.createDocument = function () {
|
||||
return new Document_js_1.LiteDocument();
|
||||
};
|
||||
LiteBase.prototype.head = function (doc) {
|
||||
return doc.head;
|
||||
};
|
||||
LiteBase.prototype.body = function (doc) {
|
||||
return doc.body;
|
||||
};
|
||||
LiteBase.prototype.root = function (doc) {
|
||||
return doc.root;
|
||||
};
|
||||
LiteBase.prototype.doctype = function (doc) {
|
||||
return doc.type;
|
||||
};
|
||||
LiteBase.prototype.tags = function (node, name, ns) {
|
||||
if (ns === void 0) { ns = null; }
|
||||
var stack = [];
|
||||
var tags = [];
|
||||
if (ns) {
|
||||
return tags;
|
||||
}
|
||||
var n = node;
|
||||
while (n) {
|
||||
var kind = n.kind;
|
||||
if (kind !== '#text' && kind !== '#comment') {
|
||||
n = n;
|
||||
if (kind === name) {
|
||||
tags.push(n);
|
||||
}
|
||||
if (n.children.length) {
|
||||
stack = n.children.concat(stack);
|
||||
}
|
||||
}
|
||||
n = stack.shift();
|
||||
}
|
||||
return tags;
|
||||
};
|
||||
LiteBase.prototype.elementById = function (node, id) {
|
||||
var stack = [];
|
||||
var n = node;
|
||||
while (n) {
|
||||
if (n.kind !== '#text' && n.kind !== '#comment') {
|
||||
n = n;
|
||||
if (n.attributes['id'] === id) {
|
||||
return n;
|
||||
}
|
||||
if (n.children.length) {
|
||||
stack = n.children.concat(stack);
|
||||
}
|
||||
}
|
||||
n = stack.shift();
|
||||
}
|
||||
return null;
|
||||
};
|
||||
LiteBase.prototype.elementsByClass = function (node, name) {
|
||||
var stack = [];
|
||||
var tags = [];
|
||||
var n = node;
|
||||
while (n) {
|
||||
if (n.kind !== '#text' && n.kind !== '#comment') {
|
||||
n = n;
|
||||
var classes = (n.attributes['class'] || '').trim().split(/ +/);
|
||||
if (classes.includes(name)) {
|
||||
tags.push(n);
|
||||
}
|
||||
if (n.children.length) {
|
||||
stack = n.children.concat(stack);
|
||||
}
|
||||
}
|
||||
n = stack.shift();
|
||||
}
|
||||
return tags;
|
||||
};
|
||||
LiteBase.prototype.getElements = function (nodes, document) {
|
||||
var e_1, _a;
|
||||
var containers = [];
|
||||
var body = this.body(document);
|
||||
try {
|
||||
for (var nodes_1 = __values(nodes), nodes_1_1 = nodes_1.next(); !nodes_1_1.done; nodes_1_1 = nodes_1.next()) {
|
||||
var node = nodes_1_1.value;
|
||||
if (typeof (node) === 'string') {
|
||||
if (node.charAt(0) === '#') {
|
||||
var n = this.elementById(body, node.slice(1));
|
||||
if (n) {
|
||||
containers.push(n);
|
||||
}
|
||||
}
|
||||
else if (node.charAt(0) === '.') {
|
||||
containers = containers.concat(this.elementsByClass(body, node.slice(1)));
|
||||
}
|
||||
else if (node.match(/^[-a-z][-a-z0-9]*$/i)) {
|
||||
containers = containers.concat(this.tags(body, node));
|
||||
}
|
||||
}
|
||||
else if (Array.isArray(node)) {
|
||||
containers = containers.concat(node);
|
||||
}
|
||||
else if (node instanceof this.window.NodeList || node instanceof this.window.HTMLCollection) {
|
||||
containers = containers.concat(node.nodes);
|
||||
}
|
||||
else {
|
||||
containers.push(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (nodes_1_1 && !nodes_1_1.done && (_a = nodes_1.return)) _a.call(nodes_1);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
return containers;
|
||||
};
|
||||
LiteBase.prototype.contains = function (container, node) {
|
||||
while (node && node !== container) {
|
||||
node = this.parent(node);
|
||||
}
|
||||
return !!node;
|
||||
};
|
||||
LiteBase.prototype.parent = function (node) {
|
||||
return node.parent;
|
||||
};
|
||||
LiteBase.prototype.childIndex = function (node) {
|
||||
return (node.parent ? node.parent.children.findIndex(function (n) { return n === node; }) : -1);
|
||||
};
|
||||
LiteBase.prototype.append = function (node, child) {
|
||||
if (child.parent) {
|
||||
this.remove(child);
|
||||
}
|
||||
node.children.push(child);
|
||||
child.parent = node;
|
||||
return child;
|
||||
};
|
||||
LiteBase.prototype.insert = function (nchild, ochild) {
|
||||
if (nchild.parent) {
|
||||
this.remove(nchild);
|
||||
}
|
||||
if (ochild && ochild.parent) {
|
||||
var i = this.childIndex(ochild);
|
||||
ochild.parent.children.splice(i, 0, nchild);
|
||||
nchild.parent = ochild.parent;
|
||||
}
|
||||
};
|
||||
LiteBase.prototype.remove = function (child) {
|
||||
var i = this.childIndex(child);
|
||||
if (i >= 0) {
|
||||
child.parent.children.splice(i, 1);
|
||||
}
|
||||
child.parent = null;
|
||||
return child;
|
||||
};
|
||||
LiteBase.prototype.replace = function (nnode, onode) {
|
||||
var i = this.childIndex(onode);
|
||||
if (i >= 0) {
|
||||
onode.parent.children[i] = nnode;
|
||||
nnode.parent = onode.parent;
|
||||
onode.parent = null;
|
||||
}
|
||||
return onode;
|
||||
};
|
||||
LiteBase.prototype.clone = function (node) {
|
||||
var _this = this;
|
||||
var nnode = new Element_js_1.LiteElement(node.kind);
|
||||
nnode.attributes = __assign({}, node.attributes);
|
||||
nnode.children = node.children.map(function (n) {
|
||||
if (n.kind === '#text') {
|
||||
return new Text_js_1.LiteText(n.value);
|
||||
}
|
||||
else if (n.kind === '#comment') {
|
||||
return new Text_js_1.LiteComment(n.value);
|
||||
}
|
||||
else {
|
||||
var m = _this.clone(n);
|
||||
m.parent = nnode;
|
||||
return m;
|
||||
}
|
||||
});
|
||||
return nnode;
|
||||
};
|
||||
LiteBase.prototype.split = function (node, n) {
|
||||
var text = new Text_js_1.LiteText(node.value.slice(n));
|
||||
node.value = node.value.slice(0, n);
|
||||
node.parent.children.splice(this.childIndex(node) + 1, 0, text);
|
||||
text.parent = node.parent;
|
||||
return text;
|
||||
};
|
||||
LiteBase.prototype.next = function (node) {
|
||||
var parent = node.parent;
|
||||
if (!parent)
|
||||
return null;
|
||||
var i = this.childIndex(node) + 1;
|
||||
return (i >= 0 && i < parent.children.length ? parent.children[i] : null);
|
||||
};
|
||||
LiteBase.prototype.previous = function (node) {
|
||||
var parent = node.parent;
|
||||
if (!parent)
|
||||
return null;
|
||||
var i = this.childIndex(node) - 1;
|
||||
return (i >= 0 ? parent.children[i] : null);
|
||||
};
|
||||
LiteBase.prototype.firstChild = function (node) {
|
||||
return node.children[0];
|
||||
};
|
||||
LiteBase.prototype.lastChild = function (node) {
|
||||
return node.children[node.children.length - 1];
|
||||
};
|
||||
LiteBase.prototype.childNodes = function (node) {
|
||||
return __spreadArray([], __read(node.children), false);
|
||||
};
|
||||
LiteBase.prototype.childNode = function (node, i) {
|
||||
return node.children[i];
|
||||
};
|
||||
LiteBase.prototype.kind = function (node) {
|
||||
return node.kind;
|
||||
};
|
||||
LiteBase.prototype.value = function (node) {
|
||||
return (node.kind === '#text' ? node.value :
|
||||
node.kind === '#comment' ? node.value.replace(/^<!(--)?((?:.|\n)*)\1>$/, '$2') : '');
|
||||
};
|
||||
LiteBase.prototype.textContent = function (node) {
|
||||
var _this = this;
|
||||
return node.children.reduce(function (s, n) {
|
||||
return s + (n.kind === '#text' ? n.value :
|
||||
n.kind === '#comment' ? '' : _this.textContent(n));
|
||||
}, '');
|
||||
};
|
||||
LiteBase.prototype.innerHTML = function (node) {
|
||||
return this.parser.serializeInner(this, node);
|
||||
};
|
||||
LiteBase.prototype.outerHTML = function (node) {
|
||||
return this.parser.serialize(this, node);
|
||||
};
|
||||
LiteBase.prototype.serializeXML = function (node) {
|
||||
return this.parser.serialize(this, node, true);
|
||||
};
|
||||
LiteBase.prototype.setAttribute = function (node, name, value, ns) {
|
||||
if (ns === void 0) { ns = null; }
|
||||
if (typeof value !== 'string') {
|
||||
value = String(value);
|
||||
}
|
||||
if (ns) {
|
||||
name = ns.replace(/.*\//, '') + ':' + name.replace(/^.*:/, '');
|
||||
}
|
||||
node.attributes[name] = value;
|
||||
if (name === 'style') {
|
||||
node.styles = null;
|
||||
}
|
||||
};
|
||||
LiteBase.prototype.getAttribute = function (node, name) {
|
||||
return node.attributes[name];
|
||||
};
|
||||
LiteBase.prototype.removeAttribute = function (node, name) {
|
||||
delete node.attributes[name];
|
||||
};
|
||||
LiteBase.prototype.hasAttribute = function (node, name) {
|
||||
return node.attributes.hasOwnProperty(name);
|
||||
};
|
||||
LiteBase.prototype.allAttributes = function (node) {
|
||||
var e_2, _a;
|
||||
var attributes = node.attributes;
|
||||
var list = [];
|
||||
try {
|
||||
for (var _b = __values(Object.keys(attributes)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var name_1 = _c.value;
|
||||
list.push({ name: name_1, value: attributes[name_1] });
|
||||
}
|
||||
}
|
||||
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_2) throw e_2.error; }
|
||||
}
|
||||
return list;
|
||||
};
|
||||
LiteBase.prototype.addClass = function (node, name) {
|
||||
var classes = (node.attributes['class'] || '').split(/ /);
|
||||
if (!classes.find(function (n) { return n === name; })) {
|
||||
classes.push(name);
|
||||
node.attributes['class'] = classes.join(' ');
|
||||
}
|
||||
};
|
||||
LiteBase.prototype.removeClass = function (node, name) {
|
||||
var classes = (node.attributes['class'] || '').split(/ /);
|
||||
var i = classes.findIndex(function (n) { return n === name; });
|
||||
if (i >= 0) {
|
||||
classes.splice(i, 1);
|
||||
node.attributes['class'] = classes.join(' ');
|
||||
}
|
||||
};
|
||||
LiteBase.prototype.hasClass = function (node, name) {
|
||||
var classes = (node.attributes['class'] || '').split(/ /);
|
||||
return !!classes.find(function (n) { return n === name; });
|
||||
};
|
||||
LiteBase.prototype.setStyle = function (node, name, value) {
|
||||
if (!node.styles) {
|
||||
node.styles = new Styles_js_1.Styles(this.getAttribute(node, 'style'));
|
||||
}
|
||||
node.styles.set(name, value);
|
||||
node.attributes['style'] = node.styles.cssText;
|
||||
};
|
||||
LiteBase.prototype.getStyle = function (node, name) {
|
||||
if (!node.styles) {
|
||||
var style = this.getAttribute(node, 'style');
|
||||
if (!style) {
|
||||
return '';
|
||||
}
|
||||
node.styles = new Styles_js_1.Styles(style);
|
||||
}
|
||||
return node.styles.get(name);
|
||||
};
|
||||
LiteBase.prototype.allStyles = function (node) {
|
||||
return this.getAttribute(node, 'style');
|
||||
};
|
||||
LiteBase.prototype.insertRules = function (node, rules) {
|
||||
node.children = [this.text(rules.join('\n\n') + '\n\n' + this.textContent(node))];
|
||||
};
|
||||
LiteBase.prototype.fontSize = function (_node) {
|
||||
return 0;
|
||||
};
|
||||
LiteBase.prototype.fontFamily = function (_node) {
|
||||
return '';
|
||||
};
|
||||
LiteBase.prototype.nodeSize = function (_node, _em, _local) {
|
||||
if (_em === void 0) { _em = 1; }
|
||||
if (_local === void 0) { _local = null; }
|
||||
return [0, 0];
|
||||
};
|
||||
LiteBase.prototype.nodeBBox = function (_node) {
|
||||
return { left: 0, right: 0, top: 0, bottom: 0 };
|
||||
};
|
||||
return LiteBase;
|
||||
}(DOMAdaptor_js_1.AbstractDOMAdaptor));
|
||||
exports.LiteBase = LiteBase;
|
||||
var LiteAdaptor = (function (_super) {
|
||||
__extends(LiteAdaptor, _super);
|
||||
function LiteAdaptor() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
return LiteAdaptor;
|
||||
}((0, NodeMixin_js_1.NodeMixin)(LiteBase)));
|
||||
exports.LiteAdaptor = LiteAdaptor;
|
||||
function liteAdaptor(options) {
|
||||
if (options === void 0) { options = null; }
|
||||
return new LiteAdaptor(null, options);
|
||||
}
|
||||
exports.liteAdaptor = liteAdaptor;
|
||||
//# sourceMappingURL=liteAdaptor.js.map
|
||||
1
node_modules/mathjax-full/js/adaptors/liteAdaptor.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/adaptors/liteAdaptor.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
16
node_modules/mathjax-full/js/components/global.d.ts
generated
vendored
Normal file
16
node_modules/mathjax-full/js/components/global.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
export interface MathJaxConfig {
|
||||
[name: string]: any;
|
||||
}
|
||||
export interface MathJaxLibrary {
|
||||
[name: string]: any;
|
||||
}
|
||||
export interface MathJaxObject {
|
||||
version: string;
|
||||
_: MathJaxLibrary;
|
||||
config: MathJaxConfig;
|
||||
}
|
||||
export declare function isObject(x: any): boolean;
|
||||
export declare function combineConfig(dst: any, src: any): any;
|
||||
export declare function combineDefaults(dst: any, name: string, src: any): any;
|
||||
export declare function combineWithMathJax(config: any): MathJaxObject;
|
||||
export declare const MathJax: MathJaxObject;
|
||||
88
node_modules/mathjax-full/js/components/global.js
generated
vendored
Normal file
88
node_modules/mathjax-full/js/components/global.js
generated
vendored
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
"use strict";
|
||||
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.MathJax = exports.combineWithMathJax = exports.combineDefaults = exports.combineConfig = exports.isObject = void 0;
|
||||
var version_js_1 = require("./version.js");
|
||||
function isObject(x) {
|
||||
return typeof x === 'object' && x !== null;
|
||||
}
|
||||
exports.isObject = isObject;
|
||||
function combineConfig(dst, src) {
|
||||
var e_1, _a;
|
||||
try {
|
||||
for (var _b = __values(Object.keys(src)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var id = _c.value;
|
||||
if (id === '__esModule')
|
||||
continue;
|
||||
if (isObject(dst[id]) && isObject(src[id]) &&
|
||||
!(src[id] instanceof Promise)) {
|
||||
combineConfig(dst[id], src[id]);
|
||||
}
|
||||
else if (src[id] !== null && src[id] !== undefined) {
|
||||
dst[id] = src[id];
|
||||
}
|
||||
}
|
||||
}
|
||||
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 dst;
|
||||
}
|
||||
exports.combineConfig = combineConfig;
|
||||
function combineDefaults(dst, name, src) {
|
||||
var e_2, _a;
|
||||
if (!dst[name]) {
|
||||
dst[name] = {};
|
||||
}
|
||||
dst = dst[name];
|
||||
try {
|
||||
for (var _b = __values(Object.keys(src)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var id = _c.value;
|
||||
if (isObject(dst[id]) && isObject(src[id])) {
|
||||
combineDefaults(dst, id, src[id]);
|
||||
}
|
||||
else if (dst[id] == null && src[id] != null) {
|
||||
dst[id] = src[id];
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_2) throw e_2.error; }
|
||||
}
|
||||
return dst;
|
||||
}
|
||||
exports.combineDefaults = combineDefaults;
|
||||
function combineWithMathJax(config) {
|
||||
return combineConfig(exports.MathJax, config);
|
||||
}
|
||||
exports.combineWithMathJax = combineWithMathJax;
|
||||
if (typeof global.MathJax === 'undefined') {
|
||||
global.MathJax = {};
|
||||
}
|
||||
if (!global.MathJax.version) {
|
||||
global.MathJax = {
|
||||
version: version_js_1.VERSION,
|
||||
_: {},
|
||||
config: global.MathJax
|
||||
};
|
||||
}
|
||||
exports.MathJax = global.MathJax;
|
||||
//# sourceMappingURL=global.js.map
|
||||
1
node_modules/mathjax-full/js/components/global.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/components/global.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"global.js","sourceRoot":"","sources":["../../ts/components/global.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAwBA,2CAAqC;AAiCrC,SAAgB,QAAQ,CAAC,CAAM;IAC7B,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,CAAC;AAC7C,CAAC;AAFD,4BAEC;AAUD,SAAgB,aAAa,CAAC,GAAQ,EAAE,GAAQ;;;QAC9C,KAAiB,IAAA,KAAA,SAAA,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA,gBAAA,4BAAE;YAA9B,IAAM,EAAE,WAAA;YACX,IAAI,EAAE,KAAK,YAAY;gBAAE,SAAS;YAClC,IAAI,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;gBACtC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,YAAY,OAAO,CAAC,EAA+B;gBAC9D,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;aACjC;iBAAM,IAAI,GAAG,CAAC,EAAE,CAAC,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC,KAAK,SAAS,EAAE;gBACpD,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC;aACnB;SACF;;;;;;;;;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAXD,sCAWC;AAYD,SAAgB,eAAe,CAAC,GAAQ,EAAE,IAAY,EAAE,GAAQ;;IAC9D,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QACd,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;KAChB;IACD,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;;QAChB,KAAiB,IAAA,KAAA,SAAA,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA,gBAAA,4BAAE;YAA9B,IAAM,EAAE,WAAA;YACX,IAAI,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE;gBAC1C,eAAe,CAAC,GAAG,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;aACnC;iBAAM,IAAI,GAAG,CAAC,EAAE,CAAC,IAAI,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC,IAAI,IAAI,EAAE;gBAC7C,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC;aACnB;SACF;;;;;;;;;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAbD,0CAaC;AAOD,SAAgB,kBAAkB,CAAC,MAAW;IAC5C,OAAO,aAAa,CAAC,eAAO,EAAE,MAAM,CAAC,CAAC;AACxC,CAAC;AAFD,gDAEC;AAMD,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,WAAW,EAAE;IACzC,MAAM,CAAC,OAAO,GAAG,EAAmB,CAAC;CACtC;AAOD,IAAI,CAAE,MAAM,CAAC,OAAyB,CAAC,OAAO,EAAE;IAC9C,MAAM,CAAC,OAAO,GAAG;QACf,OAAO,EAAE,oBAAO;QAChB,CAAC,EAAE,EAAE;QACL,MAAM,EAAE,MAAM,CAAC,OAAO;KACvB,CAAC;CACH;AAKY,QAAA,OAAO,GAAG,MAAM,CAAC,OAAwB,CAAC"}
|
||||
1
node_modules/mathjax-full/js/components/latest.d.ts
generated
vendored
Normal file
1
node_modules/mathjax-full/js/components/latest.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export declare function loadLatest(): void;
|
||||
288
node_modules/mathjax-full/js/components/latest.js
generated
vendored
Normal file
288
node_modules/mathjax-full/js/components/latest.js
generated
vendored
Normal file
|
|
@ -0,0 +1,288 @@
|
|||
"use strict";
|
||||
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.");
|
||||
};
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.loadLatest = void 0;
|
||||
var CDN = new Map([
|
||||
['cdnjs.cloudflare.com', {
|
||||
api: 'https://api.cdnjs.com/libraries/mathjax?fields=version',
|
||||
key: 'version',
|
||||
base: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/'
|
||||
}],
|
||||
['rawcdn.githack.com', {
|
||||
api: 'https://api.github.com/repos/mathjax/mathjax/releases/latest',
|
||||
key: 'tag_name',
|
||||
base: 'https://rawcdn.githack.com/mathjax/MathJax/'
|
||||
}],
|
||||
['gitcdn.xyz', {
|
||||
api: 'https://api.github.com/repos/mathjax/mathjax/releases/latest',
|
||||
key: 'tag_name',
|
||||
base: 'https://gitcdn.xyz/mathjax/MathJax/'
|
||||
}],
|
||||
['cdn.statically.io', {
|
||||
api: 'https://api.github.com/repos/mathjax/mathjax/releases/latest',
|
||||
key: 'tag_name',
|
||||
base: 'https://cdn.statically.io/gh/mathjax/MathJax/'
|
||||
}],
|
||||
['unpkg.com', {
|
||||
api: 'https://api.github.com/repos/mathjax/mathjax/releases/latest',
|
||||
key: 'tag_name',
|
||||
base: 'https://unpkg.com/mathjax@'
|
||||
}],
|
||||
['cdn.jsdelivr.net', {
|
||||
api: 'https://api.github.com/repos/mathjax/mathjax/releases/latest',
|
||||
key: 'tag_name',
|
||||
base: 'https://cdn.jsdelivr.net/npm/mathjax@'
|
||||
}]
|
||||
]);
|
||||
var GITHUB = {
|
||||
api: 'https://api.github.com/repos/mathjax/mathjax/releases',
|
||||
key: 'tag_name'
|
||||
};
|
||||
var MJX_VERSION = 3;
|
||||
var MJX_LATEST = 'mjx-latest-version';
|
||||
var SAVE_TIME = 1000 * 60 * 60 * 24 * 7;
|
||||
var script = null;
|
||||
function Error(message) {
|
||||
if (console && console.error) {
|
||||
console.error('MathJax(latest.js): ' + message);
|
||||
}
|
||||
}
|
||||
function scriptData(script, cdn) {
|
||||
if (cdn === void 0) { cdn = null; }
|
||||
script.parentNode.removeChild(script);
|
||||
var src = script.src;
|
||||
var file = src.replace(/.*?\/latest\.js(\?|$)/, '');
|
||||
if (file === '') {
|
||||
file = 'startup.js';
|
||||
src = src.replace(/\?$/, '') + '?' + file;
|
||||
}
|
||||
var version = (src.match(/(\d+\.\d+\.\d+)(\/es\d+)?\/latest.js\?/) || ['', ''])[1];
|
||||
var dir = (src.match(/(\/es\d+)\/latest.js\?/) || ['', ''])[1] || '';
|
||||
return {
|
||||
tag: script,
|
||||
src: src,
|
||||
id: script.id,
|
||||
version: version,
|
||||
dir: dir,
|
||||
file: file,
|
||||
cdn: cdn
|
||||
};
|
||||
}
|
||||
function checkScript(script) {
|
||||
var e_1, _a;
|
||||
try {
|
||||
for (var _b = __values(CDN.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var server = _c.value;
|
||||
var cdn = CDN.get(server);
|
||||
var url = cdn.base;
|
||||
var src = script.src;
|
||||
if (src && src.substr(0, url.length) === url && src.match(/\/latest\.js(\?|$)/)) {
|
||||
return scriptData(script, cdn);
|
||||
}
|
||||
}
|
||||
}
|
||||
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 null;
|
||||
}
|
||||
function getScript() {
|
||||
var e_2, _a;
|
||||
if (document.currentScript) {
|
||||
return scriptData(document.currentScript);
|
||||
}
|
||||
var script = document.getElementById('MathJax-script');
|
||||
if (script && script.nodeName.toLowerCase() === 'script') {
|
||||
return checkScript(script);
|
||||
}
|
||||
var scripts = document.getElementsByTagName('script');
|
||||
try {
|
||||
for (var _b = __values(Array.from(scripts)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var script_1 = _c.value;
|
||||
var data = checkScript(script_1);
|
||||
if (data) {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_2) throw e_2.error; }
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function saveVersion(version) {
|
||||
try {
|
||||
var data = version + ' ' + Date.now();
|
||||
localStorage.setItem(MJX_LATEST, data);
|
||||
}
|
||||
catch (err) { }
|
||||
}
|
||||
function getSavedVersion() {
|
||||
try {
|
||||
var _a = __read(localStorage.getItem(MJX_LATEST).split(/ /), 2), version = _a[0], date = _a[1];
|
||||
if (date && Date.now() - parseInt(date) < SAVE_TIME) {
|
||||
return version;
|
||||
}
|
||||
}
|
||||
catch (err) { }
|
||||
return null;
|
||||
}
|
||||
function loadMathJax(url, id) {
|
||||
var script = document.createElement('script');
|
||||
script.type = 'text/javascript';
|
||||
script.async = true;
|
||||
script.src = url;
|
||||
if (id) {
|
||||
script.id = id;
|
||||
}
|
||||
var head = document.head || document.getElementsByTagName('head')[0] || document.body;
|
||||
if (head) {
|
||||
head.appendChild(script);
|
||||
}
|
||||
else {
|
||||
Error('Can\'t find the document <head> element');
|
||||
}
|
||||
}
|
||||
function loadDefaultMathJax() {
|
||||
if (script) {
|
||||
loadMathJax(script.src.replace(/\/latest\.js\?/, '/'), script.id);
|
||||
}
|
||||
else {
|
||||
Error('Can\'t determine the URL for loading MathJax');
|
||||
}
|
||||
}
|
||||
function loadVersion(version) {
|
||||
if (script.version && script.version !== version) {
|
||||
script.file = 'latest.js?' + script.file;
|
||||
}
|
||||
loadMathJax(script.cdn.base + version + script.dir + '/' + script.file, script.id);
|
||||
}
|
||||
function checkVersion(version) {
|
||||
var major = parseInt(version.split(/\./)[0]);
|
||||
if (major === MJX_VERSION && !version.match(/-(beta|rc)/)) {
|
||||
saveVersion(version);
|
||||
loadVersion(version);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function getXMLHttpRequest() {
|
||||
if (window.XMLHttpRequest) {
|
||||
return new XMLHttpRequest();
|
||||
}
|
||||
if (window.ActiveXObject) {
|
||||
try {
|
||||
return new window.ActiveXObject('Msxml2.XMLHTTP');
|
||||
}
|
||||
catch (err) { }
|
||||
try {
|
||||
return new window.ActiveXObject('Microsoft.XMLHTTP');
|
||||
}
|
||||
catch (err) { }
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function requestXML(cdn, action, failure) {
|
||||
var request = getXMLHttpRequest();
|
||||
if (request) {
|
||||
request.onreadystatechange = function () {
|
||||
if (request.readyState === 4) {
|
||||
if (request.status === 200) {
|
||||
!action(JSON.parse(request.responseText)) && failure();
|
||||
}
|
||||
else {
|
||||
Error('Problem acquiring MathJax version: status = ' + request.status);
|
||||
failure();
|
||||
}
|
||||
}
|
||||
};
|
||||
request.open('GET', cdn.api, true);
|
||||
request.send(null);
|
||||
}
|
||||
else {
|
||||
Error('Can\'t create XMLHttpRequest object');
|
||||
failure();
|
||||
}
|
||||
}
|
||||
function loadLatestGitVersion() {
|
||||
requestXML(GITHUB, function (json) {
|
||||
var e_3, _a;
|
||||
if (!(json instanceof Array))
|
||||
return false;
|
||||
try {
|
||||
for (var json_1 = __values(json), json_1_1 = json_1.next(); !json_1_1.done; json_1_1 = json_1.next()) {
|
||||
var data = json_1_1.value;
|
||||
if (checkVersion(data[GITHUB.key])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (json_1_1 && !json_1_1.done && (_a = json_1.return)) _a.call(json_1);
|
||||
}
|
||||
finally { if (e_3) throw e_3.error; }
|
||||
}
|
||||
return false;
|
||||
}, loadDefaultMathJax);
|
||||
}
|
||||
function loadLatestCdnVersion() {
|
||||
requestXML(script.cdn, function (json) {
|
||||
if (json instanceof Array) {
|
||||
json = json[0];
|
||||
}
|
||||
if (!checkVersion(json[script.cdn.key])) {
|
||||
loadLatestGitVersion();
|
||||
}
|
||||
return true;
|
||||
}, loadDefaultMathJax);
|
||||
}
|
||||
function loadLatest() {
|
||||
script = getScript();
|
||||
if (script && script.cdn) {
|
||||
var version = getSavedVersion();
|
||||
version ?
|
||||
loadVersion(version) :
|
||||
loadLatestCdnVersion();
|
||||
}
|
||||
else {
|
||||
loadDefaultMathJax();
|
||||
}
|
||||
}
|
||||
exports.loadLatest = loadLatest;
|
||||
//# sourceMappingURL=latest.js.map
|
||||
1
node_modules/mathjax-full/js/components/latest.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/components/latest.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
83
node_modules/mathjax-full/js/components/loader.d.ts
generated
vendored
Normal file
83
node_modules/mathjax-full/js/components/loader.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
import { MathJaxObject as MJObject, MathJaxLibrary, MathJaxConfig as MJConfig } from './global.js';
|
||||
import { PackageReady, PackageFailed } from './package.js';
|
||||
export { Package, PackageError, PackageReady, PackageFailed } from './package.js';
|
||||
export { MathJaxLibrary } from './global.js';
|
||||
import { FunctionList } from '../util/FunctionList.js';
|
||||
export declare type PathFilterFunction = (data: {
|
||||
name: string;
|
||||
original: string;
|
||||
addExtension: boolean;
|
||||
}) => boolean;
|
||||
export declare type PathFilterList = (PathFilterFunction | [PathFilterFunction, number])[];
|
||||
export interface MathJaxConfig extends MJConfig {
|
||||
loader?: {
|
||||
paths?: {
|
||||
[name: string]: string;
|
||||
};
|
||||
source?: {
|
||||
[name: string]: string;
|
||||
};
|
||||
dependencies?: {
|
||||
[name: string]: string[];
|
||||
};
|
||||
provides?: {
|
||||
[name: string]: string[];
|
||||
};
|
||||
load?: string[];
|
||||
ready?: PackageReady;
|
||||
failed?: PackageFailed;
|
||||
require?: (url: string) => any;
|
||||
pathFilters?: PathFilterList;
|
||||
versionWarnings?: boolean;
|
||||
[name: string]: any;
|
||||
};
|
||||
}
|
||||
export interface MathJaxObject extends MJObject {
|
||||
_: MathJaxLibrary;
|
||||
config: MathJaxConfig;
|
||||
loader: {
|
||||
ready: (...names: string[]) => Promise<string[]>;
|
||||
load: (...names: string[]) => Promise<string>;
|
||||
preLoad: (...names: string[]) => void;
|
||||
defaultReady: () => void;
|
||||
getRoot: () => string;
|
||||
checkVersion: (name: string, version: string) => boolean;
|
||||
pathFilters: FunctionList;
|
||||
};
|
||||
startup?: any;
|
||||
}
|
||||
export declare const PathFilters: {
|
||||
[name: string]: PathFilterFunction;
|
||||
};
|
||||
export declare namespace Loader {
|
||||
const versions: Map<string, string>;
|
||||
function ready(...names: string[]): Promise<string[]>;
|
||||
function load(...names: string[]): Promise<void | string[]>;
|
||||
function preLoad(...names: string[]): void;
|
||||
function defaultReady(): void;
|
||||
function getRoot(): string;
|
||||
function checkVersion(name: string, version: string, _type?: string): boolean;
|
||||
const pathFilters: FunctionList;
|
||||
}
|
||||
export declare const MathJax: MathJaxObject;
|
||||
export declare const CONFIG: {
|
||||
[name: string]: any;
|
||||
paths?: {
|
||||
[name: string]: string;
|
||||
};
|
||||
source?: {
|
||||
[name: string]: string;
|
||||
};
|
||||
dependencies?: {
|
||||
[name: string]: string[];
|
||||
};
|
||||
provides?: {
|
||||
[name: string]: string[];
|
||||
};
|
||||
load?: string[];
|
||||
ready?: PackageReady;
|
||||
failed?: PackageFailed;
|
||||
require?: (url: string) => any;
|
||||
pathFilters?: PathFilterList;
|
||||
versionWarnings?: boolean;
|
||||
};
|
||||
218
node_modules/mathjax-full/js/components/loader.js
generated
vendored
Normal file
218
node_modules/mathjax-full/js/components/loader.js
generated
vendored
Normal file
|
|
@ -0,0 +1,218 @@
|
|||
"use strict";
|
||||
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.");
|
||||
};
|
||||
var e_1, _a;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CONFIG = exports.MathJax = exports.Loader = exports.PathFilters = exports.PackageError = exports.Package = void 0;
|
||||
var global_js_1 = require("./global.js");
|
||||
var package_js_1 = require("./package.js");
|
||||
var package_js_2 = require("./package.js");
|
||||
Object.defineProperty(exports, "Package", { enumerable: true, get: function () { return package_js_2.Package; } });
|
||||
Object.defineProperty(exports, "PackageError", { enumerable: true, get: function () { return package_js_2.PackageError; } });
|
||||
var FunctionList_js_1 = require("../util/FunctionList.js");
|
||||
exports.PathFilters = {
|
||||
source: function (data) {
|
||||
if (exports.CONFIG.source.hasOwnProperty(data.name)) {
|
||||
data.name = exports.CONFIG.source[data.name];
|
||||
}
|
||||
return true;
|
||||
},
|
||||
normalize: function (data) {
|
||||
var name = data.name;
|
||||
if (!name.match(/^(?:[a-z]+:\/)?\/|[a-z]:\\|\[/i)) {
|
||||
data.name = '[mathjax]/' + name.replace(/^\.\//, '');
|
||||
}
|
||||
if (data.addExtension && !name.match(/\.[^\/]+$/)) {
|
||||
data.name += '.js';
|
||||
}
|
||||
return true;
|
||||
},
|
||||
prefix: function (data) {
|
||||
var match;
|
||||
while ((match = data.name.match(/^\[([^\]]*)\]/))) {
|
||||
if (!exports.CONFIG.paths.hasOwnProperty(match[1]))
|
||||
break;
|
||||
data.name = exports.CONFIG.paths[match[1]] + data.name.substr(match[0].length);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
var Loader;
|
||||
(function (Loader) {
|
||||
var VERSION = global_js_1.MathJax.version;
|
||||
Loader.versions = new Map();
|
||||
function ready() {
|
||||
var e_2, _a;
|
||||
var names = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
names[_i] = arguments[_i];
|
||||
}
|
||||
if (names.length === 0) {
|
||||
names = Array.from(package_js_1.Package.packages.keys());
|
||||
}
|
||||
var promises = [];
|
||||
try {
|
||||
for (var names_1 = __values(names), names_1_1 = names_1.next(); !names_1_1.done; names_1_1 = names_1.next()) {
|
||||
var name_1 = names_1_1.value;
|
||||
var extension = package_js_1.Package.packages.get(name_1) || new package_js_1.Package(name_1, true);
|
||||
promises.push(extension.promise);
|
||||
}
|
||||
}
|
||||
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (names_1_1 && !names_1_1.done && (_a = names_1.return)) _a.call(names_1);
|
||||
}
|
||||
finally { if (e_2) throw e_2.error; }
|
||||
}
|
||||
return Promise.all(promises);
|
||||
}
|
||||
Loader.ready = ready;
|
||||
function load() {
|
||||
var e_3, _a;
|
||||
var names = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
names[_i] = arguments[_i];
|
||||
}
|
||||
if (names.length === 0) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
var promises = [];
|
||||
var _loop_1 = function (name_2) {
|
||||
var extension = package_js_1.Package.packages.get(name_2);
|
||||
if (!extension) {
|
||||
extension = new package_js_1.Package(name_2);
|
||||
extension.provides(exports.CONFIG.provides[name_2]);
|
||||
}
|
||||
extension.checkNoLoad();
|
||||
promises.push(extension.promise.then(function () {
|
||||
if (!exports.CONFIG.versionWarnings)
|
||||
return;
|
||||
if (extension.isLoaded && !Loader.versions.has(package_js_1.Package.resolvePath(name_2))) {
|
||||
console.warn("No version information available for component ".concat(name_2));
|
||||
}
|
||||
}));
|
||||
};
|
||||
try {
|
||||
for (var names_2 = __values(names), names_2_1 = names_2.next(); !names_2_1.done; names_2_1 = names_2.next()) {
|
||||
var name_2 = names_2_1.value;
|
||||
_loop_1(name_2);
|
||||
}
|
||||
}
|
||||
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (names_2_1 && !names_2_1.done && (_a = names_2.return)) _a.call(names_2);
|
||||
}
|
||||
finally { if (e_3) throw e_3.error; }
|
||||
}
|
||||
package_js_1.Package.loadAll();
|
||||
return Promise.all(promises);
|
||||
}
|
||||
Loader.load = load;
|
||||
function preLoad() {
|
||||
var e_4, _a;
|
||||
var names = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
names[_i] = arguments[_i];
|
||||
}
|
||||
try {
|
||||
for (var names_3 = __values(names), names_3_1 = names_3.next(); !names_3_1.done; names_3_1 = names_3.next()) {
|
||||
var name_3 = names_3_1.value;
|
||||
var extension = package_js_1.Package.packages.get(name_3);
|
||||
if (!extension) {
|
||||
extension = new package_js_1.Package(name_3, true);
|
||||
extension.provides(exports.CONFIG.provides[name_3]);
|
||||
}
|
||||
extension.loaded();
|
||||
}
|
||||
}
|
||||
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (names_3_1 && !names_3_1.done && (_a = names_3.return)) _a.call(names_3);
|
||||
}
|
||||
finally { if (e_4) throw e_4.error; }
|
||||
}
|
||||
}
|
||||
Loader.preLoad = preLoad;
|
||||
function defaultReady() {
|
||||
if (typeof exports.MathJax.startup !== 'undefined') {
|
||||
exports.MathJax.config.startup.ready();
|
||||
}
|
||||
}
|
||||
Loader.defaultReady = defaultReady;
|
||||
function getRoot() {
|
||||
var root = __dirname + '/../../es5';
|
||||
if (typeof document !== 'undefined') {
|
||||
var script = document.currentScript || document.getElementById('MathJax-script');
|
||||
if (script) {
|
||||
root = script.src.replace(/\/[^\/]*$/, '');
|
||||
}
|
||||
}
|
||||
return root;
|
||||
}
|
||||
Loader.getRoot = getRoot;
|
||||
function checkVersion(name, version, _type) {
|
||||
Loader.versions.set(package_js_1.Package.resolvePath(name), VERSION);
|
||||
if (exports.CONFIG.versionWarnings && version !== VERSION) {
|
||||
console.warn("Component ".concat(name, " uses ").concat(version, " of MathJax; version in use is ").concat(VERSION));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
Loader.checkVersion = checkVersion;
|
||||
Loader.pathFilters = new FunctionList_js_1.FunctionList();
|
||||
Loader.pathFilters.add(exports.PathFilters.source, 0);
|
||||
Loader.pathFilters.add(exports.PathFilters.normalize, 10);
|
||||
Loader.pathFilters.add(exports.PathFilters.prefix, 20);
|
||||
})(Loader = exports.Loader || (exports.Loader = {}));
|
||||
exports.MathJax = global_js_1.MathJax;
|
||||
if (typeof exports.MathJax.loader === 'undefined') {
|
||||
(0, global_js_1.combineDefaults)(exports.MathJax.config, 'loader', {
|
||||
paths: {
|
||||
mathjax: Loader.getRoot()
|
||||
},
|
||||
source: {},
|
||||
dependencies: {},
|
||||
provides: {},
|
||||
load: [],
|
||||
ready: Loader.defaultReady.bind(Loader),
|
||||
failed: function (error) { return console.log("MathJax(".concat(error.package || '?', "): ").concat(error.message)); },
|
||||
require: null,
|
||||
pathFilters: [],
|
||||
versionWarnings: true
|
||||
});
|
||||
(0, global_js_1.combineWithMathJax)({
|
||||
loader: Loader
|
||||
});
|
||||
try {
|
||||
for (var _b = __values(exports.MathJax.config.loader.pathFilters), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var filter = _c.value;
|
||||
if (Array.isArray(filter)) {
|
||||
Loader.pathFilters.add(filter[0], filter[1]);
|
||||
}
|
||||
else {
|
||||
Loader.pathFilters.add(filter);
|
||||
}
|
||||
}
|
||||
}
|
||||
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; }
|
||||
}
|
||||
}
|
||||
exports.CONFIG = exports.MathJax.config.loader;
|
||||
//# sourceMappingURL=loader.js.map
|
||||
1
node_modules/mathjax-full/js/components/loader.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/components/loader.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
44
node_modules/mathjax-full/js/components/package.d.ts
generated
vendored
Normal file
44
node_modules/mathjax-full/js/components/package.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
export declare type PackageMap = Map<string, Package>;
|
||||
export declare class PackageError extends Error {
|
||||
package: string;
|
||||
constructor(message: string, name: string);
|
||||
}
|
||||
export declare type PackageReady = (name: string) => string | void;
|
||||
export declare type PackageFailed = (message: PackageError) => void;
|
||||
export declare type PackagePromise = (resolve: PackageReady, reject: PackageFailed) => void;
|
||||
export interface PackageConfig {
|
||||
ready?: PackageReady;
|
||||
failed?: PackageFailed;
|
||||
checkReady?: () => Promise<void>;
|
||||
}
|
||||
export declare class Package {
|
||||
static packages: PackageMap;
|
||||
name: string;
|
||||
isLoaded: boolean;
|
||||
promise: Promise<string>;
|
||||
protected isLoading: boolean;
|
||||
protected hasFailed: boolean;
|
||||
protected noLoad: boolean;
|
||||
protected resolve: PackageReady;
|
||||
protected reject: PackageFailed;
|
||||
protected dependents: Package[];
|
||||
protected dependencies: Package[];
|
||||
protected dependencyCount: number;
|
||||
protected provided: Package[];
|
||||
get canLoad(): boolean;
|
||||
static resolvePath(name: string, addExtension?: boolean): string;
|
||||
static loadAll(): void;
|
||||
constructor(name: string, noLoad?: boolean);
|
||||
protected makeDependencies(): Promise<string>[];
|
||||
protected makePromise(promises: Promise<string>[]): Promise<string>;
|
||||
load(): void;
|
||||
protected loadCustom(url: string): void;
|
||||
protected loadScript(url: string): void;
|
||||
loaded(): void;
|
||||
protected failed(message: string): void;
|
||||
protected checkLoad(): void;
|
||||
requirementSatisfied(): void;
|
||||
provides(names?: string[]): void;
|
||||
addDependent(extension: Package, noLoad: boolean): void;
|
||||
checkNoLoad(): void;
|
||||
}
|
||||
311
node_modules/mathjax-full/js/components/package.js
generated
vendored
Normal file
311
node_modules/mathjax-full/js/components/package.js
generated
vendored
Normal file
|
|
@ -0,0 +1,311 @@
|
|||
"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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
if (typeof b !== "function" && b !== null)
|
||||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
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.");
|
||||
};
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Package = exports.PackageError = void 0;
|
||||
var loader_js_1 = require("./loader.js");
|
||||
var PackageError = (function (_super) {
|
||||
__extends(PackageError, _super);
|
||||
function PackageError(message, name) {
|
||||
var _this = _super.call(this, message) || this;
|
||||
_this.package = name;
|
||||
return _this;
|
||||
}
|
||||
return PackageError;
|
||||
}(Error));
|
||||
exports.PackageError = PackageError;
|
||||
var Package = (function () {
|
||||
function Package(name, noLoad) {
|
||||
if (noLoad === void 0) { noLoad = false; }
|
||||
this.isLoaded = false;
|
||||
this.isLoading = false;
|
||||
this.hasFailed = false;
|
||||
this.dependents = [];
|
||||
this.dependencies = [];
|
||||
this.dependencyCount = 0;
|
||||
this.provided = [];
|
||||
this.name = name;
|
||||
this.noLoad = noLoad;
|
||||
Package.packages.set(name, this);
|
||||
this.promise = this.makePromise(this.makeDependencies());
|
||||
}
|
||||
Object.defineProperty(Package.prototype, "canLoad", {
|
||||
get: function () {
|
||||
return this.dependencyCount === 0 && !this.noLoad && !this.isLoading && !this.hasFailed;
|
||||
},
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
Package.resolvePath = function (name, addExtension) {
|
||||
if (addExtension === void 0) { addExtension = true; }
|
||||
var data = { name: name, original: name, addExtension: addExtension };
|
||||
loader_js_1.Loader.pathFilters.execute(data);
|
||||
return data.name;
|
||||
};
|
||||
Package.loadAll = function () {
|
||||
var e_1, _a;
|
||||
try {
|
||||
for (var _b = __values(this.packages.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var extension = _c.value;
|
||||
if (extension.canLoad) {
|
||||
extension.load();
|
||||
}
|
||||
}
|
||||
}
|
||||
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; }
|
||||
}
|
||||
};
|
||||
Package.prototype.makeDependencies = function () {
|
||||
var e_2, _a;
|
||||
var promises = [];
|
||||
var map = Package.packages;
|
||||
var noLoad = this.noLoad;
|
||||
var name = this.name;
|
||||
var dependencies = [];
|
||||
if (loader_js_1.CONFIG.dependencies.hasOwnProperty(name)) {
|
||||
dependencies.push.apply(dependencies, __spreadArray([], __read(loader_js_1.CONFIG.dependencies[name]), false));
|
||||
}
|
||||
else if (name !== 'core') {
|
||||
dependencies.push('core');
|
||||
}
|
||||
try {
|
||||
for (var dependencies_1 = __values(dependencies), dependencies_1_1 = dependencies_1.next(); !dependencies_1_1.done; dependencies_1_1 = dependencies_1.next()) {
|
||||
var dependent = dependencies_1_1.value;
|
||||
var extension = map.get(dependent) || new Package(dependent, noLoad);
|
||||
if (this.dependencies.indexOf(extension) < 0) {
|
||||
extension.addDependent(this, noLoad);
|
||||
this.dependencies.push(extension);
|
||||
if (!extension.isLoaded) {
|
||||
this.dependencyCount++;
|
||||
promises.push(extension.promise);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (dependencies_1_1 && !dependencies_1_1.done && (_a = dependencies_1.return)) _a.call(dependencies_1);
|
||||
}
|
||||
finally { if (e_2) throw e_2.error; }
|
||||
}
|
||||
return promises;
|
||||
};
|
||||
Package.prototype.makePromise = function (promises) {
|
||||
var _this = this;
|
||||
var promise = new Promise((function (resolve, reject) {
|
||||
_this.resolve = resolve;
|
||||
_this.reject = reject;
|
||||
}));
|
||||
var config = (loader_js_1.CONFIG[this.name] || {});
|
||||
if (config.ready) {
|
||||
promise = promise.then(function (_name) { return config.ready(_this.name); });
|
||||
}
|
||||
if (promises.length) {
|
||||
promises.push(promise);
|
||||
promise = Promise.all(promises).then(function (names) { return names.join(', '); });
|
||||
}
|
||||
if (config.failed) {
|
||||
promise.catch(function (message) { return config.failed(new PackageError(message, _this.name)); });
|
||||
}
|
||||
return promise;
|
||||
};
|
||||
Package.prototype.load = function () {
|
||||
if (!this.isLoaded && !this.isLoading && !this.noLoad) {
|
||||
this.isLoading = true;
|
||||
var url = Package.resolvePath(this.name);
|
||||
if (loader_js_1.CONFIG.require) {
|
||||
this.loadCustom(url);
|
||||
}
|
||||
else {
|
||||
this.loadScript(url);
|
||||
}
|
||||
}
|
||||
};
|
||||
Package.prototype.loadCustom = function (url) {
|
||||
var _this = this;
|
||||
try {
|
||||
var result = loader_js_1.CONFIG.require(url);
|
||||
if (result instanceof Promise) {
|
||||
result.then(function () { return _this.checkLoad(); })
|
||||
.catch(function (err) { return _this.failed('Can\'t load "' + url + '"\n' + err.message.trim()); });
|
||||
}
|
||||
else {
|
||||
this.checkLoad();
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
this.failed(err.message);
|
||||
}
|
||||
};
|
||||
Package.prototype.loadScript = function (url) {
|
||||
var _this = this;
|
||||
var script = document.createElement('script');
|
||||
script.src = url;
|
||||
script.charset = 'UTF-8';
|
||||
script.onload = function (_event) { return _this.checkLoad(); };
|
||||
script.onerror = function (_event) { return _this.failed('Can\'t load "' + url + '"'); };
|
||||
document.head.appendChild(script);
|
||||
};
|
||||
Package.prototype.loaded = function () {
|
||||
var e_3, _a, e_4, _b;
|
||||
this.isLoaded = true;
|
||||
this.isLoading = false;
|
||||
try {
|
||||
for (var _c = __values(this.dependents), _d = _c.next(); !_d.done; _d = _c.next()) {
|
||||
var dependent = _d.value;
|
||||
dependent.requirementSatisfied();
|
||||
}
|
||||
}
|
||||
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
||||
}
|
||||
finally { if (e_3) throw e_3.error; }
|
||||
}
|
||||
try {
|
||||
for (var _e = __values(this.provided), _f = _e.next(); !_f.done; _f = _e.next()) {
|
||||
var provided = _f.value;
|
||||
provided.loaded();
|
||||
}
|
||||
}
|
||||
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
||||
}
|
||||
finally { if (e_4) throw e_4.error; }
|
||||
}
|
||||
this.resolve(this.name);
|
||||
};
|
||||
Package.prototype.failed = function (message) {
|
||||
this.hasFailed = true;
|
||||
this.isLoading = false;
|
||||
this.reject(new PackageError(message, this.name));
|
||||
};
|
||||
Package.prototype.checkLoad = function () {
|
||||
var _this = this;
|
||||
var config = (loader_js_1.CONFIG[this.name] || {});
|
||||
var checkReady = config.checkReady || (function () { return Promise.resolve(); });
|
||||
checkReady().then(function () { return _this.loaded(); })
|
||||
.catch(function (message) { return _this.failed(message); });
|
||||
};
|
||||
Package.prototype.requirementSatisfied = function () {
|
||||
if (this.dependencyCount) {
|
||||
this.dependencyCount--;
|
||||
if (this.canLoad) {
|
||||
this.load();
|
||||
}
|
||||
}
|
||||
};
|
||||
Package.prototype.provides = function (names) {
|
||||
var e_5, _a;
|
||||
if (names === void 0) { names = []; }
|
||||
try {
|
||||
for (var names_1 = __values(names), names_1_1 = names_1.next(); !names_1_1.done; names_1_1 = names_1.next()) {
|
||||
var name_1 = names_1_1.value;
|
||||
var provided = Package.packages.get(name_1);
|
||||
if (!provided) {
|
||||
if (!loader_js_1.CONFIG.dependencies[name_1]) {
|
||||
loader_js_1.CONFIG.dependencies[name_1] = [];
|
||||
}
|
||||
loader_js_1.CONFIG.dependencies[name_1].push(name_1);
|
||||
provided = new Package(name_1, true);
|
||||
provided.isLoading = true;
|
||||
}
|
||||
this.provided.push(provided);
|
||||
}
|
||||
}
|
||||
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (names_1_1 && !names_1_1.done && (_a = names_1.return)) _a.call(names_1);
|
||||
}
|
||||
finally { if (e_5) throw e_5.error; }
|
||||
}
|
||||
};
|
||||
Package.prototype.addDependent = function (extension, noLoad) {
|
||||
this.dependents.push(extension);
|
||||
if (!noLoad) {
|
||||
this.checkNoLoad();
|
||||
}
|
||||
};
|
||||
Package.prototype.checkNoLoad = function () {
|
||||
var e_6, _a;
|
||||
if (this.noLoad) {
|
||||
this.noLoad = false;
|
||||
try {
|
||||
for (var _b = __values(this.dependencies), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var dependency = _c.value;
|
||||
dependency.checkNoLoad();
|
||||
}
|
||||
}
|
||||
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_6) throw e_6.error; }
|
||||
}
|
||||
}
|
||||
};
|
||||
Package.packages = new Map();
|
||||
return Package;
|
||||
}());
|
||||
exports.Package = Package;
|
||||
//# sourceMappingURL=package.js.map
|
||||
1
node_modules/mathjax-full/js/components/package.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/components/package.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
118
node_modules/mathjax-full/js/components/startup.d.ts
generated
vendored
Normal file
118
node_modules/mathjax-full/js/components/startup.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
import { MathJaxObject as MJObject, MathJaxConfig as MJConfig } from './global.js';
|
||||
import { MathDocument } from '../core/MathDocument.js';
|
||||
import { MmlNode } from '../core/MmlTree/MmlNode.js';
|
||||
import { Handler } from '../core/Handler.js';
|
||||
import { InputJax } from '../core/InputJax.js';
|
||||
import { OutputJax } from '../core/OutputJax.js';
|
||||
import { CommonOutputJax } from '../output/common/OutputJax.js';
|
||||
import { DOMAdaptor } from '../core/DOMAdaptor.js';
|
||||
import { TeX } from '../input/tex.js';
|
||||
export interface MathJaxConfig extends MJConfig {
|
||||
startup?: {
|
||||
input?: string[];
|
||||
output?: string;
|
||||
handler?: string;
|
||||
adaptor?: string;
|
||||
document?: any;
|
||||
elements?: any[];
|
||||
typeset?: boolean;
|
||||
ready?: () => void;
|
||||
pageReady?: () => void;
|
||||
invalidOption?: 'fatal' | 'warn';
|
||||
optionError?: (message: string, key: string) => void;
|
||||
[name: string]: any;
|
||||
};
|
||||
}
|
||||
export declare type MATHDOCUMENT = MathDocument<any, any, any>;
|
||||
export declare type HANDLER = Handler<any, any, any>;
|
||||
export declare type DOMADAPTOR = DOMAdaptor<any, any, any>;
|
||||
export declare type INPUTJAX = InputJax<any, any, any>;
|
||||
export declare type OUTPUTJAX = OutputJax<any, any, any>;
|
||||
export declare type COMMONJAX = CommonOutputJax<any, any, any, any, any, any, any>;
|
||||
export declare type TEX = TeX<any, any, any>;
|
||||
export declare type HandlerExtension = (handler: HANDLER) => HANDLER;
|
||||
export interface MathJaxObject extends MJObject {
|
||||
config: MathJaxConfig;
|
||||
startup: {
|
||||
constructors: {
|
||||
[name: string]: any;
|
||||
};
|
||||
input: INPUTJAX[];
|
||||
output: OUTPUTJAX;
|
||||
handler: HANDLER;
|
||||
adaptor: DOMADAPTOR;
|
||||
elements: any[];
|
||||
document: MATHDOCUMENT;
|
||||
promise: Promise<void>;
|
||||
registerConstructor(name: string, constructor: any): void;
|
||||
useHandler(name: string, force?: boolean): void;
|
||||
useAdaptor(name: string, force?: boolean): void;
|
||||
useOutput(name: string, force?: boolean): void;
|
||||
useInput(name: string, force?: boolean): void;
|
||||
extendHandler(extend: HandlerExtension): void;
|
||||
toMML(node: MmlNode): string;
|
||||
defaultReady(): void;
|
||||
defaultPageReady(): Promise<void>;
|
||||
getComponents(): void;
|
||||
makeMethods(): void;
|
||||
makeTypesetMethods(): void;
|
||||
makeOutputMethods(iname: string, oname: string, input: INPUTJAX): void;
|
||||
makeMmlMethods(name: string, input: INPUTJAX): void;
|
||||
makeResetMethod(name: string, input: INPUTJAX): void;
|
||||
getInputJax(): INPUTJAX[];
|
||||
getOutputJax(): OUTPUTJAX;
|
||||
getAdaptor(): DOMADAPTOR;
|
||||
getHandler(): HANDLER;
|
||||
};
|
||||
[name: string]: any;
|
||||
}
|
||||
export declare namespace Startup {
|
||||
const constructors: {
|
||||
[name: string]: any;
|
||||
};
|
||||
let input: INPUTJAX[];
|
||||
let output: OUTPUTJAX;
|
||||
let handler: HANDLER;
|
||||
let adaptor: DOMADAPTOR;
|
||||
let elements: any[];
|
||||
let document: MATHDOCUMENT;
|
||||
let promiseResolve: () => void;
|
||||
let promiseReject: (reason: any) => void;
|
||||
let promise: Promise<void>;
|
||||
let pagePromise: Promise<void>;
|
||||
function toMML(node: MmlNode): string;
|
||||
function registerConstructor(name: string, constructor: any): void;
|
||||
function useHandler(name: string, force?: boolean): void;
|
||||
function useAdaptor(name: string, force?: boolean): void;
|
||||
function useInput(name: string, force?: boolean): void;
|
||||
function useOutput(name: string, force?: boolean): void;
|
||||
function extendHandler(extend: HandlerExtension, priority?: number): void;
|
||||
function defaultReady(): void;
|
||||
function defaultPageReady(): Promise<void>;
|
||||
function getComponents(): void;
|
||||
function makeMethods(): void;
|
||||
function makeTypesetMethods(): void;
|
||||
function makeOutputMethods(iname: string, oname: string, input: INPUTJAX): void;
|
||||
function makeMmlMethods(name: string, input: INPUTJAX): void;
|
||||
function makeResetMethod(name: string, input: INPUTJAX): void;
|
||||
function getInputJax(): INPUTJAX[];
|
||||
function getOutputJax(): OUTPUTJAX;
|
||||
function getAdaptor(): DOMADAPTOR;
|
||||
function getHandler(): HANDLER;
|
||||
function getDocument(root?: any): MathDocument<any, any, any>;
|
||||
}
|
||||
export declare const MathJax: MathJaxObject;
|
||||
export declare const CONFIG: {
|
||||
[name: string]: any;
|
||||
input?: string[];
|
||||
output?: string;
|
||||
handler?: string;
|
||||
adaptor?: string;
|
||||
document?: any;
|
||||
elements?: any[];
|
||||
typeset?: boolean;
|
||||
ready?: () => void;
|
||||
pageReady?: () => void;
|
||||
invalidOption?: 'fatal' | 'warn';
|
||||
optionError?: (message: string, key: string) => void;
|
||||
};
|
||||
360
node_modules/mathjax-full/js/components/startup.js
generated
vendored
Normal file
360
node_modules/mathjax-full/js/components/startup.js
generated
vendored
Normal file
|
|
@ -0,0 +1,360 @@
|
|||
"use strict";
|
||||
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.");
|
||||
};
|
||||
var __read = (this && this.__read) || function (o, n) {
|
||||
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
||||
if (!m) return o;
|
||||
var i = m.call(o), r, ar = [], e;
|
||||
try {
|
||||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
||||
}
|
||||
catch (error) { e = { error: error }; }
|
||||
finally {
|
||||
try {
|
||||
if (r && !r.done && (m = i["return"])) m.call(i);
|
||||
}
|
||||
finally { if (e) throw e.error; }
|
||||
}
|
||||
return ar;
|
||||
};
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CONFIG = exports.MathJax = exports.Startup = void 0;
|
||||
var global_js_1 = require("./global.js");
|
||||
var PrioritizedList_js_1 = require("../util/PrioritizedList.js");
|
||||
var Options_js_1 = require("../util/Options.js");
|
||||
var Startup;
|
||||
(function (Startup) {
|
||||
var extensions = new PrioritizedList_js_1.PrioritizedList();
|
||||
var visitor;
|
||||
var mathjax;
|
||||
Startup.constructors = {};
|
||||
Startup.input = [];
|
||||
Startup.output = null;
|
||||
Startup.handler = null;
|
||||
Startup.adaptor = null;
|
||||
Startup.elements = null;
|
||||
Startup.document = null;
|
||||
Startup.promise = new Promise(function (resolve, reject) {
|
||||
Startup.promiseResolve = resolve;
|
||||
Startup.promiseReject = reject;
|
||||
});
|
||||
Startup.pagePromise = new Promise(function (resolve, _reject) {
|
||||
var doc = global.document;
|
||||
if (!doc || !doc.readyState || doc.readyState === 'complete' || doc.readyState === 'interactive') {
|
||||
resolve();
|
||||
}
|
||||
else {
|
||||
var listener = function () { return resolve(); };
|
||||
doc.defaultView.addEventListener('load', listener, true);
|
||||
doc.defaultView.addEventListener('DOMContentLoaded', listener, true);
|
||||
}
|
||||
});
|
||||
function toMML(node) {
|
||||
return visitor.visitTree(node, Startup.document);
|
||||
}
|
||||
Startup.toMML = toMML;
|
||||
function registerConstructor(name, constructor) {
|
||||
Startup.constructors[name] = constructor;
|
||||
}
|
||||
Startup.registerConstructor = registerConstructor;
|
||||
function useHandler(name, force) {
|
||||
if (force === void 0) { force = false; }
|
||||
if (!exports.CONFIG.handler || force) {
|
||||
exports.CONFIG.handler = name;
|
||||
}
|
||||
}
|
||||
Startup.useHandler = useHandler;
|
||||
function useAdaptor(name, force) {
|
||||
if (force === void 0) { force = false; }
|
||||
if (!exports.CONFIG.adaptor || force) {
|
||||
exports.CONFIG.adaptor = name;
|
||||
}
|
||||
}
|
||||
Startup.useAdaptor = useAdaptor;
|
||||
function useInput(name, force) {
|
||||
if (force === void 0) { force = false; }
|
||||
if (!inputSpecified || force) {
|
||||
exports.CONFIG.input.push(name);
|
||||
}
|
||||
}
|
||||
Startup.useInput = useInput;
|
||||
function useOutput(name, force) {
|
||||
if (force === void 0) { force = false; }
|
||||
if (!exports.CONFIG.output || force) {
|
||||
exports.CONFIG.output = name;
|
||||
}
|
||||
}
|
||||
Startup.useOutput = useOutput;
|
||||
function extendHandler(extend, priority) {
|
||||
if (priority === void 0) { priority = 10; }
|
||||
extensions.add(extend, priority);
|
||||
}
|
||||
Startup.extendHandler = extendHandler;
|
||||
function defaultReady() {
|
||||
getComponents();
|
||||
makeMethods();
|
||||
Startup.pagePromise
|
||||
.then(function () { return exports.CONFIG.pageReady(); })
|
||||
.then(function () { return Startup.promiseResolve(); })
|
||||
.catch(function (err) { return Startup.promiseReject(err); });
|
||||
}
|
||||
Startup.defaultReady = defaultReady;
|
||||
function defaultPageReady() {
|
||||
return (exports.CONFIG.typeset && exports.MathJax.typesetPromise ?
|
||||
exports.MathJax.typesetPromise(exports.CONFIG.elements) :
|
||||
Promise.resolve());
|
||||
}
|
||||
Startup.defaultPageReady = defaultPageReady;
|
||||
function getComponents() {
|
||||
visitor = new exports.MathJax._.core.MmlTree.SerializedMmlVisitor.SerializedMmlVisitor();
|
||||
mathjax = exports.MathJax._.mathjax.mathjax;
|
||||
Startup.input = getInputJax();
|
||||
Startup.output = getOutputJax();
|
||||
Startup.adaptor = getAdaptor();
|
||||
if (Startup.handler) {
|
||||
mathjax.handlers.unregister(Startup.handler);
|
||||
}
|
||||
Startup.handler = getHandler();
|
||||
if (Startup.handler) {
|
||||
mathjax.handlers.register(Startup.handler);
|
||||
Startup.document = getDocument();
|
||||
}
|
||||
}
|
||||
Startup.getComponents = getComponents;
|
||||
function makeMethods() {
|
||||
var e_1, _a;
|
||||
if (Startup.input && Startup.output) {
|
||||
makeTypesetMethods();
|
||||
}
|
||||
var oname = (Startup.output ? Startup.output.name.toLowerCase() : '');
|
||||
try {
|
||||
for (var input_1 = __values(Startup.input), input_1_1 = input_1.next(); !input_1_1.done; input_1_1 = input_1.next()) {
|
||||
var jax = input_1_1.value;
|
||||
var iname = jax.name.toLowerCase();
|
||||
makeMmlMethods(iname, jax);
|
||||
makeResetMethod(iname, jax);
|
||||
if (Startup.output) {
|
||||
makeOutputMethods(iname, oname, jax);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (input_1_1 && !input_1_1.done && (_a = input_1.return)) _a.call(input_1);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
}
|
||||
Startup.makeMethods = makeMethods;
|
||||
function makeTypesetMethods() {
|
||||
exports.MathJax.typeset = function (elements) {
|
||||
if (elements === void 0) { elements = null; }
|
||||
Startup.document.options.elements = elements;
|
||||
Startup.document.reset();
|
||||
Startup.document.render();
|
||||
};
|
||||
exports.MathJax.typesetPromise = function (elements) {
|
||||
if (elements === void 0) { elements = null; }
|
||||
Startup.document.options.elements = elements;
|
||||
Startup.document.reset();
|
||||
return mathjax.handleRetriesFor(function () {
|
||||
Startup.document.render();
|
||||
});
|
||||
};
|
||||
exports.MathJax.typesetClear = function (elements) {
|
||||
if (elements === void 0) { elements = null; }
|
||||
if (elements) {
|
||||
Startup.document.clearMathItemsWithin(elements);
|
||||
}
|
||||
else {
|
||||
Startup.document.clear();
|
||||
}
|
||||
};
|
||||
}
|
||||
Startup.makeTypesetMethods = makeTypesetMethods;
|
||||
function makeOutputMethods(iname, oname, input) {
|
||||
var name = iname + '2' + oname;
|
||||
exports.MathJax[name] =
|
||||
function (math, options) {
|
||||
if (options === void 0) { options = {}; }
|
||||
options.format = input.name;
|
||||
return Startup.document.convert(math, options);
|
||||
};
|
||||
exports.MathJax[name + 'Promise'] =
|
||||
function (math, options) {
|
||||
if (options === void 0) { options = {}; }
|
||||
options.format = input.name;
|
||||
return mathjax.handleRetriesFor(function () { return Startup.document.convert(math, options); });
|
||||
};
|
||||
exports.MathJax[oname + 'Stylesheet'] = function () { return Startup.output.styleSheet(Startup.document); };
|
||||
if ('getMetricsFor' in Startup.output) {
|
||||
exports.MathJax.getMetricsFor = function (node, display) {
|
||||
return Startup.output.getMetricsFor(node, display);
|
||||
};
|
||||
}
|
||||
}
|
||||
Startup.makeOutputMethods = makeOutputMethods;
|
||||
function makeMmlMethods(name, input) {
|
||||
var STATE = exports.MathJax._.core.MathItem.STATE;
|
||||
exports.MathJax[name + '2mml'] =
|
||||
function (math, options) {
|
||||
if (options === void 0) { options = {}; }
|
||||
options.end = STATE.CONVERT;
|
||||
options.format = input.name;
|
||||
return toMML(Startup.document.convert(math, options));
|
||||
};
|
||||
exports.MathJax[name + '2mmlPromise'] =
|
||||
function (math, options) {
|
||||
if (options === void 0) { options = {}; }
|
||||
options.end = STATE.CONVERT;
|
||||
options.format = input.name;
|
||||
return mathjax.handleRetriesFor(function () { return toMML(Startup.document.convert(math, options)); });
|
||||
};
|
||||
}
|
||||
Startup.makeMmlMethods = makeMmlMethods;
|
||||
function makeResetMethod(name, input) {
|
||||
exports.MathJax[name + 'Reset'] = function () {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
return input.reset.apply(input, __spreadArray([], __read(args), false));
|
||||
};
|
||||
}
|
||||
Startup.makeResetMethod = makeResetMethod;
|
||||
function getInputJax() {
|
||||
var e_2, _a;
|
||||
var jax = [];
|
||||
try {
|
||||
for (var _b = __values(exports.CONFIG.input), _c = _b.next(); !_c.done; _c = _b.next()) {
|
||||
var name_1 = _c.value;
|
||||
var inputClass = Startup.constructors[name_1];
|
||||
if (inputClass) {
|
||||
jax.push(new inputClass(exports.MathJax.config[name_1]));
|
||||
}
|
||||
else {
|
||||
throw Error('Input Jax "' + name_1 + '" is not defined (has it been loaded?)');
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
||||
}
|
||||
finally { if (e_2) throw e_2.error; }
|
||||
}
|
||||
return jax;
|
||||
}
|
||||
Startup.getInputJax = getInputJax;
|
||||
function getOutputJax() {
|
||||
var name = exports.CONFIG.output;
|
||||
if (!name)
|
||||
return null;
|
||||
var outputClass = Startup.constructors[name];
|
||||
if (!outputClass) {
|
||||
throw Error('Output Jax "' + name + '" is not defined (has it been loaded?)');
|
||||
}
|
||||
return new outputClass(exports.MathJax.config[name]);
|
||||
}
|
||||
Startup.getOutputJax = getOutputJax;
|
||||
function getAdaptor() {
|
||||
var name = exports.CONFIG.adaptor;
|
||||
if (!name || name === 'none')
|
||||
return null;
|
||||
var adaptor = Startup.constructors[name];
|
||||
if (!adaptor) {
|
||||
throw Error('DOMAdaptor "' + name + '" is not defined (has it been loaded?)');
|
||||
}
|
||||
return adaptor(exports.MathJax.config[name]);
|
||||
}
|
||||
Startup.getAdaptor = getAdaptor;
|
||||
function getHandler() {
|
||||
var e_3, _a;
|
||||
var name = exports.CONFIG.handler;
|
||||
if (!name || name === 'none' || !Startup.adaptor)
|
||||
return null;
|
||||
var handlerClass = Startup.constructors[name];
|
||||
if (!handlerClass) {
|
||||
throw Error('Handler "' + name + '" is not defined (has it been loaded?)');
|
||||
}
|
||||
var handler = new handlerClass(Startup.adaptor, 5);
|
||||
try {
|
||||
for (var extensions_1 = __values(extensions), extensions_1_1 = extensions_1.next(); !extensions_1_1.done; extensions_1_1 = extensions_1.next()) {
|
||||
var extend = extensions_1_1.value;
|
||||
handler = extend.item(handler);
|
||||
}
|
||||
}
|
||||
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (extensions_1_1 && !extensions_1_1.done && (_a = extensions_1.return)) _a.call(extensions_1);
|
||||
}
|
||||
finally { if (e_3) throw e_3.error; }
|
||||
}
|
||||
return handler;
|
||||
}
|
||||
Startup.getHandler = getHandler;
|
||||
function getDocument(root) {
|
||||
if (root === void 0) { root = null; }
|
||||
return mathjax.document(root || exports.CONFIG.document, __assign(__assign({}, exports.MathJax.config.options), { InputJax: Startup.input, OutputJax: Startup.output }));
|
||||
}
|
||||
Startup.getDocument = getDocument;
|
||||
})(Startup = exports.Startup || (exports.Startup = {}));
|
||||
exports.MathJax = global_js_1.MathJax;
|
||||
if (typeof exports.MathJax._.startup === 'undefined') {
|
||||
(0, global_js_1.combineDefaults)(exports.MathJax.config, 'startup', {
|
||||
input: [],
|
||||
output: '',
|
||||
handler: null,
|
||||
adaptor: null,
|
||||
document: (typeof document === 'undefined' ? '' : document),
|
||||
elements: null,
|
||||
typeset: true,
|
||||
ready: Startup.defaultReady.bind(Startup),
|
||||
pageReady: Startup.defaultPageReady.bind(Startup)
|
||||
});
|
||||
(0, global_js_1.combineWithMathJax)({
|
||||
startup: Startup,
|
||||
options: {}
|
||||
});
|
||||
if (exports.MathJax.config.startup.invalidOption) {
|
||||
Options_js_1.OPTIONS.invalidOption = exports.MathJax.config.startup.invalidOption;
|
||||
}
|
||||
if (exports.MathJax.config.startup.optionError) {
|
||||
Options_js_1.OPTIONS.optionError = exports.MathJax.config.startup.optionError;
|
||||
}
|
||||
}
|
||||
exports.CONFIG = exports.MathJax.config.startup;
|
||||
var inputSpecified = exports.CONFIG.input.length !== 0;
|
||||
//# sourceMappingURL=startup.js.map
|
||||
1
node_modules/mathjax-full/js/components/startup.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/components/startup.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/mathjax-full/js/components/version.d.ts
generated
vendored
Normal file
1
node_modules/mathjax-full/js/components/version.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export declare const VERSION = "3.2.2";
|
||||
5
node_modules/mathjax-full/js/components/version.js
generated
vendored
Normal file
5
node_modules/mathjax-full/js/components/version.js
generated
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.VERSION = void 0;
|
||||
exports.VERSION = '3.2.2';
|
||||
//# sourceMappingURL=version.js.map
|
||||
1
node_modules/mathjax-full/js/components/version.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/components/version.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../ts/components/version.ts"],"names":[],"mappings":";;;AAwBa,QAAA,OAAO,GAAG,OAAO,CAAC"}
|
||||
113
node_modules/mathjax-full/js/core/DOMAdaptor.d.ts
generated
vendored
Normal file
113
node_modules/mathjax-full/js/core/DOMAdaptor.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
import { OptionList } from '../util/Options.js';
|
||||
export declare type AttributeData = {
|
||||
name: string;
|
||||
value: string;
|
||||
};
|
||||
export declare type PageBBox = {
|
||||
left: number;
|
||||
right: number;
|
||||
top: number;
|
||||
bottom: number;
|
||||
};
|
||||
export interface DOMAdaptor<N, T, D> {
|
||||
document: D;
|
||||
parse(text: string, format?: string): D;
|
||||
node(kind: string, def?: OptionList, children?: (N | T)[], ns?: string): N;
|
||||
text(text: string): T;
|
||||
head(doc: D): N;
|
||||
body(doc: D): N;
|
||||
root(doc: D): N;
|
||||
doctype(doc: D): string;
|
||||
tags(node: N, name: string, ns?: string): N[];
|
||||
getElements(nodes: (string | N | N[])[], document: D): N[];
|
||||
contains(container: N, node: N | T): boolean;
|
||||
parent(node: N | T): N;
|
||||
append(node: N, child: N | T): N | T;
|
||||
insert(nchild: N | T, ochild: N | T): void;
|
||||
remove(child: N | T): N | T;
|
||||
replace(nnode: N | T, onode: N | T): N | T;
|
||||
clone(node: N): N;
|
||||
split(node: T, n: number): T;
|
||||
next(node: N | T): N | T;
|
||||
previous(node: N | T): N | T;
|
||||
firstChild(node: N): N | T;
|
||||
lastChild(node: N): N | T;
|
||||
childNodes(node: N): (N | T)[];
|
||||
childNode(node: N, i: number): N | T;
|
||||
kind(node: N | T): string;
|
||||
value(node: N | T): string;
|
||||
textContent(node: N): string;
|
||||
innerHTML(node: N): string;
|
||||
outerHTML(node: N): string;
|
||||
serializeXML(node: N): string;
|
||||
setAttribute(node: N, name: string, value: string | number, ns?: string): void;
|
||||
setAttributes(node: N, def: OptionList): void;
|
||||
getAttribute(node: N, name: string): string;
|
||||
removeAttribute(node: N, name: string): void;
|
||||
hasAttribute(node: N, name: string): boolean;
|
||||
allAttributes(node: N): AttributeData[];
|
||||
addClass(node: N, name: string): void;
|
||||
removeClass(node: N, name: string): void;
|
||||
hasClass(node: N, name: string): boolean;
|
||||
allClasses(node: N): string[];
|
||||
setStyle(node: N, name: string, value: string): void;
|
||||
getStyle(node: N, name: string): string;
|
||||
allStyles(node: N): string;
|
||||
insertRules(node: N, rules: string[]): void;
|
||||
fontSize(node: N): number;
|
||||
fontFamily(node: N): string;
|
||||
nodeSize(node: N, em?: number, local?: boolean): [number, number];
|
||||
nodeBBox(node: N): PageBBox;
|
||||
}
|
||||
export declare abstract class AbstractDOMAdaptor<N, T, D> implements DOMAdaptor<N, T, D> {
|
||||
document: D;
|
||||
constructor(document?: D);
|
||||
abstract parse(text: string, format?: string): D;
|
||||
node(kind: string, def?: OptionList, children?: (N | T)[], ns?: string): N;
|
||||
protected abstract create(kind: string, ns?: string): N;
|
||||
abstract text(text: string): T;
|
||||
setAttributes(node: N, def: OptionList): void;
|
||||
abstract head(doc: D): N;
|
||||
abstract body(doc: D): N;
|
||||
abstract root(doc: D): N;
|
||||
abstract doctype(doc: D): string;
|
||||
abstract tags(node: N, name: string, ns?: string): N[];
|
||||
abstract getElements(nodes: (string | N | N[])[], document: D): N[];
|
||||
abstract contains(container: N, node: N | T): boolean;
|
||||
abstract parent(node: N | T): N;
|
||||
abstract append(node: N, child: N | T): N | T;
|
||||
abstract insert(nchild: N | T, ochild: N | T): void;
|
||||
abstract remove(child: N | T): N | T;
|
||||
replace(nnode: N | T, onode: N | T): N | T;
|
||||
abstract clone(node: N): N;
|
||||
abstract split(node: T, n: number): T;
|
||||
abstract next(node: N | T): N | T;
|
||||
abstract previous(node: N | T): N | T;
|
||||
abstract firstChild(node: N): N | T;
|
||||
abstract lastChild(node: N): N | T;
|
||||
abstract childNodes(node: N): (N | T)[];
|
||||
childNode(node: N, i: number): N | T;
|
||||
abstract kind(node: N | T): string;
|
||||
abstract value(node: N | T): string;
|
||||
abstract textContent(node: N): string;
|
||||
abstract innerHTML(node: N): string;
|
||||
abstract outerHTML(node: N): string;
|
||||
abstract serializeXML(node: N): string;
|
||||
abstract setAttribute(node: N, name: string, value: string, ns?: string): void;
|
||||
abstract getAttribute(node: N, name: string): string;
|
||||
abstract removeAttribute(node: N, name: string): void;
|
||||
abstract hasAttribute(node: N, name: string): boolean;
|
||||
abstract allAttributes(node: N): AttributeData[];
|
||||
abstract addClass(node: N, name: string): void;
|
||||
abstract removeClass(node: N, name: string): void;
|
||||
abstract hasClass(node: N, name: string): boolean;
|
||||
allClasses(node: N): string[];
|
||||
abstract setStyle(node: N, name: string, value: string): void;
|
||||
abstract getStyle(node: N, name: string): string;
|
||||
abstract allStyles(node: N): string;
|
||||
abstract insertRules(node: N, rules: string[]): void;
|
||||
abstract fontSize(node: N): number;
|
||||
abstract fontFamily(node: N): string;
|
||||
abstract nodeSize(node: N, em?: number, local?: boolean): [number, number];
|
||||
abstract nodeBBox(node: N): PageBBox;
|
||||
}
|
||||
105
node_modules/mathjax-full/js/core/DOMAdaptor.js
generated
vendored
Normal file
105
node_modules/mathjax-full/js/core/DOMAdaptor.js
generated
vendored
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
"use strict";
|
||||
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.AbstractDOMAdaptor = void 0;
|
||||
var AbstractDOMAdaptor = (function () {
|
||||
function AbstractDOMAdaptor(document) {
|
||||
if (document === void 0) { document = null; }
|
||||
this.document = document;
|
||||
}
|
||||
AbstractDOMAdaptor.prototype.node = function (kind, def, children, ns) {
|
||||
var e_1, _a;
|
||||
if (def === void 0) { def = {}; }
|
||||
if (children === void 0) { children = []; }
|
||||
var node = this.create(kind, ns);
|
||||
this.setAttributes(node, def);
|
||||
try {
|
||||
for (var children_1 = __values(children), children_1_1 = children_1.next(); !children_1_1.done; children_1_1 = children_1.next()) {
|
||||
var child = children_1_1.value;
|
||||
this.append(node, child);
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (children_1_1 && !children_1_1.done && (_a = children_1.return)) _a.call(children_1);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
return node;
|
||||
};
|
||||
AbstractDOMAdaptor.prototype.setAttributes = function (node, def) {
|
||||
var e_2, _a, e_3, _b, e_4, _c;
|
||||
if (def.style && typeof (def.style) !== 'string') {
|
||||
try {
|
||||
for (var _d = __values(Object.keys(def.style)), _e = _d.next(); !_e.done; _e = _d.next()) {
|
||||
var key = _e.value;
|
||||
this.setStyle(node, key.replace(/-([a-z])/g, function (_m, c) { return c.toUpperCase(); }), def.style[key]);
|
||||
}
|
||||
}
|
||||
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
|
||||
}
|
||||
finally { if (e_2) throw e_2.error; }
|
||||
}
|
||||
}
|
||||
if (def.properties) {
|
||||
try {
|
||||
for (var _f = __values(Object.keys(def.properties)), _g = _f.next(); !_g.done; _g = _f.next()) {
|
||||
var key = _g.value;
|
||||
node[key] = def.properties[key];
|
||||
}
|
||||
}
|
||||
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_g && !_g.done && (_b = _f.return)) _b.call(_f);
|
||||
}
|
||||
finally { if (e_3) throw e_3.error; }
|
||||
}
|
||||
}
|
||||
try {
|
||||
for (var _h = __values(Object.keys(def)), _j = _h.next(); !_j.done; _j = _h.next()) {
|
||||
var key = _j.value;
|
||||
if ((key !== 'style' || typeof (def.style) === 'string') && key !== 'properties') {
|
||||
this.setAttribute(node, key, def[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (_j && !_j.done && (_c = _h.return)) _c.call(_h);
|
||||
}
|
||||
finally { if (e_4) throw e_4.error; }
|
||||
}
|
||||
};
|
||||
AbstractDOMAdaptor.prototype.replace = function (nnode, onode) {
|
||||
this.insert(nnode, onode);
|
||||
this.remove(onode);
|
||||
return onode;
|
||||
};
|
||||
AbstractDOMAdaptor.prototype.childNode = function (node, i) {
|
||||
return this.childNodes(node)[i];
|
||||
};
|
||||
AbstractDOMAdaptor.prototype.allClasses = function (node) {
|
||||
var classes = this.getAttribute(node, 'class');
|
||||
return (!classes ? [] :
|
||||
classes.replace(/ +/g, ' ').replace(/^ /, '').replace(/ $/, '').split(/ /));
|
||||
};
|
||||
return AbstractDOMAdaptor;
|
||||
}());
|
||||
exports.AbstractDOMAdaptor = AbstractDOMAdaptor;
|
||||
//# sourceMappingURL=DOMAdaptor.js.map
|
||||
1
node_modules/mathjax-full/js/core/DOMAdaptor.js.map
generated
vendored
Normal file
1
node_modules/mathjax-full/js/core/DOMAdaptor.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"DOMAdaptor.js","sourceRoot":"","sources":["../../ts/core/DOMAdaptor.ts"],"names":[],"mappings":"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"}
|
||||
12
node_modules/mathjax-full/js/core/FindMath.d.ts
generated
vendored
Normal file
12
node_modules/mathjax-full/js/core/FindMath.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import { OptionList } from '../util/Options.js';
|
||||
import { ProtoItem } from './MathItem.js';
|
||||
export interface FindMath<N, T, _D> {
|
||||
findMath(node: N): ProtoItem<N, T>[];
|
||||
findMath(strings: string[]): ProtoItem<N, T>[];
|
||||
}
|
||||
export declare abstract class AbstractFindMath<N, T, D> implements FindMath<N, T, D> {
|
||||
static OPTIONS: OptionList;
|
||||
protected options: OptionList;
|
||||
constructor(options: OptionList);
|
||||
abstract findMath(where: N | string[]): ProtoItem<N, T>[];
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue