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,376 @@
/**
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { IColor, IColorRGB } from 'common/Types';
let $r = 0;
let $g = 0;
let $b = 0;
let $a = 0;
export const NULL_COLOR: IColor = {
css: '#00000000',
rgba: 0
};
/**
* Helper functions where the source type is "channels" (individual color channels as numbers).
*/
export namespace channels {
export function toCss(r: number, g: number, b: number, a?: number): string {
if (a !== undefined) {
return `#${toPaddedHex(r)}${toPaddedHex(g)}${toPaddedHex(b)}${toPaddedHex(a)}`;
}
return `#${toPaddedHex(r)}${toPaddedHex(g)}${toPaddedHex(b)}`;
}
export function toRgba(r: number, g: number, b: number, a: number = 0xFF): number {
// Note: The aggregated number is RGBA32 (BE), thus needs to be converted to ABGR32
// on LE systems, before it can be used for direct 32-bit buffer writes.
// >>> 0 forces an unsigned int
return (r << 24 | g << 16 | b << 8 | a) >>> 0;
}
export function toColor(r: number, g: number, b: number, a?: number): IColor {
return {
css: channels.toCss(r, g, b, a),
rgba: channels.toRgba(r, g, b, a)
};
}
}
/**
* Helper functions where the source type is `IColor`.
*/
export namespace color {
export function blend(bg: IColor, fg: IColor): IColor {
$a = (fg.rgba & 0xFF) / 255;
if ($a === 1) {
return {
css: fg.css,
rgba: fg.rgba
};
}
const fgR = (fg.rgba >> 24) & 0xFF;
const fgG = (fg.rgba >> 16) & 0xFF;
const fgB = (fg.rgba >> 8) & 0xFF;
const bgR = (bg.rgba >> 24) & 0xFF;
const bgG = (bg.rgba >> 16) & 0xFF;
const bgB = (bg.rgba >> 8) & 0xFF;
$r = bgR + Math.round((fgR - bgR) * $a);
$g = bgG + Math.round((fgG - bgG) * $a);
$b = bgB + Math.round((fgB - bgB) * $a);
const css = channels.toCss($r, $g, $b);
const rgba = channels.toRgba($r, $g, $b);
return { css, rgba };
}
export function isOpaque(color: IColor): boolean {
return (color.rgba & 0xFF) === 0xFF;
}
export function ensureContrastRatio(bg: IColor, fg: IColor, ratio: number): IColor | undefined {
const result = rgba.ensureContrastRatio(bg.rgba, fg.rgba, ratio);
if (!result) {
return undefined;
}
return channels.toColor(
(result >> 24 & 0xFF),
(result >> 16 & 0xFF),
(result >> 8 & 0xFF)
);
}
export function opaque(color: IColor): IColor {
const rgbaColor = (color.rgba | 0xFF) >>> 0;
[$r, $g, $b] = rgba.toChannels(rgbaColor);
return {
css: channels.toCss($r, $g, $b),
rgba: rgbaColor
};
}
export function opacity(color: IColor, opacity: number): IColor {
$a = Math.round(opacity * 0xFF);
[$r, $g, $b] = rgba.toChannels(color.rgba);
return {
css: channels.toCss($r, $g, $b, $a),
rgba: channels.toRgba($r, $g, $b, $a)
};
}
export function multiplyOpacity(color: IColor, factor: number): IColor {
$a = color.rgba & 0xFF;
return opacity(color, ($a * factor) / 0xFF);
}
export function toColorRGB(color: IColor): IColorRGB {
return [(color.rgba >> 24) & 0xFF, (color.rgba >> 16) & 0xFF, (color.rgba >> 8) & 0xFF];
}
}
/**
* Helper functions where the source type is "css" (string: '#rgb', '#rgba', '#rrggbb',
* '#rrggbbaa').
*/
export namespace css {
// Attempt to set get the shared canvas context
let $ctx: CanvasRenderingContext2D | undefined;
let $litmusColor: CanvasGradient | undefined;
try {
// This is guaranteed to run in the first window, so document should be correct
const canvas = document.createElement('canvas');
canvas.width = 1;
canvas.height = 1;
const ctx = canvas.getContext('2d', {
willReadFrequently: true
});
if (ctx) {
$ctx = ctx;
$ctx.globalCompositeOperation = 'copy';
$litmusColor = $ctx.createLinearGradient(0, 0, 1, 1);
}
}
catch {
// noop
}
/**
* Converts a css string to an IColor, this should handle all valid CSS color strings and will
* throw if it's invalid. The ideal format to use is `#rrggbb[aa]` as it's the fastest to parse.
*
* Only `#rgb[a]`, `#rrggbb[aa]`, `rgb()` and `rgba()` formats are supported when run in a Node
* environment.
*/
export function toColor(css: string): IColor {
// Formats: #rgb[a] and #rrggbb[aa]
if (css.match(/#[\da-f]{3,8}/i)) {
switch (css.length) {
case 4: { // #rgb
$r = parseInt(css.slice(1, 2).repeat(2), 16);
$g = parseInt(css.slice(2, 3).repeat(2), 16);
$b = parseInt(css.slice(3, 4).repeat(2), 16);
return channels.toColor($r, $g, $b);
}
case 5: { // #rgba
$r = parseInt(css.slice(1, 2).repeat(2), 16);
$g = parseInt(css.slice(2, 3).repeat(2), 16);
$b = parseInt(css.slice(3, 4).repeat(2), 16);
$a = parseInt(css.slice(4, 5).repeat(2), 16);
return channels.toColor($r, $g, $b, $a);
}
case 7: // #rrggbb
return {
css,
rgba: (parseInt(css.slice(1), 16) << 8 | 0xFF) >>> 0
};
case 9: // #rrggbbaa
return {
css,
rgba: parseInt(css.slice(1), 16) >>> 0
};
}
}
// Formats: rgb() or rgba()
const rgbaMatch = css.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);
if (rgbaMatch) {
$r = parseInt(rgbaMatch[1]);
$g = parseInt(rgbaMatch[2]);
$b = parseInt(rgbaMatch[3]);
$a = Math.round((rgbaMatch[5] === undefined ? 1 : parseFloat(rgbaMatch[5])) * 0xFF);
return channels.toColor($r, $g, $b, $a);
}
// Validate the context is available for canvas-based color parsing
if (!$ctx || !$litmusColor) {
throw new Error('css.toColor: Unsupported css format');
}
// Validate the color using canvas fillStyle
// See https://html.spec.whatwg.org/multipage/canvas.html#fill-and-stroke-styles
$ctx.fillStyle = $litmusColor;
$ctx.fillStyle = css;
if (typeof $ctx.fillStyle !== 'string') {
throw new Error('css.toColor: Unsupported css format');
}
$ctx.fillRect(0, 0, 1, 1);
[$r, $g, $b, $a] = $ctx.getImageData(0, 0, 1, 1).data;
// Validate the color is non-transparent as color hue gets lost when drawn to the canvas
if ($a !== 0xFF) {
throw new Error('css.toColor: Unsupported css format');
}
// Extract the color from the canvas' fillStyle property which exposes the color value in rgba()
// format
// See https://html.spec.whatwg.org/multipage/canvas.html#serialisation-of-a-color
return {
rgba: channels.toRgba($r, $g, $b, $a),
css
};
}
}
/**
* Helper functions where the source type is "rgb" (number: 0xrrggbb).
*/
export namespace rgb {
/**
* Gets the relative luminance of an RGB color, this is useful in determining the contrast ratio
* between two colors.
* @param rgb The color to use.
* @see https://www.w3.org/TR/WCAG20/#relativeluminancedef
*/
export function relativeLuminance(rgb: number): number {
return relativeLuminance2(
(rgb >> 16) & 0xFF,
(rgb >> 8 ) & 0xFF,
(rgb ) & 0xFF);
}
/**
* Gets the relative luminance of an RGB color, this is useful in determining the contrast ratio
* between two colors.
* @param r The red channel (0x00 to 0xFF).
* @param g The green channel (0x00 to 0xFF).
* @param b The blue channel (0x00 to 0xFF).
* @see https://www.w3.org/TR/WCAG20/#relativeluminancedef
*/
export function relativeLuminance2(r: number, g: number, b: number): number {
const rs = r / 255;
const gs = g / 255;
const bs = b / 255;
const rr = rs <= 0.03928 ? rs / 12.92 : Math.pow((rs + 0.055) / 1.055, 2.4);
const rg = gs <= 0.03928 ? gs / 12.92 : Math.pow((gs + 0.055) / 1.055, 2.4);
const rb = bs <= 0.03928 ? bs / 12.92 : Math.pow((bs + 0.055) / 1.055, 2.4);
return rr * 0.2126 + rg * 0.7152 + rb * 0.0722;
}
}
/**
* Helper functions where the source type is "rgba" (number: 0xrrggbbaa).
*/
export namespace rgba {
export function blend(bg: number, fg: number): number {
$a = (fg & 0xFF) / 0xFF;
if ($a === 1) {
return fg;
}
const fgR = (fg >> 24) & 0xFF;
const fgG = (fg >> 16) & 0xFF;
const fgB = (fg >> 8) & 0xFF;
const bgR = (bg >> 24) & 0xFF;
const bgG = (bg >> 16) & 0xFF;
const bgB = (bg >> 8) & 0xFF;
$r = bgR + Math.round((fgR - bgR) * $a);
$g = bgG + Math.round((fgG - bgG) * $a);
$b = bgB + Math.round((fgB - bgB) * $a);
return channels.toRgba($r, $g, $b);
}
/**
* Given a foreground color and a background color, either increase or reduce the luminance of the
* foreground color until the specified contrast ratio is met. If pure white or black is hit
* without the contrast ratio being met, go the other direction using the background color as the
* foreground color and take either the first or second result depending on which has the higher
* contrast ratio.
*
* `undefined` will be returned if the contrast ratio is already met.
*
* @param bgRgba The background color in rgba format.
* @param fgRgba The foreground color in rgba format.
* @param ratio The contrast ratio to achieve.
*/
export function ensureContrastRatio(bgRgba: number, fgRgba: number, ratio: number): number | undefined {
const bgL = rgb.relativeLuminance(bgRgba >> 8);
const fgL = rgb.relativeLuminance(fgRgba >> 8);
const cr = contrastRatio(bgL, fgL);
if (cr < ratio) {
if (fgL < bgL) {
const resultA = reduceLuminance(bgRgba, fgRgba, ratio);
const resultARatio = contrastRatio(bgL, rgb.relativeLuminance(resultA >> 8));
if (resultARatio < ratio) {
const resultB = increaseLuminance(bgRgba, fgRgba, ratio);
const resultBRatio = contrastRatio(bgL, rgb.relativeLuminance(resultB >> 8));
return resultARatio > resultBRatio ? resultA : resultB;
}
return resultA;
}
const resultA = increaseLuminance(bgRgba, fgRgba, ratio);
const resultARatio = contrastRatio(bgL, rgb.relativeLuminance(resultA >> 8));
if (resultARatio < ratio) {
const resultB = reduceLuminance(bgRgba, fgRgba, ratio);
const resultBRatio = contrastRatio(bgL, rgb.relativeLuminance(resultB >> 8));
return resultARatio > resultBRatio ? resultA : resultB;
}
return resultA;
}
return undefined;
}
export function reduceLuminance(bgRgba: number, fgRgba: number, ratio: number): number {
// This is a naive but fast approach to reducing luminance as converting to
// HSL and back is expensive
const bgR = (bgRgba >> 24) & 0xFF;
const bgG = (bgRgba >> 16) & 0xFF;
const bgB = (bgRgba >> 8) & 0xFF;
let fgR = (fgRgba >> 24) & 0xFF;
let fgG = (fgRgba >> 16) & 0xFF;
let fgB = (fgRgba >> 8) & 0xFF;
let cr = contrastRatio(rgb.relativeLuminance2(fgR, fgG, fgB), rgb.relativeLuminance2(bgR, bgG, bgB));
while (cr < ratio && (fgR > 0 || fgG > 0 || fgB > 0)) {
// Reduce by 10% until the ratio is hit
fgR -= Math.max(0, Math.ceil(fgR * 0.1));
fgG -= Math.max(0, Math.ceil(fgG * 0.1));
fgB -= Math.max(0, Math.ceil(fgB * 0.1));
cr = contrastRatio(rgb.relativeLuminance2(fgR, fgG, fgB), rgb.relativeLuminance2(bgR, bgG, bgB));
}
return (fgR << 24 | fgG << 16 | fgB << 8 | 0xFF) >>> 0;
}
export function increaseLuminance(bgRgba: number, fgRgba: number, ratio: number): number {
// This is a naive but fast approach to increasing luminance as converting to
// HSL and back is expensive
const bgR = (bgRgba >> 24) & 0xFF;
const bgG = (bgRgba >> 16) & 0xFF;
const bgB = (bgRgba >> 8) & 0xFF;
let fgR = (fgRgba >> 24) & 0xFF;
let fgG = (fgRgba >> 16) & 0xFF;
let fgB = (fgRgba >> 8) & 0xFF;
let cr = contrastRatio(rgb.relativeLuminance2(fgR, fgG, fgB), rgb.relativeLuminance2(bgR, bgG, bgB));
while (cr < ratio && (fgR < 0xFF || fgG < 0xFF || fgB < 0xFF)) {
// Increase by 10% until the ratio is hit
fgR = Math.min(0xFF, fgR + Math.ceil((255 - fgR) * 0.1));
fgG = Math.min(0xFF, fgG + Math.ceil((255 - fgG) * 0.1));
fgB = Math.min(0xFF, fgB + Math.ceil((255 - fgB) * 0.1));
cr = contrastRatio(rgb.relativeLuminance2(fgR, fgG, fgB), rgb.relativeLuminance2(bgR, bgG, bgB));
}
return (fgR << 24 | fgG << 16 | fgB << 8 | 0xFF) >>> 0;
}
export function toChannels(value: number): [number, number, number, number] {
return [(value >> 24) & 0xFF, (value >> 16) & 0xFF, (value >> 8) & 0xFF, value & 0xFF];
}
}
export function toPaddedHex(c: number): string {
const s = c.toString(16);
return s.length < 2 ? '0' + s : s;
}
/**
* Gets the contrast ratio between two relative luminance values.
* @param l1 The first relative luminance.
* @param l2 The first relative luminance.
* @see https://www.w3.org/TR/WCAG20/#contrast-ratiodef
*/
export function contrastRatio(l1: number, l2: number): number {
if (l1 < l2) {
return (l2 + 0.05) / (l1 + 0.05);
}
return (l1 + 0.05) / (l2 + 0.05);
}
@@ -0,0 +1,35 @@
let Prefixer = require('./prefixer')
class AtRule extends Prefixer {
/**
* Clone and add prefixes for at-rule
*/
add(rule, prefix) {
let prefixed = prefix + rule.name
let already = rule.parent.some(
i => i.name === prefixed && i.params === rule.params
)
if (already) {
return undefined
}
let cloned = this.clone(rule, { name: prefixed })
return rule.parent.insertBefore(rule, cloned)
}
/**
* Clone node with prefixes
*/
process(node) {
let parent = this.parentPrefix(node)
for (let prefix of this.prefixes) {
if (!parent || parent === prefix) {
this.add(node, prefix)
}
}
}
}
module.exports = AtRule
@@ -0,0 +1,44 @@
/**
* common.js: Internal helper and utility functions for winston.
*
* (C) 2010 Charlie Robbins
* MIT LICENCE
*/
'use strict';
var _require = require('util'),
format = _require.format;
/**
* Set of simple deprecation notices and a way to expose them for a set of
* properties.
* @type {Object}
* @private
*/
exports.warn = {
deprecated: function deprecated(prop) {
return function () {
throw new Error(format('{ %s } was removed in winston@3.0.0.', prop));
};
},
useFormat: function useFormat(prop) {
return function () {
throw new Error([format('{ %s } was removed in winston@3.0.0.', prop), 'Use a custom winston.format = winston.format(function) instead.'].join('\n'));
};
},
forFunctions: function forFunctions(obj, type, props) {
props.forEach(function (prop) {
obj[prop] = exports.warn[type](prop);
});
},
forProperties: function forProperties(obj, type, props) {
props.forEach(function (prop) {
var notice = exports.warn[type](prop);
Object.defineProperty(obj, prop, {
get: notice,
set: notice
});
});
}
};
@@ -0,0 +1 @@
{"name":"@babel/helper-plugin-utils","version":"7.27.1","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532117735,"integrity":"sha512-KYRMN3MVTuiy5XkFDHd5PnQmHaQnt3z16nsBDePxZ9YNmq7IFlslpBBlR3UI+zvlbEemzowOYeKil9a0ZkOYxQ==","mode":420,"size":1106},"README.md":{"checkedAt":1794532117735,"integrity":"sha512-BVu2tHPD5DiZL54Aie7ih5vJWqZiz784cX0hgk6z3HDrB5rlrpJGY/pKc+N38sQ7Lrl6qigiLJmIiXdshWNo9Q==","mode":420,"size":332},"lib/index.js":{"checkedAt":1794532117735,"integrity":"sha512-5u/FqjqXPi4P6scPTRfAn3SaDUc2mQEd0R8lKGKcwdJMnDb34WAAa8sWtRZ9lH83lvzw+F9c1TI7/Ta6G8eC5g==","mode":420,"size":2557},"lib/index.js.map":{"checkedAt":1794532117735,"integrity":"sha512-1EOlyHI5rjM9S83FqiIbTv5OidUeW1eOokQEpzAFOu6sYF9C9qZmjHwALT0llKd8h3nRT+LxgNht4+XRgn6f9A==","mode":420,"size":7209},"package.json":{"checkedAt":1794532117735,"integrity":"sha512-mp4/iMzCgo4AmQcFXMVCvmz7ibYX6oh4pNkVx/al+vj/66lweiv8KaOypgP0OZ73UW+5SbBPqBc/qajmd7WUtQ==","mode":420,"size":614}}}
@@ -0,0 +1,53 @@
var inspect = require('../');
var test = require('tape');
test('element', function (t) {
t.plan(3);
var elem = {
nodeName: 'div',
attributes: [{ name: 'class', value: 'row' }],
getAttribute: function (key) { return key; },
childNodes: []
};
var obj = [1, elem, 3];
t.deepEqual(inspect(obj), '[ 1, <div class="row"></div>, 3 ]');
t.deepEqual(inspect(obj, { quoteStyle: 'single' }), "[ 1, <div class='row'></div>, 3 ]");
t.deepEqual(inspect(obj, { quoteStyle: 'double' }), '[ 1, <div class="row"></div>, 3 ]');
});
test('element no attr', function (t) {
t.plan(1);
var elem = {
nodeName: 'div',
getAttribute: function (key) { return key; },
childNodes: []
};
var obj = [1, elem, 3];
t.deepEqual(inspect(obj), '[ 1, <div></div>, 3 ]');
});
test('element with contents', function (t) {
t.plan(1);
var elem = {
nodeName: 'div',
getAttribute: function (key) { return key; },
childNodes: [{ nodeName: 'b' }]
};
var obj = [1, elem, 3];
t.deepEqual(inspect(obj), '[ 1, <div>...</div>, 3 ]');
});
test('element instance', function (t) {
t.plan(1);
var h = global.HTMLElement;
global.HTMLElement = function (name, attr) {
this.nodeName = name;
this.attributes = attr;
};
global.HTMLElement.prototype.getAttribute = function () {};
var elem = new global.HTMLElement('div', []);
var obj = [1, elem, 3];
t.deepEqual(inspect(obj), '[ 1, <div></div>, 3 ]');
global.HTMLElement = h;
});
@@ -0,0 +1,615 @@
flf2a$ 6 4 20 0 2
invita.flf 06/94 pk6811s@acad.drake.edu
alas, the computer has better handwriting than I do
@
$$@
$$ @
$$ @
$$ @
$$ @@
/$$@
$/$ @
/ @
$o$ @
@
@@
@
//$@
@
$ @
@
@@
@
-/--/-$@
-/--/-$ @
@
@
@@
__/_ @
( / )$@
\ $ @
(__/_)$ @
/ @
@@
@
()/$$@
/ @
$/()$ @
@
@@
__ $@
( )$@
,\ $ @
(__\_ @
($@
@@
@
/ $@
@
$ @
@
@@
$ .-$@
$ / $ @
$ / $ @
$ / $ @
$ (__ $ @
@@
$-. $@
$ / $ @
$ / $ @
$ / $ @
$_./ $ @
@@
@
@
$_\/_$@
$ /\ $@
@
@@
@
$ @
$_|_$@
$ | $@
@
@@
$@
$@
$@
$ $@
$/ @
@@
@
$ $@
__ $@
$ $ @
$ $ @
@@
$@
@
@
$o $@
@
@@
$@
$ /$@
/ @
$/ $ @
$ @
@@
__ $@
/ )$@
/ / $@
(__ / $ @
@
@@
_ $@
/ / $@
/ $@
/ $ @
/ @
@@
_ $@
' )$@
,--' $@
/___ $ @
$@
@@
_ $@
' )$@
-( $@
(__ )$ @
@
@@
_ $@
/ /$@
/___/_$@
/ $@
/ @
@@
___$@
/ $@
/__ $@
____)$ @
@
@@
$__$@
/ $@
/__ $@
(__ )$ @
@
@@
___ $@
/ / $@
/ $@
/ $ @
/ @
@@
___ $@
( )$@
.--' $@
(___)$ @
@
@@
__ $@
/ )$@
(__,/ $@
/ $ @
/ @
@@
@
$@
$'$ @
$'$ @
@
@@
@
@
$o$ @
$ $ @
$/$ @
@@
@
/$$@
$<$$$@
\$$@
@
@@
$@
$__$@
$__$@
$@
@
@@
@
\ @
$>$$@
/ @
@
@@
___ $@
( )$@
/ $ @
o $ @
@
@@
_ $@
/ )$@
/ () $@
\____/$@
@
@@
_____ $ @
(, / |$ @
/---|$ @
) / |_ @
(_/ @
@@
______ $ @
(, / )$@
/---( $ @
) / ____) @
(_/ ( @
@@
) ___ $ @
(__/_____)$@
/ $ @
/ @
(______)$ @
@@
______ $ @
(, / )$@
/ / @
_/___ /_ @
(_/___ / @
@@
_____)$@
/ $ @
)__ $ @
/ @
(_____)$ @
@@
________)$@
(, / $ @
/___,$ @
) / $ @
(_/ @
@@
_____)$@
/ $ @
/ ___ $ @
/ / )$ @
(____ / $ @
@@
____ ___)$@
(, / / $ @
/---/$ @
) / (__ @
(_/ @
@@
_____$@
(, / $ @
/$ @
___/__ @
(__ / $ @
@@
_____$@
(, / $ @
/$ @
___/__ @
/ / $ @
(__ / $ @@
__ __)$@
(, ) / $ @
/( $ @
) / \_ @
(_/ @
@@
_ $ @
$___/__)$ @
(, / $ @
/ $ @
(_____$ @
) @@
__ __)$@
(, /| /|$ @
/ | / |$ @
) / |/ |_ @
(_/ ' $ @
@@
__ __)$@
(, /| / $ @
/ | / $ @
) / |/ $ @
(_/ ' $ @
@@
___ $@
/(, )$@
/ /$ @
/ /$ @
(___ /$ @
@@
_____ $ @
(, / )$@
_/__ /$ @
/ $ @
) / $ @
(_/ @@
____ $ @
(, )$@
/$ @
____ /$ @
(____ ( @
) @@
_____ $ @
(, / )$@
/__ /$ @
) / \_ @
(_/ @
@@
__ $@
(__/ )$@
/$ @
) /$ @
(_/$ @
@@
______)$@
(, / $ @
/ $ @
$ ) / $ @
$(_/ $ @
@@
__ __)$@
(, / / $ @
/ /$ @
/ /$ @
(___(_ @
@@
__ __)$@
(, ) / $ @
| /$ @
|/$ @
|$ @
@@
__ __)$@
(, ) | / $ @
| /| /$ @
|/ |/$ @
/ |$ @
@@
__ __)$ @
(, |/ $ @
| $ @
) /|_ @
(_/ $ @
@@
__ __)$@
(, ) / $ @
/ /$ @
(___/_ @
) / $ @
(__ / $ @@
___$ @
(, )$@
/$ @
_/_ @
) / @
(__ / @@
$ _ $@
$ / $ @
$ / $ @
$ / $ @
$ /_ $ @
@@
$ @
$\ $ @
\ @
$ \$@
$@
@@
$ _ $@
$ / $ @
$ / $ @
$ / $ @
$ _/ $ @
@@
_ @
$/ \$@
@
$ $@
@
@@
@
@
@
@
_@
@@
@
$$$\$$$@
@
$ $ @
@
@@
@
@
_$ @
(_(_@
@
@@
@
/)$@
(/_ @
/_)$ @
@
@@
@
@
_$@
(__@
@
@@
@
/)$@
_(/$ @
(_(_ @
@
@@
@
@
$_$@
_(/_@
@
@@
@
/)$@
//$ @
/(_ @
/) @
(/ @@
@
@
_ $@
(_/_@
.-/ @
(_/ @@
@
/)$@
(/ $@
/ )_@
@
@@
@
,$@
$ @
_(_ @
@
@@
@
$,$@
$ @
$/_ @
.-/ @
(_/ @@
@
/)$@
(/_$@
/(__@
@
@@
@
/)$@
//$ @
(/_ @
@
@@
@
@
___$ @
// (_@
@
@@
@
@
__$ @
/ (_@
@
@@
@
@
___@
(_) @
@
@@
@
@
__ $@
/_)_@
.-/ @
(_/ @@
@
@
_ $@
(_/_@
/( @
(_) @@
@
@
__$@
/ (_@
@
@@
@
@
$_ $@
/_)_@
@
@@
@
@
_/_ @
(__ @
@
@@
@
@
$@
(_(_@
@
@@
@
@
_ _ @
(/__@
@
@@
@
@
_ _@
(_(/$@
@
@@
@
@
__/$$@
$/(__@
/ @
@@
@
@
$ $@
(_/_@
.-/ @
(_/ @@
@
@
_ $@
'_)_@
.-/ @
(_/ @@
$ .-$@
$ / $ @
$ - $ @
$ / $ @
$ (__ $ @
@@
$ $@
$ | $@
$ | $@
$ | $@
@
@@
$-. $@
$ / $ @
$ - $ @
$ / $ @
$_./ $ @
@@
_ _$@
$' `-' @
@
$ $ @
@
@@
___'_'$ @
(, / |$ @
/---|$ @
) / |_ @
(_/ @
@@
'__'$@
/(, )$@
/ /$ @
/ /$ @
(___ /$ @
@@
__ ' '__)$@
(, / / $ @
/ /$ @
/ /$ @
(___(_ @
@@
@
. .@
_ @
(_(_@
@
@@
@
. .@
___@
(_) @
@
@@
@
. .@
$@
(_(_@
@
@@
______ $ @
(, // )$@
//--( $ @
) //____) @
(_// @
@@
@@ -0,0 +1,190 @@
/**
* @fileoverview Rule to disallow loops with a body that allows only one iteration
* @author Milos Djermanovic
*/
"use strict";
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
const allLoopTypes = [
"WhileStatement",
"DoWhileStatement",
"ForStatement",
"ForInStatement",
"ForOfStatement",
];
/**
* Checks all segments in a set and returns true if any are reachable.
* @param {Set<CodePathSegment>} segments The segments to check.
* @returns {boolean} True if any segment is reachable; false otherwise.
*/
function isAnySegmentReachable(segments) {
for (const segment of segments) {
if (segment.reachable) {
return true;
}
}
return false;
}
/**
* Determines whether the given node is the first node in the code path to which a loop statement
* 'loops' for the next iteration.
* @param {ASTNode} node The node to check.
* @returns {boolean} `true` if the node is a looping target.
*/
function isLoopingTarget(node) {
const parent = node.parent;
if (parent) {
switch (parent.type) {
case "WhileStatement":
return node === parent.test;
case "DoWhileStatement":
return node === parent.body;
case "ForStatement":
return node === (parent.update || parent.test || parent.body);
case "ForInStatement":
case "ForOfStatement":
return node === parent.left;
// no default
}
}
return false;
}
/**
* Creates an array with elements from the first given array that are not included in the second given array.
* @param {Array} arrA The array to compare from.
* @param {Array} arrB The array to compare against.
* @returns {Array} a new array that represents `arrA \ arrB`.
*/
function getDifference(arrA, arrB) {
return arrA.filter(a => !arrB.includes(a));
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
defaultOptions: [{ ignore: [] }],
docs: {
description:
"Disallow loops with a body that allows only one iteration",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-unreachable-loop",
},
schema: [
{
type: "object",
properties: {
ignore: {
type: "array",
items: {
enum: allLoopTypes,
},
uniqueItems: true,
},
},
additionalProperties: false,
},
],
messages: {
invalid: "Invalid loop. Its body allows only one iteration.",
},
},
create(context) {
const [{ ignore: ignoredLoopTypes }] = context.options;
const loopTypesToCheck = getDifference(allLoopTypes, ignoredLoopTypes),
loopSelector = loopTypesToCheck.join(","),
loopsByTargetSegments = new Map(),
loopsToReport = new Set();
const codePathSegments = [];
let currentCodePathSegments = new Set();
return {
onCodePathStart() {
codePathSegments.push(currentCodePathSegments);
currentCodePathSegments = new Set();
},
onCodePathEnd() {
currentCodePathSegments = codePathSegments.pop();
},
onUnreachableCodePathSegmentStart(segment) {
currentCodePathSegments.add(segment);
},
onUnreachableCodePathSegmentEnd(segment) {
currentCodePathSegments.delete(segment);
},
onCodePathSegmentEnd(segment) {
currentCodePathSegments.delete(segment);
},
onCodePathSegmentStart(segment, node) {
currentCodePathSegments.add(segment);
if (isLoopingTarget(node)) {
const loop = node.parent;
loopsByTargetSegments.set(segment, loop);
}
},
onCodePathSegmentLoop(_, toSegment, node) {
const loop = loopsByTargetSegments.get(toSegment);
/**
* The second iteration is reachable, meaning that the loop is valid by the logic of this rule,
* only if there is at least one loop event with the appropriate target (which has been already
* determined in the `loopsByTargetSegments` map), raised from either:
*
* - the end of the loop's body (in which case `node === loop`)
* - a `continue` statement
*
* This condition skips loop events raised from `ForInStatement > .right` and `ForOfStatement > .right` nodes.
*/
if (node === loop || node.type === "ContinueStatement") {
// Removes loop if it exists in the set. Otherwise, `Set#delete` has no effect and doesn't throw.
loopsToReport.delete(loop);
}
},
[loopSelector](node) {
/**
* Ignore unreachable loop statements to avoid unnecessary complexity in the implementation, or false positives otherwise.
* For unreachable segments, the code path analysis does not raise events required for this implementation.
*/
if (isAnySegmentReachable(currentCodePathSegments)) {
loopsToReport.add(node);
}
},
"Program:exit"() {
loopsToReport.forEach(node =>
context.report({ node, messageId: "invalid" }),
);
},
};
},
};
@@ -0,0 +1,79 @@
import { GeneralCallResult, InstanceContext, NapCatCore } from '../../napcat-core';
import { createFlashTransferResult, FileListResponse, FlashFileSetInfo, SendStatus } from '../data/flash';
import { Peer } from '../types';
export declare class NTQQFlashApi {
context: InstanceContext;
core: NapCatCore;
constructor(context: InstanceContext, core: NapCatCore);
/**
* 发起闪传上传任务
* @param fileListToUpload 上传文件绝对路径的列表,可以是文件夹!!
* @param thumbnailPath
* @param filesetName
*/
createFlashTransferUploadTask(fileListToUpload: string[], thumbnailPath: string, filesetName: string): Promise<GeneralCallResult & {
createFlashTransferResult: createFlashTransferResult;
seq: number;
}>;
/**
* 下载闪传文件集
* @param fileSetId
*/
downloadFileSetBySetId(fileSetId: string): Promise<GeneralCallResult & {
extraInfo: unknown;
}>;
/**
* 获取闪传的外链分享
* @param fileSetId
*/
getShareLinkBySetId(fileSetId: string): Promise<GeneralCallResult & {
shareLink: string;
expireTimestamp: string;
}>;
/**
* 从分享外链获取文件集id
* @param shareCode
*/
fromShareLinkFindSetId(shareCode: string): Promise<GeneralCallResult & {
fileSetId: string;
}>;
/**
* 获取fileSet的文件结构信息 (未来可能需要深度遍历)
* == 注意返回结构和其它的不同,没有GeneralCallResult!!! ==
* @param fileSetId
*/
getFileListBySetId(fileSetId: string): Promise<FileListResponse>;
/**
* 获取闪传文件集合信息
* @param fileSetId
*/
getFileSetIndoBySetId(fileSetId: string): Promise<GeneralCallResult & {
seq: number;
isCache: boolean;
fileSet: FlashFileSetInfo;
}>;
/**
* 发送闪传消息(私聊/群聊)
* @param fileSetId
* @param peer
*/
sendFlashMessage(fileSetId: string, peer: Peer): Promise<{
errCode: number;
errMsg: string;
rsp: {
sendStatus: SendStatus[];
};
}>;
/**
* 获取闪传文件集中某个文件的下载URL(外链)
* @param fileSetId
* @param options
*/
getFileTransUrl(fileSetId: string, options: {
fileName?: string;
fileIndex?: number;
}): Promise<GeneralCallResult & {
transferUrl: string;
}>;
createFileThumbnail(filePath: string): Promise<any>;
}
@@ -0,0 +1,39 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
const {
definePrototypeMethodHandler,
} = require("../util/define-prototype-method-handler")
module.exports = {
meta: {
docs: {
description: "disallow the `Array.prototype.findIndex` method.",
category: "ES2015",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-array-prototype-findindex.html",
},
fixable: null,
messages: {
forbidden: "ES2015 '{{name}}' method is forbidden.",
},
schema: [
{
type: "object",
properties: {
aggressive: { type: "boolean" },
},
additionalProperties: false,
},
],
type: "problem",
},
create(context) {
return definePrototypeMethodHandler(context, {
Array: ["findIndex"],
})
},
}
@@ -0,0 +1,900 @@
export default `flf2a$ 4 3 14 0 10 0 1920
SmShadow by Glenn Chappell 4/93 -- based on Small
Includes ISO Latin-1
figlet release 2.1 -- 12 Aug 1994
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
Modified by Paul Burton <solution@earthlink.net> 12/96 to include new parameter
supported by FIGlet and FIGWin. May also be slightly modified for better use
of new full-width/kern/smush alternatives, but default output is NOT changed.
$$@
$$@
$$@
$$@@
|$@
_|$@
_)$@
@@
| )$@
V V$ @
@
@@
| |$ @
_ |_ |_|$@
_ |_ |_|$@
_| _|$ @@
|$ @
(_-<$@
_ _/$@
_|$ @@
_) /$ @
/$ @
_/ _)$@
@@
_|$ @
_| _|$@
\\____|$ @
@@
)$@
/$ @
@
@@
/$@
|$ @
|$ @
\\_\\$@@
\\ \\$ @
|$@
|$@
_/$ @@
\\ \\ /$ @
_ _|$@
_/ _\\$ @
@@
|$ @
__ __|$@
_|$ @
@@
@
@
)$@
/$ @@
@
____|$@
@
@@
@
@
_)$@
@@
/$@
/$ @
_/$ @
@@
\\$ @
( |$@
\\__/$ @
@@
_ |$@
|$@
_|$@
@@
_ )$@
/$ @
___|$@
@@
__ /$@
_ \\$@
___/$@
@@
| |$ @
__ _|$@
_|$ @
@@
__|$@
__ \\$@
___/$@
@@
/$ @
_ \\$@
\\___/$@
@@
__ /$@
/$ @
_/$ @
@@
_ )$@
_ \\$@
\\___/$@
@@
_ \\$@
\\_ /$@
_/$ @
@@
_)$@
@
_)$@
@@
_)$@
@
)$@
/$ @@
/$@
< <$ @
\\_\\$@
@@
@
____|$@
____|$@
@@
\\ \\$ @
> >$@
_/$ @
@@
__ \\$@
_/$@
_)$ @
@@
__ \\$ @
/ _\` |$@
\\__,_|$@
\\____/$ @@
\\$ @
_ \\$ @
_/ _\\$@
@@
_ )$@
_ \\$@
___/$@
@@
__|$@
($ @
\\___|$@
@@
_ \\$ @
| |$@
___/$ @
@@
__|$@
_|$ @
___|$@
@@
__|$@
_|$ @
_|$ @
@@
__|$@
(_ |$@
\\___|$@
@@
| |$@
__ |$@
_| _|$@
@@
_ _|$@
|$ @
___|$@
@@
|$@
\\ |$@
\\__/$ @
@@
| /$@
. <$ @
_|\\_\\$@
@@
|$ @
|$ @
____|$@
@@
\\ |$@
|\\/ |$@
_| _|$@
@@
\\ |$@
. |$@
_|\\_|$@
@@
_ \\$ @
( |$@
\\___/$ @
@@
_ \\$@
__/$@
_|$ @
@@
_ \\$ @
( |$@
\\__\\_\\$@
@@
_ \\$@
/$@
_|_\\$@
@@
__|$@
\\__ \\$@
____/$@
@@
__ __|$@
|$ @
_|$ @
@@
| |$@
| |$@
\\__/$ @
@@
\\ \\ /$@
\\ \\ /$ @
\\_/$ @
@@
\\ \\ /$@
\\ \\ \\ /$ @
\\_/\\_/$ @
@@
\\ \\ /$@
> <$ @
_/\\_\\$@
@@
\\ \\ /$@
\\ /$ @
_|$ @
@@
__ /$@
/$ @
____|$@
@@
_|$@
|$ @
|$ @
__|$@@
\\ \\$ @
\\ \\$ @
\\_\\$@
@@
_ |$@
|$@
|$@
__|$@@
\\$ @
/\\|$@
@
@@
@
@
@
____|$@@
)$@
\\|$@
@
@@
@
_\` |$@
\\__,_|$@
@@
|$ @
_ \\$@
_.__/$@
@@
@
_|$@
\\__|$@
@@
|$@
_\` |$@
\\__,_|$@
@@
@
-_)$@
\\___|$@
@@
_|$@
_|$@
_|$ @
@@
@
_\` |$@
\\__, |$@
____/$ @@
|$ @
\\$ @
_| _|$@
@@
_)$@
|$@
_|$@
@@
_)$@
|$@
|$@
__/$ @@
|$ @
| /$@
_\\_\\$@
@@
|$@
|$@
_|$@
@@
@
\` \\$ @
_|_|_|$@
@@
@
\\$ @
_| _|$@
@@
@
_ \\$@
\\___/$@
@@
@
_ \\$@
.__/$@
_|$ @@
@
_\` |$@
\\__, |$@
_|$@@
@
_|$@
_|$ @
@@
@
(_-<$@
___/$@
@@
|$ @
_|$@
\\__|$@
@@
@
| |$@
\\_,_|$@
@@
@
\\ \\ /$@
\\_/$ @
@@
@
\\ \\ \\ /$@
\\_/\\_/$ @
@@
@
\\ \\ /$@
_\\_\\$@
@@
@
| |$@
\\_, |$@
___/$ @@
@
_ /$@
___|$@
@@
/$@
_ |$ @
|$ @
\\_\\$@@
|$@
|$@
|$@
_|$@@
\\ \\$ @
|_$@
|$ @
_/$ @@
\\ |$@
/\\/$ @
@
@@
_) \\_)$@
_ \\$ @
/ _\\$@
@@
_) _)$@
__ \\$@
\\____/$@
@@
_) _)$@
| |$@
\\__/$ @
@@
_) _)$@
_\` |$@
\\__,_|$@
@@
_) _)$@
_ \\$@
\\___/$@
@@
_) _)$@
| |$@
\\_,_|$@
@@
_ \\$@
|< <$@
|__/$@
_|$ @@
160 NO-BREAK SPACE
$$@
$$@
$$@
$$@@
161 INVERTED EXCLAMATION MARK
_)$@
|$@
_|$@
@@
162 CENT SIGN
|$ @
_)$@
\\ _)$@
|$ @@
163 POUND SIGN
_\\$ @
_ _|$ @
_,___|$@
@@
164 CURRENCY SIGN
\\ . /$@
_ \\$@
\\/ /$@
@@
165 YEN SIGN
\\ \\ /$ @
__ __|$@
__ __|$@
_|$ @@
166 BROKEN BAR
|$@
_|$@
|$@
_|$@@
167 SECTION SIGN
_)$@
\\ \\$ @
\\ \\/$ @
__/$ @@
168 DIAERESIS
_) _)$@
@
@
@@
169 COPYRIGHT SIGN
\\$ @
_| \\$@
\\ \\__| /$@
\\____/$ @@
170 FEMININE ORDINAL INDICATOR
_\` |$@
\\__,_|$@
_____|$@
@@
171 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
/ /$@
< < <$ @
\\_\\_\\$@
@@
172 NOT SIGN
____ |$@
_|$@
@
@@
173 SOFT HYPHEN
@
___|$@
@
@@
174 REGISTERED SIGN
\\$ @
-) \\$@
\\ |\\\\ /$@
\\____/$ @@
175 MACRON
___|$@
@
@
@@
176 DEGREE SIGN
.\\$@
\\_/$@
@
@@
177 PLUS-MINUS SIGN
|$ @
_ _|$@
_|$ @
_____|$@@
178 SUPERSCRIPT TWO
_ )$@
__|$@
@
@@
179 SUPERSCRIPT THREE
_ /$@
__)$@
@
@@
180 ACUTE ACCENT
_/$@
@
@
@@
181 MICRO SIGN
@
| |$@
.,_|$@
_|$ @@
182 PILCROW SIGN
|$@
\\_ | |$@
_|_|$@
@@
183 MIDDLE DOT
@
_)$@
@
@@
184 CEDILLA
@
@
@
_)$@@
185 SUPERSCRIPT ONE
_ |$@
_|$@
@
@@
186 MASCULINE ORDINAL INDICATOR
_ \\$@
\\___/$@
____|$@
@@
187 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
\\ \\ \\$ @
> > >$@
_/_/$ @
@@
188 VULGAR FRACTION ONE QUARTER
_ | /$ @
_| /_' |$@
_/ _|$@
@@
189 VULGAR FRACTION ONE HALF
_ | /$ @
_| /_ )$@
_/ __|$@
@@
190 VULGAR FRACTION THREE QUARTERS
_ / /$ @
__) /_' |$@
_/ _|$@
@@
191 INVERTED QUESTION MARK
_)$ @
/$ @
\\___|$@
@@
192 LATIN CAPITAL LETTER A WITH GRAVE
\\_\\$ @
--\\$ @
_/\\_\\$@
@@
193 LATIN CAPITAL LETTER A WITH ACUTE
_/$ @
--\\$ @
_/\\_\\$@
@@
194 LATIN CAPITAL LETTER A WITH CIRCUMFLEX
/\\\\$ @
--\\$ @
_/\\_\\$@
@@
195 LATIN CAPITAL LETTER A WITH TILDE
/ _/$ @
--\\$ @
_/\\_\\$@
@@
196 LATIN CAPITAL LETTER A WITH DIAERESIS
_) \\_)$@
_ \\$ @
/ _\\$@
@@
197 LATIN CAPITAL LETTER A WITH RING ABOVE
( )$ @
_ \\$ @
_/ _\\$@
@@
198 LATIN CAPITAL LETTER AE
, __|$@
_ _|$ @
_/ ___|$@
@@
199 LATIN CAPITAL LETTER C WITH CEDILLA
|$@
($ @
\\___|$@
_)$ @@
200 LATIN CAPITAL LETTER E WITH GRAVE
\\_\\$@
-<$@
__<$@
@@
201 LATIN CAPITAL LETTER E WITH ACUTE
_/$@
-<$@
__<$@
@@
202 LATIN CAPITAL LETTER E WITH CIRCUMFLEX
/\\\\$@
-<$@
__<$@
@@
203 LATIN CAPITAL LETTER E WITH DIAERESIS
_) _)$@
-<$ @
__<$ @
@@
204 LATIN CAPITAL LETTER I WITH GRAVE
\\_\\$ @
_ _|$@
___|$@
@@
205 LATIN CAPITAL LETTER I WITH ACUTE
_/$ @
_ _|$@
___|$@
@@
206 LATIN CAPITAL LETTER I WITH CIRCUMFLEX
/\\\\$ @
_ _|$@
___|$@
@@
207 LATIN CAPITAL LETTER I WITH DIAERESIS
_) _)$@
_ _|$ @
___|$ @
@@
208 LATIN CAPITAL LETTER ETH
_ \\$ @
_ _| |$@
___/$ @
@@
209 LATIN CAPITAL LETTER N WITH TILDE
/ _/$@
\\ |$@
_|\\_|$@
@@
210 LATIN CAPITAL LETTER O WITH GRAVE
\\_\\$ @
__ \\$@
\\____/$@
@@
211 LATIN CAPITAL LETTER O WITH ACUTE
_/$ @
__ \\$@
\\____/$@
@@
212 LATIN CAPITAL LETTER O WITH CIRCUMFLEX
/\\\\$ @
__ \\$@
\\____/$@
@@
213 LATIN CAPITAL LETTER O WITH TILDE
/ _/$ @
__ \\$@
\\____/$@
@@
214 LATIN CAPITAL LETTER O WITH DIAERESIS
_) _)$@
__ \\$@
\\____/$@
@@
215 MULTIPLICATION SIGN
\\ \\$@
, '$@
\\/\\/$@
@@
216 LATIN CAPITAL LETTER O WITH STROKE
_ /\\$ @
( / |$@
\\_/__/$ @
@@
217 LATIN CAPITAL LETTER U WITH GRAVE
\\_\\$ @
| |$@
\\__/$ @
@@
218 LATIN CAPITAL LETTER U WITH ACUTE
_/$ @
| |$@
\\__/$ @
@@
219 LATIN CAPITAL LETTER U WITH CIRCUMFLEX
/\\\\$ @
| |$@
\\__/$ @
@@
220 LATIN CAPITAL LETTER U WITH DIAERESIS
_) _)$@
| |$@
\\__/$ @
@@
221 LATIN CAPITAL LETTER Y WITH ACUTE
_/$ @
\\ \\ /$@
_|$ @
@@
222 LATIN CAPITAL LETTER THORN
|$ @
-_)$@
_|$ @
@@
223 LATIN SMALL LETTER SHARP S
_ \\$@
|< <$@
|__/$@
_|$ @@
224 LATIN SMALL LETTER A WITH GRAVE
\\_\\$ @
_\` |$@
\\__,_|$@
@@
225 LATIN SMALL LETTER A WITH ACUTE
_/$ @
_\` |$@
\\__,_|$@
@@
226 LATIN SMALL LETTER A WITH CIRCUMFLEX
/\\\\$ @
_\` |$@
\\__,_|$@
@@
227 LATIN SMALL LETTER A WITH TILDE
/ _/$ @
_\` |$@
\\__,_|$@
@@
228 LATIN SMALL LETTER A WITH DIAERESIS
_) _)$@
_\` |$@
\\__,_|$@
@@
229 LATIN SMALL LETTER A WITH RING ABOVE
( )$ @
_\` |$@
\\__,_|$@
@@
230 LATIN SMALL LETTER AE
@
_\` -_)$@
\\__,___|$@
@@
231 LATIN SMALL LETTER C WITH CEDILLA
@
_|$@
\\__|$@
_)$@@
232 LATIN SMALL LETTER E WITH GRAVE
\\_\\$ @
-_)$@
\\___|$@
@@
233 LATIN SMALL LETTER E WITH ACUTE
_/$ @
-_)$@
\\___|$@
@@
234 LATIN SMALL LETTER E WITH CIRCUMFLEX
/\\\\$ @
-_)$@
\\___|$@
@@
235 LATIN SMALL LETTER E WITH DIAERESIS
_) _)$@
-_)$ @
\\___|$ @
@@
236 LATIN SMALL LETTER I WITH GRAVE
\\_\\$@
|$@
_|$@
@@
237 LATIN SMALL LETTER I WITH ACUTE
_/$@
|$@
_|$@
@@
238 LATIN SMALL LETTER I WITH CIRCUMFLEX
/\\\\$@
|$ @
_|$ @
@@
239 LATIN SMALL LETTER I WITH DIAERESIS
_) _)$@
|$ @
_|$ @
@@
240 LATIN SMALL LETTER ETH
, \\'$@
_\` |$@
\\___/$ @
@@
241 LATIN SMALL LETTER N WITH TILDE
/ _/$ @
' \\$ @
_| _|$@
@@
242 LATIN SMALL LETTER O WITH GRAVE
\\_\\$ @
_ \\$@
\\___/$@
@@
243 LATIN SMALL LETTER O WITH ACUTE
_/$ @
_ \\$@
\\___/$@
@@
244 LATIN SMALL LETTER O WITH CIRCUMFLEX
/\\\\$ @
_ \\$@
\\___/$@
@@
245 LATIN SMALL LETTER O WITH TILDE
/ _/$@
_ \\$@
\\___/$@
@@
246 LATIN SMALL LETTER O WITH DIAERESIS
_) _)$@
_ \\$@
\\___/$@
@@
247 DIVISION SIGN
_)$ @
___|$@
_)$ @
@@
248 LATIN SMALL LETTER O WITH STROKE
@
/\\$@
\\_/_/$@
@@
249 LATIN SMALL LETTER U WITH GRAVE
\\_\\$ @
| |$@
\\_,_|$@
@@
250 LATIN SMALL LETTER U WITH ACUTE
_/$ @
| |$@
\\_,_|$@
@@
251 LATIN SMALL LETTER U WITH CIRCUMFLEX
/\\\\$ @
| |$@
\\_,_|$@
@@
252 LATIN SMALL LETTER U WITH DIAERESIS
_) _)$@
| |$@
\\_,_|$@
@@
253 LATIN SMALL LETTER Y WITH ACUTE
_/$ @
| |$@
\\_, |$@
___/$ @@
254 LATIN SMALL LETTER THORN
|$ @
'_ \\$@
.__/$@
_|$ @@
255 LATIN SMALL LETTER Y WITH DIAERESIS
_) _)$@
| |$@
\\_, |$@
___/$ @@
`
@@ -0,0 +1,96 @@
import { __read, __values } from "tslib";
import { useEffect, useState } from 'react';
import isBrowser from '../utils/isBrowser';
var subscribers = new Set();
var info;
var responsiveConfig = {
xs: 0,
sm: 576,
md: 768,
lg: 992,
xl: 1200,
};
function handleResize() {
var e_1, _a;
var oldInfo = info;
calculate();
if (oldInfo === info) {
return;
}
try {
for (var subscribers_1 = __values(subscribers), subscribers_1_1 = subscribers_1.next(); !subscribers_1_1.done; subscribers_1_1 = subscribers_1.next()) {
var subscriber = subscribers_1_1.value;
subscriber();
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (subscribers_1_1 && !subscribers_1_1.done && (_a = subscribers_1.return)) _a.call(subscribers_1);
}
finally { if (e_1) throw e_1.error; }
}
}
var listening = false;
function calculate() {
var e_2, _a;
var width = window.innerWidth;
var newInfo = {};
var shouldUpdate = false;
try {
for (var _b = __values(Object.keys(responsiveConfig)), _c = _b.next(); !_c.done; _c = _b.next()) {
var key = _c.value;
newInfo[key] = width >= responsiveConfig[key];
if (newInfo[key] !== info[key]) {
shouldUpdate = true;
}
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_2) throw e_2.error; }
}
if (shouldUpdate) {
info = newInfo;
}
}
export function configResponsive(config) {
responsiveConfig = config;
if (info)
calculate();
}
function useResponsive() {
if (isBrowser && !listening) {
info = {};
calculate();
window.addEventListener('resize', handleResize);
listening = true;
}
var _a = __read(useState(info), 2), state = _a[0], setState = _a[1];
useEffect(function () {
if (!isBrowser) {
return;
}
// In React 18's StrictMode, useEffect perform twice, resize listener is remove, so handleResize is never perform.
// https://github.com/alibaba/hooks/issues/1910
if (!listening) {
window.addEventListener('resize', handleResize);
}
var subscriber = function () {
setState(info);
};
subscribers.add(subscriber);
return function () {
subscribers.delete(subscriber);
if (subscribers.size === 0) {
window.removeEventListener('resize', handleResize);
listening = false;
}
};
}, []);
return state;
}
export default useResponsive;
@@ -0,0 +1,64 @@
/**
* @import {Effects, State, TokenType} from 'micromark-util-types'
*/
import { markdownSpace } from 'micromark-util-character';
// To do: implement `spaceOrTab`, `spaceOrTabMinMax`, `spaceOrTabWithOptions`.
/**
* Parse spaces and tabs.
*
* There is no `nok` parameter:
*
* * spaces in markdown are often optional, in which case this factory can be
* used and `ok` will be switched to whether spaces were found or not
* * one line ending or space can be detected with `markdownSpace(code)` right
* before using `factorySpace`
*
* ###### Examples
*
* Where `␉` represents a tab (plus how much it expands) and `␠` represents a
* single space.
*
* ```markdown
* ␉
* ␠␠␠␠
* ␉␠
* ```
*
* @param {Effects} effects
* Context.
* @param {State} ok
* State switched to when successful.
* @param {TokenType} type
* Type (`' \t'`).
* @param {number | undefined} [max=Infinity]
* Max (exclusive).
* @returns {State}
* Start state.
*/
export function factorySpace(effects, ok, type, max) {
const limit = max ? max - 1 : Number.POSITIVE_INFINITY;
let size = 0;
return start;
/** @type {State} */
function start(code) {
if (markdownSpace(code)) {
effects.enter(type);
return prefix(code);
}
return ok(code);
}
/** @type {State} */
function prefix(code) {
if (markdownSpace(code) && size++ < limit) {
effects.consume(code);
return prefix;
}
effects.exit(type);
return ok(code);
}
}
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,kEAAkE;AAClE,2DAA2D;AAC3D,yDAAyD;AACzD,kHAAkH;;;AAkB3G,SAAS,0CAAmB,KAA2B;IAC5D,IAAI,OAAC,GAAG,qBAAE,iBAAiB,cAAE,UAAU,0BAAE,sBAAsB,EAAC,GAAG;IACnE,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAE;QACpB,eAAe;QACf,2BAA2B;IAC7B;IAEA,IAAI,gBAAgB,CAAA,GAAA,oCAAa,EAAE,CAAC;QAClC,IAAI,qBAAqB,mCAAa,GAAG,MAAM;YAC7C,IAAI,wBACF,uBAAuB;YAEzB,SAAS,OAAO,CAAC,aAAa,GAAG;QACnC;IACF;IAEA,IAAI,yBAAyB,CAAA,GAAA,oCAAa,EAAE,CAAC;QAC3C,IAAI,mBACF,kBAAkB;IAEtB;IAEA,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,QAAQ,SAAS,OAAO;QAC5B,IAAI,YACF;QAGF,MAAM,UAAU,IAAI,OAAO;QAC3B,MAAM,iBAAiB,CAAA,GAAA,sCAAe,EAAE;QAExC,mFAAmF;QACnF,IAAI,OAAO,iBAAiB,aAAa;YACvC,IAAI,cAAc,CAAC;gBACjB,IAAI,MAAM,aAAa,IAAI,mCAAa,GAAG,MACzC,uBAAuB;gBAEzB,MAAM,aAAa,GAAG;YACxB;YAEA,iDAAiD;YACjD,eAAe,gBAAgB,CAAC,eAAe,eAAe;YAC9D,eAAe,gBAAgB,CAAC,aAAa,aAAa;YAE1D,OAAO;gBACL,eAAe,mBAAmB,CAAC,eAAe,eAAe;gBACjE,eAAe,mBAAmB,CAAC,aAAa,aAAa;YAC/D;QACF,OAAO;YACL,IAAI,YAAY,CAAC;gBACf,IAAI,MAAM,yBAAyB,EACjC,MAAM,yBAAyB,GAAG;qBAC7B,IAAI,MAAM,aAAa,IAAI,mCAAa,GAAG,MAChD,uBAAuB;gBAEzB,MAAM,aAAa,GAAG;YACxB;YAEA,IAAI,aAAa,CAAC;gBAChB,MAAM,yBAAyB,GAAG;gBAClC,IAAI,MAAM,aAAa,IAAI,mCAAa,GAAG,MACzC,uBAAuB;gBAEzB,MAAM,aAAa,GAAG;YACxB;YAEA,eAAe,gBAAgB,CAAC,aAAa,eAAe;YAC5D,eAAe,gBAAgB,CAAC,WAAW,WAAW;YACtD,eAAe,gBAAgB,CAAC,cAAc,eAAe;YAC7D,eAAe,gBAAgB,CAAC,YAAY,YAAY;YAExD,OAAO;gBACL,eAAe,mBAAmB,CAAC,aAAa,eAAe;gBAC/D,eAAe,mBAAmB,CAAC,WAAW,WAAW;gBACzD,eAAe,mBAAmB,CAAC,cAAc,eAAe;gBAChE,eAAe,mBAAmB,CAAC,YAAY,YAAY;YAC7D;QACF;IACF,GAAG;QAAC;QAAK;QAAY;QAAe;KAAuB;AAC7D;AAEA,SAAS,mCAAa,KAAK,EAAE,GAAG;IAC9B,IAAI,MAAM,MAAM,GAAG,GACjB,OAAO;IAGT,IAAI,MAAM,MAAM,EAAE;QAChB,2DAA2D;QAC3D,MAAM,gBAAgB,MAAM,MAAM,CAAC,aAAa;QAChD,IAAI,CAAC,iBAAiB,CAAC,cAAc,eAAe,CAAC,QAAQ,CAAC,MAAM,MAAM,GACxE,OAAO;QAGT,qEAAqE;QACrE,IAAI,MAAM,MAAM,CAAC,OAAO,CAAC,gCACvB,OAAO;IAEX;IAEA,OAAO,IAAI,OAAO,IAAI,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,MAAM;AAC1D","sources":["packages/@react-aria/interactions/src/useInteractOutside.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from react.\n// Original licensing for the following can be found in the\n// NOTICE file in the root directory of this source tree.\n// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions\n\nimport {getOwnerDocument, useEffectEvent} from '@react-aria/utils';\nimport {RefObject} from '@react-types/shared';\nimport {useEffect, useRef} from 'react';\n\nexport interface InteractOutsideProps {\n ref: RefObject<Element | null>,\n onInteractOutside?: (e: PointerEvent) => void,\n onInteractOutsideStart?: (e: PointerEvent) => void,\n /** Whether the interact outside events should be disabled. */\n isDisabled?: boolean\n}\n\n/**\n * Example, used in components like Dialogs and Popovers so they can close\n * when a user clicks outside them.\n */\nexport function useInteractOutside(props: InteractOutsideProps) {\n let {ref, onInteractOutside, isDisabled, onInteractOutsideStart} = props;\n let stateRef = useRef({\n isPointerDown: false,\n ignoreEmulatedMouseEvents: false\n });\n\n let onPointerDown = useEffectEvent((e) => {\n if (onInteractOutside && isValidEvent(e, ref)) {\n if (onInteractOutsideStart) {\n onInteractOutsideStart(e);\n }\n stateRef.current.isPointerDown = true;\n }\n });\n\n let triggerInteractOutside = useEffectEvent((e: PointerEvent) => {\n if (onInteractOutside) {\n onInteractOutside(e);\n }\n });\n\n useEffect(() => {\n let state = stateRef.current;\n if (isDisabled) {\n return;\n }\n\n const element = ref.current;\n const documentObject = getOwnerDocument(element);\n\n // Use pointer events if available. Otherwise, fall back to mouse and touch events.\n if (typeof PointerEvent !== 'undefined') {\n let onPointerUp = (e) => {\n if (state.isPointerDown && isValidEvent(e, ref)) {\n triggerInteractOutside(e);\n }\n state.isPointerDown = false;\n };\n\n // changing these to capture phase fixed combobox\n documentObject.addEventListener('pointerdown', onPointerDown, true);\n documentObject.addEventListener('pointerup', onPointerUp, true);\n\n return () => {\n documentObject.removeEventListener('pointerdown', onPointerDown, true);\n documentObject.removeEventListener('pointerup', onPointerUp, Line truncated
@@ -0,0 +1,40 @@
import { OneBotAction } from '../../action/OneBotAction';
import { Static } from '@sinclair/typebox';
declare const PayloadSchema: import("@sinclair/typebox").TObject<{
group_id: import("@sinclair/typebox").TString;
}>;
type PayloadType = Static<typeof PayloadSchema>;
declare const ReturnSchema: import("@sinclair/typebox").TObject<{
can_at_all: import("@sinclair/typebox").TBoolean;
remain_at_all_count_for_group: import("@sinclair/typebox").TNumber;
remain_at_all_count_for_uin: import("@sinclair/typebox").TNumber;
}>;
type ReturnType = Static<typeof ReturnSchema>;
export declare class GoCQHTTPGetGroupAtAllRemain extends OneBotAction<PayloadType, ReturnType> {
actionName: "get_group_at_all_remain";
payloadSchema: import("@sinclair/typebox").TObject<{
group_id: import("@sinclair/typebox").TString;
}>;
returnSchema: import("@sinclair/typebox").TObject<{
can_at_all: import("@sinclair/typebox").TBoolean;
remain_at_all_count_for_group: import("@sinclair/typebox").TNumber;
remain_at_all_count_for_uin: import("@sinclair/typebox").TNumber;
}>;
actionSummary: string;
actionDescription: string;
actionTags: string[];
payloadExample: {
group_id: string;
};
returnExample: {
can_at_all: boolean;
remain_at_all_count_for_group: number;
remain_at_all_count_for_self: number;
};
_handle(payload: PayloadType): Promise<{
can_at_all: boolean;
remain_at_all_count_for_group: number;
remain_at_all_count_for_uin: number;
}>;
}
export {};
@@ -0,0 +1 @@
{"mappings":";;AAAA;;;;;;;;;;CAUC;AASD,MAAM,uCAAiB,OAAO,aAAa,eAAe,OAAO,cAAc;AAE/E,sEAAsE;AACtE,MAAM,0CAAoB,IAAI,IAAI;IAChC;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAED,mIAAmI;AACnI,IAAI,2CAAqB;AACzB,IAAI;AAOG,SAAS,0CAAiB,UAAgC,CAAC,CAAC;IACjE,IAAI,cAAC,UAAU,EAAC,GAAG;IAEnB,CAAA,GAAA,sBAAc,EAAE;QACd,IAAI,YACF;QAGF;QACA,IAAI,6CAAuB;YACzB,IAAI,CAAA,GAAA,YAAI,KACN,gCAAU;iBAEV,gCAAU;;QAId,OAAO;YACL;YACA,IAAI,6CAAuB,GACzB;QAEJ;IACF,GAAG;QAAC;KAAW;AACjB;AAEA,0FAA0F;AAC1F,mFAAmF;AACnF,SAAS;IACP,OAAO,CAAA,GAAA,YAAI,EACT,+BAAS,SAAS,eAAe,EAAE,gBAAgB,GAAG,OAAO,UAAU,GAAG,SAAS,eAAe,CAAC,WAAW,CAAC,EAAE,CAAC,GAClH,+BAAS,SAAS,eAAe,EAAE,YAAY;AAEnD;AAEA,wEAAwE;AACxE,gDAAgD;AAChD,EAAE;AACF,8FAA8F;AAC9F,sGAAsG;AACtG,mCAAmC;AACnC,6GAA6G;AAC7G,2EAA2E;AAC3E,4GAA4G;AAC5G,sGAAsG;AACtG,EAAE;AACF,oGAAoG;AACpG,EAAE;AACF,+GAA+G;AAC/G,oBAAoB;AACpB,4GAA4G;AAC5G,+GAA+G;AAC/G,mDAAmD;AACnD,uGAAuG;AACvG,qGAAqG;AACrG,4GAA4G;AAC5G,4DAA4D;AAC5D,kHAAkH;AAClH,0GAA0G;AAC1G,oFAAoF;AACpF,gHAAgH;AAChH,oFAAoF;AACpF,SAAS;IACP,IAAI;IACJ,IAAI;IACJ,IAAI,eAAe,CAAC;QAClB,sFAAsF;QACtF,aAAa,CAAA,GAAA,sBAAc,EAAE,EAAE,MAAM,EAAa;QAClD,IAAI,eAAe,SAAS,eAAe,IAAI,eAAe,SAAS,IAAI,EACzE;QAGF,6EAA6E;QAC7E,4EAA4E;QAC5E,sBAAsB;QACtB,IAAI,sBAAsB,eAAe,OAAO,gBAAgB,CAAC,YAAY,kBAAkB,KAAK,QAClG,0BAA0B,+BAAS,YAAY,sBAAsB;IAEzE;IAEA,IAAI,cAAc,CAAC;QACjB,gCAAgC;QAChC,IAAI,CAAC,cAAc,eAAe,SAAS,eAAe,IAAI,eAAe,SAAS,IAAI,EAAE;YAC1F,EAAE,cAAc;YAChB;QACF;QAEA,6EAA6E;QAC7E,2FAA2F;QAC3F,iFAAiF;QACjF,gFAAgF;QAChF,oFAAoF;QACpF,sDAAsD;QACtD,IAAI,WAAW,YAAY,KAAK,WAAW,YAAY,IAAI,WAAW,WAAW,KAAK,WAAW,WAAW,EAC1G,EAAE,cAAc;IAEpB;IAEA,IAAI,aAAa,CAAC;QAChB,IAAI,SAAS,EAAE,MAAM;QAErB,uEAAuE;QACvE,IAAI,uCAAiB,WAAW,WAAW,SAAS,aAAa,EAAE;YACjE,EAAE,cAAc;YAChB;YAEA,sFAAsF;YACtF,oFAAoF;YACpF,+EAA+E;YAC/E,OAAO,KAAK,CAAC,SAAS,GAAG;YACzB,OAAO,KAAK;YACZ,sBAAsB;gBACpB,OAAO,KAAK,CAAC,SAAS,GAAG;YAC3B;QACF;QAEA,IAAI,yBACF;IAEJ;IAEA,IAAI,UAAU,CAAC;QACb,IAAI,SAAS,EAAE,MAAM;QACrB,IAAI,uCAAiB,SAAS;YAC5B;YAEA,mFAAmF;YACnF,iFAAiF;YACjF,wFAAwF;YACxF,+FAA+F;YAC/F,OAAO,KAAK,CAAC,SAAS,GAAG;YACzB,sBAAsB;gBACpB,OAAO,KAAK,CAAC,SAAS,GAAG;gBAEzB,qFAAqF;gBACrF,wFAAwF;gBACxF,IAAI;oBACF,IAAI,qCAAe,MAAM,GAAG,OAAO,WAAW,EAC5C,yEAAyE;oBACzE,2CAA2C;oBAC3C,sBAAsB;wBACpB,qCAAe;oBACjB;yBAEA,+EAA+E;oBAC/E,6CAA6C;oBAC7C,qCAAe,gBAAgB,CAAC,UAAU,IAAM,qCAAe,SAAS;wBAAC,MAAM;oBAAI;;YAGzF;QACF;IACF;IAEA,IAAI,gBAAqC;IACzC,IAAI,cAAc;QAChB,IAAI,eACF;QAGF,IAAI,iBAAiB;YACnB,kEAAkE;YAClE,2FAA2F;YAC3F,OAAO,QAAQ,CAAC,GAAG;QACrB;QAEA,4DAA4D;QAC5D,0FAA0F;QAC1F,6FAA6F;QAC7F,IAAI,UAAU,OAAO,WAAW;QAChC,IAAI,UAAU,OAAO,WAAW;QAEhC,gBAAgB,CAAA,GAAA,YAAI,EAClB,+BAAS,QAAQ,UAAU,iBAC3B,+BAAS,SAAS,eAAe,EAAE,gBAAgB,GAAG,OAAO,UAAU,GAAG,SAAS,eAAe,CAAC,WAAW,CAAC,EAAE,CAAC,GAClH,+BAAS,SAAS,eAAe,EAAE,YAAY,WAC/C,+BAAS,SAAS,IAAI,EAAE,aAAa,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,GACpD;YACE,OAAO,QAAQ,CAAC,SAAS;QAC3B;QAGF,qFAAqF;QACrF,OAAO,QAAQ,CAAC,GAAG;IACrB;IAEA,IAAI,eAAe,CAAA,GAAA,YAAI,EACrB,+BAAS,UAAU,cAAc,cAAc;QAAC,SAAS;QAAO,SAAS;IAAI,IAC7E,+BAAS,UAAU,aAAa,aAAa;QAAC,SAAS;QAAO,SAAS;IAAI,IAC3E,+BAAS,UAAU,YAAY,YAAY;QAAC,SAAS;QAAO,SAAS;IAAI,IACzE,+BAAS,UAAU,SAAS,SAAS;IAGvC,OAAO;QACL,2DAA2D;QAC3D,oCAAA,8CAAA;QACA,0BAAA,oCAAA;QACA;IACF;AACF;AAEA,gGAAgG;AAChG,SAAS,+BAAS,OAAoB,EAAE,KAAa,EAAE,KAAa;IAClE,IAAI,MAAM,QAAQ,KAAK,CAAC,MAAM;IAC9B,QAAQ,KAAK,CAAC,MAAM,GAAG;IAEvB,OAAO;QACL,QAAQ,KAAK,CAAC,MAAM,GAAG;IACzB;AACF;AAEA,6EAA6E;AAC7E,SAAS,+BACP,MAAyB,EACzB,KAAQ,EACR,OAA6E,EAC7E,OAA2C;IAE3C,0EAA0E;IAC1E,aAAa;IACb,OAAO,gBAAgB,CAAC,OAAO,SAAS;IACxC,OAAO;QACL,aAAa;QACb,OAAO,mBAAmB,CAAC,OAAO,SAAS;IAC7C;AACF;AAEA,SAAS,qCAAe,MAAe;IACrC,IAAI,OAAO,SAAS,gBAAgB,IAAI,SAAS,eAAe;IAChE,IAAI,aAA6B;IACjC,MAAO,cAAc,eAAe,KAAM;QACxC,0GAA0G;QAC1G,IAAI,aAAa,CAAA,GAAA,sBAAc,EAAE;QACjC,IAAI,eAAe,SAAS,eAAe,IAAI,eAAe,SAAS,IAAI,IAAI,eAAe,YAAY;YACxG,IAAI,gBAAgB,WAAW,qBAAqB,GAAG,GAAG;YAC1D,IAAI,YAAY,WAAW,qBAAqB,GAAG,GAAG;YACtD,IAAI,YAAY,gBAAgB,WAAW,YAAY,EACrD,WAAW,SAAS,IAAI,YAAY;QAExC;QAEA,aAAa,WAAW,aAAa;IACvC;AACF;AAEA,SAAS,uCAAiB,MAAe;IACvC,OACE,AAAC,kBAAkB,oBAAoB,CAAC,wCAAkB,GAAG,CAAC,OAAO,IAAI,KACzE,kBAAkB,uBACjB,kBAAkB,eAAe,OAAO,iBAAiB;AAE9D","sources":["packages/@react-aria/overlays/src/usePreventScroll.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {chain, getScrollParent, isIOS, useLayoutEffect} from '@react-aria/utils';\n\ninterface PreventScrollOptions {\n /** Whether the scroll lock is disabled. */\n isDisabled?: boolean\n}\n\nconst visualViewport = typeof document !== 'undefined' && window.visualViewportLine truncated
@@ -0,0 +1,7 @@
import type { BasicTarget } from '../utils/domTarget';
type Size = {
width: number;
height: number;
};
declare function useSize(target: BasicTarget): Size | undefined;
export default useSize;
@@ -0,0 +1,421 @@
/**
* @fileoverview Enforce curly braces or disallow unnecessary curly brace in JSX
* @author Jacky Ho
* @author Simon Lydell
*/
'use strict';
const arrayIncludes = require('array-includes');
const docsUrl = require('../util/docsUrl');
const jsxUtil = require('../util/jsx');
const report = require('../util/report');
const eslintUtil = require('../util/eslint');
const getSourceCode = eslintUtil.getSourceCode;
const getText = eslintUtil.getText;
// ------------------------------------------------------------------------------
// Constants
// ------------------------------------------------------------------------------
const OPTION_ALWAYS = 'always';
const OPTION_NEVER = 'never';
const OPTION_IGNORE = 'ignore';
const OPTION_VALUES = [
OPTION_ALWAYS,
OPTION_NEVER,
OPTION_IGNORE,
];
const DEFAULT_CONFIG = { props: OPTION_NEVER, children: OPTION_NEVER, propElementValues: OPTION_IGNORE };
const HTML_ENTITY_REGEX = () => /&[A-Za-z\d#]+;/g;
function containsLineTerminators(rawStringValue) {
return /[\n\r\u2028\u2029]/.test(rawStringValue);
}
function containsBackslash(rawStringValue) {
return arrayIncludes(rawStringValue, '\\');
}
function containsHTMLEntity(rawStringValue) {
return HTML_ENTITY_REGEX().test(rawStringValue);
}
function containsOnlyHtmlEntities(rawStringValue) {
return rawStringValue.replace(HTML_ENTITY_REGEX(), '').trim() === '';
}
function containsDisallowedJSXTextChars(rawStringValue) {
return /[{<>}]/.test(rawStringValue);
}
function containsQuoteCharacters(value) {
return /['"]/.test(value);
}
function containsMultilineComment(value) {
return /\/\*/.test(value);
}
function escapeDoubleQuotes(rawStringValue) {
return rawStringValue.replace(/\\"/g, '"').replace(/"/g, '\\"');
}
function escapeBackslashes(rawStringValue) {
return rawStringValue.replace(/\\/g, '\\\\');
}
function needToEscapeCharacterForJSX(raw, node) {
return (
containsBackslash(raw)
|| containsHTMLEntity(raw)
|| (node.parent.type !== 'JSXAttribute' && containsDisallowedJSXTextChars(raw))
);
}
function containsWhitespaceExpression(child) {
if (child.type === 'JSXExpressionContainer') {
const value = child.expression.value;
return value ? jsxUtil.isWhiteSpaces(value) : false;
}
return false;
}
function isLineBreak(text) {
return containsLineTerminators(text) && text.trim() === '';
}
function wrapNonHTMLEntities(text) {
const HTML_ENTITY = '<HTML_ENTITY>';
const withCurlyBraces = text.split(HTML_ENTITY_REGEX()).map((word) => (
word === '' ? '' : `{${JSON.stringify(word)}}`
)).join(HTML_ENTITY);
const htmlEntities = text.match(HTML_ENTITY_REGEX());
return htmlEntities.reduce((acc, htmlEntity) => (
acc.replace(HTML_ENTITY, htmlEntity)
), withCurlyBraces);
}
function wrapWithCurlyBraces(rawText) {
if (!containsLineTerminators(rawText)) {
return `{${JSON.stringify(rawText)}}`;
}
return rawText.split('\n').map((line) => {
if (line.trim() === '') {
return line;
}
const firstCharIndex = line.search(/[^\s]/);
const leftWhitespace = line.slice(0, firstCharIndex);
const text = line.slice(firstCharIndex);
if (containsHTMLEntity(line)) {
return `${leftWhitespace}${wrapNonHTMLEntities(text)}`;
}
return `${leftWhitespace}{${JSON.stringify(text)}}`;
}).join('\n');
}
function isWhiteSpaceLiteral(node) {
return node.type && node.type === 'Literal' && node.value && jsxUtil.isWhiteSpaces(node.value);
}
function isStringWithTrailingWhiteSpaces(value) {
return /^\s|\s$/.test(value);
}
function isLiteralWithTrailingWhiteSpaces(node) {
return node.type && node.type === 'Literal' && node.value && isStringWithTrailingWhiteSpaces(node.value);
}
// ------------------------------------------------------------------------------
// Rule Definition
// ------------------------------------------------------------------------------
const messages = {
unnecessaryCurly: 'Curly braces are unnecessary here.',
missingCurly: 'Need to wrap this literal in a JSX expression.',
};
/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
docs: {
description: 'Disallow unnecessary JSX expressions when literals alone are sufficient or enforce JSX expressions on literals in JSX children or attributes',
category: 'Stylistic Issues',
recommended: false,
url: docsUrl('jsx-curly-brace-presence'),
},
fixable: 'code',
messages,
schema: [
{
anyOf: [
{
type: 'object',
properties: {
props: { enum: OPTION_VALUES },
children: { enum: OPTION_VALUES },
propElementValues: { enum: OPTION_VALUES },
},
additionalProperties: false,
},
{
enum: OPTION_VALUES,
},
],
},
],
},
create(context) {
const ruleOptions = context.options[0];
const userConfig = typeof ruleOptions === 'string'
? { props: ruleOptions, children: ruleOptions, propElementValues: OPTION_IGNORE }
: Object.assign({}, DEFAULT_CONFIG, ruleOptions);
/**
* Report and fix an unnecessary curly brace violation on a node
* @param {ASTNode} JSXExpressionNode - The AST node with an unnecessary JSX expression
*/
function reportUnnecessaryCurly(JSXExpressionNode) {
report(context, messages.unnecessaryCurly, 'unnecessaryCurly', {
node: JSXExpressionNode,
fix(fixer) {
const expression = JSXExpressionNode.expression;
let textToReplace;
if (jsxUtil.isJSX(expression)) {
textToReplace = getText(context, expression);
} else {
const expressionType = expression && expression.type;
const parentType = JSXExpressionNode.parent.type;
if (parentType === 'JSXAttribute') {
if (expressionType !== 'TemplateLiteral' && /["]/.test(expression.raw.slice(1, -1))) {
textToReplace = expression.raw;
} else {
textToReplace = `"${expressionType === 'TemplateLiteral'
? expression.quasis[0].value.raw
: expression.raw.slice(1, -1)
}"`;
}
} else if (jsxUtil.isJSX(expression)) {
textToReplace = getText(context, expression);
} else {
textToReplace = expressionType === 'TemplateLiteral'
? expression.quasis[0].value.cooked : expression.value;
}
}
return fixer.replaceText(JSXExpressionNode, textToReplace);
},
});
}
function reportMissingCurly(literalNode) {
report(context, messages.missingCurly, 'missingCurly', {
node: literalNode,
fix(fixer) {
if (jsxUtil.isJSX(literalNode)) {
return fixer.replaceText(literalNode, `{${getText(context, literalNode)}}`);
}
// If a HTML entity name is found, bail out because it can be fixed
// by either using the real character or the unicode equivalent.
// If it contains any line terminator character, bail out as well.
if (
containsOnlyHtmlEntities(literalNode.raw)
|| (literalNode.parent.type === 'JSXAttribute' && containsLineTerminators(literalNode.raw))
|| isLineBreak(literalNode.raw)
) {
return null;
}
const expression = literalNode.parent.type === 'JSXAttribute'
? `{"${escapeDoubleQuotes(escapeBackslashes(
literalNode.raw.slice(1, -1)
))}"}`
: wrapWithCurlyBraces(literalNode.raw);
return fixer.replaceText(literalNode, expression);
},
});
}
// Bail out if there is any character that needs to be escaped in JSX
// because escaping decreases readability and the original code may be more
// readable anyway or intentional for other specific reasons
function lintUnnecessaryCurly(JSXExpressionNode) {
const expression = JSXExpressionNode.expression;
const expressionType = expression.type;
const sourceCode = getSourceCode(context);
// Curly braces containing comments are necessary
if (sourceCode.getCommentsInside && sourceCode.getCommentsInside(JSXExpressionNode).length > 0) {
return;
}
if (
(expressionType === 'Literal' || expressionType === 'JSXText')
&& typeof expression.value === 'string'
&& (
(JSXExpressionNode.parent.type === 'JSXAttribute' && !isWhiteSpaceLiteral(expression))
|| !isLiteralWithTrailingWhiteSpaces(expression)
)
&& !containsMultilineComment(expression.value)
&& !needToEscapeCharacterForJSX(expression.raw, JSXExpressionNode) && (
jsxUtil.isJSX(JSXExpressionNode.parent)
|| (!containsQuoteCharacters(expression.value) || typeof expression.value === 'string')
)
) {
reportUnnecessaryCurly(JSXExpressionNode);
} else if (
expressionType === 'TemplateLiteral'
&& expression.expressions.length === 0
&& expression.quasis[0].value.raw.indexOf('\n') === -1
&& !isStringWithTrailingWhiteSpaces(expression.quasis[0].value.raw)
&& !needToEscapeCharacterForJSX(expression.quasis[0].value.raw, JSXExpressionNode)
&& !containsQuoteCharacters(expression.quasis[0].value.cooked)
) {
reportUnnecessaryCurly(JSXExpressionNode);
} else if (jsxUtil.isJSX(expression)) {
reportUnnecessaryCurly(JSXExpressionNode);
}
}
function areRuleConditionsSatisfied(parent, config, ruleCondition) {
return (
parent.type === 'JSXAttribute'
&& typeof config.props === 'string'
&& config.props === ruleCondition
) || (
jsxUtil.isJSX(parent)
&& typeof config.children === 'string'
&& config.children === ruleCondition
);
}
function getAdjacentSiblings(node, children) {
for (let i = 1; i < children.length - 1; i++) {
const child = children[i];
if (node === child) {
return [children[i - 1], children[i + 1]];
}
}
if (node === children[0] && children[1]) {
return [children[1]];
}
if (node === children[children.length - 1] && children[children.length - 2]) {
return [children[children.length - 2]];
}
return [];
}
function hasAdjacentJsxExpressionContainers(node, children) {
if (!children) {
return false;
}
const childrenExcludingWhitespaceLiteral = children.filter((child) => !isWhiteSpaceLiteral(child));
const adjSiblings = getAdjacentSiblings(node, childrenExcludingWhitespaceLiteral);
return adjSiblings.some((x) => x.type && x.type === 'JSXExpressionContainer');
}
function hasAdjacentJsx(node, children) {
if (!children) {
return false;
}
const childrenExcludingWhitespaceLiteral = children.filter((child) => !isWhiteSpaceLiteral(child));
const adjSiblings = getAdjacentSiblings(node, childrenExcludingWhitespaceLiteral);
return adjSiblings.some((x) => x.type && arrayIncludes(['JSXExpressionContainer', 'JSXElement'], x.type));
}
function shouldCheckForUnnecessaryCurly(node, config) {
const parent = node.parent;
// Bail out if the parent is a JSXAttribute & its contents aren't
// StringLiteral or TemplateLiteral since e.g
// <App prop1={<CustomEl />} prop2={<CustomEl>...</CustomEl>} />
if (
parent.type && parent.type === 'JSXAttribute'
&& (node.expression && node.expression.type
&& node.expression.type !== 'Literal'
&& node.expression.type !== 'StringLiteral'
&& node.expression.type !== 'TemplateLiteral')
) {
return false;
}
// If there are adjacent `JsxExpressionContainer` then there is no need,
// to check for unnecessary curly braces.
if (jsxUtil.isJSX(parent) && hasAdjacentJsxExpressionContainers(node, parent.children)) {
return false;
}
if (containsWhitespaceExpression(node) && hasAdjacentJsx(node, parent.children)) {
return false;
}
if (
parent.children
&& parent.children.length === 1
&& containsWhitespaceExpression(node)
) {
return false;
}
return areRuleConditionsSatisfied(parent, config, OPTION_NEVER);
}
function shouldCheckForMissingCurly(node, config) {
if (jsxUtil.isJSX(node)) {
return config.propElementValues !== OPTION_IGNORE;
}
if (
isLineBreak(node.raw)
|| containsOnlyHtmlEntities(node.raw)
) {
return false;
}
const parent = node.parent;
if (
parent.children
&& parent.children.length === 1
&& containsWhitespaceExpression(parent.children[0])
) {
return false;
}
return areRuleConditionsSatisfied(parent, config, OPTION_ALWAYS);
}
// --------------------------------------------------------------------------
// Public
// --------------------------------------------------------------------------
return {
'JSXAttribute > JSXExpressionContainer > JSXElement'(node) {
if (userConfig.propElementValues === OPTION_NEVER) {
reportUnnecessaryCurly(node.parent);
}
},
JSXExpressionContainer(node) {
if (shouldCheckForUnnecessaryCurly(node, userConfig)) {
lintUnnecessaryCurly(node);
}
},
'JSXAttribute > JSXElement, Literal, JSXText'(node) {
if (shouldCheckForMissingCurly(node, userConfig)) {
reportMissingCurly(node);
}
},
};
},
};
@@ -0,0 +1,40 @@
var baseRest = require('./_baseRest'),
toInteger = require('./toInteger');
/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';
/**
* Creates a function that invokes `func` with the `this` binding of the
* created function and arguments from `start` and beyond provided as
* an array.
*
* **Note:** This method is based on the
* [rest parameter](https://mdn.io/rest_parameters).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Function
* @param {Function} func The function to apply a rest parameter to.
* @param {number} [start=func.length-1] The start position of the rest parameter.
* @returns {Function} Returns the new function.
* @example
*
* var say = _.rest(function(what, names) {
* return what + ' ' + _.initial(names).join(', ') +
* (_.size(names) > 1 ? ', & ' : '') + _.last(names);
* });
*
* say('hello', 'fred', 'barney', 'pebbles');
* // => 'hello fred, barney, & pebbles'
*/
function rest(func, start) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
start = start === undefined ? start : toInteger(start);
return baseRest(func, start);
}
module.exports = rest;
@@ -0,0 +1 @@
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAMD,SAAS,2BAAQ,KAAmB;IAClC,OAAO;AACT;AAEA,2BAAK,iBAAiB,GAAG,UAAU,kBAAqB,KAAmB,EAAE,OAAY;IACvF,IAAI,cAAC,UAAU,SAAE,KAAK,YAAE,QAAQ,EAAC,GAAG;IAEpC,IAAI,WAAW,MAAM,KAAK,IAAI,MAAM,QAAQ;IAC5C,IAAI,YAAY,MAAM,SAAS,IAAK,CAAA,OAAO,aAAa,WAAW,WAAW,EAAC,KAAM,KAAK,CAAC,aAAa,IAAI;IAE5G,qGAAqG;IACrG,IAAI,CAAC,aAAa,EAAC,oBAAA,8BAAA,QAAS,wBAAwB,KAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAC/E,QAAQ,IAAI,CAAC;IAGf,MAAM;QACJ,MAAM;QACN,OAAO;kBACP;mBACA;QACA,cAAc,KAAK,CAAC,aAAa;QACjC,eAAe,oCAAc;QAC7B,CAAC;YACC,IAAI,YACF,KAAK,IAAI,SAAS,WAChB,MAAM;gBACJ,MAAM;gBACN,OAAO;YACT;iBAEG,IAAI,OAAO;gBAChB,IAAI,QAA0B,EAAE;gBAChC,CAAA,GAAA,YAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAA;oBAC/B,MAAM,IAAI,CAAC;wBACT,MAAM;wBACN,SAAS;oBACX;gBACF;gBAEA,OAAO;YACT;QACF;IACF;AACF;AAEA,SAAS,oCAAiB,KAAmB;IAC3C,IAAI,MAAM,aAAa,IAAI,MACzB,OAAO,MAAM,aAAa;IAG5B,IAAI,MAAM,UAAU,EAClB,OAAO;IAGT,IAAI,MAAM,KAAK,IAAI,CAAA,GAAA,YAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,QAAQ,IAAI,GACxD,OAAO;IAGT,OAAO;AACT;AAEA,oEAAoE;AACpE,IAAI,4CAAQ","sources":["packages/@react-stately/collections/src/Item.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ItemElement, ItemProps} from '@react-types/shared';\nimport {PartialNode} from './types';\nimport React, {JSX, ReactElement} from 'react';\n\nfunction Item<T>(props: ItemProps<T>): ReactElement | null { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nItem.getCollectionNode = function* getCollectionNode<T>(props: ItemProps<T>, context: any): Generator<PartialNode<T>> {\n let {childItems, title, children} = props;\n\n let rendered = props.title || props.children;\n let textValue = props.textValue || (typeof rendered === 'string' ? rendered : '') || props['aria-label'] || '';\n\n // suppressTextValueWarning is used in components like Tabs, which don't have type to select support.\n if (!textValue && !context?.suppressTextValueWarning && process.env.NODE_ENV !== 'production') {\n console.warn('<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop.');\n }\n\n yield {\n type: 'item',\n props: props,\n rendered,\n textValue,\n 'aria-label': props['aria-label'],\n hasChildNodes: hasChildItems(props),\n *childNodes() {\n if (childItems) {\n for (let child of childItems) {\n yield {\n type: 'item',\n value: child\n };\n }\n } else if (title) {\n let items: PartialNode<T>[] = [];\n React.Children.forEach(children, child => {\n items.push({\n type: 'item',\n element: child as ItemElement<T>\n });\n });\n\n yield* items;\n }\n }\n };\n};\n\nfunction hasChildItems<T>(props: ItemProps<T>) {\n if (props.hasChildItems != null) {\n return props.hasChildItems;\n }\n\n if (props.childItems) {\n return true;\n }\n\n if (props.title && React.Children.count(props.children) > 0) {\n return true;\n }\n\n return false;\n}\n\n// We don't want getCollectionNode to show up in the type definition\nlet _Item = Item as <T>(props: ItemProps<T>) => JSX.Element;\nexport {_Item as Item};\n"],"names":[],"version":3,"file":"Item.module.js.map"}
@@ -0,0 +1,18 @@
# Installation
> `npm install --save @types/json5`
# Summary
This package contains type definitions for JSON5 (http://json5.org/).
# Details
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/types-2.0/json5
Additional Details
* Last updated: Mon, 19 Sep 2016 17:28:59 GMT
* File structure: ProperModule
* Library Dependencies: none
* Module Dependencies: none
* Global values: json5
# Credits
These definitions were written by Jason Swearingen <https://jasonswearingen.github.io>.
@@ -0,0 +1,21 @@
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes } from "@peculiar/asn1-schema";
import { CertificationRequestInfo } from "./certification_request_info";
import { AlgorithmIdentifier } from "@peculiar/asn1-x509";
export class CertificationRequest {
constructor(params = {}) {
this.certificationRequestInfo = new CertificationRequestInfo();
this.signatureAlgorithm = new AlgorithmIdentifier();
this.signature = new ArrayBuffer(0);
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: CertificationRequestInfo, raw: true })
], CertificationRequest.prototype, "certificationRequestInfo", void 0);
__decorate([
AsnProp({ type: AlgorithmIdentifier })
], CertificationRequest.prototype, "signatureAlgorithm", void 0);
__decorate([
AsnProp({ type: AsnPropTypes.BitString })
], CertificationRequest.prototype, "signature", void 0);
@@ -0,0 +1,35 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'no-extra-non-null-assertion',
meta: {
type: 'problem',
docs: {
description: 'Disallow extra non-null assertions',
recommended: 'recommended',
},
fixable: 'code',
messages: {
noExtraNonNullAssertion: 'Forbidden extra non-null assertion.',
},
schema: [],
},
defaultOptions: [],
create(context) {
function checkExtraNonNullAssertion(node) {
context.report({
node,
messageId: 'noExtraNonNullAssertion',
fix(fixer) {
return fixer.removeRange([node.range[1] - 1, node.range[1]]);
},
});
}
return {
'CallExpression[optional = true] > TSNonNullExpression.callee': checkExtraNonNullAssertion,
'MemberExpression[optional = true] > TSNonNullExpression.object': checkExtraNonNullAssertion,
'TSNonNullExpression > TSNonNullExpression': checkExtraNonNullAssertion,
};
},
});
@@ -0,0 +1,13 @@
/**
* Extractor function for a OptionalMemberExpression type value node.
* A member expression is accessing a property on an object `obj.property`.
*
* @param - value - AST Value object with type `OptionalMemberExpression`
* @returns - The extracted value converted to correct type
* and maintaing `obj?.property` convention.
*/
export default function extractValueFromOptionalMemberExpression(value) {
// eslint-disable-next-line global-require
const getValue = require('.').default;
return `${getValue(value.object)}?.${getValue(value.property)}`;
}
@@ -0,0 +1,24 @@
const levels = ['error', 'warn', 'log', 'info'];
let level = 'warn';
function debug(method) {
if (level) {
if (levels.indexOf(method) <= levels.indexOf(level)) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
console[method](...args); // eslint-disable-line no-console
}
}
}
function namespace(ns) {
return levels.reduce((logger, method) => {
logger[method] = debug.bind(console, method, ns);
return logger;
}, {});
}
namespace.level = newLevel => {
level = newLevel;
};
debug.level = namespace.level;
export default namespace;
//# sourceMappingURL=logger.js.map
@@ -0,0 +1,322 @@
import log from '../util/log'
function warn({ version, from, to }) {
log.warn(`${from}-color-renamed`, [
`As of Tailwind CSS ${version}, \`${from}\` has been renamed to \`${to}\`.`,
'Update your configuration file to silence this warning.',
])
}
export default {
inherit: 'inherit',
current: 'currentColor',
transparent: 'transparent',
black: '#000',
white: '#fff',
slate: {
50: '#f8fafc',
100: '#f1f5f9',
200: '#e2e8f0',
300: '#cbd5e1',
400: '#94a3b8',
500: '#64748b',
600: '#475569',
700: '#334155',
800: '#1e293b',
900: '#0f172a',
950: '#020617',
},
gray: {
50: '#f9fafb',
100: '#f3f4f6',
200: '#e5e7eb',
300: '#d1d5db',
400: '#9ca3af',
500: '#6b7280',
600: '#4b5563',
700: '#374151',
800: '#1f2937',
900: '#111827',
950: '#030712',
},
zinc: {
50: '#fafafa',
100: '#f4f4f5',
200: '#e4e4e7',
300: '#d4d4d8',
400: '#a1a1aa',
500: '#71717a',
600: '#52525b',
700: '#3f3f46',
800: '#27272a',
900: '#18181b',
950: '#09090b',
},
neutral: {
50: '#fafafa',
100: '#f5f5f5',
200: '#e5e5e5',
300: '#d4d4d4',
400: '#a3a3a3',
500: '#737373',
600: '#525252',
700: '#404040',
800: '#262626',
900: '#171717',
950: '#0a0a0a',
},
stone: {
50: '#fafaf9',
100: '#f5f5f4',
200: '#e7e5e4',
300: '#d6d3d1',
400: '#a8a29e',
500: '#78716c',
600: '#57534e',
700: '#44403c',
800: '#292524',
900: '#1c1917',
950: '#0c0a09',
},
red: {
50: '#fef2f2',
100: '#fee2e2',
200: '#fecaca',
300: '#fca5a5',
400: '#f87171',
500: '#ef4444',
600: '#dc2626',
700: '#b91c1c',
800: '#991b1b',
900: '#7f1d1d',
950: '#450a0a',
},
orange: {
50: '#fff7ed',
100: '#ffedd5',
200: '#fed7aa',
300: '#fdba74',
400: '#fb923c',
500: '#f97316',
600: '#ea580c',
700: '#c2410c',
800: '#9a3412',
900: '#7c2d12',
950: '#431407',
},
amber: {
50: '#fffbeb',
100: '#fef3c7',
200: '#fde68a',
300: '#fcd34d',
400: '#fbbf24',
500: '#f59e0b',
600: '#d97706',
700: '#b45309',
800: '#92400e',
900: '#78350f',
950: '#451a03',
},
yellow: {
50: '#fefce8',
100: '#fef9c3',
200: '#fef08a',
300: '#fde047',
400: '#facc15',
500: '#eab308',
600: '#ca8a04',
700: '#a16207',
800: '#854d0e',
900: '#713f12',
950: '#422006',
},
lime: {
50: '#f7fee7',
100: '#ecfccb',
200: '#d9f99d',
300: '#bef264',
400: '#a3e635',
500: '#84cc16',
600: '#65a30d',
700: '#4d7c0f',
800: '#3f6212',
900: '#365314',
950: '#1a2e05',
},
green: {
50: '#f0fdf4',
100: '#dcfce7',
200: '#bbf7d0',
300: '#86efac',
400: '#4ade80',
500: '#22c55e',
600: '#16a34a',
700: '#15803d',
800: '#166534',
900: '#14532d',
950: '#052e16',
},
emerald: {
50: '#ecfdf5',
100: '#d1fae5',
200: '#a7f3d0',
300: '#6ee7b7',
400: '#34d399',
500: '#10b981',
600: '#059669',
700: '#047857',
800: '#065f46',
900: '#064e3b',
950: '#022c22',
},
teal: {
50: '#f0fdfa',
100: '#ccfbf1',
200: '#99f6e4',
300: '#5eead4',
400: '#2dd4bf',
500: '#14b8a6',
600: '#0d9488',
700: '#0f766e',
800: '#115e59',
900: '#134e4a',
950: '#042f2e',
},
cyan: {
50: '#ecfeff',
100: '#cffafe',
200: '#a5f3fc',
300: '#67e8f9',
400: '#22d3ee',
500: '#06b6d4',
600: '#0891b2',
700: '#0e7490',
800: '#155e75',
900: '#164e63',
950: '#083344',
},
sky: {
50: '#f0f9ff',
100: '#e0f2fe',
200: '#bae6fd',
300: '#7dd3fc',
400: '#38bdf8',
500: '#0ea5e9',
600: '#0284c7',
700: '#0369a1',
800: '#075985',
900: '#0c4a6e',
950: '#082f49',
},
blue: {
50: '#eff6ff',
100: '#dbeafe',
200: '#bfdbfe',
300: '#93c5fd',
400: '#60a5fa',
500: '#3b82f6',
600: '#2563eb',
700: '#1d4ed8',
800: '#1e40af',
900: '#1e3a8a',
950: '#172554',
},
indigo: {
50: '#eef2ff',
100: '#e0e7ff',
200: '#c7d2fe',
300: '#a5b4fc',
400: '#818cf8',
500: '#6366f1',
600: '#4f46e5',
700: '#4338ca',
800: '#3730a3',
900: '#312e81',
950: '#1e1b4b',
},
violet: {
50: '#f5f3ff',
100: '#ede9fe',
200: '#ddd6fe',
300: '#c4b5fd',
400: '#a78bfa',
500: '#8b5cf6',
600: '#7c3aed',
700: '#6d28d9',
800: '#5b21b6',
900: '#4c1d95',
950: '#2e1065',
},
purple: {
50: '#faf5ff',
100: '#f3e8ff',
200: '#e9d5ff',
300: '#d8b4fe',
400: '#c084fc',
500: '#a855f7',
600: '#9333ea',
700: '#7e22ce',
800: '#6b21a8',
900: '#581c87',
950: '#3b0764',
},
fuchsia: {
50: '#fdf4ff',
100: '#fae8ff',
200: '#f5d0fe',
300: '#f0abfc',
400: '#e879f9',
500: '#d946ef',
600: '#c026d3',
700: '#a21caf',
800: '#86198f',
900: '#701a75',
950: '#4a044e',
},
pink: {
50: '#fdf2f8',
100: '#fce7f3',
200: '#fbcfe8',
300: '#f9a8d4',
400: '#f472b6',
500: '#ec4899',
600: '#db2777',
700: '#be185d',
800: '#9d174d',
900: '#831843',
950: '#500724',
},
rose: {
50: '#fff1f2',
100: '#ffe4e6',
200: '#fecdd3',
300: '#fda4af',
400: '#fb7185',
500: '#f43f5e',
600: '#e11d48',
700: '#be123c',
800: '#9f1239',
900: '#881337',
950: '#4c0519',
},
get lightBlue() {
warn({ version: 'v2.2', from: 'lightBlue', to: 'sky' })
return this.sky
},
get warmGray() {
warn({ version: 'v3.0', from: 'warmGray', to: 'stone' })
return this.stone
},
get trueGray() {
warn({ version: 'v3.0', from: 'trueGray', to: 'neutral' })
return this.neutral
},
get coolGray() {
warn({ version: 'v3.0', from: 'coolGray', to: 'gray' })
return this.gray
},
get blueGray() {
warn({ version: 'v3.0', from: 'blueGray', to: 'slate' })
return this.slate
},
}
@@ -0,0 +1,586 @@
# @dnd-kit/sortable
## 10.0.0
### Patch Changes
- Updated dependencies [[`0c6a28d`](https://github.com/clauderic/dnd-kit/commit/0c6a28d1b32c72cfbc6e103c9f430a1e8ebe7301)]:
- @dnd-kit/core@6.3.0
## 9.0.0
### Patch Changes
- [#1542](https://github.com/clauderic/dnd-kit/pull/1542) [`f629ec6`](https://github.com/clauderic/dnd-kit/commit/f629ec6a9c3c25b749561fac31741046d96c28dc) Thanks [@clauderic](https://github.com/clauderic)! - Fix bug with draggable and sortable elements with an `id` equal to `0`.
- Updated dependencies [[`00ec286`](https://github.com/clauderic/dnd-kit/commit/00ec286ab2fc7969549a4b19ffd42a09b5171dbe), [`995dc23`](https://github.com/clauderic/dnd-kit/commit/995dc23b7cd9019f3a920676cbe4e141e917e82c), [`f629ec6`](https://github.com/clauderic/dnd-kit/commit/f629ec6a9c3c25b749561fac31741046d96c28dc), [`99643f6`](https://github.com/clauderic/dnd-kit/commit/99643f634cd55fa0bf0898365883507b28637659), [`6bbe39b`](https://github.com/clauderic/dnd-kit/commit/6bbe39bba6ad9afd0bc6db1c345ad4e6b58f5e5e), [`545a41c`](https://github.com/clauderic/dnd-kit/commit/545a41c27c6919e4ca22a58a67f3fa02a7caab8a), [`bcaf7c4`](https://github.com/clauderic/dnd-kit/commit/bcaf7c4e57b34dfc8ff9c4eea7a01c6e525e7874)]:
- @dnd-kit/core@6.2.0
## 8.0.0
### Patch Changes
- Updated dependencies [[`bc588c7`](https://github.com/clauderic/dnd-kit/commit/bc588c7f7b1124514b2834e14f9dad29ce49c8ce), [`b417f0f`](https://github.com/clauderic/dnd-kit/commit/b417f0f94bfd8097bdf34eec27b7051dc0f5aa2a), [`f342d5e`](https://github.com/clauderic/dnd-kit/commit/f342d5efd98507f173b6a170b35bee1545d40311)]:
- @dnd-kit/core@6.1.0
- @dnd-kit/utilities@3.2.2
## 7.0.2
### Patch Changes
- [#788](https://github.com/clauderic/dnd-kit/pull/788) [`da94c02`](https://github.com/clauderic/dnd-kit/commit/da94c02a26986b8816b7b31e318f68e9e1b9a1d2) Thanks [@clauderic](https://github.com/clauderic)! - Bug fixes for React 18 Strict Mode
- Updated dependencies [[`da94c02`](https://github.com/clauderic/dnd-kit/commit/da94c02a26986b8816b7b31e318f68e9e1b9a1d2)]:
- @dnd-kit/core@6.0.7
## 7.0.1
### Patch Changes
- [#792](https://github.com/clauderic/dnd-kit/pull/792) [`b6970e7`](https://github.com/clauderic/dnd-kit/commit/b6970e78da868ea5c9f49368e88401d5b4cae765) Thanks [@clauderic](https://github.com/clauderic)! - The `hasSortableData` type-guard that is exported by @dnd-kit/sortable has been updated to also accept the `Active` and `Over` interfaces so it can be used in events such as `onDragStart`, `onDragOver`, and `onDragEnd`.
- Updated dependencies [[`eaa6e12`](https://github.com/clauderic/dnd-kit/commit/eaa6e126b8e4141b87d92d23478c47f5ba204f25)]:
- @dnd-kit/core@6.0.4
## 7.0.0
### Major Changes
- [#755](https://github.com/clauderic/dnd-kit/pull/755) [`33e6dd2`](https://github.com/clauderic/dnd-kit/commit/33e6dd2dc954f1f2da90d8f8af995021031b6b41) Thanks [@clauderic](https://github.com/clauderic)! - The `UniqueIdentifier` type has been updated to now accept either `string` or `number` identifiers. As a result, the `id` property of `useDraggable`, `useDroppable` and `useSortable` and the `items` prop of `<SortableContext>` now all accept either `string` or `number` identifiers.
#### Migration steps
For consumers that are using TypeScript, import the `UniqueIdentifier` type to have strongly typed local state:
```diff
+ import type {UniqueIdentifier} from '@dnd-kit/core';
function MyComponent() {
- const [items, setItems] = useState(['A', 'B', 'C']);
+ const [items, setItems] = useState<UniqueIdentifier>(['A', 'B', 'C']);
}
```
Alternatively, consumers can cast or convert the `id` property to a `string` when reading the `id` property of interfaces such as `Active`, `Over`, `DroppableContainer` and `DraggableNode`.
The `draggableNodes` object has also been converted to a map. Consumers that were reading from the `draggableNodes` property that is available on the public context of `<DndContext>` should follow these migration steps:
```diff
- draggableNodes[someId];
+ draggableNodes.get(someId);
```
- [#660](https://github.com/clauderic/dnd-kit/pull/660) [`30bbd12`](https://github.com/clauderic/dnd-kit/commit/30bbd12f9606c2e99523cb9ece465041cb37e916) Thanks [@clauderic](https://github.com/clauderic)! - Changes to the default `sortableKeyboardCoordinates` KeyboardSensor coordinate getter.
#### Better handling of variable sizes
The default `sortableKeyboardCoordinates` function now has better handling of lists that have items of variable sizes. We recommend that consumers re-order lists `onDragOver` instead of `onDragEnd` when sorting lists of variable sizes via the keyboard for optimal compatibility.
#### Better handling of overlapping droppables
The default `sortableKeyboardCoordinates` function that is exported from the `@dnd-kit/sortable` package has been updated to better handle cases where the collision rectangle is overlapping droppable rectangles. For example, for `down` arrow key, the default function had logic that would only consider collisions against droppables that were below the `bottom` edge of the collision rect. This was problematic when the collision rect was overlapping droppable rects, because it meant that it's bottom edge was below the top edge of the droppable, and that resulted in that droppable being skipped.
```diff
- collisionRect.bottom > droppableRect.top
+ collisionRect.top > droppableRect.top
```
This change should be backwards compatible for most consumers, but may introduce regressions in some use-cases, especially for consumers that may have copied the multiple containers examples. There is now a custom sortable keyboard coordinate getter [optimized for multiple containers that you can refer to](https://github.com/clauderic/dnd-kit/tree/master/stories/2%20-%20Presets/Sortable/multipleContainersKeyboardCoordinates.ts).
### Minor Changes
- [#748](https://github.com/clauderic/dnd-kit/pull/748) [`59ca82b`](https://github.com/clauderic/dnd-kit/commit/59ca82b9f228f34c7731ece87aef5d9633608b57) Thanks [@clauderic](https://github.com/clauderic)! - Automatic focus management and activator node refs.
#### Introducing activator node refs
Introducing the concept of activator node refs for `useDraggable` and `useSortable`. This allows @dnd-kit to handle common use-cases such as restoring focus on the activator node after dragging via the keyboard or only allowing the activator node to instantiate the keyboard sensor.
Consumers of `useDraggable` and `useSortable` may now optionally set the activator node ref on the element that receives listeners:
```diff
import {useDraggable} from '@dnd-kit/core';
function Draggable(props) {
const {
listeners,
setNodeRef,
+ setActivatorNodeRef,
} = useDraggable({id: props.id});
return (
<div ref={setNodeRef}>
Draggable element
<button
{...listeners}
+ ref={setActivatorNodeRef}
>
:: Drag Handle
</button>
</div>
)
}
```
It's common for the activator element (the element that receives the sensor listeners) to differ from the draggable node. When this happens, @dnd-kit has no reliable way to get a reference to the activator node after dragging ends, as the original `event.target` that instantiated the sensor may no longer be mounted in the DOM or associated with the draggable node that was previously active.
#### Automatically restoring focus
Focus management is now automatically handled by @dnd-kit. When the activator event is a Keyboard event, @dnd-kit will now attempt to automatically restore focus back to the first focusable node of the activator node or draggable node.
If no activator node is specified via the `setActivatorNodeRef` setter function of `useDraggble` and `useSortable`, @dnd-kit will automatically restore focus on the first focusable node of the draggable node set via the `setNodeRef` setter function of `useDraggable` and `useSortable`.
If you were previously managing focus manually and would like to opt-out of automatic focus management, use the newly introduced `restoreFocus` property of the `accessibility` prop of `<DndContext>`:
```diff
<DndContext
accessibility={{
+ restoreFocus: false
}}
```
- [#672](https://github.com/clauderic/dnd-kit/pull/672) [`10f6836`](https://github.com/clauderic/dnd-kit/commit/10f683631103b1d919f2fbca1177141b9369d2cf) Thanks [@clauderic](https://github.com/clauderic)! - `SortableContext` now always requests measuring of droppable containers when its `items` prop changes, regardless of whether or not dragging is in progress. Measuring will occur if the measuring configuration allows for it.
- [#754](https://github.com/clauderic/dnd-kit/pull/754) [`224201a`](https://github.com/clauderic/dnd-kit/commit/224201a2a5611f0efeb57c9b273eddf23c28e01f) Thanks [@clauderic](https://github.com/clauderic)! - The `<SortableContext>` component now optionally accepts a `disabled` prop to globally disable `useSortable` hooks rendered within it.
The `disabled` prop accepts either a boolean or an object with the following shape:
```ts
interface Disabled {
draggable?: boolean;
droppable?: boolean;
}
```
The `useSortable` hook has now been updated to also optionally accept the `disabled` configuration object to conditionally disable the `useDraggable` and/or `useDroppable` hooks used internally.
Like the `strategy` prop, the `disabled` prop defined on the `useSortable` hook takes precedence over the `disabled` prop defined on the parent `<SortableContext>`.
### Patch Changes
- [#757](https://github.com/clauderic/dnd-kit/pull/757) [`e6d544f`](https://github.com/clauderic/dnd-kit/commit/e6d544f3f775e6a43de25d1aee67efeec0d5db58) Thanks [@clauderic](https://github.com/clauderic)! - The `wasDragging` property of `animateLayoutChanges` now remains true for longer than a single re-render. Before this change, it was possible for the component where `useSortable` is used to re-render before @dnd-kit is ready to perform the layout animation, causing the animation to be skipped entirely.
- [#749](https://github.com/clauderic/dnd-kit/pull/749) [`188a450`](https://github.com/clauderic/dnd-kit/commit/188a4507b99d8e8fdaa50bd26deb826c86608e18) Thanks [@clauderic](https://github.com/clauderic)! - Faster (and safer) equal implementation.
- Updated dependencies [[`4173087`](https://github.com/clauderic/dnd-kit/commit/417308704454c50f88ab305ab450a99bde5034b0), [`59ca82b`](https://github.com/clauderic/dnd-kit/commit/59ca82b9f228f34c7731ece87aef5d9633608b57), [`7161f70`](https://github.com/clauderic/dnd-kit/commit/7161f702c9fe06f8dafa6449d48b918070ca46fb), [`a52fba1`](https://github.com/clauderic/dnd-kit/commit/a52fba1ccff8a8f40e2cb8dcc15236cfd9e8fbec), [`40707ce`](https://github.com/clauderic/dnd-kit/commit/40707ce6f388957203d6df4ccbeef460450ffd7d), [`a41e5b8`](https://github.com/clauderic/dnd-kit/commit/a41e5b8eff84f0528ffc8b3455b94b95ab60a4a9), [`bf30718`](https://github.com/clauderic/dnd-kit/commit/bf30718bc22584a47053c14f5920e317ac45cd50), [`a41e5b8`](https://github.com/clauderic/dnd-kit/commit/a41e5b8eff84f0528ffc8b3455b94b95ab60a4a9), [`a41e5b8`](https://github.com/clauderic/dnd-kit/commit/a41e5b8eff84f0528ffc8b3455b94b95ab60a4a9), [`035021a`](https://github.com/clauderic/dnd-kit/commit/035021aac51161e2bf9715f087a6dd1b46647bfc), [`77e3d44`](https://github.com/clauderic/dnd-kit/commit/77e3d44502383d2f9a9f9af014b053619b3e37b3), [`5811986`](https://github.com/clauderic/dnd-kit/commit/5811986e7544a5e80039870a015e38df805eaad1), [`e302bd4`](https://github.com/clauderic/dnd-kit/commit/e302bd4488bdfb6735c97ac42c1f4a0b1e8bfdf9), [`188a450`](https://github.com/clauderic/dnd-kit/commit/188a4507b99d8e8fdaa50bd26deb826c86608e18), [`59ca82b`](https://github.com/clauderic/dnd-kit/commit/59ca82b9f228f34c7731ece87aef5d9633608b57), [`750d726`](https://github.com/clauderic/dnd-kit/commit/750d72655922363b2218d7b41e028f9dceaef013), [`5f3c700`](https://github.com/clauderic/dnd-kit/commit/5f3c7009698d15936fd20f30f11ad3b23cd7886f), [`035021a`](https://github.com/clauderic/dnd-kit/commit/035021aac51161e2bf9715f087a6dd1b46647bfc), [`e6e242c`](https://github.com/clauderic/dnd-kit/commit/e6e242cbc718ed687a26f5c622eeed4dbd6c2425), [`035021a`](https://github.com/clauderic/dnd-kit/commit/035021aac51161e2bf9715f087a6dd1b46647bfc), [`33e6dd2`](https://github.com/clauderic/dnd-kit/commit/33e6dd2dc954f1f2da90d8f8af995021031b6b41), [`10f6836`](https://github.com/clauderic/dnd-kit/commit/10f683631103b1d919f2fbca1177141b9369d2cf), [`c1b3b5a`](https://github.com/clauderic/dnd-kit/commit/c1b3b5a0be5759b707e22c4e1b1236aaa82773a2), [`035021a`](https://github.com/clauderic/dnd-kit/commit/035021aac51161e2bf9715f087a6dd1b46647bfc)]:
- @dnd-kit/core@6.0.0
- @dnd-kit/utilities@3.2.0
## 6.0.1
### Patch Changes
- [#642](https://github.com/clauderic/dnd-kit/pull/642) [`15a6017`](https://github.com/clauderic/dnd-kit/commit/15a6017c4c2dd66911751877cc448456d0e5c96f) Thanks [@vosatom](https://github.com/vosatom)! - Fixed an issue that affected `SortableContext` performance. The `sortedRects` property of the `SortableContext` provider were being recomputed whenever coordinates changed rather than only when the order of the items changed.
- Updated dependencies [[`b3b185d`](https://github.com/clauderic/dnd-kit/commit/b3b185dc675b61fe2e3d1a8462728c81c3150b99)]:
- @dnd-kit/core@5.0.2
## 6.0.0
### Major Changes
- [#518](https://github.com/clauderic/dnd-kit/pull/518) [`6310227`](https://github.com/clauderic/dnd-kit/commit/63102272d0d63dae349e2e9f638277e16a7d5970) Thanks [@clauderic](https://github.com/clauderic)! - Major internal refactor of measuring and collision detection.
### Summary of changes
Previously, all collision detection algorithms were relative to the top and left points of the document. While this approach worked in most situations, it broke down in a number of different use-cases, such as fixed position droppable containers and trying to drag between containers that had different scroll positions.
This new approach changes the frame of comparison to be relative to the viewport. This is a major breaking change, and will need to be released under a new major version bump.
### Breaking changes:
- By default, `@dnd-kit` now ignores only the transforms applied to the draggable / droppable node itself, but considers all the transforms applied to its ancestors. This should provide the right balance of flexibility for most consumers.
- Transforms applied to the droppable and draggable nodes are ignored by default, because the recommended approach for moving items on the screen is to use the transform property, which can interfere with the calculation of collisions.
- Consumers can choose an alternate approach that does consider transforms for specific use-cases if needed by configuring the measuring prop of <DndContext>. Refer to the <Switch> example.
- Reduced the number of concepts related to measuring from `ViewRect`, `LayoutRect` to just a single concept of `ClientRect`.
- The `ClientRect` interface no longer holds the `offsetTop` and `offsetLeft` properties. For most use-cases, you can replace `offsetTop` with `top` and `offsetLeft` with `left`.
- Replaced the following exports from the `@dnd-kit/core` package with `getClientRect`:
- `getBoundingClientRect`
- `getViewRect`
- `getLayoutRect`
- `getViewportLayoutRect`
- Removed `translatedRect` from the `SensorContext` interface. Replace usage with `collisionRect`.
- Removed `activeNodeClientRect` on the `DndContext` interface. Replace with `activeNodeRect`.
- [#569](https://github.com/clauderic/dnd-kit/pull/569) [`e7ac3d4`](https://github.com/clauderic/dnd-kit/commit/e7ac3d45699dcc7b47191a67044a516929ac439c) Thanks [@clauderic](https://github.com/clauderic)! - Separated context into public and internal context providers. Certain properties that used to be available on the public `DndContextDescriptor` interface have been moved to the internal context provider and are no longer exposed to consumers:
```ts
interface DndContextDescriptor {
- dispatch: React.Dispatch<Actions>;
- activators: SyntheticListeners;
- ariaDescribedById: {
- draggable: UniqueIdentifier;
- };
}
```
Having two distinct context providers will allow to keep certain internals such as `dispatch` hidden from consumers.
It also serves as an optimization until context selectors are implemented in React, properties that change often, such as the droppable containers and droppable rects, the transform value and array of collisions should be stored on a different context provider to limit un-necessary re-renders in `useDraggable`, `useDroppable` and `useSortable`.
The `<InternalContext.Provider>` is also reset to its default values within `<DragOverlay>`. This paves the way towards being able to seamlessly use components that use hooks such as `useDraggable` and `useDroppable` as children of `<DragOverlay>` without causing interference or namespace collisions.
Consumers can still make calls to `useDndContext()` to get the `active` or `over` properties if they wish to re-render the component rendered within `DragOverlay` in response to user interaction, since those use the `PublicContext`
### Minor Changes
- [#558](https://github.com/clauderic/dnd-kit/pull/558) [`f3ad20d`](https://github.com/clauderic/dnd-kit/commit/f3ad20d5b2c2f2ca7b82c193c9af5eef38c5ce11) Thanks [@clauderic](https://github.com/clauderic)! - Refactor of the `CollisionDetection` interface to return an array of `Collision`s:
```diff
+export interface Collision {
+ id: UniqueIdentifier;
+ data?: Record<string, any>;
+}
export type CollisionDetection = (args: {
active: Active;
collisionRect: ClientRect;
droppableContainers: DroppableContainer[];
pointerCoordinates: Coordinates | null;
-}) => UniqueIdentifier;
+}) => Collision[];
```
This is a breaking change that requires all collision detection strategies to be updated to return an array of `Collision` rather than a single `UniqueIdentifier`
The `over` property remains a single `UniqueIdentifier`, and is set to the first item in returned in the collisions array.
Consumers can also access the `collisions` property which can be used to implement use-cases such as combining droppables in user-land.
The `onDragMove`, `onDragOver` and `onDragEnd` callbacks are also updated to receive the collisions array property.
Built-in collision detections such as rectIntersection, closestCenter, closestCorners and pointerWithin adhere to the CollisionDescriptor interface, which extends the Collision interface:
```ts
export interface CollisionDescriptor extends Collision {
data: {
droppableContainer: DroppableContainer;
value: number;
[key: string]: any;
};
}
```
Consumers can also access the array of collisions in components wrapped by `<DndContext>` via the `useDndContext()` hook:
```ts
import {useDndContext} from '@dnd-kit/core';
function MyComponent() {
const {collisions} = useDndContext();
}
```
- [#561](https://github.com/clauderic/dnd-kit/pull/561) [`02edd26`](https://github.com/clauderic/dnd-kit/commit/02edd2691b24bb49f2e7c9f9a3f282031bf658b7) Thanks [@clauderic](https://github.com/clauderic)! - Droppable containers now observe the node they are attached to via `setNodeRef` using `ResizeObserver` while dragging.
This behaviour can be configured using the newly introduced `resizeObserverConfig` property.
```ts
interface ResizeObserverConfig {
/** Whether the ResizeObserver should be disabled entirely */
disabled?: boolean;
/** Resize events may affect the layout and position of other droppable containers.
* Specify an array of `UniqueIdentifier` of droppable containers that should also be re-measured
* when this droppable container resizes. Specifying an empty array re-measures all droppable containers.
*/
updateMeasurementsFor?: UniqueIdentifier[];
/** Represents the debounce timeout between when resize events are observed and when elements are re-measured */
timeout?: number;
}
```
By default, only the current droppable is scheduled to be re-measured when a resize event is observed. However, this may not be suitable for all use-cases. When an element resizes, it can affect the layout and position of other elements, such that it may be necessary to re-measure other droppable nodes in response to that single resize event. The `recomputeIds` property can be used to specify which droppable `id`s should be re-measured in response to resize events being observed.
For example, the `useSortable` preset re-computes the measurements of all sortable elements after the element that resizes, so long as they are within the same `SortableContext` as the element that resizes, since it's highly likely that their layout will also shift.
Specifying an empty array for `recomputeIds` forces all droppable containers to be re-measured.
For consumers that were relyings on the internals of `DndContext` using `useDndContext()`, the `willRecomputeLayouts` property has been renamed to `measuringScheduled`, and the `recomputeLayouts` method has been renamed to `measureDroppableContainers`, and now optionally accepts an array of droppable `UniqueIdentifier` that should be scheduled to be re-measured.
- [#570](https://github.com/clauderic/dnd-kit/pull/570) [`1ade2f3`](https://github.com/clauderic/dnd-kit/commit/1ade2f34403ba1d5a87cbd3ce1cff62860860501) Thanks [@clauderic](https://github.com/clauderic)! - Use `transition` for the active draggable node when keyboard sorting without a `<DragOverlay />`.
### Patch Changes
- [#566](https://github.com/clauderic/dnd-kit/pull/566) [`d315df0`](https://github.com/clauderic/dnd-kit/commit/d315df07022178460a52d6021a41227878b876b8) Thanks [@clauderic](https://github.com/clauderic)! - Fixed a bug where sortable item position was not updated when quickly dragging different sortable items.
- Updated dependencies [[`f3ad20d`](https://github.com/clauderic/dnd-kit/commit/f3ad20d5b2c2f2ca7b82c193c9af5eef38c5ce11), [`02edd26`](https://github.com/clauderic/dnd-kit/commit/02edd2691b24bb49f2e7c9f9a3f282031bf658b7), [`c6c67cb`](https://github.com/clauderic/dnd-kit/commit/c6c67cb9cbc6e61027f7bb084fd2232160037d5e), [`6310227`](https://github.com/clauderic/dnd-kit/commit/63102272d0d63dae349e2e9f638277e16a7d5970), [`e7ac3d4`](https://github.com/clauderic/dnd-kit/commit/e7ac3d45699dcc7b47191a67044a516929ac439c), [`528c67e`](https://github.com/clauderic/dnd-kit/commit/528c67e4c617dfc0ce5221496aa8b222ffc82ddb), [`02edd26`](https://github.com/clauderic/dnd-kit/commit/02edd2691b24bb49f2e7c9f9a3f282031bf658b7)]:
- @dnd-kit/core@5.0.0
- @dnd-kit/utilities@3.1.0
## 5.1.0
### Minor Changes
- [#486](https://github.com/clauderic/dnd-kit/pull/486) [`d86529c`](https://github.com/clauderic/dnd-kit/commit/d86529cde6daa650e9c9edce7f26fb691d71d723) Thanks [@clauderic](https://github.com/clauderic)! - Improvements to better support swappable strategies:
- Now exporting an `arraySwap` helper to be used instead of `arrayMove` `onDragEnd`.
- Added the `getNewIndex` prop on `useSortable`. By default, `useSortable` assumes that items will be moved to their new index using `arrayMove()`, but this isn't always the case, especially when using strategies like `rectSwappingStrategy`. For those scenarios, consumers can now define custom logic that should be used to get the new index for an item on drop, for example, by computing the new order of items using `arraySwap`.
### Patch Changes
- Updated dependencies [[`d973cc6`](https://github.com/clauderic/dnd-kit/commit/d973cc6f5aaca8a01e6da4a958164eb623c4ce9d)]:
- @dnd-kit/core@4.0.2
## 5.0.0
### Major Changes
- [#427](https://github.com/clauderic/dnd-kit/pull/427) [`f96cb5d`](https://github.com/clauderic/dnd-kit/commit/f96cb5d5e45a1000104892244201a70cbe8e6553) Thanks [@clauderic](https://github.com/clauderic)! - - Using transform-agnostic measurements for the DragOverlay node.
- Renamed the `overlayNode` property to `dragOverlay` on the `DndContextDescriptor` interface.
- [`9cfac05`](https://github.com/clauderic/dnd-kit/commit/9cfac057689ae1a91b663ac2eb04c47dadb9b4db) Thanks [@clauderic](https://github.com/clauderic)! - Renamed the `wasSorting` property to `wasDragging` on the `SortableContext` and `AnimateLayoutChanges` interfaces.
### Minor Changes
- [#433](https://github.com/clauderic/dnd-kit/pull/433) [`c447880`](https://github.com/clauderic/dnd-kit/commit/c447880656b6bee2915d5a5f01d3ddfbd5705fa2) Thanks [@clauderic](https://github.com/clauderic)! - Fix unwanted animations when items in sortable context change
### Patch Changes
- [#372](https://github.com/clauderic/dnd-kit/pull/372) [`dbc9601`](https://github.com/clauderic/dnd-kit/commit/dbc9601c922e1d6944a63f66ee647f203abee595) Thanks [@clauderic](https://github.com/clauderic)! - Refactored `DroppableContainers` type from `Record<UniqueIdentifier, DroppableContainer` to a custom instance that extends the [`Map` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) and adds a few other methods such as `toArray()`, `getEnabled()` and `getNodeFor(id)`.
A unique `key` property was also added to the `DraggableNode` and `DroppableContainer` interfaces. This prevents potential race conditions in the mount and cleanup effects of `useDraggable` and `useDroppable`. It's possible for the clean-up effect to run after another React component using `useDraggable` or `useDroppable` mounts, which causes the newly mounted element to accidentally be un-registered.
- [#350](https://github.com/clauderic/dnd-kit/pull/350) [`a13dbb6`](https://github.com/clauderic/dnd-kit/commit/a13dbb66586edbf2998c7b251e236604255fd227) Thanks [@wmain](https://github.com/wmain)! - Breaking change: The `CollisionDetection` interface has been refactored. It now receives an object that contains the `active` draggable node, along with the `collisionRect` and an array of `droppableContainers`.
If you've built custom collision detection algorithms, you'll need to update them. Refer to [this PR](https://github.com/clauderic/dnd-kit/pull/350) for examples of how to refactor collision detection functions to the new `CollisionDetection` interface.
The `sortableKeyboardCoordinates` method has also been updated since it relies on the `closestCorners` collision detection algorithm. If you were using collision detection strategies in a custom `sortableKeyboardCoordinates` method, you'll need to update those as well.
- [`86d1f27`](https://github.com/clauderic/dnd-kit/commit/86d1f27f45fb60db6a34cd258227371595e00435) Thanks [@clauderic](https://github.com/clauderic)! - Fixed a bug in the `horizontalListSortingStrategy` where it did not check if the `currentRect` was undefined.
- [`e42a711`](https://github.com/clauderic/dnd-kit/commit/e42a711a26186c08fc888f8acbf4635ed855f2a2) Thanks [@clauderic](https://github.com/clauderic)! - Fixed a bug with the default layout animation function where it could return `true` initially even if the list had not been sorted yet. Now checking the `wasDragging` property to ensure no layout animation occurs if `wasDragging` is false.
- [#341](https://github.com/clauderic/dnd-kit/pull/341) [`e02b737`](https://github.com/clauderic/dnd-kit/commit/e02b737a3ce94f57592ac2ffe67d5bc8fabe1d43) Thanks [@clauderic](https://github.com/clauderic)! - Return `undefined` instead of `null` for `transition` in `useSortable`
- Updated dependencies [[`13be602`](https://github.com/clauderic/dnd-kit/commit/13be602229c6d5723b3ae98bca7b8f45f0773366), [`aede2cc`](https://github.com/clauderic/dnd-kit/commit/aede2cc42d488435cf65f19b63ba6bb7702b3fde), [`05d6a78`](https://github.com/clauderic/dnd-kit/commit/05d6a78a17cbaacd8dffed685dfea5a6ea3d38a8), [`a32a4c5`](https://github.com/clauderic/dnd-kit/commit/a32a4c5f6228b9f03bf460b8403a38b8c3de493f), [`f96cb5d`](https://github.com/clauderic/dnd-kit/commit/f96cb5d5e45a1000104892244201a70cbe8e6553), [`dea715c`](https://github.com/clauderic/dnd-kit/commit/dea715c342b2d998a9f1562cacb5e70c77562c92), [`dbc9601`](https://github.com/clauderic/dnd-kit/commit/dbc9601c922e1d6944a63f66ee647f203abee595), [`46ec5e4`](https://github.com/clauderic/dnd-kit/commit/46ec5e4c6e3ca9fa849666f90fef426b3c465cf0), [`7006464`](https://github.com/clauderic/dnd-kit/commit/700646468683e4820269534c6352cca93bb5a987), [`0e628bc`](https://github.com/clauderic/dnd-kit/commit/0e628bce53fb1a7223cdedd203cb07b6e62e5ec1), [`c447880`](https://github.com/clauderic/dnd-kit/commit/c447880656b6bee2915d5a5f01d3ddfbd5705fa2), [`2ba6dfe`](https://github.com/clauderic/dnd-kit/commit/2ba6dfe6b080b90b13aa8d9eb07331515a0d2faa), [`8d70540`](https://github.com/clauderic/dnd-kit/commit/8d70540771d1455c326310b438a198d2516e1d04), [`13be602`](https://github.com/clauderic/dnd-kit/commit/13be602229c6d5723b3ae98bca7b8f45f0773366), [`422d083`](https://github.com/clauderic/dnd-kit/commit/422d0831173a893099ba924bf7bbc465640fc15d), [`c4b21b4`](https://github.com/clauderic/dnd-kit/commit/c4b21b4ee17cba31c10928eb227848026f54222a), [`5a41340`](https://github.com/clauderic/dnd-kit/commit/5a41340e6561c3784da2a9266e1b852ba370918c), [`a13dbb6`](https://github.com/clauderic/dnd-kit/commit/a13dbb66586edbf2998c7b251e236604255fd227), [`e2ee0dc`](https://github.com/clauderic/dnd-kit/commit/e2ee0dccb12794c419587019defddfd82ba5d297), [`1fe9b5c`](https://github.com/clauderic/dnd-kit/commit/1fe9b5c9d34237aae6ab22d54478c419d44a079a), [`1fe9b5c`](https://github.com/clauderic/dnd-kit/commit/1fe9b5c9d34237aae6ab22d54478c419d44a079a), [`1f5ca27`](https://github.com/clauderic/dnd-kit/commit/1f5ca27b17879861c2c545160c2046a747544846)]:
- @dnd-kit/core@4.0.0
- @dnd-kit/utilities@3.0.0
## 4.0.0
### Patch Changes
- Updated dependencies [[`d39ab11`](https://github.com/clauderic/dnd-kit/commit/d39ab1112f9be78d467b2dfe488a7ea931d93767)]:
- @dnd-kit/core@3.1.0
## 3.1.0
### Minor Changes
- [`68960c4`](https://github.com/clauderic/dnd-kit/commit/68960c490f50962b47a57663ee0625d7704173ec) [#295](https://github.com/clauderic/dnd-kit/pull/295) Thanks [@akhmadullin](https://github.com/akhmadullin)! - `@dnd-kit/core` is now a `peerDependency` rather than a `dependency` for other `@dnd-kit` packages that depend on it, such as `@dnd-kit/sortable` and `@dnd-kit/modifiers`. This is done to avoid issues with multiple versions of `@dnd-kit/core` being installed by some package managers such as Yarn 2.
### Patch Changes
- Updated dependencies [[`ae398de`](https://github.com/clauderic/dnd-kit/commit/ae398de012aee28f5e3bec10b438153d00f65630), [`8b938ce`](https://github.com/clauderic/dnd-kit/commit/8b938ceb158c67e9fdc4616351d1a3291ac614c3)]:
- @dnd-kit/core@3.0.4
## 3.0.1
### Patch Changes
- [`a178857`](https://github.com/clauderic/dnd-kit/commit/a1788579ee12d1c1af8244bdf6a17f3f5ba388a1) [#214](https://github.com/clauderic/dnd-kit/pull/214) Thanks [@clauderic](https://github.com/clauderic)! - Ensure that consumer defined data passed to `useSortable` is passed down to both `useDraggable` and `useDroppable`.
The `data` object that is passed to `useDraggable` and `useDroppable` within `useSortable` also contains the `sortable` property, which holds a reference to the index of the item, along with the `containerId` and the `items` of its parent `SortableContext`.
## 3.0.0
### Major Changes
- [`a9d92cf`](https://github.com/clauderic/dnd-kit/commit/a9d92cf1fa35dd957e6c5915a13dfd2af134c103) [#174](https://github.com/clauderic/dnd-kit/pull/174) Thanks [@clauderic](https://github.com/clauderic)! - Distributed assets now only target modern browsers. [Browserlist](https://github.com/browserslist/browserslist) config:
```
defaults
last 2 version
not IE 11
not dead
```
If you need to support older browsers, include the appropriate polyfills in your project's build process.
### Minor Changes
- [`b7355d1`](https://github.com/clauderic/dnd-kit/commit/b7355d19d9e15bb1972627bb622c2487ddec82ad) [#207](https://github.com/clauderic/dnd-kit/pull/207) Thanks [@clauderic](https://github.com/clauderic)! - The `data` argument for `useDraggable` and `useDroppable` is now exposed in event handlers and on the `active` and `over` objects.
**Example usage:**
```tsx
import {DndContext, useDraggable, useDroppable} from '@dnd-kit/core';
function Draggable() {
const {attributes, listeners, setNodeRef, transform} = useDraggable({
id: 'draggable',
data: {
type: 'type1',
},
});
/* ... */
}
function Droppable() {
const {setNodeRef} = useDroppable({
id: 'droppable',
data: {
accepts: ['type1', 'type2'],
},
});
/* ... */
}
function App() {
return (
<DndContext
onDragEnd={({active, over}) => {
if (over?.data.current.accepts.includes(active.data.current.type)) {
// do stuff
}
}}
/>
);
}
```
### Patch Changes
- [`fb2db94`](https://github.com/clauderic/dnd-kit/commit/fb2db941d00d1f876a62751c6ac9d79143876598) [#212](https://github.com/clauderic/dnd-kit/pull/212) Thanks [@clauderic](https://github.com/clauderic)! - Allow consumers of `SortableContext` to provide items of shape `{id: string}[]` or `string[]`
- Updated dependencies [[`b7355d1`](https://github.com/clauderic/dnd-kit/commit/b7355d19d9e15bb1972627bb622c2487ddec82ad), [`a9d92cf`](https://github.com/clauderic/dnd-kit/commit/a9d92cf1fa35dd957e6c5915a13dfd2af134c103), [`b406cb9`](https://github.com/clauderic/dnd-kit/commit/b406cb9251beef8677d05c45ec42bab7581a86dc)]:
- @dnd-kit/core@3.0.0
- @dnd-kit/utilities@2.0.0
## 2.0.1
### Patch Changes
- [`92afb0f`](https://github.com/clauderic/dnd-kit/commit/92afb0f6bcb9dd91f7e487ef44c43c8d28241f6f) [#168](https://github.com/clauderic/dnd-kit/pull/168) Thanks [@clauderic](https://github.com/clauderic)! - Make sure that the `wasSorting` argument of the `animateLayoutChanges` prop of `useSortable` always receives the latest value.
- Updated dependencies [[`bdb1aa2`](https://github.com/clauderic/dnd-kit/commit/bdb1aa2b62f855a4ccd048d452d4dd93529af563)]:
- @dnd-kit/core@2.1.0
## 2.0.0
### Major Changes
- [`8583825`](https://github.com/clauderic/dnd-kit/commit/8583825380bc4d7c36e076be30bb5ca3fd20a26b) [#140](https://github.com/clauderic/dnd-kit/pull/140) Thanks [@clauderic](https://github.com/clauderic)! - Auto-scrolling defaults have been updated, which should generally lead to improved user experience for most consumers.
The auto-scroller now bases its calculations based on the position of the pointer rather than the edges of the draggable element's rect by default. This change is aligned with how the native HTML 5 Drag & Drop auto-scrolling behaves.
This behaviour can be customized using the `activator` option of the `autoScroll` prop:
```tsx
import {AutoScrollActivator, DndContext} from '@dnd-kit/core';
<DndContext autoScroll={{activator: AutoScrollActivator.DraggableRect}} />;
```
The auto-scroller now also looks at scrollable ancestors in order of appearance in the DOM tree, meaning it will first attempt to scroll the window, and narrow its focus down rather than the old behaviour of looking at scrollable ancestors in order of closeness to the draggable element in the DOM tree (reversed tree order).
This generally leads to an improved user experience, but can be customized by passing a configuration object to the `autoScroll` prop that sets the `order` option to `TraversalOrder.ReversedTreeOrder` instead of the new default value of `TraversalOrder.TreeOrder`:
```tsx
import {DndContext, TraversalOrder} from '@dnd-kit/core';
<DndContext autoScroll={{order: TraversalOrder.ReversedTreeOrder}} />;
```
The autoscrolling `thresholds`, `acceleration` and `interval` can now also be customized using the `autoScroll` prop:
```tsx
import {DndContext} from '@dnd-kit/core';
<DndContext
autoScroll={{
thresholds: {
// Left and right 10% of the scroll container activate scrolling
x: 0.1,
// Top and bottom 25% of the scroll container activate scrolling
y: 0.25,
},
// Accelerate slower than the default value (10)
acceleration: 5,
// Auto-scroll every 10ms instead of the default value of 5ms
interval: 10,
}}
/>;
```
Finally, consumers can now conditionally opt out of scrolling certain scrollable ancestors using the `canScroll` option of the `autoScroll` prop:
```tsx
import {DndContext} from '@dnd-kit/core';
<DndContext
autoScroll={{
canScroll(element) {
if (element === document.scrollingElement) {
return false;
}
return true;
},
}}
/>;
```
### Patch Changes
- Updated dependencies [[`8583825`](https://github.com/clauderic/dnd-kit/commit/8583825380bc4d7c36e076be30bb5ca3fd20a26b)]:
- @dnd-kit/core@2.0.0
## 1.1.0
### Minor Changes
- [`79f6088`](https://github.com/clauderic/dnd-kit/commit/79f6088dab2d4e7443743f85b329a25a023ecd87) [#144](https://github.com/clauderic/dnd-kit/pull/144) Thanks [@clauderic](https://github.com/clauderic)! - Allow consumers to determine whether to animate layout changes and when to measure nodes. Consumers can now use the `animateLayoutChanges` prop of `useSortable` to determine whether layout animations should occur. Consumers can now also decide when to measure layouts, and at what frequency using the `layoutMeasuring` prop of `DndContext`. By default, `DndContext` will measure layouts just-in-time after sorting has begun. Consumers can override this behaviour to either only measure before dragging begins (on mount and after dragging), or always (on mount, before dragging, after dragging). Pairing the `layoutMeasuring` prop on `DndContext` and the `animateLayoutChanges` prop of `useSortable` opens up a number of new possibilities for consumers, such as animating insertion and removal of items in a sortable list.
### Patch Changes
- Updated dependencies [[`adb7bd5`](https://github.com/clauderic/dnd-kit/commit/adb7bd58d7d95db5e450a1518541d3d71704529d), [`79f6088`](https://github.com/clauderic/dnd-kit/commit/79f6088dab2d4e7443743f85b329a25a023ecd87), [`a76cd5a`](https://github.com/clauderic/dnd-kit/commit/a76cd5abcc0b17eae20d4a6256d95b47f2e9d050)]:
- @dnd-kit/core@1.2.0
## 1.0.2
### Patch Changes
- [`423610c`](https://github.com/clauderic/dnd-kit/commit/423610ca48c5e5ca95545fdb5c5cfcfbd3d233ba) [#56](https://github.com/clauderic/dnd-kit/pull/56) Thanks [@clauderic](https://github.com/clauderic)! - Add MIT license to package.json and distributed files
- Updated dependencies [[`423610c`](https://github.com/clauderic/dnd-kit/commit/423610ca48c5e5ca95545fdb5c5cfcfbd3d233ba), [`594a24e`](https://github.com/clauderic/dnd-kit/commit/594a24e61e2fb559bceab8b50a07ceeeadf86417), [`fd25eaf`](https://github.com/clauderic/dnd-kit/commit/fd25eaf7c114f73918bf83801890d970c9b56d18)]:
- @dnd-kit/core@1.0.2
- @dnd-kit/utilities@1.0.2
## 1.0.1
### Patch Changes
- [`0b343c7`](https://github.com/clauderic/dnd-kit/commit/0b343c7e88a68351f8a39f643e9f26b8e046ef48) [#52](https://github.com/clauderic/dnd-kit/pull/52) Thanks [@clauderic](https://github.com/clauderic)! - Add repository entry to package.json files
- [`78a7b67`](https://github.com/clauderic/dnd-kit/commit/78a7b672e856c911e7cfdd4ec8f6e4d0e7c36531) Thanks [@clauderic](https://github.com/clauderic)! - Fix an issue with the sortable keyboard coordinate getter not excluding disabled droppables.
- Updated dependencies [[`0b343c7`](https://github.com/clauderic/dnd-kit/commit/0b343c7e88a68351f8a39f643e9f26b8e046ef48), [`5194696`](https://github.com/clauderic/dnd-kit/commit/5194696b4b91f26379cd3e6c11b2d66c92d32c5b), [`310bbd6`](https://github.com/clauderic/dnd-kit/commit/310bbd6370e85f8fb16cad149e6254600a5beb3a)]:
- @dnd-kit/utilities@1.0.1
- @dnd-kit/core@1.0.1
## 1.0.0
### Major Changes
- [`2912350`](https://github.com/clauderic/dnd-kit/commit/2912350c5008c2b0edda3bae30b5075a852dea63) Thanks [@clauderic](https://github.com/clauderic)! - Initial public release.
### Patch Changes
- Updated dependencies [[`2912350`](https://github.com/clauderic/dnd-kit/commit/2912350c5008c2b0edda3bae30b5075a852dea63)]:
- @dnd-kit/core@1.0.0
- @dnd-kit/utilities@1.0.0
## 0.1.0
### Minor Changes
- [`7bd4568`](https://github.com/clauderic/dnd-kit/commit/7bd4568e9f339552fd73a9a4c888460b11195a5e) [#30](https://github.com/clauderic/dnd-kit/pull/30) - Initial beta release, authored by [@clauderic](https://github.com/clauderic).
### Patch Changes
- Updated dependencies [[`7bd4568`](https://github.com/clauderic/dnd-kit/commit/7bd4568e9f339552fd73a9a4c888460b11195a5e)]:
- @dnd-kit/core@0.1.0
- @dnd-kit/utilities@0.1.0
@@ -0,0 +1,12 @@
/**
* @license
* Copyright (c) 2016, Contributors
* SPDX-License-Identifier: ISC
*/
export var DefaultValuesForTypeKey;
(function (DefaultValuesForTypeKey) {
DefaultValuesForTypeKey["BOOLEAN"] = "boolean";
DefaultValuesForTypeKey["STRING"] = "string";
DefaultValuesForTypeKey["NUMBER"] = "number";
DefaultValuesForTypeKey["ARRAY"] = "array";
})(DefaultValuesForTypeKey || (DefaultValuesForTypeKey = {}));
@@ -0,0 +1,128 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference no-default-lib="true"/>
interface ProxyHandler<T extends object> {
/**
* A trap method for a function call.
* @param target The original callable object which is being proxied.
*/
apply?(target: T, thisArg: any, argArray: any[]): any;
/**
* A trap for the `new` operator.
* @param target The original object which is being proxied.
* @param newTarget The constructor that was originally called.
*/
construct?(target: T, argArray: any[], newTarget: Function): object;
/**
* A trap for `Object.defineProperty()`.
* @param target The original object which is being proxied.
* @returns A `Boolean` indicating whether or not the property has been defined.
*/
defineProperty?(target: T, property: string | symbol, attributes: PropertyDescriptor): boolean;
/**
* A trap for the `delete` operator.
* @param target The original object which is being proxied.
* @param p The name or `Symbol` of the property to delete.
* @returns A `Boolean` indicating whether or not the property was deleted.
*/
deleteProperty?(target: T, p: string | symbol): boolean;
/**
* A trap for getting a property value.
* @param target The original object which is being proxied.
* @param p The name or `Symbol` of the property to get.
* @param receiver The proxy or an object that inherits from the proxy.
*/
get?(target: T, p: string | symbol, receiver: any): any;
/**
* A trap for `Object.getOwnPropertyDescriptor()`.
* @param target The original object which is being proxied.
* @param p The name of the property whose description should be retrieved.
*/
getOwnPropertyDescriptor?(target: T, p: string | symbol): PropertyDescriptor | undefined;
/**
* A trap for the `[[GetPrototypeOf]]` internal method.
* @param target The original object which is being proxied.
*/
getPrototypeOf?(target: T): object | null;
/**
* A trap for the `in` operator.
* @param target The original object which is being proxied.
* @param p The name or `Symbol` of the property to check for existence.
*/
has?(target: T, p: string | symbol): boolean;
/**
* A trap for `Object.isExtensible()`.
* @param target The original object which is being proxied.
*/
isExtensible?(target: T): boolean;
/**
* A trap for `Reflect.ownKeys()`.
* @param target The original object which is being proxied.
*/
ownKeys?(target: T): ArrayLike<string | symbol>;
/**
* A trap for `Object.preventExtensions()`.
* @param target The original object which is being proxied.
*/
preventExtensions?(target: T): boolean;
/**
* A trap for setting a property value.
* @param target The original object which is being proxied.
* @param p The name or `Symbol` of the property to set.
* @param receiver The object to which the assignment was originally directed.
* @returns A `Boolean` indicating whether or not the property was set.
*/
set?(target: T, p: string | symbol, newValue: any, receiver: any): boolean;
/**
* A trap for `Object.setPrototypeOf()`.
* @param target The original object which is being proxied.
* @param newPrototype The object's new prototype or `null`.
*/
setPrototypeOf?(target: T, v: object | null): boolean;
}
interface ProxyConstructor {
/**
* Creates a revocable Proxy object.
* @param target A target object to wrap with Proxy.
* @param handler An object whose properties define the behavior of Proxy when an operation is attempted on it.
*/
revocable<T extends object>(target: T, handler: ProxyHandler<T>): { proxy: T; revoke: () => void; };
/**
* Creates a Proxy object. The Proxy object allows you to create an object that can be used in place of the
* original object, but which may redefine fundamental Object operations like getting, setting, and defining
* properties. Proxy objects are commonly used to log property accesses, validate, format, or sanitize inputs.
* @param target A target object to wrap with Proxy.
* @param handler An object whose properties define the behavior of Proxy when an operation is attempted on it.
*/
new <T extends object>(target: T, handler: ProxyHandler<T>): T;
}
declare var Proxy: ProxyConstructor;
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,+DAA+D;AAC/D,qDAAqD;AACrD,4DAA4D;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,CAAA;AAQlB,MAAM,SAAS,GAAG,CAAC,OAAY,EAAwB,EAAE,CACvD,CAAC,CAAC,OAAO;IACT,OAAO,OAAO,KAAK,QAAQ;IAC3B,OAAO,OAAO,CAAC,cAAc,KAAK,UAAU;IAC5C,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU;IAClC,OAAO,OAAO,CAAC,UAAU,KAAK,UAAU;IACxC,OAAO,OAAO,CAAC,SAAS,KAAK,UAAU;IACvC,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU;IAClC,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ;IAC/B,OAAO,OAAO,CAAC,EAAE,KAAK,UAAU,CAAA;AAElC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAA;AACtD,MAAM,MAAM,GAAqD,UAAU,CAAA;AAC3E,MAAM,oBAAoB,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AAwB/D,2BAA2B;AAC3B,MAAM,OAAO;IACX,OAAO,GAAY;QACjB,SAAS,EAAE,KAAK;QAChB,IAAI,EAAE,KAAK;KACZ,CAAA;IAED,SAAS,GAAc;QACrB,SAAS,EAAE,EAAE;QACb,IAAI,EAAE,EAAE;KACT,CAAA;IAED,KAAK,GAAW,CAAC,CAAA;IACjB,EAAE,GAAW,IAAI,CAAC,MAAM,EAAE,CAAA;IAE1B;QACE,IAAI,MAAM,CAAC,YAAY,CAAC,EAAE;YACxB,OAAO,MAAM,CAAC,YAAY,CAAC,CAAA;SAC5B;QACD,oBAAoB,CAAC,MAAM,EAAE,YAAY,EAAE;YACzC,KAAK,EAAE,IAAI;YACX,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,KAAK;YACjB,YAAY,EAAE,KAAK;SACpB,CAAC,CAAA;IACJ,CAAC;IAED,EAAE,CAAC,EAAa,EAAE,EAAW;QAC3B,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAC7B,CAAC;IAED,cAAc,CAAC,EAAa,EAAE,EAAW;QACvC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QAC/B,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QAC1B,qBAAqB;QACrB,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE;YACZ,OAAM;SACP;QACD,oBAAoB;QACpB,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;YAChC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAA;SAChB;aAAM;YACL,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;SAClB;IACH,CAAC;IAED,IAAI,CACF,EAAa,EACb,IAA+B,EAC/B,MAA6B;QAE7B,IAAI,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;YACpB,OAAO,KAAK,CAAA;SACb;QACD,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,CAAA;QACvB,IAAI,GAAG,GAAY,KAAK,CAAA;QACxB,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE;YACnC,GAAG,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,IAAI,IAAI,GAAG,CAAA;SACvC;QACD,IAAI,EAAE,KAAK,MAAM,EAAE;YACjB,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,GAAG,CAAA;SAClD;QACD,OAAO,GAAG,CAAA;IACZ,CAAC;CACF;AAED,MAAe,cAAc;CAI5B;AAED,MAAM,cAAc,GAAG,CAA2B,OAAU,EAAE,EAAE;IAC9D,OAAO;QACL,MAAM,CAAC,EAAW,EAAE,IAA+B;YACjD,OAAO,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,CAAA;QACjC,CAAC;QACD,IAAI;YACF,OAAO,OAAO,CAAC,IAAI,EAAE,CAAA;QACvB,CAAC;QACD,MAAM;YACJ,OAAO,OAAO,CAAC,MAAM,EAAE,CAAA;QACzB,CAAC;KACF,CAAA;AACH,CAAC,CAAA;AAED,MAAM,kBAAmB,SAAQ,cAAc;IAC7C,MAAM;QACJ,OAAO,GAAG,EAAE,GAAE,CAAC,CAAA;IACjB,CAAC;IACD,IAAI,KAAI,CAAC;IACT,MAAM,KAAI,CAAC;CACZ;AAED,MAAM,UAAW,SAAQ,cAAc;IACrC,gDAAgD;IAChD,oCAAoC;IACpC,qBAAqB;IACrB,OAAO,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAA;IAC5D,oBAAoB;IACpB,QAAQ,GAAG,IAAI,OAAO,EAAE,CAAA;IACxB,QAAQ,CAAW;IACnB,oBAAoB,CAAmB;IACvC,0BAA0B,CAAyB;IAEnD,aAAa,GAA2C,EAAE,CAAA;IAC1D,OAAO,GAAY,KAAK,CAAA;IAExB,YAAY,OAAkB;QAC5B,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QACvB,mCAAmC;QACnC,IAAI,CAAC,aAAa,GAAG,EAAE,CAAA;QACvB,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE;YACzB,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE;gBAC7B,sDAAsD;gBACtD,uDAAuD;gBACvD,qDAAqD;gBACrD,mBAAmB;gBACnB,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;gBAC9C,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAA;gBAC7B,mEAAmE;gBACnE,oEAAoE;gBACpE,kEAAkE;gBAClE,kEAAkE;gBAClE,iEAAiE;gBACjE,WAAW;gBACX,qBAAqB;gBACrB,MAAM,CAAC,GAAG,OAET,CAAA;gBACD,IACE,OAAO,CAAC,CAAC,uBAAuB,KAAK,QAAQ;oBAC7C,OAAO,CAAC,CAAC,uBAAuB,CAAC,KAAK,KAAK,QAAQ,EACnD;oBACA,KAAK,IAAI,CAAC,CAAC,uBAAuB,CAAC,KAAK,CAAA;iBACzC;gBACD,oBAAoB;gBACpB,IAAI,SAAS,CAAC,MAAM,KAAK,KAAK,EAAE;oBAC9B,IAAI,CAAC,MAAM,EAAE,CAAA;oBACb,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,CAAC,CAAA;oBACjD,qBAAqB;oBACrB,MAAM,CAAC,GAAG,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAA;oBAC/C,IAAI,CAAC,GAAG;wBAAE,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;oBACtC,oBAAoB;iBACrB;YACH,CAAC,CAAA;SACF;QAED,IAAI,CAAC,0BAA0B,GAAG,OAAO,CAAC,UAAU,CAAA;QACpD,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAA;IAC1C,CAAC;IAED,MAAM,CAAC,EAAW,EAAE,IAA+B;QACjD,qBAAqB;QACrB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YAC7B,OAAO,GAAG,EAAE,GAAE,CAAC,CAAA;SAChB;QACD,oBAAoB;QAEpB,IAAI,IAAI,CAAC,OAAO,KAAK,KAAK,EAAE;YAC1B,IAAI,CAAC,IAAI,EAAE,CAAA;SACZ;QAED,MAAM,EAAE,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAA;QAClD,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;QACxB,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,EAAE,EAAE,CAAC,CAAA;YACpC,IACE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC;gBAC5C,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,MAAM,KAAK,CAAC,EACjD;gBACA,IAAI,CAAC,MAAM,EAAE,CAAA;aACd;QACH,CAAC,CAAA;IACH,CAAC;IAED,IAAI;QACF,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,OAAM;SACP;QACD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;QAEnB,yDAAyD;QACzD,4DAA4D;QAC5D,4DAA4D;QAC5D,2BAA2B;QAC3B,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC,CAAA;QAExB,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE;YACzB,IAAI;gBACF,MAAM,EAAE,GAAG,IALine truncated
@@ -0,0 +1,24 @@
"use client";
import "../chunk-NSERPD52.mjs";
import {
table_column_default
} from "../chunk-TSPNSPCL.mjs";
import {
table_header_default
} from "../chunk-YRZGWF2W.mjs";
import {
table_row_default
} from "../chunk-CIL4Y7FA.mjs";
import {
table_body_default
} from "../chunk-FKPXBCGS.mjs";
import {
table_cell_default
} from "../chunk-F3UDT23P.mjs";
export {
table_body_default as TableBody,
table_cell_default as TableCell,
table_column_default as TableColumn,
table_header_default as TableHeader,
table_row_default as TableRow
};
@@ -0,0 +1,2 @@
export declare const SPACE_SEPARATOR_REGEX: RegExp;
export declare const WHITE_SPACE_REGEX: RegExp;
@@ -0,0 +1,303 @@
/**
* @fileoverview Report missing `key` props in iterators/collection literals.
* @author Ben Mosher
*/
'use strict';
const hasProp = require('jsx-ast-utils/hasProp');
const propName = require('jsx-ast-utils/propName');
const values = require('object.values');
const docsUrl = require('../util/docsUrl');
const pragmaUtil = require('../util/pragma');
const report = require('../util/report');
const astUtil = require('../util/ast');
const getText = require('../util/eslint').getText;
// ------------------------------------------------------------------------------
// Rule Definition
// ------------------------------------------------------------------------------
const defaultOptions = {
checkFragmentShorthand: false,
checkKeyMustBeforeSpread: false,
warnOnDuplicates: false,
};
const messages = {
missingIterKey: 'Missing "key" prop for element in iterator',
missingIterKeyUsePrag: 'Missing "key" prop for element in iterator. Shorthand fragment syntax does not support providing keys. Use {{reactPrag}}.{{fragPrag}} instead',
missingArrayKey: 'Missing "key" prop for element in array',
missingArrayKeyUsePrag: 'Missing "key" prop for element in array. Shorthand fragment syntax does not support providing keys. Use {{reactPrag}}.{{fragPrag}} instead',
keyBeforeSpread: '`key` prop must be placed before any `{...spread}, to avoid conflicting with React’s new JSX transform: https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html`',
nonUniqueKeys: '`key` prop must be unique',
};
/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
docs: {
description: 'Disallow missing `key` props in iterators/collection literals',
category: 'Possible Errors',
recommended: true,
url: docsUrl('jsx-key'),
},
messages,
schema: [{
type: 'object',
properties: {
checkFragmentShorthand: {
type: 'boolean',
default: defaultOptions.checkFragmentShorthand,
},
checkKeyMustBeforeSpread: {
type: 'boolean',
default: defaultOptions.checkKeyMustBeforeSpread,
},
warnOnDuplicates: {
type: 'boolean',
default: defaultOptions.warnOnDuplicates,
},
},
additionalProperties: false,
}],
},
create(context) {
const options = Object.assign({}, defaultOptions, context.options[0]);
const checkFragmentShorthand = options.checkFragmentShorthand;
const checkKeyMustBeforeSpread = options.checkKeyMustBeforeSpread;
const warnOnDuplicates = options.warnOnDuplicates;
const reactPragma = pragmaUtil.getFromContext(context);
const fragmentPragma = pragmaUtil.getFragmentFromContext(context);
function isKeyAfterSpread(attributes) {
let hasFoundSpread = false;
return attributes.some((attribute) => {
if (attribute.type === 'JSXSpreadAttribute') {
hasFoundSpread = true;
return false;
}
if (attribute.type !== 'JSXAttribute') {
return false;
}
return hasFoundSpread && propName(attribute) === 'key';
});
}
function checkIteratorElement(node) {
if (node.type === 'JSXElement') {
if (!hasProp(node.openingElement.attributes, 'key')) {
report(context, messages.missingIterKey, 'missingIterKey', { node });
} else {
const attrs = node.openingElement.attributes;
if (checkKeyMustBeforeSpread && isKeyAfterSpread(attrs)) {
report(context, messages.keyBeforeSpread, 'keyBeforeSpread', { node });
}
}
} else if (checkFragmentShorthand && node.type === 'JSXFragment') {
report(context, messages.missingIterKeyUsePrag, 'missingIterKeyUsePrag', {
node,
data: {
reactPrag: reactPragma,
fragPrag: fragmentPragma,
},
});
}
}
function getReturnStatements(node) {
const returnStatements = arguments[1] || [];
if (node.type === 'IfStatement') {
if (node.consequent) {
getReturnStatements(node.consequent, returnStatements);
}
if (node.alternate) {
getReturnStatements(node.alternate, returnStatements);
}
} else if (node.type === 'ReturnStatement') {
returnStatements.push(node);
} else if (Array.isArray(node.body)) {
node.body.forEach((item) => {
if (item.type === 'IfStatement') {
getReturnStatements(item, returnStatements);
}
if (item.type === 'ReturnStatement') {
returnStatements.push(item);
}
});
}
return returnStatements;
}
/**
* Checks if the given node is a function expression or arrow function,
* and checks if there is a missing key prop in return statement's arguments
* @param {ASTNode} node
*/
function checkFunctionsBlockStatement(node) {
if (astUtil.isFunctionLikeExpression(node)) {
if (node.body.type === 'BlockStatement') {
getReturnStatements(node.body)
.filter((returnStatement) => returnStatement && returnStatement.argument)
.forEach((returnStatement) => {
checkIteratorElement(returnStatement.argument);
});
}
}
}
/**
* Checks if the given node is an arrow function that has an JSX Element or JSX Fragment in its body,
* and the JSX is missing a key prop
* @param {ASTNode} node
*/
function checkArrowFunctionWithJSX(node) {
const isArrFn = node && node.type === 'ArrowFunctionExpression';
const shouldCheckNode = (n) => n && (n.type === 'JSXElement' || n.type === 'JSXFragment');
if (isArrFn && shouldCheckNode(node.body)) {
checkIteratorElement(node.body);
}
if (node.body.type === 'ConditionalExpression') {
if (shouldCheckNode(node.body.consequent)) {
checkIteratorElement(node.body.consequent);
}
if (shouldCheckNode(node.body.alternate)) {
checkIteratorElement(node.body.alternate);
}
} else if (node.body.type === 'LogicalExpression' && shouldCheckNode(node.body.right)) {
checkIteratorElement(node.body.right);
}
}
const childrenToArraySelector = `:matches(
CallExpression
[callee.object.object.name=${reactPragma}]
[callee.object.property.name=Children]
[callee.property.name=toArray],
CallExpression
[callee.object.name=Children]
[callee.property.name=toArray]
)`.replace(/\s/g, '');
let isWithinChildrenToArray = false;
const seen = new WeakSet();
return {
[childrenToArraySelector]() {
isWithinChildrenToArray = true;
},
[`${childrenToArraySelector}:exit`]() {
isWithinChildrenToArray = false;
},
'ArrayExpression, JSXElement > JSXElement'(node) {
if (isWithinChildrenToArray) {
return;
}
const jsx = (node.type === 'ArrayExpression' ? node.elements : node.parent.children).filter((x) => x && x.type === 'JSXElement');
if (jsx.length === 0) {
return;
}
const map = {};
jsx.forEach((element) => {
const attrs = element.openingElement.attributes;
const keys = attrs.filter((x) => x.name && x.name.name === 'key');
if (keys.length === 0) {
if (node.type === 'ArrayExpression') {
report(context, messages.missingArrayKey, 'missingArrayKey', {
node: element,
});
}
} else {
keys.forEach((attr) => {
const value = getText(context, attr.value);
if (!map[value]) { map[value] = []; }
map[value].push(attr);
if (checkKeyMustBeforeSpread && isKeyAfterSpread(attrs)) {
report(context, messages.keyBeforeSpread, 'keyBeforeSpread', {
node: node.type === 'ArrayExpression' ? node : node.parent,
});
}
});
}
});
if (warnOnDuplicates) {
values(map).filter((v) => v.length > 1).forEach((v) => {
v.forEach((n) => {
if (!seen.has(n)) {
seen.add(n);
report(context, messages.nonUniqueKeys, 'nonUniqueKeys', {
node: n,
});
}
});
});
}
},
JSXFragment(node) {
if (!checkFragmentShorthand || isWithinChildrenToArray) {
return;
}
if (node.parent.type === 'ArrayExpression') {
report(context, messages.missingArrayKeyUsePrag, 'missingArrayKeyUsePrag', {
node,
data: {
reactPrag: reactPragma,
fragPrag: fragmentPragma,
},
});
}
},
// Array.prototype.map
// eslint-disable-next-line no-multi-str
'CallExpression[callee.type="MemberExpression"][callee.property.name="map"],\
CallExpression[callee.type="OptionalMemberExpression"][callee.property.name="map"],\
OptionalCallExpression[callee.type="MemberExpression"][callee.property.name="map"],\
OptionalCallExpression[callee.type="OptionalMemberExpression"][callee.property.name="map"]'(node) {
if (isWithinChildrenToArray) {
return;
}
const fn = node.arguments.length > 0 && node.arguments[0];
if (!fn || !astUtil.isFunctionLikeExpression(fn)) {
return;
}
checkArrowFunctionWithJSX(fn);
checkFunctionsBlockStatement(fn);
},
// Array.from
'CallExpression[callee.type="MemberExpression"][callee.property.name="from"]'(node) {
if (isWithinChildrenToArray) {
return;
}
const fn = node.arguments.length > 1 && node.arguments[1];
if (!astUtil.isFunctionLikeExpression(fn)) {
return;
}
checkArrowFunctionWithJSX(fn);
checkFunctionsBlockStatement(fn);
},
};
},
};
@@ -0,0 +1 @@
{"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["../../src/decode.ts"],"names":[],"mappings":"AAsBA,oBAAY,YAAY;IACpB,YAAY,QAAwB;IACpC,aAAa,QAAwB;IACrC,UAAU,MAAwB;CACrC;AAuCD,oBAAY,YAAY;IACpB,8DAA8D;IAC9D,MAAM,IAAI;IACV,uDAAuD;IACvD,MAAM,IAAI;IACV,oEAAoE;IACpE,SAAS,IAAI;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,uCAAuC,IAAI,IAAI,CAAC;IAChD,0CAA0C,CACtC,kBAAkB,EAAE,MAAM,GAC3B,IAAI,CAAC;IACR,iCAAiC,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACzD;AAED;;GAEG;AACH,qBAAa,aAAa;IAElB,wCAAwC;IACxC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B;;;;;;;;OAQG;IACH,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,gDAAgD;IAChD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;;IAbxB,wCAAwC;IACvB,UAAU,EAAE,WAAW;IACxC;;;;;;;;OAQG;IACc,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI;IACtE,gDAAgD;IAC/B,MAAM,CAAC,EAAE,mBAAmB,GAAG,SAAS;IAG7D,wCAAwC;IACxC,OAAO,CAAC,KAAK,CAAkC;IAC/C,6DAA6D;IAC7D,OAAO,CAAC,QAAQ,CAAK;IACrB;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAK;IAEnB,4CAA4C;IAC5C,OAAO,CAAC,SAAS,CAAK;IACtB,6DAA6D;IAC7D,OAAO,CAAC,MAAM,CAAK;IACnB,kDAAkD;IAClD,OAAO,CAAC,UAAU,CAAuB;IAEzC,+CAA+C;IAC/C,WAAW,CAAC,UAAU,EAAE,YAAY,GAAG,IAAI;IAS3C;;;;;;;;;;OAUG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IA8B5C;;;;;;;;OAQG;IACH,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,kBAAkB;IAe1B;;;;;;;;OAQG;IACH,OAAO,CAAC,eAAe;IAkBvB;;;;;;;;OAQG;IACH,OAAO,CAAC,mBAAmB;IAkB3B;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,iBAAiB;IA6BzB;;;;;;;;OAQG;IACH,OAAO,CAAC,gBAAgB;IAsDxB;;;;OAIG;IACH,OAAO,CAAC,4BAA4B;IAYpC;;;;;;;;OAQG;IACH,OAAO,CAAC,mBAAmB;IAqB3B;;;;;;OAMG;IACH,GAAG,IAAI,MAAM;CA6BhB;AAoDD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC3B,UAAU,EAAE,WAAW,EACvB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,GACb,MAAM,CAsCR;AAKD;;;;;;GAMG;AACH,wBAAgB,UAAU,CACtB,UAAU,EAAE,MAAM,EAClB,IAAI,GAAE,YAAkC,GACzC,MAAM,CAER;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAEjE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEnD;AAGD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE/D,OAAO,EACH,eAAe,EACf,gBAAgB,EAChB,aAAa,GAChB,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1 @@
module.exports={C:{"30":0.00353,"52":0.01058,"115":0.15519,"123":0.00353,"125":0.05291,"127":0.00353,"128":0.00353,"131":0.00353,"134":0.00353,"140":0.02116,"141":0.02116,"142":0.03527,"143":0.37739,"144":0.33154,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 124 126 129 130 132 133 135 136 137 138 139 145 146 147 3.5 3.6"},D:{"35":0.00353,"39":0.00705,"40":0.00705,"41":0.00705,"42":0.00705,"43":0.00353,"44":0.01058,"45":0.01058,"46":0.01058,"47":0.01411,"48":0.01058,"49":0.01764,"50":0.01411,"51":0.01058,"52":0.01058,"53":0.00705,"54":0.01058,"55":0.01411,"56":0.02116,"57":0.01058,"58":0.02116,"59":0.00705,"60":0.01058,"64":0.00353,"65":0.00705,"69":0.00353,"70":0.02116,"71":0.00705,"73":0.00353,"74":0.01058,"76":0.00353,"78":0.01764,"79":0.07054,"80":0.01764,"81":0.00705,"83":0.00353,"84":0.01058,"86":0.01058,"87":0.05996,"88":0.04232,"89":0.02116,"91":0.00705,"93":0.00353,"94":0.00353,"95":0.00705,"96":0.00705,"97":0.00353,"98":0.00353,"99":0.00353,"100":0.00353,"101":0.00353,"102":0.00705,"103":0.00353,"104":0.00353,"105":0.00353,"106":0.01058,"107":0.00705,"108":0.01411,"109":3.67513,"110":0.00353,"111":0.01058,"112":0.01411,"114":0.01764,"116":0.00705,"118":0.00705,"119":0.01411,"120":0.0388,"122":0.03527,"123":0.01764,"124":0.1693,"125":2.17263,"126":0.02116,"127":0.00353,"128":0.0388,"129":0.03174,"130":0.01411,"131":0.08818,"132":0.03527,"133":0.03527,"134":0.08818,"135":0.06349,"136":0.05996,"137":0.05996,"138":0.1834,"139":0.43735,"140":2.7299,"141":6.91645,"142":0.11286,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 36 37 38 61 62 63 66 67 68 72 75 77 85 90 92 113 115 117 121 143 144 145"},F:{"20":0.00353,"36":0.00353,"37":0.00353,"45":0.00353,"73":0.00705,"79":0.02822,"83":0.00353,"84":0.00353,"86":0.00353,"89":0.00353,"90":0.00353,"91":0.02469,"92":0.03174,"95":0.12345,"112":0.00353,"118":0.00705,"120":0.07407,"121":0.00353,"122":0.54316,_:"9 11 12 15 16 17 18 19 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 38 39 40 41 42 43 44 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 74 75 76 77 78 80 81 82 85 87 88 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 113 114 115 116 117 119 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"13":0.00353,"14":0.00705,"16":0.00353,"17":0.00353,"18":0.01411,"90":0.00353,"92":0.05996,"100":0.01058,"109":0.02116,"112":0.00353,"114":0.25394,"117":0.00353,"119":0.00353,"120":0.01058,"122":0.00705,"125":0.00705,"126":0.00705,"128":0.00705,"130":0.00705,"131":0.02822,"132":0.00353,"133":0.00353,"134":0.00705,"135":0.01764,"136":0.01411,"137":0.01058,"138":0.01058,"139":0.03174,"140":0.38092,"141":1.46018,_:"12 15 79 80 81 83 84 85 86 87 88 89 91 93 94 95 96 97 98 99 101 102 103 104 105 106 107 108 110 111 113 115 116 118 121 123 124 127 129 142"},E:{"14":0.02116,_:"0 4 5 6 7 8 9 10 11 12 13 15 3.1 3.2 6.1 7.1 9.1 10.1 11.1 12.1 13.1 15.1 16.2 16.3 16.4 16.5 17.0 17.2 26.1 26.2","5.1":0.01764,"14.1":0.01411,"15.2-15.3":0.00353,"15.4":0.00353,"15.5":0.00353,"15.6":0.08112,"16.0":0.00353,"16.1":0.01411,"16.6":0.01411,"17.1":0.00353,"17.3":0.00353,"17.4":0.00705,"17.5":0.01764,"17.6":0.01764,"18.0":0.01058,"18.1":0.00353,"18.2":0.00705,"18.3":0.00353,"18.4":0.00705,"18.5-18.6":0.04585,"26.0":0.07407},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00079,"5.0-5.1":0,"6.0-6.1":0.00316,"7.0-7.1":0.00237,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00711,"10.0-10.2":0.00079,"10.3":0.01344,"11.0-11.2":0.19917,"11.3-11.4":0.00474,"12.0-12.1":0.00158,"12.2-12.5":0.03873,"13.0-13.1":0,"13.2":0.00395,"13.3":0.00158,"13.4-13.7":0.00632,"14.0-14.4":0.01344,"14.5-14.8":0.01423,"15.0-15.1":0.01344,"15.2-15.3":0.01027,"15.4":0.01186,"15.5":0.01344,"15.6-15.8":0.17546,"16.0":0.02371,"16.1":0.04426,"16.2":0.02292,"16.3":0.0411,"16.4":0.01027,"16.5":0.01818,"16.6-16.7":0.23473,"17.0":0.0166,"17.1":0.02529,"17.2":0.01818,"17.3":0.02687,"17.4":0.04742,"17.5":0.08141,"17.6-17.7":0.20549,"18.0":0.04663,"18.1":0.09642,"18.2":0.05216,"18.3":0.16755,"18.4":0.08615,"18.5-18.6":4.39278,"26.0":0.54297,"26.1":0.01976},P:{"4":0.0504,"20":0.01008,"21":0.01008,"22":0.03024,"23":0.02016,"24":0.1008,"25":0.13104,"26":0.06048,"27":0.20161,"28":1.01812,"29":0.06048,_:"5.0-5.4 10.1 14.0 16.0 17.0","6.2-6.4":0.06048,"7.2-7.4":0.07056,"8.2":0.01008,"9.2":0.02016,"11.1-11.2":0.02016,"12.0":0.01008,"13.0":0.02016,"15.0":0.01008,"18.0":0.01008,"19.0":0.01008},I:{"0":0.00646,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},K:{"0":1.40111,_:"10 11 12 11.1 11.5 12.1"},A:{"9":0.03229,"11":0.02767,_:"6 7 8 10 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.07768},Q:{"14.9Line truncated
@@ -0,0 +1,86 @@
/**
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { IDisposable } from 'common/Types';
import { IEvent } from 'common/EventEmitter';
import { IRenderDimensions } from 'browser/renderer/shared/Types';
export interface IRequestRedrawEvent {
start: number;
end: number;
}
/**
* Note that IRenderer implementations should emit the refresh event after
* rendering rows to the screen.
*/
export interface IRenderer extends IDisposable {
readonly dimensions: IRenderDimensions;
/**
* Fires when the renderer is requesting to be redrawn on the next animation
* frame but is _not_ a result of content changing (eg. selection changes).
*/
readonly onRequestRedraw: IEvent<IRequestRedrawEvent>;
handleDevicePixelRatioChange(): void;
handleResize(cols: number, rows: number): void;
handleCharSizeChanged(): void;
handleBlur(): void;
handleFocus(): void;
handleSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void;
handleCursorMove(): void;
handleOptionsChanged(): void;
clear(): void;
renderRows(start: number, end: number): void;
clearTextureAtlas?(): void;
}
export interface IRenderLayer extends IDisposable {
readonly canvas: HTMLCanvasElement;
readonly cacheCanvas: HTMLCanvasElement;
readonly onAddTextureAtlasCanvas: IEvent<HTMLCanvasElement>;
/**
* Called when the terminal loses focus.
*/
handleBlur(): void;
/**
* Called when the terminal gets focus.
*/
handleFocus(): void;
/**
* Called when the cursor is moved.
*/
handleCursorMove(): void;
/**
* Called when the data in the grid has changed (or needs to be rendered
* again).
*/
handleGridChanged(startRow: number, endRow: number): void;
/**
* Calls when the selection changes.
*/
handleSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void;
/**
* Resize the render layer.
*/
resize(dim: IRenderDimensions): void;
/**
* Clear the state of the render layer.
*/
reset(): void;
/**
* Clears the texture atlas.
*/
clearTextureAtlas(): void;
}
@@ -0,0 +1,111 @@
'use strict';
var normalize = require('value-or-function');
var slice = Array.prototype.slice;
function createResolver(config, options) {
// TODO: should the config object be validated?
config = config || {};
options = options || {};
var resolver = {
resolve: resolve,
};
// Keep constants separately
var constants = {};
function resolveConstant(key) {
if (constants.hasOwnProperty(key)) {
return constants[key];
}
var definition = config[key];
// Ignore options that are not defined
if (!definition) {
return;
}
var option = options[key];
if (option != null) {
if (typeof option === 'function') {
return;
}
option = normalize.call(resolver, definition.type, option);
if (option != null) {
constants[key] = option;
return option;
}
}
var fallback = definition.default;
if (option == null && typeof fallback !== 'function') {
constants[key] = fallback;
return fallback;
}
}
// Keep requested keys to detect (and disallow) recursive resolution
var stack = [];
function resolve(key) {
var option = resolveConstant(key);
if (option != null) {
return option;
}
var definition = config[key];
// Ignore options that are not defined
if (!definition) {
return;
}
if (stack.indexOf(key) >= 0) {
throw new Error('Recursive resolution denied.');
}
option = options[key];
var fallback = definition.default;
var appliedArgs = slice.call(arguments, 1);
var args = [definition.type, option].concat(appliedArgs);
function toResolve() {
stack.push(key);
var option = normalize.apply(resolver, args);
if (option == null) {
option = fallback;
if (typeof option === 'function') {
option = option.apply(resolver, appliedArgs);
}
}
return option;
}
function onResolve() {
stack.pop();
}
return tryResolve(toResolve, onResolve);
}
return resolver;
}
function tryResolve(toResolve, onResolve) {
try {
return toResolve();
} finally {
onResolve();
}
}
module.exports = createResolver;
@@ -0,0 +1,105 @@
# 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.6](https://github.com/es-shims/Array.prototype.findLastIndex/compare/v1.2.5...v1.2.6) - 2025-03-14
### Commits
- [Dev Deps] update `@es-shims/api`, `@ljharb/eslint-config`, `auto-changelog`, `es-value-fixtures`, `for-each`, `globalthis`, `has-strict-mode`, `object-inspect`, `tape` [`2012a88`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/2012a880c41f74183bcfa55df7c800e48ca192e0)
- [Deps] update `call-bind`, `es-abstract`, `es-object-atoms`, `es-shim-unscopables` [`1c9fd19`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/1c9fd195dd01ff8546ef20ae11b5748b390e12de)
- [Refactor] use `call-bound` directly [`78722d3`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/78722d3b00af5523e4071d87d9d2746d61b705f3)
- [Tests] replace `aud` with `npm audit` [`cb689c1`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/cb689c1e11297a9202cd8f1c01299eb2aabde879)
- [Dev Deps] add missing peer dep [`d3c92c4`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/d3c92c4070999ee5d5716334e683a1acee54633b)
## [v1.2.5](https://github.com/es-shims/Array.prototype.findLastIndex/compare/v1.2.4...v1.2.5) - 2024-03-19
### Commits
- [meta] remove useless ESM [`4ed36ab`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/4ed36ab7bde25f3b265a2769163409a939d9a4de)
- [Deps] update `call-bind`, `es-abstract` [`a6e3816`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/a6e38162c958d3a54c73094a84fd27e9e48992d3)
- [Refactor] use `es-object-atoms` where possible [`3fbee9b`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/3fbee9b07d97a472b59204360620a491ff1f3cdd)
- [Dev Deps] update `hasown`, `tape` [`dc6356c`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/dc6356c69902912aa1eaee0f5677c6c64fb8ee11)
## [v1.2.4](https://github.com/es-shims/Array.prototype.findLastIndex/compare/v1.2.3...v1.2.4) - 2024-02-05
### Commits
- [Deps] update `call-bind`, `define-properties`, `es-abstract`, `es-shim-unscopables`, `get-intrinsic` [`b689455`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/b689455f6194d84d929bd678755a175aa63b1b37)
- [Refactor] use `es-errors`, so things that only need those do not need `get-intrinsic` [`ca636e6`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/ca636e60abae73755c613117f9a8eccb49a32f48)
- [Tests] use `functions-have-names` [`b91692c`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/b91692c2a695c0065805fcb4f6b6f081d27852c8)
- [Dev Deps] update `aud`, `npmignore`, `tape` [`4f87dff`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/4f87dff212fd5f0b05bdd412e669b4536e8b06f9)
- [Dev Deps] use `hasown` instead of `has` [`57ce292`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/57ce2920dc645c3dec27b3aa8bcbfff9b0bfd135)
- [Dev Deps] update `object-inspect`, `tape` [`fa74bab`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/fa74babe7cf90ec07b8c12c3ab10e89b7093e0b4)
## [v1.2.3](https://github.com/es-shims/Array.prototype.findLastIndex/compare/v1.2.2...v1.2.3) - 2023-08-29
### Commits
- [Deps] update `define-properties`, `es-abstract`, `get-intrinsic` [`27e8133`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/27e8133ccdccab46896da19cd26e3147691a77eb)
- [Tests] add passing test262 test [`678edb3`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/678edb3bc91b10298b4e72a5e471b1aa41f915dc)
- [Dev Deps] update `@es-shims/api`, `@ljharb/eslint-config`, `aud`, `object-inspect`, `tape` [`47abe8b`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/47abe8b2cc14ee1b9f4b785a9aa26947ba20305a)
- [Tests] use `globalthis` [`0cf9142`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/0cf914237811822d9d5268a057c0c9a108b8e5c0)
## [v1.2.2](https://github.com/es-shims/Array.prototype.findLastIndex/compare/v1.2.1...v1.2.2) - 2022-11-02
### Commits
- [meta] use `npmignore` to autogenerate an npmignore file [`f910dc6`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/f910dc6e5999e6941892232810ae9b3910d925ec)
- [Deps] update `es-abstract`, `get-intrinsic` [`6e44207`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/6e4420705d7435b8b9bb978e4858814ba0216fa5)
- [actions] update rebase action to use reusable workflow [`aac0471`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/aac0471a0b2f0f44765ac6055211b58f26fa6636)
- [Deps] update `define-properties`, `es-abstract`, `get-intrinsic` [`c1d1d70`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/c1d1d7083bfa8ab32a9e5560e4b2aa16ce9d0a6d)
- [Dev Deps] update `es-value-fixtures`, `object-inspect`, `tape` [`64c4c0f`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/64c4c0f6dda4793c5d9db5110ec82c6004bcc4ef)
- [Dev Deps] update `aud`, `tape` [`603fbac`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/603fbacf4d034298ff40ab6886f6af7031651acd)
- [Tests] add indication of whether it was shimmed [`7d711f6`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/7d711f6e68c9c5e4e0556946d026c159f7d82f22)
- [Tests] make nullish receiver tests more robust [`335cf53`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/335cf5381ec0bc7ce60de8824b736cb3b40918ae)
## [v1.2.1](https://github.com/es-shims/Array.prototype.findLastIndex/compare/v1.2.0...v1.2.1) - 2022-04-11
### Commits
- [Refactor] use `es-shim-unscopables` [`abe84ee`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/abe84ee8794ce9c84180bc01cf499a7bb2494b3d)
## [v1.2.0](https://github.com/es-shims/Array.prototype.findLastIndex/compare/v1.1.1...v1.2.0) - 2022-04-11
### Commits
- [actions] reuse common workflows [`670cc4c`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/670cc4c0b6f23b7f01d365a9afd2dd88ee2e4967)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@es-shims/api`, `object-inspect`, `safe-publish-latest`, `tape` [`11bc460`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/11bc460ab842d2a08c43b67aab182e0697d65308)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `object-inspect`, `tape` [`b076ad6`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/b076ad6ed9246f3139efa72d0ddbf2e0d861f982)
- [actions] update codecov uploader [`0d62d86`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/0d62d8602c2d3ecefdd0965c25cafb2a864c0903)
- [New] `shim`/`auto`: add `findLast` to `Symbol.unscopables` [`b09e4a6`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/b09e4a6a194366b45945c6d65cdcc64ca786e570)
- [Deps] update `es-abstract` [`024128c`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/024128c1abc5b58863859ea8b9cf4c1cb1df548b)
- [Deps] update `es-abstract` [`2dcab99`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/2dcab99e3ed43546cd6610b12d489d95d8e94d90)
## [v1.1.1](https://github.com/es-shims/Array.prototype.findLastIndex/compare/v1.1.0...v1.1.1) - 2021-10-01
### Commits
- [Refactor] remove unnecessary ESM files [`35161c7`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/35161c76758835dd3fbecdf0b5fbf41a3ce9f218)
- [Tests] add new tests from test262 [`e26fa25`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/e26fa256601f60b1feb5918e4fbcc76d0d773d13)
- [Deps] update `es-abstract` [`5ff80b1`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/5ff80b116f2e083ae72605275af0efec367f3a89)
- [readme] fix URLs [`b962fe2`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/b962fe225fac8a450624d861b5d6e444526bcf32)
- [Dev Deps] update `@ljharb/eslint-config`, `@es-shims/api` [`5aa11dd`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/5aa11dd23ee2bcdc9ca7d2d6007e7f44a9356743)
## [v1.1.0](https://github.com/es-shims/Array.prototype.findLastIndex/compare/v1.0.0...v1.1.0) - 2021-08-07
### Commits
- [New] add ESM entry points [`ac5ada3`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/ac5ada3d359ff267e6933dd817f4106e6de2c157)
- [Fix] ES3 engines: ensure nullish receiver throws [`4c6592a`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/4c6592a7962351e82bb1b06c79de496bf4bcd08d)
- [Dev Deps] update `eslint`, `@tape` [`6895166`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/6895166742a738a80d19ac4eaa6f12c97a5c7814)
- [Fix] add missing entry points to `exports` [`ac2f138`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/ac2f1384dcd9a9f736ce1c3c5dc7ac87e16c4f90)
- [Deps] update `es-abstract` [`c379fb7`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/c379fb7681ea3bb078891bf394756b1086bc43e7)
## v1.0.0 - 2021-07-13
### Commits
- Implementation & Tests [`cf5cae1`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/cf5cae1d78c0c74588a5baade5156950e17f4558)
- Initial commit [`2778f1c`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/2778f1cc708cc79d3bdbc20d5b84d210b9670b8a)
- npm init [`873482d`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/873482d650b6800e9484865c3b0d6d33664bcf9e)
- Only apps should have lockfiles [`b7c73ee`](https://github.com/es-shims/Array.prototype.findLastIndex/commit/b7c73ee858f01b0b1ff70800e09c0bbc2632e1a5)
@@ -0,0 +1,93 @@
{
"name": "@heroui/theme",
"version": "2.4.6",
"description": "The default theme for HeroUI components",
"keywords": [
"theme",
"theming",
"design",
"ui",
"components",
"classNames",
"css"
],
"author": "Junior Garcia <jrgarciadev@gmail.com>",
"homepage": "https://heroui.com",
"license": "MIT",
"main": "dist/index.js",
"sideEffects": false,
"files": [
"dist",
"config.js",
"config.d.ts",
"plugin.js",
"plugin.d.ts",
"colors.js",
"colors.d.ts"
],
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/heroui-inc/heroui.git",
"directory": "packages/core/theme"
},
"bugs": {
"url": "https://github.com/heroui-inc/heroui/issues"
},
"dependencies": {
"color": "^4.2.3",
"color2k": "^2.0.2",
"deepmerge": "4.3.1",
"flat": "^5.0.2",
"clsx": "^1.2.1",
"tailwind-variants": "^0.1.20",
"tailwind-merge": "^2.5.2",
"@heroui/shared-utils": "2.1.3"
},
"peerDependencies": {
"tailwindcss": ">=3.4.0"
},
"devDependencies": {
"@types/color": "^3.0.3",
"@types/flat": "^5.0.2",
"tailwindcss": "^3.4.0",
"clean-package": "2.2.0"
},
"tsup": {
"clean": true,
"target": "es2019",
"format": [
"cjs",
"esm"
]
},
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./plugin": {
"types": "./dist/plugin.d.ts",
"import": "./dist/plugin.mjs",
"require": "./dist/plugin.js"
},
"./colors": {
"types": "./dist/colors.d.ts",
"import": "./dist/colors.mjs",
"require": "./dist/colors.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,38 @@
import baseSlice from './_baseSlice.js';
import toInteger from './toInteger.js';
/**
* Creates a slice of `array` with `n` elements dropped from the beginning.
*
* @static
* @memberOf _
* @since 0.5.0
* @category Array
* @param {Array} array The array to query.
* @param {number} [n=1] The number of elements to drop.
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
* @returns {Array} Returns the slice of `array`.
* @example
*
* _.drop([1, 2, 3]);
* // => [2, 3]
*
* _.drop([1, 2, 3], 2);
* // => [3]
*
* _.drop([1, 2, 3], 5);
* // => []
*
* _.drop([1, 2, 3], 0);
* // => [1, 2, 3]
*/
function drop(array, n, guard) {
var length = array == null ? 0 : array.length;
if (!length) {
return [];
}
n = (guard || n === undefined) ? 1 : toInteger(n);
return baseSlice(array, n < 0 ? 0 : n, length);
}
export default drop;
@@ -0,0 +1,357 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var _types = require('./parser/tokenizer/types');
var _isAsyncOperation = require('./util/isAsyncOperation'); var _isAsyncOperation2 = _interopRequireDefault(_isAsyncOperation);
class TokenProcessor {
__init() {this.resultCode = ""}
// Array mapping input token index to optional string index position in the
// output code.
__init2() {this.resultMappings = new Array(this.tokens.length)}
__init3() {this.tokenIndex = 0}
constructor(
code,
tokens,
isFlowEnabled,
disableESTransforms,
helperManager,
) {;this.code = code;this.tokens = tokens;this.isFlowEnabled = isFlowEnabled;this.disableESTransforms = disableESTransforms;this.helperManager = helperManager;TokenProcessor.prototype.__init.call(this);TokenProcessor.prototype.__init2.call(this);TokenProcessor.prototype.__init3.call(this);}
/**
* Snapshot the token state in a way that can be restored later, useful for
* things like lookahead.
*
* resultMappings do not need to be copied since in all use cases, they will
* be overwritten anyway after restore.
*/
snapshot() {
return {
resultCode: this.resultCode,
tokenIndex: this.tokenIndex,
};
}
restoreToSnapshot(snapshot) {
this.resultCode = snapshot.resultCode;
this.tokenIndex = snapshot.tokenIndex;
}
/**
* Remove and return the code generated since the snapshot, leaving the
* current token position in-place. Unlike most TokenProcessor operations,
* this operation can result in input/output line number mismatches because
* the removed code may contain newlines, so this operation should be used
* sparingly.
*/
dangerouslyGetAndRemoveCodeSinceSnapshot(snapshot) {
const result = this.resultCode.slice(snapshot.resultCode.length);
this.resultCode = snapshot.resultCode;
return result;
}
reset() {
this.resultCode = "";
this.resultMappings = new Array(this.tokens.length);
this.tokenIndex = 0;
}
matchesContextualAtIndex(index, contextualKeyword) {
return (
this.matches1AtIndex(index, _types.TokenType.name) &&
this.tokens[index].contextualKeyword === contextualKeyword
);
}
identifierNameAtIndex(index) {
// TODO: We need to process escapes since technically you can have unicode escapes in variable
// names.
return this.identifierNameForToken(this.tokens[index]);
}
identifierNameAtRelativeIndex(relativeIndex) {
return this.identifierNameForToken(this.tokenAtRelativeIndex(relativeIndex));
}
identifierName() {
return this.identifierNameForToken(this.currentToken());
}
identifierNameForToken(token) {
return this.code.slice(token.start, token.end);
}
rawCodeForToken(token) {
return this.code.slice(token.start, token.end);
}
stringValueAtIndex(index) {
return this.stringValueForToken(this.tokens[index]);
}
stringValue() {
return this.stringValueForToken(this.currentToken());
}
stringValueForToken(token) {
// This is used to identify when two imports are the same and to resolve TypeScript enum keys.
// Ideally we'd process escapes within the strings, but for now we pretty much take the raw
// code.
return this.code.slice(token.start + 1, token.end - 1);
}
matches1AtIndex(index, t1) {
return this.tokens[index].type === t1;
}
matches2AtIndex(index, t1, t2) {
return this.tokens[index].type === t1 && this.tokens[index + 1].type === t2;
}
matches3AtIndex(index, t1, t2, t3) {
return (
this.tokens[index].type === t1 &&
this.tokens[index + 1].type === t2 &&
this.tokens[index + 2].type === t3
);
}
matches1(t1) {
return this.tokens[this.tokenIndex].type === t1;
}
matches2(t1, t2) {
return this.tokens[this.tokenIndex].type === t1 && this.tokens[this.tokenIndex + 1].type === t2;
}
matches3(t1, t2, t3) {
return (
this.tokens[this.tokenIndex].type === t1 &&
this.tokens[this.tokenIndex + 1].type === t2 &&
this.tokens[this.tokenIndex + 2].type === t3
);
}
matches4(t1, t2, t3, t4) {
return (
this.tokens[this.tokenIndex].type === t1 &&
this.tokens[this.tokenIndex + 1].type === t2 &&
this.tokens[this.tokenIndex + 2].type === t3 &&
this.tokens[this.tokenIndex + 3].type === t4
);
}
matches5(t1, t2, t3, t4, t5) {
return (
this.tokens[this.tokenIndex].type === t1 &&
this.tokens[this.tokenIndex + 1].type === t2 &&
this.tokens[this.tokenIndex + 2].type === t3 &&
this.tokens[this.tokenIndex + 3].type === t4 &&
this.tokens[this.tokenIndex + 4].type === t5
);
}
matchesContextual(contextualKeyword) {
return this.matchesContextualAtIndex(this.tokenIndex, contextualKeyword);
}
matchesContextIdAndLabel(type, contextId) {
return this.matches1(type) && this.currentToken().contextId === contextId;
}
previousWhitespaceAndComments() {
let whitespaceAndComments = this.code.slice(
this.tokenIndex > 0 ? this.tokens[this.tokenIndex - 1].end : 0,
this.tokenIndex < this.tokens.length ? this.tokens[this.tokenIndex].start : this.code.length,
);
if (this.isFlowEnabled) {
whitespaceAndComments = whitespaceAndComments.replace(/@flow/g, "");
}
return whitespaceAndComments;
}
replaceToken(newCode) {
this.resultCode += this.previousWhitespaceAndComments();
this.appendTokenPrefix();
this.resultMappings[this.tokenIndex] = this.resultCode.length;
this.resultCode += newCode;
this.appendTokenSuffix();
this.tokenIndex++;
}
replaceTokenTrimmingLeftWhitespace(newCode) {
this.resultCode += this.previousWhitespaceAndComments().replace(/[^\r\n]/g, "");
this.appendTokenPrefix();
this.resultMappings[this.tokenIndex] = this.resultCode.length;
this.resultCode += newCode;
this.appendTokenSuffix();
this.tokenIndex++;
}
removeInitialToken() {
this.replaceToken("");
}
removeToken() {
this.replaceTokenTrimmingLeftWhitespace("");
}
/**
* Remove all code until the next }, accounting for balanced braces.
*/
removeBalancedCode() {
let braceDepth = 0;
while (!this.isAtEnd()) {
if (this.matches1(_types.TokenType.braceL)) {
braceDepth++;
} else if (this.matches1(_types.TokenType.braceR)) {
if (braceDepth === 0) {
return;
}
braceDepth--;
}
this.removeToken();
}
}
copyExpectedToken(tokenType) {
if (this.tokens[this.tokenIndex].type !== tokenType) {
throw new Error(`Expected token ${tokenType}`);
}
this.copyToken();
}
copyToken() {
this.resultCode += this.previousWhitespaceAndComments();
this.appendTokenPrefix();
this.resultMappings[this.tokenIndex] = this.resultCode.length;
this.resultCode += this.code.slice(
this.tokens[this.tokenIndex].start,
this.tokens[this.tokenIndex].end,
);
this.appendTokenSuffix();
this.tokenIndex++;
}
copyTokenWithPrefix(prefix) {
this.resultCode += this.previousWhitespaceAndComments();
this.appendTokenPrefix();
this.resultCode += prefix;
this.resultMappings[this.tokenIndex] = this.resultCode.length;
this.resultCode += this.code.slice(
this.tokens[this.tokenIndex].start,
this.tokens[this.tokenIndex].end,
);
this.appendTokenSuffix();
this.tokenIndex++;
}
appendTokenPrefix() {
const token = this.currentToken();
if (token.numNullishCoalesceStarts || token.isOptionalChainStart) {
token.isAsyncOperation = _isAsyncOperation2.default.call(void 0, this);
}
if (this.disableESTransforms) {
return;
}
if (token.numNullishCoalesceStarts) {
for (let i = 0; i < token.numNullishCoalesceStarts; i++) {
if (token.isAsyncOperation) {
this.resultCode += "await ";
this.resultCode += this.helperManager.getHelperName("asyncNullishCoalesce");
} else {
this.resultCode += this.helperManager.getHelperName("nullishCoalesce");
}
this.resultCode += "(";
}
}
if (token.isOptionalChainStart) {
if (token.isAsyncOperation) {
this.resultCode += "await ";
}
if (this.tokenIndex > 0 && this.tokenAtRelativeIndex(-1).type === _types.TokenType._delete) {
if (token.isAsyncOperation) {
this.resultCode += this.helperManager.getHelperName("asyncOptionalChainDelete");
} else {
this.resultCode += this.helperManager.getHelperName("optionalChainDelete");
}
} else if (token.isAsyncOperation) {
this.resultCode += this.helperManager.getHelperName("asyncOptionalChain");
} else {
this.resultCode += this.helperManager.getHelperName("optionalChain");
}
this.resultCode += "([";
}
}
appendTokenSuffix() {
const token = this.currentToken();
if (token.isOptionalChainEnd && !this.disableESTransforms) {
this.resultCode += "])";
}
if (token.numNullishCoalesceEnds && !this.disableESTransforms) {
for (let i = 0; i < token.numNullishCoalesceEnds; i++) {
this.resultCode += "))";
}
}
}
appendCode(code) {
this.resultCode += code;
}
currentToken() {
return this.tokens[this.tokenIndex];
}
currentTokenCode() {
const token = this.currentToken();
return this.code.slice(token.start, token.end);
}
tokenAtRelativeIndex(relativeIndex) {
return this.tokens[this.tokenIndex + relativeIndex];
}
currentIndex() {
return this.tokenIndex;
}
/**
* Move to the next token. Only suitable in preprocessing steps. When
* generating new code, you should use copyToken or removeToken.
*/
nextToken() {
if (this.tokenIndex === this.tokens.length) {
throw new Error("Unexpectedly reached end of input.");
}
this.tokenIndex++;
}
previousToken() {
this.tokenIndex--;
}
finish() {
if (this.tokenIndex !== this.tokens.length) {
throw new Error("Tried to finish processing tokens before reaching the end.");
}
this.resultCode += this.previousWhitespaceAndComments();
return {code: this.resultCode, mappings: this.resultMappings};
}
isAtEnd() {
return this.tokenIndex === this.tokens.length;
}
} exports.default = TokenProcessor;
@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=resolveInstanceBindingConstructorParams.spec.d.ts.map
@@ -0,0 +1,6 @@
module.exports = {
"breadcrumbs": `Morzsamen\xfc`
};
//# sourceMappingURL=hu-HU.main.js.map
@@ -0,0 +1,536 @@
/**
* @fileoverview Options configuration for optionator.
* @author George Zahariev
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const optionator = require("optionator");
//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------
/**
* The options object parsed by Optionator.
* @typedef {Object} ParsedCLIOptions
* @property {boolean} cache Only check changed files
* @property {string} cacheFile Path to the cache file. Deprecated: use --cache-location
* @property {string} [cacheLocation] Path to the cache file or directory
* @property {"metadata" | "content"} cacheStrategy Strategy to use for detecting changed files in the cache
* @property {boolean} [color] Force enabling/disabling of color
* @property {number | "auto" | "off"} [concurrency] Number of linting threads, "auto" to choose automatically, "off" for no multithreading
* @property {string} [config] Use this configuration, overriding .eslintrc.* config options if present
* @property {boolean} debug Output debugging information
* @property {string[]} [env] Specify environments
* @property {boolean} envInfo Output execution environment information
* @property {boolean} errorOnUnmatchedPattern Prevent errors when pattern is unmatched
* @property {boolean} eslintrc Disable use of configuration from .eslintrc.*
* @property {string[]} [ext] Specify JavaScript file extensions
* @property {string[]} [flag] Feature flags
* @property {boolean} fix Automatically fix problems
* @property {boolean} fixDryRun Automatically fix problems without saving the changes to the file system
* @property {("directive" | "problem" | "suggestion" | "layout")[]} [fixType] Specify the types of fixes to apply (directive, problem, suggestion, layout)
* @property {string} format Use a specific output format
* @property {string[]} [global] Define global variables
* @property {boolean} [help] Show help
* @property {boolean} ignore Disable use of ignore files and patterns
* @property {string} [ignorePath] Specify path of ignore file
* @property {string[]} [ignorePattern] Patterns of files to ignore. In eslintrc mode, these are in addition to `.eslintignore`
* @property {boolean} init Run config initialization wizard
* @property {boolean} inlineConfig Prevent comments from changing config or rules
* @property {number} maxWarnings Number of warnings to trigger nonzero exit code
* @property {string} [outputFile] Specify file to write report to
* @property {string} [parser] Specify the parser to be used
* @property {Object} [parserOptions] Specify parser options
* @property {boolean} [passOnNoPatterns=false] When set to true, missing patterns cause
* the linting operation to short circuit and not report any failures.
* @property {boolean} [passOnUnprunedSuppressions] Ignore unused suppressions
* @property {string[]} [plugin] Specify plugins
* @property {string} [printConfig] Print the configuration for the given file
* @property {boolean} [pruneSuppressions] Prune unused suppressions
* @property {boolean} quiet Report errors only
* @property {boolean | undefined} reportUnusedDisableDirectives Adds reported errors for unused eslint-disable and eslint-enable directives
* @property {string | undefined} reportUnusedDisableDirectivesSeverity A severity string indicating if and how unused disable and enable directives should be tracked and reported.
* @property {string} [resolvePluginsRelativeTo] A folder where plugins should be resolved from, CWD by default
* @property {Object} [rule] Specify rules
* @property {string[]} [rulesdir] Load additional rules from this directory. Deprecated: Use rules from plugins
* @property {boolean} [stats] Report additional statistics
* @property {boolean} stdin Lint code provided on <STDIN>
* @property {string} [stdinFilename] Specify filename to process STDIN as
* @property {boolean} [suppressAll] Suppress all error violations
* @property {string} [suppressionsLocation] Path to the suppressions file or directory
* @property {string[]} [suppressRule] Suppress specific rules
* @property {boolean} [version] Output the version number
* @property {boolean} warnIgnored Show warnings when the file list includes ignored files
* @property {string[]} _ Positional filenames or patterns
*/
//------------------------------------------------------------------------------
// Initialization and Public Interface
//------------------------------------------------------------------------------
// exports "parse(args)", "generateHelp()", and "generateHelpForOption(optionName)"
/**
* Creates the CLI options for ESLint.
* @param {boolean} usingFlatConfig Indicates if flat config is being used.
* @returns {Object} The optionator instance.
*/
module.exports = function (usingFlatConfig) {
let lookupFlag;
if (usingFlatConfig) {
lookupFlag = {
option: "config-lookup",
type: "Boolean",
default: "true",
description: "Disable look up for eslint.config.js",
};
} else {
lookupFlag = {
option: "eslintrc",
type: "Boolean",
default: "true",
description: "Disable use of configuration from .eslintrc.*",
};
}
let envFlag;
if (!usingFlatConfig) {
envFlag = {
option: "env",
type: "[String]",
description: "Specify environments",
};
}
let inspectConfigFlag;
if (usingFlatConfig) {
inspectConfigFlag = {
option: "inspect-config",
type: "Boolean",
description:
"Open the config inspector with the current configuration",
};
}
let extFlag;
if (!usingFlatConfig) {
extFlag = {
option: "ext",
type: "[String]",
description: "Specify JavaScript file extensions",
};
} else {
extFlag = {
option: "ext",
type: "[String]",
description: "Specify additional file extensions to lint",
};
}
let resolvePluginsFlag;
if (!usingFlatConfig) {
resolvePluginsFlag = {
option: "resolve-plugins-relative-to",
type: "path::String",
description:
"A folder where plugins should be resolved from, CWD by default",
};
}
let rulesDirFlag;
if (!usingFlatConfig) {
rulesDirFlag = {
option: "rulesdir",
type: "[path::String]",
description:
"Load additional rules from this directory. Deprecated: Use rules from plugins",
};
}
let ignorePathFlag;
if (!usingFlatConfig) {
ignorePathFlag = {
option: "ignore-path",
type: "path::String",
description: "Specify path of ignore file",
};
}
let statsFlag;
if (usingFlatConfig) {
statsFlag = {
option: "stats",
type: "Boolean",
default: "false",
description: "Add statistics to the lint report",
};
}
let warnIgnoredFlag;
if (usingFlatConfig) {
warnIgnoredFlag = {
option: "warn-ignored",
type: "Boolean",
default: "true",
description:
"Suppress warnings when the file list includes ignored files",
};
}
let flagFlag;
if (usingFlatConfig) {
flagFlag = {
option: "flag",
type: "[String]",
description: "Enable a feature flag",
};
}
let reportUnusedInlineConfigsFlag;
if (usingFlatConfig) {
reportUnusedInlineConfigsFlag = {
option: "report-unused-inline-configs",
type: "String",
default: void 0,
description:
"Adds reported errors for unused eslint inline config comments",
enum: ["off", "warn", "error", "0", "1", "2"],
};
}
let mcpFlag;
if (usingFlatConfig) {
mcpFlag = {
option: "mcp",
type: "Boolean",
description: "Start the ESLint MCP server",
};
}
let concurrencyFlag;
if (usingFlatConfig) {
concurrencyFlag = {
option: "concurrency",
type: "Int|String",
default: "off",
description:
"Number of linting threads, auto to choose automatically, off for no multithreading",
};
}
return optionator({
prepend: "eslint [options] file.js [file.js] [dir]",
defaults: {
concatRepeatedArrays: true,
mergeRepeatedObjects: true,
},
options: [
{
heading: "Basic configuration",
},
lookupFlag,
{
option: "config",
alias: "c",
type: "path::String",
description: usingFlatConfig
? "Use this configuration instead of eslint.config.js, eslint.config.mjs, or eslint.config.cjs"
: "Use this configuration, overriding .eslintrc.* config options if present",
},
inspectConfigFlag,
envFlag,
extFlag,
{
option: "global",
type: "[String]",
description: "Define global variables",
},
{
option: "parser",
type: "String",
description: "Specify the parser to be used",
},
{
option: "parser-options",
type: "Object",
description: "Specify parser options",
},
resolvePluginsFlag,
{
heading: "Specify Rules and Plugins",
},
{
option: "plugin",
type: "[String]",
description: "Specify plugins",
},
{
option: "rule",
type: "Object",
description: "Specify rules",
},
rulesDirFlag,
{
heading: "Fix Problems",
},
{
option: "fix",
type: "Boolean",
default: false,
description: "Automatically fix problems",
},
{
option: "fix-dry-run",
type: "Boolean",
default: false,
description:
"Automatically fix problems without saving the changes to the file system",
},
{
option: "fix-type",
type: "Array",
description:
"Specify the types of fixes to apply (directive, problem, suggestion, layout)",
},
{
heading: "Ignore Files",
},
ignorePathFlag,
{
option: "ignore",
type: "Boolean",
default: "true",
description: "Disable use of ignore files and patterns",
},
{
option: "ignore-pattern",
type: "[String]",
description: `Patterns of files to ignore${usingFlatConfig ? "" : " (in addition to those in .eslintignore)"}`,
concatRepeatedArrays: [
true,
{
oneValuePerFlag: true,
},
],
},
{
heading: "Use stdin",
},
{
option: "stdin",
type: "Boolean",
default: "false",
description: "Lint code provided on <STDIN>",
},
{
option: "stdin-filename",
type: "String",
description: "Specify filename to process STDIN as",
},
{
heading: "Handle Warnings",
},
{
option: "quiet",
type: "Boolean",
default: "false",
description: "Report errors only",
},
{
option: "max-warnings",
type: "Int",
default: "-1",
description: "Number of warnings to trigger nonzero exit code",
},
{
heading: "Output",
},
{
option: "output-file",
alias: "o",
type: "path::String",
description: "Specify file to write report to",
},
{
option: "format",
alias: "f",
type: "String",
default: "stylish",
description: "Use a specific output format",
},
{
option: "color",
type: "Boolean",
alias: "no-color",
description: "Force enabling/disabling of color",
},
{
heading: "Inline configuration comments",
},
{
option: "inline-config",
type: "Boolean",
default: "true",
description: "Prevent comments from changing config or rules",
},
{
option: "report-unused-disable-directives",
type: "Boolean",
default: void 0,
description:
"Adds reported errors for unused eslint-disable and eslint-enable directives",
},
{
option: "report-unused-disable-directives-severity",
type: "String",
default: void 0,
description:
"Chooses severity level for reporting unused eslint-disable and eslint-enable directives",
enum: ["off", "warn", "error", "0", "1", "2"],
},
reportUnusedInlineConfigsFlag,
{
heading: "Caching",
},
{
option: "cache",
type: "Boolean",
default: "false",
description: "Only check changed files",
},
{
option: "cache-file",
type: "path::String",
default: ".eslintcache",
description:
"Path to the cache file. Deprecated: use --cache-location",
},
{
option: "cache-location",
type: "path::String",
description: "Path to the cache file or directory",
},
{
option: "cache-strategy",
dependsOn: ["cache"],
type: "String",
default: "metadata",
enum: ["metadata", "content"],
description:
"Strategy to use for detecting changed files in the cache",
},
{
heading: "Suppressing Violations",
},
{
option: "suppress-all",
type: "Boolean",
default: "false",
description: "Suppress all violations",
},
{
option: "suppress-rule",
type: "[String]",
description: "Suppress specific rules",
},
{
option: "suppressions-location",
type: "path::String",
description: "Specify the location of the suppressions file",
},
{
option: "prune-suppressions",
type: "Boolean",
default: "false",
description: "Prune unused suppressions",
},
{
option: "pass-on-unpruned-suppressions",
type: "Boolean",
default: "false",
description: "Ignore unused suppressions",
},
{
heading: "Miscellaneous",
},
{
option: "init",
type: "Boolean",
default: "false",
description: "Run config initialization wizard",
},
{
option: "env-info",
type: "Boolean",
default: "false",
description: "Output execution environment information",
},
{
option: "error-on-unmatched-pattern",
type: "Boolean",
default: "true",
description: "Prevent errors when pattern is unmatched",
},
{
option: "exit-on-fatal-error",
type: "Boolean",
default: "false",
description: "Exit with exit code 2 in case of fatal error",
},
warnIgnoredFlag,
{
option: "pass-on-no-patterns",
type: "Boolean",
default: false,
description:
"Exit with exit code 0 in case no file patterns are passed",
},
{
option: "debug",
type: "Boolean",
default: false,
description: "Output debugging information",
},
{
option: "help",
alias: "h",
type: "Boolean",
description: "Show help",
},
{
option: "version",
alias: "v",
type: "Boolean",
description: "Output the version number",
},
{
option: "print-config",
type: "path::String",
description: "Print the configuration for the given file",
},
statsFlag,
flagFlag,
mcpFlag,
concurrencyFlag,
].filter(value => !!value),
});
};
@@ -0,0 +1,18 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./convert"), exports);
@@ -0,0 +1 @@
{"version":3,"file":"isBindingConstraintsWithNoNameNorTags.spec.d.ts","sourceRoot":"","sources":["../../../../src/binding/calculations/isBindingConstraintsWithNoNameNorTags.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,160 @@
"use client";
// src/use-listbox-item.ts
import { useMemo, useRef, useCallback } from "react";
import { listboxItem } from "@heroui/theme";
import { mapPropsVariants, useProviderContext } from "@heroui/system";
import { useFocusRing } from "@react-aria/focus";
import { filterDOMProps } from "@heroui/react-utils";
import { clsx, dataAttr, objectToDeps, removeEvents, warn } from "@heroui/shared-utils";
import { useOption } from "@react-aria/listbox";
import { mergeProps } from "@react-aria/utils";
import { useHover, usePress } from "@react-aria/interactions";
import { useIsMobile } from "@heroui/use-is-mobile";
function useListboxItem(originalProps) {
var _a, _b;
const globalContext = useProviderContext();
const [props, variantProps] = mapPropsVariants(originalProps, listboxItem.variantKeys);
const {
as,
item,
state,
description,
startContent,
endContent,
isVirtualized,
selectedIcon,
className,
classNames,
autoFocus,
onPress,
onClick: deprecatedOnClick,
shouldHighlightOnFocus,
hideSelectedIcon = false,
isReadOnly = false,
...otherProps
} = props;
const disableAnimation = (_b = (_a = originalProps.disableAnimation) != null ? _a : globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _b : false;
const domRef = useRef(null);
const Component = as || (originalProps.href ? "a" : "li");
const shouldFilterDOMProps = typeof Component === "string";
const { rendered, key } = item;
const isDisabled = state.disabledKeys.has(key) || originalProps.isDisabled;
const isSelectable = state.selectionManager.selectionMode !== "none";
const isMobile = useIsMobile();
if (deprecatedOnClick && typeof deprecatedOnClick === "function") {
warn(
"onClick is deprecated, please use onPress instead. See: https://github.com/heroui-inc/heroui/issues/4292",
"ListboxItem"
);
}
const { pressProps, isPressed } = usePress({
ref: domRef,
isDisabled,
onPress
});
const { isHovered, hoverProps } = useHover({
isDisabled
});
const { isFocusVisible, focusProps } = useFocusRing({
autoFocus
});
const { isFocused, isSelected, optionProps, labelProps, descriptionProps } = useOption(
{
key,
isDisabled,
"aria-label": props["aria-label"],
isVirtualized
},
state,
domRef
);
let itemProps = optionProps;
const slots = useMemo(
() => listboxItem({
...variantProps,
isDisabled,
disableAnimation,
hasTitleTextChild: typeof rendered === "string",
hasDescriptionTextChild: typeof description === "string"
}),
[objectToDeps(variantProps), isDisabled, disableAnimation, rendered, description]
);
const baseStyles = clsx(classNames == null ? void 0 : classNames.base, className);
if (isReadOnly) {
itemProps = removeEvents(itemProps);
}
const isHighlighted = shouldHighlightOnFocus && isFocused || (isMobile ? isHovered || isPressed : isHovered || isFocused && !isFocusVisible);
const getItemProps = (props2 = {}) => ({
ref: domRef,
...mergeProps(
{
onClick: deprecatedOnClick
},
itemProps,
isReadOnly ? {} : mergeProps(focusProps, pressProps),
hoverProps,
filterDOMProps(otherProps, {
enabled: shouldFilterDOMProps
}),
props2
),
"data-selectable": dataAttr(isSelectable),
"data-focus": dataAttr(isFocused),
"data-hover": dataAttr(isHighlighted),
"data-disabled": dataAttr(isDisabled),
"data-selected": dataAttr(isSelected),
"data-pressed": dataAttr(isPressed),
"data-focus-visible": dataAttr(isFocusVisible),
className: slots.base({ class: clsx(baseStyles, props2.className) })
});
const getLabelProps = (props2 = {}) => ({
...mergeProps(labelProps, props2),
"data-label": dataAttr(true),
className: slots.title({ class: classNames == null ? void 0 : classNames.title })
});
const getDescriptionProps = (props2 = {}) => ({
...mergeProps(descriptionProps, props2),
className: slots.description({ class: classNames == null ? void 0 : classNames.description })
});
const getWrapperProps = (props2 = {}) => ({
...mergeProps(props2),
className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper })
});
const getSelectedIconProps = useCallback(
(props2 = {}) => {
return {
"aria-hidden": dataAttr(true),
"data-disabled": dataAttr(isDisabled),
className: slots.selectedIcon({ class: classNames == null ? void 0 : classNames.selectedIcon }),
...props2
};
},
[isDisabled, slots, classNames]
);
return {
Component,
domRef,
slots,
classNames,
isSelectable,
isSelected,
isDisabled,
rendered,
description,
startContent,
endContent,
selectedIcon,
hideSelectedIcon,
disableAnimation,
getItemProps,
getLabelProps,
getWrapperProps,
getDescriptionProps,
getSelectedIconProps
};
}
export {
useListboxItem
};
@@ -0,0 +1,8 @@
import { PluginFunc } from 'dayjs'
declare interface PluginOptions {
parseTwoDigitYear?: (yearString: string) => number
}
declare const plugin: PluginFunc<PluginOptions>
export = plugin
@@ -0,0 +1,9 @@
{
"extends": "@ljharb/tsconfig",
"compilerOptions": {
"target": "ES2021",
},
"exclude": [
"coverage",
],
}
@@ -0,0 +1,97 @@
const extractValueFromThisExpression = require('./ThisExpression').default;
const extractValueFromCallExpression = require('./CallExpression').default;
function navigate(obj, prop, value) {
if (value.computed) {
return value.optional ? `${obj}?.[${prop}]` : `${obj}[${prop}]`;
}
return value.optional ? `${obj}?.${prop}` : `${obj}.${prop}`;
}
/**
* Extractor function for a TSNonNullExpression type value node.
* A TSNonNullExpression is accessing a TypeScript Non-Null Assertion
* Operator !
*
* @param - value - AST Value object with type `TSNonNullExpression`
* @returns - The extracted value converted to correct type
* and maintaing `obj.property` convention.
*/
export default function extractValueFromTSNonNullExpression(value) {
// eslint-disable-next-line global-require
// const getValue = require('.').default;
const errorMessage = 'The prop value with an expression type of TSNonNullExpression could not be resolved. Please file an issue ( https://github.com/jsx-eslint/jsx-ast-utils/issues/new ) to get this fixed immediately.';
// it's just the name
if (value.type === 'Identifier') {
const { name } = value;
return name;
}
if (value.type === 'Literal') {
return value.value;
}
if (value.type === 'TSAsExpression') {
return extractValueFromTSNonNullExpression(value.expression);
}
if (value.type === 'CallExpression') {
return extractValueFromCallExpression(value);
}
if (value.type === 'ThisExpression') {
return extractValueFromThisExpression();
}
// does not contains properties & is not parenthesized
if (value.type === 'TSNonNullExpression' && (!value.extra || value.extra.parenthesized === false)) {
const { expression } = value;
return `${extractValueFromTSNonNullExpression(expression)}${'!'}`;
}
// does not contains properties & is parenthesized
if (value.type === 'TSNonNullExpression' && value.extra && value.extra.parenthesized === true) {
const { expression } = value;
return `${'('}${extractValueFromTSNonNullExpression(expression)}${'!'}${')'}`;
}
if (value.type === 'MemberExpression') {
// contains a property & is not parenthesized
if ((!value.extra || value.extra.parenthesized === false)) {
return navigate(
extractValueFromTSNonNullExpression(value.object),
extractValueFromTSNonNullExpression(value.property),
value,
);
}
// contains a property & is parenthesized
if (value.extra && value.extra.parenthesized === true) {
const result = navigate(
extractValueFromTSNonNullExpression(value.object),
extractValueFromTSNonNullExpression(value.property),
value,
);
return `(${result})`;
}
}
// try to fail silently, if specs for TSNonNullExpression change
// not throw, only log error. Similar to how it was done previously
if (value.expression) {
let { expression } = value;
while (expression) {
if (expression.type === 'Identifier') {
// eslint-disable-next-line no-console
console.error(errorMessage);
return expression.name;
}
({ expression } = expression);
}
}
// eslint-disable-next-line no-console
console.error(errorMessage);
return '';
}
@@ -0,0 +1,664 @@
semver(1) -- The semantic versioner for npm
===========================================
## Install
```bash
npm install semver
````
## Usage
As a node module:
```js
const semver = require('semver')
semver.valid('1.2.3') // '1.2.3'
semver.valid('a.b.c') // null
semver.clean(' =v1.2.3 ') // '1.2.3'
semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
semver.gt('1.2.3', '9.8.7') // false
semver.lt('1.2.3', '9.8.7') // true
semver.minVersion('>=1.0.0') // '1.0.0'
semver.valid(semver.coerce('v2')) // '2.0.0'
semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
```
You can also just load the module for the function that you care about if
you'd like to minimize your footprint.
```js
// load the whole API at once in a single object
const semver = require('semver')
// or just load the bits you need
// all of them listed here, just pick and choose what you want
// classes
const SemVer = require('semver/classes/semver')
const Comparator = require('semver/classes/comparator')
const Range = require('semver/classes/range')
// functions for working with versions
const semverParse = require('semver/functions/parse')
const semverValid = require('semver/functions/valid')
const semverClean = require('semver/functions/clean')
const semverInc = require('semver/functions/inc')
const semverDiff = require('semver/functions/diff')
const semverMajor = require('semver/functions/major')
const semverMinor = require('semver/functions/minor')
const semverPatch = require('semver/functions/patch')
const semverPrerelease = require('semver/functions/prerelease')
const semverCompare = require('semver/functions/compare')
const semverRcompare = require('semver/functions/rcompare')
const semverCompareLoose = require('semver/functions/compare-loose')
const semverCompareBuild = require('semver/functions/compare-build')
const semverSort = require('semver/functions/sort')
const semverRsort = require('semver/functions/rsort')
// low-level comparators between versions
const semverGt = require('semver/functions/gt')
const semverLt = require('semver/functions/lt')
const semverEq = require('semver/functions/eq')
const semverNeq = require('semver/functions/neq')
const semverGte = require('semver/functions/gte')
const semverLte = require('semver/functions/lte')
const semverCmp = require('semver/functions/cmp')
const semverCoerce = require('semver/functions/coerce')
// working with ranges
const semverSatisfies = require('semver/functions/satisfies')
const semverMaxSatisfying = require('semver/ranges/max-satisfying')
const semverMinSatisfying = require('semver/ranges/min-satisfying')
const semverToComparators = require('semver/ranges/to-comparators')
const semverMinVersion = require('semver/ranges/min-version')
const semverValidRange = require('semver/ranges/valid')
const semverOutside = require('semver/ranges/outside')
const semverGtr = require('semver/ranges/gtr')
const semverLtr = require('semver/ranges/ltr')
const semverIntersects = require('semver/ranges/intersects')
const semverSimplifyRange = require('semver/ranges/simplify')
const semverRangeSubset = require('semver/ranges/subset')
```
As a command-line utility:
```
$ semver -h
A JavaScript implementation of the https://semver.org/ specification
Copyright Isaac Z. Schlueter
Usage: semver [options] <version> [<version> [...]]
Prints valid versions sorted by SemVer precedence
Options:
-r --range <range>
Print versions that match the specified range.
-i --increment [<level>]
Increment a version by the specified level. Level can
be one of: major, minor, patch, premajor, preminor,
prepatch, prerelease, or release. Default level is 'patch'.
Only one version may be specified.
--preid <identifier>
Identifier to be used to prefix premajor, preminor,
prepatch or prerelease version increments.
-l --loose
Interpret versions and ranges loosely
-n <0|1>
This is the base to be used for the prerelease identifier.
-p --include-prerelease
Always include prerelease versions in range matching
-c --coerce
Coerce a string into SemVer if possible
(does not imply --loose)
--rtl
Coerce version strings right to left
--ltr
Coerce version strings left to right (default)
Program exits successfully if any valid version satisfies
all supplied ranges, and prints all satisfying versions.
If no satisfying versions are found, then exits failure.
Versions are printed in ascending order, so supplying
multiple versions to the utility will just sort them.
```
## Versions
A "version" is described by the `v2.0.0` specification found at
<https://semver.org/>.
A leading `"="` or `"v"` character is stripped off and ignored.
Support for stripping a leading "v" is kept for compatibility with `v1.0.0` of the SemVer
specification but should not be used anymore.
## Ranges
A `version range` is a set of `comparators` that specify versions
that satisfy the range.
A `comparator` is composed of an `operator` and a `version`. The set
of primitive `operators` is:
* `<` Less than
* `<=` Less than or equal to
* `>` Greater than
* `>=` Greater than or equal to
* `=` Equal. If no operator is specified, then equality is assumed,
so this operator is optional but MAY be included.
For example, the comparator `>=1.2.7` would match the versions
`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
or `1.1.0`. The comparator `>1` is equivalent to `>=2.0.0` and
would match the versions `2.0.0` and `3.1.0`, but not the versions
`1.0.1` or `1.1.0`.
Comparators can be joined by whitespace to form a `comparator set`,
which is satisfied by the **intersection** of all of the comparators
it includes.
A range is composed of one or more comparator sets, joined by `||`. A
version matches a range if and only if every comparator in at least
one of the `||`-separated comparator sets is satisfied by the version.
For example, the range `>=1.2.7 <1.3.0` would match the versions
`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
or `1.1.0`.
The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.
### Prerelease Tags
If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
it will only be allowed to satisfy comparator sets if at least one
comparator with the same `[major, minor, patch]` tuple also has a
prerelease tag.
For example, the range `>1.2.3-alpha.3` would be allowed to match the
version `1.2.3-alpha.7`, but it would *not* be satisfied by
`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
than" `1.2.3-alpha.3` according to the SemVer sort rules. The version
range only accepts prerelease tags on the `1.2.3` version.
Version `3.4.5` *would* satisfy the range because it does not have a
prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
The purpose of this behavior is twofold. First, prerelease versions
frequently are updated very quickly, and contain many breaking changes
that are (by the author's design) not yet fit for public consumption.
Therefore, by default, they are excluded from range-matching
semantics.
Second, a user who has opted into using a prerelease version has
indicated the intent to use *that specific* set of
alpha/beta/rc versions. By including a prerelease tag in the range,
the user is indicating that they are aware of the risk. However, it
is still not appropriate to assume that they have opted into taking a
similar risk on the *next* set of prerelease versions.
Note that this behavior can be suppressed (treating all prerelease
versions as if they were normal versions, for range-matching)
by setting the `includePrerelease` flag on the options
object to any
[functions](https://github.com/npm/node-semver#functions) that do
range matching.
#### Prerelease Identifiers
The method `.inc` takes an additional `identifier` string argument that
will append the value of the string as a prerelease identifier:
```javascript
semver.inc('1.2.3', 'prerelease', 'beta')
// '1.2.4-beta.0'
```
command-line example:
```bash
$ semver 1.2.3 -i prerelease --preid beta
1.2.4-beta.0
```
Which then can be used to increment further:
```bash
$ semver 1.2.4-beta.0 -i prerelease
1.2.4-beta.1
```
To get out of the prerelease phase, use the `release` option:
```bash
$ semver 1.2.4-beta.1 -i release
1.2.4
```
#### Prerelease Identifier Base
The method `.inc` takes an optional parameter 'identifierBase' string
that will let you let your prerelease number as zero-based or one-based.
Set to `false` to omit the prerelease number altogether.
If you do not specify this parameter, it will default to zero-based.
```javascript
semver.inc('1.2.3', 'prerelease', 'beta', '1')
// '1.2.4-beta.1'
```
```javascript
semver.inc('1.2.3', 'prerelease', 'beta', false)
// '1.2.4-beta'
```
command-line example:
```bash
$ semver 1.2.3 -i prerelease --preid beta -n 1
1.2.4-beta.1
```
```bash
$ semver 1.2.3 -i prerelease --preid beta -n false
1.2.4-beta
```
### Advanced Range Syntax
Advanced range syntax desugars to primitive comparators in
deterministic ways.
Advanced ranges may be combined in the same way as primitive
comparators using white space or `||`.
#### Hyphen Ranges `X.Y.Z - A.B.C`
Specifies an inclusive set.
* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
If a partial version is provided as the first version in the inclusive
range, then the missing pieces are replaced with zeroes.
* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`
If a partial version is provided as the second version in the
inclusive range, then all versions that start with the supplied parts
of the tuple are accepted, but nothing that would be greater than the
provided tuple parts.
* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0-0`
* `1.2.3 - 2` := `>=1.2.3 <3.0.0-0`
#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
Any of `X`, `x`, or `*` may be used to "stand in" for one of the
numeric values in the `[major, minor, patch]` tuple.
* `*` := `>=0.0.0` (Any non-prerelease version satisfies, unless
`includePrerelease` is specified, in which case any version at all
satisfies)
* `1.x` := `>=1.0.0 <2.0.0-0` (Matching major version)
* `1.2.x` := `>=1.2.0 <1.3.0-0` (Matching major and minor versions)
A partial version range is treated as an X-Range, so the special
character is in fact optional.
* `""` (empty string) := `*` := `>=0.0.0`
* `1` := `1.x.x` := `>=1.0.0 <2.0.0-0`
* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-0`
#### Tilde Ranges `~1.2.3` `~1.2` `~1`
Allows patch-level changes if a minor version is specified on the
comparator. Allows minor-level changes if not.
* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0-0`
* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`)
* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`)
* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0`
* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`)
* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`)
* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0-0` Note that prereleases in
the `1.2.3` version will be allowed, if they are greater than or
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
`1.2.4-beta.2` would not, because it is a prerelease of a
different `[major, minor, patch]` tuple.
#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
Allows changes that do not modify the left-most non-zero element in the
`[major, minor, patch]` tuple. In other words, this allows patch and
minor updates for versions `1.0.0` and above, patch updates for
versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
Many authors treat a `0.x` version as if the `x` were the major
"breaking-change" indicator.
Caret ranges are ideal when an author may make breaking changes
between `0.2.4` and `0.3.0` releases, which is a common practice.
However, it presumes that there will *not* be breaking changes between
`0.2.4` and `0.2.5`. It allows for changes that are presumed to be
additive (but non-breaking), according to commonly observed practices.
* `^1.2.3` := `>=1.2.3 <2.0.0-0`
* `^0.2.3` := `>=0.2.3 <0.3.0-0`
* `^0.0.3` := `>=0.0.3 <0.0.4-0`
* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0-0` Note that prereleases in
the `1.2.3` version will be allowed, if they are greater than or
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
`1.2.4-beta.2` would not, because it is a prerelease of a
different `[major, minor, patch]` tuple.
* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4-0` Note that prereleases in the
`0.0.3` version *only* will be allowed, if they are greater than or
equal to `beta`. So, `0.0.3-pr.2` would be allowed.
When parsing caret ranges, a missing `patch` value desugars to the
number `0`, but will allow flexibility within that value, even if the
major and minor versions are both `0`.
* `^1.2.x` := `>=1.2.0 <2.0.0-0`
* `^0.0.x` := `>=0.0.0 <0.1.0-0`
* `^0.0` := `>=0.0.0 <0.1.0-0`
A missing `minor` and `patch` values will desugar to zero, but also
allow flexibility within those values, even if the major version is
zero.
* `^1.x` := `>=1.0.0 <2.0.0-0`
* `^0.x` := `>=0.0.0 <1.0.0-0`
### Range Grammar
Putting all this together, here is a Backus-Naur grammar for ranges,
for the benefit of parser authors:
```bnf
range-set ::= range ( logical-or range ) *
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
range ::= hyphen | simple ( ' ' simple ) * | ''
hyphen ::= partial ' - ' partial
simple ::= primitive | partial | tilde | caret
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
xr ::= 'x' | 'X' | '*' | nr
nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
tilde ::= '~' partial
caret ::= '^' partial
qualifier ::= ( '-' pre )? ( '+' build )?
pre ::= parts
build ::= parts
parts ::= part ( '.' part ) *
part ::= nr | [-0-9A-Za-z]+
```
## Functions
All methods and classes take a final `options` object argument. All
options in this object are `false` by default. The options supported
are:
- `loose`: Be more forgiving about not-quite-valid semver strings.
(Any resulting output will always be 100% strict compliant, of
course.) For backwards compatibility reasons, if the `options`
argument is a boolean value instead of an object, it is interpreted
to be the `loose` param.
- `includePrerelease`: Set to suppress the [default
behavior](https://github.com/npm/node-semver#prerelease-tags) of
excluding prerelease tagged versions from ranges unless they are
explicitly opted into.
Strict-mode Comparators and Ranges will be strict about the SemVer
strings that they parse.
* `valid(v)`: Return the parsed version, or null if it's not valid.
* `inc(v, releaseType, options, identifier, identifierBase)`:
Return the version incremented by the release
type (`major`, `premajor`, `minor`, `preminor`, `patch`,
`prepatch`, `prerelease`, or `release`), or null if it's not valid
* `premajor` in one call will bump the version up to the next major
version and down to a prerelease of that major version.
`preminor`, and `prepatch` work the same way.
* If called from a non-prerelease version, `prerelease` will work the
same as `prepatch`. It increments the patch version and then makes a
prerelease. If the input version is already a prerelease it simply
increments it.
* `release` will remove any prerelease part of the version.
* `identifier` can be used to prefix `premajor`, `preminor`,
`prepatch`, or `prerelease` version increments. `identifierBase`
is the base to be used for the `prerelease` identifier.
* `prerelease(v)`: Returns an array of prerelease components, or null
if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
* `major(v)`: Return the major version number.
* `minor(v)`: Return the minor version number.
* `patch(v)`: Return the patch version number.
* `intersects(r1, r2, loose)`: Return true if the two supplied ranges
or comparators intersect.
* `parse(v)`: Attempt to parse a string as a semantic version, returning either
a `SemVer` object or `null`.
### Comparison
* `gt(v1, v2)`: `v1 > v2`
* `gte(v1, v2)`: `v1 >= v2`
* `lt(v1, v2)`: `v1 < v2`
* `lte(v1, v2)`: `v1 <= v2`
* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
even if they're not the same string. You already know how to
compare strings.
* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
the corresponding function above. `"==="` and `"!=="` do simple
string comparison, but are included for completeness. Throws if an
invalid comparison string is provided.
* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
`v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
* `rcompare(v1, v2)`: The reverse of `compare`. Sorts an array of versions
in descending order when passed to `Array.sort()`.
* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions
are equal. Sorts in ascending order if passed to `Array.sort()`.
* `compareLoose(v1, v2)`: Short for `compare(v1, v2, { loose: true })`.
* `diff(v1, v2)`: Returns the difference between two versions by the release type
(`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
or null if the versions are the same.
### Sorting
* `sort(versions)`: Returns a sorted array of versions based on the `compareBuild`
function.
* `rsort(versions)`: The reverse of `sort`. Returns an array of versions based on
the `compareBuild` function in descending order.
### Comparators
* `intersects(comparator)`: Return true if the comparators intersect
### Ranges
* `validRange(range)`: Return the valid range or null if it's not valid.
* `satisfies(version, range)`: Return true if the version satisfies the
range.
* `maxSatisfying(versions, range)`: Return the highest version in the list
that satisfies the range, or `null` if none of them do.
* `minSatisfying(versions, range)`: Return the lowest version in the list
that satisfies the range, or `null` if none of them do.
* `minVersion(range)`: Return the lowest version that can match
the given range.
* `gtr(version, range)`: Return `true` if the version is greater than all the
versions possible in the range.
* `ltr(version, range)`: Return `true` if the version is less than all the
versions possible in the range.
* `outside(version, range, hilo)`: Return true if the version is outside
the bounds of the range in either the high or low direction. The
`hilo` argument must be either the string `'>'` or `'<'`. (This is
the function called by `gtr` and `ltr`.)
* `intersects(range)`: Return true if any of the range comparators intersect.
* `simplifyRange(versions, range)`: Return a "simplified" range that
matches the same items in the `versions` list as the range specified. Note
that it does *not* guarantee that it would match the same versions in all
cases, only for the set of versions provided. This is useful when
generating ranges by joining together multiple versions with `||`
programmatically, to provide the user with something a bit more
ergonomic. If the provided range is shorter in string-length than the
generated range, then that is returned.
* `subset(subRange, superRange)`: Return `true` if the `subRange` range is
entirely contained by the `superRange` range.
Note that, since ranges may be non-contiguous, a version might not be
greater than a range, less than a range, *or* satisfy a range! For
example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
until `2.0.0`, so version `1.2.10` would not be greater than the
range (because `2.0.1` satisfies, which is higher), nor less than the
range (since `1.2.8` satisfies, which is lower), and it also does not
satisfy the range.
If you want to know if a version satisfies or does not satisfy a
range, use the `satisfies(version, range)` function.
### Coercion
* `coerce(version, options)`: Coerces a string to semver if possible
This aims to provide a very forgiving translation of a non-semver string to
semver. It looks for the first digit in a string and consumes all
remaining characters which satisfy at least a partial semver (e.g., `1`,
`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer
versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All
surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes
`3.4.0`). Only text which lacks digits will fail coercion (`version one`
is not valid). The maximum length for any semver component considered for
coercion is 16 characters; longer components will be ignored
(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any
semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
components are invalid (`9999999999999999.4.7.4` is likely invalid).
If the `options.rtl` flag is set, then `coerce` will return the right-most
coercible tuple that does not share an ending index with a longer coercible
tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not
`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of
any other overlapping SemVer tuple.
If the `options.includePrerelease` flag is set, then the `coerce` result will contain
prerelease and build parts of a version. For example, `1.2.3.4-rc.1+rev.2`
will preserve prerelease `rc.1` and build `rev.2` in the result.
### Clean
* `clean(version)`: Clean a string to be a valid semver if possible
This will return a cleaned and trimmed semver version. If the provided
version is not valid a null will be returned. This does not work for
ranges.
ex.
* `s.clean(' = v 2.1.5foo')`: `null`
* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'`
* `s.clean(' = v 2.1.5-foo')`: `null`
* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'`
* `s.clean('=v2.1.5')`: `'2.1.5'`
* `s.clean(' =v2.1.5')`: `'2.1.5'`
* `s.clean(' 2.1.5 ')`: `'2.1.5'`
* `s.clean('~1.0.0')`: `null`
## Constants
As a convenience, helper constants are exported to provide information about what `node-semver` supports:
### `RELEASE_TYPES`
- major
- premajor
- minor
- preminor
- patch
- prepatch
- prerelease
```
const semver = require('semver');
if (semver.RELEASE_TYPES.includes(arbitraryUserInput)) {
console.log('This is a valid release type!');
} else {
console.warn('This is NOT a valid release type!');
}
```
### `SEMVER_SPEC_VERSION`
2.0.0
```
const semver = require('semver');
console.log('We are currently using the semver specification version:', semver.SEMVER_SPEC_VERSION);
```
## Exported Modules
<!--
TODO: Make sure that all of these items are documented (classes aren't,
eg), and then pull the module name into the documentation for that specific
thing.
-->
You may pull in just the part of this semver utility that you need if you
are sensitive to packing and tree-shaking concerns. The main
`require('semver')` export uses getter functions to lazily load the parts
of the API that are used.
The following modules are available:
* `require('semver')`
* `require('semver/classes')`
* `require('semver/classes/comparator')`
* `require('semver/classes/range')`
* `require('semver/classes/semver')`
* `require('semver/functions/clean')`
* `require('semver/functions/cmp')`
* `require('semver/functions/coerce')`
* `require('semver/functions/compare')`
* `require('semver/functions/compare-build')`
* `require('semver/functions/compare-loose')`
* `require('semver/functions/diff')`
* `require('semver/functions/eq')`
* `require('semver/functions/gt')`
* `require('semver/functions/gte')`
* `require('semver/functions/inc')`
* `require('semver/functions/lt')`
* `require('semver/functions/lte')`
* `require('semver/functions/major')`
* `require('semver/functions/minor')`
* `require('semver/functions/neq')`
* `require('semver/functions/parse')`
* `require('semver/functions/patch')`
* `require('semver/functions/prerelease')`
* `require('semver/functions/rcompare')`
* `require('semver/functions/rsort')`
* `require('semver/functions/satisfies')`
* `require('semver/functions/sort')`
* `require('semver/functions/valid')`
* `require('semver/ranges/gtr')`
* `require('semver/ranges/intersects')`
* `require('semver/ranges/ltr')`
* `require('semver/ranges/max-satisfying')`
* `require('semver/ranges/min-satisfying')`
* `require('semver/ranges/min-version')`
* `require('semver/ranges/outside')`
* `require('semver/ranges/simplify')`
* `require('semver/ranges/subset')`
* `require('semver/ranges/to-comparators')`
* `require('semver/ranges/valid')`
@@ -0,0 +1,37 @@
export namespace constants {
let attentionSideAfter: 2;
let attentionSideBefore: 1;
let atxHeadingOpeningFenceSizeMax: 6;
let autolinkDomainSizeMax: 63;
let autolinkSchemeSizeMax: 32;
let cdataOpeningString: "CDATA[";
let characterGroupPunctuation: 2;
let characterGroupWhitespace: 1;
let characterReferenceDecimalSizeMax: 7;
let characterReferenceHexadecimalSizeMax: 6;
let characterReferenceNamedSizeMax: 31;
let codeFencedSequenceSizeMin: 3;
let contentTypeContent: "content";
let contentTypeDocument: "document";
let contentTypeFlow: "flow";
let contentTypeString: "string";
let contentTypeText: "text";
let hardBreakPrefixSizeMin: 2;
let htmlBasic: 6;
let htmlCdata: 5;
let htmlComment: 2;
let htmlComplete: 7;
let htmlDeclaration: 4;
let htmlInstruction: 3;
let htmlRawSizeMax: 8;
let htmlRaw: 1;
let linkResourceDestinationBalanceMax: 32;
let linkReferenceSizeMax: 999;
let listItemValueSizeMax: 10;
let numericBaseDecimal: 10;
let numericBaseHexadecimal: 16;
let tabSize: 4;
let thematicBreakMarkerCountMin: 3;
let v8MaxSafeChunkSize: 10000;
}
//# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2014 Dave Justice
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,12 @@
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[package.json]
indent_size = 2
@@ -0,0 +1,13 @@
import { isScalar } from '../nodes/identity.js';
function mapIncludes(ctx, items, search) {
const { uniqueKeys } = ctx.options;
if (uniqueKeys === false)
return false;
const isEqual = typeof uniqueKeys === 'function'
? uniqueKeys
: (a, b) => a === b || (isScalar(a) && isScalar(b) && a.value === b.value);
return items.some(pair => isEqual(pair.key, search));
}
export { mapIncludes };
@@ -0,0 +1,89 @@
# exponential-backoff
A utility that allows retrying a function with an exponential delay between attempts.
## Installation
```
npm i exponential-backoff
```
## Usage
The `backOff<T>` function takes a promise-returning function to retry, and an optional `BackOffOptions` object. It returns a `Promise<T>`.
```ts
function backOff<T>(
request: () => Promise<T>,
options?: BackOffOptions
): Promise<T>;
```
Here is an example retrying a function that calls a hypothetical weather endpoint:
```js
import { backOff } from "exponential-backoff";
function getWeather() {
return fetch("weather-endpoint");
}
async function main() {
try {
const response = await backOff(() => getWeather());
// process response
} catch (e) {
// handle error
}
}
main();
```
Migrating across major versions? Here are our [breaking changes](https://github.com/coveo/exponential-backoff/tree/master/doc/migration-guide.md).
### `BackOffOptions`
- `delayFirstAttempt?: boolean`
Decides whether the `startingDelay` should be applied before the first call. If `false`, the first call will occur without a delay.
Default value is `false`.
- `jitter?: JitterType | string`
Decides whether a [jitter](https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/) should be applied to the delay. Possible values are `full` and `none`.
Default value is `none`.
- `maxDelay?: number`
The maximum delay, in milliseconds, between two consecutive attempts.
Default value is `Infinity`.
- `numOfAttempts?: number`
The maximum number of times to attempt the function.
Default value is `10`.
Minimum value is `1`.
- `retry?: (e: any, attemptNumber: number) => boolean | Promise<boolean>`
The `retry` function can be used to run logic after every failed attempt (e.g. logging a message, assessing the last error, etc.). It is called with the last error and the upcoming attempt number. Returning `true` will retry the function as long as the `numOfAttempts` has not been exceeded. Returning `false` will end the execution.
Default value is a function that always returns `true`.
- `startingDelay?: number`
The delay, in milliseconds, before executing the function for the first time.
Default value is `100` ms.
- `timeMultiple?: number`
The `startingDelay` is multiplied by the `timeMultiple` to increase the delay between reattempts.
Default value is `2`.
@@ -0,0 +1,127 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
// You can regenerate it using `yarn generate-configs`
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const base_1 = __importDefault(require("./base"));
const eslint_recommended_1 = __importDefault(require("./eslint-recommended"));
/**
* Contains all of `recommended`, `recommended-type-checked`, and `strict`, along with additional strict rules that require type information.
* @see {@link https://typescript-eslint.io/users/configs#strict-type-checked}
*/
exports.default = (plugin, parser) => [
(0, base_1.default)(plugin, parser),
(0, eslint_recommended_1.default)(plugin, parser),
{
name: 'typescript-eslint/strict-type-checked',
rules: {
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/ban-ts-comment': [
'error',
{ minimumDescriptionLength: 10 },
],
'no-array-constructor': 'off',
'@typescript-eslint/no-array-constructor': 'error',
'@typescript-eslint/no-array-delete': 'error',
'@typescript-eslint/no-base-to-string': 'error',
'@typescript-eslint/no-confusing-void-expression': 'error',
'@typescript-eslint/no-deprecated': 'error',
'@typescript-eslint/no-duplicate-enum-values': 'error',
'@typescript-eslint/no-duplicate-type-constituents': 'error',
'@typescript-eslint/no-dynamic-delete': 'error',
'@typescript-eslint/no-empty-object-type': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-extra-non-null-assertion': 'error',
'@typescript-eslint/no-extraneous-class': 'error',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-for-in-array': 'error',
'no-implied-eval': 'off',
'@typescript-eslint/no-implied-eval': 'error',
'@typescript-eslint/no-invalid-void-type': 'error',
'@typescript-eslint/no-meaningless-void-operator': 'error',
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/no-misused-promises': 'error',
'@typescript-eslint/no-misused-spread': 'error',
'@typescript-eslint/no-mixed-enums': 'error',
'@typescript-eslint/no-namespace': 'error',
'@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-redundant-type-constituents': 'error',
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/no-this-alias': 'error',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
'@typescript-eslint/no-unnecessary-condition': 'error',
'@typescript-eslint/no-unnecessary-template-expression': 'error',
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/no-unnecessary-type-constraint': 'error',
'@typescript-eslint/no-unnecessary-type-conversion': 'error',
'@typescript-eslint/no-unnecessary-type-parameters': 'error',
'@typescript-eslint/no-unsafe-argument': 'error',
'@typescript-eslint/no-unsafe-assignment': 'error',
'@typescript-eslint/no-unsafe-call': 'error',
'@typescript-eslint/no-unsafe-declaration-merging': 'error',
'@typescript-eslint/no-unsafe-enum-comparison': 'error',
'@typescript-eslint/no-unsafe-function-type': 'error',
'@typescript-eslint/no-unsafe-member-access': 'error',
'@typescript-eslint/no-unsafe-return': 'error',
'@typescript-eslint/no-unsafe-unary-minus': 'error',
'no-unused-expressions': 'off',
'@typescript-eslint/no-unused-expressions': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'no-useless-constructor': 'off',
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/no-wrapper-object-types': 'error',
'no-throw-literal': 'off',
'@typescript-eslint/only-throw-error': 'error',
'@typescript-eslint/prefer-as-const': 'error',
'@typescript-eslint/prefer-literal-enum-member': 'error',
'@typescript-eslint/prefer-namespace-keyword': 'error',
'prefer-promise-reject-errors': 'off',
'@typescript-eslint/prefer-promise-reject-errors': 'error',
'@typescript-eslint/prefer-reduce-type-parameter': 'error',
'@typescript-eslint/prefer-return-this-type': 'error',
'@typescript-eslint/related-getter-setter-pairs': 'error',
'require-await': 'off',
'@typescript-eslint/require-await': 'error',
'@typescript-eslint/restrict-plus-operands': [
'error',
{
allowAny: false,
allowBoolean: false,
allowNullish: false,
allowNumberAndString: false,
allowRegExp: false,
},
],
'@typescript-eslint/restrict-template-expressions': [
'error',
{
allowAny: false,
allowBoolean: false,
allowNever: false,
allowNullish: false,
allowNumber: false,
allowRegExp: false,
},
],
'no-return-await': 'off',
'@typescript-eslint/return-await': [
'error',
'error-handling-correctness-only',
],
'@typescript-eslint/triple-slash-reference': 'error',
'@typescript-eslint/unbound-method': 'error',
'@typescript-eslint/unified-signatures': 'error',
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'error',
},
},
];
@@ -0,0 +1,13 @@
import type { SchemaOptions, TSchema } from '../schema/index.mjs';
import { type TNever } from '../never/index.mjs';
import { type TOptional } from '../optional/index.mjs';
import type { TReadonly } from '../readonly/index.mjs';
import type { TUnion } from './union-type.mjs';
type TIsUnionOptional<Types extends TSchema[]> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? Left extends TOptional<TSchema> ? true : TIsUnionOptional<Right> : false);
type TRemoveOptionalFromRest<Types extends TSchema[], Result extends TSchema[] = []> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? Left extends TOptional<infer S extends TSchema> ? TRemoveOptionalFromRest<Right, [...Result, TRemoveOptionalFromType<S>]> : TRemoveOptionalFromRest<Right, [...Result, Left]> : Result);
type TRemoveOptionalFromType<Type extends TSchema> = (Type extends TReadonly<infer Type extends TSchema> ? TReadonly<TRemoveOptionalFromType<Type>> : Type extends TOptional<infer Type extends TSchema> ? TRemoveOptionalFromType<Type> : Type);
type TResolveUnion<Types extends TSchema[], Result extends TSchema[] = TRemoveOptionalFromRest<Types>, IsOptional extends boolean = TIsUnionOptional<Types>> = (IsOptional extends true ? TOptional<TUnion<Result>> : TUnion<Result>);
export type TUnionEvaluated<Types extends TSchema[]> = (Types extends [TSchema] ? Types[0] : Types extends [] ? TNever : TResolveUnion<Types>);
/** `[Json]` Creates an evaluated Union type */
export declare function UnionEvaluated<Types extends TSchema[], Result = TUnionEvaluated<Types>>(T: [...Types], options?: SchemaOptions): Result;
export {};
@@ -0,0 +1,44 @@
{
"name": "esutils",
"description": "utility box for ECMAScript language tools",
"homepage": "https://github.com/estools/esutils",
"main": "lib/utils.js",
"version": "2.0.3",
"engines": {
"node": ">=0.10.0"
},
"directories": {
"lib": "./lib"
},
"files": [
"LICENSE.BSD",
"README.md",
"lib"
],
"maintainers": [
{
"name": "Yusuke Suzuki",
"email": "utatane.tea@gmail.com",
"web": "http://github.com/Constellation"
}
],
"repository": {
"type": "git",
"url": "http://github.com/estools/esutils.git"
},
"devDependencies": {
"chai": "~1.7.2",
"coffee-script": "~1.6.3",
"jshint": "2.6.3",
"mocha": "~2.2.1",
"regenerate": "~1.3.1",
"unicode-9.0.0": "~0.7.0"
},
"license": "BSD-2-Clause",
"scripts": {
"test": "npm run-script lint && npm run-script unit-test",
"lint": "jshint lib/*.js",
"unit-test": "mocha --compilers coffee:coffee-script -R spec",
"generate-regex": "node tools/generate-identifier-regex.js"
}
}
@@ -0,0 +1,324 @@
'use strict';
var utils = require('../utils.js');
var utils$1 = require('@typescript-eslint/utils');
var astUtils = require('@typescript-eslint/utils/ast-utils');
require('eslint-visitor-keys');
require('espree');
require('estraverse');
var _baseRule = utils.createRule(
{
name: "object-curly-spacing",
package: "js",
meta: {
type: "layout",
docs: {
description: "Enforce consistent spacing inside braces"
},
fixable: "whitespace",
schema: [
{
type: "string",
enum: ["always", "never"]
},
{
type: "object",
properties: {
arraysInObjects: {
type: "boolean"
},
objectsInObjects: {
type: "boolean"
}
},
additionalProperties: false
}
],
messages: {
requireSpaceBefore: "A space is required before '{{token}}'.",
requireSpaceAfter: "A space is required after '{{token}}'.",
unexpectedSpaceBefore: "There should be no space before '{{token}}'.",
unexpectedSpaceAfter: "There should be no space after '{{token}}'."
}
},
create(context) {
const spaced = context.options[0] === "always";
const sourceCode = context.sourceCode;
function isOptionSet(option) {
return context.options[1] ? context.options[1][option] === !spaced : false;
}
const options = {
spaced,
arraysInObjectsException: isOptionSet("arraysInObjects"),
objectsInObjectsException: isOptionSet("objectsInObjects")
};
function reportNoBeginningSpace(node, token) {
const nextToken = context.sourceCode.getTokenAfter(token, { includeComments: true });
context.report({
node,
loc: { start: token.loc.end, end: nextToken.loc.start },
messageId: "unexpectedSpaceAfter",
data: {
token: token.value
},
fix(fixer) {
return fixer.removeRange([token.range[1], nextToken.range[0]]);
}
});
}
function reportNoEndingSpace(node, token) {
const previousToken = context.sourceCode.getTokenBefore(token, { includeComments: true });
context.report({
node,
loc: { start: previousToken.loc.end, end: token.loc.start },
messageId: "unexpectedSpaceBefore",
data: {
token: token.value
},
fix(fixer) {
return fixer.removeRange([previousToken.range[1], token.range[0]]);
}
});
}
function reportRequiredBeginningSpace(node, token) {
context.report({
node,
loc: token.loc,
messageId: "requireSpaceAfter",
data: {
token: token.value
},
fix(fixer) {
return fixer.insertTextAfter(token, " ");
}
});
}
function reportRequiredEndingSpace(node, token) {
context.report({
node,
loc: token.loc,
messageId: "requireSpaceBefore",
data: {
token: token.value
},
fix(fixer) {
return fixer.insertTextBefore(token, " ");
}
});
}
function validateBraceSpacing(node, first, second, penultimate, last) {
if (utils.isTokenOnSameLine(first, second)) {
const firstSpaced = sourceCode.isSpaceBetweenTokens(first, second);
if (options.spaced && !firstSpaced)
reportRequiredBeginningSpace(node, first);
if (!options.spaced && firstSpaced && second.type !== "Line")
reportNoBeginningSpace(node, first);
}
if (utils.isTokenOnSameLine(penultimate, last)) {
const shouldCheckPenultimate = options.arraysInObjectsException && utils.isClosingBracketToken(penultimate) || options.objectsInObjectsException && utils.isClosingBraceToken(penultimate);
const penultimateType = shouldCheckPenultimate && sourceCode.getNodeByRangeIndex(penultimate.range[0]).type;
const closingCurlyBraceMustBeSpaced = options.arraysInObjectsException && penultimateType === "ArrayExpression" || options.objectsInObjectsException && (penultimateType === "ObjectExpression" || penultimateType === "ObjectPattern") ? !options.spaced : options.spaced;
const lastSpaced = sourceCode.isSpaceBetweenTokens(penultimate, last);
if (closingCurlyBraceMustBeSpaced && !lastSpaced)
reportRequiredEndingSpace(node, last);
if (!closingCurlyBraceMustBeSpaced && lastSpaced)
reportNoEndingSpace(node, last);
}
}
function getClosingBraceOfObject(node) {
const lastProperty = node.properties[node.properties.length - 1];
return sourceCode.getTokenAfter(lastProperty, utils.isClosingBraceToken);
}
function checkForObject(node) {
if (node.properties.length === 0)
return;
const first = sourceCode.getFirstToken(node);
const last = getClosingBraceOfObject(node);
const second = sourceCode.getTokenAfter(first, { includeComments: true });
const penultimate = sourceCode.getTokenBefore(last, { includeComments: true });
validateBraceSpacing(node, first, second, penultimate, last);
}
function checkForImport(node) {
if (node.specifiers.length === 0)
return;
let firstSpecifier = node.specifiers[0];
const lastSpecifier = node.specifiers[node.specifiers.length - 1];
if (lastSpecifier.type !== "ImportSpecifier")
return;
if (firstSpecifier.type !== "ImportSpecifier")
firstSpecifier = node.specifiers[1];
const first = sourceCode.getTokenBefore(firstSpecifier);
const last = sourceCode.getTokenAfter(lastSpecifier, utils.isNotCommaToken);
const second = sourceCode.getTokenAfter(first, { includeComments: true });
const penultimate = sourceCode.getTokenBefore(last, { includeComments: true });
validateBraceSpacing(node, first, second, penultimate, last);
}
function checkForExport(node) {
if (node.specifiers.length === 0)
return;
const firstSpecifier = node.specifiers[0];
const lastSpecifier = node.specifiers[node.specifiers.length - 1];
const first = sourceCode.getTokenBefore(firstSpecifier);
const last = sourceCode.getTokenAfter(lastSpecifier, utils.isNotCommaToken);
const second = sourceCode.getTokenAfter(first, { includeComments: true });
const penultimate = sourceCode.getTokenBefore(last, { includeComments: true });
validateBraceSpacing(node, first, second, penultimate, last);
}
return {
// var {x} = y;
ObjectPattern: checkForObject,
// var y = {x: 'y'}
ObjectExpression: checkForObject,
// import {y} from 'x';
ImportDeclaration: checkForImport,
// export {name} from 'yo';
ExportNamedDeclaration: checkForExport
};
}
}
);
const baseRule = /* @__PURE__ */ utils.castRuleModule(_baseRule);
var objectCurlySpacing = utils.createRule({
name: "object-curly-spacing",
package: "ts",
meta: {
...baseRule.meta,
docs: {
description: "Enforce consistent spacing inside braces"
}
},
defaultOptions: ["never"],
create(context) {
const [firstOption, secondOption] = context.options;
const spaced = firstOption === "always";
const sourceCode = context.sourceCode || context.getSourceCode();
function isOptionSet(option) {
return secondOption ? secondOption[option] === !spaced : false;
}
const options = {
spaced,
arraysInObjectsException: isOptionSet("arraysInObjects"),
objectsInObjectsException: isOptionSet("objectsInObjects")
};
function reportNoBeginningSpace(node, token) {
const nextToken = sourceCode.getTokenAfter(token, { includeComments: true });
context.report({
node,
loc: { start: token.loc.end, end: nextToken.loc.start },
messageId: "unexpectedSpaceAfter",
data: {
token: token.value
},
fix(fixer) {
return fixer.removeRange([token.range[1], nextToken.range[0]]);
}
});
}
function reportNoEndingSpace(node, token) {
const previousToken = sourceCode.getTokenBefore(token, { includeComments: true });
context.report({
node,
loc: { start: previousToken.loc.end, end: token.loc.start },
messageId: "unexpectedSpaceBefore",
data: {
token: token.value
},
fix(fixer) {
return fixer.removeRange([previousToken.range[1], token.range[0]]);
}
});
}
function reportRequiredBeginningSpace(node, token) {
context.report({
node,
loc: token.loc,
messageId: "requireSpaceAfter",
data: {
token: token.value
},
fix(fixer) {
return fixer.insertTextAfter(token, " ");
}
});
}
function reportRequiredEndingSpace(node, token) {
context.report({
node,
loc: token.loc,
messageId: "requireSpaceBefore",
data: {
token: token.value
},
fix(fixer) {
return fixer.insertTextBefore(token, " ");
}
});
}
function validateBraceSpacing(node, first, second, penultimate, last) {
if (astUtils.isTokenOnSameLine(first, second)) {
const firstSpaced = sourceCode.isSpaceBetween(first, second);
const secondType = sourceCode.getNodeByRangeIndex(
second.range[0]
).type;
const openingCurlyBraceMustBeSpaced = options.arraysInObjectsException && [
utils$1.AST_NODE_TYPES.TSMappedType,
utils$1.AST_NODE_TYPES.TSIndexSignature
].includes(secondType) ? !options.spaced : options.spaced;
if (openingCurlyBraceMustBeSpaced && !firstSpaced)
reportRequiredBeginningSpace(node, first);
if (!openingCurlyBraceMustBeSpaced && firstSpaced && second.type !== utils$1.AST_TOKEN_TYPES.Line) {
reportNoBeginningSpace(node, first);
}
}
if (astUtils.isTokenOnSameLine(penultimate, last)) {
const shouldCheckPenultimate = options.arraysInObjectsException && astUtils.isClosingBracketToken(penultimate) || options.objectsInObjectsException && astUtils.isClosingBraceToken(penultimate);
const penultimateType = shouldCheckPenultimate ? sourceCode.getNodeByRangeIndex(penultimate.range[0]).type : void 0;
const closingCurlyBraceMustBeSpaced = options.arraysInObjectsException && penultimateType === utils$1.AST_NODE_TYPES.TSTupleType || options.objectsInObjectsException && penultimateType !== void 0 && [
utils$1.AST_NODE_TYPES.TSMappedType,
utils$1.AST_NODE_TYPES.TSTypeLiteral
].includes(penultimateType) ? !options.spaced : options.spaced;
const lastSpaced = sourceCode.isSpaceBetween(penultimate, last);
if (closingCurlyBraceMustBeSpaced && !lastSpaced)
reportRequiredEndingSpace(node, last);
if (!closingCurlyBraceMustBeSpaced && lastSpaced)
reportNoEndingSpace(node, last);
}
}
function getClosingBraceOfObject(node) {
const lastProperty = node.members[node.members.length - 1];
return sourceCode.getTokenAfter(lastProperty, astUtils.isClosingBraceToken);
}
const rules = baseRule.create(context);
return {
...rules,
TSMappedType(node) {
const first = sourceCode.getFirstToken(node);
const last = sourceCode.getLastToken(node);
const second = sourceCode.getTokenAfter(first, {
includeComments: true
});
const penultimate = sourceCode.getTokenBefore(last, {
includeComments: true
});
validateBraceSpacing(node, first, second, penultimate, last);
},
TSTypeLiteral(node) {
if (node.members.length === 0)
return;
const first = sourceCode.getFirstToken(node);
const last = getClosingBraceOfObject(node);
const second = sourceCode.getTokenAfter(first, {
includeComments: true
});
const penultimate = sourceCode.getTokenBefore(last, {
includeComments: true
});
validateBraceSpacing(node, first, second, penultimate, last);
}
};
}
});
module.exports = objectCurlySpacing;
@@ -0,0 +1,27 @@
function createPlugin(plugin, config) {
return {
handler: plugin,
config,
}
}
createPlugin.withOptions = function (pluginFunction, configFunction = () => ({})) {
const optionsFunction = function (options) {
return {
__options: options,
handler: pluginFunction(options),
config: configFunction(options),
}
}
optionsFunction.__isOptionsFunction = true
// Expose plugin dependencies so that `object-hash` returns a different
// value if anything here changes, to ensure a rebuild is triggered.
optionsFunction.__pluginFunction = pluginFunction
optionsFunction.__configFunction = configFunction
return optionsFunction
}
export default createPlugin
@@ -0,0 +1,23 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.esnext_bigint = void 0;
const base_config_1 = require("./base-config");
const es2020_intl_1 = require("./es2020.intl");
exports.esnext_bigint = {
libs: [es2020_intl_1.es2020_intl],
variables: [
['BigIntToLocaleStringOptions', base_config_1.TYPE],
['BigInt', base_config_1.TYPE_VALUE],
['BigIntConstructor', base_config_1.TYPE],
['BigInt64Array', base_config_1.TYPE_VALUE],
['BigInt64ArrayConstructor', base_config_1.TYPE],
['BigUint64Array', base_config_1.TYPE_VALUE],
['BigUint64ArrayConstructor', base_config_1.TYPE],
['DataView', base_config_1.TYPE],
['Intl', base_config_1.TYPE_VALUE],
],
};
@@ -0,0 +1,356 @@
'use strict';
var getSideChannel = require('side-channel');
var utils = require('./utils');
var formats = require('./formats');
var has = Object.prototype.hasOwnProperty;
var arrayPrefixGenerators = {
brackets: function brackets(prefix) {
return prefix + '[]';
},
comma: 'comma',
indices: function indices(prefix, key) {
return prefix + '[' + key + ']';
},
repeat: function repeat(prefix) {
return prefix;
}
};
var isArray = Array.isArray;
var push = Array.prototype.push;
var pushToArray = function (arr, valueOrArray) {
push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
};
var toISO = Date.prototype.toISOString;
var defaultFormat = formats['default'];
var defaults = {
addQueryPrefix: false,
allowDots: false,
allowEmptyArrays: false,
arrayFormat: 'indices',
charset: 'utf-8',
charsetSentinel: false,
commaRoundTrip: false,
delimiter: '&',
encode: true,
encodeDotInKeys: false,
encoder: utils.encode,
encodeValuesOnly: false,
filter: void undefined,
format: defaultFormat,
formatter: formats.formatters[defaultFormat],
// deprecated
indices: false,
serializeDate: function serializeDate(date) {
return toISO.call(date);
},
skipNulls: false,
strictNullHandling: false
};
var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
return typeof v === 'string'
|| typeof v === 'number'
|| typeof v === 'boolean'
|| typeof v === 'symbol'
|| typeof v === 'bigint';
};
var sentinel = {};
var stringify = function stringify(
object,
prefix,
generateArrayPrefix,
commaRoundTrip,
allowEmptyArrays,
strictNullHandling,
skipNulls,
encodeDotInKeys,
encoder,
filter,
sort,
allowDots,
serializeDate,
format,
formatter,
encodeValuesOnly,
charset,
sideChannel
) {
var obj = object;
var tmpSc = sideChannel;
var step = 0;
var findFlag = false;
while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
// Where object last appeared in the ref tree
var pos = tmpSc.get(object);
step += 1;
if (typeof pos !== 'undefined') {
if (pos === step) {
throw new RangeError('Cyclic object value');
} else {
findFlag = true; // Break while
}
}
if (typeof tmpSc.get(sentinel) === 'undefined') {
step = 0;
}
}
if (typeof filter === 'function') {
obj = filter(prefix, obj);
} else if (obj instanceof Date) {
obj = serializeDate(obj);
} else if (generateArrayPrefix === 'comma' && isArray(obj)) {
obj = utils.maybeMap(obj, function (value) {
if (value instanceof Date) {
return serializeDate(value);
}
return value;
});
}
if (obj === null) {
if (strictNullHandling) {
return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix;
}
obj = '';
}
if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
if (encoder) {
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];
}
return [formatter(prefix) + '=' + formatter(String(obj))];
}
var values = [];
if (typeof obj === 'undefined') {
return values;
}
var objKeys;
if (generateArrayPrefix === 'comma' && isArray(obj)) {
// we need to join elements in
if (encodeValuesOnly && encoder) {
obj = utils.maybeMap(obj, encoder);
}
objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
} else if (isArray(filter)) {
objKeys = filter;
} else {
var keys = Object.keys(obj);
objKeys = sort ? keys.sort(sort) : keys;
}
var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix);
var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;
if (allowEmptyArrays && isArray(obj) && obj.length === 0) {
return adjustedPrefix + '[]';
}
for (var j = 0; j < objKeys.length; ++j) {
var key = objKeys[j];
var value = typeof key === 'object' && key && typeof key.value !== 'undefined'
? key.value
: obj[key];
if (skipNulls && value === null) {
continue;
}
var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, '%2E') : String(key);
var keyPrefix = isArray(obj)
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix
: adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');
sideChannel.set(object, step);
var valueSideChannel = getSideChannel();
valueSideChannel.set(sentinel, sideChannel);
pushToArray(values, stringify(
value,
keyPrefix,
generateArrayPrefix,
commaRoundTrip,
allowEmptyArrays,
strictNullHandling,
skipNulls,
encodeDotInKeys,
generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder,
filter,
sort,
allowDots,
serializeDate,
format,
formatter,
encodeValuesOnly,
charset,
valueSideChannel
));
}
return values;
};
var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
if (!opts) {
return defaults;
}
if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
}
if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {
throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');
}
if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
throw new TypeError('Encoder has to be a function.');
}
var charset = opts.charset || defaults.charset;
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
}
var format = formats['default'];
if (typeof opts.format !== 'undefined') {
if (!has.call(formats.formatters, opts.format)) {
throw new TypeError('Unknown format option provided.');
}
format = opts.format;
}
var formatter = formats.formatters[format];
var filter = defaults.filter;
if (typeof opts.filter === 'function' || isArray(opts.filter)) {
filter = opts.filter;
}
var arrayFormat;
if (opts.arrayFormat in arrayPrefixGenerators) {
arrayFormat = opts.arrayFormat;
} else if ('indices' in opts) {
arrayFormat = opts.indices ? 'indices' : 'repeat';
} else {
arrayFormat = defaults.arrayFormat;
}
if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
}
var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
return {
addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,
allowDots: allowDots,
allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
arrayFormat: arrayFormat,
charset: charset,
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
commaRoundTrip: !!opts.commaRoundTrip,
delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys,
encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,
encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
filter: filter,
format: format,
formatter: formatter,
serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,
skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,
sort: typeof opts.sort === 'function' ? opts.sort : null,
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
};
};
module.exports = function (object, opts) {
var obj = object;
var options = normalizeStringifyOptions(opts);
var objKeys;
var filter;
if (typeof options.filter === 'function') {
filter = options.filter;
obj = filter('', obj);
} else if (isArray(options.filter)) {
filter = options.filter;
objKeys = filter;
}
var keys = [];
if (typeof obj !== 'object' || obj === null) {
return '';
}
var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];
var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip;
if (!objKeys) {
objKeys = Object.keys(obj);
}
if (options.sort) {
objKeys.sort(options.sort);
}
var sideChannel = getSideChannel();
for (var i = 0; i < objKeys.length; ++i) {
var key = objKeys[i];
var value = obj[key];
if (options.skipNulls && value === null) {
continue;
}
pushToArray(keys, stringify(
value,
key,
generateArrayPrefix,
commaRoundTrip,
options.allowEmptyArrays,
options.strictNullHandling,
options.skipNulls,
options.encodeDotInKeys,
options.encode ? options.encoder : null,
options.filter,
options.sort,
options.allowDots,
options.serializeDate,
options.format,
options.formatter,
options.encodeValuesOnly,
options.charset,
sideChannel
));
}
var joined = keys.join(options.delimiter);
var prefix = options.addQueryPrefix === true ? '?' : '';
if (options.charsetSentinel) {
if (options.charset === 'iso-8859-1') {
// encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
prefix += 'utf8=%26%2310003%3B&';
} else {
// encodeURIComponent('✓')
prefix += 'utf8=%E2%9C%93&';
}
}
return joined.length > 0 ? prefix + joined : '';
};
@@ -0,0 +1,79 @@
import type { Options as Options_2 } from 'compute-scroll-into-view'
import type { ScrollAction } from 'compute-scroll-into-view'
/** @public */
export declare interface CustomBehaviorOptions<T = unknown> extends Options_2 {
behavior: CustomScrollBehaviorCallback<T>
}
/** @public */
export declare type CustomScrollBehaviorCallback<T = unknown> = (
actions: ScrollAction[]
) => T
/** @public */
export declare type Options<T = unknown> =
| StandardBehaviorOptions
| CustomBehaviorOptions<T>
/**
* Scrolls the given element into view, with options for when, and how.
* Supports the same `options` as [`Element.prototype.scrollIntoView`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView) with additions such as `scrollMode`, `behavior: Function` and `skipOverflowHiddenElements`.
* @public
*/
declare function scrollIntoView(
target: Element,
options?: StandardBehaviorOptions | boolean
): void
/**
* Scrolls the given element into view, with options for when, and how.
* Supports the same `options` as [`Element.prototype.scrollIntoView`](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView) with additions such as `scrollMode`, `behavior: Function` and `skipOverflowHiddenElements`.
*
* You can set the expected return type for `behavior: Function`:
* ```ts
* await scrollIntoView<Promise<boolean[]>>(node, {
* behavior: async actions => {
* return Promise.all(actions.map(
* // animate() resolves to `true` if anything was animated, `false` if the element already were in the end state
* ({ el, left, top }) => animate(el, {scroll: {left, top}})
* ))
* }
* })
* ```
* @public
*/
declare function scrollIntoView<T>(
target: Element,
options: CustomBehaviorOptions<T>
): T
export default scrollIntoView
/**
* Only scrolls if the `node` is partially out of view:
* ```ts
* scrollIntoView(node, { scrollMode: 'if-needed' })
* ```
* Skips scrolling `overflow: hidden` elements:
* ```ts
* scrollIntoView(node, { skipOverflowHiddenElements: true })
* ```
* When scrolling is needed do the least and smoothest scrolling possible:
* ```ts
* scrollIntoView(node, {
* behavior: 'smooth',
* scrollMode: 'if-needed',
* block: 'nearest',
* inline: 'nearest',
* })
* ```
* @public
*/
export declare interface StandardBehaviorOptions extends Options_2 {
/**
* @defaultValue 'auto
*/
behavior?: ScrollBehavior
}
export {}
@@ -0,0 +1,3 @@
import type { Plugin } from '../types';
declare const useDebouncePlugin: Plugin<any, any[]>;
export default useDebouncePlugin;
@@ -0,0 +1,15 @@
{
"name": "mylib",
"version": "0.0.0",
"description": "",
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"buffer": "*"
}
}
@@ -0,0 +1,28 @@
var $4eeea1c984cc0628$exports = require("./useTab.main.js");
var $8db1928b18472a1f$exports = require("./useTabPanel.main.js");
var $f2b4a4926440e901$exports = require("./useTabList.main.js");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useTab", () => $4eeea1c984cc0628$exports.useTab);
$parcel$export(module.exports, "useTabPanel", () => $8db1928b18472a1f$exports.useTabPanel);
$parcel$export(module.exports, "useTabList", () => $f2b4a4926440e901$exports.useTabList);
/*
* 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.
*/
//# sourceMappingURL=main.js.map
@@ -0,0 +1,47 @@
import * as _heroui_system from '@heroui/system';
import { Node } from '@react-types/shared';
import { TreeState } from '@react-stately/tree';
import { Key } from 'react';
import { MenuItemProps } from './menu-item.js';
import { MenuSectionBaseProps } from './base/menu-section-base.js';
import 'react/jsx-runtime';
import './use-menu-item.js';
import './base/menu-item-base.js';
import '@heroui/theme';
import '@react-aria/menu';
import '@heroui/aria-utils';
import 'tailwind-variants';
import '@heroui/divider';
interface MenuSectionProps<T extends object = object> extends MenuSectionBaseProps {
item: Node<T>;
state: TreeState<T>;
/**
* The menu items variant.
*/
variant?: MenuItemProps["variant"];
/**
* The menu items color.
*/
color?: MenuItemProps["color"];
/**
* Whether to disable the items animation.
* @default false
*/
disableAnimation?: boolean;
/**
* Whether the menu should close when the menu item is selected.
* @default true
*/
closeOnSelect?: MenuItemProps["closeOnSelect"];
/**
* Callback fired when the menu item is selected.
*/
onAction?: (key: Key) => void;
}
/**
* @internal
*/
declare const MenuSection: _heroui_system.InternalForwardRefRenderFunction<"li", MenuSectionProps<object>, never>;
export { MenuSectionProps, MenuSection as default };
@@ -0,0 +1,14 @@
import ansiRegex from 'ansi-regex';
const regex = ansiRegex();
export default function stripAnsi(string) {
if (typeof string !== 'string') {
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
}
// Even though the regex is global, we don't need to reset the `.lastIndex`
// because unlike `.exec()` and `.test()`, `.replace()` does it automatically
// and doing it manually has a performance penalty.
return string.replace(regex, '');
}
@@ -0,0 +1,39 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sha512_256WithRSAEncryption = exports.sha512_224WithRSAEncryption = exports.sha512WithRSAEncryption = exports.sha384WithRSAEncryption = exports.sha256WithRSAEncryption = exports.sha224WithRSAEncryption = exports.sha1WithRSAEncryption = exports.md5WithRSAEncryption = exports.md2WithRSAEncryption = exports.rsaEncryption = exports.pSpecifiedEmpty = exports.mgf1SHA1 = exports.sha512_256 = exports.sha512_224 = exports.sha512 = exports.sha384 = exports.sha256 = exports.sha224 = exports.sha1 = exports.md4 = exports.md2 = void 0;
const asn1_schema_1 = require("@peculiar/asn1-schema");
const asn1_x509_1 = require("@peculiar/asn1-x509");
const oid = require("./object_identifiers");
function create(algorithm) {
return new asn1_x509_1.AlgorithmIdentifier({ algorithm, parameters: null });
}
exports.md2 = create(oid.id_md2);
exports.md4 = create(oid.id_md5);
exports.sha1 = create(oid.id_sha1);
exports.sha224 = create(oid.id_sha224);
exports.sha256 = create(oid.id_sha256);
exports.sha384 = create(oid.id_sha384);
exports.sha512 = create(oid.id_sha512);
exports.sha512_224 = create(oid.id_sha512_224);
exports.sha512_256 = create(oid.id_sha512_256);
exports.mgf1SHA1 = new asn1_x509_1.AlgorithmIdentifier({
algorithm: oid.id_mgf1,
parameters: asn1_schema_1.AsnConvert.serialize(exports.sha1),
});
exports.pSpecifiedEmpty = new asn1_x509_1.AlgorithmIdentifier({
algorithm: oid.id_pSpecified,
parameters: asn1_schema_1.AsnConvert.serialize(asn1_schema_1.AsnOctetStringConverter.toASN(new Uint8Array([
0xda, 0x39, 0xa3, 0xee, 0x5e, 0x6b, 0x4b, 0x0d, 0x32, 0x55, 0xbf, 0xef, 0x95, 0x60, 0x18,
0x90, 0xaf, 0xd8, 0x07, 0x09,
]).buffer)),
});
exports.rsaEncryption = create(oid.id_rsaEncryption);
exports.md2WithRSAEncryption = create(oid.id_md2WithRSAEncryption);
exports.md5WithRSAEncryption = create(oid.id_md5WithRSAEncryption);
exports.sha1WithRSAEncryption = create(oid.id_sha1WithRSAEncryption);
exports.sha224WithRSAEncryption = create(oid.id_sha512_224WithRSAEncryption);
exports.sha256WithRSAEncryption = create(oid.id_sha512_256WithRSAEncryption);
exports.sha384WithRSAEncryption = create(oid.id_sha384WithRSAEncryption);
exports.sha512WithRSAEncryption = create(oid.id_sha512WithRSAEncryption);
exports.sha512_224WithRSAEncryption = create(oid.id_sha512_224WithRSAEncryption);
exports.sha512_256WithRSAEncryption = create(oid.id_sha512_256WithRSAEncryption);
@@ -0,0 +1,29 @@
"use client";
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/base/table-cell.tsx
var table_cell_exports = {};
__export(table_cell_exports, {
default: () => table_cell_default
});
module.exports = __toCommonJS(table_cell_exports);
var import_table = require("@react-stately/table");
var TableCell = import_table.Cell;
var table_cell_default = TableCell;
@@ -0,0 +1,9 @@
'use strict';
var $floor = require('./floor');
/** @type {import('./mod')} */
module.exports = function mod(number, modulo) {
var remain = number % modulo;
return $floor(remain >= 0 ? remain : remain + modulo);
};
@@ -0,0 +1,8 @@
"use client";
import {
skeleton_default
} from "./chunk-TLYTI3QM.mjs";
import "./chunk-XB6FZTQR.mjs";
export {
skeleton_default as default
};
@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CertificateList = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
const algorithm_identifier_1 = require("./algorithm_identifier");
const tbs_cert_list_1 = require("./tbs_cert_list");
class CertificateList {
constructor(params = {}) {
this.tbsCertList = new tbs_cert_list_1.TBSCertList();
this.signatureAlgorithm = new algorithm_identifier_1.AlgorithmIdentifier();
this.signature = new ArrayBuffer(0);
Object.assign(this, params);
}
}
exports.CertificateList = CertificateList;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: tbs_cert_list_1.TBSCertList, raw: true })
], CertificateList.prototype, "tbsCertList", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: algorithm_identifier_1.AlgorithmIdentifier })
], CertificateList.prototype, "signatureAlgorithm", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.BitString })
], CertificateList.prototype, "signature", void 0);
@@ -0,0 +1,188 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _regenerator;
var _regeneratorDefine = require("./regeneratorDefine.js");
function _regenerator() {
var undefined;
var $Symbol = typeof Symbol === "function" ? Symbol : {};
var iteratorSymbol = $Symbol.iterator || "@@iterator";
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
var _;
function wrap(innerFn, outerFn, self, tryLocsList) {
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
var generator = Object.create(protoGenerator.prototype);
(0, _regeneratorDefine.default)(generator, "_invoke", makeInvokeMethod(innerFn, self, tryLocsList), true);
return generator;
}
var ContinueSentinel = {};
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
_ = Object.getPrototypeOf;
var IteratorPrototype = [][iteratorSymbol] ? _(_([][iteratorSymbol]())) : ((0, _regeneratorDefine.default)(_ = {}, iteratorSymbol, function () {
return this;
}), _);
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
GeneratorFunction.prototype = GeneratorFunctionPrototype;
(0, _regeneratorDefine.default)(Gp, "constructor", GeneratorFunctionPrototype);
(0, _regeneratorDefine.default)(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
GeneratorFunction.displayName = "GeneratorFunction";
(0, _regeneratorDefine.default)(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction");
(0, _regeneratorDefine.default)(Gp);
(0, _regeneratorDefine.default)(Gp, toStringTagSymbol, "Generator");
(0, _regeneratorDefine.default)(Gp, iteratorSymbol, function () {
return this;
});
(0, _regeneratorDefine.default)(Gp, "toString", function () {
return "[object Generator]";
});
function mark(genFun) {
if (Object.setPrototypeOf) {
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
} else {
genFun.__proto__ = GeneratorFunctionPrototype;
(0, _regeneratorDefine.default)(genFun, toStringTagSymbol, "GeneratorFunction");
}
genFun.prototype = Object.create(Gp);
return genFun;
}
function makeInvokeMethod(innerFn, self, tryLocsList) {
var state = 0;
function invoke(_methodName, _method, _arg) {
if (state > 1) {
throw TypeError("Generator is already running");
} else if (done) {
if (_method === 1) {
Context_dispatchExceptionOrFinishOrAbrupt(_method, _arg);
}
}
method = _method;
arg = _arg;
while ((_ = method < 2 ? undefined : arg) || !done) {
if (!delegateIterator) {
if (!method) {
ctx.v = arg;
} else if (method < 3) {
if (method > 1) ctx.n = -1;
Context_dispatchExceptionOrFinishOrAbrupt(method, arg);
} else {
ctx.n = arg;
}
}
try {
state = 2;
if (delegateIterator) {
if (!method) _methodName = "next";
if (_ = delegateIterator[_methodName]) {
if (!(_ = _.call(delegateIterator, arg))) {
throw TypeError("iterator result is not an object");
}
if (!_.done) {
return _;
}
arg = _.value;
if (method < 2) {
method = 0;
}
} else {
if (method === 1 && (_ = delegateIterator["return"])) {
_.call(delegateIterator);
}
if (method < 2) {
arg = TypeError("The iterator does not provide a '" + _methodName + "' method");
method = 1;
}
}
delegateIterator = undefined;
} else {
if (done = ctx.n < 0) {
_ = arg;
} else {
_ = innerFn.call(self, ctx);
}
if (_ !== ContinueSentinel) {
break;
}
}
} catch (e) {
delegateIterator = undefined;
method = 1;
arg = e;
} finally {
state = 1;
}
}
return {
value: _,
done: done
};
}
var tryEntries = tryLocsList || [];
var done = false;
var delegateIterator;
var method;
var arg;
var ctx = {
p: 0,
n: 0,
v: undefined,
a: Context_dispatchExceptionOrFinishOrAbrupt,
f: Context_dispatchExceptionOrFinishOrAbrupt.bind(undefined, 4),
d: function (iterable, nextLoc) {
delegateIterator = iterable;
method = 0;
arg = undefined;
ctx.n = nextLoc;
return ContinueSentinel;
}
};
function Context_dispatchExceptionOrFinishOrAbrupt(_type, _arg) {
method = _type;
arg = _arg;
for (_ = 0; !done && state && !shouldReturn && _ < tryEntries.length; _++) {
var entry = tryEntries[_];
var prev = ctx.p;
var finallyLoc = entry[2];
var shouldReturn;
if (_type > 3) {
if (shouldReturn = finallyLoc === _arg) {
arg = entry[(method = entry[4]) ? 5 : (method = 3, 3)];
entry[4] = entry[5] = undefined;
}
} else {
if (entry[0] <= prev) {
if (shouldReturn = _type < 2 && prev < entry[1]) {
method = 0;
ctx.v = _arg;
ctx.n = entry[1];
} else if (prev < finallyLoc) {
if (shouldReturn = _type < 3 || entry[0] > _arg || _arg > finallyLoc) {
entry[4] = _type;
entry[5] = _arg;
ctx.n = finallyLoc;
method = 0;
}
}
}
}
}
if (shouldReturn || _type > 1) {
return ContinueSentinel;
}
done = true;
throw _arg;
}
return invoke;
}
return (exports.default = _regenerator = function () {
return {
w: wrap,
m: mark
};
})();
}
//# sourceMappingURL=regenerator.js.map
@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var docNoticeRole = {
abstract: false,
accessibleNameRequired: false,
baseConcepts: [],
childrenPresentational: false,
nameFrom: ['author'],
prohibitedProps: [],
props: {
'aria-disabled': null,
'aria-errormessage': null,
'aria-expanded': null,
'aria-haspopup': null,
'aria-invalid': null
},
relatedConcepts: [{
concept: {
name: 'notice [EPUB-SSV]'
},
module: 'EPUB'
}],
requireContextRole: [],
requiredContextRole: [],
requiredOwnedElements: [],
requiredProps: {},
superClass: [['roletype', 'structure', 'section', 'note']]
};
var _default = exports.default = docNoticeRole;
@@ -0,0 +1,111 @@
// @flow
export interface Patch {
op: "replace" | "remove" | "add";
path: (string | number)[];
value?: any;
}
export type PatchListener = (patches: Patch[], inversePatches: Patch[]) => void
type Base = {...} | Array<any>
interface IProduce {
/**
* Immer takes a state, and runs a function against it.
* That function can freely mutate the state, as it will create copies-on-write.
* This means that the original state will stay unchanged, and once the function finishes, the modified state is returned.
*
* If the first argument is a function, this is interpreted as the recipe, and will create a curried function that will execute the recipe
* any time it is called with the current state.
*
* @param currentState - the state to start with
* @param recipe - function that receives a proxy of the current state as first argument and which can be freely modified
* @param initialState - if a curried function is created and this argument was given, it will be used as fallback if the curried function is called with a state of undefined
* @returns The next state: a new state, or the current state if nothing was modified
*/
<S: Base>(
currentState: S,
recipe: (draftState: S) => S | void,
patchListener?: PatchListener
): S;
// curried invocations with initial state
<S: Base, A = void, B = void, C = void>(
recipe: (draftState: S, a: A, b: B, c: C, ...extraArgs: any[]) => S | void,
initialState: S
): (currentState: S | void, a: A, b: B, c: C, ...extraArgs: any[]) => S;
// curried invocations without initial state
<S: Base, A = void, B = void, C = void>(
recipe: (draftState: S, a: A, b: B, c: C, ...extraArgs: any[]) => S | void
): (currentState: S, a: A, b: B, c: C, ...extraArgs: any[]) => S;
}
interface IProduceWithPatches {
/**
* Like `produce`, but instead of just returning the new state,
* a tuple is returned with [nextState, patches, inversePatches]
*
* Like produce, this function supports currying
*/
<S: Base>(
currentState: S,
recipe: (draftState: S) => S | void
): [S, Patch[], Patch[]];
// curried invocations with initial state
<S: Base, A = void, B = void, C = void>(
recipe: (draftState: S, a: A, b: B, c: C, ...extraArgs: any[]) => S | void,
initialState: S
): (currentState: S | void, a: A, b: B, c: C, ...extraArgs: any[]) => [S, Patch[], Patch[]];
// curried invocations without initial state
<S: Base, A = void, B = void, C = void>(
recipe: (draftState: S, a: A, b: B, c: C, ...extraArgs: any[]) => S | void
): (currentState: S, a: A, b: B, c: C, ...extraArgs: any[]) => [S, Patch[], Patch[]];
}
declare export var produce: IProduce
declare export var produceWithPatches: IProduceWithPatches
declare export var nothing: typeof undefined
declare export var immerable: Symbol
/**
* Automatically freezes any state trees generated by immer.
* This protects against accidental modifications of the state tree outside of an immer function.
* This comes with a performance impact, so it is recommended to disable this option in production.
* By default it is turned on during local development, and turned off in production.
*/
declare export function setAutoFreeze(autoFreeze: boolean): void
/**
* Pass false to disable strict shallow copy.
*
* By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.
*/
declare export function setUseStrictShallowCopy(useStrictShallowCopy: boolean): void
declare export function applyPatches<S>(state: S, patches: Patch[]): S
declare export function original<S>(value: S): S
declare export function current<S>(value: S): S
declare export function isDraft(value: any): boolean
/**
* Creates a mutable draft from an (immutable) object / array.
* The draft can be modified until `finishDraft` is called
*/
declare export function createDraft<T>(base: T): T
/**
* Given a draft that was created using `createDraft`,
* finalizes the draft into a new immutable object.
* Optionally a patch-listener can be provided to gather the patches that are needed to construct the object.
*/
declare export function finishDraft<T>(base: T, listener?: PatchListener): T
declare export function enableMapSet(): void
declare export function enablePatches(): void
declare export function freeze<T>(obj: T, freeze?: boolean): T
@@ -0,0 +1,3 @@
import DependencyContainer from "../types/dependency-container";
declare type FactoryFunction<T> = (dependencyContainer: DependencyContainer) => T;
export default FactoryFunction;
@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [ljharb]
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/is-bigint
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,3 @@
# @react-types/switch
This package is part of [react-spectrum](https://github.com/adobe/react-spectrum). See the repo for more details.
@@ -0,0 +1 @@
{"name":"is-finalizationregistry","version":"1.1.1","requiresBuild":false,"files":{".eslintrc":{"checkedAt":1794532097547,"integrity":"sha512-dnLymwZ9AujC+eAzgR5wSX6DdRjaGmRjQPMpqv95MPqB63wfwR2rsRXhSf/v6WNIr3o4QjFzQ/9p8EEh6nbsPQ==","mode":420,"size":78},".nycrc":{"checkedAt":1794532097548,"integrity":"sha512-2vm1RFz8Ajl/OYrfoCWPJIm3Bpnf7Gyn5bha/lZx/cq+We3uMy9xj15XeP6x4wF3jf/pO7KMHAkU9mllm605xg==","mode":420,"size":139},"LICENSE":{"checkedAt":1794532096619,"integrity":"sha512-Pg0j9BX+Fmp8mAx1XW2wDVYsnbXuEq5QKBINQE+k1CyfdfAzv0tb/KUpKlAfmNVDddSa6Px43FQXpmTJrbd2Jw==","mode":420,"size":1067},"index.js":{"checkedAt":1794532097548,"integrity":"sha512-5Mw9EOzq16yNZmNkWRLODblPj+afI90ZH7WPI/mdgHZd1OBGPh0xf5aP0vLiEEtPAiKkfc3gHlprzL+Ip9md3g==","mode":420,"size":826},"test/index.js":{"checkedAt":1794532097548,"integrity":"sha512-/88V4Yt7vL7xcaP8370pygYSjWLsfq60blDFR9PTkoUO4xAG4BA3/5p82TfpsIyEO8OngqowOIKlTrAH/BwnkQ==","mode":420,"size":929},"package.json":{"checkedAt":1794532097548,"integrity":"sha512-JddZUiwMQpuziFcAgbDklmDw8jwPElzuj2nOUcRFHFPF6a7+/VgCjNeWml8R6/pbUchg3mclmckq+3Ks/Fh69Q==","mode":420,"size":2320},"tsconfig.json":{"checkedAt":1794532097548,"integrity":"sha512-xBbrFV4Zb7DECDeefgt+yhGfHLeRKbwlh2H6L08d8tjUDpSQt9WyNmB4pcNL/slJJ50FIksbN+w5cFzfKhZ+bw==","mode":420,"size":123},"CHANGELOG.md":{"checkedAt":1794532097548,"integrity":"sha512-L3wc6cirKGPDXT/0PLXf6bE2b1vCI8zAw8HjYSH5GmJjR2Eems+ZsXTJ3e8ZmNdG+pXsZxHnr1gQy2RzExmm4w==","mode":420,"size":8360},"README.md":{"checkedAt":1794532097548,"integrity":"sha512-GBs7JL/2hde+zL23/i7JxWVflI8282vFUCQYVurQRFsrUJ4shCq2yYtNncXf/RjbLPcibrHsuKvtrawf7VnRXQ==","mode":420,"size":2628},"index.d.ts":{"checkedAt":1794532097549,"integrity":"sha512-GbM7fNjwsXYdpbdOJtNWO+t60xPqaJwcVC7E2qoXOedjeJ8p8Dre1/m2dGAZvksQdgwaD4nfgMnTkMb5VL2oSA==","mode":420,"size":138},".github/FUNDING.yml":{"checkedAt":1794532097549,"integrity":"sha512-i+nnyfOvYCTPu5r8YOc9Twjw7fipGIe/UyhXFF/+kU5iDAVI0WXEhn1JqDJmtzH8OPZSUH78mdt3u/nwVZsKVQ==","mode":420,"size":594}}}
@@ -0,0 +1,520 @@
export default `flf2a$ 5 5 79 0 8
This font is (c) Michel Eftimakis 1995 -- Version 1.0 -- 3 may 1995
____________________________________________________________ /\`____
| Michel Eftimakis | "Ascii-Artist" '\\/ |
| Michel.Eftimakis@vlsi.com | Boo)- (00) ||
| Tel : (33) 92 96 27 19 | (_\`'_) ||
|__ Fax : (33) 92 96 27 01 _________|____ FRANCE ___________ _!!_ ____||
|_____________________________________________________________________|
@
@
@
@
$$$$$$$$$@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
$$$$$$$$$@@
#########@
#########@
#########@
#########@
#########@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
_ _ _ __ __ _ @
/\\ |_) / | \\ |_ |_ / |_| @
/--\\ |_) \\_ |_/ |__ | \\_? | | @
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$@@
@
/| @
| @
@
$$$$$@@
_ @
) @
/_ @
@
$$$$$@@
_ @
_) @
_) @
@
$$$$$@@
. @
/| @
'-| @
@
$$$$$@@
_ @
|_ @
_) @
@
$$$$$@@
@
/ @
(_) @
@
$$$$$@@
__ @
/ @
/ @
@
$$$$$@@
_ @
(_) @
(_) @
@
$$$$$@@
@
@
@
@
@@
@
@
@
@
$$$$$$$$$@@
#########@
#########@
#########@
#########@
#########@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
######### ######### ___ ######### ######### @
##[\`'\`']# \\\`~'/ ##'\\v/\`## /\\*/\\ ##|\`+'|## '\\v/\` ##\\\`~'/## [\`'\`'] @
###| |## (o o) ##(o 0)## /(o o)\\ ##(o o)## (o 0) ##(o o)## | | @
###|__|## \\ / \\ ###(_)### (_) ###(_)### (_) ###\\ / \\# |__| @
######### " ######### ######### ####"####$$$$$$$$$@@
@
'\\v/\` @
(o 0) @
(_) @
$$$$$$$$$@@
@
\\\`~'/ @
(o o) @
\\ / \\ @
$$$$"$$$$@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
|\`+'| @
(o o) @
(_) @
$$$$$$$$$@@
@
|:+:| @
(o:o) @
(:) @
$$$$$$$$$@@
@
@
@
@
@@
@
':v:\` @
(o:0) @
(:) @
$$$$$$$$$@@
_ @
(:) @
|:| @
|:| @
$$$$$$$$$@@
_ @
(_) @
| | @
|_| @
$$$$$$$$$@@
___ @
/\\*/\\ @
/(o o)\\ @
(_) @
$$$$$$$$$@@
@
[\`'\`'] @
| | @
|__| @
$$$$$$$$$@@
@
@
@
@
@@
@
[\`'\`'] @
|::| @
|::| @
$$$$$$$$$@@
@
@
@
@
@@
@
\\\`.'/ @
(o:o) @
\\:/:\\ @
$$$$"$$$$@@
___ @
/\\:/\\ @
/(o:o)\\ @
(:) @
$$$$$$$$$@@
@
@
@
@
@@
######### ######### ######### ######### @
######### ######### ######### ######### @
######### ######### ######### ######### @
######### ######### ######### ######### @
######### ######### ######### #########$$$$$$$$$@@
_ ######### _ ######### _ ######### _ #########@
(_) ###(_)### (_) ###(_)### (_) ###(_)### (_) ###(_)###@
| | ###| |### | | ###| |### | | ###| |### | | ###| |###@
|_| ###|_|### |_| ###|_|### |_| ###|_|### |_| ###|_|###@
$$$$$$$$$######### ######### ######### #########@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
######### ######### ######### #########@
[\`'\`'] ##\\\`.'/## ':v:\` ##/\\:/\\## |:+:| ##':v:\`## \\\`.'/ ##[\`'\`']#@
|::| ##(o:o)## (o:0) #/(o:o)\\# (o:o) ##(o:0)## (o:o) ###|::|##@
|::| ###\\:/:\\# (:) ###(:)### (:) ###(:)### \\:/:\\ ###|::|##@
$$$$$$$$$####"#### ######### ######### " #########@@
#########@
##'\\v/\`##@
##(o 0)##@
###(_)###@
#########@@
#########@
##\\\`~'/##@
##(o o)##@
###\\ / \\#@
####"####@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
#########@
##|\`+'|##@
##(o o)##@
###(_)###@
#########@@
#########@
##|:+:|##@
##(o:o)##@
###(:)###@
#########@@
@
@
@
@
@@
#########@
##':v:\`##@
##(o:0)##@
###(:)###@
#########@@
#########@
###(:)###@
###|:|###@
###|:|###@
#########@@
#########@
###(_)###@
###| |###@
###|_|###@
#########@@
#########@
##/\\*/\\##@
#/(o o)\\#@
###(_)###@
#########@@
#########@
##[\`'\`']#@
###| |##@
###|__|##@
#########@@
@
@
@
@
@@
#########@
##[\`'\`']#@
###|::|##@
###|::|##@
#########@@
@
@
@
@
@@
#########@
##\\\`.'/##@
##(o:o)##@
###\\:/:\\#@
####"####@@
#########@
##/\\:/\\##@
#/(o:o)\\#@
###(:)###@
#########@@
@
@
@
@
@@
######### ######### ######### #########@
######### ######### ######### #########@
######### ######### ######### #########@
######### ######### ######### #########@
$$$$$$$$$######### ######### ######### #########@@
######### _ ######### _ ######### _ ######### _ @
###(:)### (:) ###(:)### (:) ###(:)### (:) ###(:)### (:) @
###|:|### |:| ###|:|### |:| ###|:|### |:| ###|:|### |:| @
###|:|### |:| ###|:|### |:| ###|:|### |:| ###|:|### |:| @
######### ######### ######### #########$$$$$$$$$@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
@
@
@
@
@@
`
@@ -0,0 +1,120 @@
/**
* These are types for things that are present in the React `canary` release channel.
*
* To load the types declared here in an actual project, there are three ways. The easiest one,
* if your `tsconfig.json` already has a `"types"` array in the `"compilerOptions"` section,
* is to add `"react/canary"` to the `"types"` array.
*
* Alternatively, a specific import syntax can to be used from a typescript file.
* This module does not exist in reality, which is why the {} is important:
*
* ```ts
* import {} from 'react/canary'
* ```
*
* It is also possible to include it through a triple-slash reference:
*
* ```ts
* /// <reference types="react/canary" />
* ```
*
* Either the import or the reference only needs to appear once, anywhere in the project.
*/
// See https://github.com/facebook/react/blob/main/packages/react/src/React.js to see how the exports are declared,
import React = require(".");
export {};
declare const UNDEFINED_VOID_ONLY: unique symbol;
type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
declare module "." {
export function unstable_useCacheRefresh(): () => void;
// @enableViewTransition
export interface ViewTransitionInstance {
/**
* The {@link ViewTransitionProps name} that was used in the corresponding {@link ViewTransition} component or `"auto"` if the `name` prop was omitted.
*/
name: string;
}
export type ViewTransitionClassPerType = Record<"default" | (string & {}), "none" | "auto" | (string & {})>;
export type ViewTransitionClass = ViewTransitionClassPerType | ViewTransitionClassPerType[string];
export interface ViewTransitionProps {
children?: ReactNode | undefined;
/**
* Assigns the {@link https://developer.chrome.com/blog/view-transitions-update-io24#view-transition-class `view-transition-class`} class to the underlying DOM node.
*/
default?: ViewTransitionClass | undefined;
/**
* Combined with {@link className} if this `<ViewTransition>` or its parent Component is mounted and there's no other with the same name being deleted.
* `"none"` is a special value that deactivates the view transition name under that condition.
*/
enter?: ViewTransitionClass | undefined;
/**
* Combined with {@link className} if this `<ViewTransition>` or its parent Component is unmounted and there's no other with the same name being deleted.
* `"none"` is a special value that deactivates the view transition name under that condition.
*/
exit?: ViewTransitionClass | undefined;
/**
* "auto" will automatically assign a view-transition-name to the inner DOM node.
* That way you can add a View Transition to a Component without controlling its DOM nodes styling otherwise.
*
* A difference between this and the browser's built-in view-transition-name: auto is that switching the DOM nodes within the `<ViewTransition>` component preserves the same name so this example cross-fades between the DOM nodes instead of causing an exit and enter.
* @default "auto"
*/
name?: "auto" | (string & {}) | undefined;
/**
* The `<ViewTransition>` or its parent Component is mounted and there's no other `<ViewTransition>` with the same name being deleted.
*/
onEnter?: (instance: ViewTransitionInstance, types: Array<string>) => void;
/**
* The `<ViewTransition>` or its parent Component is unmounted and there's no other `<ViewTransition>` with the same name being deleted.
*/
onExit?: (instance: ViewTransitionInstance, types: Array<string>) => void;
/**
* This `<ViewTransition>` is being mounted and another `<ViewTransition>` instance with the same name is being unmounted elsewhere.
*/
onShare?: (instance: ViewTransitionInstance, types: Array<string>) => void;
/**
* The content of `<ViewTransition>` has changed either due to DOM mutations or because an inner child `<ViewTransition>` has resized.
*/
onUpdate?: (instance: ViewTransitionInstance, types: Array<string>) => void;
ref?: Ref<ViewTransitionInstance> | undefined;
/**
* Combined with {@link className} if this `<ViewTransition>` is being mounted and another instance with the same name is being unmounted elsewhere.
* `"none"` is a special value that deactivates the view transition name under that condition.
*/
share?: ViewTransitionClass | undefined;
/**
* Combined with {@link className} if the content of this `<ViewTransition>` has changed either due to DOM mutations or because an inner child has resized.
* `"none"` is a special value that deactivates the view transition name under that condition.
*/
update?: ViewTransitionClass | undefined;
}
/**
* Opt-in for using {@link https://developer.mozilla.org/en-US/docs/Web/API/View_Transition_API View Transitions} in React.
* View Transitions only trigger for async updates like {@link startTransition}, {@link useDeferredValue}, Actions or <{@link Suspense}> revealing from fallback to content.
* Synchronous updates provide an opt-out but also guarantee that they commit immediately which View Transitions can't.
*
* @see {@link https://react.dev/reference/react/ViewTransition `<ViewTransition>` reference documentation}
*/
export const ViewTransition: ExoticComponent<ViewTransitionProps>;
/**
* @see {@link https://react.dev/reference/react/addTransitionType `addTransitionType` reference documentation}
*/
export function addTransitionType(type: string): void;
// @enableFragmentRefs
export interface FragmentInstance {}
export interface FragmentProps {
ref?: Ref<FragmentInstance> | undefined;
}
}
@@ -0,0 +1,417 @@
import * as tailwind_variants from 'tailwind-variants';
import { VariantProps } from 'tailwind-variants';
import * as tailwind_variants_dist_config from 'tailwind-variants/dist/config';
/**
* Dropdown wrapper **Tailwind Variants** component
*
* const { base, menu } = dropdown({...})
*
* @example
* <div>
* <button className={trigger()} aria-expanded="true/false">your trigger</button>
* <div className={base()}>
* // dropdown content
* <span className={arrow()} data-placement="top/bottom/left/right..." /> // arrow
* </div>
* </div>
*/
declare const dropdown: tailwind_variants.TVReturnType<{} | {} | {}, undefined, string[], tailwind_variants_dist_config.TVConfig<unknown, {} | {}>, {} | {}, undefined, tailwind_variants.TVReturnType<unknown, undefined, string[], tailwind_variants_dist_config.TVConfig<unknown, {} | {}>, unknown, unknown, undefined>>;
/**
* DropdownItem wrapper **Tailwind Variants** component
*
* const {base, heading, indicator, trigger, leftIndicator, title, subtitle, content } = dropdownItem({...})
*
* @example
* <div className={base())} data-focus-visible={boolean} data-hover={boolean}>
* <div className={heading())}>
* <button className={trigger())}>
* <div className={leftIndicator()}>
* // content
* </div>
* <div className={titleWrapper()}>
* <h3 className={title())}>Title</h3>
* <span className={subtitle())}>Subtitle</span>
* </div>
* <span className={indicator())}>Indicator</span>
* </button>
* </div>
* <div className={content())}>Content</div>
* </div>
*/
declare const dropdownItem: tailwind_variants.TVReturnType<{
variant: {
solid: {
base: string;
};
bordered: {
base: string;
};
light: {
base: string;
};
faded: {
base: string;
};
flat: {
base: string;
};
shadow: {
base: string;
};
};
color: {
default: {};
primary: {};
secondary: {};
success: {};
warning: {};
danger: {};
};
isDisabled: {
true: {
base: string;
};
};
disableAnimation: {
true: {};
false: {};
};
}, {
base: string[];
wrapper: string;
title: string;
description: string[];
selectedIcon: string[];
shortcut: string[];
}, undefined, tailwind_variants_dist_config.TVConfig<{
variant: {
solid: {
base: string;
};
bordered: {
base: string;
};
light: {
base: string;
};
faded: {
base: string;
};
flat: {
base: string;
};
shadow: {
base: string;
};
};
color: {
default: {};
primary: {};
secondary: {};
success: {};
warning: {};
danger: {};
};
isDisabled: {
true: {
base: string;
};
};
disableAnimation: {
true: {};
false: {};
};
}, {
variant: {
solid: {
base: string;
};
bordered: {
base: string;
};
light: {
base: string;
};
faded: {
base: string;
};
flat: {
base: string;
};
shadow: {
base: string;
};
};
color: {
default: {};
primary: {};
secondary: {};
success: {};
warning: {};
danger: {};
};
isDisabled: {
true: {
base: string;
};
};
disableAnimation: {
true: {};
false: {};
};
}>, {
variant: {
solid: {
base: string;
};
bordered: {
base: string;
};
light: {
base: string;
};
faded: {
base: string;
};
flat: {
base: string;
};
shadow: {
base: string;
};
};
color: {
default: {};
primary: {};
secondary: {};
success: {};
warning: {};
danger: {};
};
isDisabled: {
true: {
base: string;
};
};
disableAnimation: {
true: {};
false: {};
};
}, {
base: string[];
wrapper: string;
title: string;
description: string[];
selectedIcon: string[];
shortcut: string[];
}, tailwind_variants.TVReturnType<{
variant: {
solid: {
base: string;
};
bordered: {
base: string;
};
light: {
base: string;
};
faded: {
base: string;
};
flat: {
base: string;
};
shadow: {
base: string;
};
};
color: {
default: {};
primary: {};
secondary: {};
success: {};
warning: {};
danger: {};
};
isDisabled: {
true: {
base: string;
};
};
disableAnimation: {
true: {};
false: {};
};
}, {
base: string[];
wrapper: string;
title: string;
description: string[];
selectedIcon: string[];
shortcut: string[];
}, undefined, tailwind_variants_dist_config.TVConfig<{
variant: {
solid: {
base: string;
};
bordered: {
base: string;
};
light: {
base: string;
};
faded: {
base: string;
};
flat: {
base: string;
};
shadow: {
base: string;
};
};
color: {
default: {};
primary: {};
secondary: {};
success: {};
warning: {};
danger: {};
};
isDisabled: {
true: {
base: string;
};
};
disableAnimation: {
true: {};
false: {};
};
}, {
variant: {
solid: {
base: string;
};
bordered: {
base: string;
};
light: {
base: string;
};
faded: {
base: string;
};
flat: {
base: string;
};
shadow: {
base: string;
};
};
color: {
default: {};
primary: {};
secondary: {};
success: {};
warning: {};
danger: {};
};
isDisabled: {
true: {
base: string;
};
};
disableAnimation: {
true: {};
false: {};
};
}>, unknown, unknown, undefined>>;
/**
* Dropdown wrapper **Tailwind Variants** component
*
* const { base, section, heading } = dropdownSection({...})
*
* @example
* <div className={base()}>
* <button className={trigger()} aria-expanded="true/false">your trigger</button>
* <div className={section()}>
* // dropdown content
* <span className={arrow()} data-placement="top/bottom/left/right..." /> // arrow
* </div>
* </div>
*/
declare const dropdownSection: tailwind_variants.TVReturnType<{
[key: string]: {
[key: string]: tailwind_variants.ClassValue | {
divider?: tailwind_variants.ClassValue;
base?: tailwind_variants.ClassValue;
group?: tailwind_variants.ClassValue;
heading?: tailwind_variants.ClassValue;
};
};
} | {
[x: string]: {
[x: string]: tailwind_variants.ClassValue | {
divider?: tailwind_variants.ClassValue;
base?: tailwind_variants.ClassValue;
group?: tailwind_variants.ClassValue;
heading?: tailwind_variants.ClassValue;
};
};
} | {}, {
base: string;
heading: string;
group: string;
divider: string;
}, undefined, tailwind_variants_dist_config.TVConfig<unknown, {
[key: string]: {
[key: string]: tailwind_variants.ClassValue | {
divider?: tailwind_variants.ClassValue;
base?: tailwind_variants.ClassValue;
group?: tailwind_variants.ClassValue;
heading?: tailwind_variants.ClassValue;
};
};
} | {}>, {
[key: string]: {
[key: string]: tailwind_variants.ClassValue | {
divider?: tailwind_variants.ClassValue;
base?: tailwind_variants.ClassValue;
group?: tailwind_variants.ClassValue;
heading?: tailwind_variants.ClassValue;
};
};
} | {}, {
base: string;
heading: string;
group: string;
divider: string;
}, tailwind_variants.TVReturnType<unknown, {
base: string;
heading: string;
group: string;
divider: string;
}, undefined, tailwind_variants_dist_config.TVConfig<unknown, {
[key: string]: {
[key: string]: tailwind_variants.ClassValue | {
divider?: tailwind_variants.ClassValue;
base?: tailwind_variants.ClassValue;
group?: tailwind_variants.ClassValue;
heading?: tailwind_variants.ClassValue;
};
};
} | {}>, unknown, unknown, undefined>>;
/**
* Dropdown Menu wrapper **Tailwind Variants** component
*
* const classNames = dropdownMenu({...})
*/
declare const dropdownMenu: tailwind_variants.TVReturnType<{} | {} | {}, undefined, "w-full flex flex-col gap-0.5 p-1", tailwind_variants_dist_config.TVConfig<unknown, {} | {}>, {} | {}, undefined, tailwind_variants.TVReturnType<unknown, undefined, "w-full flex flex-col gap-0.5 p-1", tailwind_variants_dist_config.TVConfig<unknown, {} | {}>, unknown, unknown, undefined>>;
type DropdownSectionVariantProps = VariantProps<typeof dropdownSection>;
type DropdownSectionSlots = keyof ReturnType<typeof dropdownSection>;
type DropdownItemVariantProps = VariantProps<typeof dropdownItem>;
type DropdownItemSlots = keyof ReturnType<typeof dropdownItem>;
export { DropdownItemSlots, DropdownItemVariantProps, DropdownSectionSlots, DropdownSectionVariantProps, dropdown, dropdownItem, dropdownMenu, dropdownSection };
@@ -0,0 +1,16 @@
/**
* @license React
* react-compiler-runtime.production.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";
var ReactSharedInternals =
require("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
exports.c = function (size) {
return ReactSharedInternals.H.useMemoCache(size);
};
@@ -0,0 +1,97 @@
import { chai } from '@vitest/expect';
import { l as loadDiffConfig, b as loadSnapshotSerializers, t as takeCoverageInsideWorker } from './setup-common.Dw1XgX0v.js';
import { r as rpc } from './rpc.BytlcPfC.js';
import { g as getWorkerState } from './utils.DvEY5TfP.js';
import { V as VitestTestRunner, N as NodeBenchmarkRunner } from './test.w5HLbjmU.js';
function setupChaiConfig(config) {
Object.assign(chai.config, config);
}
async function resolveSnapshotEnvironment(config, executor) {
if (!config.snapshotEnvironment) {
const { VitestNodeSnapshotEnvironment } = await import('./node.Ce0vMQM7.js');
return new VitestNodeSnapshotEnvironment();
}
const mod = await executor.import(config.snapshotEnvironment);
if (typeof mod.default !== "object" || !mod.default) throw new Error("Snapshot environment module must have a default export object with a shape of `SnapshotEnvironment`");
return mod.default;
}
async function getTestRunnerConstructor(config, moduleRunner) {
if (!config.runner) return config.mode === "test" ? VitestTestRunner : NodeBenchmarkRunner;
const mod = await moduleRunner.import(config.runner);
if (!mod.default && typeof mod.default !== "function") throw new Error(`Runner must export a default function, but got ${typeof mod.default} imported from ${config.runner}`);
return mod.default;
}
async function resolveTestRunner(config, moduleRunner) {
const testRunner = new (await (getTestRunnerConstructor(config, moduleRunner)))(config);
// inject private executor to every runner
Object.defineProperty(testRunner, "moduleRunner", {
value: moduleRunner,
enumerable: false,
configurable: false
});
if (!testRunner.config) testRunner.config = config;
if (!testRunner.importFile) throw new Error("Runner must implement \"importFile\" method.");
const [diffOptions] = await Promise.all([loadDiffConfig(config, moduleRunner), loadSnapshotSerializers(config, moduleRunner)]);
testRunner.config.diffOptions = diffOptions;
// patch some methods, so custom runners don't need to call RPC
const originalOnTaskUpdate = testRunner.onTaskUpdate;
testRunner.onTaskUpdate = async (task, events) => {
const p = rpc().onTaskUpdate(task, events);
await originalOnTaskUpdate?.call(testRunner, task, events);
return p;
};
// patch some methods, so custom runners don't need to call RPC
const originalOnTestAnnotate = testRunner.onTestAnnotate;
testRunner.onTestAnnotate = async (test, annotation) => {
const p = rpc().onTaskAnnotate(test.id, annotation);
const overriddenResult = await originalOnTestAnnotate?.call(testRunner, test, annotation);
const vitestResult = await p;
return overriddenResult || vitestResult;
};
const originalOnCollectStart = testRunner.onCollectStart;
testRunner.onCollectStart = async (file) => {
await rpc().onQueued(file);
await originalOnCollectStart?.call(testRunner, file);
};
const originalOnCollected = testRunner.onCollected;
testRunner.onCollected = async (files) => {
const state = getWorkerState();
files.forEach((file) => {
file.prepareDuration = state.durations.prepare;
file.environmentLoad = state.durations.environment;
// should be collected only for a single test file in a batch
state.durations.prepare = 0;
state.durations.environment = 0;
});
rpc().onCollected(files);
await originalOnCollected?.call(testRunner, files);
};
const originalOnAfterRun = testRunner.onAfterRunFiles;
testRunner.onAfterRunFiles = async (files) => {
const state = getWorkerState();
const coverage = await takeCoverageInsideWorker(config.coverage, moduleRunner);
if (coverage) rpc().onAfterSuiteRun({
coverage,
testFiles: files.map((file) => file.name).sort(),
environment: state.environment.viteEnvironment || state.environment.name,
projectName: state.ctx.projectName
});
await originalOnAfterRun?.call(testRunner, files);
};
const originalOnAfterRunTask = testRunner.onAfterRunTask;
testRunner.onAfterRunTask = async (test) => {
if (config.bail && test.result?.state === "fail") {
if (1 + await rpc().getCountOfFailedTests() >= config.bail) {
rpc().onCancel("test-failure");
testRunner.cancel?.("test-failure");
}
}
await originalOnAfterRunTask?.call(testRunner, test);
};
return testRunner;
}
export { resolveSnapshotEnvironment as a, resolveTestRunner as r, setupChaiConfig as s };
@@ -0,0 +1,12 @@
import { type COSEALG, type COSEPublicKeyRSA } from '../../cose.js';
import type { Uint8Array_ } from '../../../types/index.js';
/**
* Verify a signature using an RSA public key
*/
export declare function verifyRSA(opts: {
cosePublicKey: COSEPublicKeyRSA;
signature: Uint8Array_;
data: Uint8Array_;
shaHashOverride?: COSEALG;
}): Promise<boolean>;
//# sourceMappingURL=verifyRSA.d.ts.map
@@ -0,0 +1,23 @@
'use strict';
var $isFinite = require('math-intrinsics/isFinite');
var timeConstants = require('../helpers/timeConstants');
var msPerSecond = timeConstants.msPerSecond;
var msPerMinute = timeConstants.msPerMinute;
var msPerHour = timeConstants.msPerHour;
var ToIntegerOrInfinity = require('./ToIntegerOrInfinity');
// https://262.ecma-international.org/12.0/#sec-maketime
module.exports = function MakeTime(hour, min, sec, ms) {
if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) {
return NaN;
}
var h = ToIntegerOrInfinity(hour);
var m = ToIntegerOrInfinity(min);
var s = ToIntegerOrInfinity(sec);
var milli = ToIntegerOrInfinity(ms);
var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli;
return t;
};
@@ -0,0 +1,7 @@
"use client";
import {
ripple_default
} from "./chunk-QHRCZSEO.mjs";
export {
ripple_default as default
};
@@ -0,0 +1,197 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'no-explicit-any',
meta: {
type: 'suggestion',
docs: {
description: 'Disallow the `any` type',
recommended: 'recommended',
},
fixable: 'code',
hasSuggestions: true,
messages: {
suggestNever: "Use `never` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.",
suggestPropertyKey: 'Use `PropertyKey` instead, this is more explicit than `keyof any`.',
suggestUnknown: 'Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct.',
unexpectedAny: 'Unexpected any. Specify a different type.',
},
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
fixToUnknown: {
type: 'boolean',
description: 'Whether to enable auto-fixing in which the `any` type is converted to the `unknown` type.',
},
ignoreRestArgs: {
type: 'boolean',
description: 'Whether to ignore rest parameter arrays.',
},
},
},
],
},
defaultOptions: [
{
fixToUnknown: false,
ignoreRestArgs: false,
},
],
create(context, [{ fixToUnknown, ignoreRestArgs }]) {
/**
* Checks if the node is an arrow function, function/constructor declaration or function expression
* @param node the node to be validated.
* @returns true if the node is any kind of function declaration or expression
* @private
*/
function isNodeValidFunction(node) {
return [
utils_1.AST_NODE_TYPES.ArrowFunctionExpression, // const x = (...args: any[]) => {};
utils_1.AST_NODE_TYPES.FunctionDeclaration, // function f(...args: any[]) {}
utils_1.AST_NODE_TYPES.FunctionExpression, // const x = function(...args: any[]) {};
utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration, // type T = {(...args: any[]): unknown};
utils_1.AST_NODE_TYPES.TSConstructorType, // type T = new (...args: any[]) => unknown
utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration, // type T = {new (...args: any[]): unknown};
utils_1.AST_NODE_TYPES.TSDeclareFunction, // declare function _8(...args: any[]): unknown;
utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression, // declare class A { f(...args: any[]): unknown; }
utils_1.AST_NODE_TYPES.TSFunctionType, // type T = (...args: any[]) => unknown;
utils_1.AST_NODE_TYPES.TSMethodSignature, // type T = {f(...args: any[]): unknown};
].includes(node.type);
}
/**
* Checks if the node is a rest element child node of a function
* @param node the node to be validated.
* @returns true if the node is a rest element child node of a function
* @private
*/
function isNodeRestElementInFunction(node) {
return (node.type === utils_1.AST_NODE_TYPES.RestElement &&
isNodeValidFunction(node.parent));
}
/**
* Checks if the node is a TSTypeOperator node with a readonly operator
* @param node the node to be validated.
* @returns true if the node is a TSTypeOperator node with a readonly operator
* @private
*/
function isNodeReadonlyTSTypeOperator(node) {
return (node.type === utils_1.AST_NODE_TYPES.TSTypeOperator &&
node.operator === 'readonly');
}
/**
* Checks if the node is a TSTypeReference node with an Array identifier
* @param node the node to be validated.
* @returns true if the node is a TSTypeReference node with an Array identifier
* @private
*/
function isNodeValidArrayTSTypeReference(node) {
return (node.type === utils_1.AST_NODE_TYPES.TSTypeReference &&
node.typeName.type === utils_1.AST_NODE_TYPES.Identifier &&
['Array', 'ReadonlyArray'].includes(node.typeName.name));
}
/**
* Checks if the node is a valid TSTypeOperator or TSTypeReference node
* @param node the node to be validated.
* @returns true if the node is a valid TSTypeOperator or TSTypeReference node
* @private
*/
function isNodeValidTSType(node) {
return (isNodeReadonlyTSTypeOperator(node) ||
isNodeValidArrayTSTypeReference(node));
}
/**
* Checks if the great grand-parent node is a RestElement node in a function
* @param node the node to be validated.
* @returns true if the great grand-parent node is a RestElement node in a function
* @private
*/
function isGreatGrandparentRestElement(node) {
return (node.parent?.parent?.parent != null &&
isNodeRestElementInFunction(node.parent.parent.parent));
}
/**
* Checks if the great great grand-parent node is a valid RestElement node in a function
* @param node the node to be validated.
* @returns true if the great great grand-parent node is a valid RestElement node in a function
* @private
*/
function isGreatGreatGrandparentRestElement(node) {
return (node.parent?.parent?.parent?.parent != null &&
isNodeValidTSType(node.parent.parent) &&
isNodeRestElementInFunction(node.parent.parent.parent.parent));
}
/**
* Checks if the great grand-parent or the great great grand-parent node is a RestElement node
* @param node the node to be validated.
* @returns true if the great grand-parent or the great great grand-parent node is a RestElement node
* @private
*/
function isNodeDescendantOfRestElementInFunction(node) {
return (isGreatGrandparentRestElement(node) ||
isGreatGreatGrandparentRestElement(node));
}
/**
* Checks if the node is within a keyof any expression
* @param node the node to be validated.
* @returns true if the node is within a keyof any expression, false otherwise
* @private
*/
function isNodeWithinKeyofAny(node) {
return (node.parent.type === utils_1.AST_NODE_TYPES.TSTypeOperator &&
node.parent.operator === 'keyof');
}
/**
* Creates a fixer that replaces a keyof any with PropertyKey
* @param node the node to be fixed.
* @returns a function that will fix the node.
* @private
*/
function createPropertyKeyFixer(node) {
return (fixer) => {
return fixer.replaceText(node.parent, 'PropertyKey');
};
}
return {
TSAnyKeyword(node) {
const isKeyofAny = isNodeWithinKeyofAny(node);
if (ignoreRestArgs && isNodeDescendantOfRestElementInFunction(node)) {
return;
}
const fixOrSuggest = {
fix: null,
suggest: isKeyofAny
? [
{
messageId: 'suggestPropertyKey',
fix: createPropertyKeyFixer(node),
},
]
: [
{
messageId: 'suggestUnknown',
fix: fixer => fixer.replaceText(node, 'unknown'),
},
{
messageId: 'suggestNever',
fix: fixer => fixer.replaceText(node, 'never'),
},
],
};
if (fixToUnknown) {
fixOrSuggest.fix = isKeyofAny
? createPropertyKeyFixer(node)
: fixer => fixer.replaceText(node, 'unknown');
}
context.report({
node,
messageId: 'unexpectedAny',
...fixOrSuggest,
});
},
};
},
});
@@ -0,0 +1 @@
{"mappings":"AAAA;;;;;;;;;;CAUC,GAED,IAAI,uCAAiB,IAAI;AAOlB,MAAM;IAUX,qGAAqG,GACrG,OAAO,KAAW,EAAU;QAC1B,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;IAC/B;IAEA,4FAA4F,GAC5F,cAAc,KAAW,EAA6B;QACpD,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC;IACtC;IAEA,sCAAsC,GACtC,YAAY,KAAW,EAAE,GAAS,EAAU;QAC1C,aAAa;QACb,IAAI,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,KAAK,YACxC,aAAa;QACb,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,OAAO;QAG3C,IAAI,MAAM,OACR,MAAM,IAAI,WAAW;QAGvB,wCAAwC;QACxC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,UAAG,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM;IAC1E;IAEA,+CAA+C,GAC/C,mBAAmB,KAAW,EAAE,GAAS,EAAyB;QAChE,aAAa;QACb,IAAI,OAAO,IAAI,CAAC,SAAS,CAAC,kBAAkB,KAAK,YAC/C,aAAa;QACb,OAAO,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,OAAO;QAGlD,IAAI,MAAM,OACR,MAAM,IAAI,WAAW;QAGvB,IAAI,aAAa,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC;QAC9C,IAAI,WAAW,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC;QAC5C,OAAO;eACF,WAAW,GAAG,CAAC,CAAA,IAAM,CAAA;oBAAC,GAAG,CAAC;oBAAE,QAAQ;gBAAY,CAAA;YACnD;gBAAC,MAAM;gBAAW,OAAO;gBAAO,QAAQ;YAAQ;eAC7C,SAAS,GAAG,CAAC,CAAA,IAAM,CAAA;oBAAC,GAAG,CAAC;oBAAE,QAAQ;gBAAU,CAAA;SAChD;IACH;IAEA,2FAA2F,GAC3F,kBAAsD;QACpD,IAAI,kBAAkB,IAAI,CAAC,SAAS,CAAC,eAAe;QACpD,IAAI,mDAA6B;YAC/B,IAAI,CAAC,IAAI,CAAC,iBAAiB,EACzB,IAAI,CAAC,iBAAiB,GAAG,2CAAqB,gBAAgB,MAAM,EAAE,IAAI,CAAC,OAAO;YAEpF,gBAAgB,SAAS,GAAG,IAAI,CAAC,iBAAiB;YAClD,gBAAgB,MAAM,GAAG,IAAI,CAAC,iBAAiB,KAAK,SAAS,IAAI,CAAC,iBAAiB,KAAK;QAC1F;QAEA,uEAAuE;QACvE,iDAAiD;QACjD,IAAI,gBAAgB,QAAQ,KAAK,uBAC/B,gBAAgB,QAAQ,GAAG;QAG7B,OAAO;IACT;IAtEA,YAAY,MAAc,EAAE,UAAsC,CAAC,CAAC,CAAE;QACpE,IAAI,CAAC,SAAS,GAAG,6CAAuB,QAAQ;QAChD,IAAI,CAAC,OAAO,GAAG;IACjB;AAoEF;AAEA,iGAAiG;AACjG,uHAAuH;AACvH,iIAAiI;AACjI,uCAAuC;AACvC,yHAAyH;AACzH,yHAAyH;AACzH,oEAAoE;AACpE,iDAAiD;AACjD,qDAAqD;AAErD,yIAAyI;AACzI,MAAM,0CAAoB;IACxB,MAAM;QACJ,yEAAyE;QACzE,IAAI;IACN;IACA,OAAO;IAEP;AACF;AAEA,SAAS,6CAAuB,MAAc,EAAE,UAAsC,CAAC,CAAC;IACtF,0FAA0F;IAC1F,uGAAuG;IACvG,IAAI,OAAO,QAAQ,MAAM,KAAK,aAAa,gDAA0B;QACnE,UAAU;YAAC,GAAG,OAAO;QAAA;QACrB,IAAI,OAAO,uCAAiB,CAAC,OAAO,QAAQ,MAAM,EAAE,CAAC,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1E,IAAI,mBAAmB,QAAQ,MAAM,GAAG,QAAQ;QAChD,QAAQ,SAAS,GAAG,iBAAA,kBAAA,OAAQ;QAC5B,OAAO,QAAQ,MAAM;IACvB;IAEA,IAAI,WAAW,SAAU,CAAA,UAAU,OAAO,OAAO,CAAC,SAAS,IAAI,CAAC,CAAC,GAAG,IAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,KAAK,GAAG,IAAI,KAAK,EAAC;IAC1G,IAAI,qCAAe,GAAG,CAAC,WACrB,OAAO,qCAAe,GAAG,CAAC;IAG5B,IAAI,kBAAkB,IAAI,KAAK,cAAc,CAAC,QAAQ;IACtD,qCAAe,GAAG,CAAC,UAAU;IAC7B,OAAO;AACT;AAEA,IAAI,gDAA0C;AAC9C,SAAS;IACP,IAAI,iDAA2B,MAC7B,gDAA0B,IAAI,KAAK,cAAc,CAAC,SAAS;QACzD,MAAM;QACN,QAAQ;IACV,GAAG,MAAM,CAAC,IAAI,KAAK,MAAM,GAAG,GAAG,QAAQ;IAGzC,OAAO;AACT;AAEA,IAAI,mDAA6C;AACjD,SAAS;IACP,IAAI,oDAA8B,MAChC,mDAA6B,IAAI,KAAK,cAAc,CAAC,MAAM;QACzD,MAAM;QACN,QAAQ;IACV,GAAG,eAAe,GAAG,SAAS,KAAK;IAGrC,OAAO;AACT;AAEA,SAAS,2CAAqB,MAAc,EAAE,OAAmC;IAC/E,IAAI,CAAC,QAAQ,SAAS,IAAI,CAAC,QAAQ,IAAI,EACrC,OAAO;IAGT,gFAAgF;IAChF,6FAA6F;IAC7F,SAAS,OAAO,OAAO,CAAC,0BAA0B;IAClD,UAAU,AAAC,CAAA,OAAO,QAAQ,CAAC,SAAS,KAAK,IAAG,IAAK;IACjD,IAAI,YAAY,6CAAuB,QAAQ;QAC7C,GAAG,OAAO;QACV,UAAU,UAAU,qBAAqB;IAC3C;IAEA,IAAI,MAAM,SAAS,UAAU,aAAa,CAAC,IAAI,KAAK,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,CAAA,IAAK,EAAE,IAAI,KAAK,QAAS,KAAK,EAAE;IACzG,IAAI,MAAM,SAAS,UAAU,aAAa,CAAC,IAAI,KAAK,MAAM,GAAG,GAAG,KAAK,IAAI,CAAC,CAAA,IAAK,EAAE,IAAI,KAAK,QAAS,KAAK,EAAE;IAE1G,IAAI,QAAQ,KAAK,QAAQ,IACvB,OAAO;IAGT,IAAI,QAAQ,MAAM,QAAQ,IACxB,OAAO;IAGT,IAAI,QAAQ,KAAK,QAAQ,IACvB,OAAO;IAGT,IAAI,QAAQ,MAAM,QAAQ,IACxB,OAAO;IAGT,MAAM,IAAI,MAAM;AAClB","sources":["packages/@internationalized/date/src/DateFormatter.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nlet formatterCache = new Map<string, Intl.DateTimeFormat>();\n\ninterface DateRangeFormatPart extends Intl.DateTimeFormatPart {\n source: 'startRange' | 'endRange' | 'shared'\n}\n\n/** A wrapper around Intl.DateTimeFormat that fixes various browser bugs, and polyfills new features. */\nexport class DateFormatter implements Intl.DateTimeFormat {\n private formatter: Intl.DateTimeFormat;\n private options: Intl.DateTimeFormatOptions;\n private resolvedHourCycle: Intl.DateTimeFormatOptions['hourCycle'];\n\n constructor(locale: string, options: Intl.DateTimeFormatOptions = {}) {\n this.formatter = getCachedDateFormatter(locale, options);\n this.options = options;\n }\n\n /** Formats a date as a string according to the locale and format options passed to the constructor. */\n format(value: Date): string {\n return this.formatter.format(value);\n }\n\n /** Formats a date to an arrLine truncated
@@ -0,0 +1 @@
{"name":"remark-gfm","version":"4.0.1","requiresBuild":false,"files":{"license":{"checkedAt":1794532115630,"integrity":"sha512-ic4iF2Ap25Sn5T9MMw7nJ9C20WL6V01rybBBQi2Qx8cQC9/ERFEqGnove1HT65tK2TIKM30PZoOV3Qbz2FE//A==","mode":420,"size":1094},"index.js":{"checkedAt":1794532115630,"integrity":"sha512-P14774BR12ipgegLP8aoL66VNdFiT1ettPurK1LLqHvtxmI0RIfrTDJ+NZXruBcGGAZCbhXtPWFcCw0Hb5tCnQ==","mode":420,"size":81},"lib/index.js":{"checkedAt":1794532115630,"integrity":"sha512-FiYVVI8iKvnqZVCgnn4qY5MnCxnC9wOHl0EI3hx65SOjH57wY3A5PCY5NG55U9MiCIeTBz3xv8qBkobR6nYJrA==","mode":420,"size":1277},"package.json":{"checkedAt":1794532115630,"integrity":"sha512-ciJgbUiWqqf87r054kUAUNMkpvhWISM78bpQBexf3sUs/Yl2+s3YaT8ptA0UAw7KH+i17cUiBIEr8nnPAmC2VQ==","mode":420,"size":2984},"lib/index.d.ts.map":{"checkedAt":1794532115631,"integrity":"sha512-dSEGL5/VggYtbFyZkkZoK5NxRtVq7QYS/mTUJrgXG9S0/NISg1cDKSH1rKZPgfPpjpv+fQz/42D0E60nR9qNiQ==","mode":420,"size":180},"readme.md":{"checkedAt":1794532115631,"integrity":"sha512-n8t3awIxRa71lVn7bSvnMaMTHSwB8aD+HUVbz4v1uje4Sw1UDlLS2eG+X1v0zVMdevM8a6GvQnS0aQB/da8Wag==","mode":420,"size":15546},"index.d.ts":{"checkedAt":1794532115631,"integrity":"sha512-ZsoD1FYVpaEV7t0WNmCWK1K0EdKAHr0Qk24BkzbFpB4lCi3Y5wrrNC2kprLki9ZKE5iv45UgL1ZZ2h//zURkjg==","mode":420,"size":452},"lib/index.d.ts":{"checkedAt":1794532115631,"integrity":"sha512-BHzc73ig5lRLzjKbkePXxyvcMSnJXrrHot8v1UMEvDear6i2AHMs1qg9taBWuwMoxR4G89uw2Wa2rBf9kaisnQ==","mode":420,"size":379}}}
@@ -0,0 +1,71 @@
import basePropertyOf from './_basePropertyOf.js';
/** Used to map Latin Unicode letters to basic Latin letters. */
var deburredLetters = {
// Latin-1 Supplement block.
'\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
'\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
'\xc7': 'C', '\xe7': 'c',
'\xd0': 'D', '\xf0': 'd',
'\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
'\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
'\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
'\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
'\xd1': 'N', '\xf1': 'n',
'\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
'\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
'\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
'\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
'\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
'\xc6': 'Ae', '\xe6': 'ae',
'\xde': 'Th', '\xfe': 'th',
'\xdf': 'ss',
// Latin Extended-A block.
'\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
'\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
'\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
'\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
'\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
'\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
'\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
'\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
'\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
'\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
'\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
'\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
'\u0134': 'J', '\u0135': 'j',
'\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
'\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
'\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
'\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
'\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
'\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
'\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
'\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
'\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
'\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
'\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
'\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
'\u0163': 't', '\u0165': 't', '\u0167': 't',
'\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
'\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
'\u0174': 'W', '\u0175': 'w',
'\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
'\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
'\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
'\u0132': 'IJ', '\u0133': 'ij',
'\u0152': 'Oe', '\u0153': 'oe',
'\u0149': "'n", '\u017f': 's'
};
/**
* Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
* letters to basic Latin letters.
*
* @private
* @param {string} letter The matched letter to deburr.
* @returns {string} Returns the deburred letter.
*/
var deburrLetter = basePropertyOf(deburredLetters);
export default deburrLetter;
@@ -0,0 +1,65 @@
function memo(getDeps, fn, opts) {
let deps = opts.initialDeps ?? [];
let result;
return () => {
var _a, _b, _c, _d;
let depTime;
if (opts.key && ((_a = opts.debug) == null ? void 0 : _a.call(opts))) depTime = Date.now();
const newDeps = getDeps();
const depsChanged = newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep);
if (!depsChanged) {
return result;
}
deps = newDeps;
let resultTime;
if (opts.key && ((_b = opts.debug) == null ? void 0 : _b.call(opts))) resultTime = Date.now();
result = fn(...newDeps);
if (opts.key && ((_c = opts.debug) == null ? void 0 : _c.call(opts))) {
const depEndTime = Math.round((Date.now() - depTime) * 100) / 100;
const resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100;
const resultFpsPercentage = resultEndTime / 16;
const pad = (str, num) => {
str = String(str);
while (str.length < num) {
str = " " + str;
}
return str;
};
console.info(
`%c⏱ ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`,
`
font-size: .6rem;
font-weight: bold;
color: hsl(${Math.max(
0,
Math.min(120 - 120 * resultFpsPercentage, 120)
)}deg 100% 31%);`,
opts == null ? void 0 : opts.key
);
}
(_d = opts == null ? void 0 : opts.onChange) == null ? void 0 : _d.call(opts, result);
return result;
};
}
function notUndefined(value, msg) {
if (value === void 0) {
throw new Error(`Unexpected undefined${msg ? `: ${msg}` : ""}`);
} else {
return value;
}
}
const approxEqual = (a, b) => Math.abs(a - b) < 1;
const debounce = (targetWindow, fn, ms) => {
let timeoutId;
return function(...args) {
targetWindow.clearTimeout(timeoutId);
timeoutId = targetWindow.setTimeout(() => fn.apply(this, args), ms);
};
};
export {
approxEqual,
debounce,
memo,
notUndefined
};
//# sourceMappingURL=utils.js.map
@@ -0,0 +1,216 @@
'use strict';
/**
* find paired tag for a stop node
* @param {string} xmlDoc
* @param {string} tagName
* @param {number} i : start index
*/
function readStopNode(xmlDoc, tagName, i){
const startIndex = i;
// Starting at 1 since we already have an open tag
let openTagCount = 1;
for (; i < xmlDoc.length; i++) {
if( xmlDoc[i] === "<"){
if (xmlDoc[i+1] === "/") {//close tag
const closeIndex = findSubStrIndex(xmlDoc, ">", i, `${tagName} is not closed`);
let closeTagName = xmlDoc.substring(i+2,closeIndex).trim();
if(closeTagName === tagName){
openTagCount--;
if (openTagCount === 0) {
return {
tagContent: xmlDoc.substring(startIndex, i),
i : closeIndex
}
}
}
i=closeIndex;
} else if(xmlDoc[i+1] === '?') {
const closeIndex = findSubStrIndex(xmlDoc, "?>", i+1, "StopNode is not closed.")
i=closeIndex;
} else if(xmlDoc.substr(i + 1, 3) === '!--') {
const closeIndex = findSubStrIndex(xmlDoc, "-->", i+3, "StopNode is not closed.")
i=closeIndex;
} else if(xmlDoc.substr(i + 1, 2) === '![') {
const closeIndex = findSubStrIndex(xmlDoc, "]]>", i, "StopNode is not closed.") - 2;
i=closeIndex;
} else {
const tagData = readTagExp(xmlDoc, i, '>')
if (tagData) {
const openTagName = tagData && tagData.tagName;
if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length-1] !== "/") {
openTagCount++;
}
i=tagData.closeIndex;
}
}
}
}//end for loop
}
/**
* Read closing tag name
* @param {Source} source
* @returns tag name
*/
function readClosingTagName(source){
let text = ""; //temporary data
while(source.canRead()){
let ch = source.readCh();
// if (ch === null || ch === undefined) break;
// source.updateBuffer();
if (ch === ">") return text.trimEnd();
else text += ch;
}
throw new Error(`Unexpected end of source. Reading '${substr}'`);
}
/**
* Read XML tag and build attributes map
* This function can be used to read normal tag, pi tag.
* This function can't be used to read comment, CDATA, DOCTYPE.
* Eg <tag attr = ' some"' attr= ">" bool>
* @param {string} xmlDoc
* @param {number} startIndex starting index
* @returns tag expression includes tag name & attribute string
*/
function readTagExp(parser) {
let inSingleQuotes = false;
let inDoubleQuotes = false;
let i;
let EOE = false;
for (i = 0; parser.source.canRead(i); i++) {
const char = parser.source.readChAt(i);
if (char === "'" && !inDoubleQuotes) {
inSingleQuotes = !inSingleQuotes;
} else if (char === '"' && !inSingleQuotes) {
inDoubleQuotes = !inDoubleQuotes;
} else if (char === '>' && !inSingleQuotes && !inDoubleQuotes) {
// If not inside quotes, stop reading at '>'
EOE = true;
break;
}
}
if(inSingleQuotes || inDoubleQuotes){
throw new Error("Invalid attribute expression. Quote is not properly closed");
}else if(!EOE) throw new Error("Unexpected closing of source. Waiting for '>'");
const exp = parser.source.readStr(i);
parser.source.updateBufferBoundary(i + 1);
return buildTagExpObj(exp, parser)
}
function readPiExp(parser) {
let inSingleQuotes = false;
let inDoubleQuotes = false;
let i;
let EOE = false;
for (i = 0; parser.source.canRead(i) ; i++) {
const currentChar = parser.source.readChAt(i);
const nextChar = parser.source.readChAt(i+1);
if (currentChar === "'" && !inDoubleQuotes) {
inSingleQuotes = !inSingleQuotes;
} else if (currentChar === '"' && !inSingleQuotes) {
inDoubleQuotes = !inDoubleQuotes;
}
if (!inSingleQuotes && !inDoubleQuotes) {
if (currentChar === '?' && nextChar === '>') {
EOE = true;
break; // Exit the loop when '?>' is found
}
}
}
if(inSingleQuotes || inDoubleQuotes){
throw new Error("Invalid attribute expression. Quote is not properly closed in PI tag expression");
}else if(!EOE) throw new Error("Unexpected closing of source. Waiting for '?>'");
if(!parser.options.attributes.ignore){
//TODO: use regex to verify attributes if not set to ignore
}
const exp = parser.source.readStr(i);
parser.source.updateBufferBoundary(i + 1);
return buildTagExpObj(exp, parser)
}
function buildTagExpObj(exp, parser){
const tagExp = {
tagName: "",
selfClosing: false
};
let attrsExp = "";
// Check for self-closing tag before setting the name
if(exp[exp.length -1] === "/") {
tagExp.selfClosing = true;
exp = exp.slice(0, -1); // Remove the trailing slash
}
//separate tag name
let i = 0;
for (; i < exp.length; i++) {
const char = exp[i];
if(char === " "){
tagExp.tagName = exp.substring(0, i);
attrsExp = exp.substring(i + 1);
break;
}
}
//only tag
if(tagExp.tagName.length === 0 && i === exp.length)tagExp.tagName = exp;
tagExp.tagName = tagExp.tagName.trimEnd();
if(!parser.options.attributes.ignore && attrsExp.length > 0){
parseAttributesExp(attrsExp,parser)
}
return tagExp;
}
const attrsRegx = new RegExp('([^\\s=]+)\\s*(=\\s*([\'"])([\\s\\S]*?)\\3)?', 'gm');
function parseAttributesExp(attrStr, parser) {
const matches = getAllMatches(attrStr, attrsRegx);
const len = matches.length; //don't make it inline
for (let i = 0; i < len; i++) {
let attrName = parser.processAttrName(matches[i][1]);
let attrVal = parser.replaceEntities(matches[i][4] || true);
parser.outputBuilder.addAttribute(attrName, attrVal);
}
}
const getAllMatches = function(string, regex) {
const matches = [];
let match = regex.exec(string);
while (match) {
const allmatches = [];
allmatches.startIndex = regex.lastIndex - match[0].length;
const len = match.length;
for (let index = 0; index < len; index++) {
allmatches.push(match[index]);
}
matches.push(allmatches);
match = regex.exec(string);
}
return matches;
};
module.exports = {
readStopNode: readStopNode,
readClosingTagName: readClosingTagName,
readTagExp: readTagExp,
readPiExp: readPiExp,
}
@@ -0,0 +1,41 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
const { READ, ReferenceTracker } = require("eslint-utils")
module.exports = {
meta: {
docs: {
description: "disallow the `Symbol` class.",
category: "ES2015",
recommended: false,
url:
"http://mysticatea.github.io/eslint-plugin-es/rules/no-symbol.html",
},
fixable: null,
messages: {
forbidden: "ES2015 '{{name}}' class is forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
"Program:exit"() {
const tracker = new ReferenceTracker(context.getScope())
for (const { node, path } of tracker.iterateGlobalReferences({
Symbol: { [READ]: true },
})) {
context.report({
node,
messageId: "forbidden",
data: { name: path.join(".") },
})
}
},
}
},
}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B wC"},B:{"1":"3 4 5 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 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","194":"0 1 2 o p q r s t u v w x y z"},C:{"1":"0 1 2 3 4 5 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 0C 1C","33":"6 7 8 9 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"},D:{"1":"3 4 5 GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","2":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z","194":"0 1 2 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"},E:{"1":"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 B C L M G 2C ZC 3C 4C 5C 6C aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC"},F:{"1":"0 1 2 3 4 5 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 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 FD GD HD ID NC uC JD OC","194":"a b c d e f g h i j k l m n o"},G:{"1":"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 SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC"},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:{"2":"PC"},P:{"1":"BB CB DB EB FB","2":"6 7 8 9 J AB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"2":"zD"},R:{"2":"0D"},S:{"1":"2D","33":"1D"}},B:5,C:":dir() CSS pseudo-class",D:true};
@@ -0,0 +1 @@
{"name":"color","version":"4.2.3","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532104330,"integrity":"sha512-QZ4/AN1FOp9g0h6HUPe6p+JmsyJ7gx6UiN1W7hfl0S1EJxjwY5A/3P+Wh54vEg6GW6aF/Q3r3gU9FrxsrJyMOA==","mode":420,"size":1059},"index.js":{"checkedAt":1794532104331,"integrity":"sha512-d/h9EVJqB/Nhy3Tj1SxzUz9ldWxdhW2Wwf9KgrtLAr3NFIgF34KkkBBytN3uLFh+8FIqADNo/+gftU2jFZL9lg==","mode":420,"size":11169},"package.json":{"checkedAt":1794532104331,"integrity":"sha512-JJugait7Ww0Q13J9BEk9otSCebl5jdR7O/9gu/yGQlQZhn5zGzJgYWR2ofM0nSR5L4Xumf53dRogIQxnB6dntw==","mode":420,"size":896},"README.md":{"checkedAt":1794532104331,"integrity":"sha512-FRUVwS2oBqEZo4sXyicmFpQx1uOS4QUqxilOYyxxeUN0eEL+UUhj7YJS1hqXEcCY89YnA4EySxs0jBPFC8bB5g==","mode":420,"size":3682}}}
@@ -0,0 +1,2 @@
import FactoryFunction from "./factory-function";
export default function instancePerContainerCachingFactory<T>(factoryFunc: FactoryFunction<T>): FactoryFunction<T>;
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more