docs: 仓库链接指向本镜像仓库
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s

This commit is contained in:
TanTan committed 2026-11-13 09:25:58 +08:00
1 parent f954252a34
commit e311ca3275
35554 files changed
+6229626 -4

No files matched your search

@@ -0,0 +1,16 @@
var $09e6b82e0d6e466a$exports = {};
$09e6b82e0d6e466a$exports = {
"select": `Select`,
"selectAll": `Select All`,
"sortable": `sortable column`,
"ascending": `ascending`,
"descending": `descending`,
"ascendingSort": (args)=>`sorted by column ${args.columnName} in ascending order`,
"descendingSort": (args)=>`sorted by column ${args.columnName} in descending order`,
"columnSize": (args)=>`${args.value} pixels`,
"resizerDescription": `Press Enter to start resizing`
};
export {$09e6b82e0d6e466a$exports as default};
//# sourceMappingURL=en-US.module.js.map
@@ -0,0 +1,29 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
module.exports = {
meta: {
docs: {
description: "disallow `new.target` meta property.",
category: "ES2015",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-new-target.html",
},
fixable: null,
messages: {
forbidden: "ES2015 'new.target' meta property is forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
"MetaProperty[meta.name='new'][property.name='target']"(node) {
context.report({ node, messageId: "forbidden" })
},
}
},
}
@@ -0,0 +1,39 @@
import createPadding from './_createPadding.js';
import stringSize from './_stringSize.js';
import toInteger from './toInteger.js';
import toString from './toString.js';
/**
* Pads `string` on the left side if it's shorter than `length`. Padding
* characters are truncated if they exceed `length`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category String
* @param {string} [string=''] The string to pad.
* @param {number} [length=0] The padding length.
* @param {string} [chars=' '] The string used as padding.
* @returns {string} Returns the padded string.
* @example
*
* _.padStart('abc', 6);
* // => ' abc'
*
* _.padStart('abc', 6, '_-');
* // => '_-_abc'
*
* _.padStart('abc', 3);
* // => 'abc'
*/
function padStart(string, length, chars) {
string = toString(string);
length = toInteger(length);
var strLength = length ? stringSize(string) : 0;
return (length && strLength < length)
? (createPadding(length - strLength, chars) + string)
: string;
}
export default padStart;
@@ -0,0 +1,238 @@
/**
* @fileoverview Rule to flag when IIFE is not wrapped in parens
* @author Ilya Volodin
* @deprecated in ESLint v8.53.0
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
const eslintUtils = require("@eslint-community/eslint-utils");
//----------------------------------------------------------------------
// Helpers
//----------------------------------------------------------------------
/**
* Check if the given node is callee of a `NewExpression` node
* @param {ASTNode} node node to check
* @returns {boolean} True if the node is callee of a `NewExpression` node
* @private
*/
function isCalleeOfNewExpression(node) {
const maybeCallee =
node.parent.type === "ChainExpression" ? node.parent : node;
return (
maybeCallee.parent.type === "NewExpression" &&
maybeCallee.parent.callee === maybeCallee
);
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
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: "11.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "wrap-iife",
url: "https://eslint.style/rules/wrap-iife",
},
},
],
},
type: "layout",
docs: {
description:
"Require parentheses around immediate `function` invocations",
recommended: false,
url: "https://eslint.org/docs/latest/rules/wrap-iife",
},
schema: [
{
enum: ["outside", "inside", "any"],
},
{
type: "object",
properties: {
functionPrototypeMethods: {
type: "boolean",
default: false,
},
},
additionalProperties: false,
},
],
fixable: "code",
messages: {
wrapInvocation:
"Wrap an immediate function invocation in parentheses.",
wrapExpression: "Wrap only the function expression in parens.",
moveInvocation:
"Move the invocation into the parens that contain the function.",
},
},
create(context) {
const style = context.options[0] || "outside";
const includeFunctionPrototypeMethods =
context.options[1] && context.options[1].functionPrototypeMethods;
const sourceCode = context.sourceCode;
/**
* Check if the node is wrapped in any (). All parens count: grouping parens and parens for constructs such as if()
* @param {ASTNode} node node to evaluate
* @returns {boolean} True if it is wrapped in any parens
* @private
*/
function isWrappedInAnyParens(node) {
return astUtils.isParenthesised(sourceCode, node);
}
/**
* Check if the node is wrapped in grouping (). Parens for constructs such as if() don't count
* @param {ASTNode} node node to evaluate
* @returns {boolean} True if it is wrapped in grouping parens
* @private
*/
function isWrappedInGroupingParens(node) {
return eslintUtils.isParenthesized(1, node, sourceCode);
}
/**
* Get the function node from an IIFE
* @param {ASTNode} node node to evaluate
* @returns {ASTNode} node that is the function expression of the given IIFE, or null if none exist
*/
function getFunctionNodeFromIIFE(node) {
const callee = astUtils.skipChainExpression(node.callee);
if (callee.type === "FunctionExpression") {
return callee;
}
if (
includeFunctionPrototypeMethods &&
callee.type === "MemberExpression" &&
callee.object.type === "FunctionExpression" &&
(astUtils.getStaticPropertyName(callee) === "call" ||
astUtils.getStaticPropertyName(callee) === "apply")
) {
return callee.object;
}
return null;
}
return {
CallExpression(node) {
const innerNode = getFunctionNodeFromIIFE(node);
if (!innerNode) {
return;
}
const isCallExpressionWrapped = isWrappedInAnyParens(node),
isFunctionExpressionWrapped =
isWrappedInAnyParens(innerNode);
if (!isCallExpressionWrapped && !isFunctionExpressionWrapped) {
context.report({
node,
messageId: "wrapInvocation",
fix(fixer) {
const nodeToSurround =
style === "inside" ? innerNode : node;
return fixer.replaceText(
nodeToSurround,
`(${sourceCode.getText(nodeToSurround)})`,
);
},
});
} else if (style === "inside" && !isFunctionExpressionWrapped) {
context.report({
node,
messageId: "wrapExpression",
fix(fixer) {
// The outer call expression will always be wrapped at this point.
if (
isWrappedInGroupingParens(node) &&
!isCalleeOfNewExpression(node)
) {
/*
* Parenthesize the function expression and remove unnecessary grouping parens around the call expression.
* Replace the range between the end of the function expression and the end of the call expression.
* for example, in `(function(foo) {}(bar))`, the range `(bar))` should get replaced with `)(bar)`.
*/
const parenAfter =
sourceCode.getTokenAfter(node);
return fixer.replaceTextRange(
[innerNode.range[1], parenAfter.range[1]],
`)${sourceCode.getText().slice(innerNode.range[1], parenAfter.range[0])}`,
);
}
/*
* Call expression is wrapped in mandatory parens such as if(), or in necessary grouping parens.
* These parens cannot be removed, so just parenthesize the function expression.
*/
return fixer.replaceText(
innerNode,
`(${sourceCode.getText(innerNode)})`,
);
},
});
} else if (style === "outside" && !isCallExpressionWrapped) {
context.report({
node,
messageId: "moveInvocation",
fix(fixer) {
/*
* The inner function expression will always be wrapped at this point.
* It's only necessary to replace the range between the end of the function expression
* and the call expression. For example, in `(function(foo) {})(bar)`, the range `)(bar)`
* should get replaced with `(bar))`.
*/
const parenAfter =
sourceCode.getTokenAfter(innerNode);
return fixer.replaceTextRange(
[parenAfter.range[0], node.range[1]],
`${sourceCode.getText().slice(parenAfter.range[1], node.range[1])})`,
);
},
});
}
},
};
},
};
@@ -0,0 +1,29 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _react = require("react");
var diffTwoDeps = function diffTwoDeps(deps1, deps2) {
// Let's do a reference equality check on 2 dependency list.
// If deps1 is defined, we iterate over deps1 and do comparison on each element with equivalent element from deps2
// As this func is used only in this hook, we assume 2 deps always have same length.
return deps1 ? deps1.map(function (_, idx) {
return !Object.is(deps1[idx], deps2 === null || deps2 === void 0 ? void 0 : deps2[idx]) ? idx : -1;
}).filter(function (ele) {
return ele >= 0;
}) : deps2 ? deps2.map(function (_, idx) {
return idx;
}) : [];
};
var useTrackedEffect = function useTrackedEffect(effect, deps) {
var previousDepsRef = (0, _react.useRef)(undefined);
(0, _react.useEffect)(function () {
var changes = diffTwoDeps(previousDepsRef.current, deps);
var previousDeps = previousDepsRef.current;
previousDepsRef.current = deps;
return effect(changes, previousDeps, deps);
}, deps);
};
var _default = exports["default"] = useTrackedEffect;
@@ -0,0 +1,56 @@
{
"name": "minipass",
"version": "3.3.6",
"description": "minimal implementation of a PassThrough stream",
"main": "index.js",
"types": "index.d.ts",
"dependencies": {
"yallist": "^4.0.0"
},
"devDependencies": {
"@types/node": "^17.0.41",
"end-of-stream": "^1.4.0",
"prettier": "^2.6.2",
"tap": "^16.2.0",
"through2": "^2.0.3",
"ts-node": "^10.8.1",
"typescript": "^4.7.3"
},
"scripts": {
"test": "tap",
"preversion": "npm test",
"postversion": "npm publish",
"postpublish": "git push origin --follow-tags"
},
"repository": {
"type": "git",
"url": "git+https://github.com/isaacs/minipass.git"
},
"keywords": [
"passthrough",
"stream"
],
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
"license": "ISC",
"files": [
"index.d.ts",
"index.js"
],
"tap": {
"check-coverage": true
},
"engines": {
"node": ">=8"
},
"prettier": {
"semi": false,
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"jsxSingleQuote": false,
"bracketSameLine": true,
"arrowParens": "avoid",
"endOfLine": "lf"
}
}
@@ -0,0 +1,464 @@
(function (global, factory) {
if (typeof exports === 'object' && typeof module !== 'undefined') {
factory(module);
module.exports = def(module);
} else if (typeof define === 'function' && define.amd) {
define(['module'], function(mod) {
factory.apply(this, arguments);
mod.exports = def(mod);
});
} else {
const mod = { exports: {} };
factory(mod);
global = typeof globalThis !== 'undefined' ? globalThis : global || self;
global.sourcemapCodec = def(mod);
}
function def(m) { return 'default' in m.exports ? m.exports.default : m.exports; }
})(this, (function (module) {
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/sourcemap-codec.ts
var sourcemap_codec_exports = {};
__export(sourcemap_codec_exports, {
decode: () => decode,
decodeGeneratedRanges: () => decodeGeneratedRanges,
decodeOriginalScopes: () => decodeOriginalScopes,
encode: () => encode,
encodeGeneratedRanges: () => encodeGeneratedRanges,
encodeOriginalScopes: () => encodeOriginalScopes
});
module.exports = __toCommonJS(sourcemap_codec_exports);
// src/vlq.ts
var comma = ",".charCodeAt(0);
var semicolon = ";".charCodeAt(0);
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var intToChar = new Uint8Array(64);
var charToInt = new Uint8Array(128);
for (let i = 0; i < chars.length; i++) {
const c = chars.charCodeAt(i);
intToChar[i] = c;
charToInt[c] = i;
}
function decodeInteger(reader, relative) {
let value = 0;
let shift = 0;
let integer = 0;
do {
const c = reader.next();
integer = charToInt[c];
value |= (integer & 31) << shift;
shift += 5;
} while (integer & 32);
const shouldNegate = value & 1;
value >>>= 1;
if (shouldNegate) {
value = -2147483648 | -value;
}
return relative + value;
}
function encodeInteger(builder, num, relative) {
let delta = num - relative;
delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
do {
let clamped = delta & 31;
delta >>>= 5;
if (delta > 0) clamped |= 32;
builder.write(intToChar[clamped]);
} while (delta > 0);
return num;
}
function hasMoreVlq(reader, max) {
if (reader.pos >= max) return false;
return reader.peek() !== comma;
}
// src/strings.ts
var bufLength = 1024 * 16;
var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? {
decode(buf) {
const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
return out.toString();
}
} : {
decode(buf) {
let out = "";
for (let i = 0; i < buf.length; i++) {
out += String.fromCharCode(buf[i]);
}
return out;
}
};
var StringWriter = class {
constructor() {
this.pos = 0;
this.out = "";
this.buffer = new Uint8Array(bufLength);
}
write(v) {
const { buffer } = this;
buffer[this.pos++] = v;
if (this.pos === bufLength) {
this.out += td.decode(buffer);
this.pos = 0;
}
}
flush() {
const { buffer, out, pos } = this;
return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
}
};
var StringReader = class {
constructor(buffer) {
this.pos = 0;
this.buffer = buffer;
}
next() {
return this.buffer.charCodeAt(this.pos++);
}
peek() {
return this.buffer.charCodeAt(this.pos);
}
indexOf(char) {
const { buffer, pos } = this;
const idx = buffer.indexOf(char, pos);
return idx === -1 ? buffer.length : idx;
}
};
// src/scopes.ts
var EMPTY = [];
function decodeOriginalScopes(input) {
const { length } = input;
const reader = new StringReader(input);
const scopes = [];
const stack = [];
let line = 0;
for (; reader.pos < length; reader.pos++) {
line = decodeInteger(reader, line);
const column = decodeInteger(reader, 0);
if (!hasMoreVlq(reader, length)) {
const last = stack.pop();
last[2] = line;
last[3] = column;
continue;
}
const kind = decodeInteger(reader, 0);
const fields = decodeInteger(reader, 0);
const hasName = fields & 1;
const scope = hasName ? [line, column, 0, 0, kind, decodeInteger(reader, 0)] : [line, column, 0, 0, kind];
let vars = EMPTY;
if (hasMoreVlq(reader, length)) {
vars = [];
do {
const varsIndex = decodeInteger(reader, 0);
vars.push(varsIndex);
} while (hasMoreVlq(reader, length));
}
scope.vars = vars;
scopes.push(scope);
stack.push(scope);
}
return scopes;
}
function encodeOriginalScopes(scopes) {
const writer = new StringWriter();
for (let i = 0; i < scopes.length; ) {
i = _encodeOriginalScopes(scopes, i, writer, [0]);
}
return writer.flush();
}
function _encodeOriginalScopes(scopes, index, writer, state) {
const scope = scopes[index];
const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind, vars } = scope;
if (index > 0) writer.write(comma);
state[0] = encodeInteger(writer, startLine, state[0]);
encodeInteger(writer, startColumn, 0);
encodeInteger(writer, kind, 0);
const fields = scope.length === 6 ? 1 : 0;
encodeInteger(writer, fields, 0);
if (scope.length === 6) encodeInteger(writer, scope[5], 0);
for (const v of vars) {
encodeInteger(writer, v, 0);
}
for (index++; index < scopes.length; ) {
const next = scopes[index];
const { 0: l, 1: c } = next;
if (l > endLine || l === endLine && c >= endColumn) {
break;
}
index = _encodeOriginalScopes(scopes, index, writer, state);
}
writer.write(comma);
state[0] = encodeInteger(writer, endLine, state[0]);
encodeInteger(writer, endColumn, 0);
return index;
}
function decodeGeneratedRanges(input) {
const { length } = input;
const reader = new StringReader(input);
const ranges = [];
const stack = [];
let genLine = 0;
let definitionSourcesIndex = 0;
let definitionScopeIndex = 0;
let callsiteSourcesIndex = 0;
let callsiteLine = 0;
let callsiteColumn = 0;
let bindingLine = 0;
let bindingColumn = 0;
do {
const semi = reader.indexOf(";");
let genColumn = 0;
for (; reader.pos < semi; reader.pos++) {
genColumn = decodeInteger(reader, genColumn);
if (!hasMoreVlq(reader, semi)) {
const last = stack.pop();
last[2] = genLine;
last[3] = genColumn;
continue;
}
const fields = decodeInteger(reader, 0);
const hasDefinition = fields & 1;
const hasCallsite = fields & 2;
const hasScope = fields & 4;
let callsite = null;
let bindings = EMPTY;
let range;
if (hasDefinition) {
const defSourcesIndex = decodeInteger(reader, definitionSourcesIndex);
definitionScopeIndex = decodeInteger(
reader,
definitionSourcesIndex === defSourcesIndex ? definitionScopeIndex : 0
);
definitionSourcesIndex = defSourcesIndex;
range = [genLine, genColumn, 0, 0, defSourcesIndex, definitionScopeIndex];
} else {
range = [genLine, genColumn, 0, 0];
}
range.isScope = !!hasScope;
if (hasCallsite) {
const prevCsi = callsiteSourcesIndex;
const prevLine = callsiteLine;
callsiteSourcesIndex = decodeInteger(reader, callsiteSourcesIndex);
const sameSource = prevCsi === callsiteSourcesIndex;
callsiteLine = decodeInteger(reader, sameSource ? callsiteLine : 0);
callsiteColumn = decodeInteger(
reader,
sameSource && prevLine === callsiteLine ? callsiteColumn : 0
);
callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn];
}
range.callsite = callsite;
if (hasMoreVlq(reader, semi)) {
bindings = [];
do {
bindingLine = genLine;
bindingColumn = genColumn;
const expressionsCount = decodeInteger(reader, 0);
let expressionRanges;
if (expressionsCount < -1) {
expressionRanges = [[decodeInteger(reader, 0)]];
for (let i = -1; i > expressionsCount; i--) {
const prevBl = bindingLine;
bindingLine = decodeInteger(reader, bindingLine);
bindingColumn = decodeInteger(reader, bindingLine === prevBl ? bindingColumn : 0);
const expression = decodeInteger(reader, 0);
expressionRanges.push([expression, bindingLine, bindingColumn]);
}
} else {
expressionRanges = [[expressionsCount]];
}
bindings.push(expressionRanges);
} while (hasMoreVlq(reader, semi));
}
range.bindings = bindings;
ranges.push(range);
stack.push(range);
}
genLine++;
reader.pos = semi + 1;
} while (reader.pos < length);
return ranges;
}
function encodeGeneratedRanges(ranges) {
if (ranges.length === 0) return "";
const writer = new StringWriter();
for (let i = 0; i < ranges.length; ) {
i = _encodeGeneratedRanges(ranges, i, writer, [0, 0, 0, 0, 0, 0, 0]);
}
return writer.flush();
}
function _encodeGeneratedRanges(ranges, index, writer, state) {
const range = ranges[index];
const {
0: startLine,
1: startColumn,
2: endLine,
3: endColumn,
isScope,
callsite,
bindings
} = range;
if (state[0] < startLine) {
catchupLine(writer, state[0], startLine);
state[0] = startLine;
state[1] = 0;
} else if (index > 0) {
writer.write(comma);
}
state[1] = encodeInteger(writer, range[1], state[1]);
const fields = (range.length === 6 ? 1 : 0) | (callsite ? 2 : 0) | (isScope ? 4 : 0);
encodeInteger(writer, fields, 0);
if (range.length === 6) {
const { 4: sourcesIndex, 5: scopesIndex } = range;
if (sourcesIndex !== state[2]) {
state[3] = 0;
}
state[2] = encodeInteger(writer, sourcesIndex, state[2]);
state[3] = encodeInteger(writer, scopesIndex, state[3]);
}
if (callsite) {
const { 0: sourcesIndex, 1: callLine, 2: callColumn } = range.callsite;
if (sourcesIndex !== state[4]) {
state[5] = 0;
state[6] = 0;
} else if (callLine !== state[5]) {
state[6] = 0;
}
state[4] = encodeInteger(writer, sourcesIndex, state[4]);
state[5] = encodeInteger(writer, callLine, state[5]);
state[6] = encodeInteger(writer, callColumn, state[6]);
}
if (bindings) {
for (const binding of bindings) {
if (binding.length > 1) encodeInteger(writer, -binding.length, 0);
const expression = binding[0][0];
encodeInteger(writer, expression, 0);
let bindingStartLine = startLine;
let bindingStartColumn = startColumn;
for (let i = 1; i < binding.length; i++) {
const expRange = binding[i];
bindingStartLine = encodeInteger(writer, expRange[1], bindingStartLine);
bindingStartColumn = encodeInteger(writer, expRange[2], bindingStartColumn);
encodeInteger(writer, expRange[0], 0);
}
}
}
for (index++; index < ranges.length; ) {
const next = ranges[index];
const { 0: l, 1: c } = next;
if (l > endLine || l === endLine && c >= endColumn) {
break;
}
index = _encodeGeneratedRanges(ranges, index, writer, state);
}
if (state[0] < endLine) {
catchupLine(writer, state[0], endLine);
state[0] = endLine;
state[1] = 0;
} else {
writer.write(comma);
}
state[1] = encodeInteger(writer, endColumn, state[1]);
return index;
}
function catchupLine(writer, lastLine, line) {
do {
writer.write(semicolon);
} while (++lastLine < line);
}
// src/sourcemap-codec.ts
function decode(mappings) {
const { length } = mappings;
const reader = new StringReader(mappings);
const decoded = [];
let genColumn = 0;
let sourcesIndex = 0;
let sourceLine = 0;
let sourceColumn = 0;
let namesIndex = 0;
do {
const semi = reader.indexOf(";");
const line = [];
let sorted = true;
let lastCol = 0;
genColumn = 0;
while (reader.pos < semi) {
let seg;
genColumn = decodeInteger(reader, genColumn);
if (genColumn < lastCol) sorted = false;
lastCol = genColumn;
if (hasMoreVlq(reader, semi)) {
sourcesIndex = decodeInteger(reader, sourcesIndex);
sourceLine = decodeInteger(reader, sourceLine);
sourceColumn = decodeInteger(reader, sourceColumn);
if (hasMoreVlq(reader, semi)) {
namesIndex = decodeInteger(reader, namesIndex);
seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex];
} else {
seg = [genColumn, sourcesIndex, sourceLine, sourceColumn];
}
} else {
seg = [genColumn];
}
line.push(seg);
reader.pos++;
}
if (!sorted) sort(line);
decoded.push(line);
reader.pos = semi + 1;
} while (reader.pos <= length);
return decoded;
}
function sort(line) {
line.sort(sortComparator);
}
function sortComparator(a, b) {
return a[0] - b[0];
}
function encode(decoded) {
const writer = new StringWriter();
let sourcesIndex = 0;
let sourceLine = 0;
let sourceColumn = 0;
let namesIndex = 0;
for (let i = 0; i < decoded.length; i++) {
const line = decoded[i];
if (i > 0) writer.write(semicolon);
if (line.length === 0) continue;
let genColumn = 0;
for (let j = 0; j < line.length; j++) {
const segment = line[j];
if (j > 0) writer.write(comma);
genColumn = encodeInteger(writer, segment[0], genColumn);
if (segment.length === 1) continue;
sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
sourceLine = encodeInteger(writer, segment[2], sourceLine);
sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
if (segment.length === 4) continue;
namesIndex = encodeInteger(writer, segment[4], namesIndex);
}
}
return writer.flush();
}
}));
//# sourceMappingURL=sourcemap-codec.umd.js.map
@@ -0,0 +1,22 @@
'use strict';
var $TypeError = require('es-errors/type');
var $isNaN = require('math-intrinsics/isNaN');
var padTimeComponent = require('../helpers/padTimeComponent');
var HourFromTime = require('./HourFromTime');
var MinFromTime = require('./MinFromTime');
var SecFromTime = require('./SecFromTime');
// https://262.ecma-international.org/9.0/#sec-timestring
module.exports = function TimeString(tv) {
if (typeof tv !== 'number' || $isNaN(tv)) {
throw new $TypeError('Assertion failed: `tv` must be a non-NaN Number');
}
var hour = HourFromTime(tv);
var minute = MinFromTime(tv);
var second = SecFromTime(tv);
return padTimeComponent(hour) + ':' + padTimeComponent(minute) + ':' + padTimeComponent(second) + '\x20GMT';
};
@@ -0,0 +1 @@
{"version":3,"file":"tryBuildGetPlanOptionsFromResolvedValueElementMetadata.spec.d.ts","sourceRoot":"","sources":["../../../../src/planning/calculations/tryBuildGetPlanOptionsFromResolvedValueElementMetadata.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
var stringify = require('../');
var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 };
var s = stringify(obj, function (a, b) {
return a.value < b.value ? 1 : -1;
});
console.log(s);
@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var SliderRole = {
relatedConcepts: [{
module: 'ARIA',
concept: {
name: 'slider'
}
}, {
module: 'HTML',
concept: {
name: 'input',
attributes: [{
name: 'type',
value: 'range'
}]
}
}],
type: 'widget'
};
var _default = SliderRole;
exports.default = _default;
@@ -0,0 +1,19 @@
Copyright (c) 2012 Raynos.
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.
@@ -0,0 +1,573 @@
import * as diff from 'fast-diff';
import cloneDeep = require('lodash.clonedeep');
import isEqual = require('lodash.isequal');
import AttributeMap from './AttributeMap';
import Op from './Op';
import OpIterator from './OpIterator';
const NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff()
interface EmbedHandler<T> {
compose(a: T, b: T, keepNull: boolean): T;
invert(a: T, b: T): T;
transform(a: T, b: T, priority: boolean): T;
}
const getEmbedTypeAndData = (
a: Op['insert'] | Op['retain'],
b: Op['insert'],
): [string, unknown, unknown] => {
if (typeof a !== 'object' || a === null) {
throw new Error(`cannot retain a ${typeof a}`);
}
if (typeof b !== 'object' || b === null) {
throw new Error(`cannot retain a ${typeof b}`);
}
const embedType = Object.keys(a)[0];
if (!embedType || embedType !== Object.keys(b)[0]) {
throw new Error(
`embed types not matched: ${embedType} != ${Object.keys(b)[0]}`,
);
}
return [embedType, a[embedType], b[embedType]];
};
class Delta {
static Op = Op;
static OpIterator = OpIterator;
static AttributeMap = AttributeMap;
private static handlers: { [embedType: string]: EmbedHandler<unknown> } = {};
static registerEmbed<T>(embedType: string, handler: EmbedHandler<T>): void {
this.handlers[embedType] = handler;
}
static unregisterEmbed(embedType: string): void {
delete this.handlers[embedType];
}
private static getHandler(embedType: string): EmbedHandler<unknown> {
const handler = this.handlers[embedType];
if (!handler) {
throw new Error(`no handlers for embed type "${embedType}"`);
}
return handler;
}
ops: Op[];
constructor(ops?: Op[] | { ops: Op[] }) {
// Assume we are given a well formed ops
if (Array.isArray(ops)) {
this.ops = ops;
} else if (ops != null && Array.isArray(ops.ops)) {
this.ops = ops.ops;
} else {
this.ops = [];
}
}
insert(
arg: string | Record<string, unknown>,
attributes?: AttributeMap | null,
): this {
const newOp: Op = {};
if (typeof arg === 'string' && arg.length === 0) {
return this;
}
newOp.insert = arg;
if (
attributes != null &&
typeof attributes === 'object' &&
Object.keys(attributes).length > 0
) {
newOp.attributes = attributes;
}
return this.push(newOp);
}
delete(length: number): this {
if (length <= 0) {
return this;
}
return this.push({ delete: length });
}
retain(
length: number | Record<string, unknown>,
attributes?: AttributeMap | null,
): this {
if (typeof length === 'number' && length <= 0) {
return this;
}
const newOp: Op = { retain: length };
if (
attributes != null &&
typeof attributes === 'object' &&
Object.keys(attributes).length > 0
) {
newOp.attributes = attributes;
}
return this.push(newOp);
}
push(newOp: Op): this {
let index = this.ops.length;
let lastOp = this.ops[index - 1];
newOp = cloneDeep(newOp);
if (typeof lastOp === 'object') {
if (
typeof newOp.delete === 'number' &&
typeof lastOp.delete === 'number'
) {
this.ops[index - 1] = { delete: lastOp.delete + newOp.delete };
return this;
}
// Since it does not matter if we insert before or after deleting at the same index,
// always prefer to insert first
if (typeof lastOp.delete === 'number' && newOp.insert != null) {
index -= 1;
lastOp = this.ops[index - 1];
if (typeof lastOp !== 'object') {
this.ops.unshift(newOp);
return this;
}
}
if (isEqual(newOp.attributes, lastOp.attributes)) {
if (
typeof newOp.insert === 'string' &&
typeof lastOp.insert === 'string'
) {
this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };
if (typeof newOp.attributes === 'object') {
this.ops[index - 1].attributes = newOp.attributes;
}
return this;
} else if (
typeof newOp.retain === 'number' &&
typeof lastOp.retain === 'number'
) {
this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };
if (typeof newOp.attributes === 'object') {
this.ops[index - 1].attributes = newOp.attributes;
}
return this;
}
}
}
if (index === this.ops.length) {
this.ops.push(newOp);
} else {
this.ops.splice(index, 0, newOp);
}
return this;
}
chop(): this {
const lastOp = this.ops[this.ops.length - 1];
if (lastOp && typeof lastOp.retain === 'number' && !lastOp.attributes) {
this.ops.pop();
}
return this;
}
filter(predicate: (op: Op, index: number) => boolean): Op[] {
return this.ops.filter(predicate);
}
forEach(predicate: (op: Op, index: number) => void): void {
this.ops.forEach(predicate);
}
map<T>(predicate: (op: Op, index: number) => T): T[] {
return this.ops.map(predicate);
}
partition(predicate: (op: Op) => boolean): [Op[], Op[]] {
const passed: Op[] = [];
const failed: Op[] = [];
this.forEach((op) => {
const target = predicate(op) ? passed : failed;
target.push(op);
});
return [passed, failed];
}
reduce<T>(
predicate: (accum: T, curr: Op, index: number) => T,
initialValue: T,
): T {
return this.ops.reduce(predicate, initialValue);
}
changeLength(): number {
return this.reduce((length, elem) => {
if (elem.insert) {
return length + Op.length(elem);
} else if (elem.delete) {
return length - elem.delete;
}
return length;
}, 0);
}
length(): number {
return this.reduce((length, elem) => {
return length + Op.length(elem);
}, 0);
}
slice(start = 0, end = Infinity): Delta {
const ops = [];
const iter = new OpIterator(this.ops);
let index = 0;
while (index < end && iter.hasNext()) {
let nextOp;
if (index < start) {
nextOp = iter.next(start - index);
} else {
nextOp = iter.next(end - index);
ops.push(nextOp);
}
index += Op.length(nextOp);
}
return new Delta(ops);
}
compose(other: Delta): Delta {
const thisIter = new OpIterator(this.ops);
const otherIter = new OpIterator(other.ops);
const ops = [];
const firstOther = otherIter.peek();
if (
firstOther != null &&
typeof firstOther.retain === 'number' &&
firstOther.attributes == null
) {
let firstLeft = firstOther.retain;
while (
thisIter.peekType() === 'insert' &&
thisIter.peekLength() <= firstLeft
) {
firstLeft -= thisIter.peekLength();
ops.push(thisIter.next());
}
if (firstOther.retain - firstLeft > 0) {
otherIter.next(firstOther.retain - firstLeft);
}
}
const delta = new Delta(ops);
while (thisIter.hasNext() || otherIter.hasNext()) {
if (otherIter.peekType() === 'insert') {
delta.push(otherIter.next());
} else if (thisIter.peekType() === 'delete') {
delta.push(thisIter.next());
} else {
const length = Math.min(thisIter.peekLength(), otherIter.peekLength());
const thisOp = thisIter.next(length);
const otherOp = otherIter.next(length);
if (otherOp.retain) {
const newOp: Op = {};
if (typeof thisOp.retain === 'number') {
newOp.retain =
typeof otherOp.retain === 'number' ? length : otherOp.retain;
} else {
if (typeof otherOp.retain === 'number') {
if (thisOp.retain == null) {
newOp.insert = thisOp.insert;
} else {
newOp.retain = thisOp.retain;
}
} else {
const action = thisOp.retain == null ? 'insert' : 'retain';
const [embedType, thisData, otherData] = getEmbedTypeAndData(
thisOp[action],
otherOp.retain,
);
const handler = Delta.getHandler(embedType);
newOp[action] = {
[embedType]: handler.compose(
thisData,
otherData,
action === 'retain',
),
};
}
}
// Preserve null when composing with a retain, otherwise remove it for inserts
const attributes = AttributeMap.compose(
thisOp.attributes,
otherOp.attributes,
typeof thisOp.retain === 'number',
);
if (attributes) {
newOp.attributes = attributes;
}
delta.push(newOp);
// Optimization if rest of other is just retain
if (
!otherIter.hasNext() &&
isEqual(delta.ops[delta.ops.length - 1], newOp)
) {
const rest = new Delta(thisIter.rest());
return delta.concat(rest).chop();
}
// Other op should be delete, we could be an insert or retain
// Insert + delete cancels out
} else if (
typeof otherOp.delete === 'number' &&
(typeof thisOp.retain === 'number' ||
(typeof thisOp.retain === 'object' && thisOp.retain !== null))
) {
delta.push(otherOp);
}
}
}
return delta.chop();
}
concat(other: Delta): Delta {
const delta = new Delta(this.ops.slice());
if (other.ops.length > 0) {
delta.push(other.ops[0]);
delta.ops = delta.ops.concat(other.ops.slice(1));
}
return delta;
}
diff(other: Delta, cursor?: number | diff.CursorInfo): Delta {
if (this.ops === other.ops) {
return new Delta();
}
const strings = [this, other].map((delta) => {
return delta
.map((op) => {
if (op.insert != null) {
return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER;
}
const prep = delta === other ? 'on' : 'with';
throw new Error('diff() called ' + prep + ' non-document');
})
.join('');
});
const retDelta = new Delta();
const diffResult = diff(strings[0], strings[1], cursor, true);
const thisIter = new OpIterator(this.ops);
const otherIter = new OpIterator(other.ops);
diffResult.forEach((component: diff.Diff) => {
let length = component[1].length;
while (length > 0) {
let opLength = 0;
switch (component[0]) {
case diff.INSERT:
opLength = Math.min(otherIter.peekLength(), length);
retDelta.push(otherIter.next(opLength));
break;
case diff.DELETE:
opLength = Math.min(length, thisIter.peekLength());
thisIter.next(opLength);
retDelta.delete(opLength);
break;
case diff.EQUAL:
opLength = Math.min(
thisIter.peekLength(),
otherIter.peekLength(),
length,
);
const thisOp = thisIter.next(opLength);
const otherOp = otherIter.next(opLength);
if (isEqual(thisOp.insert, otherOp.insert)) {
retDelta.retain(
opLength,
AttributeMap.diff(thisOp.attributes, otherOp.attributes),
);
} else {
retDelta.push(otherOp).delete(opLength);
}
break;
}
length -= opLength;
}
});
return retDelta.chop();
}
eachLine(
predicate: (
line: Delta,
attributes: AttributeMap,
index: number,
) => boolean | void,
newline = '\n',
): void {
const iter = new OpIterator(this.ops);
let line = new Delta();
let i = 0;
while (iter.hasNext()) {
if (iter.peekType() !== 'insert') {
return;
}
const thisOp = iter.peek();
const start = Op.length(thisOp) - iter.peekLength();
const index =
typeof thisOp.insert === 'string'
? thisOp.insert.indexOf(newline, start) - start
: -1;
if (index < 0) {
line.push(iter.next());
} else if (index > 0) {
line.push(iter.next(index));
} else {
if (predicate(line, iter.next(1).attributes || {}, i) === false) {
return;
}
i += 1;
line = new Delta();
}
}
if (line.length() > 0) {
predicate(line, {}, i);
}
}
invert(base: Delta): Delta {
const inverted = new Delta();
this.reduce((baseIndex, op) => {
if (op.insert) {
inverted.delete(Op.length(op));
} else if (typeof op.retain === 'number' && op.attributes == null) {
inverted.retain(op.retain);
return baseIndex + op.retain;
} else if (op.delete || typeof op.retain === 'number') {
const length = (op.delete || op.retain) as number;
const slice = base.slice(baseIndex, baseIndex + length);
slice.forEach((baseOp) => {
if (op.delete) {
inverted.push(baseOp);
} else if (op.retain && op.attributes) {
inverted.retain(
Op.length(baseOp),
AttributeMap.invert(op.attributes, baseOp.attributes),
);
}
});
return baseIndex + length;
} else if (typeof op.retain === 'object' && op.retain !== null) {
const slice = base.slice(baseIndex, baseIndex + 1);
const baseOp = new OpIterator(slice.ops).next();
const [embedType, opData, baseOpData] = getEmbedTypeAndData(
op.retain,
baseOp.insert,
);
const handler = Delta.getHandler(embedType);
inverted.retain(
{ [embedType]: handler.invert(opData, baseOpData) },
AttributeMap.invert(op.attributes, baseOp.attributes),
);
return baseIndex + 1;
}
return baseIndex;
}, 0);
return inverted.chop();
}
transform(index: number, priority?: boolean): number;
transform(other: Delta, priority?: boolean): Delta;
transform(arg: number | Delta, priority = false): typeof arg {
priority = !!priority;
if (typeof arg === 'number') {
return this.transformPosition(arg, priority);
}
const other: Delta = arg;
const thisIter = new OpIterator(this.ops);
const otherIter = new OpIterator(other.ops);
const delta = new Delta();
while (thisIter.hasNext() || otherIter.hasNext()) {
if (
thisIter.peekType() === 'insert' &&
(priority || otherIter.peekType() !== 'insert')
) {
delta.retain(Op.length(thisIter.next()));
} else if (otherIter.peekType() === 'insert') {
delta.push(otherIter.next());
} else {
const length = Math.min(thisIter.peekLength(), otherIter.peekLength());
const thisOp = thisIter.next(length);
const otherOp = otherIter.next(length);
if (thisOp.delete) {
// Our delete either makes their delete redundant or removes their retain
continue;
} else if (otherOp.delete) {
delta.push(otherOp);
} else {
const thisData = thisOp.retain;
const otherData = otherOp.retain;
let transformedData: Op['retain'] =
typeof otherData === 'object' && otherData !== null
? otherData
: length;
if (
typeof thisData === 'object' &&
thisData !== null &&
typeof otherData === 'object' &&
otherData !== null
) {
const embedType = Object.keys(thisData)[0];
if (embedType === Object.keys(otherData)[0]) {
const handler = Delta.getHandler(embedType);
if (handler) {
transformedData = {
[embedType]: handler.transform(
thisData[embedType],
otherData[embedType],
priority,
),
};
}
}
}
// We retain either their retain or insert
delta.retain(
transformedData,
AttributeMap.transform(
thisOp.attributes,
otherOp.attributes,
priority,
),
);
}
}
}
return delta.chop();
}
transformPosition(index: number, priority = false): number {
priority = !!priority;
const thisIter = new OpIterator(this.ops);
let offset = 0;
while (thisIter.hasNext() && offset <= index) {
const length = thisIter.peekLength();
const nextType = thisIter.peekType();
thisIter.next();
if (nextType === 'delete') {
index -= Math.min(length, index - offset);
continue;
} else if (nextType === 'insert' && (offset < index || !priority)) {
index += length;
}
offset += length;
}
return index;
}
}
export default Delta;
export { Op, OpIterator, AttributeMap };
if (typeof module === 'object') {
module.exports = Delta;
module.exports.default = Delta;
}
@@ -0,0 +1,49 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/use-separator.ts
var use_separator_exports = {};
__export(use_separator_exports, {
useSeparator: () => useSeparator
});
module.exports = __toCommonJS(use_separator_exports);
var import_react_rsc_utils = require("@heroui/react-rsc-utils");
function useSeparator(props) {
let domProps = (0, import_react_rsc_utils.filterDOMProps)(props, {
enabled: typeof props.elementType === "string"
});
let ariaOrientation;
if (props.orientation === "vertical") {
ariaOrientation = "vertical";
}
if (props.elementType !== "hr") {
return {
separatorProps: {
...domProps,
role: "separator",
"aria-orientation": ariaOrientation
}
};
}
return { separatorProps: domProps };
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
useSeparator
});
@@ -0,0 +1 @@
{"version":3,"file":"lru-cache.mjs","sources":["../../src/lib/lru-cache.ts"],"sourcesContent":["// Export is needed because TypeScript complains about an error otherwise:\n// Error: …/tailwind-merge/src/config-utils.ts(8,17): semantic error TS4058: Return type of exported function has or is using name 'LruCache' from external module \"…/tailwind-merge/src/lru-cache\" but cannot be named.\nexport interface LruCache<Key, Value> {\n get(key: Key): Value | undefined\n set(key: Key, value: Value): void\n}\n\n// LRU cache inspired from hashlru (https://github.com/dominictarr/hashlru/blob/v1.0.4/index.js) but object replaced with Map to improve performance\nexport function createLruCache<Key, Value>(maxCacheSize: number): LruCache<Key, Value> {\n if (maxCacheSize < 1) {\n return {\n get: () => undefined,\n set: () => {},\n }\n }\n\n let cacheSize = 0\n let cache = new Map<Key, Value>()\n let previousCache = new Map<Key, Value>()\n\n function update(key: Key, value: Value) {\n cache.set(key, value)\n cacheSize++\n\n if (cacheSize > maxCacheSize) {\n cacheSize = 0\n previousCache = cache\n cache = new Map()\n }\n }\n\n return {\n get(key) {\n let value = cache.get(key)\n\n if (value !== undefined) {\n return value\n }\n if ((value = previousCache.get(key)) !== undefined) {\n update(key, value)\n return value\n }\n },\n set(key, value) {\n if (cache.has(key)) {\n cache.set(key, value)\n } else {\n update(key, value)\n }\n },\n }\n}\n"],"names":["createLruCache","maxCacheSize","get","undefined","set","cacheSize","cache","Map","previousCache","update","key","value","has"],"mappings":"AAOA;AACM,SAAUA,cAAc,CAAaC,YAAoB,EAAA;EAC3D,IAAIA,YAAY,GAAG,CAAC,EAAE;IAClB,OAAO;AACHC,MAAAA,GAAG,EAAE,SAAA,GAAA,GAAA;AAAA,QAAA,OAAMC,SAAS,CAAA;AAAA,OAAA;MACpBC,GAAG,EAAE,eAAK,EAAE;KACf,CAAA;AACJ,GAAA;EAED,IAAIC,SAAS,GAAG,CAAC,CAAA;AACjB,EAAA,IAAIC,KAAK,GAAG,IAAIC,GAAG,EAAc,CAAA;AACjC,EAAA,IAAIC,aAAa,GAAG,IAAID,GAAG,EAAc,CAAA;AAEzC,EAAA,SAASE,MAAM,CAACC,GAAQ,EAAEC,KAAY,EAAA;AAClCL,IAAAA,KAAK,CAACF,GAAG,CAACM,GAAG,EAAEC,KAAK,CAAC,CAAA;AACrBN,IAAAA,SAAS,EAAE,CAAA;IAEX,IAAIA,SAAS,GAAGJ,YAAY,EAAE;AAC1BI,MAAAA,SAAS,GAAG,CAAC,CAAA;AACbG,MAAAA,aAAa,GAAGF,KAAK,CAAA;MACrBA,KAAK,GAAG,IAAIC,GAAG,EAAE,CAAA;AACpB,KAAA;AACL,GAAA;EAEA,OAAO;IACHL,GAAG,EAAA,SAAA,GAAA,CAACQ,GAAG,EAAA;AACH,MAAA,IAAIC,KAAK,GAAGL,KAAK,CAACJ,GAAG,CAACQ,GAAG,CAAC,CAAA;MAE1B,IAAIC,KAAK,KAAKR,SAAS,EAAE;AACrB,QAAA,OAAOQ,KAAK,CAAA;AACf,OAAA;MACD,IAAI,CAACA,KAAK,GAAGH,aAAa,CAACN,GAAG,CAACQ,GAAG,CAAC,MAAMP,SAAS,EAAE;AAChDM,QAAAA,MAAM,CAACC,GAAG,EAAEC,KAAK,CAAC,CAAA;AAClB,QAAA,OAAOA,KAAK,CAAA;AACf,OAAA;KACJ;AACDP,IAAAA,GAAG,EAACM,SAAAA,GAAAA,CAAAA,GAAG,EAAEC,KAAK,EAAA;AACV,MAAA,IAAIL,KAAK,CAACM,GAAG,CAACF,GAAG,CAAC,EAAE;AAChBJ,QAAAA,KAAK,CAACF,GAAG,CAACM,GAAG,EAAEC,KAAK,CAAC,CAAA;AACxB,OAAA,MAAM;AACHF,QAAAA,MAAM,CAACC,GAAG,EAAEC,KAAK,CAAC,CAAA;AACrB,OAAA;AACL,KAAA;GACH,CAAA;AACL;;;;"}
@@ -0,0 +1,13 @@
/**
* @param {Break} _
* @param {Parents | undefined} _1
* @param {State} state
* @param {Info} info
* @returns {string}
*/
export function hardBreak(_: Break, _1: Parents | undefined, state: State, info: Info): string;
import type { Break } from 'mdast';
import type { Parents } from 'mdast';
import type { State } from 'mdast-util-to-markdown';
import type { Info } from 'mdast-util-to-markdown';
//# sourceMappingURL=break.d.ts.map
@@ -0,0 +1,186 @@
import {Options as FastGlobOptions, Entry as FastGlobEntry} from 'fast-glob';
declare namespace globby {
type ExpandDirectoriesOption =
| boolean
| readonly string[]
| {files?: readonly string[]; extensions?: readonly string[]};
type Entry = FastGlobEntry;
interface GlobbyOptions extends FastGlobOptions {
/**
If set to `true`, `globby` will automatically glob directories for you. If you define an `Array` it will only glob files that matches the patterns inside the `Array`. You can also define an `Object` with `files` and `extensions` like in the example below.
Note that if you set this option to `false`, you won't get back matched directories unless you set `onlyFiles: false`.
@default true
@example
```
import globby = require('globby');
(async () => {
const paths = await globby('images', {
expandDirectories: {
files: ['cat', 'unicorn', '*.jpg'],
extensions: ['png']
}
});
console.log(paths);
//=> ['cat.png', 'unicorn.png', 'cow.jpg', 'rainbow.jpg']
})();
```
*/
readonly expandDirectories?: ExpandDirectoriesOption;
/**
Respect ignore patterns in `.gitignore` files that apply to the globbed files.
@default false
*/
readonly gitignore?: boolean;
}
interface GlobTask {
readonly pattern: string;
readonly options: GlobbyOptions;
}
interface GitignoreOptions {
readonly cwd?: string;
readonly ignore?: readonly string[];
}
type FilterFunction = (path: string) => boolean;
}
interface Gitignore {
/**
@returns A filter function indicating whether a given path is ignored via a `.gitignore` file.
*/
sync: (options?: globby.GitignoreOptions) => globby.FilterFunction;
/**
`.gitignore` files matched by the ignore config are not used for the resulting filter function.
@returns A filter function indicating whether a given path is ignored via a `.gitignore` file.
@example
```
import {gitignore} from 'globby';
(async () => {
const isIgnored = await gitignore();
console.log(isIgnored('some/file'));
})();
```
*/
(options?: globby.GitignoreOptions): Promise<globby.FilterFunction>;
}
declare const globby: {
/**
Find files and directories using glob patterns.
Note that glob patterns can only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use `path.posix.join()` instead of `path.join()`.
@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3) in addition to the ones in this package.
@returns The matching paths.
*/
sync: ((
patterns: string | readonly string[],
options: globby.GlobbyOptions & {objectMode: true}
) => globby.Entry[]) & ((
patterns: string | readonly string[],
options?: globby.GlobbyOptions
) => string[]);
/**
Find files and directories using glob patterns.
Note that glob patterns can only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use `path.posix.join()` instead of `path.join()`.
@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3) in addition to the ones in this package.
@returns The stream of matching paths.
@example
```
import globby = require('globby');
(async () => {
for await (const path of globby.stream('*.tmp')) {
console.log(path);
}
})();
```
*/
stream: (
patterns: string | readonly string[],
options?: globby.GlobbyOptions
) => NodeJS.ReadableStream;
/**
Note that you should avoid running the same tasks multiple times as they contain a file system cache. Instead, run this method each time to ensure file system changes are taken into consideration.
@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3) in addition to the ones in this package.
@returns An object in the format `{pattern: string, options: object}`, which can be passed as arguments to [`fast-glob`](https://github.com/mrmlnc/fast-glob). This is useful for other globbing-related packages.
*/
generateGlobTasks: (
patterns: string | readonly string[],
options?: globby.GlobbyOptions
) => globby.GlobTask[];
/**
Note that the options affect the results.
This function is backed by [`fast-glob`](https://github.com/mrmlnc/fast-glob#isdynamicpatternpattern-options).
@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3).
@returns Whether there are any special glob characters in the `patterns`.
*/
hasMagic: (
patterns: string | readonly string[],
options?: FastGlobOptions
) => boolean;
readonly gitignore: Gitignore;
(
patterns: string | readonly string[],
options: globby.GlobbyOptions & {objectMode: true}
): Promise<globby.Entry[]>;
/**
Find files and directories using glob patterns.
Note that glob patterns can only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use `path.posix.join()` instead of `path.join()`.
@param patterns - See the supported [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
@param options - See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3) in addition to the ones in this package.
@returns The matching paths.
@example
```
import globby = require('globby');
(async () => {
const paths = await globby(['*', '!cake']);
console.log(paths);
//=> ['unicorn', 'rainbow']
})();
```
*/
(
patterns: string | readonly string[],
options?: globby.GlobbyOptions
): Promise<string[]>;
};
export = globby;
@@ -0,0 +1,47 @@
/**
* @author Toru Nagashima
* See LICENSE file in root directory for full license.
*/
"use strict"
const checkExistence = require("../util/check-existence")
const getAllowModules = require("../util/get-allow-modules")
const getResolvePaths = require("../util/get-resolve-paths")
const getTryExtensions = require("../util/get-try-extensions")
const visitImport = require("../util/visit-import")
module.exports = {
meta: {
docs: {
description:
"disallow `import` declarations which import non-existence modules",
category: "Possible Errors",
recommended: true,
url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v11.1.0/docs/rules/no-missing-import.md",
},
type: "problem",
fixable: null,
schema: [
{
type: "object",
properties: {
allowModules: getAllowModules.schema,
tryExtensions: getTryExtensions.schema,
resolvePaths: getResolvePaths.schema,
},
additionalProperties: false,
},
],
},
create(context) {
const filePath = context.getFilename()
if (filePath === "<input>") {
return {}
}
return visitImport(context, {}, targets => {
checkExistence(context, targets)
})
},
}
@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var LineBreakRole = {
relatedConcepts: [{
module: 'HTML',
concept: {
name: 'br'
}
}],
type: 'structure'
};
var _default = LineBreakRole;
exports.default = _default;
@@ -0,0 +1,91 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v1.1.0](https://github.com/inspect-js/is-bigint/compare/v1.0.4...v1.1.0) - 2024-12-02
### Commits
- [actions] reuse common workflows [`0e63a44`](https://github.com/inspect-js/is-bigint/commit/0e63a44e5d1f26783bd5a40d7aa32c14b50fd567)
- [meta] use `npmignore` to autogenerate an npmignore file [`47584ee`](https://github.com/inspect-js/is-bigint/commit/47584ee7ac726a5c7f5f2f5f34b97529134cf602)
- [Tests] use `for-each` and `es-value-fixtures` [`f226864`](https://github.com/inspect-js/is-bigint/commit/f22686422b46334c64b3658fba1237751d24460c)
- [New] add types [`78e2c47`](https://github.com/inspect-js/is-bigint/commit/78e2c473ff73d73eef27b7eb27695393667360e1)
- [actions] split out node 10-20, and 20+ [`4395a8d`](https://github.com/inspect-js/is-bigint/commit/4395a8d340b1aa3c4e68b37092fcbcace14de41f)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `has-symbols`, `object-inspect`, `tape` [`c188501`](https://github.com/inspect-js/is-bigint/commit/c188501f67f4c220fcdf8d280c99e1f6af5d217e)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-inspect`, `safe-publish-latest`, `tape` [`5360d32`](https://github.com/inspect-js/is-bigint/commit/5360d32eee0e29f09b02d3adb51086dc71160939)
- [actions] update rebase action to use reusable workflow [`d5c1775`](https://github.com/inspect-js/is-bigint/commit/d5c1775e437be97099a7e63b9bd68852b28e0ba7)
- [actions] update codecov uploader [`c7478c7`](https://github.com/inspect-js/is-bigint/commit/c7478c74498ab954917bd6a561d0ee7d0ba60a6a)
- [Dev Deps] update `@ljharb/eslint-config`, `auto-changelog`, `npmignore`, `object-inspect`, `tape` [`6fbce66`](https://github.com/inspect-js/is-bigint/commit/6fbce66ebab2ef471bfe841c8436eba3dce118c6)
- [meta] add missing `engines.node` [`6f9ed42`](https://github.com/inspect-js/is-bigint/commit/6f9ed42ed8cb00b3fccdb62d4fcc8e7ab074e194)
- [Tests] replace `aud` with `npm audit` [`21846c3`](https://github.com/inspect-js/is-bigint/commit/21846c305e5d662ec81b4922cbc57e9324ccd222)
- [Dev Deps] remove unused `has-symbols`, add missing `has-tostringtag` [`b378d94`](https://github.com/inspect-js/is-bigint/commit/b378d942933ae97ab9610d83d69b52380d6a137c)
- [Deps] update `has-bigints` [`f46c35b`](https://github.com/inspect-js/is-bigint/commit/f46c35be813c05549865477bd771300c2595496e)
- [Dev Deps] add missing peer dep [`2b9be16`](https://github.com/inspect-js/is-bigint/commit/2b9be16ab6150d588f00d037b55050d8372953a3)
## [v1.0.4](https://github.com/inspect-js/is-bigint/compare/v1.0.3...v1.0.4) - 2021-08-11
### Commits
- [eslint] remove unnecessary eslintrc file [`7220aa5`](https://github.com/inspect-js/is-bigint/commit/7220aa515c51649b48ba57bb77f92d85e27557d8)
- [readme] add github actions/codecov badges [`053a071`](https://github.com/inspect-js/is-bigint/commit/053a07123511eef5a91fd7889ae2d8323fbcf7d7)
- [Deps] add `has-bigints` as a runtime dependency [`0fc3c9d`](https://github.com/inspect-js/is-bigint/commit/0fc3c9d5165f62500ea9c27943cb302df65432f7)
- [Dev Deps] update `tape` [`145f11d`](https://github.com/inspect-js/is-bigint/commit/145f11d1d285d92b3144f48178fe0fb3b2f828d9)
## [v1.0.3](https://github.com/inspect-js/is-bigint/compare/v1.0.2...v1.0.3) - 2021-08-06
### Commits
- [Tests] use `has-tostringtag` for easier checking of Symbol.toStringTag [`3b44080`](https://github.com/inspect-js/is-bigint/commit/3b440801b69689d907b33184134f00d7e8a35f9f)
- [Dev Deps] update `auto-changelog`, `eslint`, `object-inspect`, `tape` [`e4d4a6c`](https://github.com/inspect-js/is-bigint/commit/e4d4a6c2ab743b52eda906abd1ed4b0608952533)
- [Fix] use `has-bigints` for more robust BigInt detection [`7bb9d7a`](https://github.com/inspect-js/is-bigint/commit/7bb9d7ab42214c12ce25e9f0cfe2af769388c3bb)
## [v1.0.2](https://github.com/inspect-js/is-bigint/compare/v1.0.1...v1.0.2) - 2021-05-04
### Commits
- [meta] do not publish github action workflow files [`276d677`](https://github.com/inspect-js/is-bigint/commit/276d677d1eac61e990a2f2b523c7cdef70784865)
- [actions] use `node/install` instead of `node/run`; use `codecov` action [`cea7fb6`](https://github.com/inspect-js/is-bigint/commit/cea7fb6e882ad7e2f550de2bd9317a4409bcd735)
- [readme] fix repo URLs; remove travis badge [`c8e7c36`](https://github.com/inspect-js/is-bigint/commit/c8e7c3651f3303fddafa61cf29cfbb79ea2d5d4b)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-symbols`, `object-inspect`, `tape` [`32f3d90`](https://github.com/inspect-js/is-bigint/commit/32f3d909363045fe5d40dde9e4db354344ab4d50)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-inspect`, `tape` [`c2f20f5`](https://github.com/inspect-js/is-bigint/commit/c2f20f577d84e68b4e3224abb51024fbc4b9b2ba)
- [meta] remove unneeded token; update checkout action [`94e46e9`](https://github.com/inspect-js/is-bigint/commit/94e46e92a1a85ec022c8febf8d5d3c2369b46e97)
- [meta] use `prepublishOnly` script for npm 7+ [`3e663ec`](https://github.com/inspect-js/is-bigint/commit/3e663ecb09bfdc5dbaaa37aaef4adf28b5e49035)
## [v1.0.1](https://github.com/inspect-js/is-bigint/compare/v1.0.0...v1.0.1) - 2020-11-30
### Commits
- [Tests] use shared travis-ci configs [`28f1211`](https://github.com/inspect-js/is-bigint/commit/28f1211132ad2a6495d816140680fa16c12eb6f3)
- [Tests] migrate tests to Github Actions [`0998c64`](https://github.com/inspect-js/is-bigint/commit/0998c6443d603028f8b988bcdd52d23dbf513031)
- [meta] add `auto-changelog` [`2352de6`](https://github.com/inspect-js/is-bigint/commit/2352de6df8385b256d75ce50c360947243a599f6)
- [Tests] run `nyc` on all tests [`9c16a9a`](https://github.com/inspect-js/is-bigint/commit/9c16a9a5ddaf7c2c578542ab8f00dd4e72eff541)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `auto-changelog`, `object-inspect`, `tape` [`4cd0edd`](https://github.com/inspect-js/is-bigint/commit/4cd0edd1917f789501291315c9eac5f895fd719e)
- [actions] add automatic rebasing / merge commit blocking [`f0f4b91`](https://github.com/inspect-js/is-bigint/commit/f0f4b91dba029dbca5b3cd27ef91c4fb8e3ec51a)
- [actions] add "Allow Edits" workflow [`7f4f46e`](https://github.com/inspect-js/is-bigint/commit/7f4f46ec07679c00e22287ec55b39ff1e4f809cf)
- [meta] create FUNDING.yml [`2d0cb9a`](https://github.com/inspect-js/is-bigint/commit/2d0cb9ae8ddf635f2c472ce49f95f717f2c432bf)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud` [`0ee110e`](https://github.com/inspect-js/is-bigint/commit/0ee110effdcaa96d90f21a0ec6e625941f77c45a)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `has-symbols`, `object-inspect`, `tape` [`5bb7f3a`](https://github.com/inspect-js/is-bigint/commit/5bb7f3a8de6ec5ee2aa573c22e41884f3d2d1cc3)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`d3d67d0`](https://github.com/inspect-js/is-bigint/commit/d3d67d05f8a3f4cb07085811629f56ef872949c3)
- [Dev Deps] update `auto-changelog`, `tape` [`54e270f`](https://github.com/inspect-js/is-bigint/commit/54e270fa29856dba90f86785fa61bffc79a2825d)
- [Dev Deps] update `@ljharb/eslint-config`, `tape` [`d82bfe7`](https://github.com/inspect-js/is-bigint/commit/d82bfe75c63aeda40f7e473c57f26cea8790ba3a)
- [Dev Deps] update `auto-changelog`; add `aud` [`9c34bd1`](https://github.com/inspect-js/is-bigint/commit/9c34bd1873f08d77c82d8e54ad90c5a1a035e7ea)
- [Tests] add missing `posttest` script [`0690bd9`](https://github.com/inspect-js/is-bigint/commit/0690bd9868d4d8b43424b4224cdbb8659a1c6423)
- [meta] add `funding` field [`7ca36d0`](https://github.com/inspect-js/is-bigint/commit/7ca36d06ebcf6b01a592ecd6758bd2b39c0fb0db)
- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`5ffa8da`](https://github.com/inspect-js/is-bigint/commit/5ffa8dad9f634891cf739ee118f1b43142b0f01d)
- [Dev Deps] update `eslint` [`8512c2f`](https://github.com/inspect-js/is-bigint/commit/8512c2f29a9267fe8fe19209bcf77df94f127172)
- [Tests] only audit prod deps [`f2147dc`](https://github.com/inspect-js/is-bigint/commit/f2147dc54e72594985e8f6db3932a4f0819dc4db)
- [readme] fix header [`d6eff75`](https://github.com/inspect-js/is-bigint/commit/d6eff75d00471f465768deb92867e878c27733b3)
## v1.0.0 - 2018-09-20
### Commits
- [Tests] add tests [`847f12a`](https://github.com/inspect-js/is-bigint/commit/847f12af125fcefb75ed3517550feedf7dd73e88)
- Initial commit [`b53f3c6`](https://github.com/inspect-js/is-bigint/commit/b53f3c6754e7fd7a9982ff5b1466c4dc9799dad9)
- readme [`66c15fe`](https://github.com/inspect-js/is-bigint/commit/66c15fe1a0d965b8c78bf3a3bfc289dcfec53ee1)
- Implementation [`c2c0974`](https://github.com/inspect-js/is-bigint/commit/c2c0974397825a2a56e1ea8af0546171309d4805)
- package.json [`98b174c`](https://github.com/inspect-js/is-bigint/commit/98b174c24b070053f0548e58f9b87bc9dbdf922a)
- Only apps should have lockfiles [`a77c74b`](https://github.com/inspect-js/is-bigint/commit/a77c74bd8ca5f058f1e6165ae7b33bb84adef98c)
@@ -0,0 +1,96 @@
import { DecodingMode } from "./decode.js";
/** The level of entities to support. */
export declare enum EntityLevel {
/** Support only XML entities. */
XML = 0,
/** Support HTML entities, which are a superset of XML entities. */
HTML = 1
}
export declare enum EncodingMode {
/**
* The output is UTF-8 encoded. Only characters that need escaping within
* XML will be escaped.
*/
UTF8 = 0,
/**
* The output consists only of ASCII characters. Characters that need
* escaping within HTML, and characters that aren't ASCII characters will
* be escaped.
*/
ASCII = 1,
/**
* Encode all characters that have an equivalent entity, as well as all
* characters that are not ASCII characters.
*/
Extensive = 2,
/**
* Encode all characters that have to be escaped in HTML attributes,
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
*/
Attribute = 3,
/**
* Encode all characters that have to be escaped in HTML text,
* following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}.
*/
Text = 4
}
export interface DecodingOptions {
/**
* The level of entities to support.
* @default {@link EntityLevel.XML}
*/
level?: EntityLevel;
/**
* Decoding mode. If `Legacy`, will support legacy entities not terminated
* with a semicolon (`;`).
*
* Always `Strict` for XML. For HTML, set this to `true` if you are parsing
* an attribute value.
*
* The deprecated `decodeStrict` function defaults this to `Strict`.
*
* @default {@link DecodingMode.Legacy}
*/
mode?: DecodingMode | undefined;
}
/**
* Decodes a string with entities.
*
* @param data String to decode.
* @param options Decoding options.
*/
export declare function decode(data: string, options?: DecodingOptions | EntityLevel): string;
/**
* Decodes a string with entities. Does not allow missing trailing semicolons for entities.
*
* @param data String to decode.
* @param options Decoding options.
* @deprecated Use `decode` with the `mode` set to `Strict`.
*/
export declare function decodeStrict(data: string, options?: DecodingOptions | EntityLevel): string;
/**
* Options for `encode`.
*/
export interface EncodingOptions {
/**
* The level of entities to support.
* @default {@link EntityLevel.XML}
*/
level?: EntityLevel;
/**
* Output format.
* @default {@link EncodingMode.Extensive}
*/
mode?: EncodingMode;
}
/**
* Encodes a string with entities.
*
* @param data String to encode.
* @param options Encoding options.
*/
export declare function encode(data: string, options?: EncodingOptions | EntityLevel): string;
export { encodeXML, escape, escapeUTF8, escapeAttribute, escapeText, } from "./escape.js";
export { encodeHTML, encodeNonAsciiHTML, encodeHTML as encodeHTML4, encodeHTML as encodeHTML5, } from "./encode.js";
export { EntityDecoder, DecodingMode, decodeXML, decodeHTML, decodeHTMLStrict, decodeHTMLAttribute, decodeHTML as decodeHTML4, decodeHTML as decodeHTML5, decodeHTMLStrict as decodeHTML4Strict, decodeHTMLStrict as decodeHTML5Strict, decodeXML as decodeXMLStrict, } from "./decode.js";
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,320 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseNumberSkeletonFromString = parseNumberSkeletonFromString;
exports.parseNumberSkeleton = parseNumberSkeleton;
var tslib_1 = require("tslib");
var regex_generated_1 = require("./regex.generated");
function parseNumberSkeletonFromString(skeleton) {
if (skeleton.length === 0) {
throw new Error('Number skeleton cannot be empty');
}
// Parse the skeleton
var stringTokens = skeleton
.split(regex_generated_1.WHITE_SPACE_REGEX)
.filter(function (x) { return x.length > 0; });
var tokens = [];
for (var _i = 0, stringTokens_1 = stringTokens; _i < stringTokens_1.length; _i++) {
var stringToken = stringTokens_1[_i];
var stemAndOptions = stringToken.split('/');
if (stemAndOptions.length === 0) {
throw new Error('Invalid number skeleton');
}
var stem = stemAndOptions[0], options = stemAndOptions.slice(1);
for (var _a = 0, options_1 = options; _a < options_1.length; _a++) {
var option = options_1[_a];
if (option.length === 0) {
throw new Error('Invalid number skeleton');
}
}
tokens.push({ stem: stem, options: options });
}
return tokens;
}
function icuUnitToEcma(unit) {
return unit.replace(/^(.*?)-/, '');
}
var FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g;
var SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?[rs]?$/g;
var INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g;
var CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;
function parseSignificantPrecision(str) {
var result = {};
if (str[str.length - 1] === 'r') {
result.roundingPriority = 'morePrecision';
}
else if (str[str.length - 1] === 's') {
result.roundingPriority = 'lessPrecision';
}
str.replace(SIGNIFICANT_PRECISION_REGEX, function (_, g1, g2) {
// @@@ case
if (typeof g2 !== 'string') {
result.minimumSignificantDigits = g1.length;
result.maximumSignificantDigits = g1.length;
}
// @@@+ case
else if (g2 === '+') {
result.minimumSignificantDigits = g1.length;
}
// .### case
else if (g1[0] === '#') {
result.maximumSignificantDigits = g1.length;
}
// .@@## or .@@@ case
else {
result.minimumSignificantDigits = g1.length;
result.maximumSignificantDigits =
g1.length + (typeof g2 === 'string' ? g2.length : 0);
}
return '';
});
return result;
}
function parseSign(str) {
switch (str) {
case 'sign-auto':
return {
signDisplay: 'auto',
};
case 'sign-accounting':
case '()':
return {
currencySign: 'accounting',
};
case 'sign-always':
case '+!':
return {
signDisplay: 'always',
};
case 'sign-accounting-always':
case '()!':
return {
signDisplay: 'always',
currencySign: 'accounting',
};
case 'sign-except-zero':
case '+?':
return {
signDisplay: 'exceptZero',
};
case 'sign-accounting-except-zero':
case '()?':
return {
signDisplay: 'exceptZero',
currencySign: 'accounting',
};
case 'sign-never':
case '+_':
return {
signDisplay: 'never',
};
}
}
function parseConciseScientificAndEngineeringStem(stem) {
// Engineering
var result;
if (stem[0] === 'E' && stem[1] === 'E') {
result = {
notation: 'engineering',
};
stem = stem.slice(2);
}
else if (stem[0] === 'E') {
result = {
notation: 'scientific',
};
stem = stem.slice(1);
}
if (result) {
var signDisplay = stem.slice(0, 2);
if (signDisplay === '+!') {
result.signDisplay = 'always';
stem = stem.slice(2);
}
else if (signDisplay === '+?') {
result.signDisplay = 'exceptZero';
stem = stem.slice(2);
}
if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) {
throw new Error('Malformed concise eng/scientific notation');
}
result.minimumIntegerDigits = stem.length;
}
return result;
}
function parseNotationOptions(opt) {
var result = {};
var signOpts = parseSign(opt);
if (signOpts) {
return signOpts;
}
return result;
}
/**
* https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options
*/
function parseNumberSkeleton(tokens) {
var result = {};
for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {
var token = tokens_1[_i];
switch (token.stem) {
case 'percent':
case '%':
result.style = 'percent';
continue;
case '%x100':
result.style = 'percent';
result.scale = 100;
continue;
case 'currency':
result.style = 'currency';
result.currency = token.options[0];
continue;
case 'group-off':
case ',_':
result.useGrouping = false;
continue;
case 'precision-integer':
case '.':
result.maximumFractionDigits = 0;
continue;
case 'measure-unit':
case 'unit':
result.style = 'unit';
result.unit = icuUnitToEcma(token.options[0]);
continue;
case 'compact-short':
case 'K':
result.notation = 'compact';
result.compactDisplay = 'short';
continue;
case 'compact-long':
case 'KK':
result.notation = 'compact';
result.compactDisplay = 'long';
continue;
case 'scientific':
result = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, result), { notation: 'scientific' }), token.options.reduce(function (all, opt) { return (tslib_1.__assign(tslib_1.__assign({}, all), parseNotationOptions(opt))); }, {}));
continue;
case 'engineering':
result = tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, result), { notation: 'engineering' }), token.options.reduce(function (all, opt) { return (tslib_1.__assign(tslib_1.__assign({}, all), parseNotationOptions(opt))); }, {}));
continue;
case 'notation-simple':
result.notation = 'standard';
continue;
// https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h
case 'unit-width-narrow':
result.currencyDisplay = 'narrowSymbol';
result.unitDisplay = 'narrow';
continue;
case 'unit-width-short':
result.currencyDisplay = 'code';
result.unitDisplay = 'short';
continue;
case 'unit-width-full-name':
result.currencyDisplay = 'name';
result.unitDisplay = 'long';
continue;
case 'unit-width-iso-code':
result.currencyDisplay = 'symbol';
continue;
case 'scale':
result.scale = parseFloat(token.options[0]);
continue;
case 'rounding-mode-floor':
result.roundingMode = 'floor';
continue;
case 'rounding-mode-ceiling':
result.roundingMode = 'ceil';
continue;
case 'rounding-mode-down':
result.roundingMode = 'trunc';
continue;
case 'rounding-mode-up':
result.roundingMode = 'expand';
continue;
case 'rounding-mode-half-even':
result.roundingMode = 'halfEven';
continue;
case 'rounding-mode-half-down':
result.roundingMode = 'halfTrunc';
continue;
case 'rounding-mode-half-up':
result.roundingMode = 'halfExpand';
continue;
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
case 'integer-width':
if (token.options.length > 1) {
throw new RangeError('integer-width stems only accept a single optional option');
}
token.options[0].replace(INTEGER_WIDTH_REGEX, function (_, g1, g2, g3, g4, g5) {
if (g1) {
result.minimumIntegerDigits = g2.length;
}
else if (g3 && g4) {
throw new Error('We currently do not support maximum integer digits');
}
else if (g5) {
throw new Error('We currently do not support exact integer digits');
}
return '';
});
continue;
}
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) {
result.minimumIntegerDigits = token.stem.length;
continue;
}
if (FRACTION_PRECISION_REGEX.test(token.stem)) {
// Precision
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision
// precision-integer case
if (token.options.length > 1) {
throw new RangeError('Fraction-precision stems only accept a single optional option');
}
token.stem.replace(FRACTION_PRECISION_REGEX, function (_, g1, g2, g3, g4, g5) {
// .000* case (before ICU67 it was .000+)
if (g2 === '*') {
result.minimumFractionDigits = g1.length;
}
// .### case
else if (g3 && g3[0] === '#') {
result.maximumFractionDigits = g3.length;
}
// .00## case
else if (g4 && g5) {
result.minimumFractionDigits = g4.length;
result.maximumFractionDigits = g4.length + g5.length;
}
else {
result.minimumFractionDigits = g1.length;
result.maximumFractionDigits = g1.length;
}
return '';
});
var opt = token.options[0];
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display
if (opt === 'w') {
result = tslib_1.__assign(tslib_1.__assign({}, result), { trailingZeroDisplay: 'stripIfInteger' });
}
else if (opt) {
result = tslib_1.__assign(tslib_1.__assign({}, result), parseSignificantPrecision(opt));
}
continue;
}
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision
if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) {
result = tslib_1.__assign(tslib_1.__assign({}, result), parseSignificantPrecision(token.stem));
continue;
}
var signOpts = parseSign(token.stem);
if (signOpts) {
result = tslib_1.__assign(tslib_1.__assign({}, result), signOpts);
}
var conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem);
if (conciseScientificAndEngineeringOpts) {
result = tslib_1.__assign(tslib_1.__assign({}, result), conciseScientificAndEngineeringOpts);
}
}
return result;
}
@@ -0,0 +1,31 @@
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm test
- run: npm run coverage --if-present
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1 @@
{"version":3,"names":["_parser","data","require","_codeFrame","_missingPluginHelper","parser","pluginPasses","parserOpts","highlightCode","filename","code","results","plugins","plugin","parserOverride","ast","parse","undefined","push","length","then","Error","err","message","loc","missingPlugin","codeFrame","codeFrameColumns","start","line","column","generateMissingPluginMessage"],"sources":["../../src/parser/index.ts"],"sourcesContent":["import type { Handler } from \"gensync\";\nimport { parse, type ParseResult } from \"@babel/parser\";\nimport { codeFrameColumns } from \"@babel/code-frame\";\nimport generateMissingPluginMessage from \"./util/missing-plugin-helper.ts\";\nimport type { PluginPasses } from \"../config/index.ts\";\nimport type { ResolvedOptions } from \"../config/validation/options.ts\";\n\nexport type { ParseResult };\n\nexport default function* parser(\n pluginPasses: PluginPasses,\n { parserOpts, highlightCode = true, filename = \"unknown\" }: ResolvedOptions,\n code: string,\n): Handler<ParseResult> {\n try {\n const results = [];\n for (const plugins of pluginPasses) {\n for (const plugin of plugins) {\n const { parserOverride } = plugin;\n if (parserOverride) {\n const ast = parserOverride(code, parserOpts, parse);\n\n if (ast !== undefined) results.push(ast);\n }\n }\n }\n\n if (results.length === 0) {\n return parse(code, parserOpts);\n } else if (results.length === 1) {\n // If we want to allow async parsers\n yield* [];\n if (typeof (results[0] as any).then === \"function\") {\n throw new Error(\n `You appear to be using an async parser plugin, ` +\n `which your current version of Babel does not support. ` +\n `If you're using a published plugin, you may need to upgrade ` +\n `your @babel/core version.`,\n );\n }\n return results[0];\n }\n // TODO: Add an error code\n throw new Error(\"More than one plugin attempted to override parsing.\");\n } catch (err) {\n if (err.code === \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\") {\n err.message +=\n \"\\nConsider renaming the file to '.mjs', or setting sourceType:module \" +\n \"or sourceType:unambiguous in your Babel config for this file.\";\n // err.code will be changed to BABEL_PARSE_ERROR later.\n }\n\n const { loc, missingPlugin } = err;\n if (loc) {\n const codeFrame = codeFrameColumns(\n code,\n {\n start: {\n line: loc.line,\n column: loc.column + 1,\n },\n },\n {\n highlightCode,\n },\n );\n if (missingPlugin) {\n err.message =\n `${filename}: ` +\n generateMissingPluginMessage(\n missingPlugin[0],\n loc,\n codeFrame,\n filename,\n );\n } else {\n err.message = `${filename}: ${err.message}\\n\\n` + codeFrame;\n }\n err.code = \"BABEL_PARSE_ERROR\";\n }\n throw err;\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,IAAAG,oBAAA,GAAAF,OAAA;AAMe,UAAUG,MAAMA,CAC7BC,YAA0B,EAC1B;EAAEC,UAAU;EAAEC,aAAa,GAAG,IAAI;EAAEC,QAAQ,GAAG;AAA2B,CAAC,EAC3EC,IAAY,EACU;EACtB,IAAI;IACF,MAAMC,OAAO,GAAG,EAAE;IAClB,KAAK,MAAMC,OAAO,IAAIN,YAAY,EAAE;MAClC,KAAK,MAAMO,MAAM,IAAID,OAAO,EAAE;QAC5B,MAAM;UAAEE;QAAe,CAAC,GAAGD,MAAM;QACjC,IAAIC,cAAc,EAAE;UAClB,MAAMC,GAAG,GAAGD,cAAc,CAACJ,IAAI,EAAEH,UAAU,EAAES,eAAK,CAAC;UAEnD,IAAID,GAAG,KAAKE,SAAS,EAAEN,OAAO,CAACO,IAAI,CAACH,GAAG,CAAC;QAC1C;MACF;IACF;IAEA,IAAIJ,OAAO,CAACQ,MAAM,KAAK,CAAC,EAAE;MACxB,OAAO,IAAAH,eAAK,EAACN,IAAI,EAAEH,UAAU,CAAC;IAChC,CAAC,MAAM,IAAII,OAAO,CAACQ,MAAM,KAAK,CAAC,EAAE;MAE/B,OAAO,EAAE;MACT,IAAI,OAAQR,OAAO,CAAC,CAAC,CAAC,CAASS,IAAI,KAAK,UAAU,EAAE;QAClD,MAAM,IAAIC,KAAK,CACb,iDAAiD,GAC/C,wDAAwD,GACxD,8DAA8D,GAC9D,2BACJ,CAAC;MACH;MACA,OAAOV,OAAO,CAAC,CAAC,CAAC;IACnB;IAEA,MAAM,IAAIU,KAAK,CAAC,qDAAqD,CAAC;EACxE,CAAC,CAAC,OAAOC,GAAG,EAAE;IACZ,IAAIA,GAAG,CAACZ,IAAI,KAAK,yCAAyC,EAAE;MAC1DY,GAAG,CAACC,OAAO,IACT,uEAAuE,GACvE,+DAA+D;IAEnE;IAEA,MAAM;MAAEC,GAAG;MAAEC;IAAc,CAAC,GAAGH,GAAG;IAClC,IAAIE,GAAG,EAAE;MACP,MAAME,SAAS,GAAG,IAAAC,6BAAgB,EAChCjB,IAAI,EACJ;QACEkB,KAAK,EAAE;UACLC,IAAI,EAAEL,GAAG,CAACK,IAAI;UACdC,MAAM,EAAEN,GAAG,CAACM,MAAM,GAAG;QACvB;MACF,CAAC,EACD;QACEtB;MACF,CACF,CAAC;MACD,IAAIiB,aAAa,EAAE;QACjBH,GAAG,CAACC,OAAO,GACT,GAAGd,QAAQ,IAAI,GACf,IAAAsB,4BAA4B,EAC1BN,aAAa,CAAC,CAAC,CAAC,EAChBD,GAAG,EACHE,SAAS,EACTjB,QACF,CAAC;MACL,CAAC,MAAM;QACLa,GAAG,CAACC,OAAO,GAAG,GAAGd,QAAQ,KAAKa,GAAG,CAACC,OAAO,MAAM,GAAGG,SAAS;MAC7D;MACAJ,GAAG,CAACZ,IAAI,GAAG,mBAAmB;IAChC;IACA,MAAMY,GAAG;EACX;AACF;AAAC","ignoreList":[]}
@@ -0,0 +1,341 @@
# qrcode.react
A React component to generate [QR codes](http://en.wikipedia.org/wiki/QR_code) for rendering to the DOM.
<img src="qrcode.png" height="256" width="256">
## Installation
```sh
npm install qrcode.react
```
## Usage
`qrcode.react` exports two components, supporting rendering as SVG or Canvas. SVG is generally recommended as it is more flexible, but Canvas may be preferable.
All examples are shown using modern JavaScript modules and syntax. CommonJS `require('qrcode.react')` is also supported.
### `QRCodeSVG`
```js
import ReactDOM from 'react-dom';
import {QRCodeSVG} from 'qrcode.react';
ReactDOM.render(
<QRCodeSVG value="https://reactjs.org/" />,
document.getElementById('mountNode')
);
```
### `QRCodeCanvas`
```js
import ReactDOM from 'react-dom';
import {QRCodeCanvas} from 'qrcode.react';
ReactDOM.render(
<QRCodeCanvas value="https://reactjs.org/" />,
document.getElementById('mountNode')
);
```
## Available Props
Below is a condensed type definition of the props `QRCodeSVG` and `QRCodeCanvas` accept.
```ts
type QRProps = {
/**
* The value to encode into the QR Code. An array of strings can be passed in
* to represent multiple segments to further optimize the QR Code.
*/
value: string | string[];
/**
* The size, in pixels, to render the QR Code.
* @defaultValue 128
*/
size?: number;
/**
* The Error Correction Level to use.
* @see https://www.qrcode.com/en/about/error_correction.html
* @defaultValue L
*/
level?: 'L' | 'M' | 'Q' | 'H';
/**
* The background color used to render the QR Code.
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
* @defaultValue #FFFFFF
*/
bgColor?: string;
/**
* The foregtound color used to render the QR Code.
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
* @defaultValue #000000
*/
fgColor?: string;
/**
* Whether or not a margin of 4 modules should be rendered as a part of the
* QR Code.
* @deprecated Use `marginSize` instead.
* @defaultValue false
*/
includeMargin?: boolean;
/**
* The number of _modules_ to use for margin. The QR Code specification
* requires `4`, however you can specify any number. Values will be turned to
* integers with `Math.floor`. Overrides `includeMargin` when both are specified.
* @defaultValue 0
*/
marginSize?: number;
/**
* The title to assign to the QR Code. Used for accessibility reasons.
*/
title?: string;
/**
* The minimum version used when encoding the QR Code. Valid values are 1-40
* with higher values resulting in more complex QR Codes. The optimal
* (lowest) version is determined for the `value` provided, using `minVersion`
* as the lower bound.
* @defaultValue 1
*/
minVersion?: number;
/**
* If enabled, the Error Correction Level of the result may be higher than
* the specified Error Correction Level option if it can be done without
* increasing the version.
* @defaultValue true
*/
boostLevel?: boolean;
/**
* The settings for the embedded image.
*/
imageSettings?: {
/**
* The URI of the embedded image.
*/
src: string;
/**
* The height, in pixels, of the image.
*/
height: number;
/**
* The width, in pixels, of the image.
*/
width: number;
/**
* Whether or not to "excavate" the modules around the embedded image. This
* means that any modules the embedded image overlaps will use the background
* color.
*/
excavate: boolean;
/**
* The horiztonal offset of the embedded image, starting from the top left corner.
* Will center if not specified.
*/
x?: number;
/**
* The vertical offset of the embedded image, starting from the top left corner.
* Will center if not specified.
*/
y?: number;
/**
* The opacity of the embedded image in the range of 0-1.
* @defaultValue 1
*/
opacity?: number;
/**
* The cross-origin value to use when loading the image. This is used to
* ensure compatibility with CORS, particularly when extracting image data
* from QRCodeCanvas.
* Note: `undefined` is treated differently than the seemingly equivalent
* empty string. This is intended to align with HTML behavior where omitting
* the attribute behaves differently than the empty string.
*/
crossOrigin?: 'anonymous' | 'use-credentials' | '' | undefined;
};
};
```
### `value`
The value to encode into the QR Code. See [Encoding Mode](#encoding-mode) for additional details.
| Type | Default Value |
| -------------------- | ------------- |
| `string \| string[]` | — |
### `size`
The size, in pixels, to render the QR Code.
| Type | Default Value |
| -------- | ------------- |
| `number` | `128` |
### `level`
The Error Correction Level to use. Information is encoded in QR Codes such that they can lose part of their visible areas and still be decodable. The amount of correction depends on this value. Higher error correction will result in more complex QR Codes.
- `L` = low (~7%)
- `M` = medium (~15%)
- `Q` = quartile (~25%)
- `H` = high (~30%)
See [Wikipedia](https://en.wikipedia.org/wiki/QR_code#Error_correction) or the [official QR Code documentation](https://www.qrcode.com/en/about/error_correction.html) for a more detailed explaination.
| Type | Default Value |
| ------------------ | ------------- |
| `L \| M \| Q \| H` | `L` |
### `bgColor`
The background color used to render the QR Code. This is passed directly to the Canvas (`ctx.fillStyle = bgColor`) or the SVG `<path>` (`fill={bgColor}`), both which accept any [CSS color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
| Type | Default Value |
| -------- | ------------- |
| `string` | `#FFFFFF` |
### `fgColor`
The foreground color used to render the QR Code. It follows the same constraints as `bgColor`
| Type | Default Value |
| -------- | ------------- |
| `string` | `#000000` |
### `includeMargin`
> [!WARNING]
> This has been deprecated in v4 and will be removed in a future version. Use `marginSize` instead.
Whether or not a margin of 4 modules should be rendered as a part of the QR Code.
| Type | Default Value |
| --------- | ------------- |
| `boolean` | `false` |
### `marginSize`
The number of _modules_ to use for margin. The QR Code specification requires `4`, however you can specify any number. Values will be turned to integers with `Math.floor`. Overrides `includeMargin` when both are specified.
| Type | Default Value |
| -------- | ------------- |
| `number` | `0` |
### `title`
The title to assign to the QR Code. Used for accessibility reasons.
| Type | Default Value |
| -------- | ------------- |
| `string` | — |
### `minVersion`
The minimum version used when encoding the QR Code. Valid values are 1-40 with higher values resulting in more complex QR Codes. The optimal (lowest) version is determined for the `value` provided, using `minVersion` as the lower bound.
| Type | Default Value |
| -------- | ------------- |
| `number` | `1` |
### `boostLevel`
If enabled, the Error Correction Level of the result may be higher than the specified Error Correction Level option if it can be done without increasing the version.
| Type | Default Value |
| --------- | ------------- |
| `boolean` | `true` |
### `imageSettings`
Used to specify the details for an embedded image, often used to embed a logo.
| Type | Default Value |
| --------------------------- | ------------- |
| `object` (see fields below) | — |
### `imageSettings.src`
The URI of the embedded image. This will get passed directly to `src` of an `img` element for `QRCodeCanvas` or the `href` of an inline `image` for `QRCodeSVG`.
| Type | Default Value |
| -------- | ------------- |
| `string` | — |
### `imageSettings.height`
The height, in pixels, of the embedded image.
| Type | Default Value |
| -------- | ------------- |
| `number` | — |
### `imageSettings.width`
The width, in pixels, of the embedded image.
| Type | Default Value |
| -------- | ------------- |
| `number` | — |
### `imageSettings.excavate`
Whether or not to "excavate" the modules around the embedded image. This means that any modules the embedded image overlaps will use the background color. Use this to ensure clean edges around your image. It is also useful when embedding images with transparency.
| Type | Default Value |
| --------- | ------------- |
| `boolean` | — |
### `imageSettings.x`
The horizontal offset, in pixels, of the embedded image. Positioning follows standard DOM positioning, with top left corner being 0.
When not specified, will center the image.
| Type | Default Value |
| -------- | ------------- |
| `number` | — |
### `imageSettings.y`
The vertical offset, in pixels, of the embedded image. Positioning follows standard DOM positioning, with top left corner being 0.
When not specified, will center the image.
| Type | Default Value |
| -------- | ------------- |
| `number` | — |
### `imageSettings.opacity`
The opacity of the embedded image, in the range of 0 to 1.
| Type | Default Value |
| -------- | ------------- |
| `number` | 1 |
### `imageSettings.crossOrigin`
The `cross-origin` value to use when loading the embedded image. Note that `undefined` works as typically does with React, excluding the attribute from the DOM node. This is intended to align with HTML behavior where omitting the attribute behaves differently than the empty string.
| Type | Default Value |
| -------- | ------------- |
| `string` | — |
## Custom Styles
`qrcode.react` will pass through any additional props to the underlying DOM node (`<svg>` or `<canvas>`). This allows the use of inline `style` or custom `className` to customize the rendering. One common use would be to support a responsive layout.
> [!NOTE]
> In order to render QR Codes in `<canvas>` on high density displays, we scale the canvas element to contain an appropriate number of pixels and then use inline styles to scale back down. We will merge any additional styles, with custom `height` and `width` overriding our own values. This allows scaling to percentages _but_ if scaling beyond the `size`, you will encounter blurry images. I recommend detecting resizes with something like [react-measure](https://github.com/souporserious/react-measure) to detect and pass the appropriate size when rendering to `<canvas>`.
## Encoding Mode
`qrcode.react` supports encoding text only. Prior to v4.1.0, this was done in a single segment. Since then, the `value` prop can be an array of strings. Each member will be encoded separately. The encoding library being used does minimal detection to determine if each segment being encoded can follow an optimized path for Numeric or Alphanumeric modes, allowing for more data to be encoded. Otherwise, it will encode following Byte mode. This mode includes supports multi-byte Unicode characters such as Kanji, however it does not support the optimized Kanji encoding mode.
## LICENSE
`qrcode.react` is licensed under the [ISC license](LICENSE).
`qrcode.react` bundles [QR Code Generator](https://www.nayuki.io/page/qr-code-generator-library), which is available under the [MIT license](src/third-party/qrcodegen/LICENSE).
@@ -0,0 +1,47 @@
"use client";
import {
navbar_menu_default
} from "./chunk-BKQISTKS.mjs";
import {
hideOnScrollVariants
} from "./chunk-RRUQIZLR.mjs";
import {
useNavbar
} from "./chunk-LTNGAWBY.mjs";
import {
NavbarProvider
} from "./chunk-IGERPFKH.mjs";
// src/navbar.tsx
import { forwardRef } from "@heroui/system";
import { pickChildren } from "@heroui/react-utils";
import { LazyMotion, m } from "framer-motion";
import { mergeProps } from "@react-aria/utils";
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
var domAnimation = () => import("@heroui/dom-animation").then((res) => res.default);
var Navbar = forwardRef((props, ref) => {
const { children, ...otherProps } = props;
const context = useNavbar({ ...otherProps, ref });
const Component = context.Component;
const [childrenWithoutMenu, menu] = pickChildren(children, navbar_menu_default);
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
/* @__PURE__ */ jsx("header", { ...context.getWrapperProps(), children: childrenWithoutMenu }),
menu
] });
return /* @__PURE__ */ jsx(NavbarProvider, { value: context, children: context.shouldHideOnScroll ? /* @__PURE__ */ jsx(LazyMotion, { features: domAnimation, children: /* @__PURE__ */ jsx(
m.nav,
{
animate: context.isHidden ? "hidden" : "visible",
initial: false,
variants: hideOnScrollVariants,
...mergeProps(context.getBaseProps(), context.motionProps),
children: content
}
) }) : /* @__PURE__ */ jsx(Component, { ...context.getBaseProps(), children: content }) });
});
Navbar.displayName = "HeroUI.Navbar";
var navbar_default = Navbar;
export {
navbar_default
};
@@ -0,0 +1,14 @@
/**
* DON'T EDIT THIS FILE.
* This file was generated by "scripts/update-lib-flat-configs.js" script.
*/
"use strict"
module.exports = {
plugins: {
get "es-x"() {
return require("../../index.js")
},
},
rules: { ...require("./no-new-in-es2023-intl-api").rules },
}
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2018 inspiredware
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.
@@ -0,0 +1,94 @@
'use strict';
var os = require('node:os');
var stdEnv = require('std-env');
var vite = require('vite');
const isNode = typeof process < "u" && typeof process.stdout < "u" && !process.versions?.deno && !globalThis.window;
const isDeno = typeof process < "u" && typeof process.stdout < "u" && process.versions?.deno !== void 0;
(isNode || isDeno) && process.platform === "win32";
(isNode || isDeno) && process.stdout?.isTTY && !stdEnv.isCI;
// if changed, update also jsdocs and docs
const defaultBrowserPort = 63315;
const defaultInclude = ["**/*.{test,spec}.?(c|m)[jt]s?(x)"];
const defaultExclude = ["**/node_modules/**", "**/.git/**"];
// These are the generic defaults for coverage. Providers may also set some provider specific defaults.
const coverageConfigDefaults = {
provider: "v8",
enabled: false,
clean: true,
cleanOnRerun: true,
reportsDirectory: "./coverage",
exclude: [],
reportOnFailure: false,
reporter: [
["text", {}],
["html", {}],
["clover", {}],
["json", {}]
],
allowExternal: false,
excludeAfterRemap: false,
processingConcurrency: Math.min(20, os.availableParallelism?.() ?? os.cpus().length)
};
const fakeTimersDefaults = {
loopLimit: 1e4,
shouldClearNativeTimers: true
};
const configDefaults = Object.freeze({
allowOnly: !stdEnv.isCI,
isolate: true,
watch: !stdEnv.isCI && process.stdin.isTTY,
globals: false,
environment: "node",
clearMocks: false,
restoreMocks: false,
mockReset: false,
unstubGlobals: false,
unstubEnvs: false,
include: defaultInclude,
exclude: defaultExclude,
teardownTimeout: 1e4,
forceRerunTriggers: ["**/package.json/**", "**/{vitest,vite}.config.*/**"],
update: false,
reporters: [],
silent: false,
hideSkippedTests: false,
api: false,
ui: false,
uiBase: "/__vitest__/",
open: !stdEnv.isCI,
css: { include: [] },
coverage: coverageConfigDefaults,
fakeTimers: fakeTimersDefaults,
maxConcurrency: 5,
dangerouslyIgnoreUnhandledErrors: false,
typecheck: {
checker: "tsc",
include: ["**/*.{test,spec}-d.?(c|m)[jt]s?(x)"],
exclude: defaultExclude
},
slowTestThreshold: 300,
disableConsoleIntercept: false
});
function defineConfig(config) {
return config;
}
function defineProject(config) {
return config;
}
Object.defineProperty(exports, "mergeConfig", {
enumerable: true,
get: function () { return vite.mergeConfig; }
});
exports.configDefaults = configDefaults;
exports.coverageConfigDefaults = coverageConfigDefaults;
exports.defaultBrowserPort = defaultBrowserPort;
exports.defaultExclude = defaultExclude;
exports.defaultInclude = defaultInclude;
exports.defineConfig = defineConfig;
exports.defineProject = defineProject;
@@ -0,0 +1,13 @@
import type { TSESTree } from '@typescript-eslint/types';
import type { Referencer } from './Referencer';
import { Visitor } from './Visitor';
export type ExportNode = TSESTree.ExportAllDeclaration | TSESTree.ExportDefaultDeclaration | TSESTree.ExportNamedDeclaration;
export declare class ExportVisitor extends Visitor {
#private;
constructor(node: ExportNode, referencer: Referencer);
static visit(referencer: Referencer, node: ExportNode): void;
protected ExportDefaultDeclaration(node: TSESTree.ExportDefaultDeclaration): void;
protected ExportNamedDeclaration(node: TSESTree.ExportNamedDeclaration): void;
protected ExportSpecifier(node: TSESTree.ExportSpecifier): void;
protected Identifier(node: TSESTree.Identifier): void;
}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A wC","132":"B"},B:{"1":"0 1 2 3 4 5 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I","16":"C L M"},C:{"1":"0 1 2 3 4 5 6 7 8 9 aB AB BB CB DB EB FB 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 UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","2":"xC TC J ZB K D E F A B C L M G N O P 0C 1C"},D:{"1":"0 1 2 3 4 5 6 7 8 9 G N O P aB AB BB CB DB EB FB 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 UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC 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 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","16":"J ZB K D E F A B C L M"},E:{"1":"J ZB K D E F A B C L M G 3C 4C 5C 6C aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED","16":"2C ZC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 C G N O P aB AB BB CB DB EB FB 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 EC FC GC HC IC JC KC LC Q H R WC 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 OC","2":"F B FD GD HD ID NC uC JD"},G:{"1":"E ZC KD vC LD MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC"},H:{"2":"hD"},I:{"2":"TC J I iD jD kD lD vC mD nD"},J:{"16":"D A"},K:{"2":"A B C H NC uC OC"},L:{"2":"I"},M:{"2":"MC"},N:{"16":"A B"},O:{"2":"PC"},P:{"2":"6 7 8 9 J AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"1":"zD"},R:{"2":"0D"},S:{"2":"1D 2D"}},B:6,C:"Built-in PDF viewer",D:true};
@@ -0,0 +1 @@
{"version":3,"file":"getContainerModuleId.spec.d.ts","sourceRoot":"","sources":["../../../../src/container/actions/getContainerModuleId.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,60 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _wrapAsync = require('./internal/wrapAsync.js');
var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
var _mapLimit = require('./mapLimit.js');
var _mapLimit2 = _interopRequireDefault(_mapLimit);
var _awaitify = require('./internal/awaitify.js');
var _awaitify2 = _interopRequireDefault(_awaitify);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time.
*
* @name concatLimit
* @static
* @memberOf module:Collections
* @method
* @see [async.concat]{@link module:Collections.concat}
* @category Collection
* @alias flatMapLimit
* @param {Array|Iterable|AsyncIterable|Object} coll - A collection to iterate over.
* @param {number} limit - The maximum number of async operations at a time.
* @param {AsyncFunction} iteratee - A function to apply to each item in `coll`,
* which should use an array as its result. Invoked with (item, callback).
* @param {Function} [callback] - A callback which is called after all the
* `iteratee` functions have finished, or an error occurs. Results is an array
* containing the concatenated results of the `iteratee` function. Invoked with
* (err, results).
* @returns A Promise, if no callback is passed
*/
function concatLimit(coll, limit, iteratee, callback) {
var _iteratee = (0, _wrapAsync2.default)(iteratee);
return (0, _mapLimit2.default)(coll, limit, (val, iterCb) => {
_iteratee(val, (err, ...args) => {
if (err) return iterCb(err);
return iterCb(err, args);
});
}, (err, mapResults) => {
var result = [];
for (var i = 0; i < mapResults.length; i++) {
if (mapResults[i]) {
result = result.concat(...mapResults[i]);
}
}
return callback(err, result);
});
}
exports.default = (0, _awaitify2.default)(concatLimit, 4);
module.exports = exports.default;
@@ -0,0 +1,73 @@
# emoji-regex [![Build status](https://travis-ci.org/mathiasbynens/emoji-regex.svg?branch=master)](https://travis-ci.org/mathiasbynens/emoji-regex)
_emoji-regex_ offers a regular expression to match all emoji symbols (including textual representations of emoji) as per the Unicode Standard.
This repository contains a script that generates this regular expression based on [the data from Unicode v12](https://github.com/mathiasbynens/unicode-12.0.0). Because of this, the regular expression can easily be updated whenever new emoji are added to the Unicode standard.
## Installation
Via [npm](https://www.npmjs.com/):
```bash
npm install emoji-regex
```
In [Node.js](https://nodejs.org/):
```js
const emojiRegex = require('emoji-regex');
// Note: because the regular expression has the global flag set, this module
// exports a function that returns the regex rather than exporting the regular
// expression itself, to make it impossible to (accidentally) mutate the
// original regular expression.
const text = `
\u{231A}: ⌚ default emoji presentation character (Emoji_Presentation)
\u{2194}\u{FE0F}: ↔️ default text presentation character rendered as emoji
\u{1F469}: 👩 emoji modifier base (Emoji_Modifier_Base)
\u{1F469}\u{1F3FF}: 👩🏿 emoji modifier base followed by a modifier
`;
const regex = emojiRegex();
let match;
while (match = regex.exec(text)) {
const emoji = match[0];
console.log(`Matched sequence ${ emoji } — code points: ${ [...emoji].length }`);
}
```
Console output:
```
Matched sequence ⌚ — code points: 1
Matched sequence ⌚ — code points: 1
Matched sequence ↔️ — code points: 2
Matched sequence ↔️ — code points: 2
Matched sequence 👩 — code points: 1
Matched sequence 👩 — code points: 1
Matched sequence 👩🏿 — code points: 2
Matched sequence 👩🏿 — code points: 2
```
To match emoji in their textual representation as well (i.e. emoji that are not `Emoji_Presentation` symbols and that aren’t forced to render as emoji by a variation selector), `require` the other regex:
```js
const emojiRegex = require('emoji-regex/text.js');
```
Additionally, in environments which support ES2015 Unicode escapes, you may `require` ES2015-style versions of the regexes:
```js
const emojiRegex = require('emoji-regex/es2015/index.js');
const emojiRegexText = require('emoji-regex/es2015/text.js');
```
## Author
| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") |
|---|
| [Mathias Bynens](https://mathiasbynens.be/) |
## License
_emoji-regex_ is available under the [MIT](https://mths.be/mit) license.
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAmBA;;;;;;;;;GASG;AACH,iCAPW,KAAK,YAEL,OAAO,GAAG,IAAI,GAAG,SAAS,GAExB,MAAM,CAoElB;2BA5FuB,OAAO;6BAD0B,wBAAwB"}
@@ -0,0 +1,67 @@
import {useCollator as $325a3faab7a68acd$export$a16aca283550c30d} from "./useCollator.mjs";
import {useCallback as $21ck9$useCallback, useMemo as $21ck9$useMemo} from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function $bb77f239b46e8c72$export$3274cf84b703fff(options) {
let collator = (0, $325a3faab7a68acd$export$a16aca283550c30d)({
usage: 'search',
...options
});
// TODO(later): these methods don't currently support the ignorePunctuation option.
let startsWith = (0, $21ck9$useCallback)((string, substring)=>{
if (substring.length === 0) return true;
// Normalize both strings so we can slice safely
// TODO: take into account the ignorePunctuation option as well...
string = string.normalize('NFC');
substring = substring.normalize('NFC');
return collator.compare(string.slice(0, substring.length), substring) === 0;
}, [
collator
]);
let endsWith = (0, $21ck9$useCallback)((string, substring)=>{
if (substring.length === 0) return true;
string = string.normalize('NFC');
substring = substring.normalize('NFC');
return collator.compare(string.slice(-substring.length), substring) === 0;
}, [
collator
]);
let contains = (0, $21ck9$useCallback)((string, substring)=>{
if (substring.length === 0) return true;
string = string.normalize('NFC');
substring = substring.normalize('NFC');
let scan = 0;
let sliceLen = substring.length;
for(; scan + sliceLen <= string.length; scan++){
let slice = string.slice(scan, scan + sliceLen);
if (collator.compare(substring, slice) === 0) return true;
}
return false;
}, [
collator
]);
return (0, $21ck9$useMemo)(()=>({
startsWith: startsWith,
endsWith: endsWith,
contains: contains
}), [
startsWith,
endsWith,
contains
]);
}
export {$bb77f239b46e8c72$export$3274cf84b703fff as useFilter};
//# sourceMappingURL=useFilter.module.js.map
@@ -0,0 +1 @@
{"version":3,"file":"isBindingIdentifier.spec.d.ts","sourceRoot":"","sources":["../../../../src/binding/calculations/isBindingIdentifier.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
module.exports={C:{"37":0.00575,"48":0.02298,"52":0.01724,"78":0.01724,"88":0.00575,"102":0.00575,"115":0.12067,"125":0.00575,"128":0.01149,"133":0.00575,"135":0.00575,"136":0.01149,"138":0.02298,"139":0.01724,"140":0.06895,"141":0.01724,"142":0.05171,"143":1.25263,"144":1.00555,_:"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 38 39 40 41 42 43 44 45 46 47 49 50 51 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 79 80 81 82 83 84 85 86 87 89 90 91 92 93 94 95 96 97 98 99 100 101 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 126 127 129 130 131 132 134 137 145 146 147 3.5 3.6"},D:{"29":0.00575,"34":0.00575,"38":0.05171,"39":0.00575,"40":0.00575,"41":0.00575,"42":0.00575,"43":0.00575,"44":0.00575,"46":0.00575,"47":0.00575,"48":0.00575,"49":0.02298,"50":0.00575,"51":0.00575,"53":0.01149,"54":0.00575,"55":0.00575,"56":0.00575,"58":0.00575,"60":0.00575,"61":0.00575,"70":0.00575,"78":0.01149,"79":0.02873,"83":0.00575,"87":0.03448,"93":0.01149,"94":0.00575,"95":0.00575,"96":0.00575,"97":0.00575,"99":0.00575,"102":0.00575,"103":0.12641,"104":0.01149,"106":0.00575,"107":0.00575,"108":0.02873,"109":0.40222,"111":0.00575,"112":0.00575,"113":0.01724,"114":0.06895,"115":0.00575,"116":0.1494,"117":0.00575,"119":0.02873,"120":0.03448,"121":0.02298,"122":0.06321,"123":0.01149,"124":0.04022,"125":1.66634,"126":0.08044,"127":0.02298,"128":0.12641,"129":0.01149,"130":0.04022,"131":0.12641,"132":0.05171,"133":0.06895,"134":0.49416,"135":0.05746,"136":0.13216,"137":0.18387,"138":0.58035,"139":1.0113,"140":8.46386,"141":18.39869,"142":0.20111,"143":0.02298,_:"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 30 31 32 33 35 36 37 45 52 57 59 62 63 64 65 66 67 68 69 71 72 73 74 75 76 77 80 81 84 85 86 88 89 90 91 92 98 100 101 105 110 118 144 145"},F:{"46":0.00575,"91":0.00575,"92":0.01149,"95":0.02873,"114":0.00575,"120":0.09194,"121":0.17238,"122":0.91361,_:"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 85 86 87 88 89 90 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 115 116 117 118 119 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.00575,"105":0.00575,"109":0.01724,"111":0.00575,"113":0.00575,"114":0.00575,"120":0.01724,"123":0.00575,"124":0.00575,"126":0.00575,"127":0.01724,"128":0.00575,"131":0.01724,"132":0.00575,"133":0.01149,"134":0.04597,"135":0.02873,"136":0.01149,"137":0.01724,"138":0.04022,"139":0.06321,"140":1.45948,"141":6.3206,"142":0.01724,_:"12 13 14 15 16 17 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 106 107 108 110 112 115 116 117 118 119 121 122 125 129 130"},E:{"4":0.00575,"13":0.02298,"14":0.01724,"15":0.00575,_:"0 5 6 7 8 9 10 11 12 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 26.2","12.1":0.00575,"13.1":0.05171,"14.1":0.06895,"15.1":0.00575,"15.2-15.3":0.00575,"15.4":0.01149,"15.5":0.01724,"15.6":0.32752,"16.0":0.02298,"16.1":0.03448,"16.2":0.03448,"16.3":0.08619,"16.4":0.01149,"16.5":0.02873,"16.6":0.4252,"17.0":0.00575,"17.1":0.40222,"17.2":0.02873,"17.3":0.04022,"17.4":0.06321,"17.5":0.1379,"17.6":0.40222,"18.0":0.04022,"18.1":0.06321,"18.2":0.04597,"18.3":0.18962,"18.4":0.08619,"18.5-18.6":0.35051,"26.0":0.74698,"26.1":0.02298},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00159,"5.0-5.1":0,"6.0-6.1":0.00637,"7.0-7.1":0.00477,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.01432,"10.0-10.2":0.00159,"10.3":0.02705,"11.0-11.2":0.40104,"11.3-11.4":0.00955,"12.0-12.1":0.00318,"12.2-12.5":0.07798,"13.0-13.1":0,"13.2":0.00796,"13.3":0.00318,"13.4-13.7":0.01273,"14.0-14.4":0.02705,"14.5-14.8":0.02865,"15.0-15.1":0.02705,"15.2-15.3":0.02069,"15.4":0.02387,"15.5":0.02705,"15.6-15.8":0.3533,"16.0":0.04774,"16.1":0.08912,"16.2":0.04615,"16.3":0.08275,"16.4":0.02069,"16.5":0.0366,"16.6-16.7":0.47265,"17.0":0.03342,"17.1":0.05093,"17.2":0.0366,"17.3":0.05411,"17.4":0.09549,"17.5":0.16392,"17.6-17.7":0.41377,"18.0":0.09389,"18.1":0.19415,"18.2":0.10503,"18.3":0.33738,"18.4":0.17346,"18.5-18.6":8.84512,"26.0":1.09331,"26.1":0.03979},P:{"4":0.06511,"21":0.0217,"22":0.01085,"23":0.0217,"24":0.01085,"25":0.0434,"26":0.03255,"27":0.06511,"28":2.78876,"29":0.20617,_:"20 6.2-6.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","5.0-5.4":0.01085,"7.2-7.4":0.03255},I:{"0":0.02124,"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.19568,_:"10 11 12 11.1 11.5 12.1"},A:{"8":0.13407,"9":0.01915,"10":0.05746,"11":0.01915,_:"6 7 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.51048},Q:{"14.9":0.00851},O:{"0":0.02552},H:{"0":0},L:{"0":24.45519}};
@@ -0,0 +1,23 @@
import { map } from '../common/map.js';
import { nullTag } from '../common/null.js';
import { seq } from '../common/seq.js';
import { string } from '../common/string.js';
import { boolTag } from './bool.js';
import { floatNaN, floatExp, float } from './float.js';
import { intOct, int, intHex } from './int.js';
const schema = [
map,
seq,
string,
nullTag,
boolTag,
intOct,
int,
intHex,
floatNaN,
floatExp,
float
];
export { schema };
@@ -0,0 +1,155 @@
## Follow Redirects
Drop-in replacement for Node's `http` and `https` modules that automatically follows redirects.
[![npm version](https://img.shields.io/npm/v/follow-redirects.svg)](https://www.npmjs.com/package/follow-redirects)
[![Build Status](https://github.com/follow-redirects/follow-redirects/workflows/CI/badge.svg)](https://github.com/follow-redirects/follow-redirects/actions)
[![Coverage Status](https://coveralls.io/repos/follow-redirects/follow-redirects/badge.svg?branch=master)](https://coveralls.io/r/follow-redirects/follow-redirects?branch=master)
[![npm downloads](https://img.shields.io/npm/dm/follow-redirects.svg)](https://www.npmjs.com/package/follow-redirects)
[![Sponsor on GitHub](https://img.shields.io/static/v1?label=Sponsor&message=%F0%9F%92%96&logo=GitHub)](https://github.com/sponsors/RubenVerborgh)
`follow-redirects` provides [request](https://nodejs.org/api/http.html#http_http_request_options_callback) and [get](https://nodejs.org/api/http.html#http_http_get_options_callback)
methods that behave identically to those found on the native [http](https://nodejs.org/api/http.html#http_http_request_options_callback) and [https](https://nodejs.org/api/https.html#https_https_request_options_callback)
modules, with the exception that they will seamlessly follow redirects.
```javascript
const { http, https } = require('follow-redirects');
http.get('http://bit.ly/900913', response => {
response.on('data', chunk => {
console.log(chunk);
});
}).on('error', err => {
console.error(err);
});
```
You can inspect the final redirected URL through the `responseUrl` property on the `response`.
If no redirection happened, `responseUrl` is the original request URL.
```javascript
const request = https.request({
host: 'bitly.com',
path: '/UHfDGO',
}, response => {
console.log(response.responseUrl);
// 'http://duckduckgo.com/robots.txt'
});
request.end();
```
## Options
### Global options
Global options are set directly on the `follow-redirects` module:
```javascript
const followRedirects = require('follow-redirects');
followRedirects.maxRedirects = 10;
followRedirects.maxBodyLength = 20 * 1024 * 1024; // 20 MB
```
The following global options are supported:
- `maxRedirects` (default: `21`) – sets the maximum number of allowed redirects; if exceeded, an error will be emitted.
- `maxBodyLength` (default: 10MB) – sets the maximum size of the request body; if exceeded, an error will be emitted.
### Per-request options
Per-request options are set by passing an `options` object:
```javascript
const url = require('url');
const { http, https } = require('follow-redirects');
const options = url.parse('http://bit.ly/900913');
options.maxRedirects = 10;
options.beforeRedirect = (options, response, request) => {
// Use this to adjust the request options upon redirecting,
// to inspect the latest response headers,
// or to cancel the request by throwing an error
// response.headers = the redirect response headers
// response.statusCode = the redirect response code (eg. 301, 307, etc.)
// request.url = the requested URL that resulted in a redirect
// request.headers = the headers in the request that resulted in a redirect
// request.method = the method of the request that resulted in a redirect
if (options.hostname === "example.com") {
options.auth = "user:password";
}
};
http.request(options);
```
In addition to the [standard HTTP](https://nodejs.org/api/http.html#http_http_request_options_callback) and [HTTPS options](https://nodejs.org/api/https.html#https_https_request_options_callback),
the following per-request options are supported:
- `followRedirects` (default: `true`) – whether redirects should be followed.
- `maxRedirects` (default: `21`) – sets the maximum number of allowed redirects; if exceeded, an error will be emitted.
- `maxBodyLength` (default: 10MB) – sets the maximum size of the request body; if exceeded, an error will be emitted.
- `beforeRedirect` (default: `undefined`) – optionally change the request `options` on redirects, or abort the request by throwing an error.
- `agents` (default: `undefined`) – sets the `agent` option per protocol, since HTTP and HTTPS use different agents. Example value: `{ http: new http.Agent(), https: new https.Agent() }`
- `trackRedirects` (default: `false`) – whether to store the redirected response details into the `redirects` array on the response object.
### Advanced usage
By default, `follow-redirects` will use the Node.js default implementations
of [`http`](https://nodejs.org/api/http.html)
and [`https`](https://nodejs.org/api/https.html).
To enable features such as caching and/or intermediate request tracking,
you might instead want to wrap `follow-redirects` around custom protocol implementations:
```javascript
const { http, https } = require('follow-redirects').wrap({
http: require('your-custom-http'),
https: require('your-custom-https'),
});
```
Such custom protocols only need an implementation of the `request` method.
## Browser Usage
Due to the way the browser works,
the `http` and `https` browser equivalents perform redirects by default.
By requiring `follow-redirects` this way:
```javascript
const http = require('follow-redirects/http');
const https = require('follow-redirects/https');
```
you can easily tell webpack and friends to replace
`follow-redirect` by the built-in versions:
```json
{
"follow-redirects/http" : "http",
"follow-redirects/https" : "https"
}
```
## Contributing
Pull Requests are always welcome. Please [file an issue](https://github.com/follow-redirects/follow-redirects/issues)
detailing your proposal before you invest your valuable time. Additional features and bug fixes should be accompanied
by tests. You can run the test suite locally with a simple `npm test` command.
## Debug Logging
`follow-redirects` uses the excellent [debug](https://www.npmjs.com/package/debug) for logging. To turn on logging
set the environment variable `DEBUG=follow-redirects` for debug output from just this module. When running the test
suite it is sometimes advantageous to set `DEBUG=*` to see output from the express server as well.
## Authors
- [Ruben Verborgh](https://ruben.verborgh.org/)
- [Olivier Lalonde](mailto:olalonde@gmail.com)
- [James Talmage](mailto:james@talmage.io)
## License
[MIT License](https://github.com/follow-redirects/follow-redirects/blob/master/LICENSE)
@@ -0,0 +1,9 @@
'use strict';
var $isNaN = require('math-intrinsics/isNaN');
// https://262.ecma-international.org/6.0/#sec-samevaluezero
module.exports = function SameValueZero(x, y) {
return (x === y) || ($isNaN(x) && $isNaN(y));
};
@@ -0,0 +1,125 @@
import React from 'react';
/**
* @license qrcode.react
* Copyright (c) Paul O'Shannessy
* SPDX-License-Identifier: ISC
*/
type ErrorCorrectionLevel = 'L' | 'M' | 'Q' | 'H';
type CrossOrigin = 'anonymous' | 'use-credentials' | '' | undefined;
type ImageSettings = {
/**
* The URI of the embedded image.
*/
src: string;
/**
* The height, in pixels, of the image.
*/
height: number;
/**
* The width, in pixels, of the image.
*/
width: number;
/**
* Whether or not to "excavate" the modules around the embedded image. This
* means that any modules the embedded image overlaps will use the background
* color.
*/
excavate: boolean;
/**
* The horiztonal offset of the embedded image, starting from the top left corner.
* Will center if not specified.
*/
x?: number;
/**
* The vertical offset of the embedded image, starting from the top left corner.
* Will center if not specified.
*/
y?: number;
/**
* The opacity of the embedded image in the range of 0-1.
* @defaultValue 1
*/
opacity?: number;
/**
* The cross-origin value to use when loading the image. This is used to
* ensure compatibility with CORS, particularly when extracting image data
* from QRCodeCanvas.
* Note: `undefined` is treated differently than the seemingly equivalent
* empty string. This is intended to align with HTML behavior where omitting
* the attribute behaves differently than the empty string.
*/
crossOrigin?: CrossOrigin;
};
type QRProps = {
/**
* The value to encode into the QR Code. An array of strings can be passed in
* to represent multiple segments to further optimize the QR Code.
*/
value: string | string[];
/**
* The size, in pixels, to render the QR Code.
* @defaultValue 128
*/
size?: number;
/**
* The Error Correction Level to use.
* @see https://www.qrcode.com/en/about/error_correction.html
* @defaultValue L
*/
level?: ErrorCorrectionLevel;
/**
* The background color used to render the QR Code.
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
* @defaultValue #FFFFFF
*/
bgColor?: string;
/**
* The foregtound color used to render the QR Code.
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
* @defaultValue #000000
*/
fgColor?: string;
/**
* Whether or not a margin of 4 modules should be rendered as a part of the
* QR Code.
* @deprecated Use `marginSize` instead.
* @defaultValue false
*/
includeMargin?: boolean;
/**
* The number of _modules_ to use for margin. The QR Code specification
* requires `4`, however you can specify any number. Values will be turned to
* integers with `Math.floor`. Overrides `includeMargin` when both are specified.
* @defaultValue 0
*/
marginSize?: number;
/**
* The title to assign to the QR Code. Used for accessibility reasons.
*/
title?: string;
/**
* The minimum version used when encoding the QR Code. Valid values are 1-40
* with higher values resulting in more complex QR Codes. The optimal
* (lowest) version is determined for the `value` provided, using `minVersion`
* as the lower bound.
* @defaultValue 1
*/
minVersion?: number;
/**
* If enabled, the Error Correction Level of the result may be higher than
* the specified Error Correction Level option if it can be done without
* increasing the version.
* @defaultValue true
*/
boostLevel?: boolean;
/**
* The settings for the embedded image.
*/
imageSettings?: ImageSettings;
};
declare const QRCodeCanvas: React.ForwardRefExoticComponent<QRProps & React.CanvasHTMLAttributes<HTMLCanvasElement> & React.RefAttributes<HTMLCanvasElement>>;
declare const QRCodeSVG: React.ForwardRefExoticComponent<QRProps & React.SVGAttributes<SVGSVGElement> & React.RefAttributes<SVGSVGElement>>;
export { QRCodeCanvas, QRCodeSVG };
@@ -0,0 +1 @@
const t=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],e=(()=>new Set(t))();const s={};class n{constructor(){this.subscriptions=[]}add(t){var e,s;return e=this.subscriptions,s=t,-1===e.indexOf(s)&&e.push(s),()=>function(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}(this.subscriptions,t)}notify(t,e,s){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,s);else for(let r=0;r<n;r++){const n=this.subscriptions[r];n&&n(t,e,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const r=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],i={value:null,addProjectionMetrics:null};function a(t,e){let n=!1,a=!0;const o={delta:0,timestamp:0,isProcessing:!1},c=()=>n=!0,h=r.reduce((t,e)=>(t[e]=function(t,e){let s=new Set,n=new Set,r=!1,a=!1;const o=new WeakSet;let c={delta:0,timestamp:0,isProcessing:!1},h=0;function d(e){o.has(e)&&(p.schedule(e),t()),h++,e(c)}const p={schedule:(t,e=!1,i=!1)=>{const a=i&&r?s:n;return e&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{c=t,r?a=!0:(r=!0,[s,n]=[n,s],s.forEach(d),e&&i.value&&i.value.frameloop[e].push(h),h=0,s.clear(),r=!1,a&&(a=!1,p.process(t)))}};return p}(c,e),t),{}),{setup:d,read:p,resolveKeyframes:l,preUpdate:u,update:f,preRender:m,render:v,postRender:g}=h,y=()=>{const r=s.useManualTiming?o.timestamp:performance.now();n=!1,s.useManualTiming||(o.delta=a?1e3/60:Math.max(Math.min(r-o.timestamp,40),1)),o.timestamp=r,o.isProcessing=!0,d.process(o),p.process(o),l.process(o),u.process(o),f.process(o),m.process(o),v.process(o),g.process(o),o.isProcessing=!1,n&&e&&(a=!1,t(y))};return{schedule:r.reduce((e,s)=>{const r=h[s];return e[s]=(e,s=!1,i=!1)=>(n||(n=!0,a=!0,o.isProcessing||t(y)),r.schedule(e,s,i)),e},{}),cancel:t=>{for(let e=0;e<r.length;e++)h[r[e]].cancel(t)},state:o,steps:h}}const{schedule:o,cancel:c,state:h,steps:d}=a("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:t=>t,!0);let p;function l(){p=void 0}const u={now:()=>(void 0===p&&u.set(h.isProcessing||s.useManualTiming?h.timestamp:performance.now()),p),set:t=>{p=t,queueMicrotask(l)}};class f{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=u.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=u.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new n);const s=this.events[t].add(e);return"change"===t?()=>{s(),o.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=u.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return s=parseFloat(this.current)-parseFloat(this.prevFrameValue),(n=e)?s*(1e3/n):0;var s,n}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function m(t){return(e,s)=>{const n=function(t){if(t instanceof EventTarget)return[t];if("string"==typeof t){const e=document.querySelectorAll(t);return e?Array.from(e):[]}return Array.from(t)}(e),r=[];for(const e of n){const n=t(e,s);r.push(n)}return()=>{for(const t of r)t()}}}constLine truncated
@@ -0,0 +1,28 @@
import createWrap from './_createWrap.js';
/** Used to compose bitmasks for function metadata. */
var WRAP_FLIP_FLAG = 512;
/**
* Creates a function that invokes `func` with arguments reversed.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Function
* @param {Function} func The function to flip arguments for.
* @returns {Function} Returns the new flipped function.
* @example
*
* var flipped = _.flip(function() {
* return _.toArray(arguments);
* });
*
* flipped('a', 'b', 'c', 'd');
* // => ['d', 'c', 'b', 'a']
*/
function flip(func) {
return createWrap(func, WRAP_FLIP_FLAG);
}
export default flip;
@@ -0,0 +1,13 @@
<svg viewbox="0 0 18 18">
<g class="ql-fill ql-transparent">
<path d="M11,11h4V9a1,1,0,0,0-1-1H11v3Z"></path>
<path d="M10,11V8H7A1,1,0,0,0,6,9v2h4Z"></path>
<path d="M10,12H6v2a1,1,0,0,0,1,1h3V12Z"></path>
<path d="M11,12v3h3a1,1,0,0,0,1-1V12H11Z"></path>
<path d="M11,6h3a1,1,0,0,0,1-1V3a1,1,0,0,0-1-1H11V6Z"></path>
<path d="M7,6h3V2H7A1,1,0,0,0,6,3V5A1,1,0,0,0,7,6Z"></path>
</g>
<path class="ql-fill" d="M5,6H4V5a0.5,0.5,0,0,0-.854-0.354l-2,2a0.5,0.5,0,0,0,0,.707l2,2A0.5,0.5,0,0,0,3.5,9.5a0.494,0.494,0,0,0,.191-0.038A0.5,0.5,0,0,0,4,9V8H5A1,1,0,0,0,5,6Z"></path>
<path class="ql-fill" d="M15,5H12V9h3a1,1,0,0,0,1-1V6A1,1,0,0,0,15,5Z"></path>
<path class="ql-fill" d="M11,5H8A1,1,0,0,0,7,6V8A1,1,0,0,0,8,9h3V5Z"></path>
</svg>

After

Width:  |  Height:  |  Size: 766 B

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,37 @@
'use strict';
var $SyntaxError = require('es-errors/syntax');
var $TypeError = require('es-errors/type');
var whichTypedArray = require('which-typed-array');
var availableTypedArrays = require('available-typed-arrays')();
var IsArray = require('./IsArray');
var SpeciesConstructor = require('./SpeciesConstructor');
var TypedArrayCreateFromConstructor = require('./TypedArrayCreateFromConstructor');
var getConstructor = require('../helpers/typedArrayConstructors');
// https://262.ecma-international.org/15.0/#typedarray-species-create
module.exports = function TypedArraySpeciesCreate(exemplar, argumentList) {
if (availableTypedArrays.length === 0) {
throw new $SyntaxError('Assertion failed: Typed Arrays are not supported in this environment');
}
var kind = whichTypedArray(exemplar);
if (!kind) {
throw new $TypeError('Assertion failed: exemplar must be a TypedArray'); // step 1
}
if (!IsArray(argumentList)) {
throw new $TypeError('Assertion failed: `argumentList` must be a List'); // step 1
}
var defaultConstructor = getConstructor(kind); // step 2
if (typeof defaultConstructor !== 'function') {
throw new $SyntaxError('Assertion failed: `constructor` of `exemplar` (' + kind + ') must exist. Please report this!');
}
var constructor = SpeciesConstructor(exemplar, defaultConstructor); // step 3
return TypedArrayCreateFromConstructor(constructor, argumentList); // step 4
};
@@ -0,0 +1,143 @@
'use strict';
import stream from 'stream';
import utils from '../utils.js';
const kInternals = Symbol('internals');
class AxiosTransformStream extends stream.Transform{
constructor(options) {
options = utils.toFlatObject(options, {
maxRate: 0,
chunkSize: 64 * 1024,
minChunkSize: 100,
timeWindow: 500,
ticksRate: 2,
samplesCount: 15
}, null, (prop, source) => {
return !utils.isUndefined(source[prop]);
});
super({
readableHighWaterMark: options.chunkSize
});
const internals = this[kInternals] = {
timeWindow: options.timeWindow,
chunkSize: options.chunkSize,
maxRate: options.maxRate,
minChunkSize: options.minChunkSize,
bytesSeen: 0,
isCaptured: false,
notifiedBytesLoaded: 0,
ts: Date.now(),
bytes: 0,
onReadCallback: null
};
this.on('newListener', event => {
if (event === 'progress') {
if (!internals.isCaptured) {
internals.isCaptured = true;
}
}
});
}
_read(size) {
const internals = this[kInternals];
if (internals.onReadCallback) {
internals.onReadCallback();
}
return super._read(size);
}
_transform(chunk, encoding, callback) {
const internals = this[kInternals];
const maxRate = internals.maxRate;
const readableHighWaterMark = this.readableHighWaterMark;
const timeWindow = internals.timeWindow;
const divider = 1000 / timeWindow;
const bytesThreshold = (maxRate / divider);
const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
const pushChunk = (_chunk, _callback) => {
const bytes = Buffer.byteLength(_chunk);
internals.bytesSeen += bytes;
internals.bytes += bytes;
internals.isCaptured && this.emit('progress', internals.bytesSeen);
if (this.push(_chunk)) {
process.nextTick(_callback);
} else {
internals.onReadCallback = () => {
internals.onReadCallback = null;
process.nextTick(_callback);
};
}
}
const transformChunk = (_chunk, _callback) => {
const chunkSize = Buffer.byteLength(_chunk);
let chunkRemainder = null;
let maxChunkSize = readableHighWaterMark;
let bytesLeft;
let passed = 0;
if (maxRate) {
const now = Date.now();
if (!internals.ts || (passed = (now - internals.ts)) >= timeWindow) {
internals.ts = now;
bytesLeft = bytesThreshold - internals.bytes;
internals.bytes = bytesLeft < 0 ? -bytesLeft : 0;
passed = 0;
}
bytesLeft = bytesThreshold - internals.bytes;
}
if (maxRate) {
if (bytesLeft <= 0) {
// next time window
return setTimeout(() => {
_callback(null, _chunk);
}, timeWindow - passed);
}
if (bytesLeft < maxChunkSize) {
maxChunkSize = bytesLeft;
}
}
if (maxChunkSize && chunkSize > maxChunkSize && (chunkSize - maxChunkSize) > minChunkSize) {
chunkRemainder = _chunk.subarray(maxChunkSize);
_chunk = _chunk.subarray(0, maxChunkSize);
}
pushChunk(_chunk, chunkRemainder ? () => {
process.nextTick(_callback, null, chunkRemainder);
} : _callback);
};
transformChunk(chunk, function transformNextChunk(err, _chunk) {
if (err) {
return callback(err);
}
if (_chunk) {
transformChunk(_chunk, transformNextChunk);
} else {
callback(null);
}
});
}
}
export default AxiosTransformStream;
@@ -0,0 +1,73 @@
'use strict';
module.exports = function generate_anyOf(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 $errs = 'errs__' + $lvl;
var $it = it.util.copy(it);
var $closingBraces = '';
$it.level++;
var $nextValid = 'valid' + $it.level;
var $noEmptySchema = $schema.every(function($sch) {
return (it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all));
});
if ($noEmptySchema) {
var $currentBaseId = $it.baseId;
out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; ';
var $wasComposite = it.compositeRule;
it.compositeRule = $it.compositeRule = true;
var arr1 = $schema;
if (arr1) {
var $sch, $i = -1,
l1 = arr1.length - 1;
while ($i < l1) {
$sch = arr1[$i += 1];
$it.schema = $sch;
$it.schemaPath = $schemaPath + '[' + $i + ']';
$it.errSchemaPath = $errSchemaPath + '/' + $i;
out += ' ' + (it.validate($it)) + ' ';
$it.baseId = $currentBaseId;
out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { ';
$closingBraces += '}';
}
}
it.compositeRule = $it.compositeRule = $wasComposite;
out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */
if (it.createErrors !== false) {
out += ' { keyword: \'' + ('anyOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
if (it.opts.messages !== false) {
out += ' , message: \'should match some schema in anyOf\' ';
}
if (it.opts.verbose) {
out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
}
out += ' } ';
} else {
out += ' {} ';
}
out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
if (!it.compositeRule && $breakOnError) {
/* istanbul ignore if */
if (it.async) {
out += ' throw new ValidationError(vErrors); ';
} else {
out += ' validate.errors = vErrors; return false; ';
}
}
out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';
if (it.opts.allErrors) {
out += ' } ';
}
} else {
if ($breakOnError) {
out += ' if (true) { ';
}
}
return out;
}
@@ -0,0 +1,143 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const util = __importStar(require("../core/util.cjs"));
const error = () => {
const Sizable = {
string: { unit: "caractères", verb: "avoir" },
file: { unit: "octets", verb: "avoir" },
array: { unit: "éléments", verb: "avoir" },
set: { unit: "éléments", verb: "avoir" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const parsedType = (data) => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "number";
}
case "object": {
if (Array.isArray(data)) {
return "array";
}
if (data === null) {
return "null";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
const Nouns = {
regex: "entrée",
email: "adresse courriel",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "date-heure ISO",
date: "date ISO",
time: "heure ISO",
duration: "durée ISO",
ipv4: "adresse IPv4",
ipv6: "adresse IPv6",
cidrv4: "plage IPv4",
cidrv6: "plage IPv6",
base64: "chaîne encodée en base64",
base64url: "chaîne encodée en base64url",
json_string: "chaîne JSON",
e164: "numéro E.164",
jwt: "JWT",
template_literal: "entrée",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `Entrée invalide : attendu ${issue.expected}, reçu ${parsedType(issue.input)}`;
case "invalid_value":
if (issue.values.length === 1)
return `Entrée invalide : attendu ${util.stringifyPrimitive(issue.values[0])}`;
return `Option invalide : attendu l'une des valeurs suivantes ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "≤" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Trop grand : attendu que ${issue.origin ?? "la valeur"} ait ${adj}${issue.maximum.toString()} ${sizing.unit}`;
return `Trop grand : attendu que ${issue.origin ?? "la valeur"} soit ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? "≥" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Trop petit : attendu que ${issue.origin} ait ${adj}${issue.minimum.toString()} ${sizing.unit}`;
}
return `Trop petit : attendu que ${issue.origin} soit ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with") {
return `Chaîne invalide : doit commencer par "${_issue.prefix}"`;
}
if (_issue.format === "ends_with")
return `Chaîne invalide : doit se terminer par "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Chaîne invalide : doit inclure "${_issue.includes}"`;
if (_issue.format === "regex")
return `Chaîne invalide : doit correspondre au motif ${_issue.pattern}`;
return `${Nouns[_issue.format] ?? issue.format} invalide`;
}
case "not_multiple_of":
return `Nombre invalide : doit être un multiple de ${issue.divisor}`;
case "unrecognized_keys":
return `Clé${issue.keys.length > 1 ? "s" : ""} non reconnue${issue.keys.length > 1 ? "s" : ""} : ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Clé invalide dans ${issue.origin}`;
case "invalid_union":
return "Entrée invalide";
case "invalid_element":
return `Valeur invalide dans ${issue.origin}`;
default:
return `Entrée invalide`;
}
};
};
function default_1() {
return {
localeError: error(),
};
}
@@ -0,0 +1,197 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {DOMAttributes} from '@react-types/shared';
import React, {AriaAttributes, JSX, ReactNode, useContext, useEffect, useMemo, useState} from 'react';
import ReactDOM from 'react-dom';
import {useIsSSR} from '@react-aria/ssr';
import {useUNSAFE_PortalContext} from './PortalProvider';
export interface ModalProviderProps extends DOMAttributes {
children: ReactNode
}
interface ModalContext {
parent: ModalContext | null,
modalCount: number,
addModal: () => void,
removeModal: () => void
}
const Context = React.createContext<ModalContext | null>(null);
/**
* Each ModalProvider tracks how many modals are open in its subtree. On mount, the modals
* trigger `addModal` to increment the count, and trigger `removeModal` on unmount to decrement it.
* This is done recursively so that all parent providers are incremented and decremented.
* If the modal count is greater than zero, we add `aria-hidden` to this provider to hide its
* subtree from screen readers. This is done using React context in order to account for things
* like portals, which can cause the React tree and the DOM tree to differ significantly in structure.
*/
export function ModalProvider(props: ModalProviderProps): JSX.Element {
let {children} = props;
let parent = useContext(Context);
let [modalCount, setModalCount] = useState(0);
let context = useMemo(() => ({
parent,
modalCount,
addModal() {
setModalCount(count => count + 1);
if (parent) {
parent.addModal();
}
},
removeModal() {
setModalCount(count => count - 1);
if (parent) {
parent.removeModal();
}
}
}), [parent, modalCount]);
return (
<Context.Provider value={context}>
{children}
</Context.Provider>
);
}
export interface ModalProviderAria {
/**
* Props to be spread on the container element.
*/
modalProviderProps: AriaAttributes
}
/**
* Used to determine if the tree should be aria-hidden based on how many
* modals are open.
*/
export function useModalProvider(): ModalProviderAria {
let context = useContext(Context);
return {
modalProviderProps: {
'aria-hidden': context && context.modalCount > 0 ? true : undefined
}
};
}
/**
* Creates a root node that will be aria-hidden if there are other modals open.
*/
function OverlayContainerDOM(props: ModalProviderProps) {
let {modalProviderProps} = useModalProvider();
return <div data-overlay-container {...props} {...modalProviderProps} />;
}
/**
* An OverlayProvider acts as a container for the top-level application.
* Any application that uses modal dialogs or other overlays should
* be wrapped in a `<OverlayProvider>`. This is used to ensure that
* the main content of the application is hidden from screen readers
* if a modal or other overlay is opened. Only the top-most modal or
* overlay should be accessible at once.
*/
export function OverlayProvider(props: ModalProviderProps): JSX.Element {
return (
<ModalProvider>
<OverlayContainerDOM {...props} />
</ModalProvider>
);
}
export interface OverlayContainerProps extends ModalProviderProps {
/**
* The container element in which the overlay portal will be placed.
* @default document.body
* @deprecated - Use a parent UNSAFE_PortalProvider to set your portal container instead.
*/
portalContainer?: Element
}
/**
* A container for overlays like modals and popovers. Renders the overlay
* into a Portal which is placed at the end of the document body.
* Also ensures that the overlay is hidden from screen readers if a
* nested modal is opened. Only the top-most modal or overlay should
* be accessible at once.
*/
export function OverlayContainer(props: OverlayContainerProps): React.ReactPortal | null {
let isSSR = useIsSSR();
let {portalContainer = isSSR ? null : document.body, ...rest} = props;
let {getContainer} = useUNSAFE_PortalContext();
if (!props.portalContainer && getContainer) {
portalContainer = getContainer();
}
React.useEffect(() => {
if (portalContainer?.closest('[data-overlay-container]')) {
throw new Error('An OverlayContainer must not be inside another container. Please change the portalContainer prop.');
}
}, [portalContainer]);
if (!portalContainer) {
return null;
}
let contents = <OverlayProvider {...rest} />;
return ReactDOM.createPortal(contents, portalContainer);
}
interface ModalAriaProps extends DOMAttributes {
/** Data attribute marks the dom node as a modal for the aria-modal-polyfill. */
'data-ismodal': boolean
}
export interface AriaModalOptions {
isDisabled?: boolean
}
export interface ModalAria {
/** Props for the modal content element. */
modalProps: ModalAriaProps
}
/**
* Hides content outside the current `<OverlayContainer>` from screen readers
* on mount and restores it on unmount. Typically used by modal dialogs and
* other types of overlays to ensure that only the top-most modal is
* accessible at once.
*/
export function useModal(options?: AriaModalOptions): ModalAria {
// Add aria-hidden to all parent providers on mount, and restore on unmount.
let context = useContext(Context);
if (!context) {
throw new Error('Modal is not contained within a provider');
}
useEffect(() => {
if (options?.isDisabled || !context || !context.parent) {
return;
}
// The immediate context is from the provider containing this modal, so we only
// want to trigger aria-hidden on its parents not on the modal provider itself.
context.parent.addModal();
return () => {
if (context && context.parent) {
context.parent.removeModal();
}
};
}, [context, context.parent, options?.isDisabled]);
return {
modalProps: {
'data-ismodal': !options?.isDisabled
}
};
}
@@ -0,0 +1,19 @@
/*
Progress within given range
Given a lower limit and an upper limit, we return the progress
(expressed as a number 0-1) represented by the given value, and
limit that progress to within 0-1.
@param [number]: Lower limit
@param [number]: Upper limit
@param [number]: Value to find progress within given range
@return [number]: Progress of value within range as expressed 0-1
*/
/*#__NO_SIDE_EFFECTS__*/
const progress = (from, to, value) => {
const toFromDifference = to - from;
return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;
};
export { progress };
@@ -0,0 +1,6 @@
import stripIndent from 'strip-indent';
import indentString from 'indent-string';
export default function redent(string, count = 0, options = {}) {
return indentString(stripIndent(string), count, options);
}
@@ -0,0 +1,24 @@
'use strict';
var path = require('path');
var isglob = require('is-glob');
var pathDirname = require('path-dirname');
var isWin32 = require('os').platform() === 'win32';
module.exports = function globParent(str) {
// flip windows path separators
if (isWin32 && str.indexOf('/') < 0) str = str.split('\\').join('/');
// special case for strings ending in enclosure containing path separator
if (/[\{\[].*[\/]*.*[\}\]]$/.test(str)) str += '/';
// preserves full path in case of trailing path separator
str += 'a';
// remove path parts that are globby
do {str = pathDirname.posix(str)}
while (isglob(str) || /(^|[^\\])([\{\[]|\([^\)]+$)/.test(str));
// remove escape chars and return result
return str.replace(/\\([\*\?\|\[\]\(\)\{\}])/g, '$1');
};
@@ -0,0 +1,5 @@
'use strict';
module.exports = Number.isNaN || function isNaN(a) {
return a !== a;
};
@@ -0,0 +1,2 @@
export declare const PLUGIN_NAME: string;
export declare const logger: import("base-log-factory").ILogger;
@@ -0,0 +1,6 @@
export { closestCenter } from './closestCenter';
export { closestCorners } from './closestCorners';
export { rectIntersection } from './rectIntersection';
export { pointerWithin } from './pointerWithin';
export type { Collision, CollisionDescriptor, CollisionDetection } from './types';
export { getFirstCollision } from './helpers';
@@ -0,0 +1,64 @@
/**
* @import {
* Construct,
* State,
* TokenizeContext,
* Tokenizer
* } from 'micromark-util-types'
*/
import { asciiPunctuation } from 'micromark-util-character';
/** @type {Construct} */
export const characterEscape = {
name: 'characterEscape',
tokenize: tokenizeCharacterEscape
};
/**
* @this {TokenizeContext}
* Context.
* @type {Tokenizer}
*/
function tokenizeCharacterEscape(effects, ok, nok) {
return start;
/**
* Start of character escape.
*
* ```markdown
* > | a\*b
* ^
* ```
*
* @type {State}
*/
function start(code) {
effects.enter("characterEscape");
effects.enter("escapeMarker");
effects.consume(code);
effects.exit("escapeMarker");
return inside;
}
/**
* After `\`, at punctuation.
*
* ```markdown
* > | a\*b
* ^
* ```
*
* @type {State}
*/
function inside(code) {
// ASCII punctuation.
if (asciiPunctuation(code)) {
effects.enter("characterEscapeValue");
effects.consume(code);
effects.exit("characterEscapeValue");
effects.exit("characterEscape");
return ok;
}
return nok(code);
}
}
@@ -0,0 +1,73 @@
//compile doT templates to js functions
'use strict';
var glob = require('glob')
, fs = require('fs')
, path = require('path')
, doT = require('dot')
, beautify = require('js-beautify').js_beautify;
var defsRootPath = process.argv[2] || path.join(__dirname, '../lib');
var defs = {};
var defFiles = glob.sync('./dot/**/*.def', { cwd: defsRootPath });
defFiles.forEach(function (f) {
var name = path.basename(f, '.def');
defs[name] = fs.readFileSync(path.join(defsRootPath, f));
});
var filesRootPath = process.argv[3] || path.join(__dirname, '../lib');
var files = glob.sync('./dot/**/*.jst', { cwd: filesRootPath });
var dotjsPath = path.join(filesRootPath, './dotjs');
try { fs.mkdirSync(dotjsPath); } catch(e) {}
console.log('\n\nCompiling:');
var FUNCTION_NAME = /function\s+anonymous\s*\(it[^)]*\)\s*{/;
var OUT_EMPTY_STRING = /out\s*\+=\s*'\s*';/g;
var ISTANBUL = /'(istanbul[^']+)';/g;
var ERROR_KEYWORD = /\$errorKeyword/g;
var ERROR_KEYWORD_OR = /\$errorKeyword\s+\|\|/g;
var VARS = [
'$errs', '$valid', '$lvl', '$data', '$dataLvl',
'$errorKeyword', '$closingBraces', '$schemaPath',
'$validate'
];
files.forEach(function (f) {
var keyword = path.basename(f, '.jst');
var targetPath = path.join(dotjsPath, keyword + '.js');
var template = fs.readFileSync(path.join(filesRootPath, f));
var code = doT.compile(template, defs);
code = code.toString()
.replace(OUT_EMPTY_STRING, '')
.replace(FUNCTION_NAME, 'function generate_' + keyword + '(it, $keyword, $ruleType) {')
.replace(ISTANBUL, '/* $1 */');
removeAlwaysFalsyInOr();
VARS.forEach(removeUnusedVar);
code = "'use strict';\nmodule.exports = " + code;
code = beautify(code, { indent_size: 2 }) + '\n';
fs.writeFileSync(targetPath, code);
console.log('compiled', keyword);
function removeUnusedVar(v) {
v = v.replace(/\$/g, '\\$$');
var regexp = new RegExp(v + '[^A-Za-z0-9_$]', 'g');
var count = occurrences(regexp);
if (count == 1) {
regexp = new RegExp('var\\s+' + v + '\\s*=[^;]+;|var\\s+' + v + ';');
code = code.replace(regexp, '');
}
}
function removeAlwaysFalsyInOr() {
var countUsed = occurrences(ERROR_KEYWORD);
var countOr = occurrences(ERROR_KEYWORD_OR);
if (countUsed == countOr + 1) code = code.replace(ERROR_KEYWORD_OR, '');
}
function occurrences(regexp) {
return (code.match(regexp) || []).length;
}
});
@@ -0,0 +1,85 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/use-divider.ts
var use_divider_exports = {};
__export(use_divider_exports, {
useDivider: () => useDivider
});
module.exports = __toCommonJS(use_divider_exports);
var import_theme = require("@heroui/theme");
var import_react = require("react");
// src/use-separator.ts
var import_react_rsc_utils = require("@heroui/react-rsc-utils");
function useSeparator(props) {
let domProps = (0, import_react_rsc_utils.filterDOMProps)(props, {
enabled: typeof props.elementType === "string"
});
let ariaOrientation;
if (props.orientation === "vertical") {
ariaOrientation = "vertical";
}
if (props.elementType !== "hr") {
return {
separatorProps: {
...domProps,
role: "separator",
"aria-orientation": ariaOrientation
}
};
}
return { separatorProps: domProps };
}
// src/use-divider.ts
function useDivider(props) {
const { as, className, orientation, ...otherProps } = props;
let Component = as || "hr";
if (Component === "hr" && orientation === "vertical") {
Component = "div";
}
const { separatorProps } = useSeparator({
elementType: typeof Component === "string" ? Component : "hr",
orientation
});
const styles = (0, import_react.useMemo)(
() => (0, import_theme.divider)({
orientation,
className
}),
[orientation, className]
);
const getDividerProps = (0, import_react.useCallback)(
(props2 = {}) => ({
className: styles,
role: "separator",
"data-orientation": orientation,
...separatorProps,
...otherProps,
...props2
}),
[styles, orientation, separatorProps, otherProps]
);
return { Component, getDividerProps };
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
useDivider
});
@@ -0,0 +1 @@
{"mappings":";;AAkBA,iCAAkC,SAAQ,iBAAiB;IACzD;;;OAGG;IACH,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B;AAED;IACE;;OAEG;IACH,YAAY,EAAE,eAAe,WAAW,CAAC,CAAA;CAC1C;AAED;;;;;GAKG;AACH,2BAA2B,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,UAAU,WAAW,GAAG,IAAI,CAAC,GAAG,WAAW,CA2FnG","sources":["packages/@react-aria/toolbar/src/packages/@react-aria/toolbar/src/useToolbar.ts","packages/@react-aria/toolbar/src/packages/@react-aria/toolbar/src/index.ts","packages/@react-aria/toolbar/src/index.ts"],"sourcesContent":[null,null,"/*\n * Copyright 2023 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport * from './useToolbar';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
@@ -0,0 +1,21 @@
import { flow } from '../../src/transforms/index.js';
import { seedBlock } from '../../src/util.js';
import { Block } from '../../src/primitives.js';
const t0 = (b: Block): Block => ({ ...b, description: b.description + ' t0' });
const t1 = (b: Block): Block => ({ ...b, description: b.description + ' t1' });
test('multiple', () => {
const block = seedBlock({ description: 'test' });
expect(flow(t0, t1)(block).description).toBe('test t0 t1');
});
test('one', () => {
const block = seedBlock({ description: 'test' });
expect(flow(t0)(block).description).toBe('test t0');
});
test('none', () => {
const block = seedBlock({ description: 'test' });
expect(flow()(block).description).toBe('test');
});
@@ -0,0 +1,17 @@
/**
Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms).
@param codePoint - The [code point](https://en.wikipedia.org/wiki/Code_point) of a character.
@example
```
import isFullwidthCodePoint from 'is-fullwidth-code-point';
isFullwidthCodePoint('谢'.codePointAt(0));
//=> true
isFullwidthCodePoint('a'.codePointAt(0));
//=> false
```
*/
export default function isFullwidthCodePoint(codePoint: number): boolean;
@@ -0,0 +1,8 @@
var $0936d7347ef4da4c$exports = {};
$0936d7347ef4da4c$exports = {
"dismiss": `Avvisa`
};
export {$0936d7347ef4da4c$exports as default};
//# sourceMappingURL=sv-SE.module.js.map
@@ -0,0 +1,64 @@
import { isScalar, isAlias, isSeq, isMap } from '../../nodes/identity.js';
import { Scalar } from '../../nodes/Scalar.js';
// If the value associated with a merge key is a single mapping node, each of
// its key/value pairs is inserted into the current mapping, unless the key
// already exists in it. If the value associated with the merge key is a
// sequence, then this sequence is expected to contain mapping nodes and each
// of these nodes is merged in turn according to its order in the sequence.
// Keys in mapping nodes earlier in the sequence override keys specified in
// later mapping nodes. -- http://yaml.org/type/merge.html
const MERGE_KEY = '<<';
const merge = {
identify: value => value === MERGE_KEY ||
(typeof value === 'symbol' && value.description === MERGE_KEY),
default: 'key',
tag: 'tag:yaml.org,2002:merge',
test: /^<<$/,
resolve: () => Object.assign(new Scalar(Symbol(MERGE_KEY)), {
addToJSMap: addMergeToJSMap
}),
stringify: () => MERGE_KEY
};
const isMergeKey = (ctx, key) => (merge.identify(key) ||
(isScalar(key) &&
(!key.type || key.type === Scalar.PLAIN) &&
merge.identify(key.value))) &&
ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);
function addMergeToJSMap(ctx, map, value) {
value = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
if (isSeq(value))
for (const it of value.items)
mergeValue(ctx, map, it);
else if (Array.isArray(value))
for (const it of value)
mergeValue(ctx, map, it);
else
mergeValue(ctx, map, value);
}
function mergeValue(ctx, map, value) {
const source = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
if (!isMap(source))
throw new Error('Merge sources must be maps or map aliases');
const srcMap = source.toJSON(null, ctx, Map);
for (const [key, value] of srcMap) {
if (map instanceof Map) {
if (!map.has(key))
map.set(key, value);
}
else if (map instanceof Set) {
map.add(key);
}
else if (!Object.prototype.hasOwnProperty.call(map, key)) {
Object.defineProperty(map, key, {
value,
writable: true,
enumerable: true,
configurable: true
});
}
}
return map;
}
export { addMergeToJSMap, isMergeKey, merge };
@@ -0,0 +1,46 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils")
const { getSourceCode } = require("eslint-compat-utils")
module.exports = {
meta: {
docs: {
description: "disallow the `Math.tanh` method.",
category: "ES2015",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-math-tanh.html",
},
fixable: null,
messages: {
forbidden: "ES2015 '{{name}}' method is forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
"Program:exit"(program) {
const sourceCode = getSourceCode(context)
const tracker = new ReferenceTracker(
sourceCode.getScope(program),
)
for (const { node, path } of tracker.iterateGlobalReferences({
Math: {
tanh: { [READ]: true },
},
})) {
context.report({
node,
messageId: "forbidden",
data: { name: path.join(".") },
})
}
},
}
},
}
@@ -0,0 +1,30 @@
"use strict"
const { READ } = require("@eslint-community/eslint-utils")
/**
* @satisfies {import('../types.js').SupportVersionTraceMap}
*/
const vm = {
constants: { [READ]: { supported: ["20.12.0", "21.7.0"] } },
compileFunction: { [READ]: { supported: ["10.10.0"] } },
createContext: { [READ]: { supported: ["0.3.1"] } },
isContext: { [READ]: { supported: ["0.11.7"] } },
measureMemory: { [READ]: { experimental: ["13.10.0"] } },
runInContext: { [READ]: { supported: ["0.3.1"] } },
runInNewContext: { [READ]: { supported: ["0.3.1"] } },
runInThisContext: { [READ]: { supported: ["0.3.1"] } },
Script: { [READ]: { supported: ["0.3.1"] } },
// Module was not found in v10 or v11.
Module: { [READ]: { experimental: ["13.0.0", "12.16.0", "9.6.0"] } },
SourceTextModule: { [READ]: { experimental: ["9.6.0"] } },
SyntheticModule: { [READ]: { experimental: ["13.0.0", "12.16.0"] } },
}
/**
* @satisfies {import('../types.js').SupportVersionTraceMap}
*/
module.exports = {
vm: vm,
"node:vm": { ...vm, [READ]: { supported: ["14.13.1", "12.20.0"] } },
}
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2012-2019 Thorsten Lorenz, Paul Miller (https://paulmillr.com)
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.
@@ -0,0 +1,7 @@
Copyright (c) 2015 Tiancheng “Timothy” Gu
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.
@@ -0,0 +1 @@
{"version":3,"names":["_t","require","addComment","_addComment","addComments","_addComments","shareCommentsWithSiblings","key","node","trailing","trailingComments","leading","leadingComments","prev","getSibling","next","hasPrev","Boolean","hasNext","removeIfExisting","list","toRemove","length","set","Set","filter","el","has","type","content","line","comments"],"sources":["../../src/path/comments.ts"],"sourcesContent":["// This file contains methods responsible for dealing with comments.\nimport type * as t from \"@babel/types\";\nimport type NodePath from \"./index.ts\";\nimport {\n addComment as _addComment,\n addComments as _addComments,\n} from \"@babel/types\";\n\n/**\n * Share comments amongst siblings.\n */\n\nexport function shareCommentsWithSiblings(this: NodePath) {\n // NOTE: this assumes numbered keys\n if (typeof this.key === \"string\") return;\n\n const node = this.node;\n if (!node) return;\n\n const trailing = node.trailingComments;\n const leading = node.leadingComments;\n if (!trailing && !leading) return;\n\n const prev = this.getSibling(this.key! - 1);\n const next = this.getSibling(this.key! + 1);\n const hasPrev = Boolean(prev.node);\n const hasNext = Boolean(next.node);\n\n if (hasPrev) {\n if (leading) {\n prev.addComments(\n \"trailing\",\n removeIfExisting(leading, prev.node.trailingComments),\n );\n }\n if (trailing && !hasNext) prev.addComments(\"trailing\", trailing);\n }\n if (hasNext) {\n if (trailing) {\n next.addComments(\n \"leading\",\n removeIfExisting(trailing, next.node.leadingComments),\n );\n }\n if (leading && !hasPrev) next.addComments(\"leading\", leading);\n }\n}\n\nfunction removeIfExisting<T>(list: T[], toRemove?: T[] | null): T[] {\n if (!toRemove?.length) return list;\n const set = new Set(toRemove);\n return list.filter(el => {\n return !set.has(el);\n });\n}\n\nexport function addComment(\n this: NodePath,\n type: t.CommentTypeShorthand,\n content: string,\n line?: boolean,\n) {\n _addComment(this.node, type, content, line);\n}\n\n/**\n * Give node `comments` of the specified `type`.\n */\n\nexport function addComments(\n this: NodePath,\n type: t.CommentTypeShorthand,\n comments: t.Comment[],\n) {\n _addComments(this.node, type, comments);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,EAAA,GAAAC,OAAA;AAGsB;EAFpBC,UAAU,EAAIC,WAAW;EACzBC,WAAW,EAAIC;AAAY,IAAAL,EAAA;AAOtB,SAASM,yBAAyBA,CAAA,EAAiB;EAExD,IAAI,OAAO,IAAI,CAACC,GAAG,KAAK,QAAQ,EAAE;EAElC,MAAMC,IAAI,GAAG,IAAI,CAACA,IAAI;EACtB,IAAI,CAACA,IAAI,EAAE;EAEX,MAAMC,QAAQ,GAAGD,IAAI,CAACE,gBAAgB;EACtC,MAAMC,OAAO,GAAGH,IAAI,CAACI,eAAe;EACpC,IAAI,CAACH,QAAQ,IAAI,CAACE,OAAO,EAAE;EAE3B,MAAME,IAAI,GAAG,IAAI,CAACC,UAAU,CAAC,IAAI,CAACP,GAAG,GAAI,CAAC,CAAC;EAC3C,MAAMQ,IAAI,GAAG,IAAI,CAACD,UAAU,CAAC,IAAI,CAACP,GAAG,GAAI,CAAC,CAAC;EAC3C,MAAMS,OAAO,GAAGC,OAAO,CAACJ,IAAI,CAACL,IAAI,CAAC;EAClC,MAAMU,OAAO,GAAGD,OAAO,CAACF,IAAI,CAACP,IAAI,CAAC;EAElC,IAAIQ,OAAO,EAAE;IACX,IAAIL,OAAO,EAAE;MACXE,IAAI,CAACT,WAAW,CACd,UAAU,EACVe,gBAAgB,CAACR,OAAO,EAAEE,IAAI,CAACL,IAAI,CAACE,gBAAgB,CACtD,CAAC;IACH;IACA,IAAID,QAAQ,IAAI,CAACS,OAAO,EAAEL,IAAI,CAACT,WAAW,CAAC,UAAU,EAAEK,QAAQ,CAAC;EAClE;EACA,IAAIS,OAAO,EAAE;IACX,IAAIT,QAAQ,EAAE;MACZM,IAAI,CAACX,WAAW,CACd,SAAS,EACTe,gBAAgB,CAACV,QAAQ,EAAEM,IAAI,CAACP,IAAI,CAACI,eAAe,CACtD,CAAC;IACH;IACA,IAAID,OAAO,IAAI,CAACK,OAAO,EAAED,IAAI,CAACX,WAAW,CAAC,SAAS,EAAEO,OAAO,CAAC;EAC/D;AACF;AAEA,SAASQ,gBAAgBA,CAAIC,IAAS,EAAEC,QAAqB,EAAO;EAClE,IAAI,EAACA,QAAQ,YAARA,QAAQ,CAAEC,MAAM,GAAE,OAAOF,IAAI;EAClC,MAAMG,GAAG,GAAG,IAAIC,GAAG,CAACH,QAAQ,CAAC;EAC7B,OAAOD,IAAI,CAACK,MAAM,CAACC,EAAE,IAAI;IACvB,OAAO,CAACH,GAAG,CAACI,GAAG,CAACD,EAAE,CAAC;EACrB,CAAC,CAAC;AACJ;AAEO,SAASxB,UAAUA,CAExB0B,IAA4B,EAC5BC,OAAe,EACfC,IAAc,EACd;EACA3B,WAAW,CAAC,IAAI,CAACK,IAAI,EAAEoB,IAAI,EAAEC,OAAO,EAAEC,IAAI,CAAC;AAC7C;AAMO,SAAS1B,WAAWA,CAEzBwB,IAA4B,EAC5BG,QAAqB,EACrB;EACA1B,YAAY,CAAC,IAAI,CAACG,IAAI,EAAEoB,IAAI,EAAEG,QAAQ,CAAC;AACzC","ignoreList":[]}
@@ -0,0 +1,24 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference no-default-lib="true"/>
/// <reference lib="es2018" />
/// <reference lib="es2019.array" />
/// <reference lib="es2019.object" />
/// <reference lib="es2019.string" />
/// <reference lib="es2019.symbol" />
/// <reference lib="es2019.intl" />
@@ -0,0 +1,34 @@
var path = require('path');
var test = require('tape');
var resolve = require('../');
test('filter', function (t) {
t.plan(4);
var dir = path.join(__dirname, 'resolver');
var packageFilterArgs;
resolve('./baz', {
basedir: dir,
packageFilter: function (pkg, pkgfile) {
pkg.main = 'doom'; // eslint-disable-line no-param-reassign
packageFilterArgs = [pkg, pkgfile];
return pkg;
}
}, function (err, res, pkg) {
if (err) t.fail(err);
t.equal(res, path.join(dir, 'baz/doom.js'), 'changing the package "main" works');
var packageData = packageFilterArgs[0];
t.equal(pkg, packageData, 'first packageFilter argument is "pkg"');
t.equal(packageData.main, 'doom', 'package "main" was altered');
var packageFile = packageFilterArgs[1];
t.equal(
packageFile,
path.join(dir, 'baz/package.json'),
'second packageFilter argument is "pkgfile"'
);
t.end();
});
});
@@ -0,0 +1,8 @@
export interface IconManifestType {
id: string;
name: string;
projectUrl: string;
license: string;
licenseUrl: string;
}
export declare const IconsManifest: IconManifestType[];
@@ -0,0 +1,42 @@
# globals
> Global identifiers from different JavaScript environments
It's just a [JSON file](globals.json), so you can use it in any environment.
This package is used by ESLint 8 and earlier. For ESLint 9 and later, you should depend on this package directly in [your ESLint config](https://eslint.org/docs/latest/use/configure/language-options#predefined-global-variables).
## Install
```sh
npm install globals
```
## Usage
```js
import globals from 'globals';
console.log(globals.browser);
/*
{
addEventListener: false,
applicationCache: false,
ArrayBuffer: false,
atob: false,
…
}
*/
```
Each global is given a value of `true` or `false`. A value of `true` indicates that the variable may be overwritten. A value of `false` indicates that the variable should be considered read-only. This information is used by static analysis tools to flag incorrect behavior. We assume all variables should be `false` unless we hear otherwise.
For Node.js this package provides two sets of globals:
- `globals.nodeBuiltin`: Globals available to all code running in Node.js.
These will usually be available as properties on the `globalThis` object and include `process`, `Buffer`, but not CommonJS arguments like `require`.
See: https://nodejs.org/api/globals.html
- `globals.node`: A combination of the globals from `nodeBuiltin` plus all CommonJS arguments ("CommonJS module scope").
See: https://nodejs.org/api/modules.html#modules_the_module_scope
When analyzing code that is known to run outside of a CommonJS wrapper, for example, JavaScript modules, `nodeBuiltin` can find accidental CommonJS references.
@@ -0,0 +1,40 @@
var Attributes_1;
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes, AsnArray, AsnType, AsnTypeTypes, OctetString, } from "@peculiar/asn1-schema";
import { AlgorithmIdentifier, Attribute } from "@peculiar/asn1-x509";
export var Version;
(function (Version) {
Version[Version["v1"] = 0] = "v1";
})(Version || (Version = {}));
export class PrivateKey extends OctetString {
}
let Attributes = Attributes_1 = class Attributes extends AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, Attributes_1.prototype);
}
};
Attributes = Attributes_1 = __decorate([
AsnType({ type: AsnTypeTypes.Sequence, itemType: Attribute })
], Attributes);
export { Attributes };
export class PrivateKeyInfo {
constructor(params = {}) {
this.version = Version.v1;
this.privateKeyAlgorithm = new AlgorithmIdentifier();
this.privateKey = new PrivateKey();
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.Integer })
], PrivateKeyInfo.prototype, "version", void 0);
__decorate([
AsnProp({ type: AlgorithmIdentifier })
], PrivateKeyInfo.prototype, "privateKeyAlgorithm", void 0);
__decorate([
AsnProp({ type: PrivateKey })
], PrivateKeyInfo.prototype, "privateKey", void 0);
__decorate([
AsnProp({ type: Attributes, implicit: true, context: 0, optional: true })
], PrivateKeyInfo.prototype, "attributes", void 0);
@@ -0,0 +1 @@
{"version":3,"file":"read-pkg-up.js","sourceRoot":"","sources":["../../src/utils/read-pkg-up.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAA;AAIxB,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAEnC,SAAS,QAAQ,CAAC,GAAW;IAC3B,OAAO,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;AACnC,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,IAAuB;IAC/C,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,CAAA;IAEtB,IAAI,CAAC,EAAE,EAAE,CAAC;QACR,OAAO,EAAE,CAAA;IACX,CAAC;IAED,IAAI,CAAC;QACH,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,KAAK,CACb,QAAQ,CAAC,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,CAGpD;YACD,IAAI,EAAE,EAAE;SACT,CAAA;IACH,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAA;IACX,CAAC;AACH,CAAC"}
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=getInstanceNodeBinding.spec.d.ts.map
@@ -0,0 +1,39 @@
import Client from './client'
import TPoolStats from './pool-stats'
import { URL } from 'url'
import Dispatcher from "./dispatcher";
export default Pool
type PoolConnectOptions = Omit<Dispatcher.ConnectOptions, "origin">;
declare class Pool extends Dispatcher {
constructor(url: string | URL, options?: Pool.Options)
/** `true` after `pool.close()` has been called. */
closed: boolean;
/** `true` after `pool.destroyed()` has been called or `pool.close()` has been called and the pool shutdown has completed. */
destroyed: boolean;
/** Aggregate stats for a Pool. */
readonly stats: TPoolStats;
// Override dispatcher APIs.
override connect(
options: PoolConnectOptions
): Promise<Dispatcher.ConnectData>;
override connect(
options: PoolConnectOptions,
callback: (err: Error | null, data: Dispatcher.ConnectData) => void
): void;
}
declare namespace Pool {
export type PoolStats = TPoolStats;
export interface Options extends Client.Options {
/** Default: `(origin, opts) => new Client(origin, opts)`. */
factory?(origin: URL, opts: object): Dispatcher;
/** The max number of clients to create. `null` if no limit. Default `null`. */
connections?: number | null;
interceptors?: { Pool?: readonly Dispatcher.DispatchInterceptor[] } & Client.Options["interceptors"]
}
}
@@ -0,0 +1,88 @@
'use strict';
var Type = require('../type');
var YAML_DATE_REGEXP = new RegExp(
'^([0-9][0-9][0-9][0-9])' + // [1] year
'-([0-9][0-9])' + // [2] month
'-([0-9][0-9])$'); // [3] day
var YAML_TIMESTAMP_REGEXP = new RegExp(
'^([0-9][0-9][0-9][0-9])' + // [1] year
'-([0-9][0-9]?)' + // [2] month
'-([0-9][0-9]?)' + // [3] day
'(?:[Tt]|[ \\t]+)' + // ...
'([0-9][0-9]?)' + // [4] hour
':([0-9][0-9])' + // [5] minute
':([0-9][0-9])' + // [6] second
'(?:\\.([0-9]*))?' + // [7] fraction
'(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour
'(?::([0-9][0-9]))?))?$'); // [11] tz_minute
function resolveYamlTimestamp(data) {
if (data === null) return false;
if (YAML_DATE_REGEXP.exec(data) !== null) return true;
if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
return false;
}
function constructYamlTimestamp(data) {
var match, year, month, day, hour, minute, second, fraction = 0,
delta = null, tz_hour, tz_minute, date;
match = YAML_DATE_REGEXP.exec(data);
if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
if (match === null) throw new Error('Date resolve error');
// match: [1] year [2] month [3] day
year = +(match[1]);
month = +(match[2]) - 1; // JS month starts with 0
day = +(match[3]);
if (!match[4]) { // no hour
return new Date(Date.UTC(year, month, day));
}
// match: [4] hour [5] minute [6] second [7] fraction
hour = +(match[4]);
minute = +(match[5]);
second = +(match[6]);
if (match[7]) {
fraction = match[7].slice(0, 3);
while (fraction.length < 3) { // milli-seconds
fraction += '0';
}
fraction = +fraction;
}
// match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute
if (match[9]) {
tz_hour = +(match[10]);
tz_minute = +(match[11] || 0);
delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds
if (match[9] === '-') delta = -delta;
}
date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
if (delta) date.setTime(date.getTime() - delta);
return date;
}
function representYamlTimestamp(object /*, style*/) {
return object.toISOString();
}
module.exports = new Type('tag:yaml.org,2002:timestamp', {
kind: 'scalar',
resolve: resolveYamlTimestamp,
construct: constructYamlTimestamp,
instanceOf: Date,
represent: representYamlTimestamp
});
@@ -0,0 +1,35 @@
// Copyright 2013 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Helper for rounding
#ifndef WOFF2_ROUND_H_
#define WOFF2_ROUND_H_
#include <limits>
namespace woff2 {
// Round a value up to the nearest multiple of 4. Don't round the value in the
// case that rounding up overflows.
template<typename T> T Round4(T value) {
if (std::numeric_limits<T>::max() - value < 3) {
return value;
}
return (value + 3) & ~3;
}
} // namespace woff2
#endif // WOFF2_ROUND_H_
@@ -0,0 +1,118 @@
var Stream = require('stream').Stream
module.exports = legacy
function legacy (fs) {
return {
ReadStream: ReadStream,
WriteStream: WriteStream
}
function ReadStream (path, options) {
if (!(this instanceof ReadStream)) return new ReadStream(path, options);
Stream.call(this);
var self = this;
this.path = path;
this.fd = null;
this.readable = true;
this.paused = false;
this.flags = 'r';
this.mode = 438; /*=0666*/
this.bufferSize = 64 * 1024;
options = options || {};
// Mixin options into this
var keys = Object.keys(options);
for (var index = 0, length = keys.length; index < length; index++) {
var key = keys[index];
this[key] = options[key];
}
if (this.encoding) this.setEncoding(this.encoding);
if (this.start !== undefined) {
if ('number' !== typeof this.start) {
throw TypeError('start must be a Number');
}
if (this.end === undefined) {
this.end = Infinity;
} else if ('number' !== typeof this.end) {
throw TypeError('end must be a Number');
}
if (this.start > this.end) {
throw new Error('start must be <= end');
}
this.pos = this.start;
}
if (this.fd !== null) {
process.nextTick(function() {
self._read();
});
return;
}
fs.open(this.path, this.flags, this.mode, function (err, fd) {
if (err) {
self.emit('error', err);
self.readable = false;
return;
}
self.fd = fd;
self.emit('open', fd);
self._read();
})
}
function WriteStream (path, options) {
if (!(this instanceof WriteStream)) return new WriteStream(path, options);
Stream.call(this);
this.path = path;
this.fd = null;
this.writable = true;
this.flags = 'w';
this.encoding = 'binary';
this.mode = 438; /*=0666*/
this.bytesWritten = 0;
options = options || {};
// Mixin options into this
var keys = Object.keys(options);
for (var index = 0, length = keys.length; index < length; index++) {
var key = keys[index];
this[key] = options[key];
}
if (this.start !== undefined) {
if ('number' !== typeof this.start) {
throw TypeError('start must be a Number');
}
if (this.start < 0) {
throw new Error('start must be >= zero');
}
this.pos = this.start;
}
this.busy = false;
this._queue = [];
if (this.fd === null) {
this._open = fs.open;
this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);
this.flush();
}
}
}
@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _react = require("react");
function useLatest(value) {
var ref = (0, _react.useRef)(value);
ref.current = value;
return ref;
}
var _default = exports["default"] = useLatest;
@@ -0,0 +1 @@
{"version":3,"file":"InjectFromBaseOptionsLifecycle.d.ts","sourceRoot":"","sources":["../../../../src/metadata/models/InjectFromBaseOptionsLifecycle.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,8BAA8B;IAC7C,uBAAuB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9C,0BAA0B,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAClD"}
@@ -0,0 +1,4 @@
function _objectDestructuringEmpty(t) {
if (null == t) throw new TypeError("Cannot destructure " + t);
}
module.exports = _objectDestructuringEmpty, module.exports.__esModule = true, module.exports["default"] = module.exports;
@@ -0,0 +1,38 @@
import copyObject from './_copyObject.js';
import createAssigner from './_createAssigner.js';
import keysIn from './keysIn.js';
/**
* This method is like `_.assignIn` except that it accepts `customizer`
* which is invoked to produce the assigned values. If `customizer` returns
* `undefined`, assignment is handled by the method instead. The `customizer`
* is invoked with five arguments: (objValue, srcValue, key, object, source).
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 4.0.0
* @alias extendWith
* @category Object
* @param {Object} object The destination object.
* @param {...Object} sources The source objects.
* @param {Function} [customizer] The function to customize assigned values.
* @returns {Object} Returns `object`.
* @see _.assignWith
* @example
*
* function customizer(objValue, srcValue) {
* return _.isUndefined(objValue) ? srcValue : objValue;
* }
*
* var defaults = _.partialRight(_.assignInWith, customizer);
*
* defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
* // => { 'a': 1, 'b': 2 }
*/
var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
copyObject(source, keysIn(source), object, customizer);
});
export default assignInWith;
@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isPlaceholderType;
var _index = require("../definitions/index.js");
function isPlaceholderType(placeholderType, targetType) {
if (placeholderType === targetType) return true;
const aliases = _index.PLACEHOLDERS_ALIAS[placeholderType];
if (aliases != null && aliases.includes(targetType)) return true;
return false;
}
//# sourceMappingURL=isPlaceholderType.js.map
@@ -0,0 +1,14 @@
import { GetFileBase } from './GetFile';
export default class GetImage extends GetFileBase {
actionName: "get_image";
actionSummary: string;
actionDescription: string;
actionTags: string[];
payloadExample: {
file: string;
};
returnExample: {
file: string;
url: string;
};
}
@@ -0,0 +1,3 @@
# @react-stately/selection
This package is part of [react-spectrum](https://github.com/adobe/react-spectrum). See the repo for more details.
@@ -0,0 +1,43 @@
import curry from '../utils/curry.js';
import isObject from '../utils/isObject.js';
/**
* validates the configuration object and informs about deprecation
* @param {Object} config - the configuration object
* @return {Object} config - the validated configuration object
*/
function validateConfig(config) {
if (!config) errorHandler('configIsRequired');
if (!isObject(config)) errorHandler('configType');
if (config.urls) {
informAboutDeprecation();
return {
paths: {
vs: config.urls.monacoBase
}
};
}
return config;
}
/**
* logs deprecation message
*/
function informAboutDeprecation() {
console.warn(errorMessages.deprecation);
}
function throwError(errorMessages, type) {
throw new Error(errorMessages[type] || errorMessages["default"]);
}
var errorMessages = {
configIsRequired: 'the configuration object is required',
configType: 'the configuration object should be an object',
"default": 'an unknown error accured in `@monaco-editor/loader` package',
deprecation: "Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "
};
var errorHandler = curry(throwError)(errorMessages);
var validators = {
config: validateConfig
};
export { validators as default, errorHandler, errorMessages };
@@ -0,0 +1,21 @@
Copyright (c) 2011:
Tim Koschützki (tim@debuggable.com)
Felix Geisendörfer (felix@debuggable.com)
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.
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('flattenDeep', require('../flattenDeep'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./key_description"), exports);
tslib_1.__exportStar(require("./nonstandard"), exports);
tslib_1.__exportStar(require("./attestation"), exports);
@@ -0,0 +1,49 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/** @typedef {import("./Resolver")} Resolver */
/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */
/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */
module.exports = class AppendPlugin {
/**
* @param {string | ResolveStepHook} source source
* @param {string} appending appending
* @param {string | ResolveStepHook} target target
*/
constructor(source, appending, target) {
this.source = source;
this.appending = appending;
this.target = target;
}
/**
* @param {Resolver} resolver the resolver
* @returns {void}
*/
apply(resolver) {
const target = resolver.ensureHook(this.target);
resolver
.getHook(this.source)
.tapAsync("AppendPlugin", (request, resolveContext, callback) => {
/** @type {ResolveRequest} */
const obj = {
...request,
path: request.path + this.appending,
relativePath:
request.relativePath && request.relativePath + this.appending,
};
resolver.doResolve(
target,
obj,
this.appending,
resolveContext,
callback,
);
});
}
};
@@ -0,0 +1,929 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/components/input.ts
var input_exports = {};
__export(input_exports, {
input: () => input
});
module.exports = __toCommonJS(input_exports);
// src/utils/tv.ts
var import_tailwind_variants = require("tailwind-variants");
// src/utils/tw-merge-config.ts
var COMMON_UNITS = ["small", "medium", "large"];
var twMergeConfig = {
theme: {
opacity: ["disabled"],
spacing: ["divider"],
borderWidth: COMMON_UNITS,
borderRadius: COMMON_UNITS
},
classGroups: {
shadow: [{ shadow: COMMON_UNITS }],
"font-size": [{ text: ["tiny", ...COMMON_UNITS] }],
"bg-image": [
"bg-stripe-gradient-default",
"bg-stripe-gradient-primary",
"bg-stripe-gradient-secondary",
"bg-stripe-gradient-success",
"bg-stripe-gradient-warning",
"bg-stripe-gradient-danger"
]
}
};
// src/utils/tv.ts
var tv = (options, config) => {
var _a, _b, _c;
return (0, import_tailwind_variants.tv)(options, {
...config,
twMerge: (_a = config == null ? void 0 : config.twMerge) != null ? _a : true,
twMergeConfig: {
...config == null ? void 0 : config.twMergeConfig,
theme: {
...(_b = config == null ? void 0 : config.twMergeConfig) == null ? void 0 : _b.theme,
...twMergeConfig.theme
},
classGroups: {
...(_c = config == null ? void 0 : config.twMergeConfig) == null ? void 0 : _c.classGroups,
...twMergeConfig.classGroups
}
}
});
};
// src/utils/classes.ts
var dataFocusVisibleClasses = [
"outline-none",
"data-[focus-visible=true]:z-10",
"data-[focus-visible=true]:outline-2",
"data-[focus-visible=true]:outline-focus",
"data-[focus-visible=true]:outline-offset-2"
];
var groupDataFocusVisibleClasses = [
"outline-none",
"group-data-[focus-visible=true]:z-10",
"group-data-[focus-visible=true]:ring-2",
"group-data-[focus-visible=true]:ring-focus",
"group-data-[focus-visible=true]:ring-offset-2",
"group-data-[focus-visible=true]:ring-offset-background"
];
// src/components/input.ts
var input = tv({
slots: {
base: "group flex flex-col data-[hidden=true]:hidden",
label: [
"absolute",
"z-10",
"pointer-events-none",
"origin-top-left",
"flex-shrink-0",
"rtl:origin-top-right",
"subpixel-antialiased",
"block",
"text-small",
"text-foreground-500"
],
mainWrapper: "h-full",
inputWrapper: "relative w-full inline-flex tap-highlight-transparent flex-row items-center shadow-sm px-3 gap-3",
innerWrapper: "inline-flex w-full items-center h-full box-border",
input: [
"w-full font-normal bg-transparent !outline-none placeholder:text-foreground-500 focus-visible:outline-none",
"data-[has-start-content=true]:ps-1.5",
"data-[has-end-content=true]:pe-1.5",
"file:cursor-pointer file:bg-transparent file:border-0",
"autofill:bg-transparent bg-clip-text"
],
clearButton: [
"p-2",
"-m-2",
"z-10",
"absolute",
"end-3",
"start-auto",
"pointer-events-none",
"appearance-none",
"outline-none",
"select-none",
"opacity-0",
"hover:!opacity-100",
"cursor-pointer",
"active:!opacity-70",
"rounded-full",
...dataFocusVisibleClasses
],
helperWrapper: "hidden group-data-[has-helper=true]:flex p-1 relative flex-col gap-1.5",
description: "text-tiny text-foreground-400",
errorMessage: "text-tiny text-danger"
},
variants: {
variant: {
flat: {
inputWrapper: [
"bg-default-100",
"data-[hover=true]:bg-default-200",
"group-data-[focus=true]:bg-default-100"
]
},
faded: {
inputWrapper: [
"bg-default-100",
"border-medium",
"border-default-200",
"data-[hover=true]:border-default-400 focus-within:border-default-400"
],
value: "group-data-[has-value=true]:text-default-foreground"
},
bordered: {
inputWrapper: [
"border-medium",
"border-default-200",
"data-[hover=true]:border-default-400",
"group-data-[focus=true]:border-default-foreground"
]
},
underlined: {
inputWrapper: [
"!px-1",
"!pb-0",
"!gap-0",
"relative",
"box-border",
"border-b-medium",
"shadow-[0_1px_0px_0_rgba(0,0,0,0.05)]",
"border-default-200",
"!rounded-none",
"hover:border-default-300",
"after:content-['']",
"after:w-0",
"after:origin-center",
"after:bg-default-foreground",
"after:absolute",
"after:left-1/2",
"after:-translate-x-1/2",
"after:-bottom-[2px]",
"after:h-[2px]",
"group-data-[focus=true]:after:w-full"
],
innerWrapper: "pb-1",
label: "group-data-[filled-within=true]:text-foreground"
}
},
color: {
default: {},
primary: {},
secondary: {},
success: {},
warning: {},
danger: {}
},
size: {
sm: {
label: "text-tiny",
inputWrapper: "h-8 min-h-8 px-2 rounded-small",
input: "text-small",
clearButton: "text-medium"
},
md: {
inputWrapper: "h-10 min-h-10 rounded-medium",
input: "text-small",
clearButton: "text-large"
},
lg: {
label: "text-medium",
inputWrapper: "h-12 min-h-12 rounded-large",
input: "text-medium",
clearButton: "text-large"
}
},
radius: {
none: {
inputWrapper: "rounded-none"
},
sm: {
inputWrapper: "rounded-small"
},
md: {
inputWrapper: "rounded-medium"
},
lg: {
inputWrapper: "rounded-large"
},
full: {
inputWrapper: "rounded-full"
}
},
labelPlacement: {
outside: {
mainWrapper: "flex flex-col"
},
"outside-left": {
base: "flex-row items-center flex-nowrap data-[has-helper=true]:items-start",
inputWrapper: "flex-1",
mainWrapper: "flex flex-col",
label: "relative text-foreground pe-2 ps-2 pointer-events-auto"
},
inside: {
label: "cursor-text",
inputWrapper: "flex-col items-start justify-center gap-0",
innerWrapper: "group-data-[has-label=true]:items-end"
}
},
fullWidth: {
true: {
base: "w-full"
},
false: {}
},
isClearable: {
true: {
input: "peer pe-6 input-search-cancel-button-none",
clearButton: [
"peer-data-[filled=true]:pointer-events-auto",
"peer-data-[filled=true]:opacity-70 peer-data-[filled=true]:block",
"peer-data-[filled=true]:scale-100"
]
}
},
isDisabled: {
true: {
base: "opacity-disabled pointer-events-none",
inputWrapper: "pointer-events-none",
label: "pointer-events-none"
}
},
isInvalid: {
true: {
label: "!text-danger",
input: "!placeholder:text-danger !text-danger"
}
},
isRequired: {
true: {
label: "after:content-['*'] after:text-danger after:ms-0.5"
}
},
isMultiline: {
true: {
label: "relative",
inputWrapper: "!h-auto",
innerWrapper: "items-start group-data-[has-label=true]:items-start",
input: "resize-none data-[hide-scroll=true]:scrollbar-hide",
clearButton: "absolute top-2 right-2 rtl:right-auto rtl:left-2 z-10"
}
},
disableAnimation: {
true: {
input: "transition-none",
inputWrapper: "transition-none",
label: "transition-none"
},
false: {
inputWrapper: "transition-background motion-reduce:transition-none !duration-150",
label: [
"will-change-auto",
"!duration-200",
"!ease-out",
"motion-reduce:transition-none",
"transition-[transform,color,left,opacity]"
],
clearButton: [
"scale-90",
"ease-out",
"duration-150",
"transition-[opacity,transform]",
"motion-reduce:transition-none",
"motion-reduce:scale-100"
]
}
}
},
defaultVariants: {
variant: "flat",
color: "default",
size: "md",
fullWidth: true,
labelPlacement: "inside",
isDisabled: false,
isMultiline: false
},
compoundVariants: [
{
variant: "flat",
color: "default",
class: {
input: "group-data-[has-value=true]:text-default-foreground"
}
},
{
variant: "flat",
color: "primary",
class: {
inputWrapper: [
"bg-primary-100",
"data-[hover=true]:bg-primary-50",
"text-primary",
"group-data-[focus=true]:bg-primary-50",
"placeholder:text-primary"
],
input: "placeholder:text-primary",
label: "text-primary"
}
},
{
variant: "flat",
color: "secondary",
class: {
inputWrapper: [
"bg-secondary-100",
"text-secondary",
"data-[hover=true]:bg-secondary-50",
"group-data-[focus=true]:bg-secondary-50",
"placeholder:text-secondary"
],
input: "placeholder:text-secondary",
label: "text-secondary"
}
},
{
variant: "flat",
color: "success",
class: {
inputWrapper: [
"bg-success-100",
"text-success-600",
"dark:text-success",
"placeholder:text-success-600",
"dark:placeholder:text-success",
"data-[hover=true]:bg-success-50",
"group-data-[focus=true]:bg-success-50"
],
input: "placeholder:text-success-600 dark:placeholder:text-success",
label: "text-success-600 dark:text-success"
}
},
{
variant: "flat",
color: "warning",
class: {
inputWrapper: [
"bg-warning-100",
"text-warning-600",
"dark:text-warning",
"placeholder:text-warning-600",
"dark:placeholder:text-warning",
"data-[hover=true]:bg-warning-50",
"group-data-[focus=true]:bg-warning-50"
],
input: "placeholder:text-warning-600 dark:placeholder:text-warning",
label: "text-warning-600 dark:text-warning"
}
},
{
variant: "flat",
color: "danger",
class: {
inputWrapper: [
"bg-danger-100",
"text-danger",
"dark:text-danger-500",
"placeholder:text-danger",
"dark:placeholder:text-danger-500",
"data-[hover=true]:bg-danger-50",
"group-data-[focus=true]:bg-danger-50"
],
input: "placeholder:text-danger dark:placeholder:text-danger-500",
label: "text-danger dark:text-danger-500"
}
},
{
variant: "faded",
color: "primary",
class: {
label: "text-primary",
inputWrapper: "data-[hover=true]:border-primary focus-within:border-primary"
}
},
{
variant: "faded",
color: "secondary",
class: {
label: "text-secondary",
inputWrapper: "data-[hover=true]:border-secondary focus-within:border-secondary"
}
},
{
variant: "faded",
color: "success",
class: {
label: "text-success",
inputWrapper: "data-[hover=true]:border-success focus-within:border-success"
}
},
{
variant: "faded",
color: "warning",
class: {
label: "text-warning",
inputWrapper: "data-[hover=true]:border-warning focus-within:border-warning"
}
},
{
variant: "faded",
color: "danger",
class: {
label: "text-danger",
inputWrapper: "data-[hover=true]:border-danger focus-within:border-danger"
}
},
{
variant: "underlined",
color: "default",
class: {
input: "group-data-[has-value=true]:text-foreground"
}
},
{
variant: "underlined",
color: "primary",
class: {
inputWrapper: "after:bg-primary",
label: "text-primary"
}
},
{
variant: "underlined",
color: "secondary",
class: {
inputWrapper: "after:bg-secondary",
label: "text-secondary"
}
},
{
variant: "underlined",
color: "success",
class: {
inputWrapper: "after:bg-success",
label: "text-success"
}
},
{
variant: "underlined",
color: "warning",
class: {
inputWrapper: "after:bg-warning",
label: "text-warning"
}
},
{
variant: "underlined",
color: "danger",
class: {
inputWrapper: "after:bg-danger",
label: "text-danger"
}
},
{
variant: "bordered",
color: "primary",
class: {
inputWrapper: "group-data-[focus=true]:border-primary",
label: "text-primary"
}
},
{
variant: "bordered",
color: "secondary",
class: {
inputWrapper: "group-data-[focus=true]:border-secondary",
label: "text-secondary"
}
},
{
variant: "bordered",
color: "success",
class: {
inputWrapper: "group-data-[focus=true]:border-success",
label: "text-success"
}
},
{
variant: "bordered",
color: "warning",
class: {
inputWrapper: "group-data-[focus=true]:border-warning",
label: "text-warning"
}
},
{
variant: "bordered",
color: "danger",
class: {
inputWrapper: "group-data-[focus=true]:border-danger",
label: "text-danger"
}
},
{
labelPlacement: "inside",
color: "default",
class: {
label: "group-data-[filled-within=true]:text-default-600"
}
},
{
labelPlacement: "outside",
color: "default",
class: {
label: "group-data-[filled-within=true]:text-foreground"
}
},
{
radius: "full",
size: ["sm"],
class: {
inputWrapper: "px-3"
}
},
{
radius: "full",
size: "md",
class: {
inputWrapper: "px-4"
}
},
{
radius: "full",
size: "lg",
class: {
inputWrapper: "px-5"
}
},
{
disableAnimation: false,
variant: ["faded", "bordered"],
class: {
inputWrapper: "transition-colors motion-reduce:transition-none"
}
},
{
disableAnimation: false,
variant: "underlined",
class: {
inputWrapper: "after:transition-width motion-reduce:after:transition-none"
}
},
{
variant: ["flat", "faded"],
class: {
inputWrapper: [
...groupDataFocusVisibleClasses
]
}
},
{
isInvalid: true,
variant: "flat",
class: {
inputWrapper: [
"!bg-danger-50",
"data-[hover=true]:!bg-danger-100",
"group-data-[focus=true]:!bg-danger-50"
]
}
},
{
isInvalid: true,
variant: "bordered",
class: {
inputWrapper: "!border-danger group-data-[focus=true]:!border-danger"
}
},
{
isInvalid: true,
variant: "underlined",
class: {
inputWrapper: "after:!bg-danger"
}
},
{
labelPlacement: "inside",
size: "sm",
class: {
inputWrapper: "h-12 py-1.5 px-3"
}
},
{
labelPlacement: "inside",
size: "md",
class: {
inputWrapper: "h-14 py-2"
}
},
{
labelPlacement: "inside",
size: "lg",
class: {
inputWrapper: "h-16 py-2.5 gap-0"
}
},
{
labelPlacement: "inside",
size: "sm",
variant: ["bordered", "faded"],
class: {
inputWrapper: "py-1"
}
},
{
labelPlacement: ["inside", "outside"],
class: {
label: ["group-data-[filled-within=true]:pointer-events-auto"]
}
},
{
labelPlacement: "outside",
isMultiline: false,
class: {
base: "relative justify-end",
label: [
"pb-0",
"z-20",
"top-1/2",
"-translate-y-1/2",
"group-data-[filled-within=true]:start-0"
]
}
},
{
labelPlacement: ["inside"],
class: {
label: ["group-data-[filled-within=true]:scale-85"]
}
},
{
labelPlacement: ["inside"],
variant: "flat",
class: {
innerWrapper: "pb-0.5"
}
},
{
variant: "underlined",
size: "sm",
class: {
innerWrapper: "pb-1"
}
},
{
variant: "underlined",
size: ["md", "lg"],
class: {
innerWrapper: "pb-1.5"
}
},
{
labelPlacement: "inside",
size: ["sm", "md"],
class: {
label: "text-small"
}
},
{
labelPlacement: "inside",
isMultiline: false,
size: "sm",
class: {
label: [
"group-data-[filled-within=true]:-translate-y-[calc(50%_+_theme(fontSize.tiny)/2_-_8px)]"
]
}
},
{
labelPlacement: "inside",
isMultiline: false,
size: "md",
class: {
label: [
"group-data-[filled-within=true]:-translate-y-[calc(50%_+_theme(fontSize.small)/2_-_6px)]"
]
}
},
{
labelPlacement: "inside",
isMultiline: false,
size: "lg",
class: {
label: [
"text-medium",
"group-data-[filled-within=true]:-translate-y-[calc(50%_+_theme(fontSize.small)/2_-_8px)]"
]
}
},
{
labelPlacement: "inside",
variant: ["faded", "bordered"],
isMultiline: false,
size: "sm",
class: {
label: [
"group-data-[filled-within=true]:-translate-y-[calc(50%_+_theme(fontSize.tiny)/2_-_8px_-_theme(borderWidth.medium))]"
]
}
},
{
labelPlacement: "inside",
variant: ["faded", "bordered"],
isMultiline: false,
size: "md",
class: {
label: [
"group-data-[filled-within=true]:-translate-y-[calc(50%_+_theme(fontSize.small)/2_-_6px_-_theme(borderWidth.medium))]"
]
}
},
{
labelPlacement: "inside",
variant: ["faded", "bordered"],
isMultiline: false,
size: "lg",
class: {
label: [
"text-medium",
"group-data-[filled-within=true]:-translate-y-[calc(50%_+_theme(fontSize.small)/2_-_8px_-_theme(borderWidth.medium))]"
]
}
},
{
labelPlacement: "inside",
variant: "underlined",
isMultiline: false,
size: "sm",
class: {
label: [
"group-data-[filled-within=true]:-translate-y-[calc(50%_+_theme(fontSize.tiny)/2_-_5px)]"
]
}
},
{
labelPlacement: "inside",
variant: "underlined",
isMultiline: false,
size: "md",
class: {
label: [
"group-data-[filled-within=true]:-translate-y-[calc(50%_+_theme(fontSize.small)/2_-_3.5px)]"
]
}
},
{
labelPlacement: "inside",
variant: "underlined",
size: "lg",
isMultiline: false,
class: {
label: [
"text-medium",
"group-data-[filled-within=true]:-translate-y-[calc(50%_+_theme(fontSize.small)/2_-_4px)]"
]
}
},
{
labelPlacement: "outside",
size: "sm",
isMultiline: false,
class: {
label: [
"start-2",
"text-tiny",
"group-data-[filled-within=true]:-translate-y-[calc(100%_+_theme(fontSize.tiny)/2_+_16px)]"
],
base: "data-[has-label=true]:mt-[calc(theme(fontSize.small)_+_8px)]"
}
},
{
labelPlacement: "outside",
size: "md",
isMultiline: false,
class: {
label: [
"start-3",
"end-auto",
"text-small",
"group-data-[filled-within=true]:-translate-y-[calc(100%_+_theme(fontSize.small)/2_+_20px)]"
],
base: "data-[has-label=true]:mt-[calc(theme(fontSize.small)_+_10px)]"
}
},
{
labelPlacement: "outside",
size: "lg",
isMultiline: false,
class: {
label: [
"start-3",
"end-auto",
"text-medium",
"group-data-[filled-within=true]:-translate-y-[calc(100%_+_theme(fontSize.small)/2_+_24px)]"
],
base: "data-[has-label=true]:mt-[calc(theme(fontSize.small)_+_12px)]"
}
},
{
labelPlacement: "outside-left",
size: "sm",
class: {
label: "group-data-[has-helper=true]:pt-2"
}
},
{
labelPlacement: "outside-left",
size: "md",
class: {
label: "group-data-[has-helper=true]:pt-3"
}
},
{
labelPlacement: "outside-left",
size: "lg",
class: {
label: "group-data-[has-helper=true]:pt-4"
}
},
{
labelPlacement: ["outside", "outside-left"],
isMultiline: true,
class: {
inputWrapper: "py-2"
}
},
{
labelPlacement: "outside",
isMultiline: true,
class: {
label: "pb-1.5"
}
},
{
labelPlacement: "inside",
isMultiline: true,
class: {
label: "pb-0.5",
input: "pt-0"
}
},
{
isMultiline: true,
disableAnimation: false,
class: {
input: "transition-height !duration-100 motion-reduce:transition-none"
}
},
{
labelPlacement: ["inside", "outside"],
class: {
label: ["pe-2", "max-w-full", "text-ellipsis", "overflow-hidden"]
}
},
{
isMultiline: true,
radius: "full",
class: {
inputWrapper: "data-[has-multiple-rows=true]:rounded-large"
}
},
{
isClearable: true,
isMultiline: true,
class: {
clearButton: [
"group-data-[has-value=true]:opacity-70 group-data-[has-value=true]:block",
"group-data-[has-value=true]:scale-100",
"group-data-[has-value=true]:pointer-events-auto"
]
}
}
]
});
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
input
});
@@ -0,0 +1,78 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
function testUserAgent(re: RegExp) {
if (typeof window === 'undefined' || window.navigator == null) {
return false;
}
let brands = window.navigator['userAgentData']?.brands;
return Array.isArray(brands) && brands.some((brand: {brand: string, version: string}) => re.test(brand.brand)) ||
re.test(window.navigator.userAgent);
}
function testPlatform(re: RegExp) {
return typeof window !== 'undefined' && window.navigator != null
? re.test(window.navigator['userAgentData']?.platform || window.navigator.platform)
: false;
}
function cached(fn: () => boolean) {
if (process.env.NODE_ENV === 'test') {
return fn;
}
let res: boolean | null = null;
return () => {
if (res == null) {
res = fn();
}
return res;
};
}
export const isMac: () => boolean = cached(function () {
return testPlatform(/^Mac/i);
});
export const isIPhone: () => boolean = cached(function () {
return testPlatform(/^iPhone/i);
});
export const isIPad: () => boolean = cached(function () {
return testPlatform(/^iPad/i) ||
// iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
(isMac() && navigator.maxTouchPoints > 1);
});
export const isIOS: () => boolean = cached(function () {
return isIPhone() || isIPad();
});
export const isAppleDevice: () => boolean = cached(function () {
return isMac() || isIOS();
});
export const isWebKit: () => boolean = cached(function () {
return testUserAgent(/AppleWebKit/i) && !isChrome();
});
export const isChrome: () => boolean = cached(function () {
return testUserAgent(/Chrome/i);
});
export const isAndroid: () => boolean = cached(function () {
return testUserAgent(/Android/i);
});
export const isFirefox: () => boolean = cached(function () {
return testUserAgent(/Firefox/i);
});
@@ -0,0 +1,55 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _filter;
var _isArrayLike = require('./isArrayLike.js');
var _isArrayLike2 = _interopRequireDefault(_isArrayLike);
var _wrapAsync = require('./wrapAsync.js');
var _wrapAsync2 = _interopRequireDefault(_wrapAsync);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function filterArray(eachfn, arr, iteratee, callback) {
var truthValues = new Array(arr.length);
eachfn(arr, (x, index, iterCb) => {
iteratee(x, (err, v) => {
truthValues[index] = !!v;
iterCb(err);
});
}, err => {
if (err) return callback(err);
var results = [];
for (var i = 0; i < arr.length; i++) {
if (truthValues[i]) results.push(arr[i]);
}
callback(null, results);
});
}
function filterGeneric(eachfn, coll, iteratee, callback) {
var results = [];
eachfn(coll, (x, index, iterCb) => {
iteratee(x, (err, v) => {
if (err) return iterCb(err);
if (v) {
results.push({ index, value: x });
}
iterCb(err);
});
}, err => {
if (err) return callback(err);
callback(null, results.sort((a, b) => a.index - b.index).map(v => v.value));
});
}
function _filter(eachfn, coll, iteratee, callback) {
var filter = (0, _isArrayLike2.default)(coll) ? filterArray : filterGeneric;
return filter(eachfn, coll, (0, _wrapAsync2.default)(iteratee), callback);
}
module.exports = exports.default;
@@ -0,0 +1,54 @@
# Node.js ABI
[![Build Status](https://github.com/electron/node-abi/actions/workflows/test.yml/badge.svg)](https://github.com/electron/node-abi/actions/workflows/test.yml)
[![Auto-update ABI JSON file](https://github.com/electron/node-abi/actions/workflows/update-abi.yml/badge.svg)](https://github.com/electron/node-abi/actions/workflows/update-abi.yml)
[![Snyk badge](https://snyk.io/test/github/electron/node-abi/badge.svg)](https://snyk.io/test/github/electron/node-abi)
[![npm version](http://img.shields.io/npm/v/node-abi.svg)](https://npmjs.org/package/node-abi)
Get the Node ABI (application binary interface) for a given target and runtime, and vice versa.
## Installation
```shell
npm install node-abi
```
## Usage
```javascript
const nodeAbi = require('node-abi')
nodeAbi.getAbi('7.2.0', 'node')
// '51'
nodeAbi.getAbi('1.4.10', 'electron')
// '50'
nodeAbi.getTarget('51', 'node')
// '7.2.0'
nodeAbi.getTarget('50', 'electron')
// '1.4.15'
nodeAbi.allTargets
// [
// { runtime: 'node', target: '0.10.48', abi: '11', lts: false },
// { runtime: 'node', target: '0.12.17', abi: '14', lts: false },
// { runtime: 'node', target: '4.6.1', abi: '46', lts: true },
// { runtime: 'node', target: '5.12.0', abi: '47', lts: false },
// { runtime: 'node', target: '6.9.4', abi: '48', lts: true },
// { runtime: 'node', target: '7.4.0', abi: '51', lts: false },
// { runtime: 'electron', target: '1.0.2', abi: '47', lts: false },
// { runtime: 'electron', target: '1.2.8', abi: '48', lts: false },
// { runtime: 'electron', target: '1.3.13', abi: '49', lts: false },
// { runtime: 'electron', target: '1.4.15', abi: '50', lts: false }
// ]
nodeAbi.deprecatedTargets
nodeAbi.supportedTargets
nodeAbi.additionalTargets
nodeAbi.futureTargets
// ...
```
## References
- https://github.com/lgeiger/electron-abi
- https://nodejs.org/en/download/releases/
- https://github.com/nodejs/Release
@@ -0,0 +1,4 @@
'use strict';
// TODO, semver-major: remove
module.exports = require('set-proto');
@@ -0,0 +1,4 @@
declare const safeText: (text: string) => string;
declare const safeAriaLabel: (...texts: any[]) => string;
export { safeAriaLabel, safeText };
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more