docs: 仓库链接指向本镜像仓库
Build NapCat Artifacts / Type Check & Test (push) Waiting to run

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,8 @@
function _isNativeFunction(t) {
try {
return -1 !== Function.toString.call(t).indexOf("[native code]");
} catch (n) {
return "function" == typeof t;
}
}
export { _isNativeFunction as default };
@@ -0,0 +1,21 @@
/// <reference types="node" />
interface MIMEType {
type: string
subtype: string
parameters: Map<string, string>
essence: string
}
/**
* Parse a string to a {@link MIMEType} object. Returns `failure` if the string
* couldn't be parsed.
* @see https://mimesniff.spec.whatwg.org/#parse-a-mime-type
*/
export function parseMIMEType (input: string): 'failure' | MIMEType
/**
* Convert a MIMEType object to a string.
* @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type
*/
export function serializeAMimeType (mimeType: MIMEType): string
@@ -0,0 +1,824 @@
flf2a$ 8 7 20 -1 7
STELLAR by Ron Fritz 8/94
Figlet Release 2.0
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
`..@
`..@
`..@
`. @
`. @
@
`..@
@@
`. `.@
`. `.@
@
@
@
@
@
@@
@
`.. `.. @
`...... `....@
`.. `.. @
`.. `.. @
`...... `....@
`.. `.. @
@@
`.. @
`. `.. @
`.. @
`.. @
`..@
`.. `.. @
`.. @
@@
@
`.. `.. @
`.. @
`.. @
`.. @
`.. @
`.. `.. @
@@
`. @
`.. `..@
`.. @
`... @
`.. @
`.. `..@
`. @
@@
`..@
`.@
@
@
@
@
@
@@
`..@
`.. @
`.. @
`.. @
`.. @
`.. @
`..@
@@
`.. @
`.. @
`..@
`..@
`..@
`.. @
`.. @
@@
`.. @
`.. `.. `..@
`. `. `.. @
`.... `.......@
`. `. `.. @
`.. `.. `..@
`.. @
@@
@
`.. @
`.. @
`... `.....@
`.. @
`.. @
@
@@
@
@
@
@
@
@
`..@
`.@@
@
@
@
`.....@
@
@
@
@@
@
@
@
@
@
@
`..@
@@
`..@
`.. @
`.. @
`.. @
`.. @
`.. @
`.. @
@@
@
`.. @
`.. `.. @
`.. `.. @
`.. `..@
`.. `.. @
`... @
@@
@
`.. @
`.. @
`.. @
`.. @
`.. @
`....@
@@
@
`.. `.. @
`. `..@
`.. @
`.. @
`.. @
`........ @
@@
@
`.. `.. @
`.. @
`.. @
`.. @
`..@
`..... @
@@
@
`.. @
` `.. @
`. `.. @
`.. `.. @
`.... `. `..@
`.. @
@@
@
`.. `... @
`.. @
`... @
`.. @
`..@
`... `.. @
@@
@
`.. @
`.. @
`.. @
`. `.. @
`.. `..@
`.. `.. @
@@
@
`..... `..@
`.. @
`.. @
`.. @
`.. @
`.. @
@@
@
`. @
`.. `.. @
`.. `. @
`.. `. @
`.. `..@
`.... @
@@
@
`. `.. @
`.. `..@
`. `.. @
`. `.. @
`.. @
`.. @
@@
@
@
@
@
`..@
@
`..@
@@
@
@
@
@
`..@
@
`..@
`.@@
`..@
`.. @
`.. @
`.. @
`.. @
`.. @
`..@
@@
@
@
`......@
@
`......@
@
@
@@
`.. @
`.. @
`.. @
`..@
`.. @
`.. @
`.. @
@@
`... @
`.. @
`..@
`.. @
`.. @
@
`.. @
@@
@
`... @
`. `.. @
`. `.. `..@
`.. `..` `..@
`.. ``` @
`.. @
@@
`. @
`. .. @
`. `.. @
`.. `.. @
`...... `.. @
`.. `.. @
`.. `..@
@@
`.. `.. @
`. `.. @
`. `..@
`... `. @
`. `..@
`. `.@
`.... `.. @
@@
`.. @
`.. `..@
`.. @
`.. @
`.. @
`.. `..@
`.... @
@@
`..... @
`.. `.. @
`.. `..@
`.. `..@
`.. `..@
`.. `.. @
`..... @
@@
`........@
`.. @
`.. @
`...... @
`.. @
`.. @
`........@
@@
`........@
`.. @
`.. @
`...... @
`.. @
`.. @
`.. @
@@
`.... @
`. `.. @
`.. @
`.. @
`.. `....@
`.. `. @
`..... @
@@
`.. `..@
`.. `..@
`.. `..@
`...... `..@
`.. `..@
`.. `..@
`.. `..@
@@
`..@
`..@
`..@
`..@
`..@
`..@
`..@
@@
`..@
`..@
`..@
`..@
`..@
`. `..@
`.... @
@@
`.. `.. @
`.. `.. @
`.. `.. @
`. `. @
`.. `.. @
`.. `.. @
`.. `..@
@@
`.. @
`.. @
`.. @
`.. @
`.. @
`.. @
`........@
@@
`.. `..@
`. `.. `...@
`.. `.. ` `..@
`.. `.. `..@
`.. `. `..@
`.. `..@
`.. `..@
@@
`... `..@
`. `.. `..@
`.. `.. `..@
`.. `.. `..@
`.. `. `..@
`.. `. ..@
`.. `..@
@@
`.... @
`.. `.. @
`.. `..@
`.. `..@
`.. `..@
`.. `.. @
`.... @
@@
`....... @
`.. `..@
`.. `..@
`....... @
`.. @
`.. @
`.. @
@@
`.... @
`.. `.. @
`.. `..@
`.. `..@
`.. `..@
`.. `. `.. @
`.. .. @
`. @@
`....... @
`.. `.. @
`.. `.. @
`. `.. @
`.. `.. @
`.. `.. @
`.. `..@
@@
`.. .. @
`.. `..@
`.. @
`.. @
`.. @
`.. `..@
`.. .. @
@@
`... `......@
`.. @
`.. @
`.. @
`.. @
`.. @
`.. @
@@
`.. `..@
`.. `..@
`.. `..@
`.. `..@
`.. `..@
`.. `..@
`..... @
@@
`.. `..@
`.. `.. @
`.. `.. @
`.. `.. @
`.. `.. @
`.... @
`.. @
@@
`.. `..@
`.. `..@
`.. `. `..@
`.. `.. `..@
`.. `. `.. `..@
`. `. `....@
`.. `..@
@@
`.. `..@
`.. `.. @
`.. `.. @
`.. @
`.. `.. @
`.. `.. @
`.. `..@
@@
`.. `..@
`.. `.. @
`.. `.. @
`.. @
`.. @
`.. @
`.. @
@@
`....... `..@
`.. @
`.. @
`.. @
`.. @
`.. @
`...........@
@@
`....@
`.. @
`.. @
`.. @
`.. @
`.. @
`....@
@@
`.. @
`.. @
`.. @
`.. @
`.. @
`.. @
`..@
@@
`....@
`..@
`..@
`..@
`..@
`..@
`....@
@@
`.. @
`.. `.. @
`.. `..@
@
@
@
@
@@
@
@
@
@
@
@
@
`.....@@
`..@
`. @
@
@
@
@
@
@@
@
@
`.. @
`.. `.. @
`.. `.. @
`.. `.. @
`.. `...@
@@
`.. @
`.. @
`.. @
`.. `.. @
`.. `..@
`.. `..@
`.. `.. @
@@
@
@
`...@
`.. @
`.. @
`.. @
`...@
@@
`..@
`..@
`..@
`.. `..@
`. `..@
`. `..@
`.. `..@
@@
@
@
`.. @
`. `.. @
`..... `..@
`. @
`.... @
@@
`..@
`. @
`.`. `.@
`.. @
`.. @
`.. @
`.. @
@@
@
@
`.. @
`.. `..@
`.. `..@
`.. `..@
`.. @
`.. @@
@
`.. @
`.. @
`. `. @
`.. `..@
`. `..@
`.. `..@
@@
@
`.@
@
`..@
`..@
`..@
`..@
@@
@
`..@
@
`..@
`..@
`..@
`..@
`... @@
`.. @
`.. @
`.. `..@
`.. `.. @
`.`.. @
`.. `.. @
`.. `..@
@@
`..@
`..@
`..@
`..@
`..@
`..@
`...@
@@
@
@
`... `.. `.. @
`.. `. `..@
`.. `. `..@
`.. `. `..@
`... `. `..@
@@
@
@
`.. `.. @
`.. `..@
`.. `..@
`.. `..@
`... `..@
@@
@
@
`.. @
`.. `.. @
`.. `..@
`.. `.. @
`.. @
@@
@
@
`. `.. @
`. `.. @
`. `..@
`.. `.. @
`.. @
`.. @@
@
@
`.. @
`. `.. @
`. `.. @
`..`.. @
`.. @
`...@@
@
@
`. `...@
`.. @
`.. @
`.. @
`... @
@@
@
@
`.... @
`.. @
`... @
`..@
`.. `..@
@@
`.. @
`.. @
`.`. `.@
`.. @
`.. @
`.. @
`.. @
@@
@
@
`.. `..@
`.. `..@
`.. `..@
`.. `..@
`..`..@
@@
@
@
`.. `..@
`.. `.. @
`.. `.. @
`.`.. @
`.. @
@@
@
@
`.. `...@
`.. . `..@
`.. `. `..@
`. `. `.`..@
`... `...@
@@
@
@
`.. `..@
`. `.. @
`. @
`. `.. @
`.. `..@
@@
@
@
`.. `..@
`.. `.. @
`... @
`.. @
`.. @
`.. @@
@
@
`.... `..@
`.. @
`.. @
`.. @
`........@
@@
`..@
`.. @
`.. @
`... @
`.. @
`.. @
`..@
@@
`.@
`.@
`.@
@
`.@
`.@
`.@
@@
`.. @
`.. @
`.. @
`..@
`.. @
`.. @
`.. @
@@
`.. `. @
`. `..@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@@ -0,0 +1 @@
export declare function useWindowRect(element: typeof window | null): import("../..").ClientRect | null;
@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Readonly = Readonly;
const type_1 = require("../create/type");
const index_1 = require("../symbols/index");
const index_2 = require("../discard/index");
const readonly_from_mapped_result_1 = require("./readonly-from-mapped-result");
const kind_1 = require("../guard/kind");
function RemoveReadonly(schema) {
return (0, type_1.CreateType)((0, index_2.Discard)(schema, [index_1.ReadonlyKind]));
}
function AddReadonly(schema) {
return (0, type_1.CreateType)({ ...schema, [index_1.ReadonlyKind]: 'Readonly' });
}
// prettier-ignore
function ReadonlyWithFlag(schema, F) {
return (F === false
? RemoveReadonly(schema)
: AddReadonly(schema));
}
/** `[Json]` Creates a Readonly property */
function Readonly(schema, enable) {
const F = enable ?? true;
return (0, kind_1.IsMappedResult)(schema) ? (0, readonly_from_mapped_result_1.ReadonlyFromMappedResult)(schema, F) : ReadonlyWithFlag(schema, F);
}
@@ -0,0 +1,42 @@
{
"name": "extend",
"author": "Stefan Thomas <justmoon@members.fsf.org> (http://www.justmoon.net)",
"version": "3.0.2",
"description": "Port of jQuery.extend for node.js and the browser",
"main": "index",
"scripts": {
"pretest": "npm run lint",
"test": "npm run tests-only",
"posttest": "npm run coverage-quiet",
"tests-only": "node test",
"coverage": "covert test/index.js",
"coverage-quiet": "covert test/index.js --quiet",
"lint": "npm run jscs && npm run eslint",
"jscs": "jscs *.js */*.js",
"eslint": "eslint *.js */*.js"
},
"contributors": [
{
"name": "Jordan Harband",
"url": "https://github.com/ljharb"
}
],
"keywords": [
"extend",
"clone",
"merge"
],
"repository": {
"type": "git",
"url": "https://github.com/justmoon/node-extend.git"
},
"dependencies": {},
"devDependencies": {
"@ljharb/eslint-config": "^12.2.1",
"covert": "^1.1.0",
"eslint": "^4.19.1",
"jscs": "^3.0.7",
"tape": "^4.9.1"
},
"license": "MIT"
}
@@ -0,0 +1,25 @@
"use strict";
exports.__esModule = true;
exports["default"] = void 0;
var _node = _interopRequireDefault(require("./node"));
var _types = require("./types");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
var ID = /*#__PURE__*/function (_Node) {
_inheritsLoose(ID, _Node);
function ID(opts) {
var _this;
_this = _Node.call(this, opts) || this;
_this.type = _types.ID;
return _this;
}
var _proto = ID.prototype;
_proto.valueToString = function valueToString() {
return '#' + _Node.prototype.valueToString.call(this);
};
return ID;
}(_node["default"]);
exports["default"] = ID;
module.exports = exports.default;
@@ -0,0 +1 @@
{"version":3,"file":"axios.js","sources":["../lib/helpers/bind.js","../lib/utils.js","../lib/core/AxiosError.js","../lib/helpers/null.js","../lib/helpers/toFormData.js","../lib/helpers/AxiosURLSearchParams.js","../lib/helpers/buildURL.js","../lib/core/InterceptorManager.js","../lib/defaults/transitional.js","../lib/platform/browser/classes/URLSearchParams.js","../lib/platform/browser/classes/FormData.js","../lib/platform/browser/classes/Blob.js","../lib/platform/browser/index.js","../lib/platform/common/utils.js","../lib/platform/index.js","../lib/helpers/toURLEncodedForm.js","../lib/helpers/formDataToJSON.js","../lib/defaults/index.js","../lib/helpers/parseHeaders.js","../lib/core/AxiosHeaders.js","../lib/core/transformData.js","../lib/cancel/isCancel.js","../lib/cancel/CanceledError.js","../lib/core/settle.js","../lib/helpers/parseProtocol.js","../lib/helpers/speedometer.js","../lib/helpers/throttle.js","../lib/helpers/progressEventReducer.js","../lib/helpers/isURLSameOrigin.js","../lib/helpers/cookies.js","../lib/helpers/isAbsoluteURL.js","../lib/helpers/combineURLs.js","../lib/core/buildFullPath.js","../lib/core/mergeConfig.js","../lib/helpers/resolveConfig.js","../lib/adapters/xhr.js","../lib/helpers/composeSignals.js","../lib/helpers/trackStream.js","../lib/adapters/fetch.js","../lib/adapters/adapters.js","../lib/core/dispatchRequest.js","../lib/env/data.js","../lib/helpers/validator.js","../lib/core/Axios.js","../lib/cancel/CancelToken.js","../lib/helpers/spread.js","../lib/helpers/isAxiosError.js","../lib/helpers/HttpStatusCode.js","../lib/axios.js"],"sourcesContent":["'use strict';\n\n/**\n * Create a bound version of a function with a specified `this` context\n *\n * @param {Function} fn - The function to bind\n * @param {*} thisArg - The value to be passed as the `this` parameter\n * @returns {Function} A new function that will call the original function with the specified `this` context\n */\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\nconst {iterator, toStringTag} = Symbol;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a BoLine truncated
@@ -0,0 +1,212 @@
/** @typedef {import('postcss-selector-parser').Root} Root */ /** @typedef {import('postcss-selector-parser').Selector} Selector */ /** @typedef {import('postcss-selector-parser').Pseudo} Pseudo */ /** @typedef {import('postcss-selector-parser').Node} Node */ // There are some pseudo-elements that may or may not be:
// **Actionable**
// Zero or more user-action pseudo-classes may be attached to the pseudo-element itself
// structural-pseudo-classes are NOT allowed but we don't make
// The spec is not clear on whether this is allowed or not — but in practice it is.
// **Terminal**
// It MUST be placed at the end of a selector
//
// This is the required in the spec. However, some pseudo elements are not "terminal" because
// they represent a "boundary piercing" that is compiled out by a build step.
// **Jumpable**
// Any terminal element may "jump" over combinators when moving to the end of the selector
//
// This is a backwards-compat quirk of pseudo element variants from earlier versions of Tailwind CSS.
/** @typedef {'terminal' | 'actionable' | 'jumpable'} PseudoProperty */ /** @type {Record<string, PseudoProperty[]>} */ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "movePseudos", {
enumerable: true,
get: function() {
return movePseudos;
}
});
let elementProperties = {
// Pseudo elements from the spec
"::after": [
"terminal",
"jumpable"
],
"::backdrop": [
"terminal",
"jumpable"
],
"::before": [
"terminal",
"jumpable"
],
"::cue": [
"terminal"
],
"::cue-region": [
"terminal"
],
"::first-letter": [
"terminal",
"jumpable"
],
"::first-line": [
"terminal",
"jumpable"
],
"::grammar-error": [
"terminal"
],
"::marker": [
"terminal",
"jumpable"
],
"::part": [
"terminal",
"actionable"
],
"::placeholder": [
"terminal",
"jumpable"
],
"::selection": [
"terminal",
"jumpable"
],
"::slotted": [
"terminal"
],
"::spelling-error": [
"terminal"
],
"::target-text": [
"terminal"
],
// Pseudo elements from the spec with special rules
"::file-selector-button": [
"terminal",
"actionable"
],
// Library-specific pseudo elements used by component libraries
// These are Shadow DOM-like
"::deep": [
"actionable"
],
"::v-deep": [
"actionable"
],
"::ng-deep": [
"actionable"
],
// Note: As a rule, double colons (::) should be used instead of a single colon
// (:). This distinguishes pseudo-classes from pseudo-elements. However, since
// this distinction was not present in older versions of the W3C spec, most
// browsers support both syntaxes for the original pseudo-elements.
":after": [
"terminal",
"jumpable"
],
":before": [
"terminal",
"jumpable"
],
":first-letter": [
"terminal",
"jumpable"
],
":first-line": [
"terminal",
"jumpable"
],
":where": [],
":is": [],
":has": [],
// The default value is used when the pseudo-element is not recognized
// Because it's not recognized, we don't know if it's terminal or not
// So we assume it can be moved AND can have user-action pseudo classes attached to it
__default__: [
"terminal",
"actionable"
]
};
function movePseudos(sel) {
let [pseudos] = movablePseudos(sel);
// Remove all pseudo elements from their respective selectors
pseudos.forEach(([sel, pseudo])=>sel.removeChild(pseudo));
// Re-add them to the end of the selector in the correct order.
// This moves terminal pseudo elements to the end of the
// selector otherwise the selector will not be valid.
//
// Examples:
// - `before:hover:text-center` would result in `.before\:hover\:text-center:hover::before`
// - `hover:before:text-center` would result in `.hover\:before\:text-center:hover::before`
//
// The selector `::before:hover` does not work but we
// can make it work for you by flipping the order.
sel.nodes.push(...pseudos.map(([, pseudo])=>pseudo));
return sel;
}
/** @typedef {[sel: Selector, pseudo: Pseudo, attachedTo: Pseudo | null]} MovablePseudo */ /** @typedef {[pseudos: MovablePseudo[], lastSeenElement: Pseudo | null]} MovablePseudosResult */ /**
* @param {Selector} sel
* @returns {MovablePseudosResult}
*/ function movablePseudos(sel) {
/** @type {MovablePseudo[]} */ let buffer = [];
/** @type {Pseudo | null} */ let lastSeenElement = null;
for (let node of sel.nodes){
if (node.type === "combinator") {
buffer = buffer.filter(([, node])=>propertiesForPseudo(node).includes("jumpable"));
lastSeenElement = null;
} else if (node.type === "pseudo") {
if (isMovablePseudoElement(node)) {
lastSeenElement = node;
buffer.push([
sel,
node,
null
]);
} else if (lastSeenElement && isAttachablePseudoClass(node, lastSeenElement)) {
buffer.push([
sel,
node,
lastSeenElement
]);
} else {
lastSeenElement = null;
}
var _node_nodes;
for (let sub of (_node_nodes = node.nodes) !== null && _node_nodes !== void 0 ? _node_nodes : []){
let [movable, lastSeenElementInSub] = movablePseudos(sub);
lastSeenElement = lastSeenElementInSub || lastSeenElement;
buffer.push(...movable);
}
}
}
return [
buffer,
lastSeenElement
];
}
/**
* @param {Node} node
* @returns {boolean}
*/ function isPseudoElement(node) {
return node.value.startsWith("::") || elementProperties[node.value] !== undefined;
}
/**
* @param {Node} node
* @returns {boolean}
*/ function isMovablePseudoElement(node) {
return isPseudoElement(node) && propertiesForPseudo(node).includes("terminal");
}
/**
* @param {Node} node
* @param {Pseudo} pseudo
* @returns {boolean}
*/ function isAttachablePseudoClass(node, pseudo) {
if (node.type !== "pseudo") return false;
if (isPseudoElement(node)) return false;
return propertiesForPseudo(pseudo).includes("actionable");
}
/**
* @param {Pseudo} pseudo
* @returns {PseudoProperty[]}
*/ function propertiesForPseudo(pseudo) {
var _elementProperties_pseudo_value;
return (_elementProperties_pseudo_value = elementProperties[pseudo.value]) !== null && _elementProperties_pseudo_value !== void 0 ? _elementProperties_pseudo_value : elementProperties.__default__;
}
@@ -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 `Number.isFinite` method.",
category: "ES2015",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-number-isfinite.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({
Number: {
isFinite: { [READ]: true },
},
})) {
context.report({
node,
messageId: "forbidden",
data: { name: path.join(".") },
})
}
},
}
},
}
@@ -0,0 +1 @@
{"version":3,"file":"resolveBindingDeactivations.d.ts","sourceRoot":"","sources":["../../../../src/resolution/actions/resolveBindingDeactivations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAEvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAI9C,QAAA,MAAM,cAAc,EAAE,MAAM,aAAa,CACvC,WAAW,EACX,OAAO,kBAAkB,CAAC,SAAS,EACnC,OAAO,CACE,CAAC;AAEZ,KAAK,4BAA4B,CAAC,SAAS,IAAI,OAAO,GACpD,aAAa,CAAC,WAAW,EAAE,OAAO,kBAAkB,CAAC,SAAS,EAAE,SAAS,CAAC,GAAG;IAC3E,CAAC,cAAc,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;CAC9C,CAAC;AAEJ,wBAAgB,2BAA2B,CAAC,SAAS,EACnD,MAAM,EAAE,kBAAkB,EAC1B,OAAO,EAAE,4BAA4B,CAAC,SAAS,CAAC,GAC/C,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAatB"}
@@ -0,0 +1,12 @@
"use client";
import {
avatar_group_default
} from "./chunk-NB7VH5TP.mjs";
import "./chunk-SXMLSBOY.mjs";
import "./chunk-25E6VDTZ.mjs";
import "./chunk-QH65JCLF.mjs";
import "./chunk-LTC67JRI.mjs";
import "./chunk-JUJ53SJZ.mjs";
export {
avatar_group_default as default
};
@@ -0,0 +1,28 @@
var toString = require('./toString');
/** Used to generate unique IDs. */
var idCounter = 0;
/**
* Generates a unique ID. If `prefix` is given, the ID is appended to it.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {string} [prefix=''] The value to prefix the ID with.
* @returns {string} Returns the unique ID.
* @example
*
* _.uniqueId('contact_');
* // => 'contact_104'
*
* _.uniqueId();
* // => '105'
*/
function uniqueId(prefix) {
var id = ++idCounter;
return toString(prefix) + id;
}
module.exports = uniqueId;
@@ -0,0 +1,4 @@
{
"main": "../../cjs/_to_property_key.cjs",
"module": "../../esm/_to_property_key.js"
}
@@ -0,0 +1 @@
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AAkBM,SAAS,0CAAqB,KAAsB,EAAE,KAAoB,EAAE,GAA8B;IAC/G,IAAI,QAAC,IAAI,iBAAE,aAAa,EAAC,GAAG;IAC5B,IAAI,WAAW;QACb,MAAM;IACR;IAEA,IAAI,iBAAiB,CAAE,CAAA,CAAA,GAAA,wCAAc,OAAO,kBAAkB,KAAI,GAChE,QAAQ,CAAC,gBAAgB,GAAG,KAAK,KAAK,GAAG,GAAG,2BAA2B;IAGzE,OAAO;kBACL;IACF;AACF","sources":["packages/@react-aria/table/src/useTableHeaderRow.ts"],"sourcesContent":["/*\n * Copyright 2020 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\nimport {DOMAttributes, RefObject} from '@react-types/shared';\nimport {GridRowProps} from '@react-aria/grid';\nimport {tableNestedRows} from '@react-stately/flags';\nimport {TableState} from '@react-stately/table';\n\nexport interface TableHeaderRowAria {\n /** Props for the grid row element. */\n rowProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a header row in a table.\n * @param props - Props for the row.\n * @param state - State of the table, as returned by `useTableState`.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function useTableHeaderRow<T>(props: GridRowProps<T>, state: TableState<T>, ref: RefObject<Element | null>): TableHeaderRowAria {\n let {node, isVirtualized} = props;\n let rowProps = {\n role: 'row'\n };\n\n if (isVirtualized && !(tableNestedRows() && 'expandedKeys' in state)) {\n rowProps['aria-rowindex'] = node.index + 1; // aria-rowindex is 1 based\n }\n\n return {\n rowProps\n };\n}\n"],"names":[],"version":3,"file":"useTableHeaderRow.main.js.map"}
@@ -0,0 +1,151 @@
import { ListboxItemSelectedIconProps, ListboxItemBaseProps } from './base/listbox-item-base.js';
import * as _heroui_theme from '@heroui/theme';
import { MenuItemVariantProps } from '@heroui/theme';
import * as tailwind_variants from 'tailwind-variants';
import * as react from 'react';
import * as _heroui_system from '@heroui/system';
import { HTMLHeroUIProps, PropGetter } from '@heroui/system';
import { Node } from '@react-types/shared';
import { ListState } from '@react-stately/list';
import '@react-aria/listbox';
import '@heroui/aria-utils';
interface Props<T extends object> extends ListboxItemBaseProps<T> {
item: Node<T>;
state: ListState<T>;
}
type UseListboxItemProps<T extends object> = Props<T> & Omit<HTMLHeroUIProps<"li">, keyof Props<T>> & MenuItemVariantProps;
declare function useListboxItem<T extends object>(originalProps: UseListboxItemProps<T>): {
Component: _heroui_system.As<any>;
domRef: react.RefObject<HTMLLIElement>;
slots: {
base: (slotProps?: ({
color?: "default" | "primary" | "secondary" | "success" | "warning" | "danger" | undefined;
disableAnimation?: boolean | undefined;
variant?: "solid" | "bordered" | "light" | "faded" | "flat" | "shadow" | undefined;
showDivider?: boolean | undefined;
isDisabled?: boolean | undefined;
hasTitleTextChild?: boolean | undefined;
hasDescriptionTextChild?: boolean | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
wrapper: (slotProps?: ({
color?: "default" | "primary" | "secondary" | "success" | "warning" | "danger" | undefined;
disableAnimation?: boolean | undefined;
variant?: "solid" | "bordered" | "light" | "faded" | "flat" | "shadow" | undefined;
showDivider?: boolean | undefined;
isDisabled?: boolean | undefined;
hasTitleTextChild?: boolean | undefined;
hasDescriptionTextChild?: boolean | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
title: (slotProps?: ({
color?: "default" | "primary" | "secondary" | "success" | "warning" | "danger" | undefined;
disableAnimation?: boolean | undefined;
variant?: "solid" | "bordered" | "light" | "faded" | "flat" | "shadow" | undefined;
showDivider?: boolean | undefined;
isDisabled?: boolean | undefined;
hasTitleTextChild?: boolean | undefined;
hasDescriptionTextChild?: boolean | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
description: (slotProps?: ({
color?: "default" | "primary" | "secondary" | "success" | "warning" | "danger" | undefined;
disableAnimation?: boolean | undefined;
variant?: "solid" | "bordered" | "light" | "faded" | "flat" | "shadow" | undefined;
showDivider?: boolean | undefined;
isDisabled?: boolean | undefined;
hasTitleTextChild?: boolean | undefined;
hasDescriptionTextChild?: boolean | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
selectedIcon: (slotProps?: ({
color?: "default" | "primary" | "secondary" | "success" | "warning" | "danger" | undefined;
disableAnimation?: boolean | undefined;
variant?: "solid" | "bordered" | "light" | "faded" | "flat" | "shadow" | undefined;
showDivider?: boolean | undefined;
isDisabled?: boolean | undefined;
hasTitleTextChild?: boolean | undefined;
hasDescriptionTextChild?: boolean | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
shortcut: (slotProps?: ({
color?: "default" | "primary" | "secondary" | "success" | "warning" | "danger" | undefined;
disableAnimation?: boolean | undefined;
variant?: "solid" | "bordered" | "light" | "faded" | "flat" | "shadow" | undefined;
showDivider?: boolean | undefined;
isDisabled?: boolean | undefined;
hasTitleTextChild?: boolean | undefined;
hasDescriptionTextChild?: boolean | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
} & {
base: (slotProps?: ({
color?: "default" | "primary" | "secondary" | "success" | "warning" | "danger" | undefined;
disableAnimation?: boolean | undefined;
variant?: "solid" | "bordered" | "light" | "faded" | "flat" | "shadow" | undefined;
showDivider?: boolean | undefined;
isDisabled?: boolean | undefined;
hasTitleTextChild?: boolean | undefined;
hasDescriptionTextChild?: boolean | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
wrapper: (slotProps?: ({
color?: "default" | "primary" | "secondary" | "success" | "warning" | "danger" | undefined;
disableAnimation?: boolean | undefined;
variant?: "solid" | "bordered" | "light" | "faded" | "flat" | "shadow" | undefined;
showDivider?: boolean | undefined;
isDisabled?: boolean | undefined;
hasTitleTextChild?: boolean | undefined;
hasDescriptionTextChild?: boolean | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
title: (slotProps?: ({
color?: "default" | "primary" | "secondary" | "success" | "warning" | "danger" | undefined;
disableAnimation?: boolean | undefined;
variant?: "solid" | "bordered" | "light" | "faded" | "flat" | "shadow" | undefined;
showDivider?: boolean | undefined;
isDisabled?: boolean | undefined;
hasTitleTextChild?: boolean | undefined;
hasDescriptionTextChild?: boolean | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
description: (slotProps?: ({
color?: "default" | "primary" | "secondary" | "success" | "warning" | "danger" | undefined;
disableAnimation?: boolean | undefined;
variant?: "solid" | "bordered" | "light" | "faded" | "flat" | "shadow" | undefined;
showDivider?: boolean | undefined;
isDisabled?: boolean | undefined;
hasTitleTextChild?: boolean | undefined;
hasDescriptionTextChild?: boolean | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
selectedIcon: (slotProps?: ({
color?: "default" | "primary" | "secondary" | "success" | "warning" | "danger" | undefined;
disableAnimation?: boolean | undefined;
variant?: "solid" | "bordered" | "light" | "faded" | "flat" | "shadow" | undefined;
showDivider?: boolean | undefined;
isDisabled?: boolean | undefined;
hasTitleTextChild?: boolean | undefined;
hasDescriptionTextChild?: boolean | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
shortcut: (slotProps?: ({
color?: "default" | "primary" | "secondary" | "success" | "warning" | "danger" | undefined;
disableAnimation?: boolean | undefined;
variant?: "solid" | "bordered" | "light" | "faded" | "flat" | "shadow" | undefined;
showDivider?: boolean | undefined;
isDisabled?: boolean | undefined;
hasTitleTextChild?: boolean | undefined;
hasDescriptionTextChild?: boolean | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
} & {};
classNames: _heroui_theme.SlotsToClasses<"base" | "title" | "description" | "selectedIcon" | "wrapper" | "shortcut"> | undefined;
isSelectable: boolean;
isSelected: boolean;
isDisabled: boolean | undefined;
rendered: react.ReactNode;
description: react.ReactNode;
startContent: react.ReactNode;
endContent: react.ReactNode;
selectedIcon: react.ReactNode | ((props: ListboxItemSelectedIconProps) => react.ReactNode);
hideSelectedIcon: boolean;
disableAnimation: boolean;
getItemProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
getLabelProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
getWrapperProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
getDescriptionProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
getSelectedIconProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
};
type UseListboxItemReturn = ReturnType<typeof useListboxItem>;
export { UseListboxItemProps, UseListboxItemReturn, useListboxItem };
@@ -0,0 +1,238 @@
(function () {
'use strict';
var assign = require('object-assign');
var vary = require('vary');
var defaults = {
origin: '*',
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE',
preflightContinue: false,
optionsSuccessStatus: 204
};
function isString(s) {
return typeof s === 'string' || s instanceof String;
}
function isOriginAllowed(origin, allowedOrigin) {
if (Array.isArray(allowedOrigin)) {
for (var i = 0; i < allowedOrigin.length; ++i) {
if (isOriginAllowed(origin, allowedOrigin[i])) {
return true;
}
}
return false;
} else if (isString(allowedOrigin)) {
return origin === allowedOrigin;
} else if (allowedOrigin instanceof RegExp) {
return allowedOrigin.test(origin);
} else {
return !!allowedOrigin;
}
}
function configureOrigin(options, req) {
var requestOrigin = req.headers.origin,
headers = [],
isAllowed;
if (!options.origin || options.origin === '*') {
// allow any origin
headers.push([{
key: 'Access-Control-Allow-Origin',
value: '*'
}]);
} else if (isString(options.origin)) {
// fixed origin
headers.push([{
key: 'Access-Control-Allow-Origin',
value: options.origin
}]);
headers.push([{
key: 'Vary',
value: 'Origin'
}]);
} else {
isAllowed = isOriginAllowed(requestOrigin, options.origin);
// reflect origin
headers.push([{
key: 'Access-Control-Allow-Origin',
value: isAllowed ? requestOrigin : false
}]);
headers.push([{
key: 'Vary',
value: 'Origin'
}]);
}
return headers;
}
function configureMethods(options) {
var methods = options.methods;
if (methods.join) {
methods = options.methods.join(','); // .methods is an array, so turn it into a string
}
return {
key: 'Access-Control-Allow-Methods',
value: methods
};
}
function configureCredentials(options) {
if (options.credentials === true) {
return {
key: 'Access-Control-Allow-Credentials',
value: 'true'
};
}
return null;
}
function configureAllowedHeaders(options, req) {
var allowedHeaders = options.allowedHeaders || options.headers;
var headers = [];
if (!allowedHeaders) {
allowedHeaders = req.headers['access-control-request-headers']; // .headers wasn't specified, so reflect the request headers
headers.push([{
key: 'Vary',
value: 'Access-Control-Request-Headers'
}]);
} else if (allowedHeaders.join) {
allowedHeaders = allowedHeaders.join(','); // .headers is an array, so turn it into a string
}
if (allowedHeaders && allowedHeaders.length) {
headers.push([{
key: 'Access-Control-Allow-Headers',
value: allowedHeaders
}]);
}
return headers;
}
function configureExposedHeaders(options) {
var headers = options.exposedHeaders;
if (!headers) {
return null;
} else if (headers.join) {
headers = headers.join(','); // .headers is an array, so turn it into a string
}
if (headers && headers.length) {
return {
key: 'Access-Control-Expose-Headers',
value: headers
};
}
return null;
}
function configureMaxAge(options) {
var maxAge = (typeof options.maxAge === 'number' || options.maxAge) && options.maxAge.toString()
if (maxAge && maxAge.length) {
return {
key: 'Access-Control-Max-Age',
value: maxAge
};
}
return null;
}
function applyHeaders(headers, res) {
for (var i = 0, n = headers.length; i < n; i++) {
var header = headers[i];
if (header) {
if (Array.isArray(header)) {
applyHeaders(header, res);
} else if (header.key === 'Vary' && header.value) {
vary(res, header.value);
} else if (header.value) {
res.setHeader(header.key, header.value);
}
}
}
}
function cors(options, req, res, next) {
var headers = [],
method = req.method && req.method.toUpperCase && req.method.toUpperCase();
if (method === 'OPTIONS') {
// preflight
headers.push(configureOrigin(options, req));
headers.push(configureCredentials(options, req));
headers.push(configureMethods(options, req));
headers.push(configureAllowedHeaders(options, req));
headers.push(configureMaxAge(options, req));
headers.push(configureExposedHeaders(options, req));
applyHeaders(headers, res);
if (options.preflightContinue) {
next();
} else {
// Safari (and potentially other browsers) need content-length 0,
// for 204 or they just hang waiting for a body
res.statusCode = options.optionsSuccessStatus;
res.setHeader('Content-Length', '0');
res.end();
}
} else {
// actual response
headers.push(configureOrigin(options, req));
headers.push(configureCredentials(options, req));
headers.push(configureExposedHeaders(options, req));
applyHeaders(headers, res);
next();
}
}
function middlewareWrapper(o) {
// if options are static (either via defaults or custom options passed in), wrap in a function
var optionsCallback = null;
if (typeof o === 'function') {
optionsCallback = o;
} else {
optionsCallback = function (req, cb) {
cb(null, o);
};
}
return function corsMiddleware(req, res, next) {
optionsCallback(req, function (err, options) {
if (err) {
next(err);
} else {
var corsOptions = assign({}, defaults, options);
var originCallback = null;
if (corsOptions.origin && typeof corsOptions.origin === 'function') {
originCallback = corsOptions.origin;
} else if (corsOptions.origin) {
originCallback = function (origin, cb) {
cb(null, corsOptions.origin);
};
}
if (originCallback) {
originCallback(req.headers.origin, function (err2, origin) {
if (err2 || !origin) {
next(err2);
} else {
corsOptions.origin = origin;
cors(corsOptions, req, res, next);
}
});
} else {
next();
}
}
});
};
}
// can pass either an options hash, an options delegate, or nothing
module.exports = middlewareWrapper;
}());
@@ -0,0 +1,71 @@
// Copyright (c) 2016, Daniel Wirtz All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of its author, nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
const fromCharCodes = (chunk) => String.fromCharCode.apply(String, chunk);
/**
* @deprecated This function will no longer be exported with the next major
* release, since protobuf-ts has switch to TextDecoder API. If you need this
* function, please migrate to @protobufjs/utf8. For context, see
* https://github.com/timostamm/protobuf-ts/issues/184
*
* Reads UTF8 bytes as a string.
*
* See [protobufjs / utf8](https://github.com/protobufjs/protobuf.js/blob/9893e35b854621cce64af4bf6be2cff4fb892796/lib/utf8/index.js#L40)
*
* Copyright (c) 2016, Daniel Wirtz
*/
export function utf8read(bytes) {
if (bytes.length < 1)
return "";
let pos = 0, // position in bytes
parts = [], chunk = [], i = 0, // char offset
t; // temporary
let len = bytes.length;
while (pos < len) {
t = bytes[pos++];
if (t < 128)
chunk[i++] = t;
else if (t > 191 && t < 224)
chunk[i++] = (t & 31) << 6 | bytes[pos++] & 63;
else if (t > 239 && t < 365) {
t = ((t & 7) << 18 | (bytes[pos++] & 63) << 12 | (bytes[pos++] & 63) << 6 | bytes[pos++] & 63) - 0x10000;
chunk[i++] = 0xD800 + (t >> 10);
chunk[i++] = 0xDC00 + (t & 1023);
}
else
chunk[i++] = (t & 15) << 12 | (bytes[pos++] & 63) << 6 | bytes[pos++] & 63;
if (i > 8191) {
parts.push(fromCharCodes(chunk));
i = 0;
}
}
if (parts.length) {
if (i)
parts.push(fromCharCodes(chunk.slice(0, i)));
return parts.join("");
}
return fromCharCodes(chunk.slice(0, i));
}
@@ -0,0 +1,220 @@
import * as react from 'react';
import { ReactNode } from 'react';
import * as tailwind_variants from 'tailwind-variants';
import * as _heroui_system from '@heroui/system';
import { PropGetter, HTMLHeroUIProps } from '@heroui/system';
import { KeyboardDelegate } from '@react-types/shared';
import { AriaListBoxProps } from '@react-aria/listbox';
import { ListboxVariantProps, SlotsToClasses, ListboxSlots } from '@heroui/theme';
import { ListState } from '@react-stately/list';
import { ReactRef } from '@heroui/react-utils';
import { ListboxItemProps } from './listbox-item.js';
import 'react/jsx-runtime';
import './use-listbox-item.js';
import './base/listbox-item-base.js';
import '@heroui/aria-utils';
interface AriaListBoxOptions<T> extends AriaListBoxProps<T> {
/** Whether the listbox uses virtual scrolling. */
isVirtualized?: boolean;
/**
* An optional keyboard delegate implementation for type to select,
* to override the default.
*/
keyboardDelegate?: KeyboardDelegate;
/**
* Whether the listbox items should use virtual focus instead of being focused directly.
*/
shouldUseVirtualFocus?: boolean;
/** Whether selection should occur on press up instead of press down. */
shouldSelectOnPressUp?: boolean;
/** Whether options should be focused when the user hovers over them. */
shouldFocusOnHover?: boolean;
/** Whether the item should display the same "hover" styles as when it is focused. */
shouldHighlightOnFocus?: boolean;
}
interface Props<T> extends Omit<HTMLHeroUIProps<"ul">, "children"> {
/**
* Ref to the DOM node.
*/
ref?: ReactRef<HTMLElement | null>;
/**
* The controlled state of the listbox.
*/
state?: ListState<T>;
/**
* The listbox items variant.
*/
variant?: ListboxItemProps["variant"];
/**
* The listbox items color.
*/
color?: ListboxItemProps["color"];
/**
* Custom content to be included in the top of the listbox.
*/
topContent?: ReactNode;
/**
* Custom content to be included in the bottom of the listbox.
*/
bottomContent?: ReactNode;
/**
* Whether to not display the empty content when there are no items.
* @default false
*/
hideEmptyContent?: boolean;
/**
* Provides content to display when there are no items.
* @default "No items."
*/
emptyContent?: ReactNode;
/**
* Whether to hide the check icon when the items are selected.
* @default false
*/
hideSelectedIcon?: boolean;
/**
* Whether to disable the items animation.
* @default false
*/
disableAnimation?: boolean;
/**
* Classname or List of classes to change the classNames of the element.
* if `className` is passed, it will be added to the base slot.
*
* @example
* ```ts
* <Listbox classNames={{
* base:"base-classes",
* emptyContent: "empty-content-classes",
* }} />
* ```
*/
classNames?: SlotsToClasses<ListboxSlots>;
/**
* The menu items classNames.
*/
itemClasses?: ListboxItemProps["classNames"];
}
type UseListboxProps<T = object> = Props<T> & AriaListBoxOptions<T> & ListboxVariantProps;
declare function useListbox<T extends object>(props: UseListboxProps<T>): {
Component: _heroui_system.As<any>;
state: ListState<T>;
variant: "solid" | "bordered" | "light" | "faded" | "flat" | "shadow" | undefined;
color: "default" | "primary" | "secondary" | "success" | "warning" | "danger" | undefined;
slots: {
base: (slotProps?: ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
list: (slotProps?: ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
emptyContent: (slotProps?: ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
} & {
base: (slotProps?: ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
list: (slotProps?: ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
emptyContent: (slotProps?: ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({
[x: string]: string | number | undefined;
[x: number]: string | number | undefined;
} & tailwind_variants.ClassProp<ClassValue>) | ({} & tailwind_variants.ClassProp<ClassValue>) | undefined) => string;
} & {};
classNames: SlotsToClasses<"base" | "list" | "emptyContent"> | undefined;
topContent: ReactNode;
bottomContent: ReactNode;
emptyContent: string | number | boolean | react.ReactElement<any, string | react.JSXElementConstructor<any>> | react.ReactFragment | null;
hideEmptyContent: boolean;
shouldHighlightOnFocus: boolean;
hideSelectedIcon: boolean;
disableAnimation: boolean;
className: string | undefined;
itemClasses: SlotsToClasses<"base" | "title" | "description" | "selectedIcon" | "wrapper" | "shortcut"> | undefined;
getBaseProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
getListProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
getEmptyContentProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
};
type UseListboxReturn = ReturnType<typeof useListbox>;
export { UseListboxProps, UseListboxReturn, useListbox };
@@ -0,0 +1,24 @@
const context = (() => {
if (typeof globalThis !== "undefined") {
return globalThis;
} else if (typeof self !== "undefined") {
return self;
} else if (typeof window !== "undefined") {
return window;
} else {
return Function("return this")();
}
})();
const defines = __DEFINES__;
Object.keys(defines).forEach((key) => {
const segments = key.split(".");
let target = context;
for (let i = 0; i < segments.length; i++) {
const segment = segments[i];
if (i === segments.length - 1) {
target[segment] = defines[key];
} else {
target = target[segment] || (target[segment] = {});
}
}
});
@@ -0,0 +1 @@
{"version":3,"file":"updateOwnReflectMetadata.spec.d.ts","sourceRoot":"","sources":["../../../../src/reflectMetadata/utils/updateOwnReflectMetadata.spec.ts"],"names":[],"mappings":"AAUA,OAAO,kBAAkB,CAAC"}
@@ -0,0 +1,27 @@
import type { TSESTree } from '@typescript-eslint/utils';
import type { InferMessageIdsTypeFromRule, InferOptionsTypeFromRule } from '../util';
declare const baseRule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"noMagic", [{
detectObjects?: boolean;
enforceConst?: boolean;
ignore?: (number | string)[];
ignoreArrayIndexes?: boolean;
ignoreEnums?: boolean;
ignoreNumericLiteralTypes?: boolean;
ignoreReadonlyClassProperties?: boolean;
ignoreTypeIndexes?: boolean;
}], unknown, {
Literal(node: TSESTree.Literal): void;
}>;
export type Options = InferOptionsTypeFromRule<typeof baseRule>;
export type MessageIds = InferMessageIdsTypeFromRule<typeof baseRule>;
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"noMagic", [{
detectObjects?: boolean;
enforceConst?: boolean;
ignore?: (number | string)[];
ignoreArrayIndexes?: boolean;
ignoreEnums?: boolean;
ignoreNumericLiteralTypes?: boolean;
ignoreReadonlyClassProperties?: boolean;
ignoreTypeIndexes?: boolean;
}], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
export default _default;
@@ -0,0 +1,14 @@
export { NodeWithProps } from './type-utils/index.js';
export { ItemProps } from './collections/item.js';
export { SectionProps } from './collections/section.js';
export { CollectionProps } from './collections/types.js';
export { OverlayOptions, OverlayPlacement } from './overlays/types.js';
export { getArrowPlacement, getShouldUseAxisPlacement, getTransformOrigins, toOverlayPlacement, toReactAriaPlacement } from './overlays/utils.js';
export { ariaHideOutside } from './overlays/ariaHideOutside.js';
export { ariaShouldCloseOnInteractOutside } from './overlays/ariaShouldCloseOnInteractOutside.js';
export { isCtrlKeyPressed, isNonContiguousSelectionModifier } from './utils/index.js';
export { Item as BaseItem, Section as BaseSection, PartialNode } from '@react-stately/collections';
import '@react-types/shared';
import '@heroui/system';
import 'react';
import '@react-types/overlays';
@@ -0,0 +1,58 @@
import { useCallback, useEffect, useRef } from 'react';
import useLatest from '../useLatest';
import { isNumber } from '../utils';
var setRafInterval = function (callback, delay) {
if (delay === void 0) { delay = 0; }
if (typeof requestAnimationFrame === 'undefined') {
return {
id: setInterval(callback, delay),
};
}
var start = Date.now();
var handle = {
id: 0,
};
var loop = function () {
var current = Date.now();
if (current - start >= delay) {
callback();
start = Date.now();
}
handle.id = requestAnimationFrame(loop);
};
handle.id = requestAnimationFrame(loop);
return handle;
};
var cancelAnimationFrameIsNotDefined = function (t) {
return typeof cancelAnimationFrame === 'undefined';
};
var clearRafInterval = function (handle) {
if (cancelAnimationFrameIsNotDefined(handle.id)) {
return clearInterval(handle.id);
}
cancelAnimationFrame(handle.id);
};
function useRafInterval(fn, delay, options) {
var immediate = options === null || options === void 0 ? void 0 : options.immediate;
var fnRef = useLatest(fn);
var timerRef = useRef(undefined);
var clear = useCallback(function () {
if (timerRef.current) {
clearRafInterval(timerRef.current);
}
}, []);
useEffect(function () {
if (!isNumber(delay) || delay < 0) {
return;
}
if (immediate) {
fnRef.current();
}
timerRef.current = setRafInterval(function () {
fnRef.current();
}, delay);
return clear;
}, [delay]);
return clear;
}
export default useRafInterval;
@@ -0,0 +1 @@
!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_kk=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"kk",weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekStart:1,relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},ordinal:function(_){return _},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return t.default.locale(d,null,!0),d}));
@@ -0,0 +1,3 @@
import {expect} from './index.js';
globalThis.expect = expect;
@@ -0,0 +1,18 @@
#!/usr/bin/env node
var spawn = require('child_process').spawn
var path = require('path')
var prog = path.resolve(process.argv[2])
var progArgs = process.argv.slice(3)
console.log('probing program', prog)
var nodeArgs = [
'-r',
path.join(__dirname, 'include.js')
]
var nodeOpts = { stdio: 'inherit' }
var child = spawn('node', nodeArgs.concat(prog).concat(progArgs), nodeOpts)
console.log('kill -SIGUSR1', child.pid, 'for logging')
@@ -0,0 +1,47 @@
// Copyright (c) 2011-2012 Ryan Prichard
//
// 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.
#ifndef EVENTLOOP_H
#define EVENTLOOP_H
#include <vector>
class NamedPipe;
class EventLoop
{
public:
virtual ~EventLoop();
void run();
protected:
NamedPipe &createNamedPipe();
void setPollInterval(int ms);
void shutdown();
virtual void onPollTimeout() {}
virtual void onPipeIo(NamedPipe &namedPipe) {}
private:
bool m_exiting = false;
std::vector<NamedPipe*> m_pipes;
int m_pollInterval = 0;
};
#endif // EVENTLOOP_H
@@ -0,0 +1,625 @@
flf2a$ 6 5 11 0 12
This font is (c) Michel Eftimakis 1995 -- Version 1.0 -- 11 may 1995
____________________________________________________________ /`____
| Michel Eftimakis | "Ascii-Artist" '\/ |
| Michel.Eftimakis@vlsi.com | Boo)- (00) ||
| | (_`'_) ||
|___________________________________|____ FRANCE ___________ _!!_ ____||
|_____________________________________________________________________|
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$$@
$$@
$$@
$$@
$$@
$$@@
_ @
( )@
|_|@
_ @
/_\@
@@
@
()()@
$ @
$ @
$ @
@@
@
_ _ @
_| |_| |_@
( ) ( ) @
-/_|-|_\-@
@@
_ @
( ) @
/ __|@
\_ \@
(___/@
|_| @@
_ _ @
(_)/ )@
/ / @
( /_ @
/_/(_)@
@@
__ @
( o) @
)( @
/ o`')@
\__/\\@
@@
__@
/_/@
$ @
$ @
$ @
@@
_ @
/ )@
| |$@
( )$@
| \$@
\_\@@
_ @
( \ @
$| |@
$( )@
$/ |@
/_/ @@
. . @
_\`'/_@
)_ _(@
/'`\ @
@
@@
@
_ @
_| |_ @
(_ _)@
/_\ @
@@
@
@
@
_ @
(_)@
/' @@
@
@
___ @
(___)@
@
@@
@
@
@
_ @
(_)@
@@
_ @
/ )@
/ / @
( / @
/_/ @
@@
@
_ @
/ \ @
( 0 )@
\_/ @
@@
@
__ @
/_ |@
$( )@
$/_\@
@@
@
__ @
|_ | @
/(_ @
/___\@
@@
@
___@
|_ /@
__))@
\__/@
@@
@
. @
/| @
/o) @
/___\@
@@
@
___@
| _/@
) \@
/__/@
@@
@
_ @
// @
(o \@
\__/@
@@
@
____@
|_ /@
)) @
/_\ @
@@
@
__ @
(o )@
/o \@
\__/@
@@
@
__ @
/o \@
\_ )@
/_/@
@@
@
@
_ @
(_)@
(_)@
@@
@
@
_ @
(_)@
(_)@
/' @@
_ @
/ )@
/ /$@
( \$@
\_\@
@@
@
@
____ @
(____)@
(____)@
@@
_ @
( \ @
$\ \@
$/ )@
/_/ @
@@
___ @
(_, )@
// @
(_) @
$_ @
(_) @@
@
__ @
/_ \ @
((O)_)@
$\___/@
@@
__ @
( ) @
/o \ @
( __ )@
/_\/_\@
@@
___ @
( o ) @
| \ @
( O )@
/___/ @
@@
___ @
( _)@
| | @
( )_ @
/___\@
@@
__ @
( ) @
| \ @
( O )@
/___/ @
@@
____ @
( __)@
| |_ @
( _) @
/____\@
@@
____ @
( __)@
| |_ @
( __) @
/_\ @
@@
____ @
( __)@
| | _ @
( )_))@
/____\@
@@
_ _ @
( )( )@
| L| |@
( __ )@
/_\/_\@
@@
_ @
( )@
| |@
( )@
/_\@
@@
_ @
( )@
_ | |@
((_( )@
\__/ @
@@
_ @
( ) __@
| |/ /@
( _ ( @
/_\\_|@
@@
_ @
( ) @
| | @
( )_ @
/___\@
@@
_ _ @
( `-' )@
| \_/ |@
( ) ( )@
/_\ /_\@
@@
_ _ @
( \ ( )@
| \\| |@
( )\\ )@
/_\ \_\@
@@
__ @
( ) @
/ \ @
( O )@
\__/ @
@@
___ @
( ) @
| O |@
( __/ @
/_\ @
@@
__ @
( ) @
/ \ @
( O )@
\__\\@
~@@
___ @
( ) @
| O |@
( _ ( @
/_\\_|@
@@
___ @
/ _) @
\_"-. @
__) )@
/___/ @
@@
_____ @
(_ _)@
| | @
( ) @
/_\ @
@@
_ _ @
( )( )@
| || |@
( L| )@
/____\@
@@
_ _ @
( )( )@
| || |@
( \/ )@
\__/ @
@@
_ _ @
( ) ( )@
| |__| |@
( ' ` )@
\_/\_/ @
@@
_ _ @
( \/ )@
\ / @
( ) @
/_/\_\@
@@
_ _ @
( \_/ )@
\ / @
( ) @
|_| @
@@
___ @
(__ )@
// @
((_ @
/___\@
@@
___ @
( __)@
| |$ @
( )$ @
| \_ @
|___|@@
_ @
( \ @
\ \ @
\ ) @
\_\@
@@
___ @
(__ )@
$| |@
$( )@
_/ |@
|___|@@
___ @
,;`;;;,@
;; o o|@
(; _" |@
|\__/ @
@@
@
@
@
@
____ @
|____|@@
__ @
\_\@
$ @
$ @
$ @
@@
@
@
___ @
( o )@
/_^_\@
@@
_ @
( ) @
| |_ @
( o \@
/___/@
@@
@
@
__@
/ /@
\_\@
@@
_ @
( )@
_| |@
/ o )@
\___\@
@@
@
@
___ @
( o_)@
\( @
@@
_ @
,'_)@
| | @
( _)@
/_\ @
@@
@
@
__ @
/o )@
\__\@
_|/@@
_ @
( ) @
| |_ @
( _ )@
/_\||@
@@
_ @
(_)@
_ @
( )@
/_\@
@@
_ @
(_)@
_ @
( )@
| |@
/_/@@
_ @
( ) @
| | _ @
( _'( @
/_\\_|@
@@
_ @
( )@
| |@
( )@
/_\@
@@
@
@
__ __ @
( _`'_ )@
/_\`'/_\@
@@
@
@
____ @
( __ )@
/_\/_\@
@@
@
@
___ @
( o )@
\_/ @
@@
@
@
___ @
( o \@
/ __/@
|_| @@
@
@
___ @
/ o )@
\__ \@
|_|@@
@
@
__ @
( _)@
/_\$@
@@
@
@
__ @
(_' @
/__)@
@@
_ @
( ) @
| | @
( _)@
/_\ @
@@
@
@
_ _ @
( U )@
/___\@
@@
@
@
_ _ @
( V )@
\_/ @
@@
@
@
_ _ _ @
( V V )@
\_^_/ @
@@
@
@
__ __@
\ V /@
/_^_\@
@@
@
@
_ _ @
( V )@
) / @
/_/ @@
@
@
__ @
(_ ) @
/__\@
@@
_ @
/ )@
_) )@
(_ ( @
) )@
\_\@@
_ @
( )@
| |@
( )@
| \@
|_|@@
_ @
( \ @
( (_ @
) _)@
( ( @
/_/ @@
__ __ @
(_(\)_)@
$$ @
$$ @
$$ @
@@
()() @
( ) @
/o \ @
( __ )@
/_\/_\@
@@
()() @
( ) @
/ \ @
( O )@
\__/ @
@@
()() @
( )( )@
| || |@
( L| )@
/____\@
@@
@
O O @
___ @
( o )@
/_^_\@
@@
@
O O @
___ @
( o )@
\_/ @
@@
@
O O @
_ _ @
( U )@
/___\@
@@
___ @
( o ) @
| \ @
( O )@
/ _/ @
|_| @@
@@ -0,0 +1,17 @@
export interface MappingEntry {
readonly pattern: string;
readonly paths: ReadonlyArray<string>;
}
export interface Paths {
readonly [key: string]: ReadonlyArray<string>;
}
/**
* Converts an absolute baseUrl and paths to an array of absolute mapping entries.
* The array is sorted by longest prefix.
* Having an array with entries allows us to keep a sorting order rather than
* sort by keys each time we use the mappings.
* @param absoluteBaseUrl
* @param paths
* @param addMatchAll
*/
export declare function getAbsoluteMappingEntries(absoluteBaseUrl: string, paths: Paths, addMatchAll: boolean): ReadonlyArray<MappingEntry>;
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('omitBy', require('../omitBy'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,68 @@
import {useEvent as $e9faafb641e167db$export$90fc3a17d93f704c} from "./useEvent.module.js";
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.module.js";
import {useRef as $hDRkU$useRef, useCallback as $hDRkU$useCallback} from "react";
/*
* Copyright 2024 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 $26f7f3da73fcd9d6$export$7717c92ee915373e(props, ref) {
let { isLoading: isLoading, onLoadMore: onLoadMore, scrollOffset: scrollOffset = 1, items: items } = props;
// Handle scrolling, and call onLoadMore when nearing the bottom.
let isLoadingRef = (0, $hDRkU$useRef)(isLoading);
let prevProps = (0, $hDRkU$useRef)(props);
let onScroll = (0, $hDRkU$useCallback)(()=>{
if (ref.current && !isLoadingRef.current && onLoadMore) {
let shouldLoadMore = ref.current.scrollHeight - ref.current.scrollTop - ref.current.clientHeight < ref.current.clientHeight * scrollOffset;
if (shouldLoadMore) {
isLoadingRef.current = true;
onLoadMore();
}
}
}, [
onLoadMore,
ref,
scrollOffset
]);
let lastItems = (0, $hDRkU$useRef)(items);
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
// Only update isLoadingRef if props object actually changed,
// not if a local state change occurred.
if (props !== prevProps.current) {
isLoadingRef.current = isLoading;
prevProps.current = props;
}
// TODO: Eventually this hook will move back into RAC during which we will accept the collection as a option to this hook.
// We will only load more if the collection has changed after the last load to prevent multiple onLoadMore from being called
// while the data from the last onLoadMore is being processed by RAC collection.
let shouldLoadMore = (ref === null || ref === void 0 ? void 0 : ref.current) && !isLoadingRef.current && onLoadMore && (!items || items !== lastItems.current) && ref.current.clientHeight === ref.current.scrollHeight;
if (shouldLoadMore) {
isLoadingRef.current = true;
onLoadMore === null || onLoadMore === void 0 ? void 0 : onLoadMore();
}
lastItems.current = items;
}, [
isLoading,
onLoadMore,
props,
ref,
items
]);
// TODO: maybe this should still just return scroll props?
// Test against case where the ref isn't defined when this is called
// Think this was a problem when trying to attach to the scrollable body of the table in OnLoadMoreTableBodyScroll
(0, $e9faafb641e167db$export$90fc3a17d93f704c)(ref, 'scroll', onScroll);
}
export {$26f7f3da73fcd9d6$export$7717c92ee915373e as useLoadMore};
//# sourceMappingURL=useLoadMore.module.js.map
@@ -0,0 +1,130 @@
"use client";
// src/tab.tsx
import { forwardRef } from "@heroui/system";
import { useDOMRef, filterDOMProps, mergeRefs } from "@heroui/react-utils";
import { clsx, dataAttr } from "@heroui/shared-utils";
import { chain, mergeProps } from "@react-aria/utils";
import scrollIntoView from "scroll-into-view-if-needed";
import { useFocusRing } from "@react-aria/focus";
import { useTab } from "@react-aria/tabs";
import { useHover } from "@react-aria/interactions";
import { m, domMax, LazyMotion } from "framer-motion";
import { useIsMounted } from "@heroui/use-is-mounted";
import { jsx, jsxs } from "react/jsx-runtime";
var Tab = forwardRef((props, ref) => {
var _a;
const {
className,
as,
item,
state,
classNames,
isDisabled: isDisabledProp,
listRef,
slots,
motionProps,
disableAnimation,
disableCursorAnimation,
shouldSelectOnPressUp,
onClick,
tabRef,
...otherProps
} = props;
const { key } = item;
const domRef = useDOMRef(ref);
const Component = as || (props.href ? "a" : "button");
const shouldFilterDOMProps = typeof Component === "string";
const {
tabProps,
isSelected,
isDisabled: isDisabledItem,
isPressed
} = useTab({ key, isDisabled: isDisabledProp, shouldSelectOnPressUp }, state, domRef);
if (props.children == null) {
delete tabProps["aria-controls"];
}
const isDisabled = isDisabledProp || isDisabledItem;
const { focusProps, isFocused, isFocusVisible } = useFocusRing();
const { hoverProps, isHovered } = useHover({
isDisabled
});
const tabStyles = clsx(classNames == null ? void 0 : classNames.tab, className);
const [, isMounted] = useIsMounted({
rerender: true
});
const handleClick = () => {
chain(onClick, tabProps.onClick);
if (!(domRef == null ? void 0 : domRef.current) || !(listRef == null ? void 0 : listRef.current))
return;
scrollIntoView(domRef.current, {
scrollMode: "if-needed",
behavior: "smooth",
block: "end",
inline: "end",
boundary: listRef == null ? void 0 : listRef.current
});
};
return /* @__PURE__ */ jsxs(
Component,
{
ref: mergeRefs(domRef, tabRef),
"data-disabled": dataAttr(isDisabledItem),
"data-focus": dataAttr(isFocused),
"data-focus-visible": dataAttr(isFocusVisible),
"data-hover": dataAttr(isHovered),
"data-hover-unselected": dataAttr((isHovered || isPressed) && !isSelected),
"data-pressed": dataAttr(isPressed),
"data-selected": dataAttr(isSelected),
"data-slot": "tab",
...mergeProps(
tabProps,
!isDisabled ? {
...focusProps,
...hoverProps
} : {},
filterDOMProps(otherProps, {
enabled: shouldFilterDOMProps,
omitPropNames: /* @__PURE__ */ new Set(["title"])
}),
{ onClick: handleClick }
),
className: (_a = slots.tab) == null ? void 0 : _a.call(slots, { class: tabStyles }),
title: otherProps == null ? void 0 : otherProps.titleValue,
type: Component === "button" ? "button" : void 0,
children: [
isSelected && !disableAnimation && !disableCursorAnimation && isMounted ? /* @__PURE__ */ jsx(LazyMotion, { features: domMax, children: /* @__PURE__ */ jsx(
m.span,
{
className: slots.cursor({ class: classNames == null ? void 0 : classNames.cursor }),
"data-slot": "cursor",
layoutDependency: false,
layoutId: "cursor",
transition: {
type: "spring",
bounce: 0.15,
duration: 0.5
},
...motionProps
}
) }) : null,
/* @__PURE__ */ jsx(
"div",
{
className: slots.tabContent({
class: classNames == null ? void 0 : classNames.tabContent
}),
"data-slot": "tabContent",
children: item.rendered
}
)
]
}
);
});
Tab.displayName = "HeroUI.Tab";
var tab_default = Tab;
export {
tab_default
};
@@ -0,0 +1,3 @@
import type { TSchema, SchemaOptions } from '../schema/index.mjs';
import { TUnion } from './union-type.mjs';
export declare function UnionCreate<T extends TSchema[]>(T: [...T], options?: SchemaOptions): TUnion<T>;
@@ -0,0 +1,26 @@
# fs-constants
Small module that allows you to get the fs constants across
Node and the browser.
```
npm install fs-constants
```
Previously you would use `require('constants')` for this in node but that has been
deprecated and changed to `require('fs').constants` which does not browserify.
This module uses `require('constants')` in the browser and `require('fs').constants` in node to work around this
## Usage
``` js
var constants = require('fs-constants')
console.log('constants:', constants)
```
## License
MIT
@@ -0,0 +1,46 @@
"use client";
import { isMotionValue } from 'motion-dom';
import { useCombineMotionValues } from './use-combine-values.mjs';
/**
* Combine multiple motion values into a new one using a string template literal.
*
* ```jsx
* import {
* motion,
* useSpring,
* useMotionValue,
* useMotionTemplate
* } from "framer-motion"
*
* function Component() {
* const shadowX = useSpring(0)
* const shadowY = useMotionValue(0)
* const shadow = useMotionTemplate`drop-shadow(${shadowX}px ${shadowY}px 20px rgba(0,0,0,0.3))`
*
* return <motion.div style={{ filter: shadow }} />
* }
* ```
*
* @public
*/
function useMotionTemplate(fragments, ...values) {
/**
* Create a function that will build a string from the latest motion values.
*/
const numFragments = fragments.length;
function buildValue() {
let output = ``;
for (let i = 0; i < numFragments; i++) {
output += fragments[i];
const value = values[i];
if (value) {
output += isMotionValue(value) ? value.get() : value;
}
}
return output;
}
return useCombineMotionValues(values.filter(isMotionValue), buildValue);
}
export { useMotionTemplate };
@@ -0,0 +1,2 @@
var isAppleDevice = /(mac|iphone|ipod|ipad)/i.test(typeof navigator !== 'undefined' ? navigator === null || navigator === void 0 ? void 0 : navigator.platform : '');
export default isAppleDevice;
@@ -0,0 +1,61 @@
# ArrayBuffer.prototype.slice <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
An ES spec-compliant `ArrayBuffer.prototype.slice` shim. Invoke its "shim" method to shim ArrayBuffer.prototype.slice if it is unavailable.
This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES5-supported environment and complies with the [spec](https://tc39.es/ecma262/#sec-arraybuffer.prototype.slice).
Most common usage:
```js
var assert = require('assert');
var slice = require('arraybuffer.prototype.slice');
var ab = new ArrayBuffer(1);
var arr = new Uint8Array(ab);
arr[0] = 123;
var ab2 = slice(ab);
var arr2 = new Uint8Array(ab2);
arr2[0] = 234;
assert.deepEqual(arr, new Uint8Array([123]));
assert.deepEqual(arr2, new Uint8Array([234]));
if (!ArrayBuffer.prototype.transfer) {
slice.shim();
}
var ab2 = ab.slice();
var arr2 = new Uint8Array(ab2);
arr2[0] = 234;
assert.deepEqual(arr, new Uint8Array([123]));
assert.deepEqual(arr2, new Uint8Array([234]));
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
[package-url]: https://npmjs.org/package/arraybuffer.prototype.slice
[npm-version-svg]: https://versionbadg.es/es-shims/ArrayBuffer.prototype.slice.svg
[deps-svg]: https://david-dm.org/es-shims/ArrayBuffer.prototype.slice.svg
[deps-url]: https://david-dm.org/es-shims/ArrayBuffer.prototype.slice
[dev-deps-svg]: https://david-dm.org/es-shims/ArrayBuffer.prototype.slice/dev-status.svg
[dev-deps-url]: https://david-dm.org/es-shims/ArrayBuffer.prototype.slice#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/arraybuffer.prototype.slice.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/arraybuffer.prototype.slice.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/arraybuffer.prototype.slice.svg
[downloads-url]: https://npm-stat.com/charts.html?package=arraybuffer.prototype.slice
[codecov-image]: https://codecov.io/gh/es-shims/ArrayBuffer.prototype.slice/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/es-shims/ArrayBuffer.prototype.slice/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/ArrayBuffer.prototype.slice
[actions-url]: https://github.com/es-shims/ArrayBuffer.prototype.slice/actions
@@ -0,0 +1 @@
"use strict";var f=Object.defineProperty;var r=(e,n)=>f(e,"name",{value:n,configurable:!0});var p=require("node:net"),u=require("./get-pipe-path-BoR10qr8.cjs");const g=r(()=>new Promise(e=>{const n=u.getPipePath(process.ppid),t=p.createConnection(n,()=>{e(r(a=>{const o=Buffer.from(JSON.stringify(a)),c=Buffer.alloc(4);c.writeInt32BE(o.length,0),t.write(Buffer.concat([c,o]))},"sendToParent"))});t.on("error",()=>{e()}),t.unref()}),"connectToServer"),s={send:void 0},i=g();i.then(e=>{s.send=e},()=>{}),exports.connectingToServer=i,exports.parent=s;
@@ -0,0 +1,48 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getModuleName;
{
const originalGetModuleName = getModuleName;
exports.default = getModuleName = function getModuleName(rootOpts, pluginOpts) {
var _pluginOpts$moduleId, _pluginOpts$moduleIds, _pluginOpts$getModule, _pluginOpts$moduleRoo;
return originalGetModuleName(rootOpts, {
moduleId: (_pluginOpts$moduleId = pluginOpts.moduleId) != null ? _pluginOpts$moduleId : rootOpts.moduleId,
moduleIds: (_pluginOpts$moduleIds = pluginOpts.moduleIds) != null ? _pluginOpts$moduleIds : rootOpts.moduleIds,
getModuleId: (_pluginOpts$getModule = pluginOpts.getModuleId) != null ? _pluginOpts$getModule : rootOpts.getModuleId,
moduleRoot: (_pluginOpts$moduleRoo = pluginOpts.moduleRoot) != null ? _pluginOpts$moduleRoo : rootOpts.moduleRoot
});
};
}
function getModuleName(rootOpts, pluginOpts) {
const {
filename,
filenameRelative = filename,
sourceRoot = pluginOpts.moduleRoot
} = rootOpts;
const {
moduleId,
moduleIds = !!moduleId,
getModuleId,
moduleRoot = sourceRoot
} = pluginOpts;
if (!moduleIds) return null;
if (moduleId != null && !getModuleId) {
return moduleId;
}
let moduleName = moduleRoot != null ? moduleRoot + "/" : "";
if (filenameRelative) {
const sourceRootReplacer = sourceRoot != null ? new RegExp("^" + sourceRoot + "/?") : "";
moduleName += filenameRelative.replace(sourceRootReplacer, "").replace(/\.\w*$/, "");
}
moduleName = moduleName.replace(/\\/g, "/");
if (getModuleId) {
return getModuleId(moduleName) || moduleName;
} else {
return moduleName;
}
}
//# sourceMappingURL=get-module-name.js.map
@@ -0,0 +1,8 @@
import {
drip
} from "../chunk-BWPOLXFL.mjs";
import "../chunk-UWE6H66T.mjs";
import "../chunk-GIXI35A3.mjs";
export {
drip
};
@@ -0,0 +1,14 @@
import { createClassUtils } from './class-utils'
import { createLruCache } from './lru-cache'
import { createSplitModifiers } from './modifier-utils'
import { Config } from './types'
export type ConfigUtils = ReturnType<typeof createConfigUtils>
export function createConfigUtils(config: Config) {
return {
cache: createLruCache<string, string>(config.cacheSize),
splitModifiers: createSplitModifiers(config),
...createClassUtils(config),
}
}
@@ -0,0 +1,79 @@
# object.groupby <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
An ESnext spec-compliant `Object.groupBy` shim/polyfill/replacement that works as far down as ES3.
This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the proposed [spec](https://tc39.github.io/proposal-array-grouping/).
## Getting started
```sh
npm install --save object.groupby
```
## Usage/Examples
```js
var groupBy = require('object.groupby');
var assert = require('assert');
var arr = [0, 1, 2, 3, 4, 5];
var parity = function (x) { return x % 2 === 0 ? 'even' : 'odd'; };
var results = groupBy(arr, function (x, i) {
assert.equal(x, arr[i]);
return parity(x);
});
assert.deepEqual(results, {
__proto__: null,
even: [0, 2, 4],
odd: [1, 3, 5],
});
```
```js
var groupBy = require('object.groupby');
var assert = require('assert');
/* when Object.groupBy is not present */
delete Object.groupBy;
var shimmed = groupBy.shim();
assert.equal(shimmed, groupBy.getPolyfill());
assert.deepEqual(Object.groupBy(arr, parity), groupBy(arr, parity));
```
```js
var groupBy = require('object.groupby');
var assert = require('assert');
/* when Array#group is present */
var shimmed = groupBy.shim();
assert.equal(shimmed, Object.groupBy);
assert.deepEqual(Object.groupBy(arr, parity), groupBy(arr, parity));
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
[package-url]: https://npmjs.org/package/object.groupby
[npm-version-svg]: https://versionbadg.es/es-shims/Object.groupBy.svg
[deps-svg]: https://david-dm.org/es-shims/Object.groupBy.svg
[deps-url]: https://david-dm.org/es-shims/Object.groupBy
[dev-deps-svg]: https://david-dm.org/es-shims/Object.groupBy/dev-status.svg
[dev-deps-url]: https://david-dm.org/es-shims/Object.groupBy#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/object.groupby.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/object.groupby.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/object.groupby.svg
[downloads-url]: https://npm-stat.com/charts.html?package=object.groupby
[codecov-image]: https://codecov.io/gh/es-shims/Object.groupBy/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/es-shims/Object.groupBy/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/Object.groupBy
[actions-url]: https://github.com/es-shims/Object.groupBy/actions
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('curryN', require('../curry'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,7 @@
import * as react_jsx_runtime from 'react/jsx-runtime';
import { IconSvgProps } from './types.mjs';
import 'react';
declare const EditIcon: (props: IconSvgProps) => react_jsx_runtime.JSX.Element;
export { EditIcon };
@@ -0,0 +1,48 @@
// @ts-check
const req = require('./req.js')
/**
* Load Options
*
* @private
* @method options
*
* @param {Object} config PostCSS Config
*
* @return {Promise<Object>} options PostCSS Options
*/
async function options(config, file) {
if (config.parser && typeof config.parser === 'string') {
try {
config.parser = await req(config.parser, file)
} catch (err) {
throw new Error(
`Loading PostCSS Parser failed: ${err.message}\n\n(@${file})`
)
}
}
if (config.syntax && typeof config.syntax === 'string') {
try {
config.syntax = await req(config.syntax, file)
} catch (err) {
throw new Error(
`Loading PostCSS Syntax failed: ${err.message}\n\n(@${file})`
)
}
}
if (config.stringifier && typeof config.stringifier === 'string') {
try {
config.stringifier = await req(config.stringifier, file)
} catch (err) {
throw new Error(
`Loading PostCSS Stringifier failed: ${err.message}\n\n(@${file})`
)
}
}
return config
}
module.exports = options
@@ -0,0 +1,234 @@
"use client";
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.ts
var src_exports = {};
__export(src_exports, {
Dropdown: () => dropdown_default,
DropdownItem: () => import_menu4.MenuItem,
DropdownMenu: () => dropdown_menu_default,
DropdownSection: () => import_menu4.MenuSection,
DropdownTrigger: () => dropdown_trigger_default,
useDropdown: () => useDropdown
});
module.exports = __toCommonJS(src_exports);
var import_menu4 = require("@heroui/menu");
// src/dropdown.tsx
var import_react2 = __toESM(require("react"));
var import_popover = require("@heroui/popover");
// src/dropdown-context.ts
var import_react_utils = require("@heroui/react-utils");
var [DropdownProvider, useDropdownContext] = (0, import_react_utils.createContext)({
name: "DropdownContext",
errorMessage: "useDropdownContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Dropdown />`"
});
// src/use-dropdown.ts
var import_system = require("@heroui/system");
var import_menu = require("@react-stately/menu");
var import_menu2 = require("@react-aria/menu");
var import_theme = require("@heroui/theme");
var import_shared_utils = require("@heroui/shared-utils");
var import_react_utils2 = require("@heroui/react-utils");
var import_aria_utils = require("@heroui/aria-utils");
var import_react = require("react");
var import_utils = require("@react-aria/utils");
var getMenuItem = (props, key) => {
if (props) {
const mergedChildren = Array.isArray(props.children) ? props.children : [...(props == null ? void 0 : props.items) || []];
if (mergedChildren && mergedChildren.length) {
const item = mergedChildren.find((item2) => {
if (item2 && item2.key === key) {
return item2;
}
}) || {};
return item;
}
}
return null;
};
var getCloseOnSelect = (props, key, item) => {
const mergedItem = item || getMenuItem(props, key);
if (mergedItem && mergedItem.props && "closeOnSelect" in mergedItem.props) {
return mergedItem.props.closeOnSelect;
}
return props == null ? void 0 : props.closeOnSelect;
};
function useDropdown(props) {
var _a;
const globalContext = (0, import_system.useProviderContext)();
const {
as,
triggerRef: triggerRefProp,
isOpen,
defaultOpen,
onOpenChange,
isDisabled,
type = "menu",
trigger = "press",
placement = "bottom",
closeOnSelect = true,
shouldBlockScroll = true,
classNames: classNamesProp,
disableAnimation = (_a = globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _a : false,
onClose,
className,
...otherProps
} = props;
const Component = as || "div";
const triggerRef = (0, import_react.useRef)(null);
const menuTriggerRef = triggerRefProp || triggerRef;
const menuRef = (0, import_react.useRef)(null);
const popoverRef = (0, import_react.useRef)(null);
const state = (0, import_menu.useMenuTriggerState)({
trigger,
isOpen,
defaultOpen,
onOpenChange: (isOpen2) => {
onOpenChange == null ? void 0 : onOpenChange(isOpen2);
if (!isOpen2) {
onClose == null ? void 0 : onClose();
}
}
});
const { menuTriggerProps, menuProps } = (0, import_menu2.useMenuTrigger)(
{ type, trigger, isDisabled },
state,
menuTriggerRef
);
const classNames = (0, import_react.useMemo)(
() => (0, import_theme.dropdown)({
className
}),
[className]
);
const onMenuAction = (menuCloseOnSelect) => {
if (menuCloseOnSelect !== void 0 && !menuCloseOnSelect) {
return;
}
if (closeOnSelect) {
state.close();
}
};
const getPopoverProps = (props2 = {}) => {
const popoverProps = (0, import_utils.mergeProps)(otherProps, props2);
return {
state,
placement,
ref: popoverRef,
disableAnimation,
shouldBlockScroll,
scrollRef: menuRef,
triggerRef: menuTriggerRef,
...popoverProps,
classNames: {
...classNamesProp,
...props2.classNames,
content: (0, import_shared_utils.clsx)(classNames, classNamesProp == null ? void 0 : classNamesProp.content, props2.className)
},
shouldCloseOnInteractOutside: (popoverProps == null ? void 0 : popoverProps.shouldCloseOnInteractOutside) ? popoverProps.shouldCloseOnInteractOutside : (element) => (0, import_aria_utils.ariaShouldCloseOnInteractOutside)(element, triggerRef, state)
};
};
const getMenuTriggerProps = (originalProps = {}) => {
const { onPress, onPressStart, ...otherMenuTriggerProps } = menuTriggerProps;
return (0, import_utils.mergeProps)(otherMenuTriggerProps, { isDisabled }, originalProps);
};
const getMenuProps = (props2, _ref = null) => {
return {
ref: (0, import_react_utils2.mergeRefs)(_ref, menuRef),
menuProps,
closeOnSelect,
...(0, import_utils.mergeProps)(props2, {
onAction: (key, item) => {
const closeOnSelect2 = getCloseOnSelect(props2, key, item);
onMenuAction(closeOnSelect2);
},
onClose: state.close
})
};
};
return {
Component,
menuRef,
menuProps,
classNames,
closeOnSelect,
onClose: state.close,
autoFocus: state.focusStrategy || true,
disableAnimation,
getPopoverProps,
getMenuProps,
getMenuTriggerProps
};
}
// src/dropdown.tsx
var import_jsx_runtime = require("react/jsx-runtime");
var Dropdown = (props) => {
const { children, ...otherProps } = props;
const context = useDropdown(otherProps);
const [menuTrigger, menu] = import_react2.default.Children.toArray(children);
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DropdownProvider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_popover.Popover, { ...context.getPopoverProps(), children: [
menuTrigger,
menu
] }) });
};
Dropdown.displayName = "HeroUI.Dropdown";
var dropdown_default = Dropdown;
// src/dropdown-trigger.tsx
var import_popover2 = require("@heroui/popover");
var import_jsx_runtime2 = require("react/jsx-runtime");
var DropdownTrigger = (props) => {
const { getMenuTriggerProps } = useDropdownContext();
const { children, ...otherProps } = props;
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_popover2.PopoverTrigger, { ...getMenuTriggerProps(otherProps), children });
};
DropdownTrigger.displayName = "HeroUI.DropdownTrigger";
var dropdown_trigger_default = DropdownTrigger;
// src/dropdown-menu.tsx
var import_popover3 = require("@heroui/popover");
var import_focus = require("@react-aria/focus");
var import_system2 = require("@heroui/system");
var import_menu3 = require("@heroui/menu");
var import_jsx_runtime3 = require("react/jsx-runtime");
var DropdownMenu = (0, import_system2.forwardRef)(function DropdownMenu2(props, ref) {
const { getMenuProps } = useDropdownContext();
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_popover3.PopoverContent, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_focus.FocusScope, { contain: true, restoreFocus: true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_menu3.Menu, { ...getMenuProps(props, ref) }) }) });
});
var dropdown_menu_default = DropdownMenu;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Dropdown,
DropdownItem,
DropdownMenu,
DropdownSection,
DropdownTrigger,
useDropdown
});
@@ -0,0 +1,195 @@
/**
* Check whether a character code is an ASCII control character.
*
* An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)
* to U+001F (US), or U+007F (DEL).
*
* @param {Code} code
* Code.
* @returns {boolean}
* Whether it matches.
*/
export function asciiControl(code: Code): boolean;
/**
* Check whether a character code is a markdown line ending.
*
* A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN
* LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).
*
* In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE
* RETURN (CR) are replaced by these virtual characters depending on whether
* they occurred together.
*
* @param {Code} code
* Code.
* @returns {boolean}
* Whether it matches.
*/
export function markdownLineEnding(code: Code): boolean;
/**
* Check whether a character code is a markdown line ending (see
* `markdownLineEnding`) or markdown space (see `markdownSpace`).
*
* @param {Code} code
* Code.
* @returns {boolean}
* Whether it matches.
*/
export function markdownLineEndingOrSpace(code: Code): boolean;
/**
* Check whether a character code is a markdown space.
*
* A **markdown space** is the concrete character U+0020 SPACE (SP) and the
* virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).
*
* In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is
* replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL
* SPACE (VS) characters, depending on the column at which the tab occurred.
*
* @param {Code} code
* Code.
* @returns {boolean}
* Whether it matches.
*/
export function markdownSpace(code: Code): boolean;
/**
* Check whether the character code represents an ASCII alpha (`a` through `z`,
* case insensitive).
*
* An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.
*
* An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)
* to U+005A (`Z`).
*
* An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)
* to U+007A (`z`).
*
* @param code
* Code.
* @returns {boolean}
* Whether it matches.
*/
export const asciiAlpha: (code: Code) => boolean;
/**
* Check whether the character code represents an ASCII alphanumeric (`a`
* through `z`, case insensitive, or `0` through `9`).
*
* An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha
* (see `asciiAlpha`).
*
* @param code
* Code.
* @returns {boolean}
* Whether it matches.
*/
export const asciiAlphanumeric: (code: Code) => boolean;
/**
* Check whether the character code represents an ASCII atext.
*
* atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in
* the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),
* U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F
* SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E
* CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE
* (`{`) to U+007E TILDE (`~`).
*
* See:
* **\[RFC5322]**:
* [Internet Message Format](https://tools.ietf.org/html/rfc5322).
* P. Resnick.
* IETF.
*
* @param code
* Code.
* @returns {boolean}
* Whether it matches.
*/
export const asciiAtext: (code: Code) => boolean;
/**
* Check whether the character code represents an ASCII digit (`0` through `9`).
*
* An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to
* U+0039 (`9`).
*
* @param code
* Code.
* @returns {boolean}
* Whether it matches.
*/
export const asciiDigit: (code: Code) => boolean;
/**
* Check whether the character code represents an ASCII hex digit (`a` through
* `f`, case insensitive, or `0` through `9`).
*
* An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex
* digit, or an ASCII lower hex digit.
*
* An **ASCII upper hex digit** is a character in the inclusive range U+0041
* (`A`) to U+0046 (`F`).
*
* An **ASCII lower hex digit** is a character in the inclusive range U+0061
* (`a`) to U+0066 (`f`).
*
* @param code
* Code.
* @returns {boolean}
* Whether it matches.
*/
export const asciiHexDigit: (code: Code) => boolean;
/**
* Check whether the character code represents ASCII punctuation.
*
* An **ASCII punctuation** is a character in the inclusive ranges U+0021
* EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT
* SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT
* (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).
*
* @param code
* Code.
* @returns {boolean}
* Whether it matches.
*/
export const asciiPunctuation: (code: Code) => boolean;
/**
* Check whether the character code represents Unicode punctuation.
*
* A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,
* Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`
* (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`
* (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII
* punctuation (see `asciiPunctuation`).
*
* See:
* **\[UNICODE]**:
* [The Unicode Standard](https://www.unicode.org/versions/).
* Unicode Consortium.
*
* @param code
* Code.
* @returns
* Whether it matches.
*/
export const unicodePunctuation: (code: Code) => boolean;
/**
* Check whether the character code represents Unicode whitespace.
*
* Note that this does handle micromark specific markdown whitespace characters.
* See `markdownLineEndingOrSpace` to check that.
*
* A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,
* Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),
* U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\[UNICODE]**).
*
* See:
* **\[UNICODE]**:
* [The Unicode Standard](https://www.unicode.org/versions/).
* Unicode Consortium.
*
* @param code
* Code.
* @returns
* Whether it matches.
*/
export const unicodeWhitespace: (code: Code) => boolean;
import type { Code } from 'micromark-util-types';
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,42 @@
'use strict';
module.exports = function generate_allOf(it, $keyword, $ruleType) {
var out = ' ';
var $schema = it.schema[$keyword];
var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
var $breakOnError = !it.opts.allErrors;
var $it = it.util.copy(it);
var $closingBraces = '';
$it.level++;
var $nextValid = 'valid' + $it.level;
var $currentBaseId = $it.baseId,
$allSchemasEmpty = true;
var arr1 = $schema;
if (arr1) {
var $sch, $i = -1,
l1 = arr1.length - 1;
while ($i < l1) {
$sch = arr1[$i += 1];
if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
$allSchemasEmpty = false;
$it.schema = $sch;
$it.schemaPath = $schemaPath + '[' + $i + ']';
$it.errSchemaPath = $errSchemaPath + '/' + $i;
out += ' ' + (it.validate($it)) + ' ';
$it.baseId = $currentBaseId;
if ($breakOnError) {
out += ' if (' + ($nextValid) + ') { ';
$closingBraces += '}';
}
}
}
}
if ($breakOnError) {
if ($allSchemasEmpty) {
out += ' if (true) { ';
} else {
out += ' ' + ($closingBraces.slice(0, -1)) + ' ';
}
}
return out;
}
@@ -0,0 +1,527 @@
flf2a$ 5 4 99 0 16
_____ _____ ____ ___ _____ _____
/ ___>/ __ \/ _/ /___\/ __\/ __\
|___ || __|| |---| || __|| __|
<_____/\__/ \_____/\___/\__/ \__/
#-> spliff : by nathan bloomfield (xzovik@gmail.com)
#-> based on the letters a,i,j,m,n,r,u, seen on the web, by E.DUB
#->
#-> History:
#-> 5-3-2008 : version 1.1
#-> Added umlauts (to make the file valid) and small letters ~Markus Gebhard
#-> 5-10-2007 : version 1.0
#->
#-> You are free to make changes- just note them in the history.
#->
#-> (end comments)
$$@
$$@
$$@
$$@
$$@@
___ @
/ \@
\___/@
<___>@
@@
_ _ @
| | | @
\_|_/ @
@
@@
_ _ @
_| |_|_ @
|_|_|___|@
|___| |_|@
|_|_| @@
_/_/@
/ __>@
\__ \@
<___/@
/_/ @@
_ __ @
<_>/ / @
/ /_ @
/_/<_>@
@@
___ @
< _ > @
/ _ \/@
\__\ \@
/@@
_ @
< >@
|/ @
@
@@
___@
/ /@
| | @
\__\@
@@
___ @
\ \@
| |@
/__/@
@@
__A__@
\ /@
/_ _\@
V @
@@
_ @
_| |_ @
|_ _|@
|_| @
@@
@
@
_ @
< >@
|/ @@
@
___ @
<___>@
@
@@
@
@
_ @
<_>@
@@
___@
/ /@
/ / @
/__/ @
@@
_____ @
/ _ \@
| | |@
\_____/@
@@
___ @
/ | @
| | @
<____>@
@@
_____ @
<___ \@
/ __/@
<_____|@
@@
_____ @
/ _ \@
>-<_ <@
\_____/@
@@
__ __ @
/ | \@
\_ |@
\___/@
@@
_____ @
| ___|@
|___ \@
<_____/@
@@
____ @
/ __| @
| _ \@
\_____/@
@@
_____ @
<__ \@
/ /@
<___/ @
@@
_____ @
/ _ \@
> _ <@
\_____/@
@@
_____ @
/ _ \@
\___ |@
|_____/@
@@
_ @
<_>@
_ @
<_>@
@@
_ @
<_>@
_ @
< >@
|/ @@
___@
/ /@
< < @
\__\@
@@
@
___ @
<___> @
<___> @
@@
___ @
\ \ @
> >@
/__/ @
@@
_____ @
<___ \@
|__ /@
<___> @
@@
_____ @
/ __ \@
| |___|@
\_____/@
@@
_____ @
/ _ \@
| _ |@
\__|__/@
@@
_____ @
/ _ \@
| _ <@
\_____/@
@@
_____ @
/ \@
| |--|@
\_____/@
@@
_____ @
| _ \@
| | |@
|_____/@
@@
_____ @
/ __\@
| __|@
\_____/@
@@
_____ @
/ __\@
| __|@
\__/ @
@@
_____ @
/ __\@
| |_ |@
\_____/@
@@
__ __ @
/ | \@
| _ |@
\__|__/@
@@
___ @
/___\@
| |@
\___/@
@@
____ @
\_ \@
---| |@
\_____/@
@@
__ ___@
| | /@
| _ < @
|__|__\@
@@
____ @
/ _/ @
| |---@
\_____/@
@@
__ __ @
/ \/ \@
| \/ |@
\__ \__/@
@@
_____ @
/ _ \@
| | |@
\__|__/@
@@
_____ @
/ _ \@
| | |@
\_____/@
@@
_____ @
/ _ \@
| __/@
\__/ @
@@
_____ @
/ _ \@
| | |@
\___\ \@
/@@
_____ @
/ _ \@
| _ <@
\__|\_/@
@@
_____ @
/ ___>@
|___ |@
<_____/@
@@
____ @
/ \@
\- -/@
|__| @
@@
__ __ @
/ | \@
| | |@
\_____/@
@@
__ __ @
/ | \@
\ | /@
\___/ @
@@
__ __ @
/ / \@
| /\ |@
\__/\__/@
@@
__ __ @
/ \/ \@
>- -<@
\__/\__/@
@@
___ ___@
\ | /@
| | @
\___/ @
@@
_____ @
|__ /@
/ _/ @
/_____|@
@@
___ @
| _|@
| |_ @
|___|@
@@
___ @
\ \ @
\ \ @
\__\@
@@
___ @
|_ |@
_| |@
|___|@
@@
__ @
/ \ @
/_/\_\@
@
@@
@
@
@
____ @
<____>@@
_ @
< >@
\|@
@
@@
_____ @
/ _ \@
| _ |@
\__|__/@
@@
_____ @
/ _ \@
| _ <@
\_____/@
@@
_____ @
/ \@
| |--|@
\_____/@
@@
_____ @
| _ \@
| | |@
|_____/@
@@
_____ @
/ __\@
| __|@
\_____/@
@@
_____ @
/ __\@
| __|@
\__/ @
@@
_____ @
/ __\@
| |_ |@
\_____/@
@@
__ __ @
/ | \@
| _ |@
\__|__/@
@@
___ @
/___\@
| |@
\___/@
@@
____ @
\_ \@
---| |@
\_____/@
@@
__ ___@
| | /@
| _ < @
|__|__\@
@@
____ @
/ _/ @
| |---@
\_____/@
@@
__ __ @
/ \/ \@
| \/ |@
\__ \__/@
@@
_____ @
/ _ \@
| | |@
\__|__/@
@@
_____ @
/ _ \@
| | |@
\_____/@
@@
_____ @
/ _ \@
| __/@
\__/ @
@@
_____ @
/ _ \@
| | |@
\___\ \@
/@@
_____ @
/ _ \@
| _ <@
\__|\_/@
@@
_____ @
/ ___>@
|___ |@
<_____/@
@@
____ @
/ \@
\- -/@
|__| @
@@
__ __ @
/ | \@
| | |@
\_____/@
@@
__ __ @
/ | \@
\ | /@
\___/ @
@@
__ __ @
/ / \@
| /\ |@
\__/\__/@
@@
__ __ @
/ \/ \@
>- -<@
\__/\__/@
@@
___ ___@
\ | /@
| | @
\___/ @
@@
_____ @
|__ /@
/ _/ @
/_____|@
@@
___@
| /@
< | @
|__\@
@@
_ @
| |@
| |@
|_|@
@@
___ @
\ | @
| >@
/__| @
@@
_ _ @
/ \/ >@
<_/\_/ @
@
@@
/_\_/_\@
/ _ \@
| _ |@
\__|__/@
@@
/_\_/_\@
/ _ \@
| | |@
\_____/@
@@
/_\ /_\@
/ | \@
| | |@
\_____/@
@@
/_\_/_\@
/ _ \@
| _ |@
\__|__/@
@@
/_\_/_\@
/ _ \@
| | |@
\_____/@
@@
/_\ /_\@
/ | \@
| | |@
\_____/@
@@
ß@
@
@
@
@@
@@ -0,0 +1,2 @@
"use strict";var x=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var j=Object.prototype.hasOwnProperty;var Q=(e,t)=>{for(var s in t)x(e,s,{get:t[s],enumerable:!0})},Y=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of H(t))!j.call(e,n)&&n!==s&&x(e,n,{get:()=>t[n],enumerable:!(r=C(t,n))||r.enumerable});return e};var B=e=>Y(x({},"__esModule",{value:!0}),e);var Z={};Q(Z,{default:()=>K,resolveValue:()=>A,toast:()=>i,useToaster:()=>w,useToasterStore:()=>b});module.exports=B(Z);var W=e=>typeof e=="function",A=(e,t)=>W(e)?e(t):e;var I=(()=>{let e=0;return()=>(++e).toString()})(),se=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})();var m=require("react");var X=20,R="default";var M=(e,t)=>{let{toastLimit:s}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,s)};case 1:return{...e,toasts:e.toasts.map(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case 2:let{toast:r}=t;return M(e,{type:e.toasts.find(o=>o.id===r.id)?1:0,toast:r});case 3:let{toastId:n}=t;return{...e,toasts:e.toasts.map(o=>o.id===n||n===void 0?{...o,dismissed:!0,visible:!1}:o)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let T=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(o=>({...o,pauseDuration:o.pauseDuration+T}))}}},E=[],U={toasts:[],pausedAt:void 0,settings:{toastLimit:X}},p={},F=(e,t=R)=>{p[t]=M(p[t]||U,e),E.forEach(([s,r])=>{s===t&&r(p[t])})},_=e=>Object.keys(p).forEach(t=>F(e,t)),k=e=>Object.keys(p).find(t=>p[t].toasts.some(s=>s.id===e)),S=(e=R)=>t=>{F(t,e)},q={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},b=(e={},t=R)=>{let[s,r]=(0,m.useState)(p[t]||U),n=(0,m.useRef)(p[t]);(0,m.useEffect)(()=>(n.current!==p[t]&&r(p[t]),E.push([t,r]),()=>{let o=E.findIndex(([f])=>f===t);o>-1&&E.splice(o,1)}),[t]);let T=s.toasts.map(o=>{var f,g,D;return{...e,...e[o.type],...o,removeDelay:o.removeDelay||((f=e[o.type])==null?void 0:f.removeDelay)||(e==null?void 0:e.removeDelay),duration:o.duration||((g=e[o.type])==null?void 0:g.duration)||(e==null?void 0:e.duration)||q[o.type],style:{...e.style,...(D=e[o.type])==null?void 0:D.style,...o.style}}});return{...s,toasts:T}};var G=(e,t="blank",s)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...s,id:(s==null?void 0:s.id)||I()}),y=e=>(t,s)=>{let r=G(t,e,s);return S(r.toasterId||k(r.id))({type:2,toast:r}),r.id},i=(e,t)=>y("blank")(e,t);i.error=y("error");i.success=y("success");i.loading=y("loading");i.custom=y("custom");i.dismiss=(e,t)=>{let s={type:3,toastId:e};t?S(t)(s):_(s)};i.dismissAll=e=>i.dismiss(void 0,e);i.remove=(e,t)=>{let s={type:4,toastId:e};t?S(t)(s):_(s)};i.removeAll=e=>i.remove(void 0,e);i.promise=(e,t,s)=>{let r=i.loading(t.loading,{...s,...s==null?void 0:s.loading});return typeof e=="function"&&(e=e()),e.then(n=>{let T=t.success?A(t.success,n):void 0;return T?i.success(T,{id:r,...s,...s==null?void 0:s.success}):i.dismiss(r),n}).catch(n=>{let T=t.error?A(t.error,n):void 0;T?i.error(T,{id:r,...s,...s==null?void 0:s.error}):i.dismiss(r)}),e};var c=require("react");var J=1e3,w=(e,t="default")=>{let{toasts:s,pausedAt:r}=b(e,t),n=(0,c.useRef)(new Map).current,T=(0,c.useCallback)((a,d=J)=>{if(n.has(a))return;let u=setTimeout(()=>{n.delete(a),o({type:4,toastId:a})},d);n.set(a,u)},[]);(0,c.useEffect)(()=>{if(r)return;let a=Date.now(),d=s.map(u=>{if(u.duration===1/0)return;let O=(u.duration||0)+u.pauseDuration-(a-u.createdAt);if(O<0){u.visible&&i.dismiss(u.id);return}return setTimeout(()=>i.dismiss(u.id,t),O)});return()=>{d.forEach(u=>u&&clearTimeout(u))}},[s,r,t]);let o=(0,c.useCallback)(S(t),[t]),f=(0,c.useCallback)(()=>{o({type:5,time:Date.now()})},[o]),g=(0,c.useCallback)((a,d)=>{o({type:1,toast:{id:a,height:d}})},[o]),D=(0,c.useCallback)(()=>{r&&o({type:6,time:Date.now()})},[r,o]),N=(0,c.useCallback)((a,d)=>{let{reverseOrder:u=!1,gutter:O=8,defaultPosition:V}=d||{},h=s.filter(l=>(l.position||V)===(a.position||V)&&l.height),L=h.findIndex(l=>l.id===a.id),v=h.filter((l,P)=>P<L&&l.visible).length;return h.filter(l=>l.visible).slice(...u?[v+1]:[0,v]).reduce((l,P)=>l+(P.height||0)+O,0)},[s]);return(0,c.useEffect)(()=>{s.forEach(a=>{if(a.dismissed)T(a.id,a.removeDelay);else{let d=n.get(a.id);d&&(clearTimeout(d),n.delete(a.id))}})},[s,T]),{toasts:s,handlers:{updateHeight:g,startPause:f,endPause:D,calculateOffset:N}}};var K=i;0&&(module.exports={resolveValue,toast,useToaster,useToasterStore});
//# sourceMappingURL=index.js.map
@@ -0,0 +1,126 @@
/*
* 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 {AriaToggleProps} from '@react-types/checkbox';
import {filterDOMProps, mergeProps, useFormReset} from '@react-aria/utils';
import {InputHTMLAttributes, LabelHTMLAttributes} from 'react';
import {RefObject} from '@react-types/shared';
import {ToggleState} from '@react-stately/toggle';
import {useFocusable, usePress} from '@react-aria/interactions';
export interface ToggleAria {
/** Props to be spread on the label element. */
labelProps: LabelHTMLAttributes<HTMLLabelElement>,
/** Props to be spread on the input element. */
inputProps: InputHTMLAttributes<HTMLInputElement>,
/** Whether the toggle is selected. */
isSelected: boolean,
/** Whether the toggle is in a pressed state. */
isPressed: boolean,
/** Whether the toggle is disabled. */
isDisabled: boolean,
/** Whether the toggle is read only. */
isReadOnly: boolean,
/** Whether the toggle is invalid. */
isInvalid: boolean
}
/**
* Handles interactions for toggle elements, e.g. Checkboxes and Switches.
*/
export function useToggle(props: AriaToggleProps, state: ToggleState, ref: RefObject<HTMLInputElement | null>): ToggleAria {
let {
isDisabled = false,
isReadOnly = false,
value,
name,
form,
children,
'aria-label': ariaLabel,
'aria-labelledby': ariaLabelledby,
validationState = 'valid',
isInvalid,
onPressStart,
onPressEnd,
onPressChange,
onPress,
onPressUp,
onClick
} = props;
let onChange = (e) => {
// since we spread props on label, onChange will end up there as well as in here.
// so we have to stop propagation at the lowest level that we care about
e.stopPropagation();
state.setSelected(e.target.checked);
};
let hasChildren = children != null;
let hasAriaLabel = ariaLabel != null || ariaLabelledby != null;
if (!hasChildren && !hasAriaLabel && process.env.NODE_ENV !== 'production') {
console.warn('If you do not provide children, you must specify an aria-label for accessibility');
}
// Handle press state for keyboard interactions and cases where labelProps is not used.
let {pressProps, isPressed} = usePress({
onPressStart,
onPressEnd,
onPressChange,
onPress,
onPressUp,
onClick,
isDisabled
});
// Handle press state on the label.
let {pressProps: labelProps, isPressed: isLabelPressed} = usePress({
onPressStart,
onPressEnd,
onPressChange,
onPressUp,
onClick,
onPress(e) {
onPress?.(e);
state.toggle();
ref.current?.focus();
},
isDisabled: isDisabled || isReadOnly
});
let {focusableProps} = useFocusable(props, ref);
let interactions = mergeProps(pressProps, focusableProps);
let domProps = filterDOMProps(props, {labelable: true});
useFormReset(ref, state.defaultSelected, state.setSelected);
return {
labelProps: mergeProps(labelProps, {onClick: e => e.preventDefault()}),
inputProps: mergeProps(domProps, {
'aria-invalid': isInvalid || validationState === 'invalid' || undefined,
'aria-errormessage': props['aria-errormessage'],
'aria-controls': props['aria-controls'],
'aria-readonly': isReadOnly || undefined,
onChange,
disabled: isDisabled,
...(value == null ? {} : {value}),
name,
form,
type: 'checkbox',
...interactions
}),
isSelected: state.isSelected,
isPressed: isPressed || isLabelPressed,
isDisabled,
isReadOnly,
isInvalid: isInvalid || validationState === 'invalid'
};
}
@@ -0,0 +1,45 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.spanAllZeroes = spanAllZeroes;
exports.spanAll = spanAll;
exports.spanLeadingZeroes = spanLeadingZeroes;
exports.simpleGroup = simpleGroup;
/**
* @returns {String} the string with all zeroes contained in a <span>
*/
function spanAllZeroes(s) {
return s.replace(/(0+)/g, '<span class="zero">$1</span>');
}
/**
* @returns {String} the string with each character contained in a <span>
*/
function spanAll(s, offset = 0) {
const letters = s.split('');
return letters
.map((n, i) => `<span class="digit value-${n} position-${i + offset}">${spanAllZeroes(n)}</span>`)
.join('');
}
function spanLeadingZeroesSimple(group) {
return group.replace(/^(0+)/, '<span class="zero">$1</span>');
}
/**
* @returns {String} the string with leading zeroes contained in a <span>
*/
function spanLeadingZeroes(address) {
const groups = address.split(':');
return groups.map((g) => spanLeadingZeroesSimple(g)).join(':');
}
/**
* Groups an address
* @returns {String} a grouped address
*/
function simpleGroup(addressString, offset = 0) {
const groups = addressString.split(':');
return groups.map((g, i) => {
if (/group-v4/.test(g)) {
return g;
}
return `<span class="hover-group group-${i + offset}">${spanLeadingZeroesSimple(g)}</span>`;
});
}
//# sourceMappingURL=helpers.js.map
@@ -0,0 +1,18 @@
/*
* 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.
*/
export {useMenuTriggerState} from './useMenuTriggerState';
export {useSubmenuTriggerState} from './useSubmenuTriggerState';
export type {MenuTriggerProps} from '@react-types/menu';
export type {MenuTriggerState, RootMenuTriggerState} from './useMenuTriggerState';
export type {SubmenuTriggerProps, SubmenuTriggerState} from './useSubmenuTriggerState';
@@ -0,0 +1,19 @@
{
"name": "is-utf8",
"version": "0.2.1",
"description": "Detect if a buffer is utf8 encoded.",
"main": "is-utf8.js",
"scripts": {
"test": "node test.js"
},
"repository": "https://github.com/wayfind/is-utf8.git",
"keywords": [
"utf8",
"charset"
],
"files": [
"is-utf8.js"
],
"author": "wayfind",
"license": "MIT"
}
@@ -0,0 +1,31 @@
// This file is an augmentation to the built-in ImportMeta interface
// Thus cannot contain any top-level imports
// <https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation>
// This is tested in `packages/vite/src/node/__tests_dts__/typeOptions.ts`
// eslint-disable-next-line @typescript-eslint/no-empty-object-type -- to allow extending by users
interface ViteTypeOptions {
// strictImportMetaEnv: unknown
}
type ImportMetaEnvFallbackKey =
'strictImportMetaEnv' extends keyof ViteTypeOptions ? never : string
interface ImportMetaEnv {
[key: ImportMetaEnvFallbackKey]: any
BASE_URL: string
MODE: string
DEV: boolean
PROD: boolean
SSR: boolean
}
interface ImportMeta {
url: string
readonly hot?: import('./hot').ViteHotContext
readonly env: ImportMetaEnv
glob: import('./importGlob').ImportGlobFunction
}
@@ -0,0 +1,138 @@
import { GeneralCallResult, GroupMember, NTGroupMemberRole, NTGroupRequestOperateTypes, InstanceContext, KickMemberV2Req, NapCatCore, GroupNotify, ShutUpGroupMember } from '../index';
import { LimitedHashTable } from '../../napcat-common/src/message-unique';
export declare class NTQQGroupApi {
context: InstanceContext;
core: NapCatCore;
groupMemberCache: Map<string, Map<string, GroupMember>>;
essenceLRU: LimitedHashTable<number, string>;
constructor(context: InstanceContext, core: NapCatCore);
setGroupRemark(groupCode: string, remark: string): Promise<GeneralCallResult>;
fetchGroupDetail(groupCode: string): Promise<import("../index").GroupDetailInfo>;
initApi(): Promise<void>;
createGrayTip(groupCode: string, tip: string): Promise<unknown>;
initCache(): Promise<void>;
fetchGroupEssenceList(groupCode: string): Promise<unknown>;
getGroupShutUpMemberList(groupCode: string): Promise<ShutUpGroupMember[]>;
clearGroupNotifiesUnreadCount(doubt: boolean): Promise<void>;
setGroupAvatar(groupCode: string, filePath: string): Promise<GeneralCallResult>;
setGroupRobotAddOption(groupCode: string, robotMemberSwitch?: number, robotMemberExamine?: number): Promise<GeneralCallResult & {
result: {
groupCode: string;
result: number;
};
}>;
setGroupAddOption(groupCode: string, option: {
addOption: number;
groupQuestion?: string;
groupAnswer?: string;
}): Promise<GeneralCallResult>;
setGroupSearch(groupCode: string, option: {
noCodeFingerOpenFlag?: number;
noFingerOpenFlag?: number;
}): Promise<GeneralCallResult>;
getGroups(forced?: boolean): Promise<import("../index").Group[]>;
getGroupExtFE0Info(groupCodes: Array<string>, forced?: boolean): Promise<GeneralCallResult & {
result: {
groupExtInfos: Map<string, unknown>;
};
}>;
getGroupMemberAll(groupCode: string, forced?: boolean): Promise<{
errCode: number;
errMsg: string;
result: {
ids: Array<{
uid: string;
index: number;
}>;
infos: Map<string, GroupMember>;
finish: true;
hasRobot: false;
};
}>;
refreshGroupMemberCache(groupCode: string, isWait?: boolean): Promise<Map<string, GroupMember> | undefined>;
refreshGroupMemberCachePartial(groupCode: string, uid: string): Promise<GroupMember | undefined>;
getGroupMember(groupCode: string | number, memberUinOrUid: string | number): Promise<GroupMember | undefined>;
getGroupRecommendContactArkJson(groupCode: string): Promise<GeneralCallResult & {
arkJson: string;
}>;
creatGroupFileFolder(groupCode: string, folderName: string): Promise<GeneralCallResult & {
resultWithGroupItem: {
result: unknown;
groupItem: Array<unknown>;
};
}>;
delGroupFile(groupCode: string, files: Array<string>): Promise<GeneralCallResult & {
transGroupFileResult: {
result: unknown;
successFileIdList: Array<unknown>;
failFileIdList: Array<unknown>;
};
}>;
delGroupFileFolder(groupCode: string, folderId: string): Promise<GeneralCallResult & {
groupFileCommonResult: {
retCode: number;
retMsg: string;
clientWording: string;
};
}>;
transGroupFile(groupCode: string, fileId: string): Promise<GeneralCallResult & {
transGroupFileResult: {
result: {
retCode: number;
retMsg: string;
clientWording: string;
};
saveBusId: number;
saveFilePath: string;
};
}>;
addGroupEssence(groupCode: string, msgId: string): Promise<unknown>;
kickMemberV2Inner(param: KickMemberV2Req): Promise<GeneralCallResult>;
deleteGroupBulletin(groupCode: string, noticeId: string): Promise<void>;
quitGroupV2(GroupCode: string, needDeleteLocalMsg: boolean): Promise<GeneralCallResult>;
removeGroupEssenceBySeq(groupCode: string, msgRandom: string, msgSeq: string): Promise<unknown>;
removeGroupEssence(groupCode: string, msgId: string): Promise<unknown>;
getSingleScreenNotifies(doubt: boolean, count: number): Promise<GroupNotify[]>;
searchGroup(groupCode: string): Promise<import("../index").GroupInfo | undefined>;
getGroupMemberEx(groupCode: string, uid: string, forced?: boolean, retry?: number): Promise<GroupMember | undefined>;
getGroupFileCount(groupCodes: Array<string>): Promise<GeneralCallResult & {
groupCodes: Array<string>;
groupFileCounts: Array<number>;
}>;
getArkJsonGroupShare(groupCode: string): Promise<string>;
uploadGroupBulletinPic(groupCode: string, imageurl: string): Promise<GeneralCallResult & {
errCode: number;
picInfo?: {
id: string;
width: number;
height: number;
};
}>;
handleGroupRequest(doubt: boolean, notify: GroupNotify, operateType: NTGroupRequestOperateTypes, reason?: string): Promise<void>;
quitGroup(groupCode: string): Promise<void>;
kickMember(groupCode: string, kickUids: string[], refuseForever?: boolean, kickReason?: string): Promise<void>;
banMember(groupCode: string, memList: Array<{
uid: string;
timeStamp: number;
}>): Promise<GeneralCallResult>;
banGroup(groupCode: string, shutUp: boolean): Promise<GeneralCallResult>;
setMemberCard(groupCode: string, memberUid: string, cardName: string): Promise<void>;
setMemberRole(groupCode: string, memberUid: string, role: NTGroupMemberRole): Promise<void>;
setGroupName(groupCode: string, groupName: string): Promise<GeneralCallResult>;
publishGroupBulletin(groupCode: string, content: string, picInfo?: {
id: string;
width: number;
height: number;
} | undefined, pinned?: number, confirmRequired?: number): Promise<GeneralCallResult>;
getGroupRemainAtTimes(groupCode: string): Promise<Omit<GeneralCallResult, "result"> & {
errCode: number;
atInfo: {
canAtAll: boolean;
RemainAtAllCountForUin: number;
RemainAtAllCountForGroup: number;
atTimesMsg: string;
canNotAtAllMsg: "";
};
}>;
getMemberExtInfo(groupCode: string, uin: string): Promise<unknown>;
}
@@ -0,0 +1 @@
export { a as falsyToString, e as flatArray, f as flatMergeArrays, d as isBoolean, b as isEmptyObject, c as isEqual, g as mergeObjects, h as removeExtraSpaces } from './chunk-JXBJZR5A.js';
@@ -0,0 +1 @@
{"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAQD,MAAM,iCAAW;AAKV,SAAS,0CAAI,IAAqC,EAAE,QAA0B;IACnF,IAAI,cAAsD,KAAK,IAAI;IACnE,IAAI,OAAO,UAAU,cAAc,oCAAc,aAAa,YAAY;IAE1E,+BAAS,aAAa,SAAS,KAAK,IAAI;IACxC,IAAI,YAAY,QAAQ,CAAC,gBAAgB,EACvC,YAAY,QAAQ,CAAC,gBAAgB,CAAC,aAAa;IAGrD,YAAY,KAAK,IAAI,SAAS,MAAM,IAAI;IAExC,uCAAiB;IACjB,wCAAkB;IAElB,YAAY,GAAG,IAAI,AAAC,CAAA,SAAS,KAAK,IAAI,CAAA,IAAK;IAC3C,YAAY,GAAG,IAAI,SAAS,IAAI,IAAI;IACpC,YAAY,GAAG,IAAI;IAEnB,iCAAW;IAEX,IAAI,YAAY,QAAQ,CAAC,WAAW,EAClC,YAAY,QAAQ,CAAC,WAAW,CAAC;IAGnC,iGAAiG;IACjG,+FAA+F;IAC/F,+FAA+F;IAC/F,uGAAuG;IACvG,IAAI,YAAY,IAAI,GAAG,GAAG;QACxB,YAAY,IAAI,GAAG;QACnB,YAAY,KAAK,GAAG;QACpB,YAAY,GAAG,GAAG;IACpB;IAEA,IAAI,UAAU,YAAY,QAAQ,CAAC,aAAa,CAAC;IACjD,IAAI,YAAY,IAAI,GAAG,SAAS;YACX,oCAAA;QAAnB,IAAI,gBAAe,qCAAA,CAAA,wBAAA,YAAY,QAAQ,EAAC,YAAY,cAAjC,yDAAA,wCAAA,uBAAoC;QACvD,YAAY,IAAI,GAAG;QACnB,YAAY,KAAK,GAAG,eAAe,IAAI,YAAY,QAAQ,CAAC,eAAe,CAAC;QAC5E,YAAY,GAAG,GAAG,eAAe,IAAI,YAAY,QAAQ,CAAC,cAAc,CAAC;IAC3E;IAEA,IAAI,YAAY,KAAK,GAAG,GAAG;QACzB,YAAY,KAAK,GAAG;QACpB,YAAY,GAAG,GAAG;IACpB;IAEA,IAAI,WAAW,YAAY,QAAQ,CAAC,eAAe,CAAC;IACpD,IAAI,YAAY,KAAK,GAAG,UAAU;QAChC,YAAY,KAAK,GAAG;QACpB,YAAY,GAAG,GAAG,YAAY,QAAQ,CAAC,cAAc,CAAC;IACxD;IAEA,YAAY,GAAG,GAAG,KAAK,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,YAAY,QAAQ,CAAC,cAAc,CAAC,cAAc,YAAY,GAAG;IACxG,OAAO;AACT;AAEA,SAAS,+BAAS,IAA8B,EAAE,KAAa;QACzD,6BAAA;IAAJ,KAAI,8BAAA,CAAA,iBAAA,KAAK,QAAQ,EAAC,YAAY,cAA1B,kDAAA,iCAAA,gBAA6B,OAC/B,QAAQ,CAAC;IAGX,KAAK,IAAI,IAAI;AACf;AAEA,SAAS,uCAAiB,IAA8B;IACtD,MAAO,KAAK,KAAK,GAAG,EAAG;QACrB,+BAAS,MAAM;QACf,KAAK,KAAK,IAAI,KAAK,QAAQ,CAAC,eAAe,CAAC;IAC9C;IAEA,IAAI,eAAe;IACnB,MAAO,KAAK,KAAK,GAAI,CAAA,eAAe,KAAK,QAAQ,CAAC,eAAe,CAAC,KAAI,EAAI;QACxE,KAAK,KAAK,IAAI;QACd,+BAAS,MAAM;IACjB;AACF;AAEA,SAAS,iCAAW,IAA8B;IAChD,MAAO,KAAK,GAAG,GAAG,EAAG;QACnB,KAAK,KAAK;QACV,uCAAiB;QACjB,KAAK,GAAG,IAAI,KAAK,QAAQ,CAAC,cAAc,CAAC;IAC3C;IAEA,MAAO,KAAK,GAAG,GAAG,KAAK,QAAQ,CAAC,cAAc,CAAC,MAAO;QACpD,KAAK,GAAG,IAAI,KAAK,QAAQ,CAAC,cAAc,CAAC;QACzC,KAAK,KAAK;QACV,uCAAiB;IACnB;AACF;AAEA,SAAS,wCAAkB,IAA8B;IACvD,KAAK,KAAK,GAAG,KAAK,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,QAAQ,CAAC,eAAe,CAAC,OAAO,KAAK,KAAK;IACjF,KAAK,GAAG,GAAG,KAAK,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,QAAQ,CAAC,cAAc,CAAC,OAAO,KAAK,GAAG;AAC9E;AAEO,SAAS,0CAAU,IAA8B;IACtD,IAAI,KAAK,QAAQ,CAAC,aAAa,EAC7B,KAAK,QAAQ,CAAC,aAAa,CAAC;IAG9B,KAAK,IAAI,GAAG,KAAK,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,QAAQ,CAAC,aAAa,CAAC,OAAO,KAAK,IAAI;IAC7E,wCAAkB;AACpB;AAEO,SAAS,0CAAe,QAA0B;IACvD,IAAI,kBAAkB,CAAC;IACvB,IAAK,IAAI,OAAO,SACd,IAAI,OAAO,QAAQ,CAAC,IAAI,KAAK,UAC3B,eAAe,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI;IAIzC,OAAO;AACT;AAIO,SAAS,0CAAS,IAAqC,EAAE,QAA0B;IACxF,OAAO,0CAAI,MAAM,0CAAe;AAClC;AAIO,SAAS,0CAAI,IAAqC,EAAE,MAAkB;IAC3E,IAAI,cAAwC,KAAK,IAAI;IAErD,IAAI,OAAO,GAAG,IAAI,MAChB,YAAY,GAAG,GAAG,OAAO,GAAG;IAG9B,IAAI,OAAO,IAAI,IAAI,MACjB,YAAY,IAAI,GAAG,OAAO,IAAI;IAGhC,IAAI,OAAO,KAAK,IAAI,MAClB,YAAY,KAAK,GAAG,OAAO,KAAK;IAGlC,IAAI,OAAO,GAAG,IAAI,MAChB,YAAY,GAAG,GAAG,OAAO,GAAG;IAG9B,0CAAU;IACV,OAAO;AACT;AAIO,SAAS,0CAAQ,KAA8B,EAAE,MAAkB;IACxE,IAAI,eAAiD,MAAM,IAAI;IAE/D,IAAI,OAAO,IAAI,IAAI,MACjB,aAAa,IAAI,GAAG,OAAO,IAAI;IAGjC,IAAI,OAAO,MAAM,IAAI,MACnB,aAAa,MAAM,GAAG,OAAO,MAAM;IAGrC,IAAI,OAAO,MAAM,IAAI,MACnB,aAAa,MAAM,GAAG,OAAO,MAAM;IAGrC,IAAI,OAAO,WAAW,IAAI,MACxB,aAAa,WAAW,GAAG,OAAO,WAAW;IAG/C,0CAAc;IACd,OAAO;AACT;AAEA,SAAS,kCAAY,IAAsB;IACzC,KAAK,MAAM,IAAI,KAAK,KAAK,CAAC,KAAK,WAAW,GAAG;IAC7C,KAAK,WAAW,GAAG,qCAAe,KAAK,WAAW,EAAE;IAEpD,KAAK,MAAM,IAAI,KAAK,KAAK,CAAC,KAAK,MAAM,GAAG;IACxC,KAAK,MAAM,GAAG,qCAAe,KAAK,MAAM,EAAE;IAE1C,KAAK,IAAI,IAAI,KAAK,KAAK,CAAC,KAAK,MAAM,GAAG;IACtC,KAAK,MAAM,GAAG,qCAAe,KAAK,MAAM,EAAE;IAE1C,IAAI,OAAO,KAAK,KAAK,CAAC,KAAK,IAAI,GAAG;IAClC,KAAK,IAAI,GAAG,qCAAe,KAAK,IAAI,EAAE;IAEtC,OAAO;AACT;AAEO,SAAS,0CAAc,IAAsB;IAClD,KAAK,WAAW,GAAG,KAAK,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,WAAW,EAAE;IAC1D,KAAK,MAAM,GAAG,KAAK,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,MAAM,EAAE;IAChD,KAAK,MAAM,GAAG,KAAK,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,MAAM,EAAE;IAChD,KAAK,IAAI,GAAG,KAAK,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,KAAK,IAAI,EAAE;AAC9C;AAEA,SAAS,qCAAe,CAAS,EAAE,CAAS;IAC1C,IAAI,SAAS,IAAI;IACjB,IAAI,SAAS,GACX,UAAU;IAEZ,OAAO;AACT;AAEA,SAAS,oCAAc,IAAsB,EAAE,QAAsB;IACnE,KAAK,IAAI,IAAI,SAAS,KAAK,IAAI;IAC/B,KAAK,MAAM,IAAI,SAAS,OAAO,IAAI;IACnC,KAAK,MAAM,IAAI,SAAS,OAAO,IAAI;IACnC,KAAK,WAAW,IAAI,SAAS,YAAY,IAAI;IAC7C,OAAO,kCAAY;AACrB;AAEO,SAAS,0CAAQ,IAAU,EAAE,QAAsB;IACxD,IAAI,MAAM,KAAK,IAAI;IACnB,oCAAc,KAAK;IACnB,OAAO;AACT;AAEO,SAAS,0CAAa,IAAU,EAAE,QAAsB;IAC7D,OAAO,0CAAQ,MAAM,0CAAe;AACtC;AAIO,SAAS,0CAAU,KAAsC,EAAE,KAAgB,EAAE,MAAc,EAAE,OAAsB;IACxH,IAAI,UAAoD,MAAM,IAAI;IAElE,OAAQ;QACN,KAAK;YAAO;gBACV,IAAI,OAAO,MAAM,QAAQ,CAAC,OAAO;gBACjC,IAAI,WAAW,KAAK,OAAO,CAAC,MAAM,GAAG;gBACrC,IAAI,WAAW,GACb,MAAM,IAAI,MAAM,kBAAkB,MAAM,GAAG;gBAE7C,WAAW,iCAAW,UAAU,QAAQ,GAAG,KAAK,MAAM,GAAG,GAAG,oBAAA,8BAAA,QAAS,KAAK;gBAC1E,QAAQ,GAAG,GAAG,IAAI,CAAC,SAAS;gBAE5B,uGAAuG;gBACvG,0CAAU;gBACV;YACF;QACA,KAAK;gBACC,gCAAA;YAAJ,KAAI,iCAAA,CAAA,oBAAA,QAAQ,QAAQ,EAAC,YAAY,cAA7B,qDAAA,oCAAA,mBAAgC,UAClC,SAAS,CAAC;YAGZ,0GAA0G;YAC1G,2GAA2G;YAC3G,0FAA0F;YAC1F,QAAQ,IAAI,GAAG,iCAAW,MAAM,IAAI,EALine truncated
@@ -0,0 +1,103 @@
export declare const OidbSvcTrpcTcp0xE07_0: {
version: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
client: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
entrance: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
ocrReqBody: import("napcat-protobuf").MessageProtoFieldType<() => {
imageUrl: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
languageType: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
scene: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
originMd5: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
afterCompressMd5: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
afterCompressFileSize: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
afterCompressWeight: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
afterCompressHeight: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
isCut: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.BOOL, false, false>;
}, true, false>;
};
export declare const OcrReqBody: {
imageUrl: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
languageType: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
scene: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
originMd5: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
afterCompressMd5: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
afterCompressFileSize: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
afterCompressWeight: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
afterCompressHeight: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
isCut: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.BOOL, false, false>;
};
export declare const OidbSvcTrpcTcp0xE07_0_Response: {
retCode: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.INT32, false, false>;
errMsg: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
wording: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
ocrRspBody: import("napcat-protobuf").MessageProtoFieldType<() => {
textDetections: import("napcat-protobuf").MessageProtoFieldType<() => {
detectedText: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
confidence: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
polygon: import("napcat-protobuf").MessageProtoFieldType<() => {
coordinates: import("napcat-protobuf").MessageProtoFieldType<() => {
x: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.INT32, false, false>;
y: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.INT32, false, false>;
}, false, true>;
}, false, false>;
advancedInfo: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
}, false, true>;
language: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
requestId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
ocrLanguageList: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, true>;
dstTranslateLanguageList: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, true>;
languageList: import("napcat-protobuf").MessageProtoFieldType<() => {
languageCode: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
languageDesc: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
}, false, true>;
afterCompressWeight: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
afterCompressHeight: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
}, false, false>;
};
export declare const OcrRspBody: {
textDetections: import("napcat-protobuf").MessageProtoFieldType<() => {
detectedText: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
confidence: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
polygon: import("napcat-protobuf").MessageProtoFieldType<() => {
coordinates: import("napcat-protobuf").MessageProtoFieldType<() => {
x: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.INT32, false, false>;
y: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.INT32, false, false>;
}, false, true>;
}, false, false>;
advancedInfo: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
}, false, true>;
language: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
requestId: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
ocrLanguageList: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, true>;
dstTranslateLanguageList: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, true>;
languageList: import("napcat-protobuf").MessageProtoFieldType<() => {
languageCode: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
languageDesc: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
}, false, true>;
afterCompressWeight: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
afterCompressHeight: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
};
export declare const TextDetection: {
detectedText: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
confidence: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.UINT32, false, false>;
polygon: import("napcat-protobuf").MessageProtoFieldType<() => {
coordinates: import("napcat-protobuf").MessageProtoFieldType<() => {
x: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.INT32, false, false>;
y: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.INT32, false, false>;
}, false, true>;
}, false, false>;
advancedInfo: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
};
export declare const Polygon: {
coordinates: import("napcat-protobuf").MessageProtoFieldType<() => {
x: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.INT32, false, false>;
y: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.INT32, false, false>;
}, false, true>;
};
export declare const Coordinate: {
x: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.INT32, false, false>;
y: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.INT32, false, false>;
};
export declare const Language: {
languageCode: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
languageDesc: import("napcat-protobuf").ScalarProtoFieldType<ScalarType.STRING, false, false>;
};
@@ -0,0 +1 @@
{"name":"@codemirror/lang-javascript","version":"6.2.4","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532103871,"integrity":"sha512-93AnA94LXftw4iulmPgONmsxHTOmEXXVnuDgrubQugXHDb6+kqBYV3LU04W4nfNUBsUNOpHH1CYTncof2riVDg==","mode":420,"size":1118},"dist/index.cjs":{"checkedAt":1794532103871,"integrity":"sha512-zB2qYVztSYzyf87mpxpKErrYFQjuLixRsbbmHt8WjgpjSFnKzWnBtw1TcBMN5Yp0R3deCT/vsltsp6qvqlr17g==","mode":420,"size":19956},"dist/index.d.cts":{"checkedAt":1794532103871,"integrity":"sha512-pNMcpOhCasxVq1mLwig4c3XGM/lgVM+7uXpPpXy+ZDzjo2uLQuOwK2UXtgMWN9KuwpFDG+oGdnvKPUWvBeuPSg==","mode":420,"size":3685},"dist/index.js":{"checkedAt":1794532103871,"integrity":"sha512-ni/YPE+7tAmgoyB9LPOsjUni8vZ1s0cbxF/Zo05emFdZLlaei+LeRwsdACXPxv8sO0MRaCD+8HOnMYBO/FMFMQ==","mode":420,"size":19991},"package.json":{"checkedAt":1794532103871,"integrity":"sha512-O1IfsG9aeZcdNTzaHA4qdXZj0E2ZSnBsO3y7Wno6j0V/mu90wM9BKSPzeHj4SzvTenYLXRCpI+Yi/hnBjR7Rkw==","mode":420,"size":1125},"CHANGELOG.md":{"checkedAt":1794532103871,"integrity":"sha512-aONVXgrZ9kUKGNnmZC8hTUYX/69AEdwoZ5jnotXSMlkirwcpmaRZjfjrfQ3Q97isqPbIymPcuNT0iO89D9qllA==","mode":420,"size":4002},"README.md":{"checkedAt":1794532103872,"integrity":"sha512-73SOiWpU8Hf07dLMtKCV00a53Wd/NE/DnsEpWyz2JYKJ00zVS2IM7exdjHfFBx6jcQr83Yw0eDWnaZUI/YkmVA==","mode":420,"size":8338},"dist/index.d.ts":{"checkedAt":1794532103871,"integrity":"sha512-pNMcpOhCasxVq1mLwig4c3XGM/lgVM+7uXpPpXy+ZDzjo2uLQuOwK2UXtgMWN9KuwpFDG+oGdnvKPUWvBeuPSg==","mode":420,"size":3685},".github/workflows/dispatch.yml":{"checkedAt":1794532103872,"integrity":"sha512-m1oo9FDcj8HyBMn9j8PAdgJGReOxejwknSt0WhQByhphBMTHHlS1n9+UPCgcv631fi+EwCNIv0+z6VZAl52zag==","mode":420,"size":415}}}
@@ -0,0 +1,2 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),r=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,n=require("@dnd-kit/core"),o=require("@dnd-kit/utilities");function i(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function a(e,t){return e.reduce((e,r,n)=>{const o=t.get(r);return o&&(e[n]=o),e},Array(e.length))}function s(e){return null!==e&&e>=0}const d={scaleX:1,scaleY:1},l=e=>{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const a=i(t,n,r),s=t[o],d=a[o];return d&&s?{x:d.left-s.left,y:d.top-s.top,scaleX:d.width/s.width,scaleY:d.height/s.height}:null},c={scaleX:1,scaleY:1},u=r.createContext({activeIndex:-1,containerId:"Sortable",disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:l,disabled:{draggable:!1,droppable:!1}}),f=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return i(r,n,o).indexOf(t)},p=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:o,items:i,newIndex:a,previousItems:s,previousContainerId:d,transition:l}=e;return!(!l||!n||s!==i&&o===a||!r&&(a===o||t!==d))},g={duration:200,easing:"ease"},b=o.CSS.Transition.toString({property:"transform",duration:0,easing:"linear"}),x={roleDescription:"sortable"};function v(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const h=[n.KeyboardCode.Down,n.KeyboardCode.Right,n.KeyboardCode.Up,n.KeyboardCode.Left];function I(e,t){return!(!v(e)||!v(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}exports.SortableContext=function(e){let{children:i,id:s,items:d,strategy:c=l,disabled:f=!1}=e;const{active:p,dragOverlay:g,droppableRects:b,over:x,measureDroppableContainers:v}=n.useDndContext(),h=o.useUniqueId("Sortable",s),I=Boolean(null!==g.rect),y=t.useMemo(()=>d.map(e=>"object"==typeof e&&"id"in e?e.id:e),[d]),m=null!=p,w=p?y.indexOf(p.id):-1,C=x?y.indexOf(x.id):-1,R=t.useRef(y),S=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}(y,R.current),D=-1!==C&&-1===w||S,O=function(e){return"boolean"==typeof e?{draggable:e,droppable:e}:e}(f);o.useIsomorphicLayoutEffect(()=>{S&&m&&v(y)},[S,y,m,v]),t.useEffect(()=>{R.current=y},[y]);const N=t.useMemo(()=>({activeIndex:w,containerId:h,disabled:O,disableTransforms:D,items:y,overIndex:C,useDragOverlay:I,sortedRects:a(y,b),strategy:c}),[w,h,O.draggable,O.droppable,D,y,C,b,I,c]);return r.createElement(u.Provider,{value:N},i)},exports.arrayMove=i,exports.arraySwap=function(e,t,r){const n=e.slice();return n[t]=e[r],n[r]=e[t],n},exports.defaultAnimateLayoutChanges=p,exports.defaultNewIndexGetter=f,exports.hasSortableData=v,exports.horizontalListSortingStrategy=e=>{var t;let{rects:r,activeNodeRect:n,activeIndex:o,overIndex:i,index:a}=e;const s=null!=(t=r[o])?t:n;if(!s)return null;const l=function(e,t,r){const n=e[t],o=e[t-1],i=e[t+1];return n&&(o||i)?r<t?o?n.left-(o.left+o.width):i.left-(n.left+n.width):i?i.left-(n.left+n.width):n.left-(o.left+o.width):0}(r,a,o);if(a===o){const e=r[i];return e?{x:o<i?e.left+e.width-(s.left+s.width):e.left-s.left,y:0,...d}:null}return a>o&&a<=i?{x:-s.width-l,y:0,...d}:a<o&&a>=i?{x:s.width+l,y:0,...d}:{x:0,y:0,...d}},exports.rectSortingStrategy=l,exports.rectSwappingStrategy=e=>{let t,r,{activeIndex:n,index:o,rects:i,overIndex:a}=e;return o===n&&(t=i[o],r=i[a]),o===a&&(t=i[o],r=i[n]),r&&t?{x:r.left-t.left,y:r.top-t.top,scaleX:r.width/t.width,scaleY:r.height/t.height}:null},exports.sortableKeyboardCoordinates=(e,t)=>{let{context:{active:r,collisionRect:i,droppableRects:a,droppableContainers:s,over:d,scrollableAncestors:l}}=t;if(h.includes(e.code)){if(e.preventDefault(),!r||!i)return;const t=[];s.getEnabled().forEach(r=>{if(!r||null!=r&&r.disabled)return;const o=a.get(r.id);if(o)switch(e.code){case n.KeyboardCode.Down:i.top<o.top&&t.push(r);break;case n.KeyboardCode.Up:i.top>o.top&&t.push(r);break;case n.KeyboardCode.Left:i.left>o.left&&t.push(r);break;case n.KeyboardCode.Right:i.left<o.left&&t.push(r)}});const f=n.closestCorners({active:r,collisionRect:i,droppableRects:a,droppableContainers:t,pointerCoordinates:null});let p=n.getFirstCollision(f,"id");if(p===(null==d?void 0:d.id)&&f.length>1&&(p=f[1].id),null!=p){const e=s.get(r.id),t=s.get(p),d=t?a.get(t.id):null,f=null==t?void 0:t.node.current;if(f&&d&&e&&t){const r=n.getScrollableAncestors(f).some((e,t)=>l[t]!==e),a=I(e,t),s=(u=t,!(!v(c=e)||!v(u))&&!!I(c,u)&&c.data.current.sortable.index<u.data.current.sortable.index),p=r||!a?{x:0,y:0}:{x:s?i.width-d.width:0,y:s?i.height-d.height:0},g={x:d.left,y:d.top};return p.x&&p.y?g:o.subtract(g,p)}}}var c,u},exports.useSortable=function(e){let{animateLayoutChanges:r=p,attributes:i,disabled:a,data:d,getNewIndex:l=f,id:c,strategy:v,resizeObserverConfig:h,transition:I=g}=e;const{items:y,containerId:m,activeIndex:w,disabled:C,disableTransforms:R,sortedRects:S,overIndex:D,useLine truncated
//# sourceMappingURL=sortable.cjs.production.min.js.map
@@ -0,0 +1,61 @@
import {JsObjOutputBuilder} from './OutputBuilders/JsObjBuilder.js';
export const defaultOptions = {
preserveOrder: false,
removeNSPrefix: false, // remove NS from tag name or attribute name if true
//ignoreRootElement : false,
stopNodes: [], //nested tags will not be parsed even for errors
// isArray: () => false, //User will set it
htmlEntities: false,
// skipEmptyListItem: false
tags:{
unpaired: [],
nameFor:{
cdata: false,
comment: false,
text: '#text'
},
separateTextProperty: false,
},
attributes:{
ignore: false,
booleanType: true,
entities: true,
},
// select: ["img[src]"],
// stop: ["anim", "[ads]"]
only: [], // rest tags will be skipped. It will result in flat array
hierarchy: false, //will be used when a particular tag is set to be parsed.
skip: [], // will be skipped from parse result. on('skip') will be triggered
select: [], // on('select', tag => tag ) will be called if match
stop: [], //given tagPath will not be parsed. innerXML will be set as string value
OutputBuilder: new JsObjOutputBuilder(),
};
export const buildOptions = function(options) {
const finalOptions = { ... defaultOptions};
copyProperties(finalOptions,options)
return finalOptions;
};
function copyProperties(target, source) {
for (let key in source) {
if (source.hasOwnProperty(key)) {
if (key === 'OutputBuilder') {
target[key] = source[key];
}else if (typeof source[key] === 'object' && !Array.isArray(source[key])) {
// Recursively copy nested properties
if (typeof target[key] === 'undefined') {
target[key] = {};
}
copyProperties(target[key], source[key]);
} else {
// Copy non-nested properties
target[key] = source[key];
}
}
}
}
@@ -0,0 +1,6 @@
function absFloor(v) {
return v < 0 ? Math.ceil(v) || 0 : Math.floor(v);
}
export {
absFloor as a
};
@@ -0,0 +1,3 @@
import * as ts from 'typescript';
/*** Indicates whether identifiers require the use of quotation marks when accessing property definitions and dot notation. */
export declare function requiresQuoting(name: string, target?: ts.ScriptTarget): boolean;
@@ -0,0 +1,14 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var framerMotion = require('framer-motion');
Object.keys(framerMotion).forEach(function (k) {
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
enumerable: true,
get: function () { return framerMotion[k]; }
});
});
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('trimStart', require('../trimStart'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,404 @@
# AXObject Query
![CI](https://github.com/A11yance/axobject-query/workflows/CI/badge.svg)
Approximate model of the [Chrome AXObject](https://cs.chromium.org/chromium/src/third_party/WebKit/Source/modules/accessibility/AXObject.h).
The project attempts to map the AXObject concepts to the [WAI-ARIA 1.1 Roles Model](https://www.w3.org/TR/wai-aria-1.1/#roles) so that a complete representation of the semantic HTML layer, as it is exposed assistive technology, can be obtained.
CDN URL: <https://unpkg.com/axobject-query>
## Utilities
### AXObjects
```javascript
import { AXObjects } from 'axobject-query';
```
#### Interface
These methods are available on each export from the module. The typing here in the documentation is pseudo-typed. Each export will have its own specific types for each method signature.
```javascript
{|
entries: () => Array<$Item>,
get: (key: $Key) => ?$Value,
has: (key: $Key) => boolean,
keys: () => Array<$Key>,
values: () => Array<$Value>,
|};
```
### Concepts in the project
AXObjects are mapped to their HTML and ARIA concepts in the `relatedConcepts` field.
The `type` field is a loose association of an AXObject to the `window`, `structure` and `widget` abstract roles in ARIA. The `generic` value is given to `DivRole`; it does not exist in ARIA. Divs are special in HTML in the way that they are used as generic containers. Span might have also been associated with a generic type except that there is no `SpanRole` AXObject.
```javascript
[
[ 'AbbrRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'AlertDialogRole', { relatedConcepts: [ [Object] ], type: 'window' } ],
[ 'AlertRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'AnnotationRole', { relatedConcepts: [], type: 'structure' } ],
[ 'ApplicationRole', { relatedConcepts: [ [Object] ], type: 'window' } ],
[ 'ArticleRole', { relatedConcepts: [ [Object], [Object] ], type: 'structure' } ],
[ 'AudioRole', { relatedConcepts: [ [Object] ], type: 'widget' } ],
[ 'BannerRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'BlockquoteRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'BusyIndicatorRole', { relatedConcepts: [ [Object] ], type: 'widget' } ],
[ 'ButtonRole', { relatedConcepts: [ [Object], [Object] ], type: 'widget' } ],
[ 'CanvasRole', { relatedConcepts: [ [Object] ], type: 'widget' } ],
[ 'CaptionRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'CellRole', { relatedConcepts: [ [Object], [Object], [Object] ], type: 'widget' } ],
[ 'CheckBoxRole', { relatedConcepts: [ [Object], [Object] ], type: 'widget' } ],
[ 'ColorWellRole', { relatedConcepts: [ [Object] ], type: 'widget' } ],
[ 'ColumnHeaderRole', { relatedConcepts: [ [Object], [Object] ], type: 'widget' } ],
[ 'ColumnRole', { relatedConcepts: [], type: 'structure' } ],
[ 'ComboBoxRole', { relatedConcepts: [ [Object] ], type: 'widget' } ],
[ 'ComplementaryRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'ContentInfoRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'DateRole', { relatedConcepts: [ [Object] ], type: 'widget' } ],
[ 'DateTimeRole', { relatedConcepts: [ [Object] ], type: 'widget' } ],
[ 'DefinitionRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'DescriptionListDetailRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'DescriptionListRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'DescriptionListTermRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'DetailsRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'DialogRole', { relatedConcepts: [ [Object], [Object] ], type: 'window' } ],
[ 'DirectoryRole', { relatedConcepts: [ [Object], [Object] ], type: 'structure' } ],
[ 'DisclosureTriangleRole', { relatedConcepts: [], type: 'widget' } ],
[ 'DivRole', { relatedConcepts: [ [Object] ], type: 'generic' } ],
[ 'DocumentRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'EmbeddedObjectRole', { relatedConcepts: [ [Object] ], type: 'widget' } ],
[ 'FeedRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'FigcaptionRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'FigureRole', { relatedConcepts: [ [Object], [Object] ], type: 'structure' } ],
[ 'FooterRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'FormRole', { relatedConcepts: [ [Object], [Object] ], type: 'structure' } ],
[ 'GridRole', { relatedConcepts: [ [Object] ], type: 'widget' } ],
[ 'GroupRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'HeadingRole', { relatedConcepts: [ [Object], [Object], [Object], [Object], [Object], [Object], [Object] ], type: 'structure' } ],
[ 'IframePresentationalRole', { relatedConcepts: [], type: 'window' } ],
[ 'IframeRole', { relatedConcepts: [ [Object] ], type: 'window' } ],
[ 'IgnoredRole', { relatedConcepts: [], type: 'structure' } ],
[ 'ImageMapLinkRole', { relatedConcepts: [], type: 'widget' } ],
[ 'ImageMapRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'ImageRole', { relatedConcepts: [ [Object], [Object] ], type: 'structure' } ],
[ 'InlineTextBoxRole', { relatedConcepts: [ [Object] ], type: 'widget' } ],
[ 'InputTimeRole', { relatedConcepts: [ [Object] ], type: 'widget' } ],
[ 'LabelRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'LegendRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'LineBreakRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'LinkRole', { relatedConcepts: [ [Object], [Object] ], type: 'widget' } ],
[ 'ListBoxOptionRole', { relatedConcepts: [ [Object], [Object] ], type: 'widget' } ],
[ 'ListBoxRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'ListItemRole', { relatedConcepts: [ [Object], [Object] ], type: 'structure' } ],
[ 'ListMarkerRole', { relatedConcepts: [], type: 'structure' } ],
[ 'ListRole', { relatedConcepts: [ [Object], [Object], [Object] ], type: 'structure' } ],
[ 'LogRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'MainRole', { relatedConcepts: [ [Object], [Object] ], type: 'structure' } ],
[ 'MarkRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'MarqueeRole', { relatedConcepts: [ [Object], [Object] ], type: 'structure' } ],
[ 'MathRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'MenuBarRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'MenuButtonRole', { relatedConcepts: [], type: 'widget' } ],
[ 'MenuItemRole', { relatedConcepts: [ [Object], [Object] ], type: 'widget' } ],
[ 'MenuItemCheckBoxRole', { relatedConcepts: [ [Object] ], type: 'widget' } ],
[ 'MenuItemRadioRole', { relatedConcepts: [ [Object] ], type: 'widget' } ],
[ 'MenuListOptionRole', { relatedConcepts: [], type: 'widget' } ],
[ 'MenuListPopupRole', { relatedConcepts: [], type: 'widget' } ],
[ 'MenuRole', { relatedConcepts: [ [Object], [Object] ], type: 'structure' } ],
[ 'MeterRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'NavigationRole', { relatedConcepts: [ [Object], [Object] ], type: 'structure' } ],
[ 'NoneRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'NoteRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'OutlineRole', { relatedConcepts: [], type: 'structure' } ],
[ 'ParagraphRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'PopUpButtonRole', { relatedConcepts: [], type: 'widget' } ],
[ 'PreRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'PresentationalRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'ProgressIndicatorRole', { relatedConcepts: [ [Object], [Object] ], type: 'structure' } ],
[ 'RadioButtonRole', { relatedConcepts: [ [Object], [Object] ], type: 'widget' } ],
[ 'RadioGroupRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'RegionRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'RootWebAreaRole', { relatedConcepts: [], type: 'structure' } ],
[ 'RowHeaderRole', { relatedConcepts: [ [Object], [Object] ], type: 'widget' } ],
[ 'RowRole', { relatedConcepts: [ [Object], [Object] ], type: 'structure' } ],
[ 'RubyRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'RulerRole', { relatedConcepts: [], type: 'structure' } ],
[ 'ScrollAreaRole', { relatedConcepts: [], type: 'structure' } ],
[ 'ScrollBarRole', { relatedConcepts: [ [Object] ], type: 'widget' } ],
[ 'SeamlessWebAreaRole', { relatedConcepts: [], type: 'structure' } ],
[ 'SearchRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'SearchBoxRole', { relatedConcepts: [ [Object], [Object] ], type: 'widget' } ],
[ 'SliderRole', { relatedConcepts: [ [Object], [Object] ], type: 'widget' } ],
[ 'SliderThumbRole', { relatedConcepts: [], type: 'structure' } ],
[ 'SpinButtonRole', { relatedConcepts: [ [Object], [Object] ], type: 'widget' } ],
[ 'SpinButtonPartRole', { relatedConcepts: [], type: 'structure' } ],
[ 'SplitterRole', { relatedConcepts: [ [Object] ], type: 'widget' } ],
[ 'StaticTextRole', { relatedConcepts: [], type: 'structure' } ],
[ 'StatusRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'SVGRootRole', { relatedConcepts: [], type: 'structure' } ],
[ 'SwitchRole', { relatedConcepts: [ [Object] ], type: 'widget' } ],
[ 'TabGroupRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'TabRole', { relatedConcepts: [ [Object] ], type: 'widget' } ],
[ 'TableHeaderContainerRole', { relatedConcepts: [], type: 'structure' } ],
[ 'TableRole', { relatedConcepts: [ [Object], [Object] ], type: 'structure' } ],
[ 'TabListRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'TabPanelRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'TermRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'TextFieldRole', { relatedConcepts: [ [Object], [Object], [Object] ], type: 'widget' } ],
[ 'TimeRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'TimerRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'ToggleButtonRole', { relatedConcepts: [ [Object] ], type: 'widget' } ],
[ 'ToolbarRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'TreeRole', { relatedConcepts: [ [Object] ], type: 'widget' } ],
[ 'TreeGridRole', { relatedConcepts: [ [Object] ], type: 'widget' } ],
[ 'TreeItemRole', { relatedConcepts: [ [Object] ], type: 'widget' } ],
[ 'UserInterfaceTooltipRole', { relatedConcepts: [ [Object] ], type: 'structure' } ],
[ 'VideoRole', { relatedConcepts: [ [Object] ], type: 'widget' } ],
[ 'WebAreaRole', { relatedConcepts: [], type: 'structure' } ],
[ 'WindowRole', { relatedConcepts: [], type: 'window' } ],
]
```
### AXObject to Element
```javascript
import { AXObjectElements } from 'axobject-query';
```
AXObjects are mapped to their related HTML concepts, which may require attributes (in the case of inputs) to obtain the correct association.
```javascript
[
[ 'AbbrRole', [ { name: 'abbr' } ] ],
[ 'ArticleRole', [ { name: 'article' } ] ],
[ 'AudioRole', [ { name: 'audio' } ] ],
[ 'BlockquoteRole', [ { name: 'blockquote' } ] ],
[ 'ButtonRole', [ { name: 'button' } ] ],
[ 'CanvasRole', [ { name: 'canvas' } ] ],
[ 'CaptionRole', [ { name: 'caption' } ] ],
[ 'CellRole', [ { name: 'td' } ] ],
[ 'CheckBoxRole', [ { name: 'input', attributes: [Object] } ] ],
[ 'ColorWellRole', [ { name: 'input', attributes: [Object] } ] ],
[ 'ColumnHeaderRole', [ { name: 'th' } ] ],
[ 'DateRole', [ { name: 'input', attributes: [Object] } ] ],
[ 'DateTimeRole', [ { name: 'input', attributes: [Object] } ] ],
[ 'DefinitionRole', [ { name: 'dfn' } ] ],
[ 'DescriptionListDetailRole', [ { name: 'dd' } ] ],
[ 'DescriptionListRole', [ { name: 'dl' } ] ],
[ 'DescriptionListTermRole', [ { name: 'dt' } ] ],
[ 'DetailsRole', [ { name: 'details' } ] ],
[ 'DialogRole', [ { name: 'dialog' } ] ],
[ 'DirectoryRole', [ { name: 'dir' } ] ],
[ 'DivRole', [ { name: 'div' } ] ],
[ 'EmbeddedObjectRole', [ { name: 'embed' } ] ],
[ 'FigcaptionRole', [ { name: 'figcaption' } ] ],
[ 'FigureRole', [ { name: 'figure' } ] ],
[ 'FooterRole', [ { name: 'footer' } ] ],
[ 'FormRole', [ { name: 'form' } ] ],
[ 'HeadingRole', [ { name: 'h1' }, { name: 'h2' }, { name: 'h3' }, { name: 'h4' }, { name: 'h5' }, { name: 'h6' } ] ],
[ 'IframeRole', [ { name: 'iframe' } ] ],
[ 'ImageMapRole', [ { name: 'img', attributes: [Object] } ] ],
[ 'ImageRole', [ { name: 'img' } ] ],
[ 'InlineTextBoxRole', [ { name: 'input' } ] ],
[ 'InputTimeRole', [ { name: 'input', attributes: [Object] } ] ],
[ 'LabelRole', [ { name: 'label' } ] ],
[ 'LegendRole', [ { name: 'legend' } ] ],
[ 'LineBreakRole', [ { name: 'br' } ] ],
[ 'LinkRole', [ { name: 'a', attributes: [Object] } ] ],
[ 'ListBoxOptionRole', [ { name: 'option' } ] ],
[ 'ListItemRole', [ { name: 'li' } ] ],
[ 'ListRole', [ { name: 'ul' }, { name: 'ol' } ] ],
[ 'MainRole', [ { name: 'main' } ] ],
[ 'MarkRole', [ { name: 'mark' } ] ],
[ 'MarqueeRole', [ { name: 'marquee' } ] ],
[ 'MenuItemRole', [ { name: 'menuitem' } ] ],
[ 'MenuRole', [ { name: 'menu' } ] ],
[ 'MeterRole', [ { name: 'meter' } ] ],
[ 'NavigationRole', [ { name: 'nav' } ] ],
[ 'ParagraphRole', [ { name: 'p' } ] ],
[ 'PreRole', [ { name: 'pre' } ] ],
[ 'ProgressIndicatorRole', [ { name: 'progress' } ] ],
[ 'RadioButtonRole', [ { name: 'input', attributes: [Object] } ] ],
[ 'RowHeaderRole', [ { name: 'th', attributes: [Object] } ] ],
[ 'RowRole', [ { name: 'tr' } ] ],
[ 'RubyRole', [ { name: 'ruby' } ] ],
[ 'SearchBoxRole', [ { name: 'input', attributes: [Object] } ] ],
[ 'SliderRole', [ { name: 'input', attributes: [Object] } ] ],
[ 'SpinButtonRole', [ { name: 'input', attributes: [Object] } ] ],
[ 'TableRole', [ { name: 'table' } ] ],
[ 'TextFieldRole', [ { name: 'input' }, { name: 'input', attributes: [Object] } ] ],
[ 'TimeRole', [ { name: 'time' } ] ],
[ 'VideoRole', [ { name: 'video' ] ],
]
```
### AXObject to Role
```javascript
import { AXObjectRoles } from 'axobject-query';
```
AXObjects are mapped to their related ARIA concepts..
```javascript
[
[ 'AlertDialogRole', [ { name: 'alertdialog' } ] ],
[ 'AlertRole', [ { name: 'alert' } ] ],
[ 'ApplicationRole', [ { name: 'application' } ] ],
[ 'ArticleRole', [ { name: 'article' } ] ],
[ 'BannerRole', [ { name: 'banner' } ] ],
[ 'BusyIndicatorRole', [ { attributes: [Object] } ] ],
[ 'ButtonRole', [ { name: 'button' } ] ],
[ 'CellRole', [ { name: 'cell' }, { name: 'gridcell' } ] ],
[ 'CheckBoxRole', [ { name: 'checkbox' } ] ],
[ 'ColumnHeaderRole', [ { name: 'columnheader' } ] ],
[ 'ComboBoxRole', [ { name: 'combobox' } ] ],
[ 'ComplementaryRole', [ { name: 'complementary' } ] ],
[ 'ContentInfoRole', [ { name: 'structureinfo' } ] ],
[ 'DialogRole', [ { name: 'dialog' } ] ],
[ 'DirectoryRole', [ { name: 'directory' } ] ],
[ 'DocumentRole', [ { name: 'document' } ] ],
[ 'FeedRole', [ { name: 'feed' } ] ],
[ 'FigureRole', [ { name: 'figure' } ] ],
[ 'FormRole', [ { name: 'form' } ] ],
[ 'GridRole', [ { name: 'grid' } ] ],
[ 'GroupRole', [ { name: 'group' } ] ],
[ 'HeadingRole', [ { name: 'heading' } ] ],
[ 'ImageRole', [ { name: 'img' } ] ],
[ 'LinkRole', [ { name: 'link' } ] ],
[ 'ListBoxOptionRole', [ { name: 'option' } ] ],
[ 'ListBoxRole', [ { name: 'listbox' } ] ],
[ 'ListItemRole', [ { name: 'listitem' } ] ],
[ 'ListRole', [ { name: 'list' } ] ],
[ 'LogRole', [ { name: 'log' } ] ],
[ 'MainRole', [ { name: 'main' } ] ],
[ 'MarqueeRole', [ { name: 'marquee' } ] ],
[ 'MathRole', [ { name: 'math' } ] ],
[ 'MenuBarRole', [ { name: 'menubar' } ] ],
[ 'MenuItemRole', [ { name: 'menuitem' } ] ],
[ 'MenuItemCheckBoxRole', [ { name: 'menuitemcheckbox' } ] ],
[ 'MenuItemRadioRole', [ { name: 'menuitemradio' } ] ],
[ 'MenuRole', [ { name: 'menu' } ] ],
[ 'NavigationRole', [ { name: 'navigation' } ] ],
[ 'NoneRole', [ { name: 'none' } ] ],
[ 'NoteRole', [ { name: 'note' } ] ],
[ 'PresentationalRole', [ { name: 'presentation' } ] ],
[ 'ProgressIndicatorRole', [ { name: 'progressbar' } ] ],
[ 'RadioButtonRole', [ { name: 'radio' } ] ],
[ 'RadioGroupRole', [ { name: 'radiogroup' } ] ],
[ 'RegionRole', [ { name: 'region' } ] ],
[ 'RowHeaderRole', [ { name: 'rowheader' } ] ],
[ 'RowRole', [ { name: 'row' } ] ],
[ 'ScrollBarRole', [ { name: 'scrollbar' } ] ],
[ 'SearchRole', [ { name: 'search' } ] ],
[ 'SearchBoxRole', [ { name: 'searchbox' } ] ],
[ 'SliderRole', [ { name: 'slider' } ] ],
[ 'SpinButtonRole', [ { name: 'spinbutton' } ] ],
[ 'SplitterRole', [ { name: 'separator' } ] ],
[ 'StatusRole', [ { name: 'status' } ] ],
[ 'SwitchRole', [ { name: 'switch' } ] ],
[ 'TabGroupRole', [ { name: 'tablist' } ] ],
[ 'TabRole', [ { name: 'tab' } ] ],
[ 'TableRole', [ { name: 'table' } ] ],
[ 'TabListRole', [ { name: 'tablist' } ] ],
[ 'TabPanelRole', [ { name: 'tabpanel' } ] ],
[ 'TermRole', [ { name: 'term' } ] ],
[ 'TextFieldRole', [ { name: 'textbox' } ] ],
[ 'TimerRole', [ { name: 'timer' } ] ],
[ 'ToggleButtonRole', [ { attributes: [Object] } ] ],
[ 'ToolbarRole', [ { name: 'toolbar' } ] ],
[ 'TreeRole', [ { name: 'tree' } ] ],
[ 'TreeGridRole', [ { name: 'treegrid' } ] ],
[ 'TreeItemRole', [ { name: 'treeitem' } ] ],
[ 'UserInterfaceTooltipRole', [ { name: 'tooltip' } ] ],
]
```
### Element to AXObject
```javascript
import { elementAXObjects } from 'axobject-query';
```
HTML elements are mapped to their related AXConcepts concepts.
```javascript
[
[ { name: 'abbr' }, [ 'AbbrRole' ] ],
[ { name: 'article' }, [ 'ArticleRole' ] ],
[ { name: 'audio' }, [ 'AudioRole' ] ],
[ { name: 'blockquote' }, [ 'BlockquoteRole' ] ],
[ { name: 'button' }, [ 'ButtonRole' ] ],
[ { name: 'canvas' }, [ 'CanvasRole' ] ],
[ { name: 'caption' }, [ 'CaptionRole' ] ],
[ { name: 'td' }, [ 'CellRole' ] ],
[ { name: 'input', attributes: [ [Object] ] }, [ 'CheckBoxRole' ] ],
[ { name: 'input', attributes: [ [Object] ] }, [ 'ColorWellRole' ] ],
[ { name: 'th' }, [ 'ColumnHeaderRole' ] ],
[ { name: 'input', attributes: [ [Object] ] }, [ 'DateRole' ] ],
[ { name: 'input', attributes: [ [Object] ] }, [ 'DateTimeRole' ] ],
[ { name: 'dfn' }, [ 'DefinitionRole' ] ],
[ { name: 'dd' }, [ 'DescriptionListDetailRole' ] ],
[ { name: 'dl' }, [ 'DescriptionListRole' ] ],
[ { name: 'dt' }, [ 'DescriptionListTermRole' ] ],
[ { name: 'details' }, [ 'DetailsRole' ] ],
[ { name: 'dialog' }, [ 'DialogRole' ] ],
[ { name: 'dir' }, [ 'DirectoryRole' ] ],
[ { name: 'div' }, [ 'DivRole' ] ],
[ { name: 'embed' }, [ 'EmbeddedObjectRole' ] ],
[ { name: 'figcaption' }, [ 'FigcaptionRole' ] ],
[ { name: 'figure' }, [ 'FigureRole' ] ],
[ { name: 'footer' }, [ 'FooterRole' ] ],
[ { name: 'form' }, [ 'FormRole' ] ],
[ { name: 'h1' }, [ 'HeadingRole' ] ],
[ { name: 'h2' }, [ 'HeadingRole' ] ],
[ { name: 'h3' }, [ 'HeadingRole' ] ],
[ { name: 'h4' }, [ 'HeadingRole' ] ],
[ { name: 'h5' }, [ 'HeadingRole' ] ],
[ { name: 'h6' }, [ 'HeadingRole' ] ],
[ { name: 'iframe' }, [ 'IframeRole' ] ],
[ { name: 'img', attributes: [ [Object] ] }, [ 'ImageMapRole' ] ],
[ { name: 'img' }, [ 'ImageRole' ] ],
[ { name: 'input' }, [ 'InlineTextBoxRole', 'TextFieldRole' ] ],
[ { name: 'input', attributes: [ [Object] ] }, [ 'InputTimeRole' ] ],
[ { name: 'label' }, [ 'LabelRole' ] ],
[ { name: 'legend' }, [ 'LegendRole' ] ],
[ { name: 'br' }, [ 'LineBreakRole' ] ],
[ { name: 'a', attributes: [ [Object] ] }, [ 'LinkRole' ] ],
[ { name: 'option' }, [ 'ListBoxOptionRole' ] ],
[ { name: 'li' }, [ 'ListItemRole' ] ],
[ { name: 'ul' }, [ 'ListRole' ] ],
[ { name: 'ol' }, [ 'ListRole' ] ],
[ { name: 'main' }, [ 'MainRole' ] ],
[ { name: 'mark' }, [ 'MarkRole' ] ],
[ { name: 'marquee' }, [ 'MarqueeRole' ] ],
[ { name: 'menuitem' }, [ 'MenuItemRole' ] ],
[ { name: 'menu' }, [ 'MenuRole' ] ],
[ { name: 'meter' }, [ 'MeterRole' ] ],
[ { name: 'nav' }, [ 'NavigationRole' ] ],
[ { name: 'p' }, [ 'ParagraphRole' ] ],
[ { name: 'pre' }, [ 'PreRole' ] ],
[ { name: 'progress' }, [ 'ProgressIndicatorRole' ] ],
[ { name: 'input', attributes: [ [Object] ] }, [ 'RadioButtonRole' ] ],
[ { name: 'th', attributes: [ [Object] ] }, [ 'RowHeaderRole' ] ],
[ { name: 'tr' }, [ 'RowRole' ] ],
[ { name: 'ruby' }, [ 'RubyRole' ] ],
[ { name: 'input', attributes: [ [Object] ] }, [ 'SearchBoxRole' ] ],
[ { name: 'input', attributes: [ [Object] ] }, [ 'SliderRole' ] ],
[ { name: 'input', attributes: [ [Object] ] }, [ 'SpinButtonRole' ] ],
[ { name: 'table' }, [ 'TableRole' ] ],
[ { name: 'input' }, [ 'InlineTextBoxRole', 'TextFieldRole' ] ],
[ { name: 'input', attributes: [ [Object] ] }, [ 'TextFieldRole' ] ],
[ { name: 'time' }, [ 'TimeRole' ] ],
[ { name: 'video' }, [ 'VideoRole' ] ],
]
```
## License
Copyright (c) 2021 A11yance
@@ -0,0 +1 @@
{"version":3,"file":"isStackOverflowError.d.ts","sourceRoot":"","sources":["../../../../src/error/calculations/isStackOverflowError.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAmB5D"}
@@ -0,0 +1,21 @@
var isArray = require('./isArray'),
isKey = require('./_isKey'),
stringToPath = require('./_stringToPath'),
toString = require('./toString');
/**
* Casts `value` to a path array if it's not one.
*
* @private
* @param {*} value The value to inspect.
* @param {Object} [object] The object to query keys on.
* @returns {Array} Returns the cast property path array.
*/
function castPath(value, object) {
if (isArray(value)) {
return value;
}
return isKey(value, object) ? [value] : stringToPath(toString(value));
}
module.exports = castPath;
@@ -0,0 +1,30 @@
import createToPairs from './_createToPairs.js';
import keysIn from './keysIn.js';
/**
* Creates an array of own and inherited enumerable string keyed-value pairs
* for `object` which can be consumed by `_.fromPairs`. If `object` is a map
* or set, its entries are returned.
*
* @static
* @memberOf _
* @since 4.0.0
* @alias entriesIn
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the key-value pairs.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.toPairsIn(new Foo);
* // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
*/
var toPairsIn = createToPairs(keysIn);
export default toPairsIn;
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"F A B","2":"K D E wC"},B:{"1":"0 1 2 3 4 5 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 xC TC J ZB K D E F A B C L M 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 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 0C 1C"},D:{"1":"0 1 2 3 4 5 6 7 8 9 J ZB K D E F A B C L M 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"},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 F B 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 FD GD HD ID NC uC JD OC"},G:{"1":"E 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","16":"ZC KD"},H:{"1":"hD"},I:{"1":"TC J I iD jD kD lD vC mD nD"},J:{"1":"D A"},K:{"1":"A B C H NC uC OC"},L:{"1":"I"},M:{"1":"MC"},N:{"1":"A B"},O:{"1":"PC"},P:{"1":"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:{"1":"0D"},S:{"1":"1D 2D"}},B:2,C:"CSS namespaces",D:true};
@@ -0,0 +1,24 @@
The MIT License
Copyright (c) 2011 Dominic Tarr
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,235 @@
var tape = require('tape')
var through = require('through2')
var pumpify = require('./')
var stream = require('stream')
var duplexify = require('duplexify')
tape('basic', function(t) {
t.plan(3)
var pipeline = pumpify(
through(function(data, enc, cb) {
t.same(data.toString(), 'hello')
cb(null, data.toString().toUpperCase())
}),
through(function(data, enc, cb) {
t.same(data.toString(), 'HELLO')
cb(null, data.toString().toLowerCase())
})
)
pipeline.write('hello')
pipeline.on('data', function(data) {
t.same(data.toString(), 'hello')
t.end()
})
})
tape('3 times', function(t) {
t.plan(4)
var pipeline = pumpify(
through(function(data, enc, cb) {
t.same(data.toString(), 'hello')
cb(null, data.toString().toUpperCase())
}),
through(function(data, enc, cb) {
t.same(data.toString(), 'HELLO')
cb(null, data.toString().toLowerCase())
}),
through(function(data, enc, cb) {
t.same(data.toString(), 'hello')
cb(null, data.toString().toUpperCase())
})
)
pipeline.write('hello')
pipeline.on('data', function(data) {
t.same(data.toString(), 'HELLO')
t.end()
})
})
tape('destroy', function(t) {
var test = through()
test.destroy = function() {
t.ok(true)
t.end()
}
var pipeline = pumpify(through(), test)
pipeline.destroy()
})
tape('close', function(t) {
var test = through()
var pipeline = pumpify(through(), test)
pipeline.on('error', function(err) {
t.same(err.message, 'lol')
t.end()
})
test.emit('error', new Error('lol'))
})
tape('end waits for last one', function(t) {
var ran = false
var a = through()
var b = through()
var c = through(function(data, enc, cb) {
setTimeout(function() {
ran = true
cb()
}, 100)
})
var pipeline = pumpify(a, b, c)
pipeline.write('foo')
pipeline.end(function() {
t.ok(ran)
t.end()
})
t.ok(!ran)
})
tape('always wait for finish', function(t) {
var a = new stream.Readable()
a._read = function() {}
a.push('hello')
var pipeline = pumpify(a, through(), through())
var ran = false
pipeline.on('finish', function() {
t.ok(ran)
t.end()
})
setTimeout(function() {
ran = true
a.push(null)
}, 100)
})
tape('async', function(t) {
var pipeline = pumpify()
t.plan(4)
pipeline.write('hello')
pipeline.on('data', function(data) {
t.same(data.toString(), 'HELLO')
t.end()
})
setTimeout(function() {
pipeline.setPipeline(
through(function(data, enc, cb) {
t.same(data.toString(), 'hello')
cb(null, data.toString().toUpperCase())
}),
through(function(data, enc, cb) {
t.same(data.toString(), 'HELLO')
cb(null, data.toString().toLowerCase())
}),
through(function(data, enc, cb) {
t.same(data.toString(), 'hello')
cb(null, data.toString().toUpperCase())
})
)
}, 100)
})
tape('early destroy', function(t) {
var a = through()
var b = through()
var c = through()
b.destroy = function() {
t.ok(true)
t.end()
}
var pipeline = pumpify()
pipeline.destroy()
setTimeout(function() {
pipeline.setPipeline(a, b, c)
}, 100)
})
tape('preserves error', function (t) {
var a = through()
var b = through(function (data, enc, cb) {
cb(new Error('stop'))
})
var c = through()
var s = pumpify()
s.on('error', function (err) {
t.same(err.message, 'stop')
t.end()
})
s.setPipeline(a, b, c)
s.resume()
s.write('hi')
})
tape('preserves error again', function (t) {
var ws = new stream.Writable()
var rs = new stream.Readable({highWaterMark: 16})
ws._write = function (data, enc, cb) {
cb(null)
}
rs._read = function () {
process.nextTick(function () {
rs.push('hello world')
})
}
var pumpifyErr = pumpify(
through(),
through(function(chunk, _, cb) {
cb(new Error('test'))
}),
ws
)
rs.pipe(pumpifyErr)
.on('error', function (err) {
t.ok(err)
t.ok(err.message !== 'premature close', 'does not close with premature close')
t.end()
})
})
tape('returns error from duplexify', function (t) {
var a = through()
var b = duplexify()
var s = pumpify()
s.setPipeline(a, b)
s.on('error', function (err) {
t.same(err.message, 'stop')
t.end()
})
s.write('data')
// Test passes if `.end()` is not called
s.end()
b.setWritable(through())
setImmediate(function () {
b.destroy(new Error('stop'))
})
})
@@ -0,0 +1,3 @@
declare const _default: (value: unknown) => value is string;
export default _default;
//# sourceMappingURL=isString.d.ts.map
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('max', require('../max'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,70 @@
'use strict';
require('../auto');
var test = require('tape');
var forEach = require('for-each');
var shims = require('../');
forEach(shims, function (shim) {
var shimTests;
try {
shimTests = require('./' + shim); // eslint-disable-line global-require
} catch (e) {
test(shim + ': shimmed', { todo: true });
}
if (shimTests) {
shimTests.shimmed();
}
});
test('integration', function (t) {
var seenMapEveryMap = [];
var seenMapEveryEvery = [];
var mapEveryResult = Iterator.from([1, 2, 3, 4, 5]).map(function (x) {
seenMapEveryMap.push(x);
return x * x;
}).every(function (x) {
seenMapEveryEvery.push(x);
return x < 10;
});
t.equal(mapEveryResult, false, 'map + every: every predicate returned false nonzero times');
t.deepEqual(seenMapEveryMap, [1, 2, 3, 4], 'map + every, map: all values are seen until after the first one that is > 10 when squared');
t.deepEqual(seenMapEveryEvery, [1, 4, 9, 16], 'map + every, every: all values are seen until after the first one that is > 10 when squared');
var seenMapSomeMap = [];
var seenMapSomeSome = [];
var mapSomeResult = Iterator.from([1, 2, 3, 4, 5]).map(function (x) {
seenMapSomeMap.push(x);
return x * x;
}).some(function (x) {
seenMapSomeSome.push(x);
return x > 10;
});
t.equal(mapSomeResult, true, 'map + some: some predicate returned true nonzero times');
t.deepEqual(seenMapSomeMap, [1, 2, 3, 4], 'map + some, map: all values are seen until after the first one that is > 10 when squared');
t.deepEqual(seenMapSomeSome, [1, 4, 9, 16], 'map + some, some: all values are seen until after the first one that is > 10 when squared');
var seenMapFind = [];
var mapFindResult = Iterator.from([1, 2, 3, 4, 5]).map(function (x) {
seenMapFind.push(x);
return x * x;
}).find(function (x) {
return x > 10;
});
t.equal(mapFindResult, 16, 'map + find: find found the first mapped value over 10');
t.deepEqual(seenMapFind, [1, 2, 3, 4], 'map + find: all values are seen until after the first one that is > 10 when squared');
var seenFilterEvery = [];
var filterEveryResult = Iterator.from([1, 2, 3, 4, 5]).filter(function (x) {
seenFilterEvery.push(x);
return x;
}).every(function (x) {
return x <= 3;
});
t.equal(filterEveryResult, false, 'filter + every: every predicate returned false nonzero times');
t.deepEqual(seenMapFind, [1, 2, 3, 4], 'filter + every: all values are seen until after the first one that is > 10 when squared');
t.end();
});
@@ -0,0 +1,34 @@
import {useRef as $9vW05$useRef, useEffect as $9vW05$useEffect} 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 $4f58c5f72bcf79f7$export$496315a1608d9602(effect, dependencies) {
const isInitialMount = (0, $9vW05$useRef)(true);
const lastDeps = (0, $9vW05$useRef)(null);
(0, $9vW05$useEffect)(()=>{
isInitialMount.current = true;
return ()=>{
isInitialMount.current = false;
};
}, []);
(0, $9vW05$useEffect)(()=>{
let prevDeps = lastDeps.current;
if (isInitialMount.current) isInitialMount.current = false;
else if (!prevDeps || dependencies.some((dep, i)=>!Object.is(dep, prevDeps[i]))) effect();
lastDeps.current = dependencies;
// eslint-disable-next-line react-hooks/exhaustive-deps
}, dependencies);
}
export {$4f58c5f72bcf79f7$export$496315a1608d9602 as useUpdateEffect};
//# sourceMappingURL=useUpdateEffect.module.js.map
@@ -0,0 +1,584 @@
/**
* @fileoverview Common used propTypes detection functionality.
*/
'use strict';
const values = require('object.values');
const astUtil = require('./ast');
const componentUtil = require('./componentUtil');
const testReactVersion = require('./version').testReactVersion;
const ast = require('./ast');
const eslintUtil = require('./eslint');
const getScope = eslintUtil.getScope;
const getSourceCode = eslintUtil.getSourceCode;
// ------------------------------------------------------------------------------
// Constants
// ------------------------------------------------------------------------------
const LIFE_CYCLE_METHODS = ['componentWillReceiveProps', 'shouldComponentUpdate', 'componentWillUpdate', 'componentDidUpdate'];
const ASYNC_SAFE_LIFE_CYCLE_METHODS = ['getDerivedStateFromProps', 'getSnapshotBeforeUpdate', 'UNSAFE_componentWillReceiveProps', 'UNSAFE_componentWillUpdate'];
function createPropVariables() {
/** @type {Map<string, string[]>} Maps the variable to its definition. `props.a.b` is stored as `['a', 'b']` */
let propVariables = new Map();
let hasBeenWritten = false;
const stack = [{ propVariables, hasBeenWritten }];
return {
pushScope() {
// popVariables is not copied until first write.
stack.push({ propVariables, hasBeenWritten: false });
},
popScope() {
stack.pop();
propVariables = stack[stack.length - 1].propVariables;
hasBeenWritten = stack[stack.length - 1].hasBeenWritten;
},
/**
* Add a variable name to the current scope
* @param {string} name
* @param {string[]} allNames Example: `props.a.b` should be formatted as `['a', 'b']`
* @returns {Map<string, string[]>}
*/
set(name, allNames) {
if (!hasBeenWritten) {
// copy on write
propVariables = new Map(propVariables);
Object.assign(stack[stack.length - 1], { propVariables, hasBeenWritten: true });
stack[stack.length - 1].hasBeenWritten = true;
}
return propVariables.set(name, allNames);
},
/**
* Get the definition of a variable.
* @param {string} name
* @returns {string[]} Example: `props.a.b` is represented by `['a', 'b']`
*/
get(name) {
return propVariables.get(name);
},
};
}
/**
* Checks if the string is one of `props`, `nextProps`, or `prevProps`
* @param {string} name The AST node being checked.
* @returns {boolean} True if the prop name matches
*/
function isCommonVariableNameForProps(name) {
return name === 'props' || name === 'nextProps' || name === 'prevProps';
}
/**
* Checks if the component must be validated
* @param {Object} component The component to process
* @returns {boolean} True if the component must be validated, false if not.
*/
function mustBeValidated(component) {
return !!(component && !component.ignorePropsValidation);
}
/**
* Check if we are in a lifecycle method
* @param {object} context
* @param {ASTNode} node The AST node being checked.
* @param {boolean} checkAsyncSafeLifeCycles
* @return {boolean} true if we are in a class constructor, false if not
*/
function inLifeCycleMethod(context, node, checkAsyncSafeLifeCycles) {
let scope = getScope(context, node);
while (scope) {
if (scope.block && scope.block.parent && scope.block.parent.key) {
const name = scope.block.parent.key.name;
if (LIFE_CYCLE_METHODS.indexOf(name) >= 0) {
return true;
}
if (checkAsyncSafeLifeCycles && ASYNC_SAFE_LIFE_CYCLE_METHODS.indexOf(name) >= 0) {
return true;
}
}
scope = scope.upper;
}
return false;
}
/**
* Returns true if the given node is a React Component lifecycle method
* @param {ASTNode} node The AST node being checked.
* @param {boolean} checkAsyncSafeLifeCycles
* @return {boolean} True if the node is a lifecycle method
*/
function isNodeALifeCycleMethod(node, checkAsyncSafeLifeCycles) {
if (node.key) {
if (node.kind === 'constructor') {
return true;
}
const nodeKeyName = node.key.name;
if (typeof nodeKeyName !== 'string') {
return false;
}
if (LIFE_CYCLE_METHODS.indexOf(nodeKeyName) >= 0) {
return true;
}
if (checkAsyncSafeLifeCycles && ASYNC_SAFE_LIFE_CYCLE_METHODS.indexOf(nodeKeyName) >= 0) {
return true;
}
}
return false;
}
/**
* Returns true if the given node is inside a React Component lifecycle
* method.
* @param {ASTNode} node The AST node being checked.
* @param {boolean} checkAsyncSafeLifeCycles
* @return {boolean} True if the node is inside a lifecycle method
*/
function isInLifeCycleMethod(node, checkAsyncSafeLifeCycles) {
if (
(node.type === 'MethodDefinition' || node.type === 'Property')
&& isNodeALifeCycleMethod(node, checkAsyncSafeLifeCycles)
) {
return true;
}
if (node.parent) {
return isInLifeCycleMethod(node.parent, checkAsyncSafeLifeCycles);
}
return false;
}
/**
* Check if a function node is a setState updater
* @param {ASTNode} node a function node
* @return {boolean}
*/
function isSetStateUpdater(node) {
const unwrappedParentCalleeNode = astUtil.isCallExpression(node.parent)
&& ast.unwrapTSAsExpression(node.parent.callee);
return unwrappedParentCalleeNode
&& unwrappedParentCalleeNode.property
&& unwrappedParentCalleeNode.property.name === 'setState'
// Make sure we are in the updater not the callback
&& node.parent.arguments[0] === node;
}
function isPropArgumentInSetStateUpdater(context, node, name) {
if (typeof name !== 'string') {
return;
}
let scope = getScope(context, node);
while (scope) {
const unwrappedParentCalleeNode = scope.block
&& astUtil.isCallExpression(scope.block.parent)
&& ast.unwrapTSAsExpression(scope.block.parent.callee);
if (
unwrappedParentCalleeNode
&& unwrappedParentCalleeNode.property
&& unwrappedParentCalleeNode.property.name === 'setState'
// Make sure we are in the updater not the callback
&& scope.block.parent.arguments[0].range[0] === scope.block.range[0]
&& scope.block.parent.arguments[0].params
&& scope.block.parent.arguments[0].params.length > 1
) {
return scope.block.parent.arguments[0].params[1].name === name;
}
scope = scope.upper;
}
return false;
}
/**
* @param {Context} context
* @param {ASTNode} node
* @returns {boolean}
*/
function isInClassComponent(context, node) {
return !!(componentUtil.getParentES6Component(context, node) || componentUtil.getParentES5Component(context, node));
}
/**
* Checks if the node is `this.props`
* @param {ASTNode|undefined} node
* @returns {boolean}
*/
function isThisDotProps(node) {
return !!node
&& node.type === 'MemberExpression'
&& ast.unwrapTSAsExpression(node.object).type === 'ThisExpression'
&& node.property.name === 'props';
}
/**
* Checks if the prop has spread operator.
* @param {object} context
* @param {ASTNode} node The AST node being marked.
* @returns {boolean} True if the prop has spread operator, false if not.
*/
function hasSpreadOperator(context, node) {
const tokens = getSourceCode(context).getTokens(node);
return tokens.length && tokens[0].value === '...';
}
/**
* Checks if the node is a propTypes usage of the form `this.props.*`, `props.*`, `prevProps.*`, or `nextProps.*`.
* @param {Context} context
* @param {ASTNode} node
* @param {Object} utils
* @param {boolean} checkAsyncSafeLifeCycles
* @returns {boolean}
*/
function isPropTypesUsageByMemberExpression(context, node, utils, checkAsyncSafeLifeCycles) {
const unwrappedObjectNode = ast.unwrapTSAsExpression(node.object);
if (isInClassComponent(context, node)) {
// this.props.*
if (isThisDotProps(unwrappedObjectNode)) {
return true;
}
// props.* or prevProps.* or nextProps.*
if (
isCommonVariableNameForProps(unwrappedObjectNode.name)
&& (inLifeCycleMethod(context, node, checkAsyncSafeLifeCycles) || astUtil.inConstructor(context, node))
) {
return true;
}
// this.setState((_, props) => props.*))
if (isPropArgumentInSetStateUpdater(context, node, unwrappedObjectNode.name)) {
return true;
}
return false;
}
// props.* in function component
return unwrappedObjectNode.name === 'props' && !ast.isAssignmentLHS(node);
}
/**
* Retrieve the name of a property node
* @param {Context} context
* @param {ASTNode} node The AST node with the property.
* @param {Object} utils
* @param {boolean} checkAsyncSafeLifeCycles
* @return {string|undefined} the name of the property or undefined if not found
*/
function getPropertyName(context, node, utils, checkAsyncSafeLifeCycles) {
const property = node.property;
if (property) {
switch (property.type) {
case 'Identifier':
if (node.computed) {
return '__COMPUTED_PROP__';
}
return property.name;
case 'MemberExpression':
return;
case 'Literal':
// Accept computed properties that are literal strings
if (typeof property.value === 'string') {
return property.value;
}
// Accept number as well but only accept props[123]
if (typeof property.value === 'number') {
if (isPropTypesUsageByMemberExpression(context, node, utils, checkAsyncSafeLifeCycles)) {
return property.raw;
}
}
// falls through
default:
if (node.computed) {
return '__COMPUTED_PROP__';
}
break;
}
}
}
module.exports = function usedPropTypesInstructions(context, components, utils) {
const checkAsyncSafeLifeCycles = testReactVersion(context, '>= 16.3.0');
const propVariables = createPropVariables();
const pushScope = propVariables.pushScope;
const popScope = propVariables.popScope;
/**
* Mark a prop type as used
* @param {ASTNode} node The AST node being marked.
* @param {string[]} [parentNames]
*/
function markPropTypesAsUsed(node, parentNames) {
parentNames = parentNames || [];
let type;
let name;
let allNames;
let properties;
switch (node.type) {
case 'OptionalMemberExpression':
case 'MemberExpression':
name = getPropertyName(context, node, utils, checkAsyncSafeLifeCycles);
if (name) {
allNames = parentNames.concat(name);
if (
// Match props.foo.bar, don't match bar[props.foo]
node.parent.type === 'MemberExpression'
&& node.parent.object === node
) {
markPropTypesAsUsed(node.parent, allNames);
}
// Handle the destructuring part of `const {foo} = props.a.b`
if (
node.parent.type === 'VariableDeclarator'
&& node.parent.id.type === 'ObjectPattern'
) {
node.parent.id.parent = node.parent; // patch for bug in eslint@4 in which ObjectPattern has no parent
markPropTypesAsUsed(node.parent.id, allNames);
}
// const a = props.a
if (
node.parent.type === 'VariableDeclarator'
&& node.parent.id.type === 'Identifier'
) {
propVariables.set(node.parent.id.name, allNames);
}
// Do not mark computed props as used.
type = name !== '__COMPUTED_PROP__' ? 'direct' : null;
}
break;
case 'ArrowFunctionExpression':
case 'FunctionDeclaration':
case 'FunctionExpression': {
if (node.params.length === 0) {
break;
}
type = 'destructuring';
const propParam = isSetStateUpdater(node) ? node.params[1] : node.params[0];
properties = propParam.type === 'AssignmentPattern'
? propParam.left.properties
: propParam.properties;
break;
}
case 'ObjectPattern':
type = 'destructuring';
properties = node.properties;
break;
case 'TSEmptyBodyFunctionExpression':
break;
default:
throw new Error(`${node.type} ASTNodes are not handled by markPropTypesAsUsed`);
}
const component = components.get(utils.getParentComponent(node));
const usedPropTypes = (component && component.usedPropTypes) || [];
let ignoreUnusedPropTypesValidation = (component && component.ignoreUnusedPropTypesValidation) || false;
switch (type) {
case 'direct': {
// Ignore Object methods
if (name in Object.prototype) {
break;
}
const reportedNode = node.property;
usedPropTypes.push({
name,
allNames,
node: reportedNode,
});
break;
}
case 'destructuring': {
for (let k = 0, l = (properties || []).length; k < l; k++) {
if (hasSpreadOperator(context, properties[k]) || properties[k].computed) {
ignoreUnusedPropTypesValidation = true;
break;
}
const propName = ast.getKeyValue(context, properties[k]);
if (!propName || properties[k].type !== 'Property') {
break;
}
usedPropTypes.push({
allNames: parentNames.concat([propName]),
name: propName,
node: properties[k],
});
if (properties[k].value.type === 'ObjectPattern') {
markPropTypesAsUsed(properties[k].value, parentNames.concat([propName]));
} else if (properties[k].value.type === 'Identifier') {
propVariables.set(properties[k].value.name, parentNames.concat(propName));
}
}
break;
}
default:
break;
}
components.set(component ? component.node : node, {
usedPropTypes,
ignoreUnusedPropTypesValidation,
});
}
/**
* @param {ASTNode} node We expect either an ArrowFunctionExpression,
* FunctionDeclaration, or FunctionExpression
*/
function markDestructuredFunctionArgumentsAsUsed(node) {
const param = node.params && isSetStateUpdater(node) ? node.params[1] : node.params[0];
const destructuring = param && (
param.type === 'ObjectPattern'
|| ((param.type === 'AssignmentPattern') && (param.left.type === 'ObjectPattern'))
);
if (destructuring && (components.get(node) || components.get(node.parent))) {
markPropTypesAsUsed(node);
}
}
function handleSetStateUpdater(node) {
if (!node.params || node.params.length < 2 || !isSetStateUpdater(node)) {
return;
}
markPropTypesAsUsed(node);
}
/**
* Handle both stateless functions and setState updater functions.
* @param {ASTNode} node We expect either an ArrowFunctionExpression,
* FunctionDeclaration, or FunctionExpression
*/
function handleFunctionLikeExpressions(node) {
pushScope();
handleSetStateUpdater(node);
markDestructuredFunctionArgumentsAsUsed(node);
}
function handleCustomValidators(component) {
const propTypes = component.declaredPropTypes;
if (!propTypes) {
return;
}
Object.keys(propTypes).forEach((key) => {
const node = propTypes[key].node;
if (node && node.value && astUtil.isFunctionLikeExpression(node.value)) {
markPropTypesAsUsed(node.value);
}
});
}
return {
VariableDeclarator(node) {
const unwrappedInitNode = ast.unwrapTSAsExpression(node.init);
// let props = this.props
if (isThisDotProps(unwrappedInitNode) && isInClassComponent(context, node) && node.id.type === 'Identifier') {
propVariables.set(node.id.name, []);
}
// Only handles destructuring
if (node.id.type !== 'ObjectPattern' || !unwrappedInitNode) {
return;
}
// let {props: {firstname}} = this
const propsProperty = node.id.properties.find((property) => (
property.key
&& (property.key.name === 'props' || property.key.value === 'props')
));
if (unwrappedInitNode.type === 'ThisExpression' && propsProperty && propsProperty.value.type === 'ObjectPattern') {
markPropTypesAsUsed(propsProperty.value);
return;
}
// let {props} = this
if (unwrappedInitNode.type === 'ThisExpression' && propsProperty && propsProperty.value.name === 'props') {
propVariables.set('props', []);
return;
}
// let {firstname} = props
if (
isCommonVariableNameForProps(unwrappedInitNode.name)
&& (utils.getParentStatelessComponent(node) || isInLifeCycleMethod(node, checkAsyncSafeLifeCycles))
) {
markPropTypesAsUsed(node.id);
return;
}
// let {firstname} = this.props
if (isThisDotProps(unwrappedInitNode) && isInClassComponent(context, node)) {
markPropTypesAsUsed(node.id);
return;
}
// let {firstname} = thing, where thing is defined by const thing = this.props.**.*
if (propVariables.get(unwrappedInitNode.name)) {
markPropTypesAsUsed(node.id, propVariables.get(unwrappedInitNode.name));
}
},
FunctionDeclaration: handleFunctionLikeExpressions,
ArrowFunctionExpression: handleFunctionLikeExpressions,
FunctionExpression: handleFunctionLikeExpressions,
'FunctionDeclaration:exit': popScope,
'ArrowFunctionExpression:exit': popScope,
'FunctionExpression:exit': popScope,
JSXSpreadAttribute(node) {
const component = components.get(utils.getParentComponent(node));
components.set(component ? component.node : node, {
ignoreUnusedPropTypesValidation: node.argument.type !== 'ObjectExpression',
});
},
'MemberExpression, OptionalMemberExpression'(node) {
if (isPropTypesUsageByMemberExpression(context, node, utils, checkAsyncSafeLifeCycles)) {
markPropTypesAsUsed(node);
return;
}
const propVariable = propVariables.get(ast.unwrapTSAsExpression(node.object).name);
if (propVariable) {
markPropTypesAsUsed(node, propVariable);
}
},
ObjectPattern(node) {
// If the object pattern is a destructured props object in a lifecycle
// method -- mark it for used props.
if (isNodeALifeCycleMethod(node.parent.parent, checkAsyncSafeLifeCycles) && node.properties.length > 0) {
markPropTypesAsUsed(node.parent);
}
},
'Program:exit'() {
values(components.list())
.filter((component) => mustBeValidated(component))
.forEach((component) => {
handleCustomValidators(component);
});
},
};
};
@@ -0,0 +1,5 @@
import type { TSchema } from '../../type/schema/index.mjs';
/** `[Mutable]` Converts any type mismatched values to their target type if a reasonable conversion is possible. */
export declare function Convert(schema: TSchema, references: TSchema[], value: unknown): unknown;
/** `[Mutable]` Converts any type mismatched values to their target type if a reasonable conversion is possible. */
export declare function Convert(schema: TSchema, value: unknown): unknown;
@@ -0,0 +1,33 @@
import { CursorOptions, CursorResult, Options, SupportInfo } from "./index.js";
/**
* formatWithCursor both formats the code, and translates a cursor position from unformatted code to formatted code.
* This is useful for editor integrations, to prevent the cursor from moving when code is formatted
*
* The cursorOffset option should be provided, to specify where the cursor is.
*
* ```js
* await prettier.formatWithCursor(" 1", { cursorOffset: 2, parser: "babel" });
* ```
* `-> { formatted: "1;\n", cursorOffset: 1 }`
*/
export function formatWithCursor(
source: string,
options: CursorOptions,
): Promise<CursorResult>;
/**
* `format` is used to format text using Prettier. [Options](https://prettier.io/docs/options) may be provided to override the defaults.
*/
export function format(source: string, options?: Options): Promise<string>;
/**
* `check` checks to see if the file has been formatted with Prettier given those options and returns a `Boolean`.
* This is similar to the `--list-different` parameter in the CLI and is useful for running Prettier in CI scenarios.
*/
export function check(source: string, options?: Options): Promise<boolean>;
/**
* Returns an object representing the parsers, languages and file types Prettier supports for the current version.
*/
export function getSupportInfo(): Promise<SupportInfo>;
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E wC","8":"F A B"},B:{"1":"0 1 2 3 4 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","8":"C L M G N","194":"5 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 J ZB K D E F A B C L M 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 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 0C 1C","2":"xC TC NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC"},D:{"1":"0 1 2 6 7 8 9 J ZB K D E F A B C L M 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","194":"3 4 5 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC"},E:{"2":"J ZB K D E F A B C L M G 2C ZC 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"},F:{"1":"6 7 8 9 B 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 HD ID NC uC JD OC","2":"F FD GD","194":"0 1 2 3 4 5 p q r s t u v w x y z"},G:{"2":"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:{"2":"D A"},K:{"2":"A B C H NC uC OC"},L:{"2":"I"},M:{"1":"MC"},N:{"8":"A B"},O:{"1":"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:{"1":"1D 2D"}},B:6,C:"Ogg/Theora video format",D:true};
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('invertBy', require('../invertBy'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1 @@
{"version":3,"file":"jsx-max-props-per-line.d.ts","sourceRoot":"","sources":["jsx-max-props-per-line.js"],"names":[],"mappings":"wBA0BW,OAAO,QAAQ,EAAE,IAAI,CAAC,UAAU"}
@@ -0,0 +1,22 @@
/*! *****************************************************************************
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="es5" />
/// <reference lib="dom" />
/// <reference lib="webworker.importscripts" />
/// <reference lib="scripthost" />
@@ -0,0 +1 @@
{"name":"file-uri-to-path","version":"1.0.0","requiresBuild":false,"files":{"package.json":{"checkedAt":1794532120543,"integrity":"sha512-djw3J3Pwk95g/b4L3V0LY2KILiLq6+1R9w6lD6MIdBe1xRfqnqBXtW1A8BnOoEKm6MOHNW2hubnTnCpfFue11A==","mode":420,"size":717},".npmignore":{"checkedAt":1794532120543,"integrity":"sha512-sB1wSpwOk5pAT4PMytWaFt/IXfeteUdev5/KbNRTDGsONPFtCBhYJ8qJba7YheO8fdtdDll5pobYuMbpVdWqlg==","mode":420,"size":14},"README.md":{"checkedAt":1794532120543,"integrity":"sha512-A1w/1JPTeqjC0KAihtw8nr5VrcXJ1Kb258OCi68i+ZutpILc+R9Uw8jcyBssPGeCfBrfqdA29Vw0LPnBUM8ciQ==","mode":420,"size":2073},"LICENSE":{"checkedAt":1794532120543,"integrity":"sha512-d+zg0DN8QJdpYWh82bKucj/tn451y21EMYuTcmv43mQZGP4ORiztNq/MhTO+KyYfG8i8YxuWS9raWVKRnCtYdw==","mode":420,"size":1083},"index.js":{"checkedAt":1794532120543,"integrity":"sha512-c4kIH787FvCtmfVWM3Z5voleBJMONr/I+Zcg4BPyi2i91FefEetB3UzHpko27Cam5lOdQtWIhpb3Hn0tnIeE3A==","mode":420,"size":1723},".travis.yml":{"checkedAt":1794532120543,"integrity":"sha512-ReJKr+t3sWo4ZWmJqtQ/htl363rDmFOlEb9i2V9fKHuum2+7wk/JJBzPjgZB6Omn2HmT10JJ3ebVybHwMJM91A==","mode":420,"size":472},"index.d.ts":{"checkedAt":1794532120543,"integrity":"sha512-cJBfP34JsbwEpRDOiTvRV5DPSK2QMQihV29CudxT5e2boioJZpWBY/yFgmfssomnyEMbdyblEvb9C2t/PSB4EA==","mode":420,"size":77},"History.md":{"checkedAt":1794532120544,"integrity":"sha512-ie2qqHO3TUJb0MOWhgUXgR6xYyHN3LNuwkBn03ldpygXl9gOMOwWp6XeuDGnNeGnU1B1ZJa2cmd3/IOHvNMH6A==","mode":420,"size":433},"test/test.js":{"checkedAt":1794532120544,"integrity":"sha512-JW0gTdne3NqqxZJbMYgvJFZ15ODFGOnhihKcH6uMQplGck+6nQRcdsUivGu1rz7i7vMteD8sa9tottNQRCgkOw==","mode":420,"size":666},"test/tests.json":{"checkedAt":1794532120544,"integrity":"sha512-RNf/1X2lfpabTW3VSfjwYB1cevbqHsWM03us9sHxouqHpgnt27qNs+UM2azxrlrh3nRZLEh+txSyYzMHge7WfQ==","mode":420,"size":810}}}
@@ -0,0 +1,95 @@
// src/index.ts
var d = {
reset: [0, 0],
bold: [1, 22, "\x1B[22m\x1B[1m"],
dim: [2, 22, "\x1B[22m\x1B[2m"],
italic: [3, 23],
underline: [4, 24],
inverse: [7, 27],
hidden: [8, 28],
strikethrough: [9, 29],
black: [30, 39],
red: [31, 39],
green: [32, 39],
yellow: [33, 39],
blue: [34, 39],
magenta: [35, 39],
cyan: [36, 39],
white: [37, 39],
gray: [90, 39],
bgBlack: [40, 49],
bgRed: [41, 49],
bgGreen: [42, 49],
bgYellow: [43, 49],
bgBlue: [44, 49],
bgMagenta: [45, 49],
bgCyan: [46, 49],
bgWhite: [47, 49],
blackBright: [90, 39],
redBright: [91, 39],
greenBright: [92, 39],
yellowBright: [93, 39],
blueBright: [94, 39],
magentaBright: [95, 39],
cyanBright: [96, 39],
whiteBright: [97, 39],
bgBlackBright: [100, 49],
bgRedBright: [101, 49],
bgGreenBright: [102, 49],
bgYellowBright: [103, 49],
bgBlueBright: [104, 49],
bgMagentaBright: [105, 49],
bgCyanBright: [106, 49],
bgWhiteBright: [107, 49]
};
function g(e) {
return String(e);
}
g.open = "";
g.close = "";
function B() {
let e = {
isColorSupported: !1,
reset: g
};
for (let n in d)
e[n] = g;
return e;
}
function h() {
let e = typeof process != "undefined" ? process : void 0, n = (e == null ? void 0 : e.env) || {}, a = n.FORCE_TTY !== "false", i = (e == null ? void 0 : e.argv) || [];
return !("NO_COLOR" in n || i.includes("--no-color")) && ("FORCE_COLOR" in n || i.includes("--color") || (e == null ? void 0 : e.platform) === "win32" || a && n.TERM !== "dumb" || "CI" in n) || typeof window != "undefined" && !!window.chrome;
}
function f() {
let e = h(), n = (r, t, u, o) => {
let l = "", s = 0;
do
l += r.substring(s, o) + u, s = o + t.length, o = r.indexOf(t, s);
while (~o);
return l + r.substring(s);
}, a = (r, t, u = r) => {
let o = (l) => {
let s = String(l), b = s.indexOf(t, r.length);
return ~b ? r + n(s, t, u, b) + t : r + s + t;
};
return o.open = r, o.close = t, o;
}, i = {
isColorSupported: e
}, c = (r) => `\x1B[${r}m`;
for (let r in d) {
let t = d[r];
i[r] = e ? a(
c(t[0]),
c(t[1]),
t[2]
) : g;
}
return i;
}
var C = f();
export {
f as createColors,
C as default,
B as getDefaultColors,
h as isSupported
};
@@ -0,0 +1,5 @@
'use strict'
module.exports = function spin (spinstr, spun) {
return spinstr[spun % spinstr.length]
}
@@ -0,0 +1,98 @@
import {
isBlockScopedDeclaration,
isFunctionScopedDeclaration,
isNonTopLevelDeclaration,
} from "./parser/tokenizer";
import {TokenType as tt} from "./parser/tokenizer/types";
/**
* Traverse the given tokens and modify them if necessary to indicate that some names shadow global
* variables.
*/
export default function identifyShadowedGlobals(
tokens,
scopes,
globalNames,
) {
if (!hasShadowedGlobals(tokens, globalNames)) {
return;
}
markShadowedGlobals(tokens, scopes, globalNames);
}
/**
* We can do a fast up-front check to see if there are any declarations to global names. If not,
* then there's no point in computing scope assignments.
*/
// Exported for testing.
export function hasShadowedGlobals(tokens, globalNames) {
for (const token of tokens.tokens) {
if (
token.type === tt.name &&
!token.isType &&
isNonTopLevelDeclaration(token) &&
globalNames.has(tokens.identifierNameForToken(token))
) {
return true;
}
}
return false;
}
function markShadowedGlobals(
tokens,
scopes,
globalNames,
) {
const scopeStack = [];
let scopeIndex = scopes.length - 1;
// Scopes were generated at completion time, so they're sorted by end index, so we can maintain a
// good stack by going backwards through them.
for (let i = tokens.tokens.length - 1; ; i--) {
while (scopeStack.length > 0 && scopeStack[scopeStack.length - 1].startTokenIndex === i + 1) {
scopeStack.pop();
}
while (scopeIndex >= 0 && scopes[scopeIndex].endTokenIndex === i + 1) {
scopeStack.push(scopes[scopeIndex]);
scopeIndex--;
}
// Process scopes after the last iteration so we can make sure we pop all of them.
if (i < 0) {
break;
}
const token = tokens.tokens[i];
const name = tokens.identifierNameForToken(token);
if (scopeStack.length > 1 && !token.isType && token.type === tt.name && globalNames.has(name)) {
if (isBlockScopedDeclaration(token)) {
markShadowedForScope(scopeStack[scopeStack.length - 1], tokens, name);
} else if (isFunctionScopedDeclaration(token)) {
let stackIndex = scopeStack.length - 1;
while (stackIndex > 0 && !scopeStack[stackIndex].isFunctionScope) {
stackIndex--;
}
if (stackIndex < 0) {
throw new Error("Did not find parent function scope.");
}
markShadowedForScope(scopeStack[stackIndex], tokens, name);
}
}
}
if (scopeStack.length > 0) {
throw new Error("Expected empty scope stack after processing file.");
}
}
function markShadowedForScope(scope, tokens, name) {
for (let i = scope.startTokenIndex; i < scope.endTokenIndex; i++) {
const token = tokens.tokens[i];
if (
(token.type === tt.name || token.type === tt.jsxName) &&
tokens.identifierNameForToken(token) === name
) {
token.shadowsGlobal = true;
}
}
}
@@ -0,0 +1,16 @@
const toNumber = require("strnum");
class numParser{
constructor(options){
this.options = options;
}
parse(val){
if (typeof val === 'string') {
val = toNumber(val,this.options);
}
return val;
}
}
module.exports = numParser;
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,eAAe,CAAC,qFAAa,CAAC;AAClD","sources":["packages/@react-aria/breadcrumbs/intl/ar-AE.json"],"sourcesContent":["{\n \"breadcrumbs\": \"عناصر الواجهة\"\n}\n"],"names":[],"version":3,"file":"ar-AE.main.js.map"}
@@ -0,0 +1,100 @@
/*
* 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 {AriaCheckboxGroupItemProps} from '@react-types/checkbox';
import {CheckboxAria, useCheckbox} from './useCheckbox';
import {checkboxGroupData} from './utils';
import {CheckboxGroupState} from '@react-stately/checkbox';
import {DEFAULT_VALIDATION_RESULT, privateValidationStateProp, useFormValidationState} from '@react-stately/form';
import {RefObject, ValidationResult} from '@react-types/shared';
import {useEffect, useRef} from 'react';
import {useToggleState} from '@react-stately/toggle';
/**
* Provides the behavior and accessibility implementation for a checkbox component contained within a checkbox group.
* Checkbox groups allow users to select multiple items from a list of options.
* @param props - Props for the checkbox.
* @param state - State for the checkbox, as returned by `useCheckboxGroupState`.
* @param inputRef - A ref for the HTML input element.
*/
export function useCheckboxGroupItem(props: AriaCheckboxGroupItemProps, state: CheckboxGroupState, inputRef: RefObject<HTMLInputElement | null>): CheckboxAria {
const toggleState = useToggleState({
isReadOnly: props.isReadOnly || state.isReadOnly,
isSelected: state.isSelected(props.value),
onChange(isSelected) {
if (isSelected) {
state.addValue(props.value);
} else {
state.removeValue(props.value);
}
if (props.onChange) {
props.onChange(isSelected);
}
}
});
let {name, descriptionId, errorMessageId, validationBehavior} = checkboxGroupData.get(state)!;
validationBehavior = props.validationBehavior ?? validationBehavior;
// Local validation for this checkbox.
let {realtimeValidation} = useFormValidationState({
...props,
value: toggleState.isSelected,
// Server validation is handled at the group level.
name: undefined,
validationBehavior: 'aria'
});
// Update the checkbox group state when realtime validation changes.
let nativeValidation = useRef(DEFAULT_VALIDATION_RESULT);
let updateValidation = () => {
state.setInvalid(props.value, realtimeValidation.isInvalid ? realtimeValidation : nativeValidation.current);
};
useEffect(updateValidation);
// Combine group and checkbox level validation.
let combinedRealtimeValidation = state.realtimeValidation.isInvalid ? state.realtimeValidation : realtimeValidation;
let displayValidation = validationBehavior === 'native' ? state.displayValidation : combinedRealtimeValidation;
let res = useCheckbox({
...props,
isReadOnly: props.isReadOnly || state.isReadOnly,
isDisabled: props.isDisabled || state.isDisabled,
name: props.name || name,
isRequired: props.isRequired ?? state.isRequired,
validationBehavior,
[privateValidationStateProp]: {
realtimeValidation: combinedRealtimeValidation,
displayValidation,
resetValidation: state.resetValidation,
commitValidation: state.commitValidation,
updateValidation(v: ValidationResult) {
nativeValidation.current = v;
updateValidation();
}
}
}, toggleState, inputRef);
return {
...res,
inputProps: {
...res.inputProps,
'aria-describedby': [
props['aria-describedby'],
state.isInvalid ? errorMessageId : null,
descriptionId
].filter(Boolean).join(' ') || undefined
}
};
}
@@ -0,0 +1 @@
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],a):(e="undefined"!=typeof globalThis?globalThis:e||self).dayjs_locale_bi=a(e.dayjs)}(this,(function(e){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=a(e),_={name:"bi",weekdays:"Sande_Mande_Tusde_Wenesde_Tosde_Fraede_Sarade".split("_"),months:"Januari_Februari_Maj_Eprel_Mei_Jun_Julae_Okis_Septemba_Oktoba_Novemba_Disemba".split("_"),weekStart:1,weekdaysShort:"San_Man_Tus_Wen_Tos_Frae_Sar".split("_"),monthsShort:"Jan_Feb_Maj_Epr_Mai_Jun_Jul_Oki_Sep_Okt_Nov_Dis".split("_"),weekdaysMin:"San_Ma_Tu_We_To_Fr_Sar".split("_"),ordinal:function(e){return e},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"lo %s",past:"%s bifo",s:"sam seken",m:"wan minit",mm:"%d minit",h:"wan haoa",hh:"%d haoa",d:"wan dei",dd:"%d dei",M:"wan manis",MM:"%d manis",y:"wan yia",yy:"%d yia"}};return n.default.locale(_,null,!0),_}));
@@ -0,0 +1 @@
{"version":3,"file":"character-escape.d.ts","sourceRoot":"","sources":["character-escape.js"],"names":[],"mappings":"AAaA,wBAAwB;AACxB,8BADW,SAAS,CAInB;+BAXS,sBAAsB"}
@@ -0,0 +1,59 @@
'use strict';
var test = require('tape');
var debug = require('object-inspect');
var forEach = require('for-each');
var isWeakSet = require('..');
test('non-collections', function (t) {
forEach([
null,
undefined,
true,
false,
42,
0,
-0,
NaN,
Infinity,
'',
'foo',
/a/g,
[],
{},
function () {}
], function (nonCollection) {
t.equal(isWeakSet(nonCollection), false, debug(nonCollection) + ' is not a WeakSet');
});
t.end();
});
test('Maps', { skip: typeof Map !== 'function' }, function (t) {
var m = new Map();
t.equal(isWeakSet(m), false, debug(m) + ' is not a WeakSet');
t.end();
});
test('Sets', { skip: typeof Set !== 'function' }, function (t) {
var s = new Set();
t.equal(isWeakSet(s), false, debug(s) + ' is not a WeakSet');
t.end();
});
test('WeakMaps', { skip: typeof WeakMap !== 'function' }, function (t) {
var wm = new WeakMap();
t.equal(isWeakSet(wm), false, debug(wm) + ' is not a WeakSet');
t.end();
});
test('WeakSets', { skip: typeof WeakSet !== 'function' }, function (t) {
var ws = new WeakSet();
t.equal(isWeakSet(ws), true, debug(ws) + ' is a WeakSet');
t.end();
});
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more