docs: 仓库链接指向本镜像仓库
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run

This commit is contained in:
TanTan committed 2026-11-13 09:27:07 +08:00
1 parent fa9c73363d
commit 2a69b23b47
18210 files changed
+5101211 -16

No files matched your search

@@ -0,0 +1,170 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.ts
var index_exports = {};
__export(index_exports, {
Root: () => Slot,
Slot: () => Slot,
Slottable: () => Slottable,
createSlot: () => createSlot,
createSlottable: () => createSlottable
});
module.exports = __toCommonJS(index_exports);
// src/slot.tsx
var React = __toESM(require("react"));
var import_react_compose_refs = require("@radix-ui/react-compose-refs");
// @__NO_SIDE_EFFECTS__
function createSlot(ownerName) {
const Slot2 = React.forwardRef((props, forwardedRef) => {
let { children, ...slotProps } = props;
let slottableElement = null;
let hasSlottable = false;
const newChildren = [];
if (isLazyComponent(children) && typeof use === "function") {
children = use(children._payload);
}
React.Children.forEach(children, (maybeSlottable) => {
if (isSlottable(maybeSlottable)) {
hasSlottable = true;
const slottable = maybeSlottable;
let child = "child" in slottable.props ? slottable.props.child : slottable.props.children;
if (isLazyComponent(child) && typeof use === "function") {
child = use(child._payload);
}
slottableElement = getSlottableElementFromSlottable(slottable, child);
newChildren.push(slottableElement?.props?.children);
} else {
newChildren.push(maybeSlottable);
}
});
if (slottableElement) {
slottableElement = React.cloneElement(slottableElement, void 0, newChildren);
} else if (
// A `Slottable` was found but it didn't resolve to a single element (e.g.
// it wrapped multiple elements, text, or a render-prop `child` that
// wasn't an element). Don't fall back to treating the `Slottable` wrapper
// itself as the slot target — throw a descriptive error below instead.
!hasSlottable && React.Children.count(children) === 1 && React.isValidElement(children)
) {
slottableElement = children;
}
const slottableElementRef = slottableElement ? getElementRef(slottableElement) : void 0;
const composedRef = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, slottableElementRef);
if (!slottableElement) {
if (children || children === 0) {
throw new Error(
hasSlottable ? createSlottableError(ownerName) : createSlotError(ownerName)
);
}
return children;
}
const mergedProps = mergeProps(slotProps, slottableElement.props ?? {});
if (slottableElement.type !== React.Fragment) {
mergedProps.ref = forwardedRef ? composedRef : slottableElementRef;
}
return React.cloneElement(slottableElement, mergedProps);
});
Slot2.displayName = `${ownerName}.Slot`;
return Slot2;
}
var Slot = /* @__PURE__ */ createSlot("Slot");
var SLOTTABLE_IDENTIFIER = Symbol.for("radix.slottable");
// @__NO_SIDE_EFFECTS__
function createSlottable(ownerName) {
const Slottable2 = (props) => "child" in props ? props.children(props.child) : props.children;
Slottable2.displayName = `${ownerName}.Slottable`;
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
return Slottable2;
}
var Slottable = /* @__PURE__ */ createSlottable("Slottable");
var getSlottableElementFromSlottable = (slottable, child) => {
if ("child" in slottable.props) {
const child2 = slottable.props.child;
if (!React.isValidElement(child2)) return null;
return React.cloneElement(child2, void 0, slottable.props.children(child2.props.children));
}
return React.isValidElement(child) ? child : null;
};
function mergeProps(slotProps, childProps) {
const overrideProps = { ...childProps };
for (const propName in childProps) {
const slotPropValue = slotProps[propName];
const childPropValue = childProps[propName];
const isHandler = /^on[A-Z]/.test(propName);
if (isHandler) {
if (slotPropValue && childPropValue) {
overrideProps[propName] = (...args) => {
const result = childPropValue(...args);
slotPropValue(...args);
return result;
};
} else if (slotPropValue) {
overrideProps[propName] = slotPropValue;
}
} else if (propName === "style") {
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
} else if (propName === "className") {
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
}
}
return { ...slotProps, ...overrideProps };
}
function getElementRef(element) {
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
if (mayWarn) {
return element.ref;
}
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
if (mayWarn) {
return element.props.ref;
}
return element.props.ref || element.ref;
}
function isSlottable(child) {
return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
}
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
function isLazyComponent(element) {
return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
}
function isPromiseLike(value) {
return typeof value === "object" && value !== null && "then" in value;
}
var createSlotError = (ownerName) => {
return `${ownerName} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`;
};
var createSlottableError = (ownerName) => {
return `${ownerName} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`;
};
var use = React[" use ".trim().toString()];
//# sourceMappingURL=index.js.map
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- http://en.wikipedia.org/wiki/Atom_%28standard%29 -->
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Example Feed</title>
<subtitle>A subtitle.</subtitle>
<link href="http://example.org/feed/" rel="self" />
<link href="http://example.org/" />
<id>urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6</id>
<updated>2003-12-13T18:30:02Z</updated>
<author>
<name>John Doe</name>
<email>johndoe@example.com</email>
</author>
<entry>
<title>Atom-Powered Robots Run Amok</title>
<link href="http://example.org/2003/12/13/atom03" />
<link rel="alternate" type="text/html" href="http://example.org/2003/12/13/atom03.html"/>
<link rel="edit" href="http://example.org/2003/12/13/atom03/edit"/>
<id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
<updated>2003-12-13T18:30:02Z</updated>
<content type="html"><p>Some content.</p></content>
</entry>
<entry/>
</feed>
@@ -0,0 +1 @@
module.exports={C:{"57":0.00628,"59":0.00628,"61":0.00628,"72":0.00628,"100":0.00628,"102":0.00628,"115":0.01885,"120":1.38854,"121":3.02212,"123":0.01257,"124":0.01257,"125":0.00628,"130":0.00628,"132":0.00628,"136":0.00628,"140":0.00628,"142":0.00628,"150":0.01257,"153":0.00628,"154":0.05026,"155":0.18221,"156":0.26389,"157":0.00628,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 58 60 62 63 64 65 66 67 68 69 70 71 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 101 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 122 126 127 128 129 131 133 134 135 137 138 139 141 143 144 145 146 147 148 149 151 152 158 159 160 3.5 3.6"},D:{"49":0.00628,"60":0.00628,"62":0.00628,"63":0.01257,"65":0.00628,"66":0.00628,"68":0.01257,"69":0.00628,"70":0.00628,"76":0.01257,"78":0.00628,"81":0.00628,"86":0.01885,"87":0.01257,"92":0.08168,"93":0.01885,"101":0.01257,"103":0.54662,"104":0.53406,"105":0.52149,"106":0.54034,"107":0.51521,"108":0.54034,"109":0.57804,"110":0.54034,"111":0.53406,"112":0.52149,"113":0.00628,"114":0.00628,"116":1.08696,"117":0.50892,"118":2.2179,"119":2.89646,"120":3.57503,"121":0.01257,"122":0.00628,"123":0.01885,"124":0.54034,"125":0.00628,"126":0.01885,"127":0.00628,"128":0.01257,"130":0.02513,"131":1.04926,"132":0.02513,"133":1.12466,"134":0.0754,"135":0.0754,"136":0.08796,"137":0.09425,"138":0.11309,"139":0.09425,"140":0.10053,"141":0.10681,"142":0.33928,"143":0.00628,"144":0.49007,"145":0.11938,"146":0.24504,"147":0.01885,"148":0.38955,"149":0.84192,"150":2.45037,"151":12.30211,"152":4.45465,"153":3.11637,"154":0.72883,"155":0.00628,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 50 51 52 53 54 55 56 57 58 59 61 64 67 71 72 73 74 75 77 79 80 83 84 85 88 89 90 91 94 95 96 97 98 99 100 102 115 129 156 157"},F:{"51":0.00628,"53":0.00628,"54":0.00628,"55":0.00628,"56":0.01257,"57":0.00628,"86":0.03142,"95":0.01257,"101":0.08168,"102":0.00628,"106":0.03142,"107":0.00628,"110":0.00628,"115":0.01257,"116":0.00628,"121":0.00628,"131":0.00628,"133":0.01257,"134":0.05655,"135":0.47123,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 52 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 87 88 89 90 91 92 93 94 96 97 98 99 100 103 104 105 108 109 111 112 113 114 117 118 119 120 122 123 124 125 126 127 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"16":0.00628,"18":0.00628,"115":0.00628,"119":1.43881,"120":1.42624,"122":0.00628,"132":0.01257,"135":0.00628,"140":0.01885,"142":0.00628,"144":0.00628,"145":0.00628,"147":0.03142,"148":0.0754,"149":0.01885,"150":0.0377,"151":0.21991,"152":1.63358,"153":2.05454,"154":0.64087,_:"12 13 14 15 17 79 80 81 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 121 123 124 125 126 127 128 129 130 131 133 134 136 137 138 139 141 143 146"},E:{"27":0.02513,_:"4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 14.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 16.2 16.3 16.4 16.5 17.0 17.2 17.3 17.5 18.1 18.2 18.3 18.4 18.5-18.7 26.0 26.1 27.1 27.2 TP","13.1":0.00628,"15.6":0.01885,"16.6":0.01257,"17.1":0.01257,"17.4":0.00628,"17.6":0.04398,"18.0":0.00628,"26.2":0.02513,"26.3":0.00628,"26.4":0.00628,"26.5":0.10681,"26.6":0.2953},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00061,"5.0-5.1":0.00061,"6.0-6.1":0,"7.0-7.1":0.00121,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.00607,"11.0-11.2":0.00061,"11.3-11.4":0.00121,"12.0-12.1":0,"12.2-12.5":0.01579,"13.0-13.1":0,"13.2":0.00304,"13.3":0,"13.4-13.7":0.00061,"14.0-14.4":0.00243,"14.5-14.8":0.00364,"15.0-15.1":0.00364,"15.2-15.3":0.00243,"15.4":0.00304,"15.5":0.00364,"15.6-15.8":0.07896,"16.0":0.00607,"16.1":0.01093,"16.2":0.00607,"16.3":0.01336,"16.4":0.00304,"16.5":0.00486,"16.6-16.7":0.10993,"17.0":0.00425,"17.1":0.00607,"17.2":0.00607,"17.3":0.00911,"17.4":0.01275,"17.5":0.0249,"17.6-17.7":0.06438,"18.0":0.01336,"18.1":0.02672,"18.2":0.03644,"18.3":0.06317,"18.4":0.03948,"18.5-18.7":0.81568,"26.0":0.03948,"26.1":0.04009,"26.2":0.10447,"26.3":0.11297,"26.4":0.0826,"26.5":0.5533,"26.6":3.41396,"27.0":0.26177,"27.1":0,"27.2":0.00668},P:{"21":0.00888,"22":0.00888,"24":0.00888,"25":0.00888,"26":0.00888,"27":0.01775,"28":0.09764,"29":0.11539,"30":1.77519,_:"4 20 23 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.00888},I:{"0":0.03343,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.00001},K:{"0":0.28249,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},L:{"0":30.963},R:{_:"0"},M:{"0":0.06319},Q:{"14.9":0.01487},O:{"0":0.21559},H:{all:0}};
@@ -0,0 +1,82 @@
export class Path {
/**
* Creates a new path based on the argument type. If the argument is a string,
* it is assumed to be a file or directory path and is converted to a Path
* instance. If the argument is a URL, it is assumed to be a file URL and is
* converted to a Path instance. If the argument is a Path instance, it is
* copied into a new Path instance. If the argument is an array, it is assumed
* to be the steps of a path and is used to create a new Path instance.
* @param {string|URL|Path|Array<string>} pathish The value to convert to a Path instance.
* @returns {Path} A new Path instance.
* @throws {TypeError} When pathish is not a string, URL, Path, or Array.
* @throws {TypeError} When pathish is a string and is empty.
*/
static from(pathish: string | URL | Path | Array<string>): Path;
/**
* Creates a new Path instance from a string.
* @param {string} fileOrDirPath The file or directory path to convert.
* @returns {Path} A new Path instance.
* @deprecated Use Path.from() instead.
*/
static fromString(fileOrDirPath: string): Path;
/**
* Creates a new Path instance from a URL.
* @param {URL} url The URL to convert.
* @returns {Path} A new Path instance.
* @throws {TypeError} When url is not a URL instance.
* @throws {TypeError} When url.pathname is empty.
* @throws {TypeError} When url.protocol is not "file:".
* @deprecated Use Path.from() instead.
*/
static fromURL(url: URL): Path;
/**
* Creates a new instance.
* @param {Iterable<string>} [steps] The steps to use for the path.
* @throws {TypeError} When steps is not iterable.
*/
constructor(steps?: Iterable<string>);
/**
* Adds steps to the end of the path.
* @param {...string} steps The steps to add to the path.
* @returns {void}
*/
push(...steps: string[]): void;
/**
* Removes the last step from the path.
* @returns {string} The last step in the path.
*/
pop(): string;
/**
* Returns an iterator for steps in the path.
* @returns {IterableIterator<string>} An iterator for the steps in the path.
*/
steps(): IterableIterator<string>;
/**
* Sets the name (the last step) of the path.
* @type {string}
*/
set name(value: string);
/**
* Retrieves the name (the last step) of the path.
* @type {string}
*/
get name(): string;
/**
* Retrieves the size of the path.
* @type {number}
*/
get size(): number;
/**
* Returns the path as a string.
* @returns {string} The path as a string.
*/
toString(): string;
/**
* Returns an iterator for the steps in the path.
* @returns {IterableIterator<string>} An iterator for the steps in the path.
*/
[Symbol.iterator](): IterableIterator<string>;
#private;
}
export type HfsImpl = import("@humanfs/types").HfsImpl;
export type HfsDirectoryEntry = import("@humanfs/types").HfsDirectoryEntry;
@@ -0,0 +1,391 @@
/**
* @fileoverview Comma style - enforces comma styles of two types: last and first
* @author Vignesh Anand aka vegetableman
* @deprecated in ESLint v8.53.0
*/
"use strict";
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "8.53.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "comma-style",
url: "https://eslint.style/rules/comma-style",
},
},
],
},
type: "layout",
docs: {
description: "Enforce consistent comma style",
recommended: false,
url: "https://eslint.org/docs/latest/rules/comma-style",
},
fixable: "code",
schema: [
{
enum: ["first", "last"],
},
{
type: "object",
properties: {
exceptions: {
type: "object",
additionalProperties: {
type: "boolean",
},
},
},
additionalProperties: false,
},
],
messages: {
unexpectedLineBeforeAndAfterComma:
"Bad line breaking before and after ','.",
expectedCommaFirst: "',' should be placed first.",
expectedCommaLast: "',' should be placed last.",
},
},
create(context) {
const style = context.options[0] || "last",
sourceCode = context.sourceCode;
const exceptions = {
ArrayPattern: true,
ArrowFunctionExpression: true,
CallExpression: true,
FunctionDeclaration: true,
FunctionExpression: true,
ImportDeclaration: true,
ObjectPattern: true,
NewExpression: true,
};
if (
context.options.length === 2 &&
Object.hasOwn(context.options[1], "exceptions")
) {
const keys = Object.keys(context.options[1].exceptions);
for (let i = 0; i < keys.length; i++) {
exceptions[keys[i]] = context.options[1].exceptions[keys[i]];
}
}
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
/**
* Modified text based on the style
* @param {string} styleType Style type
* @param {string} text Source code text
* @returns {string} modified text
* @private
*/
function getReplacedText(styleType, text) {
switch (styleType) {
case "between":
return `,${text.replace(astUtils.LINEBREAK_MATCHER, "")}`;
case "first":
return `${text},`;
case "last":
return `,${text}`;
default:
return "";
}
}
/**
* Determines the fixer function for a given style.
* @param {string} styleType comma style
* @param {ASTNode} previousItemToken The token to check.
* @param {ASTNode} commaToken The token to check.
* @param {ASTNode} currentItemToken The token to check.
* @returns {Function} Fixer function
* @private
*/
function getFixerFunction(
styleType,
previousItemToken,
commaToken,
currentItemToken,
) {
const text =
sourceCode.text.slice(
previousItemToken.range[1],
commaToken.range[0],
) +
sourceCode.text.slice(
commaToken.range[1],
currentItemToken.range[0],
);
const range = [
previousItemToken.range[1],
currentItemToken.range[0],
];
return function (fixer) {
return fixer.replaceTextRange(
range,
getReplacedText(styleType, text),
);
};
}
/**
* Validates the spacing around single items in lists.
* @param {Token} previousItemToken The last token from the previous item.
* @param {Token} commaToken The token representing the comma.
* @param {Token} currentItemToken The first token of the current item.
* @param {Token} reportItem The item to use when reporting an error.
* @returns {void}
* @private
*/
function validateCommaItemSpacing(
previousItemToken,
commaToken,
currentItemToken,
reportItem,
) {
// if single line
if (
astUtils.isTokenOnSameLine(commaToken, currentItemToken) &&
astUtils.isTokenOnSameLine(previousItemToken, commaToken)
) {
// do nothing.
} else if (
!astUtils.isTokenOnSameLine(commaToken, currentItemToken) &&
!astUtils.isTokenOnSameLine(previousItemToken, commaToken)
) {
const comment = sourceCode.getCommentsAfter(commaToken)[0];
const styleType =
comment &&
comment.type === "Block" &&
astUtils.isTokenOnSameLine(commaToken, comment)
? style
: "between";
// lone comma
context.report({
node: reportItem,
loc: commaToken.loc,
messageId: "unexpectedLineBeforeAndAfterComma",
fix: getFixerFunction(
styleType,
previousItemToken,
commaToken,
currentItemToken,
),
});
} else if (
style === "first" &&
!astUtils.isTokenOnSameLine(commaToken, currentItemToken)
) {
context.report({
node: reportItem,
loc: commaToken.loc,
messageId: "expectedCommaFirst",
fix: getFixerFunction(
style,
previousItemToken,
commaToken,
currentItemToken,
),
});
} else if (
style === "last" &&
astUtils.isTokenOnSameLine(commaToken, currentItemToken)
) {
context.report({
node: reportItem,
loc: commaToken.loc,
messageId: "expectedCommaLast",
fix: getFixerFunction(
style,
previousItemToken,
commaToken,
currentItemToken,
),
});
}
}
/**
* Checks the comma placement with regards to a declaration/property/element
* @param {ASTNode} node The binary expression node to check
* @param {string} property The property of the node containing child nodes.
* @private
* @returns {void}
*/
function validateComma(node, property) {
const items = node[property],
arrayLiteral =
node.type === "ArrayExpression" ||
node.type === "ArrayPattern";
if (items.length > 1 || arrayLiteral) {
// seed as opening [
let previousItemToken = sourceCode.getFirstToken(node);
items.forEach(item => {
const commaToken = item
? sourceCode.getTokenBefore(item)
: previousItemToken,
currentItemToken = item
? sourceCode.getFirstToken(item)
: sourceCode.getTokenAfter(commaToken),
reportItem = item || currentItemToken;
/*
* This works by comparing three token locations:
* - previousItemToken is the last token of the previous item
* - commaToken is the location of the comma before the current item
* - currentItemToken is the first token of the current item
*
* These values get switched around if item is undefined.
* previousItemToken will refer to the last token not belonging
* to the current item, which could be a comma or an opening
* square bracket. currentItemToken could be a comma.
*
* All comparisons are done based on these tokens directly, so
* they are always valid regardless of an undefined item.
*/
if (astUtils.isCommaToken(commaToken)) {
validateCommaItemSpacing(
previousItemToken,
commaToken,
currentItemToken,
reportItem,
);
}
if (item) {
const tokenAfterItem = sourceCode.getTokenAfter(
item,
astUtils.isNotClosingParenToken,
);
previousItemToken = tokenAfterItem
? sourceCode.getTokenBefore(tokenAfterItem)
: sourceCode.ast.tokens.at(-1);
} else {
previousItemToken = currentItemToken;
}
});
/*
* Special case for array literals that have empty last items, such
* as [ 1, 2, ]. These arrays only have two items show up in the
* AST, so we need to look at the token to verify that there's no
* dangling comma.
*/
if (arrayLiteral) {
const lastToken = sourceCode.getLastToken(node),
nextToLastToken = sourceCode.getTokenBefore(lastToken);
if (astUtils.isCommaToken(nextToLastToken)) {
validateCommaItemSpacing(
sourceCode.getTokenBefore(nextToLastToken),
nextToLastToken,
lastToken,
lastToken,
);
}
}
}
}
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
const nodes = {};
if (!exceptions.VariableDeclaration) {
nodes.VariableDeclaration = function (node) {
validateComma(node, "declarations");
};
}
if (!exceptions.ObjectExpression) {
nodes.ObjectExpression = function (node) {
validateComma(node, "properties");
};
}
if (!exceptions.ObjectPattern) {
nodes.ObjectPattern = function (node) {
validateComma(node, "properties");
};
}
if (!exceptions.ArrayExpression) {
nodes.ArrayExpression = function (node) {
validateComma(node, "elements");
};
}
if (!exceptions.ArrayPattern) {
nodes.ArrayPattern = function (node) {
validateComma(node, "elements");
};
}
if (!exceptions.FunctionDeclaration) {
nodes.FunctionDeclaration = function (node) {
validateComma(node, "params");
};
}
if (!exceptions.FunctionExpression) {
nodes.FunctionExpression = function (node) {
validateComma(node, "params");
};
}
if (!exceptions.ArrowFunctionExpression) {
nodes.ArrowFunctionExpression = function (node) {
validateComma(node, "params");
};
}
if (!exceptions.CallExpression) {
nodes.CallExpression = function (node) {
validateComma(node, "arguments");
};
}
if (!exceptions.ImportDeclaration) {
nodes.ImportDeclaration = function (node) {
validateComma(node, "specifiers");
};
}
if (!exceptions.NewExpression) {
nodes.NewExpression = function (node) {
validateComma(node, "arguments");
};
}
return nodes;
},
};
@@ -0,0 +1 @@
{"version":3,"names":["_instanceof","left","right","Symbol","hasInstance"],"sources":["../../src/helpers/instanceof.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _instanceof(left: any, right: Function) {\n if (\n right != null &&\n typeof Symbol !== \"undefined\" &&\n right[Symbol.hasInstance]\n ) {\n return !!right[Symbol.hasInstance](left);\n } else {\n return left instanceof right;\n }\n}\n"],"mappings":";;;;;;AAEe,SAASA,WAAWA,CAACC,IAAS,EAAEC,KAAe,EAAE;EAC9D,IACEA,KAAK,IAAI,IAAI,IACb,OAAOC,MAAM,KAAK,WAAW,IAC7BD,KAAK,CAACC,MAAM,CAACC,WAAW,CAAC,EACzB;IACA,OAAO,CAAC,CAACF,KAAK,CAACC,MAAM,CAACC,WAAW,CAAC,CAACH,IAAI,CAAC;EAC1C,CAAC,MAAM;IACL,OAAOA,IAAI,YAAYC,KAAK;EAC9B;AACF","ignoreList":[]}
@@ -0,0 +1,935 @@
export default `flf2a$ 9 9 40 1 15
Mega-relief by Nick Bryant 12/9, dmc1@st-and.ac.uk for the moment.
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
Explanation of first line:
flf2 - "magic number" for file identification
a - should always be \`a', for now
$ - the "hardblank" -- prints as a blank, but can't be smushed
9 - height of a character
9 - height of a character, not including descenders
40 - max line length (excluding comment lines) + a fudge factor
0 - default smushmode for this font
15 - number of comment lines
___________ @
___________ @
___________ @
___________ @
___________ @
___________ @
___________ @
___________ @
___________ @@
_____/\\\\\\____ @
___/\\\\\\\\\\\\\\__ @
__/\\\\\\\\\\\\\\\\\\_ @
_\\//\\\\\\\\\\\\\\__ @
__\\//\\\\\\\\\\___ @
___\\//\\\\\\____ @
____\\///_____ @
_____/\\\\\\____ @
____\\///_____@@
__/\\\\/\\\\_ @
_\\/\\\\/\\\\_ @
_\\//\\//__ @
_________ @
_________ @
_________ @
_________ @
_________ @
_________@@
____/\\\\\\__/\\\\\\___ @
___\\/\\\\\\_\\/\\\\\\___ @
__/\\\\\\\\\\\\\\\\\\\\\\\\\\_ @
_\\///\\\\\\///\\\\\\/__ @
___\\/\\\\\\_\\/\\\\\\___ @
__/\\\\\\\\\\\\\\\\\\\\\\\\\\_ @
_\\///\\\\\\///\\\\\\/__ @
___\\/\\\\\\_\\/\\\\\\___ @
___\\///__\\///____@@
________/\\\\\\_______ @
____/\\\\\\\\\\\\\\\\\\\\\\___ @
__/\\\\\\///\\\\\\////\\\\_ @
_\\////\\\\\\\\\\\\__\\//__ @
____\\////\\\\\\\\\\\\____ @
__/\\\\__\\/\\\\\\///\\\\\\_ @
_\\///\\\\\\\\\\\\\\\\\\\\\\/__ @
___\\/////\\\\\\///___ @
_______\\///________@@
____/\\\\\\________/\\\\\\_ @
___/\\\\/\\\\_____/\\\\\\/__ @
__\\//\\\\\\____/\\\\\\/____ @
___\\///___/\\\\\\/______ @
________/\\\\\\/________ @
______/\\\\\\/___/\\\\\\___ @
____/\\\\\\/____/\\\\/\\\\__ @
__/\\\\\\/_____\\//\\\\\\___ @
_\\///________\\///___ @@
___________/\\\\\\_______ @
________/\\\\\\//\\\\\\_____ @
_______/\\\\\\_/\\\\\\______ @
______\\//\\\\\\\\//_______ @
_____/\\\\\\///\\\\\\_______ @
___/\\\\\\/__\\///\\\\\\/\\\\\\_ @
__/\\\\\\______\\//\\\\\\//__ @
_\\//\\\\\\\\\\\\\\\\\\\\\\//\\\\\\__ @
__\\///////////_\\///___@@
__/\\\\\\\\_ @
_\\///\\\\_ @
__/\\\\/__ @
_\\//____ @
________ @
________ @
________ @
________ @
________@@
______/\\\\\\_ @
____/\\\\\\/__ @
___/\\\\\\____ @
__/\\\\\\_____ @
_\\/\\\\\\_____ @
_\\//\\\\\\____ @
__\\//\\\\\\___ @
___\\///\\\\\\_ @
_____\\///__@@
__/\\\\\\_____ @
_\\///\\\\\\___ @
___\\//\\\\\\__ @
____\\//\\\\\\_ @
_____\\/\\\\\\_ @
_____/\\\\\\__ @
____/\\\\\\___ @
__/\\\\\\/____ @
_\\///______@@
________/\\\\\\_______ @
__/\\\\\\_\\/\\\\\\__/\\\\\\_ @
_\\////\\\\\\\\\\\\\\\\\\//__ @
____\\////\\\\\\//_____ @
_____/\\\\\\\\\\\\\\\\\\____ @
__/\\\\\\///\\\\\\///\\\\\\_ @
_\\///__\\/\\\\\\_\\///__ @
_______\\///________ @
___________________@@
_______________ @
_______________ @
______/\\\\\\_____ @
_____\\/\\\\\\_____ @
__/\\\\\\\\\\\\\\\\\\\\\\_ @
_\\/////\\\\\\///__ @
_____\\/\\\\\\_____ @
_____\\///______ @
_______________@@
________ @
________ @
________ @
________ @
________ @
__/\\\\\\\\_ @
_\\///\\\\_ @
__/\\\\/__ @
_\\//____@@
_______________ @
_______________ @
_______________ @
__/\\\\\\\\\\\\\\\\\\\\\\_ @
_\\///////////__ @
_______________ @
_______________ @
_______________ @
_______________@@
_______ @
_______ @
_______ @
_______ @
_______ @
_______ @
_______ @
__/\\\\\\_ @
_\\///__@@
________________/\\\\\\_ @
______________/\\\\\\/__ @
____________/\\\\\\/____ @
__________/\\\\\\/______ @
________/\\\\\\/________ @
______/\\\\\\/__________ @
____/\\\\\\/____________ @
__/\\\\\\/______________ @
_\\///________________@@
_____/\\\\\\\\\\\\\\____ @
___/\\\\\\/////\\\\\\__ @
__/\\\\\\____\\//\\\\\\_ @
_\\/\\\\\\_____\\/\\\\\\_ @
_\\/\\\\\\_____\\/\\\\\\_ @
_\\/\\\\\\_____\\/\\\\\\_ @
_\\//\\\\\\____/\\\\\\__ @
__\\///\\\\\\\\\\\\\\/___ @
____\\///////_____@@
______/\\\\\\_ @
__/\\\\\\\\\\\\\\_ @
_\\/////\\\\\\_ @
_____\\/\\\\\\_ @
_____\\/\\\\\\_ @
_____\\/\\\\\\_ @
_____\\/\\\\\\_ @
_____\\/\\\\\\_ @
_____\\///_ @@
____/\\\\\\\\\\\\\\\\\\_____ @
__/\\\\\\///////\\\\\\___ @
_\\///______\\//\\\\\\__ @
___________/\\\\\\/___ @
________/\\\\\\//_____ @
_____/\\\\\\//________ @
___/\\\\\\/___________ @
__/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_ @
_\\///////////////__@@
_____/\\\\\\\\\\\\\\\\\\\\__ @
___/\\\\\\///////\\\\\\_ @
__\\///______/\\\\\\__ @
_________/\\\\\\//___ @
________\\////\\\\\\__ @
___________\\//\\\\\\_ @
__/\\\\\\______/\\\\\\__ @
_\\///\\\\\\\\\\\\\\\\\\/___ @
___\\/////////_____@@
____________/\\\\\\____ @
__________/\\\\\\\\\\____ @
________/\\\\\\/\\\\\\____ @
______/\\\\\\/\\/\\\\\\____ @
____/\\\\\\/__\\/\\\\\\____ @
__/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_ @
_\\///////////\\\\\\//__ @
___________\\/\\\\\\____ @
___________\\///_____@@
___/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_ @
__\\/\\\\\\///////////__ @
__\\/\\\\\\_____________ @
__\\/\\\\\\\\\\\\\\\\\\\\\\\\_____ @
__\\////////////\\\\\\___ @
_____________\\//\\\\\\__ @
__/\\\\\\________\\/\\\\\\__ @
_\\//\\\\\\\\\\\\\\\\\\\\\\\\\\/___ @
__\\/////////////_____@@
____________/\\\\\\\\\\_ @
________/\\\\\\\\////__ @
_____/\\\\\\///_______ @
___/\\\\\\\\\\\\\\\\\\\\\\____ @
__/\\\\\\\\///////\\\\\\__ @
_\\/\\\\\\______\\//\\\\\\_ @
_\\//\\\\\\______/\\\\\\__ @
__\\///\\\\\\\\\\\\\\\\\\/___ @
____\\/////////_____@@
__/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_ @
_\\/////////////\\\\\\_ @
____________/\\\\\\/__ @
__________/\\\\\\/____ @
________/\\\\\\/______ @
______/\\\\\\/________ @
____/\\\\\\/__________ @
__/\\\\\\/____________ @
_\\///______________@@
_____/\\\\\\\\\\\\\\\\\\____ @
___/\\\\\\///////\\\\\\__ @
__\\/\\\\\\_____\\/\\\\\\__ @
__\\///\\\\\\\\\\\\\\\\\\/___ @
___/\\\\\\///////\\\\\\__ @
__/\\\\\\______\\//\\\\\\_ @
_\\//\\\\\\______/\\\\\\__ @
__\\///\\\\\\\\\\\\\\\\\\/___ @
____\\/////////_____@@
______/\\\\\\\\\\\\\\\\\\____ @
____/\\\\\\///////\\\\\\__ @
___/\\\\\\______\\//\\\\\\_ @
__\\//\\\\\\_____/\\\\\\\\\\_ @
___\\///\\\\\\\\\\\\\\\\/\\\\\\_ @
_____\\////////\\/\\\\\\_ @
___/\\\\________/\\\\\\__ @
__\\//\\\\\\\\\\\\\\\\\\\\\\/___ @
___\\///////////_____@@
_______ @
_______ @
_______ @
_______ @
__/\\\\\\_ @
_\\///__ @
_______ @
__/\\\\\\_ @
_\\///__@@
________ @
________ @
________ @
__/\\\\\\__ @
_\\///___ @
__/\\\\\\\\_ @
_\\///\\\\_ @
__/\\\\/__ @
_\\//____@@
________________ @
___________/\\\\\\_ @
________/\\\\\\//__ @
_____/\\\\\\//_____ @
__/\\\\\\//________ @
_\\////\\\\\\_______ @
____\\////\\\\\\____ @
_______\\////\\\\\\_ @
__________\\///__@@
______________ @
______________ @
______________ @
__/\\\\\\\\\\\\\\\\\\\\_ @
_\\//////////__ @
__/\\\\\\\\\\\\\\\\\\\\_ @
_\\//////////__ @
______________ @
______________@@
________________ @
__/\\\\\\__________ @
_\\////\\\\\\_______ @
____\\////\\\\\\____ @
_______\\////\\\\\\_ @
________/\\\\\\//__ @
_____/\\\\\\//_____ @
__/\\\\\\//________ @
_\\///___________@@
____/\\\\\\\\\\\\\\____ @
_/\\\\\\//////\\\\\\__ @
\\///_____\\//\\\\\\_ @
__________/\\\\\\__ @
_______/\\\\\\\\/___ @
______/\\\\\\/_____ @
_____\\///_______ @
______/\\\\\\______ @
_____\\///_______@@
____/\\\\\\\\\\\\\\\\\\\\____ @
__/\\\\\\////////\\\\\\__ @
_\\/\\\\\\__/\\\\\\\\\\\\\\\\\\_ @
_\\/\\\\\\_\\/\\\\\\///\\\\\\_ @
_\\/\\\\\\_\\/\\\\\\\\\\\\\\\\__ @
_\\/\\\\\\_\\////////___ @
_\\//\\\\\\____________ @
__\\///\\\\\\\\\\\\\\\\\\\\\\\\_ @
____\\////////////__@@
_____/\\\\\\\\\\\\\\\\\\____ @
___/\\\\\\\\\\\\\\\\\\\\\\\\\\__ @
__/\\\\\\/////////\\\\\\_ @
_\\/\\\\\\_______\\/\\\\\\_ @
_\\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_ @
_\\/\\\\\\/////////\\\\\\_ @
_\\/\\\\\\_______\\/\\\\\\_ @
_\\/\\\\\\_______\\/\\\\\\_ @
_\\///________\\///__@@
__/\\\\\\\\\\\\\\\\\\\\\\\\\\___ @
_\\/\\\\\\/////////\\\\\\_ @
_\\/\\\\\\_______\\/\\\\\\_ @
_\\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\__ @
_\\/\\\\\\/////////\\\\\\_ @
_\\/\\\\\\_______\\/\\\\\\_ @
_\\/\\\\\\_______\\/\\\\\\_ @
_\\/\\\\\\\\\\\\\\\\\\\\\\\\\\/__ @
_\\/////////////____@@
________/\\\\\\\\\\\\\\\\\\_ @
_____/\\\\\\////////__ @
___/\\\\\\/___________ @
__/\\\\\\_____________ @
_\\/\\\\\\_____________ @
_\\//\\\\\\____________ @
__\\///\\\\\\__________ @
____\\////\\\\\\\\\\\\\\\\\\_ @
_______\\/////////__@@
__/\\\\\\\\\\\\\\\\\\\\\\\\____ @
_\\/\\\\\\////////\\\\\\__ @
_\\/\\\\\\______\\//\\\\\\_ @
_\\/\\\\\\_______\\/\\\\\\_ @
_\\/\\\\\\_______\\/\\\\\\_ @
_\\/\\\\\\_______\\/\\\\\\_ @
_\\/\\\\\\_______/\\\\\\__ @
_\\/\\\\\\\\\\\\\\\\\\\\\\\\/___ @
_\\////////////_____@@
__/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_ @
_\\/\\\\\\///////////__ @
_\\/\\\\\\_____________ @
_\\/\\\\\\\\\\\\\\\\\\\\\\_____ @
_\\/\\\\\\///////______ @
_\\/\\\\\\_____________ @
_\\/\\\\\\_____________ @
_\\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_ @
_\\///////////////__@@
__/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_ @
_\\/\\\\\\///////////__ @
_\\/\\\\\\_____________ @
_\\/\\\\\\\\\\\\\\\\\\\\\\_____ @
_\\/\\\\\\///////______ @
_\\/\\\\\\_____________ @
_\\/\\\\\\_____________ @
_\\/\\\\\\_____________ @
_\\///______________@@
_____/\\\\\\\\\\\\\\\\\\\\\\\\_ @
___/\\\\\\//////////__ @
__/\\\\\\_____________ @
_\\/\\\\\\____/\\\\\\\\\\\\\\_ @
_\\/\\\\\\___\\/////\\\\\\_ @
_\\/\\\\\\_______\\/\\\\\\_ @
_\\/\\\\\\_______\\/\\\\\\_ @
_\\//\\\\\\\\\\\\\\\\\\\\\\\\/__ @
__\\////////////____@@
__/\\\\\\________/\\\\\\_ @
_\\/\\\\\\_______\\/\\\\\\_ @
_\\/\\\\\\_______\\/\\\\\\_ @
_\\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_ @
_\\/\\\\\\/////////\\\\\\_ @
_\\/\\\\\\_______\\/\\\\\\_ @
_\\/\\\\\\_______\\/\\\\\\_ @
_\\/\\\\\\_______\\/\\\\\\_ @
_\\///________\\///__@@
__/\\\\\\\\\\\\\\\\\\\\\\_ @
_\\/////\\\\\\///__ @
_____\\/\\\\\\_____ @
_____\\/\\\\\\_____ @
_____\\/\\\\\\_____ @
_____\\/\\\\\\_____ @
_____\\/\\\\\\_____ @
__/\\\\\\\\\\\\\\\\\\\\\\_ @
_\\///////////__@@
______/\\\\\\\\\\\\\\\\\\\\\\_ @
_____\\/////\\\\\\///__ @
_________\\/\\\\\\_____ @
_________\\/\\\\\\_____ @
_________\\/\\\\\\_____ @
_________\\/\\\\\\_____ @
__/\\\\\\___\\/\\\\\\_____ @
_\\//\\\\\\\\\\\\\\\\\\______ @
__\\/////////_______@@
__/\\\\\\________/\\\\\\_ @
_\\/\\\\\\_____/\\\\\\//__ @
_\\/\\\\\\__/\\\\\\//_____ @
_\\/\\\\\\\\\\\\//\\\\\\_____ @
_\\/\\\\\\//_\\//\\\\\\____ @
_\\/\\\\\\____\\//\\\\\\___ @
_\\/\\\\\\_____\\//\\\\\\__ @
_\\/\\\\\\______\\//\\\\\\_ @
_\\///________\\///__@@
__/\\\\\\_____________ @
_\\/\\\\\\_____________ @
_\\/\\\\\\_____________ @
_\\/\\\\\\_____________ @
_\\/\\\\\\_____________ @
_\\/\\\\\\_____________ @
_\\/\\\\\\_____________ @
_\\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_ @
_\\///////////////__@@
__/\\\\\\\\____________/\\\\\\\\_ @
_\\/\\\\\\\\\\\\________/\\\\\\\\\\\\_ @
_\\/\\\\\\//\\\\\\____/\\\\\\//\\\\\\_ @
_\\/\\\\\\\\///\\\\\\/\\\\\\/_\\/\\\\\\_ @
_\\/\\\\\\__\\///\\\\\\/___\\/\\\\\\_ @
_\\/\\\\\\____\\///_____\\/\\\\\\_ @
_\\/\\\\\\_____________\\/\\\\\\_ @
_\\/\\\\\\_____________\\/\\\\\\_ @
_\\///______________\\///__@@
__/\\\\\\\\\\_____/\\\\\\_ @
_\\/\\\\\\\\\\\\___\\/\\\\\\_ @
_\\/\\\\\\/\\\\\\__\\/\\\\\\_ @
_\\/\\\\\\//\\\\\\_\\/\\\\\\_ @
_\\/\\\\\\\\//\\\\\\\\/\\\\\\_ @
_\\/\\\\\\_\\//\\\\\\/\\\\\\_ @
_\\/\\\\\\__\\//\\\\\\\\\\\\_ @
_\\/\\\\\\___\\//\\\\\\\\\\_ @
_\\///_____\\/////__@@
_______/\\\\\\\\\\______ @
_____/\\\\\\///\\\\\\____ @
___/\\\\\\/__\\///\\\\\\__ @
__/\\\\\\______\\//\\\\\\_ @
_\\/\\\\\\_______\\/\\\\\\_ @
_\\//\\\\\\______/\\\\\\__ @
__\\///\\\\\\__/\\\\\\____ @
____\\///\\\\\\\\\\/_____ @
______\\/////_______@@
__/\\\\\\\\\\\\\\\\\\\\\\\\\\___ @
_\\/\\\\\\/////////\\\\\\_ @
_\\/\\\\\\_______\\/\\\\\\_ @
_\\/\\\\\\\\\\\\\\\\\\\\\\\\\\/__ @
_\\/\\\\\\/////////____ @
_\\/\\\\\\_____________ @
_\\/\\\\\\_____________ @
_\\/\\\\\\_____________ @
_\\///______________@@
________/\\\\\\_______ @
_____/\\\\\\\\/\\\\\\\\____ @
___/\\\\\\//\\////\\\\\\__ @
__/\\\\\\______\\//\\\\\\_ @
_\\//\\\\\\______/\\\\\\__ @
__\\///\\\\\\\\/\\\\\\\\/___ @
____\\////\\\\\\//_____ @
_______\\///\\\\\\\\\\\\__ @
_________\\//////___@@
____/\\\\\\\\\\\\\\\\\\_____ @
__/\\\\\\///////\\\\\\___ @
_\\/\\\\\\_____\\/\\\\\\___ @
_\\/\\\\\\\\\\\\\\\\\\\\\\/____ @
_\\/\\\\\\//////\\\\\\____ @
_\\/\\\\\\____\\//\\\\\\___ @
_\\/\\\\\\_____\\//\\\\\\__ @
_\\/\\\\\\______\\//\\\\\\_ @
_\\///________\\///__@@
_____/\\\\\\\\\\\\\\\\\\\\\\___ @
___/\\\\\\/////////\\\\\\_ @
__\\//\\\\\\______\\///__ @
___\\////\\\\\\_________ @
______\\////\\\\\\______ @
_________\\////\\\\\\___ @
__/\\\\\\______\\//\\\\\\__ @
_\\///\\\\\\\\\\\\\\\\\\\\\\/___ @
___\\///////////_____@@
__/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_ @
_\\///////\\\\\\/////__ @
_______\\/\\\\\\_______ @
_______\\/\\\\\\_______ @
_______\\/\\\\\\_______ @
_______\\/\\\\\\_______ @
_______\\/\\\\\\_______ @
_______\\/\\\\\\_______ @
_______\\///________@@
__/\\\\\\________/\\\\\\_ @
_\\/\\\\\\_______\\/\\\\\\_ @
_\\/\\\\\\_______\\/\\\\\\_ @
_\\/\\\\\\_______\\/\\\\\\_ @
_\\/\\\\\\_______\\/\\\\\\_ @
_\\/\\\\\\_______\\/\\\\\\_ @
_\\//\\\\\\______/\\\\\\__ @
__\\///\\\\\\\\\\\\\\\\\\/___ @
____\\/////////_____@@
__/\\\\\\________/\\\\\\_ @
_\\/\\\\\\_______\\/\\\\\\_ @
_\\//\\\\\\______/\\\\\\__ @
__\\//\\\\\\____/\\\\\\___ @
___\\//\\\\\\__/\\\\\\____ @
____\\//\\\\\\/\\\\\\_____ @
_____\\//\\\\\\\\\\______ @
______\\//\\\\\\_______ @
_______\\///________@@
__/\\\\\\______________/\\\\\\_ @
_\\/\\\\\\_____________\\/\\\\\\_ @
_\\/\\\\\\_____________\\/\\\\\\_ @
_\\//\\\\\\____/\\\\\\____/\\\\\\__ @
__\\//\\\\\\__/\\\\\\\\\\__/\\\\\\___ @
___\\//\\\\\\/\\\\\\/\\\\\\/\\\\\\____ @
____\\//\\\\\\\\\\\\//\\\\\\\\\\_____ @
_____\\//\\\\\\__\\//\\\\\\______ @
______\\///____\\///_______@@
__/\\\\\\_______/\\\\\\_ @
_\\///\\\\\\___/\\\\\\/__ @
___\\///\\\\\\\\\\\\/____ @
_____\\//\\\\\\\\______ @
______\\/\\\\\\\\______ @
______/\\\\\\\\\\\\_____ @
____/\\\\\\////\\\\\\___ @
__/\\\\\\/___\\///\\\\\\_ @
_\\///_______\\///__@@
__/\\\\\\________/\\\\\\_ @
_\\///\\\\\\____/\\\\\\/__ @
___\\///\\\\\\/\\\\\\/____ @
_____\\///\\\\\\/______ @
_______\\/\\\\\\_______ @
_______\\/\\\\\\_______ @
_______\\/\\\\\\_______ @
_______\\/\\\\\\_______ @
_______\\///________@@
__/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_ @
_\\////////////\\\\\\__ @
___________/\\\\\\/___ @
_________/\\\\\\/_____ @
_______/\\\\\\/_______ @
_____/\\\\\\/_________ @
___/\\\\\\/___________ @
__/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_ @
_\\///////////////__@@
__/\\\\\\\\\\\\_ @
_\\/\\\\\\//__ @
_\\/\\\\\\____ @
_\\/\\\\\\____ @
_\\/\\\\\\____ @
_\\/\\\\\\____ @
_\\/\\\\\\____ @
_\\/\\\\\\\\\\\\_ @
_\\//////__@@
__/\\\\\\_______________ @
_\\///\\\\\\_____________ @
___\\///\\\\\\___________ @
_____\\///\\\\\\_________ @
_______\\///\\\\\\_______ @
_________\\///\\\\\\_____ @
___________\\///\\\\\\___ @
_____________\\///\\\\\\_ @
_______________\\///__@@
__/\\\\\\\\\\\\_ @
_\\////\\\\\\_ @
____\\/\\\\\\_ @
____\\/\\\\\\_ @
____\\/\\\\\\_ @
____\\/\\\\\\_ @
____\\/\\\\\\_ @
__/\\\\\\\\\\\\_ @
_\\//////__@@
____/\\\\\\___ @
___/\\\\/\\\\__ @
__/\\\\\\//\\\\_ @
_\\//__\\//__ @
___________ @
___________ @
___________ @
___________ @
___________@@
___________________ @
___________________ @
___________________ @
___________________ @
___________________ @
___________________ @
___________________ @
__/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\_ @
_\\///////////////__@@
____/\\\\_ @
__/\\\\/__ @
_\\/\\\\\\\\_ @
_\\////__ @
________ @
________ @
________ @
________ @
________@@
________________ @
________________ @
________________ @
__/\\\\\\\\\\\\\\\\\\____ @
_\\////////\\\\\\___ @
___/\\\\\\\\\\\\\\\\\\\\__ @
__/\\\\\\/////\\\\\\__ @
_\\//\\\\\\\\\\\\\\\\/\\\\_ @
__\\////////\\//__@@
__/\\\\\\________ @
_\\/\\\\\\________ @
_\\/\\\\\\________ @
_\\/\\\\\\________ @
_\\/\\\\\\\\\\\\\\\\\\__ @
_\\/\\\\\\////\\\\\\_ @
_\\/\\\\\\__\\/\\\\\\_ @
_\\/\\\\\\\\\\\\\\\\\\__ @
_\\/////////___@@
_______________ @
_______________ @
_______________ @
_____/\\\\\\\\\\\\\\\\_ @
___/\\\\\\//////__ @
__/\\\\\\_________ @
_\\//\\\\\\________ @
__\\///\\\\\\\\\\\\\\\\_ @
____\\////////__@@
_________/\\\\\\__ @
________\\/\\\\\\__ @
________\\/\\\\\\__ @
________\\/\\\\\\__ @
___/\\\\\\\\\\\\\\\\\\__ @
__/\\\\\\////\\\\\\__ @
_\\/\\\\\\__\\/\\\\\\__ @
_\\//\\\\\\\\\\\\\\/\\\\_ @
__\\///////\\//__@@
________________ @
________________ @
________________ @
_____/\\\\\\\\\\\\\\\\__ @
___/\\\\\\/////\\\\\\_ @
__/\\\\\\\\\\\\\\\\\\\\\\__ @
_\\//\\\\///////___ @
__\\//\\\\\\\\\\\\\\\\\\\\_ @
___\\//////////__@@
________/\\\\\\\\\\_ @
______/\\\\\\///__ @
_____/\\\\\\______ @
__/\\\\\\\\\\\\\\\\\\___ @
_\\////\\\\\\//____ @
____\\/\\\\\\______ @
____\\/\\\\\\______ @
____\\/\\\\\\______ @
____\\///_______@@
______________ @
______________ @
___/\\\\\\\\\\\\\\\\__ @
__/\\\\\\////\\\\\\_ @
_\\//\\\\\\\\\\\\\\\\\\_ @
__\\///////\\\\\\_ @
__/\\\\_____\\\\\\_ @
_\\//\\\\\\\\\\\\\\\\__ @
__\\////////___@@
__/\\\\\\_________ @
_\\/\\\\\\_________ @
_\\/\\\\\\_________ @
_\\/\\\\\\_________ @
_\\/\\\\\\\\\\\\\\\\\\\\__ @
_\\/\\\\\\/////\\\\\\_ @
_\\/\\\\\\___\\/\\\\\\_ @
_\\/\\\\\\___\\/\\\\\\_ @
_\\///____\\///__@@
_______ @
_______ @
__/\\\\\\_ @
_\\///__ @
__/\\\\\\_ @
_\\/\\\\\\_ @
_\\/\\\\\\_ @
_\\/\\\\\\_ @
_\\///__@@
____________ @
_______/\\\\\\_ @
______\\///__ @
_______/\\\\\\_ @
______\\/\\\\\\_ @
______\\/\\\\\\_ @
__/\\\\_\\/\\\\\\_ @
_\\//\\\\\\\\\\\\__ @
__\\//////___@@
_______________ @
__/\\\\\\_________ @
_\\/\\\\\\_________ @
_\\/\\\\\\\\\\\\\\\\____ @
_\\/\\\\\\////\\\\\\__ @
_\\/\\\\\\\\\\\\\\\\/___ @
_\\/\\\\\\///\\\\\\___ @
_\\/\\\\\\_\\///\\\\\\_ @
_\\///____\\///__@@
__/\\\\\\\\\\\\____ @
_\\////\\\\\\____ @
____\\/\\\\\\____ @
____\\/\\\\\\____ @
____\\/\\\\\\____ @
____\\/\\\\\\____ @
____\\/\\\\\\____ @
__/\\\\\\\\\\\\\\\\\\_ @
_\\/////////__@@
_____________________ @
_____________________ @
_____________________ @
____/\\\\\\\\\\__/\\\\\\\\\\___ @
__/\\\\\\///\\\\\\\\\\///\\\\\\_ @
_\\/\\\\\\_\\//\\\\\\__\\/\\\\\\_ @
_\\/\\\\\\__\\/\\\\\\__\\/\\\\\\_ @
_\\/\\\\\\__\\/\\\\\\__\\/\\\\\\_ @
_\\///___\\///___\\///__@@
_______________ @
_______________ @
_______________ @
__/\\\\/\\\\\\\\\\\\___ @
_\\/\\\\\\////\\\\\\__ @
_\\/\\\\\\__\\//\\\\\\_ @
_\\/\\\\\\___\\/\\\\\\_ @
_\\/\\\\\\___\\/\\\\\\_ @
_\\///____\\///__@@
_______________ @
_______________ @
_______________ @
_____/\\\\\\\\\\____ @
___/\\\\\\///\\\\\\__ @
__/\\\\\\__\\//\\\\\\_ @
_\\//\\\\\\__/\\\\\\__ @
__\\///\\\\\\\\\\/___ @
____\\/////_____@@
_______________ @
_______________ @
___/\\\\\\\\\\\\\\\\\\__ @
__/\\\\\\/////\\\\\\_ @
_\\/\\\\\\\\\\\\\\\\\\\\__ @
_\\/\\\\\\//////___ @
_\\/\\\\\\_________ @
_\\/\\\\\\_________ @
_\\///__________@@
_______________ @
_______________ @
___/\\\\\\\\\\\\\\\\___ @
__/\\\\\\////\\\\\\__ @
_\\//\\\\\\\\\\\\\\\\\\__ @
__\\///////\\\\\\__ @
________\\/\\\\\\__ @
________\\/\\\\\\\\_ @
________\\////__@@
_______________ @
_______________ @
_______________ @
__/\\\\/\\\\\\\\\\\\\\__ @
_\\/\\\\\\/////\\\\\\_ @
_\\/\\\\\\___\\///__ @
_\\/\\\\\\_________ @
_\\/\\\\\\_________ @
_\\///__________@@
______________ @
______________ @
______________ @
__/\\\\\\\\\\\\\\\\\\\\_ @
_\\/\\\\\\//////__ @
_\\/\\\\\\\\\\\\\\\\\\\\_ @
_\\////////\\\\\\_ @
__/\\\\\\\\\\\\\\\\\\\\_ @
_\\//////////__@@
_______________ @
_______________ @
_____/\\\\\\______ @
__/\\\\\\\\\\\\\\\\\\\\\\_ @
_\\////\\\\\\////__ @
____\\/\\\\\\______ @
____\\/\\\\\\_/\\\\__ @
____\\//\\\\\\\\\\___ @
_____\\/////____@@
_______________ @
_______________ @
_______________ @
__/\\\\\\____/\\\\\\_ @
_\\/\\\\\\___\\/\\\\\\_ @
_\\/\\\\\\___\\/\\\\\\_ @
_\\/\\\\\\___\\/\\\\\\_ @
_\\//\\\\\\\\\\\\\\\\\\__ @
__\\/////////___@@
_______________ @
_______________ @
_______________ @
__/\\\\\\____/\\\\\\_ @
_\\//\\\\\\__/\\\\\\__ @
__\\//\\\\\\/\\\\\\___ @
___\\//\\\\\\\\\\____ @
____\\//\\\\\\_____ @
_____\\///______@@
___________________ @
___________________ @
___________________ @
__/\\\\____/\\\\___/\\\\_ @
_\\/\\\\\\__/\\\\\\\\_/\\\\\\_ @
_\\//\\\\\\/\\\\\\\\\\/\\\\\\__ @
__\\//\\\\\\\\\\/\\\\\\\\\\___ @
___\\//\\\\\\\\//\\\\\\____ @
____\\///__\\///_____@@
_______________ @
_______________ @
_______________ @
__/\\\\\\____/\\\\\\_ @
_\\///\\\\\\/\\\\\\/__ @
___\\///\\\\\\/____ @
____/\\\\\\/\\\\\\___ @
__/\\\\\\/\\///\\\\\\_ @
_\\///____\\///__@@
_______________ @
_______________ @
____/\\\\\\__/\\\\\\_ @
___\\//\\\\\\/\\\\\\__ @
____\\//\\\\\\\\\\___ @
_____\\//\\\\\\____ @
__/\\\\_/\\\\\\_____ @
_\\//\\\\\\\\/______ @
__\\////________@@
_______________ @
_______________ @
_______________ @
__/\\\\\\\\\\\\\\\\\\\\\\_ @
_\\///////\\\\\\/__ @
______/\\\\\\/____ @
____/\\\\\\/______ @
__/\\\\\\\\\\\\\\\\\\\\\\_ @
_\\///////////__@@
______________ @
_______/\\\\\\\\\\_ @
_____/\\\\\\///__ @
____\\//\\\\\\____ @
__/\\\\\\\\\\\\_____ @
_\\/////\\\\\\____ @
_____/\\\\\\_____ @
____\\///\\\\\\\\\\_ @
______\\/////__@@
__/\\\\\\_ @
_\\/\\\\\\_ @
_\\/\\\\\\_ @
_\\///__ @
_______ @
__/\\\\\\_ @
_\\/\\\\\\_ @
_\\/\\\\\\_ @
_\\///__@@
_____________ @
__/\\\\\\\\\\_____ @
_\\////\\\\\\____ @
____/\\\\\\_____ @
___\\//\\\\\\\\\\\\_ @
____/\\\\\\///__ @
___\\//\\\\\\____ @
__/\\\\\\\\\\_____ @
_\\/////______@@
___________________ @
___________________ @
____/\\\\\\\\\\_________ @
__/\\\\\\///\\\\\\__/\\\\\\_ @
_\\///__\\///\\\\\\\\\\/__ @
_________\\/////____ @
___________________ @
___________________ @
___________________@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@
@@
`
@@ -0,0 +1,20 @@
/*! *****************************************************************************
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,
MERCHANTABILITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference lib="es2022" />
/// <reference lib="es2023.array" />
/// <reference lib="es2023.collection" />
/// <reference lib="es2023.intl" />
@@ -0,0 +1 @@
{"version":3,"file":"blob.d.ts","sourceRoot":"","sources":["../../../web/blob.ts"],"names":[],"mappings":"AAQA,QAAA,MAAM,UAAU,KA8Bd,CAAC;AAEH,eAAe,UAAU,CAAC"}
@@ -0,0 +1,518 @@
# Diagnostics Channel Support
<!--introduced_in=v6.3.0-->
<!--type=misc-->
> Stability: 1 - Experimental
Undici is instrumented with Node.js' built-in [`diagnostics_channel`][] module.
It is the preferred way to observe undici's internal behaviour without patching
the library, and it backs the human-readable [debug logs][Debug].
Each integration point is exposed as a named channel. To observe an event,
obtain the channel by name and subscribe to it:
```mjs
import diagnosticsChannel from 'node:diagnostics_channel'
diagnosticsChannel.channel('undici:request:create').subscribe(({ request }) => {
console.log(request.method, request.origin, request.path)
})
```
```cjs
const diagnosticsChannel = require('node:diagnostics_channel')
diagnosticsChannel.channel('undici:request:create').subscribe(({ request }) => {
console.log(request.method, request.origin, request.path)
})
```
The message published to a channel is always a single object whose shape depends
on the channel. The sections below describe every channel and the object it
publishes. Subscriber callbacks run synchronously inside undici, so they should
be fast and must not throw.
The same `request` object is shared across all `undici:request:*` channels for a
given request, so a subscriber may correlate the lifecycle of one request by
identity.
## Event: `'undici:request:create'`
<!-- YAML
added: v6.3.0
-->
Published when a new outgoing request is created, before it is dispatched.
* `message` {Object}
* `request` {Object} The request being created.
* `origin` {string|URL} The origin the request is sent to.
* `completed` {boolean} Whether the request has completed. `false` at this
point.
* `method` {string} The HTTP method, e.g. `'GET'`.
* `path` {string} The request path, including any query string.
* `headers` {string[]} The request headers as a flat array of strings,
alternating between header name and value.
The `request` object also exposes an `addHeader(name, value)` method that
appends a header before the request is sent.
```mjs
import diagnosticsChannel from 'node:diagnostics_channel'
diagnosticsChannel.channel('undici:request:create').subscribe(({ request }) => {
console.log('origin', request.origin)
console.log('completed', request.completed)
console.log('method', request.method)
console.log('path', request.path)
console.log('headers', request.headers)
request.addHeader('hello', 'world')
})
```
A request is only loosely bound to a given socket at this stage.
## Event: `'undici:request:bodyChunkSent'`
<!-- YAML
added: v7.11.0
-->
Published each time a chunk of the request body is written to the socket.
* `message` {Object}
* `request` {Object} The same object published by
[`'undici:request:create'`][].
* `chunk` {Uint8Array|string} The body chunk being sent.
```mjs
import diagnosticsChannel from 'node:diagnostics_channel'
diagnosticsChannel.channel('undici:request:bodyChunkSent').subscribe(({ request, chunk }) => {
console.log('sent', chunk.length, 'bytes')
})
```
## Event: `'undici:request:bodySent'`
<!-- YAML
added: v6.3.0
-->
Published after the request body has been fully sent.
* `message` {Object}
* `request` {Object} The same object published by
[`'undici:request:create'`][].
```mjs
import diagnosticsChannel from 'node:diagnostics_channel'
diagnosticsChannel.channel('undici:request:bodySent').subscribe(({ request }) => {
// request is the same object as in 'undici:request:create'
})
```
## Event: `'undici:request:headers'`
<!-- YAML
added: v6.3.0
-->
Published after the response headers have been received. This includes a
successful CONNECT or protocol upgrade response.
* `message` {Object}
* `request` {Object} The same object published by
[`'undici:request:create'`][].
* `response` {Object} The response being received.
* `statusCode` {number} The HTTP status code.
* `statusText` {string} The HTTP status message.
* `headers` {Buffer[]|Object} HTTP/1.1 response headers are an array of
buffers alternating between header name and value. HTTP/2 response
headers are an object.
```mjs
import diagnosticsChannel from 'node:diagnostics_channel'
diagnosticsChannel.channel('undici:request:headers').subscribe(({ request, response }) => {
console.log('statusCode', response.statusCode)
console.log(response.statusText)
console.log(response.headers)
})
```
## Event: `'undici:request:bodyChunkReceived'`
<!-- YAML
added: v7.11.0
-->
Published each time a chunk of the response body is received.
* `message` {Object}
* `request` {Object} The same object published by
[`'undici:request:create'`][].
* `chunk` {Buffer} The body chunk that was received.
```mjs
import diagnosticsChannel from 'node:diagnostics_channel'
diagnosticsChannel.channel('undici:request:bodyChunkReceived').subscribe(({ request, chunk }) => {
console.log('received', chunk.length, 'bytes')
})
```
## Event: `'undici:request:trailers'`
<!-- YAML
added: v6.3.0
-->
Published once the response has fully completed. After an upgraded socket has
been passed to the request handler, this event is published with an empty
`trailers` array.
* `message` {Object}
* `request` {Object} The same object published by
[`'undici:request:create'`][]. `request.completed` is now `true`.
* `trailers` {Buffer[]} The raw response trailers as an array of buffers,
alternating between header name and value.
```mjs
import diagnosticsChannel from 'node:diagnostics_channel'
diagnosticsChannel.channel('undici:request:trailers').subscribe(({ request, trailers }) => {
console.log('completed', request.completed)
console.log(trailers.map((x) => x.toString()))
})
```
## Event: `'undici:request:error'`
<!-- YAML
added: v6.3.0
-->
Published when the request is about to error, before the error is surfaced to
the caller.
* `message` {Object}
* `request` {Object} The same object published by
[`'undici:request:create'`][].
* `error` {Error} The error the request is about to fail with.
```mjs
import diagnosticsChannel from 'node:diagnostics_channel'
diagnosticsChannel.channel('undici:request:error').subscribe(({ request, error }) => {
console.error(error)
})
```
## Event: `'undici:client:sendHeaders'`
<!-- YAML
added: v6.3.0
changes:
- version: v7.0.0
pr-url: https://github.com/nodejs/undici/pull/3585
description: Refactor the diagnostics channel internals.
-->
Published immediately before the first byte of the request is written to the
socket. The headers are published exactly as they will be sent to the server, in
raw form.
* `message` {Object}
* `request` {Object} The same object published by
[`'undici:request:create'`][].
* `headers` {string} The request headers as a single raw string, with lines
separated by `\r\n`.
* `socket` {net.Socket} The socket the request is written to.
```mjs
import diagnosticsChannel from 'node:diagnostics_channel'
diagnosticsChannel.channel('undici:client:sendHeaders').subscribe(({ request, headers, socket }) => {
console.log(`Full headers list: ${headers.split('\r\n')}`)
})
```
## Event: `'undici:client:beforeConnect'`
<!-- YAML
added: v6.3.0
changes:
- version: v7.0.0
pr-url: https://github.com/nodejs/undici/pull/3585
description: Refactor the diagnostics channel internals.
-->
Published before a new connection is opened for any request. This event cannot be
attributed to a specific request, because connections are pooled and shared.
* `message` {Object}
* `connectParams` {Object} The parameters used to open the connection.
* `host` {string} The connection host, including the port if present.
* `hostname` {string} The connection hostname.
* `protocol` {string} The protocol, e.g. `'https:'`.
* `port` {string} The connection port.
* `servername` {string|null} The TLS server name, or `null`.
* `connector` {Function} The function that creates the socket.
```mjs
import diagnosticsChannel from 'node:diagnostics_channel'
diagnosticsChannel.channel('undici:client:beforeConnect').subscribe(({ connectParams, connector }) => {
const { host, hostname, protocol, port, servername } = connectParams
// connector is the function that creates the socket
})
```
## Event: `'undici:client:connected'`
<!-- YAML
added: v6.3.0
changes:
- version: v7.0.0
pr-url: https://github.com/nodejs/undici/pull/3585
description: Refactor the diagnostics channel internals.
-->
Published after a connection has been successfully established.
* `message` {Object}
* `socket` {net.Socket} The newly connected socket.
* `connectParams` {Object} The parameters used to open the connection. See
[`'undici:client:beforeConnect'`][] for the field descriptions.
* `connector` {Function} The function that created the socket.
```mjs
import diagnosticsChannel from 'node:diagnostics_channel'
diagnosticsChannel.channel('undici:client:connected').subscribe(({ socket, connectParams, connector }) => {
const { host, hostname, protocol, port, servername } = connectParams
})
```
## Event: `'undici:client:connectError'`
<!-- YAML
added: v6.3.0
changes:
- version: v7.0.0
pr-url: https://github.com/nodejs/undici/pull/3585
description: Refactor the diagnostics channel internals.
-->
Published when a connection could not be established.
* `message` {Object}
* `error` {Error} The error that prevented the connection.
* `socket` {net.Socket} The socket associated with the failed attempt.
* `connectParams` {Object} The parameters used to open the connection. See
[`'undici:client:beforeConnect'`][] for the field descriptions.
* `connector` {Function} The function that created the socket.
```mjs
import diagnosticsChannel from 'node:diagnostics_channel'
diagnosticsChannel.channel('undici:client:connectError').subscribe(({ error, socket, connectParams, connector }) => {
console.error(`Connect failed with ${error.message}`)
})
```
## Event: `'undici:websocket:open'`
<!-- YAML
added: v6.3.0
-->
Published after a [`WebSocket`][] has successfully connected to a server.
* `message` {Object}
* `address` {Object|null} The remote socket address, as returned by
[`socket.address()`][], or `null` if it cannot be determined. When present,
it contains `address`, `family`, and `port`.
* `protocol` {string} The negotiated subprotocol.
* `extensions` {string} The negotiated extensions.
* `websocket` {WebSocket} The `WebSocket` instance.
* `handshakeResponse` {Object} The HTTP response that upgraded the connection.
* `status` {number} The HTTP status code: `101` for an HTTP/1.1 upgrade, or
`200` for an HTTP/2 extended `CONNECT`.
* `statusText` {string} The HTTP status message: `'Switching Protocols'` for
HTTP/1.1, and commonly `'OK'` for HTTP/2.
* `headers` {Object} The response headers from the server. The `upgrade` and
`connection` headers are only present for HTTP/1.1 handshakes.
```mjs
import diagnosticsChannel from 'node:diagnostics_channel'
diagnosticsChannel.channel('undici:websocket:open').subscribe(({
address,
protocol,
extensions,
websocket,
handshakeResponse
}) => {
console.log(address)
console.log(protocol)
console.log(extensions)
console.log(handshakeResponse.status)
console.log(handshakeResponse.headers)
})
```
## Event: `'undici:websocket:close'`
<!-- YAML
added: v6.3.0
-->
Published after the [`WebSocket`][] connection has closed.
* `message` {Object}
* `websocket` {WebSocket} The `WebSocket` instance.
* `code` {number} The closing status code.
* `reason` {string} The closing reason.
```mjs
import diagnosticsChannel from 'node:diagnostics_channel'
diagnosticsChannel.channel('undici:websocket:close').subscribe(({ websocket, code, reason }) => {
console.log(code, reason)
})
```
## Event: `'undici:websocket:socket_error'`
<!-- YAML
added: v6.3.0
-->
Published when the underlying WebSocket socket experiences an error. Unlike the
other WebSocket channels, the published message is the error itself.
* `error` {Error} The socket error.
```mjs
import diagnosticsChannel from 'node:diagnostics_channel'
diagnosticsChannel.channel('undici:websocket:socket_error').subscribe((error) => {
console.error(error)
})
```
## Event: `'undici:websocket:ping'`
<!-- YAML
added: v6.3.0
-->
Published after the client receives a ping frame.
* `message` {Object}
* `payload` {Buffer|undefined} The optional application data carried by the
frame.
* `websocket` {WebSocket} The `WebSocket` instance.
```mjs
import diagnosticsChannel from 'node:diagnostics_channel'
diagnosticsChannel.channel('undici:websocket:ping').subscribe(({ payload, websocket }) => {
console.log(payload)
})
```
## Event: `'undici:websocket:pong'`
<!-- YAML
added: v6.3.0
-->
Published after the client receives a pong frame.
* `message` {Object}
* `payload` {Buffer|undefined} The optional application data carried by the
frame.
* `websocket` {WebSocket} The `WebSocket` instance.
```mjs
import diagnosticsChannel from 'node:diagnostics_channel'
diagnosticsChannel.channel('undici:websocket:pong').subscribe(({ payload, websocket }) => {
console.log(payload)
})
```
## Event: `'undici:proxy:connected'`
<!-- YAML
added: v7.17.0
-->
Published after a [`ProxyAgent`][] has established a tunnel to the proxy server.
* `message` {Object}
* `socket` {net.Socket} The socket connected to the proxy.
* `connectParams` {Object} The parameters used to establish the tunnel.
* `origin` {string|URL} The proxy origin.
* `port` {string} The proxy port.
* `path` {string} The requested tunnel target, e.g. `'example.com:443'`.
* `signal` {AbortSignal|undefined} The signal associated with the request.
* `headers` {Object} The headers sent in the `CONNECT` request.
* `servername` {string|undefined} The TLS server name used for the proxy.
```mjs
import diagnosticsChannel from 'node:diagnostics_channel'
diagnosticsChannel.channel('undici:proxy:connected').subscribe(({ socket, connectParams }) => {
const { origin, port, path, signal, headers, servername } = connectParams
})
```
## Event: `'undici:request:pending-requests'`
<!-- YAML
added: v6.3.0
-->
Published when the [`dedupe`][] interceptor's set of pending requests changes.
The interceptor coalesces concurrent identical requests so that only one reaches
the origin; this channel exposes that bookkeeping for monitoring and debugging.
* `message` {Object}
* `type` {string} Either `'added'` when a new pending request is registered, or
`'removed'` when a pending request completes, whether successfully or with an
error.
* `size` {number} The number of pending requests after the change.
* `key` {string} The deduplication key for the request, composed of the origin,
method, path, and request headers.
```mjs
import diagnosticsChannel from 'node:diagnostics_channel'
diagnosticsChannel.channel('undici:request:pending-requests').subscribe(({ type, size, key }) => {
if (type === 'added') {
console.log(`New pending request: ${key} (${size} total pending)`)
} else {
console.log(`Request completed: ${key} (${size} remaining)`)
}
})
```
This is useful for verifying that deduplication is working, monitoring the number
of concurrent in-flight requests, and debugging deduplication behaviour in
production.
[`'undici:client:beforeConnect'`]: #event-undiciclientbeforeconnect
[`'undici:request:create'`]: #event-undicirequestcreate
[`'undici:request:headers'`]: #event-undicirequestheaders
[`ProxyAgent`]: ProxyAgent.md#class-proxyagent
[`WebSocket`]: WebSocket.md#class-websocket
[`dedupe`]: Dispatcher.md#dedupe
[`diagnostics_channel`]: https://nodejs.org/api/diagnostics_channel.html
[`socket.address()`]: https://nodejs.org/api/net.html#socketaddress
[Debug]: Debug.md
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/domutils/0ab8bcf1ecfc70dfc93291a4cb2496578ac25e9c/src/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,gEAAgE;AAChE,OAAO,EACH,KAAK,EACL,OAAO,EACP,MAAM,EACN,SAAS,EACT,UAAU,EACV,WAAW,GACd,MAAM,YAAY,CAAC"}
@@ -0,0 +1,372 @@
flf2a$ 1 1 11 -1 11 0
binary.flf (C) 1994 by Victor Parada (vparada@inf.utfsm.cl) 94/12/05
figlet 2.1 font, includes ISO Latin-1, excludes "-D" option chars.
Spaces are not shown as binary. If this is required, change "$@" below
to "00100000 @". Change to "@" to remove the hardspace between words.
Note that figlet always removes spaces when it moves words to a new line.
Try option "-m 0" to remove the space between letters (octets).
$@
00100001 @
00100010 @
00100011 @
00100100 @
00100101 @
00100110 @
00100111 @
00101000 @
00101001 @
00101010 @
00101011 @
00101100 @
00101101 @
00101110 @
00101111 @
00110000 @
00110001 @
00110010 @
00110011 @
00110100 @
00110101 @
00110110 @
00110111 @
00111000 @
00111001 @
00111010 @
00111011 @
00111100 @
00111101 @
00111110 @
00111111 @
01000000 @
01000001 @
01000010 @
01000011 @
01000100 @
01000101 @
01000110 @
01000111 @
01001000 @
01001001 @
01001010 @
01001011 @
01001100 @
01001101 @
01001110 @
01001111 @
01010000 @
01010001 @
01010010 @
01010011 @
01010100 @
01010101 @
01010110 @
01010111 @
01011000 @
01011001 @
01011010 @
01011011 @
01011100 @
01011101 @
01011110 @
01011111 @
01100000 @
01100001 @
01100010 @
01100011 @
01100100 @
01100101 @
01100110 @
01100111 @
01101000 @
01101001 @
01101010 @
01101011 @
01101100 @
01101101 @
01101110 @
01101111 @
01110000 @
01110001 @
01110010 @
01110011 @
01110100 @
01110101 @
01110110 @
01110111 @
01111000 @
01111001 @
01111010 @
01111011 @
01111100 @
01111101 @
01111110 @
@
@
@
@
@
@
@
127
01111111 @
128
10000000 @
129
10000001 @
130
10000010 @
131
10000011 @
132
10000100 @
133
10000101 @
134
10000110 @
135
10000111 @
136
10001000 @
137
10001001 @
138
10001010 @
139
10001011 @
140
10001100 @
141
10001101 @
142
10001110 @
143
10001111 @
144
10010000 @
145
10010001 @
146
10010010 @
147
10010011 @
148
10010100 @
149
10010101 @
150
10010110 @
151
10010111 @
152
10011000 @
153
10011001 @
154
10011010 @
155
10011011 @
156
10011100 @
157
10011101 @
158
10011110 @
159
10011111 @
160
10100000 @
161
10100001 @
162
10100010 @
163
10100011 @
164
10100100 @
165
10100101 @
166
10100110 @
167
10100111 @
168
10101000 @
169
10101001 @
170
10101010 @
171
10101011 @
172
10101100 @
173
10101101 @
174
10101110 @
175
10101111 @
176
10110000 @
177
10110001 @
178
10110010 @
179
10110011 @
180
10110100 @
181
10110101 @
182
10110110 @
183
10110111 @
184
10111000 @
185
10111001 @
186
10111010 @
187
10111011 @
188
10111100 @
189
10111101 @
190
10111110 @
191
10111111 @
192
11000000 @
193
11000001 @
194
11000010 @
195
11000011 @
196
11000100 @
197
11000101 @
198
11000110 @
199
11000111 @
200
11001000 @
201
11001001 @
202
11001010 @
203
11001011 @
204
11001100 @
205
11001101 @
206
11001110 @
207
11001111 @
208
11010000 @
209
11010001 @
210
11010010 @
211
11010011 @
212
11010100 @
213
11010101 @
214
11010110 @
215
11010111 @
216
11011000 @
217
11011001 @
218
11011010 @
219
11011011 @
220
11011100 @
221
11011101 @
222
11011110 @
223
11011111 @
224
11100000 @
225
11100001 @
226
11100010 @
227
11100011 @
228
11100100 @
229
11100101 @
230
11100110 @
231
11100111 @
232
11101000 @
233
11101001 @
234
11101010 @
235
11101011 @
236
11101100 @
237
11101101 @
238
11101110 @
239
11101111 @
240
11110000 @
241
11110001 @
242
11110010 @
243
11110011 @
244
11110100 @
245
11110101 @
246
11110110 @
247
11110111 @
248
11111000 @
249
11111001 @
250
11111010 @
251
11111011 @
252
11111100 @
253
11111101 @
254
11111110 @
255
11111111 @
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACH,SAAS,EACT,OAAO,EACP,QAAQ,EAIR,QAAQ,EAER,UAAU,EACb,MAAM,WAAW,CAAC;AAEnB,cAAc,WAAW,CAAC;AAE1B,MAAM,WAAW,iBAAiB;IAC9B;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AASD,UAAU,eAAe;IACrB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,aAAK,QAAQ,GAAG,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,IAAI,CAAC;AAChE,aAAK,eAAe,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AAElD,qBAAa,UAAU;IACnB,8BAA8B;IACvB,GAAG,EAAE,SAAS,EAAE,CAAM;IAE7B,mCAAmC;IAC5B,IAAI,WAA0B;IAErC,yCAAyC;IACzC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkB;IAE3C,gCAAgC;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;IAE5C,yCAAyC;IACzC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyB;IAEnD,oDAAoD;IACpD,OAAO,CAAC,IAAI,CAAS;IAErB,0BAA0B;IAC1B,SAAS,CAAC,QAAQ,EAAE,UAAU,EAAE,CAAe;IAE/C,kDAAkD;IAClD,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAQ;IAE3C,uEAAuE;IACvE,OAAO,CAAC,MAAM,CAAgC;IAE9C;;;;OAIG;gBAEC,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,EAC1B,OAAO,CAAC,EAAE,iBAAiB,GAAG,IAAI,EAClC,SAAS,CAAC,EAAE,eAAe;IAiBxB,YAAY,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI;IAK3C,OAAO,IAAI,IAAI;IAUf,KAAK,IAAI,IAAI;IAOb,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAI3B,UAAU,IAAI,IAAI;IAYlB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI;IAOjE,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAe1B,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAW7B,YAAY,IAAI,IAAI;IAIpB,YAAY,IAAI,IAAI;IAUpB,UAAU,IAAI,IAAI;IAIlB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAKhE,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI;IAQnD,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI;CAwB3C;AAED,eAAe,UAAU,CAAC"}
@@ -0,0 +1 @@
"use strict";var b=Object.defineProperty;var p=(s,l)=>b(s,"name",{value:l,configurable:!0});let t=!0;const n=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let r=0;if(n.process&&n.process.env&&n.process.stdout){const{FORCE_COLOR:s,NODE_DISABLE_COLORS:l,NO_COLOR:c,TERM:o,COLORTERM:i}=n.process.env;l||c||s==="0"?t=!1:s==="1"||s==="2"||s==="3"?t=!0:o==="dumb"?t=!1:"CI"in n.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(g=>g in n.process.env)?t=!0:t=process.stdout.isTTY,t&&(process.platform==="win32"||i&&(i==="truecolor"||i==="24bit")?r=3:o&&(o.endsWith("-256color")||o.endsWith("256"))?r=2:r=1)}let a={enabled:t,supportLevel:r};function e(s,l,c=1){const o=`\x1B[${s}m`,i=`\x1B[${l}m`,g=new RegExp(`\\x1b\\[${l}m`,"g");return f=>a.enabled&&a.supportLevel>=c?o+(""+f).replace(g,o)+i:""+f}p(e,"kolorist");const u=e(30,39),d=e(33,39),O=e(90,39),C=e(92,39),L=e(95,39),R=e(96,39),y=e(44,49),I=e(100,49),h=e(103,49);exports.bgBlue=y,exports.bgGray=I,exports.bgLightYellow=h,exports.black=u,exports.gray=O,exports.lightCyan=R,exports.lightGreen=C,exports.lightMagenta=L,exports.options=a,exports.yellow=d;
@@ -0,0 +1 @@
{"version":3,"file":"create-projection-node.mjs","sources":["../../../../src/projection/node/create-projection-node.ts"],"sourcesContent":["import {\n Axis,\n AxisDelta,\n Box,\n clamp,\n Delta,\n noop,\n Point,\n SubscriptionManager,\n} from \"motion-utils\"\nimport { animateSingleValue } from \"../../animation/animate/single-value\"\nimport { JSAnimation } from \"../../animation/JSAnimation\"\nimport { getOptimisedAppearId } from \"../../animation/optimized-appear/get-appear-id\"\nimport { Transition, ValueAnimationOptions } from \"../../animation/types\"\nimport { getValueTransition } from \"../../animation/utils/get-value-transition\"\nimport { cancelFrame, frame, frameData, frameSteps } from \"../../frameloop\"\nimport { microtask } from \"../../frameloop/microtask\"\nimport { time } from \"../../frameloop/sync-time\"\nimport type { Process } from \"../../frameloop/types\"\nimport { HTMLVisualElement } from \"../../render/html/HTMLVisualElement\"\nimport type { ResolvedValues } from \"../../render/types\"\nimport { scaleCorrectors } from \"../../render/utils/is-forced-motion-value\"\nimport type { MotionStyle, VisualElement } from \"../../render/VisualElement\"\nimport { activeAnimations } from \"../../stats/animation-count\"\nimport { statsBuffer } from \"../../stats/buffer\"\nimport { delay } from \"../../utils/delay\"\nimport { isSVGElement } from \"../../utils/is-svg-element\"\nimport { isSVGSVGElement } from \"../../utils/is-svg-svg-element\"\nimport { mixNumber } from \"../../utils/mix/number\"\nimport { MotionValue, motionValue } from \"../../value\"\nimport { resolveMotionValue } from \"../../value/utils/resolve-motion-value\"\nimport { mixValues } from \"../animation/mix-values\"\nimport { copyAxisDeltaInto, copyAxisInto, copyBoxInto } from \"../geometry/copy\"\nimport {\n applyBoxDelta,\n applyTreeDeltas,\n transformBox,\n translateAxis,\n} from \"../geometry/delta-apply\"\nimport {\n calcBoxDelta,\n calcLength,\n calcRelativeBox,\n calcRelativePosition,\n isNear,\n} from \"../geometry/delta-calc\"\nimport { removeBoxTransforms } from \"../geometry/delta-remove\"\nimport { createBox, createDelta } from \"../geometry/models\"\nimport {\n aspectRatio,\n axisDeltaEquals,\n boxEquals,\n boxEqualsRounded,\n isDeltaZero,\n} from \"../geometry/utils\"\nimport { NodeStack } from \"../shared/stack\"\nimport { buildProjectionTransform } from \"../styles/transform\"\nimport { eachAxis } from \"../utils/each-axis\"\nimport { FlatTree } from \"../utils/flat-tree\"\nimport { has2DTranslate, hasScale, hasTransform } from \"../utils/has-transform\"\nimport { globalProjectionState } from \"./state\"\nimport {\n IProjectionNode,\n LayoutEvents,\n LayoutUpdateData,\n Measurements,\n Phase,\n ProjectionNodeConfig,\n ProjectionNodeOptions,\n ScrollMeasurements,\n} from \"./types\"\n\nconst metrics = {\n nodes: 0,\n calculatedTargetDeltas: 0,\n calculatedProjections: 0,\n}\n\nconst transformAxes = [\"\", \"X\", \"Y\", \"Z\"]\n\n/**\n * We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1\n * which has a noticeable difference in spring animations\n */\nconst animationTarget = 1000\n\nlet id = 0\n\nfunction resetDistortingTransform(\n key: string,\n visualElement: VisualElement,\n values: ResolvedValues,\n sharedAnimationValues?: ResolvedValues\n) {\n const { latestValues } = visualElement\n\n // Record the distorting transform and then temporarily set it to 0\n if (latestValues[key]) {\n values[key] = latestValues[key]\n visualElement.setStaticValue(key, 0)\n if (sharedAnimationValues) {\n sharedAnimationValues[key] = 0\n }\n }\n}\n\nfunction cancelTreeOptimisedTransformAnimations(\n projectionNode: IProjectionNode\n) {\n projectionNode.hasCheckedOptimisedAppear = true\n if (projectionNode.root === projectionNode) return\n\n const { visualElement } = projectionNode.options\n\n if (!visualElement) return\n\n const appearId = getOptimisedAppearId(visualElement)\n\n if (window.MotionHasOptimisedAnimation!(appearId, \"transform\")) {\n const { layout, layoutId } = projectionNode.options\n window.MotionCancelOptimisedAnimation!(\n appearId,\n \"transform\",\n frame,\n !(layout || layoutId)\n )\n }\n\n const { parent } = projectionNode\n if (parent && !parent.hasCheckedOptimisedAppear) {\n cancelTreeOptimisedTransformAnimations(parent)\n }\n}\n\nexport function createProjectionNode<I>({\n attachResizeListener,\n defaultParent,\n measureScroll,\n checkIsScrollRoot,\n resetTransform,\n}: ProjectionNodeConfig<I>) {\n return class ProjectionNode implements IProjectionNode<I> {\n /**\n * A unique ID generated for every projection node.\n */\n id: number = id++\n\n /**\n * An idLine truncated
@@ -0,0 +1,56 @@
[
["a140","",62],
["a180","",32],
["a240","",62],
["a280","",32],
["a2ab","",5],
["a2e3","€"],
["a2ef",""],
["a2fd",""],
["a340","",62],
["a380","",31," "],
["a440","",62],
["a480","",32],
["a4f4","",10],
["a540","",62],
["a580","",32],
["a5f7","",7],
["a640","",62],
["a680","",32],
["a6b9","",7],
["a6d9","",6],
["a6ec",""],
["a6f3",""],
["a6f6","",8],
["a740","",62],
["a780","",32],
["a7c2","",14],
["a7f2","",12],
["a896","",10],
["a8bc","ḿ"],
["a8bf","ǹ"],
["a8c1",""],
["a8ea","",20],
["a958",""],
["a95b",""],
["a95d",""],
["a989","〾⿰",11],
["a997","",12],
["a9f0","",14],
["aaa1","",93],
["aba1","",93],
["aca1","",93],
["ada1","",93],
["aea1","",93],
["afa1","",93],
["d7fa","",4],
["f8a1","",93],
["f9a1","",93],
["faa1","",93],
["fba1","",93],
["fca1","",93],
["fda1","",93],
["fe50","⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌"],
["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",6,"䶮",93],
["8135f437",""]
]
@@ -0,0 +1,7 @@
declare function findNearestPackageData(basedir: string): {
type?: "module" | "commonjs";
};
declare function getCachedData<T>(cache: Map<string, T>, basedir: string, originalBasedir: string): NonNullable<T> | undefined;
declare function setCacheData<T>(cache: Map<string, T>, data: T, basedir: string, originalBasedir: string): void;
export { findNearestPackageData, getCachedData, setCacheData };
@@ -0,0 +1,91 @@
import { useMatch } from './useMatch'
import type {
StructuralSharingOption,
ValidateSelected,
} from './structuralSharing'
import type {
AnyRouter,
RegisteredRouter,
ResolveUseLoaderData,
StrictOrFrom,
UseLoaderDataResult,
} from '@tanstack/router-core'
export interface UseLoaderDataBaseOptions<
TRouter extends AnyRouter,
TFrom,
TStrict extends boolean,
TSelected,
TStructuralSharing,
> {
select?: (
match: ResolveUseLoaderData<TRouter, TFrom, TStrict>,
) => ValidateSelected<TRouter, TSelected, TStructuralSharing>
}
export type UseLoaderDataOptions<
TRouter extends AnyRouter,
TFrom extends string | undefined,
TStrict extends boolean,
TSelected,
TStructuralSharing,
> = StrictOrFrom<TRouter, TFrom, TStrict> &
UseLoaderDataBaseOptions<
TRouter,
TFrom,
TStrict,
TSelected,
TStructuralSharing
> &
StructuralSharingOption<TRouter, TSelected, TStructuralSharing>
export type UseLoaderDataRoute<out TId> = <
TRouter extends AnyRouter = RegisteredRouter,
TSelected = unknown,
TStructuralSharing extends boolean = boolean,
>(
opts?: UseLoaderDataBaseOptions<
TRouter,
TId,
true,
TSelected,
TStructuralSharing
> &
StructuralSharingOption<TRouter, TSelected, TStructuralSharing>,
) => UseLoaderDataResult<TRouter, TId, true, TSelected>
/**
* Read and select the current route's loader data with type‑safety.
*
* Options:
* - `from`/`strict`: Choose which route's data to read and strictness
* - `select`: Map the loader data to a derived value
* - `structuralSharing`: Enable structural sharing for stable references
*
* @returns The loader data (or selected value) for the matched route.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLoaderDataHook
*/
export function useLoaderData<
TRouter extends AnyRouter = RegisteredRouter,
const TFrom extends string | undefined = undefined,
TStrict extends boolean = true,
TSelected = unknown,
TStructuralSharing extends boolean = boolean,
>(
opts: UseLoaderDataOptions<
TRouter,
TFrom,
TStrict,
TSelected,
TStructuralSharing
>,
): UseLoaderDataResult<TRouter, TFrom, TStrict, TSelected> {
return useMatch({
from: opts.from!,
strict: opts.strict,
structuralSharing: opts.structuralSharing,
select: (s: any) => {
return opts.select ? opts.select(s.loaderData) : s.loaderData
},
} as any) as UseLoaderDataResult<TRouter, TFrom, TStrict, TSelected>
}
@@ -0,0 +1 @@
{"version":3,"names":["_unsupportedIterableToArray","require","_createForOfIteratorHelperLoose","o","allowArrayLike","it","Symbol","iterator","call","next","bind","Array","isArray","unsupportedIterableToArray","length","i","done","value","TypeError"],"sources":["../../src/helpers/createForOfIteratorHelperLoose.ts"],"sourcesContent":["/* @minVersion 7.9.0 */\n\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.ts\";\n\nimport type { IteratorFunction } from \"./createForOfIteratorHelper.ts\";\n\nexport default function _createForOfIteratorHelperLoose<T>(\n o: T[] | Iterable<T> | ArrayLike<T>,\n allowArrayLike: boolean,\n): () => IteratorResult<T, undefined> {\n var it:\n | IteratorFunction<T>\n | Iterator<T>\n | T[]\n | IteratorResult<T, undefined>\n | undefined =\n (typeof Symbol !== \"undefined\" && (o as Iterable<T>)[Symbol.iterator]) ||\n (o as any)[\"@@iterator\"];\n\n if (it) return (it = (it as IteratorFunction<T>).call(o)).next.bind(it);\n\n // Fallback for engines without symbol support\n if (\n Array.isArray(o) ||\n // union type doesn't work with function overload, have to use \"as any\".\n (it = unsupportedIterableToArray(o as any) as T[] | undefined) ||\n (allowArrayLike && o && typeof (o as ArrayLike<T>).length === \"number\")\n ) {\n if (it) o = it;\n var i = 0;\n return function () {\n // After \"Array.isArray\" check, unsupportedIterableToArray to array, and allow arraylike\n // o is sure to be an array or arraylike, but TypeScript doesn't know that\n if (i >= (o as T[] | ArrayLike<T>).length) {\n // explicit missing the \"value\" (undefined) to reduce the bundle size\n return { done: true } as IteratorReturnResult<undefined>;\n }\n\n return { done: false, value: (o as T[] | ArrayLike<T>)[i++] };\n };\n }\n\n throw new TypeError(\n \"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\",\n );\n}\n"],"mappings":";;;;;;AAEA,IAAAA,2BAAA,GAAAC,OAAA;AAIe,SAASC,+BAA+BA,CACrDC,CAAmC,EACnCC,cAAuB,EACa;EACpC,IAAIC,EAKS,GACV,OAAOC,MAAM,KAAK,WAAW,IAAKH,CAAC,CAAiBG,MAAM,CAACC,QAAQ,CAAC,IACpEJ,CAAC,CAAS,YAAY,CAAC;EAE1B,IAAIE,EAAE,EAAE,OAAO,CAACA,EAAE,GAAIA,EAAE,CAAyBG,IAAI,CAACL,CAAC,CAAC,EAAEM,IAAI,CAACC,IAAI,CAACL,EAAE,CAAC;EAGvE,IACEM,KAAK,CAACC,OAAO,CAACT,CAAC,CAAC,KAEfE,EAAE,GAAG,IAAAQ,mCAA0B,EAACV,CAAQ,CAAoB,CAAC,IAC7DC,cAAc,IAAID,CAAC,IAAI,OAAQA,CAAC,CAAkBW,MAAM,KAAK,QAAS,EACvE;IACA,IAAIT,EAAE,EAAEF,CAAC,GAAGE,EAAE;IACd,IAAIU,CAAC,GAAG,CAAC;IACT,OAAO,YAAY;MAGjB,IAAIA,CAAC,IAAKZ,CAAC,CAAwBW,MAAM,EAAE;QAEzC,OAAO;UAAEE,IAAI,EAAE;QAAK,CAAC;MACvB;MAEA,OAAO;QAAEA,IAAI,EAAE,KAAK;QAAEC,KAAK,EAAGd,CAAC,CAAwBY,CAAC,EAAE;MAAE,CAAC;IAC/D,CAAC;EACH;EAEA,MAAM,IAAIG,SAAS,CACjB,uIACF,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,114 @@
{
"name": "gridstack",
"version": "12.6.0",
"license": "MIT",
"author": "Alain Dumesny <alaind831+github@gmail.com> (https://github.com/adumesny)",
"contributors": [
"Pavel Reznikov <pashka.reznikov@gmail.com>",
"Dylan Weiss <dylan.weiss@gmail.com> (https://dylandreams.com)"
],
"description": "TypeScript/JS lib for dashboard layout and creation, responsive, mobile support, no external dependencies, with many wrappers (React, Angular, Vue, Ember, knockout...)",
"main": "./dist/gridstack.js",
"types": "./dist/gridstack.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/gridstack/gridstack.js.git"
},
"funding": [
{
"type": "paypal",
"url": "https://www.paypal.me/alaind831"
},
{
"type": "venmo",
"url": "https://www.venmo.com/adumesny"
}
],
"scripts": {
"build": "yarn build:ng && grunt && webpack && tsc --project tsconfig.build.json --stripInternal && yarn doc",
"build:ng": "cd angular && yarn build lib",
"w": "webpack",
"t": "rm -rf dist/* && grunt && tsc --project tsconfig.build.json --stripInternal",
"doc": "doctoc ./README.md && doctoc ./doc/CHANGES.md && node scripts/generate-docs.js",
"doc:main": "node scripts/generate-docs.js --main-only",
"doc:angular": "node scripts/generate-docs.js --angular-only",
"test": "yarn lint && vitest run",
"test:watch": "vitest",
"test:ui": "vitest --ui",
"test:coverage": "vitest run --coverage",
"test:coverage:ui": "vitest --ui --coverage.enabled=true",
"test:coverage:detailed": "vitest run --config .vitestrc.coverage.ts",
"test:coverage:html": "vitest run --coverage && open coverage/index.html",
"test:coverage:lcov": "vitest run --coverage --coverage.reporter=lcov",
"test:ci": "vitest run --coverage --reporter=verbose --reporter=junit --outputFile.junit=./coverage/junit-report.xml",
"test:e2e": "playwright test",
"test:e2e:ui": "playwright test --ui",
"test:e2e:headed": "playwright test --headed",
"lint": "tsc --project tsconfig.build.json --noEmit && eslint src/*.ts angular/projects/lib/src/**/*.ts",
"reset": "rm -rf dist node_modules",
"prepublishOnly": "yarn build"
},
"keywords": [
"Typescript",
"gridstack.js",
"grid",
"gridster",
"layout",
"responsive",
"dashboard",
"resize",
"drag&drop",
"widgets",
"Angular",
"React",
"Vue",
"JavaScript"
],
"bugs": {
"url": "https://github.com/gridstack/gridstack.js/issues"
},
"homepage": "http://gridstackjs.com/",
"dependencies": {},
"devDependencies": {
"@playwright/test": "^1.48.2",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.4.8",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"@vitest/coverage-v8": "^2.0.5",
"@vitest/ui": "^2.0.5",
"connect": "^3.7.0",
"core-js": "^3.30.1",
"coveralls": "^3.1.1",
"doctoc": "^2.2.1",
"eslint": "^8.38.0",
"grunt": "^1.6.1",
"grunt-cli": "^1.3.2",
"grunt-contrib-connect": "^3.0.0",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-cssmin": "^4.0.0",
"grunt-contrib-uglify": "^5.2.2",
"grunt-contrib-watch": "^1.1.0",
"grunt-eslint": "^24.0.1",
"grunt-protractor-runner": "^5.0.0",
"grunt-protractor-webdriver": "^0.2.5",
"grunt-sass": "3.1.0",
"happy-dom": "^20.0.0",
"jsdom": "^25.0.0",
"protractor": "^7.0.0",
"sass": "^1.62.0",
"serve-static": "^1.15.0",
"ts-loader": "^9.4.2",
"typedoc": "^0.28.9",
"typedoc-plugin-markdown": "^4.8.0",
"typescript": "^5.0.4",
"vitest": "^2.0.5",
"webpack": "^5.79.0",
"webpack-cli": "^5.0.1"
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
"files": [
"dist",
"doc/API.md"
]
}
@@ -0,0 +1 @@
{"version":3,"file":"square-dashed-kanban.js","sources":["../../../src/icons/square-dashed-kanban.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SquareDashedKanban\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOCA3djciIC8+CiAgPHBhdGggZD0iTTEyIDd2NCIgLz4KICA8cGF0aCBkPSJNMTYgN3Y5IiAvPgogIDxwYXRoIGQ9Ik01IDNhMiAyIDAgMCAwLTIgMiIgLz4KICA8cGF0aCBkPSJNOSAzaDEiIC8+CiAgPHBhdGggZD0iTTE0IDNoMSIgLz4KICA8cGF0aCBkPSJNMTkgM2EyIDIgMCAwIDEgMiAyIiAvPgogIDxwYXRoIGQ9Ik0yMSA5djEiIC8+CiAgPHBhdGggZD0iTTIxIDE0djEiIC8+CiAgPHBhdGggZD0iTTIxIDE5YTIgMiAwIDAgMS0yIDIiIC8+CiAgPHBhdGggZD0iTTE0IDIxaDEiIC8+CiAgPHBhdGggZD0iTTkgMjFoMSIgLz4KICA8cGF0aCBkPSJNNSAyMWEyIDIgMCAwIDEtMi0yIiAvPgogIDxwYXRoIGQ9Ik0zIDE0djEiIC8+CiAgPHBhdGggZD0iTTMgOXYxIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/square-dashed-kanban\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst SquareDashedKanban = createLucideIcon('SquareDashedKanban', [\n ['path', { d: 'M8 7v7', key: '1x2jlm' }],\n ['path', { d: 'M12 7v4', key: 'xawao1' }],\n ['path', { d: 'M16 7v9', key: '1hp2iy' }],\n ['path', { d: 'M5 3a2 2 0 0 0-2 2', key: 'y57alp' }],\n ['path', { d: 'M9 3h1', key: '1yesri' }],\n ['path', { d: 'M14 3h1', key: '1ec4yj' }],\n ['path', { d: 'M19 3a2 2 0 0 1 2 2', key: '18rm91' }],\n ['path', { d: 'M21 9v1', key: 'mxsmne' }],\n ['path', { d: 'M21 14v1', key: '169vum' }],\n ['path', { d: 'M21 19a2 2 0 0 1-2 2', key: '1j7049' }],\n ['path', { d: 'M14 21h1', key: 'v9vybs' }],\n ['path', { d: 'M9 21h1', key: '15o7lz' }],\n ['path', { d: 'M5 21a2 2 0 0 1-2-2', key: 'sbafld' }],\n ['path', { d: 'M3 14v1', key: 'vnatye' }],\n ['path', { d: 'M3 9v1', key: '1r0deq' }],\n]);\n\nexport default SquareDashedKanban;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqB,iBAAiB,oBAAsB,CAAA,CAAA,CAAA;AAAA,CAAA,CAChE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAsB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACnD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAuB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAwB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACrD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAuB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CLine truncated
@@ -0,0 +1 @@
{"version":3,"file":"tree-deciduous.js","sources":["../../../src/icons/tree-deciduous.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name TreeDeciduous\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOCAxOWE0IDQgMCAwIDEtMi4yNC03LjMyQTMuNSAzLjUgMCAwIDEgOSA2LjAzVjZhMyAzIDAgMSAxIDYgMHYuMDRhMy41IDMuNSAwIDAgMSAzLjI0IDUuNjVBNCA0IDAgMCAxIDE2IDE5WiIgLz4KICA8cGF0aCBkPSJNMTIgMTl2MyIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/tree-deciduous\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst TreeDeciduous = createLucideIcon('TreeDeciduous', [\n [\n 'path',\n {\n d: 'M8 19a4 4 0 0 1-2.24-7.32A3.5 3.5 0 0 1 9 6.03V6a3 3 0 1 1 6 0v.04a3.5 3.5 0 0 1 3.24 5.65A4 4 0 0 1 16 19Z',\n key: 'oadzkq',\n },\n ],\n ['path', { d: 'M12 19v3', key: 'npa21l' }],\n]);\n\nexport default TreeDeciduous;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,iBAAiB,eAAiB,CAAA,CAAA,CAAA;AAAA,CACtD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,51 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
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 });
exports.z = void 0;
const z = __importStar(require("../v4/mini/external.cjs"));
exports.z = z;
__exportStar(require("../v4/mini/external.cjs"), exports);
// seal-cjs-exports
(function () {
var keys = Object.getOwnPropertyNames(exports);
for (var i = 0; i < keys.length; i++) {
var desc = Object.getOwnPropertyDescriptor(exports, keys[i]);
if (!desc || !desc.get || !desc.configurable) continue;
var value;
try {
value = desc.get();
} catch (e) {
continue;
}
// a circular require may not have settled this one yet, so leave it live
if (value === undefined) continue;
Object.defineProperty(exports, keys[i], { value: value, writable: false, enumerable: desc.enumerable, configurable: false });
}
Object.freeze(exports);
})();
@@ -0,0 +1,6 @@
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
function getDefaultExportFromCjs(x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
}
export { commonjsGlobal as c, getDefaultExportFromCjs as g };
@@ -0,0 +1,94 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getFirstSemanticOrSyntacticError = getFirstSemanticOrSyntacticError;
const typescript_1 = require("typescript");
/**
* By default, diagnostics from the TypeScript compiler contain all errors - regardless of whether
* they are related to generic ECMAScript standards, or TypeScript-specific constructs.
*
* Therefore, we filter out all diagnostics, except for the ones we explicitly want to consider when
* the user opts in to throwing errors on semantic issues.
*/
function getFirstSemanticOrSyntacticError(program, ast) {
try {
const supportedSyntacticDiagnostics = allowlistSupportedDiagnostics(program.getSyntacticDiagnostics(ast));
if (supportedSyntacticDiagnostics.length > 0) {
return convertDiagnosticToSemanticOrSyntacticError(supportedSyntacticDiagnostics[0]);
}
const supportedSemanticDiagnostics = allowlistSupportedDiagnostics(program.getSemanticDiagnostics(ast));
if (supportedSemanticDiagnostics.length > 0) {
return convertDiagnosticToSemanticOrSyntacticError(supportedSemanticDiagnostics[0]);
}
return undefined;
}
catch (e) {
/**
* TypeScript compiler has certain Debug.fail() statements in, which will cause the diagnostics
* retrieval above to throw.
*
* E.g. from ast-alignment-tests
* "Debug Failure. Shouldn't ever directly check a JsxOpeningElement"
*
* For our current use-cases this is undesired behavior, so we just suppress it
* and log a warning.
*/
/* istanbul ignore next */
console.warn(`Warning From TSC: "${e.message}`); // eslint-disable-line no-console
/* istanbul ignore next */
return undefined;
}
}
function allowlistSupportedDiagnostics(diagnostics) {
return diagnostics.filter(diagnostic => {
switch (diagnostic.code) {
case 1013: // "A rest parameter or binding pattern may not have a trailing comma."
case 1014: // "A rest parameter must be last in a parameter list."
case 1044: // "'{0}' modifier cannot appear on a module or namespace element."
case 1045: // "A '{0}' modifier cannot be used with an interface declaration."
case 1048: // "A rest parameter cannot have an initializer."
case 1049: // "A 'set' accessor must have exactly one parameter."
case 1070: // "'{0}' modifier cannot appear on a type member."
case 1071: // "'{0}' modifier cannot appear on an index signature."
case 1085: // "Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '{0}'."
case 1090: // "'{0}' modifier cannot appear on a parameter."
case 1096: // "An index signature must have exactly one parameter."
case 1097: // "'{0}' list cannot be empty."
case 1098: // "Type parameter list cannot be empty."
case 1099: // "Type argument list cannot be empty."
case 1117: // "An object literal cannot have multiple properties with the same name in strict mode."
case 1121: // "Octal literals are not allowed in strict mode."
case 1123: // "Variable declaration list cannot be empty."
case 1141: // "String literal expected."
case 1162: // "An object member cannot be declared optional."
case 1164: // "Computed property names are not allowed in enums."
case 1172: // "'extends' clause already seen."
case 1173: // "'extends' clause must precede 'implements' clause."
case 1175: // "'implements' clause already seen."
case 1176: // "Interface declaration cannot have 'implements' clause."
case 1190: // "The variable declaration of a 'for...of' statement cannot have an initializer."
case 1196: // "Catch clause variable type annotation must be 'any' or 'unknown' if specified."
case 1200: // "Line terminator not permitted before arrow."
case 1206: // "Decorators are not valid here."
case 1211: // "A class declaration without the 'default' modifier must have a name."
case 1242: // "'abstract' modifier can only appear on a class, method, or property declaration."
case 1246: // "An interface property cannot have an initializer."
case 1255: // "A definite assignment assertion '!' is not permitted in this context."
case 1308: // "'await' expression is only allowed within an async function."
case 2364: // "The left-hand side of an assignment expression must be a variable or a property access."
case 2369: // "A parameter property is only allowed in a constructor implementation."
case 2452: // "An enum member cannot have a numeric name."
case 2462: // "A rest element must be last in a destructuring pattern."
case 8017: // "Octal literal types must use ES2015 syntax. Use the syntax '{0}'."
case 17012: // "'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?"
case 17013: // "Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor."
return true;
}
return false;
});
}
function convertDiagnosticToSemanticOrSyntacticError(diagnostic) {
return {
...diagnostic,
message: (0, typescript_1.flattenDiagnosticMessageText)(diagnostic.messageText, typescript_1.sys.newLine),
};
}
@@ -0,0 +1 @@
{"version":3,"file":"rail-symbol.js","sources":["../../../src/icons/rail-symbol.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name RailSymbol\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNSAxNWgxNCIgLz4KICA8cGF0aCBkPSJNNSA5aDE0IiAvPgogIDxwYXRoIGQ9Im0xNCAyMC01LTUgNi02LTUtNSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/rail-symbol\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst RailSymbol = createLucideIcon('RailSymbol', [\n ['path', { d: 'M5 15h14', key: 'm0yey3' }],\n ['path', { d: 'M5 9h14', key: '7tsvo6' }],\n ['path', { d: 'm14 20-5-5 6-6-5-5', key: '1jo42i' }],\n]);\n\nexport default RailSymbol;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,iBAAiB,YAAc,CAAA,CAAA,CAAA;AAAA,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAsB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACrD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,221 @@
import { f as createRule, g as import_ast_utils } from "../utils.js";
const SPACING = {
always: "always",
never: "never"
};
const SPACING_VALUES = ["always", "never"];
const BASIC_CONFIG_SCHEMA = {
type: "object",
properties: {
when: {
type: "string",
enum: SPACING_VALUES
},
allowMultiline: { type: "boolean" },
spacing: {
type: "object",
properties: { objectLiterals: {
type: "string",
enum: SPACING_VALUES
} },
additionalProperties: false
}
},
additionalProperties: false
};
const BASIC_CONFIG_OR_BOOLEAN_SCHEMA = { anyOf: [BASIC_CONFIG_SCHEMA, { type: "boolean" }] };
var jsx_curly_spacing_default = createRule({
name: "jsx-curly-spacing",
meta: {
type: "layout",
docs: { description: "Enforce or disallow spaces inside of curly braces in JSX attributes and expressions" },
fixable: "code",
schema: {
type: "array",
items: [{ anyOf: [{
type: "object",
additionalProperties: false,
properties: {
...BASIC_CONFIG_SCHEMA.properties,
attributes: BASIC_CONFIG_OR_BOOLEAN_SCHEMA,
children: BASIC_CONFIG_OR_BOOLEAN_SCHEMA
}
}, {
type: "string",
enum: SPACING_VALUES
}] }, {
type: "object",
properties: {
allowMultiline: { type: "boolean" },
spacing: {
type: "object",
properties: { objectLiterals: {
type: "string",
enum: SPACING_VALUES
} },
additionalProperties: false
}
},
additionalProperties: false
}]
},
defaultOptions: [{
when: "never",
allowMultiline: true
}],
messages: {
noNewlineAfter: "There should be no newline after '{{token}}'",
noNewlineBefore: "There should be no newline before '{{token}}'",
noSpaceAfter: "There should be no space after '{{token}}'",
noSpaceBefore: "There should be no space before '{{token}}'",
spaceNeededAfter: "A space is required after '{{token}}'",
spaceNeededBefore: "A space is required before '{{token}}'"
}
},
create(context, [firstOption, secondOption = {}]) {
const { when: defaultWhen = "never", allowMultiline: defaultAllowMultiline = true, spacing: defaultSpacing = {}, attributes = true, children = false } = typeof firstOption === "string" ? {
when: firstOption,
...secondOption
} : firstOption;
function normalizeConfig(configOrTrue) {
const { when = defaultWhen, allowMultiline = defaultAllowMultiline, spacing = defaultSpacing } = configOrTrue === true ? {} : configOrTrue;
return {
when,
allowMultiline,
objectLiteralSpaces: spacing.objectLiterals ?? when
};
}
const attributesConfig = attributes ? normalizeConfig(attributes) : null;
const childrenConfig = children ? normalizeConfig(children) : null;
const sourceCode = context.sourceCode;
function fixByTrimmingWhitespace(fixer, fromLoc, toLoc, mode, spacing = "") {
let replacementText = sourceCode.text.slice(fromLoc, toLoc);
if (mode === "start") replacementText = replacementText.replace(/^\s+/gm, "");
else replacementText = replacementText.replace(/\s+$/gm, "");
if (spacing === SPACING.always) if (mode === "start") replacementText += " ";
else replacementText = ` ${replacementText}`;
return fixer.replaceTextRange([fromLoc, toLoc], replacementText);
}
function reportNoBeginningNewline(node, token, spacing) {
context.report({
node,
loc: token.loc.start,
messageId: "noNewlineAfter",
data: { token: token.value },
fix(fixer) {
const nextToken = sourceCode.getTokenAfter(token);
return fixByTrimmingWhitespace(fixer, token.range[1], nextToken.range[0], "start", spacing);
}
});
}
function reportNoEndingNewline(node, token, spacing) {
context.report({
node,
loc: token.loc.start,
messageId: "noNewlineBefore",
data: { token: token.value },
fix(fixer) {
return fixByTrimmingWhitespace(fixer, sourceCode.getTokenBefore(token).range[1], token.range[0], "end", spacing);
}
});
}
function reportNoBeginningSpace(node, token) {
context.report({
node,
loc: token.loc.start,
messageId: "noSpaceAfter",
data: { token: token.value },
fix(fixer) {
const nextToken = sourceCode.getTokenAfter(token);
const nextComment = sourceCode.getCommentsAfter(token);
if (nextComment.length > 0) return fixByTrimmingWhitespace(fixer, token.range[1], Math.min(nextToken.range[0], nextComment[0].range[0]), "start");
return fixByTrimmingWhitespace(fixer, token.range[1], nextToken.range[0], "start");
}
});
}
function reportNoEndingSpace(node, token) {
context.report({
node,
loc: token.loc.start,
messageId: "noSpaceBefore",
data: { token: token.value },
fix(fixer) {
const previousToken = sourceCode.getTokenBefore(token);
const previousComment = sourceCode.getCommentsBefore(token);
if (previousComment.length > 0) return fixByTrimmingWhitespace(fixer, Math.max(previousToken.range[1], previousComment[0].range[1]), token.range[0], "end");
return fixByTrimmingWhitespace(fixer, previousToken.range[1], token.range[0], "end");
}
});
}
function reportRequiredBeginningSpace(node, token) {
context.report({
node,
loc: token.loc.start,
messageId: "spaceNeededAfter",
data: { token: token.value },
fix(fixer) {
return fixer.insertTextAfter(token, " ");
}
});
}
function reportRequiredEndingSpace(node, token) {
context.report({
node,
loc: token.loc.start,
messageId: "spaceNeededBefore",
data: { token: token.value },
fix(fixer) {
return fixer.insertTextBefore(token, " ");
}
});
}
function validateBraceSpacing(node) {
let config;
switch (node.parent?.type) {
case "JSXAttribute":
case "JSXOpeningElement":
config = attributesConfig;
break;
case "JSXElement":
case "JSXFragment":
config = childrenConfig;
break;
default: return;
}
if (config === null) return;
const first = sourceCode.getFirstToken(node);
const last = sourceCode.getLastToken(node);
let second = sourceCode.getTokenAfter(first, { includeComments: true });
let penultimate = sourceCode.getTokenBefore(last, { includeComments: true });
if (!second) {
second = sourceCode.getTokenAfter(first);
const leadingComments = sourceCode.getCommentsBefore(second);
second = leadingComments ? leadingComments[0] : second;
}
if (!penultimate) {
penultimate = sourceCode.getTokenBefore(last);
const trailingComments = sourceCode.getCommentsAfter(penultimate);
penultimate = trailingComments ? trailingComments[trailingComments.length - 1] : penultimate;
}
const spacing = first.value === second.value ? config.objectLiteralSpaces : config.when;
if (spacing === SPACING.always) {
if (!sourceCode.isSpaceBetween(first, second)) reportRequiredBeginningSpace(node, first);
else if (!config.allowMultiline && !(0, import_ast_utils.isTokenOnSameLine)(first, second)) reportNoBeginningNewline(node, first, spacing);
if (!sourceCode.isSpaceBetween(penultimate, last)) reportRequiredEndingSpace(node, last);
else if (!config.allowMultiline && !(0, import_ast_utils.isTokenOnSameLine)(penultimate, last)) reportNoEndingNewline(node, last, spacing);
} else if (spacing === SPACING.never) {
if (!(0, import_ast_utils.isTokenOnSameLine)(first, second)) {
if (!config.allowMultiline) reportNoBeginningNewline(node, first, spacing);
} else if (sourceCode.isSpaceBetween(first, second)) reportNoBeginningSpace(node, first);
if (!(0, import_ast_utils.isTokenOnSameLine)(penultimate, last)) {
if (!config.allowMultiline) reportNoEndingNewline(node, last, spacing);
} else if (sourceCode.isSpaceBetween(penultimate, last)) reportNoEndingSpace(node, last);
}
}
return {
JSXExpressionContainer: validateBraceSpacing,
JSXSpreadAttribute: validateBraceSpacing
};
}
});
export { jsx_curly_spacing_default as t };
@@ -0,0 +1 @@
{"version":3,"file":"navigation.js","sources":["../../../src/icons/navigation.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Navigation\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cG9seWdvbiBwb2ludHM9IjMgMTEgMjIgMiAxMyAyMSAxMSAxMyAzIDExIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/navigation\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Navigation = createLucideIcon('Navigation', [\n ['polygon', { points: '3 11 22 2 13 21 11 13 3 11', key: '1ltx0t' }],\n]);\n\nexport default Navigation;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,iBAAiB,YAAc,CAAA,CAAA,CAAA;AAAA,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,CAAA,CAAA,CAAA,CAAE,QAAQ,CAA8B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACrE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,20 @@
{
'variables': {
'NAPI_VERSION%': "<!(node -p \"process.env.NAPI_VERSION || process.versions.napi\")",
'disable_deprecated': "<!(node -p \"process.env['npm_config_disable_deprecated']\")"
},
'conditions': [
['NAPI_VERSION!=""', { 'defines': ['NAPI_VERSION=<@(NAPI_VERSION)'] } ],
['disable_deprecated=="true"', {
'defines': ['NODE_ADDON_API_DISABLE_DEPRECATED']
}],
['OS=="mac"', {
'cflags+': ['-fvisibility=hidden'],
'xcode_settings': {
'OTHER_CFLAGS': ['-fvisibility=hidden']
}
}]
],
'cflags': [ '-Werror', '-Wall', '-Wextra', '-Wpedantic', '-Wunused-parameter' ],
'cflags_cc': [ '-Werror', '-Wall', '-Wextra', '-Wpedantic', '-Wunused-parameter' ]
}
@@ -0,0 +1,170 @@
/*!
* bytes
* Copyright(c) 2012-2014 TJ Holowaychuk
* Copyright(c) 2015 Jed Watson
* MIT Licensed
*/
'use strict';
/**
* Module exports.
* @public
*/
module.exports = bytes;
module.exports.format = format;
module.exports.parse = parse;
/**
* Module variables.
* @private
*/
var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g;
var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/;
var map = {
b: 1,
kb: 1 << 10,
mb: 1 << 20,
gb: 1 << 30,
tb: Math.pow(1024, 4),
pb: Math.pow(1024, 5),
};
var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;
/**
* Convert the given value in bytes into a string or parse to string to an integer in bytes.
*
* @param {string|number} value
* @param {{
* case: [string],
* decimalPlaces: [number]
* fixedDecimals: [boolean]
* thousandsSeparator: [string]
* unitSeparator: [string]
* }} [options] bytes options.
*
* @returns {string|number|null}
*/
function bytes(value, options) {
if (typeof value === 'string') {
return parse(value);
}
if (typeof value === 'number') {
return format(value, options);
}
return null;
}
/**
* Format the given value in bytes into a string.
*
* If the value is negative, it is kept as such. If it is a float,
* it is rounded.
*
* @param {number} value
* @param {object} [options]
* @param {number} [options.decimalPlaces=2]
* @param {number} [options.fixedDecimals=false]
* @param {string} [options.thousandsSeparator=]
* @param {string} [options.unit=]
* @param {string} [options.unitSeparator=]
*
* @returns {string|null}
* @public
*/
function format(value, options) {
if (!Number.isFinite(value)) {
return null;
}
var mag = Math.abs(value);
var thousandsSeparator = (options && options.thousandsSeparator) || '';
var unitSeparator = (options && options.unitSeparator) || '';
var decimalPlaces = (options && options.decimalPlaces !== undefined) ? options.decimalPlaces : 2;
var fixedDecimals = Boolean(options && options.fixedDecimals);
var unit = (options && options.unit) || '';
if (!unit || !map[unit.toLowerCase()]) {
if (mag >= map.pb) {
unit = 'PB';
} else if (mag >= map.tb) {
unit = 'TB';
} else if (mag >= map.gb) {
unit = 'GB';
} else if (mag >= map.mb) {
unit = 'MB';
} else if (mag >= map.kb) {
unit = 'KB';
} else {
unit = 'B';
}
}
var val = value / map[unit.toLowerCase()];
var str = val.toFixed(decimalPlaces);
if (!fixedDecimals) {
str = str.replace(formatDecimalsRegExp, '$1');
}
if (thousandsSeparator) {
str = str.split('.').map(function (s, i) {
return i === 0
? s.replace(formatThousandsRegExp, thousandsSeparator)
: s
}).join('.');
}
return str + unitSeparator + unit;
}
/**
* Parse the string value into an integer in bytes.
*
* If no unit is given, it is assumed the value is in bytes.
*
* @param {number|string} val
*
* @returns {number|null}
* @public
*/
function parse(val) {
if (typeof val === 'number' && !isNaN(val)) {
return val;
}
if (typeof val !== 'string') {
return null;
}
// Test if the string passed is valid
var results = parseRegExp.exec(val);
var floatValue;
var unit = 'b';
if (!results) {
// Nothing could be extracted from the given string
floatValue = parseInt(val, 10);
unit = 'b'
} else {
// Retrieve the value and the unit
floatValue = parseFloat(results[1]);
unit = results[4].toLowerCase();
}
if (isNaN(floatValue)) {
return null;
}
return Math.floor(map[unit] * floatValue);
}
@@ -0,0 +1 @@
{"version":3,"file":"loader-circle.js","sources":["../../../src/icons/loader-circle.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name LoaderCircle\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgMTJhOSA5IDAgMSAxLTYuMjE5LTguNTYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/loader-circle\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst LoaderCircle = createLucideIcon('LoaderCircle', [\n ['path', { d: 'M21 12a9 9 0 1 1-6.219-8.56', key: '13zald' }],\n]);\n\nexport default LoaderCircle;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA+B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC9D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
This directory is a fallback for `exports["./dom"]` in the root `framer-motion` `package.json`.
@@ -0,0 +1,338 @@
/**
* @license React
* react-jsx-dev-runtime.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
"use strict";
"production" !== process.env.NODE_ENV &&
(function () {
function getComponentNameFromType(type) {
if (null == type) return null;
if ("function" === typeof type)
return type.$$typeof === REACT_CLIENT_REFERENCE
? null
: type.displayName || type.name || null;
if ("string" === typeof type) return type;
switch (type) {
case REACT_FRAGMENT_TYPE:
return "Fragment";
case REACT_PROFILER_TYPE:
return "Profiler";
case REACT_STRICT_MODE_TYPE:
return "StrictMode";
case REACT_SUSPENSE_TYPE:
return "Suspense";
case REACT_SUSPENSE_LIST_TYPE:
return "SuspenseList";
case REACT_ACTIVITY_TYPE:
return "Activity";
}
if ("object" === typeof type)
switch (
("number" === typeof type.tag &&
console.error(
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
),
type.$$typeof)
) {
case REACT_PORTAL_TYPE:
return "Portal";
case REACT_CONTEXT_TYPE:
return type.displayName || "Context";
case REACT_CONSUMER_TYPE:
return (type._context.displayName || "Context") + ".Consumer";
case REACT_FORWARD_REF_TYPE:
var innerType = type.render;
type = type.displayName;
type ||
((type = innerType.displayName || innerType.name || ""),
(type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
return type;
case REACT_MEMO_TYPE:
return (
(innerType = type.displayName || null),
null !== innerType
? innerType
: getComponentNameFromType(type.type) || "Memo"
);
case REACT_LAZY_TYPE:
innerType = type._payload;
type = type._init;
try {
return getComponentNameFromType(type(innerType));
} catch (x) {}
}
return null;
}
function testStringCoercion(value) {
return "" + value;
}
function checkKeyStringCoercion(value) {
try {
testStringCoercion(value);
var JSCompiler_inline_result = !1;
} catch (e) {
JSCompiler_inline_result = !0;
}
if (JSCompiler_inline_result) {
JSCompiler_inline_result = console;
var JSCompiler_temp_const = JSCompiler_inline_result.error;
var JSCompiler_inline_result$jscomp$0 =
("function" === typeof Symbol &&
Symbol.toStringTag &&
value[Symbol.toStringTag]) ||
value.constructor.name ||
"Object";
JSCompiler_temp_const.call(
JSCompiler_inline_result,
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
JSCompiler_inline_result$jscomp$0
);
return testStringCoercion(value);
}
}
function getTaskName(type) {
if (type === REACT_FRAGMENT_TYPE) return "<>";
if (
"object" === typeof type &&
null !== type &&
type.$$typeof === REACT_LAZY_TYPE
)
return "<...>";
try {
var name = getComponentNameFromType(type);
return name ? "<" + name + ">" : "<...>";
} catch (x) {
return "<...>";
}
}
function getOwner() {
var dispatcher = ReactSharedInternals.A;
return null === dispatcher ? null : dispatcher.getOwner();
}
function UnknownOwner() {
return Error("react-stack-top-frame");
}
function hasValidKey(config) {
if (hasOwnProperty.call(config, "key")) {
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
if (getter && getter.isReactWarning) return !1;
}
return void 0 !== config.key;
}
function defineKeyPropWarningGetter(props, displayName) {
function warnAboutAccessingKey() {
specialPropKeyWarningShown ||
((specialPropKeyWarningShown = !0),
console.error(
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
displayName
));
}
warnAboutAccessingKey.isReactWarning = !0;
Object.defineProperty(props, "key", {
get: warnAboutAccessingKey,
configurable: !0
});
}
function elementRefGetterWithDeprecationWarning() {
var componentName = getComponentNameFromType(this.type);
didWarnAboutElementRef[componentName] ||
((didWarnAboutElementRef[componentName] = !0),
console.error(
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
));
componentName = this.props.ref;
return void 0 !== componentName ? componentName : null;
}
function ReactElement(type, key, props, owner, debugStack, debugTask) {
var refProp = props.ref;
type = {
$$typeof: REACT_ELEMENT_TYPE,
type: type,
key: key,
props: props,
_owner: owner
};
null !== (void 0 !== refProp ? refProp : null)
? Object.defineProperty(type, "ref", {
enumerable: !1,
get: elementRefGetterWithDeprecationWarning
})
: Object.defineProperty(type, "ref", { enumerable: !1, value: null });
type._store = {};
Object.defineProperty(type._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: 0
});
Object.defineProperty(type, "_debugInfo", {
configurable: !1,
enumerable: !1,
writable: !0,
value: null
});
Object.defineProperty(type, "_debugStack", {
configurable: !1,
enumerable: !1,
writable: !0,
value: debugStack
});
Object.defineProperty(type, "_debugTask", {
configurable: !1,
enumerable: !1,
writable: !0,
value: debugTask
});
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
return type;
}
function jsxDEVImpl(
type,
config,
maybeKey,
isStaticChildren,
debugStack,
debugTask
) {
var children = config.children;
if (void 0 !== children)
if (isStaticChildren)
if (isArrayImpl(children)) {
for (
isStaticChildren = 0;
isStaticChildren < children.length;
isStaticChildren++
)
validateChildKeys(children[isStaticChildren]);
Object.freeze && Object.freeze(children);
} else
console.error(
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
);
else validateChildKeys(children);
if (hasOwnProperty.call(config, "key")) {
children = getComponentNameFromType(type);
var keys = Object.keys(config).filter(function (k) {
return "key" !== k;
});
isStaticChildren =
0 < keys.length
? "{key: someKey, " + keys.join(": ..., ") + ": ...}"
: "{key: someKey}";
didWarnAboutKeySpread[children + isStaticChildren] ||
((keys =
0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"),
console.error(
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
isStaticChildren,
children,
keys,
children
),
(didWarnAboutKeySpread[children + isStaticChildren] = !0));
}
children = null;
void 0 !== maybeKey &&
(checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
hasValidKey(config) &&
(checkKeyStringCoercion(config.key), (children = "" + config.key));
if ("key" in config) {
maybeKey = {};
for (var propName in config)
"key" !== propName && (maybeKey[propName] = config[propName]);
} else maybeKey = config;
children &&
defineKeyPropWarningGetter(
maybeKey,
"function" === typeof type
? type.displayName || type.name || "Unknown"
: type
);
return ReactElement(
type,
children,
maybeKey,
getOwner(),
debugStack,
debugTask
);
}
function validateChildKeys(node) {
isValidElement(node)
? node._store && (node._store.validated = 1)
: "object" === typeof node &&
null !== node &&
node.$$typeof === REACT_LAZY_TYPE &&
("fulfilled" === node._payload.status
? isValidElement(node._payload.value) &&
node._payload.value._store &&
(node._payload.value._store.validated = 1)
: node._store && (node._store.validated = 1));
}
function isValidElement(object) {
return (
"object" === typeof object &&
null !== object &&
object.$$typeof === REACT_ELEMENT_TYPE
);
}
var React = require("react"),
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
REACT_MEMO_TYPE = Symbol.for("react.memo"),
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
hasOwnProperty = Object.prototype.hasOwnProperty,
isArrayImpl = Array.isArray,
createTask = console.createTask
? console.createTask
: function () {
return null;
};
React = {
react_stack_bottom_frame: function (callStackForError) {
return callStackForError();
}
};
var specialPropKeyWarningShown;
var didWarnAboutElementRef = {};
var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(
React,
UnknownOwner
)();
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
var didWarnAboutKeySpread = {};
exports.Fragment = REACT_FRAGMENT_TYPE;
exports.jsxDEV = function (type, config, maybeKey, isStaticChildren) {
var trackActualOwner =
1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
return jsxDEVImpl(
type,
config,
maybeKey,
isStaticChildren,
trackActualOwner
? Error("react-stack-top-frame")
: unknownOwnerDebugStack,
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
);
};
})();
@@ -0,0 +1,62 @@
import { s as setupBaseEnvironment, r as runBaseTests } from '../chunks/base.B6Opl8PE.js';
import { w as workerInit } from '../chunks/init-threads.6kl1khcL.js';
import 'node:vm';
import '@vitest/spy';
import '../chunks/index.DXx9Dtk7.js';
import '@vitest/expect';
import 'node:async_hooks';
import '../chunks/setup-common.DYx3LtFI.js';
import '../chunks/coverage.CTzCuANN.js';
import '@vitest/snapshot';
import '@vitest/utils/timers';
import '../chunks/utils.BX5Fg8C4.js';
import '../chunks/rpc.MzXet3jl.js';
import '../chunks/index.Chj8NDwU.js';
import '../chunks/test.DNmyFkvJ.js';
import '@vitest/runner';
import '@vitest/utils/helpers';
import '../chunks/benchmark.CX_oY03V.js';
import '@vitest/runner/utils';
import '@vitest/utils/error';
import 'pathe';
import '@vitest/utils/offset';
import '@vitest/utils/source-map';
import '../chunks/_commonjsHelpers.D26ty3Ew.js';
import '../chunks/init.k9zZ9sLh.js';
import 'node:fs';
import 'node:module';
import 'node:url';
import 'vite/module-runner';
import '../chunks/startVitestModuleRunner.DB-7oCpn.js';
import '../chunks/modules.BJuCwlRJ.js';
import '../path.js';
import 'node:path';
import '../module-evaluator.js';
import '../chunks/traces.DT5aQ62U.js';
import '@vitest/mocker';
import '@vitest/mocker/redirect';
import '../chunks/index.DC7d2Pf8.js';
import 'node:console';
import '@vitest/utils/serialize';
import 'tinyrainbow';
import '../chunks/inspector.CvyFGlXm.js';
import '../chunks/evaluatedModules.Dg1zASAC.js';
import '../chunks/nativeModuleRunner.BIakptoF.js';
import '../chunks/index.BCY_7LL2.js';
import 'node:process';
import 'node:fs/promises';
import 'node:assert';
import 'node:v8';
import 'node:util';
import 'node:perf_hooks';
import 'node:timers';
import 'node:timers/promises';
import '@vitest/utils/constants';
import '../chunks/index.DdgEv5B1.js';
import 'expect-type';
import 'node:worker_threads';
workerInit({
runTests: runBaseTests,
setup: setupBaseEnvironment
});
@@ -0,0 +1,5 @@
'use strict'
const compare = require('./compare')
const rcompare = (a, b, loose) => compare(b, a, loose)
module.exports = rcompare
@@ -0,0 +1 @@
{"version":3,"file":"dialects-DoSzNhcb.mjs","names":["DRAFT_2020_12_URIS: ReadonlySet<string>","DRAFT_2019_09_URIS: ReadonlySet<string>","DRAFT_07_URIS: ReadonlySet<string>","DRAFT_06_URIS: ReadonlySet<string>"],"sources":["../../core-internal/src/validators/dialects.ts"],"sourcesContent":["/**\n * Declared-dialect classification shared by the default validator providers.\n */\n\nimport type { JsonSchemaType } from './types';\n\n/**\n * Canonical `$schema` URIs per supported dialect (http + https variants, trailing-`#` stripped).\n */\nconst DRAFT_2020_12_URIS: ReadonlySet<string> = new Set([\n 'https://json-schema.org/draft/2020-12/schema',\n 'http://json-schema.org/draft/2020-12/schema'\n]);\nconst DRAFT_2019_09_URIS: ReadonlySet<string> = new Set([\n 'https://json-schema.org/draft/2019-09/schema',\n 'http://json-schema.org/draft/2019-09/schema'\n]);\nconst DRAFT_07_URIS: ReadonlySet<string> = new Set(['https://json-schema.org/draft-07/schema', 'http://json-schema.org/draft-07/schema']);\nconst DRAFT_06_URIS: ReadonlySet<string> = new Set(['https://json-schema.org/draft-06/schema', 'http://json-schema.org/draft-06/schema']);\n\n/**\n * Dialects the default providers dispatch on. draft-06 maps to `'draft-7'`: draft-07 only adds\n * keywords over draft-06 (`if`/`then`/`else`), and enforcing them on a draft-06 schema is the\n * accepted downlevel.\n */\nexport type DeclaredDialect = '2020-12' | '2019-09' | 'draft-7';\n\n/**\n * Whether a `$schema` value declares the 2019-09 dialect — the only supported dialect with\n * `$recursiveRef`/`$recursiveAnchor`. Non-throwing (unlike {@linkcode declaredDialect}) so\n * wire-layer callers can consult it for documents whose dialect may be unsupported.\n */\nexport function declares2019Dialect($schema: unknown): boolean {\n return typeof $schema === 'string' && DRAFT_2019_09_URIS.has($schema.replace(/#$/, ''));\n}\n\n/**\n * Classify a schema's declared `$schema` dialect. No `$schema` (or a non-string one) means\n * 2020-12. Any other dialect throws a plain `Error` with a clear message rather than letting the\n * engine crash on an opaque internal error or silently mis-validate; `remedy` names the calling\n * provider's escape hatch in that message.\n */\nexport function declaredDialect(schema: JsonSchemaType, remedy: string): DeclaredDialect {\n if (!('$schema' in schema) || typeof schema.$schema !== 'string') {\n return '2020-12';\n }\n const declared = schema.$schema.replace(/#$/, '');\n if (DRAFT_2020_12_URIS.has(declared)) {\n return '2020-12';\n }\n if (DRAFT_2019_09_URIS.has(declared)) {\n return '2019-09';\n }\n if (DRAFT_07_URIS.has(declared) || DRAFT_06_URIS.has(declared)) {\n return 'draft-7';\n }\n throw new Error(\n `JSON Schema declares an unsupported dialect (\"$schema\": \"${schema.$schema.slice(0, 200)}\"). ` +\n `The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${remedy}`\n );\n}\n"],"mappings":";;;;AASA,MAAMA,qBAA0C,IAAI,IAAI,CACpD,gDACA,8CACH,CAAC;AACF,MAAMC,qBAA0C,IAAI,IAAI,CACpD,gDACA,8CACH,CAAC;AACF,MAAMC,gBAAqC,IAAI,IAAI,CAAC,2CAA2C,yCAAyC,CAAC;AACzI,MAAMC,gBAAqC,IAAI,IAAI,CAAC,2CAA2C,yCAAyC,CAAC;;;;;;AAczI,SAAgB,oBAAoB,SAA2B;AAC3D,QAAO,OAAO,YAAY,YAAY,mBAAmB,IAAI,QAAQ,QAAQ,MAAM,GAAG,CAAC;;;;;;;;AAS3F,SAAgB,gBAAgB,QAAwB,QAAiC;AACrF,KAAI,EAAE,aAAa,WAAW,OAAO,OAAO,YAAY,SACpD,QAAO;CAEX,MAAM,WAAW,OAAO,QAAQ,QAAQ,MAAM,GAAG;AACjD,KAAI,mBAAmB,IAAI,SAAS,CAChC,QAAO;AAEX,KAAI,mBAAmB,IAAI,SAAS,CAChC,QAAO;AAEX,KAAI,cAAc,IAAI,SAAS,IAAI,cAAc,IAAI,SAAS,CAC1D,QAAO;AAEX,OAAM,IAAI,MACN,4DAA4D,OAAO,QAAQ,MAAM,GAAG,IAAI,CAAC,2FACG,SAC/F"}
@@ -0,0 +1 @@
{"version":3,"file":"case-lower.js","sources":["../../../src/icons/case-lower.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CaseLower\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSI3IiBjeT0iMTIiIHI9IjMiIC8+CiAgPHBhdGggZD0iTTEwIDl2NiIgLz4KICA8Y2lyY2xlIGN4PSIxNyIgY3k9IjEyIiByPSIzIiAvPgogIDxwYXRoIGQ9Ik0xNCA3djgiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/case-lower\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CaseLower = createLucideIcon('CaseLower', [\n ['circle', { cx: '7', cy: '12', r: '3', key: '12clwm' }],\n ['path', { d: 'M10 9v6', key: '17i7lo' }],\n ['circle', { cx: '17', cy: '12', r: '3', key: 'gl7c2s' }],\n ['path', { d: 'M14 7v8', key: 'dl84cr' }],\n]);\n\nexport default CaseLower;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAC9C,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACvD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACxC,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"brush.js","sources":["../../../src/icons/brush.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Brush\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtOS4wNiAxMS45IDguMDctOC4wNmEyLjg1IDIuODUgMCAxIDEgNC4wMyA0LjAzbC04LjA2IDguMDgiIC8+CiAgPHBhdGggZD0iTTcuMDcgMTQuOTRjLTEuNjYgMC0zIDEuMzUtMyAzLjAyIDAgMS4zMy0yLjUgMS41Mi0yIDIuMDIgMS4wOCAxLjEgMi40OSAyLjAyIDQgMi4wMiAyLjIgMCA0LTEuOCA0LTQuMDRhMy4wMSAzLjAxIDAgMCAwLTMtMy4wMnoiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/brush\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Brush = createLucideIcon('Brush', [\n ['path', { d: 'm9.06 11.9 8.07-8.06a2.85 2.85 0 1 1 4.03 4.03l-8.06 8.08', key: '1styjt' }],\n [\n 'path',\n {\n d: 'M7.07 14.94c-1.66 0-3 1.35-3 3.02 0 1.33-2.5 1.52-2 2.02 1.08 1.1 2.49 2.02 4 2.02 2.2 0 4-1.8 4-4.04a3.01 3.01 0 0 0-3-3.02z',\n key: 'z0l1mu',\n },\n ],\n]);\n\nexport default Brush;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CAAA,CACtC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC1F,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
module.exports={A:{A:{"16":"FD","132":"_vC","388":"_gD _A"},B:{"1":"_J"},C:{"1":"_w","2":"_f"},D:{"1":"_lO","2":"_FC","16":"_PO"},E:{"1":"_dB","2":"_u"},F:{"1":"_zG","16":"_mB"},G:{"1":"_8C","2":"_1"},H:{"388":"1D"},I:{"1":"_X","2":"_W"},J:{"1":"A","2":"D"},K:{"1":"_N"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"A","260":"B"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:1,C:"disabled attribute of the fieldset element",D:true};
@@ -0,0 +1,649 @@
import * as i0 from '@angular/core';
import { Injectable, ViewContainerRef, Component, ViewChild, Input, EventEmitter, reflectComponentType, ContentChildren, Output, NgModule } from '@angular/core';
import { NgIf } from '@angular/common';
import { GridStack } from 'gridstack';
/**
* gridstack-item.component.ts 12.6.0
* Copyright (c) 2022-2024 Alain Dumesny - see GridStack root license
*/
/**
* Base widget class for GridStack Angular integration.
*/
class BaseWidget {
/**
* Override this method to return serializable data for this widget.
*
* Return an object with properties that map to your component's @Input() fields.
* The selector is handled automatically, so only include component-specific data.
*
* @returns Object containing serializable component data
*
* @example
* ```typescript
* serialize() {
* return {
* title: this.title,
* value: this.value,
* settings: this.settings
* };
* }
* ```
*/
serialize() { return; }
/**
* Override this method to handle widget restoration from saved data.
*
* Use this for complex initialization that goes beyond simple @Input() mapping.
* The default implementation automatically assigns input data to component properties.
*
* @param w The saved widget data including input properties
*
* @example
* ```typescript
* deserialize(w: NgGridStackWidget) {
* super.deserialize(w); // Call parent for basic setup
*
* // Custom initialization logic
* if (w.input?.complexData) {
* this.processComplexData(w.input.complexData);
* }
* }
* ```
*/
deserialize(w) {
// save full description for meta data
this.widgetItem = w;
if (!w)
return;
if (w.input)
Object.assign(this, w.input);
}
}
BaseWidget.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BaseWidget, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
BaseWidget.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BaseWidget });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: BaseWidget, decorators: [{
type: Injectable
}] });
/**
* gridstack-item.component.ts 12.6.0
* Copyright (c) 2022-2024 Alain Dumesny - see GridStack root license
*/
/**
* Angular component wrapper for individual GridStack items.
*
* This component represents a single grid item and handles:
* - Dynamic content creation and management
* - Integration with parent GridStack component
* - Component lifecycle and cleanup
* - Widget options and configuration
*
* Use in combination with GridstackComponent for the parent grid.
*
* @example
* ```html
* <gridstack>
* <gridstack-item [options]="{x: 0, y: 0, w: 2, h: 1}">
* <my-widget-component></my-widget-component>
* </gridstack-item>
* </gridstack>
* ```
*/
class GridstackItemComponent {
constructor(elementRef) {
this.elementRef = elementRef;
this.el._gridItemComp = this;
}
/**
* Grid item configuration options.
* Defines position, size, and behavior of this grid item.
*
* @example
* ```typescript
* itemOptions: GridStackNode = {
* x: 0, y: 0, w: 2, h: 1,
* noResize: true,
* content: 'Item content'
* };
* ```
*/
set options(val) {
var _a;
const grid = (_a = this.el.gridstackNode) === null || _a === void 0 ? void 0 : _a.grid;
if (grid) {
// already built, do an update...
grid.update(this.el, val);
}
else {
// store our custom element in options so we can update it and not re-create a generic div!
this._options = Object.assign(Object.assign({}, val), { el: this.el });
}
}
/** return the latest grid options (from GS once built, otherwise initial values) */
get options() {
return this.el.gridstackNode || this._options || { el: this.el };
}
/** return the native element that contains grid specific fields as well */
get el() { return this.elementRef.nativeElement; }
/** clears the initial options now that we've built */
clearOptions() {
delete this._options;
}
ngOnDestroy() {
this.clearOptions();
delete this.childWidget;
delete this.el._gridItemComp;
delete this.container;
delete this.ref;
}
}
GridstackItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: GridstackItemComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
GridstackItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: GridstackItemComponent, isStandalone: true, selector: "gridstack-item", inputs: { options: "options" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: `
<div class="grid-stack-item-content">
<!-- where dynamic items go based on component selector (recommended way), or sub-grids, etc...) -->
<ng-template #container></ng-template>
<!-- any static (defined in DOM - not recommended) content goes here -->
<ng-content></ng-content>
<!-- fallback HTML content from GridStackWidget.content if used instead (not recommended) -->
{{options.content}}
</div>`, isInline: true, styles: [":host{display:block}\n"] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: GridstackItemComponent, decorators: [{
type: Component,
args: [{ selector: 'gridstack-item', template: `
<div class="grid-stack-item-content">
<!-- where dynamic items go based on component selector (recommended way), or sub-grids, etc...) -->
<ng-template #container></ng-template>
<!-- any static (defined in DOM - not recommended) content goes here -->
<ng-content></ng-content>
<!-- fallback HTML content from GridStackWidget.content if used instead (not recommended) -->
{{options.content}}
</div>`, standalone: true, styles: [":host{display:block}\n"] }]
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { container: [{
type: ViewChild,
args: ['container', { read: ViewContainerRef, static: true }]
}], options: [{
type: Input
}] } });
/**
* gridstack.component.ts 12.6.0
* Copyright (c) 2022-2024 Alain Dumesny - see GridStack root license
*/
/**
* Angular component wrapper for GridStack.
*
* This component provides Angular integration for GridStack grids, handling:
* - Grid initialization and lifecycle
* - Dynamic component creation and management
* - Event binding and emission
* - Integration with Angular change detection
*
* Use in combination with GridstackItemComponent for individual grid items.
*
* @example
* ```html
* <gridstack [options]="gridOptions" (change)="onGridChange($event)">
* <div empty-content>Drag widgets here</div>
* </gridstack>
* ```
*/
class GridstackComponent {
constructor(elementRef) {
this.elementRef = elementRef;
/**
* GridStack event emitters for Angular integration.
*
* These provide Angular-style event handling for GridStack events.
* Alternatively, use `this.grid.on('event1 event2', callback)` for multiple events.
*
* Note: 'CB' suffix prevents conflicts with native DOM events.
*
* @example
* ```html
* <gridstack (changeCB)="onGridChange($event)" (droppedCB)="onItemDropped($event)">
* </gridstack>
* ```
*/
/** Emitted when widgets are added to the grid */
this.addedCB = new EventEmitter();
/** Emitted when grid layout changes */
this.changeCB = new EventEmitter();
/** Emitted when grid is disabled */
this.disableCB = new EventEmitter();
/** Emitted during widget drag operations */
this.dragCB = new EventEmitter();
/** Emitted when widget drag starts */
this.dragStartCB = new EventEmitter();
/** Emitted when widget drag stops */
this.dragStopCB = new EventEmitter();
/** Emitted when widget is dropped */
this.droppedCB = new EventEmitter();
/** Emitted when grid is enabled */
this.enableCB = new EventEmitter();
/** Emitted when widgets are removed from the grid */
this.removedCB = new EventEmitter();
/** Emitted during widget resize operations */
this.resizeCB = new EventEmitter();
/** Emitted when widget resize starts */
this.resizeStartCB = new EventEmitter();
/** Emitted when widget resize stops */
this.resizeStopCB = new EventEmitter();
// set globally our method to create the right widget type
if (!GridStack.addRemoveCB) {
GridStack.addRemoveCB = gsCreateNgComponents;
}
if (!GridStack.saveCB) {
GridStack.saveCB = gsSaveAdditionalNgInfo;
}
if (!GridStack.updateCB) {
GridStack.updateCB = gsUpdateNgComponents;
}
this.el._gridComp = this;
}
/**
* Grid configuration options.
* Can be set before grid initialization or updated after grid is created.
*
* @example
* ```typescript
* gridOptions: GridStackOptions = {
* column: 12,
* cellHeight: 'auto',
* animate: true
* };
* ```
*/
set options(o) {
if (this._grid) {
this._grid.updateOptions(o);
}
else {
this._options = o;
}
}
/** Get the current running grid options */
get options() { var _a; return ((_a = this._grid) === null || _a === void 0 ? void 0 : _a.opts) || this._options || {}; }
/**
* Get the native DOM element that contains grid-specific fields.
* This element has GridStack properties attached to it.
*/
get el() { return this.elementRef.nativeElement; }
/**
* Get the underlying GridStack instance.
* Use this to access GridStack API methods directly.
*
* @example
* ```typescript
* this.gridComponent.grid.addWidget({x: 0, y: 0, w: 2, h: 1});
* ```
*/
get grid() { return this._grid; }
/**
* Register a list of Angular components for dynamic creation.
*
* @param typeList Array of component types to register
*
* @example
* ```typescript
* GridstackComponent.addComponentToSelectorType([
* MyWidgetComponent,
* AnotherWidgetComponent
* ]);
* ```
*/
static addComponentToSelectorType(typeList) {
typeList.forEach(type => GridstackComponent.selectorToType[GridstackComponent.getSelector(type)] = type);
}
/**
* Extract the selector string from an Angular component type.
*
* @param type The component type to get selector from
* @returns The component's selector string
*/
static getSelector(type) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
return reflectComponentType(type).selector;
}
ngOnInit() {
var _a, _b;
// init ourself before any template children are created since we track them below anyway - no need to double create+update widgets
this.loaded = !!((_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.children) === null || _b === void 0 ? void 0 : _b.length);
this._grid = GridStack.init(this._options, this.el);
delete this._options; // GS has it now
this.checkEmpty();
}
/** wait until after all DOM is ready to init gridstack children (after angular ngFor and sub-components run first) */
ngAfterContentInit() {
var _a;
// track whenever the children list changes and update the layout...
this._sub = (_a = this.gridstackItems) === null || _a === void 0 ? void 0 : _a.changes.subscribe(() => this.updateAll());
// ...and do this once at least unless we loaded children already
if (!this.loaded)
this.updateAll();
this.hookEvents(this.grid);
}
ngOnDestroy() {
var _a, _b;
this.unhookEvents(this._grid);
(_a = this._sub) === null || _a === void 0 ? void 0 : _a.unsubscribe();
(_b = this._grid) === null || _b === void 0 ? void 0 : _b.destroy();
delete this._grid;
delete this.el._gridComp;
delete this.container;
delete this.ref;
}
/**
* called when the TEMPLATE (not recommended) list of items changes - get a list of nodes and
* update the layout accordingly (which will take care of adding/removing items changed by Angular)
*/
updateAll() {
var _a;
if (!this.grid)
return;
const layout = [];
(_a = this.gridstackItems) === null || _a === void 0 ? void 0 : _a.forEach(item => {
layout.push(item.options);
item.clearOptions();
});
this.grid.load(layout); // efficient that does diffs only
}
/** check if the grid is empty, if so show alternative content */
checkEmpty() {
if (!this.grid)
return;
this.isEmpty = !this.grid.engine.nodes.length;
}
/** get all known events as easy to use Outputs for convenience */
hookEvents(grid) {
if (!grid)
return;
// nested grids don't have events in v12.1+ so skip
if (grid.parentGridNode)
return;
grid
.on('added', (event, nodes) => {
var _a;
const gridComp = ((_a = nodes[0].grid) === null || _a === void 0 ? void 0 : _a.el._gridComp) || this;
gridComp.checkEmpty();
this.addedCB.emit({ event, nodes });
})
.on('change', (event, nodes) => this.changeCB.emit({ event, nodes }))
.on('disable', (event) => this.disableCB.emit({ event }))
.on('drag', (event, el) => this.dragCB.emit({ event, el }))
.on('dragstart', (event, el) => this.dragStartCB.emit({ event, el }))
.on('dragstop', (event, el) => this.dragStopCB.emit({ event, el }))
.on('dropped', (event, previousNode, newNode) => this.droppedCB.emit({ event, previousNode, newNode }))
.on('enable', (event) => this.enableCB.emit({ event }))
.on('removed', (event, nodes) => {
var _a;
const gridComp = ((_a = nodes[0].grid) === null || _a === void 0 ? void 0 : _a.el._gridComp) || this;
gridComp.checkEmpty();
this.removedCB.emit({ event, nodes });
})
.on('resize', (event, el) => this.resizeCB.emit({ event, el }))
.on('resizestart', (event, el) => this.resizeStartCB.emit({ event, el }))
.on('resizestop', (event, el) => this.resizeStopCB.emit({ event, el }));
}
unhookEvents(grid) {
if (!grid)
return;
// nested grids don't have events in v12.1+ so skip
if (grid.parentGridNode)
return;
grid.off('added change disable drag dragstart dragstop dropped enable removed resize resizestart resizestop');
}
}
/**
* Mapping of component selectors to their types for dynamic creation.
*
* This enables dynamic component instantiation from string selectors.
* Angular doesn't provide public access to this mapping, so we maintain our own.
*
* @example
* ```typescript
* GridstackComponent.addComponentToSelectorType([MyWidgetComponent]);
* ```
*/
GridstackComponent.selectorToType = {};
GridstackComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: GridstackComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
GridstackComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: GridstackComponent, isStandalone: true, selector: "gridstack", inputs: { options: "options", isEmpty: "isEmpty" }, outputs: { addedCB: "addedCB", changeCB: "changeCB", disableCB: "disableCB", dragCB: "dragCB", dragStartCB: "dragStartCB", dragStopCB: "dragStopCB", droppedCB: "droppedCB", enableCB: "enableCB", removedCB: "removedCB", resizeCB: "resizeCB", resizeStartCB: "resizeStartCB", resizeStopCB: "resizeStopCB" }, queries: [{ propertyName: "gridstackItems", predicate: GridstackItemComponent }], viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: `
<!-- content to show when when grid is empty, like instructions on how to add widgets -->
<ng-content select="[empty-content]" *ngIf="isEmpty"></ng-content>
<!-- where dynamic items go -->
<ng-template #container></ng-template>
<!-- where template items go -->
<ng-content></ng-content>
`, isInline: true, styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: GridstackComponent, decorators: [{
type: Component,
args: [{ selector: 'gridstack', template: `
<!-- content to show when when grid is empty, like instructions on how to add widgets -->
<ng-content select="[empty-content]" *ngIf="isEmpty"></ng-content>
<!-- where dynamic items go -->
<ng-template #container></ng-template>
<!-- where template items go -->
<ng-content></ng-content>
`, standalone: true, imports: [NgIf], styles: [":host{display:block}\n"] }]
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { gridstackItems: [{
type: ContentChildren,
args: [GridstackItemComponent]
}], container: [{
type: ViewChild,
args: ['container', { read: ViewContainerRef, static: true }]
}], options: [{
type: Input
}], isEmpty: [{
type: Input
}], addedCB: [{
type: Output
}], changeCB: [{
type: Output
}], disableCB: [{
type: Output
}], dragCB: [{
type: Output
}], dragStartCB: [{
type: Output
}], dragStopCB: [{
type: Output
}], droppedCB: [{
type: Output
}], enableCB: [{
type: Output
}], removedCB: [{
type: Output
}], resizeCB: [{
type: Output
}], resizeStartCB: [{
type: Output
}], resizeStopCB: [{
type: Output
}] } });
/**
* can be used when a new item needs to be created, which we do as a Angular component, or deleted (skip)
**/
function gsCreateNgComponents(host, n, add, isGrid) {
var _a, _b, _c, _d, _e, _f, _g;
if (add) {
//
// create the component dynamically - see https://angular.io/docs/ts/latest/cookbook/dynamic-component-loader.html
//
if (!host)
return;
if (isGrid) {
// TODO: figure out how to create ng component inside regular Div. need to access app injectors...
// if (!container) {
// const hostElement: Element = host;
// const environmentInjector: EnvironmentInjector;
// grid = createComponent(GridstackComponent, {environmentInjector, hostElement})?.instance;
// }
const gridItemComp = (_a = host.parentElement) === null || _a === void 0 ? void 0 : _a._gridItemComp;
if (!gridItemComp)
return;
// check if gridItem has a child component with 'container' exposed to create under..
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const container = ((_b = gridItemComp.childWidget) === null || _b === void 0 ? void 0 : _b.container) || gridItemComp.container;
const gridRef = container === null || container === void 0 ? void 0 : container.createComponent(GridstackComponent);
const grid = gridRef === null || gridRef === void 0 ? void 0 : gridRef.instance;
if (!grid)
return;
grid.ref = gridRef;
grid.options = n;
return grid.el;
}
else {
const gridComp = host._gridComp;
const gridItemRef = (_c = gridComp === null || gridComp === void 0 ? void 0 : gridComp.container) === null || _c === void 0 ? void 0 : _c.createComponent(GridstackItemComponent);
const gridItem = gridItemRef === null || gridItemRef === void 0 ? void 0 : gridItemRef.instance;
if (!gridItem)
return;
gridItem.ref = gridItemRef;
// define what type of component to create as child, OR you can do it GridstackItemComponent template, but this is more generic
const selector = n.selector;
const type = selector ? GridstackComponent.selectorToType[selector] : undefined;
if (type) {
// shared code to create our selector component
const createComp = () => {
var _a, _b;
const childWidget = (_b = (_a = gridItem.container) === null || _a === void 0 ? void 0 : _a.createComponent(type)) === null || _b === void 0 ? void 0 : _b.instance;
// if proper BaseWidget subclass, save it and load additional data
if (childWidget && typeof childWidget.serialize === 'function' && typeof childWidget.deserialize === 'function') {
gridItem.childWidget = childWidget;
childWidget.deserialize(n);
}
};
const lazyLoad = n.lazyLoad || ((_e = (_d = n.grid) === null || _d === void 0 ? void 0 : _d.opts) === null || _e === void 0 ? void 0 : _e.lazyLoad) && n.lazyLoad !== false;
if (lazyLoad) {
if (!n.visibleObservable) {
n.visibleObservable = new IntersectionObserver(([entry]) => {
var _a;
if (entry.isIntersecting) {
(_a = n.visibleObservable) === null || _a === void 0 ? void 0 : _a.disconnect();
delete n.visibleObservable;
createComp();
}
});
window.setTimeout(() => { var _a; return (_a = n.visibleObservable) === null || _a === void 0 ? void 0 : _a.observe(gridItem.el); }); // wait until callee sets position attributes
}
}
else
createComp();
}
return gridItem.el;
}
}
else {
//
// REMOVE - have to call ComponentRef:destroy() for dynamic objects to correctly remove themselves
// Note: this will destroy all children dynamic components as well: gridItem -> childWidget
//
if (isGrid) {
const grid = (_f = n.el) === null || _f === void 0 ? void 0 : _f._gridComp;
if (grid === null || grid === void 0 ? void 0 : grid.ref)
grid.ref.destroy();
else
grid === null || grid === void 0 ? void 0 : grid.ngOnDestroy();
}
else {
const gridItem = (_g = n.el) === null || _g === void 0 ? void 0 : _g._gridItemComp;
if (gridItem === null || gridItem === void 0 ? void 0 : gridItem.ref)
gridItem.ref.destroy();
else
gridItem === null || gridItem === void 0 ? void 0 : gridItem.ngOnDestroy();
}
}
return;
}
/**
* called for each item in the grid - check if additional information needs to be saved.
* Note: since this is options minus gridstack protected members using Utils.removeInternalForSave(),
* this typically doesn't need to do anything. However your custom Component @Input() are now supported
* using BaseWidget.serialize()
*/
function gsSaveAdditionalNgInfo(n, w) {
var _a, _b, _c;
const gridItem = (_a = n.el) === null || _a === void 0 ? void 0 : _a._gridItemComp;
if (gridItem) {
const input = (_b = gridItem.childWidget) === null || _b === void 0 ? void 0 : _b.serialize();
if (input) {
w.input = input;
}
return;
}
// else check if Grid
const grid = (_c = n.el) === null || _c === void 0 ? void 0 : _c._gridComp;
if (grid) {
//.... save any custom data
}
}
/**
* track when widgeta re updated (rather than created) to make sure we de-serialize them as well
*/
function gsUpdateNgComponents(n) {
var _a;
const w = n;
const gridItem = (_a = n.el) === null || _a === void 0 ? void 0 : _a._gridItemComp;
if ((gridItem === null || gridItem === void 0 ? void 0 : gridItem.childWidget) && w.input)
gridItem.childWidget.deserialize(w);
}
/**
* gridstack.component.ts 12.6.0
* Copyright (c) 2022-2024 Alain Dumesny - see GridStack root license
*/
/**
* @deprecated Use GridstackComponent and GridstackItemComponent as standalone components instead.
*
* This NgModule is provided for backward compatibility but is no longer the recommended approach.
* Import components directly in your standalone components or use the new Angular module structure.
*
* @example
* ```typescript
* // Preferred approach - standalone components
* @Component({
* selector: 'my-app',
* imports: [GridstackComponent, GridstackItemComponent],
* template: '<gridstack></gridstack>'
* })
* export class AppComponent {}
*
* // Legacy approach (deprecated)
* @NgModule({
* imports: [GridstackModule]
* })
* export class AppModule {}
* ```
*/
class GridstackModule {
}
GridstackModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: GridstackModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
GridstackModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: GridstackModule, imports: [GridstackItemComponent,
GridstackComponent], exports: [GridstackItemComponent,
GridstackComponent] });
GridstackModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: GridstackModule, imports: [GridstackItemComponent,
GridstackComponent] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: GridstackModule, decorators: [{
type: NgModule,
args: [{
imports: [
GridstackItemComponent,
GridstackComponent,
],
exports: [
GridstackItemComponent,
GridstackComponent,
],
}]
}] });
/*
* Public API Surface of gridstack-angular
*/
/**
* Generated bundle index. Do not edit.
*/
export { BaseWidget, GridstackComponent, GridstackItemComponent, GridstackModule, gsCreateNgComponents, gsSaveAdditionalNgInfo, gsUpdateNgComponents };
//# sourceMappingURL=gridstack-angular.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"draft7.js","sourceRoot":"","sources":["../../lib/vocabularies/draft7.ts"],"names":[],"mappings":";;AACA,iCAAmC;AACnC,6CAA+C;AAC/C,6CAAkD;AAClD,qCAAuC;AACvC,yCAAgE;AAEhE,MAAM,kBAAkB,GAAiB;IACvC,cAAc;IACd,oBAAoB;IACpB,IAAA,oBAAuB,GAAE;IACzB,gBAAgB;IAChB,6BAAkB;IAClB,4BAAiB;CAClB,CAAA;AAED,kBAAe,kBAAkB,CAAA"}
@@ -0,0 +1 @@
{"version":3,"names":["finalize","deepArr","Object","freeze","flattenToSet","arr","result","Set","stack","length","el","pop","Array","isArray","push","add"],"sources":["../../../src/config/helpers/deep-array.ts"],"sourcesContent":["export type DeepArray<T> = (T | ReadonlyDeepArray<T>)[];\n\n// Just to make sure that DeepArray<T> is not assignable to ReadonlyDeepArray<T>\ndeclare const __marker: unique symbol;\nexport type ReadonlyDeepArray<T> = readonly (T | ReadonlyDeepArray<T>)[] & {\n [__marker]: true;\n};\n\nexport function finalize<T>(deepArr: DeepArray<T>): ReadonlyDeepArray<T> {\n return Object.freeze(deepArr) as ReadonlyDeepArray<T>;\n}\n\nexport function flattenToSet<T extends string>(\n arr: ReadonlyDeepArray<T>,\n): Set<T> {\n const result = new Set<T>();\n const stack = [arr];\n while (stack.length > 0) {\n for (const el of stack.pop()) {\n if (Array.isArray(el)) stack.push(el as ReadonlyDeepArray<T>);\n else result.add(el as T);\n }\n }\n return result;\n}\n"],"mappings":";;;;;;;AAQO,SAASA,QAAQA,CAAIC,OAAqB,EAAwB;EACvE,OAAOC,MAAM,CAACC,MAAM,CAACF,OAAO,CAAC;AAC/B;AAEO,SAASG,YAAYA,CAC1BC,GAAyB,EACjB;EACR,MAAMC,MAAM,GAAG,IAAIC,GAAG,CAAI,CAAC;EAC3B,MAAMC,KAAK,GAAG,CAACH,GAAG,CAAC;EACnB,OAAOG,KAAK,CAACC,MAAM,GAAG,CAAC,EAAE;IACvB,KAAK,MAAMC,EAAE,IAAIF,KAAK,CAACG,GAAG,CAAC,CAAC,EAAE;MAC5B,IAAIC,KAAK,CAACC,OAAO,CAACH,EAAE,CAAC,EAAEF,KAAK,CAACM,IAAI,CAACJ,EAA0B,CAAC,CAAC,KACzDJ,MAAM,CAACS,GAAG,CAACL,EAAO,CAAC;IAC1B;EACF;EACA,OAAOJ,MAAM;AACf;AAAC","ignoreList":[]}
@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Grid2x2 = createLucideIcon("Grid2x2", [
["path", { d: "M12 3v18", key: "108xh3" }],
["path", { d: "M3 12h18", key: "1i2n21" }],
["rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", key: "h1oib" }]
]);
export { Grid2x2 as default };
//# sourceMappingURL=grid-2x2.js.map
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_9C","2":"_aB"},C:{"1":"_LJ _bF","2":"_q _aH yB _L"},D:{"1":"_kQ","2":"_LE"},E:{"1":"_JB","2":"_RB"},F:{"1":"_nR","2":"_QM"},G:{"1":"_9","2":"_iB"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:4,C:"Upgrade Insecure Requests",D:true};
@@ -0,0 +1,21 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const CloudDrizzle = createLucideIcon("CloudDrizzle", [
["path", { d: "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242", key: "1pljnt" }],
["path", { d: "M8 19v1", key: "1dk2by" }],
["path", { d: "M8 14v1", key: "84yxot" }],
["path", { d: "M16 19v1", key: "v220m7" }],
["path", { d: "M16 14v1", key: "g12gj6" }],
["path", { d: "M12 21v1", key: "q8vafk" }],
["path", { d: "M12 16v1", key: "1mx6rx" }]
]);
export { CloudDrizzle as default };
//# sourceMappingURL=cloud-drizzle.js.map
@@ -0,0 +1,47 @@
{
"name": "istanbul-lib-coverage",
"version": "3.2.2",
"description": "Data library for istanbul coverage objects",
"author": "Krishnan Anantheswaran <kananthmail-github@yahoo.com>",
"main": "index.js",
"files": [
"lib",
"index.js"
],
"scripts": {
"test": "nyc mocha"
},
"devDependencies": {
"chai": "^4.2.0",
"mocha": "^6.2.2",
"nyc": "^15.0.0-beta.2"
},
"karmaDeps": {
"browserify-istanbul": "^0.2.1",
"karma": "^0.13.10",
"karma-browserify": "^4.2.1",
"karma-chrome-launcher": "^0.2.0",
"karma-coverage": "^0.4.2",
"karma-mocha": "^0.2.0",
"karma-phantomjs-launcher": "^0.2.0",
"phantomjs": "^1.9.17"
},
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/istanbuljs/istanbuljs.git",
"directory": "packages/istanbul-lib-coverage"
},
"keywords": [
"istanbul",
"coverage",
"data"
],
"license": "BSD-3-Clause",
"bugs": {
"url": "https://github.com/istanbuljs/istanbuljs/issues"
},
"homepage": "https://istanbul.js.org/",
"engines": {
"node": ">=8"
}
}
@@ -0,0 +1,96 @@
const alwaysContainsScroll = (node) =>
// textarea will always _contain_ scroll inside self. It only can be hidden
node.tagName === 'TEXTAREA';
const elementCanBeScrolled = (node, overflow) => {
if (!(node instanceof Element)) {
return false;
}
const styles = window.getComputedStyle(node);
return (
// not-not-scrollable
styles[overflow] !== 'hidden' &&
// contains scroll inside self
!(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === 'visible'));
};
const elementCouldBeVScrolled = (node) => elementCanBeScrolled(node, 'overflowY');
const elementCouldBeHScrolled = (node) => elementCanBeScrolled(node, 'overflowX');
export const locationCouldBeScrolled = (axis, node) => {
const ownerDocument = node.ownerDocument;
let current = node;
do {
// Skip over shadow root
if (typeof ShadowRoot !== 'undefined' && current instanceof ShadowRoot) {
current = current.host;
}
const isScrollable = elementCouldBeScrolled(axis, current);
if (isScrollable) {
const [, scrollHeight, clientHeight] = getScrollVariables(axis, current);
if (scrollHeight > clientHeight) {
return true;
}
}
current = current.parentNode;
} while (current && current !== ownerDocument.body);
return false;
};
const getVScrollVariables = ({ scrollTop, scrollHeight, clientHeight }) => [
scrollTop,
scrollHeight,
clientHeight,
];
const getHScrollVariables = ({ scrollLeft, scrollWidth, clientWidth }) => [
scrollLeft,
scrollWidth,
clientWidth,
];
const elementCouldBeScrolled = (axis, node) => axis === 'v' ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
const getScrollVariables = (axis, node) => axis === 'v' ? getVScrollVariables(node) : getHScrollVariables(node);
const getDirectionFactor = (axis, direction) =>
/**
* If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position,
* and then increasingly negative as you scroll towards the end of the content.
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft
*/
axis === 'h' && direction === 'rtl' ? -1 : 1;
export const handleScroll = (axis, endTarget, event, sourceDelta, noOverscroll) => {
const directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
const delta = directionFactor * sourceDelta;
// find scrollable target
let target = event.target;
const targetInLock = endTarget.contains(target);
let shouldCancelScroll = false;
const isDeltaPositive = delta > 0;
let availableScroll = 0;
let availableScrollTop = 0;
do {
if (!target) {
break;
}
const [position, scroll, capacity] = getScrollVariables(axis, target);
const elementScroll = scroll - capacity - directionFactor * position;
if (position || elementScroll) {
if (elementCouldBeScrolled(axis, target)) {
availableScroll += elementScroll;
availableScrollTop += position;
}
}
const parent = target.parentNode;
// we will "bubble" from ShadowDom in case we are, or just to the parent in normal case
// this is the same logic used in focus-lock
target = (parent && parent.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent.host : parent);
} while (
// portaled content
(!targetInLock && target !== document.body) ||
// self content
(targetInLock && (endTarget.contains(target) || endTarget === target)));
// handle epsilon around 0 (non standard zoom levels)
if (isDeltaPositive &&
((noOverscroll && Math.abs(availableScroll) < 1) || (!noOverscroll && delta > availableScroll))) {
shouldCancelScroll = true;
}
else if (!isDeltaPositive &&
((noOverscroll && Math.abs(availableScrollTop) < 1) || (!noOverscroll && -delta > availableScrollTop))) {
shouldCancelScroll = true;
}
return shouldCancelScroll;
};
@@ -0,0 +1 @@
{"version":3,"names":["_classApplyDescriptorDestructureSet","require","_assertClassBrand","_classCheckPrivateStaticFieldDescriptor","_classStaticPrivateFieldDestructureSet","receiver","classConstructor","descriptor","assertClassBrand","classCheckPrivateStaticFieldDescriptor","classApplyDescriptorDestructureSet"],"sources":["../../src/helpers/classStaticPrivateFieldDestructureSet.js"],"sourcesContent":["/* @minVersion 7.13.10 */\n/* @onlyBabel7 */\n\nimport classApplyDescriptorDestructureSet from \"classApplyDescriptorDestructureSet\";\nimport assertClassBrand from \"assertClassBrand\";\nimport classCheckPrivateStaticFieldDescriptor from \"classCheckPrivateStaticFieldDescriptor\";\nexport default function _classStaticPrivateFieldDestructureSet(\n receiver,\n classConstructor,\n descriptor,\n) {\n assertClassBrand(classConstructor, receiver);\n classCheckPrivateStaticFieldDescriptor(descriptor, \"set\");\n return classApplyDescriptorDestructureSet(receiver, descriptor);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,mCAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,uCAAA,GAAAF,OAAA;AACe,SAASG,sCAAsCA,CAC5DC,QAAQ,EACRC,gBAAgB,EAChBC,UAAU,EACV;EACAC,iBAAgB,CAACF,gBAAgB,EAAED,QAAQ,CAAC;EAC5CI,uCAAsC,CAACF,UAAU,EAAE,KAAK,CAAC;EACzD,OAAOG,mCAAkC,CAACL,QAAQ,EAAEE,UAAU,CAAC;AACjE","ignoreList":[]}
@@ -0,0 +1,358 @@
/**
* @fileoverview Rule to check empty newline between class members
* @author 薛定谔的猫<hh_2013@foxmail.com>
* @deprecated in ESLint v8.53.0
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Types of class members.
* Those have `test` method to check it matches to the given class member.
* @private
*/
const ClassMemberTypes = {
"*": { test: () => true },
field: { test: node => node.type === "PropertyDefinition" },
method: { test: node => node.type === "MethodDefinition" },
};
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "8.53.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "lines-between-class-members",
url: "https://eslint.style/rules/lines-between-class-members",
},
},
],
},
type: "layout",
docs: {
description:
"Require or disallow an empty line between class members",
recommended: false,
url: "https://eslint.org/docs/latest/rules/lines-between-class-members",
},
fixable: "whitespace",
schema: [
{
anyOf: [
{
type: "object",
properties: {
enforce: {
type: "array",
items: {
type: "object",
properties: {
blankLine: {
enum: ["always", "never"],
},
prev: {
enum: ["method", "field", "*"],
},
next: {
enum: ["method", "field", "*"],
},
},
additionalProperties: false,
required: ["blankLine", "prev", "next"],
},
minItems: 1,
},
},
additionalProperties: false,
required: ["enforce"],
},
{
enum: ["always", "never"],
},
],
},
{
type: "object",
properties: {
exceptAfterSingleLine: {
type: "boolean",
default: false,
},
},
additionalProperties: false,
},
],
messages: {
never: "Unexpected blank line between class members.",
always: "Expected blank line between class members.",
},
},
create(context) {
const options = [];
options[0] = context.options[0] || "always";
options[1] = context.options[1] || { exceptAfterSingleLine: false };
const configureList =
typeof options[0] === "object"
? options[0].enforce
: [{ blankLine: options[0], prev: "*", next: "*" }];
const sourceCode = context.sourceCode;
/**
* Gets a pair of tokens that should be used to check lines between two class member nodes.
*
* In most cases, this returns the very last token of the current node and
* the very first token of the next node.
* For example:
*
* class C {
* x = 1; // curLast: `;` nextFirst: `in`
* in = 2
* }
*
* There is only one exception. If the given node ends with a semicolon, and it looks like
* a semicolon-less style's semicolon - one that is not on the same line as the preceding
* token, but is on the line where the next class member starts - this returns the preceding
* token and the semicolon as boundary tokens.
* For example:
*
* class C {
* x = 1 // curLast: `1` nextFirst: `;`
* ;in = 2
* }
* When determining the desired layout of the code, we should treat this semicolon as
* a part of the next class member node instead of the one it technically belongs to.
* @param {ASTNode} curNode Current class member node.
* @param {ASTNode} nextNode Next class member node.
* @returns {Token} The actual last token of `node`.
* @private
*/
function getBoundaryTokens(curNode, nextNode) {
const lastToken = sourceCode.getLastToken(curNode);
const prevToken = sourceCode.getTokenBefore(lastToken);
const nextToken = sourceCode.getFirstToken(nextNode); // skip possible lone `;` between nodes
const isSemicolonLessStyle =
astUtils.isSemicolonToken(lastToken) &&
!astUtils.isTokenOnSameLine(prevToken, lastToken) &&
astUtils.isTokenOnSameLine(lastToken, nextToken);
return isSemicolonLessStyle
? { curLast: prevToken, nextFirst: lastToken }
: { curLast: lastToken, nextFirst: nextToken };
}
/**
* Return the last token among the consecutive tokens that have no exceed max line difference in between, before the first token in the next member.
* @param {Token} prevLastToken The last token in the previous member node.
* @param {Token} nextFirstToken The first token in the next member node.
* @param {number} maxLine The maximum number of allowed line difference between consecutive tokens.
* @returns {Token} The last token among the consecutive tokens.
*/
function findLastConsecutiveTokenAfter(
prevLastToken,
nextFirstToken,
maxLine,
) {
const after = sourceCode.getTokenAfter(prevLastToken, {
includeComments: true,
});
if (
after !== nextFirstToken &&
after.loc.start.line - prevLastToken.loc.end.line <= maxLine
) {
return findLastConsecutiveTokenAfter(
after,
nextFirstToken,
maxLine,
);
}
return prevLastToken;
}
/**
* Return the first token among the consecutive tokens that have no exceed max line difference in between, after the last token in the previous member.
* @param {Token} nextFirstToken The first token in the next member node.
* @param {Token} prevLastToken The last token in the previous member node.
* @param {number} maxLine The maximum number of allowed line difference between consecutive tokens.
* @returns {Token} The first token among the consecutive tokens.
*/
function findFirstConsecutiveTokenBefore(
nextFirstToken,
prevLastToken,
maxLine,
) {
const before = sourceCode.getTokenBefore(nextFirstToken, {
includeComments: true,
});
if (
before !== prevLastToken &&
nextFirstToken.loc.start.line - before.loc.end.line <= maxLine
) {
return findFirstConsecutiveTokenBefore(
before,
prevLastToken,
maxLine,
);
}
return nextFirstToken;
}
/**
* Checks if there is a token or comment between two tokens.
* @param {Token} before The token before.
* @param {Token} after The token after.
* @returns {boolean} True if there is a token or comment between two tokens.
*/
function hasTokenOrCommentBetween(before, after) {
return (
sourceCode.getTokensBetween(before, after, {
includeComments: true,
}).length !== 0
);
}
/**
* Checks whether the given node matches the given type.
* @param {ASTNode} node The class member node to check.
* @param {string} type The class member type to check.
* @returns {boolean} `true` if the class member node matched the type.
* @private
*/
function match(node, type) {
return ClassMemberTypes[type].test(node);
}
/**
* Finds the last matched configuration from the configureList.
* @param {ASTNode} prevNode The previous node to match.
* @param {ASTNode} nextNode The current node to match.
* @returns {string|null} Padding type or `null` if no matches were found.
* @private
*/
function getPaddingType(prevNode, nextNode) {
for (let i = configureList.length - 1; i >= 0; --i) {
const configure = configureList[i];
const matched =
match(prevNode, configure.prev) &&
match(nextNode, configure.next);
if (matched) {
return configure.blankLine;
}
}
return null;
}
return {
ClassBody(node) {
const body = node.body;
for (let i = 0; i < body.length - 1; i++) {
const curFirst = sourceCode.getFirstToken(body[i]);
const { curLast, nextFirst } = getBoundaryTokens(
body[i],
body[i + 1],
);
const isMulti = !astUtils.isTokenOnSameLine(
curFirst,
curLast,
);
const skip = !isMulti && options[1].exceptAfterSingleLine;
const beforePadding = findLastConsecutiveTokenAfter(
curLast,
nextFirst,
1,
);
const afterPadding = findFirstConsecutiveTokenBefore(
nextFirst,
curLast,
1,
);
const isPadded =
afterPadding.loc.start.line -
beforePadding.loc.end.line >
1;
const hasTokenInPadding = hasTokenOrCommentBetween(
beforePadding,
afterPadding,
);
const curLineLastToken = findLastConsecutiveTokenAfter(
curLast,
nextFirst,
0,
);
const paddingType = getPaddingType(body[i], body[i + 1]);
if (paddingType === "never" && isPadded) {
context.report({
node: body[i + 1],
messageId: "never",
fix(fixer) {
if (hasTokenInPadding) {
return null;
}
return fixer.replaceTextRange(
[
beforePadding.range[1],
afterPadding.range[0],
],
"\n",
);
},
});
} else if (paddingType === "always" && !skip && !isPadded) {
context.report({
node: body[i + 1],
messageId: "always",
fix(fixer) {
if (hasTokenInPadding) {
return null;
}
return fixer.insertTextAfter(
curLineLastToken,
"\n",
);
},
});
}
}
},
};
},
};
@@ -0,0 +1,19 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Crosshair = createLucideIcon("Crosshair", [
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
["line", { x1: "22", x2: "18", y1: "12", y2: "12", key: "l9bcsi" }],
["line", { x1: "6", x2: "2", y1: "12", y2: "12", key: "13hhkx" }],
["line", { x1: "12", x2: "12", y1: "6", y2: "2", key: "10w3f3" }],
["line", { x1: "12", x2: "12", y1: "22", y2: "18", key: "15g9kq" }]
]);
export { Crosshair as default };
//# sourceMappingURL=crosshair.js.map
@@ -0,0 +1,26 @@
'use strict';
var Cache = module.exports = function Cache() {
this._cache = {};
};
Cache.prototype.put = function Cache_put(key, value) {
this._cache[key] = value;
};
Cache.prototype.get = function Cache_get(key) {
return this._cache[key];
};
Cache.prototype.del = function Cache_del(key) {
delete this._cache[key];
};
Cache.prototype.clear = function Cache_clear() {
this._cache = {};
};
@@ -0,0 +1 @@
{"version":3,"file":"symbol.mjs","sources":["../../../../src/motion/utils/symbol.ts"],"sourcesContent":["export const motionComponentSymbol = Symbol.for(\"motionComponentSymbol\")\n"],"names":[],"mappings":"AAAO,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAC,uBAAuB;;;;"}
@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.contentVocabulary = exports.metadataVocabulary = void 0;
exports.metadataVocabulary = [
"title",
"description",
"default",
"deprecated",
"readOnly",
"writeOnly",
"examples",
];
exports.contentVocabulary = [
"contentMediaType",
"contentEncoding",
"contentSchema",
];
//# sourceMappingURL=metadata.js.map
@@ -0,0 +1,739 @@
"use client";
// src/scroll-area.tsx
import * as React2 from "react";
import { Primitive } from "@radix-ui/react-primitive";
import { Presence } from "@radix-ui/react-presence";
import { createContextScope } from "@radix-ui/react-context";
import { useComposedRefs } from "@radix-ui/react-compose-refs";
import { useCallbackRef } from "@radix-ui/react-use-callback-ref";
import { useDirection } from "@radix-ui/react-direction";
import { useLayoutEffect } from "@radix-ui/react-use-layout-effect";
import { clamp } from "@radix-ui/number";
import { composeEventHandlers } from "@radix-ui/primitive";
// src/use-state-machine.ts
import * as React from "react";
function useStateMachine(initialState, machine) {
return React.useReducer((state, event) => {
const nextState = machine[state][event];
return nextState ?? state;
}, initialState);
}
// src/scroll-area.tsx
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
var SCROLL_AREA_NAME = "ScrollArea";
var [createScrollAreaContext, createScrollAreaScope] = createContextScope(SCROLL_AREA_NAME);
var [ScrollAreaProvider, useScrollAreaContext] = createScrollAreaContext(SCROLL_AREA_NAME);
var ScrollArea = React2.forwardRef(
(props, forwardedRef) => {
const {
__scopeScrollArea,
type = "hover",
dir,
scrollHideDelay = 600,
...scrollAreaProps
} = props;
const [scrollArea, setScrollArea] = React2.useState(null);
const [viewport, setViewport] = React2.useState(null);
const [content, setContent] = React2.useState(null);
const [scrollbarX, setScrollbarX] = React2.useState(null);
const [scrollbarY, setScrollbarY] = React2.useState(null);
const [cornerWidth, setCornerWidth] = React2.useState(0);
const [cornerHeight, setCornerHeight] = React2.useState(0);
const [scrollbarXEnabled, setScrollbarXEnabled] = React2.useState(false);
const [scrollbarYEnabled, setScrollbarYEnabled] = React2.useState(false);
const composedRefs = useComposedRefs(forwardedRef, (node) => setScrollArea(node));
const direction = useDirection(dir);
return /* @__PURE__ */ jsx(
ScrollAreaProvider,
{
scope: __scopeScrollArea,
type,
dir: direction,
scrollHideDelay,
scrollArea,
viewport,
onViewportChange: setViewport,
content,
onContentChange: setContent,
scrollbarX,
onScrollbarXChange: setScrollbarX,
scrollbarXEnabled,
onScrollbarXEnabledChange: setScrollbarXEnabled,
scrollbarY,
onScrollbarYChange: setScrollbarY,
scrollbarYEnabled,
onScrollbarYEnabledChange: setScrollbarYEnabled,
onCornerWidthChange: setCornerWidth,
onCornerHeightChange: setCornerHeight,
children: /* @__PURE__ */ jsx(
Primitive.div,
{
dir: direction,
...scrollAreaProps,
ref: composedRefs,
style: {
position: "relative",
// Pass corner sizes as CSS vars to reduce re-renders of context consumers
["--radix-scroll-area-corner-width"]: cornerWidth + "px",
["--radix-scroll-area-corner-height"]: cornerHeight + "px",
...props.style
}
}
)
}
);
}
);
ScrollArea.displayName = SCROLL_AREA_NAME;
var VIEWPORT_NAME = "ScrollAreaViewport";
var ScrollAreaViewport = React2.forwardRef(
(props, forwardedRef) => {
const { __scopeScrollArea, children, nonce, ...viewportProps } = props;
const context = useScrollAreaContext(VIEWPORT_NAME, __scopeScrollArea);
const ref = React2.useRef(null);
const composedRefs = useComposedRefs(forwardedRef, ref, context.onViewportChange);
return /* @__PURE__ */ jsxs(Fragment, { children: [
/* @__PURE__ */ jsx(
"style",
{
dangerouslySetInnerHTML: {
__html: `[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`
},
nonce
}
),
/* @__PURE__ */ jsx(
Primitive.div,
{
"data-radix-scroll-area-viewport": "",
...viewportProps,
ref: composedRefs,
style: {
/**
* We don't support `visible` because the intention is to have at least one scrollbar
* if this component is used and `visible` will behave like `auto` in that case
* https://developer.mozilla.org/en-US/docs/Web/CSS/overflow#description
*
* We don't handle `auto` because the intention is for the native implementation
* to be hidden if using this component. We just want to ensure the node is scrollable
* so could have used either `scroll` or `auto` here. We picked `scroll` to prevent
* the browser from having to work out whether to render native scrollbars or not,
* we tell it to with the intention of hiding them in CSS.
*/
overflowX: context.scrollbarXEnabled ? "scroll" : "hidden",
overflowY: context.scrollbarYEnabled ? "scroll" : "hidden",
...props.style
},
children: /* @__PURE__ */ jsx("div", { ref: context.onContentChange, style: { minWidth: "100%", display: "table" }, children })
}
)
] });
}
);
ScrollAreaViewport.displayName = VIEWPORT_NAME;
var SCROLLBAR_NAME = "ScrollAreaScrollbar";
var ScrollAreaScrollbar = React2.forwardRef(
(props, forwardedRef) => {
const { forceMount, ...scrollbarProps } = props;
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
const { onScrollbarXEnabledChange, onScrollbarYEnabledChange } = context;
const isHorizontal = props.orientation === "horizontal";
React2.useEffect(() => {
isHorizontal ? onScrollbarXEnabledChange(true) : onScrollbarYEnabledChange(true);
return () => {
isHorizontal ? onScrollbarXEnabledChange(false) : onScrollbarYEnabledChange(false);
};
}, [isHorizontal, onScrollbarXEnabledChange, onScrollbarYEnabledChange]);
return context.type === "hover" ? /* @__PURE__ */ jsx(ScrollAreaScrollbarHover, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === "scroll" ? /* @__PURE__ */ jsx(ScrollAreaScrollbarScroll, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === "auto" ? /* @__PURE__ */ jsx(ScrollAreaScrollbarAuto, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === "always" ? /* @__PURE__ */ jsx(ScrollAreaScrollbarVisible, { ...scrollbarProps, ref: forwardedRef }) : null;
}
);
ScrollAreaScrollbar.displayName = SCROLLBAR_NAME;
var ScrollAreaScrollbarHover = React2.forwardRef((props, forwardedRef) => {
const { forceMount, ...scrollbarProps } = props;
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
const [visible, setVisible] = React2.useState(false);
React2.useEffect(() => {
const scrollArea = context.scrollArea;
let hideTimer = 0;
if (scrollArea) {
const handlePointerEnter = () => {
window.clearTimeout(hideTimer);
setVisible(true);
};
const handlePointerLeave = () => {
hideTimer = window.setTimeout(() => setVisible(false), context.scrollHideDelay);
};
scrollArea.addEventListener("pointerenter", handlePointerEnter);
scrollArea.addEventListener("pointerleave", handlePointerLeave);
return () => {
window.clearTimeout(hideTimer);
scrollArea.removeEventListener("pointerenter", handlePointerEnter);
scrollArea.removeEventListener("pointerleave", handlePointerLeave);
};
}
}, [context.scrollArea, context.scrollHideDelay]);
return /* @__PURE__ */ jsx(Presence, { present: forceMount || visible, children: /* @__PURE__ */ jsx(
ScrollAreaScrollbarAuto,
{
"data-state": visible ? "visible" : "hidden",
...scrollbarProps,
ref: forwardedRef
}
) });
});
var ScrollAreaScrollbarScroll = React2.forwardRef((props, forwardedRef) => {
const { forceMount, ...scrollbarProps } = props;
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
const isHorizontal = props.orientation === "horizontal";
const debounceScrollEnd = useDebounceCallback(() => send("SCROLL_END"), 100);
const [state, send] = useStateMachine("hidden", {
hidden: {
SCROLL: "scrolling"
},
scrolling: {
SCROLL_END: "idle",
POINTER_ENTER: "interacting"
},
interacting: {
SCROLL: "interacting",
POINTER_LEAVE: "idle"
},
idle: {
HIDE: "hidden",
SCROLL: "scrolling",
POINTER_ENTER: "interacting"
}
});
React2.useEffect(() => {
if (state === "idle") {
const hideTimer = window.setTimeout(() => send("HIDE"), context.scrollHideDelay);
return () => window.clearTimeout(hideTimer);
}
}, [state, context.scrollHideDelay, send]);
React2.useEffect(() => {
const viewport = context.viewport;
const scrollDirection = isHorizontal ? "scrollLeft" : "scrollTop";
if (viewport) {
let prevScrollPos = viewport[scrollDirection];
const handleScroll = () => {
const scrollPos = viewport[scrollDirection];
const hasScrollInDirectionChanged = prevScrollPos !== scrollPos;
if (hasScrollInDirectionChanged) {
send("SCROLL");
debounceScrollEnd();
}
prevScrollPos = scrollPos;
};
viewport.addEventListener("scroll", handleScroll);
return () => viewport.removeEventListener("scroll", handleScroll);
}
}, [context.viewport, isHorizontal, send, debounceScrollEnd]);
return /* @__PURE__ */ jsx(Presence, { present: forceMount || state !== "hidden", children: /* @__PURE__ */ jsx(
ScrollAreaScrollbarVisible,
{
"data-state": state === "hidden" ? "hidden" : "visible",
...scrollbarProps,
ref: forwardedRef,
onPointerEnter: composeEventHandlers(props.onPointerEnter, () => send("POINTER_ENTER")),
onPointerLeave: composeEventHandlers(props.onPointerLeave, () => send("POINTER_LEAVE"))
}
) });
});
var ScrollAreaScrollbarAuto = React2.forwardRef((props, forwardedRef) => {
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
const { forceMount, ...scrollbarProps } = props;
const [visible, setVisible] = React2.useState(false);
const isHorizontal = props.orientation === "horizontal";
const handleResize = useDebounceCallback(() => {
if (context.viewport) {
const isOverflowX = context.viewport.offsetWidth < context.viewport.scrollWidth;
const isOverflowY = context.viewport.offsetHeight < context.viewport.scrollHeight;
setVisible(isHorizontal ? isOverflowX : isOverflowY);
}
}, 10);
useResizeObserver(context.viewport, handleResize);
useResizeObserver(context.content, handleResize);
return /* @__PURE__ */ jsx(Presence, { present: forceMount || visible, children: /* @__PURE__ */ jsx(
ScrollAreaScrollbarVisible,
{
"data-state": visible ? "visible" : "hidden",
...scrollbarProps,
ref: forwardedRef
}
) });
});
var ScrollAreaScrollbarVisible = React2.forwardRef((props, forwardedRef) => {
const { orientation = "vertical", ...scrollbarProps } = props;
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
const thumbRef = React2.useRef(null);
const pointerOffsetRef = React2.useRef(0);
const [sizes, setSizes] = React2.useState({
content: 0,
viewport: 0,
scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
});
const thumbRatio = getThumbRatio(sizes.viewport, sizes.content);
const commonProps = {
...scrollbarProps,
sizes,
onSizesChange: setSizes,
hasThumb: Boolean(thumbRatio > 0 && thumbRatio < 1),
onThumbChange: (thumb) => thumbRef.current = thumb,
onThumbPointerUp: () => pointerOffsetRef.current = 0,
onThumbPointerDown: (pointerPos) => pointerOffsetRef.current = pointerPos
};
function getScrollPosition(pointerPos, dir) {
return getScrollPositionFromPointer(pointerPos, pointerOffsetRef.current, sizes, dir);
}
if (orientation === "horizontal") {
return /* @__PURE__ */ jsx(
ScrollAreaScrollbarX,
{
...commonProps,
ref: forwardedRef,
onThumbPositionChange: () => {
if (context.viewport && thumbRef.current) {
const scrollPos = context.viewport.scrollLeft;
const offset = getThumbOffsetFromScroll(scrollPos, sizes, context.dir);
thumbRef.current.style.transform = `translate3d(${offset}px, 0, 0)`;
}
},
onWheelScroll: (scrollPos) => {
if (context.viewport) context.viewport.scrollLeft = scrollPos;
},
onDragScroll: (pointerPos) => {
if (context.viewport) {
context.viewport.scrollLeft = getScrollPosition(pointerPos, context.dir);
}
}
}
);
}
if (orientation === "vertical") {
return /* @__PURE__ */ jsx(
ScrollAreaScrollbarY,
{
...commonProps,
ref: forwardedRef,
onThumbPositionChange: () => {
if (context.viewport && thumbRef.current) {
const scrollPos = context.viewport.scrollTop;
const offset = getThumbOffsetFromScroll(scrollPos, sizes);
thumbRef.current.style.transform = `translate3d(0, ${offset}px, 0)`;
}
},
onWheelScroll: (scrollPos) => {
if (context.viewport) context.viewport.scrollTop = scrollPos;
},
onDragScroll: (pointerPos) => {
if (context.viewport) context.viewport.scrollTop = getScrollPosition(pointerPos);
}
}
);
}
return null;
});
var ScrollAreaScrollbarX = React2.forwardRef((props, forwardedRef) => {
const { sizes, onSizesChange, ...scrollbarProps } = props;
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
const [computedStyle, setComputedStyle] = React2.useState();
const ref = React2.useRef(null);
const composeRefs = useComposedRefs(forwardedRef, ref, context.onScrollbarXChange);
React2.useEffect(() => {
if (ref.current) setComputedStyle(getComputedStyle(ref.current));
}, [ref]);
return /* @__PURE__ */ jsx(
ScrollAreaScrollbarImpl,
{
"data-orientation": "horizontal",
...scrollbarProps,
ref: composeRefs,
sizes,
style: {
bottom: 0,
left: context.dir === "rtl" ? "var(--radix-scroll-area-corner-width)" : 0,
right: context.dir === "ltr" ? "var(--radix-scroll-area-corner-width)" : 0,
["--radix-scroll-area-thumb-width"]: getThumbSize(sizes) + "px",
...props.style
},
onThumbPointerDown: (pointerPos) => props.onThumbPointerDown(pointerPos.x),
onDragScroll: (pointerPos) => props.onDragScroll(pointerPos.x),
onWheelScroll: (event, maxScrollPos) => {
if (context.viewport) {
const scrollPos = context.viewport.scrollLeft + event.deltaX;
props.onWheelScroll(scrollPos);
if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) {
event.preventDefault();
}
}
},
onResize: () => {
if (ref.current && context.viewport && computedStyle) {
onSizesChange({
content: context.viewport.scrollWidth,
viewport: context.viewport.offsetWidth,
scrollbar: {
size: ref.current.clientWidth,
paddingStart: toInt(computedStyle.paddingLeft),
paddingEnd: toInt(computedStyle.paddingRight)
}
});
}
}
}
);
});
var ScrollAreaScrollbarY = React2.forwardRef((props, forwardedRef) => {
const { sizes, onSizesChange, ...scrollbarProps } = props;
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
const [computedStyle, setComputedStyle] = React2.useState();
const ref = React2.useRef(null);
const composeRefs = useComposedRefs(forwardedRef, ref, context.onScrollbarYChange);
React2.useEffect(() => {
if (ref.current) setComputedStyle(getComputedStyle(ref.current));
}, [ref]);
return /* @__PURE__ */ jsx(
ScrollAreaScrollbarImpl,
{
"data-orientation": "vertical",
...scrollbarProps,
ref: composeRefs,
sizes,
style: {
top: 0,
right: context.dir === "ltr" ? 0 : void 0,
left: context.dir === "rtl" ? 0 : void 0,
bottom: "var(--radix-scroll-area-corner-height)",
["--radix-scroll-area-thumb-height"]: getThumbSize(sizes) + "px",
...props.style
},
onThumbPointerDown: (pointerPos) => props.onThumbPointerDown(pointerPos.y),
onDragScroll: (pointerPos) => props.onDragScroll(pointerPos.y),
onWheelScroll: (event, maxScrollPos) => {
if (context.viewport) {
const scrollPos = context.viewport.scrollTop + event.deltaY;
props.onWheelScroll(scrollPos);
if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) {
event.preventDefault();
}
}
},
onResize: () => {
if (ref.current && context.viewport && computedStyle) {
onSizesChange({
content: context.viewport.scrollHeight,
viewport: context.viewport.offsetHeight,
scrollbar: {
size: ref.current.clientHeight,
paddingStart: toInt(computedStyle.paddingTop),
paddingEnd: toInt(computedStyle.paddingBottom)
}
});
}
}
}
);
});
var [ScrollbarProvider, useScrollbarContext] = createScrollAreaContext(SCROLLBAR_NAME);
var ScrollAreaScrollbarImpl = React2.forwardRef((props, forwardedRef) => {
const {
__scopeScrollArea,
sizes,
hasThumb,
onThumbChange,
onThumbPointerUp,
onThumbPointerDown,
onThumbPositionChange,
onDragScroll,
onWheelScroll,
onResize,
...scrollbarProps
} = props;
const context = useScrollAreaContext(SCROLLBAR_NAME, __scopeScrollArea);
const [scrollbar, setScrollbar] = React2.useState(null);
const composeRefs = useComposedRefs(forwardedRef, (node) => setScrollbar(node));
const rectRef = React2.useRef(null);
const prevWebkitUserSelectRef = React2.useRef("");
const viewport = context.viewport;
const maxScrollPos = sizes.content - sizes.viewport;
const handleWheelScroll = useCallbackRef(onWheelScroll);
const handleThumbPositionChange = useCallbackRef(onThumbPositionChange);
const handleResize = useDebounceCallback(onResize, 10);
function handleDragScroll(event) {
if (rectRef.current) {
const x = event.clientX - rectRef.current.left;
const y = event.clientY - rectRef.current.top;
onDragScroll({ x, y });
}
}
React2.useEffect(() => {
const handleWheel = (event) => {
const element = event.target;
const isScrollbarWheel = scrollbar?.contains(element);
if (isScrollbarWheel) handleWheelScroll(event, maxScrollPos);
};
document.addEventListener("wheel", handleWheel, { passive: false });
return () => document.removeEventListener("wheel", handleWheel, { passive: false });
}, [viewport, scrollbar, maxScrollPos, handleWheelScroll]);
React2.useEffect(handleThumbPositionChange, [sizes, handleThumbPositionChange]);
useResizeObserver(scrollbar, handleResize);
useResizeObserver(context.content, handleResize);
return /* @__PURE__ */ jsx(
ScrollbarProvider,
{
scope: __scopeScrollArea,
scrollbar,
hasThumb,
onThumbChange: useCallbackRef(onThumbChange),
onThumbPointerUp: useCallbackRef(onThumbPointerUp),
onThumbPositionChange: handleThumbPositionChange,
onThumbPointerDown: useCallbackRef(onThumbPointerDown),
children: /* @__PURE__ */ jsx(
Primitive.div,
{
...scrollbarProps,
ref: composeRefs,
style: { position: "absolute", ...scrollbarProps.style },
onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {
const mainPointer = 0;
if (event.button === mainPointer) {
const element = event.target;
element.setPointerCapture(event.pointerId);
rectRef.current = scrollbar.getBoundingClientRect();
prevWebkitUserSelectRef.current = document.body.style.webkitUserSelect;
document.body.style.webkitUserSelect = "none";
if (context.viewport) context.viewport.style.scrollBehavior = "auto";
handleDragScroll(event);
}
}),
onPointerMove: composeEventHandlers(props.onPointerMove, handleDragScroll),
onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {
const element = event.target;
if (element.hasPointerCapture(event.pointerId)) {
element.releasePointerCapture(event.pointerId);
}
document.body.style.webkitUserSelect = prevWebkitUserSelectRef.current;
if (context.viewport) context.viewport.style.scrollBehavior = "";
rectRef.current = null;
})
}
)
}
);
});
var THUMB_NAME = "ScrollAreaThumb";
var ScrollAreaThumb = React2.forwardRef(
(props, forwardedRef) => {
const { forceMount, ...thumbProps } = props;
const scrollbarContext = useScrollbarContext(THUMB_NAME, props.__scopeScrollArea);
return /* @__PURE__ */ jsx(Presence, { present: forceMount || scrollbarContext.hasThumb, children: /* @__PURE__ */ jsx(ScrollAreaThumbImpl, { ref: forwardedRef, ...thumbProps }) });
}
);
var ScrollAreaThumbImpl = React2.forwardRef(
(props, forwardedRef) => {
const { __scopeScrollArea, style, ...thumbProps } = props;
const scrollAreaContext = useScrollAreaContext(THUMB_NAME, __scopeScrollArea);
const scrollbarContext = useScrollbarContext(THUMB_NAME, __scopeScrollArea);
const { onThumbPositionChange } = scrollbarContext;
const composedRef = useComposedRefs(
forwardedRef,
(node) => scrollbarContext.onThumbChange(node)
);
const removeUnlinkedScrollListenerRef = React2.useRef(void 0);
const debounceScrollEnd = useDebounceCallback(() => {
if (removeUnlinkedScrollListenerRef.current) {
removeUnlinkedScrollListenerRef.current();
removeUnlinkedScrollListenerRef.current = void 0;
}
}, 100);
React2.useEffect(() => {
const viewport = scrollAreaContext.viewport;
if (viewport) {
const handleScroll = () => {
debounceScrollEnd();
if (!removeUnlinkedScrollListenerRef.current) {
const listener = addUnlinkedScrollListener(viewport, onThumbPositionChange);
removeUnlinkedScrollListenerRef.current = listener;
onThumbPositionChange();
}
};
onThumbPositionChange();
viewport.addEventListener("scroll", handleScroll);
return () => viewport.removeEventListener("scroll", handleScroll);
}
}, [scrollAreaContext.viewport, debounceScrollEnd, onThumbPositionChange]);
return /* @__PURE__ */ jsx(
Primitive.div,
{
"data-state": scrollbarContext.hasThumb ? "visible" : "hidden",
...thumbProps,
ref: composedRef,
style: {
width: "var(--radix-scroll-area-thumb-width)",
height: "var(--radix-scroll-area-thumb-height)",
...style
},
onPointerDownCapture: composeEventHandlers(props.onPointerDownCapture, (event) => {
const thumb = event.target;
const thumbRect = thumb.getBoundingClientRect();
const x = event.clientX - thumbRect.left;
const y = event.clientY - thumbRect.top;
scrollbarContext.onThumbPointerDown({ x, y });
}),
onPointerUp: composeEventHandlers(props.onPointerUp, scrollbarContext.onThumbPointerUp)
}
);
}
);
ScrollAreaThumb.displayName = THUMB_NAME;
var CORNER_NAME = "ScrollAreaCorner";
var ScrollAreaCorner = React2.forwardRef(
(props, forwardedRef) => {
const context = useScrollAreaContext(CORNER_NAME, props.__scopeScrollArea);
const hasBothScrollbarsVisible = Boolean(context.scrollbarX && context.scrollbarY);
const hasCorner = context.type !== "scroll" && hasBothScrollbarsVisible;
return hasCorner ? /* @__PURE__ */ jsx(ScrollAreaCornerImpl, { ...props, ref: forwardedRef }) : null;
}
);
ScrollAreaCorner.displayName = CORNER_NAME;
var ScrollAreaCornerImpl = React2.forwardRef((props, forwardedRef) => {
const { __scopeScrollArea, ...cornerProps } = props;
const context = useScrollAreaContext(CORNER_NAME, __scopeScrollArea);
const [width, setWidth] = React2.useState(0);
const [height, setHeight] = React2.useState(0);
const hasSize = Boolean(width && height);
useResizeObserver(context.scrollbarX, () => {
const height2 = context.scrollbarX?.offsetHeight || 0;
context.onCornerHeightChange(height2);
setHeight(height2);
});
useResizeObserver(context.scrollbarY, () => {
const width2 = context.scrollbarY?.offsetWidth || 0;
context.onCornerWidthChange(width2);
setWidth(width2);
});
return hasSize ? /* @__PURE__ */ jsx(
Primitive.div,
{
...cornerProps,
ref: forwardedRef,
style: {
width,
height,
position: "absolute",
right: context.dir === "ltr" ? 0 : void 0,
left: context.dir === "rtl" ? 0 : void 0,
bottom: 0,
...props.style
}
}
) : null;
});
function toInt(value) {
return value ? parseInt(value, 10) : 0;
}
function getThumbRatio(viewportSize, contentSize) {
const ratio = viewportSize / contentSize;
return isNaN(ratio) ? 0 : ratio;
}
function getThumbSize(sizes) {
const ratio = getThumbRatio(sizes.viewport, sizes.content);
const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;
const thumbSize = (sizes.scrollbar.size - scrollbarPadding) * ratio;
return Math.max(thumbSize, 18);
}
function getScrollPositionFromPointer(pointerPos, pointerOffset, sizes, dir = "ltr") {
const thumbSizePx = getThumbSize(sizes);
const thumbCenter = thumbSizePx / 2;
const offset = pointerOffset || thumbCenter;
const thumbOffsetFromEnd = thumbSizePx - offset;
const minPointerPos = sizes.scrollbar.paddingStart + offset;
const maxPointerPos = sizes.scrollbar.size - sizes.scrollbar.paddingEnd - thumbOffsetFromEnd;
const maxScrollPos = sizes.content - sizes.viewport;
const scrollRange = dir === "ltr" ? [0, maxScrollPos] : [maxScrollPos * -1, 0];
const interpolate = linearScale([minPointerPos, maxPointerPos], scrollRange);
return interpolate(pointerPos);
}
function getThumbOffsetFromScroll(scrollPos, sizes, dir = "ltr") {
const thumbSizePx = getThumbSize(sizes);
const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;
const scrollbar = sizes.scrollbar.size - scrollbarPadding;
const maxScrollPos = sizes.content - sizes.viewport;
const maxThumbPos = scrollbar - thumbSizePx;
const scrollClampRange = dir === "ltr" ? [0, maxScrollPos] : [maxScrollPos * -1, 0];
const scrollWithoutMomentum = clamp(scrollPos, scrollClampRange);
const interpolate = linearScale([0, maxScrollPos], [0, maxThumbPos]);
return interpolate(scrollWithoutMomentum);
}
function linearScale(input, output) {
return (value) => {
if (input[0] === input[1] || output[0] === output[1]) return output[0];
const ratio = (output[1] - output[0]) / (input[1] - input[0]);
return output[0] + ratio * (value - input[0]);
};
}
function isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos) {
return scrollPos > 0 && scrollPos < maxScrollPos;
}
var addUnlinkedScrollListener = (node, handler = () => {
}) => {
let prevPosition = { left: node.scrollLeft, top: node.scrollTop };
let rAF = 0;
(function loop() {
const position = { left: node.scrollLeft, top: node.scrollTop };
const isHorizontalScroll = prevPosition.left !== position.left;
const isVerticalScroll = prevPosition.top !== position.top;
if (isHorizontalScroll || isVerticalScroll) handler();
prevPosition = position;
rAF = window.requestAnimationFrame(loop);
})();
return () => window.cancelAnimationFrame(rAF);
};
function useDebounceCallback(callback, delay) {
const handleCallback = useCallbackRef(callback);
const debounceTimerRef = React2.useRef(0);
React2.useEffect(() => () => window.clearTimeout(debounceTimerRef.current), []);
return React2.useCallback(() => {
window.clearTimeout(debounceTimerRef.current);
debounceTimerRef.current = window.setTimeout(handleCallback, delay);
}, [handleCallback, delay]);
}
function useResizeObserver(element, onResize) {
const handleResize = useCallbackRef(onResize);
useLayoutEffect(() => {
let rAF = 0;
if (element) {
const resizeObserver = new ResizeObserver(() => {
cancelAnimationFrame(rAF);
rAF = window.requestAnimationFrame(handleResize);
});
resizeObserver.observe(element);
return () => {
window.cancelAnimationFrame(rAF);
resizeObserver.unobserve(element);
};
}
}, [element, handleResize]);
}
var Root = ScrollArea;
var Viewport = ScrollAreaViewport;
var Scrollbar = ScrollAreaScrollbar;
var Thumb = ScrollAreaThumb;
var Corner = ScrollAreaCorner;
export {
Corner,
Root,
ScrollArea,
ScrollAreaCorner,
ScrollAreaScrollbar,
ScrollAreaThumb,
ScrollAreaViewport,
Scrollbar,
Thumb,
Viewport,
createScrollAreaScope
};
//# sourceMappingURL=index.mjs.map
@@ -0,0 +1,57 @@
/**
* @fileoverview Define the cursor which iterates tokens only in reverse.
* @author Toru Nagashima
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const Cursor = require("./cursor");
const { getLastIndex, getFirstIndex } = require("./utils");
//------------------------------------------------------------------------------
// Exports
//------------------------------------------------------------------------------
/**
* The cursor which iterates tokens only in reverse.
*/
module.exports = class BackwardTokenCursor extends Cursor {
/**
* Initializes this cursor.
* @param {Token[]} tokens The array of tokens.
* @param {Comment[]} comments The array of comments.
* @param {Object} indexMap The map from locations to indices in `tokens`.
* @param {number} startLoc The start location of the iteration range.
* @param {number} endLoc The end location of the iteration range.
*/
constructor(tokens, comments, indexMap, startLoc, endLoc) {
super();
this.tokens = tokens;
this.index = getLastIndex(tokens, indexMap, endLoc);
this.indexEnd = getFirstIndex(tokens, indexMap, startLoc);
}
/** @inheritdoc */
moveNext() {
if (this.index >= this.indexEnd) {
this.current = this.tokens[this.index];
this.index -= 1;
return true;
}
return false;
}
/*
*
* Shorthand for performance.
*
*/
/** @inheritdoc */
getOneToken() {
return this.index >= this.indexEnd ? this.tokens[this.index] : null;
}
};
@@ -0,0 +1 @@
{"version":3,"file":"waves.js","sources":["../../../src/icons/waves.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Waves\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiA2Yy42LjUgMS4yIDEgMi41IDFDNyA3IDcgNSA5LjUgNWMyLjYgMCAyLjQgMiA1IDIgMi41IDAgMi41LTIgNS0yIDEuMyAwIDEuOS41IDIuNSAxIiAvPgogIDxwYXRoIGQ9Ik0yIDEyYy42LjUgMS4yIDEgMi41IDEgMi41IDAgMi41LTIgNS0yIDIuNiAwIDIuNCAyIDUgMiAyLjUgMCAyLjUtMiA1LTIgMS4zIDAgMS45LjUgMi41IDEiIC8+CiAgPHBhdGggZD0iTTIgMThjLjYuNSAxLjIgMSAyLjUgMSAyLjUgMCAyLjUtMiA1LTIgMi42IDAgMi40IDIgNSAyIDIuNSAwIDIuNS0yIDUtMiAxLjMgMCAxLjkuNSAyLjUgMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/waves\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Waves = createLucideIcon('Waves', [\n [\n 'path',\n {\n d: 'M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1',\n key: 'knzxuh',\n },\n ],\n [\n 'path',\n {\n d: 'M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1',\n key: '2jd2cc',\n },\n ],\n [\n 'path',\n {\n d: 'M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1',\n key: 'rd2r6e',\n },\n ],\n]);\n\nexport default Waves;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CACtC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"dialects-BOhdv1Fc.mjs","names":["DRAFT_2020_12_URIS: ReadonlySet<string>","DRAFT_2019_09_URIS: ReadonlySet<string>","DRAFT_07_URIS: ReadonlySet<string>","DRAFT_06_URIS: ReadonlySet<string>"],"sources":["../../core-internal/src/validators/dialects.ts"],"sourcesContent":["/**\n * Declared-dialect classification shared by the default validator providers.\n */\n\nimport type { JsonSchemaType } from './types';\n\n/**\n * Canonical `$schema` URIs per supported dialect (http + https variants, trailing-`#` stripped).\n */\nconst DRAFT_2020_12_URIS: ReadonlySet<string> = new Set([\n 'https://json-schema.org/draft/2020-12/schema',\n 'http://json-schema.org/draft/2020-12/schema'\n]);\nconst DRAFT_2019_09_URIS: ReadonlySet<string> = new Set([\n 'https://json-schema.org/draft/2019-09/schema',\n 'http://json-schema.org/draft/2019-09/schema'\n]);\nconst DRAFT_07_URIS: ReadonlySet<string> = new Set(['https://json-schema.org/draft-07/schema', 'http://json-schema.org/draft-07/schema']);\nconst DRAFT_06_URIS: ReadonlySet<string> = new Set(['https://json-schema.org/draft-06/schema', 'http://json-schema.org/draft-06/schema']);\n\n/**\n * Dialects the default providers dispatch on. draft-06 maps to `'draft-7'`: draft-07 only adds\n * keywords over draft-06 (`if`/`then`/`else`), and enforcing them on a draft-06 schema is the\n * accepted downlevel.\n */\nexport type DeclaredDialect = '2020-12' | '2019-09' | 'draft-7';\n\n/**\n * Whether a `$schema` value declares the 2019-09 dialect — the only supported dialect with\n * `$recursiveRef`/`$recursiveAnchor`. Non-throwing (unlike {@linkcode declaredDialect}) so\n * wire-layer callers can consult it for documents whose dialect may be unsupported.\n */\nexport function declares2019Dialect($schema: unknown): boolean {\n return typeof $schema === 'string' && DRAFT_2019_09_URIS.has($schema.replace(/#$/, ''));\n}\n\n/**\n * Classify a schema's declared `$schema` dialect. No `$schema` (or a non-string one) means\n * 2020-12. Any other dialect throws a plain `Error` with a clear message rather than letting the\n * engine crash on an opaque internal error or silently mis-validate; `remedy` names the calling\n * provider's escape hatch in that message.\n */\nexport function declaredDialect(schema: JsonSchemaType, remedy: string): DeclaredDialect {\n if (!('$schema' in schema) || typeof schema.$schema !== 'string') {\n return '2020-12';\n }\n const declared = schema.$schema.replace(/#$/, '');\n if (DRAFT_2020_12_URIS.has(declared)) {\n return '2020-12';\n }\n if (DRAFT_2019_09_URIS.has(declared)) {\n return '2019-09';\n }\n if (DRAFT_07_URIS.has(declared) || DRAFT_06_URIS.has(declared)) {\n return 'draft-7';\n }\n throw new Error(\n `JSON Schema declares an unsupported dialect (\"$schema\": \"${schema.$schema.slice(0, 200)}\"). ` +\n `The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${remedy}`\n );\n}\n"],"mappings":";;;;AASA,MAAMA,qBAA0C,IAAI,IAAI,CACpD,gDACA,8CACH,CAAC;AACF,MAAMC,qBAA0C,IAAI,IAAI,CACpD,gDACA,8CACH,CAAC;AACF,MAAMC,gBAAqC,IAAI,IAAI,CAAC,2CAA2C,yCAAyC,CAAC;AACzI,MAAMC,gBAAqC,IAAI,IAAI,CAAC,2CAA2C,yCAAyC,CAAC;;;;;;AAczI,SAAgB,oBAAoB,SAA2B;AAC3D,QAAO,OAAO,YAAY,YAAY,mBAAmB,IAAI,QAAQ,QAAQ,MAAM,GAAG,CAAC;;;;;;;;AAS3F,SAAgB,gBAAgB,QAAwB,QAAiC;AACrF,KAAI,EAAE,aAAa,WAAW,OAAO,OAAO,YAAY,SACpD,QAAO;CAEX,MAAM,WAAW,OAAO,QAAQ,QAAQ,MAAM,GAAG;AACjD,KAAI,mBAAmB,IAAI,SAAS,CAChC,QAAO;AAEX,KAAI,mBAAmB,IAAI,SAAS,CAChC,QAAO;AAEX,KAAI,cAAc,IAAI,SAAS,IAAI,cAAc,IAAI,SAAS,CAC1D,QAAO;AAEX,OAAM,IAAI,MACN,4DAA4D,OAAO,QAAQ,MAAM,GAAG,IAAI,CAAC,2FACG,SAC/F"}