update
This commit is contained in:
@@ -0,0 +1,116 @@
|
||||
// Copyright (c) 2010 LearnBoost <tj@learnboost.com>
|
||||
|
||||
#include <cstdio>
|
||||
#include <pango/pango.h>
|
||||
|
||||
#include <cairo.h>
|
||||
#if CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 10, 0)
|
||||
// CAIRO_FORMAT_RGB16_565: undeprecated in v1.10.0
|
||||
// CAIRO_STATUS_INVALID_SIZE: v1.10.0
|
||||
// CAIRO_FORMAT_INVALID: v1.10.0
|
||||
// Lots of the compositing operators: v1.10.0
|
||||
// JPEG MIME tracking: v1.10.0
|
||||
// Note: CAIRO_FORMAT_RGB30 is v1.12.0 and still optional
|
||||
#error("cairo v1.10.0 or later is required")
|
||||
#endif
|
||||
|
||||
#include "Backends.h"
|
||||
#include "Canvas.h"
|
||||
#include "CanvasGradient.h"
|
||||
#include "CanvasPattern.h"
|
||||
#include "CanvasRenderingContext2d.h"
|
||||
#include "Image.h"
|
||||
#include "ImageData.h"
|
||||
#include "InstanceData.h"
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
/*
|
||||
* Save some external modules as private references.
|
||||
*/
|
||||
|
||||
static void
|
||||
setDOMMatrix(const Napi::CallbackInfo& info) {
|
||||
InstanceData* data = info.Env().GetInstanceData<InstanceData>();
|
||||
data->DOMMatrixCtor = Napi::Persistent(info[0].As<Napi::Function>());
|
||||
}
|
||||
|
||||
static void
|
||||
setParseFont(const Napi::CallbackInfo& info) {
|
||||
InstanceData* data = info.Env().GetInstanceData<InstanceData>();
|
||||
data->parseFont = Napi::Persistent(info[0].As<Napi::Function>());
|
||||
}
|
||||
|
||||
// Compatibility with Visual Studio versions prior to VS2015
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1900
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
Napi::Object init(Napi::Env env, Napi::Object exports) {
|
||||
env.SetInstanceData(new InstanceData());
|
||||
|
||||
Backends::Initialize(env, exports);
|
||||
Canvas::Initialize(env, exports);
|
||||
Image::Initialize(env, exports);
|
||||
ImageData::Initialize(env, exports);
|
||||
Context2d::Initialize(env, exports);
|
||||
Gradient::Initialize(env, exports);
|
||||
Pattern::Initialize(env, exports);
|
||||
|
||||
exports.Set("setDOMMatrix", Napi::Function::New(env, &setDOMMatrix));
|
||||
exports.Set("setParseFont", Napi::Function::New(env, &setParseFont));
|
||||
|
||||
exports.Set("cairoVersion", Napi::String::New(env, cairo_version_string()));
|
||||
#ifdef HAVE_JPEG
|
||||
|
||||
#ifndef JPEG_LIB_VERSION_MAJOR
|
||||
#ifdef JPEG_LIB_VERSION
|
||||
#define JPEG_LIB_VERSION_MAJOR (JPEG_LIB_VERSION / 10)
|
||||
#else
|
||||
#define JPEG_LIB_VERSION_MAJOR 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef JPEG_LIB_VERSION_MINOR
|
||||
#ifdef JPEG_LIB_VERSION
|
||||
#define JPEG_LIB_VERSION_MINOR (JPEG_LIB_VERSION % 10)
|
||||
#else
|
||||
#define JPEG_LIB_VERSION_MINOR 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
char jpeg_version[10];
|
||||
static bool minor_gt_0 = JPEG_LIB_VERSION_MINOR > 0;
|
||||
if (minor_gt_0) {
|
||||
snprintf(jpeg_version, 10, "%d%c", JPEG_LIB_VERSION_MAJOR, JPEG_LIB_VERSION_MINOR + 'a' - 1);
|
||||
} else {
|
||||
snprintf(jpeg_version, 10, "%d", JPEG_LIB_VERSION_MAJOR);
|
||||
}
|
||||
exports.Set("jpegVersion", Napi::String::New(env, jpeg_version));
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GIF
|
||||
#ifndef GIF_LIB_VERSION
|
||||
char gif_version[10];
|
||||
snprintf(gif_version, 10, "%d.%d.%d", GIFLIB_MAJOR, GIFLIB_MINOR, GIFLIB_RELEASE);
|
||||
exports.Set("gifVersion", Napi::String::New(env, gif_version));
|
||||
#else
|
||||
exports.Set("gifVersion", Napi::String::New(env, GIF_LIB_VERSION));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_RSVG
|
||||
exports.Set("rsvgVersion", Napi::String::New(env, LIBRSVG_VERSION));
|
||||
#endif
|
||||
|
||||
exports.Set("pangoVersion", Napi::String::New(env, PANGO_VERSION_STRING));
|
||||
|
||||
char freetype_version[10];
|
||||
snprintf(freetype_version, 10, "%d.%d.%d", FREETYPE_MAJOR, FREETYPE_MINOR, FREETYPE_PATCH);
|
||||
exports.Set("freetypeVersion", Napi::String::New(env, freetype_version));
|
||||
|
||||
return exports;
|
||||
}
|
||||
|
||||
NODE_API_MODULE(canvas, init);
|
||||
@@ -0,0 +1,842 @@
|
||||
/**
|
||||
* @license React
|
||||
* react-refresh-babel.development.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
function ReactFreshBabelPlugin (babel) {
|
||||
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
|
||||
if (typeof babel.env === 'function') {
|
||||
// Only available in Babel 7.
|
||||
var env = babel.env();
|
||||
|
||||
if (env !== 'development' && !opts.skipEnvCheck) {
|
||||
throw new Error('React Refresh Babel transform should only be enabled in development environment. ' + 'Instead, the environment is: "' + env + '". If you want to override this check, pass {skipEnvCheck: true} as plugin options.');
|
||||
}
|
||||
}
|
||||
|
||||
var t = babel.types;
|
||||
var refreshReg = t.identifier(opts.refreshReg || '$RefreshReg$');
|
||||
var refreshSig = t.identifier(opts.refreshSig || '$RefreshSig$');
|
||||
var registrationsByProgramPath = new Map();
|
||||
|
||||
function createRegistration(programPath, persistentID) {
|
||||
var handle = programPath.scope.generateUidIdentifier('c');
|
||||
|
||||
if (!registrationsByProgramPath.has(programPath)) {
|
||||
registrationsByProgramPath.set(programPath, []);
|
||||
}
|
||||
|
||||
var registrations = registrationsByProgramPath.get(programPath);
|
||||
registrations.push({
|
||||
handle: handle,
|
||||
persistentID: persistentID
|
||||
});
|
||||
return handle;
|
||||
}
|
||||
|
||||
function isComponentishName(name) {
|
||||
return typeof name === 'string' && name[0] >= 'A' && name[0] <= 'Z';
|
||||
}
|
||||
|
||||
function findInnerComponents(inferredName, path, callback) {
|
||||
var node = path.node;
|
||||
|
||||
switch (node.type) {
|
||||
case 'Identifier':
|
||||
{
|
||||
if (!isComponentishName(node.name)) {
|
||||
return false;
|
||||
} // export default hoc(Foo)
|
||||
// const X = hoc(Foo)
|
||||
|
||||
|
||||
callback(inferredName, node, null);
|
||||
return true;
|
||||
}
|
||||
|
||||
case 'FunctionDeclaration':
|
||||
{
|
||||
// function Foo() {}
|
||||
// export function Foo() {}
|
||||
// export default function Foo() {}
|
||||
callback(inferredName, node.id, null);
|
||||
return true;
|
||||
}
|
||||
|
||||
case 'ArrowFunctionExpression':
|
||||
{
|
||||
if (node.body.type === 'ArrowFunctionExpression') {
|
||||
return false;
|
||||
} // let Foo = () => {}
|
||||
// export default hoc1(hoc2(() => {}))
|
||||
|
||||
|
||||
callback(inferredName, node, path);
|
||||
return true;
|
||||
}
|
||||
|
||||
case 'FunctionExpression':
|
||||
{
|
||||
// let Foo = function() {}
|
||||
// const Foo = hoc1(forwardRef(function renderFoo() {}))
|
||||
// export default memo(function() {})
|
||||
callback(inferredName, node, path);
|
||||
return true;
|
||||
}
|
||||
|
||||
case 'CallExpression':
|
||||
{
|
||||
var argsPath = path.get('arguments');
|
||||
|
||||
if (argsPath === undefined || argsPath.length === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var calleePath = path.get('callee');
|
||||
|
||||
switch (calleePath.node.type) {
|
||||
case 'MemberExpression':
|
||||
case 'Identifier':
|
||||
{
|
||||
var calleeSource = calleePath.getSource();
|
||||
var firstArgPath = argsPath[0];
|
||||
var innerName = inferredName + '$' + calleeSource;
|
||||
var foundInside = findInnerComponents(innerName, firstArgPath, callback);
|
||||
|
||||
if (!foundInside) {
|
||||
return false;
|
||||
} // const Foo = hoc1(hoc2(() => {}))
|
||||
// export default memo(React.forwardRef(function() {}))
|
||||
|
||||
|
||||
callback(inferredName, node, path);
|
||||
return true;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
case 'VariableDeclarator':
|
||||
{
|
||||
var init = node.init;
|
||||
|
||||
if (init === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var name = node.id.name;
|
||||
|
||||
if (!isComponentishName(name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (init.type) {
|
||||
case 'ArrowFunctionExpression':
|
||||
case 'FunctionExpression':
|
||||
// Likely component definitions.
|
||||
break;
|
||||
|
||||
case 'CallExpression':
|
||||
{
|
||||
// Maybe a HOC.
|
||||
// Try to determine if this is some form of import.
|
||||
var callee = init.callee;
|
||||
var calleeType = callee.type;
|
||||
|
||||
if (calleeType === 'Import') {
|
||||
return false;
|
||||
} else if (calleeType === 'Identifier') {
|
||||
if (callee.name.indexOf('require') === 0) {
|
||||
return false;
|
||||
} else if (callee.name.indexOf('import') === 0) {
|
||||
return false;
|
||||
} // Neither require nor import. Might be a HOC.
|
||||
// Pass through.
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 'TaggedTemplateExpression':
|
||||
// Maybe something like styled.div`...`
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
var initPath = path.get('init');
|
||||
|
||||
var _foundInside = findInnerComponents(inferredName, initPath, callback);
|
||||
|
||||
if (_foundInside) {
|
||||
return true;
|
||||
} // See if this identifier is used in JSX. Then it's a component.
|
||||
|
||||
|
||||
var binding = path.scope.getBinding(name);
|
||||
|
||||
if (binding === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
var isLikelyUsedAsType = false;
|
||||
var referencePaths = binding.referencePaths;
|
||||
|
||||
for (var i = 0; i < referencePaths.length; i++) {
|
||||
var ref = referencePaths[i];
|
||||
|
||||
if (ref.node && ref.node.type !== 'JSXIdentifier' && ref.node.type !== 'Identifier') {
|
||||
continue;
|
||||
}
|
||||
|
||||
var refParent = ref.parent;
|
||||
|
||||
if (refParent.type === 'JSXOpeningElement') {
|
||||
isLikelyUsedAsType = true;
|
||||
} else if (refParent.type === 'CallExpression') {
|
||||
var _callee = refParent.callee;
|
||||
var fnName = void 0;
|
||||
|
||||
switch (_callee.type) {
|
||||
case 'Identifier':
|
||||
fnName = _callee.name;
|
||||
break;
|
||||
|
||||
case 'MemberExpression':
|
||||
fnName = _callee.property.name;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (fnName) {
|
||||
case 'createElement':
|
||||
case 'jsx':
|
||||
case 'jsxDEV':
|
||||
case 'jsxs':
|
||||
isLikelyUsedAsType = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isLikelyUsedAsType) {
|
||||
// const X = ... + later <X />
|
||||
callback(inferredName, init, initPath);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function isBuiltinHook(hookName) {
|
||||
switch (hookName) {
|
||||
case 'useState':
|
||||
case 'React.useState':
|
||||
case 'useReducer':
|
||||
case 'React.useReducer':
|
||||
case 'useEffect':
|
||||
case 'React.useEffect':
|
||||
case 'useLayoutEffect':
|
||||
case 'React.useLayoutEffect':
|
||||
case 'useMemo':
|
||||
case 'React.useMemo':
|
||||
case 'useCallback':
|
||||
case 'React.useCallback':
|
||||
case 'useRef':
|
||||
case 'React.useRef':
|
||||
case 'useContext':
|
||||
case 'React.useContext':
|
||||
case 'useImperativeHandle':
|
||||
case 'React.useImperativeHandle':
|
||||
case 'useDebugValue':
|
||||
case 'React.useDebugValue':
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function getHookCallsSignature(functionNode) {
|
||||
var fnHookCalls = hookCalls.get(functionNode);
|
||||
|
||||
if (fnHookCalls === undefined) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
key: fnHookCalls.map(function (call) {
|
||||
return call.name + '{' + call.key + '}';
|
||||
}).join('\n'),
|
||||
customHooks: fnHookCalls.filter(function (call) {
|
||||
return !isBuiltinHook(call.name);
|
||||
}).map(function (call) {
|
||||
return t.cloneDeep(call.callee);
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
var hasForceResetCommentByFile = new WeakMap(); // We let user do /* @refresh reset */ to reset state in the whole file.
|
||||
|
||||
function hasForceResetComment(path) {
|
||||
var file = path.hub.file;
|
||||
var hasForceReset = hasForceResetCommentByFile.get(file);
|
||||
|
||||
if (hasForceReset !== undefined) {
|
||||
return hasForceReset;
|
||||
}
|
||||
|
||||
hasForceReset = false;
|
||||
var comments = file.ast.comments;
|
||||
|
||||
for (var i = 0; i < comments.length; i++) {
|
||||
var cmt = comments[i];
|
||||
|
||||
if (cmt.value.indexOf('@refresh reset') !== -1) {
|
||||
hasForceReset = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
hasForceResetCommentByFile.set(file, hasForceReset);
|
||||
return hasForceReset;
|
||||
}
|
||||
|
||||
function createArgumentsForSignature(node, signature, scope) {
|
||||
var key = signature.key,
|
||||
customHooks = signature.customHooks;
|
||||
var forceReset = hasForceResetComment(scope.path);
|
||||
var customHooksInScope = [];
|
||||
customHooks.forEach(function (callee) {
|
||||
// Check if a corresponding binding exists where we emit the signature.
|
||||
var bindingName;
|
||||
|
||||
switch (callee.type) {
|
||||
case 'MemberExpression':
|
||||
if (callee.object.type === 'Identifier') {
|
||||
bindingName = callee.object.name;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'Identifier':
|
||||
bindingName = callee.name;
|
||||
break;
|
||||
}
|
||||
|
||||
if (scope.hasBinding(bindingName)) {
|
||||
customHooksInScope.push(callee);
|
||||
} else {
|
||||
// We don't have anything to put in the array because Hook is out of scope.
|
||||
// Since it could potentially have been edited, remount the component.
|
||||
forceReset = true;
|
||||
}
|
||||
});
|
||||
var finalKey = key;
|
||||
|
||||
if (typeof require === 'function' && !opts.emitFullSignatures) {
|
||||
// Prefer to hash when we can (e.g. outside of ASTExplorer).
|
||||
// This makes it deterministically compact, even if there's
|
||||
// e.g. a useState initializer with some code inside.
|
||||
// We also need it for www that has transforms like cx()
|
||||
// that don't understand if something is part of a string.
|
||||
finalKey = require('crypto').createHash('sha1').update(key).digest('base64');
|
||||
}
|
||||
|
||||
var args = [node, t.stringLiteral(finalKey)];
|
||||
|
||||
if (forceReset || customHooksInScope.length > 0) {
|
||||
args.push(t.booleanLiteral(forceReset));
|
||||
}
|
||||
|
||||
if (customHooksInScope.length > 0) {
|
||||
args.push( // TODO: We could use an arrow here to be more compact.
|
||||
// However, don't do it until AMA can run them natively.
|
||||
t.functionExpression(null, [], t.blockStatement([t.returnStatement(t.arrayExpression(customHooksInScope))])));
|
||||
}
|
||||
|
||||
return args;
|
||||
}
|
||||
|
||||
function findHOCCallPathsAbove(path) {
|
||||
var calls = [];
|
||||
|
||||
while (true) {
|
||||
if (!path) {
|
||||
return calls;
|
||||
}
|
||||
|
||||
var parentPath = path.parentPath;
|
||||
|
||||
if (!parentPath) {
|
||||
return calls;
|
||||
}
|
||||
|
||||
if ( // hoc(_c = function() { })
|
||||
parentPath.node.type === 'AssignmentExpression' && path.node === parentPath.node.right) {
|
||||
// Ignore registrations.
|
||||
path = parentPath;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( // hoc1(hoc2(...))
|
||||
parentPath.node.type === 'CallExpression' && path.node !== parentPath.node.callee) {
|
||||
calls.push(parentPath);
|
||||
path = parentPath;
|
||||
continue;
|
||||
}
|
||||
|
||||
return calls; // Stop at other types.
|
||||
}
|
||||
}
|
||||
|
||||
var seenForRegistration = new WeakSet();
|
||||
var seenForSignature = new WeakSet();
|
||||
var seenForOutro = new WeakSet();
|
||||
var hookCalls = new WeakMap();
|
||||
var HookCallsVisitor = {
|
||||
CallExpression: function (path) {
|
||||
var node = path.node;
|
||||
var callee = node.callee; // Note: this visitor MUST NOT mutate the tree in any way.
|
||||
// It runs early in a separate traversal and should be very fast.
|
||||
|
||||
var name = null;
|
||||
|
||||
switch (callee.type) {
|
||||
case 'Identifier':
|
||||
name = callee.name;
|
||||
break;
|
||||
|
||||
case 'MemberExpression':
|
||||
name = callee.property.name;
|
||||
break;
|
||||
}
|
||||
|
||||
if (name === null || !/^use[A-Z]/.test(name)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var fnScope = path.scope.getFunctionParent();
|
||||
|
||||
if (fnScope === null) {
|
||||
return;
|
||||
} // This is a Hook call. Record it.
|
||||
|
||||
|
||||
var fnNode = fnScope.block;
|
||||
|
||||
if (!hookCalls.has(fnNode)) {
|
||||
hookCalls.set(fnNode, []);
|
||||
}
|
||||
|
||||
var hookCallsForFn = hookCalls.get(fnNode);
|
||||
var key = '';
|
||||
|
||||
if (path.parent.type === 'VariableDeclarator') {
|
||||
// TODO: if there is no LHS, consider some other heuristic.
|
||||
key = path.parentPath.get('id').getSource();
|
||||
} // Some built-in Hooks reset on edits to arguments.
|
||||
|
||||
|
||||
var args = path.get('arguments');
|
||||
|
||||
if (name === 'useState' && args.length > 0) {
|
||||
// useState second argument is initial state.
|
||||
key += '(' + args[0].getSource() + ')';
|
||||
} else if (name === 'useReducer' && args.length > 1) {
|
||||
// useReducer second argument is initial state.
|
||||
key += '(' + args[1].getSource() + ')';
|
||||
}
|
||||
|
||||
hookCallsForFn.push({
|
||||
callee: path.node.callee,
|
||||
name: name,
|
||||
key: key
|
||||
});
|
||||
}
|
||||
};
|
||||
return {
|
||||
visitor: {
|
||||
ExportDefaultDeclaration: function (path) {
|
||||
var node = path.node;
|
||||
var decl = node.declaration;
|
||||
var declPath = path.get('declaration');
|
||||
|
||||
if (decl.type !== 'CallExpression') {
|
||||
// For now, we only support possible HOC calls here.
|
||||
// Named function declarations are handled in FunctionDeclaration.
|
||||
// Anonymous direct exports like export default function() {}
|
||||
// are currently ignored.
|
||||
return;
|
||||
} // Make sure we're not mutating the same tree twice.
|
||||
// This can happen if another Babel plugin replaces parents.
|
||||
|
||||
|
||||
if (seenForRegistration.has(node)) {
|
||||
return;
|
||||
}
|
||||
|
||||
seenForRegistration.add(node); // Don't mutate the tree above this point.
|
||||
// This code path handles nested cases like:
|
||||
// export default memo(() => {})
|
||||
// In those cases it is more plausible people will omit names
|
||||
// so they're worth handling despite possible false positives.
|
||||
// More importantly, it handles the named case:
|
||||
// export default memo(function Named() {})
|
||||
|
||||
var inferredName = '%default%';
|
||||
var programPath = path.parentPath;
|
||||
findInnerComponents(inferredName, declPath, function (persistentID, targetExpr, targetPath) {
|
||||
if (targetPath === null) {
|
||||
// For case like:
|
||||
// export default hoc(Foo)
|
||||
// we don't want to wrap Foo inside the call.
|
||||
// Instead we assume it's registered at definition.
|
||||
return;
|
||||
}
|
||||
|
||||
var handle = createRegistration(programPath, persistentID);
|
||||
targetPath.replaceWith(t.assignmentExpression('=', handle, targetExpr));
|
||||
});
|
||||
},
|
||||
FunctionDeclaration: {
|
||||
enter: function (path) {
|
||||
var node = path.node;
|
||||
var programPath;
|
||||
var insertAfterPath;
|
||||
var modulePrefix = '';
|
||||
|
||||
switch (path.parent.type) {
|
||||
case 'Program':
|
||||
insertAfterPath = path;
|
||||
programPath = path.parentPath;
|
||||
break;
|
||||
|
||||
case 'TSModuleBlock':
|
||||
insertAfterPath = path;
|
||||
programPath = insertAfterPath.parentPath.parentPath;
|
||||
break;
|
||||
|
||||
case 'ExportNamedDeclaration':
|
||||
insertAfterPath = path.parentPath;
|
||||
programPath = insertAfterPath.parentPath;
|
||||
break;
|
||||
|
||||
case 'ExportDefaultDeclaration':
|
||||
insertAfterPath = path.parentPath;
|
||||
programPath = insertAfterPath.parentPath;
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
} // These types can be nested in typescript namespace
|
||||
// We need to find the export chain
|
||||
// Or return if it stays local
|
||||
|
||||
|
||||
if (path.parent.type === 'TSModuleBlock' || path.parent.type === 'ExportNamedDeclaration') {
|
||||
while (programPath.type !== 'Program') {
|
||||
if (programPath.type === 'TSModuleDeclaration') {
|
||||
if (programPath.parentPath.type !== 'Program' && programPath.parentPath.type !== 'ExportNamedDeclaration') {
|
||||
return;
|
||||
}
|
||||
|
||||
modulePrefix = programPath.node.id.name + '$' + modulePrefix;
|
||||
}
|
||||
|
||||
programPath = programPath.parentPath;
|
||||
}
|
||||
}
|
||||
|
||||
var id = node.id;
|
||||
|
||||
if (id === null) {
|
||||
// We don't currently handle anonymous default exports.
|
||||
return;
|
||||
}
|
||||
|
||||
var inferredName = id.name;
|
||||
|
||||
if (!isComponentishName(inferredName)) {
|
||||
return;
|
||||
} // Make sure we're not mutating the same tree twice.
|
||||
// This can happen if another Babel plugin replaces parents.
|
||||
|
||||
|
||||
if (seenForRegistration.has(node)) {
|
||||
return;
|
||||
}
|
||||
|
||||
seenForRegistration.add(node); // Don't mutate the tree above this point.
|
||||
|
||||
var innerName = modulePrefix + inferredName; // export function Named() {}
|
||||
// function Named() {}
|
||||
|
||||
findInnerComponents(innerName, path, function (persistentID, targetExpr) {
|
||||
var handle = createRegistration(programPath, persistentID);
|
||||
insertAfterPath.insertAfter(t.expressionStatement(t.assignmentExpression('=', handle, targetExpr)));
|
||||
});
|
||||
},
|
||||
exit: function (path) {
|
||||
var node = path.node;
|
||||
var id = node.id;
|
||||
|
||||
if (id === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
var signature = getHookCallsSignature(node);
|
||||
|
||||
if (signature === null) {
|
||||
return;
|
||||
} // Make sure we're not mutating the same tree twice.
|
||||
// This can happen if another Babel plugin replaces parents.
|
||||
|
||||
|
||||
if (seenForSignature.has(node)) {
|
||||
return;
|
||||
}
|
||||
|
||||
seenForSignature.add(node); // Don't mutate the tree above this point.
|
||||
|
||||
var sigCallID = path.scope.generateUidIdentifier('_s');
|
||||
path.scope.parent.push({
|
||||
id: sigCallID,
|
||||
init: t.callExpression(refreshSig, [])
|
||||
}); // The signature call is split in two parts. One part is called inside the function.
|
||||
// This is used to signal when first render happens.
|
||||
|
||||
path.get('body').unshiftContainer('body', t.expressionStatement(t.callExpression(sigCallID, []))); // The second call is around the function itself.
|
||||
// This is used to associate a type with a signature.
|
||||
// Unlike with $RefreshReg$, this needs to work for nested
|
||||
// declarations too. So we need to search for a path where
|
||||
// we can insert a statement rather than hard coding it.
|
||||
|
||||
var insertAfterPath = null;
|
||||
path.find(function (p) {
|
||||
if (p.parentPath.isBlock()) {
|
||||
insertAfterPath = p;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
if (insertAfterPath === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
insertAfterPath.insertAfter(t.expressionStatement(t.callExpression(sigCallID, createArgumentsForSignature(id, signature, insertAfterPath.scope))));
|
||||
}
|
||||
},
|
||||
'ArrowFunctionExpression|FunctionExpression': {
|
||||
exit: function (path) {
|
||||
var node = path.node;
|
||||
var signature = getHookCallsSignature(node);
|
||||
|
||||
if (signature === null) {
|
||||
return;
|
||||
} // Make sure we're not mutating the same tree twice.
|
||||
// This can happen if another Babel plugin replaces parents.
|
||||
|
||||
|
||||
if (seenForSignature.has(node)) {
|
||||
return;
|
||||
}
|
||||
|
||||
seenForSignature.add(node); // Don't mutate the tree above this point.
|
||||
|
||||
var sigCallID = path.scope.generateUidIdentifier('_s');
|
||||
path.scope.parent.push({
|
||||
id: sigCallID,
|
||||
init: t.callExpression(refreshSig, [])
|
||||
}); // The signature call is split in two parts. One part is called inside the function.
|
||||
// This is used to signal when first render happens.
|
||||
|
||||
if (path.node.body.type !== 'BlockStatement') {
|
||||
path.node.body = t.blockStatement([t.returnStatement(path.node.body)]);
|
||||
}
|
||||
|
||||
path.get('body').unshiftContainer('body', t.expressionStatement(t.callExpression(sigCallID, []))); // The second call is around the function itself.
|
||||
// This is used to associate a type with a signature.
|
||||
|
||||
if (path.parent.type === 'VariableDeclarator') {
|
||||
var insertAfterPath = null;
|
||||
path.find(function (p) {
|
||||
if (p.parentPath.isBlock()) {
|
||||
insertAfterPath = p;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
if (insertAfterPath === null) {
|
||||
return;
|
||||
} // Special case when a function would get an inferred name:
|
||||
// let Foo = () => {}
|
||||
// let Foo = function() {}
|
||||
// We'll add signature it on next line so that
|
||||
// we don't mess up the inferred 'Foo' function name.
|
||||
|
||||
|
||||
insertAfterPath.insertAfter(t.expressionStatement(t.callExpression(sigCallID, createArgumentsForSignature(path.parent.id, signature, insertAfterPath.scope)))); // Result: let Foo = () => {}; __signature(Foo, ...);
|
||||
} else {
|
||||
// let Foo = hoc(() => {})
|
||||
var paths = [path].concat(findHOCCallPathsAbove(path));
|
||||
paths.forEach(function (p) {
|
||||
p.replaceWith(t.callExpression(sigCallID, createArgumentsForSignature(p.node, signature, p.scope)));
|
||||
}); // Result: let Foo = __signature(hoc(__signature(() => {}, ...)), ...)
|
||||
}
|
||||
}
|
||||
},
|
||||
VariableDeclaration: function (path) {
|
||||
var node = path.node;
|
||||
var programPath;
|
||||
var insertAfterPath;
|
||||
var modulePrefix = '';
|
||||
|
||||
switch (path.parent.type) {
|
||||
case 'Program':
|
||||
insertAfterPath = path;
|
||||
programPath = path.parentPath;
|
||||
break;
|
||||
|
||||
case 'TSModuleBlock':
|
||||
insertAfterPath = path;
|
||||
programPath = insertAfterPath.parentPath.parentPath;
|
||||
break;
|
||||
|
||||
case 'ExportNamedDeclaration':
|
||||
insertAfterPath = path.parentPath;
|
||||
programPath = insertAfterPath.parentPath;
|
||||
break;
|
||||
|
||||
case 'ExportDefaultDeclaration':
|
||||
insertAfterPath = path.parentPath;
|
||||
programPath = insertAfterPath.parentPath;
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
} // These types can be nested in typescript namespace
|
||||
// We need to find the export chain
|
||||
// Or return if it stays local
|
||||
|
||||
|
||||
if (path.parent.type === 'TSModuleBlock' || path.parent.type === 'ExportNamedDeclaration') {
|
||||
while (programPath.type !== 'Program') {
|
||||
if (programPath.type === 'TSModuleDeclaration') {
|
||||
if (programPath.parentPath.type !== 'Program' && programPath.parentPath.type !== 'ExportNamedDeclaration') {
|
||||
return;
|
||||
}
|
||||
|
||||
modulePrefix = programPath.node.id.name + '$' + modulePrefix;
|
||||
}
|
||||
|
||||
programPath = programPath.parentPath;
|
||||
}
|
||||
} // Make sure we're not mutating the same tree twice.
|
||||
// This can happen if another Babel plugin replaces parents.
|
||||
|
||||
|
||||
if (seenForRegistration.has(node)) {
|
||||
return;
|
||||
}
|
||||
|
||||
seenForRegistration.add(node); // Don't mutate the tree above this point.
|
||||
|
||||
var declPaths = path.get('declarations');
|
||||
|
||||
if (declPaths.length !== 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
var declPath = declPaths[0];
|
||||
var inferredName = declPath.node.id.name;
|
||||
var innerName = modulePrefix + inferredName;
|
||||
findInnerComponents(innerName, declPath, function (persistentID, targetExpr, targetPath) {
|
||||
if (targetPath === null) {
|
||||
// For case like:
|
||||
// export const Something = hoc(Foo)
|
||||
// we don't want to wrap Foo inside the call.
|
||||
// Instead we assume it's registered at definition.
|
||||
return;
|
||||
}
|
||||
|
||||
var handle = createRegistration(programPath, persistentID);
|
||||
|
||||
if (targetPath.parent.type === 'VariableDeclarator') {
|
||||
// Special case when a variable would get an inferred name:
|
||||
// let Foo = () => {}
|
||||
// let Foo = function() {}
|
||||
// let Foo = styled.div``;
|
||||
// We'll register it on next line so that
|
||||
// we don't mess up the inferred 'Foo' function name.
|
||||
// (eg: with @babel/plugin-transform-react-display-name or
|
||||
// babel-plugin-styled-components)
|
||||
insertAfterPath.insertAfter(t.expressionStatement(t.assignmentExpression('=', handle, declPath.node.id))); // Result: let Foo = () => {}; _c1 = Foo;
|
||||
} else {
|
||||
// let Foo = hoc(() => {})
|
||||
targetPath.replaceWith(t.assignmentExpression('=', handle, targetExpr)); // Result: let Foo = hoc(_c1 = () => {})
|
||||
}
|
||||
});
|
||||
},
|
||||
Program: {
|
||||
enter: function (path) {
|
||||
// This is a separate early visitor because we need to collect Hook calls
|
||||
// and "const [foo, setFoo] = ..." signatures before the destructuring
|
||||
// transform mangles them. This extra traversal is not ideal for perf,
|
||||
// but it's the best we can do until we stop transpiling destructuring.
|
||||
path.traverse(HookCallsVisitor);
|
||||
},
|
||||
exit: function (path) {
|
||||
var registrations = registrationsByProgramPath.get(path);
|
||||
|
||||
if (registrations === undefined) {
|
||||
return;
|
||||
} // Make sure we're not mutating the same tree twice.
|
||||
// This can happen if another Babel plugin replaces parents.
|
||||
|
||||
|
||||
var node = path.node;
|
||||
|
||||
if (seenForOutro.has(node)) {
|
||||
return;
|
||||
}
|
||||
|
||||
seenForOutro.add(node); // Don't mutate the tree above this point.
|
||||
|
||||
registrationsByProgramPath.delete(path);
|
||||
var declarators = [];
|
||||
path.pushContainer('body', t.variableDeclaration('var', declarators));
|
||||
registrations.forEach(function (_ref) {
|
||||
var handle = _ref.handle,
|
||||
persistentID = _ref.persistentID;
|
||||
path.pushContainer('body', t.expressionStatement(t.callExpression(refreshReg, [handle, t.stringLiteral(persistentID)])));
|
||||
declarators.push(t.variableDeclarator(handle));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = ReactFreshBabelPlugin;
|
||||
})();
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
ISC License
|
||||
|
||||
Copyright (c) 2021-2024 Oleksii Raspopov, Kostiantyn Denysov, Anton Verinov
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
@@ -0,0 +1,458 @@
|
||||
import { RawSourceMap, SourceMapGenerator } from 'source-map-js'
|
||||
|
||||
import AtRule, { AtRuleProps } from './at-rule.js'
|
||||
import Comment, { CommentProps } from './comment.js'
|
||||
import Container, { ContainerProps, NewChild } from './container.js'
|
||||
import CssSyntaxError from './css-syntax-error.js'
|
||||
import Declaration, { DeclarationProps } from './declaration.js'
|
||||
import Document, { DocumentProps } from './document.js'
|
||||
import Input, { FilePosition } from './input.js'
|
||||
import LazyResult from './lazy-result.js'
|
||||
import list from './list.js'
|
||||
import Node, {
|
||||
AnyNode,
|
||||
ChildNode,
|
||||
ChildProps,
|
||||
NodeErrorOptions,
|
||||
NodeProps,
|
||||
Position,
|
||||
Source
|
||||
} from './node.js'
|
||||
import Processor from './processor.js'
|
||||
import Result, { Message } from './result.js'
|
||||
import Root, { RootProps } from './root.js'
|
||||
import Rule, { RuleProps } from './rule.js'
|
||||
import Warning, { WarningOptions } from './warning.js'
|
||||
|
||||
type DocumentProcessor = (
|
||||
document: Document,
|
||||
helper: postcss.Helpers
|
||||
) => Promise<void> | void
|
||||
type RootProcessor = (
|
||||
root: Root,
|
||||
helper: postcss.Helpers
|
||||
) => Promise<void> | void
|
||||
type DeclarationProcessor = (
|
||||
decl: Declaration,
|
||||
helper: postcss.Helpers
|
||||
) => Promise<void> | void
|
||||
type RuleProcessor = (
|
||||
rule: Rule,
|
||||
helper: postcss.Helpers
|
||||
) => Promise<void> | void
|
||||
type AtRuleProcessor = (
|
||||
atRule: AtRule,
|
||||
helper: postcss.Helpers
|
||||
) => Promise<void> | void
|
||||
type CommentProcessor = (
|
||||
comment: Comment,
|
||||
helper: postcss.Helpers
|
||||
) => Promise<void> | void
|
||||
|
||||
interface Processors {
|
||||
/**
|
||||
* Will be called on all`AtRule` nodes.
|
||||
*
|
||||
* Will be called again on node or children changes.
|
||||
*/
|
||||
AtRule?: { [name: string]: AtRuleProcessor } | AtRuleProcessor
|
||||
|
||||
/**
|
||||
* Will be called on all `AtRule` nodes, when all children will be processed.
|
||||
*
|
||||
* Will be called again on node or children changes.
|
||||
*/
|
||||
AtRuleExit?: { [name: string]: AtRuleProcessor } | AtRuleProcessor
|
||||
|
||||
/**
|
||||
* Will be called on all `Comment` nodes.
|
||||
*
|
||||
* Will be called again on node or children changes.
|
||||
*/
|
||||
Comment?: CommentProcessor
|
||||
|
||||
/**
|
||||
* Will be called on all `Comment` nodes after listeners
|
||||
* for `Comment` event.
|
||||
*
|
||||
* Will be called again on node or children changes.
|
||||
*/
|
||||
CommentExit?: CommentProcessor
|
||||
|
||||
/**
|
||||
* Will be called on all `Declaration` nodes after listeners
|
||||
* for `Declaration` event.
|
||||
*
|
||||
* Will be called again on node or children changes.
|
||||
*/
|
||||
Declaration?: { [prop: string]: DeclarationProcessor } | DeclarationProcessor
|
||||
|
||||
/**
|
||||
* Will be called on all `Declaration` nodes.
|
||||
*
|
||||
* Will be called again on node or children changes.
|
||||
*/
|
||||
DeclarationExit?:
|
||||
| { [prop: string]: DeclarationProcessor }
|
||||
| DeclarationProcessor
|
||||
|
||||
/**
|
||||
* Will be called on `Document` node.
|
||||
*
|
||||
* Will be called again on children changes.
|
||||
*/
|
||||
Document?: DocumentProcessor
|
||||
|
||||
/**
|
||||
* Will be called on `Document` node, when all children will be processed.
|
||||
*
|
||||
* Will be called again on children changes.
|
||||
*/
|
||||
DocumentExit?: DocumentProcessor
|
||||
|
||||
/**
|
||||
* Will be called on `Root` node once.
|
||||
*/
|
||||
Once?: RootProcessor
|
||||
|
||||
/**
|
||||
* Will be called on `Root` node once, when all children will be processed.
|
||||
*/
|
||||
OnceExit?: RootProcessor
|
||||
|
||||
/**
|
||||
* Will be called on `Root` node.
|
||||
*
|
||||
* Will be called again on children changes.
|
||||
*/
|
||||
Root?: RootProcessor
|
||||
|
||||
/**
|
||||
* Will be called on `Root` node, when all children will be processed.
|
||||
*
|
||||
* Will be called again on children changes.
|
||||
*/
|
||||
RootExit?: RootProcessor
|
||||
|
||||
/**
|
||||
* Will be called on all `Rule` nodes.
|
||||
*
|
||||
* Will be called again on node or children changes.
|
||||
*/
|
||||
Rule?: RuleProcessor
|
||||
|
||||
/**
|
||||
* Will be called on all `Rule` nodes, when all children will be processed.
|
||||
*
|
||||
* Will be called again on node or children changes.
|
||||
*/
|
||||
RuleExit?: RuleProcessor
|
||||
}
|
||||
|
||||
declare namespace postcss {
|
||||
export {
|
||||
AnyNode,
|
||||
AtRule,
|
||||
AtRuleProps,
|
||||
ChildNode,
|
||||
ChildProps,
|
||||
Comment,
|
||||
CommentProps,
|
||||
Container,
|
||||
ContainerProps,
|
||||
CssSyntaxError,
|
||||
Declaration,
|
||||
DeclarationProps,
|
||||
Document,
|
||||
DocumentProps,
|
||||
FilePosition,
|
||||
Input,
|
||||
LazyResult,
|
||||
list,
|
||||
Message,
|
||||
NewChild,
|
||||
Node,
|
||||
NodeErrorOptions,
|
||||
NodeProps,
|
||||
Position,
|
||||
Processor,
|
||||
Result,
|
||||
Root,
|
||||
RootProps,
|
||||
Rule,
|
||||
RuleProps,
|
||||
Source,
|
||||
Warning,
|
||||
WarningOptions
|
||||
}
|
||||
|
||||
export type SourceMap = {
|
||||
toJSON(): RawSourceMap
|
||||
} & SourceMapGenerator
|
||||
|
||||
export type Helpers = { postcss: Postcss; result: Result } & Postcss
|
||||
|
||||
export interface Plugin extends Processors {
|
||||
postcssPlugin: string
|
||||
prepare?: (result: Result) => Processors
|
||||
}
|
||||
|
||||
export interface PluginCreator<PluginOptions> {
|
||||
(opts?: PluginOptions): Plugin | Processor
|
||||
postcss: true
|
||||
}
|
||||
|
||||
export interface Transformer extends TransformCallback {
|
||||
postcssPlugin: string
|
||||
postcssVersion: string
|
||||
}
|
||||
|
||||
export interface TransformCallback {
|
||||
(root: Root, result: Result): Promise<void> | void
|
||||
}
|
||||
|
||||
export interface OldPlugin<T> extends Transformer {
|
||||
(opts?: T): Transformer
|
||||
postcss: Transformer
|
||||
}
|
||||
|
||||
export type AcceptedPlugin =
|
||||
| {
|
||||
postcss: Processor | TransformCallback
|
||||
}
|
||||
| OldPlugin<any>
|
||||
| Plugin
|
||||
| PluginCreator<any>
|
||||
| Processor
|
||||
| TransformCallback
|
||||
|
||||
export interface Parser<RootNode = Document | Root> {
|
||||
(
|
||||
css: { toString(): string } | string,
|
||||
opts?: Pick<ProcessOptions, 'document' | 'from' | 'map'>
|
||||
): RootNode
|
||||
}
|
||||
|
||||
export interface Builder {
|
||||
(part: string, node?: AnyNode, type?: 'end' | 'start'): void
|
||||
}
|
||||
|
||||
export interface Stringifier {
|
||||
(node: AnyNode, builder: Builder): void
|
||||
}
|
||||
|
||||
export interface JSONHydrator {
|
||||
(data: object): Node
|
||||
(data: object[]): Node[]
|
||||
}
|
||||
|
||||
export interface Syntax<RootNode = Document | Root> {
|
||||
/**
|
||||
* Function to generate AST by string.
|
||||
*/
|
||||
parse?: Parser<RootNode>
|
||||
|
||||
/**
|
||||
* Class to generate string by AST.
|
||||
*/
|
||||
stringify?: Stringifier
|
||||
}
|
||||
|
||||
export interface SourceMapOptions {
|
||||
/**
|
||||
* Use absolute path in generated source map.
|
||||
*/
|
||||
absolute?: boolean
|
||||
|
||||
/**
|
||||
* Indicates that PostCSS should add annotation comments to the CSS.
|
||||
* By default, PostCSS will always add a comment with a path
|
||||
* to the source map. PostCSS will not add annotations to CSS files
|
||||
* that do not contain any comments.
|
||||
*
|
||||
* By default, PostCSS presumes that you want to save the source map as
|
||||
* `opts.to + '.map'` and will use this path in the annotation comment.
|
||||
* A different path can be set by providing a string value for annotation.
|
||||
*
|
||||
* If you have set `inline: true`, annotation cannot be disabled.
|
||||
*/
|
||||
annotation?: ((file: string, root: Root) => string) | boolean | string
|
||||
|
||||
/**
|
||||
* Override `from` in map’s sources.
|
||||
*/
|
||||
from?: string
|
||||
|
||||
/**
|
||||
* Indicates that the source map should be embedded in the output CSS
|
||||
* as a Base64-encoded comment. By default, it is `true`.
|
||||
* But if all previous maps are external, not inline, PostCSS will not embed
|
||||
* the map even if you do not set this option.
|
||||
*
|
||||
* If you have an inline source map, the result.map property will be empty,
|
||||
* as the source map will be contained within the text of `result.css`.
|
||||
*/
|
||||
inline?: boolean
|
||||
|
||||
/**
|
||||
* Source map content from a previous processing step (e.g., Sass).
|
||||
*
|
||||
* PostCSS will try to read the previous source map
|
||||
* automatically (based on comments within the source CSS), but you can use
|
||||
* this option to identify it manually.
|
||||
*
|
||||
* If desired, you can omit the previous map with prev: `false`.
|
||||
*/
|
||||
prev?: ((file: string) => string) | boolean | object | string
|
||||
|
||||
/**
|
||||
* Indicates that PostCSS should set the origin content (e.g., Sass source)
|
||||
* of the source map. By default, it is true. But if all previous maps do not
|
||||
* contain sources content, PostCSS will also leave it out even if you
|
||||
* do not set this option.
|
||||
*/
|
||||
sourcesContent?: boolean
|
||||
}
|
||||
|
||||
export interface ProcessOptions<RootNode = Document | Root> {
|
||||
/**
|
||||
* Input file if it is not simple CSS file, but HTML with <style> or JS with CSS-in-JS blocks.
|
||||
*/
|
||||
document?: string
|
||||
|
||||
/**
|
||||
* The path of the CSS source file. You should always set `from`,
|
||||
* because it is used in source map generation and syntax error messages.
|
||||
*/
|
||||
from?: string | undefined
|
||||
|
||||
/**
|
||||
* Source map options
|
||||
*/
|
||||
map?: boolean | SourceMapOptions
|
||||
|
||||
/**
|
||||
* Function to generate AST by string.
|
||||
*/
|
||||
parser?: Parser<RootNode> | Syntax<RootNode>
|
||||
|
||||
/**
|
||||
* Class to generate string by AST.
|
||||
*/
|
||||
stringifier?: Stringifier | Syntax<RootNode>
|
||||
|
||||
/**
|
||||
* Object with parse and stringify.
|
||||
*/
|
||||
syntax?: Syntax<RootNode>
|
||||
|
||||
/**
|
||||
* The path where you'll put the output CSS file. You should always set `to`
|
||||
* to generate correct source maps.
|
||||
*/
|
||||
to?: string
|
||||
}
|
||||
|
||||
export type Postcss = typeof postcss
|
||||
|
||||
/**
|
||||
* Default function to convert a node tree into a CSS string.
|
||||
*/
|
||||
export let stringify: Stringifier
|
||||
|
||||
/**
|
||||
* Parses source css and returns a new `Root` or `Document` node,
|
||||
* which contains the source CSS nodes.
|
||||
*
|
||||
* ```js
|
||||
* // Simple CSS concatenation with source map support
|
||||
* const root1 = postcss.parse(css1, { from: file1 })
|
||||
* const root2 = postcss.parse(css2, { from: file2 })
|
||||
* root1.append(root2).toResult().css
|
||||
* ```
|
||||
*/
|
||||
export let parse: Parser<Root>
|
||||
|
||||
/**
|
||||
* Rehydrate a JSON AST (from `Node#toJSON`) back into the AST classes.
|
||||
*
|
||||
* ```js
|
||||
* const json = root.toJSON()
|
||||
* // save to file, send by network, etc
|
||||
* const root2 = postcss.fromJSON(json)
|
||||
* ```
|
||||
*/
|
||||
export let fromJSON: JSONHydrator
|
||||
|
||||
/**
|
||||
* Creates a new `Comment` node.
|
||||
*
|
||||
* @param defaults Properties for the new node.
|
||||
* @return New comment node
|
||||
*/
|
||||
export function comment(defaults?: CommentProps): Comment
|
||||
|
||||
/**
|
||||
* Creates a new `AtRule` node.
|
||||
*
|
||||
* @param defaults Properties for the new node.
|
||||
* @return New at-rule node.
|
||||
*/
|
||||
export function atRule(defaults?: AtRuleProps): AtRule
|
||||
|
||||
/**
|
||||
* Creates a new `Declaration` node.
|
||||
*
|
||||
* @param defaults Properties for the new node.
|
||||
* @return New declaration node.
|
||||
*/
|
||||
export function decl(defaults?: DeclarationProps): Declaration
|
||||
|
||||
/**
|
||||
* Creates a new `Rule` node.
|
||||
*
|
||||
* @param default Properties for the new node.
|
||||
* @return New rule node.
|
||||
*/
|
||||
export function rule(defaults?: RuleProps): Rule
|
||||
|
||||
/**
|
||||
* Creates a new `Root` node.
|
||||
*
|
||||
* @param defaults Properties for the new node.
|
||||
* @return New root node.
|
||||
*/
|
||||
export function root(defaults?: RootProps): Root
|
||||
|
||||
/**
|
||||
* Creates a new `Document` node.
|
||||
*
|
||||
* @param defaults Properties for the new node.
|
||||
* @return New document node.
|
||||
*/
|
||||
export function document(defaults?: DocumentProps): Document
|
||||
|
||||
export { postcss as default }
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new `Processor` instance that will apply `plugins`
|
||||
* as CSS processors.
|
||||
*
|
||||
* ```js
|
||||
* let postcss = require('postcss')
|
||||
*
|
||||
* postcss(plugins).process(css, { from, to }).then(result => {
|
||||
* console.log(result.css)
|
||||
* })
|
||||
* ```
|
||||
*
|
||||
* @param plugins PostCSS plugins.
|
||||
* @return Processor to process multiple CSS.
|
||||
*/
|
||||
declare function postcss(
|
||||
plugins?: readonly postcss.AcceptedPlugin[]
|
||||
): Processor
|
||||
declare function postcss(...plugins: postcss.AcceptedPlugin[]): Processor
|
||||
|
||||
export = postcss
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"0 9 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","132":"N O P"},C:{"1":"0 9 pB qB rB sB tB uB vB MC wB NC 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 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC","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 qC rC"},D:{"1":"0 9 wB NC xB yB zB 0B 1B 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","132":"uB vB MC"},E:{"1":"B C L M G FC GC xC yC 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","132":"TC"},F:{"1":"0 kB lB mB nB oB pB qB 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 4C 5C 6C 7C FC kC 8C GC","132":"hB iB jB"},G:{"1":"ID JD KD LD 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","132":"HD"},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:{"1":"EC"},N:{"2":"A B"},O:{"1":"HC"},P:{"1":"1 2 3 4 5 6 7 8 gD hD TC iD jD kD lD mD IC JC KC nD","2":"J dD eD","132":"fD"},Q:{"1":"oD"},R:{"1":"pD"},S:{"1":"rD","132":"qD"}},B:5,C:"CSS justify-content: space-evenly",D:true};
|
||||
@@ -0,0 +1,66 @@
|
||||
'use strict';
|
||||
module.exports = function generate_enum(it, $keyword, $ruleType) {
|
||||
var out = ' ';
|
||||
var $lvl = it.level;
|
||||
var $dataLvl = it.dataLevel;
|
||||
var $schema = it.schema[$keyword];
|
||||
var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
|
||||
var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
|
||||
var $breakOnError = !it.opts.allErrors;
|
||||
var $data = 'data' + ($dataLvl || '');
|
||||
var $valid = 'valid' + $lvl;
|
||||
var $isData = it.opts.$data && $schema && $schema.$data,
|
||||
$schemaValue;
|
||||
if ($isData) {
|
||||
out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
|
||||
$schemaValue = 'schema' + $lvl;
|
||||
} else {
|
||||
$schemaValue = $schema;
|
||||
}
|
||||
var $i = 'i' + $lvl,
|
||||
$vSchema = 'schema' + $lvl;
|
||||
if (!$isData) {
|
||||
out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + ';';
|
||||
}
|
||||
out += 'var ' + ($valid) + ';';
|
||||
if ($isData) {
|
||||
out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {';
|
||||
}
|
||||
out += '' + ($valid) + ' = false;for (var ' + ($i) + '=0; ' + ($i) + '<' + ($vSchema) + '.length; ' + ($i) + '++) if (equal(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + '])) { ' + ($valid) + ' = true; break; }';
|
||||
if ($isData) {
|
||||
out += ' } ';
|
||||
}
|
||||
out += ' if (!' + ($valid) + ') { ';
|
||||
var $$outStack = $$outStack || [];
|
||||
$$outStack.push(out);
|
||||
out = ''; /* istanbul ignore else */
|
||||
if (it.createErrors !== false) {
|
||||
out += ' { keyword: \'' + ('enum') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValues: schema' + ($lvl) + ' } ';
|
||||
if (it.opts.messages !== false) {
|
||||
out += ' , message: \'should be equal to one of the allowed values\' ';
|
||||
}
|
||||
if (it.opts.verbose) {
|
||||
out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
|
||||
}
|
||||
out += ' } ';
|
||||
} else {
|
||||
out += ' {} ';
|
||||
}
|
||||
var __err = out;
|
||||
out = $$outStack.pop();
|
||||
if (!it.compositeRule && $breakOnError) {
|
||||
/* istanbul ignore if */
|
||||
if (it.async) {
|
||||
out += ' throw new ValidationError([' + (__err) + ']); ';
|
||||
} else {
|
||||
out += ' validate.errors = [' + (__err) + ']; return false; ';
|
||||
}
|
||||
} else {
|
||||
out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
|
||||
}
|
||||
out += ' }';
|
||||
if ($breakOnError) {
|
||||
out += ' else { ';
|
||||
}
|
||||
return out;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"0 9 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 O P"},C:{"1":"0 9 oB pB qB rB sB tB uB vB MC wB NC 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 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC","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 qC rC","132":"hB iB jB","260":"kB lB mB nB"},D:{"1":"0 9 vB MC wB NC xB yB zB 0B 1B 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","132":"lB mB nB oB","260":"pB qB rB sB tB uB"},E:{"1":"B C L M G TC FC GC xC yC 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"},F:{"1":"0 iB jB kB lB mB nB oB pB qB 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 4C 5C 6C 7C FC kC 8C GC","132":"YB ZB aB bB","260":"cB dB eB fB gB hB"},G:{"1":"HD ID JD KD LD 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","16":"GD"},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:{"1":"EC"},N:{"2":"A B"},O:{"1":"HC"},P:{"1":"1 2 3 4 5 6 7 8 fD gD hD TC iD jD kD lD mD IC JC KC nD","2":"J","260":"dD eD"},Q:{"1":"oD"},R:{"1":"pD"},S:{"1":"rD","260":"qD"}},B:2,C:"IndexedDB 2.0",D:true};
|
||||
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* @fileoverview Rule to flag statements with function invocation preceded by
|
||||
* "new" and not part of assignment
|
||||
* @author Ilya Volodin
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @type {import('../shared/types').Rule} */
|
||||
module.exports = {
|
||||
meta: {
|
||||
type: "suggestion",
|
||||
|
||||
docs: {
|
||||
description:
|
||||
"Disallow `new` operators outside of assignments or comparisons",
|
||||
recommended: false,
|
||||
url: "https://eslint.org/docs/latest/rules/no-new",
|
||||
},
|
||||
|
||||
schema: [],
|
||||
|
||||
messages: {
|
||||
noNewStatement: "Do not use 'new' for side effects.",
|
||||
},
|
||||
},
|
||||
|
||||
create(context) {
|
||||
return {
|
||||
"ExpressionStatement > NewExpression"(node) {
|
||||
context.report({
|
||||
node: node.parent,
|
||||
messageId: "noNewStatement",
|
||||
});
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,172 @@
|
||||
/**
|
||||
* @fileoverview Tracks performance of individual rules.
|
||||
* @author Brandon Mills
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
const { startTime, endTime } = require("../shared/stats");
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Helpers
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/* c8 ignore next */
|
||||
/**
|
||||
* Align the string to left
|
||||
* @param {string} str string to evaluate
|
||||
* @param {int} len length of the string
|
||||
* @param {string} ch delimiter character
|
||||
* @returns {string} modified string
|
||||
* @private
|
||||
*/
|
||||
function alignLeft(str, len, ch) {
|
||||
return str + new Array(len - str.length + 1).join(ch || " ");
|
||||
}
|
||||
|
||||
/* c8 ignore next */
|
||||
/**
|
||||
* Align the string to right
|
||||
* @param {string} str string to evaluate
|
||||
* @param {int} len length of the string
|
||||
* @param {string} ch delimiter character
|
||||
* @returns {string} modified string
|
||||
* @private
|
||||
*/
|
||||
function alignRight(str, len, ch) {
|
||||
return new Array(len - str.length + 1).join(ch || " ") + str;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Module definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
const enabled = !!process.env.TIMING;
|
||||
|
||||
const HEADERS = ["Rule", "Time (ms)", "Relative"];
|
||||
const ALIGN = [alignLeft, alignRight, alignRight];
|
||||
|
||||
/**
|
||||
* Decide how many rules to show in the output list.
|
||||
* @returns {number} the number of rules to show
|
||||
*/
|
||||
function getListSize() {
|
||||
const MINIMUM_SIZE = 10;
|
||||
|
||||
if (typeof process.env.TIMING !== "string") {
|
||||
return MINIMUM_SIZE;
|
||||
}
|
||||
|
||||
if (process.env.TIMING.toLowerCase() === "all") {
|
||||
return Number.POSITIVE_INFINITY;
|
||||
}
|
||||
|
||||
const TIMING_ENV_VAR_AS_INTEGER = Number.parseInt(process.env.TIMING, 10);
|
||||
|
||||
return TIMING_ENV_VAR_AS_INTEGER > 10
|
||||
? TIMING_ENV_VAR_AS_INTEGER
|
||||
: MINIMUM_SIZE;
|
||||
}
|
||||
|
||||
/* c8 ignore next */
|
||||
/**
|
||||
* display the data
|
||||
* @param {Object} data Data object to be displayed
|
||||
* @returns {void} prints modified string with console.log
|
||||
* @private
|
||||
*/
|
||||
function display(data) {
|
||||
let total = 0;
|
||||
const rows = Object.keys(data)
|
||||
.map(key => {
|
||||
const time = data[key];
|
||||
|
||||
total += time;
|
||||
return [key, time];
|
||||
})
|
||||
.sort((a, b) => b[1] - a[1])
|
||||
.slice(0, getListSize());
|
||||
|
||||
rows.forEach(row => {
|
||||
row.push(`${((row[1] * 100) / total).toFixed(1)}%`);
|
||||
row[1] = row[1].toFixed(3);
|
||||
});
|
||||
|
||||
rows.unshift(HEADERS);
|
||||
|
||||
const widths = [];
|
||||
|
||||
rows.forEach(row => {
|
||||
const len = row.length;
|
||||
|
||||
for (let i = 0; i < len; i++) {
|
||||
const n = row[i].length;
|
||||
|
||||
if (!widths[i] || n > widths[i]) {
|
||||
widths[i] = n;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const table = rows.map(row =>
|
||||
row.map((cell, index) => ALIGN[index](cell, widths[index])).join(" | "),
|
||||
);
|
||||
|
||||
table.splice(
|
||||
1,
|
||||
0,
|
||||
widths
|
||||
.map((width, index) => {
|
||||
const extraAlignment =
|
||||
index !== 0 && index !== widths.length - 1 ? 2 : 1;
|
||||
|
||||
return ALIGN[index](":", width + extraAlignment, "-");
|
||||
})
|
||||
.join("|"),
|
||||
);
|
||||
|
||||
console.log(table.join("\n")); // eslint-disable-line no-console -- Debugging function
|
||||
}
|
||||
|
||||
/* c8 ignore next */
|
||||
module.exports = (function () {
|
||||
const data = Object.create(null);
|
||||
|
||||
/**
|
||||
* Time the run
|
||||
* @param {any} key key from the data object
|
||||
* @param {Function} fn function to be called
|
||||
* @param {boolean} stats if 'stats' is true, return the result and the time difference
|
||||
* @returns {Function} function to be executed
|
||||
* @private
|
||||
*/
|
||||
function time(key, fn, stats) {
|
||||
return function (...args) {
|
||||
const t = startTime();
|
||||
const result = fn(...args);
|
||||
const tdiff = endTime(t);
|
||||
|
||||
if (enabled) {
|
||||
if (typeof data[key] === "undefined") {
|
||||
data[key] = 0;
|
||||
}
|
||||
|
||||
data[key] += tdiff;
|
||||
}
|
||||
|
||||
return stats ? { result, tdiff } : result;
|
||||
};
|
||||
}
|
||||
|
||||
if (enabled) {
|
||||
process.on("exit", () => {
|
||||
display(data);
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
time,
|
||||
enabled,
|
||||
getListSize,
|
||||
};
|
||||
})();
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"72":0.00118,"79":0.00118,"96":0.00118,"101":0.00118,"115":0.05792,"127":0.00236,"128":0.00591,"132":0.00473,"133":0.00118,"134":0.00473,"135":0.10402,"136":0.35342,"137":0.00355,_:"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 73 74 75 76 77 78 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 97 98 99 100 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 125 126 129 130 131 138 139 140 3.5 3.6"},D:{"40":0.00355,"46":0.00118,"49":0.00236,"50":0.00118,"51":0.00118,"55":0.00118,"56":0.00118,"58":0.00118,"65":0.00118,"66":0.00473,"69":0.00118,"72":0.00355,"73":0.00118,"75":0.00118,"77":0.00118,"79":0.01182,"80":0.00118,"81":0.00118,"83":0.00236,"86":0.00118,"87":0.01655,"88":0.00118,"89":0.00118,"91":0.00118,"93":0.00118,"94":0.00118,"97":0.00118,"98":0.00946,"99":0.00118,"103":0.02246,"104":0.00118,"105":0.00118,"106":0.00118,"107":0.02246,"109":0.17612,"110":0.00236,"111":0.00236,"113":0.00118,"114":0.00355,"116":0.00709,"117":0.00118,"118":0.00355,"119":0.01064,"120":0.00118,"121":0.00236,"122":0.01418,"123":0.01418,"124":0.08747,"125":0.04728,"126":0.00946,"127":0.00355,"128":0.01182,"129":0.00355,"130":0.00591,"131":0.02128,"132":0.04019,"133":1.03898,"134":1.81792,_:"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 41 42 43 44 45 47 48 52 53 54 57 59 60 61 62 63 64 67 68 70 71 74 76 78 84 85 90 92 95 96 100 101 102 108 112 115 135 136 137 138"},F:{"46":0.00118,"85":0.00118,"87":0.00236,"95":0.01891,"114":0.00118,"115":0.00236,"116":0.00591,"117":0.13711,_:"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 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 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 113 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"13":0.00236,"16":0.00118,"18":0.00946,"90":0.00118,"92":0.00473,"100":0.00118,"109":0.01418,"113":0.00118,"119":0.00118,"120":0.00236,"121":0.00473,"122":0.04137,"125":0.02955,"126":0.04019,"127":0.00118,"128":0.00118,"129":0.00118,"130":0.00118,"131":0.02128,"132":0.01773,"133":0.61464,"134":1.74581,_:"12 14 15 17 79 80 81 83 84 85 86 87 88 89 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 111 112 114 115 116 117 118 123 124"},E:{"14":0.00355,_:"0 4 5 6 7 8 9 10 11 12 13 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.2-15.3 15.5 16.1 16.2 16.3 16.5 17.3 17.4","13.1":0.01182,"14.1":0.01182,"15.1":0.00118,"15.4":0.00118,"15.6":0.03782,"16.0":0.00118,"16.4":0.00118,"16.6":0.00591,"17.0":0.00118,"17.1":0.00118,"17.2":0.026,"17.5":0.01418,"17.6":0.01182,"18.0":0.00827,"18.1":0.00827,"18.2":0.00473,"18.3":0.06619,"18.4":0.00118},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00336,"5.0-5.1":0,"6.0-6.1":0.01009,"7.0-7.1":0.00673,"8.1-8.4":0,"9.0-9.2":0.00504,"9.3":0.02354,"10.0-10.2":0.00168,"10.3":0.03868,"11.0-11.2":0.17825,"11.3-11.4":0.01177,"12.0-12.1":0.00673,"12.2-12.5":0.16648,"13.0-13.1":0.00336,"13.2":0.00504,"13.3":0.00673,"13.4-13.7":0.02354,"14.0-14.4":0.05886,"14.5-14.8":0.07063,"15.0-15.1":0.03868,"15.2-15.3":0.03868,"15.4":0.04708,"15.5":0.05381,"15.6-15.8":0.66255,"16.0":0.09417,"16.1":0.19338,"16.2":0.1009,"16.3":0.17489,"16.4":0.03868,"16.5":0.07231,"16.6-16.7":0.7853,"17.0":0.04708,"17.1":0.08408,"17.2":0.0639,"17.3":0.08912,"17.4":0.17825,"17.5":0.39686,"17.6-17.7":1.15189,"18.0":0.32287,"18.1":1.05604,"18.2":0.47253,"18.3":9.87599,"18.4":0.1463},P:{"4":0.11108,"21":0.0202,"22":0.19187,"23":0.04039,"24":0.18178,"25":0.31306,"26":0.26256,"27":0.80789,_:"20 6.2-6.4 8.2 10.1 12.0 15.0 16.0 17.0 18.0","5.0-5.4":0.0303,"7.2-7.4":0.16158,"9.2":0.0101,"11.1-11.2":0.0101,"13.0":0.15148,"14.0":0.0202,"19.0":0.12118},I:{"0":0.0176,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00002},K:{"0":0.17281,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.00118,_:"6 7 8 9 10 5.5"},S:{"2.5":0.07054,_:"3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.08818},Q:{_:"14.9"},O:{"0":0.13227},H:{"0":0.03},L:{"0":72.95497}};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,52 @@
|
||||
import { defaultSerializeError } from './router'
|
||||
|
||||
export const TSR_DEFERRED_PROMISE = Symbol.for('TSR_DEFERRED_PROMISE')
|
||||
|
||||
export type DeferredPromiseState<T> =
|
||||
| {
|
||||
status: 'pending'
|
||||
data?: T
|
||||
error?: unknown
|
||||
}
|
||||
| {
|
||||
status: 'success'
|
||||
data: T
|
||||
}
|
||||
| {
|
||||
status: 'error'
|
||||
data?: T
|
||||
error: unknown
|
||||
}
|
||||
|
||||
export type DeferredPromise<T> = Promise<T> & {
|
||||
[TSR_DEFERRED_PROMISE]: DeferredPromiseState<T>
|
||||
}
|
||||
|
||||
export function defer<T>(
|
||||
_promise: Promise<T>,
|
||||
options?: {
|
||||
serializeError?: typeof defaultSerializeError
|
||||
},
|
||||
) {
|
||||
const promise = _promise as DeferredPromise<T>
|
||||
// this is already deferred promise
|
||||
if ((promise as any)[TSR_DEFERRED_PROMISE]) {
|
||||
return promise
|
||||
}
|
||||
promise[TSR_DEFERRED_PROMISE] = { status: 'pending' }
|
||||
|
||||
promise
|
||||
.then((data) => {
|
||||
promise[TSR_DEFERRED_PROMISE].status = 'success'
|
||||
promise[TSR_DEFERRED_PROMISE].data = data
|
||||
})
|
||||
.catch((error) => {
|
||||
promise[TSR_DEFERRED_PROMISE].status = 'error'
|
||||
;(promise[TSR_DEFERRED_PROMISE] as any).error = {
|
||||
data: (options?.serializeError ?? defaultSerializeError)(error),
|
||||
__isServerError: true,
|
||||
}
|
||||
})
|
||||
|
||||
return promise
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import type { StructTreeContent } from 'pdfjs-dist/types/src/display/api.js';
|
||||
import type { StructTreeNodeWithExtraAttributes } from './shared/types.js';
|
||||
type StructTreeItemProps = {
|
||||
className?: string;
|
||||
node: StructTreeNodeWithExtraAttributes | StructTreeContent;
|
||||
};
|
||||
export default function StructTreeItem({ className, node, }: StructTreeItemProps): React.ReactElement;
|
||||
export {};
|
||||
@@ -0,0 +1,65 @@
|
||||
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||||
/* eslint-disable node/no-deprecated-api */
|
||||
var buffer = require('buffer')
|
||||
var Buffer = buffer.Buffer
|
||||
|
||||
// alternative to using Object.keys for old browsers
|
||||
function copyProps (src, dst) {
|
||||
for (var key in src) {
|
||||
dst[key] = src[key]
|
||||
}
|
||||
}
|
||||
if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
|
||||
module.exports = buffer
|
||||
} else {
|
||||
// Copy properties from require('buffer')
|
||||
copyProps(buffer, exports)
|
||||
exports.Buffer = SafeBuffer
|
||||
}
|
||||
|
||||
function SafeBuffer (arg, encodingOrOffset, length) {
|
||||
return Buffer(arg, encodingOrOffset, length)
|
||||
}
|
||||
|
||||
SafeBuffer.prototype = Object.create(Buffer.prototype)
|
||||
|
||||
// Copy static methods from Buffer
|
||||
copyProps(Buffer, SafeBuffer)
|
||||
|
||||
SafeBuffer.from = function (arg, encodingOrOffset, length) {
|
||||
if (typeof arg === 'number') {
|
||||
throw new TypeError('Argument must not be a number')
|
||||
}
|
||||
return Buffer(arg, encodingOrOffset, length)
|
||||
}
|
||||
|
||||
SafeBuffer.alloc = function (size, fill, encoding) {
|
||||
if (typeof size !== 'number') {
|
||||
throw new TypeError('Argument must be a number')
|
||||
}
|
||||
var buf = Buffer(size)
|
||||
if (fill !== undefined) {
|
||||
if (typeof encoding === 'string') {
|
||||
buf.fill(fill, encoding)
|
||||
} else {
|
||||
buf.fill(fill)
|
||||
}
|
||||
} else {
|
||||
buf.fill(0)
|
||||
}
|
||||
return buf
|
||||
}
|
||||
|
||||
SafeBuffer.allocUnsafe = function (size) {
|
||||
if (typeof size !== 'number') {
|
||||
throw new TypeError('Argument must be a number')
|
||||
}
|
||||
return Buffer(size)
|
||||
}
|
||||
|
||||
SafeBuffer.allocUnsafeSlow = function (size) {
|
||||
if (typeof size !== 'number') {
|
||||
throw new TypeError('Argument must be a number')
|
||||
}
|
||||
return buffer.SlowBuffer(size)
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
module.exports={C:{"4":0.02561,"45":0.00171,"67":0.00171,"72":0.00171,"100":0.00171,"112":0.00512,"115":0.01878,"121":0.00341,"127":0.00512,"128":0.00171,"131":0.00171,"132":0.00171,"133":0.00683,"134":0.00171,"135":0.08023,"136":0.32774,"137":0.03073,_:"2 3 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 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 68 69 70 71 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 109 110 111 113 114 116 117 118 119 120 122 123 124 125 126 129 130 138 139 140 3.5 3.6"},D:{"22":0.00512,"48":0.00341,"49":0.00171,"50":0.00171,"54":0.00171,"55":0.00512,"56":0.00171,"58":0.00341,"59":0.00171,"60":0.00683,"63":0.00683,"64":0.00171,"65":0.01366,"66":0.00171,"67":0.00171,"68":0.02902,"70":0.00341,"71":0.00171,"72":0.00341,"73":0.00171,"74":0.00683,"75":0.01195,"76":0.00854,"77":0.03414,"78":0.00171,"79":0.01707,"80":0.00683,"81":0.00341,"83":0.00683,"84":0.00341,"85":0.00171,"86":0.00341,"87":0.01195,"88":0.00171,"89":0.00171,"91":0.00683,"93":0.01195,"94":0.00683,"97":0.00341,"98":0.00341,"99":0.00171,"100":0.00512,"101":0.01366,"102":0.00171,"103":0.04609,"105":0.01366,"106":0.00683,"107":0.00171,"108":0.01195,"109":0.06657,"110":0.00171,"111":0.01195,"113":0.01878,"114":0.01024,"116":0.01195,"117":0.00171,"118":0.00341,"119":0.05121,"120":0.00512,"121":0.01366,"122":0.03585,"123":0.01024,"124":0.00171,"125":0.00854,"126":0.02902,"127":0.01024,"128":0.02048,"129":0.01707,"130":0.03073,"131":0.15534,"132":0.11949,"133":1.47485,"134":2.69365,"135":0.00341,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 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 51 52 53 57 61 62 69 90 92 95 96 104 112 115 136 137 138"},F:{"34":0.00171,"42":0.00171,"43":0.00171,"48":0.01195,"51":0.00683,"64":0.00171,"79":0.00854,"86":0.00512,"87":0.03243,"88":0.00341,"95":0.01536,"102":0.00341,"108":0.00171,"112":0.00683,"113":0.00171,"114":0.00341,"115":0.00341,"116":0.02902,"117":0.44382,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 35 36 37 38 39 40 41 44 45 46 47 49 50 52 53 54 55 56 57 58 60 62 63 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 82 83 84 85 89 90 91 92 93 94 96 97 98 99 100 101 103 104 105 106 107 109 110 111 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6","12.1":0.00341},B:{"12":0.00341,"13":0.00683,"14":0.00341,"15":0.00171,"16":0.00512,"18":0.03585,"84":0.00341,"89":0.00171,"90":0.01024,"92":0.05804,"100":0.00854,"109":0.00341,"111":0.00171,"112":0.00171,"114":0.00171,"116":0.00171,"119":0.00341,"120":0.00171,"121":0.00171,"122":0.00341,"126":0.00341,"127":0.01536,"128":0.00512,"129":0.00683,"130":0.00341,"131":0.03926,"132":0.05292,"133":0.62306,"134":0.96446,_:"17 79 80 81 83 85 86 87 88 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 113 115 117 118 123 124 125"},E:{"13":0.00171,"15":0.00171,_:"0 4 5 6 7 8 9 10 11 12 14 3.1 3.2 5.1 6.1 7.1 9.1 10.1 12.1 15.1 15.4 15.5 16.2 16.3 16.4 16.5 17.0 17.3 18.4","11.1":0.00683,"13.1":0.03073,"14.1":0.00683,"15.2-15.3":0.00512,"15.6":0.02219,"16.0":0.00171,"16.1":0.00341,"16.6":0.06145,"17.1":0.03243,"17.2":0.00171,"17.4":0.00171,"17.5":0.00854,"17.6":0.05633,"18.0":0.00341,"18.1":0.01707,"18.2":0.01536,"18.3":0.08194},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00101,"5.0-5.1":0,"6.0-6.1":0.00302,"7.0-7.1":0.00201,"8.1-8.4":0,"9.0-9.2":0.00151,"9.3":0.00704,"10.0-10.2":0.0005,"10.3":0.01156,"11.0-11.2":0.05327,"11.3-11.4":0.00352,"12.0-12.1":0.00201,"12.2-12.5":0.04975,"13.0-13.1":0.00101,"13.2":0.00151,"13.3":0.00201,"13.4-13.7":0.00704,"14.0-14.4":0.01759,"14.5-14.8":0.02111,"15.0-15.1":0.01156,"15.2-15.3":0.01156,"15.4":0.01407,"15.5":0.01608,"15.6-15.8":0.19801,"16.0":0.02814,"16.1":0.05779,"16.2":0.03015,"16.3":0.05227,"16.4":0.01156,"16.5":0.02161,"16.6-16.7":0.23469,"17.0":0.01407,"17.1":0.02513,"17.2":0.0191,"17.3":0.02664,"17.4":0.05327,"17.5":0.1186,"17.6-17.7":0.34425,"18.0":0.09649,"18.1":0.31561,"18.2":0.14122,"18.3":2.95151,"18.4":0.04372},P:{"4":0.12459,"21":0.01038,"22":0.05191,"23":0.01038,"24":0.09344,"25":0.09344,"26":0.13497,"27":0.40492,_:"20 8.2 10.1 12.0 14.0 16.0 17.0 18.0","5.0-5.4":0.10383,"6.2-6.4":0.01038,"7.2-7.4":0.04153,"9.2":0.01038,"11.1-11.2":0.16612,"13.0":0.03115,"15.0":0.02077,"19.0":0.01038},I:{"0":0.02483,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00003},K:{"0":6.08982,_:"10 11 12 11.1 11.5 12.1"},A:{"10":0.00171,"11":0.00512,_:"6 7 8 9 5.5"},S:{"2.5":0.01659,_:"3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.03317},Q:{"14.9":0.00829},O:{"0":0.21562},H:{"0":1.83},L:{"0":76.57249}};
|
||||
@@ -0,0 +1,7 @@
|
||||
import type * as React from 'react'
|
||||
|
||||
declare module '@tanstack/router-core' {
|
||||
export interface SerializerExtensions {
|
||||
ReadableStream: React.JSX.Element
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import { AnyRouter, RegisteredRouter } from '@tanstack/router-core';
|
||||
export declare function useRouter<TRouter extends AnyRouter = RegisteredRouter>(opts?: {
|
||||
warn?: boolean;
|
||||
}): TRouter;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"47":0.00824,"52":0.00824,"66":0.00824,"101":0.00275,"103":0.00275,"107":0.00275,"110":0.0055,"115":0.05496,"125":0.02473,"127":0.00824,"128":0.00275,"129":0.00275,"130":0.00275,"135":0.11267,"136":0.36274,_:"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 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 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 93 94 95 96 97 98 99 100 102 104 105 106 108 109 111 112 113 114 116 117 118 119 120 121 122 123 124 126 131 132 133 134 137 138 139 140 3.5 3.6"},D:{"39":0.0055,"40":0.00275,"41":0.00275,"42":0.00275,"43":0.00824,"44":0.00275,"45":0.00275,"46":0.00275,"47":0.00275,"48":0.0055,"49":0.0055,"50":0.00275,"51":0.00275,"52":0.00275,"53":0.0055,"54":0.00275,"55":0.00275,"56":0.00275,"57":0.00275,"58":0.00275,"59":0.00275,"60":0.00275,"66":0.0055,"68":0.00275,"69":0.00275,"70":0.00275,"71":0.00824,"74":0.00275,"78":0.0055,"79":0.00275,"84":0.00275,"86":0.00275,"87":0.00275,"89":0.00275,"90":0.01099,"91":0.01099,"92":0.00275,"93":0.0055,"94":0.01649,"97":0.01099,"98":0.00275,"99":0.0055,"100":0.0055,"101":0.00275,"102":0.0742,"103":0.01374,"104":0.17038,"105":0.0055,"106":0.01374,"107":0.00275,"108":0.01374,"109":0.54685,"110":0.01099,"111":0.06046,"112":0.00275,"113":0.00275,"114":0.02748,"115":0.00275,"116":0.02748,"118":0.0055,"119":0.01099,"120":0.02473,"121":0.01099,"122":0.04946,"123":0.00824,"124":0.12091,"125":0.25007,"126":0.03847,"127":0.02473,"128":0.15664,"129":0.02473,"130":0.03298,"131":0.25007,"132":0.42044,"133":7.54876,"134":8.96123,"135":0.01099,"136":0.0055,_:"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 61 62 63 64 65 67 72 73 75 76 77 80 81 83 85 88 95 96 117 137 138"},F:{"87":0.01099,"95":0.0055,"110":0.01099,"116":0.03298,"117":0.23633,_:"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 88 89 90 91 92 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 111 112 113 114 115 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"16":0.00275,"18":0.01099,"92":0.04672,"100":0.00275,"109":0.01649,"110":0.00275,"114":0.04122,"117":0.00275,"119":0.00824,"124":0.00275,"125":0.01649,"126":0.00275,"127":0.00275,"128":0.00824,"129":0.00275,"130":0.00824,"131":0.01374,"132":0.04397,"133":0.57708,"134":1.31904,_:"12 13 14 15 17 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 111 112 113 115 116 118 120 121 122 123"},E:{"14":0.01374,_:"0 4 5 6 7 8 9 10 11 12 13 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 15.4 15.5 16.2 16.4 17.0","13.1":0.00824,"14.1":0.02473,"15.6":0.12091,"16.0":0.00275,"16.1":0.00275,"16.3":0.01374,"16.5":0.00275,"16.6":0.06046,"17.1":0.0055,"17.2":0.00275,"17.3":0.00275,"17.4":0.01649,"17.5":0.09893,"17.6":0.06595,"18.0":0.01099,"18.1":0.04672,"18.2":0.01924,"18.3":0.31327,"18.4":0.0055},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00316,"5.0-5.1":0,"6.0-6.1":0.00947,"7.0-7.1":0.00632,"8.1-8.4":0,"9.0-9.2":0.00474,"9.3":0.0221,"10.0-10.2":0.00158,"10.3":0.03631,"11.0-11.2":0.16735,"11.3-11.4":0.01105,"12.0-12.1":0.00632,"12.2-12.5":0.1563,"13.0-13.1":0.00316,"13.2":0.00474,"13.3":0.00632,"13.4-13.7":0.0221,"14.0-14.4":0.05526,"14.5-14.8":0.06631,"15.0-15.1":0.03631,"15.2-15.3":0.03631,"15.4":0.04421,"15.5":0.05052,"15.6-15.8":0.62203,"16.0":0.08841,"16.1":0.18156,"16.2":0.09473,"16.3":0.16419,"16.4":0.03631,"16.5":0.06789,"16.6-16.7":0.73728,"17.0":0.04421,"17.1":0.07894,"17.2":0.05999,"17.3":0.08367,"17.4":0.16735,"17.5":0.37259,"17.6-17.7":1.08145,"18.0":0.30312,"18.1":0.99146,"18.2":0.44363,"18.3":9.27206,"18.4":0.13735},P:{"4":0.01033,"20":0.01033,"21":0.02066,"22":0.03099,"23":0.05164,"24":0.03099,"25":0.11361,"26":0.09296,"27":1.86948,_:"5.0-5.4 6.2-6.4 8.2 9.2 10.1 12.0 13.0 14.0 15.0 17.0 18.0","7.2-7.4":0.0723,"11.1-11.2":0.01033,"16.0":0.01033,"19.0":0.03099},I:{"0":0.03618,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00004},K:{"0":0.23932,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.10992,_:"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.07977},Q:{"14.9":0.13779},O:{"0":1.27635},H:{"0":0},L:{"0":55.77014}};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"1":"K D E F A B mC"},B:{"1":"0 9 C L M G N 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"},C:{"1":"0 1 2 3 4 5 6 7 8 9 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 MC wB NC 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 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC","2":"nC LC J PB K D E qC rC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 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 MC wB NC xB yB zB 0B 1B 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"},E:{"1":"K D E F A B C L M G uC vC wC TC FC GC xC yC 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","16":"J PB sC SC tC"},F:{"1":"0 1 2 3 4 5 6 7 8 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 mB nB oB pB qB 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 5C 6C 7C FC kC 8C GC","16":"F 4C"},G:{"1":"E CD DD ED FD GD HD ID JD KD LD 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":"SC 9C","16":"lC AD BD"},H:{"2":"WD"},I:{"1":"I aD lC bD cD","2":"LC J XD YD ZD"},J:{"1":"A","2":"D"},K:{"1":"A B C H FC kC GC"},L:{"1":"I"},M:{"1":"EC"},N:{"1":"B","2":"A"},O:{"1":"HC"},P:{"1":"1 2 3 4 5 6 7 8 J dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD"},Q:{"1":"oD"},R:{"1":"pD"},S:{"1":"qD rD"}},B:7,C:"Document.execCommand()",D:true};
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017 Evgeny Poberezkin
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
Reference in New Issue
Block a user