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,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var IgnoredRole = {
relatedConcepts: [],
type: 'structure'
};
var _default = IgnoredRole;
exports.default = _default;
@@ -0,0 +1,80 @@
# EE First
[![NPM version][npm-image]][npm-url]
[![Build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![Gittip][gittip-image]][gittip-url]
Get the first event in a set of event emitters and event pairs,
then clean up after itself.
## Install
```sh
$ npm install ee-first
```
## API
```js
var first = require('ee-first')
```
### first(arr, listener)
Invoke `listener` on the first event from the list specified in `arr`. `arr` is
an array of arrays, with each array in the format `[ee, ...event]`. `listener`
will be called only once, the first time any of the given events are emitted. If
`error` is one of the listened events, then if that fires first, the `listener`
will be given the `err` argument.
The `listener` is invoked as `listener(err, ee, event, args)`, where `err` is the
first argument emitted from an `error` event, if applicable; `ee` is the event
emitter that fired; `event` is the string event name that fired; and `args` is an
array of the arguments that were emitted on the event.
```js
var ee1 = new EventEmitter()
var ee2 = new EventEmitter()
first([
[ee1, 'close', 'end', 'error'],
[ee2, 'error']
], function (err, ee, event, args) {
// listener invoked
})
```
#### .cancel()
The group of listeners can be cancelled before being invoked and have all the event
listeners removed from the underlying event emitters.
```js
var thunk = first([
[ee1, 'close', 'end', 'error'],
[ee2, 'error']
], function (err, ee, event, args) {
// listener invoked
})
// cancel and clean up
thunk.cancel()
```
[npm-image]: https://img.shields.io/npm/v/ee-first.svg?style=flat-square
[npm-url]: https://npmjs.org/package/ee-first
[github-tag]: http://img.shields.io/github/tag/jonathanong/ee-first.svg?style=flat-square
[github-url]: https://github.com/jonathanong/ee-first/tags
[travis-image]: https://img.shields.io/travis/jonathanong/ee-first.svg?style=flat-square
[travis-url]: https://travis-ci.org/jonathanong/ee-first
[coveralls-image]: https://img.shields.io/coveralls/jonathanong/ee-first.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/jonathanong/ee-first?branch=master
[license-image]: http://img.shields.io/npm/l/ee-first.svg?style=flat-square
[license-url]: LICENSE.md
[downloads-image]: http://img.shields.io/npm/dm/ee-first.svg?style=flat-square
[downloads-url]: https://npmjs.org/package/ee-first
[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square
[gittip-url]: https://www.gittip.com/jonathanong/
@@ -0,0 +1,56 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
const {
CALL,
CONSTRUCT,
PatternMatcher,
ReferenceTracker,
getStringIfConstant,
} = require("eslint-utils")
module.exports = {
/**
* Define generator to search pattern.
* The iterator generated by the generator returns the start and end index of the match.
* @param {RegExp} pattern Base pattern
* @returns {function(string):IterableIterator<RegExpExecArray>} generator
*/
definePatternSearchGenerator(pattern) {
const matcher = new PatternMatcher(pattern)
return matcher.execAll.bind(matcher)
},
/**
* Check whether a given token is a comma token or not.
* @param {Token} token The token to check.
* @returns {boolean} `true` if the token is a comma token.
*/
isCommaToken(token) {
return (
token != null && token.type === "Punctuator" && token.value === ","
)
},
/**
* Iterate the calls of the `RegExp` global variable.
* @param {Scope} globalScope The global scope object.
* @returns {IterableIterator<{node:Node,pattern:(string|null),flags:(string|null)}>} The iterator of `CallExpression` or `NewExpression` for `RegExp`.
*/
*getRegExpCalls(globalScope) {
const tracker = new ReferenceTracker(globalScope)
for (const { node } of tracker.iterateGlobalReferences({
RegExp: { [CALL]: true, [CONSTRUCT]: true },
})) {
const [patternNode, flagsNode] = node.arguments
yield {
node,
pattern: getStringIfConstant(patternNode, globalScope),
flags: getStringIfConstant(flagsNode, globalScope),
}
}
},
}
@@ -0,0 +1,31 @@
import { MotionGlobalConfig } from 'motion-utils';
import { frameData } from './frame.mjs';
let now;
function clearTime() {
now = undefined;
}
/**
* An eventloop-synchronous alternative to performance.now().
*
* Ensures that time measurements remain consistent within a synchronous context.
* Usually calling performance.now() twice within the same synchronous context
* will return different values which isn't useful for animations when we're usually
* trying to sync animations to the same frame.
*/
const time = {
now: () => {
if (now === undefined) {
time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming
? frameData.timestamp
: performance.now());
}
return now;
},
set: (newTime) => {
now = newTime;
queueMicrotask(clearTime);
},
};
export { time };
@@ -0,0 +1,5 @@
export { AnimationManager } from './AnimationManager';
export type { Animation } from './AnimationManager';
export { NullifiedContextProvider } from './NullifiedContextProvider';
export { PositionedOverlay } from './PositionedOverlay';
export type { PositionedOverlayProps } from './PositionedOverlay';
@@ -0,0 +1,305 @@
# micromark-extension-gfm-task-list-item
[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]
[micromark][] extensions to support GFM [task list items][].
## Contents
* [What is this?](#what-is-this)
* [When to use this](#when-to-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [`gfmTaskListItem()`](#gfmtasklistitem)
* [`gfmTaskListItemHtml()`](#gfmtasklistitemhtml)
* [Authoring](#authoring)
* [HTML](#html)
* [CSS](#css)
* [Syntax](#syntax)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)
## What is this?
This package contains extensions that add support for task lists as enabled by
GFM to [`micromark`][micromark].
It matches how task list items work on `github.com`.
## When to use this
This project is useful when you want to support task lists in markdown.
You can use these extensions when you are working with [`micromark`][micromark].
To support all GFM features, use
[`micromark-extension-gfm`][micromark-extension-gfm].
When you need a syntax tree, you can combine this package with
[`mdast-util-gfm-task-list-item`][mdast-util-gfm-task-list-item].
All these packages are used [`remark-gfm`][remark-gfm], which focusses on making
it easier to transform content by abstracting these internals away.
## Install
This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:
```sh
npm install micromark-extension-gfm-task-list-item
```
In Deno with [`esm.sh`][esmsh]:
```js
import {gfmTaskListItem, gfmTaskListItemHtml} from 'https://esm.sh/micromark-extension-gfm-task-list-item@2'
```
In browsers with [`esm.sh`][esmsh]:
```html
<script type="module">
import {gfmTaskListItem, gfmTaskListItemHtml} from 'https://esm.sh/micromark-extension-gfm-task-list-item@2?bundle'
</script>
```
## Use
```js
import {micromark} from 'micromark'
import {
gfmTaskListItem,
gfmTaskListItemHtml
} from 'micromark-extension-gfm-task-list-item'
const output = micromark('* [x] a\n* [ ] b', {
extensions: [gfmTaskListItem()],
htmlExtensions: [gfmTaskListItemHtml()]
})
console.log(output)
```
Yields:
```html
<ul>
<li><input type="checkbox" disabled="" checked="" /> a</li>
<li><input type="checkbox" disabled="" /> b</li>
</ul>
```
## API
This package exports the identifiers [`gfmTaskListItem`][api-gfm-task-list-item]
and [`gfmTaskListItemHtml`][api-gfm-task-list-item-html].
There is no default export.
The export map supports the [`development` condition][development].
Run `node --conditions development module.js` to get instrumented dev code.
Without this condition, production code is loaded.
### `gfmTaskListItem()`
Create an HTML extension for `micromark` to support GFM task list items
syntax.
###### Returns
Extension for `micromark` that can be passed in `extensions`, to enable GFM
task list items syntax ([`Extension`][micromark-extension]).
### `gfmTaskListItemHtml()`
Create an HTML extension for `micromark` to support GFM task list items when
serializing to HTML.
###### Returns
Extension for `micromark` that can be passed in `htmlExtensions` to support GFM
task list items when serializing to HTML
([`HtmlExtension`][micromark-html-extension]).
## Authoring
It is recommended to use lowercase `x` (instead of uppercase `X`), because in
markdown, it is more common to use lowercase in places where casing does not
matter.
It is also recommended to use a space (instead of a tab), as there is no benefit
of using tabs in this case.
## HTML
Checks relate to the `<input>` element, in the checkbox state (`type=checkbox`),
in HTML.
See [*§ 4.10.5.1.15 Checkbox state (`type=checkbox`)*][html-input-checkbox]
in the HTML spec for more info.
```html
<!--…-->
<li><input type="checkbox" disabled="" /> foo</li>
<li><input type="checkbox" disabled="" checked="" /> bar</li>
<!--…-->
```
## CSS
GitHub itself uses slightly different markup for task list items than they
define in their spec.
When following the spec, as this extension does, only inputs are added.
They can be styled with the following CSS:
```css
input[type="checkbox"] {
margin: 0 .2em .25em -1.6em;
vertical-align: middle;
}
input[type="checkbox"]:dir(rtl) {
margin: 0 -1.6em .25em .2em;
}
```
For the complete actual CSS see
[`sindresorhus/github-markdown-css`][github-markdown-css].
## Syntax
Checks form with the following BNF:
```bnf
gfm_task_list_item_check ::= '[' (0x09 | ' ' | 'X' | 'x') ']'
```
The check is only allowed at the start of the first paragraph, optionally
following zero or more definitions or a blank line, in a list item.
The check must be followed by whitespace (`[\t\n\r ]*`), which is in turn
followed by non-whitespace.
## Types
This package is fully typed with [TypeScript][].
It exports no additional types.
## Compatibility
Projects maintained by the unified collective are compatible with maintained
versions of Node.js.
When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-extension-gfm-task-list-item@^2`, compatible with Node.js 16.
This package works with `micromark` version `3` and later.
## Security
This package is safe.
## Related
* [`micromark-extension-gfm`][micromark-extension-gfm]
— support all of GFM
* [`mdast-util-gfm-task-list-item`][mdast-util-gfm-task-list-item]
— support all of GFM in mdast
* [`mdast-util-gfm`][mdast-util-gfm]
— support all of GFM in mdast
* [`remark-gfm`][remark-gfm]
— support all of GFM in remark
## Contribute
See [`contributing.md` in `micromark/.github`][contributing] for ways to get
started.
See [`support.md`][support] for ways to get help.
This project has a [code of conduct][coc].
By interacting with this repository, organization, or community you agree to
abide by its terms.
## License
[MIT][license] © [Titus Wormer][author]
<!-- Definitions -->
[build-badge]: https://github.com/micromark/micromark-extension-gfm-task-list-item/workflows/main/badge.svg
[build]: https://github.com/micromark/micromark-extension-gfm-task-list-item/actions
[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark-extension-gfm-task-list-item.svg
[coverage]: https://codecov.io/github/micromark/micromark-extension-gfm-task-list-item
[downloads-badge]: https://img.shields.io/npm/dm/micromark-extension-gfm-task-list-item.svg
[downloads]: https://www.npmjs.com/package/micromark-extension-gfm-task-list-item
[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-extension-gfm-task-list-item
[size]: https://bundlejs.com/?q=micromark-extension-gfm-task-list-item
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
[collective]: https://opencollective.com/unified
[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
[chat]: https://github.com/micromark/micromark/discussions
[npm]: https://docs.npmjs.com/cli/install
[esmsh]: https://esm.sh
[license]: license
[author]: https://wooorm.com
[contributing]: https://github.com/micromark/.github/blob/main/contributing.md
[support]: https://github.com/micromark/.github/blob/main/support.md
[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md
[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
[typescript]: https://www.typescriptlang.org
[development]: https://nodejs.org/api/packages.html#packages_resolving_user_conditions
[micromark]: https://github.com/micromark/micromark
[micromark-html-extension]: https://github.com/micromark/micromark#htmlextension
[micromark-extension]: https://github.com/micromark/micromark#syntaxextension
[micromark-extension-gfm]: https://github.com/micromark/micromark-extension-gfm
[mdast-util-gfm-task-list-item]: https://github.com/syntax-tree/mdast-util-gfm-task-list-item
[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm
[remark-gfm]: https://github.com/remarkjs/remark-gfm
[task list items]: https://github.github.com/gfm/#task-list-items-extension-
[github-markdown-css]: https://github.com/sindresorhus/github-markdown-css
[html-input-checkbox]: https://html.spec.whatwg.org/multipage/input.html#checkbox-state-\(type=checkbox\)
[api-gfm-task-list-item]: #gfmtasklistitem
[api-gfm-task-list-item-html]: #gfmtasklistitemhtml
@@ -0,0 +1 @@
module.exports = require('./lib').propName; // eslint-disable-line import/no-unresolved
@@ -0,0 +1,52 @@
# es-to-primitive <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
ECMAScript “ToPrimitive” algorithm. Provides ES5 and ES2015 versions.
When different versions of the spec conflict, the default export will be the latest version of the abstract operation.
Alternative versions will also be available under an `es5`/`es2015` exported property if you require a specific version.
## Example
```js
var toPrimitive = require('es-to-primitive');
var assert = require('assert');
assert(toPrimitive(function () {}) === String(function () {}));
var date = new Date();
assert(toPrimitive(date) === String(date));
assert(toPrimitive({ valueOf: function () { return 3; } }) === 3);
assert(toPrimitive(['a', 'b', 3]) === String(['a', 'b', 3]));
var sym = Symbol();
assert(toPrimitive(Object(sym)) === sym);
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
[package-url]: https://npmjs.org/package/es-to-primitive
[npm-version-svg]: https://versionbadg.es/ljharb/es-to-primitive.svg
[deps-svg]: https://david-dm.org/ljharb/es-to-primitive.svg
[deps-url]: https://david-dm.org/ljharb/es-to-primitive
[dev-deps-svg]: https://david-dm.org/ljharb/es-to-primitive/dev-status.svg
[dev-deps-url]: https://david-dm.org/ljharb/es-to-primitive#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/es-to-primitive.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/es-to-primitive.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/es-to-primitive.svg
[downloads-url]: https://npm-stat.com/charts.html?package=es-to-primitive
[codecov-image]: https://codecov.io/gh/ljharb/es-to-primitive/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/ljharb/es-to-primitive/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/es-to-primitive
[actions-url]: https://github.com/ljharb/es-to-primitive/actions
@@ -0,0 +1,41 @@
# Encoding
**encoding** is a simple wrapper around [iconv-lite](https://github.com/ashtuchkin/iconv-lite/) to convert strings from one encoding to another.
[![Build Status](https://secure.travis-ci.org/andris9/encoding.svg)](http://travis-ci.org/andris9/Nodemailer)
[![npm version](https://badge.fury.io/js/encoding.svg)](http://badge.fury.io/js/encoding)
Initially _encoding_ was a wrapper around _node-iconv_ (main) and _iconv-lite_ (fallback) and was used as the encoding layer for Nodemailer/mailparser. Somehow it also ended up as a dependency for a bunch of other project, none of these actually using _node-iconv_. The loading mechanics caused issues for front-end projects and Nodemailer/malparser had moved on, so _node-iconv_ was removed.
## Install
Install through npm
npm install encoding
## Usage
Require the module
var encoding = require("encoding");
Convert with encoding.convert()
var resultBuffer = encoding.convert(text, toCharset, fromCharset);
Where
- **text** is either a Buffer or a String to be converted
- **toCharset** is the characterset to convert the string
- **fromCharset** (_optional_, defaults to UTF-8) is the source charset
Output of the conversion is always a Buffer object.
Example
var result = encoding.convert("ÕÄÖÜ", "Latin_1");
console.log(result); //<Buffer d5 c4 d6 dc>
## License
**MIT**
@@ -0,0 +1 @@
{"name":"@types/chai","version":"5.2.3","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532091866,"integrity":"sha512-HQaIQk9pwOcyKutyDk4o2a87WnotwYuLGYFW43emGm4FvIJFKPyg+OYaw5sTegKAKf+C5SKa1ACjzCLivbaHrQ==","mode":420,"size":1141},"README.md":{"checkedAt":1794532091867,"integrity":"sha512-CE2m7c1BkCHOF1tIFGl0qj7FcuI0lhwqZnpEuY/RM0672qzHljNIs8P/V2wF/2f31SpnS2RuifhIx+Gba9A0bA==","mode":420,"size":1009},"index.d.ts":{"checkedAt":1794532091867,"integrity":"sha512-KuHMuHNBj4j/OIXMIsYj44ddLW0z6+iViKlnisAHQvCzJo1A2Ns7W+jfxaLzILEVISQGiuVPVIB+mMATuEjiig==","mode":420,"size":87485},"package.json":{"checkedAt":1794532091867,"integrity":"sha512-X6dn5IiYes9ueBgVWosRlfwJLQuW3OwKLVPawMTdDCFDdMqtzpJyuHjFS+DbmitBDwtRJv0if7p7XTs+xpiHdg==","mode":420,"size":2284},"register-should.d.ts":{"checkedAt":1794532091867,"integrity":"sha512-h04NyoYUogdZ+B4PADQbZeD+OGORYQjQNxSru/uWAk0rrMGb3cKDa4EGf6pETgaRzFc2Axp+PB7fYBknKxX7Sg==","mode":420,"size":92}}}
@@ -0,0 +1,2 @@
'use strict';
require('../register')('lie', {Promise: require('lie')})
@@ -0,0 +1,14 @@
/**
* unopinionated config. just the things that are necessarily runtime errors
* waiting to happen.
* @type {Object}
*/
module.exports = {
plugins: ['import'],
rules: { 'import/no-unresolved': 2,
'import/named': 2,
'import/namespace': 2,
'import/default': 2,
'import/export': 2,
},
};
@@ -0,0 +1 @@
{"version":3,"file":"fallback.js","sourceRoot":"","sources":["../src/fallback.ts"],"names":[],"mappings":";AAAA,2DAAiD;AACjD,8BAA6B;AAC7B,8BAA6B;AAC7B,kCAAiC;AAEjC,iDAA4C;AAC5C,6CAAuE;AAGvE,MAAM,SAAS,GAAG;IAChB,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,CAAC,IAAc,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;CAC9E,CAAA;AAED,SAAS,gBAAgB,CACvB,KAAyD,EACzD,IAAc;IAEd,MAAM,IAAI,GACR,OAAO,KAAK,KAAK,UAAU;QACzB,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;QACb,CAAC;YACE,EAAe,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;IAC1C,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;QAChB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;KACpB,CAAA;AACH,CAAC;AASD,SAAS,QAAQ,CACf,eAAuB,EACvB,YAAsB;IAEtB,MAAM,WAAW,GAAG,OAAO,CAAC,eAAe,CAAgB,CAAA;IAE3D,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,GAAG,WAAW,CAAA;IAEvE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,UAAU,EAAE,GAAG,IAAA,uCAA0B,EAC/D,WAAW,EACX,YAAY,CACb,CAAA;IAED,IAAI,YAAY,IAAI,UAAU,KAAK,OAAO,EAAE,CAAC;QAC3C,MAAM,IAAI,KAAK,CACb,IAAA,yBAAY,EACV,6CAA6C,IAAI,OAAO,UAAU,SAAS,IAAI,CAAC,WAAW,OAAO,OAAO,GAAG,CAC7G,CACF,CAAA;IACH,CAAC;IAED,IAAI,OAAO,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC;QAClC,MAAM,cAAc,GAAG,GAAG,IAAI,CAAC,WAAW,IAAI,0BAAW,EAAE,CAAA;QAE3D,IAAI,CAAC,oBAAoB,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC;YAC5C,MAAM,IAAI,KAAK,CACb,IAAA,yBAAY,EACV,KAAK,0BAAW,kCAAkC,IAAI,OAAO,OAAO,EAAE,CACvE,CACF,CAAA;QACH,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,GAAG,IAAI,IAAI,OAAO,EAAE,CAAC,CAAA;QAE/D,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAC/B,OAAO,EACP,gBAAgB,cAAc,IAAI,IAAI,CAAC,UAAU,WAAW,CAC7D,CAAA;QAED,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;YACjC,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;YACpD,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;YAE1C,MAAM,UAAU,GAAG,GAAG,cAAc,IAAI,OAAO,EAAE,CAAA;YAEjD,OAAO,CAAC,GAAG,CACT,IAAA,yBAAY,EAAC,iBAAiB,UAAU,uBAAuB,CAAC,CACjE,CAAA;YAED,IAAA,iCAAY,EAAC,MAAM,EAAE,CAAC,GAAG,EAAE,UAAU,CAAC,EAAE;gBACtC,GAAG,EAAE,OAAO;gBACZ,KAAK,EAAE,SAAS;aACjB,CAAC,CAAA;QACJ,CAAC;QAED,OAAO,OAAO,CAAC,YAAY,CAAM,CAAA;IACnC,CAAC;IAED,MAAM,SAAS,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACxE,KAAK,CAA2B,CAAA;IAElC,MAAM,QAAQ,GAAG,SAAS,CAAC,SAAS,CAAC,CAAA;IAErC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CACb,IAAA,yBAAY,EACV,gCAAgC,SAAS,6BAA6B,MAAM,CAAC,IAAI,CAC/E,SAAS,CACV,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAChB,CACF,CAAA;IACH,CAAC;IAED,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,gBAAgB,CAAC,QAAQ,EAAE;QACnD,kBAAkB;QAClB,IAAI;QACJ,OAAO;QACP,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;KACzB,CAAC,CAAA;IAEF,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA;IAE5C,IAAA,iCAAY,EAAC,OAAO,EAAE,IAAI,EAAE;QAC1B,GAAG,EAAE,MAAM;QACX,KAAK,EAAE,SAAS;KACjB,CAAC,CAAA;IAGF,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,WAAW,CAAC,GAAG,GAAG,CAAA;IAE3E,MAAM,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IAEjD,OAAO,OAAO,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAA;IAEvC,OAAO,OAAO,CAAC,MAAM,CAAM,CAAA;AAC7B,CAAC;AAED,iBAAS,QAAQ,CAAA"}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B wC"},B:{"1":"0 1 2 3 4 5 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","2":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 6 7 8 9 AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","2":"xC TC J ZB K D E F A B C L M G N O P 0C 1C","132":"aB"},D:{"1":"0 1 2 3 4 5 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","2":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB"},E:{"1":"B C L M G 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","2":"J ZB K D E F A 2C ZC 3C 4C 5C 6C"},F:{"1":"0 1 2 3 4 5 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","2":"6 7 8 9 F B C G N O P aB AB FD GD HD ID NC uC JD OC"},G:{"1":"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","2":"E ZC KD vC LD MD ND OD PD QD RD"},H:{"2":"hD"},I:{"1":"I","2":"TC J iD jD kD lD vC mD nD"},J:{"2":"D A"},K:{"1":"H","2":"A B C NC uC OC"},L:{"1":"I"},M:{"1":"MC"},N:{"2":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 J AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"1D 2D"}},B:1,C:"TextEncoder & TextDecoder",D:true};
@@ -0,0 +1,13 @@
import { IPacketMsgElement } from '../../packet/message/element';
import { SendMessageElement, SendMultiForwardMsgElement } from '../../index';
export type PacketSendMsgElement = SendMessageElement | SendMultiForwardMsgElement;
export interface PacketMsg {
seq?: number;
clientSeq?: number;
groupId?: number;
senderUid: string;
senderUin: number;
senderName: string;
time: number;
msg: IPacketMsgElement<PacketSendMsgElement>[];
}
@@ -0,0 +1,225 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const memoize = require("./util/memoize");
/** @typedef {import("./CachedInputFileSystem").BaseFileSystem} BaseFileSystem */
/** @typedef {import("./PnpPlugin").PnpApiImpl} PnpApi */
/** @typedef {import("./Resolver")} Resolver */
/** @typedef {import("./Resolver").FileSystem} FileSystem */
/** @typedef {import("./Resolver").ResolveCallback} ResolveCallback */
/** @typedef {import("./Resolver").ResolveContext} ResolveContext */
/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */
/** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */
/** @typedef {import("./ResolverFactory").Plugin} Plugin */
/** @typedef {import("./ResolverFactory").UserResolveOptions} ResolveOptions */
/**
* @typedef {{
* (context: object, path: string, request: string, resolveContext: ResolveContext, callback: ResolveCallback): void;
* (context: object, path: string, request: string, callback: ResolveCallback): void;
* (path: string, request: string, resolveContext: ResolveContext, callback: ResolveCallback): void;
* (path: string, request: string, callback: ResolveCallback): void;
* }} ResolveFunctionAsync
*/
/**
* @typedef {{
* (context: object, path: string, request: string): string | false;
* (path: string, request: string): string | false;
* }} ResolveFunction
*/
const getCachedFileSystem = memoize(() => require("./CachedInputFileSystem"));
const getNodeFileSystem = memoize(() => {
const fs = require("graceful-fs");
const CachedInputFileSystem = getCachedFileSystem();
return new CachedInputFileSystem(fs, 4000);
});
const getNodeContext = memoize(() => ({
environments: ["node+es3+es5+process+native"],
}));
const getResolverFactory = memoize(() => require("./ResolverFactory"));
const getAsyncResolver = memoize(() =>
getResolverFactory().createResolver({
conditionNames: ["node"],
extensions: [".js", ".json", ".node"],
fileSystem: getNodeFileSystem(),
}),
);
/**
* @type {ResolveFunctionAsync}
*/
const resolve =
/**
* @param {object | string} context context
* @param {string} path path
* @param {string | ResolveContext | ResolveCallback} request request
* @param {ResolveContext | ResolveCallback=} resolveContext resolve context
* @param {ResolveCallback=} callback callback
*/
(context, path, request, resolveContext, callback) => {
if (typeof context === "string") {
callback = /** @type {ResolveCallback} */ (resolveContext);
resolveContext = /** @type {ResolveContext} */ (request);
request = path;
path = context;
context = getNodeContext();
}
if (typeof callback !== "function") {
callback = /** @type {ResolveCallback} */ (resolveContext);
}
getAsyncResolver().resolve(
context,
path,
/** @type {string} */ (request),
/** @type {ResolveContext} */ (resolveContext),
/** @type {ResolveCallback} */ (callback),
);
};
const getSyncResolver = memoize(() =>
getResolverFactory().createResolver({
conditionNames: ["node"],
extensions: [".js", ".json", ".node"],
useSyncFileSystemCalls: true,
fileSystem: getNodeFileSystem(),
}),
);
/**
* @type {ResolveFunction}
*/
const resolveSync =
/**
* @param {object|string} context context
* @param {string} path path
* @param {string=} request request
* @returns {string | false} result
*/
(context, path, request) => {
if (typeof context === "string") {
request = path;
path = context;
context = getNodeContext();
}
return getSyncResolver().resolveSync(
context,
path,
/** @type {string} */ (request),
);
};
/** @typedef {Omit<ResolveOptions, "fileSystem"> & Partial<Pick<ResolveOptions, "fileSystem">>} ResolveOptionsOptionalFS */
/**
* @param {ResolveOptionsOptionalFS} options Resolver options
* @returns {ResolveFunctionAsync} Resolver function
*/
function create(options) {
const resolver = getResolverFactory().createResolver({
fileSystem: getNodeFileSystem(),
...options,
});
/**
* @param {object|string} context Custom context
* @param {string} path Base path
* @param {string|ResolveContext|ResolveCallback} request String to resolve
* @param {ResolveContext|ResolveCallback=} resolveContext Resolve context
* @param {ResolveCallback=} callback Result callback
*/
return function create(context, path, request, resolveContext, callback) {
if (typeof context === "string") {
callback = /** @type {ResolveCallback} */ (resolveContext);
resolveContext = /** @type {ResolveContext} */ (request);
request = path;
path = context;
context = getNodeContext();
}
if (typeof callback !== "function") {
callback = /** @type {ResolveCallback} */ (resolveContext);
}
resolver.resolve(
context,
path,
/** @type {string} */ (request),
/** @type {ResolveContext} */ (resolveContext),
callback,
);
};
}
/**
* @param {ResolveOptionsOptionalFS} options Resolver options
* @returns {ResolveFunction} Resolver function
*/
function createSync(options) {
const resolver = getResolverFactory().createResolver({
useSyncFileSystemCalls: true,
fileSystem: getNodeFileSystem(),
...options,
});
/**
* @param {object | string} context custom context
* @param {string} path base path
* @param {string=} request request to resolve
* @returns {string | false} Resolved path or false
*/
return function createSync(context, path, request) {
if (typeof context === "string") {
request = path;
path = context;
context = getNodeContext();
}
return resolver.resolveSync(context, path, /** @type {string} */ (request));
};
}
/**
* @template A
* @template B
* @param {A} obj input a
* @param {B} exports input b
* @returns {A & B} merged
*/
const mergeExports = (obj, exports) => {
const descriptors = Object.getOwnPropertyDescriptors(exports);
Object.defineProperties(obj, descriptors);
return /** @type {A & B} */ (Object.freeze(obj));
};
module.exports = mergeExports(resolve, {
get sync() {
return resolveSync;
},
create: mergeExports(create, {
get sync() {
return createSync;
},
}),
get ResolverFactory() {
return getResolverFactory();
},
get CachedInputFileSystem() {
return getCachedFileSystem();
},
get CloneBasenamePlugin() {
return require("./CloneBasenamePlugin");
},
get LogInfoPlugin() {
return require("./LogInfoPlugin");
},
get forEachBail() {
return require("./forEachBail");
},
});
@@ -0,0 +1,9 @@
import arrayLikeToArray from "./arrayLikeToArray.js";
function _unsupportedIterableToArray(r, a) {
if (r) {
if ("string" == typeof r) return arrayLikeToArray(r, a);
var t = {}.toString.call(r).slice(8, -1);
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0;
}
}
export { _unsupportedIterableToArray as default };
@@ -0,0 +1,95 @@
import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.mjs";
import {useValueEffect as $1dbecbe27a04f9af$export$14d238f342723f25} from "./useValueEffect.mjs";
import {useState as $eKkEp$useState, useRef as $eKkEp$useRef, useCallback as $eKkEp$useCallback, useEffect as $eKkEp$useEffect} from "react";
import {useSSRSafeId as $eKkEp$useSSRSafeId} from "@react-aria/ssr";
/*
* 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 $bdb11010cef70236$var$canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
let $bdb11010cef70236$var$idsUpdaterMap = new Map();
function $bdb11010cef70236$export$f680877a34711e37(defaultId) {
let [value, setValue] = (0, $eKkEp$useState)(defaultId);
let nextId = (0, $eKkEp$useRef)(null);
let res = (0, $eKkEp$useSSRSafeId)(value);
let updateValue = (0, $eKkEp$useCallback)((val)=>{
nextId.current = val;
}, []);
if ($bdb11010cef70236$var$canUseDOM) {
// TS not smart enough to know that `has` means the value exists
if ($bdb11010cef70236$var$idsUpdaterMap.has(res) && !$bdb11010cef70236$var$idsUpdaterMap.get(res).includes(updateValue)) $bdb11010cef70236$var$idsUpdaterMap.set(res, [
...$bdb11010cef70236$var$idsUpdaterMap.get(res),
updateValue
]);
else $bdb11010cef70236$var$idsUpdaterMap.set(res, [
updateValue
]);
}
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{
let r = res;
return ()=>{
$bdb11010cef70236$var$idsUpdaterMap.delete(r);
};
}, [
res
]);
// This cannot cause an infinite loop because the ref is updated first.
// eslint-disable-next-line
(0, $eKkEp$useEffect)(()=>{
let newId = nextId.current;
if (newId) {
nextId.current = null;
setValue(newId);
}
});
return res;
}
function $bdb11010cef70236$export$cd8c9cb68f842629(idA, idB) {
if (idA === idB) return idA;
let setIdsA = $bdb11010cef70236$var$idsUpdaterMap.get(idA);
if (setIdsA) {
setIdsA.forEach((fn)=>fn(idB));
return idB;
}
let setIdsB = $bdb11010cef70236$var$idsUpdaterMap.get(idB);
if (setIdsB) {
setIdsB.forEach((fn)=>fn(idA));
return idA;
}
return idB;
}
function $bdb11010cef70236$export$b4cc09c592e8fdb8(depArray = []) {
let id = $bdb11010cef70236$export$f680877a34711e37();
let [resolvedId, setResolvedId] = (0, $1dbecbe27a04f9af$export$14d238f342723f25)(id);
let updateId = (0, $eKkEp$useCallback)(()=>{
setResolvedId(function*() {
yield id;
yield document.getElementById(id) ? id : undefined;
});
}, [
id,
setResolvedId
]);
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(updateId, [
id,
updateId,
...depArray
]);
return resolvedId;
}
export {$bdb11010cef70236$export$f680877a34711e37 as useId, $bdb11010cef70236$export$cd8c9cb68f842629 as mergeIds, $bdb11010cef70236$export$b4cc09c592e8fdb8 as useSlotId};
//# sourceMappingURL=useId.module.js.map
@@ -0,0 +1,18 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
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/common/types.ts
var types_exports = {};
module.exports = __toCommonJS(types_exports);
@@ -0,0 +1,13 @@
/**
* Gets the value at `key` of `object`.
*
* @private
* @param {Object} [object] The object to query.
* @param {string} key The key of the property to get.
* @returns {*} Returns the property value.
*/
function getValue(object, key) {
return object == null ? undefined : object[key];
}
export default getValue;
@@ -0,0 +1,8 @@
type Subscription<T> = (val: T) => void;
export declare class EventEmitter<T> {
private subscriptions;
emit: (val: T) => void;
useSubscription: (callback: Subscription<T>) => void;
}
declare function useEventEmitter<T = void>(): EventEmitter<T>;
export default useEventEmitter;
@@ -0,0 +1,321 @@
var openParentheses = "(".charCodeAt(0);
var closeParentheses = ")".charCodeAt(0);
var singleQuote = "'".charCodeAt(0);
var doubleQuote = '"'.charCodeAt(0);
var backslash = "\\".charCodeAt(0);
var slash = "/".charCodeAt(0);
var comma = ",".charCodeAt(0);
var colon = ":".charCodeAt(0);
var star = "*".charCodeAt(0);
var uLower = "u".charCodeAt(0);
var uUpper = "U".charCodeAt(0);
var plus = "+".charCodeAt(0);
var isUnicodeRange = /^[a-f0-9?-]+$/i;
module.exports = function(input) {
var tokens = [];
var value = input;
var next,
quote,
prev,
token,
escape,
escapePos,
whitespacePos,
parenthesesOpenPos;
var pos = 0;
var code = value.charCodeAt(pos);
var max = value.length;
var stack = [{ nodes: tokens }];
var balanced = 0;
var parent;
var name = "";
var before = "";
var after = "";
while (pos < max) {
// Whitespaces
if (code <= 32) {
next = pos;
do {
next += 1;
code = value.charCodeAt(next);
} while (code <= 32);
token = value.slice(pos, next);
prev = tokens[tokens.length - 1];
if (code === closeParentheses && balanced) {
after = token;
} else if (prev && prev.type === "div") {
prev.after = token;
prev.sourceEndIndex += token.length;
} else if (
code === comma ||
code === colon ||
(code === slash &&
value.charCodeAt(next + 1) !== star &&
(!parent ||
(parent && parent.type === "function" && parent.value !== "calc")))
) {
before = token;
} else {
tokens.push({
type: "space",
sourceIndex: pos,
sourceEndIndex: next,
value: token
});
}
pos = next;
// Quotes
} else if (code === singleQuote || code === doubleQuote) {
next = pos;
quote = code === singleQuote ? "'" : '"';
token = {
type: "string",
sourceIndex: pos,
quote: quote
};
do {
escape = false;
next = value.indexOf(quote, next + 1);
if (~next) {
escapePos = next;
while (value.charCodeAt(escapePos - 1) === backslash) {
escapePos -= 1;
escape = !escape;
}
} else {
value += quote;
next = value.length - 1;
token.unclosed = true;
}
} while (escape);
token.value = value.slice(pos + 1, next);
token.sourceEndIndex = token.unclosed ? next : next + 1;
tokens.push(token);
pos = next + 1;
code = value.charCodeAt(pos);
// Comments
} else if (code === slash && value.charCodeAt(pos + 1) === star) {
next = value.indexOf("*/", pos);
token = {
type: "comment",
sourceIndex: pos,
sourceEndIndex: next + 2
};
if (next === -1) {
token.unclosed = true;
next = value.length;
token.sourceEndIndex = next;
}
token.value = value.slice(pos + 2, next);
tokens.push(token);
pos = next + 2;
code = value.charCodeAt(pos);
// Operation within calc
} else if (
(code === slash || code === star) &&
parent &&
parent.type === "function" &&
parent.value === "calc"
) {
token = value[pos];
tokens.push({
type: "word",
sourceIndex: pos - before.length,
sourceEndIndex: pos + token.length,
value: token
});
pos += 1;
code = value.charCodeAt(pos);
// Dividers
} else if (code === slash || code === comma || code === colon) {
token = value[pos];
tokens.push({
type: "div",
sourceIndex: pos - before.length,
sourceEndIndex: pos + token.length,
value: token,
before: before,
after: ""
});
before = "";
pos += 1;
code = value.charCodeAt(pos);
// Open parentheses
} else if (openParentheses === code) {
// Whitespaces after open parentheses
next = pos;
do {
next += 1;
code = value.charCodeAt(next);
} while (code <= 32);
parenthesesOpenPos = pos;
token = {
type: "function",
sourceIndex: pos - name.length,
value: name,
before: value.slice(parenthesesOpenPos + 1, next)
};
pos = next;
if (name === "url" && code !== singleQuote && code !== doubleQuote) {
next -= 1;
do {
escape = false;
next = value.indexOf(")", next + 1);
if (~next) {
escapePos = next;
while (value.charCodeAt(escapePos - 1) === backslash) {
escapePos -= 1;
escape = !escape;
}
} else {
value += ")";
next = value.length - 1;
token.unclosed = true;
}
} while (escape);
// Whitespaces before closed
whitespacePos = next;
do {
whitespacePos -= 1;
code = value.charCodeAt(whitespacePos);
} while (code <= 32);
if (parenthesesOpenPos < whitespacePos) {
if (pos !== whitespacePos + 1) {
token.nodes = [
{
type: "word",
sourceIndex: pos,
sourceEndIndex: whitespacePos + 1,
value: value.slice(pos, whitespacePos + 1)
}
];
} else {
token.nodes = [];
}
if (token.unclosed && whitespacePos + 1 !== next) {
token.after = "";
token.nodes.push({
type: "space",
sourceIndex: whitespacePos + 1,
sourceEndIndex: next,
value: value.slice(whitespacePos + 1, next)
});
} else {
token.after = value.slice(whitespacePos + 1, next);
token.sourceEndIndex = next;
}
} else {
token.after = "";
token.nodes = [];
}
pos = next + 1;
token.sourceEndIndex = token.unclosed ? next : pos;
code = value.charCodeAt(pos);
tokens.push(token);
} else {
balanced += 1;
token.after = "";
token.sourceEndIndex = pos + 1;
tokens.push(token);
stack.push(token);
tokens = token.nodes = [];
parent = token;
}
name = "";
// Close parentheses
} else if (closeParentheses === code && balanced) {
pos += 1;
code = value.charCodeAt(pos);
parent.after = after;
parent.sourceEndIndex += after.length;
after = "";
balanced -= 1;
stack[stack.length - 1].sourceEndIndex = pos;
stack.pop();
parent = stack[balanced];
tokens = parent.nodes;
// Words
} else {
next = pos;
do {
if (code === backslash) {
next += 1;
}
next += 1;
code = value.charCodeAt(next);
} while (
next < max &&
!(
code <= 32 ||
code === singleQuote ||
code === doubleQuote ||
code === comma ||
code === colon ||
code === slash ||
code === openParentheses ||
(code === star &&
parent &&
parent.type === "function" &&
parent.value === "calc") ||
(code === slash &&
parent.type === "function" &&
parent.value === "calc") ||
(code === closeParentheses && balanced)
)
);
token = value.slice(pos, next);
if (openParentheses === code) {
name = token;
} else if (
(uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) &&
plus === token.charCodeAt(1) &&
isUnicodeRange.test(token.slice(2))
) {
tokens.push({
type: "unicode-range",
sourceIndex: pos,
sourceEndIndex: next,
value: token
});
} else {
tokens.push({
type: "word",
sourceIndex: pos,
sourceEndIndex: next,
value: token
});
}
pos = next;
}
}
for (pos = stack.length - 1; pos; pos -= 1) {
stack[pos].unclosed = true;
stack[pos].sourceEndIndex = value.length;
}
return stack[0].nodes;
};
@@ -0,0 +1 @@
{"version":3,"file":"utilities.esm.js","sources":["../src/hooks/useCombinedRefs.ts","../src/execution-context/canUseDOM.ts","../src/type-guards/isWindow.ts","../src/type-guards/isNode.ts","../src/execution-context/getWindow.ts","../src/type-guards/isDocument.ts","../src/type-guards/isHTMLElement.ts","../src/type-guards/isSVGElement.ts","../src/execution-context/getOwnerDocument.ts","../src/hooks/useIsomorphicLayoutEffect.ts","../src/hooks/useEvent.ts","../src/hooks/useInterval.ts","../src/hooks/useLatestValue.ts","../src/hooks/useLazyMemo.ts","../src/hooks/useNodeRef.ts","../src/hooks/usePrevious.ts","../src/hooks/useUniqueId.ts","../src/adjustment.ts","../src/event/hasViewportRelativeCoordinates.ts","../src/event/isKeyboardEvent.ts","../src/event/isTouchEvent.ts","../src/coordinates/getEventCoordinates.ts","../src/css.ts","../src/focus/findFirstFocusableNode.ts"],"sourcesContent":["import {useMemo} from 'react';\n\nexport function useCombinedRefs<T>(\n ...refs: ((node: T) => void)[]\n): (node: T) => void {\n return useMemo(\n () => (node: T) => {\n refs.forEach((ref) => ref(node));\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n refs\n );\n}\n","// https://github.com/facebook/react/blob/master/packages/shared/ExecutionEnvironment.js\nexport const canUseDOM =\n typeof window !== 'undefined' &&\n typeof window.document !== 'undefined' &&\n typeof window.document.createElement !== 'undefined';\n","export function isWindow(element: Object): element is typeof window {\n const elementString = Object.prototype.toString.call(element);\n return (\n elementString === '[object Window]' ||\n // In Electron context the Window object serializes to [object global]\n elementString === '[object global]'\n );\n}\n","export function isNode(node: Object): node is Node {\n return 'nodeType' in node;\n}\n","import {isWindow} from '../type-guards/isWindow';\nimport {isNode} from '../type-guards/isNode';\n\nexport function getWindow(target: Event['target']): typeof window {\n if (!target) {\n return window;\n }\n\n if (isWindow(target)) {\n return target;\n }\n\n if (!isNode(target)) {\n return window;\n }\n\n return target.ownerDocument?.defaultView ?? window;\n}\n","import {getWindow} from '../execution-context/getWindow';\n\nexport function isDocument(node: Node): node is Document {\n const {Document} = getWindow(node);\n\n return node instanceof Document;\n}\n","import {getWindow} from '../execution-context/getWindow';\n\nimport {isWindow} from './isWindow';\n\nexport function isHTMLElement(node: Node | Window): node is HTMLElement {\n if (isWindow(node)) {\n return false;\n }\n\n return node instanceof getWindow(node).HTMLElement;\n}\n","import {getWindow} from '../execution-context/getWindow';\n\nexport function isSVGElement(node: Node): node is SVGElement {\n return node instanceof getWindow(node).SVGElement;\n}\n","import {\n isWindow,\n isHTMLElement,\n isDocument,\n isNode,\n isSVGElement,\n} from '../type-guards';\n\nexport function getOwnerDocument(target: Event['target']): Document {\n if (!target) {\n return document;\n }\n\n if (isWindow(target)) {\n return target.document;\n }\n\n if (!isNode(target)) {\n return document;\n }\n\n if (isDocument(target)) {\n return target;\n }\n\n if (isHTMLElement(target) || isSVGElement(target)) {\n return target.ownerDocument;\n }\n\n return document;\n}\n","import {useEffect, useLayoutEffect} from 'react';\n\nimport {canUseDOM} from '../execution-context';\n\n/**\n * A hook that resolves to useEffect on the server and useLayoutEffect on the client\n * @param callback {function} Callback function that is invoked when the dependencies of the hook change\n */\nexport const useIsomorphicLayoutEffect = canUseDOM\n ? useLayoutEffect\n : useEffect;\n","import {useCallback, useRef} from 'react';\n\nimport {useIsomorphicLayoutEffect} from './useIsomorphicLayoutEffect';\n\nexport function useEvent<T extends Function>(handler: T | undefined) {\n const handlerRef = useRef<T | undefined>(handler);\n\n useIsomorphicLayoutEffect(() => {\n handlerRef.current = handler;\n });\n\n return useCallback(function (...args: any) {\n return handlerRef.current?.(...args);\n }, []);\n}\n","import {useCallback, useRef} from 'react';\n\nexport function useInterval() {\n const intervalRef = useRef<number | null>(null);\n\n const set = useCallback((listener: Function, duration: number) => {\n intervalRef.current = setInterval(listener, duration);\n }, []);\n\n const clear = useCallback(() => {\n if (intervalRef.current !== null) {\n clearInterval(intervalRef.current);\n intervalRef.current = null;\n }\n }, []);\n\n return [set, clear] as const;\n}\n","import {useRef} from 'react';\nimport type {DependencyList} from 'react';\n\nimport {useIsomorphicLayoutEffect} from './useIsomorphicLayoutEffect';\n\nexport function useLatestValue<T extends any>(\n value: T,\n dLine truncated
@@ -0,0 +1,617 @@
export default `flf2a% 6 6 21 0 3
cosmic.flf by Mike Rosulek <mjr@netins.net>, 7/11/95. Check out my
homepage at: http://www.netins.net/showcase/mikewrld/
---- Modified and corrected by Michel Eftimakis (Michel.Eftimakis@vlsi.com) ----
%%%%#
%%%%#
%%%%#
%%%%#
%%%%#
%%%%##
.:#
;;;#
'[[#
$$#
""#
MM##
%:: ::%#
%"; ;"%#
#
#
#
##
:: :: #
__,;'_,;'_#
''[[''[[''#
,$" ,$" #
o88oo88oo #
,M" ,M" ##
.: #
,;;;. #
[[,,_\` #
\`"""Yo#
Yo_,d"#
'M' ##
.. .:\`#
; ; ,;\` #
^^ ,[\` #
cP ,, #
,8" 8 8#
,dP "" ##
:\\ #
.;;' #
([__ #
c$"" #
"Yo,oP#
"M,##
::#
,'#
#
#
#
##
.:#
,;' #
n[ #
Y$ #
8o,#
"M##
:. #
';,#
[n#
$Y#
,o8 #
M" ##
#
\\|/ #
/|\\ #
#
#
##
#
#
[ #
%$$$$$%#
8 #
##
#
#
#
#
d8b#
,M"##
#
#
#
%cccc%#
#
##
#
#
#
#
d8b#
YMP##
/:\`#
/;\` #
n[' #
c$" #
o8" #
mM" ##
#
,;;, #
,[' [n #
$$ $$#
Y8, ,8"#
"YmmP ##
:.#
;;#
[[#
$$#
88#
MM##
.:::. #
,;'\`\`;. #
'' ,[['#
.c$$P' #
d88 _,oo,#
MMMUP*"^^##
.::. #
;'\`';;, #
.n[[ #
\`\`"$$$.#
,,o888"#
YMMP" ##
.:: #
,;';; #
,[' [[ #
$P__$$c#
\`"""88"#
MM ##
::::::::#
\`;;\`\`'';#
[[,_ #
\`""*Ycc#
__,od8"#
MMP" ##
.:. #
,;' #
,[[.od8b #
$$$" "$$#
Y8b,,d8P#
"YMP" ##
...:::::#
'''\`\`;;'#
.[' #
,$$' #
888 #
MMM ##
.::::. #
\`;. ,;'#
[nn[, #
$" $c#
Yb,_,8P#
"YMP" ##
.,,. #
,;;'\`';,#
[[, _,[[#
Y$$P"$$#
,,_,d8"#
"MP" ##
#
,;,#
'['#
#
d8b#
YMP##
#
,;,#
'['#
#
d8b#
,M"##
#
,,#
,[['#
c$ #
"8bo,#
"MP##
#
#
%,,,,,%#
% """"%#
%oooo%#
%""""%##
#
,, #
'[[, #
$c#
,od8"#
YM" ##
.-::::-.#
;;'\`\`\`;;;#
,n[[' #
d$P" #
"" #
MM ##
.:::''''''':::. #
;;' ,;;;;;;,.; \`;.#
:[[ [. .['[[ [[#
$$, 'Y$$$P'Y$$P' #
'Y8o,_ __,oo #
\`"YUMMMMMMUY" ##
:::. #
;;\`;; #
,[[ '[[, #
c$$$cc$$$c #
888 888,#
YMM ""\` ##
:::::::. #
;;;'';;' #
[[[__[[\\.#
$$""""Y$$#
_88o,,od8P#
""YUMMMP" ##
.,-::::: #
,;;;'\`\`\`\`' #
[[[ #
$$$ #
\`88bo,__,o, #
"YUMMMMMP"##
:::::::-. #
;;, \`';,#
\`[[ [[#
$$, $$#
888_,o8P'#
MMMMP"\` ##
.,:::::: #
;;;;'''' #
[[cccc #
$$"""" #
888oo,__ #
""""YUMMM##
.-:::::'#
;;;'''' #
[[[,,== #
\`$$$"\`\` #
888 #
"MM, ##
.,-:::::/ #
,;;-'\`\`\`\`' #
[[[ [[[[[[/#
"$$c. "$$ #
\`Y8bo,,,o88o#
\`'YMUP"YMM##
:: .: #
,;; ;;, #
,[[[,,,[[[ #
"$$$"""$$$ #
888 "88o#
MMM YMM##
:::#
;;;#
[[[#
$$$#
888#
MMM##
....::::::#
;;;;;;;;;\`\`\`\`#
''\` \`[[. #
,,, \`$$ #
888boood88 #
"MMMMMMMM" ##
::: . #
;;; .;;,.#
[[[[[/' #
_$$$$, #
"888"88o, #
MMM "MMP"##
::: #
;;; #
[[[ #
$$' #
o88oo,.__#
""""YUMMM##
. : #
;;,. ;;; #
[[[[, ,[[[[, #
$$$$$$$$"$$$ #
888 Y88" 888o#
MMM M' "MMM##
:::. :::.#
\`;;;;, \`;;;#
[[[[[. '[[#
$$$ "Y$c$$#
888 Y88#
MMM YM##
... #
.;;;;;;;. #
,[[ \\[[,#
$$$, $$$#
"888,_ _,88P#
"YMMMMMP" ##
::::::::::. #
\`;;;\`\`\`.;;;#
\`]]nnn]]' #
$$$"" #
888o #
YMMMb ##
.::::::. #
,;;'\`\`\`';;, #
[[[ [[[\\#
"$$c cc$$$"#
"*8bo,Y88b,#
"*YP" "M"##
:::::::.. #
;;;;\`\`;;;; #
[[[,/[[[' #
$$$$$$c #
888b "88bo,#
MMMM "W" ##
.::::::. #
;;;\` \` #
'[==/[[[[,#
''' $#
88b dP#
"YMmMY" ##
::::::::::::#
;;;;;;;;''''#
[[ #
$$ #
88, #
MMM ##
... :::#
;; ;;;#
[[' [[[#
$$ $$$#
88 .d888#
"YmmMMMM""##
::: .::.#
';;, ,;;;' #
\\[[ .[[/ #
Y$c.$$" #
Y88P #
MP ##
.:: . .:::#
';;, ;; ;;;' #
'[[, [[, [[' #
Y$c$$$c$P #
"88"888 #
"M "M" ##
.,:: .:#
\`;;;, .,;; #
'[[,,[[' #
Y$$$P #
oP"\`\`"Yo, #
,m" "Mm,##
.-:. ::-.#
';;. ;;;;'#
'[[,[[[' #
c$$" #
,8P"\` #
mM" ##
:::::::::#
'\`\`\`\`\`;;;#
.n[['#
,$$P" #
,888bo,_ #
\`""*UMM ##
::::#
;;' #
[[ #
$$ #
88, #
"YMM##
\`:\\ #
\`;\\ #
'[n #
"$c #
"8o #
"Mm##
::::#
';;#
[[#
$$#
,88#
MMP"##
.:. #
;' \`;#
#
#
#
##
#
#
#
#
#
mmmmmmm##
\`:. #
\`;,#
#
#
#
##
:::. #
;;\`;; #
,[[ '[[, #
c$$$cc$$$c #
888 888,#
YMM ""\` ##
:::::::. #
;;;'';;' #
[[[__[[\\.#
$$""""Y$$#
_88o,,od8P#
""YUMMMP" ##
.,-::::: #
,;;;'\`\`\`\`' #
[[[ #
$$$ #
\`88bo,__,o, #
"YUMMMMMP"##
:::::::-. #
;;, \`';,#
\`[[ [[#
$$, $$#
888_,o8P'#
MMMMP"\` ##
.,:::::: #
;;;;'''' #
[[cccc #
$$"""" #
888oo,__ #
""""YUMMM##
.-:::::'#
;;;'''' #
[[[,,== #
\`$$$"\`\` #
888 #
"MM, ##
.,-:::::/ #
,;;-'\`\`\`\`' #
[[[ [[[[[[/#
"$$c. "$$ #
\`Y8bo,,,o88o#
\`'YMUP"YMM##
:: .: #
,;; ;;, #
,[[[,,,[[[ #
"$$$"""$$$ #
888 "88o#
MMM YMM##
:::#
;;;#
[[[#
$$$#
888#
MMM##
....::::::#
;;;;;;;;;\`\`\`\`#
''\` \`[[. #
,,, \`$$ #
888boood88 #
"MMMMMMMM" ##
::: . #
;;; .;;,.#
[[[[[/' #
_$$$$, #
"888"88o, #
MMM "MMP"##
::: #
;;; #
[[[ #
$$' #
o88oo,.__#
""""YUMMM##
. : #
;;,. ;;; #
[[[[, ,[[[[, #
$$$$$$$$"$$$ #
888 Y88" 888o#
MMM M' "MMM##
:::. :::.#
\`;;;;, \`;;;#
[[[[[. '[[#
$$$ "Y$c$$#
888 Y88#
MMM YM##
... #
.;;;;;;;. #
,[[ \\[[,#
$$$, $$$#
"888,_ _,88P#
"YMMMMMP" ##
::::::::::. #
\`;;;\`\`\`.;;;#
\`]]nnn]]' #
$$$"" #
888o #
YMMMb ##
.::::::. #
,;;'\`\`\`';;, #
[[[ [[[\\#
"$$c cc$$$"#
"*8bo,Y88b,#
"*YP" "M"##
:::::::.. #
;;;;\`\`;;;; #
[[[,/[[[' #
$$$$$$c #
888b "88bo,#
MMMM "W" ##
.::::::. #
;;;\` \` #
'[==/[[[[,#
''' $#
88b dP#
"YMmMY" ##
::::::::::::#
;;;;;;;;''''#
[[ #
$$ #
88, #
MMM ##
... :::#
;; ;;;#
[[' [[[#
$$ $$$#
88 .d888#
"YmmMMMM""##
::: .::.#
';;, ,;;;' #
\\[[ .[[/ #
Y$c.$$" #
Y88P #
MP ##
.:: . .:::#
';;, ;; ;;;' #
'[[, [[, [[' #
Y$c$$$c$P #
"88"888 #
"M "M" ##
.,:: .:#
\`;;;, .,;; #
'[[,,[[' #
Y$$$P #
oP"\`\`"Yo, #
,m" "Mm,##
.-:. ::-.#
';;. ;;;;'#
'[[,[[[' #
c$$" #
,8P"\` #
mM" ##
:::::::::#
'\`\`\`\`\`;;;#
.n[['#
,$$P" #
,888bo,_ #
\`""*UMM ##
.:#
;'#
[#
$"#
8 #
"M##
\`:#
,;#
[[#
$$#
88#
MM##
:.#
';#
[ #
"$#
8#
M"##
':.:':.#
\`;' \`;#
#
#
#
##
:: ::. :: #
;;\`;; #
,[[ '[[, #
c$$$cc$$$c #
888 888,#
YMM ""\` ##
:: ... :: #
.;;;;;;;. #
,[[ \\[[,#
$$$, $$$#
"888,_ _,88P#
"YMMMMMP" ##
..:: :: ::#
;; ;;;#
[[' [[[#
$$ $$$#
88 .d888#
"YmmMMMM""##
:: ::. :: #
;;\`;; #
,[[ '[[, #
c$$$cc$$$c #
888 888,#
YMM ""\` ##
:: ... :: #
.;;;;;;;. #
,[[ \\[[,#
$$$, $$$#
"888,_ _,88P#
"YMMMMMP" ##
..:: :: ::#
;; ;;;#
[[' [[[#
$$ $$$#
88 .d888#
"YmmMMMM""##
:::::::. #
;;;'';;' #
[[[__[[\\.#
$$""""Y$$#
88o,,od8P#
MM\`YMMP" ##
`
@@ -0,0 +1,49 @@
{
"name": "statuses",
"description": "HTTP status utility",
"version": "2.0.2",
"contributors": [
"Douglas Christopher Wilson <doug@somethingdoug.com>",
"Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
],
"repository": "jshttp/statuses",
"license": "MIT",
"keywords": [
"http",
"status",
"code"
],
"files": [
"HISTORY.md",
"index.js",
"codes.json",
"LICENSE"
],
"devDependencies": {
"csv-parse": "4.16.3",
"eslint": "7.19.0",
"eslint-config-standard": "14.1.1",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-markdown": "1.0.2",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "4.3.1",
"eslint-plugin-standard": "4.1.0",
"mocha": "8.4.0",
"nyc": "15.1.0",
"raw-body": "2.5.2",
"stream-to-array": "2.3.0"
},
"engines": {
"node": ">= 0.8"
},
"scripts": {
"build": "node scripts/build.js",
"fetch": "node scripts/fetch-apache.js && node scripts/fetch-iana.js && node scripts/fetch-nginx.js && node scripts/fetch-node.js",
"lint": "eslint --plugin markdown --ext js,md .",
"test": "mocha --reporter spec --check-leaks --bail test/",
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
"test-cov": "nyc --reporter=html --reporter=text npm test",
"update": "npm run fetch && npm run build",
"version": "node scripts/version-history.js && git add HISTORY.md"
}
}
@@ -0,0 +1,273 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "defaultExtractor", {
enumerable: true,
get: function() {
return defaultExtractor;
}
});
const _regex = /*#__PURE__*/ _interop_require_wildcard(require("./regex"));
const _splitAtTopLevelOnly = require("../util/splitAtTopLevelOnly");
function _getRequireWildcardCache(nodeInterop) {
if (typeof WeakMap !== "function") return null;
var cacheBabelInterop = new WeakMap();
var cacheNodeInterop = new WeakMap();
return (_getRequireWildcardCache = function(nodeInterop) {
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
})(nodeInterop);
}
function _interop_require_wildcard(obj, nodeInterop) {
if (!nodeInterop && obj && obj.__esModule) {
return obj;
}
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
return {
default: obj
};
}
var cache = _getRequireWildcardCache(nodeInterop);
if (cache && cache.has(obj)) {
return cache.get(obj);
}
var newObj = {};
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
for(var key in obj){
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
if (desc && (desc.get || desc.set)) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
newObj.default = obj;
if (cache) {
cache.set(obj, newObj);
}
return newObj;
}
function defaultExtractor(context) {
let patterns = Array.from(buildRegExps(context));
/**
* @param {string} content
*/ return (content)=>{
/** @type {(string|string)[]} */ let results = [];
for (let pattern of patterns){
var _content_match;
for (let result of (_content_match = content.match(pattern)) !== null && _content_match !== void 0 ? _content_match : []){
results.push(clipAtBalancedParens(result));
}
}
// Extract any subclasses from languages like Slim and Pug, eg:
// div.flex.px-5.underline
for (let result of results.slice()){
let segments = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(result, ".");
for(let idx = 0; idx < segments.length; idx++){
let segment = segments[idx];
if (idx >= segments.length - 1) {
results.push(segment);
continue;
}
// If the next segment is a number, discard both, for example seeing
// `px-1` and `5` means the real candidate was `px-1.5` which is already
// captured.
let next = Number(segments[idx + 1]);
if (isNaN(next)) {
results.push(segment);
} else {
idx++;
}
}
}
return results;
};
}
function* buildRegExps(context) {
let separator = context.tailwindConfig.separator;
let prefix = context.tailwindConfig.prefix !== "" ? _regex.optional(_regex.pattern([
/-?/,
_regex.escape(context.tailwindConfig.prefix)
])) : "";
let utility = _regex.any([
// Arbitrary properties (without square brackets)
/\[[^\s:'"`]+:[^\s\[\]]+\]/,
// Arbitrary properties with balanced square brackets
// This is a targeted fix to continue to allow theme()
// with square brackets to work in arbitrary properties
// while fixing a problem with the regex matching too much
/\[[^\s:'"`\]]+:[^\s]+?\[[^\s]+\][^\s]+?\]/,
// Utilities
_regex.pattern([
// Utility Name / Group Name
_regex.any([
/-?(?:\w+)/,
// This is here to make sure @container supports everything that other utilities do
/@(?:\w+)/
]),
// Normal/Arbitrary values
_regex.optional(_regex.any([
_regex.pattern([
// Arbitrary values
_regex.any([
/-(?:\w+-)*\['[^\s]+'\]/,
/-(?:\w+-)*\["[^\s]+"\]/,
/-(?:\w+-)*\[`[^\s]+`\]/,
/-(?:\w+-)*\[(?:[^\s\[\]]+\[[^\s\[\]]+\])*[^\s:\[\]]+\]/
]),
// Not immediately followed by an `{[(`
/(?![{([]])/,
// optionally followed by an opacity modifier
/(?:\/[^\s'"`\\><$]*)?/
]),
_regex.pattern([
// Arbitrary values
_regex.any([
/-(?:\w+-)*\['[^\s]+'\]/,
/-(?:\w+-)*\["[^\s]+"\]/,
/-(?:\w+-)*\[`[^\s]+`\]/,
/-(?:\w+-)*\[(?:[^\s\[\]]+\[[^\s\[\]]+\])*[^\s\[\]]+\]/
]),
// Not immediately followed by an `{[(`
/(?![{([]])/,
// optionally followed by an opacity modifier
/(?:\/[^\s'"`\\$]*)?/
]),
// Normal values w/o quotes — may include an opacity modifier
/[-\/][^\s'"`\\$={><]*/
]))
])
]);
let variantPatterns = [
// Without quotes
_regex.any([
// This is here to provide special support for the `@` variant
_regex.pattern([
/@\[[^\s"'`]+\](\/[^\s"'`]+)?/,
separator
]),
// With variant modifier (e.g.: group-[..]/modifier)
_regex.pattern([
/([^\s"'`\[\\]+-)?\[[^\s"'`]+\]\/[\w_-]+/,
separator
]),
_regex.pattern([
/([^\s"'`\[\\]+-)?\[[^\s"'`]+\]/,
separator
]),
_regex.pattern([
/[^\s"'`\[\\]+/,
separator
])
]),
// With quotes allowed
_regex.any([
// With variant modifier (e.g.: group-[..]/modifier)
_regex.pattern([
/([^\s"'`\[\\]+-)?\[[^\s`]+\]\/[\w_-]+/,
separator
]),
_regex.pattern([
/([^\s"'`\[\\]+-)?\[[^\s`]+\]/,
separator
]),
_regex.pattern([
/[^\s`\[\\]+/,
separator
])
])
];
for (const variantPattern of variantPatterns){
yield _regex.pattern([
// Variants
"((?=((",
variantPattern,
")+))\\2)?",
// Important (optional)
/!?/,
prefix,
utility
]);
}
// 5. Inner matches
yield /[^<>"'`\s.(){}[\]#=%$][^<>"'`\s(){}[\]#=%$]*[^<>"'`\s.(){}[\]#=%:$]/g;
}
// We want to capture any "special" characters
// AND the characters immediately following them (if there is one)
let SPECIALS = /([\[\]'"`])([^\[\]'"`])?/g;
let ALLOWED_CLASS_CHARACTERS = /[^"'`\s<>\]]+/;
/**
* Clips a string ensuring that parentheses, quotes, etc… are balanced
* Used for arbitrary values only
*
* We will go past the end of the balanced parens until we find a non-class character
*
* Depth matching behavior:
* w-[calc(100%-theme('spacing[some_key][1.5]'))]']
* ┬ ┬ ┬┬ ┬ ┬┬ ┬┬┬┬┬┬┬
* 1 2 3 4 34 3 210 END
* ╰────┴──────────┴────────┴────────┴┴───┴─┴┴┴
*
* @param {string} input
*/ function clipAtBalancedParens(input) {
// We are care about this for arbitrary values
if (!input.includes("-[")) {
return input;
}
let depth = 0;
let openStringTypes = [];
// Find all parens, brackets, quotes, etc
// Stop when we end at a balanced pair
// This is naive and will treat mismatched parens as balanced
// This shouldn't be a problem in practice though
let matches = input.matchAll(SPECIALS);
// We can't use lookbehind assertions because we have to support Safari
// So, instead, we've emulated it using capture groups and we'll re-work the matches to accommodate
matches = Array.from(matches).flatMap((match)=>{
const [, ...groups] = match;
return groups.map((group, idx)=>Object.assign([], match, {
index: match.index + idx,
0: group
}));
});
for (let match of matches){
let char = match[0];
let inStringType = openStringTypes[openStringTypes.length - 1];
if (char === inStringType) {
openStringTypes.pop();
} else if (char === "'" || char === '"' || char === "`") {
openStringTypes.push(char);
}
if (inStringType) {
continue;
} else if (char === "[") {
depth++;
continue;
} else if (char === "]") {
depth--;
continue;
}
// We've gone one character past the point where we should stop
// This means that there was an extra closing `]`
// We'll clip to just before it
if (depth < 0) {
return input.substring(0, match.index - 1);
}
// We've finished balancing the brackets but there still may be characters that can be included
// For example in the class `text-[#336699]/[.35]`
// The depth goes to `0` at the closing `]` but goes up again at the `[`
// If we're at zero and encounter a non-class character then we clip the class there
if (depth === 0 && !ALLOWED_CLASS_CHARACTERS.test(char)) {
return input.substring(0, match.index);
}
}
return input;
} // Regular utilities
// {{modifier}:}*{namespace}{-{suffix}}*{/{opacityModifier}}?
// Arbitrary values
// {{modifier}:}*{namespace}-[{arbitraryValue}]{/{opacityModifier}}?
// arbitraryValue: no whitespace, balanced quotes unless within quotes, balanced brackets unless within quotes
// Arbitrary properties
// {{modifier}:}*[{validCssPropertyName}:{arbitraryValue}]
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _nonIterableRest;
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
//# sourceMappingURL=nonIterableRest.js.map
@@ -0,0 +1,81 @@
/*
* 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 {AriaLabelingProps, DOMProps, StyleProps} from '@react-types/shared';
import {OverlayTriggerProps, Placement, PositionProps} from '@react-types/overlays';
import {ReactElement, ReactNode} from 'react';
export interface TooltipTriggerProps extends OverlayTriggerProps {
/**
* Whether the tooltip should be disabled, independent from the trigger.
*/
isDisabled?: boolean,
/**
* The delay time for the tooltip to show up. [See guidelines](https://spectrum.adobe.com/page/tooltip/#Immediate-or-delayed-appearance).
* @default 1500
*/
delay?: number,
/**
* The delay time for the tooltip to close. [See guidelines](https://spectrum.adobe.com/page/tooltip/#Warmup-and-cooldown).
* @default 500
*/
closeDelay?: number,
/**
* By default, opens for both focus and hover. Can be made to open only for focus.
*/
trigger?: 'focus'
}
export interface SpectrumTooltipTriggerProps extends Omit<TooltipTriggerProps, 'closeDelay'>, PositionProps {
children: [ReactElement, ReactElement],
/**
* The additional offset applied along the main axis between the element and its
* anchor element.
* @default 7
*/
offset?: number,
/**
* The placement of the tooltip with respect to the trigger.
* @default 'top'
*/
placement?: Placement
}
export interface TooltipProps {
isOpen?: boolean
}
export interface AriaTooltipProps extends TooltipProps, DOMProps, AriaLabelingProps {}
export interface SpectrumTooltipProps extends AriaTooltipProps, StyleProps {
/**
* The [visual style](https://spectrum.adobe.com/page/tooltip/#Semantic-variants) of the Tooltip.
*/
variant?: 'neutral' | 'positive' | 'negative' | 'info',
/**
* The placement of the element with respect to its anchor element.
* @default 'top'
*/
placement?: 'start' | 'end' | 'right' | 'left' | 'top' | 'bottom',
/**
* Whether the element is rendered.
*/
showIcon?: boolean,
children: ReactNode
}
@@ -0,0 +1,67 @@
{
"name": "@heroui/tooltip",
"version": "2.2.8",
"description": "A React Component for rendering dynamically positioned Tooltips",
"keywords": [
"tooltip"
],
"author": "Junior Garcia <jrgarciadev@gmail.com>",
"homepage": "https://heroui.com",
"license": "MIT",
"main": "dist/index.js",
"sideEffects": false,
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/heroui-inc/heroui.git",
"directory": "packages/components/tooltip"
},
"bugs": {
"url": "https://github.com/heroui-inc/heroui/issues"
},
"peerDependencies": {
"react": ">=18 || >=19.0.0-rc.0",
"react-dom": ">=18 || >=19.0.0-rc.0",
"framer-motion": ">=11.5.6 || >=12.0.0-alpha.1",
"@heroui/theme": ">=2.4.0",
"@heroui/system": ">=2.4.0"
},
"dependencies": {
"@react-aria/interactions": "3.22.5",
"@react-aria/overlays": "3.24.0",
"@react-aria/tooltip": "3.7.10",
"@react-aria/utils": "3.26.0",
"@react-stately/tooltip": "3.5.0",
"@react-types/overlays": "3.8.11",
"@react-types/tooltip": "3.4.13",
"@heroui/shared-utils": "2.1.3",
"@heroui/react-utils": "2.1.4",
"@heroui/aria-utils": "2.2.8",
"@heroui/framer-utils": "2.1.7",
"@heroui/use-safe-layout-effect": "2.1.2",
"@heroui/dom-animation": "2.1.2"
},
"clean-package": "../../../clean-package.config.json",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./package.json": "./package.json"
},
"scripts": {
"build": "tsup src --dts",
"build:fast": "tsup src",
"dev": "pnpm build:fast --watch",
"clean": "rimraf dist .turbo",
"typecheck": "tsc --noEmit"
}
}
@@ -0,0 +1 @@
{"version":3,"file":"buildArrayMetadataWithIndex.d.ts","sourceRoot":"","sources":["../../../../src/reflectMetadata/utils/buildArrayMetadataWithIndex.ts"],"names":[],"mappings":"AAAA,wBAAgB,2BAA2B,CAAC,CAAC,EAC3C,WAAW,EAAE,CAAC,EACd,KAAK,EAAE,MAAM,GACZ,CAAC,aAAa,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,CAM7B"}
@@ -0,0 +1,4 @@
function _classStaticPrivateMethodSet() {
throw new TypeError("attempted to set read only static private field");
}
export { _classStaticPrivateMethodSet as default };
@@ -0,0 +1,36 @@
import {styleTags, tags as t} from "@lezer/highlight"
export const cssHighlighting = styleTags({
"AtKeyword import charset namespace keyframes media supports": t.definitionKeyword,
"from to selector": t.keyword,
NamespaceName: t.namespace,
KeyframeName: t.labelName,
KeyframeRangeName: t.operatorKeyword,
TagName: t.tagName,
ClassName: t.className,
PseudoClassName: t.constant(t.className),
IdName: t.labelName,
"FeatureName PropertyName": t.propertyName,
AttributeName: t.attributeName,
NumberLiteral: t.number,
KeywordQuery: t.keyword,
UnaryQueryOp: t.operatorKeyword,
"CallTag ValueName": t.atom,
VariableName: t.variableName,
Callee: t.operatorKeyword,
Unit: t.unit,
"UniversalSelector NestingSelector": t.definitionOperator,
"MatchOp CompareOp": t.compareOperator,
"ChildOp SiblingOp, LogicOp": t.logicOperator,
BinOp: t.arithmeticOperator,
Important: t.modifier,
Comment: t.blockComment,
ColorLiteral: t.color,
"ParenthesizedContent StringLiteral": t.string,
":": t.punctuation,
"PseudoOp #": t.derefOperator,
"; ,": t.separator,
"( )": t.paren,
"[ ]": t.squareBracket,
"{ }": t.brace
})
@@ -0,0 +1,29 @@
"use client";
import {
HeroUIProvider
} from "./chunk-6SNXZVD5.mjs";
import {
ProviderContext,
useProviderContext
} from "./chunk-Q3W45BN5.mjs";
// src/index.ts
import {
forwardRef,
toIterator,
mapPropsVariants,
mapPropsVariantsWithCommon,
isHeroUIEl,
extendVariants
} from "@heroui/system-rsc";
export {
HeroUIProvider,
ProviderContext,
extendVariants,
forwardRef,
isHeroUIEl,
mapPropsVariants,
mapPropsVariantsWithCommon,
toIterator,
useProviderContext
};
@@ -0,0 +1,199 @@
# 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.1](https://github.com/ljharb/Object.values/compare/v1.2.0...v1.2.1) - 2024-12-18
### Commits
- [actions] split out node 10-20, and 20+ [`c13655c`](https://github.com/ljharb/Object.values/commit/c13655cf506b26151debf588ea8df116a8824697)
- [Dev Deps] update `@es-shims/api`, `@ljharb/eslint-config`, `array.prototype.map`, `auto-changelog`, `tape` [`53dd34a`](https://github.com/ljharb/Object.values/commit/53dd34aa1df92d0eff7cb0c99d9137fd3525d342)
- [Refactor] avoid needing call-bound push [`427c25f`](https://github.com/ljharb/Object.values/commit/427c25f3a4f9e11501e20f335ea0ae3a0649ab93)
- [Refactor] use `call-bound` directly [`c8a03c7`](https://github.com/ljharb/Object.values/commit/c8a03c75c82338543c5b67c30486b7ce64044bf6)
- [Tests] replace `aud` with `npm audit` [`44d93b1`](https://github.com/ljharb/Object.values/commit/44d93b16319764d7ec695e316b8151b5334f3bf5)
- [Deps] update `call-bind` [`719d75c`](https://github.com/ljharb/Object.values/commit/719d75c73e664c4ec80c82da8a1be0089e76ea70)
- [Dev Deps] add missing peer dep [`0a19681`](https://github.com/ljharb/Object.values/commit/0a19681a6185008d41f5734e8b9df18f8ece8860)
## [v1.2.0](https://github.com/ljharb/Object.values/compare/v1.1.7...v1.2.0) - 2024-03-18
### Commits
- [Refactor] use `es-object-atoms` instead of `es-abstract`; update `call-bind`, `define-properties` [`a51f9fd`](https://github.com/ljharb/Object.values/commit/a51f9fd7c20458d2d0084d632fdba8a97f5d36b3)
- [Dev Deps] update `array.prototype.map`, `aud`, `npmignore`, `tape` [`540765d`](https://github.com/ljharb/Object.values/commit/540765d28f61687e35bc39423e85d76a65336e60)
- [New] add `auto` entrypoint [`ce8740c`](https://github.com/ljharb/Object.values/commit/ce8740c5783609df274f56747982bb9820436a1b)
## [v1.1.7](https://github.com/ljharb/Object.values/compare/v1.1.6...v1.1.7) - 2023-08-27
### Commits
- [Dev Deps] update `@es-shims/api`, `@ljharb/eslint-config`, `aud`, `tape` [`7a52cb5`](https://github.com/ljharb/Object.values/commit/7a52cb5bd457db370f7928ab411fa39c06c3a1ac)
- [Deps] update `define-properties`, `es-abstract` [`4adc158`](https://github.com/ljharb/Object.values/commit/4adc15840a9521a952f4620d80ef657397119da9)
## [v1.1.6](https://github.com/ljharb/Object.values/compare/v1.1.5...v1.1.6) - 2022-11-06
### Commits
- [actions] reuse common workflows [`4072b71`](https://github.com/ljharb/Object.values/commit/4072b716b4ed42cbd3f3f008ea6a53a374f31bf6)
- [meta] use `npmignore` to autogenerate an npmignore file [`6881278`](https://github.com/ljharb/Object.values/commit/688127818288a7ab3232aa45ab9271c678a702d5)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@es-shims/api`, `array.prototype.map`, `safe-publish-latest`, `tape` [`28c21e6`](https://github.com/ljharb/Object.values/commit/28c21e6c67420b8a1c466321dce35e883b6e4e52)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `array.prototype.map`, `aud`, `auto-changelog`, `functions-have-names`, `tape` [`0e78caa`](https://github.com/ljharb/Object.values/commit/0e78caadf9d6fae70712ea8d5953517d6b3d9bdb)
- [actions] update rebase action to use reusable workflow [`6f37c60`](https://github.com/ljharb/Object.values/commit/6f37c60053cfe4bcdd44ddf0f29296fe3c312c1b)
- [actions] update codecov uploader [`d7c5f30`](https://github.com/ljharb/Object.values/commit/d7c5f3019ccdba81f0afea189e95d5996ea9dd95)
- [Deps] update `define-properties`, `es-abstract` [`911ca0e`](https://github.com/ljharb/Object.values/commit/911ca0ee81f38cd1541c1c7ec7c29ec9904d11d5)
## [v1.1.5](https://github.com/ljharb/Object.values/compare/v1.1.4...v1.1.5) - 2021-10-03
### Commits
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@es-shims/api`, `tape` [`c397925`](https://github.com/ljharb/Object.values/commit/c3979252140c24514aeebf3d452b422528e36349)
- [Deps] update `es-abstract` [`f98d0da`](https://github.com/ljharb/Object.values/commit/f98d0da2035bf8396b2544f2e2ac02aec766d36f)
- [Robustness] use a call-bound `Array.prototype.push` [`72a3213`](https://github.com/ljharb/Object.values/commit/72a32138e91a9a7b3a828fa1f8f02fe361097c51)
- [meta] npmignore coverage output [`3b0433f`](https://github.com/ljharb/Object.values/commit/3b0433fe3025cb079b0de2373a0a9cfd2e0777b5)
## [v1.1.4](https://github.com/ljharb/Object.values/compare/v1.1.3...v1.1.4) - 2021-05-26
### Commits
- [meta] add `auto-changelog` [`01ee3ac`](https://github.com/ljharb/Object.values/commit/01ee3acb5c767559ce37a3b24bbd30253eae280c)
- [actions] use `node/install` instead of `node/run`; use `codecov` action [`f403cba`](https://github.com/ljharb/Object.values/commit/f403cba8852664d82bbf744cd36ad019742a14b5)
- [readme] add actions and codecov badges [`bee5cd2`](https://github.com/ljharb/Object.values/commit/bee5cd21770c9dffa874a2d18d728cf8478e3e7d)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`; switch `array-map` for `array.prototype.map` [`8c49dbe`](https://github.com/ljharb/Object.values/commit/8c49dbeed8e3312081d88848abe6bb04383d46ae)
- [Refactor] `propertyIsEnumerable` checks own-ness; remove `has` [`3cb48cf`](https://github.com/ljharb/Object.values/commit/3cb48cf8655504fee0d226036e9582be0fd3fbb0)
- [actions] update workflows [`eb1d757`](https://github.com/ljharb/Object.values/commit/eb1d7574489b86d5d276cf58e3faf77271d0a6f7)
- [Dev Deps] update `eslint`, `tape` [`0abdb2d`](https://github.com/ljharb/Object.values/commit/0abdb2d576aba1074075c1fb25de01ef943aaa77)
- [Tests] increase coverage [`8ca19a3`](https://github.com/ljharb/Object.values/commit/8ca19a3472a9e7883de91d4623fbbce978a0c535)
- [meta] use `prepublishOnly` script for npm 7+ [`88998c8`](https://github.com/ljharb/Object.values/commit/88998c80f21c0aaf7a640ad14caa7b9c08aa1e7c)
- [Deps] update `es-abstract` [`12515ab`](https://github.com/ljharb/Object.values/commit/12515ab54f055c42904caaadecce8d13edd673d8)
- [Deps] update `es-abstract` [`3083ce7`](https://github.com/ljharb/Object.values/commit/3083ce7cd7263cb2570d894947c5d6a4f64feffa)
- [meta] gitignore coverage output [`7aef22b`](https://github.com/ljharb/Object.values/commit/7aef22b2c623b756a3302c6df2265b69b1bb3e10)
## [v1.1.3](https://github.com/ljharb/Object.values/compare/v1.1.2...v1.1.3) - 2021-02-22
### Commits
- [meta] do not publish github action workflow files [`208c71c`](https://github.com/ljharb/Object.values/commit/208c71c6b34125317ea7784cd05f72c2c511fdfb)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `functions-have-names`, `has-strict-mode`, `tape` [`88849ab`](https://github.com/ljharb/Object.values/commit/88849abd1607d5e80cd4252246ad3d9d0876c431)
- [readme] remove travis badge [`0a9a67f`](https://github.com/ljharb/Object.values/commit/0a9a67f3f33fd82a8c45db6ec0059996c19b54cd)
- [actions] update workflows [`4ecb890`](https://github.com/ljharb/Object.values/commit/4ecb8909b6b5dead0a5ce65489f71c626a569826)
- [Deps] update `call-bind`, `es-abstract` [`28845c7`](https://github.com/ljharb/Object.values/commit/28845c737b5aa665344c39bcf87799484891fe47)
## [v1.1.2](https://github.com/ljharb/Object.values/compare/v1.1.1...v1.1.2) - 2020-11-26
### Commits
- [Tests] migrate tests to Github Actions [`6ab9d79`](https://github.com/ljharb/Object.values/commit/6ab9d798482ad84fbcb874b085820b6830d0d4e3)
- [Tests] add `implementation` test; run `es-shim-api` in postlint; use `tape` runner [`65667b7`](https://github.com/ljharb/Object.values/commit/65667b7b346a13f91ce6e541871a7687ff4673a4)
- [Tests] run `nyc` on all tests [`b83f36c`](https://github.com/ljharb/Object.values/commit/b83f36ce151a31a78f7e0b763a0b3a118be76256)
- [actions] add "Allow Edits" workflow [`44c7de1`](https://github.com/ljharb/Object.values/commit/44c7de155a409bda38215c32ce616eb33b0cf1cf)
- [Deps] update `es-abstract`; use `call-bind` where applicable [`35f88b0`](https://github.com/ljharb/Object.values/commit/35f88b0f8c7243238058640518446d09f3abe319)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`, `functions-have-names`; add `safe-publish-latest` [`2495030`](https://github.com/ljharb/Object.values/commit/2495030adccb3f3af615395f364950d76390517d)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`1cc1742`](https://github.com/ljharb/Object.values/commit/1cc17421906a8afa3d2ece4ebb745c6b501cba0e)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape`; add `aud` [`f42bc75`](https://github.com/ljharb/Object.values/commit/f42bc75fc7c3a61a09eb0a2e5b4ae003f92d0023)
- [Fix] do not mutate the native function when present [`ea2a273`](https://github.com/ljharb/Object.values/commit/ea2a273cbd8f60f91cf9bb6528b8d5d1cae25f47)
- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`5040d09`](https://github.com/ljharb/Object.values/commit/5040d09bee5c3ea77694f76ff95c6d4b09bf4a0c)
- [Tests] only audit prod deps [`2803c92`](https://github.com/ljharb/Object.values/commit/2803c924114308f261e4c38dfc81706458046e7b)
- [Deps] update `es-abstract` [`d15d0e5`](https://github.com/ljharb/Object.values/commit/d15d0e5e0ac5342588aa558477e56a075b4b130f)
- [Dev Deps] update `tape` [`e83fe3a`](https://github.com/ljharb/Object.values/commit/e83fe3a4c38dc678866cd0905445d59ea7c58b5b)
- [Deps] update `es-abstract` [`cfab489`](https://github.com/ljharb/Object.values/commit/cfab48956d88dbf4a2659672c648465ca0cc3fc8)
## [v1.1.1](https://github.com/ljharb/Object.values/compare/v1.1.0...v1.1.1) - 2019-12-12
### Commits
- [Tests] use shared travis-ci configs [`2a82dea`](https://github.com/ljharb/Object.values/commit/2a82dea7bbde9773c0fbae64f7a70f9236effd86)
- [Tests] up to `node` `v12.7`, `v11.15`, `v10.16`, `v8.16`, `v6.17`; use `nvm install-latest-npm` [`58a4209`](https://github.com/ljharb/Object.values/commit/58a420950f906d62b9b62b6ad5881216f7585be2)
- [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops [`80080cd`](https://github.com/ljharb/Object.values/commit/80080cdd93f8dbceb3383864e4d18f8cbb4947c0)
- [actions] add automatic rebasing / merge commit blocking [`e8a9297`](https://github.com/ljharb/Object.values/commit/e8a92975258fd674a2c00380f7ee7c2adb6ee009)
- [Refactor] use split-up `es-abstract` (85% bundle size decrease) [`a8ac36f`](https://github.com/ljharb/Object.values/commit/a8ac36fcad70e86a42d08cf0163f7b23945a3f45)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `functions-have-names` [`c74ad8a`](https://github.com/ljharb/Object.values/commit/c74ad8adcb78173f8e9cec541366c21307587de4)
- [Dev Deps] update `object-keys`, `tape`, `eslint` [`10adf18`](https://github.com/ljharb/Object.values/commit/10adf18de8784be02de042b7c8eec5dd911f4f1a)
- [meta] add `funding` field [`110dbca`](https://github.com/ljharb/Object.values/commit/110dbca51bc0413bab11fe56dabc5d0a373415a7)
- [Tests] use `functions-have-names` [`40746e5`](https://github.com/ljharb/Object.values/commit/40746e5311298d61385e3e316e3f0bc2956d9053)
- [Deps] update `es-abstract` [`9b7c99b`](https://github.com/ljharb/Object.values/commit/9b7c99b9881a3af022ec002cedd72a9aa64f34d2)
## [v1.1.0](https://github.com/ljharb/Object.values/compare/v1.0.4...v1.1.0) - 2019-01-01
### Commits
- [Tests] remove `jscs` [`a9d5f94`](https://github.com/ljharb/Object.values/commit/a9d5f94000ae6efb44cd964dcdfa5b986596392f)
- [Tests] up to `node` `v11.1`, `v10.13`, `v9.11`, `v8.12`, `v7.10`, `v6.14`, `v4.9`; use `nvm install-latest-npm` [`103a907`](https://github.com/ljharb/Object.values/commit/103a907829c29fabf16e880b178341d3b6832e32)
- [Tests] up to `node` `v7.4`, `v4.7`; improve test matrix [`66caa4a`](https://github.com/ljharb/Object.values/commit/66caa4a74e08de777c1b00185f796e609704bb83)
- [Tests] up to `node` `v11.6`, `v10.15`, `v8.15`, `v6.16` [`81de647`](https://github.com/ljharb/Object.values/commit/81de647b1eede60d69f49cf4ccbf970e3224528e)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `nsp`, `tape` [`13c5dd1`](https://github.com/ljharb/Object.values/commit/13c5dd1fa7762cf509deafde12b14fe65e6c0c17)
- [Dev Deps] add missing `object-keys` dev dep [`7cbc7f3`](https://github.com/ljharb/Object.values/commit/7cbc7f38ac6b13738af8b42b62d0c89c5dce6bc6)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `covert`, `tape` [`1bf1dbe`](https://github.com/ljharb/Object.values/commit/1bf1dbe0b1fa1c646ef2c6c1bc3a14f5d4045f92)
- [Deps] update `define-properties`, `es-abstract`, `function-bind`, `has` [`faa4051`](https://github.com/ljharb/Object.values/commit/faa40515ff43662e3f381147a902e978cf250bdc)
- [Tests] use `npm audit` instead of `nsp` [`428fb50`](https://github.com/ljharb/Object.values/commit/428fb50c79cc0ef1e62fc053dc959a8848b0d190)
- Only apps should have lockfiles [`f35eb85`](https://github.com/ljharb/Object.values/commit/f35eb8520052bb4dd27ccfd4a399c6011c2ec157)
- [New] add `auto` entry point [`ed730e3`](https://github.com/ljharb/Object.values/commit/ed730e3b2508e4d89691b57d00fc63eebce7130e)
## [v1.0.4](https://github.com/ljharb/Object.values/compare/v1.0.3...v1.0.4) - 2016-12-04
### Commits
- [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `@es-shims/api` [`b0db351`](https://github.com/ljharb/Object.values/commit/b0db351280cfebad008eedff99556cead33a2f37)
- [Tests] up to `node` `v7.2`, `v6.9`, `v4.6`; improve test matrix. [`89362d3`](https://github.com/ljharb/Object.values/commit/89362d30ccee1a27f8d85c114adb14937b4ca7d0)
- [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config` [`883dce4`](https://github.com/ljharb/Object.values/commit/883dce455bcab08a045561554055003c3f06a917)
- [Dev Deps] update `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config` [`67e83b8`](https://github.com/ljharb/Object.values/commit/67e83b8a84ff77f29c99b924760256e05e358dd8)
- [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config` [`2c1c6c7`](https://github.com/ljharb/Object.values/commit/2c1c6c759725418806d079abf828fd16b3df0aba)
- [Dev Deps] update `jscs`, `nsp`, `eslint`, `@es-shims/api` [`d878ea6`](https://github.com/ljharb/Object.values/commit/d878ea62dc98952e62136de5a42a8caab2a66e84)
- [Tests] up to `node` `v5.6`, `v4.3` [`f37757e`](https://github.com/ljharb/Object.values/commit/f37757e78526e060d7fe2a7ba11414690bbbaa98)
- [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config` [`348a2a3`](https://github.com/ljharb/Object.values/commit/348a2a386b791fe090a08b7f33111d531277a3ab)
- [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config` [`b1e915e`](https://github.com/ljharb/Object.values/commit/b1e915ed9b35bdb9bb2b7ea35cdd5c78e62636d9)
- [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config` [`015b78d`](https://github.com/ljharb/Object.values/commit/015b78db57c4cc46d06b1b4f04f4ea2fdb35fc0c)
- [Tests] up to `node` `v5.9`, `v4.4` [`b33686e`](https://github.com/ljharb/Object.values/commit/b33686ea45a842c84e5186416fb52be31a60cc7e)
- [Dev Deps] update `jscs` [`0a44aa3`](https://github.com/ljharb/Object.values/commit/0a44aa30ab2fd5fe4a15070237c700172e517b3f)
- [Docs] update to reflect ES2017 inclusion. [`c01085b`](https://github.com/ljharb/Object.values/commit/c01085b134408bffadafa060bd1585a61674dd57)
- [Tests] use pretest/posttest for linting/security. [`8f9c6c7`](https://github.com/ljharb/Object.values/commit/8f9c6c7104d5694aaf266a6e6d12a92b9731a709)
- [Tests] fix npm upgrades on older nodes [`68c195f`](https://github.com/ljharb/Object.values/commit/68c195fe88677667002e5102c4efcfcc7bef059b)
- [Tests] up to `node` `v6.2` [`48fac8d`](https://github.com/ljharb/Object.values/commit/48fac8de7265142acb1554b28a29322baf53be20)
- [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config` [`471a794`](https://github.com/ljharb/Object.values/commit/471a7940a7dff28a6544c6c253b90daa60ff3c65)
- [Deps] update `es-abstract` [`7e644f1`](https://github.com/ljharb/Object.values/commit/7e644f1bb7c6db533ed137d88de7856e7b9c55b1)
- [Deps] update `es-abstract` [`1856267`](https://github.com/ljharb/Object.values/commit/18562676e8aa606a47116753c323dd28619dea50)
- [Tests] on `node` `v5.12` [`8a4e0c0`](https://github.com/ljharb/Object.values/commit/8a4e0c03415fb67fc2ac420eba6ece5b660cbfe7)
- [Tests] on `node` `v5.10` [`aaeb1a7`](https://github.com/ljharb/Object.values/commit/aaeb1a7a176eca1e69f4df7a8979f0ba40b12c29)
- [Deps] update `function-bind` [`14d2e88`](https://github.com/ljharb/Object.values/commit/14d2e88045d8f92877e9a31f31a2b624267de54f)
- [Deps] update `es-abstract` [`63e46a9`](https://github.com/ljharb/Object.values/commit/63e46a9efd3081872e92ec94a2ed6dbaae3c615a)
- [Deps] update `es-abstract` [`7c40db6`](https://github.com/ljharb/Object.values/commit/7c40db6381bad3232be3e1c24ef79839b6edaba7)
- [Deps] update `define-properties` [`0a86270`](https://github.com/ljharb/Object.values/commit/0a86270bda6478c4e08045b1fb3f2eb72b2207cd)
- [Tests] on `node` `v4.2` [`8ee831d`](https://github.com/ljharb/Object.values/commit/8ee831dae76ef522d6acaae9869a1a7b465361a4)
- [Tests] on `node` `v5.0` [`b9c88c7`](https://github.com/ljharb/Object.values/commit/b9c88c74f2cbb280cfc1c88064c9cd514b4876ae)
## [v1.0.3](https://github.com/ljharb/Object.values/compare/v1.0.2...v1.0.3) - 2015-10-06
### Commits
- Add test case to cover non-enumerable keys made enumerable by a previous getter. [`9d61739`](https://github.com/ljharb/Object.values/commit/9d617395f0ec81cbdcbc50a46e4489c95253f80b)
- [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config` [`cf6dff8`](https://github.com/ljharb/Object.values/commit/cf6dff84131cef953498988249c5306c71c1fe9f)
- [Dev Deps] update `jscs`, `eslint` [`f439029`](https://github.com/ljharb/Object.values/commit/f439029b228e0dab0542caa63e1d032889d53705)
- [Deps] update `es-abstract` [`6879994`](https://github.com/ljharb/Object.values/commit/6879994fec305490b5550d25ce390e4b64c74fe0)
## [v1.0.2](https://github.com/ljharb/Object.values/compare/v1.0.1...v1.0.2) - 2015-09-25
### Fixed
- Not-yet-visited keys deleted on a [[Get]] must not show up in the output [`#1`](https://github.com/ljharb/Object.values/issues/1)
## [v1.0.1](https://github.com/ljharb/Object.values/compare/v1.0.0...v1.0.1) - 2015-09-21
### Commits
- [Tests] on `io.js` `v3.3`, up to `node` `v4.1` [`27aac5f`](https://github.com/ljharb/Object.values/commit/27aac5f80c05f66d584056931b63eed637059621)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`83cde5c`](https://github.com/ljharb/Object.values/commit/83cde5c685db366f769d738bc30f7a6d273bcc3a)
- Add es-shim API keyword [`2c6b885`](https://github.com/ljharb/Object.values/commit/2c6b88550c155b4f9a7c6ece609b8d97d77b2942)
- [Docs] update version badge URL [`626bf99`](https://github.com/ljharb/Object.values/commit/626bf991d9b0f5720819537698918b295c6ea0d0)
## v1.0.0 - 2015-09-02
### Commits
- Dotfiles [`5251629`](https://github.com/ljharb/Object.values/commit/5251629c47404fa0dec7b6d230eda10da0f47eea)
- Tests [`b02e54e`](https://github.com/ljharb/Object.values/commit/b02e54ef157c56117b390cb1db95f7d48163a838)
- package.json [`7b84f4e`](https://github.com/ljharb/Object.values/commit/7b84f4e839f75b227a5233325f064900a6032f9a)
- Read me [`31e115b`](https://github.com/ljharb/Object.values/commit/31e115b31af2eabf4db518343310f2bb42e7fa04)
- Initial commit [`01271a5`](https://github.com/ljharb/Object.values/commit/01271a51976524c62bac00d8af9af3ede72831dd)
- Implementation. [`9a0c315`](https://github.com/ljharb/Object.values/commit/9a0c31554899f411d31d3b8343c754eb2c19842e)
- Clarifying tests that only Symbol *properties* are omitted. [`16b3abb`](https://github.com/ljharb/Object.values/commit/16b3abb7c15790cb63e9b2b842b75fdc4210ad69)
@@ -0,0 +1,43 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $concat = GetIntrinsic('%Array.prototype.concat%');
var callBind = require('call-bind');
var callBound = require('call-bound');
var $slice = callBound('Array.prototype.slice');
var hasSymbols = require('has-symbols/shams')();
var isConcatSpreadable = hasSymbols && Symbol.isConcatSpreadable;
/** @type {never[]} */ var empty = [];
var $concatApply = isConcatSpreadable ? callBind.apply($concat, empty) : null;
// eslint-disable-next-line no-extra-parens
var isArray = isConcatSpreadable ? /** @type {(value: unknown) => value is unknown[]} */ (require('isarray')) : null;
/** @type {import('.')} */
module.exports = isConcatSpreadable
// eslint-disable-next-line no-unused-vars
? function safeArrayConcat(item) {
for (var i = 0; i < arguments.length; i += 1) {
/** @type {typeof item} */ var arg = arguments[i];
// @ts-expect-error ts(2538) see https://github.com/microsoft/TypeScript/issues/9998#issuecomment-1890787975; works if `const`
if (arg && typeof arg === 'object' && typeof arg[isConcatSpreadable] === 'boolean') {
// @ts-expect-error ts(7015) TS doesn't yet support Symbol indexing
if (!empty[isConcatSpreadable]) {
// @ts-expect-error ts(7015) TS doesn't yet support Symbol indexing
empty[isConcatSpreadable] = true;
}
// @ts-expect-error ts(2721) ts(18047) not sure why TS can't figure out this can't be null
var arr = isArray(arg) ? $slice(arg) : [arg];
// @ts-expect-error ts(7015) TS can't handle expandos on an array
arr[isConcatSpreadable] = true; // shadow the property. TODO: use [[Define]]
arguments[i] = arr;
}
}
// @ts-expect-error ts(2345) https://github.com/microsoft/TypeScript/issues/57164 TS doesn't understand that apply can take an arguments object
return $concatApply(arguments);
}
: callBind($concat, empty);
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.escape = void 0;
/**
* Escape all magic characters in a glob pattern.
*
* If the {@link windowsPathsNoEscape | GlobOptions.windowsPathsNoEscape}
* option is used, then characters are escaped by wrapping in `[]`, because
* a magic character wrapped in a character class can only be satisfied by
* that exact character. In this mode, `\` is _not_ escaped, because it is
* not interpreted as a magic character, but instead as a path separator.
*/
const escape = (s, { windowsPathsNoEscape = false, } = {}) => {
// don't need to escape +@! because we escape the parens
// that make those magic, and escaping ! as [!] isn't valid,
// because [!]] is a valid glob class meaning not ']'.
return windowsPathsNoEscape
? s.replace(/[?*()[\]]/g, '[$&]')
: s.replace(/[?*()[\]\\]/g, '\\$&');
};
exports.escape = escape;
//# sourceMappingURL=escape.js.map
@@ -0,0 +1 @@
{"version":3,"file":"unescape.js","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,MACsB,EAAE,EACtD,EAAE;IACF,OAAO,oBAAoB;QACzB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,IAAI,CAAC;QACnC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;AAChF,CAAC,CAAA","sourcesContent":["import { MinimatchOptions } from './index.js'\n/**\n * Un-escape a string that has been escaped with {@link escape}.\n *\n * If the {@link windowsPathsNoEscape} option is used, then square-brace\n * escapes are removed, but not backslash escapes. For example, it will turn\n * the string `'[*]'` into `*`, but it will not turn `'\\\\*'` into `'*'`,\n * becuase `\\` is a path separator in `windowsPathsNoEscape` mode.\n *\n * When `windowsPathsNoEscape` is not set, then both brace escapes and\n * backslash escapes are removed.\n *\n * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped\n * or unescaped.\n */\nexport const unescape = (\n s: string,\n {\n windowsPathsNoEscape = false,\n }: Pick<MinimatchOptions, 'windowsPathsNoEscape'> = {}\n) => {\n return windowsPathsNoEscape\n ? s.replace(/\\[([^\\/\\\\])\\]/g, '$1')\n : s.replace(/((?!\\\\).|^)\\[([^\\/\\\\])\\]/g, '$1$2').replace(/\\\\([^\\/])/g, '$1')\n}\n"]}
@@ -0,0 +1,403 @@
# Redux Thunk
Thunk [middleware](https://redux.js.org/tutorials/fundamentals/part-4-store#middleware) for Redux. It allows writing functions with logic inside that can interact with a Redux store's `dispatch` and `getState` methods.
For complete usage instructions and useful patterns, see the [Redux docs **Writing Logic with Thunks** page](https://redux.js.org/usage/writing-logic-thunks).
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/reduxjs/redux-thunk/test.yml?branch=master)
[![npm version](https://img.shields.io/npm/v/redux-thunk.svg?style=flat-square)](https://www.npmjs.com/package/redux-thunk)
[![npm downloads](https://img.shields.io/npm/dm/redux-thunk.svg?style=flat-square)](https://www.npmjs.com/package/redux-thunk)
## Installation and Setup
### Redux Toolkit
If you're using [our official Redux Toolkit package](https://redux-toolkit.js.org) as recommended, there's nothing to install - RTK's `configureStore` API already adds the thunk middleware by default:
```js
import { configureStore } from '@reduxjs/toolkit'
import todosReducer from './features/todos/todosSlice'
import filtersReducer from './features/filters/filtersSlice'
const store = configureStore({
reducer: {
todos: todosReducer,
filters: filtersReducer
}
})
// The thunk middleware was automatically added
```
### Manual Setup
If you're using the basic Redux `createStore` API and need to set this up manually, first add the `redux-thunk` package:
```sh
npm install redux-thunk
yarn add redux-thunk
```
The thunk middleware is the default export.
<details>
<summary><b>More Details: Importing the thunk middleware</b></summary>
If you're using ES modules:
```js
import thunk from 'redux-thunk' // no changes here 😀
```
If you use Redux Thunk 2.x in a CommonJS environment,
[don’t forget to add `.default` to your import](https://github.com/reduxjs/redux-thunk/releases/tag/v2.0.0):
```diff
- const thunk = require('redux-thunk')
+ const thunk = require('redux-thunk').default
```
Additionally, since 2.x, we also support a
[UMD build](https://unpkg.com/redux-thunk/dist/redux-thunk.min.js) for use as a global script tag:
```js
const ReduxThunk = window.ReduxThunk
```
</details>
Then, to enable Redux Thunk, use
[`applyMiddleware()`](https://redux.js.org/api/applymiddleware):
```js
import { createStore, applyMiddleware } from 'redux'
import thunk from 'redux-thunk'
import rootReducer from './reducers/index'
const store = createStore(rootReducer, applyMiddleware(thunk))
```
### Injecting a Custom Argument
Since 2.1.0, Redux Thunk supports injecting a custom argument into the thunk middleware. This is typically useful for cases like using an API service layer that could be swapped out for a mock service in tests.
For Redux Toolkit, the `getDefaultMiddleware` callback inside of `configureStore` lets you pass in a custom `extraArgument`:
```js
import { configureStore } from '@reduxjs/toolkit'
import rootReducer from './reducer'
import { myCustomApiService } from './api'
const store = configureStore({
reducer: rootReducer,
middleware: getDefaultMiddleware =>
getDefaultMiddleware({
thunk: {
extraArgument: myCustomApiService
}
})
})
// later
function fetchUser(id) {
// The `extraArgument` is the third arg for thunk functions
return (dispatch, getState, api) => {
// you can use api here
}
}
```
If you need to pass in multiple values, combine them into a single object:
```js
const store = configureStore({
reducer: rootReducer,
middleware: getDefaultMiddleware =>
getDefaultMiddleware({
thunk: {
extraArgument: {
api: myCustomApiService,
otherValue: 42
}
}
})
})
// later
function fetchUser(id) {
return (dispatch, getState, { api, otherValue }) => {
// you can use api and something else here
}
}
```
If you're setting up the store by hand, the named export `withExtraArgument()` function should be used to generate the correct thunk middleware:
```js
const store = createStore(reducer, applyMiddleware(withExtraArgument(api)))
```
## Why Do I Need This?
With a plain basic Redux store, you can only do simple synchronous updates by
dispatching an action. Middleware extends the store's abilities, and lets you
write async logic that interacts with the store.
Thunks are the recommended middleware for basic Redux side effects logic,
including complex synchronous logic that needs access to the store, and simple
async logic like AJAX requests.
For more details on why thunks are useful, see:
- **Redux docs: Writing Logic with Thunks**
https://redux.js.org/usage/writing-logic-thunks
The official usage guide page on thunks. Covers why they exist, how the thunk middleware works, and useful patterns for using thunks.
- **Stack Overflow: Dispatching Redux Actions with a Timeout**
http://stackoverflow.com/questions/35411423/how-to-dispatch-a-redux-action-with-a-timeout/35415559#35415559
Dan Abramov explains the basics of managing async behavior in Redux, walking
through a progressive series of approaches (inline async calls, async action
creators, thunk middleware).
- **Stack Overflow: Why do we need middleware for async flow in Redux?**
http://stackoverflow.com/questions/34570758/why-do-we-need-middleware-for-async-flow-in-redux/34599594#34599594
Dan Abramov gives reasons for using thunks and async middleware, and some
useful patterns for using thunks.
- **What the heck is a "thunk"?**
https://daveceddia.com/what-is-a-thunk/
A quick explanation for what the word "thunk" means in general, and for Redux
specifically.
- **Thunks in Redux: The Basics**
https://medium.com/fullstack-academy/thunks-in-redux-the-basics-85e538a3fe60
A detailed look at what thunks are, what they solve, and how to use them.
You may also want to read the
**[Redux FAQ entry on choosing which async middleware to use](https://redux.js.org/faq/actions#what-async-middleware-should-i-use-how-do-you-decide-between-thunks-sagas-observables-or-something-else)**.
While the thunk middleware is not directly included with the Redux core library,
it is used by default in our
**[`@reduxjs/toolkit` package](https://github.com/reduxjs/redux-toolkit)**.
## Motivation
Redux Thunk [middleware](https://redux.js.org/tutorials/fundamentals/part-4-store#middleware)
allows you to write action creators that return a function instead of an action.
The thunk can be used to delay the dispatch of an action, or to dispatch only if
a certain condition is met. The inner function receives the store methods
`dispatch` and `getState` as parameters.
An action creator that returns a function to perform asynchronous dispatch:
```js
const INCREMENT_COUNTER = 'INCREMENT_COUNTER'
function increment() {
return {
type: INCREMENT_COUNTER
}
}
function incrementAsync() {
return dispatch => {
setTimeout(() => {
// Yay! Can invoke sync or async actions with `dispatch`
dispatch(increment())
}, 1000)
}
}
```
An action creator that returns a function to perform conditional dispatch:
```js
function incrementIfOdd() {
return (dispatch, getState) => {
const { counter } = getState()
if (counter % 2 === 0) {
return
}
dispatch(increment())
}
}
```
## What’s a thunk?!
A [thunk](https://en.wikipedia.org/wiki/Thunk) is a function that wraps an
expression to delay its evaluation.
```js
// calculation of 1 + 2 is immediate
// x === 3
let x = 1 + 2
// calculation of 1 + 2 is delayed
// foo can be called later to perform the calculation
// foo is a thunk!
let foo = () => 1 + 2
```
The term [originated](https://en.wikipedia.org/wiki/Thunk#cite_note-1) as a
humorous past-tense version of "think".
## Composition
Any return value from the inner function will be available as the return value
of `dispatch` itself. This is convenient for orchestrating an asynchronous
control flow with thunk action creators dispatching each other and returning
Promises to wait for each other’s completion:
```js
import { createStore, applyMiddleware } from 'redux'
import thunk from 'redux-thunk'
import rootReducer from './reducers'
// Note: this API requires redux@>=3.1.0
const store = createStore(rootReducer, applyMiddleware(thunk))
function fetchSecretSauce() {
return fetch('https://www.google.com/search?q=secret+sauce')
}
// These are the normal action creators you have seen so far.
// The actions they return can be dispatched without any middleware.
// However, they only express “facts” and not the “async flow”.
function makeASandwich(forPerson, secretSauce) {
return {
type: 'MAKE_SANDWICH',
forPerson,
secretSauce
}
}
function apologize(fromPerson, toPerson, error) {
return {
type: 'APOLOGIZE',
fromPerson,
toPerson,
error
}
}
function withdrawMoney(amount) {
return {
type: 'WITHDRAW',
amount
}
}
// Even without middleware, you can dispatch an action:
store.dispatch(withdrawMoney(100))
// But what do you do when you need to start an asynchronous action,
// such as an API call, or a router transition?
// Meet thunks.
// A thunk in this context is a function that can be dispatched to perform async
// activity and can dispatch actions and read state.
// This is an action creator that returns a thunk:
function makeASandwichWithSecretSauce(forPerson) {
// We can invert control here by returning a function - the "thunk".
// When this function is passed to `dispatch`, the thunk middleware will intercept it,
// and call it with `dispatch` and `getState` as arguments.
// This gives the thunk function the ability to run some logic, and still interact with the store.
return function (dispatch) {
return fetchSecretSauce().then(
sauce => dispatch(makeASandwich(forPerson, sauce)),
error => dispatch(apologize('The Sandwich Shop', forPerson, error))
)
}
}
// Thunk middleware lets me dispatch thunk async actions
// as if they were actions!
store.dispatch(makeASandwichWithSecretSauce('Me'))
// It even takes care to return the thunk’s return value
// from the dispatch, so I can chain Promises as long as I return them.
store.dispatch(makeASandwichWithSecretSauce('My partner')).then(() => {
console.log('Done!')
})
// In fact I can write action creators that dispatch
// actions and async actions from other action creators,
// and I can build my control flow with Promises.
function makeSandwichesForEverybody() {
return function (dispatch, getState) {
if (!getState().sandwiches.isShopOpen) {
// You don’t have to return Promises, but it’s a handy convention
// so the caller can always call .then() on async dispatch result.
return Promise.resolve()
}
// We can dispatch both plain object actions and other thunks,
// which lets us compose the asynchronous actions in a single flow.
return dispatch(makeASandwichWithSecretSauce('My Grandma'))
.then(() =>
Promise.all([
dispatch(makeASandwichWithSecretSauce('Me')),
dispatch(makeASandwichWithSecretSauce('My wife'))
])
)
.then(() => dispatch(makeASandwichWithSecretSauce('Our kids')))
.then(() =>
dispatch(
getState().myMoney > 42
? withdrawMoney(42)
: apologize('Me', 'The Sandwich Shop')
)
)
}
}
// This is very useful for server side rendering, because I can wait
// until data is available, then synchronously render the app.
store
.dispatch(makeSandwichesForEverybody())
.then(() =>
response.send(ReactDOMServer.renderToString(<MyApp store={store} />))
)
// I can also dispatch a thunk async action from a component
// any time its props change to load the missing data.
import { connect } from 'react-redux'
import { Component } from 'react'
class SandwichShop extends Component {
componentDidMount() {
this.props.dispatch(makeASandwichWithSecretSauce(this.props.forPerson))
}
componentDidUpdate(prevProps) {
if (prevProps.forPerson !== this.props.forPerson) {
this.props.dispatch(makeASandwichWithSecretSauce(this.props.forPerson))
}
}
render() {
return <p>{this.props.sandwiches.join('mustard')}</p>
}
}
export default connect(state => ({
sandwiches: state.sandwiches
}))(SandwichShop)
```
## License
MIT
@@ -0,0 +1,49 @@
This page contains links to some examples of existing `binding.gyp` files that other node modules are using. Take a look at them for inspiration.
To add to this page, just add the link to the project's `binding.gyp` file below:
* [ons](https://github.com/XadillaX/aliyun-ons/blob/master/binding.gyp)
* [thmclrx](https://github.com/XadillaX/thmclrx/blob/master/binding.gyp)
* [libxmljs](https://github.com/polotek/libxmljs/blob/master/binding.gyp)
* [node-buffertools](https://github.com/bnoordhuis/node-buffertools/blob/master/binding.gyp)
* [node-canvas](https://github.com/LearnBoost/node-canvas/blob/master/binding.gyp)
* [node-ffi](https://github.com/rbranson/node-ffi/blob/master/binding.gyp) + [libffi](https://github.com/rbranson/node-ffi/blob/master/deps/libffi/libffi.gyp)
* [node-time](https://github.com/TooTallNate/node-time/blob/master/binding.gyp)
* [node-sass](https://github.com/sass/node-sass/blob/master/binding.gyp) + [libsass](https://github.com/sass/node-sass/blob/master/src/libsass.gyp)
* [node-serialport](https://github.com/voodootikigod/node-serialport/blob/master/binding.gyp)
* [node-weak](https://github.com/TooTallNate/node-weak/blob/master/binding.gyp)
* [pty.js](https://github.com/chjj/pty.js/blob/master/binding.gyp)
* [ref](https://github.com/TooTallNate/ref/blob/master/binding.gyp)
* [appjs](https://github.com/milani/appjs/blob/master/binding.gyp)
* [nwm](https://github.com/mixu/nwm/blob/master/binding.gyp)
* [bcrypt](https://github.com/ncb000gt/node.bcrypt.js/blob/master/binding.gyp)
* [nk-mysql](https://github.com/mmod/nodamysql/blob/master/binding.gyp)
* [nk-xrm-installer](https://github.com/mmod/nk-xrm-installer/blob/master/binding.gyp) + [includable.gypi](https://github.com/mmod/nk-xrm-installer/blob/master/includable.gypi) + [unpack.py](https://github.com/mmod/nk-xrm-installer/blob/master/unpack.py) + [disburse.py](https://github.com/mmod/nk-xrm-installer/blob/master/disburse.py)
<sub>.py files above provide complete reference for examples of fetching source via http, extracting, and moving files.</sub>
* [node-memwatch](https://github.com/lloyd/node-memwatch/blob/master/binding.gyp)
* [node-ip2location](https://github.com/bolgovr/node-ip2location/blob/master/binding.gyp)
* [node-midi](https://github.com/justinlatimer/node-midi/blob/master/binding.gyp)
* [node-sqlite3](https://github.com/developmentseed/node-sqlite3/blob/master/binding.gyp) + [libsqlite3](https://github.com/developmentseed/node-sqlite3/blob/master/deps/sqlite3.gyp)
* [node-zipfile](https://github.com/mapbox/node-zipfile/blob/master/binding.gyp)
* [node-mapnik](https://github.com/mapnik/node-mapnik/blob/master/binding.gyp)
* [node-inotify](https://github.com/c4milo/node-inotify/blob/master/binding.gyp)
* [v8-profiler](https://github.com/c4milo/v8-profiler/blob/master/binding.gyp)
* [airtunes](https://github.com/radioline/node_airtunes/blob/master/binding.gyp)
* [node-fann](https://github.com/c4milo/node-fann/blob/master/binding.gyp)
* [node-talib](https://github.com/oransel/node-talib/blob/master/binding.gyp)
* [node-leveldown](https://github.com/rvagg/node-leveldown/blob/master/binding.gyp) + [leveldb.gyp](https://github.com/rvagg/node-leveldown/blob/master/deps/leveldb/leveldb.gyp) + [snappy.gyp](https://github.com/rvagg/node-leveldown/blob/master/deps/snappy/snappy.gyp)
* [node-expat](https://github.com/astro/node-expat/blob/master/binding.gyp) + [libexpat](https://github.com/astro/node-expat/blob/master/deps/libexpat/libexpat.gyp)
* [node-openvg-canvas](https://github.com/luismreis/node-openvg-canvas/blob/master/binding.gyp) + [node-openvg](https://github.com/luismreis/node-openvg/blob/master/binding.gyp)
* [node-cryptopp](https://github.com/BatikhSouri/node-cryptopp/blob/master/binding.gyp)
* [topcube](https://github.com/creationix/topcube/blob/master/binding.gyp)
* [node-osmium](https://github.com/osmcode/node-osmium/blob/master/binding.gyp)
* [node-osrm](https://github.com/DennisOSRM/node-osrm)
* [node-oracle](https://github.com/joeferner/node-oracle/blob/master/binding.gyp)
* [node-process-list](https://github.com/ReklatsMasters/node-process-list/blob/master/binding.gyp)
* [node-nanomsg](https://github.com/nickdesaulniers/node-nanomsg/blob/master/binding.gyp)
* [Ghostscript4JS](https://github.com/NickNaso/ghostscript4js/blob/master/binding.gyp)
* [nodecv](https://github.com/xudafeng/nodecv/blob/master/binding.gyp)
* [magick-cli](https://github.com/NickNaso/magick-cli/blob/master/binding.gyp)
* [sharp](https://github.com/lovell/sharp/blob/master/binding.gyp)
* [krb5](https://github.com/adaltas/node-krb5/blob/master/binding.gyp)
* [node-heapdump](https://github.com/bnoordhuis/node-heapdump/blob/master/binding.gyp)
@@ -0,0 +1,29 @@
var abort = require('./abort.js')
, async = require('./async.js')
;
// API
module.exports = terminator;
/**
* Terminates jobs in the attached state context
*
* @this AsyncKitState#
* @param {function} callback - final callback to invoke after termination
*/
function terminator(callback)
{
if (!Object.keys(this.jobs).length)
{
return;
}
// fast forward iteration index
this.index = this.size;
// abort jobs
abort(this);
// send back results we have so far
async(callback)(null, this.results);
}
@@ -0,0 +1,176 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Default = Default;
const index_1 = require("../check/index");
const index_2 = require("../clone/index");
const index_3 = require("../deref/index");
const index_4 = require("../../type/symbols/index");
// ------------------------------------------------------------------
// ValueGuard
// ------------------------------------------------------------------
const index_5 = require("../guard/index");
// ------------------------------------------------------------------
// TypeGuard
// ------------------------------------------------------------------
const kind_1 = require("../../type/guard/kind");
// ------------------------------------------------------------------
// ValueOrDefault
// ------------------------------------------------------------------
function ValueOrDefault(schema, value) {
const defaultValue = (0, index_5.HasPropertyKey)(schema, 'default') ? schema.default : undefined;
const clone = (0, index_5.IsFunction)(defaultValue) ? defaultValue() : (0, index_2.Clone)(defaultValue);
return (0, index_5.IsUndefined)(value) ? clone : (0, index_5.IsObject)(value) && (0, index_5.IsObject)(clone) ? Object.assign(clone, value) : value;
}
// ------------------------------------------------------------------
// HasDefaultProperty
// ------------------------------------------------------------------
function HasDefaultProperty(schema) {
return (0, kind_1.IsKind)(schema) && 'default' in schema;
}
// ------------------------------------------------------------------
// Types
// ------------------------------------------------------------------
function FromArray(schema, references, value) {
// if the value is an array, we attempt to initialize it's elements
if ((0, index_5.IsArray)(value)) {
for (let i = 0; i < value.length; i++) {
value[i] = Visit(schema.items, references, value[i]);
}
return value;
}
// ... otherwise use default initialization
const defaulted = ValueOrDefault(schema, value);
if (!(0, index_5.IsArray)(defaulted))
return defaulted;
for (let i = 0; i < defaulted.length; i++) {
defaulted[i] = Visit(schema.items, references, defaulted[i]);
}
return defaulted;
}
function FromDate(schema, references, value) {
// special case intercept for dates
return (0, index_5.IsDate)(value) ? value : ValueOrDefault(schema, value);
}
function FromImport(schema, references, value) {
const definitions = globalThis.Object.values(schema.$defs);
const target = schema.$defs[schema.$ref];
return Visit(target, [...references, ...definitions], value);
}
function FromIntersect(schema, references, value) {
const defaulted = ValueOrDefault(schema, value);
return schema.allOf.reduce((acc, schema) => {
const next = Visit(schema, references, defaulted);
return (0, index_5.IsObject)(next) ? { ...acc, ...next } : next;
}, {});
}
function FromObject(schema, references, value) {
const defaulted = ValueOrDefault(schema, value);
// return defaulted
if (!(0, index_5.IsObject)(defaulted))
return defaulted;
const knownPropertyKeys = Object.getOwnPropertyNames(schema.properties);
// properties
for (const key of knownPropertyKeys) {
// note: we need to traverse into the object and test if the return value
// yielded a non undefined result. Here we interpret an undefined result as
// a non assignable property and continue.
const propertyValue = Visit(schema.properties[key], references, defaulted[key]);
if ((0, index_5.IsUndefined)(propertyValue))
continue;
defaulted[key] = Visit(schema.properties[key], references, defaulted[key]);
}
// return if not additional properties
if (!HasDefaultProperty(schema.additionalProperties))
return defaulted;
// additional properties
for (const key of Object.getOwnPropertyNames(defaulted)) {
if (knownPropertyKeys.includes(key))
continue;
defaulted[key] = Visit(schema.additionalProperties, references, defaulted[key]);
}
return defaulted;
}
function FromRecord(schema, references, value) {
const defaulted = ValueOrDefault(schema, value);
if (!(0, index_5.IsObject)(defaulted))
return defaulted;
const additionalPropertiesSchema = schema.additionalProperties;
const [propertyKeyPattern, propertySchema] = Object.entries(schema.patternProperties)[0];
const knownPropertyKey = new RegExp(propertyKeyPattern);
// properties
for (const key of Object.getOwnPropertyNames(defaulted)) {
if (!(knownPropertyKey.test(key) && HasDefaultProperty(propertySchema)))
continue;
defaulted[key] = Visit(propertySchema, references, defaulted[key]);
}
// return if not additional properties
if (!HasDefaultProperty(additionalPropertiesSchema))
return defaulted;
// additional properties
for (const key of Object.getOwnPropertyNames(defaulted)) {
if (knownPropertyKey.test(key))
continue;
defaulted[key] = Visit(additionalPropertiesSchema, references, defaulted[key]);
}
return defaulted;
}
function FromRef(schema, references, value) {
return Visit((0, index_3.Deref)(schema, references), references, ValueOrDefault(schema, value));
}
function FromThis(schema, references, value) {
return Visit((0, index_3.Deref)(schema, references), references, value);
}
function FromTuple(schema, references, value) {
const defaulted = ValueOrDefault(schema, value);
if (!(0, index_5.IsArray)(defaulted) || (0, index_5.IsUndefined)(schema.items))
return defaulted;
const [items, max] = [schema.items, Math.max(schema.items.length, defaulted.length)];
for (let i = 0; i < max; i++) {
if (i < items.length)
defaulted[i] = Visit(items[i], references, defaulted[i]);
}
return defaulted;
}
function FromUnion(schema, references, value) {
const defaulted = ValueOrDefault(schema, value);
for (const inner of schema.anyOf) {
const result = Visit(inner, references, (0, index_2.Clone)(defaulted));
if ((0, index_1.Check)(inner, references, result)) {
return result;
}
}
return defaulted;
}
function Visit(schema, references, value) {
const references_ = (0, index_3.Pushref)(schema, references);
const schema_ = schema;
switch (schema_[index_4.Kind]) {
case 'Array':
return FromArray(schema_, references_, value);
case 'Date':
return FromDate(schema_, references_, value);
case 'Import':
return FromImport(schema_, references_, value);
case 'Intersect':
return FromIntersect(schema_, references_, value);
case 'Object':
return FromObject(schema_, references_, value);
case 'Record':
return FromRecord(schema_, references_, value);
case 'Ref':
return FromRef(schema_, references_, value);
case 'This':
return FromThis(schema_, references_, value);
case 'Tuple':
return FromTuple(schema_, references_, value);
case 'Union':
return FromUnion(schema_, references_, value);
default:
return ValueOrDefault(schema_, value);
}
}
/** `[Mutable]` Generates missing properties on a value using default schema annotations if available. This function does not check the value and returns an unknown type. You should Check the result before use. Default is a mutable operation. To avoid mutation, Clone the value first. */
function Default(...args) {
return args.length === 3 ? Visit(args[0], args[1], args[2]) : Visit(args[0], [], args[1]);
}
@@ -0,0 +1,57 @@
/*
* Copyright 2021 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, HelpTextProps, Validation} from '@react-types/shared';
import {LabelAria, LabelAriaProps, useLabel} from './useLabel';
import {mergeProps, useSlotId} from '@react-aria/utils';
export interface AriaFieldProps extends LabelAriaProps, HelpTextProps, Omit<Validation<any>, 'isRequired'> {}
export interface FieldAria extends LabelAria {
/** Props for the description element, if any. */
descriptionProps: DOMAttributes,
/** Props for the error message element, if any. */
errorMessageProps: DOMAttributes
}
/**
* Provides the accessibility implementation for input fields.
* Fields accept user input, gain context from their label, and may display a description or error message.
* @param props - Props for the Field.
*/
export function useField(props: AriaFieldProps): FieldAria {
let {description, errorMessage, isInvalid, validationState} = props;
let {labelProps, fieldProps} = useLabel(props);
let descriptionId = useSlotId([Boolean(description), Boolean(errorMessage), isInvalid, validationState]);
let errorMessageId = useSlotId([Boolean(description), Boolean(errorMessage), isInvalid, validationState]);
fieldProps = mergeProps(fieldProps, {
'aria-describedby': [
descriptionId,
// Use aria-describedby for error message because aria-errormessage is unsupported using VoiceOver or NVDA. See https://github.com/adobe/react-spectrum/issues/1346#issuecomment-740136268
errorMessageId,
props['aria-describedby']
].filter(Boolean).join(' ') || undefined
});
return {
labelProps,
fieldProps,
descriptionProps: {
id: descriptionId
},
errorMessageProps: {
id: errorMessageId
}
};
}
@@ -0,0 +1,6 @@
function _object_destructuring_empty(o) {
if (o === null || o === void 0) throw new TypeError("Cannot destructure " + o);
return o;
}
export { _object_destructuring_empty as _ };
@@ -0,0 +1,18 @@
export * from './ensureType';
export * from './getType';
export * from './isAbsoluteURL';
export * from './isArrayLike';
export * from './isAsyncFunction';
export * from './isESModule';
export * from './isError';
export * from './isFunction';
export * from './isIterable';
export * from './isLeapYear';
export * from './isLength';
export * from './isNil';
export * from './isNumber';
export * from './isObject';
export * from './isPlainObject';
export * from './isPromiseLike';
export * from './isValidDate';
export * from './isWhat';
@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.statements = exports.statement = exports.smart = exports.program = exports.expression = exports.default = void 0;
var formatters = require("./formatters.js");
var _builder = require("./builder.js");
const smart = exports.smart = (0, _builder.default)(formatters.smart);
const statement = exports.statement = (0, _builder.default)(formatters.statement);
const statements = exports.statements = (0, _builder.default)(formatters.statements);
const expression = exports.expression = (0, _builder.default)(formatters.expression);
const program = exports.program = (0, _builder.default)(formatters.program);
var _default = exports.default = Object.assign(smart.bind(undefined), {
smart,
statement,
statements,
expression,
program,
ast: smart.ast
});
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
!function(f){"object"==typeof exports&&"undefined"!=typeof module?module.exports=f():"function"==typeof define&&define.amd?define([],f):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).PropTypes=f()}(function(){return function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var p="function"==typeof require&&require;if(!f&&p)return p(i,!0);if(u)return u(i,!0);throw(p=new Error("Cannot find module '"+i+"'")).code="MODULE_NOT_FOUND",p}p=n[i]={exports:{}},e[i][0].call(p.exports,function(r){return o(e[i][1][r]||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}({1:[function(require,module,exports){"use strict";var ReactPropTypesSecret=require(3);function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction,module.exports=function(){function e(e,t,n,r,o,c){if(c!==ReactPropTypesSecret){c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}var n={array:e.isRequired=e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return n.PropTypes=n}},{3:3}],2:[function(require,module,exports){module.exports=require(1)()},{1:1}],3:[function(require,module,exports){"use strict";module.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},{}]},{},[2])(2)});
@@ -0,0 +1,104 @@
'use strict';
var test = require('tape');
var getSideChannelList = require('../');
test('getSideChannelList', function (t) {
t.test('export', function (st) {
st.equal(typeof getSideChannelList, 'function', 'is a function');
st.equal(getSideChannelList.length, 0, 'takes no arguments');
var channel = getSideChannelList();
st.ok(channel, 'is truthy');
st.equal(typeof channel, 'object', 'is an object');
st.end();
});
t.test('assert', function (st) {
var channel = getSideChannelList();
st['throws'](
function () { channel.assert({}); },
TypeError,
'nonexistent value throws'
);
var o = {};
channel.set(o, 'data');
st.doesNotThrow(function () { channel.assert(o); }, 'existent value noops');
st.end();
});
t.test('has', function (st) {
var channel = getSideChannelList();
/** @type {unknown[]} */ var o = [];
st.equal(channel.has(o), false, 'nonexistent value yields false');
channel.set(o, 'foo');
st.equal(channel.has(o), true, 'existent value yields true');
st.equal(channel.has('abc'), false, 'non object value non existent yields false');
channel.set('abc', 'foo');
st.equal(channel.has('abc'), true, 'non object value that exists yields true');
st.end();
});
t.test('get', function (st) {
var channel = getSideChannelList();
var o = {};
st.equal(channel.get(o), undefined, 'nonexistent value yields undefined');
var data = {};
channel.set(o, data);
st.equal(channel.get(o), data, '"get" yields data set by "set"');
st.end();
});
t.test('set', function (st) {
var channel = getSideChannelList();
var o = function () {};
st.equal(channel.get(o), undefined, 'value not set');
channel.set(o, 42);
st.equal(channel.get(o), 42, 'value was set');
channel.set(o, Infinity);
st.equal(channel.get(o), Infinity, 'value was set again');
var o2 = {};
channel.set(o2, 17);
st.equal(channel.get(o), Infinity, 'o is not modified');
st.equal(channel.get(o2), 17, 'o2 is set');
channel.set(o, 14);
st.equal(channel.get(o), 14, 'o is modified');
st.equal(channel.get(o2), 17, 'o2 is not modified');
st.end();
});
t.test('delete', function (st) {
var channel = getSideChannelList();
var o = {};
st.equal(channel['delete']({}), false, 'nonexistent value yields false');
channel.set(o, 42);
st.equal(channel.has(o), true, 'value is set');
st.equal(channel['delete']({}), false, 'nonexistent value still yields false');
st.equal(channel['delete'](o), true, 'deleted value yields true');
st.equal(channel.has(o), false, 'value is no longer set');
st.end();
});
t.end();
});
@@ -0,0 +1 @@
{"name":"csstype","version":"3.1.3","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532108465,"integrity":"sha512-pGW89xqLbp2Pgo2uD2x/00BvTMUA95E/T+0Hqr6nqMABQSaBn+W4PYbNKLb6D/HPM8LUMIYH3i4oODAinzK/bg==","mode":420,"size":1062},"index.js.flow":{"checkedAt":1794532108466,"integrity":"sha512-O2khCBW3weBlIpOWJ7Thc30g180gHnDZ5JORVrcWA7TwfvJMbCEs0RBNi5i2biRY95nIiXfUK3iUVXZ/sCwmfg==","mode":420,"size":329241},"package.json":{"checkedAt":1794532108466,"integrity":"sha512-xUpvC+WyLpQenHRGYjeZDB6vcy9Q2L8EdW/OPnCfLwcVJP19u514QOs6Ee/B6XtWBxijY5uk7k4rV4yVm13oFg==","mode":420,"size":2137},"README.md":{"checkedAt":1794532108467,"integrity":"sha512-rC4q1DHMszR5M1QjC9kRmgJ+jat9BlB+0cUV8n9RtVN95pQgrUnJ/El/eDc5sUqtjL8FZVcI88tIVSrwZetpzw==","mode":420,"size":10518},"index.d.ts":{"checkedAt":1794532108469,"integrity":"sha512-XkAYacFR2Grr5DLqxQt/KkxkIX566BE/Pledj+RWJ0GFbXdHDvKsoXtusjWKOkI2PD6ZSxBxJY/DTsEaMs5UzA==","mode":420,"size":903116}}}
@@ -0,0 +1,8 @@
var $8d15e736e12d3dfd$exports = {};
$8d15e736e12d3dfd$exports = {
"breadcrumbs": `\u{5BFC}\u{822A}\u{680F}`
};
export {$8d15e736e12d3dfd$exports as default};
//# sourceMappingURL=zh-CN.module.js.map
@@ -0,0 +1,20 @@
// src/info-filled.tsx
import { jsx } from "react/jsx-runtime";
var InfoFilledIcon = (props) => {
return /* @__PURE__ */ jsx(
"svg",
{
fill: "none",
height: "24",
viewBox: "0 0 24 24",
width: "24",
xmlns: "http://www.w3.org/2000/svg",
...props,
children: /* @__PURE__ */ jsx("path", { d: "M12 22C17.51 22 22 17.51 22 12C22 6.49 17.51 2 12 2C6.49 2 2 6.49 2 12C2 17.51 6.49 22 12 22ZM12.75 16C12.75 16.41 12.41 16.75 12 16.75C11.59 16.75 11.25 16.41 11.25 16L11.25 11C11.25 10.59 11.59 10.25 12 10.25C12.41 10.25 12.75 10.59 12.75 11L12.75 16ZM11.08 7.62C11.13 7.49 11.2 7.39 11.29 7.29C11.39 7.2 11.5 7.13 11.62 7.08C11.74 7.03 11.87 7 12 7C12.13 7 12.26 7.03 12.38 7.08C12.5 7.13 12.61 7.2 12.71 7.29C12.8 7.39 12.87 7.49 12.92 7.62C12.97 7.74 13 7.87 13 8C13 8.13 12.97 8.26 12.92 8.38C12.87 8.5 12.8 8.61 12.71 8.71C12.61 8.8 12.5 8.87 12.38 8.92C12.14 9.02 11.86 9.02 11.62 8.92C11.5 8.87 11.39 8.8 11.29 8.71C11.2 8.61 11.13 8.5 11.08 8.38C11.03 8.26 11 8.13 11 8C11 7.87 11.03 7.74 11.08 7.62Z" })
}
);
};
export {
InfoFilledIcon
};
@@ -0,0 +1,18 @@
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Checks if `value` is likely a prototype object.
*
* @private
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
*/
function isPrototype(value) {
var Ctor = value && value.constructor,
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
return value === proto;
}
export default isPrototype;
@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/path-browserify
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,263 @@
/*
* 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 {BackgroundColorValue, BackgroundColorValueV6, BorderColorValue, BorderColorValueV6, BorderRadiusValue, BorderSizeValue, DimensionValue} from './dna';
import {CSSProperties} from 'react';
type ResponsiveProp<T> = {
base?: T,
S?: T,
M?: T,
L?: T,
[custom: string]: T | undefined
}
type Responsive<T> = T | ResponsiveProp<T>
export interface StyleProps {
// For backward compatibility!
/** Sets the CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. Only use as a **last resort**. Use style props instead. */
UNSAFE_className?: string,
/** Sets inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. Only use as a **last resort**. Use style props instead. */
UNSAFE_style?: CSSProperties,
/** The margin for all four sides of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/margin). */
margin?: Responsive<DimensionValue>,
/** The margin for the logical start side of the element, depending on layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/margin-inline-start). */
marginStart?: Responsive<DimensionValue>,
/** The margin for the logical end side of an element, depending on layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/margin-inline-end). */
marginEnd?: Responsive<DimensionValue>,
// /** The margin for the left side of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left). Consider using `marginStart` instead for RTL support. */
// marginLeft?: Responsive<DimensionValue>,
// /** The margin for the right side of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left). Consider using `marginEnd` instead for RTL support. */
// marginRight?: Responsive<DimensionValue>,
/** The margin for the top side of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top). */
marginTop?: Responsive<DimensionValue>,
/** The margin for the bottom side of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom). */
marginBottom?: Responsive<DimensionValue>,
/** The margin for both the left and right sides of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/margin). */
marginX?: Responsive<DimensionValue>,
/** The margin for both the top and bottom sides of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/margin). */
marginY?: Responsive<DimensionValue>,
/** The width of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/width). */
width?: Responsive<DimensionValue>,
/** The height of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/height). */
height?: Responsive<DimensionValue>,
/** The minimum width of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/min-width). */
minWidth?: Responsive<DimensionValue>,
/** The minimum height of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/min-height). */
minHeight?: Responsive<DimensionValue>,
/** The maximum width of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/max-width). */
maxWidth?: Responsive<DimensionValue>,
/** The maximum height of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/max-height). */
maxHeight?: Responsive<DimensionValue>,
/** When used in a flex layout, specifies how the element will grow or shrink to fit the space available. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/flex). */
flex?: Responsive<string | number | boolean>,
/** When used in a flex layout, specifies how the element will grow to fit the space available. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow). */
flexGrow?: Responsive<number>,
/** When used in a flex layout, specifies how the element will shrink to fit the space available. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink). */
flexShrink?: Responsive<number>,
/** When used in a flex layout, specifies the initial main size of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis). */
flexBasis?: Responsive<number | string>,
/** Specifies how the element is justified inside a flex or grid container. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-self). */
justifySelf?: Responsive<'auto' | 'normal' | 'start' | 'end' | 'flex-start' | 'flex-end' | 'self-start' | 'self-end' | 'center' | 'left' | 'right' | 'stretch'>, // ...
/** Overrides the `alignItems` property of a flex or grid container. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/align-self). */
alignSelf?: Responsive<'auto' | 'normal' | 'start' | 'end' | 'center' | 'flex-start' | 'flex-end' | 'self-start' | 'self-end' | 'stretch'>,
/** The layout order for the element within a flex or grid container. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/order). */
order?: Responsive<number>,
/** When used in a grid layout, specifies the named grid area that the element should be placed in within the grid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-area). */
gridArea?: Responsive<string>,
/** When used in a grid layout, specifies the column the element should be placed in within the grid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column). */
gridColumn?: Responsive<string>,
/** When used in a grid layout, specifies the row the element should be placed in within the grid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row). */
gridRow?: Responsive<string>,
/** When used in a grid layout, specifies the starting column to span within the grid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-start). */
gridColumnStart?: Responsive<string>,
/** When used in a grid layout, specifies the ending column to span within the grid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-end). */
gridColumnEnd?: Responsive<string>,
/** When used in a grid layout, specifies the starting row to span within the grid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-start). */
gridRowStart?: Responsive<string>,
/** When used in a grid layout, specifies the ending row to span within the grid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-end). */
gridRowEnd?: Responsive<string>,
/** Specifies how the element is positioned. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/position). */
position?: Responsive<'static' | 'relative' | 'absolute' | 'fixed' | 'sticky'>,
/** The stacking order for the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/z-index). */
zIndex?: Responsive<number>,
/** The top position for the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/top). */
top?: Responsive<DimensionValue>,
/** The bottom position for the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/bottom). */
bottom?: Responsive<DimensionValue>,
/** The logical start position for the element, depending on layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/inset-inline-start). */
start?: Responsive<DimensionValue>,
/** The logical end position for the element, depending on layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/inset-inline-end). */
end?: Responsive<DimensionValue>,
/** The left position for the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/left). Consider using `start` instead for RTL support. */
left?: Responsive<DimensionValue>,
/** The right position for the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/right). Consider using `start` instead for RTL support. */
right?: Responsive<DimensionValue>,
/** Hides the element. */
isHidden?: Responsive<boolean>
}
export type ColorVersion = 5 | 6;
type BackgroundColor = {
5: BackgroundColorValue,
6: BackgroundColorValueV6
};
type BorderColor = {
5: BorderColorValue,
6: BorderColorValueV6
}
// These support more properties than specific Spectrum components
// but still based on spectrum global/alias variables.
export interface ViewStyleProps<C extends ColorVersion> extends StyleProps {
/**
* The Spectrum color token version number.
* @default 5
*/
colorVersion?: C,
/** The background color for the element. */
backgroundColor?: Responsive<BackgroundColor[C]>,
/** The width of the element's border on all four sides. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-width). */
borderWidth?: Responsive<BorderSizeValue>,
/** The width of the border on the logical start side, depending on the layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline-start-width). */
borderStartWidth?: Responsive<BorderSizeValue>,
/** The width of the border on the logical end side, depending on the layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline-end-width). */
borderEndWidth?: Responsive<BorderSizeValue>,
// borderLeftWidth?: BorderSizeValue,
// borderRightWidth?: BorderSizeValue,
/** The width of the top border. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-width). */
borderTopWidth?: Responsive<BorderSizeValue>,
/** The width of the bottom border. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-width). */
borderBottomWidth?: Responsive<BorderSizeValue>,
/** The width of the left and right borders. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-width). */
borderXWidth?: Responsive<BorderSizeValue>,
/** The width of the top and bottom borders. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-width). */
borderYWidth?: Responsive<BorderSizeValue>,
/** The color of the element's border on all four sides. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-color). */
borderColor?: Responsive<BorderColor[C]>,
/** The color of the border on the logical start side, depending on the layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline-start-color). */
borderStartColor?: Responsive<BorderColor[C]>,
/** The color of the border on the logical end side, depending on the layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-inline-end-color). */
borderEndColor?: Responsive<BorderColor[C]>,
// borderLeftColor?: BorderColorValue,
// borderRightColor?: BorderColorValue,
/** The color of the top border. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-color). */
borderTopColor?: Responsive<BorderColor[C]>,
/** The color of the bottom border. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-color). */
borderBottomColor?: Responsive<BorderColor[C]>,
/** The color of the left and right borders. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-color). */
borderXColor?: Responsive<BorderColor[C]>,
/** The color of the top and bottom borders. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-width). */
borderYColor?: Responsive<BorderColor[C]>,
/** The border radius on all four sides of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius). */
borderRadius?: Responsive<BorderRadiusValue>,
/** The border radius for the top start corner of the element, depending on the layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-start-start-radius). */
borderTopStartRadius?: Responsive<BorderRadiusValue>,
/** The border radius for the top end corner of the element, depending on the layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-start-end-radius). */
borderTopEndRadius?: Responsive<BorderRadiusValue>,
/** The border radius for the bottom start corner of the element, depending on the layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-end-start-radius). */
borderBottomStartRadius?: Responsive<BorderRadiusValue>,
/** The border radius for the bottom end corner of the element, depending on the layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/border-end-end-radius). */
borderBottomEndRadius?: Responsive<BorderRadiusValue>,
// borderTopLeftRadius?: BorderRadiusValue,
// borderTopRightRadius?: BorderRadiusValue,
// borderBottomLeftRadius?: BorderRadiusValue,
// borderBottomRightRadius?: BorderRadiusValue,
/** The padding for all four sides of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/padding). */
padding?: Responsive<DimensionValue>,
/** The padding for the logical start side of the element, depending on layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/padding-inline-start). */
paddingStart?: Responsive<DimensionValue>,
/** The padding for the logical end side of an element, depending on layout direction. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/padding-inline-end). */
paddingEnd?: Responsive<DimensionValue>,
// paddingLeft?: Responsive<DimensionValue>,
// paddingRight?: Responsive<DimensionValue>,
/** The padding for the top side of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/padding-top). */
paddingTop?: Responsive<DimensionValue>,
/** The padding for the bottom side of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/padding-bottom). */
paddingBottom?: Responsive<DimensionValue>,
/** The padding for both the left and right sides of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/padding). */
paddingX?: Responsive<DimensionValue>,
/** The padding for both the top and bottom sides of the element. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/padding). */
paddingY?: Responsive<DimensionValue>,
/** Species what to do when the element's content is too long to fit its size. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/overflow). */
overflow?: Responsive<string>
// ...
// shadows?
// transforms?
}
export interface BoxAlignmentStyleProps {
/**
* The distribution of space around items along the main axis. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content).
* @default 'stretch'
*/
justifyContent?: Responsive<'start' | 'end' | 'center' | 'left' | 'right' | 'space-between' | 'space-around' | 'space-evenly' | 'stretch' | 'baseline' | 'first baseline' | 'last baseline' | 'safe center' | 'unsafe center'>,
/**
* The distribution of space around child items along the cross axis. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/align-content).
* @default 'start'
*/
alignContent?: Responsive<'start' | 'end' | 'center' | 'space-between' | 'space-around' | 'space-evenly' | 'stretch' | 'baseline' | 'first baseline' | 'last baseline' | 'safe center' | 'unsafe center'>,
/**
* The alignment of children within their container. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/align-items).
* @default 'stretch'
*/
alignItems?: Responsive<'start' | 'end' | 'center' | 'stretch' | 'self-start' | 'self-end' | 'baseline' | 'first baseline' | 'last baseline' | 'safe center' | 'unsafe center'>,
/** The space to display between both rows and columns. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/gap). */
gap?: Responsive<DimensionValue>,
/** The space to display between columns. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/column-gap). */
columnGap?: Responsive<DimensionValue>,
/** The space to display between rows. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/row-gap). */
rowGap?: Responsive<DimensionValue>
}
export interface FlexStyleProps extends BoxAlignmentStyleProps, StyleProps {
/**
* The direction in which to layout children. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction).
* @default 'row'
*/
direction?: Responsive<'row' | 'column' | 'row-reverse' | 'column-reverse'>,
/**
* Whether to wrap items onto multiple lines. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-wrap).
* @default false
*/
wrap?: Responsive<boolean | 'wrap' | 'nowrap' | 'wrap-reverse'>
}
export interface GridStyleProps extends BoxAlignmentStyleProps, StyleProps {
/** Defines named grid areas. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-areas). */
areas?: Responsive<string[]>,
/** Defines the sizes of each row in the grid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-rows). */
rows?: Responsive<string | DimensionValue[]>,
/** Defines the sizes of each column in the grid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-columns). */
columns?: Responsive<string | DimensionValue[]>,
/** Defines the size of implicitly generated columns. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-columns). */
autoColumns?: Responsive<DimensionValue>,
/** Defines the size of implicitly generated rows. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-rows). */
autoRows?: Responsive<DimensionValue>,
/** Controls how auto-placed items are flowed into the grid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-flow). */
autoFlow?: Responsive<'row' | 'column' | 'row dense' | 'column dense'>,
/** Defines the default `justifySelf` for all items in the grid. See [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-items). */
justifyItems?: Responsive<'auto' | 'normal' | 'start' | 'end' | 'center' | 'left' | 'right' | 'stretch' | 'self-start' | 'self-end' | 'baseline' | 'first baseline' | 'last baseline' | 'safe center' | 'unsafe center' | 'legacy right' | 'legacy left' | 'legacy center'>
}
@@ -0,0 +1 @@
{"version":3,"file":"windowsTerminal.test.js","sourceRoot":"","sources":["../src/windowsTerminal.test.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAEH,uBAAyB;AACzB,+BAAiC;AACjC,qDAAoD;AACpD,2BAA6B;AAC7B,gCAAkC;AAYlC,SAAS,mBAAmB,CAAC,YAA2B,EAAE,UAAwB,EAAE,SAAwB;IAAlD,2BAAA,EAAA,gBAAwB;IAAE,0BAAA,EAAA,gBAAwB;IAC1G,OAAO,IAAI,OAAO,CAAO,UAAA,OAAO;QAC9B,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,IAAM,QAAQ,GAAG,WAAW,CAAC;YAC3B,MAAM,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,UAAA,EAAE;gBAC3B,IAAI,OAAO,GAAG,IAAI,CAAC;gBACnB,IAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,EAAf,CAAe,CAAC,CAAC;gBACjE,IAAI,CAAC,OAAO,CAAC,UAAA,GAAG;oBACd,IAAI,YAAY,CAAC,GAAG,CAAC,EAAE;wBACrB,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,GAAG,KAAK,GAAG,EAAb,CAAa,CAAC,EAAE;4BAChC,OAAO,GAAG,KAAK,CAAC;yBACjB;qBACF;yBAAM;wBACL,IAAI,EAAE,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,GAAG,KAAK,GAAG,EAAb,CAAa,CAAC,EAAE;4BAC/B,OAAO,GAAG,KAAK,CAAC;yBACjB;qBACF;gBACH,CAAC,CAAC,CAAC;gBACH,IAAI,OAAO,EAAE;oBACX,aAAa,CAAC,QAAQ,CAAC,CAAC;oBACxB,OAAO,EAAE,CAAC;oBACV,OAAO;iBACR;gBACD,KAAK,EAAE,CAAC;gBACR,IAAI,KAAK,GAAG,UAAU,IAAI,SAAS,EAAE;oBACnC,aAAa,CAAC,QAAQ,CAAC,CAAC;oBACxB,IAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAG,CAAC,UAAK,YAAY,CAAC,CAAC,CAAG,EAA1B,CAA0B,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBAC5E,MAAM,CAAC,IAAI,CAAC,mCAAiC,cAAgB,CAAC,CAAC;oBAC/D,OAAO,EAAE,CAAC;iBACX;YACH,CAAC,CAAC,CAAC;QACL,CAAC,EAAE,UAAU,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,sBAAsB,CAAC,GAAW,EAAE,IAAY,EAAE,UAAwB,EAAE,SAAwB;IAAlD,2BAAA,EAAA,gBAAwB;IAAE,0BAAA,EAAA,gBAAwB;IAC3G,OAAO,IAAI,OAAO,CAA8B,UAAA,OAAO;QACrD,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,IAAM,QAAQ,GAAG,WAAW,CAAC;YAC3B,MAAM,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,UAAA,EAAE;gBAC3B,IAAM,QAAQ,GAAgC,EAAE,CAAC;gBACjD,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,GAAG,KAAK,GAAG,EAAb,CAAa,CAAC,CAAC,GAAG,CAAC,UAAA,CAAC;oBAC/C,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;gBACtC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACP,IAAM,IAAI,GAAgC,EAAE,CAAC;;oBAE3C,IAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,EAAG,CAAC;oBAClC,EAAE,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,GAAG,EAAtB,CAAsB,CAAC,CAAC,GAAG,CAAC,UAAA,CAAC;wBAC1C,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;oBACtC,CAAC,CAAC,CAAC,OAAO,CAAC,UAAA,CAAC,IAAI,OAAA,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAhB,CAAgB,CAAC,CAAC;oBAClC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;;gBALrB,OAAO,QAAQ,CAAC,MAAM;;iBAMrB;gBACD,IAAM,OAAO,GAAG,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC;gBACrC,IAAI,OAAO,EAAE;oBACX,aAAa,CAAC,QAAQ,CAAC,CAAC;oBACxB,OAAO,CAAC,IAAI,CAAC,CAAC;oBACd,OAAO;iBACR;gBACD,KAAK,EAAE,CAAC;gBACR,IAAI,KAAK,GAAG,UAAU,IAAI,SAAS,EAAE;oBACnC,aAAa,CAAC,QAAQ,CAAC,CAAC;oBACxB,MAAM,CAAC,IAAI,CAAC,kCAAgC,IAAI,kBAAa,IAAI,CAAC,MAAQ,CAAC,CAAC;iBAC7E;YACH,CAAC,CAAC,CAAC;QACL,CAAC,EAAE,UAAU,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;IAChC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,UAAC,SAAS;QAC9B,QAAQ,CAAC,kCAAgC,SAAS,MAAG,EAAE;YACrD,QAAQ,CAAC,MAAM,EAAE;gBACf,EAAE,CAAC,iCAAiC,EAAE,UAAC,IAAI;oBACzC,IAAM,IAAI,GAAG,IAAI,iCAAe,CAAC,SAAS,EAAE,EAAE,EAAE,EAAE,SAAS,WAAA,EAAE,CAAC,CAAC;oBAC/D,IAAI,CAAC,IAAI,EAAE,CAAC;oBACZ,iFAAiF;oBAC3E,IAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBAC3B,CAAC,CAAC,CAAC;gBACH,EAAE,CAAC,8BAA8B,EAAE,UAAU,IAAgB;oBAC3D,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;oBACpB,IAAM,IAAI,GAAG,IAAI,iCAAe,CAAC,SAAS,EAAE,EAAE,EAAE,EAAE,SAAS,WAAA,EAAE,CAAC,CAAC;oBAC/D,sBAAsB;oBACtB,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;oBAC/B,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;oBAC5B,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;oBACzB,sBAAsB,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,UAAA,IAAI;wBACtD,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,SAAS,CAAC,CAAC;wBAC1D,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,gBAAgB,CAAC,CAAC;wBACjE,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,aAAa,CAAC,CAAC;wBAC9D,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,UAAU,CAAC,CAAC;wBAC3D,IAAI,CAAC,IAAI,EAAE,CAAC;wBACZ,IAAM,YAAY,GAAkB,EAAE,CAAC;wBACvC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;wBAClC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;wBAClC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;wBACjC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;wBAClC,mBAAmB,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC;4BACrC,2BAA2B;4BAC3B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;4BAC1B,IAAI,EAAE,CAAC;wBACT,CAAC,CAAC,CAAC;oBACL,CAAC,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,QAAQ,CAAC,QAAQ,EAAE;gBACjB,EAAE,CAAC,oEAAoE,EAAE;oBACvE,IAAM,IAAI,GAAG,IAAI,iCAAe,CAAC,SAAS,EAAE,EAAE,EAAE,EAAE,SAAS,WAAA,EAAE,CAAC,CAAC;oBAC/D,MAAM,CAAC,MAAM,CAAC,cAAM,OAAA,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAnB,CAAmB,CAAC,CAAC;oBACzC,MAAM,CAAC,MAAM,CAAC,cAAM,OAAA,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAALine truncated
@@ -0,0 +1,32 @@
/* eslint no-undefined: 0 */
'use strict';
var format = require('./format');
var _require = require('triple-beam'),
MESSAGE = _require.MESSAGE;
var jsonStringify = require('safe-stable-stringify');
/*
* function simple (info)
* Returns a new instance of the simple format TransformStream
* which writes a simple representation of logs.
*
* const { level, message, splat, ...rest } = info;
*
* ${level}: ${message} if rest is empty
* ${level}: ${message} ${JSON.stringify(rest)} otherwise
*/
module.exports = format(function (info) {
var stringifiedRest = jsonStringify(Object.assign({}, info, {
level: undefined,
message: undefined,
splat: undefined
}));
var padding = info.padding && info.padding[info.level] || '';
if (stringifiedRest !== '{}') {
info[MESSAGE] = "".concat(info.level, ":").concat(padding, " ").concat(info.message, " ").concat(stringifiedRest);
} else {
info[MESSAGE] = "".concat(info.level, ":").concat(padding, " ").concat(info.message);
}
return info;
});
@@ -0,0 +1,68 @@
{
"name": "package-json-from-dist",
"version": "1.0.1",
"description": "Load the local package.json from either src or dist folder",
"main": "./dist/commonjs/index.js",
"exports": {
"./package.json": "./package.json",
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
}
},
"files": [
"dist"
],
"scripts": {
"preversion": "npm test",
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags",
"prepare": "tshy",
"pretest": "npm run prepare",
"presnap": "npm run prepare",
"test": "tap",
"snap": "tap",
"format": "prettier --write . --log-level warn",
"typedoc": "typedoc"
},
"author": "Isaac Z. Schlueter <i@izs.me> (https://izs.me)",
"license": "BlueOak-1.0.0",
"repository": {
"type": "git",
"url": "git+https://github.com/isaacs/package-json-from-dist.git"
},
"devDependencies": {
"@types/node": "^20.12.12",
"prettier": "^3.2.5",
"tap": "^18.5.3",
"typedoc": "^0.24.8",
"typescript": "^5.1.6",
"tshy": "^1.14.0"
},
"prettier": {
"semi": false,
"printWidth": 70,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"jsxSingleQuote": false,
"bracketSameLine": true,
"arrowParens": "avoid",
"endOfLine": "lf",
"experimentalTernaries": true
},
"tshy": {
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts"
}
},
"types": "./dist/commonjs/index.d.ts",
"type": "module"
}
@@ -0,0 +1 @@
{"version":3,"file":"InstanceBindingNode.js","sourceRoot":"","sources":["../../../../src/planning/models/InstanceBindingNode.ts"],"names":[],"mappings":""}
@@ -0,0 +1,34 @@
import * as _heroui_system from '@heroui/system';
import { HTMLHeroUIProps } from '@heroui/system';
import { GridNode } from '@react-types/grid';
import { Key } from 'react';
import { ValuesType } from './use-table.js';
import '@react-types/table';
import '@heroui/theme';
import '@react-stately/virtualizer';
import '@react-types/shared';
import '@react-stately/table';
import '@react-aria/table';
import '@heroui/react-utils';
import '@heroui/checkbox';
interface TableCheckboxCellProps<T = object> extends HTMLHeroUIProps<"td"> {
/**
* The key of the table row.
*/
rowKey: Key;
/**
* The table cell.
*/
node: GridNode<T>;
slots: ValuesType["slots"];
state: ValuesType["state"];
color: ValuesType["color"];
disableAnimation: ValuesType["disableAnimation"];
checkboxesProps: ValuesType["checkboxesProps"];
selectionMode: ValuesType["selectionMode"];
classNames?: ValuesType["classNames"];
}
declare const TableCheckboxCell: _heroui_system.InternalForwardRefRenderFunction<"td", TableCheckboxCellProps<object>, never>;
export { type TableCheckboxCellProps, TableCheckboxCell as default };
@@ -0,0 +1,4 @@
{
"main": "../../cjs/_object_without_properties.cjs",
"module": "../../esm/_object_without_properties.js"
}
@@ -0,0 +1 @@
{"version":3,"file":"isNoAncestorBindingConstraintsWithServiceId.spec.d.ts","sourceRoot":"","sources":["../../../../src/binding/calculations/isNoAncestorBindingConstraintsWithServiceId.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"A B","2":"K D E F wC"},B:{"1":"0 1 2 3 4 5 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","2":"xC TC J ZB K D 0C 1C"},D:{"1":"0 1 2 3 4 5 6 7 8 9 G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","16":"J ZB K D E F A B C L M"},E:{"1":"K D E F A B C L M G 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","2":"J ZB 2C ZC 3C"},F:{"1":"0 1 2 3 4 5 6 7 8 9 C G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JD OC","2":"F FD GD","16":"B HD ID NC uC"},G:{"1":"E 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","2":"ZC KD vC LD"},H:{"2":"hD"},I:{"1":"I mD nD","2":"TC J iD jD kD lD vC"},J:{"1":"A","2":"D"},K:{"1":"C H uC OC","2":"A","16":"B NC"},L:{"1":"I"},M:{"1":"MC"},N:{"1":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 J AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"1D 2D"}},B:5,C:"FileReaderSync",D:true};
@@ -0,0 +1,2 @@
var qs=Object.defineProperty;var tn=n=>{throw TypeError(n)};var nn=(n,e)=>{for(var t in e)qs(n,t,{get:e[t],enumerable:!0})};var dt=(n,e,t)=>e.has(n)||tn("Cannot "+t);var L=(n,e,t)=>(dt(n,e,"read from private field"),t?t.call(n):e.get(n)),V=(n,e,t)=>e.has(n)?tn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),te=(n,e,t,s)=>(dt(n,e,"write to private field"),s?s.call(n,t):e.set(n,t),t),c=(n,e,t)=>(dt(n,e,"access private method"),t);var Zt={};nn(Zt,{parsers:()=>Kt});var Kt={};nn(Kt,{__ng_action:()=>Jr,__ng_binding:()=>Yr,__ng_directive:()=>Kr,__ng_interpolation:()=>Qr});var ei=new RegExp(`(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,"g");var sn;(function(n){n[n.Emulated=0]="Emulated",n[n.None=2]="None",n[n.ShadowDom=3]="ShadowDom"})(sn||(sn={}));var rn;(function(n){n[n.OnPush=0]="OnPush",n[n.Default=1]="Default"})(rn||(rn={}));var on;(function(n){n[n.None=0]="None",n[n.SignalBased=1]="SignalBased",n[n.HasDecoratorInputTransform=2]="HasDecoratorInputTransform"})(on||(on={}));var D;(function(n){n[n.NONE=0]="NONE",n[n.HTML=1]="HTML",n[n.STYLE=2]="STYLE",n[n.SCRIPT=3]="SCRIPT",n[n.URL=4]="URL",n[n.RESOURCE_URL=5]="RESOURCE_URL"})(D||(D={}));var an;(function(n){n[n.Error=0]="Error",n[n.Warning=1]="Warning",n[n.Ignore=2]="Ignore"})(an||(an={}));var ln;(function(n){n[n.Directive=0]="Directive",n[n.Component=1]="Component",n[n.Injectable=2]="Injectable",n[n.Pipe=3]="Pipe",n[n.NgModule=4]="NgModule"})(ln||(ln={}));var cn;(function(n){n[n.Directive=0]="Directive",n[n.Pipe=1]="Pipe",n[n.NgModule=2]="NgModule"})(cn||(cn={}));var un;(function(n){n[n.Emulated=0]="Emulated",n[n.None=2]="None",n[n.ShadowDom=3]="ShadowDom"})(un||(un={}));var pn;(function(n){n[n.Little=0]="Little",n[n.Big=1]="Big"})(pn||(pn={}));var hn;(function(n){n[n.None=0]="None",n[n.Const=1]="Const"})(hn||(hn={}));var fn;(function(n){n[n.Dynamic=0]="Dynamic",n[n.Bool=1]="Bool",n[n.String=2]="String",n[n.Int=3]="Int",n[n.Number=4]="Number",n[n.Function=5]="Function",n[n.Inferred=6]="Inferred",n[n.None=7]="None"})(fn||(fn={}));var js=void 0;var dn;(function(n){n[n.Minus=0]="Minus",n[n.Plus=1]="Plus"})(dn||(dn={}));var _;(function(n){n[n.Equals=0]="Equals",n[n.NotEquals=1]="NotEquals",n[n.Identical=2]="Identical",n[n.NotIdentical=3]="NotIdentical",n[n.Minus=4]="Minus",n[n.Plus=5]="Plus",n[n.Divide=6]="Divide",n[n.Multiply=7]="Multiply",n[n.Modulo=8]="Modulo",n[n.And=9]="And",n[n.Or=10]="Or",n[n.BitwiseOr=11]="BitwiseOr",n[n.BitwiseAnd=12]="BitwiseAnd",n[n.Lower=13]="Lower",n[n.LowerEquals=14]="LowerEquals",n[n.Bigger=15]="Bigger",n[n.BiggerEquals=16]="BiggerEquals",n[n.NullishCoalesce=17]="NullishCoalesce",n[n.Exponentiation=18]="Exponentiation",n[n.In=19]="In"})(_||(_={}));function zs(n,e){return n==null||e==null?n==e:n.isEquivalent(e)}function Gs(n,e,t){let s=n.length;if(s!==e.length)return!1;for(let r=0;r<s;r++)if(!t(n[r],e[r]))return!1;return!0}function ct(n,e){return Gs(n,e,(t,s)=>t.isEquivalent(s))}var b=class{type;sourceSpan;constructor(e,t){this.type=e||null,this.sourceSpan=t||null}prop(e,t){return new _t(this,e,null,t)}key(e,t,s){return new Ct(this,e,t,s)}callFn(e,t,s){return new xt(this,e,null,t,s)}instantiate(e,t,s){return new St(this,e,t,s)}conditional(e,t=null,s){return new yt(this,e,t,null,s)}equals(e,t){return new C(_.Equals,this,e,null,t)}notEquals(e,t){return new C(_.NotEquals,this,e,null,t)}identical(e,t){return new C(_.Identical,this,e,null,t)}notIdentical(e,t){return new C(_.NotIdentical,this,e,null,t)}minus(e,t){return new C(_.Minus,this,e,null,t)}plus(e,t){return new C(_.Plus,this,e,null,t)}divide(e,t){return new C(_.Divide,this,e,null,t)}multiply(e,t){return new C(_.Multiply,this,e,null,t)}modulo(e,t){return new C(_.Modulo,this,e,null,t)}power(e,t){return new C(_.Exponentiation,this,e,null,t)}and(e,t){return new C(_.And,this,e,null,t)}bitwiseOr(e,t){return new C(_.BitwiseOr,this,e,null,t)}bitwiseAnd(e,t){return new C(_.BitwiseAnd,this,e,null,t)}or(e,t){return new C(_.Or,this,e,null,t)}lower(e,t){return new C(_.Lower,this,e,null,t)}lowerEquals(e,t){return new C(_.LowerEquals,this,e,null,t)}bigger(e,t){return new C(_.Bigger,this,e,null,t)}biggerEquals(e,t){return new C(_.BiggerEquals,this,e,null,t)}isBlank(e){return this.equals(TYPED_NULL_EXPR,e)}nullishCoalesce(e,t){return new C(_.NullishCoalesce,this,e,null,t)}toStmt(){return new It(this,null)}},st=class n extends b{name;constructor(e,t,s){super(t,s),this.name=e}isEquivalent(e){return e instanceof n&&this.name===e.name}isConstant(){return!1}visitExpression(e,t){return e.visitReadVarExpr(this,t)}clone(){return new n(this.name,this.type,this.sourceSpan)}set(e){return new gt(this.name,e,null,this.sourceSpan)}},mt=class n extends b{expr;constructor(e,t,s){super(t,s),this.expr=e}visitExpression(e,t){return e.visitTypeofExpr(this,t)}isEquivalent(e){return e instanceof n&&e.expr.isEquivalent(this.expr)}isConstant(){return this.expr.isConstant()}clone(){return new n(this.expr.clone())}};varLine truncated
\r \v\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`,Ei=new RegExp(`[^${ds}]`),yi=new RegExp(`[${ds}]{2,}`,"g");var m;(function(n){n[n.Character=0]="Character",n[n.Identifier=1]="Identifier",n[n.PrivateIdentifier=2]="PrivateIdentifier",n[n.Keyword=3]="Keyword",n[n.String=4]="String",n[n.Operator=5]="Operator",n[n.Number=6]="Number",n[n.Error=7]="Error"})(m||(m={}));var q;(function(n){n[n.Plain=0]="Plain",n[n.TemplateLiteralPart=1]="TemplateLiteralPart",n[n.TemplateLiteralEnd=2]="TemplateLiteralEnd"})(q||(q={}));var Ir=["var","let","as","null","undefined","true","false","if","else","this","typeof","void","in"],qe=class{tokenize(e){return new Dt(e).scan()}},M=class{index;end;type;numValue;strValue;constructor(e,t,s,r,i){this.index=e,this.end=t,this.type=s,this.numValue=r,this.strValue=i}isCharacter(e){return this.type===m.Character&&this.numValue===e}isNumber(){return this.type===m.Number}isString(){return this.type===m.String}isOperator(e){return this.type===m.Operator&&this.strValue===e}isIdentifier(){return this.type===m.Identifier}isPrivateIdentifier(){return this.type===m.PrivateIdentifier}isKeyword(){return this.type===m.Keyword}isKeywordLet(){return this.type===m.Keyword&&this.strValue==="let"}isKeywordAs(){return this.type===m.Keyword&&this.strValue==="as"}isKeywordNull(){return this.type===m.Keyword&&this.strValue==="null"}isKeywordUndefined(){return this.type===m.Keyword&&this.strValue==="undefined"}isKeywordTrue(){return this.type===m.Keyword&&this.strValue==="true"}isKeywordFalse(){return this.type===m.Keyword&&this.strValue==="false"}isKeywordThis(){return this.type===m.Keyword&&this.strValue==="this"}isKeywordTypeof(){return this.type===m.Keyword&&this.strValue==="typeof"}isKeywordVoid(){return this.type===m.Keyword&&this.strValue==="void"}isKeywordIn(){return this.type===m.Keyword&&this.strValue==="in"}isError(){return this.type===m.Error}toNumber(){return this.type===m.Number?this.numValue:-1}isTemplateLiteralPart(){return this.isString()&&this.kind===q.TemplateLiteralPart}isTemplateLiteralEnd(){return this.isString()&&this.kind===q.TemplateLiteralEnd}isTemplateLiteralInterpolationStart(){return this.isOperator("${")}isTemplateLiteralInterpolationEnd(){return this.isOperator("}")}toString(){switch(this.type){case m.Character:case m.Identifier:case m.Keyword:case m.Operator:case m.PrivateIdentifier:case m.String:case m.Error:return this.strValue;case m.Number:return this.numValue.toString();default:return null}}},Ie=class extends M{kind;constructor(e,t,s,r){super(e,t,m.String,0,s),this.kind=r}};function Ze(n,e,t){return new M(n,e,m.Character,t,String.fromCharCode(t))}function Nr(n,e,t){return new M(n,e,m.Identifier,0,t)}function Ar(n,e,t){return new M(n,e,m.PrivateIdentifier,0,t)}function Pr(n,e,t){return new M(n,e,m.Keyword,0,t)}function _e(n,e,t){return new M(n,e,m.Operator,0,t)}function Lr(n,e,t){return new M(n,e,m.Number,t,"")}function Mr(n,e,t){return new M(n,e,m.Error,0,t)}var et=new M(-1,-1,m.Character,0,""),Dt=class{input;tokens=[];length;peek=0;index=-1;braceStack=[];constructor(e){this.input=e,this.length=e.length,this.advance()}scan(){let e=this.scanToken();for(;e!==null;)this.tokens.push(e),e=this.scanToken();return this.tokens}advance(){this.peek=++this.index>=this.length?Qe:this.input.charCodeAt(this.index)}scanToken(){let e=this.input,t=this.length,s=this.peek,r=this.index;for(;s<=Zn;)if(++r>=t){s=Qe;break}else s=e.charCodeAt(r);if(this.peek=s,this.index=r,r>=t)return null;if(zn(s))return this.scanIdentifier();if(z(s))return this.scanNumber(r);let i=r;switch(s){case re:return this.advance(),z(this.peek)?this.scanNumber(i):Ze(i,this.index,re);case tt:case se:case nt:case ke:case Ce:case ie:case Te:return this.scanCharacter(i,s);case ot:return this.scanOpenBrace(i,s);case be:return this.scanCloseBrace(i,s);case ts:case es:return this.scanString();case $t:return this.advance(),this.scanTemplateLiteralPart(i);case nr:return this.scanPrivateIdentifier();case ns:case ss:case Mt:case sr:case cr:return this.scanOperator(i,String.fromCharCode(s));case En:return this.scanComplexOperator(i,"*",En,"*");case yn:return this.scanQuestion(i);case rr:case ir:return this.scanComplexOperator(i,String.fromCharCode(s),Ke,"=");case tr:case Ke:return this.scanComplexOperator(i,String.fromCharCode(s),Ke,"=",Ke,"=");case Sn:return this.scanComplexOperator(i,"&",Sn,"&");case Cn:return this.scanComplexOperator(i,"|",Cn,"|");case ls:for(;vr(this.peek);)this.advance();return this.scanToken()}return this.advance(),this.error(`Unexpected character [${String.fromCharCode(s)}]`,0)}scanCharacter(e,t){return this.advance(),Ze(e,this.index,t)}scanOperator(e,t){return this.advance(),_e(e,this.index,t)}scanOpenBrace(e,t){return this.braceStack.push("expression"),this.advance(),Ze(e,this.index,t)}scanCloseBrace(e,t){return this.advance(),this.braceStack.pop()==="interpolation"?(this.tokens.push(_e(e,this.index,"}")),this.scanTemplateLiteralPart(this.index)):Ze(e,this.index,t)}scanComplexOperator(e,t,s,Line truncated
@@ -0,0 +1,101 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.ts
var index_exports = {};
__export(index_exports, {
Divider: () => divider_default,
useDivider: () => useDivider
});
module.exports = __toCommonJS(index_exports);
// src/divider.tsx
var import_system_rsc = require("@heroui/system-rsc");
// src/use-divider.ts
var import_theme = require("@heroui/theme");
var import_react = require("react");
// src/use-separator.ts
var import_react_rsc_utils = require("@heroui/react-rsc-utils");
function useSeparator(props) {
let domProps = (0, import_react_rsc_utils.filterDOMProps)(props, {
enabled: typeof props.elementType === "string"
});
let ariaOrientation;
if (props.orientation === "vertical") {
ariaOrientation = "vertical";
}
if (props.elementType !== "hr") {
return {
separatorProps: {
...domProps,
role: "separator",
"aria-orientation": ariaOrientation
}
};
}
return { separatorProps: domProps };
}
// src/use-divider.ts
function useDivider(props) {
const { as, className, orientation, ...otherProps } = props;
let Component = as || "hr";
if (Component === "hr" && orientation === "vertical") {
Component = "div";
}
const { separatorProps } = useSeparator({
elementType: typeof Component === "string" ? Component : "hr",
orientation
});
const styles = (0, import_react.useMemo)(
() => (0, import_theme.divider)({
orientation,
className
}),
[orientation, className]
);
const getDividerProps = (0, import_react.useCallback)(
(props2 = {}) => ({
className: styles,
role: "separator",
"data-orientation": orientation,
...separatorProps,
...otherProps,
...props2
}),
[styles, orientation, separatorProps, otherProps]
);
return { Component, getDividerProps };
}
// src/divider.tsx
var import_jsx_runtime = require("react/jsx-runtime");
var Divider = (0, import_system_rsc.forwardRef)((props, ref) => {
const { Component, getDividerProps } = useDivider({ ...props });
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ref, ...getDividerProps() });
});
Divider.displayName = "HeroUI.Divider";
var divider_default = Divider;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Divider,
useDivider
});
@@ -0,0 +1,74 @@
# array.prototype.findlast <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
An ESnext spec-compliant `Array.prototype.findLast` shim/polyfill/replacement that works as far down as ES3.
This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the proposed [spec](https://tc39.es/proposal-array-find-from-last).
Because `Array.prototype.findLast` depends on a receiver (the `this` value), the main export takes the array to operate on as the first argument.
## Getting started
```sh
npm install --save array.prototype.findlast
```
## Usage/Examples
```js
var findLast = require('array.prototype.findlast');
var assert = require('assert');
var arr = [1, [2], [], 3, [[4]]];
var isNumber = function (x) { return typeof x === 'number' };
assert.deepEqual(findLast(arr, isNumber), 3);
```
```js
var findLast = require('array.prototype.findlast');
var assert = require('assert');
/* when Array#findLast is not present */
delete Array.prototype.findLast;
var shimmed = findLast.shim();
assert.equal(shimmed, findLast.getPolyfill());
assert.deepEqual(arr.findLast(isNumber), findLast(arr, isNumber));
```
```js
var findLast = require('array.prototype.findlast');
var assert = require('assert');
/* when Array#findLast is present */
var shimmed = findLast.shim();
assert.equal(shimmed, Array.prototype.findLast);
assert.deepEqual(arr.findLast(isNumber), findLast(arr, isNumber));
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
[package-url]: https://npmjs.org/package/array.prototype.findlast
[npm-version-svg]: https://versionbadg.es/es-shims/Array.prototype.findLast.svg
[deps-svg]: https://david-dm.org/es-shims/Array.prototype.findLast.svg
[deps-url]: https://david-dm.org/es-shims/Array.prototype.findLast
[dev-deps-svg]: https://david-dm.org/es-shims/Array.prototype.findLast/dev-status.svg
[dev-deps-url]: https://david-dm.org/es-shims/Array.prototype.findLast#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/array.prototype.findlast.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/array.prototype.findlast.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/array.prototype.findlast.svg
[downloads-url]: https://npm-stat.com/charts.html?package=array.prototype.findlast
[codecov-image]: https://codecov.io/gh/es-shims/Array.prototype.findLast/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/es-shims/Array.prototype.findLast/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/Array.prototype.findLast
[actions-url]: https://github.com/es-shims/Array.prototype.findLast
@@ -0,0 +1,81 @@
{
"name": "@typescript-eslint/type-utils",
"version": "8.46.4",
"description": "Type utilities for working with TypeScript + ESLint together",
"files": [
"dist",
"!*.tsbuildinfo",
"package.json",
"README.md",
"LICENSE"
],
"type": "commonjs",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./package.json": "./package.json"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"repository": {
"type": "git",
"url": "https://github.com/typescript-eslint/typescript-eslint.git",
"directory": "packages/type-utils"
},
"bugs": {
"url": "https://github.com/typescript-eslint/typescript-eslint/issues"
},
"homepage": "https://typescript-eslint.io",
"license": "MIT",
"keywords": [
"eslint",
"typescript",
"estree"
],
"scripts": {
"build": "yarn run -BT nx build",
"clean": "rimraf dist/ coverage/",
"format": "yarn run -T format",
"lint": "yarn run -BT nx lint",
"test": "yarn run -BT nx test",
"typecheck": "yarn run -BT nx typecheck"
},
"dependencies": {
"@typescript-eslint/types": "8.46.4",
"@typescript-eslint/typescript-estree": "8.46.4",
"@typescript-eslint/utils": "8.46.4",
"debug": "^4.3.4",
"ts-api-utils": "^2.1.0"
},
"peerDependencies": {
"eslint": "^8.57.0 || ^9.0.0",
"typescript": ">=4.8.4 <6.0.0"
},
"devDependencies": {
"@typescript-eslint/parser": "8.46.4",
"@vitest/coverage-v8": "^3.1.3",
"ajv": "^6.12.6",
"eslint": "*",
"rimraf": "*",
"typescript": "*",
"vitest": "^3.1.3"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"nx": {
"name": "type-utils",
"includedScripts": [
"clean"
],
"targets": {
"lint": {
"command": "eslint"
}
}
}
}
@@ -0,0 +1,14 @@
'use strict';
var $TypeError = require('es-errors/type');
var max = require('math-intrinsics/max');
var min = require('math-intrinsics/min');
// https://262.ecma-international.org/12.0/#clamping
module.exports = function clamp(x, lower, upper) {
if (typeof x !== 'number' || typeof lower !== 'number' || typeof upper !== 'number' || !(lower <= upper)) {
throw new $TypeError('Assertion failed: all three arguments must be MVs, and `lower` must be `<= upper`');
}
return min(max(lower, x), upper);
};
@@ -0,0 +1,18 @@
import { CertificationRequestInfo } from "./certification_request_info";
import { AlgorithmIdentifier } from "@peculiar/asn1-x509";
/**
* ```asn1
* CertificationRequest ::= SEQUENCE {
* certificationRequestInfo CertificationRequestInfo,
* signatureAlgorithm AlgorithmIdentifier{{ SignatureAlgorithms }},
* signature BIT STRING
* }
* ```
*/
export declare class CertificationRequest {
certificationRequestInfo: CertificationRequestInfo;
certificationRequestInfoRaw?: ArrayBuffer;
signatureAlgorithm: AlgorithmIdentifier;
signature: ArrayBuffer;
constructor(params?: Partial<CertificationRequest>);
}
@@ -0,0 +1,187 @@
/// <reference types="node" />
import * as fs from "fs";
import stream = require("stream");
/**
* Create a new SendStream for the given path to send to a res.
* The req is the Node.js HTTP request and the path is a urlencoded path to send (urlencoded, not the actual file-system path).
*/
declare function send(req: stream.Readable, path: string, options?: send.SendOptions): send.SendStream;
declare namespace send {
interface SendOptions {
/**
* Enable or disable accepting ranged requests, defaults to true.
* Disabling this will not send Accept-Ranges and ignore the contents of the Range request header.
*/
acceptRanges?: boolean | undefined;
/**
* Enable or disable setting Cache-Control response header, defaults to true.
* Disabling this will ignore the maxAge option.
*/
cacheControl?: boolean | undefined;
/**
* Set how "dotfiles" are treated when encountered.
* A dotfile is a file or directory that begins with a dot (".").
* Note this check is done on the path itself without checking if the path actually exists on the disk.
* If root is specified, only the dotfiles above the root are checked (i.e. the root itself can be within a dotfile when when set to "deny").
* 'allow' No special treatment for dotfiles.
* 'deny' Send a 403 for any request for a dotfile.
* 'ignore' Pretend like the dotfile does not exist and 404.
* The default value is similar to 'ignore', with the exception that this default will not ignore the files within a directory that begins with a dot, for backward-compatibility.
*/
dotfiles?: "allow" | "deny" | "ignore" | undefined;
/**
* Byte offset at which the stream ends, defaults to the length of the file minus 1.
* The end is inclusive in the stream, meaning end: 3 will include the 4th byte in the stream.
*/
end?: number | undefined;
/**
* Enable or disable etag generation, defaults to true.
*/
etag?: boolean | undefined;
/**
* If a given file doesn't exist, try appending one of the given extensions, in the given order.
* By default, this is disabled (set to false).
* An example value that will serve extension-less HTML files: ['html', 'htm'].
* This is skipped if the requested file already has an extension.
*/
extensions?: string[] | string | boolean | undefined;
/**
* Enable or disable the immutable directive in the Cache-Control response header, defaults to false.
* If set to true, the maxAge option should also be specified to enable caching.
* The immutable directive will prevent supported clients from making conditional requests during the life of the maxAge option to check if the file has changed.
* @default false
*/
immutable?: boolean | undefined;
/**
* By default send supports "index.html" files, to disable this set false or to supply a new index pass a string or an array in preferred order.
*/
index?: string[] | string | boolean | undefined;
/**
* Enable or disable Last-Modified header, defaults to true.
* Uses the file system's last modified value.
*/
lastModified?: boolean | undefined;
/**
* Provide a max-age in milliseconds for http caching, defaults to 0.
* This can also be a string accepted by the ms module.
*/
maxAge?: string | number | undefined;
/**
* Serve files relative to path.
*/
root?: string | undefined;
/**
* Byte offset at which the stream starts, defaults to 0.
* The start is inclusive, meaning start: 2 will include the 3rd byte in the stream.
*/
start?: number | undefined;
}
interface SendStream extends stream.Stream {
/**
* Emit error with `status`.
*/
error(status: number, error?: Error): void;
/**
* Check if the pathname ends with "/".
*/
hasTrailingSlash(): boolean;
/**
* Check if this is a conditional GET request.
*/
isConditionalGET(): boolean;
/**
* Strip content-* header fields.
*/
removeContentHeaderFields(): void;
/**
* Respond with 304 not modified.
*/
notModified(): void;
/**
* Raise error that headers already sent.
*/
headersAlreadySent(): void;
/**
* Check if the request is cacheable, aka responded with 2xx or 304 (see RFC 2616 section 14.2{5,6}).
*/
isCachable(): boolean;
/**
* Handle stat() error.
*/
onStatError(error: Error): void;
/**
* Check if the cache is fresh.
*/
isFresh(): boolean;
/**
* Check if the range is fresh.
*/
isRangeFresh(): boolean;
/**
* Redirect to path.
*/
redirect(path: string): void;
/**
* Pipe to `res`.
*/
pipe<T extends NodeJS.WritableStream>(res: T): T;
/**
* Transfer `path`.
*/
send(path: string, stat?: fs.Stats): void;
/**
* Transfer file for `path`.
*/
sendFile(path: string): void;
/**
* Transfer index for `path`.
*/
sendIndex(path: string): void;
/**
* Transfer index for `path`.
*/
stream(path: string, options?: {}): void;
/**
* Set content-type based on `path` if it hasn't been explicitly set.
*/
type(path: string): void;
/**
* Set response header fields, most fields may be pre-defined.
*/
setHeader(path: string, stat: fs.Stats): void;
}
}
export = send;
@@ -0,0 +1,10 @@
'use strict'
module.exports = /** @satisfies {import('eslint').Linter.Config} */({
name: 'neostandard/semi',
rules: {
'@stylistic/semi': ['error', 'always'],
'@stylistic/no-extra-semi': 'error',
},
})
@@ -0,0 +1,749 @@
var fs = require("fs");
var Transform = require("stream").Transform;
var PassThrough = require("stream").PassThrough;
var zlib = require("zlib");
var util = require("util");
var EventEmitter = require("events").EventEmitter;
var crc32 = require("buffer-crc32");
exports.ZipFile = ZipFile;
exports.dateToDosDateTime = dateToDosDateTime;
util.inherits(ZipFile, EventEmitter);
function ZipFile() {
this.outputStream = new PassThrough();
this.entries = [];
this.outputStreamCursor = 0;
this.ended = false; // .end() sets this
this.allDone = false; // set when we've written the last bytes
this.forceZip64Eocd = false; // configurable in .end()
}
ZipFile.prototype.addFile = function(realPath, metadataPath, options) {
var self = this;
metadataPath = validateMetadataPath(metadataPath, false);
if (options == null) options = {};
var entry = new Entry(metadataPath, false, options);
self.entries.push(entry);
fs.stat(realPath, function(err, stats) {
if (err) return self.emit("error", err);
if (!stats.isFile()) return self.emit("error", new Error("not a file: " + realPath));
entry.uncompressedSize = stats.size;
if (options.mtime == null) entry.setLastModDate(stats.mtime);
if (options.mode == null) entry.setFileAttributesMode(stats.mode);
entry.setFileDataPumpFunction(function() {
var readStream = fs.createReadStream(realPath);
entry.state = Entry.FILE_DATA_IN_PROGRESS;
readStream.on("error", function(err) {
self.emit("error", err);
});
pumpFileDataReadStream(self, entry, readStream);
});
pumpEntries(self);
});
};
ZipFile.prototype.addReadStream = function(readStream, metadataPath, options) {
var self = this;
metadataPath = validateMetadataPath(metadataPath, false);
if (options == null) options = {};
var entry = new Entry(metadataPath, false, options);
self.entries.push(entry);
entry.setFileDataPumpFunction(function() {
entry.state = Entry.FILE_DATA_IN_PROGRESS;
pumpFileDataReadStream(self, entry, readStream);
});
pumpEntries(self);
};
ZipFile.prototype.addBuffer = function(buffer, metadataPath, options) {
var self = this;
metadataPath = validateMetadataPath(metadataPath, false);
if (buffer.length > 0x3fffffff) throw new Error("buffer too large: " + buffer.length + " > " + 0x3fffffff);
if (options == null) options = {};
if (options.size != null) throw new Error("options.size not allowed");
var entry = new Entry(metadataPath, false, options);
entry.uncompressedSize = buffer.length;
entry.crc32 = crc32.unsigned(buffer);
entry.crcAndFileSizeKnown = true;
self.entries.push(entry);
if (!entry.compress) {
setCompressedBuffer(buffer);
} else {
zlib.deflateRaw(buffer, function(err, compressedBuffer) {
setCompressedBuffer(compressedBuffer);
});
}
function setCompressedBuffer(compressedBuffer) {
entry.compressedSize = compressedBuffer.length;
entry.setFileDataPumpFunction(function() {
writeToOutputStream(self, compressedBuffer);
writeToOutputStream(self, entry.getDataDescriptor());
entry.state = Entry.FILE_DATA_DONE;
// don't call pumpEntries() recursively.
// (also, don't call process.nextTick recursively.)
setImmediate(function() {
pumpEntries(self);
});
});
pumpEntries(self);
}
};
ZipFile.prototype.addEmptyDirectory = function(metadataPath, options) {
var self = this;
metadataPath = validateMetadataPath(metadataPath, true);
if (options == null) options = {};
if (options.size != null) throw new Error("options.size not allowed");
if (options.compress != null) throw new Error("options.compress not allowed");
var entry = new Entry(metadataPath, true, options);
self.entries.push(entry);
entry.setFileDataPumpFunction(function() {
writeToOutputStream(self, entry.getDataDescriptor());
entry.state = Entry.FILE_DATA_DONE;
pumpEntries(self);
});
pumpEntries(self);
};
var eocdrSignatureBuffer = bufferFrom([0x50, 0x4b, 0x05, 0x06]);
ZipFile.prototype.end = function(options, finalSizeCallback) {
if (typeof options === "function") {
finalSizeCallback = options;
options = null;
}
if (options == null) options = {};
if (this.ended) return;
this.ended = true;
this.finalSizeCallback = finalSizeCallback;
this.forceZip64Eocd = !!options.forceZip64Format;
if (options.comment) {
if (typeof options.comment === "string") {
this.comment = encodeCp437(options.comment);
} else {
// It should be a Buffer
this.comment = options.comment;
}
if (this.comment.length > 0xffff) throw new Error("comment is too large");
// gotta check for this, because the zipfile format is actually ambiguous.
if (bufferIncludes(this.comment, eocdrSignatureBuffer)) throw new Error("comment contains end of central directory record signature");
} else {
// no comment.
this.comment = EMPTY_BUFFER;
}
pumpEntries(this);
};
function writeToOutputStream(self, buffer) {
self.outputStream.write(buffer);
self.outputStreamCursor += buffer.length;
}
function pumpFileDataReadStream(self, entry, readStream) {
var crc32Watcher = new Crc32Watcher();
var uncompressedSizeCounter = new ByteCounter();
var compressor = entry.compress ? new zlib.DeflateRaw() : new PassThrough();
var compressedSizeCounter = new ByteCounter();
readStream.pipe(crc32Watcher)
.pipe(uncompressedSizeCounter)
.pipe(compressor)
.pipe(compressedSizeCounter)
.pipe(self.outputStream, {end: false});
compressedSizeCounter.on("end", function() {
entry.crc32 = crc32Watcher.crc32;
if (entry.uncompressedSize == null) {
entry.uncompressedSize = uncompressedSizeCounter.byteCount;
} else {
if (entry.uncompressedSize !== uncompressedSizeCounter.byteCount) return self.emit("error", new Error("file data stream has unexpected number of bytes"));
}
entry.compressedSize = compressedSizeCounter.byteCount;
self.outputStreamCursor += entry.compressedSize;
writeToOutputStream(self, entry.getDataDescriptor());
entry.state = Entry.FILE_DATA_DONE;
pumpEntries(self);
});
}
function pumpEntries(self) {
if (self.allDone) return;
// first check if finalSize is finally known
if (self.ended && self.finalSizeCallback != null) {
var finalSize = calculateFinalSize(self);
if (finalSize != null) {
// we have an answer
self.finalSizeCallback(finalSize);
self.finalSizeCallback = null;
}
}
// pump entries
var entry = getFirstNotDoneEntry();
function getFirstNotDoneEntry() {
for (var i = 0; i < self.entries.length; i++) {
var entry = self.entries[i];
if (entry.state < Entry.FILE_DATA_DONE) return entry;
}
return null;
}
if (entry != null) {
// this entry is not done yet
if (entry.state < Entry.READY_TO_PUMP_FILE_DATA) return; // input file not open yet
if (entry.state === Entry.FILE_DATA_IN_PROGRESS) return; // we'll get there
// start with local file header
entry.relativeOffsetOfLocalHeader = self.outputStreamCursor;
var localFileHeader = entry.getLocalFileHeader();
writeToOutputStream(self, localFileHeader);
entry.doFileDataPump();
} else {
// all cought up on writing entries
if (self.ended) {
// head for the exit
self.offsetOfStartOfCentralDirectory = self.outputStreamCursor;
self.entries.forEach(function(entry) {
var centralDirectoryRecord = entry.getCentralDirectoryRecord();
writeToOutputStream(self, centralDirectoryRecord);
});
writeToOutputStream(self, getEndOfCentralDirectoryRecord(self));
self.outputStream.end();
self.allDone = true;
}
}
}
function calculateFinalSize(self) {
var pretendOutputCursor = 0;
var centralDirectorySize = 0;
for (var i = 0; i < self.entries.length; i++) {
var entry = self.entries[i];
// compression is too hard to predict
if (entry.compress) return -1;
if (entry.state >= Entry.READY_TO_PUMP_FILE_DATA) {
// if addReadStream was called without providing the size, we can't predict the final size
if (entry.uncompressedSize == null) return -1;
} else {
// if we're still waiting for fs.stat, we might learn the size someday
if (entry.uncompressedSize == null) return null;
}
// we know this for sure, and this is important to know if we need ZIP64 format.
entry.relativeOffsetOfLocalHeader = pretendOutputCursor;
var useZip64Format = entry.useZip64Format();
pretendOutputCursor += LOCAL_FILE_HEADER_FIXED_SIZE + entry.utf8FileName.length;
pretendOutputCursor += entry.uncompressedSize;
if (!entry.crcAndFileSizeKnown) {
// use a data descriptor
if (useZip64Format) {
pretendOutputCursor += ZIP64_DATA_DESCRIPTOR_SIZE;
} else {
pretendOutputCursor += DATA_DESCRIPTOR_SIZE;
}
}
centralDirectorySize += CENTRAL_DIRECTORY_RECORD_FIXED_SIZE + entry.utf8FileName.length + entry.fileComment.length;
if (useZip64Format) {
centralDirectorySize += ZIP64_EXTENDED_INFORMATION_EXTRA_FIELD_SIZE;
}
}
var endOfCentralDirectorySize = 0;
if (self.forceZip64Eocd ||
self.entries.length >= 0xffff ||
centralDirectorySize >= 0xffff ||
pretendOutputCursor >= 0xffffffff) {
// use zip64 end of central directory stuff
endOfCentralDirectorySize += ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE + ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIZE;
}
endOfCentralDirectorySize += END_OF_CENTRAL_DIRECTORY_RECORD_SIZE + self.comment.length;
return pretendOutputCursor + centralDirectorySize + endOfCentralDirectorySize;
}
var ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE = 56;
var ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIZE = 20;
var END_OF_CENTRAL_DIRECTORY_RECORD_SIZE = 22;
function getEndOfCentralDirectoryRecord(self, actuallyJustTellMeHowLongItWouldBe) {
var needZip64Format = false;
var normalEntriesLength = self.entries.length;
if (self.forceZip64Eocd || self.entries.length >= 0xffff) {
normalEntriesLength = 0xffff;
needZip64Format = true;
}
var sizeOfCentralDirectory = self.outputStreamCursor - self.offsetOfStartOfCentralDirectory;
var normalSizeOfCentralDirectory = sizeOfCentralDirectory;
if (self.forceZip64Eocd || sizeOfCentralDirectory >= 0xffffffff) {
normalSizeOfCentralDirectory = 0xffffffff;
needZip64Format = true;
}
var normalOffsetOfStartOfCentralDirectory = self.offsetOfStartOfCentralDirectory;
if (self.forceZip64Eocd || self.offsetOfStartOfCentralDirectory >= 0xffffffff) {
normalOffsetOfStartOfCentralDirectory = 0xffffffff;
needZip64Format = true;
}
if (actuallyJustTellMeHowLongItWouldBe) {
if (needZip64Format) {
return (
ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE +
ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIZE +
END_OF_CENTRAL_DIRECTORY_RECORD_SIZE
);
} else {
return END_OF_CENTRAL_DIRECTORY_RECORD_SIZE;
}
}
var eocdrBuffer = bufferAlloc(END_OF_CENTRAL_DIRECTORY_RECORD_SIZE + self.comment.length);
// end of central dir signature 4 bytes (0x06054b50)
eocdrBuffer.writeUInt32LE(0x06054b50, 0);
// number of this disk 2 bytes
eocdrBuffer.writeUInt16LE(0, 4);
// number of the disk with the start of the central directory 2 bytes
eocdrBuffer.writeUInt16LE(0, 6);
// total number of entries in the central directory on this disk 2 bytes
eocdrBuffer.writeUInt16LE(normalEntriesLength, 8);
// total number of entries in the central directory 2 bytes
eocdrBuffer.writeUInt16LE(normalEntriesLength, 10);
// size of the central directory 4 bytes
eocdrBuffer.writeUInt32LE(normalSizeOfCentralDirectory, 12);
// offset of start of central directory with respect to the starting disk number 4 bytes
eocdrBuffer.writeUInt32LE(normalOffsetOfStartOfCentralDirectory, 16);
// .ZIP file comment length 2 bytes
eocdrBuffer.writeUInt16LE(self.comment.length, 20);
// .ZIP file comment (variable size)
self.comment.copy(eocdrBuffer, 22);
if (!needZip64Format) return eocdrBuffer;
// ZIP64 format
// ZIP64 End of Central Directory Record
var zip64EocdrBuffer = bufferAlloc(ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE);
// zip64 end of central dir signature 4 bytes (0x06064b50)
zip64EocdrBuffer.writeUInt32LE(0x06064b50, 0);
// size of zip64 end of central directory record 8 bytes
writeUInt64LE(zip64EocdrBuffer, ZIP64_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE - 12, 4);
// version made by 2 bytes
zip64EocdrBuffer.writeUInt16LE(VERSION_MADE_BY, 12);
// version needed to extract 2 bytes
zip64EocdrBuffer.writeUInt16LE(VERSION_NEEDED_TO_EXTRACT_ZIP64, 14);
// number of this disk 4 bytes
zip64EocdrBuffer.writeUInt32LE(0, 16);
// number of the disk with the start of the central directory 4 bytes
zip64EocdrBuffer.writeUInt32LE(0, 20);
// total number of entries in the central directory on this disk 8 bytes
writeUInt64LE(zip64EocdrBuffer, self.entries.length, 24);
// total number of entries in the central directory 8 bytes
writeUInt64LE(zip64EocdrBuffer, self.entries.length, 32);
// size of the central directory 8 bytes
writeUInt64LE(zip64EocdrBuffer, sizeOfCentralDirectory, 40);
// offset of start of central directory with respect to the starting disk number 8 bytes
writeUInt64LE(zip64EocdrBuffer, self.offsetOfStartOfCentralDirectory, 48);
// zip64 extensible data sector (variable size)
// nothing in the zip64 extensible data sector
// ZIP64 End of Central Directory Locator
var zip64EocdlBuffer = bufferAlloc(ZIP64_END_OF_CENTRAL_DIRECTORY_LOCATOR_SIZE);
// zip64 end of central dir locator signature 4 bytes (0x07064b50)
zip64EocdlBuffer.writeUInt32LE(0x07064b50, 0);
// number of the disk with the start of the zip64 end of central directory 4 bytes
zip64EocdlBuffer.writeUInt32LE(0, 4);
// relative offset of the zip64 end of central directory record 8 bytes
writeUInt64LE(zip64EocdlBuffer, self.outputStreamCursor, 8);
// total number of disks 4 bytes
zip64EocdlBuffer.writeUInt32LE(1, 16);
return Buffer.concat([
zip64EocdrBuffer,
zip64EocdlBuffer,
eocdrBuffer,
]);
}
function validateMetadataPath(metadataPath, isDirectory) {
if (metadataPath === "") throw new Error("empty metadataPath");
metadataPath = metadataPath.replace(/\\/g, "/");
if (/^[a-zA-Z]:/.test(metadataPath) || /^\//.test(metadataPath)) throw new Error("absolute path: " + metadataPath);
if (metadataPath.split("/").indexOf("..") !== -1) throw new Error("invalid relative path: " + metadataPath);
var looksLikeDirectory = /\/$/.test(metadataPath);
if (isDirectory) {
// append a trailing '/' if necessary.
if (!looksLikeDirectory) metadataPath += "/";
} else {
if (looksLikeDirectory) throw new Error("file path cannot end with '/': " + metadataPath);
}
return metadataPath;
}
var EMPTY_BUFFER = bufferAlloc(0);
// this class is not part of the public API
function Entry(metadataPath, isDirectory, options) {
this.utf8FileName = bufferFrom(metadataPath);
if (this.utf8FileName.length > 0xffff) throw new Error("utf8 file name too long. " + utf8FileName.length + " > " + 0xffff);
this.isDirectory = isDirectory;
this.state = Entry.WAITING_FOR_METADATA;
this.setLastModDate(options.mtime != null ? options.mtime : new Date());
if (options.mode != null) {
this.setFileAttributesMode(options.mode);
} else {
this.setFileAttributesMode(isDirectory ? 0o40775 : 0o100664);
}
if (isDirectory) {
this.crcAndFileSizeKnown = true;
this.crc32 = 0;
this.uncompressedSize = 0;
this.compressedSize = 0;
} else {
// unknown so far
this.crcAndFileSizeKnown = false;
this.crc32 = null;
this.uncompressedSize = null;
this.compressedSize = null;
if (options.size != null) this.uncompressedSize = options.size;
}
if (isDirectory) {
this.compress = false;
} else {
this.compress = true; // default
if (options.compress != null) this.compress = !!options.compress;
}
this.forceZip64Format = !!options.forceZip64Format;
if (options.fileComment) {
if (typeof options.fileComment === "string") {
this.fileComment = bufferFrom(options.fileComment, "utf-8");
} else {
// It should be a Buffer
this.fileComment = options.fileComment;
}
if (this.fileComment.length > 0xffff) throw new Error("fileComment is too large");
} else {
// no comment.
this.fileComment = EMPTY_BUFFER;
}
}
Entry.WAITING_FOR_METADATA = 0;
Entry.READY_TO_PUMP_FILE_DATA = 1;
Entry.FILE_DATA_IN_PROGRESS = 2;
Entry.FILE_DATA_DONE = 3;
Entry.prototype.setLastModDate = function(date) {
var dosDateTime = dateToDosDateTime(date);
this.lastModFileTime = dosDateTime.time;
this.lastModFileDate = dosDateTime.date;
};
Entry.prototype.setFileAttributesMode = function(mode) {
if ((mode & 0xffff) !== mode) throw new Error("invalid mode. expected: 0 <= " + mode + " <= " + 0xffff);
// http://unix.stackexchange.com/questions/14705/the-zip-formats-external-file-attribute/14727#14727
this.externalFileAttributes = (mode << 16) >>> 0;
};
// doFileDataPump() should not call pumpEntries() directly. see issue #9.
Entry.prototype.setFileDataPumpFunction = function(doFileDataPump) {
this.doFileDataPump = doFileDataPump;
this.state = Entry.READY_TO_PUMP_FILE_DATA;
};
Entry.prototype.useZip64Format = function() {
return (
(this.forceZip64Format) ||
(this.uncompressedSize != null && this.uncompressedSize > 0xfffffffe) ||
(this.compressedSize != null && this.compressedSize > 0xfffffffe) ||
(this.relativeOffsetOfLocalHeader != null && this.relativeOffsetOfLocalHeader > 0xfffffffe)
);
}
var LOCAL_FILE_HEADER_FIXED_SIZE = 30;
var VERSION_NEEDED_TO_EXTRACT_UTF8 = 20;
var VERSION_NEEDED_TO_EXTRACT_ZIP64 = 45;
// 3 = unix. 63 = spec version 6.3
var VERSION_MADE_BY = (3 << 8) | 63;
var FILE_NAME_IS_UTF8 = 1 << 11;
var UNKNOWN_CRC32_AND_FILE_SIZES = 1 << 3;
Entry.prototype.getLocalFileHeader = function() {
var crc32 = 0;
var compressedSize = 0;
var uncompressedSize = 0;
if (this.crcAndFileSizeKnown) {
crc32 = this.crc32;
compressedSize = this.compressedSize;
uncompressedSize = this.uncompressedSize;
}
var fixedSizeStuff = bufferAlloc(LOCAL_FILE_HEADER_FIXED_SIZE);
var generalPurposeBitFlag = FILE_NAME_IS_UTF8;
if (!this.crcAndFileSizeKnown) generalPurposeBitFlag |= UNKNOWN_CRC32_AND_FILE_SIZES;
// local file header signature 4 bytes (0x04034b50)
fixedSizeStuff.writeUInt32LE(0x04034b50, 0);
// version needed to extract 2 bytes
fixedSizeStuff.writeUInt16LE(VERSION_NEEDED_TO_EXTRACT_UTF8, 4);
// general purpose bit flag 2 bytes
fixedSizeStuff.writeUInt16LE(generalPurposeBitFlag, 6);
// compression method 2 bytes
fixedSizeStuff.writeUInt16LE(this.getCompressionMethod(), 8);
// last mod file time 2 bytes
fixedSizeStuff.writeUInt16LE(this.lastModFileTime, 10);
// last mod file date 2 bytes
fixedSizeStuff.writeUInt16LE(this.lastModFileDate, 12);
// crc-32 4 bytes
fixedSizeStuff.writeUInt32LE(crc32, 14);
// compressed size 4 bytes
fixedSizeStuff.writeUInt32LE(compressedSize, 18);
// uncompressed size 4 bytes
fixedSizeStuff.writeUInt32LE(uncompressedSize, 22);
// file name length 2 bytes
fixedSizeStuff.writeUInt16LE(this.utf8FileName.length, 26);
// extra field length 2 bytes
fixedSizeStuff.writeUInt16LE(0, 28);
return Buffer.concat([
fixedSizeStuff,
// file name (variable size)
this.utf8FileName,
// extra field (variable size)
// no extra fields
]);
};
var DATA_DESCRIPTOR_SIZE = 16;
var ZIP64_DATA_DESCRIPTOR_SIZE = 24;
Entry.prototype.getDataDescriptor = function() {
if (this.crcAndFileSizeKnown) {
// the Mac Archive Utility requires this not be present unless we set general purpose bit 3
return EMPTY_BUFFER;
}
if (!this.useZip64Format()) {
var buffer = bufferAlloc(DATA_DESCRIPTOR_SIZE);
// optional signature (required according to Archive Utility)
buffer.writeUInt32LE(0x08074b50, 0);
// crc-32 4 bytes
buffer.writeUInt32LE(this.crc32, 4);
// compressed size 4 bytes
buffer.writeUInt32LE(this.compressedSize, 8);
// uncompressed size 4 bytes
buffer.writeUInt32LE(this.uncompressedSize, 12);
return buffer;
} else {
// ZIP64 format
var buffer = bufferAlloc(ZIP64_DATA_DESCRIPTOR_SIZE);
// optional signature (unknown if anyone cares about this)
buffer.writeUInt32LE(0x08074b50, 0);
// crc-32 4 bytes
buffer.writeUInt32LE(this.crc32, 4);
// compressed size 8 bytes
writeUInt64LE(buffer, this.compressedSize, 8);
// uncompressed size 8 bytes
writeUInt64LE(buffer, this.uncompressedSize, 16);
return buffer;
}
};
var CENTRAL_DIRECTORY_RECORD_FIXED_SIZE = 46;
var ZIP64_EXTENDED_INFORMATION_EXTRA_FIELD_SIZE = 28;
Entry.prototype.getCentralDirectoryRecord = function() {
var fixedSizeStuff = bufferAlloc(CENTRAL_DIRECTORY_RECORD_FIXED_SIZE);
var generalPurposeBitFlag = FILE_NAME_IS_UTF8;
if (!this.crcAndFileSizeKnown) generalPurposeBitFlag |= UNKNOWN_CRC32_AND_FILE_SIZES;
var normalCompressedSize = this.compressedSize;
var normalUncompressedSize = this.uncompressedSize;
var normalRelativeOffsetOfLocalHeader = this.relativeOffsetOfLocalHeader;
var versionNeededToExtract;
var zeiefBuffer;
if (this.useZip64Format()) {
normalCompressedSize = 0xffffffff;
normalUncompressedSize = 0xffffffff;
normalRelativeOffsetOfLocalHeader = 0xffffffff;
versionNeededToExtract = VERSION_NEEDED_TO_EXTRACT_ZIP64;
// ZIP64 extended information extra field
zeiefBuffer = bufferAlloc(ZIP64_EXTENDED_INFORMATION_EXTRA_FIELD_SIZE);
// 0x0001 2 bytes Tag for this "extra" block type
zeiefBuffer.writeUInt16LE(0x0001, 0);
// Size 2 bytes Size of this "extra" block
zeiefBuffer.writeUInt16LE(ZIP64_EXTENDED_INFORMATION_EXTRA_FIELD_SIZE - 4, 2);
// Original Size 8 bytes Original uncompressed file size
writeUInt64LE(zeiefBuffer, this.uncompressedSize, 4);
// Compressed Size 8 bytes Size of compressed data
writeUInt64LE(zeiefBuffer, this.compressedSize, 12);
// Relative Header Offset 8 bytes Offset of local header record
writeUInt64LE(zeiefBuffer, this.relativeOffsetOfLocalHeader, 20);
// Disk Start Number 4 bytes Number of the disk on which this file starts
// (omit)
} else {
versionNeededToExtract = VERSION_NEEDED_TO_EXTRACT_UTF8;
zeiefBuffer = EMPTY_BUFFER;
}
// central file header signature 4 bytes (0x02014b50)
fixedSizeStuff.writeUInt32LE(0x02014b50, 0);
// version made by 2 bytes
fixedSizeStuff.writeUInt16LE(VERSION_MADE_BY, 4);
// version needed to extract 2 bytes
fixedSizeStuff.writeUInt16LE(versionNeededToExtract, 6);
// general purpose bit flag 2 bytes
fixedSizeStuff.writeUInt16LE(generalPurposeBitFlag, 8);
// compression method 2 bytes
fixedSizeStuff.writeUInt16LE(this.getCompressionMethod(), 10);
// last mod file time 2 bytes
fixedSizeStuff.writeUInt16LE(this.lastModFileTime, 12);
// last mod file date 2 bytes
fixedSizeStuff.writeUInt16LE(this.lastModFileDate, 14);
// crc-32 4 bytes
fixedSizeStuff.writeUInt32LE(this.crc32, 16);
// compressed size 4 bytes
fixedSizeStuff.writeUInt32LE(normalCompressedSize, 20);
// uncompressed size 4 bytes
fixedSizeStuff.writeUInt32LE(normalUncompressedSize, 24);
// file name length 2 bytes
fixedSizeStuff.writeUInt16LE(this.utf8FileName.length, 28);
// extra field length 2 bytes
fixedSizeStuff.writeUInt16LE(zeiefBuffer.length, 30);
// file comment length 2 bytes
fixedSizeStuff.writeUInt16LE(this.fileComment.length, 32);
// disk number start 2 bytes
fixedSizeStuff.writeUInt16LE(0, 34);
// internal file attributes 2 bytes
fixedSizeStuff.writeUInt16LE(0, 36);
// external file attributes 4 bytes
fixedSizeStuff.writeUInt32LE(this.externalFileAttributes, 38);
// relative offset of local header 4 bytes
fixedSizeStuff.writeUInt32LE(normalRelativeOffsetOfLocalHeader, 42);
return Buffer.concat([
fixedSizeStuff,
// file name (variable size)
this.utf8FileName,
// extra field (variable size)
zeiefBuffer,
// file comment (variable size)
this.fileComment,
]);
};
Entry.prototype.getCompressionMethod = function() {
var NO_COMPRESSION = 0;
var DEFLATE_COMPRESSION = 8;
return this.compress ? DEFLATE_COMPRESSION : NO_COMPRESSION;
};
function dateToDosDateTime(jsDate) {
var date = 0;
date |= jsDate.getDate() & 0x1f; // 1-31
date |= ((jsDate.getMonth() + 1) & 0xf) << 5; // 0-11, 1-12
date |= ((jsDate.getFullYear() - 1980) & 0x7f) << 9; // 0-128, 1980-2108
var time = 0;
time |= Math.floor(jsDate.getSeconds() / 2); // 0-59, 0-29 (lose odd numbers)
time |= (jsDate.getMinutes() & 0x3f) << 5; // 0-59
time |= (jsDate.getHours() & 0x1f) << 11; // 0-23
return {date: date, time: time};
}
function writeUInt64LE(buffer, n, offset) {
// can't use bitshift here, because JavaScript only allows bitshifting on 32-bit integers.
var high = Math.floor(n / 0x100000000);
var low = n % 0x100000000;
buffer.writeUInt32LE(low, offset);
buffer.writeUInt32LE(high, offset + 4);
}
function defaultCallback(err) {
if (err) throw err;
}
util.inherits(ByteCounter, Transform);
function ByteCounter(options) {
Transform.call(this, options);
this.byteCount = 0;
}
ByteCounter.prototype._transform = function(chunk, encoding, cb) {
this.byteCount += chunk.length;
cb(null, chunk);
};
util.inherits(Crc32Watcher, Transform);
function Crc32Watcher(options) {
Transform.call(this, options);
this.crc32 = 0;
}
Crc32Watcher.prototype._transform = function(chunk, encoding, cb) {
this.crc32 = crc32.unsigned(chunk, this.crc32);
cb(null, chunk);
};
var cp437 = '\u0000☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ';
if (cp437.length !== 256) throw new Error("assertion failure");
var reverseCp437 = null;
function encodeCp437(string) {
if (/^[\x20-\x7e]*$/.test(string)) {
// CP437, ASCII, and UTF-8 overlap in this range.
return bufferFrom(string, "utf-8");
}
// This is the slow path.
if (reverseCp437 == null) {
// cache this once
reverseCp437 = {};
for (var i = 0; i < cp437.length; i++) {
reverseCp437[cp437[i]] = i;
}
}
var result = bufferAlloc(string.length);
for (var i = 0; i < string.length; i++) {
var b = reverseCp437[string[i]];
if (b == null) throw new Error("character not encodable in CP437: " + JSON.stringify(string[i]));
result[i] = b;
}
return result;
}
function bufferAlloc(size) {
bufferAlloc = modern;
try {
return bufferAlloc(size);
} catch (e) {
bufferAlloc = legacy;
return bufferAlloc(size);
}
function modern(size) {
return Buffer.allocUnsafe(size);
}
function legacy(size) {
return new Buffer(size);
}
}
function bufferFrom(something, encoding) {
bufferFrom = modern;
try {
return bufferFrom(something, encoding);
} catch (e) {
bufferFrom = legacy;
return bufferFrom(something, encoding);
}
function modern(something, encoding) {
return Buffer.from(something, encoding);
}
function legacy(something, encoding) {
return new Buffer(something, encoding);
}
}
function bufferIncludes(buffer, content) {
bufferIncludes = modern;
try {
return bufferIncludes(buffer, content);
} catch (e) {
bufferIncludes = legacy;
return bufferIncludes(buffer, content);
}
function modern(buffer, content) {
return buffer.includes(content);
}
function legacy(buffer, content) {
for (var i = 0; i <= buffer.length - content.length; i++) {
for (var j = 0;; j++) {
if (j === content.length) return true;
if (buffer[i + j] !== content[j]) break;
}
}
return false;
}
}
@@ -0,0 +1,10 @@
/*!
* Quill Editor v2.0.3
* https://quilljs.com
* Copyright (c) 2017-2024, Slab
* Copyright (c) 2014, Jason Chen
* Copyright (c) 2013, salesforce.com
*/
.ql-container{box-sizing:border-box;font-family:Helvetica,Arial,sans-serif;font-size:13px;height:100%;margin:0;position:relative}.ql-container.ql-disabled .ql-tooltip{visibility:hidden}.ql-container:not(.ql-disabled) li[data-list=checked] > .ql-ui,.ql-container:not(.ql-disabled) li[data-list=unchecked] > .ql-ui{cursor:pointer}.ql-clipboard{left:-100000px;height:1px;overflow-y:hidden;position:absolute;top:50%}.ql-clipboard p{margin:0;padding:0}.ql-editor{box-sizing:border-box;counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;line-height:1.42;height:100%;outline:none;overflow-y:auto;padding:12px 15px;tab-size:4;-moz-tab-size:4;text-align:left;white-space:pre-wrap;word-wrap:break-word}.ql-editor > *{cursor:text}.ql-editor p,.ql-editor ol,.ql-editor pre,.ql-editor blockquote,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{margin:0;padding:0}@supports (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-set:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor table{border-collapse:collapse}.ql-editor td{border:1px solid #000;padding:2px 5px}.ql-editor ol{padding-left:1.5em}.ql-editor li{list-style-type:none;padding-left:1.5em;position:relative}.ql-editor li > .ql-ui:before{display:inline-block;margin-left:-1.5em;margin-right:.3em;text-align:right;white-space:nowrap;width:1.2em}.ql-editor li[data-list=checked] > .ql-ui,.ql-editor li[data-list=unchecked] > .ql-ui{color:#777}.ql-editor li[data-list=bullet] > .ql-ui:before{content:'\2022'}.ql-editor li[data-list=checked] > .ql-ui:before{content:'\2611'}.ql-editor li[data-list=unchecked] > .ql-ui:before{content:'\2610'}@supports (counter-set:none){.ql-editor li[data-list]{counter-set:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list]{counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered]{counter-increment:list-0}.ql-editor li[data-list=ordered] > .ql-ui:before{content:counter(list-0, decimal) '. '}.ql-editor li[data-list=ordered].ql-indent-1{counter-increment:list-1}.ql-editor li[data-list=ordered].ql-indent-1 > .ql-ui:before{content:counter(list-1, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-set:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-reset:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-2{counter-increment:list-2}.ql-editor li[data-list=ordered].ql-indent-2 > .ql-ui:before{content:counter(list-2, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-set:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-reset:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-3{counter-increment:list-3}.ql-editor li[data-list=ordered].ql-indent-3 > .ql-ui:before{content:counter(list-3, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-set:list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-reset:list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-4{counter-increment:list-4}.ql-editor li[data-list=ordered].ql-indent-4 > .ql-ui:before{content:counter(list-4, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-set:list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-reset:list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-5{counter-increment:list-5}.ql-editor li[data-list=ordered].ql-indent-5 > .ql-ui:before{content:counter(list-5, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-set:list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-reset:list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-6{counter-increment:list-6}.ql-editor li[data-list=ordered].ql-indent-6 > .ql-ui:before{content:counter(list-6, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-set:list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-reset:list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-7{counter-increment:list-7}.ql-editor li[data-list=ordered].ql-indent-7 > .ql-ui:before{content:coLine truncated
/*# sourceMappingURL=quill.bubble.css.map*/
@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = getImplicitRoleForLi;
/**
* Returns the implicit role for an li tag.
*/
function getImplicitRoleForLi() {
return 'listitem';
}
module.exports = exports.default;
@@ -0,0 +1 @@
{"version":3,"sources":["../../src/index.ts","../../src/utils/react.ts","../../src/utils/react-is.ts","../../src/utils/warning.ts","../../src/connect/verifySubselectors.ts","../../src/connect/selectorFactory.ts","../../src/utils/bindActionCreators.ts","../../src/utils/isPlainObject.ts","../../src/utils/verifyPlainObject.ts","../../src/connect/wrapMapToProps.ts","../../src/connect/invalidArgFactory.ts","../../src/connect/mapDispatchToProps.ts","../../src/connect/mapStateToProps.ts","../../src/connect/mergeProps.ts","../../src/utils/batch.ts","../../src/utils/Subscription.ts","../../src/utils/useIsomorphicLayoutEffect.ts","../../src/utils/shallowEqual.ts","../../src/utils/hoistStatics.ts","../../src/components/Context.ts","../../src/components/connect.tsx","../../src/components/Provider.tsx","../../src/hooks/useReduxContext.ts","../../src/hooks/useStore.ts","../../src/hooks/useDispatch.ts","../../src/hooks/useSelector.ts","../../src/exports.ts"],"sourcesContent":["export * from './exports'\n","import * as React from 'react'\n\nexport { React }\n","import type { ElementType, MemoExoticComponent, ReactElement } from 'react'\nimport { React } from './react'\n\n// Directly ported from:\n// https://unpkg.com/browse/react-is@19.0.0/cjs/react-is.production.js\n// It's very possible this could change in the future, but given that\n// we only use these in `connect`, this is a low priority.\n\nexport const IS_REACT_19 = /* @__PURE__ */ React.version.startsWith('19')\n\nconst REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for(\n IS_REACT_19 ? 'react.transitional.element' : 'react.element',\n)\nconst REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for('react.portal')\nconst REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for('react.fragment')\nconst REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for('react.strict_mode')\nconst REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for('react.profiler')\nconst REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for('react.consumer')\nconst REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for('react.context')\nconst REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for('react.forward_ref')\nconst REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for('react.suspense')\nconst REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for(\n 'react.suspense_list',\n)\nconst REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for('react.memo')\nconst REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for('react.lazy')\nconst REACT_OFFSCREEN_TYPE = /* @__PURE__ */ Symbol.for('react.offscreen')\nconst REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for(\n 'react.client.reference',\n)\n\nexport const ForwardRef = REACT_FORWARD_REF_TYPE\nexport const Memo = REACT_MEMO_TYPE\n\nexport function isValidElementType(type: any): type is ElementType {\n return typeof type === 'string' ||\n typeof type === 'function' ||\n type === REACT_FRAGMENT_TYPE ||\n type === REACT_PROFILER_TYPE ||\n type === REACT_STRICT_MODE_TYPE ||\n type === REACT_SUSPENSE_TYPE ||\n type === REACT_SUSPENSE_LIST_TYPE ||\n type === REACT_OFFSCREEN_TYPE ||\n (typeof type === 'object' &&\n type !== null &&\n (type.$$typeof === REACT_LAZY_TYPE ||\n type.$$typeof === REACT_MEMO_TYPE ||\n type.$$typeof === REACT_CONTEXT_TYPE ||\n type.$$typeof === REACT_CONSUMER_TYPE ||\n type.$$typeof === REACT_FORWARD_REF_TYPE ||\n type.$$typeof === REACT_CLIENT_REFERENCE ||\n type.getModuleId !== undefined))\n ? !0\n : !1\n}\n\nfunction typeOf(object: any): symbol | undefined {\n if (typeof object === 'object' && object !== null) {\n const { $$typeof } = object\n\n switch ($$typeof) {\n case REACT_ELEMENT_TYPE:\n switch (((object = object.type), object)) {\n case REACT_FRAGMENT_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_SUSPENSE_TYPE:\n case REACT_SUSPENSE_LIST_TYPE:\n return object\n default:\n switch (((object = object && object.$$typeof), object)) {\n case REACT_CONTEXT_TYPE:\n case REACT_FORWARD_REF_TYPE:\n case REACT_LAZY_TYPE:\n case REACT_MEMO_TYPE:\n return object\n case REACT_CONSUMER_TYPE:\n return object\n default:\n return $$typeof\n }\n }\n case REACT_PORTAL_TYPE:\n return $$typeof\n }\n }\n}\n\nexport function isContextConsumer(object: any): object is ReactElement {\n return IS_REACT_19\n ? typeOf(object) === REACT_CONSUMER_TYPE\n : typeOf(object) === REACT_CONTEXT_TYPE\n}\n\nexport function isMemo(object: any): object is MemoExoticComponent<any> {\n return typeOf(object) === REACT_MEMO_TYPE\n}\n","/**\r\n * Prints a warning in the console if it exists.\r\n *\r\n * @param {String} message The warning message.\r\n * @returns {void}\r\n */\r\nexport default function warning(message: string) {\r\n /* eslint-disable Line truncated
@@ -0,0 +1,6 @@
<svg viewbox="0 0 18 18">
<line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"></line>
<line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"></line>
<line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"></line>
<polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline>
</svg>

After

Width:  |  Height:  |  Size: 299 B

@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var bannerRole = {
abstract: false,
accessibleNameRequired: false,
baseConcepts: [],
childrenPresentational: false,
nameFrom: ['author'],
prohibitedProps: [],
props: {},
relatedConcepts: [{
concept: {
constraints: ['scoped to the body element'],
name: 'header'
},
module: 'HTML'
}],
requireContextRole: [],
requiredContextRole: [],
requiredOwnedElements: [],
requiredProps: {},
superClass: [['roletype', 'structure', 'section', 'landmark']]
};
var _default = exports.default = bannerRole;
@@ -0,0 +1,11 @@
"use strict";
module.exports = function (it) {
const { pluginName } = it;
return `
ESLint couldn't find the plugin "${pluginName}". because there is whitespace in the name. Please check your configuration and remove all whitespace from the plugin name.
If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.
`.trimStart();
};
@@ -0,0 +1 @@
{"version":3,"names":["helpers","data","require","_traverse","_codeFrame","_t","_semver","_babel7Helpers","cloneNode","interpreterDirective","traverseFast","File","constructor","options","code","ast","inputMap","_map","Map","opts","declarations","path","scope","metadata","hub","file","getCode","getScope","addHelper","bind","buildError","buildCodeFrameError","NodePath","get","parentPath","parent","container","key","setContext","shebang","interpreter","node","value","replaceWith","remove","set","val","Error","has","availableHelper","name","versionRange","isInternal","minVersion","err","semver","valid","intersects","_addHelper","declar","generator","res","uid","generateUidIdentifier","dependencies","dep","getDependencies","nodes","globals","Object","keys","getAllBindings","forEach","hasBinding","rename","_compact","added","unshiftContainer","isVariableDeclaration","registerDeclaration","msg","_Error","SyntaxError","loc","stop","txt","highlightCode","codeFrameColumns","start","line","column","end","undefined","exports","default","prototype","addImport","addTemplateObject","getModuleName","babel7"],"sources":["../../../src/transformation/file/file.ts"],"sourcesContent":["import * as helpers from \"@babel/helpers\";\nimport { NodePath } from \"@babel/traverse\";\nimport type { HubInterface, Scope } from \"@babel/traverse\";\nimport { codeFrameColumns } from \"@babel/code-frame\";\nimport { cloneNode, interpreterDirective, traverseFast } from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport semver from \"semver\";\n\nimport type { NormalizedFile } from \"../normalize-file.ts\";\n\n// @ts-expect-error This file is `any`\nimport babel7 from \"./babel-7-helpers.cjs\" with { if: \"!process.env.BABEL_8_BREAKING && (!USE_ESM || IS_STANDALONE)\" };\nimport type { ResolvedOptions } from \"../../config/validation/options.ts\";\nimport type { SourceMapConverter } from \"convert-source-map\";\n\nexport default class File {\n _map: Map<unknown, unknown> = new Map();\n opts: ResolvedOptions;\n declarations: Record<string, t.Identifier> = {};\n path: NodePath<t.Program>;\n ast: t.File;\n scope: Scope;\n metadata: Record<string, any> = {};\n code: string = \"\";\n inputMap: SourceMapConverter;\n\n hub: HubInterface & { file: File } = {\n // keep it for the usage in babel-core, ex: path.hub.file.opts.filename\n file: this,\n getCode: () => this.code,\n getScope: () => this.scope,\n addHelper: this.addHelper.bind(this),\n buildError: this.buildCodeFrameError.bind(this),\n };\n\n constructor(\n options: ResolvedOptions,\n { code, ast, inputMap }: NormalizedFile,\n ) {\n this.opts = options;\n this.code = code;\n this.ast = ast;\n this.inputMap = inputMap;\n\n this.path = NodePath.get({\n hub: this.hub,\n parentPath: null,\n parent: this.ast,\n container: this.ast,\n key: \"program\",\n }).setContext() as NodePath<t.Program>;\n this.scope = this.path.scope;\n }\n\n /**\n * Provide backward-compatible access to the interpreter directive handling\n * in Babel 6.x. If you are writing a plugin for Babel 7.x, it would be\n * best to use 'program.interpreter' directly.\n */\n get shebang(): string {\n const { interpreter } = this.path.node;\n return interpreter ? interpreter.value : \"\";\n }\n set shebang(value: string) {\n if (value) {\n this.path.get(\"interpreter\").replaceWith(interpreterDirective(value));\n } else {\n this.path.get(\"interpreter\").remove();\n }\n }\n\n set(key: unknown, val: unknown) {\n if (!process.env.BABEL_8_BREAKING) {\n if (key === \"helpersNamespace\") {\n throw new Error(\n \"Babel 7.0.0-beta.56 has dropped support for the 'helpersNamespace' utility.\" +\n \"If you are using @babel/plugin-external-helpers you will need to use a newer \" +\n \"version than the one you currently have installed. \" +\n \"If you have your own implementation, you'll want to explore using 'helperGenerator' \" +\n \"alongside 'file.availableHelper()'.\",\n );\n }\n }\n\n this._map.set(key, val);\n }\n\n get(key: unknown): any {\n return this._map.get(key);\n }\n\n has(key: unknown): boolean {\n return this._map.has(key);\n }\n\n /**\n * Check if a given helper is available in @babel/core's helper list.\n *\n * This _also_ allows you to pass a Babel version specifically. If the\n * helper exists, but was not available for the full given range, it will be\n * considered unavailable.\n */\n availableHelper(name: string, versionRange?: string | null): boolean {\n if (helpers.isInternal(name)) return false;\n\n let minVersion;\n try {\n minVersion = helpers.minVersion(name);\n } catch (err) {\n if (err.code !== \"BABEL_HELPER_UNKNOWN\") throw err;\n\n return false;\n }\n\n if (typeof versionRange !== \"string\") return true;\n\n // semver.intersects(Line truncated
@@ -0,0 +1,77 @@
'use strict';
// We define these manually to ensure they're always copied
// even if they would move up the prototype chain
// https://nodejs.org/api/http.html#http_class_http_incomingmessage
const knownProperties = [
'aborted',
'complete',
'headers',
'httpVersion',
'httpVersionMinor',
'httpVersionMajor',
'method',
'rawHeaders',
'rawTrailers',
'setTimeout',
'socket',
'statusCode',
'statusMessage',
'trailers',
'url'
];
module.exports = (fromStream, toStream) => {
if (toStream._readableState.autoDestroy) {
throw new Error('The second stream must have the `autoDestroy` option set to `false`');
}
const fromProperties = new Set(Object.keys(fromStream).concat(knownProperties));
const properties = {};
for (const property of fromProperties) {
// Don't overwrite existing properties.
if (property in toStream) {
continue;
}
properties[property] = {
get() {
const value = fromStream[property];
const isFunction = typeof value === 'function';
return isFunction ? value.bind(fromStream) : value;
},
set(value) {
fromStream[property] = value;
},
enumerable: true,
configurable: false
};
}
Object.defineProperties(toStream, properties);
fromStream.once('aborted', () => {
toStream.destroy();
toStream.emit('aborted');
});
fromStream.once('close', () => {
if (fromStream.complete) {
if (toStream.readable) {
toStream.once('end', () => {
toStream.emit('close');
});
} else {
toStream.emit('close');
}
} else {
toStream.emit('close');
}
});
return toStream;
};
@@ -0,0 +1,49 @@
"use strict"
const { getTsconfig, parseTsconfig } = require("get-tsconfig")
const { getPhysicalFilename, getFilename } = require("./eslint-compat")
const fsCache = new Map()
/**
* Attempts to get the ExtensionMap from the tsconfig given the path to the tsconfig file.
*
* @param {string} filename - The path to the tsconfig.json file
* @returns {import("get-tsconfig").TsConfigJsonResolved}
*/
function getTSConfig(filename) {
return parseTsconfig(filename, fsCache)
}
/**
* Attempts to get the ExtensionMap from the tsconfig of a given file.
*
* @param {string} filename - The path to the file we need to find the tsconfig.json of
* @returns {import("get-tsconfig").TsConfigResult | null}
*/
function getTSConfigForFile(filename) {
return getTsconfig(filename, "tsconfig.json", fsCache)
}
/**
* Attempts to get the ExtensionMap from the tsconfig of a given file.
*
* @param {import('eslint').Rule.RuleContext} context - The current eslint context
* @returns {import("get-tsconfig").TsConfigResult | null}
*/
function getTSConfigForContext(context) {
const filename = getPhysicalFilename(context) ?? getFilename(context)
return getTSConfigForFile(filename)
}
module.exports = {
getTSConfig,
getTSConfigForFile,
getTSConfigForContext,
}
/**
* @typedef {string} TSConfigPath
*/
module.exports.schema = { type: "string" }
@@ -0,0 +1,149 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = exports.ReadyState = void 0;
var _tslib = require("tslib");
var _react = require("react");
var _useLatest = _interopRequireDefault(require("../useLatest"));
var _useMemoizedFn = _interopRequireDefault(require("../useMemoizedFn"));
var _useUnmount = _interopRequireDefault(require("../useUnmount"));
var ReadyState;
(function (ReadyState) {
ReadyState[ReadyState["Connecting"] = 0] = "Connecting";
ReadyState[ReadyState["Open"] = 1] = "Open";
ReadyState[ReadyState["Closing"] = 2] = "Closing";
ReadyState[ReadyState["Closed"] = 3] = "Closed";
})(ReadyState || (exports.ReadyState = ReadyState = {}));
function useWebSocket(socketUrl, options) {
if (options === void 0) {
options = {};
}
var _a = options.reconnectLimit,
reconnectLimit = _a === void 0 ? 3 : _a,
_b = options.reconnectInterval,
reconnectInterval = _b === void 0 ? 3 * 1000 : _b,
_c = options.manual,
manual = _c === void 0 ? false : _c,
onOpen = options.onOpen,
onClose = options.onClose,
onMessage = options.onMessage,
onError = options.onError,
protocols = options.protocols;
var _d = (0, _tslib.__read)((0, _react.useState)(), 2),
latestMessage = _d[0],
setLatestMessage = _d[1];
var _e = (0, _tslib.__read)((0, _react.useState)(ReadyState.Closed), 2),
readyState = _e[0],
setReadyState = _e[1];
var onOpenRef = (0, _useLatest["default"])(onOpen);
var onCloseRef = (0, _useLatest["default"])(onClose);
var onMessageRef = (0, _useLatest["default"])(onMessage);
var onErrorRef = (0, _useLatest["default"])(onError);
var readyStateRef = (0, _useLatest["default"])(readyState);
var reconnectTimesRef = (0, _react.useRef)(0);
var reconnectTimerRef = (0, _react.useRef)(undefined);
var websocketRef = (0, _react.useRef)(undefined);
var reconnect = function reconnect() {
var _a;
if (reconnectTimesRef.current < reconnectLimit && ((_a = websocketRef.current) === null || _a === void 0 ? void 0 : _a.readyState) !== ReadyState.Open) {
if (reconnectTimerRef.current) {
clearTimeout(reconnectTimerRef.current);
}
reconnectTimerRef.current = setTimeout(function () {
// eslint-disable-next-line @typescript-eslint/no-use-before-define
connectWs();
reconnectTimesRef.current++;
}, reconnectInterval);
}
};
var connectWs = function connectWs() {
if (reconnectTimerRef.current) {
clearTimeout(reconnectTimerRef.current);
}
if (websocketRef.current) {
websocketRef.current.close();
}
var ws = new WebSocket(socketUrl, protocols);
setReadyState(ReadyState.Connecting);
ws.onerror = function (event) {
var _a;
if (websocketRef.current !== ws) {
return;
}
reconnect();
(_a = onErrorRef.current) === null || _a === void 0 ? void 0 : _a.call(onErrorRef, event, ws);
setReadyState(ws.readyState || ReadyState.Closed);
};
ws.onopen = function (event) {
var _a;
if (websocketRef.current !== ws) {
return;
}
(_a = onOpenRef.current) === null || _a === void 0 ? void 0 : _a.call(onOpenRef, event, ws);
reconnectTimesRef.current = 0;
setReadyState(ws.readyState || ReadyState.Open);
};
ws.onmessage = function (message) {
var _a;
if (websocketRef.current !== ws) {
return;
}
(_a = onMessageRef.current) === null || _a === void 0 ? void 0 : _a.call(onMessageRef, message, ws);
setLatestMessage(message);
};
ws.onclose = function (event) {
var _a;
(_a = onCloseRef.current) === null || _a === void 0 ? void 0 : _a.call(onCloseRef, event, ws);
// closed by server
if (websocketRef.current === ws) {
reconnect();
}
// closed by disconnect or closed by server
if (!websocketRef.current || websocketRef.current === ws) {
setReadyState(ws.readyState || ReadyState.Closed);
}
};
websocketRef.current = ws;
};
var sendMessage = function sendMessage(message) {
var _a;
if (readyStateRef.current === ReadyState.Open) {
(_a = websocketRef.current) === null || _a === void 0 ? void 0 : _a.send(message);
} else {
throw new Error('WebSocket disconnected');
}
};
var connect = function connect() {
reconnectTimesRef.current = 0;
connectWs();
};
var disconnect = function disconnect() {
var _a;
if (reconnectTimerRef.current) {
clearTimeout(reconnectTimerRef.current);
}
reconnectTimesRef.current = reconnectLimit;
(_a = websocketRef.current) === null || _a === void 0 ? void 0 : _a.close();
websocketRef.current = undefined;
};
(0, _react.useEffect)(function () {
if (!manual && socketUrl) {
connect();
}
}, [socketUrl, manual]);
(0, _useUnmount["default"])(function () {
disconnect();
});
return {
latestMessage: latestMessage,
sendMessage: (0, _useMemoizedFn["default"])(sendMessage),
connect: (0, _useMemoizedFn["default"])(connect),
disconnect: (0, _useMemoizedFn["default"])(disconnect),
readyState: readyState,
webSocketIns: websocketRef.current
};
}
var _default = exports["default"] = useWebSocket;
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F wC","132":"A B"},B:{"1":"0 1 2 3 4 5 C L M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I"},C:{"1":"0 1 2 3 4 5 6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC 1C","2":"xC TC 0C"},D:{"1":"0 1 2 3 4 5 6 7 8 9 K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","2":"J ZB"},E:{"1":"K D E F A B C L M G 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","2":"J ZB 2C ZC 3C"},F:{"1":"0 1 2 3 4 5 6 7 8 9 C G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z NC uC JD OC","2":"F B FD GD HD ID"},G:{"1":"E 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","2":"ZC KD vC LD"},H:{"2":"hD"},I:{"1":"TC J I lD vC mD nD","2":"iD jD kD"},J:{"1":"A","2":"D"},K:{"1":"C H NC uC OC","2":"A B"},L:{"1":"I"},M:{"1":"MC"},N:{"1":"A B"},O:{"1":"PC"},P:{"1":"6 7 8 9 J AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"1":"zD"},R:{"1":"0D"},S:{"1":"1D 2D"}},B:5,C:"FileReader API",D:true};
@@ -0,0 +1,39 @@
'use strict';
var setFunctionName = require('set-function-name');
var $TypeError = require('es-errors/type');
var $Object = Object;
module.exports = setFunctionName(function flags() {
if (this == null || this !== $Object(this)) {
throw new $TypeError('RegExp.prototype.flags getter called on non-object');
}
var result = '';
if (this.hasIndices) {
result += 'd';
}
if (this.global) {
result += 'g';
}
if (this.ignoreCase) {
result += 'i';
}
if (this.multiline) {
result += 'm';
}
if (this.dotAll) {
result += 's';
}
if (this.unicode) {
result += 'u';
}
if (this.unicodeSets) {
result += 'v';
}
if (this.sticky) {
result += 'y';
}
return result;
}, 'get flags', true);
@@ -0,0 +1 @@
{"version":3,"file":"axios.min.js","sources":["../lib/helpers/bind.js","../lib/utils.js","../lib/core/AxiosError.js","../lib/helpers/toFormData.js","../lib/helpers/AxiosURLSearchParams.js","../lib/helpers/buildURL.js","../lib/core/InterceptorManager.js","../lib/defaults/transitional.js","../lib/platform/browser/index.js","../lib/platform/browser/classes/URLSearchParams.js","../lib/platform/browser/classes/FormData.js","../lib/platform/browser/classes/Blob.js","../lib/platform/common/utils.js","../lib/platform/index.js","../lib/helpers/formDataToJSON.js","../lib/defaults/index.js","../lib/helpers/toURLEncodedForm.js","../lib/helpers/parseHeaders.js","../lib/core/AxiosHeaders.js","../lib/core/transformData.js","../lib/cancel/isCancel.js","../lib/cancel/CanceledError.js","../lib/core/settle.js","../lib/helpers/speedometer.js","../lib/helpers/throttle.js","../lib/helpers/progressEventReducer.js","../lib/helpers/isURLSameOrigin.js","../lib/helpers/cookies.js","../lib/core/buildFullPath.js","../lib/helpers/isAbsoluteURL.js","../lib/helpers/combineURLs.js","../lib/core/mergeConfig.js","../lib/helpers/resolveConfig.js","../lib/adapters/fetch.js","../lib/adapters/xhr.js","../lib/helpers/parseProtocol.js","../lib/helpers/composeSignals.js","../lib/helpers/trackStream.js","../lib/adapters/adapters.js","../lib/helpers/null.js","../lib/core/dispatchRequest.js","../lib/env/data.js","../lib/helpers/validator.js","../lib/core/Axios.js","../lib/cancel/CancelToken.js","../lib/helpers/HttpStatusCode.js","../lib/axios.js","../lib/helpers/spread.js","../lib/helpers/isAxiosError.js"],"sourcesContent":["'use strict';\n\n/**\n * Create a bound version of a function with a specified `this` context\n *\n * @param {Function} fn - The function to bind\n * @param {*} thisArg - The value to be passed as the `this` parameter\n * @returns {Function} A new function that will call the original function with the specified `this` context\n */\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst {toString} = Object.prototype;\nconst {getPrototypeOf} = Object;\nconst {iterator, toStringTag} = Symbol;\n\nconst kindOf = (cache => thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is Line truncated
@@ -0,0 +1,308 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/components/progress.ts
var progress_exports = {};
__export(progress_exports, {
circularProgress: () => circularProgress,
progress: () => progress
});
module.exports = __toCommonJS(progress_exports);
// src/utils/tv.ts
var import_tailwind_variants = require("tailwind-variants");
// src/utils/tw-merge-config.ts
var COMMON_UNITS = ["small", "medium", "large"];
var twMergeConfig = {
theme: {
opacity: ["disabled"],
spacing: ["divider"],
borderWidth: COMMON_UNITS,
borderRadius: COMMON_UNITS
},
classGroups: {
shadow: [{ shadow: COMMON_UNITS }],
"font-size": [{ text: ["tiny", ...COMMON_UNITS] }],
"bg-image": [
"bg-stripe-gradient-default",
"bg-stripe-gradient-primary",
"bg-stripe-gradient-secondary",
"bg-stripe-gradient-success",
"bg-stripe-gradient-warning",
"bg-stripe-gradient-danger"
]
}
};
// src/utils/tv.ts
var tv = (options, config) => {
var _a, _b, _c;
return (0, import_tailwind_variants.tv)(options, {
...config,
twMerge: (_a = config == null ? void 0 : config.twMerge) != null ? _a : true,
twMergeConfig: {
...config == null ? void 0 : config.twMergeConfig,
theme: {
...(_b = config == null ? void 0 : config.twMergeConfig) == null ? void 0 : _b.theme,
...twMergeConfig.theme
},
classGroups: {
...(_c = config == null ? void 0 : config.twMergeConfig) == null ? void 0 : _c.classGroups,
...twMergeConfig.classGroups
}
}
});
};
// src/components/progress.ts
var progress = tv(
{
slots: {
base: "flex flex-col gap-2 w-full",
label: "",
labelWrapper: "flex justify-between",
value: "",
track: "z-0 relative bg-default-300/50 overflow-hidden",
indicator: "h-full"
},
variants: {
color: {
default: {
indicator: "bg-default-400"
},
primary: {
indicator: "bg-primary"
},
secondary: {
indicator: "bg-secondary"
},
success: {
indicator: "bg-success"
},
warning: {
indicator: "bg-warning"
},
danger: {
indicator: "bg-danger"
}
},
size: {
sm: {
label: "text-small",
value: "text-small",
track: "h-1"
},
md: {
label: "text-medium",
value: "text-medium",
track: "h-3"
},
lg: {
label: "text-large",
value: "text-large",
track: "h-5"
}
},
radius: {
none: {
track: "rounded-none",
indicator: "rounded-none"
},
sm: {
track: "rounded-small",
indicator: "rounded-small"
},
md: {
track: "rounded-medium",
indicator: "rounded-medium"
},
lg: {
track: "rounded-large",
indicator: "rounded-large"
},
full: {
track: "rounded-full",
indicator: "rounded-full"
}
},
isStriped: {
true: {
indicator: "bg-stripe-gradient-default bg-stripe-size"
}
},
isIndeterminate: {
true: {
indicator: ["absolute", "w-full", "origin-left", "animate-indeterminate-bar"]
}
},
isDisabled: {
true: {
base: "opacity-disabled cursor-not-allowed"
}
},
disableAnimation: {
true: {},
false: {
indicator: "transition-transform !duration-500"
}
}
},
defaultVariants: {
color: "primary",
size: "md",
radius: "full",
isStriped: false,
isIndeterminate: false,
isDisabled: false
},
compoundVariants: [
{
disableAnimation: true,
isIndeterminate: false,
class: {
indicator: "!transition-none motion-reduce:transition-none"
}
},
{
color: "primary",
isStriped: true,
class: {
indicator: "bg-stripe-gradient-primary bg-stripe-size"
}
},
{
color: "secondary",
isStriped: true,
class: {
indicator: "bg-stripe-gradient-secondary bg-stripe-size"
}
},
{
color: "success",
isStriped: true,
class: {
indicator: "bg-stripe-gradient-success bg-stripe-size"
}
},
{
color: "warning",
isStriped: true,
class: {
indicator: "bg-stripe-gradient-warning bg-stripe-size"
}
},
{
color: "danger",
isStriped: true,
class: {
indicator: "bg-stripe-gradient-danger bg-stripe-size"
}
}
]
},
{
twMerge: true
}
);
var circularProgress = tv({
slots: {
base: "flex flex-col justify-center gap-1 max-w-fit items-center",
label: "",
svgWrapper: "relative block",
svg: "z-0 relative overflow-hidden",
track: "h-full stroke-default-300/50",
indicator: "h-full stroke-current",
value: "absolute font-normal inset-0 flex items-center justify-center"
},
variants: {
color: {
default: {
svg: "text-default-400"
},
primary: {
svg: "text-primary"
},
secondary: {
svg: "text-secondary"
},
success: {
svg: "text-success"
},
warning: {
svg: "text-warning"
},
danger: {
svg: "text-danger"
}
},
size: {
sm: {
svg: "w-8 h-8",
label: "text-small",
value: "text-[0.5rem]"
},
md: {
svg: "w-10 h-10",
label: "text-small",
value: "text-[0.55rem]"
},
lg: {
svg: "w-12 h-12",
label: "text-medium",
value: "text-[0.6rem]"
}
},
isIndeterminate: {
true: {
svg: "animate-spinner-ease-spin"
}
},
isDisabled: {
true: {
base: "opacity-disabled cursor-not-allowed"
}
},
disableAnimation: {
true: {},
false: {
indicator: "transition-all !duration-500"
}
}
},
defaultVariants: {
color: "primary",
size: "md",
isDisabled: false
},
compoundVariants: [
{
disableAnimation: true,
isIndeterminate: false,
class: {
svg: "!transition-none motion-reduce:transition-none"
}
}
]
});
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
circularProgress,
progress
});
@@ -0,0 +1,9 @@
import { TraceMap } from './trace-mapping.mts';
import type { SectionedSourceMapInput, Ro } from './types.mts';
type FlattenMap = {
new (map: Ro<SectionedSourceMapInput>, mapUrl?: string | null): TraceMap;
(map: Ro<SectionedSourceMapInput>, mapUrl?: string | null): TraceMap;
};
export declare const FlattenMap: FlattenMap;
export {};
//# sourceMappingURL=flatten-map.d.ts.map
@@ -0,0 +1,9 @@
export function sourceType(context) {
if ('sourceType' in context.parserOptions) {
return context.parserOptions.sourceType;
}
if ('languageOptions' in context && context.languageOptions) {
return context.languageOptions.sourceType;
}
}
//# sourceMappingURL=source-type.js.map
@@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.visitorKeys = exports.getKeys = void 0;
var get_keys_1 = require("./get-keys");
Object.defineProperty(exports, "getKeys", { enumerable: true, get: function () { return get_keys_1.getKeys; } });
var visitor_keys_1 = require("./visitor-keys");
Object.defineProperty(exports, "visitorKeys", { enumerable: true, get: function () { return visitor_keys_1.visitorKeys; } });
@@ -0,0 +1,14 @@
"use strict";
/* eslint-disable @typescript-eslint/no-namespace */
Object.defineProperty(exports, "__esModule", { value: true });
exports.LegacyESLint = void 0;
const use_at_your_own_risk_1 = require("eslint/use-at-your-own-risk");
/**
* The ESLint class is the primary class to use in Node.js applications.
* This class depends on the Node.js fs module and the file system, so you cannot use it in browsers.
*
* If you want to lint code on browsers, use the Linter class instead.
*/
class LegacyESLint extends use_at_your_own_risk_1.LegacyESLint {
}
exports.LegacyESLint = LegacyESLint;
@@ -0,0 +1,290 @@
"use client";
// src/use-slider.ts
import {
mapPropsVariants,
useProviderContext
} from "@heroui/system";
import { slider } from "@heroui/theme";
import { useDOMRef, filterDOMProps } from "@heroui/react-utils";
import { useSliderState } from "@react-stately/slider";
import { useCallback, useMemo, useRef } from "react";
import { useNumberFormatter, useLocale } from "@react-aria/i18n";
import { mergeProps } from "@react-aria/utils";
import { useSlider as useAriaSlider } from "@react-aria/slider";
import { clsx, objectToDeps } from "@heroui/shared-utils";
import { useHover } from "@react-aria/interactions";
function useSlider(originalProps) {
var _a, _b, _c, _d;
const globalContext = useProviderContext();
const [props, variantProps] = mapPropsVariants(originalProps, slider.variantKeys);
const {
ref,
as,
name,
label,
formatOptions,
value: valueProp,
maxValue = 100,
minValue = 0,
step = 1,
showSteps = false,
showTooltip = false,
orientation = "horizontal",
marks = [],
startContent,
endContent,
fillOffset,
className,
classNames,
renderThumb,
renderLabel,
renderValue,
onChange,
onChangeEnd,
getValue,
tooltipValueFormatOptions = formatOptions,
tooltipProps: userTooltipProps = {},
...otherProps
} = props;
const Component = as || "div";
const shouldFilterDOMProps = typeof Component === "string";
const disableAnimation = (_b = (_a = originalProps == null ? void 0 : originalProps.disableAnimation) != null ? _a : globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _b : false;
const domRef = useDOMRef(ref);
const trackRef = useRef(null);
const numberFormatter = useNumberFormatter(formatOptions);
const { direction } = useLocale();
const clampValue = useCallback(
(valueToClamp) => Math.min(Math.max(valueToClamp, minValue), maxValue),
[minValue, maxValue]
);
const validatedValue = useMemo(() => {
if (valueProp === void 0)
return void 0;
if (Array.isArray(valueProp)) {
return valueProp.map(clampValue);
}
return clampValue(valueProp);
}, [valueProp, clampValue]);
const state = useSliderState({
...otherProps,
value: validatedValue,
isDisabled: (_c = originalProps == null ? void 0 : originalProps.isDisabled) != null ? _c : false,
orientation,
step,
minValue,
maxValue,
numberFormatter,
onChange,
onChangeEnd
});
const tooltipProps = {
offset: 5,
delay: 0,
size: "sm",
showArrow: true,
color: (originalProps == null ? void 0 : originalProps.color) ? originalProps == null ? void 0 : originalProps.color : (_d = slider.defaultVariants) == null ? void 0 : _d.color,
isDisabled: originalProps.isDisabled,
...userTooltipProps
};
const { groupProps, trackProps, labelProps, outputProps } = useAriaSlider(
originalProps,
state,
trackRef
);
const { isHovered, hoverProps } = useHover({ isDisabled: originalProps.isDisabled });
const baseStyles = clsx(classNames == null ? void 0 : classNames.base, className);
const isVertical = orientation === "vertical";
const hasMarks = (marks == null ? void 0 : marks.length) > 0;
const hasSingleThumb = fillOffset === void 0 ? state.values.length === 1 : false;
const slots = useMemo(
() => slider({
...variantProps,
hasMarks,
disableAnimation,
hasSingleThumb,
isVertical,
className
}),
[objectToDeps(variantProps), isVertical, disableAnimation, hasSingleThumb, hasMarks, className]
);
const [startOffset, endOffset] = [
state.values.length > 1 ? state.getThumbPercent(0) : fillOffset !== void 0 ? state.getValuePercent(fillOffset) : 0,
state.getThumbPercent(state.values.length - 1)
].sort();
const value = state.values.length === 1 ? numberFormatter.format(state.values[0]) : numberFormatter.formatRange(state.values[0], state.values[state.values.length - 1]);
const steps = showSteps ? Math.floor((maxValue - minValue) / step) + 1 : 0;
const getBaseProps = (props2 = {}) => {
return {
ref: domRef,
"data-orientation": state.orientation,
"data-slot": "base",
"data-hover": isHovered,
className: slots.base({ class: baseStyles }),
...mergeProps(
groupProps,
hoverProps,
filterDOMProps(otherProps, {
enabled: shouldFilterDOMProps
}),
filterDOMProps(props2)
)
};
};
const getLabelWrapperProps = (props2 = {}) => {
return {
className: slots.labelWrapper({ class: classNames == null ? void 0 : classNames.labelWrapper }),
"data-slot": "labelWrapper",
...props2
};
};
const getLabelProps = (props2 = {}) => {
return {
"data-slot": "label",
className: slots.label({ class: classNames == null ? void 0 : classNames.label }),
children: label,
...labelProps,
...props2
};
};
const getValueProps = (props2 = {}) => {
return {
"data-slot": "value",
className: slots.value({ class: classNames == null ? void 0 : classNames.value }),
children: getValue && typeof getValue === "function" ? getValue(state.values) : value,
...outputProps,
...props2
};
};
const getTrackProps = (props2 = {}) => {
return {
ref: trackRef,
"data-slot": "track",
"data-thumb-hidden": !!(originalProps == null ? void 0 : originalProps.hideThumb),
"data-vertical": isVertical,
className: slots.track({ class: classNames == null ? void 0 : classNames.track }),
...trackProps,
...props2
};
};
const getTrackWrapperProps = (props2 = {}) => {
return {
"data-slot": "track-wrapper",
className: slots.trackWrapper({ class: classNames == null ? void 0 : classNames.trackWrapper }),
...props2
};
};
const getFillerProps = (props2 = {}) => {
return {
"data-slot": "filler",
className: slots.filler({ class: classNames == null ? void 0 : classNames.filler }),
...props2,
style: {
...props2.style,
[isVertical ? "bottom" : direction === "rtl" ? "right" : "left"]: `${startOffset * 100}%`,
...isVertical ? {
height: `${(endOffset - startOffset) * 100}%`
} : {
width: `${(endOffset - startOffset) * 100}%`
}
}
};
};
const getThumbProps = (index) => {
return {
name,
index,
state,
trackRef,
orientation,
isVertical,
tooltipProps,
showTooltip,
renderThumb,
formatOptions: tooltipValueFormatOptions,
className: slots.thumb({ class: classNames == null ? void 0 : classNames.thumb })
};
};
const getStepProps = (index) => {
const percent = state.getValuePercent(index * step + minValue);
return {
className: slots.step({ class: classNames == null ? void 0 : classNames.step }),
"data-slot": "step",
"data-in-range": percent <= endOffset && percent >= startOffset,
style: {
[isVertical ? "bottom" : direction === "rtl" ? "right" : "left"]: `${percent * 100}%`
}
};
};
const getMarkProps = (mark) => {
const percent = state.getValuePercent(mark.value);
return {
className: slots.mark({ class: classNames == null ? void 0 : classNames.mark }),
"data-slot": "mark",
"data-in-range": percent <= endOffset && percent >= startOffset,
style: {
[isVertical ? "bottom" : direction === "rtl" ? "right" : "left"]: `${percent * 100}%`
},
onMouseDown: (e) => e.stopPropagation(),
onPointerDown: (e) => e.stopPropagation(),
onClick: (e) => {
e.stopPropagation();
if (state.values.length === 1) {
state.setThumbPercent(0, percent);
} else {
const leftThumbVal = state.values[0];
const rightThumbVal = state.values[1];
if (mark.value < leftThumbVal) {
state.setThumbPercent(0, percent);
} else if (mark.value > rightThumbVal) {
state.setThumbPercent(1, percent);
} else if (Math.abs(mark.value - leftThumbVal) < Math.abs(mark.value - rightThumbVal)) {
state.setThumbPercent(0, percent);
} else {
state.setThumbPercent(1, percent);
}
}
}
};
};
const getStartContentProps = (props2 = {}) => ({
"data-slot": "startContent",
className: slots.startContent({ class: classNames == null ? void 0 : classNames.startContent }),
...props2
});
const getEndContentProps = (props2 = {}) => ({
"data-slot": "endContent",
className: slots.endContent({ class: classNames == null ? void 0 : classNames.endContent }),
...props2
});
return {
Component,
state,
value,
domRef,
label,
steps,
marks,
startContent,
endContent,
getStepProps,
getBaseProps,
getValue,
renderLabel,
renderValue,
getTrackWrapperProps,
getLabelWrapperProps,
getLabelProps,
getValueProps,
getTrackProps,
getFillerProps,
getThumbProps,
getMarkProps,
getStartContentProps,
getEndContentProps
};
}
export {
useSlider
};
@@ -0,0 +1,29 @@
{
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
"name": "chownr",
"description": "like `chown -R`",
"version": "1.1.4",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/chownr.git"
},
"main": "chownr.js",
"files": [
"chownr.js"
],
"devDependencies": {
"mkdirp": "0.3",
"rimraf": "^2.7.1",
"tap": "^14.10.6"
},
"tap": {
"check-coverage": true
},
"scripts": {
"test": "tap",
"preversion": "npm test",
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags"
},
"license": "ISC"
}
@@ -0,0 +1,10 @@
var toPropertyKey = require("./toPropertyKey.js");
function _defineProperty(e, r, t) {
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
value: t,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[r] = t, e;
}
module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
@@ -0,0 +1,3 @@
export type SetState<S extends Record<string, any>> = <K extends keyof S>(state: Pick<S, K> | null | ((prevState: Readonly<S>) => Pick<S, K> | S | null)) => void;
declare const useSetState: <S extends Record<string, any>>(initialState: S | (() => S)) => [S, SetState<S>];
export default useSetState;
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,aAAa,CAAC,gBAAE,CAAC;IACnC,iBAAiB,CAAC,OAAS,CAAC,iBAAG,EAAE,KAAK,UAAU,CAAC,iCAAK,CAAC;IACvD,cAAc,CAAC,OAAS,GAAG,KAAK,KAAK,CAAC,iBAAG,CAAC;IAC1C,cAAc,CAAC,gBAAE,CAAC;IAClB,kBAAkB,CAAC,OAAS,CAAC,iBAAG,EAAE,KAAK,UAAU,CAAC,iCAAK,CAAC;IACxD,sBAAsB,CAAC,wGAAa,CAAC;IACrC,UAAU,CAAC,gBAAE,CAAC;IACd,aAAa,CAAC,gBAAE,CAAC;IACjB,YAAY,CAAC,wCAAK,CAAC;AACrB","sources":["packages/@react-aria/table/intl/zh-CN.json"],"sourcesContent":["{\n \"ascending\": \"升序\",\n \"ascendingSort\": \"按列 {columnName} 升序排序\",\n \"columnSize\": \"{value} 像素\",\n \"descending\": \"降序\",\n \"descendingSort\": \"按列 {columnName} 降序排序\",\n \"resizerDescription\": \"按“输入”键开始调整大小。\",\n \"select\": \"选择\",\n \"selectAll\": \"全选\",\n \"sortable\": \"可排序的列\"\n}\n"],"names":[],"version":3,"file":"zh-CN.main.js.map"}
@@ -0,0 +1 @@
{"version":3,"file":"InjectFromBaseOptions.d.ts","sourceRoot":"","sources":["../../../../src/metadata/models/InjectFromBaseOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAElF,MAAM,WAAW,qBAAqB;IACpC,0BAA0B,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACjD,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,SAAS,CAAC,EAAE,8BAA8B,GAAG,SAAS,CAAC;CACxD"}
@@ -0,0 +1,370 @@
/**
* @license React
* react-jsx-dev-runtime.react-server.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
"use strict";
"production" !== process.env.NODE_ENV &&
(function () {
function getComponentNameFromType(type) {
if (null == type) return null;
if ("function" === typeof type)
return type.$$typeof === REACT_CLIENT_REFERENCE
? null
: type.displayName || type.name || null;
if ("string" === typeof type) return type;
switch (type) {
case REACT_FRAGMENT_TYPE:
return "Fragment";
case REACT_PROFILER_TYPE:
return "Profiler";
case REACT_STRICT_MODE_TYPE:
return "StrictMode";
case REACT_SUSPENSE_TYPE:
return "Suspense";
case REACT_SUSPENSE_LIST_TYPE:
return "SuspenseList";
case REACT_ACTIVITY_TYPE:
return "Activity";
}
if ("object" === typeof type)
switch (
("number" === typeof type.tag &&
console.error(
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
),
type.$$typeof)
) {
case REACT_PORTAL_TYPE:
return "Portal";
case REACT_CONTEXT_TYPE:
return type.displayName || "Context";
case REACT_CONSUMER_TYPE:
return (type._context.displayName || "Context") + ".Consumer";
case REACT_FORWARD_REF_TYPE:
var innerType = type.render;
type = type.displayName;
type ||
((type = innerType.displayName || innerType.name || ""),
(type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
return type;
case REACT_MEMO_TYPE:
return (
(innerType = type.displayName || null),
null !== innerType
? innerType
: getComponentNameFromType(type.type) || "Memo"
);
case REACT_LAZY_TYPE:
innerType = type._payload;
type = type._init;
try {
return getComponentNameFromType(type(innerType));
} catch (x) {}
}
return null;
}
function testStringCoercion(value) {
return "" + value;
}
function checkKeyStringCoercion(value) {
try {
testStringCoercion(value);
var JSCompiler_inline_result = !1;
} catch (e) {
JSCompiler_inline_result = !0;
}
if (JSCompiler_inline_result) {
JSCompiler_inline_result = console;
var JSCompiler_temp_const = JSCompiler_inline_result.error;
var JSCompiler_inline_result$jscomp$0 =
("function" === typeof Symbol &&
Symbol.toStringTag &&
value[Symbol.toStringTag]) ||
value.constructor.name ||
"Object";
JSCompiler_temp_const.call(
JSCompiler_inline_result,
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
JSCompiler_inline_result$jscomp$0
);
return testStringCoercion(value);
}
}
function getTaskName(type) {
if (type === REACT_FRAGMENT_TYPE) return "<>";
if (
"object" === typeof type &&
null !== type &&
type.$$typeof === REACT_LAZY_TYPE
)
return "<...>";
try {
var name = getComponentNameFromType(type);
return name ? "<" + name + ">" : "<...>";
} catch (x) {
return "<...>";
}
}
function getOwner() {
var dispatcher = ReactSharedInternalsServer.A;
return null === dispatcher ? null : dispatcher.getOwner();
}
function UnknownOwner() {
return Error("react-stack-top-frame");
}
function hasValidKey(config) {
if (hasOwnProperty.call(config, "key")) {
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
if (getter && getter.isReactWarning) return !1;
}
return void 0 !== config.key;
}
function defineKeyPropWarningGetter(props, displayName) {
function warnAboutAccessingKey() {
specialPropKeyWarningShown ||
((specialPropKeyWarningShown = !0),
console.error(
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
displayName
));
}
warnAboutAccessingKey.isReactWarning = !0;
Object.defineProperty(props, "key", {
get: warnAboutAccessingKey,
configurable: !0
});
}
function elementRefGetterWithDeprecationWarning() {
var componentName = getComponentNameFromType(this.type);
didWarnAboutElementRef[componentName] ||
((didWarnAboutElementRef[componentName] = !0),
console.error(
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
));
componentName = this.props.ref;
return void 0 !== componentName ? componentName : null;
}
function ReactElement(type, key, props, owner, debugStack, debugTask) {
var refProp = props.ref;
type = {
$$typeof: REACT_ELEMENT_TYPE,
type: type,
key: key,
props: props,
_owner: owner
};
null !== (void 0 !== refProp ? refProp : null)
? Object.defineProperty(type, "ref", {
enumerable: !1,
get: elementRefGetterWithDeprecationWarning
})
: Object.defineProperty(type, "ref", { enumerable: !1, value: null });
type._store = {};
Object.defineProperty(type._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: 0
});
Object.defineProperty(type, "_debugInfo", {
configurable: !1,
enumerable: !1,
writable: !0,
value: null
});
Object.defineProperty(type, "_debugStack", {
configurable: !1,
enumerable: !1,
writable: !0,
value: debugStack
});
Object.defineProperty(type, "_debugTask", {
configurable: !1,
enumerable: !1,
writable: !0,
value: debugTask
});
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
return type;
}
function jsxDEVImpl(
type,
config,
maybeKey,
isStaticChildren,
debugStack,
debugTask
) {
var children = config.children;
if (void 0 !== children)
if (isStaticChildren)
if (isArrayImpl(children)) {
for (
isStaticChildren = 0;
isStaticChildren < children.length;
isStaticChildren++
)
validateChildKeys(children[isStaticChildren]);
Object.freeze && Object.freeze(children);
} else
console.error(
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
);
else validateChildKeys(children);
if (hasOwnProperty.call(config, "key")) {
children = getComponentNameFromType(type);
var keys = Object.keys(config).filter(function (k) {
return "key" !== k;
});
isStaticChildren =
0 < keys.length
? "{key: someKey, " + keys.join(": ..., ") + ": ...}"
: "{key: someKey}";
didWarnAboutKeySpread[children + isStaticChildren] ||
((keys =
0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"),
console.error(
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
isStaticChildren,
children,
keys,
children
),
(didWarnAboutKeySpread[children + isStaticChildren] = !0));
}
children = null;
void 0 !== maybeKey &&
(checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
hasValidKey(config) &&
(checkKeyStringCoercion(config.key), (children = "" + config.key));
if ("key" in config) {
maybeKey = {};
for (var propName in config)
"key" !== propName && (maybeKey[propName] = config[propName]);
} else maybeKey = config;
children &&
defineKeyPropWarningGetter(
maybeKey,
"function" === typeof type
? type.displayName || type.name || "Unknown"
: type
);
return ReactElement(
type,
children,
maybeKey,
getOwner(),
debugStack,
debugTask
);
}
function validateChildKeys(node) {
isValidElement(node)
? node._store && (node._store.validated = 1)
: "object" === typeof node &&
null !== node &&
node.$$typeof === REACT_LAZY_TYPE &&
("fulfilled" === node._payload.status
? isValidElement(node._payload.value) &&
node._payload.value._store &&
(node._payload.value._store.validated = 1)
: node._store && (node._store.validated = 1));
}
function isValidElement(object) {
return (
"object" === typeof object &&
null !== object &&
object.$$typeof === REACT_ELEMENT_TYPE
);
}
var React = require("react"),
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
REACT_MEMO_TYPE = Symbol.for("react.memo"),
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
ReactSharedInternalsServer =
React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
if (!ReactSharedInternalsServer)
throw Error(
'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.'
);
var hasOwnProperty = Object.prototype.hasOwnProperty,
isArrayImpl = Array.isArray,
createTask = console.createTask
? console.createTask
: function () {
return null;
};
React = {
react_stack_bottom_frame: function (callStackForError) {
return callStackForError();
}
};
var specialPropKeyWarningShown;
var didWarnAboutElementRef = {};
var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(
React,
UnknownOwner
)();
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
var didWarnAboutKeySpread = {};
exports.Fragment = REACT_FRAGMENT_TYPE;
exports.jsx = function (type, config, maybeKey) {
var trackActualOwner =
1e4 > ReactSharedInternalsServer.recentlyCreatedOwnerStacks++;
return jsxDEVImpl(
type,
config,
maybeKey,
!1,
trackActualOwner
? Error("react-stack-top-frame")
: unknownOwnerDebugStack,
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
);
};
exports.jsxDEV = function (type, config, maybeKey, isStaticChildren) {
var trackActualOwner =
1e4 > ReactSharedInternalsServer.recentlyCreatedOwnerStacks++;
return jsxDEVImpl(
type,
config,
maybeKey,
isStaticChildren,
trackActualOwner
? Error("react-stack-top-frame")
: unknownOwnerDebugStack,
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
);
};
exports.jsxs = function (type, config, maybeKey) {
var trackActualOwner =
1e4 > ReactSharedInternalsServer.recentlyCreatedOwnerStacks++;
return jsxDEVImpl(
type,
config,
maybeKey,
!0,
trackActualOwner
? Error("react-stack-top-frame")
: unknownOwnerDebugStack,
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
);
};
})();
@@ -0,0 +1,6 @@
module.exports = {
"dismiss": `Luk`
};
//# sourceMappingURL=da-DK.main.js.map
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more