Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sort typescript imports #2074

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/addons/auto-render.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/* eslint no-console:0 */

import { AutoRenderOptions } from '../public/options';
import '../core/atom';

import { injectStylesheet } from '../common/stylesheet';

import '../core/atom';
import { loadFonts } from '../core/fonts';
import { parseMathString } from '../editor/parse-math-string';
import { AutoRenderOptions } from '../public/options';

/** @internal */
export type AutoRenderOptionsPrivate = AutoRenderOptions & {
Expand Down
4 changes: 2 additions & 2 deletions src/addons/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
*/

import {
ENVIRONMENTS,
LATEX_COMMANDS,
MATH_SYMBOLS,
TEXT_SYMBOLS,
ENVIRONMENTS,
} from '../core-definitions/definitions';
import { DEFAULT_KEYBINDINGS } from '../editor/keybindings-definitions';
import { getKeybindingMarkup } from '../editor/keybindings';
import { DEFAULT_KEYBINDINGS } from '../editor/keybindings-definitions';

const MathliveDebug = {
FUNCTIONS: LATEX_COMMANDS,
Expand Down
2 changes: 1 addition & 1 deletion src/addons/math-ml.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Atom } from '../core/atom-class';
import { MacroAtom } from '../core-atoms/macro';
import { Atom } from '../core/atom-class';

export type MathMLStream = {
atoms: Atom[];
Expand Down
15 changes: 5 additions & 10 deletions src/common/stylesheet.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
// @ts-ignore-error
import MATHFIELD_STYLESHEET from '../../css/mathfield.less';

// @ts-ignore-error
import CORE_STYLESHEET from '../../css/core.less';

// @ts-ignore-error
import ENVIRONMENT_POPOVER_STYLESHEET from '../../css/environment-popover.less';

// @ts-ignore-error
import SUGGESTION_POPOVER_STYLESHEET from '../../css/suggestion-popover.less';

// @ts-ignore-error
import KEYSTROKE_CAPTION_STYLESHEET from '../../css/keystroke-caption.less';

// @ts-ignore-error
import VIRTUAL_KEYBOARD_STYLESHEET from '../../css/virtual-keyboard.less' assert { type: 'css' };
import MATHFIELD_STYLESHEET from '../../css/mathfield.less';
// @ts-ignore-error
import SUGGESTION_POPOVER_STYLESHEET from '../../css/suggestion-popover.less';
// @ts-ignore-error
import VIRTUAL_KEYBOARD_STYLESHEET from '../../css/virtual-keyboard.less';

type StylesheetId =
| 'core'
Expand Down
2 changes: 1 addition & 1 deletion src/core-atoms/accent.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Atom, AtomJson, CreateAtomOptions } from '../core/atom-class';
import { makeSVGBox, Box } from '../core/box';
import { Box, makeSVGBox } from '../core/box';
import { Context } from '../core/context';
import { X_HEIGHT } from '../core/font-metrics';
import { VBox } from '../core/v-box';
Expand Down
9 changes: 4 additions & 5 deletions src/core-atoms/array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type {
Environment,
} from '../public/core-types';

import { isMatrixEnvironment } from '../core-definitions/environment-types';
import {
Atom,
AtomJson,
Expand All @@ -13,15 +14,13 @@ import {
ToLatexOptions,
} from '../core/atom-class';
import { Box } from '../core/box';
import { VBox, VBoxElementAndShift } from '../core/v-box';
import { makeLeftRightDelim } from '../core/delimiters';
import { Context } from '../core/context';
import { joinLatex } from '../core/tokenizer';
import { makeLeftRightDelim } from '../core/delimiters';
import { AXIS_HEIGHT, BASELINE_SKIP } from '../core/font-metrics';
import { convertDimensionToEm } from '../core/registers-utils';

import { joinLatex } from '../core/tokenizer';
import { VBox, VBoxElementAndShift } from '../core/v-box';
import { PlaceholderAtom } from './placeholder';
import { isMatrixEnvironment } from '../core-definitions/environment-types';

export type ColumnFormat =
| {
Expand Down
2 changes: 1 addition & 1 deletion src/core-atoms/delim.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { getDefinition } from '../core-definitions/definitions-utils';
import {
Atom,
AtomJson,
Expand All @@ -8,7 +9,6 @@ import { Box } from '../core/box';
import { Context } from '../core/context';
import { makeSizedDelim } from '../core/delimiters';
import { latexCommand } from '../core/tokenizer';
import { getDefinition } from '../core-definitions/definitions-utils';

export class MiddleDelimAtom extends Atom {
size: 1 | 2 | 3 | 4;
Expand Down
2 changes: 1 addition & 1 deletion src/core-atoms/enclose.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { Style } from '../public/core-types';

import { getDefinition } from '../core-definitions/definitions-utils';
import { Atom, AtomJson, ToLatexOptions } from '../core/atom-class';
import { addSVGOverlay, Box } from '../core/box';
import { Context } from '../core/context';
import { latexCommand } from '../core/tokenizer';
import { getDefinition } from '../core-definitions/definitions-utils';

export type EncloseAtomOptions = {
shadow?: string;
Expand Down
1 change: 1 addition & 0 deletions src/core-atoms/error.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Atom, AtomJson } from '../core/atom-class';

import type { Box } from '../core/box';
import type { Context } from '../core/context';

Expand Down
4 changes: 2 additions & 2 deletions src/core-atoms/genfrac.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import type { MathstyleName, Style } from '../public/core-types';

import { Atom, AtomJson } from '../core/atom-class';
import { Box } from '../core/box';
import { VBox } from '../core/v-box';
import { makeCustomSizedDelim, makeNullDelimiter } from '../core/delimiters';
import { Context } from '../core/context';
import { makeCustomSizedDelim, makeNullDelimiter } from '../core/delimiters';
import { AXIS_HEIGHT } from '../core/font-metrics';
import { VBox } from '../core/v-box';

export type GenfracOptions = {
continuousFraction?: boolean;
Expand Down
4 changes: 2 additions & 2 deletions src/core-atoms/group.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { ParseMode, Style } from '../public/core-types';

import { getDefinition } from '../core-definitions/definitions-utils';
import { Atom, AtomJson, ToLatexOptions } from '../core/atom-class';

import type { Context } from '../core/context';
import type { Box } from '../core/box';
import type { BoxType } from '../core/types';
import { getDefinition } from '../core-definitions/definitions-utils';

export class GroupAtom extends Atom {
private boxType?: BoxType;

Expand Down
2 changes: 1 addition & 1 deletion src/core-atoms/leftright.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import type { Style } from '../public/core-types';

import { Atom, AtomJson, ToLatexOptions } from '../core/atom-class';
import { Box } from '../core/box';
import { makeLeftRightDelim, RIGHT_DELIM } from '../core/delimiters';
import { Context } from '../core/context';
import { makeLeftRightDelim, RIGHT_DELIM } from '../core/delimiters';
import { joinLatex } from '../core/tokenizer';

/**
Expand Down
3 changes: 2 additions & 1 deletion src/core-atoms/macro.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Atom, AtomJson, ToLatexOptions } from '../core/atom-class';
import { Context } from '../core/context';
import { Box } from '../core/box';
import { Context } from '../core/context';

import type { Style } from '../public/core-types';

export class MacroAtom extends Atom {
Expand Down
4 changes: 2 additions & 2 deletions src/core-atoms/operator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Variant, VariantStyle } from '../public/core-types';

import { getDefinition } from '../core-definitions/definitions-utils';
import {
Atom,
AtomJson,
Expand All @@ -9,9 +10,8 @@ import {
} from '../core/atom-class';
import { Box } from '../core/box';
import { Context } from '../core/context';
import { joinLatex, latexCommand } from '../core/tokenizer';
import { AXIS_HEIGHT } from '../core/font-metrics';
import { getDefinition } from '../core-definitions/definitions-utils';
import { joinLatex, latexCommand } from '../core/tokenizer';

/**
* Operators are handled in the TeXbook pg. 443-444, rule 13(a).
Expand Down
1 change: 1 addition & 0 deletions src/core-atoms/overlap.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Atom, AtomJson, CreateAtomOptions } from '../core/atom-class';
import { Box } from '../core/box';
import { Context } from '../core/context';

import type { BoxType } from '../core/types';

export class OverlapAtom extends Atom {
Expand Down
3 changes: 2 additions & 1 deletion src/core-atoms/overunder.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Atom, AtomJson, CreateAtomOptions } from '../core/atom-class';
import { Box, makeSVGBox } from '../core/box';
import { VBox } from '../core/v-box';
import { Context } from '../core/context';
import { makeNullDelimiter } from '../core/delimiters';
import { VBox } from '../core/v-box';

import type { BoxType } from '../core/types';

// An `overunder` atom has the following attributes:
Expand Down
2 changes: 1 addition & 1 deletion src/core-atoms/phantom.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Atom, AtomJson, CreateAtomOptions } from '../core/atom-class';
import { Box } from '../core/box';
import { VBox } from '../core/v-box';
import { Context } from '../core/context';
import { VBox } from '../core/v-box';

export class PhantomAtom extends Atom {
private readonly isInvisible: boolean;
Expand Down
4 changes: 2 additions & 2 deletions src/core-atoms/spacing.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import type { LatexValue } from '../public/core-types';

import { getDefinition } from '../core-definitions/definitions-utils';
import {
Atom,
AtomJson,
CreateAtomOptions,
ToLatexOptions,
} from '../core/atom-class';
import { Box } from '../core/box';
import type { Context } from '../core/context';
import { serializeLatexValue } from '../core/registers-utils';
import { getDefinition } from '../core-definitions/definitions-utils';

import type { Context } from '../core/context';
export class SpacingAtom extends Atom {
private readonly width: LatexValue | undefined;
private _braced: boolean;
Expand Down
7 changes: 3 additions & 4 deletions src/core-atoms/surd.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import type { ParseMode } from '../public/core-types';

import { getDefinition } from '../core-definitions/definitions-utils';
import {
Atom,
AtomJson,
CreateAtomOptions,
ToLatexOptions,
} from '../core/atom-class';
import { X_HEIGHT } from '../core/font-metrics';
import { Box } from '../core/box';
import { VBox } from '../core/v-box';
import { Context } from '../core/context';

import { makeCustomSizedDelim } from '../core/delimiters';
import { X_HEIGHT } from '../core/font-metrics';
import { latexCommand } from '../core/tokenizer';
import { getDefinition } from '../core-definitions/definitions-utils';
import { VBox } from '../core/v-box';

export class SurdAtom extends Atom {
constructor(
Expand Down
2 changes: 1 addition & 1 deletion src/core-atoms/text.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Style } from '../public/core-types';

import { charToLatex } from '../core-definitions/definitions-utils';
import { Atom, AtomJson, ToLatexOptions } from '../core/atom-class';
import { Box } from '../core/box';
import { Context } from '../core/context';
import { charToLatex } from '../core-definitions/definitions-utils';

export class TextAtom extends Atom {
constructor(command: string, value: string, style: Style) {
Expand Down
7 changes: 4 additions & 3 deletions src/core-atoms/tooltip.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Argument } from 'core-definitions/definitions-utils';

import { fromJson } from '../core/atom';
import { Atom, AtomJson, CreateAtomOptions } from '../core/atom-class';
import { Context } from '../core/context';
import { Box, coalesce } from '../core/box';
import { Context } from '../core/context';
import { DEFAULT_FONT_SIZE } from '../core/font-metrics';
import { fromJson } from '../core/atom';
import { applyInterBoxSpacing } from '../core/inter-box-spacing';
import { Argument } from 'core-definitions/definitions-utils';

export class TooltipAtom extends Atom {
tooltip: Atom;
Expand Down
5 changes: 2 additions & 3 deletions src/core-definitions/accents.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { Atom } from '../core/atom-class';
import { AccentAtom } from '../core-atoms/accent';
import { OverunderAtom } from '../core-atoms/overunder';

import { Atom } from '../core/atom-class';
import { atomsBoxType } from '../core/box';
import {
argAtoms,
defineFunction,
parseArgAsString,
} from './definitions-utils';
import { atomsBoxType } from '../core/box';

const ACCENTS = {
acute: 0x02ca,
Expand Down
9 changes: 4 additions & 5 deletions src/core-definitions/definitions-utils.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { supportRegexPropertyEscape } from '../common/capabilities';

import {
Atom,
AtomType,
BBoxParameter,
CreateAtomOptions,
ToLatexOptions,
} from '../core/atom-class';
import { Box } from '../core/box';
import { MathfieldPrivate } from '../editor-mathfield/mathfield-private';
import { unicodeToMathVariant } from './unicode';

import type { ColumnFormat } from '../core-atoms/array';

import { MathfieldPrivate } from '../editor-mathfield/mathfield-private';
import type {
ArgumentType,
Dimension,
Expand All @@ -23,11 +25,8 @@ import type {
Environment,
LatexValue,
} from '../public/core-types';
import { unicodeToMathVariant } from './unicode';
import type { ContextInterface, PrivateStyle } from '../core/types';
import type { Context } from '../core/context';
import { Box } from '../core/box';

export type FunctionArgumentDefinition = {
isOptional: boolean;
type: ArgumentType;
Expand Down
2 changes: 1 addition & 1 deletion src/core-definitions/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import './functions';
import './mhchem';
import './styling';
import './symbols';

import './definitions-utils';

export * from './definitions-utils';

export { MacroDictionary } from '../public/core-types';
4 changes: 2 additions & 2 deletions src/core-definitions/enclose.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CreateAtomOptions } from 'core/atom-class';
import { EncloseAtom, EncloseAtomOptions } from '../core-atoms/enclose';

import { Argument, argAtoms, defineFunction } from './definitions-utils';
import { EncloseAtom, EncloseAtomOptions } from '../core-atoms/enclose';
import { argAtoms, Argument, defineFunction } from './definitions-utils';

// \enclose, a MathJax extension mapping to the MathML `menclose` tag.
// The first argument is a comma delimited list of notations, as defined
Expand Down
5 changes: 2 additions & 3 deletions src/core-definitions/environments.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import type { Dimension, Environment } from '../public/core-types';

import { Atom } from '../core/atom-class';
import { PlaceholderAtom } from '../core-atoms/placeholder';
import { ArrayAtom, ColumnFormat } from '../core-atoms/array';

import { PlaceholderAtom } from '../core-atoms/placeholder';
import { Atom } from '../core/atom-class';
import {
Argument,
defineEnvironment,
Expand Down
1 change: 0 additions & 1 deletion src/core-definitions/extensible-symbols.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { ToLatexOptions } from '../core/atom-class';
import { OverunderAtom } from '../core-atoms/overunder';

import { argAtoms, defineFunction } from './definitions-utils';

// Extensible (horizontally stretchy) symbols
Expand Down
Loading
Loading