mathjax-angular
Advanced tools
Comparing version 0.5.0 to 1.0.0
@@ -34,9 +34,10 @@ (function (global, factory) { | ||
loader: { | ||
load: ['output/svg', '[tex]/require'], | ||
load: ['output/svg', '[tex]/require', '[tex]/ams'], | ||
}, | ||
tex: { | ||
inlineMath: [['$', '$']], | ||
displayMath: [['$$', '$$']], | ||
packages: ['base', 'require'], | ||
//displayMath: [['$$', '$$']], | ||
packages: ['base', 'require', 'ams'], | ||
}, | ||
svg: { fontCache: 'global' }, | ||
}; | ||
@@ -135,16 +136,24 @@ // | ||
function MathjaxModule(moduleConfig) { | ||
var _a, _b; | ||
this.moduleConfig = moduleConfig; | ||
// | ||
this.addConfigToDocument(); | ||
// | ||
var config = document.createElement('script'); | ||
var providConfig = Object.assign(Object.assign({}, MathjaxDefaultConfig), ((_a = moduleConfig === null || moduleConfig === void 0 ? void 0 : moduleConfig.config) !== null && _a !== void 0 ? _a : {})); | ||
config.text = "MathJax = " + JSON.stringify(providConfig); | ||
// | ||
// | ||
this.addMatjaxToDocument(); | ||
} | ||
MathjaxModule.prototype.addConfigToDocument = function () { | ||
var _a, _b; | ||
var providConfig = Object.assign(Object.assign({}, MathjaxDefaultConfig), ((_b = (_a = this.moduleConfig) === null || _a === void 0 ? void 0 : _a.config) !== null && _b !== void 0 ? _b : {})); | ||
var script = document.createElement('script'); | ||
script.type = 'text/javascript'; | ||
script.src = (_b = moduleConfig === null || moduleConfig === void 0 ? void 0 : moduleConfig.src) !== null && _b !== void 0 ? _b : mathjax_url; | ||
script.text = "MathJax = " + JSON.stringify(providConfig); | ||
document.getElementsByTagName('head')[0].appendChild(script); | ||
}; | ||
MathjaxModule.prototype.addMatjaxToDocument = function () { | ||
var _a, _b; | ||
var script = document.createElement('script'); | ||
script.type = 'text/javascript'; | ||
script.src = (_b = (_a = this.moduleConfig) === null || _a === void 0 ? void 0 : _a.src) !== null && _b !== void 0 ? _b : mathjax_url; | ||
script.async = true; | ||
// | ||
} | ||
document.getElementsByTagName('head')[0].appendChild(script); | ||
}; | ||
MathjaxModule.forRoot = function (config) { | ||
@@ -151,0 +160,0 @@ return { |
@@ -6,3 +6,6 @@ import { ModuleWithProviders } from '@angular/core'; | ||
export declare class MathjaxModule { | ||
private moduleConfig; | ||
constructor(moduleConfig: RootMathjaxConfig); | ||
private addConfigToDocument; | ||
private addMatjaxToDocument; | ||
static forRoot(config?: RootMathjaxConfig): ModuleWithProviders<MathjaxModule>; | ||
@@ -9,0 +12,0 @@ static forChild(): { |
@@ -17,5 +17,7 @@ export interface MathjaxContent { | ||
inlineMath: string[][]; | ||
displayMath: string[][]; | ||
packages: string[]; | ||
}; | ||
svg: { | ||
fontCache: string; | ||
}; | ||
}; | ||
@@ -22,0 +24,0 @@ export declare class RootMathjaxConfig { |
@@ -8,15 +8,23 @@ import { NgModule } from '@angular/core'; | ||
constructor(moduleConfig) { | ||
var _a, _b; | ||
this.moduleConfig = moduleConfig; | ||
// | ||
this.addConfigToDocument(); | ||
// | ||
const config = document.createElement('script'); | ||
const providConfig = Object.assign(Object.assign({}, MathjaxDefaultConfig), ((_a = moduleConfig === null || moduleConfig === void 0 ? void 0 : moduleConfig.config) !== null && _a !== void 0 ? _a : {})); | ||
config.text = `MathJax = ${JSON.stringify(providConfig)}`; | ||
// | ||
// | ||
this.addMatjaxToDocument(); | ||
} | ||
addConfigToDocument() { | ||
var _a, _b; | ||
const providConfig = Object.assign(Object.assign({}, MathjaxDefaultConfig), ((_b = (_a = this.moduleConfig) === null || _a === void 0 ? void 0 : _a.config) !== null && _b !== void 0 ? _b : {})); | ||
const script = document.createElement('script'); | ||
script.type = 'text/javascript'; | ||
script.src = (_b = moduleConfig === null || moduleConfig === void 0 ? void 0 : moduleConfig.src) !== null && _b !== void 0 ? _b : mathjax_url; | ||
script.text = `MathJax = ${JSON.stringify(providConfig)}`; | ||
document.getElementsByTagName('head')[0].appendChild(script); | ||
} | ||
addMatjaxToDocument() { | ||
var _a, _b; | ||
const script = document.createElement('script'); | ||
script.type = 'text/javascript'; | ||
script.src = (_b = (_a = this.moduleConfig) === null || _a === void 0 ? void 0 : _a.src) !== null && _b !== void 0 ? _b : mathjax_url; | ||
script.async = true; | ||
// | ||
document.getElementsByTagName('head')[0].appendChild(script); | ||
} | ||
@@ -45,2 +53,2 @@ static forRoot(config) { | ||
}], ctorParameters: function () { return [{ type: i1.RootMathjaxConfig }]; } }); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWF0aGpheC5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9tYXRoamF4LWxpYi9zcmMvZGlyZWN0aXZlL21hdGhqYXgubW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBdUIsUUFBUSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzlELE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQ3ZELE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxXQUFXLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxVQUFVLENBQUM7OztBQU1oRixNQUFNLE9BQU8sYUFBYTtJQUN4QixZQUFZLFlBQStCOztRQUN6QyxFQUFFO1FBQ0YsRUFBRTtRQUNGLE1BQU0sTUFBTSxHQUFHLFFBQVEsQ0FBQyxhQUFhLENBQUMsUUFBUSxDQUFzQixDQUFDO1FBQ3JFLE1BQU0sWUFBWSxtQ0FDYixvQkFBb0IsR0FDcEIsQ0FBQyxNQUFBLFlBQVksYUFBWixZQUFZLHVCQUFaLFlBQVksQ0FBRSxNQUFNLG1DQUFJLEVBQUUsQ0FBQyxDQUNoQyxDQUFDO1FBQ0YsTUFBTSxDQUFDLElBQUksR0FBRyxhQUFhLElBQUksQ0FBQyxTQUFTLENBQUMsWUFBWSxDQUFDLEVBQUUsQ0FBQztRQUMxRCxFQUFFO1FBQ0Y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pO1xyXG4gIH1cclxuXHJcbiAgcHVibGljIHN0YXRpYyBmb3JSb290KFxyXG4gICAgY29uZmlnPzogUm9vdE1hdGhqYXhDb25maWdcclxuICApOiBNb2R1bGVXaXRoUHJvdmlkZXJzPE1hdGhqYXhNb2R1bGU+IHtcclxuICAgIHJldHVybiB7XHJcbiAgICAgIG5nTW9kdWxlOiBNYXRoamF4TW9kdWxlLFxyXG4gICAgICBwcm92aWRlcnM6IFt7IHByb3ZpZGU6IFJvb3RNYXRoamF4Q29uZmlnLCB1c2VWYWx1ZTogY29uZmlnID8/IHt9IH1dLFxyXG4gICAgfTtcclxuICB9XHJcbiAgcHVibGljIHN0YXRpYyBmb3JDaGlsZCgpIHtcclxuICAgIHJldHVybiB7XHJcbiAgICAgIG5nTW9kdWxlOiBNYXRoamF4TW9kdWxlLFxyXG4gICAgfTtcclxuICB9XHJcbn1cclxuIl19 |
@@ -6,9 +6,10 @@ export const isMathjax = /(?:\$|\\\(|\\\[|\\begin\{.*?})/; | ||
loader: { | ||
load: ['output/svg', '[tex]/require'], | ||
load: ['output/svg', '[tex]/require', '[tex]/ams'], | ||
}, | ||
tex: { | ||
inlineMath: [['$', '$']], | ||
displayMath: [['$$', '$$']], | ||
packages: ['base', 'require'], | ||
//displayMath: [['$$', '$$']], | ||
packages: ['base', 'require', 'ams'], | ||
}, | ||
svg: { fontCache: 'global' }, | ||
}; | ||
@@ -18,2 +19,2 @@ // | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9kZWxzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcHJvamVjdHMvbWF0aGpheC1saWIvc3JjL2RpcmVjdGl2ZS9tb2RlbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBU0EsTUFBTSxDQUFDLE1BQU0sU0FBUyxHQUFHLGdDQUFnQyxDQUFDO0FBQzFELHlGQUF5RjtBQUN6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2VzOiBbJ2Jhc2UnLCAncmVxdWlyZScsICdhbXMnXSxcclxuICB9LFxyXG4gIHN2ZzogeyBmb250Q2FjaGU6ICdnbG9iYWwnIH0sXHJcbn07XHJcbi8vXHJcbmV4cG9ydCBjbGFzcyBSb290TWF0aGpheENvbmZpZyB7XHJcbiAgY29uZmlnPzogeyBbbmFtZTogc3RyaW5nXTogYW55IH07XHJcbiAgc3JjPzogc3RyaW5nO1xyXG59XHJcbiJdfQ== |
@@ -9,9 +9,10 @@ import * as i0 from '@angular/core'; | ||
loader: { | ||
load: ['output/svg', '[tex]/require'], | ||
load: ['output/svg', '[tex]/require', '[tex]/ams'], | ||
}, | ||
tex: { | ||
inlineMath: [['$', '$']], | ||
displayMath: [['$$', '$$']], | ||
packages: ['base', 'require'], | ||
//displayMath: [['$$', '$$']], | ||
packages: ['base', 'require', 'ams'], | ||
}, | ||
svg: { fontCache: 'global' }, | ||
}; | ||
@@ -101,15 +102,23 @@ // | ||
constructor(moduleConfig) { | ||
var _a, _b; | ||
this.moduleConfig = moduleConfig; | ||
// | ||
this.addConfigToDocument(); | ||
// | ||
const config = document.createElement('script'); | ||
const providConfig = Object.assign(Object.assign({}, MathjaxDefaultConfig), ((_a = moduleConfig === null || moduleConfig === void 0 ? void 0 : moduleConfig.config) !== null && _a !== void 0 ? _a : {})); | ||
config.text = `MathJax = ${JSON.stringify(providConfig)}`; | ||
// | ||
// | ||
this.addMatjaxToDocument(); | ||
} | ||
addConfigToDocument() { | ||
var _a, _b; | ||
const providConfig = Object.assign(Object.assign({}, MathjaxDefaultConfig), ((_b = (_a = this.moduleConfig) === null || _a === void 0 ? void 0 : _a.config) !== null && _b !== void 0 ? _b : {})); | ||
const script = document.createElement('script'); | ||
script.type = 'text/javascript'; | ||
script.src = (_b = moduleConfig === null || moduleConfig === void 0 ? void 0 : moduleConfig.src) !== null && _b !== void 0 ? _b : mathjax_url; | ||
script.text = `MathJax = ${JSON.stringify(providConfig)}`; | ||
document.getElementsByTagName('head')[0].appendChild(script); | ||
} | ||
addMatjaxToDocument() { | ||
var _a, _b; | ||
const script = document.createElement('script'); | ||
script.type = 'text/javascript'; | ||
script.src = (_b = (_a = this.moduleConfig) === null || _a === void 0 ? void 0 : _a.src) !== null && _b !== void 0 ? _b : mathjax_url; | ||
script.async = true; | ||
// | ||
document.getElementsByTagName('head')[0].appendChild(script); | ||
} | ||
@@ -116,0 +125,0 @@ static forRoot(config) { |
{ | ||
"name": "mathjax-angular", | ||
"version": "0.5.0", | ||
"version": "1.0.0", | ||
"peerDependencies": { | ||
@@ -5,0 +5,0 @@ "@angular/common": "^12.1.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
58349
565
1
0