mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-04 18:58:39 +00:00
chore(deps): update dependency flow-bin to v0.134.0 [skip netlify] (#2533)
* chore(deps): update dependency flow-bin to v0.134.0 [skip netlify] * Fix flow errors Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Young Min Kin <mail@ylem.kim>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
[version]
|
||||
0.133.0
|
||||
0.134.0
|
||||
|
||||
[ignore]
|
||||
<PROJECT_ROOT>/dist
|
||||
|
2
.yarn/sdks/flow-bin/package.json
vendored
2
.yarn/sdks/flow-bin/package.json
vendored
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "flow-bin",
|
||||
"version": "0.133.0-pnpify",
|
||||
"version": "0.134.0-pnpify",
|
||||
"type": "commonjs"
|
||||
}
|
||||
|
@@ -710,7 +710,10 @@ const flatten = function(array) {
|
||||
return result;
|
||||
};
|
||||
|
||||
const renderA11yString = function(text: string, settings?: SettingsOptions) {
|
||||
const renderA11yString = function(
|
||||
text: string,
|
||||
settings?: SettingsOptions,
|
||||
): string {
|
||||
|
||||
const tree = katex.__parse(text, settings);
|
||||
const a11yStrings = buildA11yStrings(tree, [], "normal");
|
||||
|
7
katex.js
7
katex.js
@@ -25,6 +25,7 @@ import {
|
||||
|
||||
import type {SettingsOptions} from "./src/Settings";
|
||||
import type {AnyParseNode} from "./src/parseNode";
|
||||
import type {DomSpan} from "./src/domTree";
|
||||
|
||||
import {defineSymbol} from './src/symbols';
|
||||
import {defineMacro} from './src/macros';
|
||||
@@ -36,7 +37,7 @@ declare var __VERSION__: string;
|
||||
* Parse and build an expression, and place that expression in the DOM node
|
||||
* given.
|
||||
*/
|
||||
let render = function(
|
||||
let render: (string, Node, SettingsOptions) => void = function(
|
||||
expression: string,
|
||||
baseNode: Node,
|
||||
options: SettingsOptions,
|
||||
@@ -109,7 +110,7 @@ const renderError = function(
|
||||
const renderToDomTree = function(
|
||||
expression: string,
|
||||
options: SettingsOptions,
|
||||
) {
|
||||
): DomSpan {
|
||||
const settings = new Settings(options);
|
||||
try {
|
||||
const tree = parseTree(expression, settings);
|
||||
@@ -126,7 +127,7 @@ const renderToDomTree = function(
|
||||
const renderToHTMLTree = function(
|
||||
expression: string,
|
||||
options: SettingsOptions,
|
||||
) {
|
||||
): DomSpan {
|
||||
const settings = new Settings(options);
|
||||
try {
|
||||
const tree = parseTree(expression, settings);
|
||||
|
@@ -43,7 +43,7 @@
|
||||
"eslint-plugin-flowtype": "^5.2.0",
|
||||
"eslint-plugin-react": "^7.20.3",
|
||||
"file-loader": "^6.0.0",
|
||||
"flow-bin": "^0.133.0",
|
||||
"flow-bin": "^0.134.0",
|
||||
"fs-extra": "^9.0.1",
|
||||
"husky": "^4.2.5",
|
||||
"istanbul-lib-coverage": "^3.0.0",
|
||||
|
@@ -42,7 +42,7 @@ const controlWordWhitespaceRegexString =
|
||||
const controlWordWhitespaceRegex = new RegExp(
|
||||
`^(${controlWordRegexString})${spaceRegexString}*$`);
|
||||
const combiningDiacriticalMarkString = "[\u0300-\u036f]";
|
||||
export const combiningDiacriticalMarksEndRegex =
|
||||
export const combiningDiacriticalMarksEndRegex: RegExp =
|
||||
new RegExp(`${combiningDiacriticalMarkString}+$`);
|
||||
const tokenRegexString = `(${spaceRegexString}+)|` + // whitespace
|
||||
"([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]" + // single codepoint
|
||||
|
@@ -83,7 +83,7 @@ class Options {
|
||||
/**
|
||||
* The base size index.
|
||||
*/
|
||||
static BASESIZE = 6;
|
||||
static BASESIZE: number = 6;
|
||||
|
||||
constructor(data: OptionsData) {
|
||||
this.style = data.style;
|
||||
@@ -242,7 +242,7 @@ class Options {
|
||||
/**
|
||||
* Create a new options objects with the given fontFamily.
|
||||
*/
|
||||
withTextFontFamily(fontFamily: string) {
|
||||
withTextFontFamily(fontFamily: string): Options {
|
||||
return this.extend({
|
||||
fontFamily,
|
||||
font: "",
|
||||
|
@@ -18,7 +18,7 @@ class ParseError {
|
||||
constructor(
|
||||
message: string, // The error message
|
||||
token?: ?Token | AnyParseNode, // An object providing position information
|
||||
) {
|
||||
): Error {
|
||||
let error = "KaTeX parse error: " + message;
|
||||
let start;
|
||||
|
||||
|
@@ -143,7 +143,7 @@ export default class Parser {
|
||||
return parse;
|
||||
}
|
||||
|
||||
static endOfExpression = ["}", "\\endgroup", "\\end", "\\right", "&"];
|
||||
static endOfExpression: string[] = ["}", "\\endgroup", "\\end", "\\right", "&"];
|
||||
|
||||
/**
|
||||
* Parses an "expression", which is a list of atoms.
|
||||
|
@@ -158,7 +158,7 @@ export default class Settings {
|
||||
* This is for the second category of `errorCode`s listed in the README.
|
||||
*/
|
||||
useStrictBehavior(errorCode: string, errorMsg: string,
|
||||
token?: Token | AnyParseNode) {
|
||||
token?: Token | AnyParseNode): boolean {
|
||||
let strict = this.strict;
|
||||
if (typeof strict === "function") {
|
||||
// Allow return value of strict function to be boolean or string
|
||||
@@ -196,7 +196,7 @@ export default class Settings {
|
||||
* If `context` has a `url` field, a `protocol` field will automatically
|
||||
* get added by this function (changing the specified object).
|
||||
*/
|
||||
isTrusted(context: AnyTrustContext) {
|
||||
isTrusted(context: AnyTrustContext): boolean {
|
||||
if (context.url && !context.protocol) {
|
||||
context.protocol = utils.protocolFromUrl(context.url);
|
||||
}
|
||||
|
@@ -123,8 +123,8 @@ const text = [D, Dc, T, Tc, T, Tc, T, Tc];
|
||||
|
||||
// We only export some of the styles.
|
||||
export default {
|
||||
DISPLAY: styles[D],
|
||||
TEXT: styles[T],
|
||||
SCRIPT: styles[S],
|
||||
SCRIPTSCRIPT: styles[SS],
|
||||
DISPLAY: (styles[D]: Style),
|
||||
TEXT: (styles[T]: Style),
|
||||
SCRIPT: (styles[S]: Style),
|
||||
SCRIPTSCRIPT: (styles[SS]: Style),
|
||||
};
|
||||
|
@@ -41,7 +41,7 @@ export class Token {
|
||||
range(
|
||||
endToken: Token, // last token of the range, inclusive
|
||||
text: string, // the text of the newly constructed token
|
||||
) {
|
||||
): Token {
|
||||
return new Token(text, SourceLocation.range(this, endToken));
|
||||
}
|
||||
}
|
||||
|
@@ -349,7 +349,7 @@ const makeLineSpan = function(
|
||||
className: string,
|
||||
options: Options,
|
||||
thickness?: number,
|
||||
) {
|
||||
): DomSpan {
|
||||
const line = makeSpan([className], [], options);
|
||||
line.height = Math.max(
|
||||
thickness || options.fontMetrics().defaultRuleThickness,
|
||||
@@ -369,7 +369,7 @@ const makeAnchor = function(
|
||||
classes: string[],
|
||||
children: HtmlDomNode[],
|
||||
options: Options,
|
||||
) {
|
||||
): Anchor {
|
||||
const anchor = new Anchor(href, classes, children, options);
|
||||
|
||||
sizeElementFromChildren(anchor);
|
||||
|
@@ -4,6 +4,8 @@ import buildCommon from "../buildCommon";
|
||||
import mathMLTree from "../mathMLTree";
|
||||
import {assertNodeType} from "../parseNode";
|
||||
|
||||
import type {AnyParseNode} from '../parseNode';
|
||||
|
||||
import * as html from "../buildHTML";
|
||||
import * as mml from "../buildMathML";
|
||||
|
||||
@@ -47,7 +49,7 @@ defineFunction({
|
||||
type: "color",
|
||||
mode: parser.mode,
|
||||
color,
|
||||
body: ordargument(body),
|
||||
body: (ordargument(body): AnyParseNode[]),
|
||||
};
|
||||
},
|
||||
htmlBuilder,
|
||||
@@ -72,7 +74,7 @@ defineFunction({
|
||||
parser.gullet.macros.set("\\current@color", color);
|
||||
|
||||
// Parse out the implicit body that should be colored.
|
||||
const body = parser.parseExpression(true, breakOnTokenText);
|
||||
const body: AnyParseNode[] = parser.parseExpression(true, breakOnTokenText);
|
||||
|
||||
return {
|
||||
type: "color",
|
||||
|
@@ -3,8 +3,8 @@ const {targets, createConfig} = require('./webpack.common');
|
||||
// $FlowIgnore
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
||||
|
||||
// dev minify
|
||||
const katexConfig = createConfig(targets.shift(), false, false);
|
||||
// dev minify
|
||||
const katexConfig /*: Object */ = createConfig(targets.shift(), false, false);
|
||||
|
||||
katexConfig.plugins.push(new BundleAnalyzerPlugin());
|
||||
|
||||
|
@@ -172,6 +172,7 @@ function createConfig(target /*: Target */, dev /*: boolean */,
|
||||
plugins: [PnpWebpackPlugin],
|
||||
},
|
||||
resolveLoader: {
|
||||
// $FlowIgnore
|
||||
plugins: [PnpWebpackPlugin.moduleLoader(module)],
|
||||
},
|
||||
};
|
||||
|
@@ -1,7 +1,7 @@
|
||||
// @flow
|
||||
const {targets, createConfig} = require('./webpack.common');
|
||||
|
||||
module.exports = [ // dev minify
|
||||
module.exports = ([ // dev minify
|
||||
...targets.map(target => createConfig(target, false, false)),
|
||||
...targets.map(target => createConfig(target, false, true)),
|
||||
];
|
||||
] /*: Array<Object> */);
|
||||
|
@@ -3,8 +3,8 @@ const {targets, createConfig} = require('./webpack.common');
|
||||
const path = require('path');
|
||||
const PORT = 7936;
|
||||
|
||||
// dev minify
|
||||
const katexConfig = createConfig(targets.shift(), true, false);
|
||||
// dev minify
|
||||
const katexConfig /*: Object*/ = createConfig(targets.shift(), true, false);
|
||||
|
||||
// add the entry point for test page
|
||||
katexConfig.entry.main = './static/main.js';
|
||||
@@ -24,7 +24,7 @@ katexConfig.devServer = {
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = [
|
||||
module.exports = ([
|
||||
katexConfig,
|
||||
...targets.map(target => createConfig(target, true, false)),
|
||||
];
|
||||
] /*: Array<Object> */);
|
||||
|
10
yarn.lock
10
yarn.lock
@@ -5345,12 +5345,12 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"flow-bin@npm:^0.133.0":
|
||||
version: 0.133.0
|
||||
resolution: "flow-bin@npm:0.133.0"
|
||||
"flow-bin@npm:^0.134.0":
|
||||
version: 0.134.0
|
||||
resolution: "flow-bin@npm:0.134.0"
|
||||
bin:
|
||||
flow: cli.js
|
||||
checksum: b767946fb8763372127d7c7fd013a8c39de2066e59e19210aba17e6e7bb772bdd19f225b90466ca02bcdb2523463d59eb10d15f671d1ea024612219ed9f44fb2
|
||||
checksum: 8858ccda62b4e7d30c1672cb48dfcd43c9421c89c692f295224090032573b1488a07abbd7cabdd9d4e2acd8792467d67e7fbeaeb0792191af772e4eae70c4010
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -7657,7 +7657,7 @@ fsevents@^1.2.7:
|
||||
eslint-plugin-flowtype: ^5.2.0
|
||||
eslint-plugin-react: ^7.20.3
|
||||
file-loader: ^6.0.0
|
||||
flow-bin: ^0.133.0
|
||||
flow-bin: ^0.134.0
|
||||
fs-extra: ^9.0.1
|
||||
husky: ^4.2.5
|
||||
istanbul-lib-coverage: ^3.0.0
|
||||
|
Reference in New Issue
Block a user