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,7 @@
export {
current,
isDraft,
produce as createNextState,
isDraftable,
setUseStrictIteration,
} from 'immer'
@@ -0,0 +1,13 @@
import {
navbar
} from "../chunk-PMUB6T6D.mjs";
import "../chunk-CWYZ2GEH.mjs";
import "../chunk-GQT3YUX3.mjs";
import "../chunk-46U6G7UJ.mjs";
import "../chunk-DGTYPKBN.mjs";
import "../chunk-UWE6H66T.mjs";
import "../chunk-GIXI35A3.mjs";
import "../chunk-GH5E4FQB.mjs";
export {
navbar
};
@@ -0,0 +1,235 @@
import { IsObject, IsArray, IsString, IsNumber, IsNull } from '../guard/index.mjs';
import { TypeBoxError } from '../../type/error/index.mjs';
import { Kind } from '../../type/symbols/index.mjs';
import { Create } from '../create/index.mjs';
import { Check } from '../check/index.mjs';
import { Clone } from '../clone/index.mjs';
import { Deref, Pushref } from '../deref/index.mjs';
// ------------------------------------------------------------------
// Errors
// ------------------------------------------------------------------
export class ValueCastError extends TypeBoxError {
constructor(schema, message) {
super(message);
this.schema = schema;
}
}
// ------------------------------------------------------------------
// The following logic assigns a score to a schema based on how well
// it matches a given value. For object types, the score is calculated
// by evaluating each property of the value against the schema's
// properties. To avoid bias towards objects with many properties,
// each property contributes equally to the total score. Properties
// that exactly match literal values receive the highest possible
// score, as literals are often used as discriminators in union types.
// ------------------------------------------------------------------
function ScoreUnion(schema, references, value) {
if (schema[Kind] === 'Object' && typeof value === 'object' && !IsNull(value)) {
const object = schema;
const keys = Object.getOwnPropertyNames(value);
const entries = Object.entries(object.properties);
return entries.reduce((acc, [key, schema]) => {
const literal = schema[Kind] === 'Literal' && schema.const === value[key] ? 100 : 0;
const checks = Check(schema, references, value[key]) ? 10 : 0;
const exists = keys.includes(key) ? 1 : 0;
return acc + (literal + checks + exists);
}, 0);
}
else if (schema[Kind] === 'Union') {
const schemas = schema.anyOf.map((schema) => Deref(schema, references));
const scores = schemas.map((schema) => ScoreUnion(schema, references, value));
return Math.max(...scores);
}
else {
return Check(schema, references, value) ? 1 : 0;
}
}
function SelectUnion(union, references, value) {
const schemas = union.anyOf.map((schema) => Deref(schema, references));
let [select, best] = [schemas[0], 0];
for (const schema of schemas) {
const score = ScoreUnion(schema, references, value);
if (score > best) {
select = schema;
best = score;
}
}
return select;
}
function CastUnion(union, references, value) {
if ('default' in union) {
return typeof value === 'function' ? union.default : Clone(union.default);
}
else {
const schema = SelectUnion(union, references, value);
return Cast(schema, references, value);
}
}
// ------------------------------------------------------------------
// Default
// ------------------------------------------------------------------
function DefaultClone(schema, references, value) {
return Check(schema, references, value) ? Clone(value) : Create(schema, references);
}
function Default(schema, references, value) {
return Check(schema, references, value) ? value : Create(schema, references);
}
// ------------------------------------------------------------------
// Cast
// ------------------------------------------------------------------
function FromArray(schema, references, value) {
if (Check(schema, references, value))
return Clone(value);
const created = IsArray(value) ? Clone(value) : Create(schema, references);
const minimum = IsNumber(schema.minItems) && created.length < schema.minItems ? [...created, ...Array.from({ length: schema.minItems - created.length }, () => null)] : created;
const maximum = IsNumber(schema.maxItems) && minimum.length > schema.maxItems ? minimum.slice(0, schema.maxItems) : minimum;
const casted = maximum.map((value) => Visit(schema.items, references, value));
if (schema.uniqueItems !== true)
return casted;
const unique = [...new Set(casted)];
if (!Check(schema, references, unique))
throw new ValueCastError(schema, 'Array cast produced invalid data due to uniqueItems constraint');
return unique;
}
function FromConstructor(schema, references, value) {
if (Check(schema, references, value))
return Create(schema, references);
const required = new Set(schema.returns.required || []);
const result = function () { };
for (const [key, property] of Object.entries(schema.returns.properties)) {
if (!required.has(key) && value.prototype[key] === undefined)
continue;
result.prototype[key] = Visit(property, references, value.prototype[key]);
}
return result;
}
function FromImport(schema, references, value) {
const definitions = globalThis.Object.values(schema.$defs);
const target = schema.$defs[schema.$ref];
return Visit(target, [...references, ...definitions], value);
}
// ------------------------------------------------------------------
// Intersect
// ------------------------------------------------------------------
function IntersectAssign(correct, value) {
// trust correct on mismatch | value on non-object
if ((IsObject(correct) && !IsObject(value)) || (!IsObject(correct) && IsObject(value)))
return correct;
if (!IsObject(correct) || !IsObject(value))
return value;
return globalThis.Object.getOwnPropertyNames(correct).reduce((result, key) => {
const property = key in value ? IntersectAssign(correct[key], value[key]) : correct[key];
return { ...result, [key]: property };
}, {});
}
function FromIntersect(schema, references, value) {
if (Check(schema, references, value))
return value;
const correct = Create(schema, references);
const assigned = IntersectAssign(correct, value);
return Check(schema, references, assigned) ? assigned : correct;
}
function FromNever(schema, references, value) {
throw new ValueCastError(schema, 'Never types cannot be cast');
}
function FromObject(schema, references, value) {
if (Check(schema, references, value))
return value;
if (value === null || typeof value !== 'object')
return Create(schema, references);
const required = new Set(schema.required || []);
const result = {};
for (const [key, property] of Object.entries(schema.properties)) {
if (!required.has(key) && value[key] === undefined)
continue;
result[key] = Visit(property, references, value[key]);
}
// additional schema properties
if (typeof schema.additionalProperties === 'object') {
const propertyNames = Object.getOwnPropertyNames(schema.properties);
for (const propertyName of Object.getOwnPropertyNames(value)) {
if (propertyNames.includes(propertyName))
continue;
result[propertyName] = Visit(schema.additionalProperties, references, value[propertyName]);
}
}
return result;
}
function FromRecord(schema, references, value) {
if (Check(schema, references, value))
return Clone(value);
if (value === null || typeof value !== 'object' || Array.isArray(value) || value instanceof Date)
return Create(schema, references);
const subschemaPropertyName = Object.getOwnPropertyNames(schema.patternProperties)[0];
const subschema = schema.patternProperties[subschemaPropertyName];
const result = {};
for (const [propKey, propValue] of Object.entries(value)) {
result[propKey] = Visit(subschema, references, propValue);
}
return result;
}
function FromRef(schema, references, value) {
return Visit(Deref(schema, references), references, value);
}
function FromThis(schema, references, value) {
return Visit(Deref(schema, references), references, value);
}
function FromTuple(schema, references, value) {
if (Check(schema, references, value))
return Clone(value);
if (!IsArray(value))
return Create(schema, references);
if (schema.items === undefined)
return [];
return schema.items.map((schema, index) => Visit(schema, references, value[index]));
}
function FromUnion(schema, references, value) {
return Check(schema, references, value) ? Clone(value) : CastUnion(schema, references, value);
}
function Visit(schema, references, value) {
const references_ = IsString(schema.$id) ? Pushref(schema, references) : references;
const schema_ = schema;
switch (schema[Kind]) {
// --------------------------------------------------------------
// Structural
// --------------------------------------------------------------
case 'Array':
return FromArray(schema_, references_, value);
case 'Constructor':
return FromConstructor(schema_, references_, value);
case 'Import':
return FromImport(schema_, references_, value);
case 'Intersect':
return FromIntersect(schema_, references_, value);
case 'Never':
return FromNever(schema_, references_, value);
case 'Object':
return FromObject(schema_, references_, value);
case 'Record':
return FromRecord(schema_, references_, value);
case 'Ref':
return FromRef(schema_, references_, value);
case 'This':
return FromThis(schema_, references_, value);
case 'Tuple':
return FromTuple(schema_, references_, value);
case 'Union':
return FromUnion(schema_, references_, value);
// --------------------------------------------------------------
// DefaultClone
// --------------------------------------------------------------
case 'Date':
case 'Symbol':
case 'Uint8Array':
return DefaultClone(schema, references, value);
// --------------------------------------------------------------
// Default
// --------------------------------------------------------------
default:
return Default(schema_, references_, value);
}
}
/** Casts a value into a given type. The return value will retain as much information of the original value as possible. */
export function Cast(...args) {
return args.length === 3 ? Visit(args[0], args[1], args[2]) : Visit(args[0], [], args[1]);
}
@@ -0,0 +1,18 @@
import { As, RightJoinProps, PropsOf, InternalForwardRefRenderFunction } from './types.js';
import * as React from 'react';
import '@react-types/shared';
declare function forwardRef<Component extends As, Props extends object, OmitKeys extends keyof any = never>(component: React.ForwardRefRenderFunction<any, RightJoinProps<PropsOf<Component>, Props> & {
as?: As;
}>): InternalForwardRefRenderFunction<Component, Props, OmitKeys>;
declare const toIterator: (obj: any) => any;
declare const mapPropsVariants: <T extends Record<string, any>, K extends keyof T>(props: T, variantKeys?: K[], removeVariantProps?: boolean) => readonly [Omit<T, K> | T, Pick<T, K> | {}];
declare const mapPropsVariantsWithCommon: <P extends Record<any, any>, VK extends keyof P, CK extends keyof P = never>(originalProps: P, variantKeys: VK[], commonKeys?: CK[]) => readonly [Omit<P, Exclude<VK, CK>>, Pick<P, VK>];
/**
* Checks if a component is a HeroUI component.
* @param component - The component to check.
* @returns `true` if the component is a HeroUI component, `false` otherwise.
*/
declare const isHeroUIEl: (component: React.ReactComponentElement<any>) => boolean;
export { forwardRef, isHeroUIEl, mapPropsVariants, mapPropsVariantsWithCommon, toIterator };
@@ -0,0 +1,7 @@
var getNative = require('./_getNative'),
root = require('./_root');
/* Built-in method references that are verified to be native. */
var Set = getNative(root, 'Set');
module.exports = Set;
@@ -0,0 +1,73 @@
{
"name": "is-alphabetical",
"version": "2.0.1",
"description": "Check if a character is alphabetical",
"license": "MIT",
"keywords": [
"string",
"character",
"char",
"code",
"alphabetical"
],
"repository": "wooorm/is-alphabetical",
"bugs": "https://github.com/wooorm/is-alphabetical/issues",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/wooorm"
},
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
"contributors": [
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
],
"sideEffects": false,
"type": "module",
"main": "index.js",
"types": "index.d.ts",
"files": [
"index.d.ts",
"index.js"
],
"devDependencies": {
"@types/tape": "^4.0.0",
"c8": "^7.0.0",
"prettier": "^2.0.0",
"remark-cli": "^10.0.0",
"remark-preset-wooorm": "^9.0.0",
"rimraf": "^3.0.0",
"tape": "^5.0.0",
"type-coverage": "^2.0.0",
"typescript": "^4.0.0",
"xo": "^0.46.0"
},
"scripts": {
"prepublishOnly": "npm run build && npm run format",
"build": "rimraf \"*.d.ts\" && tsc && type-coverage",
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
"test-api": "node --conditions development test.js",
"test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov npm run test-api",
"test": "npm run build && npm run format && npm run test-coverage"
},
"prettier": {
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"bracketSpacing": false,
"semi": false,
"trailingComma": "none"
},
"xo": {
"prettier": true
},
"remarkConfig": {
"plugins": [
"preset-wooorm"
]
},
"typeCoverage": {
"atLeast": 100,
"detail": true,
"strict": true,
"ignoreCatch": true
}
}
@@ -0,0 +1,13 @@
/**
* ```asn1
* Time ::= CHOICE {
* utcTime UTCTime,
* generalTime GeneralizedTime }
* ```
*/
export declare class Time {
utcTime?: Date;
generalTime?: Date;
constructor(time?: Date | string | number | Partial<Time>);
getTime(): Date;
}
@@ -0,0 +1 @@
{"version":3,"file":"getFieldValueAs.d.ts","sourceRoot":"","sources":["../../src/logic/getFieldValueAs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;yBAIxC,CAAC,SAAS,gBAAgB,EACxC,OAAO,CAAC,EACR,4CAA4C,KAAK,CAAC,IAAI,CAAC;AAFzD,wBAgBkB"}
@@ -0,0 +1,75 @@
/*
* 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 {chain} from './chain';
import clsx from 'clsx';
import {mergeIds} from './useId';
interface Props {
[key: string]: any
}
type PropsArg = Props | null | undefined;
// taken from: https://stackoverflow.com/questions/51603250/typescript-3-parameter-list-intersection-type/51604379#51604379
type TupleTypes<T> = { [P in keyof T]: T[P] } extends { [key: number]: infer V } ? NullToObject<V> : never;
type NullToObject<T> = T extends (null | undefined) ? {} : T;
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
/**
* Merges multiple props objects together. Event handlers are chained,
* classNames are combined, and ids are deduplicated - different ids
* will trigger a side-effect and re-render components hooked up with `useId`.
* For all other props, the last prop object overrides all previous ones.
* @param args - Multiple sets of props to merge together.
*/
export function mergeProps<T extends PropsArg[]>(...args: T): UnionToIntersection<TupleTypes<T>> {
// Start with a base clone of the first argument. This is a lot faster than starting
// with an empty object and adding properties as we go.
let result: Props = {...args[0]};
for (let i = 1; i < args.length; i++) {
let props = args[i];
for (let key in props) {
let a = result[key];
let b = props[key];
// Chain events
if (
typeof a === 'function' &&
typeof b === 'function' &&
// This is a lot faster than a regex.
key[0] === 'o' &&
key[1] === 'n' &&
key.charCodeAt(2) >= /* 'A' */ 65 &&
key.charCodeAt(2) <= /* 'Z' */ 90
) {
result[key] = chain(a, b);
// Merge classnames, sometimes classNames are empty string which eval to false, so we just need to do a type check
} else if (
(key === 'className' || key === 'UNSAFE_className') &&
typeof a === 'string' &&
typeof b === 'string'
) {
result[key] = clsx(a, b);
} else if (key === 'id' && a && b) {
result.id = mergeIds(a, b);
// Override others
} else {
result[key] = b !== undefined ? b : a;
}
}
}
return result as UnionToIntersection<TupleTypes<T>>;
}
@@ -0,0 +1,27 @@
{
"name": "javascript-natural-sort",
"version": "0.7.1",
"description": "Natural Sort algorithm for Javascript - Version 0.7 - Released under MIT license",
"main": "naturalSort.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/Bill4Time/javascript-natural-sort.git"
},
"keywords": [
"natural",
"sort",
"javascript",
"array",
"sort",
"sorting"
],
"author": "Jim Palmer (based on chunking idea from Dave Koelle, packaged by @khous of Bill4Time)",
"license": "MIT",
"bugs": {
"url": "https://github.com/Bill4Time/javascript-natural-sort/issues"
},
"homepage": "https://github.com/Bill4Time/javascript-natural-sort"
}
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=types.js.map
@@ -0,0 +1,35 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GlobalSign_Root_CA = void 0;
/**
* GlobalSign Root CA
*
* Downloaded from https://pki.goog/roots.pem
*
* Valid until 2028-01-28 @ 04:00 PST
*
* SHA256 Fingerprint
* EB:D4:10:40:E4:BB:3E:C7:42:C9:E3:81:D3:1E:F2:A4:1A:48:B6:68:5C:96:E7:CE:F3:C1:DF:6C:D4:33:1C:99
*/
exports.GlobalSign_Root_CA = `-----BEGIN CERTIFICATE-----
MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG
A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv
b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw
MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i
YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT
aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ
jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp
xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp
1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG
snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ
U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8
9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E
BTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B
AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz
yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE
38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP
AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad
DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME
HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==
-----END CERTIFICATE-----
`;
@@ -0,0 +1,14 @@
export const getOwnerDocument = (el: Element | null | undefined): Document => {
return el?.ownerDocument ?? document;
};
export const getOwnerWindow = (
el: (Window & typeof global) | Element | null | undefined
): Window & typeof global => {
if (el && 'window' in el && el.window === el) {
return el;
}
const doc = getOwnerDocument(el as Element | null | undefined);
return doc.defaultView || window;
};
@@ -0,0 +1,38 @@
{
"name": "ms",
"version": "2.1.3",
"description": "Tiny millisecond conversion utility",
"repository": "vercel/ms",
"main": "./index",
"files": [
"index.js"
],
"scripts": {
"precommit": "lint-staged",
"lint": "eslint lib/* bin/*",
"test": "mocha tests.js"
},
"eslintConfig": {
"extends": "eslint:recommended",
"env": {
"node": true,
"es6": true
}
},
"lint-staged": {
"*.js": [
"npm run lint",
"prettier --single-quote --write",
"git add"
]
},
"license": "MIT",
"devDependencies": {
"eslint": "4.18.2",
"expect.js": "0.3.1",
"husky": "0.14.3",
"lint-staged": "5.0.0",
"mocha": "4.0.1",
"prettier": "2.0.5"
}
}
@@ -0,0 +1,55 @@
{
"name": "@heroui/framer-utils",
"version": "2.1.7",
"description": "A set of framer motion transitions for react",
"keywords": [
"framer-utils"
],
"author": "Junior Garcia <jrgarciadev@gmail.com>",
"homepage": "https://heroui.com",
"license": "MIT",
"main": "dist/index.js",
"sideEffects": false,
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/heroui-inc/heroui.git",
"directory": "packages/utilities/framer-utils"
},
"bugs": {
"url": "https://github.com/heroui-inc/heroui/issues"
},
"peerDependencies": {
"react": ">=18 || >=19.0.0-rc.0",
"react-dom": ">=18 || >=19.0.0-rc.0",
"framer-motion": ">=11.5.6 || >=12.0.0-alpha.1"
},
"dependencies": {
"@heroui/system": "2.4.7",
"@heroui/use-measure": "2.1.2",
"@heroui/shared-utils": "2.1.3"
},
"clean-package": "../../../clean-package.config.json",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./package.json": "./package.json"
},
"scripts": {
"build": "tsup src --dts",
"build:fast": "tsup src",
"dev": "pnpm build:fast --watch",
"clean": "rimraf dist .turbo",
"typecheck": "tsc --noEmit"
}
}
@@ -0,0 +1,101 @@
{
"name": "quill",
"version": "2.0.3",
"description": "Your powerful, rich text editor",
"author": "Jason Chen <jhchen7@gmail.com>",
"homepage": "https://quilljs.com",
"main": "quill.js",
"type": "module",
"dependencies": {
"eventemitter3": "^5.0.1",
"lodash-es": "^4.17.21",
"parchment": "^3.0.0",
"quill-delta": "^5.1.0"
},
"devDependencies": {
"@babel/cli": "^7.23.9",
"@babel/core": "^7.24.0",
"@babel/preset-env": "^7.24.0",
"@babel/preset-typescript": "^7.23.3",
"@playwright/test": "1.44.1",
"@types/highlight.js": "^9.12.4",
"@types/lodash-es": "^4.17.12",
"@types/node": "^20.10.0",
"@types/webpack": "^5.28.5",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"@vitest/browser": "^1.1.3",
"babel-loader": "^9.1.3",
"babel-plugin-transform-define": "^2.1.4",
"css-loader": "^6.10.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-import-resolver-webpack": "^0.13.8",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-require-extensions": "^0.1.3",
"glob": "10.4.2",
"highlight.js": "^9.18.1",
"html-loader": "^4.2.0",
"html-webpack-plugin": "^5.5.3",
"jsdom": "^22.1.0",
"mini-css-extract-plugin": "^2.7.6",
"prettier": "^3.0.3",
"source-map-loader": "^5.0.0",
"style-loader": "^3.3.3",
"stylus": "^0.62.0",
"stylus-loader": "^7.1.3",
"svgo": "^3.2.0",
"terser-webpack-plugin": "^5.3.9",
"transpile-webpack-plugin": "^1.1.3",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"typescript": "^5.4.2",
"vitest": "^1.1.3",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1",
"webpack-merge": "^5.10.0"
},
"license": "BSD-3-Clause",
"repository": {
"type": "git",
"url": "git+https://github.com/slab/quill.git",
"directory": "packages/quill"
},
"bugs": {
"url": "https://github.com/slab/quill/issues"
},
"prettier": {
"singleQuote": true
},
"browserslist": [
"defaults"
],
"scripts": {
"build": "./scripts/build production",
"lint": "run-s lint:*",
"lint:eslint": "eslint .",
"lint:tsc": "tsc --noEmit --skipLibCheck",
"start": "[[ -z \"$npm_package_config_ports_webpack\" ]] && webpack-dev-server || webpack-dev-server --port $npm_package_config_ports_webpack",
"test": "run-s test:*",
"test:unit": "vitest --config test/unit/vitest.config.ts",
"test:fuzz": "vitest --config test/fuzz/vitest.config.ts",
"test:e2e": "playwright test"
},
"keywords": [
"quill",
"editor",
"rich text",
"wysiwyg",
"operational transformation",
"ot",
"framework"
],
"engines": {
"npm": ">=8.2.3"
},
"engineStrict": true
}
@@ -0,0 +1,80 @@
{
"name": "unist-util-stringify-position",
"version": "4.0.0",
"description": "unist utility to serialize a node, position, or point as a human readable location",
"license": "MIT",
"keywords": [
"unist",
"unist-util",
"util",
"utility",
"position",
"location",
"point",
"node",
"stringify",
"tostring"
],
"repository": "syntax-tree/unist-util-stringify-position",
"bugs": "https://github.com/syntax-tree/unist-util-stringify-position/issues",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
},
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
"contributors": [
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
],
"sideEffects": false,
"type": "module",
"exports": "./index.js",
"files": [
"lib/",
"index.d.ts",
"index.js"
],
"dependencies": {
"@types/unist": "^3.0.0"
},
"devDependencies": {
"@types/mdast": "^4.0.0",
"@types/node": "^20.0.0",
"c8": "^8.0.0",
"prettier": "^2.0.0",
"remark-cli": "^11.0.0",
"remark-preset-wooorm": "^9.0.0",
"type-coverage": "^2.0.0",
"typescript": "^5.0.0",
"xo": "^0.54.0"
},
"scripts": {
"prepack": "npm run build && npm run format",
"build": "tsc --build --clean && tsc --build && type-coverage",
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
"test-api": "node --conditions development test.js",
"test-coverage": "c8 --100 --reporter lcov npm run test-api",
"test": "npm run build && npm run format && npm run test-coverage"
},
"prettier": {
"bracketSpacing": false,
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "none",
"useTabs": false
},
"remarkConfig": {
"plugins": [
"remark-preset-wooorm"
]
},
"typeCoverage": {
"atLeast": 100,
"detail": true,
"ignoreCatch": true,
"strict": true
},
"xo": {
"prettier": true
}
}
@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _tslib = require("tslib");
var _react = require("react");
var useUpdate = function useUpdate() {
var _a = (0, _tslib.__read)((0, _react.useState)({}), 2),
setState = _a[1];
return (0, _react.useCallback)(function () {
return setState({});
}, []);
};
var _default = exports["default"] = useUpdate;
@@ -0,0 +1,41 @@
/**
* @typedef {import('hast').Element} Element
* @typedef {import('hast').ElementContent} ElementContent
* @typedef {import('hast').Properties} Properties
* @typedef {import('mdast').ImageReference} ImageReference
* @typedef {import('../state.js').State} State
*/
import {normalizeUri} from 'micromark-util-sanitize-uri'
import {revert} from '../revert.js'
/**
* Turn an mdast `imageReference` node into hast.
*
* @param {State} state
* Info passed around.
* @param {ImageReference} node
* mdast node.
* @returns {Array<ElementContent> | ElementContent}
* hast node.
*/
export function imageReference(state, node) {
const id = String(node.identifier).toUpperCase()
const definition = state.definitionById.get(id)
if (!definition) {
return revert(state, node)
}
/** @type {Properties} */
const properties = {src: normalizeUri(definition.url || ''), alt: node.alt}
if (definition.title !== null && definition.title !== undefined) {
properties.title = definition.title
}
/** @type {Element} */
const result = {type: 'element', tagName: 'img', properties, children: []}
state.patch(node, result)
return state.applyData(node, result)
}
@@ -0,0 +1,5 @@
'use strict';
module.exports = function isTrailingSurrogate(charCode) {
return typeof charCode === 'number' && charCode >= 0xDC00 && charCode <= 0xDFFF;
};
@@ -0,0 +1 @@
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["merge.js"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,mCAPW,aAAa,CAAC,MAAM,CAAC,UAErB,KAAK,GAAG,SAAS,GAEf,MAAM,CAelB;uBAtBoB,aAAa;2BAHJ,sBAAsB"}
@@ -0,0 +1,51 @@
"use client";
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/refs.ts
var refs_exports = {};
__export(refs_exports, {
assignRef: () => assignRef,
mergeRefs: () => mergeRefs
});
module.exports = __toCommonJS(refs_exports);
var import_shared_utils = require("@heroui/shared-utils");
function assignRef(ref, value) {
if (ref == null)
return;
if ((0, import_shared_utils.isFunction)(ref)) {
ref(value);
return;
}
try {
ref.current = value;
} catch (error) {
throw new Error(`Cannot assign value '${value}' to ref '${ref}'`);
}
}
function mergeRefs(...refs) {
return (node) => {
refs.forEach((ref) => assignRef(ref, node));
};
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
assignRef,
mergeRefs
});
@@ -0,0 +1,39 @@
'use strict';
const stringReplaceAll = (string, substring, replacer) => {
let index = string.indexOf(substring);
if (index === -1) {
return string;
}
const substringLength = substring.length;
let endIndex = 0;
let returnValue = '';
do {
returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
endIndex = index + substringLength;
index = string.indexOf(substring, endIndex);
} while (index !== -1);
returnValue += string.substr(endIndex);
return returnValue;
};
const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
let endIndex = 0;
let returnValue = '';
do {
const gotCR = string[index - 1] === '\r';
returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? '\r\n' : '\n') + postfix;
endIndex = index + 1;
index = string.indexOf('\n', endIndex);
} while (index !== -1);
returnValue += string.substr(endIndex);
return returnValue;
};
module.exports = {
stringReplaceAll,
stringEncaseCRLFWithFirstIndex
};
@@ -0,0 +1,93 @@
import { vi } from 'vitest'
import { isOnline, isDocumentVisible, joinUrls } from '@internal/query/utils'
afterAll(() => {
vi.restoreAllMocks()
})
describe('isOnline', () => {
test('Assumes online=true in a node env', () => {
vi.spyOn(window, 'navigator', 'get').mockImplementation(
() => undefined as any,
)
expect(navigator).toBeUndefined()
expect(isOnline()).toBe(true)
})
test('Returns false if navigator isOnline=false', () => {
vi.spyOn(window, 'navigator', 'get').mockImplementation(
() => ({ onLine: false }) as any,
)
expect(isOnline()).toBe(false)
})
test('Returns true if navigator isOnline=true', () => {
vi.spyOn(window, 'navigator', 'get').mockImplementation(
() => ({ onLine: true }) as any,
)
expect(isOnline()).toBe(true)
})
})
describe('isDocumentVisible', () => {
test('Assumes true when in a non-browser env', () => {
vi.spyOn(window, 'document', 'get').mockImplementation(
() => undefined as any,
)
expect(window.document).toBeUndefined()
expect(isDocumentVisible()).toBe(true)
})
test('Returns false when hidden=true', () => {
vi.spyOn(window, 'document', 'get').mockImplementation(
() => ({ visibilityState: 'hidden' }) as any,
)
expect(isDocumentVisible()).toBe(false)
})
test('Returns true when visibilityState=prerender', () => {
vi.spyOn(window, 'document', 'get').mockImplementation(
() => ({ visibilityState: 'prerender' }) as any,
)
expect(document.visibilityState).toBe('prerender')
expect(isDocumentVisible()).toBe(true)
})
test('Returns true when visibilityState=visible', () => {
vi.spyOn(window, 'document', 'get').mockImplementation(
() => ({ visibilityState: 'visible' }) as any,
)
expect(document.visibilityState).toBe('visible')
expect(isDocumentVisible()).toBe(true)
})
test('Returns true when visibilityState=undefined', () => {
vi.spyOn(window, 'document', 'get').mockImplementation(
() => ({ visibilityState: undefined }) as any,
)
expect(document.visibilityState).toBeUndefined()
expect(isDocumentVisible()).toBe(true)
})
})
describe('joinUrls', () => {
test.each([
['/api/', '/banana', '/api/banana'],
['/api/', 'banana', '/api/banana'],
['/api', '/banana', '/api/banana'],
['/api', 'banana', '/api/banana'],
['', '/banana', '/banana'],
['', 'banana', 'banana'],
['api', '?a=1', 'api?a=1'],
['api/', '?a=1', 'api/?a=1'],
['api', 'banana?a=1', 'api/banana?a=1'],
['api/', 'banana?a=1', 'api/banana?a=1'],
['https://example.com/api', 'banana', 'https://example.com/api/banana'],
['https://example.com/api', '/banana', 'https://example.com/api/banana'],
['https://example.com/api/', 'banana', 'https://example.com/api/banana'],
['https://example.com/api/', '/banana', 'https://example.com/api/banana'],
['https://example.com/api/', 'https://example.org', 'https://example.org'],
['https://example.com/api/', '//example.org', '//example.org'],
])('%s and %s join to %s', (base, url, expected) => {
expect(joinUrls(base, url)).toBe(expected)
})
})
@@ -0,0 +1,8 @@
var $c0398ad35c3639b7$exports = {};
$c0398ad35c3639b7$exports = {
"longPressMessage": `\u{627}\u{636}\u{63A}\u{637} \u{645}\u{637}\u{648}\u{644}\u{627}\u{64B} \u{623}\u{648} \u{627}\u{636}\u{63A}\u{637} \u{639}\u{644}\u{649} Alt + \u{627}\u{644}\u{633}\u{647}\u{645} \u{644}\u{623}\u{633}\u{641}\u{644} \u{644}\u{641}\u{62A}\u{62D} \u{627}\u{644}\u{642}\u{627}\u{626}\u{645}\u{629}`
};
export {$c0398ad35c3639b7$exports as default};
//# sourceMappingURL=ar-AE.module.js.map
@@ -0,0 +1,10 @@
import {
code_default
} from "./chunk-B75B6XQK.mjs";
import {
useCode
} from "./chunk-RYFHIXXN.mjs";
export {
code_default as Code,
useCode
};
@@ -0,0 +1,75 @@
{
"name": "resolve",
"description": "resolve like require.resolve() on behalf of files asynchronously and synchronously",
"version": "1.22.11",
"repository": {
"type": "git",
"url": "ssh://github.com/browserify/resolve.git"
},
"bin": {
"resolve": "./bin/resolve"
},
"main": "index.js",
"keywords": [
"resolve",
"require",
"node",
"module"
],
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated && cp node_modules/is-core-module/core.json ./lib/ ||:",
"prepublishOnly": "safe-publish-latest",
"prepublish": "not-in-publish || npm run prepublishOnly",
"prelint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')",
"lint": "eslint --ext=js,mjs --no-eslintrc -c .eslintrc . 'bin/**'",
"pretests-only": "cd ./test/resolver/nested_symlinks && node mylib/sync && node mylib/async",
"tests-only": "tape test/*.js",
"pretest": "npm run lint",
"test": "npm run --silent tests-only",
"posttest": "npm run test:multirepo && npx npm@'>= 10.2' audit --production",
"test:multirepo": "cd ./test/resolver/multirepo && npm install && npm test"
},
"devDependencies": {
"@ljharb/eslint-config": "^21.2.0",
"array.prototype.map": "^1.0.8",
"copy-dir": "^1.3.0",
"eclint": "^2.8.1",
"eslint": "=8.8.0",
"in-publish": "^2.0.1",
"mkdirp": "^0.5.5",
"mv": "^2.1.1",
"npmignore": "^0.3.1",
"object-keys": "^1.1.1",
"rimraf": "^2.7.1",
"safe-publish-latest": "^2.0.0",
"semver": "^6.3.1",
"tap": "0.4.13",
"tape": "^5.9.0",
"tmp": "^0.0.31"
},
"license": "MIT",
"author": {
"name": "James Halliday",
"email": "mail@substack.net",
"url": "http://substack.net"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"dependencies": {
"is-core-module": "^2.16.1",
"path-parse": "^1.0.7",
"supports-preserve-symlinks-flag": "^1.0.0"
},
"publishConfig": {
"ignore": [
".github/workflows",
"appveyor.yml",
"test/resolver/malformed_package_json",
"test/list-exports"
]
},
"engines": {
"node": ">= 0.4"
}
}
@@ -0,0 +1,8 @@
var $9e9fef000aa4c013$exports = {};
$9e9fef000aa4c013$exports = {
"longPressMessage": `H\xe5ll nedtryckt eller tryck p\xe5 Alt + pil ned\xe5t f\xf6r att \xf6ppna menyn`
};
export {$9e9fef000aa4c013$exports as default};
//# sourceMappingURL=sv-SE.module.js.map
@@ -0,0 +1,61 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return collapseAdjacentRules;
}
});
let comparisonMap = {
atrule: [
"name",
"params"
],
rule: [
"selector"
]
};
let types = new Set(Object.keys(comparisonMap));
function collapseAdjacentRules() {
function collapseRulesIn(root) {
let currentRule = null;
root.each((node)=>{
if (!types.has(node.type)) {
currentRule = null;
return;
}
if (currentRule === null) {
currentRule = node;
return;
}
let properties = comparisonMap[node.type];
var _node_property, _currentRule_property;
if (node.type === "atrule" && node.name === "font-face") {
currentRule = node;
} else if (properties.every((property)=>((_node_property = node[property]) !== null && _node_property !== void 0 ? _node_property : "").replace(/\s+/g, " ") === ((_currentRule_property = currentRule[property]) !== null && _currentRule_property !== void 0 ? _currentRule_property : "").replace(/\s+/g, " "))) {
// An AtRule may not have children (for example if we encounter duplicate @import url(…) rules)
if (node.nodes) {
currentRule.append(node.nodes);
}
node.remove();
} else {
currentRule = node;
}
});
// After we've collapsed adjacent rules & at-rules, we need to collapse
// adjacent rules & at-rules that are children of at-rules.
// We do not care about nesting rules because Tailwind CSS
// explicitly does not handle rule nesting on its own as
// the user is expected to use a nesting plugin
root.each((node)=>{
if (node.type === "atrule") {
collapseRulesIn(node);
}
});
}
return (root)=>{
collapseRulesIn(root);
};
}
@@ -0,0 +1,96 @@
/**
* Rule: no-return-wrap function
* Prevents unnecessary wrapping of results in Promise.resolve
* or Promise.reject as the Promise will do that for us
*/
'use strict'
const { getAncestors } = require('./lib/eslint-compat')
const getDocsUrl = require('./lib/get-docs-url')
const isPromise = require('./lib/is-promise')
function isInPromise(context, node) {
let functionNode = getAncestors(context, node)
.filter((node) => {
return (
node.type === 'ArrowFunctionExpression' ||
node.type === 'FunctionExpression'
)
})
.reverse()[0]
while (
functionNode &&
functionNode.parent &&
functionNode.parent.type === 'MemberExpression' &&
functionNode.parent.object === functionNode &&
functionNode.parent.property.type === 'Identifier' &&
functionNode.parent.property.name === 'bind' &&
functionNode.parent.parent &&
functionNode.parent.parent.type === 'CallExpression' &&
functionNode.parent.parent.callee === functionNode.parent
) {
functionNode = functionNode.parent.parent
}
return functionNode && functionNode.parent && isPromise(functionNode.parent)
}
module.exports = {
meta: {
type: 'suggestion',
docs: {
description:
'Disallow wrapping values in `Promise.resolve` or `Promise.reject` when not needed.',
url: getDocsUrl('no-return-wrap'),
},
messages: {
resolve: 'Avoid wrapping return values in Promise.resolve',
reject: 'Expected throw instead of Promise.reject',
},
schema: [
{
type: 'object',
properties: {
allowReject: {
type: 'boolean',
},
},
additionalProperties: false,
},
],
},
create(context) {
const options = context.options[0] || {}
const allowReject = options.allowReject
/**
* Checks a call expression, reporting if necessary.
* @param callExpression The call expression.
* @param node The node to report.
*/
function checkCallExpression({ callee }, node) {
if (
isInPromise(context, node) &&
callee.type === 'MemberExpression' &&
callee.object.name === 'Promise'
) {
if (callee.property.name === 'resolve') {
context.report({ node, messageId: 'resolve' })
} else if (!allowReject && callee.property.name === 'reject') {
context.report({ node, messageId: 'reject' })
}
}
}
return {
ReturnStatement(node) {
if (node.argument && node.argument.type === 'CallExpression') {
checkCallExpression(node.argument, node)
}
},
'ArrowFunctionExpression > CallExpression'(node) {
checkCallExpression(node, node)
},
}
},
}
@@ -0,0 +1,498 @@
import { parser } from '@lezer/javascript';
import { syntaxTree, LRLanguage, indentNodeProp, continuedIndent, flatIndent, delimitedIndent, foldNodeProp, foldInside, defineLanguageFacet, sublanguageProp, LanguageSupport } from '@codemirror/language';
import { EditorSelection } from '@codemirror/state';
import { EditorView } from '@codemirror/view';
import { snippetCompletion, ifNotIn, completeFromList } from '@codemirror/autocomplete';
import { NodeWeakMap, IterMode } from '@lezer/common';
/**
A collection of JavaScript-related
[snippets](https://codemirror.net/6/docs/ref/#autocomplete.snippet).
*/
const snippets = [
/*@__PURE__*/snippetCompletion("function ${name}(${params}) {\n\t${}\n}", {
label: "function",
detail: "definition",
type: "keyword"
}),
/*@__PURE__*/snippetCompletion("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n\t${}\n}", {
label: "for",
detail: "loop",
type: "keyword"
}),
/*@__PURE__*/snippetCompletion("for (let ${name} of ${collection}) {\n\t${}\n}", {
label: "for",
detail: "of loop",
type: "keyword"
}),
/*@__PURE__*/snippetCompletion("do {\n\t${}\n} while (${})", {
label: "do",
detail: "loop",
type: "keyword"
}),
/*@__PURE__*/snippetCompletion("while (${}) {\n\t${}\n}", {
label: "while",
detail: "loop",
type: "keyword"
}),
/*@__PURE__*/snippetCompletion("try {\n\t${}\n} catch (${error}) {\n\t${}\n}", {
label: "try",
detail: "/ catch block",
type: "keyword"
}),
/*@__PURE__*/snippetCompletion("if (${}) {\n\t${}\n}", {
label: "if",
detail: "block",
type: "keyword"
}),
/*@__PURE__*/snippetCompletion("if (${}) {\n\t${}\n} else {\n\t${}\n}", {
label: "if",
detail: "/ else block",
type: "keyword"
}),
/*@__PURE__*/snippetCompletion("class ${name} {\n\tconstructor(${params}) {\n\t\t${}\n\t}\n}", {
label: "class",
detail: "definition",
type: "keyword"
}),
/*@__PURE__*/snippetCompletion("import {${names}} from \"${module}\"\n${}", {
label: "import",
detail: "named",
type: "keyword"
}),
/*@__PURE__*/snippetCompletion("import ${name} from \"${module}\"\n${}", {
label: "import",
detail: "default",
type: "keyword"
})
];
/**
A collection of snippet completions for TypeScript. Includes the
JavaScript [snippets](https://codemirror.net/6/docs/ref/#lang-javascript.snippets).
*/
const typescriptSnippets = /*@__PURE__*/snippets.concat([
/*@__PURE__*/snippetCompletion("interface ${name} {\n\t${}\n}", {
label: "interface",
detail: "definition",
type: "keyword"
}),
/*@__PURE__*/snippetCompletion("type ${name} = ${type}", {
label: "type",
detail: "definition",
type: "keyword"
}),
/*@__PURE__*/snippetCompletion("enum ${name} {\n\t${}\n}", {
label: "enum",
detail: "definition",
type: "keyword"
})
]);
const cache = /*@__PURE__*/new NodeWeakMap();
const ScopeNodes = /*@__PURE__*/new Set([
"Script", "Block",
"FunctionExpression", "FunctionDeclaration", "ArrowFunction", "MethodDeclaration",
"ForStatement"
]);
function defID(type) {
return (node, def) => {
let id = node.node.getChild("VariableDefinition");
if (id)
def(id, type);
return true;
};
}
const functionContext = ["FunctionDeclaration"];
const gatherCompletions = {
FunctionDeclaration: /*@__PURE__*/defID("function"),
ClassDeclaration: /*@__PURE__*/defID("class"),
ClassExpression: () => true,
EnumDeclaration: /*@__PURE__*/defID("constant"),
TypeAliasDeclaration: /*@__PURE__*/defID("type"),
NamespaceDeclaration: /*@__PURE__*/defID("namespace"),
VariableDefinition(node, def) { if (!node.matchContext(functionContext))
def(node, "variable"); },
TypeDefinition(node, def) { def(node, "type"); },
__proto__: null
};
function getScope(doc, node) {
let cached = cache.get(node);
if (cached)
return cached;
let completions = [], top = true;
function def(node, type) {
let name = doc.sliceString(node.from, node.to);
completions.push({ label: name, type });
}
node.cursor(IterMode.IncludeAnonymous).iterate(node => {
if (top) {
top = false;
}
else if (node.name) {
let gather = gatherCompletions[node.name];
if (gather && gather(node, def) || ScopeNodes.has(node.name))
return false;
}
else if (node.to - node.from > 8192) {
// Allow caching for bigger internal nodes
for (let c of getScope(doc, node.node))
completions.push(c);
return false;
}
});
cache.set(node, completions);
return completions;
}
const Identifier = /^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/;
const dontComplete = [
"TemplateString", "String", "RegExp",
"LineComment", "BlockComment",
"VariableDefinition", "TypeDefinition", "Label",
"PropertyDefinition", "PropertyName",
"PrivatePropertyDefinition", "PrivatePropertyName",
"JSXText", "JSXAttributeValue", "JSXOpenTag", "JSXCloseTag", "JSXSelfClosingTag",
".", "?."
];
/**
Completion source that looks up locally defined names in
JavaScript code.
*/
function localCompletionSource(context) {
let inner = syntaxTree(context.state).resolveInner(context.pos, -1);
if (dontComplete.indexOf(inner.name) > -1)
return null;
let isWord = inner.name == "VariableName" ||
inner.to - inner.from < 20 && Identifier.test(context.state.sliceDoc(inner.from, inner.to));
if (!isWord && !context.explicit)
return null;
let options = [];
for (let pos = inner; pos; pos = pos.parent) {
if (ScopeNodes.has(pos.name))
options = options.concat(getScope(context.state.doc, pos));
}
return {
options,
from: isWord ? inner.from : context.pos,
validFor: Identifier
};
}
function pathFor(read, member, name) {
var _a;
let path = [];
for (;;) {
let obj = member.firstChild, prop;
if ((obj === null || obj === void 0 ? void 0 : obj.name) == "VariableName") {
path.push(read(obj));
return { path: path.reverse(), name };
}
else if ((obj === null || obj === void 0 ? void 0 : obj.name) == "MemberExpression" && ((_a = (prop = obj.lastChild)) === null || _a === void 0 ? void 0 : _a.name) == "PropertyName") {
path.push(read(prop));
member = obj;
}
else {
return null;
}
}
}
/**
Helper function for defining JavaScript completion sources. It
returns the completable name and object path for a completion
context, or null if no name/property completion should happen at
that position. For example, when completing after `a.b.c` it will
return `{path: ["a", "b"], name: "c"}`. When completing after `x`
it will return `{path: [], name: "x"}`. When not in a property or
name, it will return null if `context.explicit` is false, and
`{path: [], name: ""}` otherwise.
*/
function completionPath(context) {
let read = (node) => context.state.doc.sliceString(node.from, node.to);
let inner = syntaxTree(context.state).resolveInner(context.pos, -1);
if (inner.name == "PropertyName") {
return pathFor(read, inner.parent, read(inner));
}
else if ((inner.name == "." || inner.name == "?.") && inner.parent.name == "MemberExpression") {
return pathFor(read, inner.parent, "");
}
else if (dontComplete.indexOf(inner.name) > -1) {
return null;
}
else if (inner.name == "VariableName" || inner.to - inner.from < 20 && Identifier.test(read(inner))) {
return { path: [], name: read(inner) };
}
else if (inner.name == "MemberExpression") {
return pathFor(read, inner, "");
}
else {
return context.explicit ? { path: [], name: "" } : null;
}
}
function enumeratePropertyCompletions(obj, top) {
let options = [], seen = new Set;
for (let depth = 0;; depth++) {
for (let name of (Object.getOwnPropertyNames || Object.keys)(obj)) {
if (!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(name) || seen.has(name))
continue;
seen.add(name);
let value;
try {
value = obj[name];
}
catch (_) {
continue;
}
options.push({
label: name,
type: typeof value == "function" ? (/^[A-Z]/.test(name) ? "class" : top ? "function" : "method")
: top ? "variable" : "property",
boost: -depth
});
}
let next = Object.getPrototypeOf(obj);
if (!next)
return options;
obj = next;
}
}
/**
Defines a [completion source](https://codemirror.net/6/docs/ref/#autocomplete.CompletionSource) that
completes from the given scope object (for example `globalThis`).
Will enter properties of the object when completing properties on
a directly-named path.
*/
function scopeCompletionSource(scope) {
let cache = new Map;
return (context) => {
let path = completionPath(context);
if (!path)
return null;
let target = scope;
for (let step of path.path) {
target = target[step];
if (!target)
return null;
}
let options = cache.get(target);
if (!options)
cache.set(target, options = enumeratePropertyCompletions(target, !path.path.length));
return {
from: context.pos - path.name.length,
options,
validFor: Identifier
};
};
}
/**
A language provider based on the [Lezer JavaScript
parser](https://github.com/lezer-parser/javascript), extended with
highlighting and indentation information.
*/
const javascriptLanguage = /*@__PURE__*/LRLanguage.define({
name: "javascript",
parser: /*@__PURE__*/parser.configure({
props: [
/*@__PURE__*/indentNodeProp.add({
IfStatement: /*@__PURE__*/continuedIndent({ except: /^\s*({|else\b)/ }),
TryStatement: /*@__PURE__*/continuedIndent({ except: /^\s*({|catch\b|finally\b)/ }),
LabeledStatement: flatIndent,
SwitchBody: context => {
let after = context.textAfter, closed = /^\s*\}/.test(after), isCase = /^\s*(case|default)\b/.test(after);
return context.baseIndent + (closed ? 0 : isCase ? 1 : 2) * context.unit;
},
Block: /*@__PURE__*/delimitedIndent({ closing: "}" }),
ArrowFunction: cx => cx.baseIndent + cx.unit,
"TemplateString BlockComment": () => null,
"Statement Property": /*@__PURE__*/continuedIndent({ except: /^\s*{/ }),
JSXElement(context) {
let closed = /^\s*<\//.test(context.textAfter);
return context.lineIndent(context.node.from) + (closed ? 0 : context.unit);
},
JSXEscape(context) {
let closed = /\s*\}/.test(context.textAfter);
return context.lineIndent(context.node.from) + (closed ? 0 : context.unit);
},
"JSXOpenTag JSXSelfClosingTag"(context) {
return context.column(context.node.from) + context.unit;
}
}),
/*@__PURE__*/foldNodeProp.add({
"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType": foldInside,
BlockComment(tree) { return { from: tree.from + 2, to: tree.to - 2 }; }
})
]
}),
languageData: {
closeBrackets: { brackets: ["(", "[", "{", "'", '"', "`"] },
commentTokens: { line: "//", block: { open: "/*", close: "*/" } },
indentOnInput: /^\s*(?:case |default:|\{|\}|<\/)$/,
wordChars: "$"
}
});
const jsxSublanguage = {
test: node => /^JSX/.test(node.name),
facet: /*@__PURE__*/defineLanguageFacet({ commentTokens: { block: { open: "{/*", close: "*/}" } } })
};
/**
A language provider for TypeScript.
*/
const typescriptLanguage = /*@__PURE__*/javascriptLanguage.configure({ dialect: "ts" }, "typescript");
/**
Language provider for JSX.
*/
const jsxLanguage = /*@__PURE__*/javascriptLanguage.configure({
dialect: "jsx",
props: [/*@__PURE__*/sublanguageProp.add(n => n.isTop ? [jsxSublanguage] : undefined)]
});
/**
Language provider for JSX + TypeScript.
*/
const tsxLanguage = /*@__PURE__*/javascriptLanguage.configure({
dialect: "jsx ts",
props: [/*@__PURE__*/sublanguageProp.add(n => n.isTop ? [jsxSublanguage] : undefined)]
}, "typescript");
let kwCompletion = (name) => ({ label: name, type: "keyword" });
const keywords = /*@__PURE__*/"break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(kwCompletion);
const typescriptKeywords = /*@__PURE__*/keywords.concat(/*@__PURE__*/["declare", "implements", "private", "protected", "public"].map(kwCompletion));
/**
JavaScript support. Includes [snippet](https://codemirror.net/6/docs/ref/#lang-javascript.snippets)
and local variable completion.
*/
function javascript(config = {}) {
let lang = config.jsx ? (config.typescript ? tsxLanguage : jsxLanguage)
: config.typescript ? typescriptLanguage : javascriptLanguage;
let completions = config.typescript ? typescriptSnippets.concat(typescriptKeywords) : snippets.concat(keywords);
return new LanguageSupport(lang, [
javascriptLanguage.data.of({
autocomplete: ifNotIn(dontComplete, completeFromList(completions))
}),
javascriptLanguage.data.of({
autocomplete: localCompletionSource
}),
config.jsx ? autoCloseTags : [],
]);
}
function findOpenTag(node) {
for (;;) {
if (node.name == "JSXOpenTag" || node.name == "JSXSelfClosingTag" || node.name == "JSXFragmentTag")
return node;
if (node.name == "JSXEscape" || !node.parent)
return null;
node = node.parent;
}
}
function elementName(doc, tree, max = doc.length) {
for (let ch = tree === null || tree === void 0 ? void 0 : tree.firstChild; ch; ch = ch.nextSibling) {
if (ch.name == "JSXIdentifier" || ch.name == "JSXBuiltin" || ch.name == "JSXNamespacedName" ||
ch.name == "JSXMemberExpression")
return doc.sliceString(ch.from, Math.min(ch.to, max));
}
return "";
}
const android = typeof navigator == "object" && /*@__PURE__*//Android\b/.test(navigator.userAgent);
/**
Extension that will automatically insert JSX close tags when a `>` or
`/` is typed.
*/
const autoCloseTags = /*@__PURE__*/EditorView.inputHandler.of((view, from, to, text, defaultInsert) => {
if ((android ? view.composing : view.compositionStarted) || view.state.readOnly ||
from != to || (text != ">" && text != "/") ||
!javascriptLanguage.isActiveAt(view.state, from, -1))
return false;
let base = defaultInsert(), { state } = base;
let closeTags = state.changeByRange(range => {
var _a;
let { head } = range, around = syntaxTree(state).resolveInner(head - 1, -1), name;
if (around.name == "JSXStartTag")
around = around.parent;
if (state.doc.sliceString(head - 1, head) != text || around.name == "JSXAttributeValue" && around.to > head) ;
else if (text == ">" && around.name == "JSXFragmentTag") {
return { range, changes: { from: head, insert: `</>` } };
}
else if (text == "/" && around.name == "JSXStartCloseTag") {
let empty = around.parent, base = empty.parent;
if (base && empty.from == head - 2 &&
((name = elementName(state.doc, base.firstChild, head)) || ((_a = base.firstChild) === null || _a === void 0 ? void 0 : _a.name) == "JSXFragmentTag")) {
let insert = `${name}>`;
return { range: EditorSelection.cursor(head + insert.length, -1), changes: { from: head, insert } };
}
}
else if (text == ">") {
let openTag = findOpenTag(around);
if (openTag && openTag.name == "JSXOpenTag" &&
!/^\/?>|^<\//.test(state.doc.sliceString(head, head + 2)) &&
(name = elementName(state.doc, openTag, head)))
return { range, changes: { from: head, insert: `</${name}>` } };
}
return { range };
});
if (closeTags.changes.empty)
return false;
view.dispatch([
base,
state.update(closeTags, { userEvent: "input.complete", scrollIntoView: true })
]);
return true;
});
/**
Connects an [ESLint](https://eslint.org/) linter to CodeMirror's
[lint](https://codemirror.net/6/docs/ref/#lint) integration. `eslint` should be an instance of the
[`Linter`](https://eslint.org/docs/developer-guide/nodejs-api#linter)
class, and `config` an optional ESLint configuration. The return
value of this function can be passed to [`linter`](https://codemirror.net/6/docs/ref/#lint.linter)
to create a JavaScript linting extension.
Note that ESLint targets node, and is tricky to run in the
browser. The
[eslint-linter-browserify](https://github.com/UziTech/eslint-linter-browserify)
package may help with that (see
[example](https://github.com/UziTech/eslint-linter-browserify/blob/master/example/script.js)).
*/
function esLint(eslint, config) {
if (!config) {
config = {
parserOptions: { ecmaVersion: 2019, sourceType: "module" },
env: { browser: true, node: true, es6: true, es2015: true, es2017: true, es2020: true },
rules: {}
};
eslint.getRules().forEach((desc, name) => {
var _a;
if ((_a = desc.meta.docs) === null || _a === void 0 ? void 0 : _a.recommended)
config.rules[name] = 2;
});
}
return (view) => {
let { state } = view, found = [];
for (let { from, to } of javascriptLanguage.findRegions(state)) {
let fromLine = state.doc.lineAt(from), offset = { line: fromLine.number - 1, col: from - fromLine.from, pos: from };
for (let d of eslint.verify(state.sliceDoc(from, to), config))
found.push(translateDiagnostic(d, state.doc, offset));
}
return found;
};
}
function mapPos(line, col, doc, offset) {
return doc.line(line + offset.line).from + col + (line == 1 ? offset.col - 1 : -1);
}
function translateDiagnostic(input, doc, offset) {
let start = mapPos(input.line, input.column, doc, offset);
let result = {
from: start,
to: input.endLine != null && input.endColumn != 1 ? mapPos(input.endLine, input.endColumn, doc, offset) : start,
message: input.message,
source: input.ruleId ? "eslint:" + input.ruleId : "eslint",
severity: input.severity == 1 ? "warning" : "error",
};
if (input.fix) {
let { range, text } = input.fix, from = range[0] + offset.pos - start, to = range[1] + offset.pos - start;
result.actions = [{
name: "fix",
apply(view, start) {
view.dispatch({ changes: { from: start + from, to: start + to, insert: text }, scrollIntoView: true });
}
}];
}
return result;
}
export { autoCloseTags, completionPath, esLint, javascript, javascriptLanguage, jsxLanguage, localCompletionSource, scopeCompletionSource, snippets, tsxLanguage, typescriptLanguage, typescriptSnippets };
@@ -0,0 +1,6 @@
function _tagged_template_literal(strings, raw) {
if (!raw) raw = strings.slice(0);
return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } }));
}
export { _tagged_template_literal as _ };
@@ -0,0 +1,32 @@
const SAFE_TIMERS_SYMBOL = Symbol("vitest:SAFE_TIMERS");
function getSafeTimers() {
const { setTimeout: safeSetTimeout, setInterval: safeSetInterval, clearInterval: safeClearInterval, clearTimeout: safeClearTimeout, setImmediate: safeSetImmediate, clearImmediate: safeClearImmediate, queueMicrotask: safeQueueMicrotask } = globalThis[SAFE_TIMERS_SYMBOL] || globalThis;
const { nextTick: safeNextTick } = globalThis[SAFE_TIMERS_SYMBOL] || globalThis.process || {};
return {
nextTick: safeNextTick,
setTimeout: safeSetTimeout,
setInterval: safeSetInterval,
clearInterval: safeClearInterval,
clearTimeout: safeClearTimeout,
setImmediate: safeSetImmediate,
clearImmediate: safeClearImmediate,
queueMicrotask: safeQueueMicrotask
};
}
function setSafeTimers() {
const { setTimeout: safeSetTimeout, setInterval: safeSetInterval, clearInterval: safeClearInterval, clearTimeout: safeClearTimeout, setImmediate: safeSetImmediate, clearImmediate: safeClearImmediate, queueMicrotask: safeQueueMicrotask } = globalThis;
const { nextTick: safeNextTick } = globalThis.process || {};
const timers = {
nextTick: safeNextTick,
setTimeout: safeSetTimeout,
setInterval: safeSetInterval,
clearInterval: safeClearInterval,
clearTimeout: safeClearTimeout,
setImmediate: safeSetImmediate,
clearImmediate: safeClearImmediate,
queueMicrotask: safeQueueMicrotask
};
globalThis[SAFE_TIMERS_SYMBOL] = timers;
}
export { getSafeTimers, setSafeTimers };
@@ -0,0 +1 @@
{"mappings":";;AEuBA,2BAA4B,SAAQ,WAAW;IAC7C,+FAA+F;IAC/F,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mDAAmD;IACnD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4DAA4D;IAC5D,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;;OAKG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,yEAAyE;IACzE,yBAAyB,CAAC,EAAE,OAAO,CAAA;CACpC;AAED,+BAAgC,SAAQ,UAAU;IAChD,mCAAmC;IACnC,GAAG,CAAC,EAAE,UAAU,OAAO,GAAG,IAAI,CAAC,CAAA;CAChC;AA2BD;IACE,+CAA+C;IAC/C,SAAS,EAAE,OAAO,CAAC;IACnB,6CAA6C;IAC7C,UAAU,EAAE,aAAa,CAAA;CAC1B;AAmED;;;;GAIG;AACH,yBAAyB,KAAK,EAAE,cAAc,GAAG,WAAW,CA+oB3D;AClxBD,wBAAyB,SAAQ,UAAU;IACzC,QAAQ,EAAE,aAAa,aAAa,EAAE,MAAM,CAAC,CAAA;CAC9C;AAED,OAAO,MAAM,6FASX,CAAC;ACZH,6BAA8B,SAAQ,UAAU;IAC9C,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,OAAO,MAAM,4GAgCX,CAAC;AAEH,oCAAoC,EAAC,QAAQ,EAAC,EAAE;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAC,qBAOpE;AEzCD,4BAA4B,MAAM,GAAG,gBAAgB,CAAE,SAAQ,YAAY,MAAM,CAAC;IAChF,mDAAmD;IACnD,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,6BAA6B,MAAM,GAAG,gBAAgB;IACpD,+CAA+C;IAC/C,UAAU,EAAE,cAAc,MAAM,CAAC,CAAA;CAClC;AAED;;;GAGG;AACH,yBAAyB,MAAM,SAAS,gBAAgB,GAAG,gBAAgB,EAAE,KAAK,EAAE,WAAW,MAAM,CAAC,GAAG,YAAY,MAAM,CAAC,CAkD3H;ACjED,uBAAuB,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;AAG1D,kCAAkC,CAAC,gBAAgB,OAAO,KAAK,IAAI,CAAC;AACpE;IACE,2CAA2C;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gDAAgD;IAChD,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED;IACE,kDAAkD;IAClD,gBAAgB,OAAO,CAAA;CACxB;AA+JD;;;;;;;;;;;;;;;;GAgBG;AACH,uCAAuC,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,GAAG,MAAM,IAAI,CAa/E;AAQD;;GAEG;AACH,kCAAkC,OAAO,CAExC;AAED,0CAA0C,QAAQ,GAAG,IAAI,CAExD;AAED,uCAAuC,QAAQ,EAAE,QAAQ,QAGxD;AAED;;GAEG;AACH,0CAA0C,QAAQ,GAAG,IAAI,CAgBxD;AA+BD;;GAEG;AACH,gCAAgC,KAAK,GAAE,iBAAsB,GAAG,kBAAkB,CAQjF;AAED;;GAEG;AACH,wCAAwC,EAAE,EAAE,mBAAmB,EAAE,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,EAAE;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAC,GAAG,IAAI,CAgB/H;ACrTD;IACE,0DAA0D;IAC1D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qFAAqF;IACrF,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACxC,qFAAqF;IACrF,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACvC,sEAAsE;IACtE,mBAAmB,CAAC,EAAE,CAAC,aAAa,EAAE,OAAO,KAAK,IAAI,CAAA;CACvD;AAED;IACE,+CAA+C;IAC/C,gBAAgB,EAAE,aAAa,CAAA;CAChC;AAED;;GAEG;AACH,+BAA+B,KAAK,EAAE,gBAAgB,GAAG,iBAAiB,CA8DzE;AClFD,2BAA4B,SAAQ,WAAW;IAC7C,mDAAmD;IACnD,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED;IACE,6CAA6C;IAC7C,UAAU,EAAE,aAAa,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAA;CACnB;AAoDD;;;GAGG;AACH,yBAAyB,KAAK,EAAE,UAAU,GAAG,WAAW,CAwHvD;ACxLD;IACE,GAAG,EAAE,UAAU,OAAO,GAAG,IAAI,CAAC,CAAC;IAC/B,iBAAiB,CAAC,EAAE,CAAC,CAAC,EAAE,YAAY,KAAK,IAAI,CAAC;IAC9C,sBAAsB,CAAC,EAAE,CAAC,CAAC,EAAE,YAAY,KAAK,IAAI,CAAC;IACnD,8DAA8D;IAC9D,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED;;;GAGG;AACH,mCAAmC,KAAK,EAAE,oBAAoB,QA+E7D;AEjGD,8BAA+B,SAAQ,cAAc;IACnD,sDAAsD;IACtD,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED;IACE,+CAA+C;IAC/C,aAAa,EAAE,aAAa,CAAA;CAC7B;AAED;;GAEG;AACH,4BAA4B,KAAK,EAAE,aAAa,GAAG,cAAc,CAOhE;AClBD;IACE,6CAA6C;IAC7C,SAAS,EAAE,aAAa,CAAA;CACzB;AASD;;;;GAIG;AACH,wBAAwB,KAAK,EAAE,UAAU,GAAG,UAAU,CAoMrD;ACtND,iCAAkC,SAAQ,YAAY;IACpD,sDAAsD;IACtD,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAGD,+BAA+B,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,UAAU,WAAW,GAAG,IAAI,CAAC,GAAG,IAAI,CAkBhG;ACvBD;IACE,oDAAoD;IACpD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mEAAmE;IACnE,gBAAgB,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAC/C;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAC1C;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAA;CAClC;AAED;IACE,6CAA6C;IAC7C,cAAc,EAAE,aAAa,CAAA;CAC9B;AAID;;;GAGG;AACH,6BAA6B,KAAK,EAAE,cAAc,GAAG,eAAe,CAyEnE;ACxFD,YAAY,EAAC,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAC,MAAM,qBAAqB,CAAC","sources":["packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/textSelection.ts","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/context.ts","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/usePress.ts","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/Pressable.tsx","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/PressResponder.tsx","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/utils.ts","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/useFocus.ts","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/useFocusVisible.ts","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/useFocusWithin.ts","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/useHover.ts","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/useInteractOutside.ts","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/createEventHandler.ts","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/useKeyboard.ts","packages/@react-aria/interactions/src/packages/@react-aria/interactions/src/useMove.ts","packages/@react-aria/interactions/src/packages/@react-aria/interactionsLine truncated
@@ -0,0 +1,50 @@
"use client";
// src/table-cell.tsx
import { useMemo } from "react";
import { forwardRef } from "@heroui/system";
import { useDOMRef, filterDOMProps } from "@heroui/react-utils";
import { clsx, dataAttr, mergeProps } from "@heroui/shared-utils";
import { useTableCell } from "@react-aria/table";
import { useFocusRing } from "@react-aria/focus";
import { jsx } from "react/jsx-runtime";
var TableCell = forwardRef((props, ref) => {
var _a, _b, _c;
const { as, className, node, rowKey, slots, state, classNames, ...otherProps } = props;
const Component = as || "td";
const shouldFilterDOMProps = typeof Component === "string";
const domRef = useDOMRef(ref);
const { gridCellProps } = useTableCell({ node }, state, domRef);
const tdStyles = clsx(classNames == null ? void 0 : classNames.td, className, (_a = node.props) == null ? void 0 : _a.className);
const { isFocusVisible, focusProps } = useFocusRing();
const isRowSelected = state.selectionManager.isSelected(rowKey);
const cell = useMemo(() => {
const cellType = typeof node.rendered;
return cellType !== "object" && cellType !== "function" ? /* @__PURE__ */ jsx("span", { children: node.rendered }) : node.rendered;
}, [node.rendered]);
const columnProps = ((_b = node.column) == null ? void 0 : _b.props) || {};
return /* @__PURE__ */ jsx(
Component,
{
ref: domRef,
"data-focus-visible": dataAttr(isFocusVisible),
"data-selected": dataAttr(isRowSelected),
...mergeProps(
gridCellProps,
focusProps,
filterDOMProps(node.props, {
enabled: shouldFilterDOMProps
}),
otherProps
),
className: (_c = slots.td) == null ? void 0 : _c.call(slots, { align: columnProps.align, class: tdStyles }),
children: cell
}
);
});
TableCell.displayName = "HeroUI.TableCell";
var table_cell_default = TableCell;
export {
table_cell_default
};
@@ -0,0 +1,110 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.Required = Required;
const type_1 = require("../create/type");
const index_1 = require("../computed/index");
const index_2 = require("../object/index");
const index_3 = require("../intersect/index");
const index_4 = require("../union/index");
const index_5 = require("../ref/index");
const index_6 = require("../symbols/index");
const index_7 = require("../discard/index");
const required_from_mapped_result_1 = require("./required-from-mapped-result");
// ------------------------------------------------------------------
// TypeGuard
// ------------------------------------------------------------------
const KindGuard = __importStar(require("../guard/kind"));
// prettier-ignore
function FromComputed(target, parameters) {
return (0, index_1.Computed)('Required', [(0, index_1.Computed)(target, parameters)]);
}
// prettier-ignore
function FromRef($ref) {
return (0, index_1.Computed)('Required', [(0, index_5.Ref)($ref)]);
}
// prettier-ignore
function FromProperties(properties) {
const requiredProperties = {};
for (const K of globalThis.Object.getOwnPropertyNames(properties))
requiredProperties[K] = (0, index_7.Discard)(properties[K], [index_6.OptionalKind]);
return requiredProperties;
}
// prettier-ignore
function FromObject(type, properties) {
const options = (0, index_7.Discard)(type, [index_6.TransformKind, '$id', 'required', 'properties']);
const mappedProperties = FromProperties(properties);
return (0, index_2.Object)(mappedProperties, options);
}
// prettier-ignore
function FromRest(types) {
return types.map(type => RequiredResolve(type));
}
// ------------------------------------------------------------------
// RequiredResolve
// ------------------------------------------------------------------
// prettier-ignore
function RequiredResolve(type) {
return (
// Mappable
KindGuard.IsComputed(type) ? FromComputed(type.target, type.parameters) :
KindGuard.IsRef(type) ? FromRef(type.$ref) :
KindGuard.IsIntersect(type) ? (0, index_3.Intersect)(FromRest(type.allOf)) :
KindGuard.IsUnion(type) ? (0, index_4.Union)(FromRest(type.anyOf)) :
KindGuard.IsObject(type) ? FromObject(type, type.properties) :
// Intrinsic
KindGuard.IsBigInt(type) ? type :
KindGuard.IsBoolean(type) ? type :
KindGuard.IsInteger(type) ? type :
KindGuard.IsLiteral(type) ? type :
KindGuard.IsNull(type) ? type :
KindGuard.IsNumber(type) ? type :
KindGuard.IsString(type) ? type :
KindGuard.IsSymbol(type) ? type :
KindGuard.IsUndefined(type) ? type :
// Passthrough
(0, index_2.Object)({}));
}
/** `[Json]` Constructs a type where all properties are required */
function Required(type, options) {
if (KindGuard.IsMappedResult(type)) {
return (0, required_from_mapped_result_1.RequiredFromMappedResult)(type, options);
}
else {
// special: mapping types require overridable options
return (0, type_1.CreateType)({ ...RequiredResolve(type), ...options });
}
}
@@ -0,0 +1,19 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./policy"), exports);
__exportStar(require("./system"), exports);
@@ -0,0 +1,702 @@
'use strict'
const proc =
typeof process === 'object' && process
? process
: {
stdout: null,
stderr: null,
}
import EE from 'events'
import Stream from 'stream'
import stringdecoder from 'string_decoder'
const SD = stringdecoder.StringDecoder
const EOF = Symbol('EOF')
const MAYBE_EMIT_END = Symbol('maybeEmitEnd')
const EMITTED_END = Symbol('emittedEnd')
const EMITTING_END = Symbol('emittingEnd')
const EMITTED_ERROR = Symbol('emittedError')
const CLOSED = Symbol('closed')
const READ = Symbol('read')
const FLUSH = Symbol('flush')
const FLUSHCHUNK = Symbol('flushChunk')
const ENCODING = Symbol('encoding')
const DECODER = Symbol('decoder')
const FLOWING = Symbol('flowing')
const PAUSED = Symbol('paused')
const RESUME = Symbol('resume')
const BUFFER = Symbol('buffer')
const PIPES = Symbol('pipes')
const BUFFERLENGTH = Symbol('bufferLength')
const BUFFERPUSH = Symbol('bufferPush')
const BUFFERSHIFT = Symbol('bufferShift')
const OBJECTMODE = Symbol('objectMode')
// internal event when stream is destroyed
const DESTROYED = Symbol('destroyed')
// internal event when stream has an error
const ERROR = Symbol('error')
const EMITDATA = Symbol('emitData')
const EMITEND = Symbol('emitEnd')
const EMITEND2 = Symbol('emitEnd2')
const ASYNC = Symbol('async')
const ABORT = Symbol('abort')
const ABORTED = Symbol('aborted')
const SIGNAL = Symbol('signal')
const defer = fn => Promise.resolve().then(fn)
// TODO remove when Node v8 support drops
const doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== '1'
const ASYNCITERATOR =
(doIter && Symbol.asyncIterator) || Symbol('asyncIterator not implemented')
const ITERATOR =
(doIter && Symbol.iterator) || Symbol('iterator not implemented')
// events that mean 'the stream is over'
// these are treated specially, and re-emitted
// if they are listened for after emitting.
const isEndish = ev => ev === 'end' || ev === 'finish' || ev === 'prefinish'
const isArrayBuffer = b =>
b instanceof ArrayBuffer ||
(typeof b === 'object' &&
b.constructor &&
b.constructor.name === 'ArrayBuffer' &&
b.byteLength >= 0)
const isArrayBufferView = b => !Buffer.isBuffer(b) && ArrayBuffer.isView(b)
class Pipe {
constructor(src, dest, opts) {
this.src = src
this.dest = dest
this.opts = opts
this.ondrain = () => src[RESUME]()
dest.on('drain', this.ondrain)
}
unpipe() {
this.dest.removeListener('drain', this.ondrain)
}
// istanbul ignore next - only here for the prototype
proxyErrors() {}
end() {
this.unpipe()
if (this.opts.end) this.dest.end()
}
}
class PipeProxyErrors extends Pipe {
unpipe() {
this.src.removeListener('error', this.proxyErrors)
super.unpipe()
}
constructor(src, dest, opts) {
super(src, dest, opts)
this.proxyErrors = er => dest.emit('error', er)
src.on('error', this.proxyErrors)
}
}
export class Minipass extends Stream {
constructor(options) {
super()
this[FLOWING] = false
// whether we're explicitly paused
this[PAUSED] = false
this[PIPES] = []
this[BUFFER] = []
this[OBJECTMODE] = (options && options.objectMode) || false
if (this[OBJECTMODE]) this[ENCODING] = null
else this[ENCODING] = (options && options.encoding) || null
if (this[ENCODING] === 'buffer') this[ENCODING] = null
this[ASYNC] = (options && !!options.async) || false
this[DECODER] = this[ENCODING] ? new SD(this[ENCODING]) : null
this[EOF] = false
this[EMITTED_END] = false
this[EMITTING_END] = false
this[CLOSED] = false
this[EMITTED_ERROR] = null
this.writable = true
this.readable = true
this[BUFFERLENGTH] = 0
this[DESTROYED] = false
if (options && options.debugExposeBuffer === true) {
Object.defineProperty(this, 'buffer', { get: () => this[BUFFER] })
}
if (options && options.debugExposePipes === true) {
Object.defineProperty(this, 'pipes', { get: () => this[PIPES] })
}
this[SIGNAL] = options && options.signal
this[ABORTED] = false
if (this[SIGNAL]) {
this[SIGNAL].addEventListener('abort', () => this[ABORT]())
if (this[SIGNAL].aborted) {
this[ABORT]()
}
}
}
get bufferLength() {
return this[BUFFERLENGTH]
}
get encoding() {
return this[ENCODING]
}
set encoding(enc) {
if (this[OBJECTMODE]) throw new Error('cannot set encoding in objectMode')
if (
this[ENCODING] &&
enc !== this[ENCODING] &&
((this[DECODER] && this[DECODER].lastNeed) || this[BUFFERLENGTH])
)
throw new Error('cannot change encoding')
if (this[ENCODING] !== enc) {
this[DECODER] = enc ? new SD(enc) : null
if (this[BUFFER].length)
this[BUFFER] = this[BUFFER].map(chunk => this[DECODER].write(chunk))
}
this[ENCODING] = enc
}
setEncoding(enc) {
this.encoding = enc
}
get objectMode() {
return this[OBJECTMODE]
}
set objectMode(om) {
this[OBJECTMODE] = this[OBJECTMODE] || !!om
}
get ['async']() {
return this[ASYNC]
}
set ['async'](a) {
this[ASYNC] = this[ASYNC] || !!a
}
// drop everything and get out of the flow completely
[ABORT]() {
this[ABORTED] = true
this.emit('abort', this[SIGNAL].reason)
this.destroy(this[SIGNAL].reason)
}
get aborted() {
return this[ABORTED]
}
set aborted(_) {}
write(chunk, encoding, cb) {
if (this[ABORTED]) return false
if (this[EOF]) throw new Error('write after end')
if (this[DESTROYED]) {
this.emit(
'error',
Object.assign(
new Error('Cannot call write after a stream was destroyed'),
{ code: 'ERR_STREAM_DESTROYED' }
)
)
return true
}
if (typeof encoding === 'function') (cb = encoding), (encoding = 'utf8')
if (!encoding) encoding = 'utf8'
const fn = this[ASYNC] ? defer : f => f()
// convert array buffers and typed array views into buffers
// at some point in the future, we may want to do the opposite!
// leave strings and buffers as-is
// anything else switches us into object mode
if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) {
if (isArrayBufferView(chunk))
chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength)
else if (isArrayBuffer(chunk)) chunk = Buffer.from(chunk)
else if (typeof chunk !== 'string')
// use the setter so we throw if we have encoding set
this.objectMode = true
}
// handle object mode up front, since it's simpler
// this yields better performance, fewer checks later.
if (this[OBJECTMODE]) {
/* istanbul ignore if - maybe impossible? */
if (this.flowing && this[BUFFERLENGTH] !== 0) this[FLUSH](true)
if (this.flowing) this.emit('data', chunk)
else this[BUFFERPUSH](chunk)
if (this[BUFFERLENGTH] !== 0) this.emit('readable')
if (cb) fn(cb)
return this.flowing
}
// at this point the chunk is a buffer or string
// don't buffer it up or send it to the decoder
if (!chunk.length) {
if (this[BUFFERLENGTH] !== 0) this.emit('readable')
if (cb) fn(cb)
return this.flowing
}
// fast-path writing strings of same encoding to a stream with
// an empty buffer, skipping the buffer/decoder dance
if (
typeof chunk === 'string' &&
// unless it is a string already ready for us to use
!(encoding === this[ENCODING] && !this[DECODER].lastNeed)
) {
chunk = Buffer.from(chunk, encoding)
}
if (Buffer.isBuffer(chunk) && this[ENCODING])
chunk = this[DECODER].write(chunk)
// Note: flushing CAN potentially switch us into not-flowing mode
if (this.flowing && this[BUFFERLENGTH] !== 0) this[FLUSH](true)
if (this.flowing) this.emit('data', chunk)
else this[BUFFERPUSH](chunk)
if (this[BUFFERLENGTH] !== 0) this.emit('readable')
if (cb) fn(cb)
return this.flowing
}
read(n) {
if (this[DESTROYED]) return null
if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH]) {
this[MAYBE_EMIT_END]()
return null
}
if (this[OBJECTMODE]) n = null
if (this[BUFFER].length > 1 && !this[OBJECTMODE]) {
if (this.encoding) this[BUFFER] = [this[BUFFER].join('')]
else this[BUFFER] = [Buffer.concat(this[BUFFER], this[BUFFERLENGTH])]
}
const ret = this[READ](n || null, this[BUFFER][0])
this[MAYBE_EMIT_END]()
return ret
}
[READ](n, chunk) {
if (n === chunk.length || n === null) this[BUFFERSHIFT]()
else {
this[BUFFER][0] = chunk.slice(n)
chunk = chunk.slice(0, n)
this[BUFFERLENGTH] -= n
}
this.emit('data', chunk)
if (!this[BUFFER].length && !this[EOF]) this.emit('drain')
return chunk
}
end(chunk, encoding, cb) {
if (typeof chunk === 'function') (cb = chunk), (chunk = null)
if (typeof encoding === 'function') (cb = encoding), (encoding = 'utf8')
if (chunk) this.write(chunk, encoding)
if (cb) this.once('end', cb)
this[EOF] = true
this.writable = false
// if we haven't written anything, then go ahead and emit,
// even if we're not reading.
// we'll re-emit if a new 'end' listener is added anyway.
// This makes MP more suitable to write-only use cases.
if (this.flowing || !this[PAUSED]) this[MAYBE_EMIT_END]()
return this
}
// don't let the internal resume be overwritten
[RESUME]() {
if (this[DESTROYED]) return
this[PAUSED] = false
this[FLOWING] = true
this.emit('resume')
if (this[BUFFER].length) this[FLUSH]()
else if (this[EOF]) this[MAYBE_EMIT_END]()
else this.emit('drain')
}
resume() {
return this[RESUME]()
}
pause() {
this[FLOWING] = false
this[PAUSED] = true
}
get destroyed() {
return this[DESTROYED]
}
get flowing() {
return this[FLOWING]
}
get paused() {
return this[PAUSED]
}
[BUFFERPUSH](chunk) {
if (this[OBJECTMODE]) this[BUFFERLENGTH] += 1
else this[BUFFERLENGTH] += chunk.length
this[BUFFER].push(chunk)
}
[BUFFERSHIFT]() {
if (this[OBJECTMODE]) this[BUFFERLENGTH] -= 1
else this[BUFFERLENGTH] -= this[BUFFER][0].length
return this[BUFFER].shift()
}
[FLUSH](noDrain) {
do {} while (this[FLUSHCHUNK](this[BUFFERSHIFT]()) && this[BUFFER].length)
if (!noDrain && !this[BUFFER].length && !this[EOF]) this.emit('drain')
}
[FLUSHCHUNK](chunk) {
this.emit('data', chunk)
return this.flowing
}
pipe(dest, opts) {
if (this[DESTROYED]) return
const ended = this[EMITTED_END]
opts = opts || {}
if (dest === proc.stdout || dest === proc.stderr) opts.end = false
else opts.end = opts.end !== false
opts.proxyErrors = !!opts.proxyErrors
// piping an ended stream ends immediately
if (ended) {
if (opts.end) dest.end()
} else {
this[PIPES].push(
!opts.proxyErrors
? new Pipe(this, dest, opts)
: new PipeProxyErrors(this, dest, opts)
)
if (this[ASYNC]) defer(() => this[RESUME]())
else this[RESUME]()
}
return dest
}
unpipe(dest) {
const p = this[PIPES].find(p => p.dest === dest)
if (p) {
this[PIPES].splice(this[PIPES].indexOf(p), 1)
p.unpipe()
}
}
addListener(ev, fn) {
return this.on(ev, fn)
}
on(ev, fn) {
const ret = super.on(ev, fn)
if (ev === 'data' && !this[PIPES].length && !this.flowing) this[RESUME]()
else if (ev === 'readable' && this[BUFFERLENGTH] !== 0)
super.emit('readable')
else if (isEndish(ev) && this[EMITTED_END]) {
super.emit(ev)
this.removeAllListeners(ev)
} else if (ev === 'error' && this[EMITTED_ERROR]) {
if (this[ASYNC]) defer(() => fn.call(this, this[EMITTED_ERROR]))
else fn.call(this, this[EMITTED_ERROR])
}
return ret
}
get emittedEnd() {
return this[EMITTED_END]
}
[MAYBE_EMIT_END]() {
if (
!this[EMITTING_END] &&
!this[EMITTED_END] &&
!this[DESTROYED] &&
this[BUFFER].length === 0 &&
this[EOF]
) {
this[EMITTING_END] = true
this.emit('end')
this.emit('prefinish')
this.emit('finish')
if (this[CLOSED]) this.emit('close')
this[EMITTING_END] = false
}
}
emit(ev, data, ...extra) {
// error and close are only events allowed after calling destroy()
if (ev !== 'error' && ev !== 'close' && ev !== DESTROYED && this[DESTROYED])
return
else if (ev === 'data') {
return !this[OBJECTMODE] && !data
? false
: this[ASYNC]
? defer(() => this[EMITDATA](data))
: this[EMITDATA](data)
} else if (ev === 'end') {
return this[EMITEND]()
} else if (ev === 'close') {
this[CLOSED] = true
// don't emit close before 'end' and 'finish'
if (!this[EMITTED_END] && !this[DESTROYED]) return
const ret = super.emit('close')
this.removeAllListeners('close')
return ret
} else if (ev === 'error') {
this[EMITTED_ERROR] = data
super.emit(ERROR, data)
const ret =
!this[SIGNAL] || this.listeners('error').length
? super.emit('error', data)
: false
this[MAYBE_EMIT_END]()
return ret
} else if (ev === 'resume') {
const ret = super.emit('resume')
this[MAYBE_EMIT_END]()
return ret
} else if (ev === 'finish' || ev === 'prefinish') {
const ret = super.emit(ev)
this.removeAllListeners(ev)
return ret
}
// Some other unknown event
const ret = super.emit(ev, data, ...extra)
this[MAYBE_EMIT_END]()
return ret
}
[EMITDATA](data) {
for (const p of this[PIPES]) {
if (p.dest.write(data) === false) this.pause()
}
const ret = super.emit('data', data)
this[MAYBE_EMIT_END]()
return ret
}
[EMITEND]() {
if (this[EMITTED_END]) return
this[EMITTED_END] = true
this.readable = false
if (this[ASYNC]) defer(() => this[EMITEND2]())
else this[EMITEND2]()
}
[EMITEND2]() {
if (this[DECODER]) {
const data = this[DECODER].end()
if (data) {
for (const p of this[PIPES]) {
p.dest.write(data)
}
super.emit('data', data)
}
}
for (const p of this[PIPES]) {
p.end()
}
const ret = super.emit('end')
this.removeAllListeners('end')
return ret
}
// const all = await stream.collect()
collect() {
const buf = []
if (!this[OBJECTMODE]) buf.dataLength = 0
// set the promise first, in case an error is raised
// by triggering the flow here.
const p = this.promise()
this.on('data', c => {
buf.push(c)
if (!this[OBJECTMODE]) buf.dataLength += c.length
})
return p.then(() => buf)
}
// const data = await stream.concat()
concat() {
return this[OBJECTMODE]
? Promise.reject(new Error('cannot concat in objectMode'))
: this.collect().then(buf =>
this[OBJECTMODE]
? Promise.reject(new Error('cannot concat in objectMode'))
: this[ENCODING]
? buf.join('')
: Buffer.concat(buf, buf.dataLength)
)
}
// stream.promise().then(() => done, er => emitted error)
promise() {
return new Promise((resolve, reject) => {
this.on(DESTROYED, () => reject(new Error('stream destroyed')))
this.on('error', er => reject(er))
this.on('end', () => resolve())
})
}
// for await (let chunk of stream)
[ASYNCITERATOR]() {
let stopped = false
const stop = () => {
this.pause()
stopped = true
return Promise.resolve({ done: true })
}
const next = () => {
if (stopped) return stop()
const res = this.read()
if (res !== null) return Promise.resolve({ done: false, value: res })
if (this[EOF]) return stop()
let resolve = null
let reject = null
const onerr = er => {
this.removeListener('data', ondata)
this.removeListener('end', onend)
this.removeListener(DESTROYED, ondestroy)
stop()
reject(er)
}
const ondata = value => {
this.removeListener('error', onerr)
this.removeListener('end', onend)
this.removeListener(DESTROYED, ondestroy)
this.pause()
resolve({ value: value, done: !!this[EOF] })
}
const onend = () => {
this.removeListener('error', onerr)
this.removeListener('data', ondata)
this.removeListener(DESTROYED, ondestroy)
stop()
resolve({ done: true })
}
const ondestroy = () => onerr(new Error('stream destroyed'))
return new Promise((res, rej) => {
reject = rej
resolve = res
this.once(DESTROYED, ondestroy)
this.once('error', onerr)
this.once('end', onend)
this.once('data', ondata)
})
}
return {
next,
throw: stop,
return: stop,
[ASYNCITERATOR]() {
return this
},
}
}
// for (let chunk of stream)
[ITERATOR]() {
let stopped = false
const stop = () => {
this.pause()
this.removeListener(ERROR, stop)
this.removeListener(DESTROYED, stop)
this.removeListener('end', stop)
stopped = true
return { done: true }
}
const next = () => {
if (stopped) return stop()
const value = this.read()
return value === null ? stop() : { value }
}
this.once('end', stop)
this.once(ERROR, stop)
this.once(DESTROYED, stop)
return {
next,
throw: stop,
return: stop,
[ITERATOR]() {
return this
},
}
}
destroy(er) {
if (this[DESTROYED]) {
if (er) this.emit('error', er)
else this.emit(DESTROYED)
return this
}
this[DESTROYED] = true
// throw away all buffered data, it's never coming out
this[BUFFER].length = 0
this[BUFFERLENGTH] = 0
if (typeof this.close === 'function' && !this[CLOSED]) this.close()
if (er) this.emit('error', er)
// if no error to emit, still reject pending promises
else this.emit(DESTROYED)
return this
}
static isStream(s) {
return (
!!s &&
(s instanceof Minipass ||
s instanceof Stream ||
(s instanceof EE &&
// readable
(typeof s.pipe === 'function' ||
// writable
(typeof s.write === 'function' && typeof s.end === 'function'))))
)
}
}
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('attempt', require('../attempt'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,116 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'prefer-literal-enum-member',
meta: {
type: 'suggestion',
docs: {
description: 'Require all enum members to be literal values',
recommended: 'strict',
requiresTypeChecking: false,
},
messages: {
notLiteral: `Explicit enum value must only be a literal value (string or number).`,
notLiteralOrBitwiseExpression: `Explicit enum value must only be a literal value (string or number) or a bitwise expression.`,
},
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
allowBitwiseExpressions: {
type: 'boolean',
description: 'Whether to allow using bitwise expressions in enum initializers.',
},
},
},
],
},
defaultOptions: [
{
allowBitwiseExpressions: false,
},
],
create(context, [{ allowBitwiseExpressions }]) {
function isIdentifierWithName(node, name) {
return node.type === utils_1.AST_NODE_TYPES.Identifier && node.name === name;
}
function hasEnumMember(decl, name) {
return decl.body.members.some(member => isIdentifierWithName(member.id, name) ||
(member.id.type === utils_1.AST_NODE_TYPES.Literal &&
(0, util_1.getStaticStringValue)(member.id) === name));
}
function isSelfEnumMember(decl, node) {
if (node.type === utils_1.AST_NODE_TYPES.Identifier) {
return hasEnumMember(decl, node.name);
}
if (node.type === utils_1.AST_NODE_TYPES.MemberExpression &&
isIdentifierWithName(node.object, decl.id.name)) {
if (node.property.type === utils_1.AST_NODE_TYPES.Identifier) {
return hasEnumMember(decl, node.property.name);
}
if (node.computed) {
const propertyName = (0, util_1.getStaticStringValue)(node.property);
if (propertyName) {
return hasEnumMember(decl, propertyName);
}
}
}
return false;
}
return {
TSEnumMember(node) {
// If there is no initializer, then this node is just the name of the member, so ignore.
if (node.initializer == null) {
return;
}
const declaration = node.parent.parent;
function isAllowedInitializerExpressionRecursive(node, partOfBitwiseComputation) {
// You can only refer to an enum member if it's part of a bitwise computation.
// so C = B isn't allowed (special case), but C = A | B is.
if (partOfBitwiseComputation && isSelfEnumMember(declaration, node)) {
return true;
}
switch (node.type) {
// any old literal
case utils_1.AST_NODE_TYPES.Literal:
return true;
// TemplateLiteral without expressions
case utils_1.AST_NODE_TYPES.TemplateLiteral:
return node.expressions.length === 0;
case utils_1.AST_NODE_TYPES.UnaryExpression:
// +123, -123, etc.
if (['-', '+'].includes(node.operator)) {
return isAllowedInitializerExpressionRecursive(node.argument, partOfBitwiseComputation);
}
if (allowBitwiseExpressions) {
return (node.operator === '~' &&
isAllowedInitializerExpressionRecursive(node.argument, true));
}
return false;
case utils_1.AST_NODE_TYPES.BinaryExpression:
if (allowBitwiseExpressions) {
return (['&', '^', '<<', '>>', '>>>', '|'].includes(node.operator) &&
isAllowedInitializerExpressionRecursive(node.left, true) &&
isAllowedInitializerExpressionRecursive(node.right, true));
}
return false;
default:
return false;
}
}
if (isAllowedInitializerExpressionRecursive(node.initializer, false)) {
return;
}
context.report({
node: node.id,
messageId: allowBitwiseExpressions
? 'notLiteralOrBitwiseExpression'
: 'notLiteral',
});
},
};
},
});
@@ -0,0 +1,24 @@
import arrayReduce from './_arrayReduce.js';
import deburr from './deburr.js';
import words from './words.js';
/** Used to compose unicode capture groups. */
var rsApos = "['\u2019]";
/** Used to match apostrophes. */
var reApos = RegExp(rsApos, 'g');
/**
* Creates a function like `_.camelCase`.
*
* @private
* @param {Function} callback The function to combine each word.
* @returns {Function} Returns the new compounder function.
*/
function createCompounder(callback) {
return function(string) {
return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
};
}
export default createCompounder;
@@ -0,0 +1 @@
module.exports={C:{"4":1.64738,"52":0.0397,"68":0.00662,"75":0.00662,"78":0.00662,"88":0.00662,"103":0.00662,"113":0.00662,"115":0.44327,"120":0.00662,"127":0.00662,"128":0.05954,"133":0.00662,"134":0.00662,"135":0.00662,"136":0.00662,"138":0.00662,"139":0.03308,"140":0.06616,"141":0.01985,"142":0.0397,"143":0.65498,"144":0.6219,_:"2 3 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 69 70 71 72 73 74 76 77 79 80 81 82 83 84 85 86 87 89 90 91 92 93 94 95 96 97 98 99 100 101 102 104 105 106 107 108 109 110 111 112 114 116 117 118 119 121 122 123 124 125 126 129 130 131 132 137 145 146 147 3.5 3.6"},D:{"39":0.01323,"40":0.01323,"41":0.01323,"42":0.01323,"43":0.01323,"44":0.01323,"45":0.01323,"46":0.01323,"47":0.01323,"48":0.01323,"49":0.02646,"50":0.01323,"51":0.01323,"52":0.01323,"53":0.01323,"54":0.01323,"55":0.01323,"56":0.01323,"57":0.01323,"58":0.01323,"59":0.01323,"60":0.01323,"65":0.00662,"69":0.00662,"71":0.00662,"72":0.00662,"73":0.05954,"75":0.00662,"76":0.01985,"79":0.01323,"81":0.01323,"83":0.01323,"84":0.00662,"85":0.02646,"86":0.00662,"87":0.01985,"88":0.00662,"89":0.00662,"90":0.00662,"91":0.01323,"93":0.01323,"96":0.00662,"97":0.03308,"98":0.01323,"99":0.00662,"100":0.00662,"101":0.00662,"102":0.00662,"103":0.0397,"104":0.01323,"106":0.00662,"107":0.00662,"108":0.01323,"109":2.77872,"110":0.01323,"111":0.01323,"112":13.53634,"113":0.00662,"114":0.01985,"115":0.00662,"116":0.06616,"117":0.00662,"118":0.00662,"119":0.01985,"120":0.02646,"121":0.02646,"122":0.08601,"123":0.00662,"124":0.01323,"125":11.16781,"126":1.1578,"127":0.02646,"128":0.06616,"129":0.02646,"130":0.0397,"131":0.07939,"132":0.05293,"133":0.05954,"134":0.07278,"135":0.05293,"136":0.10586,"137":0.11247,"138":0.25141,"139":0.22494,"140":4.43272,"141":12.0345,"142":0.17202,"143":0.00662,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 61 62 63 64 66 67 68 70 74 77 78 80 92 94 95 105 144 145"},F:{"79":0.00662,"91":0.01323,"92":0.14555,"95":0.13232,"114":0.00662,"117":0.00662,"120":0.11247,"121":0.18525,"122":1.81278,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 82 83 84 85 86 87 88 89 90 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 115 116 118 119 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"85":0.00662,"92":0.03308,"109":0.05954,"114":0.76084,"121":0.00662,"122":0.01323,"124":0.00662,"126":0.00662,"129":0.00662,"130":0.00662,"131":0.01985,"132":0.01323,"133":0.00662,"134":0.03308,"135":0.00662,"136":0.01323,"137":0.03308,"138":0.01985,"139":0.02646,"140":0.52928,"141":2.91104,"142":0.00662,_:"12 13 14 15 16 17 18 79 80 81 83 84 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 115 116 117 118 119 120 123 125 127 128"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 15.5 16.0 16.1 16.2 16.5 17.0 17.2 17.3 17.4 17.5 18.0 18.1 18.2 26.1 26.2","5.1":0.02646,"13.1":0.00662,"14.1":0.00662,"15.4":0.01323,"15.6":0.04631,"16.3":0.00662,"16.4":0.00662,"16.6":0.01985,"17.1":0.00662,"17.6":0.03308,"18.3":0.00662,"18.4":0.00662,"18.5-18.6":0.02646,"26.0":0.1257},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00027,"5.0-5.1":0,"6.0-6.1":0.00108,"7.0-7.1":0.00081,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00243,"10.0-10.2":0.00027,"10.3":0.00458,"11.0-11.2":0.06795,"11.3-11.4":0.00162,"12.0-12.1":0.00054,"12.2-12.5":0.01321,"13.0-13.1":0,"13.2":0.00135,"13.3":0.00054,"13.4-13.7":0.00216,"14.0-14.4":0.00458,"14.5-14.8":0.00485,"15.0-15.1":0.00458,"15.2-15.3":0.00351,"15.4":0.00404,"15.5":0.00458,"15.6-15.8":0.05986,"16.0":0.00809,"16.1":0.0151,"16.2":0.00782,"16.3":0.01402,"16.4":0.00351,"16.5":0.0062,"16.6-16.7":0.08008,"17.0":0.00566,"17.1":0.00863,"17.2":0.0062,"17.3":0.00917,"17.4":0.01618,"17.5":0.02777,"17.6-17.7":0.0701,"18.0":0.01591,"18.1":0.03289,"18.2":0.0178,"18.3":0.05716,"18.4":0.02939,"18.5-18.6":1.49858,"26.0":0.18523,"26.1":0.00674},P:{"21":0.01098,"23":0.01098,"25":0.01098,"26":0.02196,"27":0.01098,"28":0.46111,"29":0.03294,_:"4 20 22 24 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.02196},I:{"0":0.01013,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.00001},K:{"0":0.29432,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.01985,_:"6 7 8 9 10 5.5"},S:{"2.5":0.00338,_:"3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.12179},Q:{_:"14.9"},O:{"0":0.0203},H:{"0":0},L:{"0":35.75203}};
@@ -0,0 +1,3 @@
import { SchemaOptions } from '../schema/schema';
/** Creates TypeBox schematics using the configured InstanceMode */
export declare function CreateType(schema: Record<any, unknown>, options?: SchemaOptions): unknown;
@@ -0,0 +1,425 @@
/**
* @fileoverview Rule to flag statements without curly braces
* @author Nicholas C. Zakas
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description:
"Enforce consistent brace style for all control statements",
recommended: false,
frozen: true,
url: "https://eslint.org/docs/latest/rules/curly",
},
schema: {
anyOf: [
{
type: "array",
items: [
{
enum: ["all"],
},
],
minItems: 0,
maxItems: 1,
},
{
type: "array",
items: [
{
enum: ["multi", "multi-line", "multi-or-nest"],
},
{
enum: ["consistent"],
},
],
minItems: 0,
maxItems: 2,
},
],
},
defaultOptions: ["all"],
fixable: "code",
messages: {
missingCurlyAfter: "Expected { after '{{name}}'.",
missingCurlyAfterCondition:
"Expected { after '{{name}}' condition.",
unexpectedCurlyAfter: "Unnecessary { after '{{name}}'.",
unexpectedCurlyAfterCondition:
"Unnecessary { after '{{name}}' condition.",
},
},
create(context) {
const multiOnly = context.options[0] === "multi";
const multiLine = context.options[0] === "multi-line";
const multiOrNest = context.options[0] === "multi-or-nest";
const consistent = context.options[1] === "consistent";
const sourceCode = context.sourceCode;
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
/**
* Determines if a given node is a one-liner that's on the same line as it's preceding code.
* @param {ASTNode} node The node to check.
* @returns {boolean} True if the node is a one-liner that's on the same line as it's preceding code.
* @private
*/
function isCollapsedOneLiner(node) {
const before = sourceCode.getTokenBefore(node);
const last = sourceCode.getLastToken(node);
const lastExcludingSemicolon = astUtils.isSemicolonToken(last)
? sourceCode.getTokenBefore(last)
: last;
return (
before.loc.start.line === lastExcludingSemicolon.loc.end.line
);
}
/**
* Determines if a given node is a one-liner.
* @param {ASTNode} node The node to check.
* @returns {boolean} True if the node is a one-liner.
* @private
*/
function isOneLiner(node) {
if (node.type === "EmptyStatement") {
return true;
}
const first = sourceCode.getFirstToken(node);
const last = sourceCode.getLastToken(node);
const lastExcludingSemicolon = astUtils.isSemicolonToken(last)
? sourceCode.getTokenBefore(last)
: last;
return first.loc.start.line === lastExcludingSemicolon.loc.end.line;
}
/**
* Determines if a semicolon needs to be inserted after removing a set of curly brackets, in order to avoid a SyntaxError.
* @param {Token} closingBracket The } token
* @returns {boolean} `true` if a semicolon needs to be inserted after the last statement in the block.
*/
function needsSemicolon(closingBracket) {
const tokenBefore = sourceCode.getTokenBefore(closingBracket);
const tokenAfter = sourceCode.getTokenAfter(closingBracket);
const lastBlockNode = sourceCode.getNodeByRangeIndex(
tokenBefore.range[0],
);
if (astUtils.isSemicolonToken(tokenBefore)) {
// If the last statement already has a semicolon, don't add another one.
return false;
}
if (!tokenAfter) {
// If there are no statements after this block, there is no need to add a semicolon.
return false;
}
if (
lastBlockNode.type === "BlockStatement" &&
lastBlockNode.parent.type !== "FunctionExpression" &&
lastBlockNode.parent.type !== "ArrowFunctionExpression"
) {
/*
* If the last node surrounded by curly brackets is a BlockStatement (other than a FunctionExpression or an ArrowFunctionExpression),
* don't insert a semicolon. Otherwise, the semicolon would be parsed as a separate statement, which would cause
* a SyntaxError if it was followed by `else`.
*/
return false;
}
if (tokenBefore.loc.end.line === tokenAfter.loc.start.line) {
// If the next token is on the same line, insert a semicolon.
return true;
}
if (/^[([/`+-]/u.test(tokenAfter.value)) {
// If the next token starts with a character that would disrupt ASI, insert a semicolon.
return true;
}
if (
tokenBefore.type === "Punctuator" &&
(tokenBefore.value === "++" || tokenBefore.value === "--")
) {
// If the last token is ++ or --, insert a semicolon to avoid disrupting ASI.
return true;
}
// Otherwise, do not insert a semicolon.
return false;
}
/**
* Prepares to check the body of a node to see if it's a block statement.
* @param {ASTNode} node The node to report if there's a problem.
* @param {ASTNode} body The body node to check for blocks.
* @param {string} name The name to report if there's a problem.
* @param {{ condition: boolean }} opts Options to pass to the report functions
* @returns {Object} a prepared check object, with "actual", "expected", "check" properties.
* "actual" will be `true` or `false` whether the body is already a block statement.
* "expected" will be `true` or `false` if the body should be a block statement or not, or
* `null` if it doesn't matter, depending on the rule options. It can be modified to change
* the final behavior of "check".
* "check" will be a function reporting appropriate problems depending on the other
* properties.
*/
function prepareCheck(node, body, name, opts) {
const hasBlock = body.type === "BlockStatement";
let expected = null;
if (
hasBlock &&
(body.body.length !== 1 ||
astUtils.areBracesNecessary(body, sourceCode))
) {
expected = true;
} else if (multiOnly) {
expected = false;
} else if (multiLine) {
if (!isCollapsedOneLiner(body)) {
expected = true;
}
// otherwise, the body is allowed to have braces or not to have braces
} else if (multiOrNest) {
if (hasBlock) {
const statement = body.body[0];
const leadingCommentsInBlock =
sourceCode.getCommentsBefore(statement);
expected =
!isOneLiner(statement) ||
leadingCommentsInBlock.length > 0;
} else {
expected = !isOneLiner(body);
}
} else {
// default "all"
expected = true;
}
return {
actual: hasBlock,
expected,
check() {
if (
this.expected !== null &&
this.expected !== this.actual
) {
if (this.expected) {
context.report({
node,
loc: body.loc,
messageId:
opts && opts.condition
? "missingCurlyAfterCondition"
: "missingCurlyAfter",
data: {
name,
},
fix: fixer =>
fixer.replaceText(
body,
`{${sourceCode.getText(body)}}`,
),
});
} else {
context.report({
node,
loc: body.loc,
messageId:
opts && opts.condition
? "unexpectedCurlyAfterCondition"
: "unexpectedCurlyAfter",
data: {
name,
},
fix(fixer) {
/*
* `do while` expressions sometimes need a space to be inserted after `do`.
* e.g. `do{foo()} while (bar)` should be corrected to `do foo() while (bar)`
*/
const needsPrecedingSpace =
node.type === "DoWhileStatement" &&
sourceCode.getTokenBefore(body)
.range[1] === body.range[0] &&
!astUtils.canTokensBeAdjacent(
"do",
sourceCode.getFirstToken(body, {
skip: 1,
}),
);
const openingBracket =
sourceCode.getFirstToken(body);
const closingBracket =
sourceCode.getLastToken(body);
const lastTokenInBlock =
sourceCode.getTokenBefore(
closingBracket,
);
if (needsSemicolon(closingBracket)) {
/*
* If removing braces would cause a SyntaxError due to multiple statements on the same line (or
* change the semantics of the code due to ASI), don't perform a fix.
*/
return null;
}
const resultingBodyText =
sourceCode
.getText()
.slice(
openingBracket.range[1],
lastTokenInBlock.range[0],
) +
sourceCode.getText(lastTokenInBlock) +
sourceCode
.getText()
.slice(
lastTokenInBlock.range[1],
closingBracket.range[0],
);
return fixer.replaceText(
body,
(needsPrecedingSpace ? " " : "") +
resultingBodyText,
);
},
});
}
}
},
};
}
/**
* Prepares to check the bodies of a "if", "else if" and "else" chain.
* @param {ASTNode} node The first IfStatement node of the chain.
* @returns {Object[]} prepared checks for each body of the chain. See `prepareCheck` for more
* information.
*/
function prepareIfChecks(node) {
const preparedChecks = [];
for (
let currentNode = node;
currentNode;
currentNode = currentNode.alternate
) {
preparedChecks.push(
prepareCheck(currentNode, currentNode.consequent, "if", {
condition: true,
}),
);
if (
currentNode.alternate &&
currentNode.alternate.type !== "IfStatement"
) {
preparedChecks.push(
prepareCheck(
currentNode,
currentNode.alternate,
"else",
),
);
break;
}
}
if (consistent) {
/*
* If any node should have or already have braces, make sure they
* all have braces.
* If all nodes shouldn't have braces, make sure they don't.
*/
const expected = preparedChecks.some(preparedCheck => {
if (preparedCheck.expected !== null) {
return preparedCheck.expected;
}
return preparedCheck.actual;
});
preparedChecks.forEach(preparedCheck => {
preparedCheck.expected = expected;
});
}
return preparedChecks;
}
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
return {
IfStatement(node) {
const parent = node.parent;
const isElseIf =
parent.type === "IfStatement" && parent.alternate === node;
if (!isElseIf) {
// This is a top `if`, check the whole `if-else-if` chain
prepareIfChecks(node).forEach(preparedCheck => {
preparedCheck.check();
});
}
// Skip `else if`, it's already checked (when the top `if` was visited)
},
WhileStatement(node) {
prepareCheck(node, node.body, "while", {
condition: true,
}).check();
},
DoWhileStatement(node) {
prepareCheck(node, node.body, "do").check();
},
ForStatement(node) {
prepareCheck(node, node.body, "for", {
condition: true,
}).check();
},
ForInStatement(node) {
prepareCheck(node, node.body, "for-in").check();
},
ForOfStatement(node) {
prepareCheck(node, node.body, "for-of").check();
},
};
},
};
@@ -0,0 +1,13 @@
import type { Uint8Array_ } from '../types/index.js';
/**
* Generate a suitably random value to be used as user ID
*/
export declare function generateUserID(): Promise<Uint8Array_>;
/**
* Make it possible to stub the return value during testing
* @ignore Don't include this in docs output
*/
export declare const _generateUserIDInternals: {
stubThis: (value: Uint8Array_) => Uint8Array;
};
//# sourceMappingURL=generateUserID.d.ts.map
@@ -0,0 +1,3 @@
export declare class NodeIO3MiscListener {
getOnAmgomDataPiece(..._arg: unknown[]): any;
}
@@ -0,0 +1,735 @@
export default `flf2a$ 7 6 20 0 19
"Red Phoenix" font by Red Phoenix
====================================
-> Conversion to FigLet font by MEPH. (Part of ASCII Editor Service Pack I)
(http://studenten.freepage.de/meph/ascii/ascii/editor/_index.htm)
-> Defined: ASCII code alphanumeric + most used symbols
ScarecrowsASCIIArtArchive
From: Purdie@zeus.usq.edu.au (Red Phoenix)
[Here's a nice font, which I've used (in a modified form) for one of my sigs.]
---
Font modified June 17, 2007 by patorjk
I changed the "smushing" rules from the original font, so the letters would
fit together.
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
._. @
| | @
| | @
\\| @
__ @
\\/ @
@@
/\\/\\ @
)/)/ @
@
@
@
@
@@
_ _ @
__| || |__ @
\\ __ / @
| || | @
/_ ~~ _\\ @
|_||_| @
@@
____/\\__ @
/ / /_/ @
\\__/ / \\ @
/ / / \\ @
/_/ /__ / @
\\/ \\/ @
@@
_ /\\ @
/ \\ / / @
\\_// /_ @
/ // \\ @
/ / \\_/ @
\\/ @
@@
____ @
/ _ \\ @
> _ </\\ @
/ <_\\ \\/ @
\\_____\\ \\ @
\\/ @
@@
/\\ @
\\( @
@
@
@
@
@@
___ @
/ / @
/ / @
( ( @
\\ \\ @
\\__\\ @
@@
___ @
\\ \\ @
\\ \\ @
) ) @
/ / @
/__/ @
@@
@
/\\|\\/\\ @
_) (__ @
\\_ _/ @
) \\ @
\\/\\|\\/ @
@@
@
.__ @
__| |___ @
__ __/ @
|__| @
@
@@
@
@
@
@
/\\ @
)/ @
@@
@
@
______ @
/_____/ @
@
@
@@
@
@
@
@
/\\ @
\\/ @
@@
/\\ @
/ / @
/ / @
/ / @
/ / @
\\/ @
@@
_______ @
\\ _ \\ @
/ /_\\ \\ @
\\ \\_/ \\ @
\\_____ / @
\\/ @
@@
____ @
/_ | @
| | @
| | @
|___| @
@
@@
________ @
\\_____ \\ @
/ ____/ @
/ \\ @
\\_______ \\ @
\\/ @
@@
________ @
\\_____ \\ @
_(__ < @
/ \\ @
/______ / @
\\/ @
@@
_____ @
/ | | @
/ | |_ @
/ ^ / @
\\____ | @
|__| @
@@
.________ @
| ____/ @
|____ \\ @
/ \\ @
/______ / @
\\/ @
@@
________ @
/ _____/ @
/ __ \\ @
\\ |__\\ \\ @
\\_____ / @
\\/ @
@@
_________ @
\\______ \\ @
/ / @
/ / @
/____/ @
@
@@
______ @
/ __ \\ @
> < @
/ -- \\ @
\\______ / @
\\/ @
@@
________ @
/ __ \\ @
\\____ / @
/ / @
/____/ @
@
@@
@
/\\ @
\\/ @
/\\ @
\\/ @
@
@@
@
/\\ @
\\/ @
/\\ @
)/ @
@
@@
__ @
/ / @
/ / @
\\ \\ @
\\_\\ @
@
@@
@
______ @
/_____/ @
/_____/ @
@
@
@@
__ @
\\ \\ @
\\ \\ @
/ / @
/_/ @
@
@@
_________ @
\\_____ \\ @
/ __/ @
| | @
|___| @
<___> @
@@
_____ @
/ ___ \\ @
/ / ._\\ \\ @
< \\_____/ @
\\_____\\ @
@
@@
_____ @
/ _ \\ @
/ /_\\ \\ @
/ | \\ @
\\____|__ / @
\\/ @
@@
__________ @
\\______ \\ @
| | _/ @
| | \\ @
|______ / @
\\/ @
@@
_________ @
\\_ ___ \\ @
/ \\ \\/ @
\\ \\____ @
\\______ / @
\\/ @
@@
________ @
\\______ \\ @
| | \\ @
| \` \\ @
/_______ / @
\\/ @
@@
___________ @
\\_ _____/ @
| __)_ @
| \\ @
/_______ / @
\\/ @
@@
___________ @
\\_ _____/ @
| __) @
| \\ @
\\___ / @
\\/ @
@@
________ @
/ _____/ @
/ \\ ___ @
\\ \\_\\ \\ @
\\______ / @
\\/ @
@@
___ ___ @
/ | \\ @
/ ~ \\ @
\\ Y / @
\\___|_ / @
\\/ @
@@
.___ @
| | @
| | @
| | @
|___| @
@
@@
____. @
| | @
| | @
/\\__| | @
\\________| @
@
@@
____ __. @
| |/ _| @
| < @
| | \\ @
|____|__ \\ @
\\/ @
@@
.____ @
| | @
| | @
| |___ @
|_______ \\ @
\\/ @
@@
_____ @
/ \\ @
/ \\ / \\ @
/ Y \\ @
\\____|__ / @
\\/ @
@@
_______ @
\\ \\ @
/ | \\ @
/ | \\ @
\\____|__ / @
\\/ @
@@
________ @
\\_____ \\ @
/ | \\ @
/ | \\ @
\\_______ / @
\\/ @
@@
__________ @
\\______ \\ @
| ___/ @
| | @
|____| @
@
@@
________ @
\\_____ \\ @
/ / \\ \\ @
/ \\_/. \\ @
\\_____\\ \\_/ @
\\__> @
@@
__________ @
\\______ \\ @
| _/ @
| | \\ @
|____|_ / @
\\/ @
@@
_________ @
/ _____/ @
\\_____ \\ @
/ \\ @
/_______ / @
\\/ @
@@
___________ @
\\__ ___/ @
| | @
| | @
|____| @
@
@@
____ ___ @
| | \\ @
| | / @
| | / @
|______/ @
@
@@
____ ____ @
\\ \\ / / @
\\ Y / @
\\ / @
\\___/ @
@
@@
__ __ @
/ \\ / \\ @
\\ \\/\\/ / @
\\ / @
\\__/\\ / @
\\/ @
@@
____ ___ @
\\ \\/ / @
\\ / @
/ \\ @
/___/\\ \\ @
\\_/ @
@@
_____.___. @
\\__ | | @
/ | | @
\\____ | @
/ ______| @
\\/ @
@@
__________ @
\\____ / @
/ / @
/ /_ @
/_______ \\ @
\\/ @
@@
.____ @
| _| @
| | @
| | @
| |_ @
|____| @
@@
/\\ @
\\ \\ @
\\ \\ @
\\ \\ @
\\ \\ @
\\/ @
@@
____. @
|_ | @
| | @
| | @
_| | @
|____| @
@@
/\\ @
/ \\ @
\\/\\/ @
@
@
@
@@
@
@
@
@
______ @
/_____/ @
@@
/\\ @
\\( @
@
@
@
@
@@
@
_____ @
\\__ \\ @
/ __ \\_ @
(____ / @
\\/ @
@@
___. @
\\_ |__ @
| __ \\ @
| \\_\\ \\ @
|___ / @
\\/ @
@@
@
____ @
_/ ___\\ @
\\ \\___ @
\\___ > @
\\/ @
@@
.___ @
__| _/ @
/ __ | @
/ /_/ | @
\\____ | @
\\/ @
@@
@
____ @
_/ __ \\ @
\\ ___/ @
\\___ > @
\\/ @
@@
_____ @
_/ ____\\ @
\\ __\\ @
| | @
|__| @
@
@@
____ @
/ ___\\ @
/ /_/ > @
\\___ / @
/_____/ @
@
@@
.__ @
| |__ @
| | \\ @
| Y \\ @
|___| / @
\\/ @
@@
.__ @
|__| @
| | @
| | @
|__| @
@
@@
__ @
|__| @
| | @
| | @
/\\__| | @
\\______| @
@@
__ @
| | __ @
| |/ / @
| < @
|__|_ \\ @
\\/ @
@@
.__ @
| | @
| | @
| |__ @
|____/ @
@
@@
@
_____ @
/ \\ @
| Y Y \\ @
|__|_| / @
\\/ @
@@
@
____ @
/ \\ @
| | \\ @
|___| / @
\\/ @
@@
@
____ @
/ _ \\ @
( <_> ) @
\\____/ @
@
@@
@
______ @
\\____ \\ @
| |_> > @
| __/ @
|__| @
@@
@
______ @
/ ____/ @
< <_| | @
\\__ | @
|__| @
@@
@
_______ @
\\_ __ \\ @
| | \\/ @
|__| @
@
@@
@
______ @
/ ___/ @
\\___ \\ @
/____ > @
\\/ @
@@
__ @
_/ |_ @
\\ __\\ @
| | @
|__| @
@
@@
@
__ __ @
| | \\ @
| | / @
|____/ @
@
@@
@
___ __ @
\\ \\/ / @
\\ / @
\\_/ @
@
@@
@
__ _ __ @
\\ \\/ \\/ / @
\\ / @
\\/\\_/ @
@
@@
@
___ ___ @
\\ \\/ / @
> < @
/__/\\_ \\ @
\\/ @
@@
@
___.__. @
< | | @
\\___ | @
/ ____| @
\\/ @
@@
@
________ @
\\___ / @
/ / @
/_____ \\ @
\\/ @
@@
___ @
/ / @
\\ \\ @
< < @
/ / @
\\_\\_ @
@@
._. @
| | @
|_| @
|-| @
| | @
|_| @
@@
___ @
\\ \\ @
/ / @
> > @
\\ \\ @
_/_/ @
@@
___ @
/ _ \\_/\\ @
\\/ \\___/ @
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
`
@@ -0,0 +1,43 @@
/**
* The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better.
*
* Specifically:
* - Runtime code from https://github.com/lukeed/clsx/blob/v1.2.1/src/index.js
* - TypeScript types from https://github.com/lukeed/clsx/blob/v1.2.1/clsx.d.ts
*
* Original code has MIT license: Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
*/
function twJoin() {
var index = 0;
var argument;
var resolvedValue;
var string = '';
while (index < arguments.length) {
if (argument = arguments[index++]) {
if (resolvedValue = toValue(argument)) {
string && (string += ' ');
string += resolvedValue;
}
}
}
return string;
}
function toValue(mix) {
if (typeof mix === 'string') {
return mix;
}
var resolvedValue;
var string = '';
for (var k = 0; k < mix.length; k++) {
if (mix[k]) {
if (resolvedValue = toValue(mix[k])) {
string && (string += ' ');
string += resolvedValue;
}
}
}
return string;
}
export { twJoin };
//# sourceMappingURL=tw-join.mjs.map
@@ -0,0 +1,29 @@
{
"name": "expand-template",
"version": "2.0.3",
"description": "Expand placeholders in a template string",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/ralphtheninja/expand-template.git"
},
"homepage": "https://github.com/ralphtheninja/expand-template",
"scripts": {
"test": "tape test.js && standard"
},
"keywords": [
"template",
"expand",
"replace"
],
"author": "LM <ralphtheninja@riseup.net>",
"license": "(MIT OR WTFPL)",
"dependencies": {},
"devDependencies": {
"standard": "^12.0.0",
"tape": "^4.2.2"
},
"engines": {
"node": ">=6"
}
}
@@ -0,0 +1 @@
{"version":3,"names":["helpers","data","require","_generator","_template","_t","arrayExpression","assignmentExpression","binaryExpression","blockStatement","callExpression","cloneNode","conditionalExpression","exportNamedDeclaration","exportSpecifier","expressionStatement","functionExpression","identifier","memberExpression","objectExpression","program","stringLiteral","unaryExpression","variableDeclaration","variableDeclarator","buildUmdWrapper","replacements","template","statement","buildGlobal","allowlist","namespace","body","container","tree","push","buildHelpers","buildModule","refs","unshift","Object","keys","map","name","buildUmd","FACTORY_PARAMETERS","BROWSER_ARGUMENTS","COMMON_ARGUMENTS","AMD_ARGUMENTS","FACTORY_BODY","UMD_ROOT","buildVar","getHelperReference","list","forEach","includes","ref","nodes","get","ast","exportName","mapExportBindingAssignments","node","_default","outputType","build","global","module","umd","var","Error","generator","code"],"sources":["../../src/tools/build-external-helpers.ts"],"sourcesContent":["import * as helpers from \"@babel/helpers\";\nimport generator from \"@babel/generator\";\nimport template from \"@babel/template\";\nimport {\n arrayExpression,\n assignmentExpression,\n binaryExpression,\n blockStatement,\n callExpression,\n cloneNode,\n conditionalExpression,\n exportNamedDeclaration,\n exportSpecifier,\n expressionStatement,\n functionExpression,\n identifier,\n memberExpression,\n objectExpression,\n program,\n stringLiteral,\n unaryExpression,\n variableDeclaration,\n variableDeclarator,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport type { Replacements } from \"@babel/template\";\n\n// Wrapped to avoid wasting time parsing this when almost no-one uses\n// build-external-helpers.\nconst buildUmdWrapper = (replacements: Replacements) =>\n template.statement`\n (function (root, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(AMD_ARGUMENTS, factory);\n } else if (typeof exports === \"object\") {\n factory(COMMON_ARGUMENTS);\n } else {\n factory(BROWSER_ARGUMENTS);\n }\n })(UMD_ROOT, function (FACTORY_PARAMETERS) {\n FACTORY_BODY\n });\n `(replacements);\n\nfunction buildGlobal(allowlist?: Array<string>) {\n const namespace = identifier(\"babelHelpers\");\n\n const body: t.Statement[] = [];\n const container = functionExpression(\n null,\n [identifier(\"global\")],\n blockStatement(body),\n );\n const tree = program([\n expressionStatement(\n callExpression(container, [\n // typeof global === \"undefined\" ? self : global\n conditionalExpression(\n binaryExpression(\n \"===\",\n unaryExpression(\"typeof\", identifier(\"global\")),\n stringLiteral(\"undefined\"),\n ),\n identifier(\"self\"),\n identifier(\"global\"),\n ),\n ]),\n ),\n ]);\n\n body.push(\n variableDeclaration(\"var\", [\n variableDeclarator(\n namespace,\n assignmentExpression(\n \"=\",\n memberExpression(identifier(\"global\"), namespace),\n objectExpression([]),\n ),\n ),\n ]),\n );\n\n buildHelpers(body, namespace, allowlist);\n\n return tree;\n}\n\nfunction buildModule(allowlist?: Array<string>) {\n const body: t.Statement[] = [];\n const refs = buildHelpers(body, null, allowlist);\n\n body.unshift(\n exportNamedDeclaration(\n null,\n Object.keys(refs).map(name => {\n return exportSpecifier(cloneNode(refs[name]), identifier(name));\n }),\n ),\n );\n\n return program(body, [], \"module\");\n}\n\nfunction buildUmd(allowlist?: Array<string>) {\n const namespace = identifier(\"babelHelpers\");\n\n const body: t.Statement[] = [];\n body.push(\n variableDeclaration(\"var\", [\n variableDeclarator(namespace, identifier(\"global\")),\n ]),\n );\n\n buildHelpers(body, namespace, allowlist);\n\n return program([\n buildUmdWrapper({\n FACTORY_PARAMETERS: identifier(\"global\"),\n BROWSER_ARGUMENTS: assignmentExpression(\n \"=\",\n memberExpression(identifier(\"root\"), namespace),\n objectExpression([]),\n ),\n COMMON_ARGUMENTS: identifier(\"exports\"),\n AMD_ARGUMENTS: arrayExpression([stringLiteral(\"exports\")]),\n FACTORY_BODY: body,\n UMD_ROOT: identifier(\"this\"),\n }),\n ]);\n}\n\nfunction buildVar(allowlist?: Array<string>) {\n const namespace = identifier(\"babelHelpers\");\n\n const body: t.Statement[] = [];\n body.push(\n variableDeclaration(\"var\", [\n variableDeclarator(namespace, objectExpression([])),\n ]),\n );\n const tree = program(body);\n buildHelpers(body, namespace, allowlist);\n body.push(expressionStatement(namespace));\n return tree;\n}\n\nfunction buildHelpers(\n body: t.Statement[],\n namespace: t.Expression,\n allowlist?: ArLine truncated
@@ -0,0 +1,134 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { ICoreBrowserService, IRenderService } from 'browser/services/Services';
import { Disposable, toDisposable } from 'common/Lifecycle';
import { IBufferService, IDecorationService, IInternalDecoration } from 'common/services/Services';
export class BufferDecorationRenderer extends Disposable {
private readonly _container: HTMLElement;
private readonly _decorationElements: Map<IInternalDecoration, HTMLElement> = new Map();
private _animationFrame: number | undefined;
private _altBufferIsActive: boolean = false;
private _dimensionsChanged: boolean = false;
constructor(
private readonly _screenElement: HTMLElement,
@IBufferService private readonly _bufferService: IBufferService,
@ICoreBrowserService private readonly _coreBrowserService: ICoreBrowserService,
@IDecorationService private readonly _decorationService: IDecorationService,
@IRenderService private readonly _renderService: IRenderService
) {
super();
this._container = document.createElement('div');
this._container.classList.add('xterm-decoration-container');
this._screenElement.appendChild(this._container);
this.register(this._renderService.onRenderedViewportChange(() => this._doRefreshDecorations()));
this.register(this._renderService.onDimensionsChange(() => {
this._dimensionsChanged = true;
this._queueRefresh();
}));
this.register(this._coreBrowserService.onDprChange(() => this._queueRefresh()));
this.register(this._bufferService.buffers.onBufferActivate(() => {
this._altBufferIsActive = this._bufferService.buffer === this._bufferService.buffers.alt;
}));
this.register(this._decorationService.onDecorationRegistered(() => this._queueRefresh()));
this.register(this._decorationService.onDecorationRemoved(decoration => this._removeDecoration(decoration)));
this.register(toDisposable(() => {
this._container.remove();
this._decorationElements.clear();
}));
}
private _queueRefresh(): void {
if (this._animationFrame !== undefined) {
return;
}
this._animationFrame = this._renderService.addRefreshCallback(() => {
this._doRefreshDecorations();
this._animationFrame = undefined;
});
}
private _doRefreshDecorations(): void {
for (const decoration of this._decorationService.decorations) {
this._renderDecoration(decoration);
}
this._dimensionsChanged = false;
}
private _renderDecoration(decoration: IInternalDecoration): void {
this._refreshStyle(decoration);
if (this._dimensionsChanged) {
this._refreshXPosition(decoration);
}
}
private _createElement(decoration: IInternalDecoration): HTMLElement {
const element = this._coreBrowserService.mainDocument.createElement('div');
element.classList.add('xterm-decoration');
element.classList.toggle('xterm-decoration-top-layer', decoration?.options?.layer === 'top');
element.style.width = `${Math.round((decoration.options.width || 1) * this._renderService.dimensions.css.cell.width)}px`;
element.style.height = `${(decoration.options.height || 1) * this._renderService.dimensions.css.cell.height}px`;
element.style.top = `${(decoration.marker.line - this._bufferService.buffers.active.ydisp) * this._renderService.dimensions.css.cell.height}px`;
element.style.lineHeight = `${this._renderService.dimensions.css.cell.height}px`;
const x = decoration.options.x ?? 0;
if (x && x > this._bufferService.cols) {
// exceeded the container width, so hide
element.style.display = 'none';
}
this._refreshXPosition(decoration, element);
return element;
}
private _refreshStyle(decoration: IInternalDecoration): void {
const line = decoration.marker.line - this._bufferService.buffers.active.ydisp;
if (line < 0 || line >= this._bufferService.rows) {
// outside of viewport
if (decoration.element) {
decoration.element.style.display = 'none';
decoration.onRenderEmitter.fire(decoration.element);
}
} else {
let element = this._decorationElements.get(decoration);
if (!element) {
element = this._createElement(decoration);
decoration.element = element;
this._decorationElements.set(decoration, element);
this._container.appendChild(element);
decoration.onDispose(() => {
this._decorationElements.delete(decoration);
element!.remove();
});
}
element.style.top = `${line * this._renderService.dimensions.css.cell.height}px`;
element.style.display = this._altBufferIsActive ? 'none' : 'block';
decoration.onRenderEmitter.fire(element);
}
}
private _refreshXPosition(decoration: IInternalDecoration, element: HTMLElement | undefined = decoration.element): void {
if (!element) {
return;
}
const x = decoration.options.x ?? 0;
if ((decoration.options.anchor || 'left') === 'right') {
element.style.right = x ? `${x * this._renderService.dimensions.css.cell.width}px` : '';
} else {
element.style.left = x ? `${x * this._renderService.dimensions.css.cell.width}px` : '';
}
}
private _removeDecoration(decoration: IInternalDecoration): void {
this._decorationElements.get(decoration)?.remove();
this._decorationElements.delete(decoration);
decoration.dispose();
}
}
@@ -0,0 +1,27 @@
var $ezjoC$react = require("react");
function $parcel$interopDefault(a) {
return a && a.__esModule ? a.default : a;
}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useLayoutEffect", () => $78605a5d7424e31b$export$e5c5a5f917a5871c);
/*
* 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.
*/
const $78605a5d7424e31b$export$e5c5a5f917a5871c = typeof document !== 'undefined' ? (0, ($parcel$interopDefault($ezjoC$react))).useLayoutEffect : ()=>{};
//# sourceMappingURL=useLayoutEffect.main.js.map
@@ -0,0 +1,21 @@
/**
* This method returns the first argument it receives.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {*} value Any value.
* @returns {*} Returns `value`.
* @example
*
* var object = { 'a': 1 };
*
* console.log(_.identity(object) === object);
* // => true
*/
function identity(value) {
return value;
}
module.exports = identity;
@@ -0,0 +1,31 @@
import { FileElement, GrayTipElement, InstanceContext, MessageElement, NapCatCore, RawMessage, TipGroupElement } from '../../napcat-core';
import { OB11GroupBanEvent } from '../event/notice/OB11GroupBanEvent';
import { OB11GroupMsgEmojiLikeEvent } from '../event/notice/OB11MsgEmojiLikeEvent';
import { OB11GroupCardEvent } from '../event/notice/OB11GroupCardEvent';
import { OB11GroupPokeEvent } from '../event/notice/OB11PokeEvent';
import { OB11GroupEssenceEvent } from '../event/notice/OB11GroupEssenceEvent';
import { OB11GroupTitleEvent } from '../event/notice/OB11GroupTitleEvent';
import { OB11GroupGrayTipEvent } from '../event/notice/OB11GroupGrayTipEvent';
import { OB11GroupUploadNoticeEvent } from '../event/notice/OB11GroupUploadNoticeEvent';
import { OB11GroupNameEvent } from '../event/notice/OB11GroupNameEvent';
import { OB11GroupIncreaseEvent } from '../event/notice/OB11GroupIncreaseEvent';
import { NapCatOneBot11Adapter } from '..';
export declare class OneBotGroupApi {
obContext: NapCatOneBot11Adapter;
core: NapCatCore;
constructor(obContext: NapCatOneBot11Adapter, core: NapCatCore);
parseGroupBanEvent(GroupCode: string, grayTipElement: GrayTipElement): Promise<OB11GroupBanEvent | undefined>;
parseGroupEmojiLikeEventByGrayTip(groupCode: string, grayTipElement: GrayTipElement): Promise<OB11GroupMsgEmojiLikeEvent | undefined>;
createGroupEmojiLikeEvent(groupCode: string, senderUin: string, msgSeq: string, emojiId: string, isAdd?: boolean, count?: number): Promise<OB11GroupMsgEmojiLikeEvent | undefined>;
parseCardChangedEvent(msg: RawMessage): Promise<OB11GroupCardEvent | undefined>;
registerParseGroupReactEvent(): Promise<void>;
registerParseGroupReactEventByCore(): Promise<void>;
parsePaiYiPai(msg: RawMessage, jsonStr: string): Promise<OB11GroupPokeEvent | undefined>;
parseOtherJsonEvent(msg: RawMessage, jsonGrayTipElement: GrayTipElement['jsonGrayTipElement'], context: InstanceContext): Promise<OB11GroupTitleEvent | OB11GroupGrayTipEvent | undefined>;
parseEssenceMsg(msg: RawMessage, jsonStr: string): Promise<OB11GroupEssenceEvent | undefined>;
parseGroupUploadFileEvene(msg: RawMessage, element: FileElement, elementWrapper: MessageElement): Promise<OB11GroupUploadNoticeEvent>;
parseGroupElement(msg: RawMessage, element: TipGroupElement, elementWrapper: GrayTipElement): Promise<OB11GroupBanEvent | OB11GroupNameEvent | OB11GroupIncreaseEvent | undefined>;
parseSelfInviteEvent(msg: RawMessage, inviterUin: string, inviteeUin: string): Promise<OB11GroupIncreaseEvent>;
parse51TypeEvent(msg: RawMessage, grayTipElement: GrayTipElement): Promise<OB11GroupIncreaseEvent | undefined>;
parseGrayTipElement(msg: RawMessage, grayTipElement: GrayTipElement): Promise<OB11GroupPokeEvent | OB11GroupBanEvent | OB11GroupMsgEmojiLikeEvent | OB11GroupEssenceEvent | OB11GroupTitleEvent | OB11GroupGrayTipEvent | OB11GroupNameEvent | OB11GroupIncreaseEvent | undefined>;
}
@@ -0,0 +1,615 @@
flf2a$ 6 5 20 -1 2
Contrast Font by Dennis Monk 7/94
Original font, I think. Maybe inspired by one of Scarecrow's .sigs.
........@
........@
........@
........@
........@
........@@
...%%...@
...%%...@
...%%...@
........@
...%%...@
........@@
.%%..%%.@
.%%..%%.@
..%..%..@
........@
........@
........@@
..%..%..@
.%%%%%%.@
..%..%..@
.%%%%%%.@
..%..%..@
........@@
..%%%%%.@
.%%.%...@
..%%%%..@
...%.%%.@
.%%%%%..@
........@@
.%%..%%.@
.%..%%..@
...%%...@
..%%..%.@
.%%..%%.@
........@@
..%%%%%..@
.%%...%%.@
..%%.%%..@
.%%.%%.%.@
..%%%%%..@
.........@@
...%%...@
...%%...@
....%...@
........@
........@
........@@
....%%%.@
..%%....@
.%......@
..%%....@
....%%%.@
........@@
.%%%....@
....%%..@
......%.@
....%%..@
.%%%....@
........@@
.%..%..%.@
..%.%.%..@
.%%%%%%%.@
..%.%.%..@
.%..%..%.@
.........@@
...%%...@
...%%...@
.%%%%%%.@
...%%...@
...%%...@
........@@
........@
........@
...%%...@
...%%...@
....%...@
........@@
........@
........@
.%%%%%%.@
........@
........@
........@@
........@
........@
........@
...%%...@
...%%...@
........@@
.....%%.@
....%%..@
...%%...@
..%%....@
.%%.....@
........@@
..%%%%..@
.%%..%%.@
.%%%%%%.@
.%%..%%.@
..%%%%..@
........@@
...%%...@
..%%%...@
...%%...@
...%%...@
.%%%%%%.@
........@@
..%%%%..@
.....%%.@
..%%%%..@
.%%.....@
.%%%%%%.@
........@@
.%%%%%%.@
....%%..@
...%%%..@
.....%%.@
.%%%%%..@
........@@
.....%%.@
.%%..%%.@
.%%%%%%.@
.....%%.@
.....%%.@
........@@
.%%%%%%.@
.%%.....@
..%%%%..@
.....%%.@
.%%%%%..@
........@@
...%%...@
..%%....@
.%%%%%..@
.%%..%%.@
..%%%%..@
........@@
.%%%%%%.@
....%%..@
...%%...@
..%%....@
.%%.....@
........@@
..%%%%..@
.%%..%%.@
..%%%%..@
.%%..%%.@
..%%%%..@
........@@
..%%%%..@
.%%..%%.@
..%%%%..@
...%%...@
..%%....@
........@@
........@
...%%...@
........@
...%%...@
........@
........@@
........@
...%%...@
........@
...%%...@
....%...@
........@@
.....%%.@
...%%...@
.%%.....@
...%%...@
.....%%.@
........@@
........@
.%%%%%%.@
........@
.%%%%%%.@
........@
........@@
.%%.....@
...%%...@
.....%%.@
...%%...@
.%%.....@
........@@
..%%%%..@
.%%..%%.@
....%%..@
...%%...@
...%%...@
........@@
..%%%%..@
.%.%%.%.@
.%.%%.%.@
.%..%.%.@
..%%%%..@
........@@
..%%%%..@
.%%..%%.@
.%%%%%%.@
.%%..%%.@
.%%..%%.@
........@@
.%%%%%..@
.%%..%%.@
.%%%%%..@
.%%..%%.@
.%%%%%..@
........@@
..%%%%..@
.%%..%%.@
.%%.....@
.%%..%%.@
..%%%%..@
........@@
.%%%%%..@
.%%..%%.@
.%%..%%.@
.%%..%%.@
.%%%%%..@
........@@
.%%%%%%.@
.%%.....@
.%%%%...@
.%%.....@
.%%%%%%.@
........@@
.%%%%%%.@
.%%.....@
.%%%%...@
.%%.....@
.%%.....@
........@@
..%%%%..@
.%%.....@
.%%.%%%.@
.%%..%%.@
..%%%%..@
........@@
.%%..%%.@
.%%..%%.@
.%%%%%%.@
.%%..%%.@
.%%..%%.@
........@@
.%%%%%%.@
...%%...@
...%%...@
...%%...@
.%%%%%%.@
........@@
.%%%%%%.@
.....%%.@
.....%%.@
.%%..%%.@
..%%%%..@
........@@
.%%..%%.@
.%%.%%..@
.%%%%...@
.%%.%%..@
.%%..%%.@
........@@
.%%.....@
.%%.....@
.%%.....@
.%%.....@
.%%%%%%.@
........@@
.%%...%%.@
.%%%.%%%.@
.%%.%.%%.@
.%%...%%.@
.%%...%%.@
.........@@
.%%..%%.@
.%%%.%%.@
.%%.%%%.@
.%%..%%.@
.%%..%%.@
........@@
..%%%%..@
.%%..%%.@
.%%..%%.@
.%%..%%.@
..%%%%..@
........@@
.%%%%%..@
.%%..%%.@
.%%%%%..@
.%%.....@
.%%.....@
........@@
..%%%%..@
.%%..%%.@
.%%.%%%.@
.%%..%%.@
..%%%%%.@
........@@
.%%%%%..@
.%%..%%.@
.%%%%%..@
.%%..%%.@
.%%..%%.@
........@@
..%%%%..@
.%%.....@
..%%%%..@
.....%%.@
..%%%%..@
........@@
.%%%%%%.@
...%%...@
...%%...@
...%%...@
...%%...@
........@@
.%%..%%.@
.%%..%%.@
.%%..%%.@
.%%..%%.@
..%%%%..@
........@@
.%%..%%.@
.%%..%%.@
.%%..%%.@
..%%%%..@
...%%...@
........@@
.%%...%%.@
.%%...%%.@
.%%.%.%%.@
.%%%%%%%.@
..%%.%%..@
.........@@
.%%..%%.@
..%%%%..@
...%%...@
..%%%%..@
.%%..%%.@
........@@
.%%..%%.@
..%%%%..@
...%%...@
...%%...@
...%%...@
........@@
.%%%%%%.@
....%%..@
...%%...@
..%%....@
.%%%%%%.@
........@@
.%%%%%%.@
.%%.....@
.%%.....@
.%%.....@
.%%%%%%.@
........@@
.%%.....@
..%%....@
...%%...@
....%%..@
.....%%.@
........@@
.%%%%%%.@
.....%%.@
.....%%.@
.....%%.@
.%%%%%%.@
........@@
...%%...@
..%%%%..@
.%%..%%.@
........@
........@
........@@
........@
........@
........@
........@
.%%%%%%.@
........@@
...%%...@
...%%...@
...%....@
........@
........@
........@@
..%%%%..@
.%%..%%.@
.%%%%%%.@
.%%..%%.@
.%%..%%.@
........@@
.%%%%%..@
.%%..%%.@
.%%%%%..@
.%%..%%.@
.%%%%%..@
........@@
..%%%%..@
.%%..%%.@
.%%.....@
.%%..%%.@
..%%%%..@
........@@
.%%%%%..@
.%%..%%.@
.%%..%%.@
.%%..%%.@
.%%%%%..@
........@@
.%%%%%%.@
.%%.....@
.%%%%...@
.%%.....@
.%%%%%%.@
........@@
.%%%%%%.@
.%%.....@
.%%%%...@
.%%.....@
.%%.....@
........@@
..%%%%..@
.%%.....@
.%%.%%%.@
.%%..%%.@
..%%%%..@
........@@
.%%..%%.@
.%%..%%.@
.%%%%%%.@
.%%..%%.@
.%%..%%.@
........@@
.%%%%%%.@
...%%...@
...%%...@
...%%...@
.%%%%%%.@
........@@
.%%%%%%.@
.....%%.@
.....%%.@
.%%..%%.@
..%%%%..@
........@@
.%%..%%.@
.%%.%%..@
.%%%%...@
.%%.%%..@
.%%..%%.@
........@@
.%%.....@
.%%.....@
.%%.....@
.%%.....@
.%%%%%%.@
........@@
.%%...%%.@
.%%%.%%%.@
.%%.%.%%.@
.%%...%%.@
.%%...%%.@
.........@@
.%%..%%.@
.%%%.%%.@
.%%.%%%.@
.%%..%%.@
.%%..%%.@
........@@
..%%%%..@
.%%..%%.@
.%%..%%.@
.%%..%%.@
..%%%%..@
........@@
.%%%%%..@
.%%..%%.@
.%%%%%..@
.%%.....@
.%%.....@
........@@
..%%%%..@
.%%..%%.@
.%%.%%%.@
.%%..%%.@
..%%%%%.@
........@@
.%%%%%..@
.%%..%%.@
.%%%%%..@
.%%..%%.@
.%%..%%.@
........@@
..%%%%..@
.%%.....@
..%%%%..@
.....%%.@
..%%%%..@
........@@
.%%%%%%.@
...%%...@
...%%...@
...%%...@
...%%...@
........@@
.%%..%%.@
.%%..%%.@
.%%..%%.@
.%%..%%.@
..%%%%..@
........@@
.%%..%%.@
.%%..%%.@
.%%..%%.@
..%%%%..@
...%%...@
........@@
.%%...%%.@
.%%...%%.@
.%%.%.%%.@
.%%%%%%%.@
..%%.%%..@
.........@@
.%%..%%.@
..%%%%..@
...%%...@
..%%%%..@
.%%..%%.@
........@@
.%%..%%.@
..%%%%..@
...%%...@
...%%...@
...%%...@
........@@
.%%%%%%.@
....%%..@
...%%...@
..%%....@
.%%%%%%.@
........@@
...%%%%.@
...%%...@
.%%%....@
...%%...@
...%%%%.@
........@@
...%%...@
...%%...@
...%%...@
...%%...@
...%%...@
...%%...@@
.%%%%...@
...%%...@
....%%%.@
...%%...@
.%%%%...@
........@@
..%%%.%.@
.%.%%%..@
........@
........@
........@
........@@
.%%..%%.@
........@
..%%%%%.@
.%%..%%.@
..%%%%%.@
........@@
.%%..%%.@
........@
..%%%%..@
.%%..%%.@
..%%%%..@
........@@
.%%..%%.@
........@
.%%..%%.@
.%%..%%.@
..%%%%..@
........@@
.%%..%%.@
........@
..%%%%%.@
.%%..%%.@
..%%%%%.@
........@@
.%%..%%.@
........@
..%%%%..@
.%%..%%.@
..%%%%..@
........@@
.%%..%%.@
........@
.%%..%%.@
.%%..%%.@
..%%%%..@
........@@
..%%%%%..@
.%%...%%.@
.%%.%%%..@
.%%...%%.@
.%%.%%%..@
.%%......@@
@@ -0,0 +1 @@
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,gBAAE,CAAC;IACnC,iBAAiB,CAAC,OAAS,CAAC,gCAAI,EAAE,KAAK,UAAU,CAAC,gDAAM,CAAC;IACzD,cAAc,CAAC,OAAS,GAAG,KAAK,KAAK,CAAC,iBAAG,CAAC;IAC1C,cAAc,CAAC,gBAAE,CAAC;IAClB,kBAAkB,CAAC,OAAS,CAAC,gCAAI,EAAE,KAAK,UAAU,CAAC,gDAAM,CAAC;IAC1D,sBAAsB,CAAC,+EAAgB,CAAC;IACxC,UAAU,CAAC,gBAAE,CAAC;IACd,aAAa,CAAC,gBAAE,CAAC;IACjB,YAAY,CAAC,wCAAK,CAAC;AACrB","sources":["packages/@react-aria/table/intl/zh-TW.json"],"sourcesContent":["{\n \"ascending\": \"遞增\",\n \"ascendingSort\": \"已依據「{columnName}」欄遞增排序\",\n \"columnSize\": \"{value} 像素\",\n \"descending\": \"遞減\",\n \"descendingSort\": \"已依據「{columnName}」欄遞減排序\",\n \"resizerDescription\": \"按 Enter 鍵以開始調整大小\",\n \"select\": \"選取\",\n \"selectAll\": \"全選\",\n \"sortable\": \"可排序的欄\"\n}\n"],"names":[],"version":3,"file":"zh-TW.module.js.map"}
@@ -0,0 +1,70 @@
var fs = require('fs');
var path = require('path');
var test = require('tape');
var resolve = require('../');
test('$NODE_PATH', function (t) {
t.plan(8);
var isDir = function (dir, cb) {
if (dir === '/node_path' || dir === 'node_path/x') {
return cb(null, true);
}
fs.stat(dir, function (err, stat) {
if (!err) {
return cb(null, stat.isDirectory());
}
if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);
return cb(err);
});
};
resolve('aaa', {
paths: [
path.join(__dirname, '/node_path/x'),
path.join(__dirname, '/node_path/y')
],
basedir: __dirname,
isDirectory: isDir
}, function (err, res) {
t.error(err);
t.equal(res, path.join(__dirname, '/node_path/x/aaa/index.js'), 'aaa resolves');
});
resolve('bbb', {
paths: [
path.join(__dirname, '/node_path/x'),
path.join(__dirname, '/node_path/y')
],
basedir: __dirname,
isDirectory: isDir
}, function (err, res) {
t.error(err);
t.equal(res, path.join(__dirname, '/node_path/y/bbb/index.js'), 'bbb resolves');
});
resolve('ccc', {
paths: [
path.join(__dirname, '/node_path/x'),
path.join(__dirname, '/node_path/y')
],
basedir: __dirname,
isDirectory: isDir
}, function (err, res) {
t.error(err);
t.equal(res, path.join(__dirname, '/node_path/x/ccc/index.js'), 'ccc resolves');
});
// ensure that relative paths still resolve against the regular `node_modules` correctly
resolve('tap', {
paths: [
'node_path'
],
basedir: path.join(__dirname, 'node_path/x'),
isDirectory: isDir
}, function (err, res) {
var root = require('tap/package.json').main; // eslint-disable-line global-require
t.error(err);
t.equal(res, path.resolve(__dirname, '..', 'node_modules/tap', root), 'tap resolves');
});
});
@@ -0,0 +1,2 @@
/*! js-cookie v3.0.5 | MIT */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self,function(){var n=e.Cookies,o=e.Cookies=t();o.noConflict=function(){return e.Cookies=n,o}}())}(this,(function(){"use strict";function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}var t=function t(n,o){function r(t,r,i){if("undefined"!=typeof document){"number"==typeof(i=e({},o,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var u in i)i[u]&&(c+="; "+u,!0!==i[u]&&(c+="="+i[u].split(";")[0]));return document.cookie=t+"="+n.write(r,t)+c}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],o={},r=0;r<t.length;r++){var i=t[r].split("="),c=i.slice(1).join("=");try{var u=decodeURIComponent(i[0]);if(o[u]=n.read(c,u),e===u)break}catch(e){}}return e?o[e]:o}},remove:function(t,n){r(t,"",e({},n,{expires:-1}))},withAttributes:function(n){return t(this.converter,e({},this.attributes,n))},withConverter:function(n){return t(e({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(n)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});return t}));
@@ -0,0 +1,34 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.esnext = void 0;
const es2024_1 = require("./es2024");
const esnext_array_1 = require("./esnext.array");
const esnext_collection_1 = require("./esnext.collection");
const esnext_decorators_1 = require("./esnext.decorators");
const esnext_disposable_1 = require("./esnext.disposable");
const esnext_error_1 = require("./esnext.error");
const esnext_float16_1 = require("./esnext.float16");
const esnext_intl_1 = require("./esnext.intl");
const esnext_iterator_1 = require("./esnext.iterator");
const esnext_promise_1 = require("./esnext.promise");
const esnext_sharedmemory_1 = require("./esnext.sharedmemory");
exports.esnext = {
libs: [
es2024_1.es2024,
esnext_intl_1.esnext_intl,
esnext_decorators_1.esnext_decorators,
esnext_disposable_1.esnext_disposable,
esnext_collection_1.esnext_collection,
esnext_array_1.esnext_array,
esnext_iterator_1.esnext_iterator,
esnext_promise_1.esnext_promise,
esnext_float16_1.esnext_float16,
esnext_error_1.esnext_error,
esnext_sharedmemory_1.esnext_sharedmemory,
],
variables: [],
};
@@ -0,0 +1,147 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createMemoizedListFormat = exports.createMemoizedLocale = exports.createMemoizedPluralRules = exports.createMemoizedDateTimeFormat = exports.createMemoizedNumberFormat = exports.UNICODE_EXTENSION_SEQUENCE_REGEX = void 0;
exports.repeat = repeat;
exports.setInternalSlot = setInternalSlot;
exports.setMultiInternalSlots = setMultiInternalSlots;
exports.getInternalSlot = getInternalSlot;
exports.getMultiInternalSlots = getMultiInternalSlots;
exports.isLiteralPart = isLiteralPart;
exports.defineProperty = defineProperty;
exports.createDataProperty = createDataProperty;
exports.invariant = invariant;
var tslib_1 = require("tslib");
var fast_memoize_1 = require("@formatjs/fast-memoize");
function repeat(s, times) {
if (typeof s.repeat === 'function') {
return s.repeat(times);
}
var arr = new Array(times);
for (var i = 0; i < arr.length; i++) {
arr[i] = s;
}
return arr.join('');
}
function setInternalSlot(map, pl, field, value) {
if (!map.get(pl)) {
map.set(pl, Object.create(null));
}
var slots = map.get(pl);
slots[field] = value;
}
function setMultiInternalSlots(map, pl, props) {
for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {
var k = _a[_i];
setInternalSlot(map, pl, k, props[k]);
}
}
function getInternalSlot(map, pl, field) {
return getMultiInternalSlots(map, pl, field)[field];
}
function getMultiInternalSlots(map, pl) {
var fields = [];
for (var _i = 2; _i < arguments.length; _i++) {
fields[_i - 2] = arguments[_i];
}
var slots = map.get(pl);
if (!slots) {
throw new TypeError("".concat(pl, " InternalSlot has not been initialized"));
}
return fields.reduce(function (all, f) {
all[f] = slots[f];
return all;
}, Object.create(null));
}
function isLiteralPart(patternPart) {
return patternPart.type === 'literal';
}
/*
17 ECMAScript Standard Built-in Objects:
Every built-in Function object, including constructors, that is not
identified as an anonymous function has a name property whose value
is a String.
Unless otherwise specified, the name property of a built-in Function
object, if it exists, has the attributes { [[Writable]]: false,
[[Enumerable]]: false, [[Configurable]]: true }.
*/
function defineProperty(target, name, _a) {
var value = _a.value;
Object.defineProperty(target, name, {
configurable: true,
enumerable: false,
writable: true,
value: value,
});
}
/**
* 7.3.5 CreateDataProperty
* @param target
* @param name
* @param value
*/
function createDataProperty(target, name, value) {
Object.defineProperty(target, name, {
configurable: true,
enumerable: true,
writable: true,
value: value,
});
}
exports.UNICODE_EXTENSION_SEQUENCE_REGEX = /-u(?:-[0-9a-z]{2,8})+/gi;
function invariant(condition, message, Err) {
if (Err === void 0) { Err = Error; }
if (!condition) {
throw new Err(message);
}
}
exports.createMemoizedNumberFormat = (0, fast_memoize_1.memoize)(function () {
var _a;
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return new ((_a = Intl.NumberFormat).bind.apply(_a, tslib_1.__spreadArray([void 0], args, false)))();
}, {
strategy: fast_memoize_1.strategies.variadic,
});
exports.createMemoizedDateTimeFormat = (0, fast_memoize_1.memoize)(function () {
var _a;
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return new ((_a = Intl.DateTimeFormat).bind.apply(_a, tslib_1.__spreadArray([void 0], args, false)))();
}, {
strategy: fast_memoize_1.strategies.variadic,
});
exports.createMemoizedPluralRules = (0, fast_memoize_1.memoize)(function () {
var _a;
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return new ((_a = Intl.PluralRules).bind.apply(_a, tslib_1.__spreadArray([void 0], args, false)))();
}, {
strategy: fast_memoize_1.strategies.variadic,
});
exports.createMemoizedLocale = (0, fast_memoize_1.memoize)(function () {
var _a;
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return new ((_a = Intl.Locale).bind.apply(_a, tslib_1.__spreadArray([void 0], args, false)))();
}, {
strategy: fast_memoize_1.strategies.variadic,
});
exports.createMemoizedListFormat = (0, fast_memoize_1.memoize)(function () {
var _a;
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return new ((_a = Intl.ListFormat).bind.apply(_a, tslib_1.__spreadArray([void 0], args, false)))();
}, {
strategy: fast_memoize_1.strategies.variadic,
});
@@ -0,0 +1,23 @@
'use strict';
var $TypeError = require('es-errors/type');
var isObject = require('es-object-atoms/isObject');
var CreateDataProperty = require('./CreateDataProperty');
var isPropertyKey = require('../helpers/isPropertyKey');
// // https://262.ecma-international.org/14.0/#sec-createdatapropertyorthrow
module.exports = function CreateDataPropertyOrThrow(O, P, V) {
if (!isObject(O)) {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
if (!isPropertyKey(P)) {
throw new $TypeError('Assertion failed: P is not a Property Key');
}
var success = CreateDataProperty(O, P, V);
if (!success) {
throw new $TypeError('unable to create data property');
}
};
@@ -0,0 +1 @@
{"version":3,"file":"jsx-props-no-spread-multi.d.ts","sourceRoot":"","sources":["jsx-props-no-spread-multi.js"],"names":[],"mappings":"wBAkBW,OAAO,QAAQ,EAAE,IAAI,CAAC,UAAU"}
@@ -0,0 +1 @@
{"name":"node-releases","version":"2.0.27","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532117174,"integrity":"sha512-Z7cB51PZdzP3HlW3aOh7wAMWWeD9DLWXOLaiyfNgQ8ofbBgVjjmKuqVubKkQWAr1KLYi7A+RK472Di8r+ZzBfg==","mode":420,"size":1107},"data/processed/envs.json":{"checkedAt":1794532117175,"integrity":"sha512-MImjYBZ8jfkWHIVSiD11AWE1Bb3fOqh6i+J/SebMW5Y+TOHyvFX02m0HRpON05Jn5KXX8KwLllyRXhCql3z7rQ==","mode":420,"size":36401},"package.json":{"checkedAt":1794532117175,"integrity":"sha512-U4jZlyoz3aqDt2+87a4Oo2bpPmEJEnure7B+R2xKODVtznLX7V3STma6VWu+YpzbQRoLpXoWuhBqMQeTtUbkKg==","mode":420,"size":449},"data/release-schedule/release-schedule.json":{"checkedAt":1794532117175,"integrity":"sha512-/gvVfNM+HhBUZtpO+LyJarE0R6XUrDA17n9o1ckxRWUxBAMFoMacvfPXUUhOgumBbFsmLmoLf2n2VbH79jX5hg==","mode":420,"size":2330},"README.md":{"checkedAt":1794532117175,"integrity":"sha512-2AIHQR+yGmsF7NPo9T0hPQV6uLqsTGqk1uO/p/sKfPPVrekUOpVh5Jw8Lskei/lmHu54/82kxDkfkI2QmvBn/Q==","mode":420,"size":505}}}
@@ -0,0 +1,15 @@
import { Time } from "@peculiar/asn1-x509";
/**
* ```asn
* id-signingTime OBJECT IDENTIFIER ::= { iso(1) member-body(2)
* us(840) rsadsi(113549) pkcs(1) pkcs9(9) 5 }
* ```
*/
export declare const id_signingTime = "1.2.840.113549.1.9.5";
/**
* ```asn
* SigningTime ::= Time
* ```
*/
export declare class SigningTime extends Time {
}
@@ -0,0 +1,29 @@
var basePullAll = require('./_basePullAll');
/**
* This method is like `_.pull` except that it accepts an array of values to remove.
*
* **Note:** Unlike `_.difference`, this method mutates `array`.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Array
* @param {Array} array The array to modify.
* @param {Array} values The values to remove.
* @returns {Array} Returns `array`.
* @example
*
* var array = ['a', 'b', 'c', 'a', 'b', 'c'];
*
* _.pullAll(array, ['a', 'c']);
* console.log(array);
* // => ['b', 'b']
*/
function pullAll(array, values) {
return (array && array.length && values && values.length)
? basePullAll(array, values)
: array;
}
module.exports = pullAll;
@@ -0,0 +1,102 @@
# import/named
💼🚫 This rule is enabled in the following configs: ❗ `errors`, ☑️ `recommended`. This rule is _disabled_ in the ⌨️ `typescript` config.
<!-- end auto-generated rule header -->
Verifies that all named imports are part of the set of named exports in the referenced module.
For `export`, verifies that all named exports exist in the referenced module.
Note: for packages, the plugin will find exported names
from [`jsnext:main`] (deprecated) or `module`, if present in `package.json`.
Redux's npm module includes this key, and thereby is lintable, for example.
A module path that is [ignored] or not [unambiguously an ES module] will not be reported when imported. Note that type imports and exports, as used by [Flow], are always ignored.
[ignored]: ../../README.md#importignore
[unambiguously an ES module]: https://github.com/bmeck/UnambiguousJavaScriptGrammar
[Flow]: https://flow.org/
## Rule Details
Given:
```js
// ./foo.js
export const foo = "I'm so foo"
```
The following is considered valid:
```js
// ./bar.js
import { foo } from './foo'
// ES7 proposal
export { foo as bar } from './foo'
// node_modules without jsnext:main are not analyzed by default
// (import/ignore setting)
import { SomeNonsenseThatDoesntExist } from 'react'
```
...and the following are reported:
```js
// ./baz.js
import { notFoo } from './foo'
// ES7 proposal
export { notFoo as defNotBar } from './foo'
// will follow 'jsnext:main', if available
import { dontCreateStore } from 'redux'
```
### Settings
[`import/ignore`] can be provided as a setting to ignore certain modules (node_modules,
CoffeeScript, CSS if using Webpack, etc.).
Given:
```yaml
# .eslintrc (YAML)
---
settings:
import/ignore:
- node_modules # included by default, but replaced if explicitly configured
- *.coffee$ # can't parse CoffeeScript (unless a custom polyglot parser was configured)
```
and
```coffeescript
# ./whatever.coffee
exports.whatever = (foo) -> console.log foo
```
then the following is not reported:
```js
// ./foo.js
// can't be analyzed, and ignored, so not reported
import { notWhatever } from './whatever'
```
## When Not To Use It
If you are using CommonJS and/or modifying the exported namespace of any module at
runtime, you will likely see false positives with this rule.
## Further Reading
- [`import/ignore`] setting
- [`jsnext:main`] deprecation
- [`pkg.module`] (Rollup)
[`jsnext:main`]: https://github.com/jsforum/jsforum/issues/5
[`pkg.module`]: https://github.com/rollup/rollup/wiki/pkg.module
[`import/ignore`]: ../../README.md#importignore
@@ -0,0 +1,76 @@
import * as _heroui_theme from '@heroui/theme';
import { AccordionGroupVariantProps } from '@heroui/theme';
import * as _heroui_system from '@heroui/system';
import { HTMLHeroUIProps, PropGetter } from '@heroui/system';
import { SelectionBehavior, MultipleSelection } from '@react-types/shared';
import { AriaAccordionProps } from '@react-types/accordion';
import { ReactRef } from '@heroui/react-utils';
import { Key } from 'react';
import { TreeState } from '@react-stately/tree';
import { DividerProps } from '@heroui/divider';
import { AccordionItemProps } from './accordion-item.mjs';
import './use-accordion-item.mjs';
import 'framer-motion';
import './base/accordion-item-base.mjs';
import '@heroui/aria-utils';
import 'tailwind-variants';
interface Props extends HTMLHeroUIProps<"div"> {
/**
* Ref to the DOM node.
*/
ref?: ReactRef<HTMLDivElement | null>;
/**
* Whether to display a divider at the bottom of the each accordion item.
*
* @default true
*/
showDivider?: boolean;
/**
* The divider props.
*/
dividerProps?: Partial<DividerProps>;
/**
* The accordion selection behavior.
* @default "toggle"
*/
selectionBehavior?: SelectionBehavior;
/**
* Whether to keep the accordion content mounted when collapsed.
* @default false
*/
keepContentMounted?: boolean;
/**
* The accordion items classNames.
*/
itemClasses?: AccordionItemProps["classNames"];
}
type UseAccordionProps<T extends object = {}> = Props & AccordionGroupVariantProps & Pick<AccordionItemProps, "isCompact" | "isDisabled" | "hideIndicator" | "disableAnimation" | "disableIndicatorAnimation" | "motionProps"> & AriaAccordionProps<T> & MultipleSelection;
type ValuesType<T extends object = {}> = {
state: TreeState<T>;
focusedKey?: Key | null;
isCompact?: AccordionItemProps["isCompact"];
isDisabled?: AccordionItemProps["isDisabled"];
hideIndicator?: AccordionItemProps["hideIndicator"];
disableAnimation?: AccordionItemProps["disableAnimation"];
keepContentMounted?: Props["keepContentMounted"];
disableIndicatorAnimation?: AccordionItemProps["disableAnimation"];
motionProps?: AccordionItemProps["motionProps"];
};
declare function useAccordion<T extends object>(props: UseAccordionProps<T>): {
Component: _heroui_system.As<any>;
values: ValuesType<T>;
state: TreeState<T>;
focusedKey: Key | null;
getBaseProps: PropGetter;
isSplitted: boolean;
classNames: string;
showDivider: boolean;
dividerProps: Partial<DividerProps>;
disableAnimation: boolean;
handleFocusChanged: (isFocused: boolean, key: Key | null) => void;
itemClasses: _heroui_theme.SlotsToClasses<"base" | "title" | "content" | "heading" | "startContent" | "indicator" | "titleWrapper" | "subtitle" | "trigger"> | undefined;
};
type UseAccordionReturn = ReturnType<typeof useAccordion>;
export { type UseAccordionProps, type UseAccordionReturn, type ValuesType, useAccordion };
@@ -0,0 +1,178 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const tsutils = __importStar(require("ts-api-utils"));
const util_1 = require("../util");
var ArgumentType;
(function (ArgumentType) {
ArgumentType[ArgumentType["Other"] = 0] = "Other";
ArgumentType[ArgumentType["String"] = 1] = "String";
ArgumentType[ArgumentType["RegExp"] = 2] = "RegExp";
ArgumentType[ArgumentType["Both"] = 3] = "Both";
})(ArgumentType || (ArgumentType = {}));
exports.default = (0, util_1.createRule)({
name: 'prefer-regexp-exec',
meta: {
type: 'suggestion',
docs: {
description: 'Enforce `RegExp#exec` over `String#match` if no global flag is provided',
recommended: 'stylistic',
requiresTypeChecking: true,
},
fixable: 'code',
messages: {
regExpExecOverStringMatch: 'Use the `RegExp#exec()` method instead.',
},
schema: [],
},
defaultOptions: [],
create(context) {
const globalScope = context.sourceCode.getScope(context.sourceCode.ast);
const services = (0, util_1.getParserServices)(context);
const checker = services.program.getTypeChecker();
/**
* Check if a given node type is a string.
* @param type The node type to check.
*/
function isStringType(type) {
return (0, util_1.getTypeName)(checker, type) === 'string';
}
/**
* Check if a given node type is a RegExp.
* @param type The node type to check.
*/
function isRegExpType(type) {
return (0, util_1.getTypeName)(checker, type) === 'RegExp';
}
function collectArgumentTypes(types) {
let result = ArgumentType.Other;
for (const type of types) {
if (isRegExpType(type)) {
result |= ArgumentType.RegExp;
}
else if (isStringType(type)) {
result |= ArgumentType.String;
}
}
return result;
}
/**
* Returns true if and only if we have syntactic proof that the /g flag is
* absent. Returns false in all other cases (i.e. it still might or might
* not contain the global flag).
*/
function definitelyDoesNotContainGlobalFlag(node) {
if ((node.type === utils_1.AST_NODE_TYPES.CallExpression ||
node.type === utils_1.AST_NODE_TYPES.NewExpression) &&
node.callee.type === utils_1.AST_NODE_TYPES.Identifier &&
node.callee.name === 'RegExp') {
const flags = node.arguments.at(1);
return !(flags?.type === utils_1.AST_NODE_TYPES.Literal &&
typeof flags.value === 'string' &&
flags.value.includes('g'));
}
return false;
}
return {
'CallExpression[arguments.length=1] > MemberExpression'(memberNode) {
if (!(0, util_1.isStaticMemberAccessOfValue)(memberNode, context, 'match')) {
return;
}
const objectNode = memberNode.object;
const callNode = memberNode.parent;
const [argumentNode] = callNode.arguments;
const argumentValue = (0, util_1.getStaticValue)(argumentNode, globalScope);
if (!isStringType(services.getTypeAtLocation(objectNode))) {
return;
}
// Don't report regular expressions with global flag.
if ((!argumentValue &&
!definitelyDoesNotContainGlobalFlag(argumentNode)) ||
(argumentValue &&
argumentValue.value instanceof RegExp &&
argumentValue.value.flags.includes('g'))) {
return;
}
if (argumentNode.type === utils_1.AST_NODE_TYPES.Literal &&
typeof argumentNode.value === 'string') {
let regExp;
try {
regExp = RegExp(argumentNode.value);
}
catch {
return;
}
return context.report({
node: memberNode.property,
messageId: 'regExpExecOverStringMatch',
fix: (0, util_1.getWrappingFixer)({
node: callNode,
innerNode: [objectNode],
sourceCode: context.sourceCode,
wrap: objectCode => `${regExp.toString()}.exec(${objectCode})`,
}),
});
}
const argumentType = services.getTypeAtLocation(argumentNode);
const argumentTypes = collectArgumentTypes(tsutils.unionConstituents(argumentType));
switch (argumentTypes) {
case ArgumentType.RegExp:
return context.report({
node: memberNode.property,
messageId: 'regExpExecOverStringMatch',
fix: (0, util_1.getWrappingFixer)({
node: callNode,
innerNode: [objectNode, argumentNode],
sourceCode: context.sourceCode,
wrap: (objectCode, argumentCode) => `${argumentCode}.exec(${objectCode})`,
}),
});
case ArgumentType.String:
return context.report({
node: memberNode.property,
messageId: 'regExpExecOverStringMatch',
fix: (0, util_1.getWrappingFixer)({
node: callNode,
innerNode: [objectNode, argumentNode],
sourceCode: context.sourceCode,
wrap: (objectCode, argumentCode) => `RegExp(${argumentCode}).exec(${objectCode})`,
}),
});
}
},
};
},
});
@@ -0,0 +1,271 @@
"use client";
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.ts
var src_exports = {};
__export(src_exports, {
Switch: () => switch_default,
useSwitch: () => useSwitch
});
module.exports = __toCommonJS(src_exports);
// src/switch.tsx
var import_react3 = require("react");
var import_system2 = require("@heroui/system");
// src/use-switch.ts
var import_react = require("react");
var import_system = require("@heroui/system");
var import_react_utils = require("@heroui/react-utils");
var import_use_safe_layout_effect = require("@heroui/use-safe-layout-effect");
var import_interactions = require("@react-aria/interactions");
var import_theme = require("@heroui/theme");
var import_utils = require("@react-aria/utils");
var import_shared_utils = require("@heroui/shared-utils");
var import_switch = require("@react-aria/switch");
var import_react2 = require("react");
var import_toggle = require("@react-stately/toggle");
var import_focus = require("@react-aria/focus");
function useSwitch(originalProps = {}) {
var _a, _b;
const globalContext = (0, import_system.useProviderContext)();
const [props, variantProps] = (0, import_system.mapPropsVariants)(originalProps, import_theme.toggle.variantKeys);
const {
ref,
as,
name,
value = "",
isReadOnly: isReadOnlyProp = false,
autoFocus = false,
startContent,
endContent,
defaultSelected,
isSelected: isSelectedProp,
children,
thumbIcon,
className,
classNames,
onChange,
onValueChange,
...otherProps
} = props;
const Component = as || "label";
const domRef = (0, import_react.useRef)(null);
const inputRef = (0, import_react.useRef)(null);
const disableAnimation = (_b = (_a = originalProps.disableAnimation) != null ? _a : globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _b : false;
const labelId = (0, import_react.useId)();
const ariaSwitchProps = (0, import_react2.useMemo)(() => {
const ariaLabel = otherProps["aria-label"] || typeof children === "string" ? children : void 0;
return {
name,
value,
children,
autoFocus,
defaultSelected,
isSelected: isSelectedProp,
isDisabled: !!originalProps.isDisabled,
isReadOnly: isReadOnlyProp,
"aria-label": ariaLabel,
"aria-labelledby": otherProps["aria-labelledby"] || labelId,
onChange: onValueChange
};
}, [
value,
name,
labelId,
children,
autoFocus,
isReadOnlyProp,
isSelectedProp,
defaultSelected,
originalProps.isDisabled,
otherProps["aria-label"],
otherProps["aria-labelledby"],
onValueChange
]);
const state = (0, import_toggle.useToggleState)(ariaSwitchProps);
(0, import_use_safe_layout_effect.useSafeLayoutEffect)(() => {
if (!inputRef.current)
return;
const isInputRefChecked = !!inputRef.current.checked;
state.setSelected(isInputRefChecked);
}, [inputRef.current]);
const { inputProps, isPressed, isReadOnly } = (0, import_switch.useSwitch)(ariaSwitchProps, state, inputRef);
const { focusProps, isFocused, isFocusVisible } = (0, import_focus.useFocusRing)({ autoFocus: inputProps.autoFocus });
const { hoverProps, isHovered } = (0, import_interactions.useHover)({
isDisabled: inputProps.disabled
});
const isInteractionDisabled = ariaSwitchProps.isDisabled || isReadOnly;
const pressed = isInteractionDisabled ? false : isPressed;
const isSelected = inputProps.checked;
const isDisabled = inputProps.disabled;
const slots = (0, import_react2.useMemo)(
() => (0, import_theme.toggle)({
...variantProps,
disableAnimation
}),
[(0, import_shared_utils.objectToDeps)(variantProps), disableAnimation]
);
const baseStyles = (0, import_shared_utils.clsx)(classNames == null ? void 0 : classNames.base, className);
const getBaseProps = (props2) => {
return {
...(0, import_utils.mergeProps)(hoverProps, otherProps, props2),
ref: domRef,
className: slots.base({ class: (0, import_shared_utils.clsx)(baseStyles, props2 == null ? void 0 : props2.className) }),
"data-disabled": (0, import_shared_utils.dataAttr)(isDisabled),
"data-selected": (0, import_shared_utils.dataAttr)(isSelected),
"data-readonly": (0, import_shared_utils.dataAttr)(isReadOnly),
"data-focus": (0, import_shared_utils.dataAttr)(isFocused),
"data-focus-visible": (0, import_shared_utils.dataAttr)(isFocusVisible),
"data-hover": (0, import_shared_utils.dataAttr)(isHovered),
"data-pressed": (0, import_shared_utils.dataAttr)(pressed)
};
};
const getWrapperProps = (0, import_react.useCallback)(
(props2 = {}) => {
return {
...props2,
"aria-hidden": true,
className: (0, import_shared_utils.clsx)(slots.wrapper({ class: (0, import_shared_utils.clsx)(classNames == null ? void 0 : classNames.wrapper, props2 == null ? void 0 : props2.className) }))
};
},
[slots, classNames == null ? void 0 : classNames.wrapper]
);
const getInputProps = (props2 = {}) => {
return {
...(0, import_utils.mergeProps)(inputProps, focusProps, props2),
ref: (0, import_react_utils.mergeRefs)(inputRef, ref),
id: inputProps.id,
className: slots.hiddenInput({ class: classNames == null ? void 0 : classNames.hiddenInput }),
onChange: (0, import_utils.chain)(onChange, inputProps.onChange)
};
};
const getThumbProps = (0, import_react.useCallback)(
(props2 = {}) => ({
...props2,
className: slots.thumb({ class: (0, import_shared_utils.clsx)(classNames == null ? void 0 : classNames.thumb, props2 == null ? void 0 : props2.className) })
}),
[slots, classNames == null ? void 0 : classNames.thumb]
);
const getLabelProps = (0, import_react.useCallback)(
(props2 = {}) => ({
...props2,
id: labelId,
className: slots.label({ class: (0, import_shared_utils.clsx)(classNames == null ? void 0 : classNames.label, props2 == null ? void 0 : props2.className) })
}),
[slots, classNames == null ? void 0 : classNames.label, isDisabled, isSelected]
);
const getThumbIconProps = (0, import_react.useCallback)(
(props2 = {
includeStateProps: false
}) => (0, import_utils.mergeProps)(
{
width: "1em",
height: "1em",
className: slots.thumbIcon({ class: (0, import_shared_utils.clsx)(classNames == null ? void 0 : classNames.thumbIcon) })
},
props2.includeStateProps ? {
isSelected
} : {}
),
[slots, classNames == null ? void 0 : classNames.thumbIcon, isSelected]
);
const getStartContentProps = (0, import_react.useCallback)(
(props2 = {}) => ({
width: "1em",
height: "1em",
...props2,
className: slots.startContent({ class: (0, import_shared_utils.clsx)(classNames == null ? void 0 : classNames.startContent, props2 == null ? void 0 : props2.className) })
}),
[slots, classNames == null ? void 0 : classNames.startContent, isSelected]
);
const getEndContentProps = (0, import_react.useCallback)(
(props2 = {}) => ({
width: "1em",
height: "1em",
...props2,
className: slots.endContent({ class: (0, import_shared_utils.clsx)(classNames == null ? void 0 : classNames.endContent, props2 == null ? void 0 : props2.className) })
}),
[slots, classNames == null ? void 0 : classNames.endContent, isSelected]
);
return {
Component,
slots,
classNames,
domRef,
children,
thumbIcon,
startContent,
endContent,
isHovered,
isSelected,
isPressed: pressed,
isFocused,
isFocusVisible,
isDisabled,
getBaseProps,
getWrapperProps,
getInputProps,
getLabelProps,
getThumbProps,
getThumbIconProps,
getStartContentProps,
getEndContentProps
};
}
// src/switch.tsx
var import_jsx_runtime = require("react/jsx-runtime");
var Switch = (0, import_system2.forwardRef)((props, ref) => {
const {
Component,
children,
startContent,
endContent,
thumbIcon,
getBaseProps,
getInputProps,
getWrapperProps,
getThumbProps,
getThumbIconProps,
getLabelProps,
getStartContentProps,
getEndContentProps
} = useSwitch({ ...props, ref });
const clonedThumbIcon = typeof thumbIcon === "function" ? thumbIcon(getThumbIconProps({ includeStateProps: true })) : thumbIcon && (0, import_react3.cloneElement)(thumbIcon, getThumbIconProps());
const clonedStartContent = startContent && (0, import_react3.cloneElement)(startContent, getStartContentProps());
const clonedEndContent = endContent && (0, import_react3.cloneElement)(endContent, getEndContentProps());
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Component, { ...getBaseProps(), children: [
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { ...getInputProps() }),
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { ...getWrapperProps(), children: [
startContent && clonedStartContent,
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { ...getThumbProps(), children: thumbIcon && clonedThumbIcon }),
endContent && clonedEndContent
] }),
children && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { ...getLabelProps(), children })
] });
});
Switch.displayName = "HeroUI.Switch";
var switch_default = Switch;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Switch,
useSwitch
});
@@ -0,0 +1,117 @@
/*
Copyright (C) 2014 Yusuke Suzuki <utatane.tea@gmail.com>
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.
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 <COPYRIGHT HOLDER> 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.
*/
(function () {
'use strict';
var estraverse = require('estraverse');
function isNode(node) {
if (node == null) {
return false;
}
return typeof node === 'object' && typeof node.type === 'string';
}
function isProperty(nodeType, key) {
return (nodeType === estraverse.Syntax.ObjectExpression || nodeType === estraverse.Syntax.ObjectPattern) && key === 'properties';
}
function Visitor(visitor, options) {
options = options || {};
this.__visitor = visitor || this;
this.__childVisitorKeys = options.childVisitorKeys
? Object.assign({}, estraverse.VisitorKeys, options.childVisitorKeys)
: estraverse.VisitorKeys;
if (options.fallback === 'iteration') {
this.__fallback = Object.keys;
} else if (typeof options.fallback === 'function') {
this.__fallback = options.fallback;
}
}
/* Default method for visiting children.
* When you need to call default visiting operation inside custom visiting
* operation, you can use it with `this.visitChildren(node)`.
*/
Visitor.prototype.visitChildren = function (node) {
var type, children, i, iz, j, jz, child;
if (node == null) {
return;
}
type = node.type || estraverse.Syntax.Property;
children = this.__childVisitorKeys[type];
if (!children) {
if (this.__fallback) {
children = this.__fallback(node);
} else {
throw new Error('Unknown node type ' + type + '.');
}
}
for (i = 0, iz = children.length; i < iz; ++i) {
child = node[children[i]];
if (child) {
if (Array.isArray(child)) {
for (j = 0, jz = child.length; j < jz; ++j) {
if (child[j]) {
if (isNode(child[j]) || isProperty(type, children[i])) {
this.visit(child[j]);
}
}
}
} else if (isNode(child)) {
this.visit(child);
}
}
}
};
/* Dispatching node. */
Visitor.prototype.visit = function (node) {
var type;
if (node == null) {
return;
}
type = node.type || estraverse.Syntax.Property;
if (this.__visitor[type]) {
this.__visitor[type].call(this, node);
return;
}
this.visitChildren(node);
};
exports.version = require('./package.json').version;
exports.Visitor = Visitor;
exports.visit = function (node, visitor, options) {
var v = new Visitor(visitor, options);
v.visit(node);
};
}());
/* vim: set sw=4 ts=4 et tw=80 : */
@@ -0,0 +1,3 @@
import CryptoJS = require("./index");
export = CryptoJS.RC4;
@@ -0,0 +1,83 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $parseInt = GetIntrinsic('%parseInt%');
var $abs = require('math-intrinsics/abs');
var $floor = require('math-intrinsics/floor');
var isNegativeZero = require('math-intrinsics/isNegativeZero');
var callBound = require('call-bound');
var $strIndexOf = callBound('String.prototype.indexOf');
var $strSlice = callBound('String.prototype.slice');
var fractionToBitString = require('../helpers/fractionToBinaryString');
var intToBinString = require('../helpers/intToBinaryString');
var float64bias = 1023;
var elevenOnes = '11111111111';
var elevenZeroes = '00000000000';
var fiftyOneZeroes = elevenZeroes + elevenZeroes + elevenZeroes + elevenZeroes + '0000000';
// IEEE 754-1985
module.exports = function valueToFloat64Bytes(value, isLittleEndian) {
var signBit = value < 0 || isNegativeZero(value) ? '1' : '0';
var exponentBits;
var significandBits;
if (isNaN(value)) {
exponentBits = elevenOnes;
significandBits = '1' + fiftyOneZeroes;
} else if (!isFinite(value)) {
exponentBits = elevenOnes;
significandBits = '0' + fiftyOneZeroes;
} else if (value === 0) {
exponentBits = elevenZeroes;
significandBits = '0' + fiftyOneZeroes;
} else {
value = $abs(value); // eslint-disable-line no-param-reassign
// Isolate the integer part (digits before the decimal):
var integerPart = $floor(value);
var intBinString = intToBinString(integerPart); // bit string for integer part
var fracBinString = fractionToBitString(value - integerPart); // bit string for fractional part
var numberOfBits;
// find exponent needed to normalize integer+fractional parts
if (intBinString) {
exponentBits = intBinString.length - 1; // move the decimal to the left
} else {
var first1 = $strIndexOf(fracBinString, '1');
if (first1 > -1) {
numberOfBits = first1 + 1;
}
exponentBits = -numberOfBits; // move the decimal to the right
}
significandBits = intBinString + fracBinString;
if (exponentBits < 0) {
// subnormals
if (exponentBits <= -float64bias) {
numberOfBits = float64bias - 1; // limit number of removed bits
}
significandBits = $strSlice(significandBits, numberOfBits); // remove all leading 0s and the first 1 for normal values; for subnormals, remove up to `float64bias - 1` leading bits
} else {
significandBits = $strSlice(significandBits, 1); // remove the leading '1' (implicit/hidden bit)
}
exponentBits = $strSlice(elevenZeroes + intToBinString(exponentBits + float64bias), -11); // Convert the exponent to a bit string
significandBits = $strSlice(significandBits + fiftyOneZeroes + '0', 0, 52); // fill in any trailing zeros and ensure we have only 52 fraction bits
}
var bits = signBit + exponentBits + significandBits;
var rawBytes = [];
for (var i = 0; i < 8; i++) {
var targetIndex = isLittleEndian ? 8 - i - 1 : i;
rawBytes[targetIndex] = $parseInt($strSlice(bits, i * 8, (i + 1) * 8), 2);
}
return rawBytes;
};
@@ -0,0 +1,3 @@
declare function pkgUp(opts?: { cwd?: string }): string | null;
export default pkgUp;
@@ -0,0 +1,71 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v1.1.5](https://github.com/ljharb/Iterator.prototype/compare/v1.1.4...v1.1.5) - 2025-01-01
### Commits
- [Refactor] use `get-proto` directly [`c36361a`](https://github.com/ljharb/Iterator.prototype/commit/c36361a6a83b128c054cc8ebed15a16436332255)
- [Deps] update `reflect.getprototypeof` [`c3f9c2a`](https://github.com/ljharb/Iterator.prototype/commit/c3f9c2a4aa0b84585e4990f465ca28771337c4b9)
## [v1.1.4](https://github.com/ljharb/Iterator.prototype/compare/v1.1.3...v1.1.4) - 2024-12-11
### Commits
- [actions] split out node 10-20, and 20+ [`a6e7fa2`](https://github.com/ljharb/Iterator.prototype/commit/a6e7fa21e5f470551594db6caf497ac3a1e1aa29)
- [Refactor] use `define-data-property` directly instead of `define-properties` [`9c55a02`](https://github.com/ljharb/Iterator.prototype/commit/9c55a029f606e751deb3bcbca4cff622acf806bc)
- [Deps] update `get-intrinsic`, `has-symbols`, `reflect.getprototypeof`, `set-function-name` [`958fdf5`](https://github.com/ljharb/Iterator.prototype/commit/958fdf52e5a331a2c35d7c70ca51272e7800c2f9)
- [Dev Deps] update `@ljharb/eslint-config`, `auto-changelog`, `npmignore`, `tape` [`ab7c77d`](https://github.com/ljharb/Iterator.prototype/commit/ab7c77d7be8fe91b0a54b7e61eae85ba9c717bbe)
- [Robustness] use `es-object-atoms` [`ed8ee34`](https://github.com/ljharb/Iterator.prototype/commit/ed8ee3447ea912e6f915247d0245f59717ece94f)
## [v1.1.3](https://github.com/ljharb/Iterator.prototype/compare/v1.1.2...v1.1.3) - 2024-10-08
### Commits
- [Fix] in node 0.12 - 4, do not mutate Object.prototype [`4a4fa45`](https://github.com/ljharb/Iterator.prototype/commit/4a4fa458728ec2cb0c8e182956020989c7fb0573)
- [Tests] replace `aud` with `npm audit` [`ece6082`](https://github.com/ljharb/Iterator.prototype/commit/ece60822ffcd87c82db10add871cb9958c875e4f)
- [meta] add missing `engines.node` [`7ee3359`](https://github.com/ljharb/Iterator.prototype/commit/7ee335941706c5cebf940b541a73b4414fd47508)
- [Dev Deps] add missing peer dep [`fb90acc`](https://github.com/ljharb/Iterator.prototype/commit/fb90accee214ee8c40046edd6f90d6d0e983961a)
## [v1.1.2](https://github.com/ljharb/Iterator.prototype/compare/v1.1.1...v1.1.2) - 2023-09-13
### Commits
- [Fix] properly name `Iterator.prototype[Symbol.iterator]` method [`42ddaf7`](https://github.com/ljharb/Iterator.prototype/commit/42ddaf757d941ab3e5baf341ccb2598b8b86a1a1)
- [Deps] update `define-properties`, `reflect.getprototypeof` [`8b06aec`](https://github.com/ljharb/Iterator.prototype/commit/8b06aec1a6e79c14806a4ba1e783a2dc79de5e5d)
## [v1.1.1](https://github.com/ljharb/Iterator.prototype/compare/v1.1.0...v1.1.1) - 2023-08-30
### Commits
- [Fix] stop mutating node 4+ Iterator.prototype with Symbol.toStringTag [`74e9560`](https://github.com/ljharb/Iterator.prototype/commit/74e9560c10fcdadb207fea82577946976b9a87da)
- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`63fd269`](https://github.com/ljharb/Iterator.prototype/commit/63fd269da6a0a39f79bc48b887b7ec81b6e5e0a0)
- [Deps] update `define-properties`, `get-intrinsic` [`ef73f0e`](https://github.com/ljharb/Iterator.prototype/commit/ef73f0e78223e7eb09a987bc0614a802585e376a)
## [v1.1.0](https://github.com/ljharb/Iterator.prototype/compare/v1.0.1...v1.1.0) - 2022-12-09
### Commits
- [New] define `Symbol.toStringTag` [`d3f94aa`](https://github.com/ljharb/Iterator.prototype/commit/d3f94aaebf65eba391f702815216a32c5b6cbf18)
## [v1.0.1](https://github.com/ljharb/Iterator.prototype/compare/v1.0.0...v1.0.1) - 2022-12-09
### Commits
- [meta] fix repo URLs [`670823e`](https://github.com/ljharb/Iterator.prototype/commit/670823e0c547003a1006dcd0d27a22395a8dff1a)
- [Fix] move `has-symbols` to a runtime dep [`1b15df1`](https://github.com/ljharb/Iterator.prototype/commit/1b15df1dd481d9e12fbcf25f540b6ccfe9c51502)
## v1.0.0 - 2022-12-05
### Commits
- Initial implementation, tests, readme [`2db7663`](https://github.com/ljharb/Iterator.prototype/commit/2db76638655461506671b62ee97800288ae6d95b)
- Initial commit [`5c97994`](https://github.com/ljharb/Iterator.prototype/commit/5c979947a473848bf28d1bf286b813a6756a9700)
- npm init [`0c61e07`](https://github.com/ljharb/Iterator.prototype/commit/0c61e079e02b7604bfeaab3aa383171286bd4563)
- [meta] add `auto-changelog` [`8df6001`](https://github.com/ljharb/Iterator.prototype/commit/8df6001310793f8753fd776dc5db485e51624867)
- [meta] use `npmignore` to autogenerate an npmignore file [`d173afc`](https://github.com/ljharb/Iterator.prototype/commit/d173afcd7ef5bdfc1c5b9e90baf75885186a339e)
- Only apps should have lockfiles [`0fde03f`](https://github.com/ljharb/Iterator.prototype/commit/0fde03f141f5053fcba79a8bff09d410e25be201)
@@ -0,0 +1 @@
{"name":"abbrev","version":"1.1.1","requiresBuild":false,"files":{"package.json":{"checkedAt":1794532122490,"integrity":"sha512-kBxo2oPd6ZNtsW2S2Hr6zpaWKeTwsl/GtlsEYPpmCnUJ3t37cHKsHuWf4Q+OSd/o7w91crvQTrN2HVLGeMA1mw==","mode":420,"size":509},"abbrev.js":{"checkedAt":1794532122490,"integrity":"sha512-DK2qkMaPglZfPyad8BBpOKl6bQux4faTqCXuk0PFriLwwcJYc1ShAOfoEck125f1wyDgAomTkll2Zt8cNPKtUg==","mode":420,"size":1763},"LICENSE":{"checkedAt":1794532122491,"integrity":"sha512-+6giDj3dbUVfNlZOPJHDilCKddJur7qbH3YSFrH6P7sqAaRzZpTZD+gdTdh/gdMhXIzBGkjz040jHcTzQC1a2w==","mode":420,"size":2011},"README.md":{"checkedAt":1794532122491,"integrity":"sha512-p0MY80RHnNl24AbUqvTVrP4RMwqrAI5+RinRMr0U7b2yHQrUcIOpCrS/JG/0qUVoqxI4IZR7ZfWbu/PQ9TPPlg==","mode":420,"size":499}}}
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2018_regexp: LibDefinition;
@@ -0,0 +1,327 @@
// Generated by LiveScript 1.6.0
(function(){
var parsedTypeCheck, types, toString$ = {}.toString;
parsedTypeCheck = require('type-check').parsedTypeCheck;
types = {
'*': function(value, options){
switch (toString$.call(value).slice(8, -1)) {
case 'Array':
return typeCast(value, {
type: 'Array'
}, options);
case 'Object':
return typeCast(value, {
type: 'Object'
}, options);
default:
return {
type: 'Just',
value: typesCast(value, [
{
type: 'Undefined'
}, {
type: 'Null'
}, {
type: 'NaN'
}, {
type: 'Boolean'
}, {
type: 'Number'
}, {
type: 'Date'
}, {
type: 'RegExp'
}, {
type: 'Array'
}, {
type: 'Object'
}, {
type: 'String'
}
], (options.explicit = true, options))
};
}
},
Undefined: function(it){
if (it === 'undefined' || it === void 8) {
return {
type: 'Just',
value: void 8
};
} else {
return {
type: 'Nothing'
};
}
},
Null: function(it){
if (it === 'null') {
return {
type: 'Just',
value: null
};
} else {
return {
type: 'Nothing'
};
}
},
NaN: function(it){
if (it === 'NaN') {
return {
type: 'Just',
value: NaN
};
} else {
return {
type: 'Nothing'
};
}
},
Boolean: function(it){
if (it === 'true') {
return {
type: 'Just',
value: true
};
} else if (it === 'false') {
return {
type: 'Just',
value: false
};
} else {
return {
type: 'Nothing'
};
}
},
Number: function(it){
return {
type: 'Just',
value: +it
};
},
Int: function(it){
return {
type: 'Just',
value: +it
};
},
Float: function(it){
return {
type: 'Just',
value: +it
};
},
Date: function(value, options){
var that;
if (that = /^\#([\s\S]*)\#$/.exec(value)) {
return {
type: 'Just',
value: new Date(+that[1] || that[1])
};
} else if (options.explicit) {
return {
type: 'Nothing'
};
} else {
return {
type: 'Just',
value: new Date(+value || value)
};
}
},
RegExp: function(value, options){
var that;
if (that = /^\/([\s\S]*)\/([gimy]*)$/.exec(value)) {
return {
type: 'Just',
value: new RegExp(that[1], that[2])
};
} else if (options.explicit) {
return {
type: 'Nothing'
};
} else {
return {
type: 'Just',
value: new RegExp(value)
};
}
},
Array: function(value, options){
return castArray(value, {
of: [{
type: '*'
}]
}, options);
},
Object: function(value, options){
return castFields(value, {
of: {}
}, options);
},
String: function(it){
var replace, that;
if (toString$.call(it).slice(8, -1) !== 'String') {
return {
type: 'Nothing'
};
}
replace = function(value, quote){
return value.replace(/\\([^u]|u[0-9a-fA-F]{4})/g, function(all, escaped){
switch (escaped[0]) {
case quote:
return quote;
case '\\':
return '\\';
case 'b':
return '\b';
case 'f':
return '\f';
case 'n':
return '\n';
case 'r':
return '\r';
case 't':
return '\t';
case 'u':
return JSON.parse("\"" + all + "\"");
default:
return escaped;
}
});
};
if (that = it.match(/^'([\s\S]*)'$/)) {
return {
type: 'Just',
value: replace(that[1], "'")
};
} else if (that = it.match(/^"([\s\S]*)"$/)) {
return {
type: 'Just',
value: replace(that[1], '"')
};
} else {
return {
type: 'Just',
value: it
};
}
}
};
function castArray(node, type, options){
var typeOf, element;
if (toString$.call(node).slice(8, -1) !== 'Array') {
return {
type: 'Nothing'
};
}
typeOf = type.of;
return {
type: 'Just',
value: (function(){
var i$, ref$, len$, results$ = [];
for (i$ = 0, len$ = (ref$ = node).length; i$ < len$; ++i$) {
element = ref$[i$];
results$.push(typesCast(element, typeOf, options));
}
return results$;
}())
};
}
function castTuple(node, type, options){
var result, i, i$, ref$, len$, types, cast;
if (toString$.call(node).slice(8, -1) !== 'Array') {
return {
type: 'Nothing'
};
}
result = [];
i = 0;
for (i$ = 0, len$ = (ref$ = type.of).length; i$ < len$; ++i$) {
types = ref$[i$];
cast = typesCast(node[i], types, options);
if (toString$.call(cast).slice(8, -1) !== 'Undefined') {
result.push(cast);
}
i++;
}
if (node.length <= i) {
return {
type: 'Just',
value: result
};
} else {
return {
type: 'Nothing'
};
}
}
function castFields(node, type, options){
var typeOf, key, value;
if (toString$.call(node).slice(8, -1) !== 'Object') {
return {
type: 'Nothing'
};
}
typeOf = type.of;
return {
type: 'Just',
value: (function(){
var ref$, resultObj$ = {};
for (key in ref$ = node) {
value = ref$[key];
resultObj$[typesCast(key, [{
type: 'String'
}], options)] = typesCast(value, typeOf[key] || [{
type: '*'
}], options);
}
return resultObj$;
}())
};
}
function typeCast(node, typeObj, options){
var type, structure, castFunc, ref$;
type = typeObj.type, structure = typeObj.structure;
if (type) {
castFunc = ((ref$ = options.customTypes[type]) != null ? ref$.cast : void 8) || types[type];
if (!castFunc) {
throw new Error("Type not defined: " + type + ".");
}
return castFunc(node, options, typesCast);
} else {
switch (structure) {
case 'array':
return castArray(node, typeObj, options);
case 'tuple':
return castTuple(node, typeObj, options);
case 'fields':
return castFields(node, typeObj, options);
}
}
}
function typesCast(node, types, options){
var i$, len$, type, ref$, valueType, value;
for (i$ = 0, len$ = types.length; i$ < len$; ++i$) {
type = types[i$];
ref$ = typeCast(node, type, options), valueType = ref$.type, value = ref$.value;
if (valueType === 'Nothing') {
continue;
}
if (parsedTypeCheck([type], value, {
customTypes: options.customTypes
})) {
return value;
}
}
throw new Error("Value " + JSON.stringify(node) + " does not type check against " + JSON.stringify(types) + ".");
}
module.exports = function(node, types, options){
if (!options.explicit && types.length === 1 && types[0].type === 'String') {
return node;
}
return typesCast(node, types, options);
};
}).call(this);
@@ -0,0 +1 @@
{"name":"@nolyfill/is-core-module","version":"1.0.39","requiresBuild":false,"files":{"index.js":{"checkedAt":1794532096158,"integrity":"sha512-TU4IrjGgFLwq4NYhqr1csE5zNBlH2Z2/PKK0z6CucTPE19U/9op2MuaLqW0oTLcQvzJ4mJW4Kf16GtckLAbiAQ==","mode":420,"size":745},"package.json":{"checkedAt":1794532096158,"integrity":"sha512-r7tWlgdHRiowN16HekcgNEFBOwDR+E/l/ross6pK8msKMp5aOOkSgT/500NBEMAhh7ThHs7fgrTo/WkhAwfbIg==","mode":420,"size":815},"index.d.ts":{"checkedAt":1794532096158,"integrity":"sha512-ZEkEnJSqKMcdD1guhZvs0B/xWVf0jxY5/AaJivMZcWYNS9WLGJTASHSIn+uDy/8GagbxFNbqKmErEvcOOfsG/g==","mode":420,"size":84},"LICENSE":{"checkedAt":1794532096159,"integrity":"sha512-COJUaZ3C06p+Cvf15vcDLtS3igRkiiwCJEa+Pwn4v3sc410iQoPYH0EQnAkbast427+w5P1TN+h7B0pyO4A9DQ==","mode":420,"size":1062}}}
@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _setPrototypeOf;
function _setPrototypeOf(o, p) {
exports.default = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
//# sourceMappingURL=setPrototypeOf.js.map
@@ -0,0 +1,3 @@
declare function isSharedArrayBuffer(obj: unknown): obj is SharedArrayBuffer;
export = isSharedArrayBuffer;
@@ -0,0 +1,22 @@
import Picker from './picker.js';
class IconPicker extends Picker {
constructor(select, icons) {
super(select);
this.container.classList.add('ql-icon-picker');
Array.from(this.container.querySelectorAll('.ql-picker-item')).forEach(item => {
item.innerHTML = icons[item.getAttribute('data-value') || ''];
});
this.defaultItem = this.container.querySelector('.ql-selected');
this.selectItem(this.defaultItem);
}
selectItem(target, trigger) {
super.selectItem(target, trigger);
const item = target || this.defaultItem;
if (item != null) {
if (this.label.innerHTML === item.innerHTML) return;
this.label.innerHTML = item.innerHTML;
}
}
}
export default IconPicker;
//# sourceMappingURL=icon-picker.js.map
@@ -0,0 +1,10 @@
export {
useEffect,
useRef,
useMemo,
useContext,
useCallback,
useDebugValue,
useLayoutEffect,
useState,
} from 'react'
@@ -0,0 +1,13 @@
import {
slider
} from "../chunk-C2ZKHLLE.mjs";
import "../chunk-CWYZ2GEH.mjs";
import "../chunk-GQT3YUX3.mjs";
import "../chunk-46U6G7UJ.mjs";
import "../chunk-DGTYPKBN.mjs";
import "../chunk-UWE6H66T.mjs";
import "../chunk-GIXI35A3.mjs";
import "../chunk-GH5E4FQB.mjs";
export {
slider
};
@@ -0,0 +1,18 @@
/*#__NO_SIDE_EFFECTS__*/
const createUnitType = (unit) => ({
test: (v) => typeof v === "string" && v.endsWith(unit) && v.split(" ").length === 1,
parse: parseFloat,
transform: (v) => `${v}${unit}`,
});
const degrees = /*@__PURE__*/ createUnitType("deg");
const percent = /*@__PURE__*/ createUnitType("%");
const px = /*@__PURE__*/ createUnitType("px");
const vh = /*@__PURE__*/ createUnitType("vh");
const vw = /*@__PURE__*/ createUnitType("vw");
const progressPercentage = /*@__PURE__*/ (() => ({
...percent,
parse: (v) => percent.parse(v) / 100,
transform: (v) => percent.transform(v * 100),
}))();
export { degrees, percent, progressPercentage, px, vh, vw };
@@ -0,0 +1,179 @@
# micromark-util-decode-string
[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][bundle-size-badge]][bundle-size]
[![Sponsors][sponsors-badge]][opencollective]
[![Backers][backers-badge]][opencollective]
[![Chat][chat-badge]][chat]
[micromark][] utility to decode markdown strings.
## Contents
* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`decodeString(value)`](#decodestringvalue)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Contribute](#contribute)
* [License](#license)
## What is this?
This package exposes an algorithm to parse character escapes and character
references.
## When should I use this?
This package might be useful when you are making your own micromark extensions.
## Install
This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:
```sh
npm install micromark-util-decode-string
```
In Deno with [`esm.sh`][esmsh]:
```js
import {decodeString} from 'https://esm.sh/micromark-util-decode-string@1'
```
In browsers with [`esm.sh`][esmsh]:
```html
<script type="module">
import {decodeString} from 'https://esm.sh/micromark-util-decode-string@1?bundle'
</script>
```
## Use
```js
import {decodeString} from 'micromark-util-decode-string'
decodeString('a &semi; b') // 'a ; b'
decodeString('a \\; b') // 'a ; b'
decodeString('a ; b') // 'a ; b'
```
## API
This module exports the identifier [`decodeString`][api-decode-string].
There is no default export.
### `decodeString(value)`
Decode markdown strings (which occur in places such as fenced code info strings,
destinations, labels, and titles).
The “string” content type allows character escapes and -references.
This decodes those.
###### Parameters
* `value` (`string`)
— value to decode
###### Returns
Decoded value (`string`).
## Types
This package is fully typed with [TypeScript][].
It exports no additional types.
## Compatibility
Projects maintained by the unified collective are compatible with maintained
versions of Node.js.
When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-util-decode-string@2`, compatible with Node.js 16.
This package works with `micromark@3`.
## Security
This package is safe.
See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
submit a security report.
## Contribute
See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
to get started.
See [`support.md`][support] for ways to get help.
This project has a [code of conduct][coc].
By interacting with this repository, organisation, or community you agree to
abide by its terms.
## License
[MIT][license] © [Titus Wormer][author]
<!-- Definitions -->
[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg
[build]: https://github.com/micromark/micromark/actions
[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg
[coverage]: https://codecov.io/github/micromark/micromark
[downloads-badge]: https://img.shields.io/npm/dm/micromark-util-normalize-identifier.svg
[downloads]: https://www.npmjs.com/package/micromark-util-normalize-identifier
[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-util-normalize-identifier
[bundle-size]: https://bundlejs.com/?q=micromark-util-normalize-identifier
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
[opencollective]: https://opencollective.com/unified
[npm]: https://docs.npmjs.com/cli/install
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
[esmsh]: https://esm.sh
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
[chat]: https://github.com/micromark/micromark/discussions
[license]: https://github.com/micromark/micromark/blob/main/license
[author]: https://wooorm.com
[health]: https://github.com/micromark/.github
[securitymd]: https://github.com/micromark/.github/blob/main/security.md
[contributing]: https://github.com/micromark/.github/blob/main/contributing.md
[support]: https://github.com/micromark/.github/blob/main/support.md
[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md
[typescript]: https://www.typescriptlang.org
[micromark]: https://github.com/micromark/micromark
[api-decode-string]: #decodestringvalue
@@ -0,0 +1,94 @@
import type { COSEAlgorithmIdentifier, CredentialDeviceType, RegistrationResponseJSON, Uint8Array_, WebAuthnCredential } from '../types/index.js';
import { type AttestationFormat, type AttestationStatement } from '../helpers/decodeAttestationObject.js';
import type { AuthenticationExtensionsAuthenticatorOutputs } from '../helpers/decodeAuthenticatorExtensions.js';
/**
* Configurable options when calling `verifyRegistrationResponse()`
*/
export type VerifyRegistrationResponseOpts = Parameters<typeof verifyRegistrationResponse>[0];
/**
* Verify that the user has legitimately completed the registration process
*
* **Options:**
*
* @param response - Response returned by **@simplewebauthn/browser**'s `startAuthentication()`
* @param expectedChallenge - The base64url-encoded `options.challenge` returned by `generateRegistrationOptions()`
* @param expectedOrigin - Website URL (or array of URLs) that the registration should have occurred on
* @param expectedRPID - RP ID (or array of IDs) that was specified in the registration options
* @param expectedType **(Optional)** - The response type expected ('webauthn.create')
* @param requireUserPresence **(Optional)** - Enforce user presence by the authenticator (or skip it during auto registration) Defaults to `true`
* @param requireUserVerification **(Optional)** - Enforce user verification by the authenticator (via PIN, fingerprint, etc...) Defaults to `true`
* @param supportedAlgorithmIDs **(Optional)** - Array of numeric COSE algorithm identifiers supported for attestation by this RP. See https://www.iana.org/assignments/cose/cose.xhtml#algorithms. Defaults to all supported algorithm IDs
* @param attestationSafetyNetEnforceCTSCheck **(Optional)** - Require that an Android device's system integrity has not been tampered with if it uses SafetyNet attestation. Defaults to `true`
*/
export declare function verifyRegistrationResponse(options: {
response: RegistrationResponseJSON;
expectedChallenge: string | ((challenge: string) => boolean | Promise<boolean>);
expectedOrigin: string | string[];
expectedRPID?: string | string[];
expectedType?: string | string[];
requireUserPresence?: boolean;
requireUserVerification?: boolean;
supportedAlgorithmIDs?: COSEAlgorithmIdentifier[];
attestationSafetyNetEnforceCTSCheck?: boolean;
}): Promise<VerifiedRegistrationResponse>;
/**
* Result of registration verification
*
* @param verified If the assertion response could be verified
* @param registrationInfo.fmt Type of attestation
* @param registrationInfo.counter The number of times the authenticator reported it has been used.
* **Should be kept in a DB for later reference to help prevent replay attacks!**
* @param registrationInfo.aaguid Authenticator's Attestation GUID indicating the type of the
* authenticator
* @param registrationInfo.credentialPublicKey The credential's public key
* @param registrationInfo.credentialID The credential's credential ID for the public key above
* @param registrationInfo.credentialType The type of the credential returned by the browser
* @param registrationInfo.userVerified Whether the user was uniquely identified during attestation
* @param registrationInfo.attestationObject The raw `response.attestationObject` Buffer returned by
* the authenticator
* @param registrationInfo.credentialDeviceType Whether this is a single-device or multi-device
* credential. **Should be kept in a DB for later reference!**
* @param registrationInfo.credentialBackedUp Whether or not the multi-device credential has been
* backed up. Always `false` for single-device credentials. **Should be kept in a DB for later
* reference!**
* @param registrationInfo.origin The origin of the website that the registration occurred on
* @param registrationInfo?.rpID The RP ID that the registration occurred on, if one or more were
* specified in the registration options
* @param registrationInfo?.authenticatorExtensionResults The authenticator extensions returned
* by the browser
*/
export type VerifiedRegistrationResponse = {
verified: false;
registrationInfo?: never;
} | {
verified: true;
registrationInfo: {
fmt: AttestationFormat;
aaguid: string;
credential: WebAuthnCredential;
credentialType: 'public-key';
attestationObject: Uint8Array_;
userVerified: boolean;
credentialDeviceType: CredentialDeviceType;
credentialBackedUp: boolean;
origin: string;
rpID?: string;
authenticatorExtensionResults?: AuthenticationExtensionsAuthenticatorOutputs;
};
};
/**
* Values passed to all attestation format verifiers, from which they are free to use as they please
*/
export type AttestationFormatVerifierOpts = {
aaguid: Uint8Array_;
attStmt: AttestationStatement;
authData: Uint8Array_;
clientDataHash: Uint8Array_;
credentialID: Uint8Array_;
credentialPublicKey: Uint8Array_;
rootCertificates: string[];
rpIdHash: Uint8Array_;
verifyTimestampMS?: boolean;
attestationSafetyNetEnforceCTSCheck?: boolean;
};
//# sourceMappingURL=verifyRegistrationResponse.d.ts.map
@@ -0,0 +1,13 @@
import * as _heroui_system from '@heroui/system';
import { HTMLHeroUIProps } from '@heroui/system';
import { ReactRef } from '@heroui/react-utils';
interface ModalHeaderProps extends HTMLHeroUIProps<"header"> {
/**
* Ref to the DOM node.
*/
ref?: ReactRef<HTMLElement | null>;
}
declare const ModalHeader: _heroui_system.InternalForwardRefRenderFunction<"header", ModalHeaderProps, never>;
export { ModalHeaderProps, ModalHeader as default };
@@ -0,0 +1 @@
module.exports={C:{"47":0.00579,"48":0.00579,"52":0.01738,"61":0.03476,"68":0.00579,"78":0.00579,"105":0.00579,"113":0.01159,"115":0.29549,"125":0.01738,"127":0.00579,"128":0.01159,"133":0.00579,"136":0.01159,"138":0.00579,"139":0.01159,"140":0.03476,"141":0.00579,"142":0.01738,"143":0.94442,"144":0.99077,"145":0.00579,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 49 50 51 53 54 55 56 57 58 59 60 62 63 64 65 66 67 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 106 107 108 109 110 111 112 114 116 117 118 119 120 121 122 123 124 126 129 130 131 132 134 135 137 146 147 3.5 3.6"},D:{"39":0.01159,"40":0.01159,"41":0.01159,"42":0.01159,"43":0.01159,"44":0.01159,"45":0.01159,"46":0.01159,"47":0.01159,"48":0.01159,"49":0.01159,"50":0.01159,"51":0.01159,"52":0.01159,"53":0.01159,"54":0.01159,"55":0.01159,"56":0.00579,"57":0.01159,"58":0.01159,"59":0.01159,"60":0.01159,"69":0.00579,"70":0.00579,"75":0.01159,"78":0.00579,"79":0.06953,"83":0.00579,"84":0.01159,"85":0.00579,"87":0.04056,"92":0.00579,"93":0.00579,"96":0.00579,"97":0.01738,"98":0.00579,"99":0.00579,"100":0.00579,"101":0.00579,"103":0.02897,"105":0.02897,"106":0.00579,"107":0.00579,"108":0.02897,"109":1.49485,"110":0.00579,"111":0.01159,"112":6.07211,"113":0.00579,"114":0.06953,"116":0.04056,"117":0.00579,"118":0.00579,"119":0.01738,"120":0.02897,"121":0.01738,"122":0.08112,"123":0.01738,"124":0.04056,"125":5.13348,"126":0.64313,"127":0.02897,"128":0.04635,"129":0.01738,"130":0.03476,"131":0.08691,"132":0.05794,"133":0.02897,"134":0.04056,"135":0.05794,"136":0.05215,"137":0.07532,"138":0.26073,"139":0.35923,"140":9.4616,"141":17.00539,"142":0.1912,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 61 62 63 64 65 66 67 68 71 72 73 74 76 77 80 81 86 88 89 90 91 94 95 102 104 115 143 144 145"},F:{"79":0.01159,"91":0.00579,"92":0.02318,"95":0.05215,"99":0.06373,"114":0.00579,"119":0.00579,"120":0.13906,"121":0.18541,"122":1.59335,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 82 83 84 85 86 87 88 89 90 93 94 96 97 98 100 101 102 103 104 105 106 107 108 109 110 111 112 113 115 116 117 118 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.00579,"92":0.02318,"109":0.02318,"114":0.21438,"122":0.00579,"129":0.00579,"131":0.00579,"133":0.00579,"134":0.01159,"135":0.00579,"136":0.02318,"137":0.08112,"138":0.02318,"139":0.04635,"140":0.52146,"141":3.13455,"142":0.01159,_:"12 13 14 15 16 17 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 115 116 117 118 119 120 121 123 124 125 126 127 128 130 132"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 15.4 15.5 16.0 16.2 16.3 16.4 16.5 17.0 17.2 17.3 18.0 18.1 18.2 26.2","5.1":0.01159,"13.1":0.01159,"14.1":0.05794,"15.6":0.02897,"16.1":0.04056,"16.6":0.06953,"17.1":0.06373,"17.4":0.00579,"17.5":0.00579,"17.6":0.06953,"18.3":0.01738,"18.4":0.00579,"18.5-18.6":0.02318,"26.0":0.16803,"26.1":0.01738},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.0003,"5.0-5.1":0,"6.0-6.1":0.00122,"7.0-7.1":0.00091,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00274,"10.0-10.2":0.0003,"10.3":0.00518,"11.0-11.2":0.07684,"11.3-11.4":0.00183,"12.0-12.1":0.00061,"12.2-12.5":0.01494,"13.0-13.1":0,"13.2":0.00152,"13.3":0.00061,"13.4-13.7":0.00244,"14.0-14.4":0.00518,"14.5-14.8":0.00549,"15.0-15.1":0.00518,"15.2-15.3":0.00396,"15.4":0.00457,"15.5":0.00518,"15.6-15.8":0.0677,"16.0":0.00915,"16.1":0.01708,"16.2":0.00884,"16.3":0.01586,"16.4":0.00396,"16.5":0.00701,"16.6-16.7":0.09057,"17.0":0.0064,"17.1":0.00976,"17.2":0.00701,"17.3":0.01037,"17.4":0.0183,"17.5":0.03141,"17.6-17.7":0.07928,"18.0":0.01799,"18.1":0.0372,"18.2":0.02013,"18.3":0.06465,"18.4":0.03324,"18.5-18.6":1.69483,"26.0":0.20949,"26.1":0.00762},P:{"4":0.06318,"21":0.01053,"22":0.02106,"23":0.01053,"24":0.01053,"25":0.01053,"26":0.05265,"27":0.02106,"28":1.06348,"29":0.08424,_:"20 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 14.0 15.0 16.0 18.0 19.0","7.2-7.4":0.1053,"13.0":0.01053,"17.0":0.06318},I:{"0":0.0336,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00002},K:{"0":0.39957,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.00579,_:"6 7 8 9 10 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.1388},Q:{"14.9":0.00421},O:{"0":0.03785},H:{"0":0},L:{"0":40.23895}};
@@ -0,0 +1,253 @@
/*
Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>
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.
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 <COPYRIGHT HOLDER> 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.
*/
import {
BlockScope,
CatchScope,
ClassFieldInitializerScope,
ClassStaticBlockScope,
ClassScope,
ForScope,
FunctionExpressionNameScope,
FunctionScope,
GlobalScope,
ModuleScope,
SwitchScope,
WithScope
} from "./scope.js";
import { assert } from "./assert.js";
/**
* @constructor ScopeManager
*/
class ScopeManager {
constructor(options) {
this.scopes = [];
this.globalScope = null;
this.__nodeToScope = new WeakMap();
this.__currentScope = null;
this.__options = options;
this.__declaredVariables = new WeakMap();
}
__isOptimistic() {
return this.__options.optimistic;
}
__ignoreEval() {
return this.__options.ignoreEval;
}
__isJSXEnabled() {
return this.__options.jsx === true;
}
isGlobalReturn() {
return this.__options.nodejsScope || this.__options.sourceType === "commonjs";
}
isModule() {
return this.__options.sourceType === "module";
}
isImpliedStrict() {
return this.__options.impliedStrict;
}
isStrictModeSupported() {
return this.__options.ecmaVersion >= 5;
}
// Returns appropriate scope for this node.
__get(node) {
return this.__nodeToScope.get(node);
}
/**
* Get variables that are declared by the node.
*
* "are declared by the node" means the node is same as `Variable.defs[].node` or `Variable.defs[].parent`.
* If the node declares nothing, this method returns an empty array.
* CAUTION: This API is experimental. See https://github.com/estools/escope/pull/69 for more details.
* @param {Espree.Node} node a node to get.
* @returns {Variable[]} variables that declared by the node.
*/
getDeclaredVariables(node) {
return this.__declaredVariables.get(node) || [];
}
/**
* acquire scope from node.
* @function ScopeManager#acquire
* @param {Espree.Node} node node for the acquired scope.
* @param {?boolean} [inner=false] look up the most inner scope, default value is false.
* @returns {Scope?} Scope from node
*/
acquire(node, inner) {
/**
* predicate
* @param {Scope} testScope scope to test
* @returns {boolean} predicate
*/
function predicate(testScope) {
if (testScope.type === "function" && testScope.functionExpressionScope) {
return false;
}
return true;
}
const scopes = this.__get(node);
if (!scopes || scopes.length === 0) {
return null;
}
// Heuristic selection from all scopes.
// If you would like to get all scopes, please use ScopeManager#acquireAll.
if (scopes.length === 1) {
return scopes[0];
}
if (inner) {
for (let i = scopes.length - 1; i >= 0; --i) {
const scope = scopes[i];
if (predicate(scope)) {
return scope;
}
}
} else {
for (let i = 0, iz = scopes.length; i < iz; ++i) {
const scope = scopes[i];
if (predicate(scope)) {
return scope;
}
}
}
return null;
}
/**
* acquire all scopes from node.
* @function ScopeManager#acquireAll
* @param {Espree.Node} node node for the acquired scope.
* @returns {Scopes?} Scope array
*/
acquireAll(node) {
return this.__get(node);
}
/**
* release the node.
* @function ScopeManager#release
* @param {Espree.Node} node releasing node.
* @param {?boolean} [inner=false] look up the most inner scope, default value is false.
* @returns {Scope?} upper scope for the node.
*/
release(node, inner) {
const scopes = this.__get(node);
if (scopes && scopes.length) {
const scope = scopes[0].upper;
if (!scope) {
return null;
}
return this.acquire(scope.block, inner);
}
return null;
}
attach() { } // eslint-disable-line class-methods-use-this -- Desired as instance method
detach() { } // eslint-disable-line class-methods-use-this -- Desired as instance method
__nestScope(scope) {
if (scope instanceof GlobalScope) {
assert(this.__currentScope === null);
this.globalScope = scope;
}
this.__currentScope = scope;
return scope;
}
__nestGlobalScope(node) {
return this.__nestScope(new GlobalScope(this, node));
}
__nestBlockScope(node) {
return this.__nestScope(new BlockScope(this, this.__currentScope, node));
}
__nestFunctionScope(node, isMethodDefinition) {
return this.__nestScope(new FunctionScope(this, this.__currentScope, node, isMethodDefinition));
}
__nestForScope(node) {
return this.__nestScope(new ForScope(this, this.__currentScope, node));
}
__nestCatchScope(node) {
return this.__nestScope(new CatchScope(this, this.__currentScope, node));
}
__nestWithScope(node) {
return this.__nestScope(new WithScope(this, this.__currentScope, node));
}
__nestClassScope(node) {
return this.__nestScope(new ClassScope(this, this.__currentScope, node));
}
__nestClassFieldInitializerScope(node) {
return this.__nestScope(new ClassFieldInitializerScope(this, this.__currentScope, node));
}
__nestClassStaticBlockScope(node) {
return this.__nestScope(new ClassStaticBlockScope(this, this.__currentScope, node));
}
__nestSwitchScope(node) {
return this.__nestScope(new SwitchScope(this, this.__currentScope, node));
}
__nestModuleScope(node) {
return this.__nestScope(new ModuleScope(this, this.__currentScope, node));
}
__nestFunctionExpressionNameScope(node) {
return this.__nestScope(new FunctionExpressionNameScope(this, this.__currentScope, node));
}
__isES6() {
return this.__options.ecmaVersion >= 6;
}
}
export default ScopeManager;
/* vim: set sw=4 ts=4 et tw=80 : */
@@ -0,0 +1,18 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');
function merge(target, source) {
Object.keys(source).forEach(function (key) {
if (source[key] instanceof Object) {
if (target[key]) {
Object.assign(source[key], merge(target[key], source[key]));
}
}
});
return _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, target), source);
}
exports.default = merge;
@@ -0,0 +1,23 @@
import { IArray, IConst, IContext, IIdent, INumber, IOptional, IRef, IString, ITuple, IUnion } from './types.mjs';
/** Returns true if the value is a Array Parser */
export declare function IsArray(value: unknown): value is IArray;
/** Returns true if the value is a Const Parser */
export declare function IsConst(value: unknown): value is IConst;
/** Returns true if the value is a Context Parser */
export declare function IsContext(value: unknown): value is IContext;
/** Returns true if the value is a Ident Parser */
export declare function IsIdent(value: unknown): value is IIdent;
/** Returns true if the value is a Number Parser */
export declare function IsNumber(value: unknown): value is INumber;
/** Returns true if the value is a Optional Parser */
export declare function IsOptional(value: unknown): value is IOptional;
/** Returns true if the value is a Ref Parser */
export declare function IsRef(value: unknown): value is IRef;
/** Returns true if the value is a String Parser */
export declare function IsString(value: unknown): value is IString;
/** Returns true if the value is a Tuple Parser */
export declare function IsTuple(value: unknown): value is ITuple;
/** Returns true if the value is a Union Parser */
export declare function IsUnion(value: unknown): value is IUnion;
/** Returns true if the value is a Parser */
export declare function IsParser(value: unknown): value is IContext<unknown> | IUnion<unknown> | IArray<unknown> | IConst<unknown> | IIdent<unknown> | INumber<unknown> | IOptional<unknown> | IRef<unknown> | IString<unknown> | ITuple<unknown>;
@@ -0,0 +1,17 @@
var $87f92a7e077514b2$exports = {};
$87f92a7e077514b2$exports = {
"deselectedItem": (args)=>`Nie zaznaczono ${args.item}.`,
"longPressToSelect": `Naci\u{15B}nij i przytrzymaj, aby wej\u{15B}\u{107} do trybu wyboru.`,
"select": `Zaznacz`,
"selectedAll": `Wszystkie zaznaczone elementy.`,
"selectedCount": (args, formatter)=>`${formatter.plural(args.count, {
"=0": `Nie zaznaczono \u{17C}adnych element\xf3w`,
one: ()=>`${formatter.number(args.count)} zaznaczony element`,
other: ()=>`${formatter.number(args.count)} zaznaczonych element\xf3w`
})}.`,
"selectedItem": (args)=>`Zaznaczono ${args.item}.`
};
export {$87f92a7e077514b2$exports as default};
//# sourceMappingURL=pl-PL.module.js.map
@@ -0,0 +1 @@
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/dialog/src/index.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 */\nexport {useDialog} from './useDialog';\nexport type {AriaDialogProps} from '@react-types/dialog';\nexport type {DialogAria} from './useDialog';\n"],"names":[],"version":3,"file":"main.js.map"}
@@ -0,0 +1,12 @@
/**
* Converts an ASCII `string` to an array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the converted array.
*/
function asciiToArray(string) {
return string.split('');
}
export default asciiToArray;
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('isMatch', require('../isMatch'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,130 @@
import {
hasCR,
isSpace,
seedTokens,
seedBlock,
splitLines,
splitSpace,
seedSpec,
} from '../../src/util.js';
test.each([
['beginning', '\r to end', false],
['middle', 'has \r in middle', false],
['ending', 'only at end \r', true],
['none', 'no carriage returns', false],
])('carriage returns - %s', (name, source, boolResult) => {
expect(hasCR(source)).toEqual(boolResult);
});
test.each([
['win', 'a\r\nb\r\nc', ['a\r', 'b\r', 'c']],
['unix', 'a\nb\nc', ['a', 'b', 'c']],
['mixed', 'a\nb\r\nc', ['a', 'b\r', 'c']],
['none', 'abc', ['abc']],
])('spliLines - %s', (name, source, parsed) =>
expect(splitLines(source)).toEqual(parsed)
);
test.each([
['pre', ' abc', [' ', 'abc']],
['pre', 'abc ', ['', 'abc ']],
['pre+post', ' abc ', [' ', 'abc ']],
['none', 'abc', ['', 'abc']],
])('spliSpace - %s', (name, source, parsed) =>
expect(splitSpace(source)).toEqual(parsed)
);
test.each([
['space', ' ', true],
['spaces', ' ', true],
['tab', '\t', true],
['tabs', '\t\t', true],
['line end', '\n', true],
['line ends', '\n\n', true],
['line return', '\r', true],
['line returns', '\r\r', true],
['mixed space', '\n\r\t', true],
['mixed', '\naba', false],
['alpahnumeric', '1abcd34', false],
['symbols', '*', false],
['empty', '', false],
])('isSpace - %s', (name, source, result) =>
expect(isSpace(source)).toBe(result)
);
test('seedTokens defaults', () => {
expect(seedTokens()).toEqual({
start: '',
delimiter: '',
postDelimiter: '',
tag: '',
postTag: '',
name: '',
postName: '',
type: '',
postType: '',
description: '',
end: '',
lineEnd: '',
});
});
test('seedTokens overrides', () => {
expect(seedTokens({ description: 'abc' })).toEqual({
start: '',
delimiter: '',
postDelimiter: '',
tag: '',
postTag: '',
name: '',
postName: '',
type: '',
postType: '',
description: 'abc',
end: '',
lineEnd: '',
});
});
test('seedBlock defaults', () => {
expect(seedBlock()).toEqual({
description: '',
tags: [],
source: [],
problems: [],
});
});
test('seedBlock overrides', () => {
expect(seedBlock({ description: 'abc' })).toEqual({
description: 'abc',
tags: [],
source: [],
problems: [],
});
});
test('seedSpec defaults', () => {
expect(seedSpec()).toEqual({
tag: '',
name: '',
type: '',
optional: false,
description: '',
problems: [],
source: [],
});
});
test('seedSpec overrides', () => {
expect(seedSpec({ description: 'abc' })).toEqual({
tag: '',
name: '',
type: '',
optional: false,
description: 'abc',
problems: [],
source: [],
});
});
@@ -0,0 +1,173 @@
import { MESSAGE_TYPE } from "./message-type-contract";
import { normalizeFieldInfo } from "./reflection-info";
import { ReflectionTypeCheck } from "./reflection-type-check";
import { ReflectionJsonReader } from "./reflection-json-reader";
import { ReflectionJsonWriter } from "./reflection-json-writer";
import { ReflectionBinaryReader } from "./reflection-binary-reader";
import { ReflectionBinaryWriter } from "./reflection-binary-writer";
import { reflectionCreate } from "./reflection-create";
import { reflectionMergePartial } from "./reflection-merge-partial";
import { typeofJsonValue } from "./json-typings";
import { jsonReadOptions, jsonWriteOptions, } from "./json-format-contract";
import { reflectionEquals } from "./reflection-equals";
import { binaryWriteOptions } from "./binary-writer";
import { binaryReadOptions } from "./binary-reader";
const baseDescriptors = Object.getOwnPropertyDescriptors(Object.getPrototypeOf({}));
const messageTypeDescriptor = baseDescriptors[MESSAGE_TYPE] = {};
/**
* This standard message type provides reflection-based
* operations to work with a message.
*/
export class MessageType {
constructor(name, fields, options) {
this.defaultCheckDepth = 16;
this.typeName = name;
this.fields = fields.map(normalizeFieldInfo);
this.options = options !== null && options !== void 0 ? options : {};
messageTypeDescriptor.value = this;
this.messagePrototype = Object.create(null, baseDescriptors);
this.refTypeCheck = new ReflectionTypeCheck(this);
this.refJsonReader = new ReflectionJsonReader(this);
this.refJsonWriter = new ReflectionJsonWriter(this);
this.refBinReader = new ReflectionBinaryReader(this);
this.refBinWriter = new ReflectionBinaryWriter(this);
}
create(value) {
let message = reflectionCreate(this);
if (value !== undefined) {
reflectionMergePartial(this, message, value);
}
return message;
}
/**
* Clone the message.
*
* Unknown fields are discarded.
*/
clone(message) {
let copy = this.create();
reflectionMergePartial(this, copy, message);
return copy;
}
/**
* Determines whether two message of the same type have the same field values.
* Checks for deep equality, traversing repeated fields, oneof groups, maps
* and messages recursively.
* Will also return true if both messages are `undefined`.
*/
equals(a, b) {
return reflectionEquals(this, a, b);
}
/**
* Is the given value assignable to our message type
* and contains no [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)?
*/
is(arg, depth = this.defaultCheckDepth) {
return this.refTypeCheck.is(arg, depth, false);
}
/**
* Is the given value assignable to our message type,
* regardless of [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)?
*/
isAssignable(arg, depth = this.defaultCheckDepth) {
return this.refTypeCheck.is(arg, depth, true);
}
/**
* Copy partial data into the target message.
*/
mergePartial(target, source) {
reflectionMergePartial(this, target, source);
}
/**
* Create a new message from binary format.
*/
fromBinary(data, options) {
let opt = binaryReadOptions(options);
return this.internalBinaryRead(opt.readerFactory(data), data.byteLength, opt);
}
/**
* Read a new message from a JSON value.
*/
fromJson(json, options) {
return this.internalJsonRead(json, jsonReadOptions(options));
}
/**
* Read a new message from a JSON string.
* This is equivalent to `T.fromJson(JSON.parse(json))`.
*/
fromJsonString(json, options) {
let value = JSON.parse(json);
return this.fromJson(value, options);
}
/**
* Write the message to canonical JSON value.
*/
toJson(message, options) {
return this.internalJsonWrite(message, jsonWriteOptions(options));
}
/**
* Convert the message to canonical JSON string.
* This is equivalent to `JSON.stringify(T.toJson(t))`
*/
toJsonString(message, options) {
var _a;
let value = this.toJson(message, options);
return JSON.stringify(value, null, (_a = options === null || options === void 0 ? void 0 : options.prettySpaces) !== null && _a !== void 0 ? _a : 0);
}
/**
* Write the message to binary format.
*/
toBinary(message, options) {
let opt = binaryWriteOptions(options);
return this.internalBinaryWrite(message, opt.writerFactory(), opt).finish();
}
/**
* This is an internal method. If you just want to read a message from
* JSON, use `fromJson()` or `fromJsonString()`.
*
* Reads JSON value and merges the fields into the target
* according to protobuf rules. If the target is omitted,
* a new instance is created first.
*/
internalJsonRead(json, options, target) {
if (json !== null && typeof json == "object" && !Array.isArray(json)) {
let message = target !== null && target !== void 0 ? target : this.create();
this.refJsonReader.read(json, message, options);
return message;
}
throw new Error(`Unable to parse message ${this.typeName} from JSON ${typeofJsonValue(json)}.`);
}
/**
* This is an internal method. If you just want to write a message
* to JSON, use `toJson()` or `toJsonString().
*
* Writes JSON value and returns it.
*/
internalJsonWrite(message, options) {
return this.refJsonWriter.write(message, options);
}
/**
* This is an internal method. If you just want to write a message
* in binary format, use `toBinary()`.
*
* Serializes the message in binary format and appends it to the given
* writer. Returns passed writer.
*/
internalBinaryWrite(message, writer, options) {
this.refBinWriter.write(message, writer, options);
return writer;
}
/**
* This is an internal method. If you just want to read a message from
* binary data, use `fromBinary()`.
*
* Reads data from binary format and merges the fields into
* the target according to protobuf rules. If the target is
* omitted, a new instance is created first.
*/
internalBinaryRead(reader, length, options, target) {
let message = target !== null && target !== void 0 ? target : this.create();
this.refBinReader.read(reader, message, options, length);
return message;
}
}
@@ -0,0 +1,29 @@
{
"name": "spdx-license-ids",
"version": "3.0.22",
"description": "A list of SPDX license identifiers",
"repository": "jslicense/spdx-license-ids",
"author": "Shinnosuke Watanabe (https://github.com/shinnn)",
"license": "CC0-1.0",
"scripts": {
"build": "node build.js",
"latest": "node latest.js",
"pretest": "npm run build",
"test": "node test.js"
},
"files": [
"deprecated.json",
"index.json"
],
"keywords": [
"spdx",
"license",
"licenses",
"id",
"identifier",
"identifiers",
"json",
"array",
"oss"
]
}
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more