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,34 @@
import chain from './chain.js';
/**
* Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
*
* @name chain
* @memberOf _
* @since 0.1.0
* @category Seq
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* var users = [
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 40 }
* ];
*
* // A sequence without explicit chaining.
* _(users).head();
* // => { 'user': 'barney', 'age': 36 }
*
* // A sequence with explicit chaining.
* _(users)
* .chain()
* .head()
* .pick('user')
* .value();
* // => { 'user': 'barney' }
*/
function wrapperChain() {
return chain(this);
}
export default wrapperChain;
@@ -0,0 +1,55 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = getAccessibleChildText;
var _jsxAstUtils = require("jsx-ast-utils");
var _isHiddenFromScreenReader = _interopRequireDefault(require("./isHiddenFromScreenReader"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
/**
* Returns a new "standardized" string: all whitespace is collapsed to one space,
* and the string is lowercase
* @param {string} input
* @returns lowercase, single-spaced, punctuation-stripped, trimmed string
*/
function standardizeSpaceAndCase(input) {
return input.trim().replace(/[,.?¿!‽¡;:]/g, '') // strip punctuation
.replace(/\s\s+/g, ' ') // collapse spaces
.toLowerCase();
}
/**
* Returns the (recursively-defined) accessible child text of a node, which (in-order) is:
* 1. The element's aria-label
* 2. If the element is a direct literal, the literal value
* 3. Otherwise, merge all of its children
* @param {JSXElement} node - node to traverse
* @returns child text as a string
*/
function getAccessibleChildText(node, elementType) {
var ariaLabel = (0, _jsxAstUtils.getLiteralPropValue)((0, _jsxAstUtils.getProp)(node.openingElement.attributes, 'aria-label'));
// early escape-hatch when aria-label is applied
if (ariaLabel) return standardizeSpaceAndCase(ariaLabel);
// early-return if alt prop exists and is an image
var altTag = (0, _jsxAstUtils.getLiteralPropValue)((0, _jsxAstUtils.getProp)(node.openingElement.attributes, 'alt'));
if (elementType(node.openingElement) === 'img' && altTag) return standardizeSpaceAndCase(altTag);
// skip if aria-hidden is true
if ((0, _isHiddenFromScreenReader["default"])(elementType(node.openingElement), node.openingElement.attributes)) {
return '';
}
var rawChildText = node.children.map(function (currentNode) {
// $FlowFixMe JSXText is missing in ast-types-flow
if (currentNode.type === 'Literal' || currentNode.type === 'JSXText') {
return String(currentNode.value);
}
if (currentNode.type === 'JSXElement') {
return getAccessibleChildText(currentNode, elementType);
}
return '';
}).join(' ');
return standardizeSpaceAndCase(rawChildText);
}
module.exports = exports.default;
@@ -0,0 +1 @@
{"version":3,"file":"getFirstIteratorResult.spec.d.ts","sourceRoot":"","sources":["../../../../src/common/actions/getFirstIteratorResult.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var figureRole = {
abstract: false,
accessibleNameRequired: false,
baseConcepts: [],
childrenPresentational: false,
nameFrom: ['author'],
prohibitedProps: [],
props: {},
relatedConcepts: [{
concept: {
name: 'figure'
},
module: 'HTML'
}],
requireContextRole: [],
requiredContextRole: [],
requiredOwnedElements: [],
requiredProps: {},
superClass: [['roletype', 'structure', 'section']]
};
var _default = exports.default = figureRole;
@@ -0,0 +1,2 @@
export * from './errors.mjs';
export * from './function.mjs';
@@ -0,0 +1,455 @@
import {
tv
} from "./chunk-UWE6H66T.mjs";
// src/components/date-input.ts
var dateInput = tv({
slots: {
base: "group flex flex-col",
label: [
"block subpixel-antialiased text-small text-default-600",
"group-data-[required=true]:after:content-['*'] group-data-[required=true]:after:text-danger group-data-[required=true]:after:ml-0.5",
"group-data-[invalid=true]:text-danger"
],
inputWrapper: [
"relative px-3 gap-3 w-full inline-flex flex-row items-center",
"cursor-text tap-highlight-transparent shadow-sm"
],
input: "flex h-full gap-x-0.5 w-full font-normal",
innerWrapper: [
"flex items-center text-default-400 w-full gap-x-2 h-6",
"group-data-[invalid=true]:text-danger"
],
segment: [
"group first:-ml-0.5 [&:not(:first-child)]:-ml-1 px-0.5 my-auto box-content tabular-nums text-start",
"inline-block outline-none focus:shadow-sm rounded-md",
"text-foreground-500 data-[editable=true]:text-foreground",
"data-[editable=true]:data-[placeholder=true]:text-foreground-500",
"data-[invalid=true]:text-danger-300 data-[invalid=true]:data-[editable=true]:text-danger",
"data-[invalid=true]:focus:bg-danger-400/50 dark:data-[invalid=true]:focus:bg-danger-400/20",
"data-[invalid=true]:data-[editable=true]:focus:text-danger"
],
helperWrapper: "hidden group-data-[has-helper=true]:flex p-1 relative flex-col gap-1.5",
description: "text-tiny text-foreground-400",
errorMessage: "text-tiny text-danger"
},
variants: {
variant: {
flat: {
inputWrapper: [
"bg-default-100",
"hover:bg-default-200",
"focus-within:hover:bg-default-100",
"group-data-[invalid=true]:bg-danger-50",
"group-data-[invalid=true]:hover:bg-danger-100",
"group-data-[invalid=true]:focus-within:hover:bg-danger-50"
]
},
faded: {
inputWrapper: [
"bg-default-100",
"border-medium",
"border-default-200",
"hover:border-default-400",
"group-data-[invalid=true]:bg-danger-50",
"group-data-[invalid=true]:hover:bg-danger-100",
"group-data-[invalid=true]:focus-within:hover:bg-danger-50"
]
},
bordered: {
inputWrapper: [
"border-medium",
"border-default-200",
"hover:border-default-400",
"focus-within:border-default-foreground",
"focus-within:hover:border-default-foreground",
"group-data-[invalid=true]:border-danger",
"group-data-[invalid=true]:hover:border-danger",
"group-data-[invalid=true]:focus-within:hover:border-danger"
]
},
underlined: {
inputWrapper: [
"px-1",
"pb-1",
"gap-0",
"relative",
"box-border",
"border-b-medium",
"shadow-[0_1px_0px_0_rgba(0,0,0,0.05)]",
"border-default-200",
"!rounded-none",
"hover:border-default-300",
"after:content-['']",
"after:w-0",
"after:origin-center",
"after:bg-default-foreground",
"after:absolute",
"after:left-1/2",
"after:-translate-x-1/2",
"after:-bottom-[2px]",
"after:h-[2px]",
"focus-within:after:w-full",
"group-data-[invalid=true]:after:bg-danger"
]
}
},
color: {
default: {
segment: "focus:bg-default-400/50 data-[editable=true]:focus:text-default-foreground"
},
primary: {
segment: "focus:bg-primary-400/50 data-[editable=true]:focus:text-primary"
},
secondary: {
segment: "focus:bg-secondary-400/50 data-[editable=true]:focus:text-secondary"
},
success: {
segment: "focus:bg-success-400/50 dark:focus:bg-success-400/20 data-[editable=true]:focus:text-success"
},
warning: {
segment: "focus:bg-warning-400/50 dark:focus:bg-warning-400/20 data-[editable=true]:focus:text-warning"
},
danger: {
segment: "focus:bg-danger-400/50 dark:focus:bg-danger-400/20 data-[editable=true]:focus:text-danger"
}
},
size: {
sm: {
label: "text-tiny",
input: "text-small",
inputWrapper: "h-8 min-h-8 px-2 rounded-small"
},
md: {
input: "text-small",
inputWrapper: "h-10 min-h-10 rounded-medium",
clearButton: "text-large"
},
lg: {
label: "text-medium",
input: "text-medium",
inputWrapper: "h-12 min-h-12 rounded-large"
}
},
radius: {
none: {
inputWrapper: "rounded-none"
},
sm: {
inputWrapper: "rounded-small"
},
md: {
inputWrapper: "rounded-medium"
},
lg: {
inputWrapper: "rounded-large"
},
full: {
inputWrapper: "rounded-full"
}
},
labelPlacement: {
outside: {
base: "flex flex-col data-[has-helper=true]:pb-[calc(theme(fontSize.tiny)_+8px)] gap-y-1.5",
label: "w-full text-foreground",
helperWrapper: "absolute top-[calc(100%_+_2px)] start-0"
},
"outside-left": {
base: "flex-row items-center data-[has-helper=true]:pb-[calc(theme(fontSize.tiny)_+_8px)] gap-x-2 flex-nowrap",
label: "relative text-foreground",
inputWrapper: "relative flex-1",
helperWrapper: "absolute top-[calc(100%_+_2px)] start-0"
},
inside: {
label: "w-full text-tiny cursor-text",
inputWrapper: "flex-col items-start justify-center gap-0"
}
},
fullWidth: {
true: {
base: "w-full",
inputWrapper: "w-full"
}
},
isDisabled: {
true: {
base: "opacity-disabled pointer-events-none",
inputWrapper: "pointer-events-none",
label: "pointer-events-none"
}
},
disableAnimation: {
true: {
label: "transition-none",
input: "transition-none",
inputWrapper: "transition-none"
},
false: {
label: [
"!ease-out",
"!duration-200",
"will-change-auto",
"motion-reduce:transition-none",
"transition-[color,opacity]"
],
inputWrapper: "transition-background motion-reduce:transition-none !duration-150",
segment: "transition-colors motion-reduce:transition-none"
}
}
},
defaultVariants: {
variant: "flat",
color: "default",
size: "md",
fullWidth: true,
labelPlacement: "inside",
isDisabled: false
},
compoundVariants: [
{
variant: "flat",
color: "primary",
class: {
innerWrapper: "text-primary",
inputWrapper: ["bg-primary-100", "hover:bg-primary-50", "focus-within:bg-primary-50"],
segment: "text-primary-300 data-[editable=true]:data-[placeholder=true]:text-primary-300 data-[editable=true]:text-primary",
label: "text-primary"
}
},
{
variant: "flat",
color: "secondary",
class: {
innerWrapper: "text-secondary",
inputWrapper: ["bg-secondary-100", "hover:bg-secondary-50", "focus-within:bg-secondary-50"],
segment: "text-secondary-300 data-[editable=true]:data-[placeholder=true]:text-secondary-300 data-[editable=true]:text-secondary",
label: "text-secondary"
}
},
{
variant: "flat",
color: "success",
class: {
innerWrapper: "text-success-600 dark:text-success",
inputWrapper: ["bg-success-100", "hover:bg-success-50", "focus-within:bg-success-50"],
segment: "text-success-400 data-[editable=true]:data-[placeholder=true]:text-success-400 data-[editable=true]:text-success-600 data-[editable=true]:focus:text-success-600",
label: "text-success-600 dark:text-success"
}
},
{
variant: "flat",
color: "warning",
class: {
innerWrapper: "text-warning-600 dark:text-warning",
inputWrapper: ["bg-warning-100", "hover:bg-warning-50", "focus-within:bg-warning-50"],
segment: "text-warning-400 data-[editable=true]:data-[placeholder=true]:text-warning-400 data-[editable=true]:text-warning-600 data-[editable=true]:focus:text-warning-600",
label: "text-warning-600 dark:text-warning"
}
},
{
variant: "flat",
color: "danger",
class: {
innerWrapper: "text-danger",
inputWrapper: ["bg-danger-100", "hover:bg-danger-50", "focus-within:bg-danger-50"],
segment: "text-danger-300 data-[editable=true]:data-[placeholder=true]:text-danger-300 data-[editable=true]:text-danger",
label: "text-danger"
}
},
{
variant: "faded",
color: "primary",
class: {
innerWrapper: "text-primary",
inputWrapper: [
"hover:border-primary",
"focus-within:border-primary",
"focus-within:hover:border-primary"
],
label: "text-primary"
}
},
{
variant: "faded",
color: "secondary",
class: {
innerWrapper: "text-secondary",
inputWrapper: [
"hover:border-secondary",
"focus-within:border-secondary",
"focus-within:hover:border-secondary"
],
label: "text-secondary"
}
},
{
variant: "faded",
color: "success",
class: {
innerWrapper: "text-success",
inputWrapper: [
"hover:border-success",
"focus-within:border-success",
"focus-within:hover:border-success"
],
label: "text-success"
}
},
{
variant: "faded",
color: "warning",
class: {
innerWrapper: "text-warning",
inputWrapper: [
"hover:border-warning",
"focus-within:border-warning",
"focus-within:hover:border-warning"
],
label: "text-warning"
}
},
{
variant: "faded",
color: "danger",
class: {
innerWrapper: "text-danger",
inputWrapper: [
"hover:border-danger",
"focus-within:border-danger",
"focus-within:hover:border-danger"
],
label: "text-danger"
}
},
{
variant: "bordered",
color: "primary",
class: {
innerWrapper: "text-primary",
inputWrapper: ["focus-within:border-primary", "focus-within:hover:border-primary"],
label: "text-primary"
}
},
{
variant: "bordered",
color: "secondary",
class: {
innerWrapper: "text-secondary",
inputWrapper: ["focus-within:border-secondary", "focus-within:hover:border-secondary"],
label: "text-secondary"
}
},
{
variant: "bordered",
color: "success",
class: {
innerWrapper: "text-success",
inputWrapper: ["focus-within:border-success", "focus-within:hover:border-success"],
label: "text-success"
}
},
{
variant: "bordered",
color: "warning",
class: {
innerWrapper: "text-warning",
inputWrapper: ["focus-within:border-warning", "focus-within:hover:border-warning"],
label: "text-warning"
}
},
{
variant: "bordered",
color: "danger",
class: {
innerWrapper: "text-danger",
inputWrapper: ["focus-within:border-danger", "focus-within:hover:border-danger"],
label: "text-danger"
}
},
{
variant: "underlined",
color: "primary",
class: {
innerWrapper: "text-primary",
inputWrapper: "after:bg-primary",
label: "text-primary"
}
},
{
variant: "underlined",
color: "secondary",
class: {
innerWrapper: "text-secondary",
inputWrapper: "after:bg-secondary",
label: "text-secondary"
}
},
{
variant: "underlined",
color: "success",
class: {
innerWrapper: "text-success",
inputWrapper: "after:bg-success",
label: "text-success"
}
},
{
variant: "underlined",
color: "warning",
class: {
innerWrapper: "text-warning",
inputWrapper: "after:bg-warning",
label: "text-warning"
}
},
{
variant: "underlined",
color: "danger",
class: {
innerWrapper: "text-danger",
inputWrapper: "after:bg-danger",
label: "text-danger"
}
},
{
labelPlacement: "inside",
size: "sm",
class: {
inputWrapper: "h-12 py-1.5 px-3"
}
},
{
labelPlacement: "inside",
size: "md",
class: {
inputWrapper: "h-14 py-2"
}
},
{
labelPlacement: "inside",
size: "lg",
class: {
label: "text-medium",
inputWrapper: "h-16 py-2.5 gap-0"
}
},
{
disableAnimation: false,
variant: ["faded", "bordered"],
class: {
inputWrapper: "transition-colors motion-reduce:transition-none"
}
},
{
disableAnimation: false,
variant: "underlined",
class: {
inputWrapper: "after:transition-width motion-reduce:after:transition-none"
}
}
]
});
export {
dateInput
};
@@ -0,0 +1,52 @@
/*
* 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.
*/ class $d6fd23bc337660df$export$64839e615120df17 {
getStringForLocale(key, locale) {
let strings = this.messages[locale];
if (!strings) {
strings = $d6fd23bc337660df$var$getStringsForLocale(locale, this.messages, this.defaultLocale);
this.messages[locale] = strings;
}
let string = strings[key];
if (!string) throw new Error(`Could not find intl message ${key} in ${locale} locale`);
return string;
}
constructor(messages, defaultLocale = 'en-US'){
// Clone messages so we don't modify the original object.
// Filter out entries with falsy values which may have been caused by applying optimize-locales-plugin.
this.messages = Object.fromEntries(Object.entries(messages).filter(([, v])=>v));
this.defaultLocale = defaultLocale;
}
}
function $d6fd23bc337660df$var$getStringsForLocale(locale, strings, defaultLocale = 'en-US') {
// If there is an exact match, use it.
if (strings[locale]) return strings[locale];
// Attempt to find the closest match by language.
// For example, if the locale is fr-CA (French Canadian), but there is only
// an fr-FR (France) set of strings, use that.
// This could be replaced with Intl.LocaleMatcher once it is supported.
// https://github.com/tc39/proposal-intl-localematcher
let language = $d6fd23bc337660df$var$getLanguage(locale);
if (strings[language]) return strings[language];
for(let key in strings){
if (key.startsWith(language + '-')) return strings[key];
}
// Nothing close, use english.
return strings[defaultLocale];
}
function $d6fd23bc337660df$var$getLanguage(locale) {
if (Intl.Locale) return new Intl.Locale(locale).language;
return locale.split('-')[0];
}
export {$d6fd23bc337660df$export$64839e615120df17 as MessageDictionary};
//# sourceMappingURL=MessageDictionary.module.js.map
@@ -0,0 +1,19 @@
let Declaration = require('../declaration')
let flexSpec = require('./flex-spec')
class FlexWrap extends Declaration {
/**
* Don't add prefix for 2009 spec
*/
set(decl, prefix) {
let spec = flexSpec(prefix)[0]
if (spec !== 2009) {
return super.set(decl, prefix)
}
return undefined
}
}
FlexWrap.names = ['flex-wrap']
module.exports = FlexWrap
@@ -0,0 +1,13 @@
type Handler<T> = () => T | Promise<T>;
type Checker<T> = (result: T) => T | Promise<T>;
export declare class Fallback<T> {
private handlers;
private checker;
constructor(checker?: Checker<T>);
add(handler: Handler<T>): this;
run(): Promise<T>;
}
export declare class FallbackUtil {
static boolchecker<T>(value: T, condition: boolean): T;
}
export {};
@@ -0,0 +1,61 @@
# toidentifier
[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Build Status][github-actions-ci-image]][github-actions-ci-url]
[![Test Coverage][codecov-image]][codecov-url]
> Convert a string of words to a JavaScript identifier
## Install
This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
```bash
$ npm install toidentifier
```
## Example
```js
var toIdentifier = require('toidentifier')
console.log(toIdentifier('Bad Request'))
// => "BadRequest"
```
## API
This CommonJS module exports a single default function: `toIdentifier`.
### toIdentifier(string)
Given a string as the argument, it will be transformed according to
the following rules and the new string will be returned:
1. Split into words separated by space characters (`0x20`).
2. Upper case the first character of each word.
3. Join the words together with no separator.
4. Remove all non-word (`[0-9a-z_]`) characters.
## License
[MIT](LICENSE)
[codecov-image]: https://img.shields.io/codecov/c/github/component/toidentifier.svg
[codecov-url]: https://codecov.io/gh/component/toidentifier
[downloads-image]: https://img.shields.io/npm/dm/toidentifier.svg
[downloads-url]: https://npmjs.org/package/toidentifier
[github-actions-ci-image]: https://img.shields.io/github/workflow/status/component/toidentifier/ci/master?label=ci
[github-actions-ci-url]: https://github.com/component/toidentifier?query=workflow%3Aci
[npm-image]: https://img.shields.io/npm/v/toidentifier.svg
[npm-url]: https://npmjs.org/package/toidentifier
##
[npm]: https://www.npmjs.com/
[yarn]: https://yarnpkg.com/
@@ -0,0 +1 @@
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@react-aria/link/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 type {AriaLinkOptions, LinkAria} from './useLink';\nexport {useLink} from './useLink';\n"],"names":[],"version":3,"file":"main.js.map"}
@@ -0,0 +1,145 @@
'use strict';
var identity = require('../nodes/identity.js');
var stringify = require('./stringify.js');
var stringifyComment = require('./stringifyComment.js');
function stringifyCollection(collection, ctx, options) {
const flow = ctx.inFlow ?? collection.flow;
const stringify = flow ? stringifyFlowCollection : stringifyBlockCollection;
return stringify(collection, ctx, options);
}
function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) {
const { indent, options: { commentString } } = ctx;
const itemCtx = Object.assign({}, ctx, { indent: itemIndent, type: null });
let chompKeep = false; // flag for the preceding node's status
const lines = [];
for (let i = 0; i < items.length; ++i) {
const item = items[i];
let comment = null;
if (identity.isNode(item)) {
if (!chompKeep && item.spaceBefore)
lines.push('');
addCommentBefore(ctx, lines, item.commentBefore, chompKeep);
if (item.comment)
comment = item.comment;
}
else if (identity.isPair(item)) {
const ik = identity.isNode(item.key) ? item.key : null;
if (ik) {
if (!chompKeep && ik.spaceBefore)
lines.push('');
addCommentBefore(ctx, lines, ik.commentBefore, chompKeep);
}
}
chompKeep = false;
let str = stringify.stringify(item, itemCtx, () => (comment = null), () => (chompKeep = true));
if (comment)
str += stringifyComment.lineComment(str, itemIndent, commentString(comment));
if (chompKeep && comment)
chompKeep = false;
lines.push(blockItemPrefix + str);
}
let str;
if (lines.length === 0) {
str = flowChars.start + flowChars.end;
}
else {
str = lines[0];
for (let i = 1; i < lines.length; ++i) {
const line = lines[i];
str += line ? `\n${indent}${line}` : '\n';
}
}
if (comment) {
str += '\n' + stringifyComment.indentComment(commentString(comment), indent);
if (onComment)
onComment();
}
else if (chompKeep && onChompKeep)
onChompKeep();
return str;
}
function stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) {
const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx;
itemIndent += indentStep;
const itemCtx = Object.assign({}, ctx, {
indent: itemIndent,
inFlow: true,
type: null
});
let reqNewline = false;
let linesAtValue = 0;
const lines = [];
for (let i = 0; i < items.length; ++i) {
const item = items[i];
let comment = null;
if (identity.isNode(item)) {
if (item.spaceBefore)
lines.push('');
addCommentBefore(ctx, lines, item.commentBefore, false);
if (item.comment)
comment = item.comment;
}
else if (identity.isPair(item)) {
const ik = identity.isNode(item.key) ? item.key : null;
if (ik) {
if (ik.spaceBefore)
lines.push('');
addCommentBefore(ctx, lines, ik.commentBefore, false);
if (ik.comment)
reqNewline = true;
}
const iv = identity.isNode(item.value) ? item.value : null;
if (iv) {
if (iv.comment)
comment = iv.comment;
if (iv.commentBefore)
reqNewline = true;
}
else if (item.value == null && ik?.comment) {
comment = ik.comment;
}
}
if (comment)
reqNewline = true;
let str = stringify.stringify(item, itemCtx, () => (comment = null));
if (i < items.length - 1)
str += ',';
if (comment)
str += stringifyComment.lineComment(str, itemIndent, commentString(comment));
if (!reqNewline && (lines.length > linesAtValue || str.includes('\n')))
reqNewline = true;
lines.push(str);
linesAtValue = lines.length;
}
const { start, end } = flowChars;
if (lines.length === 0) {
return start + end;
}
else {
if (!reqNewline) {
const len = lines.reduce((sum, line) => sum + line.length + 2, 2);
reqNewline = ctx.options.lineWidth > 0 && len > ctx.options.lineWidth;
}
if (reqNewline) {
let str = start;
for (const line of lines)
str += line ? `\n${indentStep}${indent}${line}` : '\n';
return `${str}\n${indent}${end}`;
}
else {
return `${start}${fcPadding}${lines.join(' ')}${fcPadding}${end}`;
}
}
}
function addCommentBefore({ indent, options: { commentString } }, lines, comment, chompKeep) {
if (comment && chompKeep)
comment = comment.replace(/^\n+/, '');
if (comment) {
const ic = stringifyComment.indentComment(commentString(comment), indent);
lines.push(ic.trimStart()); // Avoid double indent on first line
}
}
exports.stringifyCollection = stringifyCollection;
@@ -0,0 +1,41 @@
// Helper type. Not useful on its own.
type Without<FirstType, SecondType> = {[KeyType in Exclude<keyof FirstType, keyof SecondType>]?: never};
/**
Create a type that has mutually exclusive keys.
This type was inspired by [this comment](https://github.com/Microsoft/TypeScript/issues/14094#issuecomment-373782604).
This type works with a helper type, called `Without`. `Without<FirstType, SecondType>` produces a type that has only keys from `FirstType` which are not present on `SecondType` and sets the value type for these keys to `never`. This helper type is then used in `MergeExclusive` to remove keys from either `FirstType` or `SecondType`.
@example
```
import {MergeExclusive} from 'type-fest';
interface ExclusiveVariation1 {
exclusive1: boolean;
}
interface ExclusiveVariation2 {
exclusive2: string;
}
type ExclusiveOptions = MergeExclusive<ExclusiveVariation1, ExclusiveVariation2>;
let exclusiveOptions: ExclusiveOptions;
exclusiveOptions = {exclusive1: true};
//=> Works
exclusiveOptions = {exclusive2: 'hi'};
//=> Works
exclusiveOptions = {exclusive1: true, exclusive2: 'hi'};
//=> Error
```
@category Utilities
*/
export type MergeExclusive<FirstType, SecondType> =
(FirstType | SecondType) extends object ?
(Without<FirstType, SecondType> & SecondType) | (Without<SecondType, FirstType> & FirstType) :
FirstType | SecondType;
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2024_arraybuffer: LibDefinition;
@@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var TabGroupRole = {
relatedConcepts: [{
module: 'ARIA',
concept: {
name: 'tablist'
}
}],
type: 'structure'
};
var _default = TabGroupRole;
exports.default = _default;
@@ -0,0 +1,550 @@
"use strict";
/* @minVersion 7.20.0 */
/**
Enums are used in this file, but not assigned to vars to avoid non-hoistable values
CONSTRUCTOR = 0;
PUBLIC = 1;
PRIVATE = 2;
FIELD = 0;
ACCESSOR = 1;
METHOD = 2;
GETTER = 3;
SETTER = 4;
STATIC = 5;
CLASS = 10; // only used in assertValidReturnValue
*/
function _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentClass) {
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
return function addInitializer(initializer) {
assertNotFinished(decoratorFinishedRef, "addInitializer");
assertCallable(initializer, "An initializer");
initializers.push(initializer);
};
}
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value) {
var kindStr;
switch (kind) {
case 1 /* ACCESSOR */:
kindStr = "accessor";
break;
case 2 /* METHOD */:
kindStr = "method";
break;
case 3 /* GETTER */:
kindStr = "getter";
break;
case 4 /* SETTER */:
kindStr = "setter";
break;
default:
kindStr = "field";
}
var ctx = { kind: kindStr, name: isPrivate ? "#" + name : name, static: isStatic, private: isPrivate, metadata: metadata };
var decoratorFinishedRef = { v: false };
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
var get, set;
if (kind === 0 /* FIELD */) {
if (isPrivate) {
get = desc.get;
set = desc.set;
} else {
get = function() {
return this[name];
};
set = function(v) {
this[name] = v;
};
}
} else if (kind === 2 /* METHOD */) {
get = function() {
return desc.value;
};
} else {
// replace with values that will go through the final getter and setter
if (kind === 1 /* ACCESSOR */ || kind === 3 /* GETTER */) {
get = function() {
return desc.get.call(this);
};
}
if (kind === 1 /* ACCESSOR */ || kind === 4 /* SETTER */) {
set = function(v) {
desc.set.call(this, v);
};
}
}
ctx.access = get && set ? { get: get, set: set } : get ? { get: get } : { set: set };
try {
return dec(value, ctx);
} finally {
decoratorFinishedRef.v = true;
}
}
function assertNotFinished(decoratorFinishedRef, fnName) {
if (decoratorFinishedRef.v) {
throw new Error("attempted to call " + fnName + " after decoration was finished");
}
}
function assertCallable(fn, hint) {
if (typeof fn !== "function") {
throw new TypeError(hint + " must be a function");
}
}
function assertValidReturnValue(kind, value) {
var type = typeof value;
if (kind === 1 /* ACCESSOR */) {
if (type !== "object" || value === null) {
throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
}
if (value.get !== undefined) {
assertCallable(value.get, "accessor.get");
}
if (value.set !== undefined) {
assertCallable(value.set, "accessor.set");
}
if (value.init !== undefined) {
assertCallable(value.init, "accessor.init");
}
} else if (type !== "function") {
var hint;
if (kind === 0 /* FIELD */) {
hint = "field";
} else if (kind === 10 /* CLASS */) {
hint = "class";
} else {
hint = "method";
}
throw new TypeError(hint + " decorators must return a function or void 0");
}
}
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata) {
var decs = decInfo[0];
var desc, init, value;
if (isPrivate) {
if (kind === 0 /* FIELD */ || kind === 1 /* ACCESSOR */) {
desc = { get: decInfo[3], set: decInfo[4] };
} else if (kind === 3 /* GETTER */) {
desc = { get: decInfo[3] };
} else if (kind === 4 /* SETTER */) {
desc = { set: decInfo[3] };
} else {
desc = { value: decInfo[3] };
}
} else if (kind !== 0 /* FIELD */) {
desc = Object.getOwnPropertyDescriptor(base, name);
}
if (kind === 1 /* ACCESSOR */) {
value = { get: desc.get, set: desc.set };
} else if (kind === 2 /* METHOD */) {
value = desc.value;
} else if (kind === 3 /* GETTER */) {
value = desc.get;
} else if (kind === 4 /* SETTER */) {
value = desc.set;
}
var newValue, get, set;
if (typeof decs === "function") {
newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
if (newValue !== void 0) {
assertValidReturnValue(kind, newValue);
if (kind === 0 /* FIELD */) {
init = newValue;
} else if (kind === 1 /* ACCESSOR */) {
init = newValue.init;
get = newValue.get || value.get;
set = newValue.set || value.set;
value = { get: get, set: set };
} else {
value = newValue;
}
}
} else {
for (var i = decs.length - 1; i >= 0; i--) {
var dec = decs[i];
newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
if (newValue !== void 0) {
assertValidReturnValue(kind, newValue);
var newInit;
if (kind === 0 /* FIELD */) {
newInit = newValue;
} else if (kind === 1 /* ACCESSOR */) {
newInit = newValue.init;
get = newValue.get || value.get;
set = newValue.set || value.set;
value = { get: get, set: set };
} else {
value = newValue;
}
if (newInit !== void 0) {
if (init === void 0) {
init = newInit;
} else if (typeof init === "function") {
init = [init, newInit];
} else {
init.push(newInit);
}
}
}
}
}
if (kind === 0 /* FIELD */ || kind === 1 /* ACCESSOR */) {
if (init === void 0) {
// If the initializer was void 0, sub in a dummy initializer
init = function(instance, init) {
return init;
};
} else if (typeof init !== "function") {
var ownInitializers = init;
init = function(instance, init) {
var value = init;
for (var i = 0; i < ownInitializers.length; i++) value = ownInitializers[i].call(instance, value);
return value;
};
} else {
var originalInitializer = init;
init = function(instance, init) {
return originalInitializer.call(instance, init);
};
}
ret.push(init);
}
if (kind !== 0 /* FIELD */) {
if (kind === 1 /* ACCESSOR */) {
desc.get = value.get;
desc.set = value.set;
} else if (kind === 2 /* METHOD */) {
desc.value = value;
} else if (kind === 3 /* GETTER */) {
desc.get = value;
} else if (kind === 4 /* SETTER */) {
desc.set = value;
}
if (isPrivate) {
if (kind === 1 /* ACCESSOR */) {
ret.push(function(instance, args) {
return value.get.call(instance, args);
});
ret.push(function(instance, args) {
return value.set.call(instance, args);
});
} else if (kind === 2 /* METHOD */) {
ret.push(value);
} else {
ret.push(function(instance, args) {
return value.call(instance, args);
});
}
} else {
Object.defineProperty(base, name, desc);
}
}
}
function applyMemberDecs(Class, decInfos, metadata) {
var ret = [];
var protoInitializers;
var staticInitializers;
var existingProtoNonFields = new Map();
var existingStaticNonFields = new Map();
for (var i = 0; i < decInfos.length; i++) {
var decInfo = decInfos[i];
// skip computed property names
if (!Array.isArray(decInfo)) continue;
var kind = decInfo[1];
var name = decInfo[2];
var isPrivate = decInfo.length > 3;
var isStatic = kind >= 5; /* STATIC */
var base;
var initializers;
if (isStatic) {
base = Class;
kind = kind - 5 /* STATIC */;
// initialize staticInitializers when we see a non-field static member
staticInitializers = staticInitializers || [];
initializers = staticInitializers;
} else {
base = Class.prototype;
// initialize protoInitializers when we see a non-field member
protoInitializers = protoInitializers || [];
initializers = protoInitializers;
}
if (kind !== 0 /* FIELD */ && !isPrivate) {
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
var existingKind = existingNonFields.get(name) || 0;
if (existingKind === true || (existingKind === 3 /* GETTER */ && kind !== 4) /* SETTER */ || (existingKind === 4 /* SETTER */ && kind !== 3) /* GETTER */) {
throw new Error(
"Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "
+ name
);
} else if (!existingKind && kind > 2 /* METHOD */) {
existingNonFields.set(name, kind);
} else {
existingNonFields.set(name, true);
}
}
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata);
}
pushInitializers(ret, protoInitializers);
pushInitializers(ret, staticInitializers);
return ret;
}
function pushInitializers(ret, initializers) {
if (initializers) {
ret.push(function(instance) {
for (var i = 0; i < initializers.length; i++) initializers[i].call(instance);
return instance;
});
}
}
function applyClassDecs(targetClass, classDecs, metadata) {
if (classDecs.length > 0) {
var initializers = [];
var newClass = targetClass;
var name = targetClass.name;
for (var i = classDecs.length - 1; i >= 0; i--) {
var decoratorFinishedRef = { v: false };
try {
var nextNewClass = classDecs[i](newClass, { kind: "class", name: name, addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef), metadata });
} finally {
decoratorFinishedRef.v = true;
}
if (nextNewClass !== undefined) {
assertValidReturnValue(10, /* CLASS */ nextNewClass);
newClass = nextNewClass;
}
}
return [defineMetadata(newClass, metadata), function() {
for (var i = 0; i < initializers.length; i++) initializers[i].call(newClass);
}];
}
// The transformer will not emit assignment when there are no class decorators,
// so we don't have to return an empty array here.
}
function defineMetadata(Class, metadata) {
return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: true, enumerable: true, value: metadata });
}
/**
Basic usage:
applyDecs(
Class,
[
// member decorators
[
dec, // dec or array of decs
0, // kind of value being decorated
'prop', // name of public prop on class containing the value being decorated,
'#p', // the name of the private property (if is private, void 0 otherwise),
]
],
[
// class decorators
dec1, dec2
]
)
```
Fully transpiled example:
```js
@dec
class Class {
@dec
a = 123;
@dec
#a = 123;
@dec
@dec2
accessor b = 123;
@dec
accessor #b = 123;
@dec
c() { console.log('c'); }
@dec
#c() { console.log('privC'); }
@dec
get d() { console.log('d'); }
@dec
get #d() { console.log('privD'); }
@dec
set e(v) { console.log('e'); }
@dec
set #e(v) { console.log('privE'); }
}
// becomes
let initializeInstance;
let initializeClass;
let initA;
let initPrivA;
let initB;
let initPrivB, getPrivB, setPrivB;
let privC;
let privD;
let privE;
let Class;
class _Class {
static {
let ret = applyDecs(
this,
[
[dec, 0, 'a'],
[dec, 0, 'a', (i) => i.#a, (i, v) => i.#a = v],
[[dec, dec2], 1, 'b'],
[dec, 1, 'b', (i) => i.#privBData, (i, v) => i.#privBData = v],
[dec, 2, 'c'],
[dec, 2, 'c', () => console.log('privC')],
[dec, 3, 'd'],
[dec, 3, 'd', () => console.log('privD')],
[dec, 4, 'e'],
[dec, 4, 'e', () => console.log('privE')],
],
[
dec
]
)
initA = ret[0];
initPrivA = ret[1];
initB = ret[2];
initPrivB = ret[3];
getPrivB = ret[4];
setPrivB = ret[5];
privC = ret[6];
privD = ret[7];
privE = ret[8];
initializeInstance = ret[9];
Class = ret[10]
initializeClass = ret[11];
}
a = (initializeInstance(this), initA(this, 123));
#a = initPrivA(this, 123);
#bData = initB(this, 123);
get b() { return this.#bData }
set b(v) { this.#bData = v }
#privBData = initPrivB(this, 123);
get #b() { return getPrivB(this); }
set #b(v) { setPrivB(this, v); }
c() { console.log('c'); }
#c(...args) { return privC(this, ...args) }
get d() { console.log('d'); }
get #d() { return privD(this); }
set e(v) { console.log('e'); }
set #e(v) { privE(this, v); }
}
initializeClass(Class);
*/
exports._ = _apply_decs_2203_r = function(targetClass, memberDecs, classDecs, parentClass) {
if (parentClass !== void 0) {
var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
}
var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
var e = applyMemberDecs(targetClass, memberDecs, metadata);
if (!classDecs.length) defineMetadata(targetClass, metadata);
return {
e: e,
// Lazily apply class decorations so that member init locals can be properly bound.
get c() {
return applyClassDecs(targetClass, classDecs, metadata);
}
};
};
return _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentClass);
}
exports._ = _apply_decs_2203_r;
@@ -0,0 +1,32 @@
"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/dimensions.ts
var dimensions_exports = {};
__export(dimensions_exports, {
getMargin: () => getMargin
});
module.exports = __toCommonJS(dimensions_exports);
var getMargin = (num) => {
return `calc(${num * 15.25}pt + 1px * ${num - 1})`;
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
getMargin
});
@@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2013-2014 Jonathan Ong <me@jongleberry.com>
Copyright (c) 2014-2022 Douglas Christopher Wilson <doug@somethingdoug.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@@ -0,0 +1,27 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference no-default-lib="true"/>
/// <reference lib="es2019" />
/// <reference lib="es2020.bigint" />
/// <reference lib="es2020.date" />
/// <reference lib="es2020.number" />
/// <reference lib="es2020.promise" />
/// <reference lib="es2020.sharedmemory" />
/// <reference lib="es2020.string" />
/// <reference lib="es2020.symbol.wellknown" />
/// <reference lib="es2020.intl" />
@@ -0,0 +1,59 @@
{
"name": "iconv-lite",
"description": "Convert character encodings in pure javascript.",
"version": "0.7.0",
"license": "MIT",
"keywords": [
"iconv",
"convert",
"charset",
"icu"
],
"author": "Alexander Shtuchkin <ashtuchkin@gmail.com>",
"main": "./lib/index.js",
"typings": "./lib/index.d.ts",
"homepage": "https://github.com/pillarjs/iconv-lite",
"bugs": "https://github.com/pillarjs/iconv-lite/issues",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/express"
},
"repository": {
"type": "git",
"url": "https://github.com/pillarjs/iconv-lite.git"
},
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"lint": "eslint",
"lint:fix": "eslint --fix",
"test": "mocha --reporter spec --check-leaks --grep .",
"test:ci": "nyc --exclude test --reporter=lcovonly --reporter=text npm test",
"test:cov": "nyc --exclude test --reporter=html --reporter=text npm test",
"test:performance": "node --allow-natives-syntax performance/index.js",
"test:tap": "mocha --reporter tap --check-leaks --grep .",
"test:webpack": "npm pack && mv iconv-lite-*.tgz test/webpack/iconv-lite.tgz && cd test/webpack && npm install && npm run test && rm iconv-lite.tgz"
},
"browser": {
"stream": false
},
"devDependencies": {
"@stylistic/eslint-plugin": "^5.1.0",
"@stylistic/eslint-plugin-js": "^4.1.0",
"async": "^3.2.0",
"bench-node": "^0.10.0",
"eslint": "^9.0.0",
"errto": "^0.2.1",
"iconv": "^2.3.5",
"mocha": "^6.2.2",
"neostandard": "^0.12.0",
"nyc": "^14.1.1",
"request": "^2.88.2",
"semver": "^6.3.0",
"unorm": "^1.6.0"
},
"dependencies": {
"safer-buffer": ">= 2.1.2 < 3.0.0"
}
}
@@ -0,0 +1,15 @@
import { a } from './chunk-FUBUDMV2.js';
import w from 'tailwindcss/resolveConfig';
var p={tv:/tv\s*\(((\([^\)]*?\)|\[[^\]]*?\]|.)*?)\)/gs,tvExtend:/extend:\s*\w+(,| )\s*/,comment:/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm,blankLine:/^\s*$(?:\r\n?|\n)/gm,extension:/\.\w+/g},l=n=>Array.isArray(n),E=n=>typeof n=="string",d=n=>typeof n=="object",T=n=>typeof n=="boolean",g=n=>typeof n=="function",f=n=>!!(!n||l(n)&&n.length===0||E(n)&&n.length===0||d(n)&&Object.keys(n).length===0),j=(n,r)=>{let t={},e=r.length,s=Object.prototype.hasOwnProperty;for(let a=0;a<e;a++){let o=r[a];s.call(n,o)&&(t[o]=n[o]);}return t},V=(n,r)=>{let t="https://github.com/heroui-inc/tailwind-variants/issues/new/choose";console.log("\x1B[31m%s\x1B[0m",`${n}: ${r.message}`),console.log(`If you think this is an issue, please submit it at ${t}`);},y=(...n)=>r=>n.reduce((t,e)=>e(t),r),S=n=>{let t=n.replace(p.comment,"$1").toString().replace(p.blankLine,"").toString(),e=s=>s[1].replace(p.tvExtend,"").toString();return Array.from(t.matchAll(p.tv),e)},$=n=>{let r=S(n);if(!f(r))return r.map(t=>t.includes("responsiveVariants")?new Function(`
const [options, config] = [${t.toString()}];
return {options, config};
`)():{})},b=n=>n.flatMap(r=>r).toString().replaceAll(","," ").split(" "),k=(n,r)=>{let t={};for(let[e,s]of Object.entries(n))t[e]={},t[e].original=s,!f(s)&&(t.temp=l(s)?b(s):s.split(" "),r.forEach(a=>{let o="";t.temp.forEach(i=>{o+=`${a}:${i} `;}),t[e][a]=o.trimEnd();}),delete t.temp);return t},A=(n,r)=>E(n)?n.split(" "):l(n)?b(n):d(n)?k(n,r):n,x=(n,r)=>{let t={};for(let[e,s]of Object.entries(n))if(t[e]={},!f(s))for(let[a,o]of Object.entries(s)){if(t[e][a]={},t[e][a].original=o,f(o))continue;let i=A(o,r);if(!f(i)){if(!l(i)){t[e][a]=i;continue}r.forEach(c=>{let m="";i.forEach(u=>{m+=`${c}:${u} `;}),t[e][a][c]=m.trimEnd();});}}return t},C=({options:n,config:r},t)=>{var a,o;let e=(a=n==null?void 0:n.variants)!=null?a:{},s=(o=r==null?void 0:r.responsiveVariants)!=null?o:!1;if(!(!s||f(e))){if(T(s))return x(e,t);if(l(s))return x(e,s);if(d(s)){let i=[];for(let[c,m]of Object.entries(s)){if(!m||f(m))continue;let O={options:{variants:j(e,[c])},config:{responsiveVariants:m}};i.push(C(O,t));}return i}}},P=(n,r,t)=>{try{let e=["tailwind-variants"];if(!(l(t==null?void 0:t.aliases)?[...t.aliases,...e]:e).some(u=>n.includes(u)))return n;let o=$(n);if(f(o))return n;let i=JSON.stringify(o.map(u=>C(u,r)),void 0,2),c=`
/* Tailwind Variants Transformed Content Start
`,m=`
Tailwind Variants Transformed Content End */
`;return n.concat(c+i+m)}catch(e){return V("Tailwind Variants Transform Failed",e),n}},h=n=>{let r=n.map(t=>{if(d(t)&&t.extension)return t.extension;let e=t.match(p.extension);return e||(e=t.split("{"),e=e.pop().replace("}","").split(",")),e.map(s=>s.replace(".","").split(".")).flat()}).flatMap(t=>t);return Array.from(new Set(r)).filter(t=>t!=="html")},D=(n,r)=>{var a$1;let t=w(n);if(a(t.theme),f((a$1=t.content)==null?void 0:a$1.files)||!l(t.content.files))return t;let e=o=>{var i,c;return P(o,Object.keys((c=(i=t.theme)==null?void 0:i.screens)!=null?c:{}),r)},s=t.content.transform;if(f(s)){let i=h(t.content.files).map(c=>[c,e]);return t.content.transform=Object.fromEntries(i),t}if(g(s)){let i=h(t.content.files).map(c=>[c,y(e,s)]);return t.content.transform=Object.fromEntries(i),t}if(d(s)){let i=h(t.content.files).map(c=>g(s[c])?[c,y(e,s[c])]:[c,e]);return t.content.transform=Object.fromEntries(i),t}return t};
export { P as tvTransformer, D as withTV };
@@ -0,0 +1,626 @@
export default `flf2a$ 6 5 8 -1 12
Based on a lowercase font posted by robert@cs.caltech.edu
Figletized by Wendell Hicken 11/93 (whicken@parasoft.com)
Explanation of first line:
flf2 - "magic number" for file identification
a - should always be \`a', for now
$ - the "hardblank" -- prints as a blank, but can't be smushed
6 - height of a character
5 - height of a character, not including descenders
8 - max line length (excluding comment lines) + a fudge factor
-1 - default smushmode for this font (like "-m 15" on command line)
12 - number of comment lines
@
@
@
@
@
@@
@
|@
|@
@
o@
@@
@
| |@
\` \`@
@
@
@@
@
. . @
-+-+-@
-+-+-@
\` \` @
@@
, @
,-|-.@
\`-|-.@
| |@
\`-|-'@
\` @@
@
o /@
/ @
/ @
/ o@
@@
@
@
,-. @
|_|_@
| @
@@
@
|@
' @
@
@
@@
@
/@
| @
| @
| @
\\@@
@
\\ @
|@
|@
|@
/ @@
@
@
.|.@
-*-@
'|\`@
@@
@
@
| @
-+- @
| @
@@
@
@
@
@
| @
' @@
@
@
@
---@
@
@@
@
@
@
@
o@
@@
@
/@
/ @
/ @
/ @
@@
@
,--.@
| |@
| |@
\`--'@
@@
@
'|@
|@
|@
\`@
@@
@
,--.@
,--'@
| @
\`--'@
@@
@
,--.@
-|@
|@
\`--'@
@@
@
| |@
\`--|@
|@
\`@
@@
@
---.@
\`--.@
|@
\`--'@
@@
@
,--.@
|--.@
| |@
\`--'@
@@
@
---.@
/@
| @
| @
@@
@
,--.@
,--.@
| |@
\`--'@
@@
@
,--.@
\`__|@
|@
'@
@@
@
@
o@
@
o@
@@
@
@
o@
@
|@
' @@
@
/@
/ @
\\ @
\\@
@@
@
@
---@
---@
@
@@
@
\\ @
\\@
/@
/ @
@@
@
,---.@
,-'@
| @
o @
@@
@
,---.@
| o_/@
| @
\`---'@
@@
@
,---.@
|---|@
| |@
\` '@
@@
@
,---.@
|---.@
| |@
\`---'@
@@
@
,---.@
| @
| @
\`---'@
@@
@
,--. @
| |@
| |@
\`--' @
@@
@
,---.@
|--- @
| @
\`---'@
@@
@
,---.@
|__. @
| @
\` @
@@
@
,---.@
| _.@
| |@
\`---'@
@@
@
| |@
|---|@
| |@
\` '@
@@
@
|@
|@
|@
\`@
@@
@
|@
|@
|@
\`---'@
@@
@
| /@
|__/ @
| \\ @
\` \`@
@@
@
| @
| @
| @
\`---'@
@@
@
,-.-.@
| | |@
| | |@
\` ' '@
@@
@
, .@
|\\ |@
| \\ |@
\` \`'@
@@
@
,---.@
| |@
| |@
\`---'@
@@
@
,---.@
|---'@
| @
\` @
@@
@
,---.@
| |@
| |@
\`---\\@
@@
@
,---.@
|---'@
| \\ @
\` \`@
@@
@
,---.@
\`---.@
|@
\`---'@
@@
@
--.--@
| @
| @
\` @
@@
@
. .@
| |@
| |@
\`---'@
@@
@
. ,@
| |@
\\ / @
\`' @
@@
@
. . .@
| | |@
| | |@
\`-'-'@
@@
@
. ,@
>< @
| |@
' \`@
@@
@
, .@
| |@
\`---'@
| @
\` @@
@
,---,@
.-' @
| @
\`---'@
@@
@
,-@
| @
: @
| @
\`-@@
@
\\ @
\\ @
\\ @
\\@
@@
@
-.@
|@
:@
|@
-'@@
@
. @
/ \\@
@
@
@@
@
@
@
@
@
---@@
@
| @
\`@
@
@
@@
@
@
,---.@
,---|@
\`---^@
@@
@
| @
|---.@
| |@
\`---'@
@@
@
@
,---.@
| @
\`---'@
@@
@
|@
,---|@
| |@
\`---'@
@@
@
@
,---.@
|---'@
\`---'@
@@
@
,---.@
|__. @
| @
\` @
@@
@
@
,---.@
| |@
\`---|@
\`---'@@
@
| @
|---.@
| |@
\` '@
@@
@
o@
.@
|@
\`@
@@
@
o@
.@
|@
|@
\`---'@@
@
| @
|__/ @
| \\ @
\` \`@
@@
@
| @
| @
| @
\`---'@
@@
@
@
,-.-.@
| | |@
\` ' '@
@@
@
@
,---.@
| |@
\` '@
@@
@
@
,---.@
| |@
\`---'@
@@
@
@
,---.@
| |@
|---'@
| @@
@
@
,---.@
| |@
\`---|@
|@@
@
@
,---.@
| @
\` @
@@
@
@
,---.@
\`---.@
\`---'@
@@
@
| @
|--- @
| @
\`---'@
@@
@
@
. .@
| |@
\`---'@
@@
@
@
. ,@
\\ / @
\`' @
@@
@
@
. . .@
| | |@
\`-'-'@
@@
@
@
. ,@
>< @
' \`@
@@
@
@
, .@
| |@
\`---|@
\`---'@@
@
@
,---,@
.-' @
'---'@
@@
@
,-@
| @
-: @
| @
\`-@@
@
|@
|@
|@
|@
@@
@
-. @
| @
:-@
| @
-' @@
@
_ @
/ \\_/@
@
@
@@
o o @
,---.@
|---|@
| |@
\` '@
@@
o o @
,---.@
| |@
| |@
\`---'@
@@
o o @
. .@
| |@
| |@
\`---'@
@@
@
o o @
,---.@
,---|@
\`---^@
@@
@
o o @
,---.@
| |@
\`---'@
@@
@
o o @
. .@
| |@
\`---'@
@@
@
,---.@
|---.@
| |@
|---'@
| @@
`
@@ -0,0 +1,12 @@
type Dimensions = {
width: number | null;
height: number | null;
};
/**
* A custom hook that measures the dimensions of a DOM element.
* @returns A tuple containing a ref callback and the dimensions of the measured element.
*/
declare function useMeasure(): [React.RefCallback<Element>, Dimensions];
type UseMeasureReturn = ReturnType<typeof useMeasure>;
export { Dimensions, UseMeasureReturn, useMeasure };
@@ -0,0 +1,15 @@
"use strict";
function _defaults(obj, defaults) {
var keys = Object.getOwnPropertyNames(defaults);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
var value = Object.getOwnPropertyDescriptor(defaults, key);
if (value && value.configurable && obj[key] === undefined) Object.defineProperty(obj, key, value);
}
return obj;
}
exports._ = _defaults;
@@ -0,0 +1,6 @@
function isNil(value) {
return value == null;
}
export {
isNil
};
@@ -0,0 +1,102 @@
'use strict';
var utils = require('../utils.js');
require('eslint-visitor-keys');
require('espree');
require('estraverse');
function hasBlockBody(node) {
return node.body.type === "BlockStatement";
}
var arrowParens = utils.createRule({
name: "arrow-parens",
package: "js",
meta: {
type: "layout",
docs: {
description: "Require parentheses around arrow function arguments"
},
fixable: "code",
schema: [
{
type: "string",
enum: ["always", "as-needed"]
},
{
type: "object",
properties: {
requireForBlockBody: {
type: "boolean",
default: false
}
},
additionalProperties: false
}
],
messages: {
unexpectedParens: "Unexpected parentheses around single function argument.",
expectedParens: "Expected parentheses around arrow function argument.",
unexpectedParensInline: "Unexpected parentheses around single function argument having a body with no curly braces.",
expectedParensBlock: "Expected parentheses around arrow function argument having a body with curly braces."
}
},
create(context) {
const asNeeded = context.options[0] === "as-needed";
const requireForBlockBody = asNeeded && context.options[1] && context.options[1].requireForBlockBody === true;
const sourceCode = context.sourceCode;
function findOpeningParenOfParams(node) {
const tokenBeforeParams = sourceCode.getTokenBefore(node.params[0]);
if (tokenBeforeParams && utils.isOpeningParenToken(tokenBeforeParams) && node.range[0] <= tokenBeforeParams.range[0]) {
return tokenBeforeParams;
}
return null;
}
function getClosingParenOfParams(node) {
return sourceCode.getTokenAfter(node.params[0], utils.isClosingParenToken);
}
function hasCommentsInParensOfParams(node, openingParen) {
return sourceCode.commentsExistBetween(openingParen, getClosingParenOfParams(node));
}
function hasUnexpectedTokensBeforeOpeningParen(node, openingParen) {
const expectedCount = node.async ? 1 : 0;
return sourceCode.getFirstToken(node, { skip: expectedCount }) !== openingParen;
}
return {
"ArrowFunctionExpression[params.length=1]": function(node) {
const shouldHaveParens = !asNeeded || requireForBlockBody && hasBlockBody(node);
const openingParen = findOpeningParenOfParams(node);
const hasParens = openingParen !== null;
const [param] = node.params;
if (shouldHaveParens && !hasParens) {
context.report({
node,
messageId: requireForBlockBody ? "expectedParensBlock" : "expectedParens",
loc: param.loc,
*fix(fixer) {
yield fixer.insertTextBefore(param, "(");
yield fixer.insertTextAfter(param, ")");
}
});
}
if (!shouldHaveParens && hasParens && param.type === "Identifier" && !param.optional && !param.typeAnnotation && !node.returnType && !hasCommentsInParensOfParams(node, openingParen) && !hasUnexpectedTokensBeforeOpeningParen(node, openingParen)) {
context.report({
node,
messageId: requireForBlockBody ? "unexpectedParensInline" : "unexpectedParens",
loc: param.loc,
*fix(fixer) {
const tokenBeforeOpeningParen = sourceCode.getTokenBefore(openingParen);
const closingParen = getClosingParenOfParams(node);
if (tokenBeforeOpeningParen && tokenBeforeOpeningParen.range[1] === openingParen.range[0] && !utils.canTokensBeAdjacent(tokenBeforeOpeningParen, sourceCode.getFirstToken(param))) {
yield fixer.insertTextBefore(openingParen, " ");
}
yield fixer.removeRange([openingParen.range[0], param.range[0]]);
yield fixer.removeRange([param.range[1], closingParen.range[1]]);
}
});
}
}
};
}
});
module.exports = arrowParens;
@@ -0,0 +1,38 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const matcher_1 = require("./matcher");
class PartialMatcher extends matcher_1.default {
match(filepath) {
const parts = filepath.split('/');
const levels = parts.length;
const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels);
for (const pattern of patterns) {
const section = pattern.sections[0];
/**
* In this case, the pattern has a globstar and we must read all directories unconditionally,
* but only if the level has reached the end of the first group.
*
* fixtures/{a,b}/**
* ^ true/false ^ always true
*/
if (!pattern.complete && levels > section.length) {
return true;
}
const match = parts.every((part, index) => {
const segment = pattern.segments[index];
if (segment.dynamic && segment.patternRe.test(part)) {
return true;
}
if (!segment.dynamic && segment.pattern === part) {
return true;
}
return false;
});
if (match) {
return true;
}
}
return false;
}
}
exports.default = PartialMatcher;
@@ -0,0 +1,36 @@
function getValueState(visualElement) {
const state = [{}, {}];
visualElement?.values.forEach((value, key) => {
state[0][key] = value.get();
state[1][key] = value.getVelocity();
});
return state;
}
function resolveVariantFromProps(props, definition, custom, visualElement) {
/**
* If the variant definition is a function, resolve.
*/
if (typeof definition === "function") {
const [current, velocity] = getValueState(visualElement);
definition = definition(custom !== undefined ? custom : props.custom, current, velocity);
}
/**
* If the variant definition is a variant label, or
* the function returned a variant label, resolve.
*/
if (typeof definition === "string") {
definition = props.variants && props.variants[definition];
}
/**
* At this point we've resolved both functions and variant labels,
* but the resolved variant label might itself have been a function.
* If so, resolve. This can only have returned a valid target object.
*/
if (typeof definition === "function") {
const [current, velocity] = getValueState(visualElement);
definition = definition(custom !== undefined ? custom : props.custom, current, velocity);
}
return definition;
}
export { resolveVariantFromProps };
@@ -0,0 +1 @@
{"version":3,"file":"scrollRectIntoView.js","names":["getParentElement","element","parentElement","getRootNode","host","getElementRect","rect","getBoundingClientRect","scaleX","Math","abs","width","offsetWidth","scaleY","height","offsetHeight","top","right","left","clientWidth","bottom","clientHeight","paddingValueToInt","value","number","parseInt","Number","isNaN","getScrollDistance","targetStart","targetEnd","scrollStart","scrollEnd","scrollPaddingStart","scrollPaddingEnd","scrollRectIntoView","root","targetRect","document","ownerDocument","current","isDocumentBody","body","bounding","window","visualViewport","documentElement","style","getComputedStyle","scrollDistanceX","scrollPaddingLeft","scrollPaddingRight","scrollDistanceY","scrollPaddingTop","scrollPaddingBottom","defaultView","scrollBy","scrollLeft","scrollTop","scrolledLeft","scrolledTop","position"],"sources":["../../../src/core/utils/scrollRectIntoView.ts"],"sourcesContent":["export type Rect = {\n top: number;\n right: number;\n bottom: number;\n left: number;\n};\n\nconst getParentElement = (element: Node): Element | null =>\n element.parentElement || (element.getRootNode() as ShadowRoot).host || null;\n\nconst getElementRect = (element: Element): Rect => {\n const rect = element.getBoundingClientRect();\n const scaleX =\n ('offsetWidth' in element &&\n Math.abs(rect.width) / (element as HTMLElement).offsetWidth) ||\n 1;\n const scaleY =\n ('offsetHeight' in element &&\n Math.abs(rect.height) / (element as HTMLElement).offsetHeight) ||\n 1;\n return {\n top: rect.top,\n right: rect.left + element.clientWidth * scaleX,\n bottom: rect.top + element.clientHeight * scaleY,\n left: rect.left,\n };\n};\n\nconst paddingValueToInt = (value: string) => {\n const number = parseInt(value, 10);\n return Number.isNaN(number) ? 0 : number;\n};\n\n// Follow the steps described in https://www.w3.org/TR/cssom-view-1/#element-scrolling-members,\n// assuming that the scroll option is set to 'nearest'.\nconst getScrollDistance = (\n targetStart: number,\n targetEnd: number,\n scrollStart: number,\n scrollEnd: number,\n scrollPaddingStart: number,\n scrollPaddingEnd: number,\n) => {\n if (targetStart < scrollStart && targetEnd > scrollEnd) {\n return 0;\n }\n\n if (targetStart < scrollStart) {\n return -(scrollStart - targetStart + scrollPaddingStart);\n }\n\n if (targetEnd > scrollEnd) {\n return targetEnd - targetStart > scrollEnd - scrollStart\n ? targetStart + scrollPaddingStart - scrollStart\n : targetEnd - scrollEnd + scrollPaddingEnd;\n }\n return 0;\n};\n\nconst scrollRectIntoView = (root: HTMLElement, targetRect: Rect) => {\n const document = root.ownerDocument;\n\n let rect = targetRect;\n\n let current: Element | null = root;\n while (current) {\n const isDocumentBody: boolean = current === document.body;\n const bounding = isDocumentBody\n ? {\n top: 0,\n right:\n window.visualViewport?.width ??\n document.documentElement.clientWidth,\n bottom:\n window.visualViewport?.height ??\n document.documentElement.clientHeight,\n left: 0,\n }\n : getElementRect(current);\n\n const style = getComputedStyle(current);\n const scrollDistanceX = getScrollDistance(\n rect.left,\n rect.right,\n bounding.left,\n bounding.right,\n paddingValueToInt(style.scrollPaddingLeft),\n paddingValueToInt(style.scrollPaddingRight),\n );\n const scrollDistanceY = getScrollDistance(\n rect.top,\n rect.bottom,\n bounding.top,\n bounding.bottom,\n paddingValueToInt(style.scrollPaddingTop),\n paddingValueToInt(style.scrollPaddingBottom),\n );\n if (scrollDistanceX || scrollDistanceY) {\n if (isDocumentBody) {\n document.defaultView?.scrollBy(scrollDistanceX, scrollDistanceY);\n } else {\n const { scrollLeft, scrollTop } = current;\n if (scrollDistanceY) {\n current.scrollTop += scrollDistanceY;\n }\n if (scrollDistanceX) {\n current.scrollLeft += scrollDistanceX;\n }\n const scrolledLeft = current.scrollLeft - scrollLeft;\n const scrolledTop = current.scrollTop - scrollTop;\n rect = {\n left: rect.left - scrolledLeft,\n top: rect.top - scrolledTop,\n right: rect.right - scrolledLeft,\n bottom: rect.bottom - scrolledTop,\n };\n }\n }\n\n current =\n isDocumentBody || style.position === 'fixed'\n ? null\n : getParentElement(current);\n }\n};\n\nexport default scrollRectIntoView;\n"],"mappings":"AAOA,MAAMA,gBAAgB,GAAIC,OAAa,IACrCA,OAAO,CAACC,aAAa,IAAKD,OAAO,CAACE,WAAW,CAAC,CAAC,CAAgBC,IAAI,IAAI,IAAI;AAE7E,MAAMC,cAAc,GAAIJ,OAAgB,IAAW;EACjD,MAAMK,IAAI,GAAGL,OAAO,CAACM,qBAAqB,CAAC,CAAC;EAC5C,MAAMC,MAAM,GACT,aAAa,IAAIP,OAAO,IACvBQ,IAAI,CAACC,GAAG,CAACJ,IAAI,CAACK,KAAK,CAACLine truncated
@@ -0,0 +1,7 @@
var je=Object.defineProperty;var o=(e,t)=>je(e,"name",{value:t,configurable:!0});import m from"node:path";import ie from"node:fs";import Fe from"node:module";import{resolveExports as De}from"resolve-pkg-maps";import Ee from"fs";import he from"os";import Ie from"path";function h(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}o(h,"slash");const G=o(e=>{const t=ie[e];return(s,...n)=>{const l=`${e}:${n.join(":")}`;let i=s==null?void 0:s.get(l);return i===void 0&&(i=Reflect.apply(t,ie,n),s==null||s.set(l,i)),i}},"cacheFs"),I=G("existsSync"),Be=G("readFileSync"),R=G("statSync"),oe=o((e,t,s)=>{for(;;){const n=m.posix.join(e,t);if(I(s,n))return n;const l=m.dirname(e);if(l===e)return;e=l}},"findUp"),Q=/^\.{1,2}(\/.*)?$/,H=o(e=>{const t=h(e);return Q.test(t)?t:`./${t}`},"normalizeRelativePath");function Le(e,t=!1){const s=e.length;let n=0,l="",i=0,r=16,f=0,u=0,g=0,w=0,b=0;function y(c,_){let D=0,T=0;for(;D<c;){let p=e.charCodeAt(n);if(p>=48&&p<=57)T=T*16+p-48;else if(p>=65&&p<=70)T=T*16+p-65+10;else if(p>=97&&p<=102)T=T*16+p-97+10;else break;n++,D++}return D<c&&(T=-1),T}o(y,"scanHexDigits");function v(c){n=c,l="",i=0,r=16,b=0}o(v,"setPosition");function j(){let c=n;if(e.charCodeAt(n)===48)n++;else for(n++;n<e.length&&$(e.charCodeAt(n));)n++;if(n<e.length&&e.charCodeAt(n)===46)if(n++,n<e.length&&$(e.charCodeAt(n)))for(n++;n<e.length&&$(e.charCodeAt(n));)n++;else return b=3,e.substring(c,n);let _=n;if(n<e.length&&(e.charCodeAt(n)===69||e.charCodeAt(n)===101))if(n++,(n<e.length&&e.charCodeAt(n)===43||e.charCodeAt(n)===45)&&n++,n<e.length&&$(e.charCodeAt(n))){for(n++;n<e.length&&$(e.charCodeAt(n));)n++;_=n}else b=3;return e.substring(c,_)}o(j,"scanNumber");function d(){let c="",_=n;for(;;){if(n>=s){c+=e.substring(_,n),b=2;break}const D=e.charCodeAt(n);if(D===34){c+=e.substring(_,n),n++;break}if(D===92){if(c+=e.substring(_,n),n++,n>=s){b=2;break}switch(e.charCodeAt(n++)){case 34:c+='"';break;case 92:c+="\\";break;case 47:c+="/";break;case 98:c+="\b";break;case 102:c+="\f";break;case 110:c+=`
`;break;case 114:c+="\r";break;case 116:c+=" ";break;case 117:const p=y(4);p>=0?c+=String.fromCharCode(p):b=4;break;default:b=5}_=n;continue}if(D>=0&&D<=31)if(S(D)){c+=e.substring(_,n),b=2;break}else b=6;n++}return c}o(d,"scanString");function A(){if(l="",b=0,i=n,u=f,w=g,n>=s)return i=s,r=17;let c=e.charCodeAt(n);if(X(c)){do n++,l+=String.fromCharCode(c),c=e.charCodeAt(n);while(X(c));return r=15}if(S(c))return n++,l+=String.fromCharCode(c),c===13&&e.charCodeAt(n)===10&&(n++,l+=`
`),f++,g=n,r=14;switch(c){case 123:return n++,r=1;case 125:return n++,r=2;case 91:return n++,r=3;case 93:return n++,r=4;case 58:return n++,r=6;case 44:return n++,r=5;case 34:return n++,l=d(),r=10;case 47:const _=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n<s&&!S(e.charCodeAt(n));)n++;return l=e.substring(_,n),r=12}if(e.charCodeAt(n+1)===42){n+=2;const D=s-1;let T=!1;for(;n<D;){const p=e.charCodeAt(n);if(p===42&&e.charCodeAt(n+1)===47){n+=2,T=!0;break}n++,S(p)&&(p===13&&e.charCodeAt(n)===10&&n++,f++,g=n)}return T||(n++,b=1),l=e.substring(_,n),r=13}return l+=String.fromCharCode(c),n++,r=16;case 45:if(l+=String.fromCharCode(c),n++,n===s||!$(e.charCodeAt(n)))return r=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return l+=j(),r=11;default:for(;n<s&&E(c);)n++,c=e.charCodeAt(n);if(i!==n){switch(l=e.substring(i,n),l){case"true":return r=8;case"false":return r=9;case"null":return r=7}return r=16}return l+=String.fromCharCode(c),n++,r=16}}o(A,"scanNext");function E(c){if(X(c)||S(c))return!1;switch(c){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}o(E,"isUnknownContentCharacter");function B(){let c;do c=A();while(c>=12&&c<=15);return c}return o(B,"scanNextNonTrivia"),{setPosition:v,getPosition:o(()=>n,"getPosition"),scan:t?B:A,getToken:o(()=>r,"getToken"),getTokenValue:o(()=>l,"getTokenValue"),getTokenOffset:o(()=>i,"getTokenOffset"),getTokenLength:o(()=>n-i,"getTokenLength"),getTokenStartLine:o(()=>u,"getTokenStartLine"),getTokenStartCharacter:o(()=>i-w,"getTokenStartCharacter"),getTokenError:o(()=>b,"getTokenError")}}o(Le,"createScanner");function X(e){return e===32||e===9}o(X,"isWhiteSpace");function S(e){return e===10||e===13}o(S,"isLineBreak");function $(e){return e>=48&&e<=57}o($,"isDigit");var re;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(re||(re={})),new Array(20).fill(0).map((e,t)=>" ".repeat(t));const x=200;new Array(x).fill(0).map((e,t)=>`
`+" ".repeat(t)),new Array(x).fill(0).map((e,t)=>"\r"+" ".repeat(t)),new Array(x).fill(0).map((e,t)=>`\r
`+" ".repeat(t)),new Array(x).fill(0).map((e,t)=>`
`+" ".repeat(t)),new Array(x).fill(0).map((e,t)=>"\r"+" ".repeat(t)),new Array(x).fill(0).map((e,t)=>`\r
`+" ".repeat(t));var W;(function(e){e.DEFAULT={allowTrailingComma:!1}})(W||(W={}));function $e(e,t=[],s=W.DEFAULT){let n=null,l=[];const i=[];function r(u){Array.isArray(l)?l.push(u):n!==null&&(l[n]=u)}return o(r,"onValue"),xe(e,{onObjectBegin:o(()=>{const u={};r(u),i.push(l),l=u,n=null},"onObjectBegin"),onObjectProperty:o(u=>{n=u},"onObjectProperty"),onObjectEnd:o(()=>{l=i.pop()},"onObjectEnd"),onArrayBegin:o(()=>{const u=[];r(u),i.push(l),l=u,n=null},"onArrayBegin"),onArrayEnd:o(()=>{l=i.pop()},"onArrayEnd"),onLiteralValue:r,onError:o((u,g,w)=>{t.push({error:u,offset:g,length:w})},"onError")},s),l[0]}o($e,"parse$1");function xe(e,t,s=W.DEFAULT){const n=Le(e,!1),l=[];let i=0;function r(k){return k?()=>i===0&&k(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}o(r,"toNoArgVisit");function f(k){return k?F=>i===0&&k(F,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}o(f,"toOneArgVisit");function u(k){return k?F=>i===0&&k(F,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>l.slice()):()=>!0}o(u,"toOneArgVisitWithPath");function g(k){return k?()=>{i>0?i++:k(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>l.slice())===!1&&(i=1)}:()=>!0}o(g,"toBeginVisit");function w(k){return k?()=>{i>0&&i--,i===0&&k(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:()=>!0}o(w,"toEndVisit");const b=g(t.onObjectBegin),y=u(t.onObjectProperty),v=w(t.onObjectEnd),j=g(t.onArrayBegin),d=w(t.onArrayEnd),A=u(t.onLiteralValue),E=f(t.onSeparator),B=r(t.onComment),c=f(t.onError),_=s&&s.disallowComments,D=s&&s.allowTrailingComma;function T(){for(;;){const k=n.scan();switch(n.getTokenError()){case 4:p(14);break;case 5:p(15);break;case 3:p(13);break;case 1:_||p(11);break;case 2:p(12);break;case 6:p(16);break}switch(k){case 12:case 13:_?p(10):B();break;case 16:p(1);break;case 15:case 14:break;default:return k}}}o(T,"scanNext");function p(k,F=[],le=[]){if(c(k),F.length+le.length>0){let P=n.getToken();for(;P!==17;){if(F.indexOf(P)!==-1){T();break}else if(le.indexOf(P)!==-1)break;P=T()}}}o(p,"handleError");function U(k){const F=n.getTokenValue();return k?A(F):(y(F),l.push(F)),T(),!0}o(U,"parseString");function a(){switch(n.getToken()){case 11:const k=n.getTokenValue();let F=Number(k);isNaN(F)&&(p(2),F=0),A(F);break;case 7:A(null);break;case 8:A(!0);break;case 9:A(!1);break;default:return!1}return T(),!0}o(a,"parseLiteral");function N(){return n.getToken()!==10?(p(3,[],[2,5]),!1):(U(!1),n.getToken()===6?(E(":"),T(),z()||p(4,[],[2,5])):p(5,[],[2,5]),l.pop(),!0)}o(N,"parseProperty");function _e(){b(),T();let k=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(k||p(4,[],[]),E(","),T(),n.getToken()===2&&D)break}else k&&p(6,[],[]);N()||p(4,[],[2,5]),k=!0}return v(),n.getToken()!==2?p(7,[2],[]):T(),!0}o(_e,"parseObject");function ye(){j(),T();let k=!0,F=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(F||p(4,[],[]),E(","),T(),n.getToken()===4&&D)break}else F&&p(6,[],[]);k?(l.push(0),k=!1):l[l.length-1]++,z()||p(4,[],[4,5]),F=!0}return d(),k||l.pop(),n.getToken()!==4?p(8,[4],[]):T(),!0}o(ye,"parseArray");function z(){switch(n.getToken()){case 3:return ye();case 1:return _e();case 10:return U(!0);default:return a()}}return o(z,"parseValue"),T(),n.getToken()===17?s.allowEmptyContent?!0:(p(4,[],[]),!1):z()?(n.getToken()!==17&&p(9,[],[]),!0):(p(4,[],[]),!1)}o(xe,"visit");var ue;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(ue||(ue={}));var fe;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(fe||(fe={}));const Ue=$e;var ce;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommeLine truncated
@@ -0,0 +1,233 @@
// @ts-ignore TS6133
import { expect, test } from "vitest";
import * as z from "zod/v3";
import { util } from "../helpers/util.js";
const stringToNumber = z.string().transform((arg) => Number.parseFloat(arg));
// const numberToString = z
// .transformer(z.number())
// .transform((n) => String(n));
const asyncNumberToString = z.number().transform(async (n) => String(n));
test("transform ctx.addIssue with parse", () => {
const strs = ["foo", "bar"];
expect(() => {
z.string()
.transform((data, ctx) => {
const i = strs.indexOf(data);
if (i === -1) {
ctx.addIssue({
code: "custom",
message: `${data} is not one of our allowed strings`,
});
}
return data.length;
})
.parse("asdf");
}).toThrow(
JSON.stringify(
[
{
code: "custom",
message: "asdf is not one of our allowed strings",
path: [],
},
],
null,
2
)
);
});
test("transform ctx.addIssue with parseAsync", async () => {
const strs = ["foo", "bar"];
const result = await z
.string()
.transform(async (data, ctx) => {
const i = strs.indexOf(data);
if (i === -1) {
ctx.addIssue({
code: "custom",
message: `${data} is not one of our allowed strings`,
});
}
return data.length;
})
.safeParseAsync("asdf");
expect(JSON.parse(JSON.stringify(result))).toEqual({
success: false,
error: {
issues: [
{
code: "custom",
message: "asdf is not one of our allowed strings",
path: [],
},
],
name: "ZodError",
},
});
});
test("z.NEVER in transform", () => {
const foo = z
.number()
.optional()
.transform((val, ctx) => {
if (!val) {
ctx.addIssue({ code: z.ZodIssueCode.custom, message: "bad" });
return z.NEVER;
}
return val;
});
type foo = z.infer<typeof foo>;
util.assertEqual<foo, number>(true);
const arg = foo.safeParse(undefined);
if (!arg.success) {
expect(arg.error.issues[0].message).toEqual("bad");
}
});
test("basic transformations", () => {
const r1 = z
.string()
.transform((data) => data.length)
.parse("asdf");
expect(r1).toEqual(4);
});
test("coercion", () => {
const numToString = z.number().transform((n) => String(n));
const data = z
.object({
id: numToString,
})
.parse({ id: 5 });
expect(data).toEqual({ id: "5" });
});
test("async coercion", async () => {
const numToString = z.number().transform(async (n) => String(n));
const data = await z
.object({
id: numToString,
})
.parseAsync({ id: 5 });
expect(data).toEqual({ id: "5" });
});
test("sync coercion async error", async () => {
expect(() =>
z
.object({
id: asyncNumberToString,
})
.parse({ id: 5 })
).toThrow();
// expect(data).toEqual({ id: '5' });
});
test("default", () => {
const data = z.string().default("asdf").parse(undefined); // => "asdf"
expect(data).toEqual("asdf");
});
test("dynamic default", () => {
const data = z
.string()
.default(() => "string")
.parse(undefined); // => "asdf"
expect(data).toEqual("string");
});
test("default when property is null or undefined", () => {
const data = z
.object({
foo: z.boolean().nullable().default(true),
bar: z.boolean().default(true),
})
.parse({ foo: null });
expect(data).toEqual({ foo: null, bar: true });
});
test("default with falsy values", () => {
const schema = z.object({
emptyStr: z.string().default("def"),
zero: z.number().default(5),
falseBoolean: z.boolean().default(true),
});
const input = { emptyStr: "", zero: 0, falseBoolean: true };
const output = schema.parse(input);
// defaults are not supposed to be used
expect(output).toEqual(input);
});
test("object typing", () => {
const t1 = z.object({
stringToNumber,
});
type t1 = z.input<typeof t1>;
type t2 = z.output<typeof t1>;
util.assertEqual<t1, { stringToNumber: string }>(true);
util.assertEqual<t2, { stringToNumber: number }>(true);
});
test("transform method overloads", () => {
const t1 = z.string().transform((val) => val.toUpperCase());
expect(t1.parse("asdf")).toEqual("ASDF");
const t2 = z.string().transform((val) => val.length);
expect(t2.parse("asdf")).toEqual(4);
});
test("multiple transformers", () => {
const doubler = stringToNumber.transform((val) => {
return val * 2;
});
expect(doubler.parse("5")).toEqual(10);
});
test("short circuit on dirty", () => {
const schema = z
.string()
.refine(() => false)
.transform((val) => val.toUpperCase());
const result = schema.safeParse("asdf");
expect(result.success).toEqual(false);
if (!result.success) {
expect(result.error.issues[0].code).toEqual(z.ZodIssueCode.custom);
}
const result2 = schema.safeParse(1234);
expect(result2.success).toEqual(false);
if (!result2.success) {
expect(result2.error.issues[0].code).toEqual(z.ZodIssueCode.invalid_type);
}
});
test("async short circuit on dirty", async () => {
const schema = z
.string()
.refine(() => false)
.transform((val) => val.toUpperCase());
const result = await schema.spa("asdf");
expect(result.success).toEqual(false);
if (!result.success) {
expect(result.error.issues[0].code).toEqual(z.ZodIssueCode.custom);
}
const result2 = await schema.spa(1234);
expect(result2.success).toEqual(false);
if (!result2.success) {
expect(result2.error.issues[0].code).toEqual(z.ZodIssueCode.invalid_type);
}
});
@@ -0,0 +1,36 @@
export default class RegistryBase {
constructor() {
this._registryMap = new Map();
}
entries() {
return this._registryMap.entries();
}
getAll(key) {
this.ensure(key);
return this._registryMap.get(key);
}
get(key) {
this.ensure(key);
const value = this._registryMap.get(key);
return value[value.length - 1] || null;
}
set(key, value) {
this.ensure(key);
this._registryMap.get(key).push(value);
}
setAll(key, value) {
this._registryMap.set(key, value);
}
has(key) {
this.ensure(key);
return this._registryMap.get(key).length > 0;
}
clear() {
this._registryMap.clear();
}
ensure(key) {
if (!this._registryMap.has(key)) {
this._registryMap.set(key, []);
}
}
}
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,eAAe,CAAC,uBAAW,CAAC;AAChD","sources":["packages/@react-aria/breadcrumbs/intl/lv-LV.json"],"sourcesContent":["{\n \"breadcrumbs\": \"Atpakaļceļi\"\n}\n"],"names":[],"version":3,"file":"lv-LV.main.js.map"}
@@ -0,0 +1 @@
{"name":"mime-db","version":"1.54.0","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532088685,"integrity":"sha512-2Qg6Jzsp/k37D4lnXY6/5xgcAVpzuji/pHSedmeDXI5A8R9NgH27YkijNdZoMDF00BYkMq4nSoHWomxfY3IBhQ==","mode":420,"size":1172},"index.js":{"checkedAt":1794532088686,"integrity":"sha512-gopGcxBIPMG9hSxVXJZR5jygUhm29DjH/u1TyZilj+fwDjoBHPjFxnYOXrgfB1WJmDjnJIcHtBbafPMagY5Ysw==","mode":420,"size":189},"db.json":{"checkedAt":1794532088687,"integrity":"sha512-evfyTutPbR4/TtnhMkz0PaPPfmSWCNi7DJ+8wdJzwe9rd0z7RFS4LslWDso4sn3K49zCgWB5TCMMhGOUnmrB6g==","mode":420,"size":203840},"package.json":{"checkedAt":1794532088687,"integrity":"sha512-jNhRoUjHLz/EGLgRwW3PxK0ZdY0g5JFVfBRnUC201WPi9qF6R2vhEHHjmPtdKo7jRjo09ABLGZfSHFsk4EtpFQ==","mode":420,"size":1530},"HISTORY.md":{"checkedAt":1794532088687,"integrity":"sha512-grgC8tIh0aI+8glRxyp9txTY4C951LVr5xZTsHZvMvDbY2ToLKOajtCkg1Jm/SNHLL0m69TSN64/zWxiUdkPLA==","mode":420,"size":13886},"README.md":{"checkedAt":1794532088687,"integrity":"sha512-lLbJryUzzhFxaI1r78PARw/hRGkxYS2YPWJcjcYM2jCbca2FPH4an0A3yAGjtbkSexapyTpNoAvcms+S2wFvxQ==","mode":420,"size":4949}}}
@@ -0,0 +1,45 @@
# 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.2.0](https://github.com/ljharb/gopd/compare/v1.1.0...v1.2.0) - 2024-12-03
### Commits
- [New] add `gOPD` entry point; remove `get-intrinsic` [`5b61232`](https://github.com/ljharb/gopd/commit/5b61232dedea4591a314bcf16101b1961cee024e)
## [v1.1.0](https://github.com/ljharb/gopd/compare/v1.0.1...v1.1.0) - 2024-11-29
### Commits
- [New] add types [`f585e39`](https://github.com/ljharb/gopd/commit/f585e397886d270e4ba84e53d226e4f9ca2eb0e6)
- [Dev Deps] update `@ljharb/eslint-config`, `auto-changelog`, `tape` [`0b8e4fd`](https://github.com/ljharb/gopd/commit/0b8e4fded64397a7726a9daa144a6cc9a5e2edfa)
- [Dev Deps] update `aud`, `npmignore`, `tape` [`48378b2`](https://github.com/ljharb/gopd/commit/48378b2443f09a4f7efbd0fb6c3ee845a6cabcf3)
- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`78099ee`](https://github.com/ljharb/gopd/commit/78099eeed41bfdc134c912280483689cc8861c31)
- [Tests] replace `aud` with `npm audit` [`4e0d0ac`](https://github.com/ljharb/gopd/commit/4e0d0ac47619d24a75318a8e1f543ee04b2a2632)
- [meta] add missing `engines.node` [`1443316`](https://github.com/ljharb/gopd/commit/14433165d07835c680155b3dfd62d9217d735eca)
- [Deps] update `get-intrinsic` [`eee5f51`](https://github.com/ljharb/gopd/commit/eee5f51769f3dbaf578b70e2a3199116b01aa670)
- [Deps] update `get-intrinsic` [`550c378`](https://github.com/ljharb/gopd/commit/550c3780e3a9c77b62565712a001b4ed64ea61f5)
- [Dev Deps] add missing peer dep [`8c2ecf8`](https://github.com/ljharb/gopd/commit/8c2ecf848122e4e30abfc5b5086fb48b390dce75)
## [v1.0.1](https://github.com/ljharb/gopd/compare/v1.0.0...v1.0.1) - 2022-11-01
### Commits
- [Fix] actually export gOPD instead of dP [`4b624bf`](https://github.com/ljharb/gopd/commit/4b624bfbeff788c5e3ff16d9443a83627847234f)
## v1.0.0 - 2022-11-01
### Commits
- Initial implementation, tests, readme [`0911e01`](https://github.com/ljharb/gopd/commit/0911e012cd642092bd88b732c161c58bf4f20bea)
- Initial commit [`b84e33f`](https://github.com/ljharb/gopd/commit/b84e33f5808a805ac57ff88d4247ad935569acbe)
- [actions] add reusable workflows [`12ae28a`](https://github.com/ljharb/gopd/commit/12ae28ae5f50f86e750215b6e2188901646d0119)
- npm init [`280118b`](https://github.com/ljharb/gopd/commit/280118badb45c80b4483836b5cb5315bddf6e582)
- [meta] add `auto-changelog` [`bb78de5`](https://github.com/ljharb/gopd/commit/bb78de5639a180747fb290c28912beaaf1615709)
- [meta] create FUNDING.yml; add `funding` in package.json [`11c22e6`](https://github.com/ljharb/gopd/commit/11c22e6355bb01f24e7fac4c9bb3055eb5b25002)
- [meta] use `npmignore` to autogenerate an npmignore file [`4f4537a`](https://github.com/ljharb/gopd/commit/4f4537a843b39f698c52f072845092e6fca345bb)
- Only apps should have lockfiles [`c567022`](https://github.com/ljharb/gopd/commit/c567022a18573aa7951cf5399445d9840e23e98b)
@@ -0,0 +1,98 @@
/*
* 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 {Key} from '@react-types/shared';
import {LayoutInfo} from './LayoutInfo';
import {Virtualizer} from './Virtualizer';
let KEY = 0;
/**
* `Virtualizer` creates instances of the `ReusableView` class to
* represent views currently being displayed.
*/
export class ReusableView<T extends object, V> {
/** The Virtualizer this view is a part of. */
virtualizer: Virtualizer<T, V>;
/** The LayoutInfo this view is currently representing. */
layoutInfo: LayoutInfo | null;
/** The content currently being displayed by this view, set by the virtualizer. */
content: T | null;
rendered: V | null;
viewType: string;
key: Key;
children: Set<ChildView<T, V>>;
reusableViews: Map<string, ChildView<T, V>[]>;
constructor(virtualizer: Virtualizer<T, V>, viewType: string) {
this.virtualizer = virtualizer;
this.key = ++KEY;
this.viewType = viewType;
this.children = new Set();
this.reusableViews = new Map();
this.layoutInfo = null;
this.content = null;
this.rendered = null;
}
/**
* Prepares the view for reuse. Called just before the view is removed from the DOM.
*/
prepareForReuse(): void {
this.content = null;
this.rendered = null;
this.layoutInfo = null;
}
getReusableView(reuseType: string): ChildView<T, V> {
// Reusable view queue should be FIFO so that DOM order remains consistent during scrolling.
// For example, cells within a row should remain in the same order even if the row changes contents.
// The cells within a row are removed from their parent in order. If the row is reused, the cells
// should be reused in the new row in the same order they were before.
let reusable = this.reusableViews.get(reuseType);
let view = reusable && reusable.length > 0
? reusable.shift()!
: new ChildView<T, V>(this.virtualizer, this, reuseType);
return view;
}
reuseChild(child: ChildView<T, V>): void {
child.prepareForReuse();
let reusable = this.reusableViews.get(child.viewType);
if (!reusable) {
reusable = [];
this.reusableViews.set(child.viewType, reusable);
}
reusable.push(child);
}
}
export class RootView<T extends object, V> extends ReusableView<T, V> {
constructor(virtualizer: Virtualizer<T, V>) {
super(virtualizer, 'root');
}
}
export class ChildView<T extends object, V> extends ReusableView<T, V> {
parent: ReusableView<T, V>;
constructor(virtualizer: Virtualizer<T, V>, parent: ReusableView<T, V>, viewType: string) {
super(virtualizer, viewType);
this.parent = parent;
}
}
@@ -0,0 +1,20 @@
import test from 'tape';
import JSXAttributeMock from '../../../../__mocks__/JSXAttributeMock';
import getImplicitRoleForMenu from '../../../../src/util/implicitRoles/menu';
test('isAbstractRole', (t) => {
t.equal(
getImplicitRoleForMenu([JSXAttributeMock('type', 'toolbar')]),
'toolbar',
'works for toolbars',
);
t.equal(
getImplicitRoleForMenu([JSXAttributeMock('type', '')]),
'',
'works for non-toolbars',
);
t.end();
});
@@ -0,0 +1,36 @@
import apply from './_apply.js';
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max;
/**
* A specialized version of `baseRest` which transforms the rest array.
*
* @private
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @param {Function} transform The rest array transform.
* @returns {Function} Returns the new function.
*/
function overRest(func, start, transform) {
start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
return function() {
var args = arguments,
index = -1,
length = nativeMax(args.length - start, 0),
array = Array(length);
while (++index < length) {
array[index] = args[start + index];
}
index = -1;
var otherArgs = Array(start + 1);
while (++index < start) {
otherArgs[index] = args[index];
}
otherArgs[start] = transform(array);
return apply(func, this, otherArgs);
};
}
export default overRest;
@@ -0,0 +1 @@
{"name":"@heroui/divider","version":"2.2.21","requiresBuild":false,"files":{"dist/divider.js":{"checkedAt":1794532106577,"integrity":"sha512-03mNEDYR6W2mMEYMMDClhC6n7U0CNruDDdGtUMaE7gIRRAeiwfOb0aesBsgs6xxtTdHhWTt3UyhWWu1kxC10gA==","mode":420,"size":2936},"dist/index.js":{"checkedAt":1794532106577,"integrity":"sha512-M3Mod3Sy4CKTdE+zW+6+gG/uuW29uRVulVbUqjkXTfYLcF0RLYOK02MEJywGwjoEn9fJvj9AC2pfDM60ZRqL1A==","mode":420,"size":3094},"dist/use-divider.js":{"checkedAt":1794532106577,"integrity":"sha512-fHPmqzNe5yntHJ37i825rgth4KtnGXEUav3BPojCnZ9ZLyCA9fWbZcvwSwV5YUpXgViTDpPrh5TnLg9qOZxInQ==","mode":420,"size":2596},"dist/use-separator.js":{"checkedAt":1794532106577,"integrity":"sha512-fBU2ZcaIIftXGiSHdlqBownpcuCv/Tyw93X4OMw5YXf2q/8rNBmfZcCV+w4V0GwBgIdwB+92vEsJoBeN2W9GNg==","mode":420,"size":1639},"package.json":{"checkedAt":1794532107875,"integrity":"sha512-1bRpFyJlYFBPsVwMc56KZxDMKxRKvBUM5EvOURnU/1ZhPwoSpGfBOk1CBQPnC4LQYvXBBmCRrTLjAkz5Tnwkvg==","mode":420,"size":1388},"README.md":{"checkedAt":1794532106578,"integrity":"sha512-fYyXaBGsQxvJQRVCEIIxFo7IEYfjCrd8zUfeYn/36jGtUkVzg+O3BTG3on1j9NACJ/VMTrpAtxNelJuDJfOK6w==","mode":420,"size":536},"dist/chunk-D2EG5U3Q.mjs":{"checkedAt":1794532106578,"integrity":"sha512-/ms/s57TXq/b1AfwWT0d7SGL/lz0NAWdCx+FB37CS76iMH7xh4uy3pFR0iS3bPSY3zHphage7Xpa29sZk3o/JA==","mode":420,"size":567},"dist/chunk-IHO36JMK.mjs":{"checkedAt":1794532106578,"integrity":"sha512-ZqhPitA1eICXUgui8CEbnKt9wqJB6YzRNa07qjAgD3UOsFUTpIjOmYkp/q73K+8NOLr52uc4m6ewvxxcVJiySg==","mode":420,"size":451},"dist/chunk-TS7K35D7.mjs":{"checkedAt":1794532106578,"integrity":"sha512-6gaTea+TrvqVK51+6B0+Qi2kllmSZNw38IJNCGrxeuR3Ao5G5HZGPv4w4NL/il6NzLeMKHL20QNcB/gr2RhICA==","mode":420,"size":978},"dist/divider.mjs":{"checkedAt":1794532106578,"integrity":"sha512-/ae8IRbg/exs3paggXufpQPNF0LIrIpsAkA27F0XcYRjRnPQPcVsljwoKhUhiNiWoq3yAD2JsTWF9MZeHwCMkw==","mode":420,"size":161},"dist/index.mjs":{"checkedAt":1794532106578,"integrity":"sha512-QzBJD6BtOSGxbD2ROSReh1hkNmNeQnixmRxgwiRwCCJUI71KXNRahOzYy4rysZiUAavk1WIVstwN+uefcF6sDg==","mode":420,"size":197},"dist/use-divider.mjs":{"checkedAt":1794532106579,"integrity":"sha512-o7e4mMM/PG20Y3c/tfsjjf3RCHrsR73kJjlr2+kDXV0BbNfkH/c17RzwHwaXET42oiVtRHPrbQaQf2BZQ2/JUA==","mode":420,"size":109},"dist/use-separator.mjs":{"checkedAt":1794532106579,"integrity":"sha512-n32qoVhdeJ7M4Zioz0KlAfSStn26rvSFd1NtkMk55BI04csCgVctJAcQxwqVf4lGopvAoYDj33yZnsQiel/hfw==","mode":420,"size":82},"dist/divider.d.mts":{"checkedAt":1794532106579,"integrity":"sha512-7nFbgyqk6z6QYOtHAttHaB/8hjvaNnitC268rk5v35n+wsckd4oX2gh+9u8UCmjikLRnSzuubgYgWoB2kERiXg==","mode":420,"size":436},"dist/index.d.mts":{"checkedAt":1794532106579,"integrity":"sha512-Qd/uKGGffgescDhOPTYOW3/HleoXdZ7Lt+2rL/lcYe09iGbGRjL9PdZ4DgmsOArqLkyF14HnwXCYdmd6nF/1wA==","mode":420,"size":243},"dist/use-divider.d.mts":{"checkedAt":1794532106579,"integrity":"sha512-5ce08yjIEysjNT0/uGOsg5N7OBkEjjOtIjnx/DuxPtNG9oq/1G234zJVW15gPIYc3KubAeYP1XSRy0GBetuFWQ==","mode":420,"size":773},"dist/use-separator.d.mts":{"checkedAt":1794532106579,"integrity":"sha512-4oOD8MB1sWyT4DbiE022SJ4M5uqOQuTzOVwVVvN52bf8uh8IFXf+k3Tz937W7lmGZ6FtkkUghUv+GdFbYvexwQ==","mode":420,"size":811},"dist/divider.d.ts":{"checkedAt":1794532106579,"integrity":"sha512-dsOAPJfrtBXUKJeYa/YweO8tJNrQ0sGN9e+ySSvLr0ggDCdI2KdtlbWv9rRh+yg7Bz7+lSptQF2Tr37RJcvd9Q==","mode":420,"size":434},"dist/index.d.ts":{"checkedAt":1794532106579,"integrity":"sha512-wAg2J8a41Z+AF5TsZuIkXf1IsVko06sELOTytCcNyBTFfsu2PIB55vzth40IQ59TinK6fNTTx41CE5H/zCKXcA==","mode":420,"size":240},"dist/use-divider.d.ts":{"checkedAt":1794532106580,"integrity":"sha512-DgHa0DOCvXi7ZMo/bAV3zuSxwDuFjhKrdGkBXplt1a+1A/XSsjzSQ8/FaYL3Yy5JBXSKPaEglOQDUN98c3A0MQ==","mode":420,"size":772},"dist/use-separator.d.ts":{"checkedAt":1794532106579,"integrity":"sha512-4oOD8MB1sWyT4DbiE022SJ4M5uqOQuTzOVwVVvN52bf8uh8IFXf+k3Tz937W7lmGZ6FtkkUghUv+GdFbYvexwQ==","mode":420,"size":811},"LICENSE":{"checkedAt":1794532107875,"integrity":"sha512-fUY+MMF2uFI8CfCphWLCp6ty4uU9bKvcaTZFGiBK7qgOOULkpyNSGb2IIjBYgGT5iqdeUaZRGLbTggbAUEyPyQ==","mode":420,"size":1069}}}
@@ -0,0 +1,15 @@
import Block from '../blots/block.js';
import Inline from '../blots/inline.js';
import Container from '../blots/container.js';
declare class CodeBlockContainer extends Container {
static create(value: string): Element;
code(index: number, length: number): string;
html(index: number, length: number): string;
}
declare class CodeBlock extends Block {
static TAB: string;
static register(): void;
}
declare class Code extends Inline {
}
export { Code, CodeBlockContainer, CodeBlock as default };
@@ -0,0 +1,6 @@
module.exports = {
"breadcrumbs": `\u{D0D0}\u{C0C9} \u{D45C}\u{C2DC}`
};
//# sourceMappingURL=ko-KR.main.js.map
@@ -0,0 +1,314 @@
/**
* @import {Node, Point, Position} from 'unist'
*/
/**
* @typedef {object & {type: string, position?: Position | undefined}} NodeLike
*
* @typedef Options
* Configuration.
* @property {Array<Node> | null | undefined} [ancestors]
* Stack of (inclusive) ancestor nodes surrounding the message (optional).
* @property {Error | null | undefined} [cause]
* Original error cause of the message (optional).
* @property {Point | Position | null | undefined} [place]
* Place of message (optional).
* @property {string | null | undefined} [ruleId]
* Category of message (optional, example: `'my-rule'`).
* @property {string | null | undefined} [source]
* Namespace of who sent the message (optional, example: `'my-package'`).
*/
import {stringifyPosition} from 'unist-util-stringify-position'
/**
* Message.
*/
export class VFileMessage extends Error {
/**
* Create a message for `reason`.
*
* > 🪦 **Note**: also has obsolete signatures.
*
* @overload
* @param {string} reason
* @param {Options | null | undefined} [options]
* @returns
*
* @overload
* @param {string} reason
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns
*
* @overload
* @param {string} reason
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns
*
* @overload
* @param {string} reason
* @param {string | null | undefined} [origin]
* @returns
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Node | NodeLike | null | undefined} parent
* @param {string | null | undefined} [origin]
* @returns
*
* @overload
* @param {Error | VFileMessage} cause
* @param {Point | Position | null | undefined} place
* @param {string | null | undefined} [origin]
* @returns
*
* @overload
* @param {Error | VFileMessage} cause
* @param {string | null | undefined} [origin]
* @returns
*
* @param {Error | VFileMessage | string} causeOrReason
* Reason for message, should use markdown.
* @param {Node | NodeLike | Options | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
* Configuration (optional).
* @param {string | null | undefined} [origin]
* Place in code where the message originates (example:
* `'my-package:my-rule'` or `'my-rule'`).
* @returns
* Instance of `VFileMessage`.
*/
// eslint-disable-next-line complexity
constructor(causeOrReason, optionsOrParentOrPlace, origin) {
super()
if (typeof optionsOrParentOrPlace === 'string') {
origin = optionsOrParentOrPlace
optionsOrParentOrPlace = undefined
}
/** @type {string} */
let reason = ''
/** @type {Options} */
let options = {}
let legacyCause = false
if (optionsOrParentOrPlace) {
// Point.
if (
'line' in optionsOrParentOrPlace &&
'column' in optionsOrParentOrPlace
) {
options = {place: optionsOrParentOrPlace}
}
// Position.
else if (
'start' in optionsOrParentOrPlace &&
'end' in optionsOrParentOrPlace
) {
options = {place: optionsOrParentOrPlace}
}
// Node.
else if ('type' in optionsOrParentOrPlace) {
options = {
ancestors: [optionsOrParentOrPlace],
place: optionsOrParentOrPlace.position
}
}
// Options.
else {
options = {...optionsOrParentOrPlace}
}
}
if (typeof causeOrReason === 'string') {
reason = causeOrReason
}
// Error.
else if (!options.cause && causeOrReason) {
legacyCause = true
reason = causeOrReason.message
options.cause = causeOrReason
}
if (!options.ruleId && !options.source && typeof origin === 'string') {
const index = origin.indexOf(':')
if (index === -1) {
options.ruleId = origin
} else {
options.source = origin.slice(0, index)
options.ruleId = origin.slice(index + 1)
}
}
if (!options.place && options.ancestors && options.ancestors) {
const parent = options.ancestors[options.ancestors.length - 1]
if (parent) {
options.place = parent.position
}
}
const start =
options.place && 'start' in options.place
? options.place.start
: options.place
/**
* Stack of ancestor nodes surrounding the message.
*
* @type {Array<Node> | undefined}
*/
this.ancestors = options.ancestors || undefined
/**
* Original error cause of the message.
*
* @type {Error | undefined}
*/
this.cause = options.cause || undefined
/**
* Starting column of message.
*
* @type {number | undefined}
*/
this.column = start ? start.column : undefined
/**
* State of problem.
*
* * `true` — error, file not usable
* * `false` — warning, change may be needed
* * `undefined` — change likely not needed
*
* @type {boolean | null | undefined}
*/
this.fatal = undefined
/**
* Path of a file (used throughout the `VFile` ecosystem).
*
* @type {string | undefined}
*/
this.file = ''
// Field from `Error`.
/**
* Reason for message.
*
* @type {string}
*/
this.message = reason
/**
* Starting line of error.
*
* @type {number | undefined}
*/
this.line = start ? start.line : undefined
// Field from `Error`.
/**
* Serialized positional info of message.
*
* On normal errors, this would be something like `ParseError`, buit in
* `VFile` messages we use this space to show where an error happened.
*/
this.name = stringifyPosition(options.place) || '1:1'
/**
* Place of message.
*
* @type {Point | Position | undefined}
*/
this.place = options.place || undefined
/**
* Reason for message, should use markdown.
*
* @type {string}
*/
this.reason = this.message
/**
* Category of message (example: `'my-rule'`).
*
* @type {string | undefined}
*/
this.ruleId = options.ruleId || undefined
/**
* Namespace of message (example: `'my-package'`).
*
* @type {string | undefined}
*/
this.source = options.source || undefined
// Field from `Error`.
/**
* Stack of message.
*
* This is used by normal errors to show where something happened in
* programming code, irrelevant for `VFile` messages,
*
* @type {string}
*/
this.stack =
legacyCause && options.cause && typeof options.cause.stack === 'string'
? options.cause.stack
: ''
// The following fields are “well known”.
// Not standard.
// Feel free to add other non-standard fields to your messages.
/**
* Specify the source value that’s being reported, which is deemed
* incorrect.
*
* @type {string | undefined}
*/
this.actual = undefined
/**
* Suggest acceptable values that can be used instead of `actual`.
*
* @type {Array<string> | undefined}
*/
this.expected = undefined
/**
* Long form description of the message (you should use markdown).
*
* @type {string | undefined}
*/
this.note = undefined
/**
* Link to docs for the message.
*
* > 👉 **Note**: this must be an absolute URL that can be passed as `x`
* > to `new URL(x)`.
*
* @type {string | undefined}
*/
this.url = undefined
}
}
VFileMessage.prototype.file = ''
VFileMessage.prototype.name = ''
VFileMessage.prototype.reason = ''
VFileMessage.prototype.message = ''
VFileMessage.prototype.stack = ''
VFileMessage.prototype.column = undefined
VFileMessage.prototype.line = undefined
VFileMessage.prototype.ancestors = undefined
VFileMessage.prototype.cause = undefined
VFileMessage.prototype.fatal = undefined
VFileMessage.prototype.place = undefined
VFileMessage.prototype.ruleId = undefined
VFileMessage.prototype.source = undefined
@@ -0,0 +1,11 @@
/// <reference path="./types.d.ts" />
declare module 'dayjs/esm/locale/*' {
namespace locale {
interface Locale extends ILocale {}
}
const locale: locale.Locale
export = locale
}
@@ -0,0 +1,39 @@
import { BitString } from "@peculiar/asn1-schema";
/**
* ```asn1
* id-entrust-entrustVersInfo OBJECT IDENTIFIER ::= {iso(1)
* member-body(2) us(840) nortelnetworks(113533) entrust(7)
* nsn-ce(65) 0}
* ```
*/
export declare const id_entrust_entrustVersInfo = "1.2.840.113533.7.65.0";
export type EntrustInfoType = "keyUpdateAllowed" | "newExtensions" | "pKIXCertificate";
export declare enum EntrustInfoFlags {
keyUpdateAllowed = 1,
newExtensions = 2,
pKIXCertificate = 4
}
/**
* ```asn1
* EntrustInfoFlags ::= BIT STRING {
* keyUpdateAllowed (0),
* newExtensions (1), -- not used
* pKIXCertificate (2) } -- certificate created by pkix
* ```
*/
export declare class EntrustInfo extends BitString {
toJSON(): EntrustInfoType[];
toString(): string;
}
/**
* ```asn1
* EntrustVersionInfo ::= SEQUENCE {
* entrustVers GeneralString,
* entrustInfoFlags EntrustInfoFlags }
* ```
*/
export declare class EntrustVersionInfo {
entrustVers: string;
entrustInfoFlags: EntrustInfo;
constructor(params?: Partial<EntrustVersionInfo>);
}
@@ -0,0 +1,32 @@
import { DOMRefValue, FocusableRefValue, FocusableRef } from '@react-types/shared';
import { RefObject, Ref, MutableRefObject } from 'react';
declare function canUseDOM(): boolean;
declare const isBrowser: boolean;
declare function getUserAgentBrowser(navigator: Navigator): "Chrome for iOS" | "Edge" | "Silk" | "Chrome" | "Firefox" | "AOSP" | "IE" | "Safari" | "WebKit" | null;
type UserAgentBrowser = NonNullable<ReturnType<typeof getUserAgentBrowser>>;
declare function getUserAgentOS(navigator: Navigator): "Android" | "iOS" | "Windows" | "Mac" | "Chrome OS" | "Firefox OS" | null;
type UserAgentOS = NonNullable<ReturnType<typeof getUserAgentOS>>;
declare function detectDeviceType(navigator: Navigator): "tablet" | "phone" | "desktop";
type UserAgentDeviceType = NonNullable<ReturnType<typeof detectDeviceType>>;
declare function detectOS(os: UserAgentOS): boolean;
declare function detectBrowser(browser: UserAgentBrowser): boolean;
declare function detectTouch(): boolean;
declare function createDOMRef<T extends HTMLElement = HTMLElement>(ref: RefObject<T>): DOMRefValue<T>;
declare function createFocusableRef<T extends HTMLElement = HTMLElement>(domRef: RefObject<T>, focusableRef?: RefObject<HTMLElement>): FocusableRefValue<T>;
declare function useDOMRef<T extends HTMLElement = HTMLElement>(ref?: RefObject<T | null> | Ref<T | null>): RefObject<T>;
declare function useFocusableRef<T extends HTMLElement = HTMLElement>(ref: FocusableRef<T>, focusableRef?: RefObject<HTMLElement>): RefObject<T>;
interface ContextValue<T> {
ref?: MutableRefObject<T>;
}
declare function useSyncRef<T>(context: ContextValue<T | null>, ref: RefObject<T>): void;
/**
* Checks if two DOMRect objects intersect each other.
*
* @param rect1 - The first DOMRect object.
* @param rect2 - The second DOMRect object.
* @returns A boolean indicating whether the two DOMRect objects intersect.
*/
declare function areRectsIntersecting(rect1: DOMRect, rect2: DOMRect): boolean;
export { type ContextValue, type UserAgentBrowser, type UserAgentDeviceType, type UserAgentOS, areRectsIntersecting, canUseDOM, createDOMRef, createFocusableRef, detectBrowser, detectDeviceType, detectOS, detectTouch, getUserAgentBrowser, getUserAgentOS, isBrowser, useDOMRef, useFocusableRef, useSyncRef };
@@ -0,0 +1 @@
{"name":"decompress-response","version":"6.0.0","requiresBuild":false,"files":{"license":{"checkedAt":1794532093291,"integrity":"sha512-0fM2/ycrxrltyaBKfQ748Ck23VlPUUBgNAR47ldf4B1V/HoXTfWBSk+vcshGKwEpmOynu4mOP5o+hyBfuRNa8g==","mode":420,"size":1117},"index.js":{"checkedAt":1794532102331,"integrity":"sha512-2NzruRqpMM+qwkt+mxUO9qZqc7Op3NuAv2ct8dWsDeFSG25c6jUbKcNGlDkev8zpta5KqIoe7/mG5/7TPr6ZNA==","mode":420,"size":1320},"package.json":{"checkedAt":1794532102331,"integrity":"sha512-AgrCmtMwCLKuA+OTklEtlVRdHdwpEDfCzXfO+40mU4DN+QQS25T4mF6ubDlKSDSf0eQBqc7wr8WBK/L902cmRA==","mode":420,"size":985},"readme.md":{"checkedAt":1794532102331,"integrity":"sha512-x6P4uLBNpNGoDmgVoyqbHUMhOJ7oiEWlnEM8/DtSopGMO5vxD/j96WN4hfVT340MjYHLye2I/xT779HuD8rwHw==","mode":420,"size":1508},"index.d.ts":{"checkedAt":1794532102331,"integrity":"sha512-WnLvjH482p9G8Wg56o5Na1JJIDOvxfCfe2TVwDK40zks0QRh8Gd+faIRGhcTDqUB/TZyypYyS+WR9ijCUed+Og==","mode":420,"size":542}}}
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,6EAAW,CAAC;IAC5C,iBAAiB,CAAC,OAAS,CAAC,gIAAoB,EAAE,KAAK,UAAU,CAAC,wIAAsB,CAAC;IACzF,cAAc,CAAC,OAAS,GAAG,KAAK,KAAK,CAAC,8BAAM,CAAC;IAC7C,cAAc,CAAC,wDAAQ,CAAC;IACxB,kBAAkB,CAAC,OAAS,CAAC,gIAAoB,EAAE,KAAK,UAAU,CAAC,mHAAmB,CAAC;IACvF,sBAAsB,CAAC,mSAAmD,CAAC;IAC3E,UAAU,CAAC,iDAAO,CAAC;IACnB,aAAa,CAAC,uEAAW,CAAC;IAC1B,YAAY,CAAC,+HAAmB,CAAC;AACnC","sources":["packages/@react-aria/table/intl/ru-RU.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":"ru-RU.main.js.map"}
@@ -0,0 +1 @@
export { _ as default } from "../esm/_class_static_private_field_update.js";
@@ -0,0 +1,82 @@
import * as fs from "fs";
import * as path from "path";
import figlet from "./figlet.mjs";
import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const fontPath = path.join(__dirname, "/../fonts/");
const nodeFiglet = figlet;
nodeFiglet.defaults({ fontPath });
nodeFiglet.loadFont = function(name, callback) {
return new Promise((resolve, reject) => {
if (nodeFiglet.figFonts[name]) {
callback?.(null, nodeFiglet.figFonts[name].options);
resolve(nodeFiglet.figFonts[name].options);
return;
}
fs.readFile(
path.join(nodeFiglet.defaults().fontPath, name + ".flf"),
{ encoding: "utf-8" },
(err, fontData) => {
if (err) {
callback?.(err);
reject(err);
return;
}
fontData = fontData + "";
try {
const font = nodeFiglet.parseFont(name, fontData);
callback?.(null, font);
resolve(font);
} catch (error) {
const typedError = error instanceof Error ? error : new Error(String(error));
callback?.(typedError);
reject(typedError);
}
}
);
});
};
nodeFiglet.loadFontSync = function(font) {
if (nodeFiglet.figFonts[font]) {
return nodeFiglet.figFonts[font].options;
}
const fontData = fs.readFileSync(path.join(nodeFiglet.defaults().fontPath, font + ".flf"), {
encoding: "utf-8"
}) + "";
return nodeFiglet.parseFont(font, fontData);
};
nodeFiglet.fonts = function(next) {
return new Promise((resolve, reject) => {
const fontList = [];
fs.readdir(
nodeFiglet.defaults().fontPath,
(err, files) => {
if (err) {
next && next(err);
reject(err);
return;
}
files.forEach((file) => {
if (/\.flf$/.test(file)) {
fontList.push(file.replace(/\.flf$/, ""));
}
});
next && next(null, fontList);
resolve(fontList);
}
);
});
};
nodeFiglet.fontsSync = function() {
const fontList = [];
fs.readdirSync(nodeFiglet.defaults().fontPath).forEach((file) => {
if (/\.flf$/.test(file)) {
fontList.push(file.replace(/\.flf$/, ""));
}
});
return fontList;
};
export {
nodeFiglet as default
};
@@ -0,0 +1,721 @@
flf2a$ 7 7 20 -1 6
banner.flf by Ryan Youck (youck@cs.uregina.ca)
(From a unix program called banner)
I am not responsible for use of this font
Thanks to Glenn Chappell for his help
March 7, 1994
$$$@
$$$@
$$$@
$$$@
$$$@
$$$@
$$$@@
###$@
###$@
###$@
# $@
$@
###$@
###$@@
### ###$@
### ###$@
# # $@
$ $@
$ $@
$@
$@@
# # $@
# # $@
#######$@
# # $@
#######$@
# # $@
# # $@@
##### $@
# # #$@
# # $@
##### $@
# #$@
# # #$@
##### $@@
### #$@
# # # $@
### # $@
# $@
# ###$@
# # #$@
# ###$@@
## $@
# # $@
## $@
### $@
# # #$@
# # $@
### #$@@
###$@
###$@
# $@
# $@
$@
$@
$@@
##$@
# $@
# $@
# $@
# $@
# $@
##$@@
## $@
# $@
#$@
#$@
#$@
# $@
## $@@
$@
# # $@
# # $@
#######$@
# # $@
# # $@
$@@
$@
# $@
# $@
#####$@
# $@
# $@
$@@
$@
$@
$@
###$@
###$@
# $@
# $@@
$@
$@
$@
#####$@
$@
$@
$@@
$@
$@
$@
$@
###$@
###$@
###$@@
#$@
# $@
# $@
# $@
# $@
# $@
# $@@
### $@
# # $@
# #$@
# #$@
# #$@
# # $@
### $@@
# $@
## $@
# # $@
# $@
# $@
# $@
#####$@@
##### $@
# #$@
#$@
##### $@
# $@
# $@
#######$@@
##### $@
# #$@
#$@
##### $@
#$@
# #$@
##### $@@
# $@
# # $@
# # $@
# # $@
#######$@
# $@
# $@@
#######$@
# $@
# $@
###### $@
#$@
# #$@
##### $@@
##### $@
# #$@
# $@
###### $@
# #$@
# #$@
##### $@@
#######$@
# # $@
# $@
# $@
# $@
# $@
# $@@
##### $@
# #$@
# #$@
##### $@
# #$@
# #$@
##### $@@
##### $@
# #$@
# #$@
######$@
#$@
# #$@
##### $@@
# $@
###$@
# $@
$@
# $@
###$@
# $@@
###$@
###$@
$@
###$@
###$@
# $@
# $@@
#$@
# $@
# $@
# $@
# $@
# $@
#$@@
$@
$@
#####$@
$@
#####$@
$@
$@@
# $@
# $@
# $@
#$@
# $@
# $@
# $@@
##### $@
# #$@
#$@
### $@
# $@
$@
# $@@
##### $@
# #$@
# ### #$@
# ### #$@
# #### $@
# $@
##### $@@
# $@
# # $@
# # $@
# #$@
#######$@
# #$@
# #$@@
###### $@
# #$@
# #$@
###### $@
# #$@
# #$@
###### $@@
##### $@
# #$@
# $@
# $@
# $@
# #$@
##### $@@
###### $@
# #$@
# #$@
# #$@
# #$@
# #$@
###### $@@
#######$@
# $@
# $@
##### $@
# $@
# $@
#######$@@
#######$@
# $@
# $@
##### $@
# $@
# $@
# $@@
##### $@
# #$@
# $@
# ####$@
# #$@
# #$@
##### $@@
# #$@
# #$@
# #$@
#######$@
# #$@
# #$@
# #$@@
###$@
# $@
# $@
# $@
# $@
# $@
###$@@
#$@
#$@
#$@
#$@
# #$@
# #$@
##### $@@
# #$@
# # $@
# # $@
### $@
# # $@
# # $@
# #$@@
# $@
# $@
# $@
# $@
# $@
# $@
#######$@@
# #$@
## ##$@
# # # #$@
# # #$@
# #$@
# #$@
# #$@@
# #$@
## #$@
# # #$@
# # #$@
# # #$@
# ##$@
# #$@@
#######$@
# #$@
# #$@
# #$@
# #$@
# #$@
#######$@@
###### $@
# #$@
# #$@
###### $@
# $@
# $@
# $@@
##### $@
# #$@
# #$@
# #$@
# # #$@
# # $@
#### #$@@
###### $@
# #$@
# #$@
###### $@
# # $@
# # $@
# #$@@
##### $@
# #$@
# $@
##### $@
#$@
# #$@
##### $@@
#######$@
# $@
# $@
# $@
# $@
# $@
# $@@
# #$@
# #$@
# #$@
# #$@
# #$@
# #$@
##### $@@
# #$@
# #$@
# #$@
# #$@
# # $@
# # $@
# $@@
# #$@
# # #$@
# # #$@
# # #$@
# # #$@
# # #$@
## ## $@@
# #$@
# # $@
# # $@
# $@
# # $@
# # $@
# #$@@
# #$@
# # $@
# # $@
# $@
# $@
# $@
# $@@
#######$@
# $@
# $@
# $@
# $@
# $@
#######$@@
#####$@
# $@
# $@
# $@
# $@
# $@
#####$@@
# $@
# $@
# $@
# $@
# $@
# $@
#$@@
#####$@
#$@
#$@
#$@
#$@
#$@
#####$@@
# $@
# # $@
# #$@
$@
$@
$@
$@@
$@
$@
$@
$@
$@
$@
#######$@@
###$@
###$@
# $@
#$@
$@
$@
$@@
$@
## $@
# # $@
# #$@
######$@
# #$@
# #$@@
$@
##### $@
# #$@
##### $@
# #$@
# #$@
##### $@@
$@
#### $@
# #$@
# $@
# $@
# #$@
#### $@@
$@
##### $@
# #$@
# #$@
# #$@
# #$@
##### $@@
$@
######$@
# $@
##### $@
# $@
# $@
######$@@
$@
######$@
# $@
##### $@
# $@
# $@
# $@@
$@
#### $@
# #$@
# $@
# ###$@
# #$@
#### $@@
$@
# #$@
# #$@
######$@
# #$@
# #$@
# #$@@
$@
#$@
#$@
#$@
#$@
#$@
#$@@
$@
#$@
#$@
#$@
#$@
# #$@
#### $@@
$@
# #$@
# # $@
#### $@
# # $@
# # $@
# #$@@
$@
# $@
# $@
# $@
# $@
# $@
######$@@
$@
# #$@
## ##$@
# ## #$@
# #$@
# #$@
# #$@@
$@
# #$@
## #$@
# # #$@
# # #$@
# ##$@
# #$@@
$@
#### $@
# #$@
# #$@
# #$@
# #$@
#### $@@
$@
##### $@
# #$@
# #$@
##### $@
# $@
# $@@
$@
#### $@
# #$@
# #$@
# # #$@
# # $@
### #$@@
$@
##### $@
# #$@
# #$@
##### $@
# # $@
# #$@@
$@
#### $@
# $@
#### $@
#$@
# #$@
#### $@@
$@
#####$@
# $@
# $@
# $@
# $@
# $@@
$@
# #$@
# #$@
# #$@
# #$@
# #$@
#### $@@
$@
# #$@
# #$@
# #$@
# #$@
# # $@
## $@@
$@
# #$@
# #$@
# #$@
# ## #$@
## ##$@
# #$@@
$@
# #$@
# # $@
## $@
## $@
# # $@
# #$@@
$@
# #$@
# # $@
# $@
# $@
# $@
# $@@
$@
######$@
# $@
# $@
# $@
# $@
######$@@
###$@
# $@
# $@
## $@
# $@
# $@
###$@@
#$@
#$@
#$@
$@
#$@
#$@
#$@@
### $@
# $@
# $@
##$@
# $@
# $@
### $@@
## $@
# # #$@
## $@
$@
$@
$@
$@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@@
@@ -0,0 +1,246 @@
/**
* @import {Code} from 'micromark-util-types'
*/
/**
* Check whether the character code represents an ASCII alpha (`a` through `z`,
* case insensitive).
*
* An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.
*
* An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)
* to U+005A (`Z`).
*
* An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)
* to U+007A (`z`).
*
* @param code
* Code.
* @returns {boolean}
* Whether it matches.
*/
export const asciiAlpha = regexCheck(/[A-Za-z]/);
/**
* Check whether the character code represents an ASCII alphanumeric (`a`
* through `z`, case insensitive, or `0` through `9`).
*
* An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha
* (see `asciiAlpha`).
*
* @param code
* Code.
* @returns {boolean}
* Whether it matches.
*/
export const asciiAlphanumeric = regexCheck(/[\dA-Za-z]/);
/**
* Check whether the character code represents an ASCII atext.
*
* atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in
* the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),
* U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F
* SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E
* CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE
* (`{`) to U+007E TILDE (`~`).
*
* See:
* **\[RFC5322]**:
* [Internet Message Format](https://tools.ietf.org/html/rfc5322).
* P. Resnick.
* IETF.
*
* @param code
* Code.
* @returns {boolean}
* Whether it matches.
*/
export const asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/);
/**
* Check whether a character code is an ASCII control character.
*
* An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)
* to U+001F (US), or U+007F (DEL).
*
* @param {Code} code
* Code.
* @returns {boolean}
* Whether it matches.
*/
export function asciiControl(code) {
return (
// Special whitespace codes (which have negative values), C0 and Control
// character DEL
code !== null && (code < 32 || code === 127)
);
}
/**
* Check whether the character code represents an ASCII digit (`0` through `9`).
*
* An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to
* U+0039 (`9`).
*
* @param code
* Code.
* @returns {boolean}
* Whether it matches.
*/
export const asciiDigit = regexCheck(/\d/);
/**
* Check whether the character code represents an ASCII hex digit (`a` through
* `f`, case insensitive, or `0` through `9`).
*
* An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex
* digit, or an ASCII lower hex digit.
*
* An **ASCII upper hex digit** is a character in the inclusive range U+0041
* (`A`) to U+0046 (`F`).
*
* An **ASCII lower hex digit** is a character in the inclusive range U+0061
* (`a`) to U+0066 (`f`).
*
* @param code
* Code.
* @returns {boolean}
* Whether it matches.
*/
export const asciiHexDigit = regexCheck(/[\dA-Fa-f]/);
/**
* Check whether the character code represents ASCII punctuation.
*
* An **ASCII punctuation** is a character in the inclusive ranges U+0021
* EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT
* SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT
* (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).
*
* @param code
* Code.
* @returns {boolean}
* Whether it matches.
*/
export const asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/);
/**
* Check whether a character code is a markdown line ending.
*
* A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN
* LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).
*
* In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE
* RETURN (CR) are replaced by these virtual characters depending on whether
* they occurred together.
*
* @param {Code} code
* Code.
* @returns {boolean}
* Whether it matches.
*/
export function markdownLineEnding(code) {
return code !== null && code < -2;
}
/**
* Check whether a character code is a markdown line ending (see
* `markdownLineEnding`) or markdown space (see `markdownSpace`).
*
* @param {Code} code
* Code.
* @returns {boolean}
* Whether it matches.
*/
export function markdownLineEndingOrSpace(code) {
return code !== null && (code < 0 || code === 32);
}
/**
* Check whether a character code is a markdown space.
*
* A **markdown space** is the concrete character U+0020 SPACE (SP) and the
* virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).
*
* In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is
* replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL
* SPACE (VS) characters, depending on the column at which the tab occurred.
*
* @param {Code} code
* Code.
* @returns {boolean}
* Whether it matches.
*/
export function markdownSpace(code) {
return code === -2 || code === -1 || code === 32;
}
// Size note: removing ASCII from the regex and using `asciiPunctuation` here
// In fact adds to the bundle size.
/**
* Check whether the character code represents Unicode punctuation.
*
* A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,
* Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`
* (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`
* (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII
* punctuation (see `asciiPunctuation`).
*
* See:
* **\[UNICODE]**:
* [The Unicode Standard](https://www.unicode.org/versions/).
* Unicode Consortium.
*
* @param code
* Code.
* @returns
* Whether it matches.
*/
export const unicodePunctuation = regexCheck(/\p{P}|\p{S}/u);
/**
* Check whether the character code represents Unicode whitespace.
*
* Note that this does handle micromark specific markdown whitespace characters.
* See `markdownLineEndingOrSpace` to check that.
*
* A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,
* Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),
* U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\[UNICODE]**).
*
* See:
* **\[UNICODE]**:
* [The Unicode Standard](https://www.unicode.org/versions/).
* Unicode Consortium.
*
* @param code
* Code.
* @returns
* Whether it matches.
*/
export const unicodeWhitespace = regexCheck(/\s/);
/**
* Create a code check from a regex.
*
* @param {RegExp} regex
* Expression.
* @returns {(code: Code) => boolean}
* Check.
*/
function regexCheck(regex) {
return check;
/**
* Check whether a code matches the bound regex.
*
* @param {Code} code
* Character code.
* @returns {boolean}
* Whether the character code matches the bound regex.
*/
function check(code) {
return code !== null && code > -1 && regex.test(String.fromCharCode(code));
}
}
@@ -0,0 +1,27 @@
'use strict';
import AxiosError from './AxiosError.js';
/**
* Resolve or reject a Promise based on response status.
*
* @param {Function} resolve A function that resolves the promise.
* @param {Function} reject A function that rejects the promise.
* @param {object} response The response.
*
* @returns {object} The response.
*/
export default function settle(resolve, reject, response) {
const validateStatus = response.config.validateStatus;
if (!response.status || !validateStatus || validateStatus(response.status)) {
resolve(response);
} else {
reject(new AxiosError(
'Request failed with status code ' + response.status,
[AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
response.config,
response.request,
response
));
}
}
@@ -0,0 +1,9 @@
export type Options = [
{
allow?: string[];
allowAsImport?: boolean;
}
];
export type MessageIds = 'noRequireImports';
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"noRequireImports", Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
export default _default;
@@ -0,0 +1 @@
{"name":"@heroui/react-utils","version":"2.1.4","requiresBuild":false,"files":{"dist/context.js":{"checkedAt":1794532106681,"integrity":"sha512-2E3bdOkBy/NHIKgNxOY/i+6DtNdsmzyjTyuf6lJx6TjjcHaGhQ54XnKwBt0uN29cwl6mkvDHMQ0iUfge0mufow==","mode":420,"size":2106},"dist/dimensions.js":{"checkedAt":1794532106681,"integrity":"sha512-eMVwU+tOUVfjASUuKmDxPTWpexYWQemv+cZS0Q39YK0EEKvFhCt+28xSK2CdOCIcdiAbUjVtuivGjVkV2hNzJQ==","mode":420,"size":1761},"dist/dom.js":{"checkedAt":1794532106681,"integrity":"sha512-I0qRrth/wuBm8Bsou1XBLUDDoPad0X+nUf+IQWdeD9wDiAlgHXImY00SETvebCmfLdbrQVGyVfpSy0ROvCAGTQ==","mode":420,"size":5073},"dist/index.js":{"checkedAt":1794532106681,"integrity":"sha512-RYKUE6ZYbpV7K2Bv5QOS+kVgGsrSxSYfqCgsRDXmsAtrQWupB6/Tu4gQAtA+5NHLjAmCnURCkhkL+EGaqqSY+w==","mode":420,"size":8297},"dist/refs.js":{"checkedAt":1794532106681,"integrity":"sha512-niGC66DOEOw30iLjA2EkISPQ3pOfLm5L7rQwYq2EQS0Ku/d94NftoBNiC8EL4IBCnaiDpgIuIqyFiYAqmx7DZw==","mode":420,"size":1543},"dist/use-is-hydrated.js":{"checkedAt":1794532106681,"integrity":"sha512-HNnwfK2Pjq9U7gcrgq3BLu0/vk0rwwaJuk/AAdjs176qvxxmsH7HmTG3iGUGFPglTGyDiQejq2+r1Q/EzppqDg==","mode":420,"size":1621},"package.json":{"checkedAt":1794532106681,"integrity":"sha512-h4NzltUGexqBnXhVGBc/k575Woo8Mu4JmRt+ckSkFRIgXNbtsP7HVqnAjQDGaIhMvDvdI+dkpX+VYkrunxM2QA==","mode":420,"size":1277},"README.md":{"checkedAt":1794532106682,"integrity":"sha512-IUCuoLapVO58as2f7CevEzNrkduFg14Y7GKS3EBOZV0CHhxcyLoL2gojJVKqQ7rJKM/c9yNPWmWFJpfuXMSplA==","mode":420,"size":488},"dist/chunk-3XT5V4LF.mjs":{"checkedAt":1794532104187,"integrity":"sha512-WsGFGGqJUVIhQXYBYYsfkBht+p/jxaZ4sIdbnHJgoAKXWIoxv4wqMzpJNcLlPu1TUZ6Z1YvbcAtIHEJUk6WNoA==","mode":420,"size":785},"dist/chunk-6UBKM7F3.mjs":{"checkedAt":1794532104187,"integrity":"sha512-JhpanXqNNE+iq6VfiQDGqemH5E+40Q94EJ8cKMauEbpb5v69Af2M+k6OoaWcy+Iu68LAonRV6RzEAYddnOXr2A==","mode":420,"size":259},"dist/chunk-LL7CBZ2S.mjs":{"checkedAt":1794532106682,"integrity":"sha512-JwiQ9Jv5YDbMn4whp7AeKpDAJAEzJ8DmAAAneP7HedGgmkEOqCtUnWojD0+mp8FuTSupJETwO1QUJKWeux2XmQ==","mode":420,"size":694},"dist/chunk-RQNQ5XFG.mjs":{"checkedAt":1794532106682,"integrity":"sha512-aDsvn9BuwoSSaR+WO5hV9WojpdFrld82VnjNGXnBVoGopM1i3x+1QHpf1Jx98bmjO6Uavpy4BfoGjGKTAE/LtA==","mode":420,"size":3518},"dist/chunk-UX7UMZL5.mjs":{"checkedAt":1794532106682,"integrity":"sha512-mhPEzG+xLY+bhTJ2TDV7cSuInZ81N/Woz5Md9DSS1epowdoAZYE9f3uEYoH1aLtTZLkH/C7/06sINaBJIcZ3OA==","mode":420,"size":477},"dist/context.mjs":{"checkedAt":1794532104187,"integrity":"sha512-8Rshh1wTXb/+T+j+eJClaBpkxQVvcDfud52MAvNUZBHoablrVqopEH3NvpfA9oeKN9gsrGYY3alI2CaWlfFbxA==","mode":420,"size":98},"dist/dimensions.mjs":{"checkedAt":1794532106682,"integrity":"sha512-DBx4RkxZG3TUN42UM7k8UZI5moOcRjwX2VG8+ZkwSt7OCRsKBcbW11fivq4PLC+q65nWnKniO7SLvz8fmTzNxQ==","mode":420,"size":132},"dist/dom.mjs":{"checkedAt":1794532106682,"integrity":"sha512-upRO61zig465L4b1Ts6WhFZSKmgaWIIo67iK+46t4V31tZV4xF3NTaHkjxm+v++Wn8ByJ4Q21DMgU+9tADQv2w==","mode":420,"size":542},"dist/index.mjs":{"checkedAt":1794532106683,"integrity":"sha512-l+/RTchL8rnFMXfS8GGFAU52W8dK9/apM5L91pL5enmdw2Wz8xrBuK4u2by95li+NzsAfIKK6cfzMrmdzMB0QA==","mode":420,"size":1143},"dist/refs.mjs":{"checkedAt":1794532106683,"integrity":"sha512-VsJOd3VJ6DLVYkj4cKpzd+vxUzAPtyHX6wFUqFltTPROqTFUU3Fr0lAYwZ8GetMq48e7RSngEPCQ22jovFAr9Q==","mode":420,"size":116},"dist/use-is-hydrated.mjs":{"checkedAt":1794532104188,"integrity":"sha512-VGpDii9dqcPODF3qGml9ByWFj8olUoJsKl5cMXqrqjbluqmImmc5j11HpcvjJ4qAhu0U9B5Sd7nwylAjGlSZiA==","mode":420,"size":98},"dist/context.d.ts":{"checkedAt":1794532106683,"integrity":"sha512-L0ZvS6VLDNk0/2hx7lJ8XwOH7ex/TqdvE6Kmd1rL10mT9Z2fUuRqI2y0daQYXvE09umkaZyP2/SipMoYU3M8kQ==","mode":420,"size":806},"dist/dimensions.d.ts":{"checkedAt":1794532106683,"integrity":"sha512-s4N0ervBZQpXyJC1rF3BGVzR7E51sGURQMS5lI7yCADsBoWZvZoH3Tzk/vKo7HNHqDlRqC650/sOrYE1LlVI9A==","mode":420,"size":255},"dist/dom.d.ts":{"checkedAt":1794532106683,"integrity":"sha512-WEJIXHISG5y1QvJyGOjrRXwpjuVXU04aJlGosc8ESZiVYD79RV4cJCWPHsKZ/0er4nuPNVQnDAM0rEGzu9N8Tw==","mode":420,"size":2261},"dist/index.d.ts":{"checkedAt":1794532104189,"integrity":"sha512-e7K+578wdNz9vq9+exExrpKB+HNNJaz6B8ybQcwIqkPgls4CIirLeHQlrfWHBkwJnIfQQ3Z1mzaHvCx7JxQxCw==","mode":420,"size":757},"dist/refs.d.ts":{"checkedAt":1794532106683,"integrity":"sha512-3qmvlIao2KOXQB8m3tXClXA54hOf9Tx2o8/5//601qpva+HualOLtyFZzOpCxp1oDNHfnm6B4exWQybY/ktljA==","mode":420,"size":663},"dist/use-is-hydrated.d.ts":{"checkedAt":1794532104189,"integrity":"sha512-N56IzyRMpBz7IaXNnmJ/wIVRtXliqPYoJCkqrJLOR29+Ajz+YyBO4DhOumHZ8MTfPWkuuqvFyFd3W+6SFUVv1A==","mode":420,"size":485},"LICENSE":{"checkedAt":1794532106683,"integrity":"sha512-eaopHP+N4EYXlGoX9hmoxDPoVft4BqrXKmbsFTcsoBHSrJp/GWF4qVtLBzrw9h9ZrbFfPY69z+3RuDX9FdPG+Q==","mode":420,"size":1064}}}
@@ -0,0 +1 @@
{"version":3,"file":"hasPromiseValidation.d.ts","sourceRoot":"","sources":["../../src/logic/hasPromiseValidation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAY,MAAM,UAAU,CAAC;yBAMhC,gBAAgB,KAAK,CAAC,IAAI,CAAC;AAA3C,wBAWI"}
@@ -0,0 +1,147 @@
# bail
[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
Throw if given an error.
## Contents
* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`bail(err?)`](#bailerr)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)
## What is this?
This package throws a given error.
## When should I use this?
Use this package if you’re building some scripts that might theoretically get
errors but frequently don’t and you keep writing `if (error) throw error` over
and over again and you’re just really done with that.
## Install
This package is [ESM only][esm].
In Node.js (version 12.20+, 14.14+, or 16.0+), install with [npm][]:
```sh
npm install bail
```
In Deno with [Skypack][]:
```js
import {bail} from 'https://cdn.skypack.dev/bail@2?dts'
```
In browsers with [Skypack][]:
```html
<script type="module">
import {bail} from 'https://cdn.skypack.dev/bail@2?min'
</script>
```
## Use
```js
import {bail} from 'bail'
bail()
bail(new Error('failure'))
// Error: failure
// at repl:1:6
// at REPLServer.defaultEval (repl.js:154:27)
// …
```
## API
This package exports the following identifier: `bail`.
There is no default export.
### `bail(err?)`
Throw a given error (`Error?`).
## Types
This package is fully typed with [TypeScript][].
There are no extra exported types.
## Compatibility
This package is at least compatible with all maintained versions of Node.js.
As of now, that is Node.js 12.20+, 14.14+, and 16.0+.
It also works in Deno and modern browsers.
## Security
This package is safe.
## Related
* [`noop`][noop]
* [`noop2`][noop2]
* [`noop3`][noop3]
## Contribute
Yes please!
See [How to Contribute to Open Source][contribute].
## License
[MIT][license] © [Titus Wormer][author]
<!-- Definitions -->
[build-badge]: https://github.com/wooorm/bail/workflows/main/badge.svg
[build]: https://github.com/wooorm/bail/actions
[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/bail.svg
[coverage]: https://codecov.io/github/wooorm/bail
[downloads-badge]: https://img.shields.io/npm/dm/bail.svg
[downloads]: https://www.npmjs.com/package/bail
[size-badge]: https://img.shields.io/bundlephobia/minzip/bail.svg
[size]: https://bundlephobia.com/result?p=bail
[npm]: https://docs.npmjs.com/cli/install
[skypack]: https://www.skypack.dev
[license]: license
[author]: https://wooorm.com
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
[typescript]: https://www.typescriptlang.org
[contribute]: https://opensource.guide/how-to-contribute/
[noop]: https://www.npmjs.com/package/noop
[noop2]: https://www.npmjs.com/package/noop2
[noop3]: https://www.npmjs.com/package/noop3
@@ -0,0 +1,54 @@
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.mjs";
import {useState as $hQ5Hp$useState} from "react";
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
let $ef06256079686ba0$var$descriptionId = 0;
const $ef06256079686ba0$var$descriptionNodes = new Map();
function $ef06256079686ba0$export$f8aeda7b10753fa1(description) {
let [id, setId] = (0, $hQ5Hp$useState)();
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
if (!description) return;
let desc = $ef06256079686ba0$var$descriptionNodes.get(description);
if (!desc) {
let id = `react-aria-description-${$ef06256079686ba0$var$descriptionId++}`;
setId(id);
let node = document.createElement('div');
node.id = id;
node.style.display = 'none';
node.textContent = description;
document.body.appendChild(node);
desc = {
refCount: 0,
element: node
};
$ef06256079686ba0$var$descriptionNodes.set(description, desc);
} else setId(desc.element.id);
desc.refCount++;
return ()=>{
if (desc && --desc.refCount === 0) {
desc.element.remove();
$ef06256079686ba0$var$descriptionNodes.delete(description);
}
};
}, [
description
]);
return {
'aria-describedby': description ? id : undefined
};
}
export {$ef06256079686ba0$export$f8aeda7b10753fa1 as useDescription};
//# sourceMappingURL=useDescription.module.js.map
@@ -0,0 +1 @@
{"version":3,"names":["_core","require","_traverse","rewriteThisVisitor","rewriteThis","programPath","visitors","environmentVisitor","ThisExpression","path","replaceWith","t","unaryExpression","numericLiteral","noScope","traverse","node"],"sources":["../src/rewrite-this.ts"],"sourcesContent":["import { types as t } from \"@babel/core\";\nimport traverse, { visitors, type NodePath } from \"@babel/traverse\";\n\n/**\n * A lazily constructed visitor to walk the tree, rewriting all `this` references in the\n * top-level scope to be `void 0` (undefined).\n *\n */\nlet rewriteThisVisitor: Parameters<typeof traverse>[1];\n\nexport default function rewriteThis(programPath: NodePath) {\n if (!rewriteThisVisitor) {\n rewriteThisVisitor = visitors.environmentVisitor({\n ThisExpression(path) {\n path.replaceWith(t.unaryExpression(\"void\", t.numericLiteral(0), true));\n },\n });\n rewriteThisVisitor.noScope = true;\n }\n // Rewrite \"this\" to be \"undefined\".\n traverse(programPath.node, rewriteThisVisitor);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAOA,IAAIE,kBAAkD;AAEvC,SAASC,WAAWA,CAACC,WAAqB,EAAE;EACzD,IAAI,CAACF,kBAAkB,EAAE;IACvBA,kBAAkB,GAAGG,kBAAQ,CAACC,kBAAkB,CAAC;MAC/CC,cAAcA,CAACC,IAAI,EAAE;QACnBA,IAAI,CAACC,WAAW,CAACC,WAAC,CAACC,eAAe,CAAC,MAAM,EAAED,WAAC,CAACE,cAAc,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;MACxE;IACF,CAAC,CAAC;IACFV,kBAAkB,CAACW,OAAO,GAAG,IAAI;EACnC;EAEA,IAAAC,iBAAQ,EAACV,WAAW,CAACW,IAAI,EAAEb,kBAAkB,CAAC;AAChD","ignoreList":[]}
@@ -0,0 +1,6 @@
var async = require('./lib/async');
async.core = require('./lib/core');
async.isCore = require('./lib/is-core');
async.sync = require('./lib/sync');
module.exports = async;
@@ -0,0 +1,36 @@
import { Feature } from '../Feature.mjs';
let id = 0;
class ExitAnimationFeature extends Feature {
constructor() {
super(...arguments);
this.id = id++;
}
update() {
if (!this.node.presenceContext)
return;
const { isPresent, onExitComplete } = this.node.presenceContext;
const { isPresent: prevIsPresent } = this.node.prevPresenceContext || {};
if (!this.node.animationState || isPresent === prevIsPresent) {
return;
}
const exitAnimation = this.node.animationState.setActive("exit", !isPresent);
if (onExitComplete && !isPresent) {
exitAnimation.then(() => {
onExitComplete(this.id);
});
}
}
mount() {
const { register, onExitComplete } = this.node.presenceContext || {};
if (onExitComplete) {
onExitComplete(this.id);
}
if (register) {
this.unmount = register(this.id);
}
}
unmount() { }
}
export { ExitAnimationFeature };
@@ -0,0 +1,72 @@
var SetCache = require('./_SetCache'),
arrayIncludes = require('./_arrayIncludes'),
arrayIncludesWith = require('./_arrayIncludesWith'),
cacheHas = require('./_cacheHas'),
createSet = require('./_createSet'),
setToArray = require('./_setToArray');
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/**
* The base implementation of `_.uniqBy` without support for iteratee shorthands.
*
* @private
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The iteratee invoked per element.
* @param {Function} [comparator] The comparator invoked per element.
* @returns {Array} Returns the new duplicate free array.
*/
function baseUniq(array, iteratee, comparator) {
var index = -1,
includes = arrayIncludes,
length = array.length,
isCommon = true,
result = [],
seen = result;
if (comparator) {
isCommon = false;
includes = arrayIncludesWith;
}
else if (length >= LARGE_ARRAY_SIZE) {
var set = iteratee ? null : createSet(array);
if (set) {
return setToArray(set);
}
isCommon = false;
includes = cacheHas;
seen = new SetCache;
}
else {
seen = iteratee ? [] : result;
}
outer:
while (++index < length) {
var value = array[index],
computed = iteratee ? iteratee(value) : value;
value = (comparator || value !== 0) ? value : 0;
if (isCommon && computed === computed) {
var seenIndex = seen.length;
while (seenIndex--) {
if (seen[seenIndex] === computed) {
continue outer;
}
}
if (iteratee) {
seen.push(computed);
}
result.push(value);
}
else if (!includes(seen, computed, comparator)) {
if (seen !== result) {
seen.push(computed);
}
result.push(value);
}
}
return result;
}
module.exports = baseUniq;
@@ -0,0 +1,79 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
const util_js_1 = require("../../util.cjs");
/**
* Sets splits remaining `Spec.lines[].tokes.description` into `type` and `description`
* tokens and populates Spec.type`
*
* @param {Spacing} spacing tells how to deal with a whitespace
* for type values going over multiple lines
*/
function typeTokenizer(spacing = 'compact') {
const join = getJoiner(spacing);
return spec => {
let curlies = 0;
let lines = [];
for (const [i, {
tokens
}] of spec.source.entries()) {
let type = '';
if (i === 0 && tokens.description[0] !== '{') return spec;
for (const ch of tokens.description) {
if (ch === '{') curlies++;
if (ch === '}') curlies--;
type += ch;
if (curlies === 0) break;
}
lines.push([tokens, type]);
if (curlies === 0) break;
}
if (curlies !== 0) {
spec.problems.push({
code: 'spec:type:unpaired-curlies',
message: 'unpaired curlies',
line: spec.source[0].number,
critical: true
});
return spec;
}
const parts = [];
const offset = lines[0][0].postDelimiter.length;
for (const [i, [tokens, type]] of lines.entries()) {
tokens.type = type;
if (i > 0) {
tokens.type = tokens.postDelimiter.slice(offset) + type;
tokens.postDelimiter = tokens.postDelimiter.slice(0, offset);
}
[tokens.postType, tokens.description] = (0, util_js_1.splitSpace)(tokens.description.slice(type.length));
parts.push(tokens.type);
}
parts[0] = parts[0].slice(1);
parts[parts.length - 1] = parts[parts.length - 1].slice(0, -1);
spec.type = join(parts);
return spec;
};
}
exports.default = typeTokenizer;
const trim = x => x.trim();
function getJoiner(spacing) {
if (spacing === 'compact') return t => t.map(trim).join('');else if (spacing === 'preserve') return t => t.join('\n');else return spacing;
}
//# sourceMappingURL=type.cjs.map
@@ -0,0 +1 @@
{"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":";;;AAAA,mCAAqC;AAErC,IAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IAC3C,MAAM,EAAE,CAAC,SAAS,CAAC;IACnB,KAAK,EAAE;QACL,OAAO,EAAE,CAAC,GAAG,CAAC;KACf;CACF,CAAC,CAAC;AAEH,IAAM,OAAO,GAAG,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC;AAMxB,QAAA,OAAO,GAAY;IAC9B,GAAG,EAAE,OAAO,IAAI,OAAO,CAAC,GAAG,EAAE;CAC9B,CAAC"}
@@ -0,0 +1,5 @@
import pkgUp from './pkgUp';
declare function readPkgUp(opts?: Parameters<typeof pkgUp>[0]): {} | { pkg: string, path: string };
export default readPkgUp;
@@ -0,0 +1,4 @@
import type Settings from '../settings';
import type { ErrnoException, Stats } from '../types';
export declare type AsyncCallback = (error: ErrnoException, stats: Stats) => void;
export declare function read(path: string, settings: Settings, callback: AsyncCallback): void;
@@ -0,0 +1 @@
{"version":3,"names":["asyncGeneratorStep","gen","resolve","reject","_next","_throw","key","arg","info","value","error","done","Promise","then","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined"],"sources":["../../src/helpers/asyncToGenerator.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nfunction asyncGeneratorStep<TYield, TReturn>(\n gen: Generator<TYield, TReturn, Awaited<TYield>>,\n resolve: (value: TReturn) => void,\n reject: (error: unknown) => void,\n _next: (value: Awaited<TYield> | undefined) => void,\n _throw: (err: unknown) => void,\n key: \"next\",\n arg: Awaited<TYield> | undefined,\n): void;\nfunction asyncGeneratorStep<TYield, TReturn>(\n gen: Generator<TYield, TReturn, Awaited<TYield>>,\n resolve: (value: TReturn) => void,\n reject: (error: unknown) => void,\n _next: (value: Awaited<TYield> | undefined) => void,\n _throw: (err: unknown) => void,\n key: \"throw\",\n arg: unknown,\n): void;\nfunction asyncGeneratorStep<TYield, TReturn>(\n gen: Generator<TYield, TReturn, Awaited<TYield>>,\n resolve: (value: TReturn) => void,\n reject: (error: unknown) => void,\n _next: (value: Awaited<TYield> | undefined) => void,\n _throw: (err: unknown) => void,\n key: \"next\" | \"throw\",\n arg: any,\n): void {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n // The \"value\" variable is defined above before the \"info.done\" guard\n // So TypeScript can't narrowing \"value\" to TReturn here\n // If we use \"info.value\" here the type is narrowed correctly.\n // Still requires manual casting for the smaller bundle size.\n resolve(value as TReturn);\n } else {\n // Same as above, TypeScript can't narrow \"value\" to TYield here\n Promise.resolve(value as TYield).then(_next, _throw);\n }\n}\n\nexport default function _asyncToGenerator<\n This,\n Args extends unknown[],\n TYield,\n TReturn,\n>(\n fn: (\n this: This,\n ...args: Args\n ) => Generator<TYield, TReturn, Awaited<TYield>>,\n): (this: This, ...args: Args) => Promise<TReturn> {\n return function (this: any) {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n // Casting \"args\" to \"Args\" is intentional since we are trying to avoid the spread operator (not ES5)\n var gen = fn.apply(self, args as any as Args);\n function _next(value: Awaited<TYield> | undefined) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err: unknown) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}\n"],"mappings":";;;;;;AAoBA,SAASA,kBAAkBA,CACzBC,GAAgD,EAChDC,OAAiC,EACjCC,MAAgC,EAChCC,KAAmD,EACnDC,MAA8B,EAC9BC,GAAqB,EACrBC,GAAQ,EACF;EACN,IAAI;IACF,IAAIC,IAAI,GAAGP,GAAG,CAACK,GAAG,CAAC,CAACC,GAAG,CAAC;IACxB,IAAIE,KAAK,GAAGD,IAAI,CAACC,KAAK;EACxB,CAAC,CAAC,OAAOC,KAAK,EAAE;IACdP,MAAM,CAACO,KAAK,CAAC;IACb;EACF;EAEA,IAAIF,IAAI,CAACG,IAAI,EAAE;IAKbT,OAAO,CAACO,KAAgB,CAAC;EAC3B,CAAC,MAAM;IAELG,OAAO,CAACV,OAAO,CAACO,KAAe,CAAC,CAACI,IAAI,CAACT,KAAK,EAAEC,MAAM,CAAC;EACtD;AACF;AAEe,SAASS,iBAAiBA,CAMvCC,EAGgD,EACC;EACjD,OAAO,YAAqB;IAC1B,IAAIC,IAAI,GAAG,IAAI;MACbC,IAAI,GAAGC,SAAS;IAClB,OAAO,IAAIN,OAAO,CAAC,UAAUV,OAAO,EAAEC,MAAM,EAAE;MAE5C,IAAIF,GAAG,GAAGc,EAAE,CAACI,KAAK,CAACH,IAAI,EAAEC,IAAmB,CAAC;MAC7C,SAASb,KAAKA,CAACK,KAAkC,EAAE;QACjDT,kBAAkB,CAACC,GAAG,EAAEC,OAAO,EAAEC,MAAM,EAAEC,KAAK,EAAEC,MAAM,EAAE,MAAM,EAAEI,KAAK,CAAC;MACxE;MACA,SAASJ,MAAMA,CAACe,GAAY,EAAE;QAC5BpB,kBAAkB,CAACC,GAAG,EAAEC,OAAO,EAAEC,MAAM,EAAEC,KAAK,EAAEC,MAAM,EAAE,OAAO,EAAEe,GAAG,CAAC;MACvE;MAEAhB,KAAK,CAACiB,SAAS,CAAC;IAClB,CAAC,CAAC;EACJ,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var ImageMapRole = {
relatedConcepts: [{
module: 'HTML',
concept: {
name: 'img',
attributes: [{
name: 'usemap'
}]
}
}],
type: 'structure'
};
var _default = ImageMapRole;
exports.default = _default;
@@ -0,0 +1,824 @@
flf2a$ 8 7 20 -1 7
MARQUEE by Ron Fritz 8/94
Figlet Release 2.0
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
.::@
.::@
.::@
.: @
.: @
@
.::@
@@
.: .:@
.: .:@
@
@
@
@
@
@@
@
.:: .:: @
.:::::::.::::@
.:: .:: @
.:: .:: @
.:::::::.::::@
.:: .:: @
@@
.:: @
.: .:: @
.:: @
.:: @
.:: @
.:: .:: @
.:: @
@@
@
.:: .::@
.:: @
.:: @
.:: @
.:: @
.:: .:: @
@@
.: @
.:: .::@
.:: @
.::: @
.:: @
.:: .::@
.: @
@@
.::@
.:@
@
@
@
@
@
@@
.::@
.:: @
.:: @
.:: @
.:: @
.:: @
.::@
@@
.:: @
.:: @
.::@
.::@
.::@
.:: @
.:: @
@@
.:: @
.:: .:: .::@
.: .: .:: @
.:::: .:::::::@
.: .: .:: @
.:: .:: .::@
.:: @
@@
@
.:: @
.:: @
.:::.:::::@
.:: @
.:: @
@
@@
@
@
@
@
@
@
.::@
.:@@
@
@
@
.:::::@
@
@
@
@@
@
@
@
@
@
@
.::@
@@
.::@
.:: @
.:: @
.:: @
.:: @
.:: @
.:: @
@@
@
.:: @
.:: .:: @
.:: .:: @
.:: .::@
.:: .:: @
.::: @
@@
@
.:: @
.:: @
.:: @
.:: @
.:: @
.::::@
@@
@
.:::.: @
.: .:@
.:: @
.:: @
.:: @
.:::::::@
@@
@
.:: .:: @
.:: @
.:: @
::. @
:::.@
.:::::: @
@@
@
.:: @
. .:: @
.: .:: @
.:: .:: @
.:::: .: .::@
.:: @
@@
@
.:: .::: @
.:: @
.::: @
.:: @
.::@
.::: .:: @
@@
@
.:: @
.:: @
.:: @
.: .:: @
.:: .:: @
.:: .:: @
@@
@
.::::: .::@
.:: @
.:: @
.:: @
.:: @
.:: @
@@
@
.: @
.:: .:: @
.:: .: @
.:: .: @
.:: .::@
.:::: @
@@
@
.: .:: @
.:: .::@
.: .::@
.: .:: @
.:: @
.:: @
@@
@
@
@
@
.::@
@
.::@
@@
@
@
@
@
.::@
@
.::@
.:@@
.::@
.:: @
.:: @
.:: @
.:: @
.:: @
.::@
@@
@
@
.::::::@
@
.::::::@
@
@
@@
.:: @
.:: @
.:: @
.::@
.:: @
.:: @
.:: @
@@
.::: @
.:: @
.::@
.:: @
.:: @
@
.:: @
@@
@
.::: @
.: .:: @
.: .:: .::@
.:: .::. .::@
.:: ``` @
.:: @
@@
.: @
.: :: @
.: .:: @
.:: .:: @
.:::::: .:: @
.:: .:: @
.:: .::@
@@
.:: .:: @
.: .:: @
.: .::@
.::: .: @
.: .::@
.: .:@
.:::: .:: @
@@
.:: @
.:: .::@
.:: @
.:: @
.:: @
.:: .::@
.:::: @
@@
.::::: @
.:: .:: @
.:: .::@
.:: .::@
.:: .::@
.:: .:: @
.::::: @
@@
.::::::::@
.:: @
.:: @
.:::::: @
.:: @
.:: @
.::::::::@
@@
.::::::::@
.:: @
.:: @
.:::::: @
.:: @
.:: @
.:: @
@@
.:::: @
.: .:: @
.:: @
.:: @
.:: .::::@
.:: .: @
.::::: @
@@
.:: .::@
.:: .::@
.:: .::@
.:::::: .::@
.:: .::@
.:: .::@
.:: .::@
@@
.::@
.::@
.::@
.::@
.::@
.::@
.::@
@@
.::@
.::@
.::@
.::@
.::@
.: .::@
.:::: @
@@
.:: .:: @
.:: .:: @
.:: .:: @
.: .: @
.:: .:: @
.:: .:: @
.:: .::@
@@
.:: @
.:: @
.:: @
.:: @
.:: @
.:: @
.::::::::@
@@
.:: .::@
.: .:: .:::@
.:: .:: . .::@
.:: .:: .::@
.:: .: .::@
.:: .::@
.:: .::@
@@
.::: .::@
.: .:: .::@
.:: .:: .::@
.:: .:: .::@
.:: .: .::@
.:: .: ::@
.:: .::@
@@
.:::: @
.:: .:: @
.:: .::@
.:: .::@
.:: .::@
.:: .:: @
.:::: @
@@
.::::::: @
.:: .::@
.:: .::@
.::::::: @
.:: @
.:: @
.:: @
@@
.:::: @
.:: .:: @
.:: .::@
.:: .::@
.:: .::@
.:: .: .:: @
.:: :: @
.: @@
.::::::: @
.:: .:: @
.:: .:: @
.: .:: @
.:: .:: @
.:: .:: @
.:: .::@
@@
.:: :: @
.:: .::@
.:: @
.:: @
.:: @
.:: .::@
.:: :: @
@@
.::: .::::::@
.:: @
.:: @
.:: @
.:: @
.:: @
.:: @
@@
.:: .::@
.:: .::@
.:: .::@
.:: .::@
.:: .::@
.:: .::@
.::::: @
@@
.:: .::@
.:: .:: @
.:: .:: @
.:: .:: @
.:: .:: @
.:::: @
.:: @
@@
.:: .::@
.:: .::@
.:: .: .::@
.:: .:: .::@
.:: .: .:: .::@
.: .: .::::@
.:: .::@
@@
.:: .::@
.:: .:: @
.:: .:: @
.:: @
.:: .:: @
.:: .:: @
.:: .::@
@@
.:: .::@
.:: .:: @
.:: .:: @
.:: @
.:: @
.:: @
.:: @
@@
.::::::: .::@
.:: @
.:: @
.:: @
.:: @
.:: @
.:::::::::::@
@@
.::::@
.:: @
.:: @
.:: @
.:: @
.:: @
.::::@
@@
.:: @
.:: @
.:: @
.:: @
.:: @
.:: @
.::@
@@
.::::@
.::@
.::@
.::@
.::@
.::@
.::::@
@@
.:: @
.:: .:: @
.:: .::@
@
@
@
@
@@
@
@
@
@
@
@
@
.:::::@@
.::@
.: @
@
@
@
@
@
@@
@
@
.:: @
.:: .:: @
.:: .:: @
.:: .:: @
.:: .:::@
@@
.:: @
.:: @
.:: @
.:: .:: @
.:: .::@
.:: .::@
.:: .:: @
@@
@
@
.:::@
.:: @
.:: @
.:: @
.:::@
@@
.::@
.::@
.::@
.:: .::@
.: .::@
.: .::@
.:: .::@
@@
@
@
.:: @
.: .:: @
.::::: .::@
.: @
.:::: @
@@
.::@
.: @
.:.: .:@
.:: @
.:: @
.:: @
.:: @
@@
@
@
.:: @
.:: .::@
.:: .::@
.:: .::@
.:: @
.:: @@
@
.:: @
.:: @
.: .: @
.:: .::@
.: .::@
.:: .::@
@@
@
.:@
@
.::@
.::@
.::@
.::@
@@
@
.::@
@
.::@
.::@
.::@
.::@
.::: @@
.:: @
.:: @
.:: .::@
.:: .:: @
.:.:: @
.:: .:: @
.:: .::@
@@
.::@
.::@
.::@
.::@
.::@
.::@
.:::@
@@
@
@
.::: .:: .:: @
.:: .: .::@
.:: .: .::@
.:: .: .::@
.::: .: .::@
@@
@
@
.:: .:: @
.:: .::@
.:: .::@
.:: .::@
.::: .::@
@@
@
@
.:: @
.:: .:: @
.:: .::@
.:: .:: @
.:: @
@@
@
@
.: .:: @
.: .:: @
.: .::@
.:: .:: @
.:: @
.:: @@
@
@
.:: @
.: .:: @
.: .:: @
.::.:: @
.:: @
.:::@@
@
@
.: .:::@
.:: @
.:: @
.:: @
.::: @
@@
@
@
.:::: @
.:: @
.::: @
.::@
.:: .::@
@@
.:: @
.:: @
.:.: .:@
.:: @
.:: @
.:: @
.:: @
@@
@
@
.:: .::@
.:: .::@
.:: .::@
.:: .::@
.::.::@
@@
@
@
.:: .::@
.:: .:: @
.:: .:: @
.:.:: @
.:: @
@@
@
@
.:: .:::@
.:: : .::@
.:: .: .::@
.: .: .:.::@
.::: .:::@
@@
@
@
.:: .::@
.: .:: @
.: @
.: .:: @
.:: .::@
@@
@
@
.:: .::@
.:: .:: @
.::: @
.:: @
.:: @
.:: @@
@
@
.:::: .::@
.:: @
.:: @
.:: @
.::::::::@
@@
.::@
.:: @
.:: @
.:: @
.:: @
.:: @
.::@
@@
.:@
.:@
.:@
@
.:@
.:@
.:@
@@
.:: @
.:: @
.:: @
.::@
.:: @
.:: @
.:: @
@@
.:: .: @
.: .::@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@@ -0,0 +1,61 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {DOMAttributes} from '@react-types/shared';
import {ReactNode} from 'react';
import {useId} from '@react-aria/utils';
export interface AriaMenuSectionProps {
/** The heading for the section. */
heading?: ReactNode,
/** An accessibility label for the section. Required if `heading` is not present. */
'aria-label'?: string
}
export interface MenuSectionAria {
/** Props for the wrapper list item. */
itemProps: DOMAttributes,
/** Props for the heading element, if any. */
headingProps: DOMAttributes,
/** Props for the group element. */
groupProps: DOMAttributes
}
/**
* Provides the behavior and accessibility implementation for a section in a menu.
* See `useMenu` for more details about menus.
* @param props - Props for the section.
*/
export function useMenuSection(props: AriaMenuSectionProps): MenuSectionAria {
let {heading, 'aria-label': ariaLabel} = props;
let headingId = useId();
return {
itemProps: {
role: 'presentation'
},
headingProps: heading ? {
// Techincally, menus cannot contain headings according to ARIA.
// We hide the heading from assistive technology, using role="presentation",
// and only use it as a label for the nested group.
id: headingId,
role: 'presentation'
} : {},
groupProps: {
role: 'group',
'aria-label': ariaLabel,
'aria-labelledby': heading ? headingId : undefined
}
};
}
@@ -0,0 +1,7 @@
#!/bin/sh
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
emacs --no-site-file --no-init-file --batch \
--load ert.el --load gyp.el --load gyp-tests.el \
-f ert-run-tests-batch-and-exit
@@ -0,0 +1,33 @@
import type { TAny } from '../any/index.mjs';
import type { TArray } from '../array/index.mjs';
import type { TAsyncIterator } from '../async-iterator/index.mjs';
import type { TBigInt } from '../bigint/index.mjs';
import type { TBoolean } from '../boolean/index.mjs';
import type { TConstructor } from '../constructor/index.mjs';
import type { TDate } from '../date/index.mjs';
import type { TEnum } from '../enum/index.mjs';
import type { TFunction } from '../function/index.mjs';
import type { TInteger } from '../integer/index.mjs';
import type { TIntersect } from '../intersect/index.mjs';
import type { TIterator } from '../iterator/index.mjs';
import type { TLiteral } from '../literal/index.mjs';
import type { TNot } from '../not/index.mjs';
import type { TNull } from '../null/index.mjs';
import type { TNumber } from '../number/index.mjs';
import type { TObject } from '../object/index.mjs';
import type { TPromise } from '../promise/index.mjs';
import type { TRecord } from '../record/index.mjs';
import type { TThis } from '../recursive/index.mjs';
import type { TRef } from '../ref/index.mjs';
import type { TRegExp } from '../regexp/index.mjs';
import type { TString } from '../string/index.mjs';
import type { TSymbol } from '../symbol/index.mjs';
import type { TTemplateLiteral } from '../template-literal/index.mjs';
import type { TTuple } from '../tuple/index.mjs';
import type { TUint8Array } from '../uint8array/index.mjs';
import type { TUndefined } from '../undefined/index.mjs';
import type { TUnion } from '../union/index.mjs';
import type { TUnknown } from '../unknown/index.mjs';
import type { TVoid } from '../void/index.mjs';
import type { TSchema } from './schema.mjs';
export type TAnySchema = TSchema | TAny | TArray | TAsyncIterator | TBigInt | TBoolean | TConstructor | TDate | TEnum | TFunction | TInteger | TIntersect | TIterator | TLiteral | TNot | TNull | TNumber | TObject | TPromise | TRecord | TRef | TRegExp | TString | TSymbol | TTemplateLiteral | TThis | TTuple | TUndefined | TUnion | TUint8Array | TUnknown | TVoid;
@@ -0,0 +1,60 @@
/**
* Parses the object into css, scoped, blocks
* @param {Object} obj
* @param {String} selector
* @param {String} wrapper
*/
export let parse = (obj, selector) => {
let outer = '';
let blocks = '';
let current = '';
for (let key in obj) {
let val = obj[key];
if (key[0] == '@') {
// If these are the `@` rule
if (key[1] == 'i') {
// Handling the `@import`
outer = key + ' ' + val + ';';
} else if (key[1] == 'f') {
// Handling the `@font-face` where the
// block doesn't need the brackets wrapped
blocks += parse(val, key);
} else {
// Regular at rule block
blocks += key + '{' + parse(val, key[1] == 'k' ? '' : selector) + '}';
}
} else if (typeof val == 'object') {
// Call the parse for this block
blocks += parse(
val,
selector
? // Go over the selector and replace the matching multiple selectors if any
selector.replace(/([^,])+/g, (sel) => {
// Return the current selector with the key matching multiple selectors if any
return key.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g, (k) => {
// If the current `k`(key) has a nested selector replace it
if (/&/.test(k)) return k.replace(/&/g, sel);
// If there's a current selector concat it
return sel ? sel + ' ' + k : k;
});
})
: key
);
} else if (val != undefined) {
// Convert all but CSS variables
key = /^--/.test(key) ? key : key.replace(/[A-Z]/g, '-$&').toLowerCase();
// Push the line for this property
current += parse.p
? // We have a prefixer and we need to run this through that
parse.p(key, val)
: // Nope no prefixer just append it
key + ':' + val + ';';
}
}
// If we have properties apply standard rule composition
return outer + (selector && current ? selector + '{' + current + '}' : current) + blocks;
};
@@ -0,0 +1,51 @@
import tslib from '../tslib.js';
const {
__extends,
__assign,
__rest,
__decorate,
__param,
__metadata,
__awaiter,
__generator,
__exportStar,
__createBinding,
__values,
__read,
__spread,
__spreadArrays,
__await,
__asyncGenerator,
__asyncDelegator,
__asyncValues,
__makeTemplateObject,
__importStar,
__importDefault,
__classPrivateFieldGet,
__classPrivateFieldSet,
} = tslib;
export {
__extends,
__assign,
__rest,
__decorate,
__param,
__metadata,
__awaiter,
__generator,
__exportStar,
__createBinding,
__values,
__read,
__spread,
__spreadArrays,
__await,
__asyncGenerator,
__asyncDelegator,
__asyncValues,
__makeTemplateObject,
__importStar,
__importDefault,
__classPrivateFieldGet,
__classPrivateFieldSet,
};
@@ -0,0 +1,19 @@
{
"root": true,
"extends": "@ljharb",
"rules": {
"array-bracket-newline": 0,
},
"overrides": [
{
"files": "example/**",
"rules": {
"no-buffer-constructor": 0,
"no-console": 0,
},
},
],
}
@@ -0,0 +1 @@
{"name":"triple-beam","version":"1.4.1","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532101490,"integrity":"sha512-7yKEq2P934XleZw5FWZubNEVjhg5LkQG7eFQ4ckHhlZeBmkwkBCwyyakmhW65AdEh4Zg5PlCJzCTojnH8IoEAA==","mode":420,"size":1066},"config/cli.js":{"checkedAt":1794532101490,"integrity":"sha512-jEbGpIW3x7ffqUB5MGtIQp+p6R8aHcv9eWBcNEJuNjEDSBvjMWwZMYDqKI9sM2RJofT02xx0WxQEObHpvfhngQ==","mode":420,"size":616},"config/index.js":{"checkedAt":1794532101491,"integrity":"sha512-BGI7iWgUWBWk1ZFX+HeB7YP3WVkSLlEWW3ffEdyzSJ8hs/6jTzJ4nTMg/6nyQg7EK33fSDLeWKxet9pOk4eM0w==","mode":420,"size":538},"index.js":{"checkedAt":1794532101491,"integrity":"sha512-KQTJE/gtaovTh1dWPRdVxvc0dfDShXeSBJCZ5p6lhxL6c0ScYbr6gTPjkeEBY4F4INv6FczST4pfz5QKzHWhpA==","mode":420,"size":1065},"config/npm.js":{"checkedAt":1794532101491,"integrity":"sha512-1LH483xbwYUkD7Mvc4QpLXIw08btWLSRU2NPiPWh/OCVIajYj+VxJYe7Gc3NctFaSUhkGKEGgBaXq7tM/gn38Q==","mode":420,"size":516},"config/syslog.js":{"checkedAt":1794532101491,"integrity":"sha512-sFBkVLBx1li8sZOnQOp75CRPw7mooVlKzGCVB/gj2ABVp9JM61NMPuyUV7Xe9UHS4R7HSlXuglDZ4PXgwn7Wfw==","mode":420,"size":556},".nyc_output/c579bf8f-6820-47a5-b2da-a11267eb8435.json":{"checkedAt":1794532101491,"integrity":"sha512-yBSgFZYZQSZNAT0rxYE/iWEespPh5MWRuMQCmO+5NKSOfSFHFPTZ/5liPhVuDBhamuQM0nAOppeKR2mF0BFDBw==","mode":420,"size":2657},".nyc_output/processinfo/c579bf8f-6820-47a5-b2da-a11267eb8435.json":{"checkedAt":1794532101491,"integrity":"sha512-GU3DxJj9+TYyOuvpVa77JHER3kdzxaSIRt6JOQvE7rTgxZTNDZ985IrBWNRHvH10sw0Rsj6MxGzZldI/Nr2Btw==","mode":420,"size":598},".nyc_output/processinfo/index.json":{"checkedAt":1794532101492,"integrity":"sha512-hYOEZJuhRPYrpd5cwwrS45EgTNM/eeU2wRN+EztcZKybN1Hmwgyfn7bMuGj/xI1qxi1rRkyLu4u/iDuGXZ+Xnw==","mode":420,"size":516},"package.json":{"checkedAt":1794532101492,"integrity":"sha512-/K6eiTTQLYbR3nxy3ZxRJL0lJor7ksjtLPnSmKO3YUn9b/JDVousxOjxMXMV4NLei3QYxCwxoulNMJnxYiNn4w==","mode":420,"size":1029},"CHANGELOG.md":{"checkedAt":1794532101492,"integrity":"sha512-XxJoyucK+y9BiPxVaaEI2L3p/RRNrhOCcKFpQWSksu/PY8MFN2/xkQHaFPAg0gsV454n2uOsAecilfgpv0Xfmw==","mode":420,"size":374},"README.md":{"checkedAt":1794532101492,"integrity":"sha512-a42NykP8SQDYd9PZ3ke2dYAfITGQ+PROciQ0W5BiW+zAnIzrOVGWqqgbCGdTnPfgAHNoUMkBrCrOI6BaoZMbow==","mode":420,"size":689}}}
@@ -0,0 +1,327 @@
/* eslint-disable jsdoc/valid-types -- doesn't allow `readonly`.
TODO: remove eslint-disable when https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/164 is fixed
*/
/**
* @typedef {{ readonly [type: string]: ReadonlyArray<string> }} VisitorKeys
*/
/* eslint-enable jsdoc/valid-types -- doesn't allow `readonly string[]`. TODO: check why */
/**
* @type {VisitorKeys}
*/
const KEYS = {
ArrayExpression: [
"elements"
],
ArrayPattern: [
"elements"
],
ArrowFunctionExpression: [
"params",
"body"
],
AssignmentExpression: [
"left",
"right"
],
AssignmentPattern: [
"left",
"right"
],
AwaitExpression: [
"argument"
],
BinaryExpression: [
"left",
"right"
],
BlockStatement: [
"body"
],
BreakStatement: [
"label"
],
CallExpression: [
"callee",
"arguments"
],
CatchClause: [
"param",
"body"
],
ChainExpression: [
"expression"
],
ClassBody: [
"body"
],
ClassDeclaration: [
"id",
"superClass",
"body"
],
ClassExpression: [
"id",
"superClass",
"body"
],
ConditionalExpression: [
"test",
"consequent",
"alternate"
],
ContinueStatement: [
"label"
],
DebuggerStatement: [],
DoWhileStatement: [
"body",
"test"
],
EmptyStatement: [],
ExperimentalRestProperty: [
"argument"
],
ExperimentalSpreadProperty: [
"argument"
],
ExportAllDeclaration: [
"exported",
"source",
"attributes"
],
ExportDefaultDeclaration: [
"declaration"
],
ExportNamedDeclaration: [
"declaration",
"specifiers",
"source",
"attributes"
],
ExportSpecifier: [
"local",
"exported"
],
ExpressionStatement: [
"expression"
],
ForInStatement: [
"left",
"right",
"body"
],
ForOfStatement: [
"left",
"right",
"body"
],
ForStatement: [
"init",
"test",
"update",
"body"
],
FunctionDeclaration: [
"id",
"params",
"body"
],
FunctionExpression: [
"id",
"params",
"body"
],
Identifier: [],
IfStatement: [
"test",
"consequent",
"alternate"
],
ImportAttribute: [
"key",
"value"
],
ImportDeclaration: [
"specifiers",
"source",
"attributes"
],
ImportDefaultSpecifier: [
"local"
],
ImportExpression: [
"source",
"options"
],
ImportNamespaceSpecifier: [
"local"
],
ImportSpecifier: [
"imported",
"local"
],
JSXAttribute: [
"name",
"value"
],
JSXClosingElement: [
"name"
],
JSXClosingFragment: [],
JSXElement: [
"openingElement",
"children",
"closingElement"
],
JSXEmptyExpression: [],
JSXExpressionContainer: [
"expression"
],
JSXFragment: [
"openingFragment",
"children",
"closingFragment"
],
JSXIdentifier: [],
JSXMemberExpression: [
"object",
"property"
],
JSXNamespacedName: [
"namespace",
"name"
],
JSXOpeningElement: [
"name",
"attributes"
],
JSXOpeningFragment: [],
JSXSpreadAttribute: [
"argument"
],
JSXSpreadChild: [
"expression"
],
JSXText: [],
LabeledStatement: [
"label",
"body"
],
Literal: [],
LogicalExpression: [
"left",
"right"
],
MemberExpression: [
"object",
"property"
],
MetaProperty: [
"meta",
"property"
],
MethodDefinition: [
"key",
"value"
],
NewExpression: [
"callee",
"arguments"
],
ObjectExpression: [
"properties"
],
ObjectPattern: [
"properties"
],
PrivateIdentifier: [],
Program: [
"body"
],
Property: [
"key",
"value"
],
PropertyDefinition: [
"key",
"value"
],
RestElement: [
"argument"
],
ReturnStatement: [
"argument"
],
SequenceExpression: [
"expressions"
],
SpreadElement: [
"argument"
],
StaticBlock: [
"body"
],
Super: [],
SwitchCase: [
"test",
"consequent"
],
SwitchStatement: [
"discriminant",
"cases"
],
TaggedTemplateExpression: [
"tag",
"quasi"
],
TemplateElement: [],
TemplateLiteral: [
"quasis",
"expressions"
],
ThisExpression: [],
ThrowStatement: [
"argument"
],
TryStatement: [
"block",
"handler",
"finalizer"
],
UnaryExpression: [
"argument"
],
UpdateExpression: [
"argument"
],
VariableDeclaration: [
"declarations"
],
VariableDeclarator: [
"id",
"init"
],
WhileStatement: [
"test",
"body"
],
WithStatement: [
"object",
"body"
],
YieldExpression: [
"argument"
]
};
// Types.
const NODE_TYPES = Object.keys(KEYS);
// Freeze the keys.
for (const type of NODE_TYPES) {
Object.freeze(KEYS[type]);
}
Object.freeze(KEYS);
export default KEYS;
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=resolveInstanceBindingNodeAsyncFromConstructorParams.spec.d.ts.map
@@ -0,0 +1,14 @@
function shallowCompare(next, prev) {
if (!Array.isArray(prev))
return false;
const prevLength = prev.length;
if (prevLength !== next.length)
return false;
for (let i = 0; i < prevLength; i++) {
if (prev[i] !== next[i])
return false;
}
return true;
}
export { shallowCompare };
@@ -0,0 +1,32 @@
var arrayLikeKeys = require('./_arrayLikeKeys'),
baseKeysIn = require('./_baseKeysIn'),
isArrayLike = require('./isArrayLike');
/**
* Creates an array of the own and inherited enumerable property names of `object`.
*
* **Note:** Non-object values are coerced to objects.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Object
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
* @example
*
* function Foo() {
* this.a = 1;
* this.b = 2;
* }
*
* Foo.prototype.c = 3;
*
* _.keysIn(new Foo);
* // => ['a', 'b', 'c'] (iteration order is not guaranteed)
*/
function keysIn(object) {
return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
}
module.exports = keysIn;
@@ -0,0 +1,133 @@
'use strict'
let pico = require('picocolors')
let terminalHighlight = require('./terminal-highlight')
class CssSyntaxError extends Error {
constructor(message, line, column, source, file, plugin) {
super(message)
this.name = 'CssSyntaxError'
this.reason = message
if (file) {
this.file = file
}
if (source) {
this.source = source
}
if (plugin) {
this.plugin = plugin
}
if (typeof line !== 'undefined' && typeof column !== 'undefined') {
if (typeof line === 'number') {
this.line = line
this.column = column
} else {
this.line = line.line
this.column = line.column
this.endLine = column.line
this.endColumn = column.column
}
}
this.setMessage()
if (Error.captureStackTrace) {
Error.captureStackTrace(this, CssSyntaxError)
}
}
setMessage() {
this.message = this.plugin ? this.plugin + ': ' : ''
this.message += this.file ? this.file : '<css input>'
if (typeof this.line !== 'undefined') {
this.message += ':' + this.line + ':' + this.column
}
this.message += ': ' + this.reason
}
showSourceCode(color) {
if (!this.source) return ''
let css = this.source
if (color == null) color = pico.isColorSupported
let aside = text => text
let mark = text => text
let highlight = text => text
if (color) {
let { bold, gray, red } = pico.createColors(true)
mark = text => bold(red(text))
aside = text => gray(text)
if (terminalHighlight) {
highlight = text => terminalHighlight(text)
}
}
let lines = css.split(/\r?\n/)
let start = Math.max(this.line - 3, 0)
let end = Math.min(this.line + 2, lines.length)
let maxWidth = String(end).length
return lines
.slice(start, end)
.map((line, index) => {
let number = start + 1 + index
let gutter = ' ' + (' ' + number).slice(-maxWidth) + ' | '
if (number === this.line) {
if (line.length > 160) {
let padding = 20
let subLineStart = Math.max(0, this.column - padding)
let subLineEnd = Math.max(
this.column + padding,
this.endColumn + padding
)
let subLine = line.slice(subLineStart, subLineEnd)
let spacing =
aside(gutter.replace(/\d/g, ' ')) +
line
.slice(0, Math.min(this.column - 1, padding - 1))
.replace(/[^\t]/g, ' ')
return (
mark('>') +
aside(gutter) +
highlight(subLine) +
'\n ' +
spacing +
mark('^')
)
}
let spacing =
aside(gutter.replace(/\d/g, ' ')) +
line.slice(0, this.column - 1).replace(/[^\t]/g, ' ')
return (
mark('>') +
aside(gutter) +
highlight(line) +
'\n ' +
spacing +
mark('^')
)
}
return ' ' + aside(gutter) + highlight(line)
})
.join('\n')
}
toString() {
let code = this.showSourceCode()
if (code) {
code = '\n\n' + code + '\n'
}
return this.name + ': ' + this.message + code
}
}
module.exports = CssSyntaxError
CssSyntaxError.default = CssSyntaxError
@@ -0,0 +1,155 @@
'use strict';
/* (c) 2015 Ari Porad (@ariporad) <http://ariporad.com>. License: ariporad.mit-license.org */
const BuiltinModule = require('module');
const path = require('path');
const nodeModulesRegex = /^(?:.*[\\/])?node_modules(?:[\\/].*)?$/;
// Guard against poorly-mocked module constructors.
const Module =
module.constructor.length > 1 ? module.constructor : BuiltinModule;
const HOOK_RETURNED_NOTHING_ERROR_MESSAGE =
'[Pirates] A hook returned a non-string, or nothing at all! This is a' +
' violation of intergalactic law!\n' +
'--------------------\n' +
'If you have no idea what this means or what Pirates is, let me explain: ' +
'Pirates is a module that makes it easy to implement require hooks. One of' +
" the require hooks you're using uses it. One of these require hooks" +
" didn't return anything from it's handler, so we don't know what to" +
' do. You might want to debug this.';
/**
* @param {string} filename The filename to check.
* @param {string[]} exts The extensions to hook. Should start with '.' (ex. ['.js']).
* @param {Matcher|null} matcher A matcher function, will be called with path to a file. Should return truthy if the file should be hooked, falsy otherwise.
* @param {boolean} ignoreNodeModules Auto-ignore node_modules. Independent of any matcher.
*/
function shouldCompile(filename, exts, matcher, ignoreNodeModules) {
if (typeof filename !== 'string') {
return false;
}
if (exts.indexOf(path.extname(filename)) === -1) {
return false;
}
const resolvedFilename = path.resolve(filename);
if (ignoreNodeModules && nodeModulesRegex.test(resolvedFilename)) {
return false;
}
if (matcher && typeof matcher === 'function') {
return !!matcher(resolvedFilename);
}
return true;
}
/**
* @callback Hook The hook. Accepts the code of the module and the filename.
* @param {string} code
* @param {string} filename
* @returns {string}
*/
/**
* @callback Matcher A matcher function, will be called with path to a file.
*
* Should return truthy if the file should be hooked, falsy otherwise.
* @param {string} path
* @returns {boolean}
*/
/**
* @callback RevertFunction Reverts the hook when called.
* @returns {void}
*/
/**
* @typedef {object} Options
* @property {Matcher|null} [matcher=null] A matcher function, will be called with path to a file.
*
* Should return truthy if the file should be hooked, falsy otherwise.
*
* @property {string[]} [extensions=['.js']] The extensions to hook. Should start with '.' (ex. ['.js']).
* @property {string[]} [exts=['.js']] The extensions to hook. Should start with '.' (ex. ['.js']).
*
* @property {string[]} [extension=['.js']] The extensions to hook. Should start with '.' (ex. ['.js']).
* @property {string[]} [ext=['.js']] The extensions to hook. Should start with '.' (ex. ['.js']).
*
* @property {boolean} [ignoreNodeModules=true] Auto-ignore node_modules. Independent of any matcher.
*/
/**
* Add a require hook.
*
* @param {Hook} hook The hook. Accepts the code of the module and the filename. Required.
* @param {Options} [opts] Options
* @returns {RevertFunction} The `revert` function. Reverts the hook when called.
*/
function addHook(hook, opts = {}) {
let reverted = false;
const loaders = [];
const oldLoaders = [];
let exts;
// We need to do this to fix #15. Basically, if you use a non-standard extension (ie. .jsx), then
// We modify the .js loader, then use the modified .js loader for as the base for .jsx.
// This prevents that.
const originalJSLoader = Module._extensions['.js'];
const matcher = opts.matcher || null;
const ignoreNodeModules = opts.ignoreNodeModules !== false;
exts = opts.extensions || opts.exts || opts.extension || opts.ext || ['.js'];
if (!Array.isArray(exts)) {
exts = [exts];
}
exts.forEach((ext) => {
if (typeof ext !== 'string') {
throw new TypeError(`Invalid Extension: ${ext}`);
}
const oldLoader = Module._extensions[ext] || originalJSLoader;
oldLoaders[ext] = Module._extensions[ext];
loaders[ext] = Module._extensions[ext] = function newLoader(mod, filename) {
let compile;
if (!reverted) {
if (shouldCompile(filename, exts, matcher, ignoreNodeModules)) {
compile = mod._compile;
mod._compile = function _compile(code) {
// reset the compile immediately as otherwise we end up having the
// compile function being changed even though this loader might be reverted
// Not reverting it here leads to long useless compile chains when doing
// addHook -> revert -> addHook -> revert -> ...
// The compile function is also anyway created new when the loader is called a second time.
mod._compile = compile;
const newCode = hook(code, filename);
if (typeof newCode !== 'string') {
throw new Error(HOOK_RETURNED_NOTHING_ERROR_MESSAGE);
}
return mod._compile(newCode, filename);
};
}
}
oldLoader(mod, filename);
};
});
return function revert() {
if (reverted) return;
reverted = true;
exts.forEach((ext) => {
// if the current loader for the extension is our loader then unregister it and set the oldLoader again
// if not we cannot do anything as we cannot remove a loader from within the loader-chain
if (Module._extensions[ext] === loaders[ext]) {
if (!oldLoaders[ext]) {
delete Module._extensions[ext];
} else {
Module._extensions[ext] = oldLoaders[ext];
}
}
});
};
}
exports.addHook = addHook;
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('partialRight', require('../partialRight'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,17 @@
import { time } from '../../frameloop/sync-time.mjs';
import { frame, cancelFrame, frameData } from '../../frameloop/frame.mjs';
const frameloopDriver = (update) => {
const passTimestamp = ({ timestamp }) => update(timestamp);
return {
start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),
stop: () => cancelFrame(passTimestamp),
/**
* If we're processing this frame we can use the
* framelocked timestamp to keep things in sync.
*/
now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),
};
};
export { frameloopDriver };
@@ -0,0 +1,102 @@
var $78605a5d7424e31b$exports = require("./useLayoutEffect.main.js");
var $19a2307bfabafaf1$exports = require("./useValueEffect.main.js");
var $dG5aF$react = require("react");
var $dG5aF$reactariassr = require("@react-aria/ssr");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useId", () => $8c61827343eed941$export$f680877a34711e37);
$parcel$export(module.exports, "mergeIds", () => $8c61827343eed941$export$cd8c9cb68f842629);
$parcel$export(module.exports, "useSlotId", () => $8c61827343eed941$export$b4cc09c592e8fdb8);
/*
* 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.
*/
// copied from SSRProvider.tsx to reduce exports, if needed again, consider sharing
let $8c61827343eed941$var$canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
let $8c61827343eed941$var$idsUpdaterMap = new Map();
function $8c61827343eed941$export$f680877a34711e37(defaultId) {
let [value, setValue] = (0, $dG5aF$react.useState)(defaultId);
let nextId = (0, $dG5aF$react.useRef)(null);
let res = (0, $dG5aF$reactariassr.useSSRSafeId)(value);
let updateValue = (0, $dG5aF$react.useCallback)((val)=>{
nextId.current = val;
}, []);
if ($8c61827343eed941$var$canUseDOM) {
// TS not smart enough to know that `has` means the value exists
if ($8c61827343eed941$var$idsUpdaterMap.has(res) && !$8c61827343eed941$var$idsUpdaterMap.get(res).includes(updateValue)) $8c61827343eed941$var$idsUpdaterMap.set(res, [
...$8c61827343eed941$var$idsUpdaterMap.get(res),
updateValue
]);
else $8c61827343eed941$var$idsUpdaterMap.set(res, [
updateValue
]);
}
(0, $78605a5d7424e31b$exports.useLayoutEffect)(()=>{
let r = res;
return ()=>{
$8c61827343eed941$var$idsUpdaterMap.delete(r);
};
}, [
res
]);
// This cannot cause an infinite loop because the ref is updated first.
// eslint-disable-next-line
(0, $dG5aF$react.useEffect)(()=>{
let newId = nextId.current;
if (newId) {
nextId.current = null;
setValue(newId);
}
});
return res;
}
function $8c61827343eed941$export$cd8c9cb68f842629(idA, idB) {
if (idA === idB) return idA;
let setIdsA = $8c61827343eed941$var$idsUpdaterMap.get(idA);
if (setIdsA) {
setIdsA.forEach((fn)=>fn(idB));
return idB;
}
let setIdsB = $8c61827343eed941$var$idsUpdaterMap.get(idB);
if (setIdsB) {
setIdsB.forEach((fn)=>fn(idA));
return idA;
}
return idB;
}
function $8c61827343eed941$export$b4cc09c592e8fdb8(depArray = []) {
let id = $8c61827343eed941$export$f680877a34711e37();
let [resolvedId, setResolvedId] = (0, $19a2307bfabafaf1$exports.useValueEffect)(id);
let updateId = (0, $dG5aF$react.useCallback)(()=>{
setResolvedId(function*() {
yield id;
yield document.getElementById(id) ? id : undefined;
});
}, [
id,
setResolvedId
]);
(0, $78605a5d7424e31b$exports.useLayoutEffect)(updateId, [
id,
updateId,
...depArray
]);
return resolvedId;
}
//# sourceMappingURL=useId.main.js.map
@@ -0,0 +1,54 @@
/*
Fraction.js v5.0.0 10/1/2024
https://raw.org/article/rational-numbers-in-javascript/
Copyright (c) 2024, Robert Eisele (https://raw.org/)
Licensed under the MIT license.
*/
const Fraction = require('fraction.js');
// Another rational approximation, not using Farey Sequences but Binary Search using the mediant
function approximate(p, precision) {
var num1 = Math.floor(p);
var den1 = 1;
var num2 = num1 + 1;
var den2 = 1;
if (p !== num1) {
while (den1 <= precision && den2 <= precision) {
var m = (num1 + num2) / (den1 + den2);
if (p === m) {
if (den1 + den2 <= precision) {
den1 += den2;
num1 += num2;
den2 = precision + 1;
} else if (den1 > den2) {
den2 = precision + 1;
} else {
den1 = precision + 1;
}
break;
} else if (p < m) {
num2 += num1;
den2 += den1;
} else {
num1 += num2;
den1 += den2;
}
}
}
if (den1 > precision) {
den1 = den2;
num1 = num2;
}
return new Fraction(num1, den1);
}
@@ -0,0 +1,320 @@
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { readFileSync } from "node:fs";
import * as vite from "vite";
import { createFilter } from "vite";
import { exactRegex, makeIdFiltersToMatchWithQuery } from "@rolldown/pluginutils";
//#region ../common/refresh-utils.ts
const runtimePublicPath = "/@react-refresh";
const reactCompRE = /extends\s+(?:React\.)?(?:Pure)?Component/;
const refreshContentRE = /\$RefreshReg\$\(/;
const preambleCode = `import { injectIntoGlobalHook } from "__BASE__${runtimePublicPath.slice(1)}";
injectIntoGlobalHook(window);
window.$RefreshReg$ = () => {};
window.$RefreshSig$ = () => (type) => type;`;
const getPreambleCode = (base) => preambleCode.replace("__BASE__", base);
const avoidSourceMapOption = Symbol();
function addRefreshWrapper(code, map, pluginName, id, reactRefreshHost = "") {
const hasRefresh = refreshContentRE.test(code);
const onlyReactComp = !hasRefresh && reactCompRE.test(code);
const normalizedMap = map === avoidSourceMapOption ? null : map;
if (!hasRefresh && !onlyReactComp) return {
code,
map: normalizedMap
};
const avoidSourceMap = map === avoidSourceMapOption;
const newMap = typeof normalizedMap === "string" ? JSON.parse(normalizedMap) : normalizedMap;
let newCode = code;
if (hasRefresh) {
const refreshHead = removeLineBreaksIfNeeded(`let prevRefreshReg;
let prevRefreshSig;
if (import.meta.hot && !inWebWorker) {
if (!window.$RefreshReg$) {
throw new Error(
"${pluginName} can't detect preamble. Something is wrong."
);
}
prevRefreshReg = window.$RefreshReg$;
prevRefreshSig = window.$RefreshSig$;
window.$RefreshReg$ = RefreshRuntime.getRefreshReg(${JSON.stringify(id)});
window.$RefreshSig$ = RefreshRuntime.createSignatureFunctionForTransform;
}
`, avoidSourceMap);
newCode = `${refreshHead}${newCode}
if (import.meta.hot && !inWebWorker) {
window.$RefreshReg$ = prevRefreshReg;
window.$RefreshSig$ = prevRefreshSig;
}
`;
if (newMap) newMap.mappings = ";".repeat(16) + newMap.mappings;
}
const sharedHead = removeLineBreaksIfNeeded(`import * as RefreshRuntime from "${reactRefreshHost}${runtimePublicPath}";
const inWebWorker = typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope;
`, avoidSourceMap);
newCode = `${sharedHead}${newCode}
if (import.meta.hot && !inWebWorker) {
RefreshRuntime.__hmr_import(import.meta.url).then((currentExports) => {
RefreshRuntime.registerExportsForReactRefresh(${JSON.stringify(id)}, currentExports);
import.meta.hot.accept((nextExports) => {
if (!nextExports) return;
const invalidateMessage = RefreshRuntime.validateRefreshBoundaryAndEnqueueUpdate(${JSON.stringify(id)}, currentExports, nextExports);
if (invalidateMessage) import.meta.hot.invalidate(invalidateMessage);
});
});
}
`;
if (newMap) newMap.mappings = ";;;" + newMap.mappings;
return {
code: newCode,
map: newMap
};
}
function removeLineBreaksIfNeeded(code, enabled) {
return enabled ? code.replace(/\n/g, "") : code;
}
//#endregion
//#region ../common/warning.ts
const silenceUseClientWarning = (userConfig) => ({ rollupOptions: { onwarn(warning, defaultHandler) {
var _userConfig$build;
if (warning.code === "MODULE_LEVEL_DIRECTIVE" && (warning.message.includes("use client") || warning.message.includes("use server"))) return;
if (warning.code === "SOURCEMAP_ERROR" && warning.message.includes("resolve original location") && warning.pos === 0) return;
if ((_userConfig$build = userConfig.build) === null || _userConfig$build === void 0 || (_userConfig$build = _userConfig$build.rollupOptions) === null || _userConfig$build === void 0 ? void 0 : _userConfig$build.onwarn) userConfig.build.rollupOptions.onwarn(warning, defaultHandler);
else defaultHandler(warning);
} } });
//#endregion
//#region src/index.ts
const _dirname = dirname(fileURLToPath(import.meta.url));
const refreshRuntimePath = join(_dirname, "refresh-runtime.js");
let babel;
async function loadBabel() {
if (!babel) babel = await import("@babel/core");
return babel;
}
const defaultIncludeRE = /\.[tj]sx?$/;
const tsRE = /\.tsx?$/;
function viteReact(opts = {}) {
var _opts$babel;
const include = opts.include ?? defaultIncludeRE;
const exclude = opts.exclude;
const filter = createFilter(include, exclude);
const jsxImportSource = opts.jsxImportSource ?? "react";
const jsxImportRuntime = `${jsxImportSource}/jsx-runtime`;
const jsxImportDevRuntime = `${jsxImportSource}/jsx-dev-runtime`;
let runningInVite = false;
let isProduction = true;
let projectRoot = process.cwd();
let skipFastRefresh = true;
let runPluginOverrides;
let staticBabelOptions;
const importReactRE = /\bimport\s+(?:\*\s+as\s+)?React\b/;
const viteBabel = {
name: "vite:react-babel",
enforce: "pre",
config() {
if (opts.jsxRuntime === "classic") if ("rolldownVersion" in vite) return { oxc: { jsx: {
runtime: "classic",
development: false
} } };
else return { esbuild: { jsx: "transform" } };
else return {
esbuild: {
jsx: "automatic",
jsxImportSource: opts.jsxImportSource
},
optimizeDeps: "rolldownVersion" in vite ? { rollupOptions: { jsx: { mode: "automatic" } } } : { esbuildOptions: { jsx: "automatic" } }
};
},
configResolved(config) {
runningInVite = true;
projectRoot = config.root;
isProduction = config.isProduction;
skipFastRefresh = isProduction || config.command === "build" || config.server.hmr === false;
if ("jsxPure" in opts) config.logger.warnOnce("[@vitejs/plugin-react] jsxPure was removed. You can configure esbuild.jsxSideEffects directly.");
const hooks = config.plugins.map((plugin) => {
var _plugin$api;
return (_plugin$api = plugin.api) === null || _plugin$api === void 0 ? void 0 : _plugin$api.reactBabel;
}).filter(defined);
if ("rolldownVersion" in vite && !opts.babel && !hooks.length && !opts.disableOxcRecommendation) config.logger.warn("[vite:react-babel] We recommend switching to `@vitejs/plugin-react-oxc` for improved performance. More information at https://vite.dev/rolldown");
if (hooks.length > 0) runPluginOverrides = (babelOptions, context) => {
hooks.forEach((hook) => hook(babelOptions, context, config));
};
else if (typeof opts.babel !== "function") {
staticBabelOptions = createBabelOptions(opts.babel);
if (canSkipBabel(staticBabelOptions.plugins, staticBabelOptions) && skipFastRefresh && (opts.jsxRuntime === "classic" ? isProduction : true)) delete viteBabel.transform;
}
},
options(options) {
if (!runningInVite) {
options.jsx = {
mode: opts.jsxRuntime,
importSource: opts.jsxImportSource
};
return options;
}
},
transform: {
filter: { id: {
include: makeIdFiltersToMatchWithQuery(include),
exclude: [...exclude ? makeIdFiltersToMatchWithQuery(ensureArray(exclude)) : [], /\/node_modules\//]
} },
async handler(code, id, options) {
if (id.includes("/node_modules/")) return;
const [filepath] = id.split("?");
if (!filter(filepath)) return;
const ssr = (options === null || options === void 0 ? void 0 : options.ssr) === true;
const babelOptions = (() => {
if (staticBabelOptions) return staticBabelOptions;
const newBabelOptions = createBabelOptions(typeof opts.babel === "function" ? opts.babel(id, { ssr }) : opts.babel);
runPluginOverrides === null || runPluginOverrides === void 0 || runPluginOverrides(newBabelOptions, {
id,
ssr
});
return newBabelOptions;
})();
const plugins = [...babelOptions.plugins];
const isJSX = filepath.endsWith("x");
const useFastRefresh = !skipFastRefresh && !ssr && (isJSX || (opts.jsxRuntime === "classic" ? importReactRE.test(code) : code.includes(jsxImportDevRuntime) || code.includes(jsxImportRuntime)));
if (useFastRefresh) plugins.push([await loadPlugin("react-refresh/babel"), { skipEnvCheck: true }]);
if (opts.jsxRuntime === "classic" && isJSX) {
if (!isProduction) plugins.push(await loadPlugin("@babel/plugin-transform-react-jsx-self"), await loadPlugin("@babel/plugin-transform-react-jsx-source"));
}
if (canSkipBabel(plugins, babelOptions)) return;
const parserPlugins = [...babelOptions.parserOpts.plugins];
if (!filepath.endsWith(".ts")) parserPlugins.push("jsx");
if (tsRE.test(filepath)) parserPlugins.push("typescript");
const babel$1 = await loadBabel();
const result = await babel$1.transformAsync(code, {
...babelOptions,
root: projectRoot,
filename: id,
sourceFileName: filepath,
retainLines: getReactCompilerPlugin(plugins) != null ? false : !isProduction && isJSX && opts.jsxRuntime !== "classic",
parserOpts: {
...babelOptions.parserOpts,
sourceType: "module",
allowAwaitOutsideFunction: true,
plugins: parserPlugins
},
generatorOpts: {
...babelOptions.generatorOpts,
importAttributesKeyword: "with",
decoratorsBeforeExport: true
},
plugins,
sourceMaps: true
});
if (result) {
if (!useFastRefresh) return {
code: result.code,
map: result.map
};
return addRefreshWrapper(result.code, result.map, "@vitejs/plugin-react", id, opts.reactRefreshHost);
}
}
}
};
const dependencies = [
"react",
"react-dom",
jsxImportDevRuntime,
jsxImportRuntime
];
const staticBabelPlugins = typeof opts.babel === "object" ? ((_opts$babel = opts.babel) === null || _opts$babel === void 0 ? void 0 : _opts$babel.plugins) ?? [] : [];
const reactCompilerPlugin = getReactCompilerPlugin(staticBabelPlugins);
if (reactCompilerPlugin != null) {
const reactCompilerRuntimeModule = getReactCompilerRuntimeModule(reactCompilerPlugin);
dependencies.push(reactCompilerRuntimeModule);
}
const viteReactRefresh = {
name: "vite:react-refresh",
enforce: "pre",
config: (userConfig) => ({
build: silenceUseClientWarning(userConfig),
optimizeDeps: { include: dependencies },
resolve: { dedupe: ["react", "react-dom"] }
}),
resolveId: {
filter: { id: exactRegex(runtimePublicPath) },
handler(id) {
if (id === runtimePublicPath) return id;
}
},
load: {
filter: { id: exactRegex(runtimePublicPath) },
handler(id) {
if (id === runtimePublicPath) return readFileSync(refreshRuntimePath, "utf-8").replace(/__README_URL__/g, "https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react");
}
},
transformIndexHtml(_, config) {
if (!skipFastRefresh) return [{
tag: "script",
attrs: { type: "module" },
children: getPreambleCode(config.server.config.base)
}];
}
};
return [viteBabel, viteReactRefresh];
}
viteReact.preambleCode = preambleCode;
function canSkipBabel(plugins, babelOptions) {
return !(plugins.length || babelOptions.presets.length || babelOptions.configFile || babelOptions.babelrc);
}
const loadedPlugin = /* @__PURE__ */ new Map();
function loadPlugin(path) {
const cached = loadedPlugin.get(path);
if (cached) return cached;
const promise = import(path).then((module) => {
const value = module.default || module;
loadedPlugin.set(path, value);
return value;
});
loadedPlugin.set(path, promise);
return promise;
}
function createBabelOptions(rawOptions) {
var _babelOptions$parserO;
const babelOptions = {
babelrc: false,
configFile: false,
...rawOptions
};
babelOptions.plugins || (babelOptions.plugins = []);
babelOptions.presets || (babelOptions.presets = []);
babelOptions.overrides || (babelOptions.overrides = []);
babelOptions.parserOpts || (babelOptions.parserOpts = {});
(_babelOptions$parserO = babelOptions.parserOpts).plugins || (_babelOptions$parserO.plugins = []);
return babelOptions;
}
function defined(value) {
return value !== void 0;
}
function getReactCompilerPlugin(plugins) {
return plugins.find((p) => p === "babel-plugin-react-compiler" || Array.isArray(p) && p[0] === "babel-plugin-react-compiler");
}
function getReactCompilerRuntimeModule(plugin) {
let moduleName = "react/compiler-runtime";
if (Array.isArray(plugin)) {
var _plugin$, _plugin$2, _plugin$3;
if (((_plugin$ = plugin[1]) === null || _plugin$ === void 0 ? void 0 : _plugin$.target) === "17" || ((_plugin$2 = plugin[1]) === null || _plugin$2 === void 0 ? void 0 : _plugin$2.target) === "18") moduleName = "react-compiler-runtime";
else if (typeof ((_plugin$3 = plugin[1]) === null || _plugin$3 === void 0 ? void 0 : _plugin$3.runtimeModule) === "string") {
var _plugin$4;
moduleName = (_plugin$4 = plugin[1]) === null || _plugin$4 === void 0 ? void 0 : _plugin$4.runtimeModule;
}
}
return moduleName;
}
function ensureArray(value) {
return Array.isArray(value) ? value : [value];
}
//#endregion
export { viteReact as default };
@@ -0,0 +1 @@
{"version":3,"names":["_identity","x"],"sources":["../../src/helpers/identity.ts"],"sourcesContent":["/* @minVersion 7.17.0 */\n\nexport default function _identity<T>(x: T) {\n return x;\n}\n"],"mappings":";;;;;;AAEe,SAASA,SAASA,CAAIC,CAAI,EAAE;EACzC,OAAOA,CAAC;AACV","ignoreList":[]}
@@ -0,0 +1,356 @@
> [!NOTE]
>
> This is a fork of [oxc-resolver] and [rspack-resolver], and will be used in [eslint-plugin-import-x] and [eslint-import-resolver-typescript] cause 100% compatible with [enhanced-resolve] is the non-goal of [oxc-resolver] itself, we add [enhanced-resolve] specific features like [`pnp support`](https://github.com/web-infra-dev/rspack/issues/2236).
>
> We also fix several bugs reported by [eslint-plugin-import-x] and [eslint-import-resolver-typescript] users:
>
> - takes `paths` and `references` into account [at the same time](https://github.com/unrs/unrs-resolver/pull/12)
> - `references` should [take higher priority](https://github.com/unrs/unrs-resolver/pull/13)
> - support `pnpapi` core module and [package deep link](https://github.com/un-ts/eslint-plugin-import-x/issues/253)
> - enable [more targets](https://github.com/unrs/unrs-resolver/pull/29) support
> - absolute path aliasing [should not be skipped](https://github.com/import-js/eslint-import-resolver-typescript/issues/401)
> - use [napi-postinstall] for [legacy npm versions](https://github.com/unrs/unrs-resolver/issues/56)
> - Raspberry PI 4 aarch64 [compatibility issue](https://github.com/unrs/unrs-resolver/issues/64) and [import-js/eslint-import-resolver-typescript#406](https://github.com/import-js/eslint-import-resolver-typescript/issues/406) due to [mimalloc-safe]
> - support `load_as_directory` for [`pnp` mode](https://github.com/import-js/eslint-import-resolver-typescript/issues/409)
> - [resolve parent base url correctly](https://github.com/import-js/eslint-import-resolver-typescript/issues/437) by normalizing as absolute path
>
> The list could be longer in the future, but we don't want to make it too long here.
>
> We also sync with [oxc-resolver] and [rspack-resolver] regularly to keep up with the latest changes:
>
> - `oxc-resolver`: [#15](https://github.com/unrs/unrs-resolver/pull/15), [#49](https://github.com/unrs/unrs-resolver/pull/49), [#62](https://github.com/unrs/unrs-resolver/pull/62), [#86](https://github.com/unrs/unrs-resolver/pull/86) and [#94](https://github.com/unrs/unrs-resolver/pull/94)
> - `rspack-resolver`(planned): [#59](https://github.com/unrs/unrs-resolver/issues/59)
>
> Last but not least, we prepare some bug fix PRs first on our side and PR back into upstream projects, and we will keep doing this in the future:
>
> - `oxc-resolver`: [#84](https://github.com/unrs/unrs-resolver/pull/84) with [oxc-resolver#455](https://github.com/oxc-project/oxc-resolver/pull/455)
> - `rspack-resolver`: [#7](https://github.com/unrs/unrs-resolver/pull/7) with [rspack-resolver#54](https://github.com/web-infra-dev/rspack-resolver/pull/54), which is eventually replaced by [oxc-resolver#443](https://github.com/oxc-project/oxc-resolver/pull/443)
<div align="center">
[![Crates.io][crates-badge]][crates-url]
[![npmjs.com][npm-badge]][npm-url]
[![Docs.rs][docs-badge]][docs-url]
[![Build Status][ci-badge]][ci-url]
[![Code Coverage][code-coverage-badge]][code-coverage-url]
[![CodSpeed Badge][codspeed-badge]][codspeed-url]
[![Sponsors][sponsors-badge]][sponsors-url]
[![MIT licensed][license-badge]][license-url]
</div>
# UnRS Resolver
Rust port of [enhanced-resolve].
- Released on [crates.io][crates-url] and [npm][npm-url].
- Implements the [ESM](https://nodejs.org/api/esm.html#resolution-algorithm) and [CommonJS](https://nodejs.org/api/modules.html#all-together) module resolution algorithm specification.
- Built-in [tsconfig-paths-webpack-plugin]
- support extending tsconfig defined in `tsconfig.extends`
- support paths alias defined in `tsconfig.compilerOptions.paths`
- support project references defined `tsconfig.references`
- support [template variable ${configDir} for substitution of config files directory path](https://github.com/microsoft/TypeScript/pull/58042)
- Supports in-memory file system via the `FileSystem` trait.
- Contains `tracing` instrumentation.
## Usage
### npm package
See `index.d.ts` for `resolveSync` and `ResolverFactory` API.
Quick example:
```javascript
import assert from 'node:assert';
import path from 'node:path';
import resolve, { ResolverFactory } from 'unrs-resolver';
// `resolve`
assert(resolve.sync(process.cwd(), './index.js').path, path.resolve('index.js'));
// `ResolverFactory`
const resolver = new ResolverFactory();
assert(resolver.sync(process.cwd(), './index.js').path, path.resolve('index.js'));
```
### Supports WASM
See https://stackblitz.com/edit/unrs-resolver for usage example.
### Rust
See [docs.rs/unrs_resolver](https://docs.rs/unrs_resolver/latest/unrs_resolver/).
### [Yarn Plug'n'Play](https://yarnpkg.com/features/pnp)
- For node.js, yarn pnp should work without any configuration, given the following conditions:
- the program is called with the `yarn` command, where the value [`process.versions.pnp`](https://yarnpkg.com/advanced/pnpapi#processversionspnp) is set.
- `.pnp.cjs` manifest file exists in the closest directory, searched from the current working directory,
- no multi-project setup, per second bullet point in [FIND_PNP_MANIFEST](https://yarnpkg.com/advanced/pnp-spec#find_pnp_manifest)
## Terminology
### `directory`
An **absolute** path to a directory where the specifier is resolved against.
For CommonJS modules, it is the `__dirname` variable that contains the absolute path to the folder containing current module.
For ECMAScript modules, it is the value of `import.meta.dirname`.
Behavior is undefined when given a path to a file.
### `specifier`
The string passed to `require` or `import`, i.e. `require("specifier")` or `import "specifier"`
## Errors and Trouble Shooting
- `Error: Package subpath '.' is not defined by "exports" in` - occurs when resolving without `conditionNames`.
## Configuration
The following usages apply to both Rust and Node.js; the code snippets are written in JavaScript.
To handle the `exports` field in `package.json`, ESM and CJS need to be differentiated.
### ESM
Per [ESM Resolution algorithm](https://nodejs.org/api/esm.html#resolution-and-loading-algorithm)
> defaultConditions is the conditional environment name array, ["node", "import"].
This means when the caller is an ESM import (`import "module"`), resolve options should be
```javascript
{
"conditionNames": ["node", "import"]
}
```
### CJS
Per [CJS Resolution algorithm](https://nodejs.org/api/modules.html#all-together)
> LOAD_PACKAGE_EXPORTS(X, DIR)
>
> 5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH,
> `package.json` "exports", ["node", "require"]) defined in the ESM resolver.
This means when the caller is a CJS require (`require("module")`), resolve options should be
```javascript
{
"conditionNames": ["node", "require"]
}
```
### Cache
To support both CJS and ESM with the same cache:
```javascript
const esmResolver = new ResolverFactory({
conditionNames: ['node', 'import'],
});
const cjsResolver = esmResolver.cloneWithOptions({
conditionNames: ['node', 'require'],
});
```
### Browser Field
From this [non-standard spec](https://github.com/defunctzombie/package-browser-field-spec):
> The `browser` field is provided to JavaScript bundlers or component tools when packaging modules for client side use.
The option is
```javascript
{
"aliasFields": ["browser"]
}
```
### Main Field
```javascript
{
"mainFields": ["module", "main"]
}
```
Quoting esbuild's documentation:
- `main` - This is [the standard field](https://docs.npmjs.com/files/package.json#main) for all packages that are meant to be used with node. The name main is hard-coded in to node's module resolution logic itself. Because it's intended for use with node, it's reasonable to expect that the file path in this field is a CommonJS-style module.
- `module` - This field came from a [proposal](https://github.com/dherman/defense-of-dot-js/blob/f31319be735b21739756b87d551f6711bd7aa283/proposal.md) for how to integrate ECMAScript modules into node. Because of this, it's reasonable to expect that the file path in this field is an ECMAScript-style module. This proposal wasn't adopted by node (node uses "type": "module" instead) but it was adopted by major bundlers because ECMAScript-style modules lead to better tree shaking, or dead code removal.
- `browser` - This field came from a [proposal](https://gist.github.com/defunctzombie/4339901/49493836fb873ddaa4b8a7aa0ef2352119f69211) that allows bundlers to replace node-specific files or modules with their browser-friendly versions. It lets you specify an alternate browser-specific entry point. Note that it is possible for a package to use both the browser and module field together (see the note below).
## Options
The following options are aligned with [enhanced-resolve], and is implemented for Rust crate usage.
See [index.d.ts](https://github.com/unrs/unrs-resolver/blob/main/napi/index.d.ts) for Node.js usage.
| Field | Default | Description |
| ------------------------------------- | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| alias | {} | A hash map of module alias configurations |
| aliasFields | [] | A list of alias fields in description files |
| extensionAlias | {} | An object which maps extension to extension aliases |
| conditionNames | [] | A list of exports field condition names |
| descriptionFiles | ["package.json"] | A list of description files to read from |
| enforceExtension | false | Enforce that a extension from extensions must be used |
| exportsFields | ["exports"] | A list of exports fields in description files |
| extensions | [".js", ".json", ".node"] | A list of extensions which should be tried for files |
| fallback | {} | Same as `alias`, but only used if default resolving fails |
| fileSystem | | The file system which should be used |
| fullySpecified | false | Request passed to resolve is already fully specified and extensions or main files are not resolved for it (they are still resolved for internal requests) |
| mainFields | ["main"] | A list of main fields in description files |
| mainFiles | ["index"] | A list of main files in directories |
| modules | ["node_modules"] | A list of directories to resolve modules from, can be absolute path or folder name |
| resolveToContext | false | Resolve to a context instead of a file |
| preferRelative | false | Prefer to resolve module requests as relative request and fallback to resolving as module |
| preferAbsolute | false | Prefer to resolve server-relative urls as absolute paths before falling back to resolve in roots |
| restrictions | [] | A list of resolve restrictions |
| roots | [] | A list of root paths |
| symlinks | true | Whether to resolve symlinks to their symlinked location |
| allowPackageExportsInDirectoryResolve | false | Allow `exports` field in `require('../directory')`. Not part of `enhanced-resolve`. |
### TypeScript Configuration
| Field | Default | Description |
| ------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| tsconfig | None | TypeScript related config for resolver |
| tsconfig.configFile | | A relative path to the tsconfig file based on `cwd`, or an absolute path of tsconfig file. |
| tsconfig.references | `[]` | - 'auto': inherits from TypeScript config <br/> - `string []`: relative path (based on directory of the referencing tsconfig file) or absolute path of referenced project's tsconfig |
### Unimplemented Options
| Field | Default | Description |
| ---------------- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| cachePredicate | function() { return true }; | A function which decides whether a request should be cached or not. An object is passed to the function with `path` and `request` properties. |
| cacheWithContext | true | If unsafe cache is enabled, includes `request.context` in the cache key |
| plugins | [] | A list of additional resolve plugins which should be applied |
| resolver | undefined | A prepared Resolver to which the plugins are attached |
| unsafeCache | false | Use this cache object to unsafely cache the successful requests |
## Debugging
The following environment variable emits tracing information for the `unrs_resolver::resolve` function.
e.g.
```
2024-06-11T07:12:20.003537Z DEBUG unrs_resolver: options: ResolveOptions { ... }, path: "...", specifier: "...", ret: "..."
at /path/to/unrs_resolver-1.8.1/src/lib.rs:212
in unrs_resolver::resolve with path: "...", specifier: "..."
```
The input values are `options`, `path` and `specifier`, the returned value is `ret`.
### NAPI
```
UNRS_LOG=DEBUG your_program
```
## Test
Tests are ported from
- [enhanced-resolve](https://github.com/webpack/enhanced-resolve/tree/main/test)
- [tsconfig-path](https://github.com/dividab/tsconfig-paths/blob/master/src/__tests__/data/match-path-data.ts) and [parcel-resolver](https://github.com/parcel-bundler/parcel/tree/v2/packages/utils/node-resolver-core/test/fixture/tsconfig) for tsconfig-paths
Test cases are located in `./src/tests`, fixtures are located in `./tests`
- [x] alias.test.js
- [x] browserField.test.js
- [x] dependencies.test.js
- [x] exportsField.test.js
- [x] extension-alias.test.js
- [x] extensions.test.js
- [x] fallback.test.js
- [x] fullSpecified.test.js
- [x] identifier.test.js (see unit test in `crates/unrs_resolver/src/request.rs`)
- [x] importsField.test.js
- [x] incorrect-description-file.test.js (need to add ctx.fileDependencies)
- [x] missing.test.js
- [x] path.test.js (see unit test in `crates/unrs_resolver/src/path.rs`)
- [ ] plugins.test.js
- [ ] pnp.test.js
- [x] resolve.test.js
- [x] restrictions.test.js (partially done, regex is not supported yet)
- [x] roots.test.js
- [x] scoped-packages.test.js
- [x] simple.test.js
- [x] symlink.test.js
Irrelevant tests
- CachedInputFileSystem.test.js
- SyncAsyncFileSystemDecorator.test.js
- forEachBail.test.js
- getPaths.test.js
- pr-53.test.js
- unsafe-cache.test.js
- yield.test.js
## [Sponsored By](https://github.com/sponsors/JounQin)
[![Sponsors](https://raw.githubusercontent.com/1stG/static/master/sponsors.svg)](https://github.com/sponsors/JounQin)
### Sponsors
| 1stG | UnRs | UnTS |
| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| [![1stG Open Collective backers and sponsors](https://opencollective.com/1stG/organizations.svg)](https://opencollective.com/1stG) | [![UnRs Open Collective backers and sponsors](https://opencollective.com/unrs/organizations.svg)](https://opencollective.com/unrs) | [![UnTS Open Collective backers and sponsors](https://opencollective.com/unts/organizations.svg)](https://opencollective.com/unts) |
### Backers
| 1stG | UnRs | UnTS |
| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| [![1stG Open Collective backers and sponsors](https://opencollective.com/1stG/individuals.svg)](https://opencollective.com/1stG) | [![UnRs Open Collective backers and sponsors](https://opencollective.com/unrs/individuals.svg)](https://opencollective.com/unrs) | [![UnTS Open Collective backers and sponsors](https://opencollective.com/unts/individuals.svg)](https://opencollective.com/unts) |
## 📖 License
`unrs_resolver` is free and open-source software licensed under the [MIT License](./LICENSE).
UnRS partially copies code from the following projects.
| Project | License |
| --------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| [webpack/enhanced-resolve](https://github.com/webpack/enhanced-resolve) | [MIT](https://github.com/webpack/enhanced-resolve/blob/main/LICENSE) |
| [dividab/tsconfig-paths](https://github.com/dividab/tsconfig-paths) | [MIT](https://github.com/dividab/tsconfig-paths/blob/master/LICENSE) |
| [parcel-bundler/parcel](https://github.com/parcel-bundler/parcel) | [MIT](https://github.com/parcel-bundler/parcel/blob/v2/LICENSE) |
| [tmccombs/json-comments-rs](https://github.com/tmccombs/json-comments-rs) | [Apache 2.0](https://github.com/tmccombs/json-comments-rs/blob/main/LICENSE) |
| [oxc-project/oxc-resolver](https://github.com/oxc-project/oxc-resolver) | [MIT](https://github.com/oxc-project/oxc-resolver/blob/main/LICENSE) |
| [web-infra-dev/rspack-resolver](https://github.com/web-infra-dev/rspack-resolver) | [MIT](https://github.com/web-infra-dev/rspack-resolver/blob/main/LICENSE) |
[enhanced-resolve]: https://github.com/webpack/enhanced-resolve
[oxc-resolver]: https://github.com/oxc-project/oxc-resolver
[rspack-resolver]: https://github.com/web-infra-dev/rspack-resolver
[eslint-plugin-import-x]: https://github.com/un-ts/eslint-plugin-import-x
[eslint-import-resolver-typescript]: https://github.com/import-js/eslint-import-resolver-typescript
[napi-postinstall]: https://github.com/un-ts/napi-postinstall
[mimalloc-safe]: https://github.com/napi-rs/mimalloc-safe
[tsconfig-paths-webpack-plugin]: https://github.com/dividab/tsconfig-paths-webpack-plugin
[license-badge]: https://img.shields.io/badge/license-MIT-blue.svg
[license-url]: https://github.com/unrs/unrs-resolver/blob/main/LICENSE
[ci-badge]: https://github.com/unrs/unrs-resolver/actions/workflows/ci.yml/badge.svg?event=push&branch=main
[ci-url]: https://github.com/unrs/unrs-resolver/actions/workflows/ci.yml?query=event%3Apush+branch%3Amain
[code-coverage-badge]: https://codecov.io/github/unrs/unrs-resolver/branch/main/graph/badge.svg
[code-coverage-url]: https://codecov.io/gh/unrs/unrs-resolver
[sponsors-badge]: https://img.shields.io/github/sponsors/JounQin
[sponsors-url]: https://github.com/sponsors/JounQin
[codspeed-badge]: https://img.shields.io/endpoint?url=https://codspeed.io/badge.json
[codspeed-url]: https://codspeed.io/unrs/unrs-resolver
[crates-badge]: https://img.shields.io/crates/d/unrs_resolver?label=crates.io
[crates-url]: https://crates.io/crates/unrs_resolver
[docs-badge]: https://img.shields.io/docsrs/unrs_resolver
[docs-url]: https://docs.rs/unrs_resolver
[npm-badge]: https://img.shields.io/npm/dw/unrs-resolver?label=npm
[npm-url]: https://www.npmjs.com/package/unrs-resolver
@@ -0,0 +1,346 @@
var test = require('tape')
var rimraf = require('rimraf')
var tar = require('../index')
var tarStream = require('tar-stream')
var path = require('path')
var fs = require('fs')
var os = require('os')
var win32 = os.platform() === 'win32'
var mtime = function (st) {
return Math.floor(st.mtime.getTime() / 1000)
}
test('copy a -> copy/a', function (t) {
t.plan(5)
var a = path.join(__dirname, 'fixtures', 'a')
var b = path.join(__dirname, 'fixtures', 'copy', 'a')
rimraf.sync(b)
tar.pack(a)
.pipe(tar.extract(b))
.on('finish', function () {
var files = fs.readdirSync(b)
t.same(files.length, 1)
t.same(files[0], 'hello.txt')
var fileB = path.join(b, files[0])
var fileA = path.join(a, files[0])
t.same(fs.readFileSync(fileB, 'utf-8'), fs.readFileSync(fileA, 'utf-8'))
t.same(fs.statSync(fileB).mode, fs.statSync(fileA).mode)
t.same(mtime(fs.statSync(fileB)), mtime(fs.statSync(fileA)))
})
})
test('copy b -> copy/b', function (t) {
t.plan(8)
var a = path.join(__dirname, 'fixtures', 'b')
var b = path.join(__dirname, 'fixtures', 'copy', 'b')
rimraf.sync(b)
tar.pack(a)
.pipe(tar.extract(b))
.on('finish', function () {
var files = fs.readdirSync(b)
t.same(files.length, 1)
t.same(files[0], 'a')
var dirB = path.join(b, files[0])
var dirA = path.join(a, files[0])
t.same(fs.statSync(dirB).mode, fs.statSync(dirA).mode)
t.same(mtime(fs.statSync(dirB)), mtime(fs.statSync(dirA)))
t.ok(fs.statSync(dirB).isDirectory())
var fileB = path.join(dirB, 'test.txt')
var fileA = path.join(dirA, 'test.txt')
t.same(fs.readFileSync(fileB, 'utf-8'), fs.readFileSync(fileA, 'utf-8'))
t.same(fs.statSync(fileB).mode, fs.statSync(fileA).mode)
t.same(mtime(fs.statSync(fileB)), mtime(fs.statSync(fileA)))
})
})
test('symlink', function (t) {
if (win32) { // no symlink support on win32 currently. TODO: test if this can be enabled somehow
t.plan(1)
t.ok(true)
return
}
t.plan(5)
var a = path.join(__dirname, 'fixtures', 'c')
rimraf.sync(path.join(a, 'link'))
fs.symlinkSync('.gitignore', path.join(a, 'link'))
var b = path.join(__dirname, 'fixtures', 'copy', 'c')
rimraf.sync(b)
tar.pack(a)
.pipe(tar.extract(b))
.on('finish', function () {
var files = fs.readdirSync(b).sort()
t.same(files.length, 2)
t.same(files[0], '.gitignore')
t.same(files[1], 'link')
var linkA = path.join(a, 'link')
var linkB = path.join(b, 'link')
t.same(mtime(fs.lstatSync(linkB)), mtime(fs.lstatSync(linkA)))
t.same(fs.readlinkSync(linkB), fs.readlinkSync(linkA))
})
})
test('follow symlinks', function (t) {
if (win32) { // no symlink support on win32 currently. TODO: test if this can be enabled somehow
t.plan(1)
t.ok(true)
return
}
t.plan(5)
var a = path.join(__dirname, 'fixtures', 'c')
rimraf.sync(path.join(a, 'link'))
fs.symlinkSync('.gitignore', path.join(a, 'link'))
var b = path.join(__dirname, 'fixtures', 'copy', 'c-dereference')
rimraf.sync(b)
tar.pack(a, { dereference: true })
.pipe(tar.extract(b))
.on('finish', function () {
var files = fs.readdirSync(b).sort()
t.same(files.length, 2)
t.same(files[0], '.gitignore')
t.same(files[1], 'link')
var file1 = path.join(b, '.gitignore')
var file2 = path.join(b, 'link')
t.same(mtime(fs.lstatSync(file1)), mtime(fs.lstatSync(file2)))
t.same(fs.readFileSync(file1), fs.readFileSync(file2))
})
})
test('strip', function (t) {
t.plan(2)
var a = path.join(__dirname, 'fixtures', 'b')
var b = path.join(__dirname, 'fixtures', 'copy', 'b-strip')
rimraf.sync(b)
tar.pack(a)
.pipe(tar.extract(b, { strip: 1 }))
.on('finish', function () {
var files = fs.readdirSync(b).sort()
t.same(files.length, 1)
t.same(files[0], 'test.txt')
})
})
test('strip + map', function (t) {
t.plan(2)
var a = path.join(__dirname, 'fixtures', 'b')
var b = path.join(__dirname, 'fixtures', 'copy', 'b-strip')
rimraf.sync(b)
var uppercase = function (header) {
header.name = header.name.toUpperCase()
return header
}
tar.pack(a)
.pipe(tar.extract(b, { strip: 1, map: uppercase }))
.on('finish', function () {
var files = fs.readdirSync(b).sort()
t.same(files.length, 1)
t.same(files[0], 'TEST.TXT')
})
})
test('map + dir + permissions', function (t) {
t.plan(win32 ? 1 : 2) // skip chmod test, it's not working like unix
var a = path.join(__dirname, 'fixtures', 'b')
var b = path.join(__dirname, 'fixtures', 'copy', 'a-perms')
rimraf.sync(b)
var aWithMode = function (header) {
if (header.name === 'a') {
header.mode = parseInt(700, 8)
}
return header
}
tar.pack(a)
.pipe(tar.extract(b, { map: aWithMode }))
.on('finish', function () {
var files = fs.readdirSync(b).sort()
var stat = fs.statSync(path.join(b, 'a'))
t.same(files.length, 1)
if (!win32) {
t.same(stat.mode & parseInt(777, 8), parseInt(700, 8))
}
})
})
test('specific entries', function (t) {
t.plan(6)
var a = path.join(__dirname, 'fixtures', 'd')
var b = path.join(__dirname, 'fixtures', 'copy', 'd-entries')
var entries = ['file1', 'sub-files/file3', 'sub-dir']
rimraf.sync(b)
tar.pack(a, { entries: entries })
.pipe(tar.extract(b))
.on('finish', function () {
var files = fs.readdirSync(b)
t.same(files.length, 3)
t.notSame(files.indexOf('file1'), -1)
t.notSame(files.indexOf('sub-files'), -1)
t.notSame(files.indexOf('sub-dir'), -1)
var subFiles = fs.readdirSync(path.join(b, 'sub-files'))
t.same(subFiles, ['file3'])
var subDir = fs.readdirSync(path.join(b, 'sub-dir'))
t.same(subDir, ['file5'])
})
})
test('check type while mapping header on packing', function (t) {
t.plan(3)
var e = path.join(__dirname, 'fixtures', 'e')
var checkHeaderType = function (header) {
if (header.name.indexOf('.') === -1) t.same(header.type, header.name)
}
tar.pack(e, { map: checkHeaderType })
})
test('finish callbacks', function (t) {
t.plan(3)
var a = path.join(__dirname, 'fixtures', 'a')
var b = path.join(__dirname, 'fixtures', 'copy', 'a')
rimraf.sync(b)
var packEntries = 0
var extractEntries = 0
var countPackEntry = function (header) { packEntries++ }
var countExtractEntry = function (header) { extractEntries++ }
var pack
var onPackFinish = function (passedPack) {
t.equal(packEntries, 2, 'All entries have been packed') // 2 entries - the file and base directory
t.equal(passedPack, pack, 'The finish hook passes the pack')
}
var onExtractFinish = function () { t.equal(extractEntries, 2) }
pack = tar.pack(a, { map: countPackEntry, finish: onPackFinish })
pack.pipe(tar.extract(b, { map: countExtractEntry, finish: onExtractFinish }))
.on('finish', function () {
t.end()
})
})
test('not finalizing the pack', function (t) {
t.plan(2)
var a = path.join(__dirname, 'fixtures', 'a')
var b = path.join(__dirname, 'fixtures', 'b')
var out = path.join(__dirname, 'fixtures', 'copy', 'merged-packs')
rimraf.sync(out)
var prefixer = function (prefix) {
return function (header) {
header.name = path.join(prefix, header.name)
return header
}
}
tar.pack(a, {
map: prefixer('a-files'),
finalize: false,
finish: packB
})
function packB (pack) {
tar.pack(b, { pack: pack, map: prefixer('b-files') })
.pipe(tar.extract(out))
.on('finish', assertResults)
}
function assertResults () {
var containers = fs.readdirSync(out)
t.deepEqual(containers, ['a-files', 'b-files'])
var aFiles = fs.readdirSync(path.join(out, 'a-files'))
t.deepEqual(aFiles, ['hello.txt'])
}
})
test('do not extract invalid tar', function (t) {
var a = path.join(__dirname, 'fixtures', 'invalid.tar')
var out = path.join(__dirname, 'fixtures', 'invalid')
rimraf.sync(out)
fs.createReadStream(a)
.pipe(tar.extract(out))
.on('error', function (err) {
t.ok(/is not a valid symlink/i.test(err.message))
fs.stat(path.join(out, '../bar'), function (err) {
t.ok(err)
t.end()
})
})
})
test('no abs hardlink targets', function (t) {
var out = path.join(__dirname, 'fixtures', 'invalid')
var outside = path.join(__dirname, 'fixtures', 'outside')
rimraf.sync(out)
var s = tarStream.pack()
fs.writeFileSync(outside, 'something')
s.entry({
type: 'link',
name: 'link',
linkname: outside
})
s.entry({
name: 'link'
}, 'overwrite')
s.finalize()
s.pipe(tar.extract(out))
.on('error', function (err) {
t.ok(err, 'had error')
fs.readFile(outside, 'utf-8', function (err, str) {
t.error(err, 'no error')
t.same(str, 'something')
t.end()
})
})
})
@@ -0,0 +1,64 @@
/*
@license
Rollup.js v4.53.2
Mon, 10 Nov 2025 08:56:08 GMT - commit d8b0150971681d9efa4f173de5edd2c79a6e03d9
https://github.com/rollup/rollup
Released under the MIT License.
*/
const getLogFilter = filters => {
if (filters.length === 0)
return () => true;
const normalizedFilters = filters.map(filter => filter.split('&').map(subFilter => {
const inverted = subFilter[0] === '!';
if (inverted)
subFilter = subFilter.slice(1);
const [key, ...value] = subFilter.split(':');
return { inverted, key: key.split('.'), parts: value.join(':').split('*') };
}));
return (log) => {
nextIntersectedFilter: for (const intersectedFilters of normalizedFilters) {
for (const { inverted, key, parts } of intersectedFilters) {
const isFilterSatisfied = testFilter(log, key, parts);
if (inverted ? isFilterSatisfied : !isFilterSatisfied) {
continue nextIntersectedFilter;
}
}
return true;
}
return false;
};
};
const testFilter = (log, key, parts) => {
let rawValue = log;
for (let index = 0; index < key.length; index++) {
if (!rawValue) {
return false;
}
const part = key[index];
if (!(part in rawValue)) {
return false;
}
rawValue = rawValue[part];
}
let value = typeof rawValue === 'object' ? JSON.stringify(rawValue) : String(rawValue);
if (parts.length === 1) {
return value === parts[0];
}
if (!value.startsWith(parts[0])) {
return false;
}
const lastPartIndex = parts.length - 1;
for (let index = 1; index < lastPartIndex; index++) {
const part = parts[index];
const position = value.indexOf(part);
if (position === -1) {
return false;
}
value = value.slice(position + part.length);
}
return value.endsWith(parts[lastPartIndex]);
};
export { getLogFilter };
@@ -0,0 +1,184 @@
import Literal from '../Literal';
import JSXElement from '../JSXElement';
import JSXFragment from '../JSXFragment';
import JSXText from '../JSXText';
import Identifier from './Identifier';
import TaggedTemplateExpression from './TaggedTemplateExpression';
import TemplateLiteral from './TemplateLiteral';
import FunctionExpression from './FunctionExpression';
import LogicalExpression from './LogicalExpression';
import MemberExpression from './MemberExpression';
import ChainExpression from './ChainExpression';
import OptionalCallExpression from './OptionalCallExpression';
import OptionalMemberExpression from './OptionalMemberExpression';
import CallExpression from './CallExpression';
import UnaryExpression from './UnaryExpression';
import ThisExpression from './ThisExpression';
import ConditionalExpression from './ConditionalExpression';
import BinaryExpression from './BinaryExpression';
import ObjectExpression from './ObjectExpression';
import NewExpression from './NewExpression';
import UpdateExpression from './UpdateExpression';
import ArrayExpression from './ArrayExpression';
import BindExpression from './BindExpression';
import SpreadElement from './SpreadElement';
import TypeCastExpression from './TypeCastExpression';
import SequenceExpression from './SequenceExpression';
import TSNonNullExpression from './TSNonNullExpression';
import AssignmentExpression from './AssignmentExpression';
// Composition map of types to their extractor functions.
const TYPES = {
Identifier,
Literal,
JSXElement,
JSXFragment,
JSXText,
TaggedTemplateExpression,
TemplateLiteral,
ArrowFunctionExpression: FunctionExpression,
FunctionExpression,
LogicalExpression,
MemberExpression,
ChainExpression,
OptionalCallExpression,
OptionalMemberExpression,
CallExpression,
UnaryExpression,
ThisExpression,
ConditionalExpression,
BinaryExpression,
ObjectExpression,
NewExpression,
UpdateExpression,
ArrayExpression,
BindExpression,
SpreadElement,
TypeCastExpression,
SequenceExpression,
TSNonNullExpression,
AssignmentExpression,
};
const noop = () => null;
const errorMessage = (expression) => `The prop value with an expression type of ${expression} could not be resolved. Please file an issue ( https://github.com/jsx-eslint/jsx-ast-utils/issues/new ) to get this fixed immediately.`;
/**
* This function maps an AST value node
* to its correct extractor function for its
* given type.
*
* This will map correctly for *all* possible expression types.
*
* @param - value - AST Value object with type `JSXExpressionContainer`
* @returns The extracted value.
*/
export default function extract(value) {
// Value will not have the expression property when we recurse.
// The type for expression on ArrowFunctionExpression is a boolean.
let expression;
if (
typeof value.expression !== 'boolean'
&& value.expression
) {
expression = value.expression; // eslint-disable-line prefer-destructuring
} else {
expression = value;
}
let { type } = expression;
// Typescript NonNull Expression is wrapped & it would end up in the wrong extractor
if (expression.object && expression.object.type === 'TSNonNullExpression') {
type = 'TSNonNullExpression';
}
while (type === 'TSAsExpression') {
({ type } = expression);
if (expression.expression) {
({ expression } = expression);
}
}
if (TYPES[type] === undefined) {
// eslint-disable-next-line no-console
console.error(errorMessage(type));
return null;
}
return TYPES[type](expression);
}
// Composition map of types to their extractor functions to handle literals.
const LITERAL_TYPES = {
...TYPES,
Literal: (value) => {
const extractedVal = TYPES.Literal.call(undefined, value);
const isNull = extractedVal === null;
// This will be convention for attributes that have null
// value explicitly defined (<div prop={null} /> maps to 'null').
return isNull ? 'null' : extractedVal;
},
Identifier: (value) => {
const isUndefined = TYPES.Identifier.call(undefined, value) === undefined;
return isUndefined ? undefined : null;
},
JSXElement: noop,
JSXFragment: noop,
JSXText: noop,
ArrowFunctionExpression: noop,
FunctionExpression: noop,
LogicalExpression: noop,
MemberExpression: noop,
OptionalCallExpression: noop,
OptionalMemberExpression: noop,
CallExpression: noop,
UnaryExpression: (value) => {
const extractedVal = TYPES.UnaryExpression.call(undefined, value);
return extractedVal === undefined ? null : extractedVal;
},
UpdateExpression: (value) => {
const extractedVal = TYPES.UpdateExpression.call(undefined, value);
return extractedVal === undefined ? null : extractedVal;
},
ThisExpression: noop,
ConditionalExpression: noop,
BinaryExpression: noop,
ObjectExpression: noop,
NewExpression: noop,
ArrayExpression: (value) => {
const extractedVal = TYPES.ArrayExpression.call(undefined, value);
return extractedVal.filter((val) => val !== null);
},
BindExpression: noop,
SpreadElement: noop,
TSNonNullExpression: noop,
TSAsExpression: noop,
TypeCastExpression: noop,
SequenceExpression: noop,
ChainExpression: noop,
};
/**
* This function maps an AST value node
* to its correct extractor function for its
* given type.
*
* This will map correctly for *some* possible types that map to literals.
*
* @param - value - AST Value object with type `JSXExpressionContainer`
* @returns The extracted value.
*/
export function extractLiteral(value) {
// Value will not have the expression property when we recurse.
const expression = value.expression || value;
const { type } = expression;
if (LITERAL_TYPES[type] === undefined) {
// eslint-disable-next-line no-console
console.error(errorMessage(type));
return null;
}
return LITERAL_TYPES[type](expression);
}
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"F A B","16":"wC","260":"K D E"},B:{"1":"0 1 2 3 4 5 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I"},C:{"1":"0 1 2 3 4 5 xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","132":"6 7 8 9 xC TC J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB 0C 1C","2180":"oB pB qB rB sB tB uB vB wB"},D:{"1":"0 1 2 3 4 5 6 7 8 9 G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","16":"J ZB K D E F A B C L M"},E:{"1":"K D E F A B C L M G 3C 4C 5C 6C aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED","16":"J ZB 2C ZC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","132":"F B C FD GD HD ID NC uC JD OC"},G:{"16":"vC","132":"ZC KD","516":"E LD MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC"},H:{"2":"hD"},I:{"1":"I mD nD","16":"TC J iD jD kD lD","1025":"vC"},J:{"1":"A","16":"D"},K:{"1":"H","16":"A B C NC uC","132":"OC"},L:{"1":"I"},M:{"1":"MC"},N:{"1":"B","16":"A"},O:{"1":"PC"},P:{"1":"6 7 8 9 J AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"2D","2180":"1D"}},B:5,C:"Selection API",D:true};
@@ -0,0 +1,205 @@
/*!
* express
* Copyright(c) 2009-2013 TJ Holowaychuk
* Copyright(c) 2013 Roman Shtylman
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/
'use strict';
/**
* Module dependencies.
* @private
*/
var debug = require('debug')('express:view');
var path = require('node:path');
var fs = require('node:fs');
/**
* Module variables.
* @private
*/
var dirname = path.dirname;
var basename = path.basename;
var extname = path.extname;
var join = path.join;
var resolve = path.resolve;
/**
* Module exports.
* @public
*/
module.exports = View;
/**
* Initialize a new `View` with the given `name`.
*
* Options:
*
* - `defaultEngine` the default template engine name
* - `engines` template engine require() cache
* - `root` root path for view lookup
*
* @param {string} name
* @param {object} options
* @public
*/
function View(name, options) {
var opts = options || {};
this.defaultEngine = opts.defaultEngine;
this.ext = extname(name);
this.name = name;
this.root = opts.root;
if (!this.ext && !this.defaultEngine) {
throw new Error('No default engine was specified and no extension was provided.');
}
var fileName = name;
if (!this.ext) {
// get extension from default engine name
this.ext = this.defaultEngine[0] !== '.'
? '.' + this.defaultEngine
: this.defaultEngine;
fileName += this.ext;
}
if (!opts.engines[this.ext]) {
// load engine
var mod = this.ext.slice(1)
debug('require "%s"', mod)
// default engine export
var fn = require(mod).__express
if (typeof fn !== 'function') {
throw new Error('Module "' + mod + '" does not provide a view engine.')
}
opts.engines[this.ext] = fn
}
// store loaded engine
this.engine = opts.engines[this.ext];
// lookup path
this.path = this.lookup(fileName);
}
/**
* Lookup view by the given `name`
*
* @param {string} name
* @private
*/
View.prototype.lookup = function lookup(name) {
var path;
var roots = [].concat(this.root);
debug('lookup "%s"', name);
for (var i = 0; i < roots.length && !path; i++) {
var root = roots[i];
// resolve the path
var loc = resolve(root, name);
var dir = dirname(loc);
var file = basename(loc);
// resolve the file
path = this.resolve(dir, file);
}
return path;
};
/**
* Render with the given options.
*
* @param {object} options
* @param {function} callback
* @private
*/
View.prototype.render = function render(options, callback) {
var sync = true;
debug('render "%s"', this.path);
// render, normalizing sync callbacks
this.engine(this.path, options, function onRender() {
if (!sync) {
return callback.apply(this, arguments);
}
// copy arguments
var args = new Array(arguments.length);
var cntx = this;
for (var i = 0; i < arguments.length; i++) {
args[i] = arguments[i];
}
// force callback to be async
return process.nextTick(function renderTick() {
return callback.apply(cntx, args);
});
});
sync = false;
};
/**
* Resolve the file within the given directory.
*
* @param {string} dir
* @param {string} file
* @private
*/
View.prototype.resolve = function resolve(dir, file) {
var ext = this.ext;
// <path>.<ext>
var path = join(dir, file);
var stat = tryStat(path);
if (stat && stat.isFile()) {
return path;
}
// <path>/index.<ext>
path = join(dir, basename(file, ext), 'index' + ext);
stat = tryStat(path);
if (stat && stat.isFile()) {
return path;
}
};
/**
* Return a stat, maybe.
*
* @param {string} path
* @return {fs.Stats}
* @private
*/
function tryStat(path) {
debug('stat "%s"', path);
try {
return fs.statSync(path);
} catch (e) {
return undefined;
}
}
@@ -0,0 +1,381 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Font = void 0;
exports.createFont = createFont;
exports.default = void 0;
var _buffer = _interopRequireDefault(require("../nodejs/buffer"));
var _getEmptyttfObject = _interopRequireDefault(require("./getEmptyttfObject"));
var _ttf = _interopRequireDefault(require("./ttf"));
var _woff2ttf = _interopRequireDefault(require("./woff2ttf"));
var _otf2ttfobject = _interopRequireDefault(require("./otf2ttfobject"));
var _eot2ttf = _interopRequireDefault(require("./eot2ttf"));
var _svg2ttfobject = _interopRequireDefault(require("./svg2ttfobject"));
var _ttfreader = _interopRequireDefault(require("./ttfreader"));
var _ttfwriter = _interopRequireDefault(require("./ttfwriter"));
var _ttf2eot = _interopRequireDefault(require("./ttf2eot"));
var _ttf2woff = _interopRequireDefault(require("./ttf2woff"));
var _ttf2svg = _interopRequireDefault(require("./ttf2svg"));
var _ttf2symbol = _interopRequireDefault(require("./ttf2symbol"));
var _ttftowoff = _interopRequireDefault(require("./ttftowoff2"));
var _woff2tottf = _interopRequireDefault(require("./woff2tottf"));
var _ttf2base = _interopRequireDefault(require("./ttf2base64"));
var _eot2base = _interopRequireDefault(require("./eot2base64"));
var _woff2base = _interopRequireDefault(require("./woff2base64"));
var _svg2base = _interopRequireDefault(require("./svg2base64"));
var _bytes2base = _interopRequireDefault(require("./util/bytes2base64"));
var _woff2tobase = _interopRequireDefault(require("./woff2tobase64"));
var _optimizettf = _interopRequireDefault(require("./util/optimizettf"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } /**
* @file 字体管理对象,处理字体相关的读取、查询、转换
*
* @author mengke01(kekee000@gmail.com)
*/
// 必须是nodejs环境下的Buffer对象才能触发buffer转换
var SUPPORT_BUFFER = (typeof process === "undefined" ? "undefined" : _typeof(process)) === 'object' && _typeof(process.versions) === 'object' && typeof process.versions.node !== 'undefined' && typeof Buffer === 'function';
var Font = exports.Font = /*#__PURE__*/function () {
/**
* 字体对象构造函数
*
* @param {ArrayBuffer|Buffer|string|Document} buffer 字体数据
* @param {Object} options 读取参数
*/
function Font(buffer) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
type: 'ttf'
};
_classCallCheck(this, Font);
// 字形对象
if (_typeof(buffer) === 'object' && buffer.glyf) {
this.set(buffer);
}
// buffer
else if (buffer) {
this.read(buffer, options);
}
// 空
else {
this.readEmpty();
}
}
/**
* Create a Font instance
*
* @param {ArrayBuffer|Buffer|string|Document} buffer 字体数据
* @param {Object} options 读取参数
* @return {Font}
*/
return _createClass(Font, [{
key: "readEmpty",
value:
/**
* 设置一个空的 ttfObject 对象
*
* @return {Font}
*/
function readEmpty() {
this.data = (0, _getEmptyttfObject.default)();
return this;
}
/**
* 读取字体数据
*
* @param {ArrayBuffer|Buffer|string|Document} buffer 字体数据
* @param {Object} options 读取参数
* @param {string} options.type 字体类型
*
* ttf, woff , eot 读取配置
* @param {boolean} options.hinting 是否保留 hinting 信息
* @param {boolean} options.kerning 是否保留 kerning 信息
* @param {boolean} options.compound2simple 复合字形转简单字形
*
* woff 读取配置
* @param {Function} options.inflate 解压相关函数
*
* svg 读取配置
* @param {boolean} options.combinePath 是否合并成单个字形,仅限于普通svg导入
* @return {Font}
*/
}, {
key: "read",
value: function read(buffer, options) {
// nodejs buffer
if (SUPPORT_BUFFER) {
if (buffer instanceof Buffer) {
buffer = _buffer.default.toArrayBuffer(buffer);
}
}
if (options.type === 'ttf') {
this.data = new _ttfreader.default(options).read(buffer);
} else if (options.type === 'otf') {
this.data = (0, _otf2ttfobject.default)(buffer, options);
} else if (options.type === 'eot') {
buffer = (0, _eot2ttf.default)(buffer, options);
this.data = new _ttfreader.default(options).read(buffer);
} else if (options.type === 'woff') {
buffer = (0, _woff2ttf.default)(buffer, options);
this.data = new _ttfreader.default(options).read(buffer);
} else if (options.type === 'woff2') {
buffer = (0, _woff2tottf.default)(buffer, options);
this.data = new _ttfreader.default(options).read(buffer);
} else if (options.type === 'svg') {
this.data = (0, _svg2ttfobject.default)(buffer, options);
} else {
throw new Error('not support font type' + options.type);
}
this.type = options.type;
return this;
}
/**
* 写入字体数据
*
* @param {Object} options 写入参数
* @param {string} options.type 字体类型, 默认 ttf
* @param {boolean} options.toBuffer nodejs 环境中返回 Buffer 对象, 默认 true
*
* ttf 字体参数
* @param {boolean} options.hinting 是否保留 hinting 信息
* @param {boolean} options.kerning 是否保留 kerning 信息
* svg,woff 字体参数
* @param {Object} options.metadata 字体相关的信息
*
* woff 字体参数
* @param {Function} options.deflate 压缩相关函数
* @return {Buffer|ArrayBuffer|string}
*/
}, {
key: "write",
value: function write() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
if (!options.type) {
options.type = this.type;
}
var buffer = null;
if (options.type === 'ttf') {
buffer = new _ttfwriter.default(options).write(this.data);
} else if (options.type === 'eot') {
buffer = new _ttfwriter.default(options).write(this.data);
buffer = (0, _ttf2eot.default)(buffer, options);
} else if (options.type === 'woff') {
buffer = new _ttfwriter.default(options).write(this.data);
buffer = (0, _ttf2woff.default)(buffer, options);
} else if (options.type === 'woff2') {
buffer = new _ttfwriter.default(options).write(this.data);
buffer = (0, _ttftowoff.default)(buffer, options);
} else if (options.type === 'svg') {
buffer = (0, _ttf2svg.default)(this.data, options);
} else if (options.type === 'symbol') {
buffer = (0, _ttf2symbol.default)(this.data, options);
} else {
throw new Error('not support font type' + options.type);
}
if (SUPPORT_BUFFER) {
if (false !== options.toBuffer && buffer instanceof ArrayBuffer) {
buffer = _buffer.default.toBuffer(buffer);
}
}
return buffer;
}
/**
* 转换成 base64编码
*
* @param {Object} options 写入参数
* @param {string} options.type 字体类型, 默认 ttf
* 其他 options参数, 参考 write
* @see write
*
* @param {ArrayBuffer=} buffer 如果提供了buffer数据则使用 buffer数据, 否则转换现有的 font
* @return {string}
*/
}, {
key: "toBase64",
value: function toBase64(options, buffer) {
if (!options.type) {
options.type = this.type;
}
if (buffer) {
if (SUPPORT_BUFFER) {
if (buffer instanceof Buffer) {
buffer = _buffer.default.toArrayBuffer(buffer);
}
}
} else {
options.toBuffer = false;
buffer = this.write(options);
}
var base64Str;
if (options.type === 'ttf') {
base64Str = (0, _ttf2base.default)(buffer);
} else if (options.type === 'eot') {
base64Str = (0, _eot2base.default)(buffer);
} else if (options.type === 'woff') {
base64Str = (0, _woff2base.default)(buffer);
} else if (options.type === 'woff2') {
base64Str = (0, _woff2tobase.default)(buffer);
} else if (options.type === 'svg') {
base64Str = (0, _svg2base.default)(buffer);
} else if (options.type === 'symbol') {
base64Str = (0, _svg2base.default)(buffer, 'image/svg+xml');
} else {
throw new Error('not support font type' + options.type);
}
return base64Str;
}
/**
* 设置 font 对象
*
* @param {Object} data font的ttfObject对象
* @return {this}
*/
}, {
key: "set",
value: function set(data) {
this.data = data;
return this;
}
/**
* 获取 font 数据
*
* @return {Object} ttfObject 对象
*/
}, {
key: "get",
value: function get() {
return this.data;
}
/**
* 对字形数据进行优化
*
* @param {Object} out 输出结果
* @param {boolean|Object} out.result `true` 或者有问题的地方
* @return {Font}
*/
}, {
key: "optimize",
value: function optimize(out) {
var result = (0, _optimizettf.default)(this.data);
if (out) {
out.result = result;
}
return this;
}
/**
* 将字体中的复合字形转为简单字形
*
* @return {this}
*/
}, {
key: "compound2simple",
value: function compound2simple() {
var ttfHelper = this.getHelper();
ttfHelper.compound2simple();
this.data = ttfHelper.get();
return this;
}
/**
* 对字形按照unicode编码排序
*
* @return {this}
*/
}, {
key: "sort",
value: function sort() {
var ttfHelper = this.getHelper();
ttfHelper.sortGlyf();
this.data = ttfHelper.get();
return this;
}
/**
* 查找相关字形
*
* @param {Object} condition 查询条件
* @param {Array|number} condition.unicode unicode编码列表或者单个unicode编码
* @param {string} condition.name glyf名字,例如`uniE001`, `uniE`
* @param {Function} condition.filter 自定义过滤器
* @example
* condition.filter(glyf) {
* return glyf.name === 'logo';
* }
* @return {Array} glyf字形列表
*/
}, {
key: "find",
value: function find(condition) {
var ttfHelper = this.getHelper();
var indexList = ttfHelper.findGlyf(condition);
return indexList.length ? ttfHelper.getGlyf(indexList) : indexList;
}
/**
* 合并 font 到当前的 font
*
* @param {Object} font Font 对象
* @param {Object} options 参数选项
* @param {boolean} options.scale 是否自动缩放
* @param {boolean} options.adjustGlyf 是否调整字形以适应边界
* (和 options.scale 参数互斥)
*
* @return {Font}
*/
}, {
key: "merge",
value: function merge(font, options) {
var ttfHelper = this.getHelper();
ttfHelper.mergeGlyf(font.get(), options);
this.data = ttfHelper.get();
return this;
}
/**
* 获取 TTF helper 实例
*/
}, {
key: "getHelper",
value: function getHelper() {
return new _ttf.default(this.data);
}
}], [{
key: "create",
value: function create(buffer, options) {
return new Font(buffer, options);
}
}]);
}();
/**
* base64序列化buffer 数据
*
* @param {ArrayBuffer|Buffer|string} buffer 字体数据
* @return {Font}
*/
Font.toBase64 = function (buffer) {
if (typeof buffer === 'string') {
// node 环境中没有 btoa 函数
if (typeof btoa === 'undefined') {
return Buffer.from(buffer, 'binary').toString('base64');
}
return btoa(buffer);
}
return (0, _bytes2base.default)(buffer);
};
function createFont(buffer, options) {
return new Font(buffer, options);
}
var _default = exports.default = Font;
@@ -0,0 +1,59 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _ariaQuery = require("aria-query");
var _jsxAstUtils = require("jsx-ast-utils");
var _schemas = require("../util/schemas");
var _getSuggestion = _interopRequireDefault(require("../util/getSuggestion"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
/**
* @fileoverview Enforce all aria-* properties are valid.
* @author Ethan Cohen
*/
// ----------------------------------------------------------------------------
// Rule Definition
// ----------------------------------------------------------------------------
var ariaAttributes = _ariaQuery.aria.keys();
var errorMessage = function errorMessage(name) {
var suggestions = (0, _getSuggestion["default"])(name, ariaAttributes);
var message = "".concat(name, ": This attribute is an invalid ARIA attribute.");
if (suggestions.length > 0) {
return "".concat(message, " Did you mean to use ").concat(suggestions, "?");
}
return message;
};
var schema = (0, _schemas.generateObjSchema)();
var _default = exports["default"] = {
meta: {
docs: {
url: 'https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/tree/HEAD/docs/rules/aria-props.md',
description: 'Enforce all `aria-*` props are valid.'
},
schema: [schema]
},
create: function create(context) {
return {
JSXAttribute: function JSXAttribute(attribute) {
var name = (0, _jsxAstUtils.propName)(attribute);
// `aria` needs to be prefix of property.
if (name.indexOf('aria-') !== 0) {
return;
}
var isValid = _ariaQuery.aria.has(name);
if (isValid === false) {
context.report({
node: attribute,
message: errorMessage(name)
});
}
}
};
}
};
module.exports = exports.default;
@@ -0,0 +1,66 @@
"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: 'no-this-alias',
meta: {
type: 'suggestion',
docs: {
description: 'Disallow aliasing `this`',
recommended: 'recommended',
},
messages: {
thisAssignment: "Unexpected aliasing of 'this' to local variable.",
thisDestructure: "Unexpected aliasing of members of 'this' to local variables.",
},
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
allowDestructuring: {
type: 'boolean',
description: 'Whether to ignore destructurings, such as `const { props, state } = this`.',
},
allowedNames: {
type: 'array',
description: 'Names to ignore, such as ["self"] for `const self = this;`.',
items: {
type: 'string',
},
},
},
},
],
},
defaultOptions: [
{
allowDestructuring: true,
allowedNames: [],
},
],
create(context, [{ allowDestructuring, allowedNames }]) {
return {
"VariableDeclarator[init.type='ThisExpression'], AssignmentExpression[right.type='ThisExpression']"(node) {
const id = node.type === utils_1.AST_NODE_TYPES.VariableDeclarator ? node.id : node.left;
if (allowDestructuring && id.type !== utils_1.AST_NODE_TYPES.Identifier) {
return;
}
const hasAllowedName = id.type === utils_1.AST_NODE_TYPES.Identifier
? // https://github.com/typescript-eslint/typescript-eslint/issues/5439
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
allowedNames.includes(id.name)
: false;
if (!hasAllowedName) {
context.report({
node: id,
messageId: id.type === utils_1.AST_NODE_TYPES.Identifier
? 'thisAssignment'
: 'thisDestructure',
});
}
},
};
},
});
@@ -0,0 +1 @@
{"version":3,"file":"state-in-constructor.d.ts","sourceRoot":"","sources":["state-in-constructor.js"],"names":[],"mappings":"wBAqBW,OAAO,QAAQ,EAAE,IAAI,CAAC,UAAU"}
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more