This commit is contained in:
2025-05-09 05:30:08 +02:00
parent 7bb10e7df4
commit 73367bad9e
5322 changed files with 1266973 additions and 313 deletions

View File

@@ -0,0 +1,20 @@
export class ColorPicker {
static "__#23@#l10nColor": null;
static get _keyboardManager(): any;
constructor({ editor, uiManager }: {
editor?: null | undefined;
uiManager?: null | undefined;
});
renderButton(): HTMLButtonElement;
renderMainDropdown(): HTMLDivElement;
_colorSelectFromKeyboard(event: any): void;
_moveToNext(event: any): void;
_moveToPrevious(event: any): void;
_moveToBeginning(event: any): void;
_moveToEnd(event: any): void;
hideDropdown(): void;
_hideDropdownFromKeyboard(): void;
updateColor(color: any): void;
destroy(): void;
#private;
}

View File

@@ -0,0 +1,42 @@
'use strict'
/*!
* Canvas - PNGStream
* Copyright (c) 2010 LearnBoost <tj@learnboost.com>
* MIT Licensed
*/
const { Readable } = require('stream')
function noop () {}
class PNGStream extends Readable {
constructor (canvas, options) {
super()
if (options &&
options.palette instanceof Uint8ClampedArray &&
options.palette.length % 4 !== 0) {
throw new Error('Palette length must be a multiple of 4.')
}
this.canvas = canvas
this.options = options || {}
}
_read () {
// For now we're not controlling the c++ code's data emission, so we only
// call canvas.streamPNGSync once and let it emit data at will.
this._read = noop
this.canvas.streamPNGSync((err, chunk, len) => {
if (err) {
this.emit('error', err)
} else if (len) {
this.push(chunk)
} else {
this.push(null)
}
}, this.options)
}
}
module.exports = PNGStream

View File

@@ -0,0 +1,67 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createConfigItem = createConfigItem;
exports.createItemFromDescriptor = createItemFromDescriptor;
exports.getItemDescriptor = getItemDescriptor;
function _path() {
const data = require("path");
_path = function () {
return data;
};
return data;
}
var _configDescriptors = require("./config-descriptors.js");
function createItemFromDescriptor(desc) {
return new ConfigItem(desc);
}
function* createConfigItem(value, {
dirname = ".",
type
} = {}) {
const descriptor = yield* (0, _configDescriptors.createDescriptor)(value, _path().resolve(dirname), {
type,
alias: "programmatic item"
});
return createItemFromDescriptor(descriptor);
}
const CONFIG_ITEM_BRAND = Symbol.for("@babel/core@7 - ConfigItem");
function getItemDescriptor(item) {
if (item != null && item[CONFIG_ITEM_BRAND]) {
return item._descriptor;
}
return undefined;
}
class ConfigItem {
constructor(descriptor) {
this._descriptor = void 0;
this[CONFIG_ITEM_BRAND] = true;
this.value = void 0;
this.options = void 0;
this.dirname = void 0;
this.name = void 0;
this.file = void 0;
this._descriptor = descriptor;
Object.defineProperty(this, "_descriptor", {
enumerable: false
});
Object.defineProperty(this, CONFIG_ITEM_BRAND, {
enumerable: false
});
this.value = this._descriptor.value;
this.options = this._descriptor.options;
this.dirname = this._descriptor.dirname;
this.name = this._descriptor.name;
this.file = this._descriptor.file ? {
request: this._descriptor.file.request,
resolved: this._descriptor.file.resolved
} : undefined;
Object.freeze(this);
}
}
Object.freeze(ConfigItem.prototype);
0 && 0;
//# sourceMappingURL=item.js.map

View File

@@ -0,0 +1,254 @@
// https://github.com/prettier/prettier/blob/next/src/document/public.js
export namespace builders {
type DocCommand =
| Align
| BreakParent
| Cursor
| Fill
| Group
| IfBreak
| Indent
| IndentIfBreak
| Label
| Line
| LineSuffix
| LineSuffixBoundary
| Trim;
type Doc = string | Doc[] | DocCommand;
interface Align {
type: "align";
contents: Doc;
n: number | string | { type: "root" };
}
interface BreakParent {
type: "break-parent";
}
interface Cursor {
type: "cursor";
placeholder: symbol;
}
interface Fill {
type: "fill";
parts: Doc[];
}
interface Group {
type: "group";
id?: symbol;
contents: Doc;
break: boolean;
expandedStates: Doc[];
}
interface HardlineWithoutBreakParent extends Line {
hard: true;
}
interface IfBreak {
type: "if-break";
breakContents: Doc;
flatContents: Doc;
}
interface Indent {
type: "indent";
contents: Doc;
}
interface IndentIfBreak {
type: "indent-if-break";
}
interface Label {
type: "label";
label: any;
contents: Doc;
}
interface Line {
type: "line";
soft?: boolean | undefined;
hard?: boolean | undefined;
literal?: boolean | undefined;
}
interface LineSuffix {
type: "line-suffix";
contents: Doc;
}
interface LineSuffixBoundary {
type: "line-suffix-boundary";
}
interface LiterallineWithoutBreakParent extends Line {
hard: true;
literal: true;
}
type LiteralLine = [LiterallineWithoutBreakParent, BreakParent];
interface Softline extends Line {
soft: true;
}
type Hardline = [HardlineWithoutBreakParent, BreakParent];
interface Trim {
type: "trim";
}
interface GroupOptions {
shouldBreak?: boolean | undefined;
id?: symbol | undefined;
}
function addAlignmentToDoc(doc: Doc, size: number, tabWidth: number): Doc;
/** @see [align](https://github.com/prettier/prettier/blob/main/commands.md#align) */
function align(widthOrString: Align["n"], doc: Doc): Align;
/** @see [breakParent](https://github.com/prettier/prettier/blob/main/commands.md#breakparent) */
const breakParent: BreakParent;
/** @see [conditionalGroup](https://github.com/prettier/prettier/blob/main/commands.md#conditionalgroup) */
function conditionalGroup(alternatives: Doc[], options?: GroupOptions): Group;
/** @see [dedent](https://github.com/prettier/prettier/blob/main/commands.md#dedent) */
function dedent(doc: Doc): Align;
/** @see [dedentToRoot](https://github.com/prettier/prettier/blob/main/commands.md#dedenttoroot) */
function dedentToRoot(doc: Doc): Align;
/** @see [fill](https://github.com/prettier/prettier/blob/main/commands.md#fill) */
function fill(docs: Doc[]): Fill;
/** @see [group](https://github.com/prettier/prettier/blob/main/commands.md#group) */
function group(doc: Doc, opts?: GroupOptions): Group;
/** @see [hardline](https://github.com/prettier/prettier/blob/main/commands.md#hardline) */
const hardline: Hardline;
/** @see [hardlineWithoutBreakParent](https://github.com/prettier/prettier/blob/main/commands.md#hardlinewithoutbreakparent-and-literallinewithoutbreakparent) */
const hardlineWithoutBreakParent: HardlineWithoutBreakParent;
/** @see [ifBreak](https://github.com/prettier/prettier/blob/main/commands.md#ifbreak) */
function ifBreak(
ifBreak: Doc,
noBreak?: Doc,
options?: { groupId?: symbol | undefined },
): IfBreak;
/** @see [indent](https://github.com/prettier/prettier/blob/main/commands.md#indent) */
function indent(doc: Doc): Indent;
/** @see [indentIfBreak](https://github.com/prettier/prettier/blob/main/commands.md#indentifbreak) */
function indentIfBreak(
doc: Doc,
opts: { groupId: symbol; negate?: boolean | undefined },
): IndentIfBreak;
/** @see [join](https://github.com/prettier/prettier/blob/main/commands.md#join) */
function join(sep: Doc, docs: Doc[]): Doc[];
/** @see [label](https://github.com/prettier/prettier/blob/main/commands.md#label) */
function label(label: any | undefined, contents: Doc): Doc;
/** @see [line](https://github.com/prettier/prettier/blob/main/commands.md#line) */
const line: Line;
/** @see [lineSuffix](https://github.com/prettier/prettier/blob/main/commands.md#linesuffix) */
function lineSuffix(suffix: Doc): LineSuffix;
/** @see [lineSuffixBoundary](https://github.com/prettier/prettier/blob/main/commands.md#linesuffixboundary) */
const lineSuffixBoundary: LineSuffixBoundary;
/** @see [literalline](https://github.com/prettier/prettier/blob/main/commands.md#literalline) */
const literalline: LiteralLine;
/** @see [literallineWithoutBreakParent](https://github.com/prettier/prettier/blob/main/commands.md#hardlinewithoutbreakparent-and-literallinewithoutbreakparent) */
const literallineWithoutBreakParent: LiterallineWithoutBreakParent;
/** @see [markAsRoot](https://github.com/prettier/prettier/blob/main/commands.md#markasroot) */
function markAsRoot(doc: Doc): Align;
/** @see [softline](https://github.com/prettier/prettier/blob/main/commands.md#softline) */
const softline: Softline;
/** @see [trim](https://github.com/prettier/prettier/blob/main/commands.md#trim) */
const trim: Trim;
/** @see [cursor](https://github.com/prettier/prettier/blob/main/commands.md#cursor) */
const cursor: Cursor;
}
export namespace printer {
function printDocToString(
doc: builders.Doc,
options: Options,
): {
formatted: string;
/**
* This property is a misnomer, and has been since the changes in
* https://github.com/prettier/prettier/pull/15709.
* The region of the document indicated by `cursorNodeStart` and `cursorNodeText` will
* sometimes actually be what lies BETWEEN a pair of leaf nodes in the AST, rather than a node.
*/
cursorNodeStart?: number | undefined;
/**
* Note that, like cursorNodeStart, this is a misnomer and may actually be the text between two
* leaf nodes in the AST instead of the text of a node.
*/
cursorNodeText?: string | undefined;
};
interface Options {
/**
* Specify the line length that the printer will wrap on.
* @default 80
*/
printWidth: number;
/**
* Specify the number of spaces per indentation-level.
* @default 2
*/
tabWidth: number;
/**
* Indent lines with tabs instead of spaces
* @default false
*/
useTabs?: boolean;
parentParser?: string | undefined;
__embeddedInHtml?: boolean | undefined;
}
}
export namespace utils {
function willBreak(doc: builders.Doc): boolean;
function traverseDoc(
doc: builders.Doc,
onEnter?: (doc: builders.Doc) => void | boolean,
onExit?: (doc: builders.Doc) => void,
shouldTraverseConditionalGroups?: boolean,
): void;
function findInDoc<T = builders.Doc>(
doc: builders.Doc,
callback: (doc: builders.Doc) => T,
defaultValue: T,
): T;
function mapDoc<T = builders.Doc>(
doc: builders.Doc,
callback: (doc: builders.Doc) => T,
): T;
function removeLines(doc: builders.Doc): builders.Doc;
function stripTrailingHardline(doc: builders.Doc): builders.Doc;
function replaceEndOfLine(
doc: builders.Doc,
replacement?: builders.Doc,
): builders.Doc;
function canBreak(doc: builders.Doc): boolean;
}

View File

@@ -0,0 +1,148 @@
import path, { resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { readFileSync } from 'node:fs';
const { version } = JSON.parse(
readFileSync(new URL("../../package.json", import.meta.url)).toString()
);
const ROLLUP_HOOKS = [
"options",
"buildStart",
"buildEnd",
"renderStart",
"renderError",
"renderChunk",
"writeBundle",
"generateBundle",
"banner",
"footer",
"augmentChunkHash",
"outputOptions",
"renderDynamicImport",
"resolveFileUrl",
"resolveImportMeta",
"intro",
"outro",
"closeBundle",
"closeWatcher",
"load",
"moduleParsed",
"watchChange",
"resolveDynamicImport",
"resolveId",
"shouldTransformCachedModule",
"transform",
"onLog"
];
const VERSION = version;
const DEFAULT_MAIN_FIELDS = [
"browser",
"module",
"jsnext:main",
// moment still uses this...
"jsnext"
];
const DEFAULT_CLIENT_MAIN_FIELDS = Object.freeze(DEFAULT_MAIN_FIELDS);
const DEFAULT_SERVER_MAIN_FIELDS = Object.freeze(
DEFAULT_MAIN_FIELDS.filter((f) => f !== "browser")
);
const DEV_PROD_CONDITION = `development|production`;
const DEFAULT_CONDITIONS = ["module", "browser", "node", DEV_PROD_CONDITION];
const DEFAULT_CLIENT_CONDITIONS = Object.freeze(
DEFAULT_CONDITIONS.filter((c) => c !== "node")
);
const DEFAULT_SERVER_CONDITIONS = Object.freeze(
DEFAULT_CONDITIONS.filter((c) => c !== "browser")
);
const ESBUILD_MODULES_TARGET = [
"es2020",
"edge88",
"firefox78",
"chrome87",
"safari14"
];
const DEFAULT_CONFIG_FILES = [
"vite.config.js",
"vite.config.mjs",
"vite.config.ts",
"vite.config.cjs",
"vite.config.mts",
"vite.config.cts"
];
const JS_TYPES_RE = /\.(?:j|t)sx?$|\.mjs$/;
const CSS_LANGS_RE = /\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/;
const OPTIMIZABLE_ENTRY_RE = /\.[cm]?[jt]s$/;
const SPECIAL_QUERY_RE = /[?&](?:worker|sharedworker|raw|url)\b/;
const FS_PREFIX = `/@fs/`;
const CLIENT_PUBLIC_PATH = `/@vite/client`;
const ENV_PUBLIC_PATH = `/@vite/env`;
const VITE_PACKAGE_DIR = resolve(
// import.meta.url is `dist/node/constants.js` after bundle
fileURLToPath(import.meta.url),
"../../.."
);
const CLIENT_ENTRY = resolve(VITE_PACKAGE_DIR, "dist/client/client.mjs");
const ENV_ENTRY = resolve(VITE_PACKAGE_DIR, "dist/client/env.mjs");
const CLIENT_DIR = path.dirname(CLIENT_ENTRY);
const KNOWN_ASSET_TYPES = [
// images
"apng",
"bmp",
"png",
"jpe?g",
"jfif",
"pjpeg",
"pjp",
"gif",
"svg",
"ico",
"webp",
"avif",
"cur",
"jxl",
// media
"mp4",
"webm",
"ogg",
"mp3",
"wav",
"flac",
"aac",
"opus",
"mov",
"m4a",
"vtt",
// fonts
"woff2?",
"eot",
"ttf",
"otf",
// other
"webmanifest",
"pdf",
"txt"
];
const DEFAULT_ASSETS_RE = new RegExp(
`\\.(` + KNOWN_ASSET_TYPES.join("|") + `)(\\?.*)?$`
);
const DEP_VERSION_RE = /[?&](v=[\w.-]+)\b/;
const loopbackHosts = /* @__PURE__ */ new Set([
"localhost",
"127.0.0.1",
"::1",
"0000:0000:0000:0000:0000:0000:0000:0001"
]);
const wildcardHosts = /* @__PURE__ */ new Set([
"0.0.0.0",
"::",
"0000:0000:0000:0000:0000:0000:0000:0000"
]);
const DEFAULT_DEV_PORT = 5173;
const DEFAULT_PREVIEW_PORT = 4173;
const DEFAULT_ASSETS_INLINE_LIMIT = 4096;
const defaultAllowedOrigins = /^https?:\/\/(?:(?:[^:]+\.)?localhost|127\.0\.0\.1|\[::1\])(?::\d+)?$/;
const METADATA_FILENAME = "_metadata.json";
const ERR_OPTIMIZE_DEPS_PROCESSING_ERROR = "ERR_OPTIMIZE_DEPS_PROCESSING_ERROR";
const ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR = "ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR";
export { CLIENT_DIR, CLIENT_ENTRY, CLIENT_PUBLIC_PATH, CSS_LANGS_RE, DEFAULT_ASSETS_INLINE_LIMIT, DEFAULT_ASSETS_RE, DEFAULT_CLIENT_CONDITIONS, DEFAULT_CLIENT_MAIN_FIELDS, DEFAULT_CONFIG_FILES, DEFAULT_DEV_PORT, DEFAULT_PREVIEW_PORT, DEFAULT_SERVER_CONDITIONS, DEFAULT_SERVER_MAIN_FIELDS, DEP_VERSION_RE, DEV_PROD_CONDITION, ENV_ENTRY, ENV_PUBLIC_PATH, ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_DIR, ERR_OPTIMIZE_DEPS_PROCESSING_ERROR, ESBUILD_MODULES_TARGET, FS_PREFIX, JS_TYPES_RE, KNOWN_ASSET_TYPES, METADATA_FILENAME, OPTIMIZABLE_ENTRY_RE, ROLLUP_HOOKS, SPECIAL_QUERY_RE, VERSION, VITE_PACKAGE_DIR, defaultAllowedOrigins, loopbackHosts, wildcardHosts };

View File

@@ -0,0 +1 @@
module.exports={C:{"55":0.00289,"60":0.00289,"72":0.00289,"76":0.00289,"88":0.00289,"89":0.00289,"98":0.00289,"109":0.00289,"110":0.00289,"111":0.00578,"113":0.00578,"115":0.08095,"118":0.00289,"123":0.00578,"127":0.04337,"128":0.00867,"129":0.00289,"130":0.00289,"131":0.01156,"132":0.00578,"133":0.01735,"134":0.02313,"135":0.20526,"136":0.59266,"137":0.00289,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 61 62 63 64 65 66 67 68 69 70 71 73 74 75 77 78 79 80 81 82 83 84 85 86 87 90 91 92 93 94 95 96 97 99 100 101 102 103 104 105 106 107 108 112 114 116 117 119 120 121 122 124 125 126 138 139 140 3.5 3.6"},D:{"11":0.00578,"26":0.00289,"43":0.00289,"47":0.00289,"49":0.00289,"50":0.00289,"59":0.00289,"67":0.00867,"70":0.00578,"72":0.00578,"74":0.00289,"76":0.00289,"77":0.00578,"78":0.00289,"80":0.00289,"85":0.00289,"87":0.00867,"88":0.04047,"90":0.01446,"91":0.00289,"92":0.01156,"94":0.00578,"95":0.00289,"96":0.00289,"98":0.02024,"99":0.01735,"103":0.00867,"104":0.01156,"105":0.00867,"106":0.00578,"109":0.43943,"110":0.00578,"111":0.02313,"112":0.00578,"113":0.03469,"114":0.03758,"115":0.00289,"116":0.02313,"117":0.00867,"118":0.00578,"119":0.01156,"120":0.15322,"121":0.0318,"122":0.02602,"123":0.01446,"124":0.03469,"125":0.01156,"126":0.06071,"127":0.06649,"128":0.0318,"129":0.0318,"130":0.02602,"131":0.2573,"132":0.18213,"133":3.02977,"134":5.15465,"135":0.01156,"136":0.00289,_:"4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 45 46 48 51 52 53 54 55 56 57 58 60 61 62 63 64 65 66 68 69 71 73 75 79 81 83 84 86 89 93 97 100 101 102 107 108 137 138"},F:{"74":0.00289,"77":0.00289,"79":0.00289,"83":0.04337,"86":0.01156,"87":0.04915,"88":0.00867,"95":0.00578,"102":0.00289,"106":0.00578,"113":0.00289,"114":0.00867,"116":0.02891,"117":0.47991,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 75 76 78 80 81 82 84 85 89 90 91 92 93 94 96 97 98 99 100 101 103 104 105 107 108 109 110 111 112 115 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"12":0.00289,"13":0.00867,"14":0.00289,"15":0.01446,"16":0.00867,"17":0.00867,"18":0.02024,"80":0.00289,"83":0.00289,"84":0.01446,"88":0.00578,"89":0.02024,"90":0.00867,"92":0.0954,"100":0.05493,"108":0.00289,"109":0.01446,"112":0.00578,"113":0.00289,"114":0.00867,"115":0.00289,"116":0.00578,"117":0.00578,"118":0.00578,"119":0.01156,"120":0.00289,"121":0.00867,"122":0.0318,"123":0.02024,"124":0.01735,"125":0.01156,"126":0.01446,"127":0.02024,"128":0.02313,"129":0.04915,"130":0.04626,"131":0.23417,"132":0.10119,"133":1.72882,"134":3.15986,_:"79 81 85 86 87 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 110 111"},E:{"13":0.00289,_:"0 4 5 6 7 8 9 10 11 12 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.5 16.0 16.2 17.0","13.1":0.00867,"14.1":0.00578,"15.2-15.3":0.00578,"15.4":0.01156,"15.6":0.01446,"16.1":0.00289,"16.3":0.0954,"16.4":0.00578,"16.5":0.00289,"16.6":0.01446,"17.1":0.00289,"17.2":0.00289,"17.3":0.00289,"17.4":0.00289,"17.5":0.00289,"17.6":0.02602,"18.0":0.00289,"18.1":0.01156,"18.2":0.00289,"18.3":0.07806,"18.4":0.00289},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00036,"5.0-5.1":0,"6.0-6.1":0.00108,"7.0-7.1":0.00072,"8.1-8.4":0,"9.0-9.2":0.00054,"9.3":0.00252,"10.0-10.2":0.00018,"10.3":0.00414,"11.0-11.2":0.01906,"11.3-11.4":0.00126,"12.0-12.1":0.00072,"12.2-12.5":0.01781,"13.0-13.1":0.00036,"13.2":0.00054,"13.3":0.00072,"13.4-13.7":0.00252,"14.0-14.4":0.0063,"14.5-14.8":0.00755,"15.0-15.1":0.00414,"15.2-15.3":0.00414,"15.4":0.00504,"15.5":0.00576,"15.6-15.8":0.07086,"16.0":0.01007,"16.1":0.02068,"16.2":0.01079,"16.3":0.01871,"16.4":0.00414,"16.5":0.00773,"16.6-16.7":0.08399,"17.0":0.00504,"17.1":0.00899,"17.2":0.00683,"17.3":0.00953,"17.4":0.01906,"17.5":0.04245,"17.6-17.7":0.1232,"18.0":0.03453,"18.1":0.11295,"18.2":0.05054,"18.3":1.0563,"18.4":0.01565},P:{"4":0.02048,"20":0.04096,"21":0.04096,"22":0.24574,"23":0.0512,"24":0.35837,"25":0.19454,"26":0.12287,"27":1.39252,_:"5.0-5.4 6.2-6.4 8.2 9.2 10.1 12.0 16.0","7.2-7.4":0.10239,"11.1-11.2":0.0512,"13.0":0.02048,"14.0":0.04096,"15.0":0.01024,"17.0":0.01024,"18.0":0.01024,"19.0":0.03072},I:{"0":0.48949,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00015,"4.4":0,"4.4.3-4.4.4":0.00054},K:{"0":0.95104,_:"10 11 12 11.1 11.5 12.1"},A:{"9":0.00392,"10":0.00785,"11":0.04316,_:"6 7 8 5.5"},S:{"2.5":0.00711,_:"3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.07109},Q:{"14.9":0.12796},O:{"0":0.61848},H:{"0":0.03},L:{"0":73.73974}};

View File

@@ -0,0 +1 @@
module.exports={C:{"68":0.0029,"78":0.0029,"115":0.11322,"122":0.0029,"128":0.02613,"129":0.01742,"132":0.0029,"133":0.00581,"134":0.01452,"135":0.25837,"136":5.14702,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 123 124 125 126 127 130 131 137 138 139 140 3.5 3.6"},D:{"49":0.00581,"56":0.00581,"76":0.00581,"79":0.03193,"83":0.00581,"88":0.00581,"94":0.00581,"97":0.0029,"99":0.0029,"100":0.05225,"102":0.0029,"103":0.01161,"104":0.04645,"105":0.01161,"108":0.02322,"109":0.20321,"110":0.0029,"111":0.0029,"114":0.04935,"116":0.01161,"119":0.00871,"120":0.0029,"121":0.0029,"122":0.02903,"123":0.00871,"124":0.04645,"125":0.05225,"126":0.01742,"127":0.01161,"128":0.04355,"129":0.01161,"130":0.01742,"131":0.08709,"132":0.26417,"133":3.91324,"134":7.47813,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 50 51 52 53 54 55 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 77 78 80 81 84 85 86 87 89 90 91 92 93 95 96 98 101 106 107 112 113 115 117 118 135 136 137 138"},F:{"36":0.0029,"40":0.0029,"46":0.00871,"55":0.0029,"87":0.00581,"95":0.00581,"113":0.0029,"116":0.36868,"117":1.02476,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 37 38 39 41 42 43 44 45 47 48 49 50 51 52 53 54 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 88 89 90 91 92 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 114 115 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"17":0.0029,"92":0.01452,"109":0.02322,"111":0.0029,"114":0.02032,"119":0.0029,"120":0.0029,"121":0.0029,"122":0.00581,"124":0.0029,"125":0.0029,"127":0.0029,"128":0.00871,"129":0.0029,"130":0.02322,"131":0.03193,"132":0.07838,"133":1.10604,"134":3.22233,_:"12 13 14 15 16 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 112 113 115 116 117 118 123 126"},E:{"14":0.0029,"15":0.0029,_:"0 4 5 6 7 8 9 10 11 12 13 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1","12.1":0.00581,"13.1":0.04355,"14.1":0.01452,"15.1":0.0029,"15.2-15.3":0.02032,"15.4":0.01452,"15.5":0.02322,"15.6":0.12483,"16.0":0.08128,"16.1":0.01161,"16.2":0.00581,"16.3":0.01161,"16.4":0.01161,"16.5":0.01742,"16.6":0.17708,"17.0":0.04935,"17.1":0.17708,"17.2":0.05516,"17.3":0.00871,"17.4":0.04064,"17.5":0.20902,"17.6":0.14805,"18.0":0.08419,"18.1":0.10741,"18.2":0.11612,"18.3":1.5502,"18.4":0.02032},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.0023,"5.0-5.1":0,"6.0-6.1":0.00691,"7.0-7.1":0.0046,"8.1-8.4":0,"9.0-9.2":0.00345,"9.3":0.01611,"10.0-10.2":0.00115,"10.3":0.02647,"11.0-11.2":0.122,"11.3-11.4":0.00806,"12.0-12.1":0.0046,"12.2-12.5":0.11395,"13.0-13.1":0.0023,"13.2":0.00345,"13.3":0.0046,"13.4-13.7":0.01611,"14.0-14.4":0.04028,"14.5-14.8":0.04834,"15.0-15.1":0.02647,"15.2-15.3":0.02647,"15.4":0.03223,"15.5":0.03683,"15.6-15.8":0.45348,"16.0":0.06445,"16.1":0.13236,"16.2":0.06906,"16.3":0.1197,"16.4":0.02647,"16.5":0.04949,"16.6-16.7":0.5375,"17.0":0.03223,"17.1":0.05755,"17.2":0.04374,"17.3":0.061,"17.4":0.122,"17.5":0.27163,"17.6-17.7":0.78842,"18.0":0.22099,"18.1":0.72281,"18.2":0.32342,"18.3":6.75965,"18.4":0.10013},P:{"4":0.03113,"21":0.03113,"22":0.11413,"23":0.02075,"24":0.02075,"25":0.05188,"26":0.17639,"27":3.06087,_:"20 5.0-5.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","6.2-6.4":0.05188,"7.2-7.4":0.01038},I:{"0":0.1487,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00004,"4.4":0,"4.4.3-4.4.4":0.00016},K:{"0":0.40447,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.17999,_:"6 7 8 9 10 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.22707},Q:{_:"14.9"},O:{"0":0.04967},H:{"0":0},L:{"0":55.75944}};

View File

@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = removeProperties;
var _index = require("../constants/index.js");
const CLEAR_KEYS = ["tokens", "start", "end", "loc", "raw", "rawValue"];
const CLEAR_KEYS_PLUS_COMMENTS = [..._index.COMMENT_KEYS, "comments", ...CLEAR_KEYS];
function removeProperties(node, opts = {}) {
const map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS;
for (const key of map) {
if (node[key] != null) node[key] = undefined;
}
for (const key of Object.keys(node)) {
if (key[0] === "_" && node[key] != null) node[key] = undefined;
}
const symbols = Object.getOwnPropertySymbols(node);
for (const sym of symbols) {
node[sym] = null;
}
}
//# sourceMappingURL=removeProperties.js.map

View File

@@ -0,0 +1 @@
module.exports={C:{"93":0.00336,"110":0.02351,"111":0.00672,"115":0.04365,"127":0.00336,"128":0.01007,"134":0.00336,"135":0.14104,"136":0.34587,"137":0.02351,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 112 113 114 116 117 118 119 120 121 122 123 124 125 126 129 130 131 132 133 138 139 140 3.5 3.6"},D:{"11":0.00336,"39":0.01007,"40":0.01007,"41":0.01007,"42":0.01007,"43":0.01007,"44":0.00672,"45":0.00672,"46":0.00336,"47":0.00672,"48":0.00672,"49":0.01007,"50":0.01007,"51":0.01007,"52":0.01007,"53":0.01007,"54":0.01007,"55":0.00672,"56":0.00672,"57":0.01007,"58":0.00672,"59":0.00672,"60":0.01007,"63":0.00672,"65":0.01343,"69":0.0403,"73":0.01007,"76":0.00336,"79":0.09067,"81":0.03022,"83":0.00672,"84":0.00336,"87":0.04365,"88":0.00336,"90":0.00336,"91":0.00672,"93":0.01679,"94":0.01343,"97":0.06716,"98":0.01007,"99":0.00336,"100":0.00336,"103":0.04701,"104":0.00336,"105":0.02015,"108":0.01679,"109":0.18469,"110":0.00336,"111":0.01007,"112":0.00336,"113":0.00336,"114":0.00672,"116":0.03358,"117":0.30558,"118":0.00336,"119":0.02351,"120":0.01007,"121":0.00336,"122":0.05709,"123":0.01343,"124":0.01343,"125":0.27871,"126":0.0403,"127":0.00672,"128":0.24178,"129":0.01343,"130":0.04701,"131":0.14439,"132":0.3358,"133":5.25863,"134":10.93365,"135":0.0638,"136":0.01679,_:"4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 61 62 64 66 67 68 70 71 72 74 75 77 78 80 85 86 89 92 95 96 101 102 106 107 115 137 138"},F:{"87":0.05037,"88":0.02686,"95":0.00672,"113":0.00672,"114":0.00336,"116":0.15783,"117":0.83614,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 89 90 91 92 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 115 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6","12.1":0.00336},B:{"15":0.00336,"16":0.00336,"18":0.00672,"84":0.00336,"92":0.18133,"100":0.00336,"109":0.00672,"114":0.00336,"118":0.01007,"120":0.00336,"122":0.00672,"124":0.00336,"126":0.00336,"127":0.01007,"129":0.00336,"130":0.01679,"131":0.05037,"132":0.10074,"133":1.73273,"134":4.43592,_:"12 13 14 17 79 80 81 83 85 86 87 88 89 90 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 111 112 113 115 116 117 119 121 123 125 128"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.1 16.0 16.1 16.2 17.0","13.1":0.00336,"14.1":0.00336,"15.2-15.3":0.00336,"15.4":0.00336,"15.5":0.00336,"15.6":0.07052,"16.3":0.00336,"16.4":0.00672,"16.5":0.01679,"16.6":0.03694,"17.1":0.03022,"17.2":0.00672,"17.3":0.01007,"17.4":0.00336,"17.5":0.02015,"17.6":0.34587,"18.0":0.02015,"18.1":0.08059,"18.2":0.01007,"18.3":1.61184,"18.4":0.00336},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00182,"5.0-5.1":0,"6.0-6.1":0.00546,"7.0-7.1":0.00364,"8.1-8.4":0,"9.0-9.2":0.00273,"9.3":0.01274,"10.0-10.2":0.00091,"10.3":0.02093,"11.0-11.2":0.09646,"11.3-11.4":0.00637,"12.0-12.1":0.00364,"12.2-12.5":0.09009,"13.0-13.1":0.00182,"13.2":0.00273,"13.3":0.00364,"13.4-13.7":0.01274,"14.0-14.4":0.03185,"14.5-14.8":0.03822,"15.0-15.1":0.02093,"15.2-15.3":0.02093,"15.4":0.02548,"15.5":0.02912,"15.6-15.8":0.35852,"16.0":0.05096,"16.1":0.10464,"16.2":0.0546,"16.3":0.09464,"16.4":0.02093,"16.5":0.03913,"16.6-16.7":0.42495,"17.0":0.02548,"17.1":0.0455,"17.2":0.03458,"17.3":0.04823,"17.4":0.09646,"17.5":0.21475,"17.6-17.7":0.62332,"18.0":0.17471,"18.1":0.57145,"18.2":0.2557,"18.3":5.34416,"18.4":0.07917},P:{"4":0.07461,"20":0.04263,"21":0.02132,"22":0.07461,"23":0.04263,"24":0.30908,"25":0.13856,"26":0.14921,"27":3.0269,_:"5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 15.0 16.0 17.0 18.0","7.2-7.4":0.11724,"13.0":0.03197,"14.0":0.05329,"19.0":0.03197},I:{"0":0.00663,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.00001},K:{"0":0.2524,_:"10 11 12 11.1 11.5 12.1"},A:{"10":0.01007,"11":0.02015,_:"6 7 8 9 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.05978},Q:{"14.9":0.04649},O:{"0":0.37195},H:{"0":0},L:{"0":55.6655}};

View File

@@ -0,0 +1,80 @@
const SemVer = require('../classes/semver')
const Comparator = require('../classes/comparator')
const { ANY } = Comparator
const Range = require('../classes/range')
const satisfies = require('../functions/satisfies')
const gt = require('../functions/gt')
const lt = require('../functions/lt')
const lte = require('../functions/lte')
const gte = require('../functions/gte')
const outside = (version, range, hilo, options) => {
version = new SemVer(version, options)
range = new Range(range, options)
let gtfn, ltefn, ltfn, comp, ecomp
switch (hilo) {
case '>':
gtfn = gt
ltefn = lte
ltfn = lt
comp = '>'
ecomp = '>='
break
case '<':
gtfn = lt
ltefn = gte
ltfn = gt
comp = '<'
ecomp = '<='
break
default:
throw new TypeError('Must provide a hilo val of "<" or ">"')
}
// If it satisfies the range it is not outside
if (satisfies(version, range, options)) {
return false
}
// From now on, variable terms are as if we're in "gtr" mode.
// but note that everything is flipped for the "ltr" function.
for (let i = 0; i < range.set.length; ++i) {
const comparators = range.set[i]
let high = null
let low = null
comparators.forEach((comparator) => {
if (comparator.semver === ANY) {
comparator = new Comparator('>=0.0.0')
}
high = high || comparator
low = low || comparator
if (gtfn(comparator.semver, high.semver, options)) {
high = comparator
} else if (ltfn(comparator.semver, low.semver, options)) {
low = comparator
}
})
// If the edge version comparator has a operator then our version
// isn't outside it
if (high.operator === comp || high.operator === ecomp) {
return false
}
// If the lowest version comparator has an operator and our version
// is less than it then it isn't higher than the range
if ((!low.operator || low.operator === comp) &&
ltefn(version, low.semver)) {
return false
} else if (low.operator === ecomp && ltfn(version, low.semver)) {
return false
}
}
return true
}
module.exports = outside

View File

@@ -0,0 +1,206 @@
export type PageViewport = import("../src/display/display_utils").PageViewport;
export type OptionalContentConfig = import("../src/display/optional_content_config").OptionalContentConfig;
export type EventBus = import("./event_utils").EventBus;
export type IL10n = import("./interfaces").IL10n;
export type IRenderableView = import("./interfaces").IRenderableView;
export type PDFRenderingQueue = import("./pdf_rendering_queue").PDFRenderingQueue;
export type PDFPageViewOptions = {
/**
* - The viewer element.
*/
container?: HTMLDivElement | undefined;
/**
* - The application event bus.
*/
eventBus: EventBus;
/**
* - The page unique ID (normally its number).
*/
id: number;
/**
* - The page scale display.
*/
scale?: number | undefined;
/**
* - The page viewport.
*/
defaultViewport: PageViewport;
/**
* -
* A promise that is resolved with an {@link OptionalContentConfig} instance.
* The default value is `null`.
*/
optionalContentConfigPromise?: Promise<import("../src/display/optional_content_config").OptionalContentConfig> | undefined;
/**
* - The rendering queue object.
*/
renderingQueue?: import("./pdf_rendering_queue").PDFRenderingQueue | undefined;
/**
* - Controls if the text layer used for
* selection and searching is created. The constants from {TextLayerMode}
* should be used. The default value is `TextLayerMode.ENABLE`.
*/
textLayerMode?: number | undefined;
/**
* - Controls if the annotation layer is
* created, and if interactive form elements or `AnnotationStorage`-data are
* being rendered. The constants from {@link AnnotationMode} should be used;
* see also {@link RenderParameters} and {@link GetOperatorListParameters}.
* The default value is `AnnotationMode.ENABLE_FORMS`.
*/
annotationMode?: number | undefined;
/**
* - Path for image resources, mainly
* for annotation icons. Include trailing slash.
*/
imageResourcesPath?: string | undefined;
/**
* - The maximum supported canvas size in
* total pixels, i.e. width * height. Use `-1` for no limit, or `0` for
* CSS-only zooming. The default value is 4096 * 8192 (32 mega-pixels).
*/
maxCanvasPixels?: number | undefined;
/**
* - Overwrites background and foreground colors
* with user defined ones in order to improve readability in high contrast
* mode.
*/
pageColors?: Object | undefined;
/**
* - Localization service.
*/
l10n?: import("./interfaces").IL10n | undefined;
/**
* - The object that is used to lookup
* the necessary layer-properties.
*/
layerProperties?: Object | undefined;
/**
* - Enables hardware acceleration for
* rendering. The default value is `false`.
*/
enableHWA?: boolean | undefined;
};
/**
* @implements {IRenderableView}
*/
export class PDFPageView implements IRenderableView {
/**
* @param {PDFPageViewOptions} options
*/
constructor(options: PDFPageViewOptions);
id: number;
renderingId: string;
pdfPage: any;
pageLabel: string | null;
rotation: number;
scale: number;
viewport: import("../src/display/display_utils").PageViewport;
pdfPageRotate: number;
_optionalContentConfigPromise: Promise<import("../src/display/optional_content_config").OptionalContentConfig> | null;
imageResourcesPath: string;
maxCanvasPixels: any;
pageColors: Object | null;
eventBus: import("./event_utils").EventBus;
renderingQueue: import("./pdf_rendering_queue").PDFRenderingQueue | undefined;
l10n: import("./interfaces").IL10n | GenericL10n | undefined;
renderTask: any;
resume: (() => void) | null;
_isStandalone: boolean | undefined;
_container: HTMLDivElement | undefined;
_annotationCanvasMap: any;
annotationLayer: AnnotationLayerBuilder | null;
annotationEditorLayer: any;
textLayer: TextLayerBuilder | null;
zoomLayer: ParentNode | null;
xfaLayer: XfaLayerBuilder | null;
structTreeLayer: any;
drawLayer: any;
div: HTMLDivElement;
set renderingState(state: number);
get renderingState(): number;
setPdfPage(pdfPage: any): void;
destroy(): void;
hasEditableAnnotations(): boolean;
get _textHighlighter(): any;
/**
* @private
*/
private _resetZoomLayer;
reset({ keepZoomLayer, keepAnnotationLayer, keepAnnotationEditorLayer, keepXfaLayer, keepTextLayer, }?: {
keepZoomLayer?: boolean | undefined;
keepAnnotationLayer?: boolean | undefined;
keepAnnotationEditorLayer?: boolean | undefined;
keepXfaLayer?: boolean | undefined;
keepTextLayer?: boolean | undefined;
}): void;
toggleEditingMode(isEditing: any): void;
/**
* @typedef {Object} PDFPageViewUpdateParameters
* @property {number} [scale] The new scale, if specified.
* @property {number} [rotation] The new rotation, if specified.
* @property {Promise<OptionalContentConfig>} [optionalContentConfigPromise]
* A promise that is resolved with an {@link OptionalContentConfig}
* instance. The default value is `null`.
* @property {number} [drawingDelay]
*/
/**
* Update e.g. the scale and/or rotation of the page.
* @param {PDFPageViewUpdateParameters} params
*/
update({ scale, rotation, optionalContentConfigPromise, drawingDelay, }: {
/**
* The new scale, if specified.
*/
scale?: number | undefined;
/**
* The new rotation, if specified.
*/
rotation?: number | undefined;
/**
* A promise that is resolved with an {@link OptionalContentConfig}instance. The default value is `null`.
*/
optionalContentConfigPromise?: Promise<import("../src/display/optional_content_config").OptionalContentConfig> | undefined;
drawingDelay?: number | undefined;
}): void;
/**
* PLEASE NOTE: Most likely you want to use the `this.reset()` method,
* rather than calling this one directly.
*/
cancelRendering({ keepAnnotationLayer, keepAnnotationEditorLayer, keepXfaLayer, keepTextLayer, cancelExtraDelay, }?: {
keepAnnotationLayer?: boolean | undefined;
keepAnnotationEditorLayer?: boolean | undefined;
keepXfaLayer?: boolean | undefined;
keepTextLayer?: boolean | undefined;
cancelExtraDelay?: number | undefined;
}): void;
cssTransform({ target, redrawAnnotationLayer, redrawAnnotationEditorLayer, redrawXfaLayer, redrawTextLayer, hideTextLayer, }: {
target: any;
redrawAnnotationLayer?: boolean | undefined;
redrawAnnotationEditorLayer?: boolean | undefined;
redrawXfaLayer?: boolean | undefined;
redrawTextLayer?: boolean | undefined;
hideTextLayer?: boolean | undefined;
}): void;
get width(): number;
get height(): number;
getPagePoint(x: any, y: any): any[];
draw(): Promise<any>;
canvas: HTMLCanvasElement | undefined;
outputScale: OutputScale | undefined;
/**
* @param {string|null} label
*/
setPageLabel(label: string | null): void;
/**
* For use by the `PDFThumbnailView.setImage`-method.
* @ignore
*/
get thumbnailCanvas(): HTMLCanvasElement | null | undefined;
#private;
}
import { GenericL10n } from "./genericl10n";
import { AnnotationLayerBuilder } from "./annotation_layer_builder.js";
import { TextLayerBuilder } from "./text_layer_builder.js";
import { XfaLayerBuilder } from "./xfa_layer_builder.js";
import { OutputScale } from "../src/pdf";

View File

@@ -0,0 +1,150 @@
/**
* @fileoverview Rule to disallow whitespace before properties
* @author Kai Cataldo
* @deprecated in ESLint v8.53.0
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "8.53.0",
availableUntil: "10.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin-js",
url: "https://eslint.style/packages/js",
},
rule: {
name: "no-whitespace-before-property",
url: "https://eslint.style/rules/js/no-whitespace-before-property",
},
},
],
},
type: "layout",
docs: {
description: "Disallow whitespace before properties",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-whitespace-before-property",
},
fixable: "whitespace",
schema: [],
messages: {
unexpectedWhitespace:
"Unexpected whitespace before property {{propName}}.",
},
},
create(context) {
const sourceCode = context.sourceCode;
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
/**
* Reports whitespace before property token
* @param {ASTNode} node the node to report in the event of an error
* @param {Token} leftToken the left token
* @param {Token} rightToken the right token
* @returns {void}
* @private
*/
function reportError(node, leftToken, rightToken) {
context.report({
node,
messageId: "unexpectedWhitespace",
data: {
propName: sourceCode.getText(node.property),
},
fix(fixer) {
let replacementText = "";
if (
!node.computed &&
!node.optional &&
astUtils.isDecimalInteger(node.object)
) {
/*
* If the object is a number literal, fixing it to something like 5.toString() would cause a SyntaxError.
* Don't fix this case.
*/
return null;
}
// Don't fix if comments exist.
if (
sourceCode.commentsExistBetween(leftToken, rightToken)
) {
return null;
}
if (node.optional) {
replacementText = "?.";
} else if (!node.computed) {
replacementText = ".";
}
return fixer.replaceTextRange(
[leftToken.range[1], rightToken.range[0]],
replacementText,
);
},
});
}
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
return {
MemberExpression(node) {
let rightToken;
let leftToken;
if (!astUtils.isTokenOnSameLine(node.object, node.property)) {
return;
}
if (node.computed) {
rightToken = sourceCode.getTokenBefore(
node.property,
astUtils.isOpeningBracketToken,
);
leftToken = sourceCode.getTokenBefore(
rightToken,
node.optional ? 1 : 0,
);
} else {
rightToken = sourceCode.getFirstToken(node.property);
leftToken = sourceCode.getTokenBefore(rightToken, 1);
}
if (sourceCode.isSpaceBetweenTokens(leftToken, rightToken)) {
reportError(node, leftToken, rightToken);
}
},
};
},
};

View File

@@ -0,0 +1,8 @@
<svg width="29" height="32" viewBox="0 0 29 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M28 16.75C28.2761 16.75 28.5 16.5261 28.5 16.25V15C28.5 14.7239 28.2761 14.5 28 14.5H26.358C25.9117 14.5 25.4773 14.6257 25.0999 14.8604L25.0989 14.8611L24 15.5484L22.9 14.861L22.8991 14.8604C22.5218 14.6257 22.0875 14.5 21.642 14.5H20C19.7239 14.5 19.5 14.7239 19.5 15V16.25C19.5 16.5261 19.7239 16.75 20 16.75H21.642C21.6648 16.75 21.6885 16.7564 21.7101 16.7697C21.7102 16.7698 21.7104 16.7699 21.7105 16.77L22.817 17.461C22.817 17.461 22.8171 17.4611 22.8171 17.4611C22.8171 17.4611 22.8171 17.4611 22.8171 17.4611C22.8552 17.4849 22.876 17.5229 22.876 17.567V22.625V27.683C22.876 27.7271 22.8552 27.765 22.8172 27.7889C22.8171 27.7889 22.8171 27.789 22.817 27.789L21.7095 28.48C21.7094 28.4801 21.7093 28.4802 21.7092 28.4803C21.6872 28.4938 21.6644 28.5 21.641 28.5H20C19.7239 28.5 19.5 28.7239 19.5 29V30.25C19.5 30.5261 19.7239 30.75 20 30.75H21.642C22.0883 30.75 22.5227 30.6243 22.9001 30.3896L22.9009 30.3891L24 29.7026L25.1 30.39L25.1009 30.3906C25.4783 30.6253 25.9127 30.751 26.359 30.751H28C28.2761 30.751 28.5 30.5271 28.5 30.251V29.001C28.5 28.7249 28.2761 28.501 28 28.501H26.358C26.3352 28.501 26.3115 28.4946 26.2899 28.4813C26.2897 28.4812 26.2896 28.4811 26.2895 28.481L25.183 27.79C25.183 27.79 25.183 27.79 25.1829 27.79C25.1829 27.7899 25.1829 27.7899 25.1829 27.7899C25.1462 27.7669 25.125 27.7297 25.125 27.684V22.625V17.567C25.125 17.5227 25.146 17.4844 25.1836 17.4606C25.1838 17.4605 25.1839 17.4604 25.184 17.4603L26.2895 16.77C26.2896 16.7699 26.2898 16.7698 26.2899 16.7697C26.3119 16.7562 26.3346 16.75 26.358 16.75H28Z" fill="black" stroke="#FBFBFE" stroke-linejoin="round"/>
<path d="M24.625 17.567C24.625 17.35 24.735 17.152 24.918 17.037L26.026 16.345C26.126 16.283 26.24 16.25 26.358 16.25H28V15H26.358C26.006 15 25.663 15.099 25.364 15.285L24.256 15.978C24.161 16.037 24.081 16.113 24 16.187C23.918 16.113 23.839 16.037 23.744 15.978L22.635 15.285C22.336 15.099 21.993 15 21.642 15H20V16.25H21.642C21.759 16.25 21.874 16.283 21.974 16.345L23.082 17.037C23.266 17.152 23.376 17.35 23.376 17.567V22.625V27.683C23.376 27.9 23.266 28.098 23.082 28.213L21.973 28.905C21.873 28.967 21.759 29 21.641 29H20V30.25H21.642C21.994 30.25 22.337 30.151 22.636 29.965L23.744 29.273C23.84 29.213 23.919 29.137 24 29.064C24.081 29.137 24.161 29.213 24.256 29.273L25.365 29.966C25.664 30.152 26.007 30.251 26.359 30.251H28V29.001H26.358C26.241 29.001 26.126 28.968 26.026 28.906L24.918 28.214C24.734 28.099 24.625 27.901 24.625 27.684V22.625V17.567Z" fill="black"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.2 2.59C12.28 2.51 12.43 2.5 12.43 2.5C12.48 2.5 12.58 2.52 12.66 2.6L14.45 4.39C14.58 4.52 14.58 4.72 14.45 4.85L11.7713 7.52872L9.51628 5.27372L12.2 2.59ZM13.2658 4.62L11.7713 6.1145L10.9305 5.27372L12.425 3.77921L13.2658 4.62Z" fill="#FBFBFE"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.98 8.82L8.23 11.07L10.7106 8.58938L8.45562 6.33438L5.98 8.81V8.82ZM8.23 9.65579L9.29641 8.58938L8.45562 7.74859L7.38921 8.815L8.23 9.65579Z" fill="#FBFBFE"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.1526 12.6816L16.2125 6.6217C16.7576 6.08919 17.05 5.3707 17.05 4.62C17.05 3.86931 16.7576 3.15084 16.2126 2.61834L14.4317 0.837474C13.8992 0.29242 13.1807 0 12.43 0C11.6643 0 10.9529 0.312929 10.4329 0.832893L3.68289 7.58289C3.04127 8.22452 3.00459 9.25075 3.57288 9.93634L1.29187 12.2239C1.09186 12.4245 0.990263 12.6957 1.0007 12.9685L1 14C0.447715 14 0 14.4477 0 15V17C0 17.5523 0.447715 18 1 18H16C16.5523 18 17 17.5523 17 17V15C17 14.4477 16.5523 14 16 14H10.2325C9.83594 14 9.39953 13.4347 10.1526 12.6816ZM4.39 9.35L4.9807 9.9407L2.39762 12.5312H6.63877L7.10501 12.065L7.57125 12.5312H8.88875L15.51 5.91C15.86 5.57 16.05 5.11 16.05 4.62C16.05 4.13 15.86 3.67 15.51 3.33L13.72 1.54C13.38 1.19 12.92 1 12.43 1C11.94 1 11.48 1.2 11.14 1.54L4.39 8.29C4.1 8.58 4.1 9.06 4.39 9.35ZM16 17V15H1V17H16Z" fill="#FBFBFE"/>
<path d="M15.1616 5.55136L15.1616 5.55132L15.1564 5.55645L8.40645 12.3064C8.35915 12.3537 8.29589 12.38 8.23 12.38C8.16411 12.38 8.10085 12.3537 8.05355 12.3064L7.45857 11.7115L7.10501 11.3579L6.75146 11.7115L6.03289 12.43H3.20465L5.33477 10.2937L5.6873 9.94019L5.33426 9.58715L4.74355 8.99645C4.64882 8.90171 4.64882 8.73829 4.74355 8.64355L11.4936 1.89355C11.7436 1.64354 12.0779 1.5 12.43 1.5C12.7883 1.5 13.1179 1.63776 13.3614 1.88839L13.3613 1.88843L13.3664 1.89355L15.1564 3.68355L15.1564 3.68359L15.1616 3.68864C15.4122 3.93211 15.55 4.26166 15.55 4.62C15.55 4.97834 15.4122 5.30789 15.1616 5.55136ZM5.48 8.82V9.02711L5.62645 9.17355L7.87645 11.4236L8.23 11.7771L8.58355 11.4236L11.0642 8.94293L11.4177 8.58938L11.0642 8.23582L8.80918 5.98082L8.45562 5.62727L8.10207 5.98082L5.62645 8.45645L5.48 8.60289V8.81V8.82ZM11.4177 7.88227L11.7713 8.23582L12.1248 7.88227L14.8036 5.20355C15.1288 4.87829 15.1288 4.36171 14.8036 4.03645L13.0136 2.24645C12.8186 2.05146 12.5792 2 12.43 2H12.4134L12.3967 2.00111L12.43 2.5C12.3967 2.00111 12.3966 2.00112 12.3965 2.00112L12.3963 2.00114L12.3957 2.00117L12.3947 2.00125L12.3924 2.00142L12.387 2.00184L12.3732 2.00311C12.3628 2.00416 12.3498 2.00567 12.3346 2.00784C12.3049 2.01208 12.2642 2.01925 12.2178 2.03146C12.1396 2.05202 11.9797 2.10317 11.8464 2.23645L9.16273 4.92016L8.80918 5.27372L9.16273 5.62727L11.4177 7.88227ZM1.5 16.5V15.5H15.5V16.5H1.5Z" stroke="#15141A"/>
</svg>

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createUnionType = createUnionType;
var _t = require("@babel/types");
const {
createFlowUnionType,
createTSUnionType,
createUnionTypeAnnotation,
isFlowType,
isTSType
} = _t;
function createUnionType(types) {
{
if (types.every(v => isFlowType(v))) {
if (createFlowUnionType) {
return createFlowUnionType(types);
}
return createUnionTypeAnnotation(types);
} else if (types.every(v => isTSType(v))) {
if (createTSUnionType) {
return createTSUnionType(types);
}
}
}
}
//# sourceMappingURL=util.js.map

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"0 9 O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I","2":"C L M G N"},C:{"2":"1 2 3 4 5 6 7 8 nC LC J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qC rC","4609":"xB yB zB 0B 1B 2B 3B 4B 5B","4674":"NC","5698":"wB","7490":"qB rB sB tB uB","7746":"vB MC","8705":"0 9 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC"},D:{"1":"0 9 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC","2":"1 2 3 4 5 6 7 8 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB","4097":"1B","4290":"MC wB NC","6148":"xB yB zB 0B"},E:{"1":"G zC UC VC HC 0C IC WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C","2":"J PB K D E F A sC SC tC uC vC wC TC","4609":"B C FC GC","8193":"L M xC yC"},F:{"1":"0 rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 4 5 6 7 8 F B C G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB 4C 5C 6C 7C FC kC 8C GC","4097":"qB","6148":"mB nB oB pB"},G:{"1":"MD ND OD PD QD RD SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC","2":"E SC 9C lC AD BD CD DD ED FD GD HD","4097":"ID JD KD LD"},H:{"2":"WD"},I:{"1":"I","2":"LC J XD YD ZD aD lC bD cD"},J:{"2":"D A"},K:{"1":"H","2":"A B C FC kC GC"},L:{"1":"I"},M:{"4097":"EC"},N:{"2":"A B"},O:{"1":"HC"},P:{"2":"J dD eD fD","4097":"1 2 3 4 5 6 7 8 gD hD TC iD jD kD lD mD IC JC KC nD"},Q:{"1":"oD"},R:{"1":"pD"},S:{"1":"rD","2":"qD"}},B:5,C:"Variable fonts",D:true};

View File

@@ -0,0 +1,94 @@
var once = require('once');
var noop = function() {};
var isRequest = function(stream) {
return stream.setHeader && typeof stream.abort === 'function';
};
var isChildProcess = function(stream) {
return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
};
var eos = function(stream, opts, callback) {
if (typeof opts === 'function') return eos(stream, null, opts);
if (!opts) opts = {};
callback = once(callback || noop);
var ws = stream._writableState;
var rs = stream._readableState;
var readable = opts.readable || (opts.readable !== false && stream.readable);
var writable = opts.writable || (opts.writable !== false && stream.writable);
var cancelled = false;
var onlegacyfinish = function() {
if (!stream.writable) onfinish();
};
var onfinish = function() {
writable = false;
if (!readable) callback.call(stream);
};
var onend = function() {
readable = false;
if (!writable) callback.call(stream);
};
var onexit = function(exitCode) {
callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
};
var onerror = function(err) {
callback.call(stream, err);
};
var onclose = function() {
process.nextTick(onclosenexttick);
};
var onclosenexttick = function() {
if (cancelled) return;
if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
};
var onrequest = function() {
stream.req.on('finish', onfinish);
};
if (isRequest(stream)) {
stream.on('complete', onfinish);
stream.on('abort', onclose);
if (stream.req) onrequest();
else stream.on('request', onrequest);
} else if (writable && !ws) { // legacy streams
stream.on('end', onlegacyfinish);
stream.on('close', onlegacyfinish);
}
if (isChildProcess(stream)) stream.on('exit', onexit);
stream.on('end', onend);
stream.on('finish', onfinish);
if (opts.error !== false) stream.on('error', onerror);
stream.on('close', onclose);
return function() {
cancelled = true;
stream.removeListener('complete', onfinish);
stream.removeListener('abort', onclose);
stream.removeListener('request', onrequest);
if (stream.req) stream.req.removeListener('finish', onfinish);
stream.removeListener('end', onlegacyfinish);
stream.removeListener('close', onlegacyfinish);
stream.removeListener('finish', onfinish);
stream.removeListener('exit', onexit);
stream.removeListener('end', onend);
stream.removeListener('error', onerror);
stream.removeListener('close', onclose);
};
};
module.exports = eos;