@nteract/mathjax
Advanced tools
Comparing version 4.0.1 to 4.0.2
import * as React from "react"; | ||
import { MathJaxContextValue } from "./context"; | ||
interface Props { | ||
@@ -7,2 +8,34 @@ inline: boolean; | ||
} | ||
export declare class MathJaxNode_ extends React.Component<Props & MathJaxContextValue> { | ||
script?: HTMLScriptElement; | ||
nodeRef: React.RefObject<HTMLSpanElement>; | ||
constructor(props: Props & MathJaxContextValue); | ||
/** | ||
* Render the math once the node is mounted | ||
*/ | ||
componentDidMount(): void; | ||
/** | ||
* Update the jax, force update if the display mode changed | ||
*/ | ||
componentDidUpdate(prevProps: Props & MathJaxContextValue): void; | ||
/** | ||
* Clear the math when unmounting the node | ||
*/ | ||
componentWillUnmount(): void; | ||
/** | ||
* Clear the jax | ||
*/ | ||
clear(): void; | ||
/** | ||
* Update math in the node | ||
* @param { Boolean } forceUpdate | ||
*/ | ||
typeset(forceUpdate?: boolean): void; | ||
/** | ||
* Create a script | ||
* @param { String } text | ||
*/ | ||
setScriptText(text: string): void; | ||
render(): JSX.Element; | ||
} | ||
export default class MathJaxNode extends React.PureComponent<Props> { | ||
@@ -9,0 +42,0 @@ static defaultProps: { |
@@ -24,2 +24,4 @@ "use strict"; | ||
this.nodeRef = React.createRef(); | ||
this.typeset = this.typeset.bind(this); | ||
this.clear = this.clear.bind(this); | ||
} | ||
@@ -111,2 +113,3 @@ /** | ||
} | ||
exports.MathJaxNode_ = MathJaxNode_; | ||
class MathJaxNode extends React.PureComponent { | ||
@@ -127,2 +130,3 @@ render() { | ||
} | ||
exports.default = MathJaxNode; | ||
MathJaxNode.defaultProps = { | ||
@@ -132,2 +136,1 @@ inline: false, | ||
}; | ||
exports.default = MathJaxNode; |
@@ -14,4 +14,4 @@ "use strict"; | ||
const React = __importStar(require("react")); | ||
const load_script_1 = __importDefault(require("load-script")); | ||
const context_1 = __importDefault(require("./context")); | ||
const load_script_1 = __importDefault(require("./load-script")); | ||
/** | ||
@@ -62,3 +62,3 @@ * MathJax Provider | ||
if (state.input !== props.input) { | ||
return Object.assign({}, state, { input: props.input }); | ||
return Object.assign(Object.assign({}, state), { input: props.input }); | ||
} | ||
@@ -81,2 +81,3 @@ return null; | ||
} | ||
exports.default = Provider; | ||
Provider.defaultProps = { | ||
@@ -95,2 +96,1 @@ src: "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML", | ||
}; | ||
exports.default = Provider; |
import * as React from "react"; | ||
import { MathJaxContextValue } from "./context"; | ||
interface Props { | ||
@@ -6,2 +7,10 @@ children: string; | ||
} | ||
export declare class MathJaxText_ extends React.Component<Props & MathJaxContextValue> { | ||
nodeRef: React.RefObject<HTMLDivElement>; | ||
constructor(props: Props & MathJaxContextValue); | ||
componentDidMount(): void; | ||
componentDidUpdate(): void; | ||
typeset(): void; | ||
render(): JSX.Element; | ||
} | ||
declare class MathJaxText extends React.PureComponent<Props> { | ||
@@ -8,0 +17,0 @@ static defaultProps: { |
@@ -44,2 +44,3 @@ "use strict"; | ||
} | ||
exports.MathJaxText_ = MathJaxText_; | ||
class MathJaxText extends React.PureComponent { | ||
@@ -46,0 +47,0 @@ render() { |
{ | ||
"name": "@nteract/mathjax", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "React components for MathJax", | ||
@@ -18,3 +18,6 @@ "main": "lib/index.js", | ||
"license": "BSD-3-Clause", | ||
"gitHead": "3054fe966bd280c9b5d3ec40e0767f756a2a0cc1" | ||
"dependencies": { | ||
"load-script": "^1.0.0" | ||
}, | ||
"gitHead": "f595c033d4a8d70706d10197393110bb45dbf152" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
479508
34
1014
0
1
+ Addedload-script@^1.0.0
+ Addedload-script@1.0.0(transitive)