docs: 仓库链接指向本镜像仓库
Build NapCat Artifacts / Type Check & Test (push) Waiting to run

This commit is contained in:
TanTan committed 2026-11-13 09:25:58 +08:00
1 parent f954252a34
commit e311ca3275
35554 files changed
+6229626 -4

No files matched your search

@@ -0,0 +1,25 @@
{
"authors": "Jason Swearingen <https://jasonswearingen.github.io>",
"definitionFilename": "index.d.ts",
"libraryDependencies": [],
"moduleDependencies": [],
"libraryMajorVersion": "0",
"libraryMinorVersion": "0",
"libraryName": "JSON5",
"typingsPackageName": "json5",
"projectName": "http://json5.org/",
"sourceRepoURL": "https://www.github.com/DefinitelyTyped/DefinitelyTyped",
"sourceBranch": "types-2.0",
"kind": "ProperModule",
"globals": [
"json5"
],
"declaredModules": [
"json5"
],
"files": [
"index.d.ts"
],
"hasPackageJson": false,
"contentHash": "1ed77f2bfd59d290798abf89db281c36565f4a78d97d4e9caab25319d54c6331"
}
@@ -0,0 +1,332 @@
/**
* @fileoverview ESQuery wrapper for ESLint.
* @author Nicholas C. Zakas
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const esquery = require("esquery");
//-----------------------------------------------------------------------------
// Typedefs
//-----------------------------------------------------------------------------
/**
* @typedef {import("esquery").Selector} ESQuerySelector
* @typedef {import("esquery").ESQueryOptions} ESQueryOptions
*/
//------------------------------------------------------------------------------
// Classes
//------------------------------------------------------------------------------
/**
* The result of parsing and analyzing an ESQuery selector.
*/
class ESQueryParsedSelector {
/**
* The raw selector string that was parsed
* @type {string}
*/
source;
/**
* Whether this selector is an exit selector
* @type {boolean}
*/
isExit;
/**
* An object (from esquery) describing the matching behavior of the selector
* @type {ESQuerySelector}
*/
root;
/**
* The node types that could possibly trigger this selector, or `null` if all node types could trigger it
* @type {string[]|null}
*/
nodeTypes;
/**
* The number of class, pseudo-class, and attribute queries in this selector
* @type {number}
*/
attributeCount;
/**
* The number of identifier queries in this selector
* @type {number}
*/
identifierCount;
/**
* Creates a new parsed selector.
* @param {string} source The raw selector string that was parsed
* @param {boolean} isExit Whether this selector is an exit selector
* @param {ESQuerySelector} root An object (from esquery) describing the matching behavior of the selector
* @param {string[]|null} nodeTypes The node types that could possibly trigger this selector, or `null` if all node types could trigger it
* @param {number} attributeCount The number of class, pseudo-class, and attribute queries in this selector
* @param {number} identifierCount The number of identifier queries in this selector
*/
constructor(
source,
isExit,
root,
nodeTypes,
attributeCount,
identifierCount,
) {
this.source = source;
this.isExit = isExit;
this.root = root;
this.nodeTypes = nodeTypes;
this.attributeCount = attributeCount;
this.identifierCount = identifierCount;
}
/**
* Compares this selector's specificity to another selector for sorting purposes.
* @param {ESQueryParsedSelector} otherSelector The selector to compare against
* @returns {number}
* a value less than 0 if this selector is less specific than otherSelector
* a value greater than 0 if this selector is more specific than otherSelector
* a value less than 0 if this selector and otherSelector have the same specificity, and this selector <= otherSelector alphabetically
* a value greater than 0 if this selector and otherSelector have the same specificity, and this selector > otherSelector alphabetically
*/
compare(otherSelector) {
return (
this.attributeCount - otherSelector.attributeCount ||
this.identifierCount - otherSelector.identifierCount ||
(this.source <= otherSelector.source ? -1 : 1)
);
}
}
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
const selectorCache = new Map();
/**
* Computes the union of one or more arrays
* @param {...any[]} arrays One or more arrays to union
* @returns {any[]} The union of the input arrays
*/
function union(...arrays) {
return [...new Set(arrays.flat())];
}
/**
* Computes the intersection of one or more arrays
* @param {...any[]} arrays One or more arrays to intersect
* @returns {any[]} The intersection of the input arrays
*/
function intersection(...arrays) {
if (arrays.length === 0) {
return [];
}
let result = [...new Set(arrays[0])];
for (const array of arrays.slice(1)) {
result = result.filter(x => array.includes(x));
}
return result;
}
/**
* Analyzes a parsed selector and returns combined data about it
* @param {ESQuerySelector} parsedSelector An object (from esquery) describing the matching behavior of the selector
* @returns {{nodeTypes:string[]|null, attributeCount:number, identifierCount:number}} Object containing selector data.
*/
function analyzeParsedSelector(parsedSelector) {
let attributeCount = 0;
let identifierCount = 0;
/**
* Analyzes a selector and returns the node types that could possibly trigger it.
* @param {ESQuerySelector} selector The selector to analyze.
* @returns {string[]|null} The node types that could possibly trigger this selector, or `null` if all node types could trigger it
*/
function analyzeSelector(selector) {
switch (selector.type) {
case "identifier":
identifierCount++;
return [selector.value];
case "not":
selector.selectors.map(analyzeSelector);
return null;
case "matches": {
const typesForComponents =
selector.selectors.map(analyzeSelector);
if (typesForComponents.every(Boolean)) {
return union(...typesForComponents);
}
return null;
}
case "compound": {
const typesForComponents = selector.selectors
.map(analyzeSelector)
.filter(typesForComponent => typesForComponent);
// If all of the components could match any type, then the compound could also match any type.
if (!typesForComponents.length) {
return null;
}
/*
* If at least one of the components could only match a particular type, the compound could only match
* the intersection of those types.
*/
return intersection(...typesForComponents);
}
case "attribute":
case "field":
case "nth-child":
case "nth-last-child":
attributeCount++;
return null;
case "child":
case "descendant":
case "sibling":
case "adjacent":
analyzeSelector(selector.left);
return analyzeSelector(selector.right);
case "class":
// TODO: abstract into JSLanguage somehow
if (selector.name === "function") {
return [
"FunctionDeclaration",
"FunctionExpression",
"ArrowFunctionExpression",
];
}
return null;
default:
return null;
}
}
const nodeTypes = analyzeSelector(parsedSelector);
return {
nodeTypes,
attributeCount,
identifierCount,
};
}
/**
* Tries to parse a simple selector string, such as a single identifier or wildcard.
* This saves time by avoiding the overhead of esquery parsing for simple cases.
* @param {string} selector The selector string to parse.
* @returns {Object|null} An object describing the selector if it is simple, or `null` if it is not.
*/
function trySimpleParseSelector(selector) {
if (selector === "*") {
return {
type: "wildcard",
value: "*",
};
}
if (/^[a-z]+$/iu.test(selector)) {
return {
type: "identifier",
value: selector,
};
}
return null;
}
/**
* Parses a raw selector string, and throws a useful error if parsing fails.
* @param {string} selector The selector string to parse.
* @returns {Object} An object (from esquery) describing the matching behavior of this selector
* @throws {Error} An error if the selector is invalid
*/
function tryParseSelector(selector) {
try {
return esquery.parse(selector);
} catch (err) {
if (
err.location &&
err.location.start &&
typeof err.location.start.offset === "number"
) {
throw new SyntaxError(
`Syntax error in selector "${selector}" at position ${err.location.start.offset}: ${err.message}`,
{
cause: err,
},
);
}
throw err;
}
}
/**
* Parses a raw selector string, and returns the parsed selector along with specificity and type information.
* @param {string} source A raw AST selector
* @returns {ESQueryParsedSelector} A selector descriptor
*/
function parse(source) {
if (selectorCache.has(source)) {
return selectorCache.get(source);
}
const cleanSource = source.replace(/:exit$/u, "");
const parsedSelector =
trySimpleParseSelector(cleanSource) ?? tryParseSelector(cleanSource);
const { nodeTypes, attributeCount, identifierCount } =
analyzeParsedSelector(parsedSelector);
const result = new ESQueryParsedSelector(
source,
source.endsWith(":exit"),
parsedSelector,
nodeTypes,
attributeCount,
identifierCount,
);
selectorCache.set(source, result);
return result;
}
/**
* Checks if a node matches a given selector.
* @param {Object} node The node to check against the selector.
* @param {ESQuerySelector} root The root of the selector to match against.
* @param {Object[]} ancestry The ancestry of the node being checked, which is an array of nodes from the current node to the root.
* @param {ESQueryOptions} options The options to use for matching.
* @returns {boolean} `true` if the node matches the selector, `false` otherwise.
*/
function matches(node, root, ancestry, options) {
return esquery.matches(node, root, ancestry, options);
}
//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------
module.exports = {
parse,
matches,
ESQueryParsedSelector,
};
@@ -0,0 +1,16 @@
// src/index.ts
function createThunkMiddleware(extraArgument) {
const middleware = ({ dispatch, getState }) => (next) => (action) => {
if (typeof action === "function") {
return action(dispatch, getState, extraArgument);
}
return next(action);
};
return middleware;
}
var thunk = createThunkMiddleware();
var withExtraArgument = createThunkMiddleware;
export {
thunk,
withExtraArgument
};
@@ -0,0 +1,218 @@
/**
* @flow
*/
import { dom, roles } from 'aria-query';
import includes from 'array-includes';
import fromEntries from 'object.fromentries';
import JSXAttributeMock from './JSXAttributeMock';
import JSXElementMock from './JSXElementMock';
import type { JSXAttributeMockType } from './JSXAttributeMock';
import type { JSXElementMockType } from './JSXElementMock';
const domElements = dom.keys();
const roleNames = roles.keys();
const interactiveElementsMap = {
a: [{ prop: 'href', value: '#' }],
area: [{ prop: 'href', value: '#' }],
audio: [],
button: [],
canvas: [],
datalist: [],
embed: [],
input: [],
'input[type="button"]': [{ prop: 'type', value: 'button' }],
'input[type="checkbox"]': [{ prop: 'type', value: 'checkbox' }],
'input[type="color"]': [{ prop: 'type', value: 'color' }],
'input[type="date"]': [{ prop: 'type', value: 'date' }],
'input[type="datetime"]': [{ prop: 'type', value: 'datetime' }],
'input[type="email"]': [{ prop: 'type', value: 'email' }],
'input[type="file"]': [{ prop: 'type', value: 'file' }],
'input[type="image"]': [{ prop: 'type', value: 'image' }],
'input[type="month"]': [{ prop: 'type', value: 'month' }],
'input[type="number"]': [{ prop: 'type', value: 'number' }],
'input[type="password"]': [{ prop: 'type', value: 'password' }],
'input[type="radio"]': [{ prop: 'type', value: 'radio' }],
'input[type="range"]': [{ prop: 'type', value: 'range' }],
'input[type="reset"]': [{ prop: 'type', value: 'reset' }],
'input[type="search"]': [{ prop: 'type', value: 'search' }],
'input[type="submit"]': [{ prop: 'type', value: 'submit' }],
'input[type="tel"]': [{ prop: 'type', value: 'tel' }],
'input[type="text"]': [{ prop: 'type', value: 'text' }],
'input[type="time"]': [{ prop: 'type', value: 'time' }],
'input[type="url"]': [{ prop: 'type', value: 'url' }],
'input[type="week"]': [{ prop: 'type', value: 'week' }],
menuitem: [],
option: [],
select: [],
summary: [],
// Whereas ARIA makes a distinction between cell and gridcell, the AXObject
// treats them both as CellRole and since gridcell is interactive, we consider
// cell interactive as well.
td: [],
th: [],
tr: [],
textarea: [],
video: [],
};
const nonInteractiveElementsMap: {[string]: Array<{[string]: string}>} = {
abbr: [],
address: [],
article: [],
aside: [],
blockquote: [],
br: [],
caption: [],
code: [],
dd: [],
del: [],
details: [],
dfn: [],
dialog: [],
dir: [],
dl: [],
dt: [],
em: [],
fieldset: [],
figcaption: [],
figure: [],
footer: [],
form: [],
h1: [],
h2: [],
h3: [],
h4: [],
h5: [],
h6: [],
hr: [],
html: [],
iframe: [],
img: [],
ins: [],
label: [],
legend: [],
li: [],
main: [],
mark: [],
marquee: [],
menu: [],
meter: [],
nav: [],
ol: [],
optgroup: [],
output: [],
p: [],
pre: [],
progress: [],
ruby: [],
'section[aria-label]': [{ prop: 'aria-label' }],
'section[aria-labelledby]': [{ prop: 'aria-labelledby' }],
strong: [],
sub: [],
sup: [],
table: [],
tbody: [],
tfoot: [],
thead: [],
time: [],
ul: [],
};
const indeterminantInteractiveElementsMap: { [key: string]: Array<any> } = fromEntries(domElements.map((name) => [name, []]));
Object.keys(interactiveElementsMap)
.concat(Object.keys(nonInteractiveElementsMap))
.forEach((name) => delete indeterminantInteractiveElementsMap[name]);
const abstractRoles = roleNames.filter((role) => roles.get(role).abstract);
const nonAbstractRoles = roleNames.filter((role) => !roles.get(role).abstract);
const interactiveRoles = []
.concat(
roleNames,
// 'toolbar' does not descend from widget, but it does support
// aria-activedescendant, thus in practice we treat it as a widget.
'toolbar',
)
.filter((role) => (
!roles.get(role).abstract
&& roles.get(role).superClass.some((klasses) => includes(klasses, 'widget'))
));
const nonInteractiveRoles = roleNames
.filter((role) => (
!roles.get(role).abstract
&& !roles.get(role).superClass.some((klasses) => includes(klasses, 'widget'))
// 'toolbar' does not descend from widget, but it does support
// aria-activedescendant, thus in practice we treat it as a widget.
&& !includes(['toolbar'], role)
));
export function genElementSymbol(openingElement: Object): string {
return (
openingElement.name.name + (openingElement.attributes.length > 0
? `${openingElement.attributes.map((attr) => `[${attr.name.name}="${attr.value.value}"]`).join('')}`
: ''
)
);
}
export function genInteractiveElements(): Array<JSXElementMockType> {
return Object.keys(interactiveElementsMap).map((elementSymbol: string): JSXElementMockType => {
const bracketIndex = elementSymbol.indexOf('[');
let name = elementSymbol;
if (bracketIndex > -1) {
name = elementSymbol.slice(0, bracketIndex);
}
const attributes = interactiveElementsMap[elementSymbol].map(({ prop, value }) => JSXAttributeMock(prop, value));
return JSXElementMock(name, attributes);
});
}
export function genInteractiveRoleElements(): Array<JSXElementMockType> {
return interactiveRoles.concat('button article', 'fakerole button article').map((value): JSXElementMockType => JSXElementMock(
'div',
[JSXAttributeMock('role', value)],
));
}
export function genNonInteractiveElements(): Array<JSXElementMockType> {
return Object.keys(nonInteractiveElementsMap).map((elementSymbol): JSXElementMockType => {
const bracketIndex = elementSymbol.indexOf('[');
let name = elementSymbol;
if (bracketIndex > -1) {
name = elementSymbol.slice(0, bracketIndex);
}
const attributes = nonInteractiveElementsMap[elementSymbol].map(({ prop, value }) => JSXAttributeMock(prop, value));
return JSXElementMock(name, attributes);
});
}
export function genNonInteractiveRoleElements(): Array<JSXElementMockType> {
return [
...nonInteractiveRoles,
'article button',
'fakerole article button',
].map((value) => JSXElementMock('div', [JSXAttributeMock('role', value)]));
}
export function genAbstractRoleElements(): Array<JSXElementMockType> {
return abstractRoles.map((value) => JSXElementMock('div', [JSXAttributeMock('role', value)]));
}
export function genNonAbstractRoleElements(): Array<JSXElementMockType> {
return nonAbstractRoles.map((value) => JSXElementMock('div', [JSXAttributeMock('role', value)]));
}
export function genIndeterminantInteractiveElements(): Array<JSXElementMockType> {
return Object.keys(indeterminantInteractiveElementsMap).map((name) => {
const attributes = indeterminantInteractiveElementsMap[name].map(({ prop, value }): JSXAttributeMockType => JSXAttributeMock(prop, value));
return JSXElementMock(name, attributes);
});
}
@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _createClass;
var _toPropertyKey = require("./toPropertyKey.js");
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, (0, _toPropertyKey.default)(descriptor.key), descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor;
}
//# sourceMappingURL=createClass.js.map
@@ -0,0 +1,51 @@
import { __values } from "tslib";
import { useRef, useEffect } from 'react';
var EventEmitter = /** @class */ (function () {
function EventEmitter() {
var _this = this;
this.subscriptions = new Set();
this.emit = function (val) {
var e_1, _a;
try {
for (var _b = __values(_this.subscriptions), _c = _b.next(); !_c.done; _c = _b.next()) {
var subscription = _c.value;
subscription(val);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_1) throw e_1.error; }
}
};
this.useSubscription = function (callback) {
// eslint-disable-next-line react-hooks/rules-of-hooks
var callbackRef = useRef(undefined);
callbackRef.current = callback;
// eslint-disable-next-line react-hooks/rules-of-hooks
useEffect(function () {
function subscription(val) {
if (callbackRef.current) {
callbackRef.current(val);
}
}
_this.subscriptions.add(subscription);
return function () {
_this.subscriptions.delete(subscription);
};
}, []);
};
}
return EventEmitter;
}());
export { EventEmitter };
function useEventEmitter() {
var ref = useRef(undefined);
if (!ref.current) {
ref.current = new EventEmitter();
}
return ref.current;
}
export default useEventEmitter;
@@ -0,0 +1,10 @@
"use strict";
var _class_apply_descriptor_get = require("./_class_apply_descriptor_get.cjs");
var _class_extract_field_descriptor = require("./_class_extract_field_descriptor.cjs");
function _class_private_field_get(receiver, privateMap) {
var descriptor = _class_extract_field_descriptor._(receiver, privateMap, "get");
return _class_apply_descriptor_get._(receiver, descriptor);
}
exports._ = _class_private_field_get;
@@ -0,0 +1,74 @@
/** @deprecated use HotPayload */
export type HMRPayload = HotPayload
export type HotPayload =
| ConnectedPayload
| PingPayload
| UpdatePayload
| FullReloadPayload
| CustomPayload
| ErrorPayload
| PrunePayload
export interface ConnectedPayload {
type: 'connected'
}
export interface PingPayload {
type: 'ping'
}
export interface UpdatePayload {
type: 'update'
updates: Update[]
}
export interface Update {
type: 'js-update' | 'css-update'
path: string
acceptedPath: string
timestamp: number
/** @internal */
explicitImportRequired?: boolean
/** @internal */
isWithinCircularImport?: boolean
/** @internal */
firstInvalidatedBy?: string
/** @internal */
invalidates?: string[]
}
export interface PrunePayload {
type: 'prune'
paths: string[]
}
export interface FullReloadPayload {
type: 'full-reload'
path?: string
/** @internal */
triggeredBy?: string
}
export interface CustomPayload {
type: 'custom'
event: string
data?: any
}
export interface ErrorPayload {
type: 'error'
err: {
[name: string]: any
message: string
stack: string
id?: string
frame?: string
plugin?: string
pluginCode?: string
loc?: {
file?: string
line: number
column: number
}
}
}
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('unset', require('../unset'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1 @@
{"version":3,"file":"isNameInFieldArray.d.ts","sourceRoot":"","sources":["../../src/logic/isNameInFieldArray.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;yBAIlC,OAAO,GAAG,CAAC,iBAAiB,CAAC,EAAE,MAAM,iBAAiB;AAAtE,wBACqC"}
@@ -0,0 +1,184 @@
## 0.5.2 / 2020-06-08
* Added `iconv.getEncoder()` and `iconv.getDecoder()` methods to typescript definitions (#229).
* Fixed semver version to 6.1.2 to support Node 8.x (by @tanandara).
* Capped iconv version to 2.x as 3.x has dropped support for older Node versions.
* Switched from instanbul to c8 for code coverage.
## 0.5.1 / 2020-01-18
* Added cp720 encoding (#221, by @kr-deps)
* (minor) Changed Changelog.md formatting to use h2.
## 0.5.0 / 2019-06-26
* Added UTF-32 encoding, both little-endian and big-endian variants (UTF-32LE, UTF32-BE). If endianness
is not provided for decoding, it's deduced automatically from the stream using a heuristic similar to
what we use in UTF-16. (great work in #216 by @kshetline)
* Several minor updates to README (#217 by @oldj, plus some more)
* Added Node versions 10 and 12 to Travis test harness.
## 0.4.24 / 2018-08-22
* Added MIK encoding (#196, by @Ivan-Kalatchev)
## 0.4.23 / 2018-05-07
* Fix deprecation warning in Node v10 due to the last usage of `new Buffer` (#185, by @felixbuenemann)
* Switched from NodeBuffer to Buffer in typings (#155 by @felixfbecker, #186 by @larssn)
## 0.4.22 / 2018-05-05
* Use older semver style for dependencies to be compatible with Node version 0.10 (#182, by @dougwilson)
* Fix tests to accomodate fixes in Node v10 (#182, by @dougwilson)
## 0.4.21 / 2018-04-06
* Fix encoding canonicalization (#156)
* Fix the paths in the "browser" field in package.json (#174 by @LMLB)
* Removed "contributors" section in package.json - see Git history instead.
## 0.4.20 / 2018-04-06
* Updated `new Buffer()` usages with recommended replacements as it's being deprecated in Node v10 (#176, #178 by @ChALkeR)
## 0.4.19 / 2017-09-09
* Fixed iso8859-1 codec regression in handling untranslatable characters (#162, caused by #147)
* Re-generated windows1255 codec, because it was updated in iconv project
* Fixed grammar in error message when iconv-lite is loaded with encoding other than utf8
## 0.4.18 / 2017-06-13
* Fixed CESU-8 regression in Node v8.
## 0.4.17 / 2017-04-22
* Updated typescript definition file to support Angular 2 AoT mode (#153 by @larssn)
## 0.4.16 / 2017-04-22
* Added support for React Native (#150)
* Changed iso8859-1 encoding to usine internal 'binary' encoding, as it's the same thing (#147 by @mscdex)
* Fixed typo in Readme (#138 by @jiangzhuo)
* Fixed build for Node v6.10+ by making correct version comparison
* Added a warning if iconv-lite is loaded not as utf-8 (see #142)
## 0.4.15 / 2016-11-21
* Fixed typescript type definition (#137)
## 0.4.14 / 2016-11-20
* Preparation for v1.0
* Added Node v6 and latest Node versions to Travis CI test rig
* Deprecated Node v0.8 support
* Typescript typings (@larssn)
* Fix encoding of Euro character in GB 18030 (inspired by @lygstate)
* Add ms prefix to dbcs windows encodings (@rokoroku)
## 0.4.13 / 2015-10-01
* Fix silly mistake in deprecation notice.
## 0.4.12 / 2015-09-26
* Node v4 support:
* Added CESU-8 decoding (#106)
* Added deprecation notice for `extendNodeEncodings`
* Added Travis tests for Node v4 and io.js latest (#105 by @Mithgol)
## 0.4.11 / 2015-07-03
* Added CESU-8 encoding.
## 0.4.10 / 2015-05-26
* Changed UTF-16 endianness heuristic to take into account any ASCII chars, not
just spaces. This should minimize the importance of "default" endianness.
## 0.4.9 / 2015-05-24
* Streamlined BOM handling: strip BOM by default, add BOM when encoding if
addBOM: true. Added docs to Readme.
* UTF16 now uses UTF16-LE by default.
* Fixed minor issue with big5 encoding.
* Added io.js testing on Travis; updated node-iconv version to test against.
Now we just skip testing SBCS encodings that node-iconv doesn't support.
* (internal refactoring) Updated codec interface to use classes.
* Use strict mode in all files.
## 0.4.8 / 2015-04-14
* added alias UNICODE-1-1-UTF-7 for UTF-7 encoding (#94)
## 0.4.7 / 2015-02-05
* stop official support of Node.js v0.8. Should still work, but no guarantees.
reason: Packages needed for testing are hard to get on Travis CI.
* work in environment where Object.prototype is monkey patched with enumerable
props (#89).
## 0.4.6 / 2015-01-12
* fix rare aliases of single-byte encodings (thanks @mscdex)
* double the timeout for dbcs tests to make them less flaky on travis
## 0.4.5 / 2014-11-20
* fix windows-31j and x-sjis encoding support (@nleush)
* minor fix: undefined variable reference when internal error happens
## 0.4.4 / 2014-07-16
* added encodings UTF-7 (RFC2152) and UTF-7-IMAP (RFC3501 Section 5.1.3)
* fixed streaming base64 encoding
## 0.4.3 / 2014-06-14
* added encodings UTF-16BE and UTF-16 with BOM
## 0.4.2 / 2014-06-12
* don't throw exception if `extendNodeEncodings()` is called more than once
## 0.4.1 / 2014-06-11
* codepage 808 added
## 0.4.0 / 2014-06-10
* code is rewritten from scratch
* all widespread encodings are supported
* streaming interface added
* browserify compatibility added
* (optional) extend core primitive encodings to make usage even simpler
* moved from vows to mocha as the testing framework
@@ -0,0 +1,22 @@
export var INJECTION_TOKEN_METADATA_KEY = "injectionTokens";
export function getParamInfo(target) {
var params = Reflect.getMetadata("design:paramtypes", target) || [];
var injectionTokens = Reflect.getOwnMetadata(INJECTION_TOKEN_METADATA_KEY, target) || {};
Object.keys(injectionTokens).forEach(function (key) {
params[+key] = injectionTokens[key];
});
return params;
}
export function defineInjectionTokenMetadata(data, transform) {
return function (target, _propertyKey, parameterIndex) {
var descriptors = Reflect.getOwnMetadata(INJECTION_TOKEN_METADATA_KEY, target) || {};
descriptors[parameterIndex] = transform
? {
token: data,
transform: transform.transformToken,
transformArgs: transform.args || []
}
: data;
Reflect.defineMetadata(INJECTION_TOKEN_METADATA_KEY, descriptors, target);
};
}
@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.read = void 0;
function read(path, settings) {
const lstat = settings.fs.lstatSync(path);
if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
return lstat;
}
try {
const stat = settings.fs.statSync(path);
if (settings.markSymbolicLink) {
stat.isSymbolicLink = () => true;
}
return stat;
}
catch (error) {
if (!settings.throwErrorOnBrokenSymbolicLink) {
return lstat;
}
throw error;
}
}
exports.read = read;
@@ -0,0 +1,2 @@
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.FitAddon=t():e.FitAddon=t()}(self,(()=>(()=>{"use strict";var e={};return(()=>{var t=e;Object.defineProperty(t,"__esModule",{value:!0}),t.FitAddon=void 0,t.FitAddon=class{activate(e){this._terminal=e}dispose(){}fit(){const e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;const t=this._terminal._core;this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal)return;if(!this._terminal.element||!this._terminal.element.parentElement)return;const e=this._terminal._core,t=e._renderService.dimensions;if(0===t.css.cell.width||0===t.css.cell.height)return;const r=0===this._terminal.options.scrollback?0:e.viewport.scrollBarWidth,i=window.getComputedStyle(this._terminal.element.parentElement),o=parseInt(i.getPropertyValue("height")),s=Math.max(0,parseInt(i.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),l=o-(parseInt(n.getPropertyValue("padding-top"))+parseInt(n.getPropertyValue("padding-bottom"))),a=s-(parseInt(n.getPropertyValue("padding-right"))+parseInt(n.getPropertyValue("padding-left")))-r;return{cols:Math.max(2,Math.floor(a/t.css.cell.width)),rows:Math.max(1,Math.floor(l/t.css.cell.height))}}}})(),e})()));
//# sourceMappingURL=addon-fit.js.map
@@ -0,0 +1,11 @@
/**
* Create an HTML extension for `micromark` to support GitHub tables when
* serializing to HTML.
*
* @returns {HtmlExtension}
* Extension for `micromark` that can be passed in `htmlExtensions` to
* support GitHub tables when serializing to HTML.
*/
export function gfmTableHtml(): HtmlExtension;
import type { HtmlExtension } from 'micromark-util-types';
//# sourceMappingURL=html.d.ts.map
@@ -0,0 +1,41 @@
type OverlayPlacement = "top" | "bottom" | "right" | "left" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end" | "right-start" | "right-end";
interface OverlayOptions {
/**
* Whether the element should render an arrow.
* @default false
*/
showArrow?: boolean;
/**
* The additional offset applied along the main axis between the element and its
* anchor element.
* @default 7 (px) - if `showArrow` is true the default value is 10 (px)
*/
offset?: number;
/**
* The additional offset applied along the cross axis between the element and its
* anchor element.
* @default 0
*/
crossOffset?: number;
/**
* Whether the element should flip its orientation (e.g. top to bottom or left to right) when
* there is insufficient room for it to render completely.
* @default true
*/
shouldFlip?: boolean;
/**
* The placement of the element with respect to its anchor element.
* @default 'top'
*/
placement?: OverlayPlacement;
/**
* The placement padding that should be applied between the element and its
* surrounding container.
* @default 12
*/
containerPadding?: number;
/** Handler that is called when the overlay should close. */
onClose?: () => void;
}
export { OverlayOptions, OverlayPlacement };
@@ -0,0 +1 @@
{"mappings":";AAAA,4BAAiB;IAAG,aAAa,CAAC,SAAS,CAAC;IAC1C,iBAAiB,CAAC,OAAS,CAAC,8CAA+B,EAAE,KAAK,UAAU,EAAE;IAC9E,cAAc,CAAC,OAAS,CAAC,qBAAe,EAAE,KAAK,KAAK,EAAE;IACtD,cAAc,CAAC,QAAQ,CAAC;IACxB,kBAAkB,CAAC,OAAS,CAAC,8CAA+B,EAAE,KAAK,UAAU,EAAE;IAC/E,sBAAsB,CAAC,sEAA8C,CAAC;IACtE,UAAU,CAAC,YAAM,CAAC;IAClB,aAAa,CAAC,yBAAa,CAAC;IAC5B,YAAY,CAAC,iCAAkB,CAAC;AAClC","sources":["packages/@react-aria/table/intl/sk-SK.json"],"sourcesContent":["{\n \"ascending\": \"vzostupne\",\n \"ascendingSort\": \"zoradené zostupne podľa stĺpca {columnName}\",\n \"columnSize\": \"Počet pixelov: {value}\",\n \"descending\": \"zostupne\",\n \"descendingSort\": \"zoradené zostupne podľa stĺpca {columnName}\",\n \"resizerDescription\": \"Stlačením klávesu Enter začnete zmenu veľkosti\",\n \"select\": \"Vybrať\",\n \"selectAll\": \"Vybrať všetko\",\n \"sortable\": \"zoraditeľný stĺpec\"\n}\n"],"names":[],"version":3,"file":"sk-SK.module.js.map"}
@@ -0,0 +1 @@
{"name":"@types/node","version":"22.19.1","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532089978,"integrity":"sha512-HQaIQk9pwOcyKutyDk4o2a87WnotwYuLGYFW43emGm4FvIJFKPyg+OYaw5sTegKAKf+C5SKa1ACjzCLivbaHrQ==","mode":420,"size":1141},"README.md":{"checkedAt":1794532090921,"integrity":"sha512-okWJ5eXnm+miClxsTYsQn5WBFAe95Ugfat3deVUUwUt+F9coP2pvPKgLJ6dOYJGNN4uP2Tar4azwZKC5bY+Byw==","mode":420,"size":1541},"assert.d.ts":{"checkedAt":1794532090921,"integrity":"sha512-J3mWn7+JxTMfsEX115UPstKWwYbzd0re55e7UWkRm/dRL8bjaCi1/BJPubzpBdi3TQQM9qVPwR946SoUgY0q5g==","mode":420,"size":45270},"async_hooks.d.ts":{"checkedAt":1794532090922,"integrity":"sha512-M+1vVX5Fgyi3rfHo/b4bpmK3YtRfOKEjvsDHYa7VT+NanJWhypqN9Z74Mmr2ycX3QpvvSQD+Wb2fd6/bORaTWw==","mode":420,"size":25553},"buffer.buffer.d.ts":{"checkedAt":1794532090923,"integrity":"sha512-LO6AYB0ysHH/0MtNk+1HVdraNL1ExDmxPHjaaQ7pzLqsatuswW14QSPYTfEYD3CUa6H0uuz45R5UXGMYGNHPMQ==","mode":420,"size":22839},"buffer.d.ts":{"checkedAt":1794532090923,"integrity":"sha512-UXn/h5bwEM6CeB3EvgfParNCis65GwjScO809vcETlfPm++4TRwmRRv74EtEdpBXMoXoNM2I0iya2Dz+Ud8X7g==","mode":420,"size":88244},"child_process.d.ts":{"checkedAt":1794532090923,"integrity":"sha512-hCzx0D6qjpyeVq4DuJtn4KHmYQs7FGON0XdU88EKpwV/6xX3LZ09A8B57oKxGDfvhW2sefc1WLkvZG3WYN334Q==","mode":420,"size":66722},"cluster.d.ts":{"checkedAt":1794532090924,"integrity":"sha512-hSZabdPezmlrZBNjn/n5RDcUWkg+XJuLK7M0n/ELpX9HN00/5YkEejI31rRgOmEiAtY+9BGe5f2q7I0gp4bQQg==","mode":420,"size":27926},"console.d.ts":{"checkedAt":1794532090924,"integrity":"sha512-QuCkJrbMK1kzTREpWCNwHwlCRErZn0jR1ZJ3yUQuWk3YA83Uqzk+/1QdV308aKIiyJktKGifOb4nM9gA9AKtLA==","mode":420,"size":21249},"constants.d.ts":{"checkedAt":1794532090924,"integrity":"sha512-ygmJrw231vRId7TnFnbulp+edIdcy0FAMiKPjFGEZG7dv6YGkmB5rBN44L9FqC3QrfV/cQLwVI2zhaqOk/U1LA==","mode":420,"size":816},"crypto.d.ts":{"checkedAt":1794532090924,"integrity":"sha512-SPT3a1Afwb8WWqNFUsRfO3y9ndRNQ1Se1KpQp/iaW8EpfXNifiM/7cbzwri5dVA0EfBlPrt/PXWu2TcMvpJktA==","mode":420,"size":192007},"dgram.d.ts":{"checkedAt":1794532090925,"integrity":"sha512-Lqd8LfvgbqPT24scMKXesCLUV44CQMv9CF/947dO4SHlgtIgOTsmN50/68Fimy4qNNe1Ekf33oBCVRj0OM2YUA==","mode":420,"size":28114},"diagnostics_channel.d.ts":{"checkedAt":1794532090925,"integrity":"sha512-683qlvL7JX+BjoXIk+ASqFpVrXEDL4akjK5buP1NX8UXUMp8Jt7odOylao0FD12a3osa7AtvjoEfLL35PiKxRQ==","mode":420,"size":25224},"dns.d.ts":{"checkedAt":1794532090925,"integrity":"sha512-spq7t512TuU43q3/29/dDdvQ6ZumIblEDR9PKquTKTtS3f7mW2sp3XVlfEzKudnrNHjtdmtvgfJ0gM8IN378dg==","mode":420,"size":37027},"domain.d.ts":{"checkedAt":1794532090925,"integrity":"sha512-dPW2vnmep00kexCas/4QFX3zW1hVnaw/VM9kIhOzOtnHVzRjPJmmaw3+Nnb8ZKe2BbYCQIH3sD8kZOzsWMB1BQ==","mode":420,"size":7812},"events.d.ts":{"checkedAt":1794532090925,"integrity":"sha512-JZDk298qlcA3dcvi328YAZeKdBvtZi9ScZNE9J+Y0cPJtzn6lQM67f115T4VkcG2j54T6B+XnhzZlnMuLmBh4g==","mode":420,"size":44252},"fs.d.ts":{"checkedAt":1794532090926,"integrity":"sha512-UHhA6w1o+HMch4oMKyDL/8dr/ma8ucFMU/JE2Zr+h2dklemvFkbu4BtczONiW50iaazEMeX3E7BWoknh4F/pnw==","mode":420,"size":190341},"globals.d.ts":{"checkedAt":1794532090926,"integrity":"sha512-wh8cS4i8IKm3KshQChK3UB+fLD4weA/aeV+6uSyY6wscMscmypyL+6Dh7lDCfOJTpf9Qmlo37npIkh9/DEmWNw==","mode":420,"size":6114},"globals.typedarray.d.ts":{"checkedAt":1794532090926,"integrity":"sha512-dxJ3WQZv69H6QdsinXvRZPObNcXtVq6BV8EGm+QZNH8qzjifVjIVmCblwZ/AS2Cr9rlyKRYn+nyxd4vQaycRqw==","mode":420,"size":1825},"http.d.ts":{"checkedAt":1794532090927,"integrity":"sha512-FW/DnlGdP9UQpFsVUyo6DdRSYZfaEMicLp1usRjZGamWkjux+38psvyyPppNdaFYWL/8BpzooPosa64xhSeKDA==","mode":420,"size":92884},"http2.d.ts":{"checkedAt":1794532090927,"integrity":"sha512-dwawjeUzR1HzlXmg0KZCCJCLFNNx/j+o8J12NBUxo09WMB7S0n1MizWENVmc4n1dxmWZz11/xA+3HsiQQWQU+g==","mode":420,"size":129797},"https.d.ts":{"checkedAt":1794532090927,"integrity":"sha512-5BuU4iJWELdAsHJyTSrOCaYJpw+i54deIy0tWgGWFh/G27f9yFNRjwDlOgU35naPX203sUyOTLM7LA0lZDFu5Q==","mode":420,"size":25856},"index.d.ts":{"checkedAt":1794532090927,"integrity":"sha512-mFST12lrp4XMoC3PxKCDLwEnc25y6x0PHvdcVBPfXmCybH/gTjrstsIIEvtXOWuMb2/ts0fAL/v0XOk21OI/YA==","mode":420,"size":4146},"inspector.d.ts":{"checkedAt":1794532090927,"integrity":"sha512-6bWwgNxhlmPKga12NO+0yz6oEKegrBy+8PWspCB0xVrqlUGF011RBnTWdl/+N4zUioxOZfemsNKSILOUeU7WRA==","mode":420,"size":11019},"inspector.generated.d.ts":{"checkedAt":1794532090928,"integrity":"sha512-Oq4VYQDCVtH8SIgVVo42QL+LaVIHVtRAmnG0z9DMhnveN2+SSQ9x2JqLbTh3lrlsjjYy0wX5ueZMV57/xtq53w==","mode":420,"size":205045},"module.d.ts":{"checkedAt":1794532090928,"integrity":"sha512-vXurRsSELFFZ2hTVlIBCAJmjRmCme2ja6H+HlK1zTot9G0pETOKyKcXtXSgwWgS56bW6QYq6Ll/RNLF2O68hsQ==","mode":420,"size":40283},"net.d.ts":{"checkedAt":1794532090928,"integrity":"sha512-gNO3sjJvpvZzS4IWODIG/TZzcLCUuaf7FMUhcnG+mnPzpnz8BAwS8nvIVV7u5PQD3u3Hs6EgxxCsO6R0D2Lguw==","mode":420,"size":48452},"os.d.ts":{"checkedAt":1794532090929,"integrity":"sha512-yCQUFHGcmB2lPiCJU9GBx0bo68HCuu3gH1E2ypII12KxUAf5C8eUvdsBdwoyJOnyMopJpB/w3tjJ9Line truncated
@@ -0,0 +1,464 @@
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""GYP backend that generates Eclipse CDT settings files.
This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML
files that can be imported into an Eclipse CDT project. The XML file contains a
list of include paths and symbols (i.e. defines).
Because a full .cproject definition is not created by this generator, it's not
possible to properly define the include dirs and symbols for each file
individually. Instead, one set of includes/symbols is generated for the entire
project. This works fairly well (and is a vast improvement in general), but may
still result in a few indexer issues here and there.
This generator has no automated tests, so expect it to be broken.
"""
from xml.sax.saxutils import escape
import os.path
import subprocess
import gyp
import gyp.common
import gyp.msvs_emulation
import shlex
import xml.etree.ElementTree as ET
generator_wants_static_library_dependencies_adjusted = False
generator_default_variables = {}
for dirname in ["INTERMEDIATE_DIR", "PRODUCT_DIR", "LIB_DIR", "SHARED_LIB_DIR"]:
# Some gyp steps fail if these are empty(!), so we convert them to variables
generator_default_variables[dirname] = "$" + dirname
for unused in [
"RULE_INPUT_PATH",
"RULE_INPUT_ROOT",
"RULE_INPUT_NAME",
"RULE_INPUT_DIRNAME",
"RULE_INPUT_EXT",
"EXECUTABLE_PREFIX",
"EXECUTABLE_SUFFIX",
"STATIC_LIB_PREFIX",
"STATIC_LIB_SUFFIX",
"SHARED_LIB_PREFIX",
"SHARED_LIB_SUFFIX",
"CONFIGURATION_NAME",
]:
generator_default_variables[unused] = ""
# Include dirs will occasionally use the SHARED_INTERMEDIATE_DIR variable as
# part of the path when dealing with generated headers. This value will be
# replaced dynamically for each configuration.
generator_default_variables["SHARED_INTERMEDIATE_DIR"] = "$SHARED_INTERMEDIATE_DIR"
def CalculateVariables(default_variables, params):
generator_flags = params.get("generator_flags", {})
for key, val in generator_flags.items():
default_variables.setdefault(key, val)
flavor = gyp.common.GetFlavor(params)
default_variables.setdefault("OS", flavor)
if flavor == "win":
gyp.msvs_emulation.CalculateCommonVariables(default_variables, params)
def CalculateGeneratorInputInfo(params):
"""Calculate the generator specific info that gets fed to input (called by
gyp)."""
generator_flags = params.get("generator_flags", {})
if generator_flags.get("adjust_static_libraries", False):
global generator_wants_static_library_dependencies_adjusted
generator_wants_static_library_dependencies_adjusted = True
def GetAllIncludeDirectories(
target_list,
target_dicts,
shared_intermediate_dirs,
config_name,
params,
compiler_path,
):
"""Calculate the set of include directories to be used.
Returns:
A list including all the include_dir's specified for every target followed
by any include directories that were added as cflag compiler options.
"""
gyp_includes_set = set()
compiler_includes_list = []
# Find compiler's default include dirs.
if compiler_path:
command = shlex.split(compiler_path)
command.extend(["-E", "-xc++", "-v", "-"])
proc = subprocess.Popen(
args=command,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
output = proc.communicate()[1].decode("utf-8")
# Extract the list of include dirs from the output, which has this format:
# ...
# #include "..." search starts here:
# #include <...> search starts here:
# /usr/include/c++/4.6
# /usr/local/include
# End of search list.
# ...
in_include_list = False
for line in output.splitlines():
if line.startswith("#include"):
in_include_list = True
continue
if line.startswith("End of search list."):
break
if in_include_list:
include_dir = line.strip()
if include_dir not in compiler_includes_list:
compiler_includes_list.append(include_dir)
flavor = gyp.common.GetFlavor(params)
if flavor == "win":
generator_flags = params.get("generator_flags", {})
for target_name in target_list:
target = target_dicts[target_name]
if config_name in target["configurations"]:
config = target["configurations"][config_name]
# Look for any include dirs that were explicitly added via cflags. This
# may be done in gyp files to force certain includes to come at the end.
# TODO(jgreenwald): Change the gyp files to not abuse cflags for this, and
# remove this.
if flavor == "win":
msvs_settings = gyp.msvs_emulation.MsvsSettings(target, generator_flags)
cflags = msvs_settings.GetCflags(config_name)
else:
cflags = config["cflags"]
for cflag in cflags:
if cflag.startswith("-I"):
include_dir = cflag[2:]
if include_dir not in compiler_includes_list:
compiler_includes_list.append(include_dir)
# Find standard gyp include dirs.
if "include_dirs" in config:
include_dirs = config["include_dirs"]
for shared_intermediate_dir in shared_intermediate_dirs:
for include_dir in include_dirs:
include_dir = include_dir.replace(
"$SHARED_INTERMEDIATE_DIR", shared_intermediate_dir
)
if not os.path.isabs(include_dir):
base_dir = os.path.dirname(target_name)
include_dir = base_dir + "/" + include_dir
include_dir = os.path.abspath(include_dir)
gyp_includes_set.add(include_dir)
# Generate a list that has all the include dirs.
all_includes_list = list(gyp_includes_set)
all_includes_list.sort()
for compiler_include in compiler_includes_list:
if compiler_include not in gyp_includes_set:
all_includes_list.append(compiler_include)
# All done.
return all_includes_list
def GetCompilerPath(target_list, data, options):
"""Determine a command that can be used to invoke the compiler.
Returns:
If this is a gyp project that has explicit make settings, try to determine
the compiler from that. Otherwise, see if a compiler was specified via the
CC_target environment variable.
"""
# First, see if the compiler is configured in make's settings.
build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0])
make_global_settings_dict = data[build_file].get("make_global_settings", {})
for key, value in make_global_settings_dict:
if key in ["CC", "CXX"]:
return os.path.join(options.toplevel_dir, value)
# Check to see if the compiler was specified as an environment variable.
for key in ["CC_target", "CC", "CXX"]:
compiler = os.environ.get(key)
if compiler:
return compiler
return "gcc"
def GetAllDefines(target_list, target_dicts, data, config_name, params, compiler_path):
"""Calculate the defines for a project.
Returns:
A dict that includes explicit defines declared in gyp files along with all
of the default defines that the compiler uses.
"""
# Get defines declared in the gyp files.
all_defines = {}
flavor = gyp.common.GetFlavor(params)
if flavor == "win":
generator_flags = params.get("generator_flags", {})
for target_name in target_list:
target = target_dicts[target_name]
if flavor == "win":
msvs_settings = gyp.msvs_emulation.MsvsSettings(target, generator_flags)
extra_defines = msvs_settings.GetComputedDefines(config_name)
else:
extra_defines = []
if config_name in target["configurations"]:
config = target["configurations"][config_name]
target_defines = config["defines"]
else:
target_defines = []
for define in target_defines + extra_defines:
split_define = define.split("=", 1)
if len(split_define) == 1:
split_define.append("1")
if split_define[0].strip() in all_defines:
# Already defined
continue
all_defines[split_define[0].strip()] = split_define[1].strip()
# Get default compiler defines (if possible).
if flavor == "win":
return all_defines # Default defines already processed in the loop above.
if compiler_path:
command = shlex.split(compiler_path)
command.extend(["-E", "-dM", "-"])
cpp_proc = subprocess.Popen(
args=command, cwd=".", stdin=subprocess.PIPE, stdout=subprocess.PIPE
)
cpp_output = cpp_proc.communicate()[0].decode("utf-8")
cpp_lines = cpp_output.split("\n")
for cpp_line in cpp_lines:
if not cpp_line.strip():
continue
cpp_line_parts = cpp_line.split(" ", 2)
key = cpp_line_parts[1]
if len(cpp_line_parts) >= 3:
val = cpp_line_parts[2]
else:
val = "1"
all_defines[key] = val
return all_defines
def WriteIncludePaths(out, eclipse_langs, include_dirs):
"""Write the includes section of a CDT settings export file."""
out.write(
' <section name="org.eclipse.cdt.internal.ui.wizards.'
'settingswizards.IncludePaths">\n'
)
out.write(' <language name="holder for library settings"></language>\n')
for lang in eclipse_langs:
out.write(' <language name="%s">\n' % lang)
for include_dir in include_dirs:
out.write(
' <includepath workspace_path="false">%s</includepath>\n'
% include_dir
)
out.write(" </language>\n")
out.write(" </section>\n")
def WriteMacros(out, eclipse_langs, defines):
"""Write the macros section of a CDT settings export file."""
out.write(
' <section name="org.eclipse.cdt.internal.ui.wizards.'
'settingswizards.Macros">\n'
)
out.write(' <language name="holder for library settings"></language>\n')
for lang in eclipse_langs:
out.write(' <language name="%s">\n' % lang)
for key in sorted(defines):
out.write(
" <macro><name>%s</name><value>%s</value></macro>\n"
% (escape(key), escape(defines[key]))
)
out.write(" </language>\n")
out.write(" </section>\n")
def GenerateOutputForConfig(target_list, target_dicts, data, params, config_name):
options = params["options"]
generator_flags = params.get("generator_flags", {})
# build_dir: relative path from source root to our output files.
# e.g. "out/Debug"
build_dir = os.path.join(generator_flags.get("output_dir", "out"), config_name)
toplevel_build = os.path.join(options.toplevel_dir, build_dir)
# Ninja uses out/Debug/gen while make uses out/Debug/obj/gen as the
# SHARED_INTERMEDIATE_DIR. Include both possible locations.
shared_intermediate_dirs = [
os.path.join(toplevel_build, "obj", "gen"),
os.path.join(toplevel_build, "gen"),
]
GenerateCdtSettingsFile(
target_list,
target_dicts,
data,
params,
config_name,
os.path.join(toplevel_build, "eclipse-cdt-settings.xml"),
options,
shared_intermediate_dirs,
)
GenerateClasspathFile(
target_list,
target_dicts,
options.toplevel_dir,
toplevel_build,
os.path.join(toplevel_build, "eclipse-classpath.xml"),
)
def GenerateCdtSettingsFile(
target_list,
target_dicts,
data,
params,
config_name,
out_name,
options,
shared_intermediate_dirs,
):
gyp.common.EnsureDirExists(out_name)
with open(out_name, "w") as out:
out.write('<?xml version="1.0" encoding="UTF-8"?>\n')
out.write("<cdtprojectproperties>\n")
eclipse_langs = [
"C++ Source File",
"C Source File",
"Assembly Source File",
"GNU C++",
"GNU C",
"Assembly",
]
compiler_path = GetCompilerPath(target_list, data, options)
include_dirs = GetAllIncludeDirectories(
target_list,
target_dicts,
shared_intermediate_dirs,
config_name,
params,
compiler_path,
)
WriteIncludePaths(out, eclipse_langs, include_dirs)
defines = GetAllDefines(
target_list, target_dicts, data, config_name, params, compiler_path
)
WriteMacros(out, eclipse_langs, defines)
out.write("</cdtprojectproperties>\n")
def GenerateClasspathFile(
target_list, target_dicts, toplevel_dir, toplevel_build, out_name
):
"""Generates a classpath file suitable for symbol navigation and code
completion of Java code (such as in Android projects) by finding all
.java and .jar files used as action inputs."""
gyp.common.EnsureDirExists(out_name)
result = ET.Element("classpath")
def AddElements(kind, paths):
# First, we need to normalize the paths so they are all relative to the
# toplevel dir.
rel_paths = set()
for path in paths:
if os.path.isabs(path):
rel_paths.add(os.path.relpath(path, toplevel_dir))
else:
rel_paths.add(path)
for path in sorted(rel_paths):
entry_element = ET.SubElement(result, "classpathentry")
entry_element.set("kind", kind)
entry_element.set("path", path)
AddElements("lib", GetJavaJars(target_list, target_dicts, toplevel_dir))
AddElements("src", GetJavaSourceDirs(target_list, target_dicts, toplevel_dir))
# Include the standard JRE container and a dummy out folder
AddElements("con", ["org.eclipse.jdt.launching.JRE_CONTAINER"])
# Include a dummy out folder so that Eclipse doesn't use the default /bin
# folder in the root of the project.
AddElements("output", [os.path.join(toplevel_build, ".eclipse-java-build")])
ET.ElementTree(result).write(out_name)
def GetJavaJars(target_list, target_dicts, toplevel_dir):
"""Generates a sequence of all .jars used as inputs."""
for target_name in target_list:
target = target_dicts[target_name]
for action in target.get("actions", []):
for input_ in action["inputs"]:
if os.path.splitext(input_)[1] == ".jar" and not input_.startswith("$"):
if os.path.isabs(input_):
yield input_
else:
yield os.path.join(os.path.dirname(target_name), input_)
def GetJavaSourceDirs(target_list, target_dicts, toplevel_dir):
"""Generates a sequence of all likely java package root directories."""
for target_name in target_list:
target = target_dicts[target_name]
for action in target.get("actions", []):
for input_ in action["inputs"]:
if os.path.splitext(input_)[1] == ".java" and not input_.startswith(
"$"
):
dir_ = os.path.dirname(
os.path.join(os.path.dirname(target_name), input_)
)
# If there is a parent 'src' or 'java' folder, navigate up to it -
# these are canonical package root names in Chromium. This will
# break if 'src' or 'java' exists in the package structure. This
# could be further improved by inspecting the java file for the
# package name if this proves to be too fragile in practice.
parent_search = dir_
while os.path.basename(parent_search) not in ["src", "java"]:
parent_search, _ = os.path.split(parent_search)
if not parent_search or parent_search == toplevel_dir:
# Didn't find a known root, just return the original path
yield dir_
break
else:
yield parent_search
def GenerateOutput(target_list, target_dicts, data, params):
"""Generate an XML settings file that can be imported into a CDT project."""
if params["options"].generator_output:
raise NotImplementedError("--generator_output not implemented for eclipse")
user_config = params.get("generator_flags", {}).get("config", None)
if user_config:
GenerateOutputForConfig(target_list, target_dicts, data, params, user_config)
else:
config_names = target_dicts[target_list[0]]["configurations"]
for config_name in config_names:
GenerateOutputForConfig(
target_list, target_dicts, data, params, config_name
)
@@ -0,0 +1,259 @@
/**
* @file cff表
* @author mengke01(kekee000@gmail.com)
*
* reference:
* http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/font/pdfs/5176.CFF.pdf
*
* modify from:
* https://github.com/nodebox/opentype.js/blob/master/src/tables/cff.js
*/
import table from './table';
import string from '../util/string';
import encoding from './cff/encoding';
import cffStandardStrings from './cff/cffStandardStrings';
import parseCFFDict from './cff/parseCFFDict';
import parseCFFGlyph from './cff/parseCFFGlyph';
import parseCFFCharset from './cff/parseCFFCharset';
import parseCFFEncoding from './cff/parseCFFEncoding';
import Reader from '../reader';
/**
* 获取cff偏移
*
* @param {Reader} reader 读取器
* @param {number} offSize 偏移大小
* @param {number} offset 起始偏移
* @return {number} 偏移
*/
function getOffset(reader, offSize) {
let v = 0;
for (let i = 0; i < offSize; i++) {
v <<= 8;
v += reader.readUint8();
}
return v;
}
/**
* 解析cff表头部
*
* @param {Reader} reader 读取器
* @return {Object} 头部字段
*/
function parseCFFHead(reader) {
const head = {};
head.startOffset = reader.offset;
head.endOffset = head.startOffset + 4;
head.formatMajor = reader.readUint8();
head.formatMinor = reader.readUint8();
head.size = reader.readUint8();
head.offsetSize = reader.readUint8();
return head;
}
/**
* 解析`CFF`表索引
*
* @param {Reader} reader 读取器
* @param {number} offset 偏移
* @param {Funciton} conversionFn 转换函数
* @return {Object} 表对象
*/
function parseCFFIndex(reader, offset, conversionFn) {
if (offset) {
reader.seek(offset);
}
const start = reader.offset;
const offsets = [];
const objects = [];
const count = reader.readUint16();
let i;
let l;
if (count !== 0) {
const offsetSize = reader.readUint8();
for (i = 0, l = count + 1; i < l; i++) {
offsets.push(getOffset(reader, offsetSize));
}
for (i = 0, l = count; i < l; i++) {
let value = reader.readBytes(offsets[i + 1] - offsets[i]);
if (conversionFn) {
value = conversionFn(value);
}
objects.push(value);
}
}
return {
objects,
startOffset: start,
endOffset: reader.offset
};
}
// Subroutines are encoded using the negative half of the number space.
// See type 2 chapter 4.7 "Subroutine operators".
function calcCFFSubroutineBias(subrs) {
let bias;
if (subrs.length < 1240) {
bias = 107;
}
else if (subrs.length < 33900) {
bias = 1131;
}
else {
bias = 32768;
}
return bias;
}
export default table.create(
'cff',
[],
{
read(reader, font) {
const offset = this.offset;
reader.seek(offset);
const head = parseCFFHead(reader);
const nameIndex = parseCFFIndex(reader, head.endOffset, string.getString);
const topDictIndex = parseCFFIndex(reader, nameIndex.endOffset);
const stringIndex = parseCFFIndex(reader, topDictIndex.endOffset, string.getString);
const globalSubrIndex = parseCFFIndex(reader, stringIndex.endOffset);
const cff = {
head
};
// 全局子glyf数据
cff.gsubrs = globalSubrIndex.objects;
cff.gsubrsBias = calcCFFSubroutineBias(globalSubrIndex.objects);
// 顶级字典数据
const dictReader = new Reader(new Uint8Array(topDictIndex.objects[0]).buffer);
const topDict = parseCFFDict.parseTopDict(
dictReader,
0,
dictReader.length,
stringIndex.objects
);
cff.topDict = topDict;
// 私有字典数据
const privateDictLength = topDict.private[0];
let privateDict = {};
let privateDictOffset;
if (privateDictLength) {
privateDictOffset = offset + topDict.private[1];
privateDict = parseCFFDict.parsePrivateDict(
reader,
privateDictOffset,
privateDictLength,
stringIndex.objects
);
cff.defaultWidthX = privateDict.defaultWidthX;
cff.nominalWidthX = privateDict.nominalWidthX;
}
else {
cff.defaultWidthX = 0;
cff.nominalWidthX = 0;
}
// 私有子glyf数据
if (privateDict.subrs) {
const subrOffset = privateDictOffset + privateDict.subrs;
const subrIndex = parseCFFIndex(reader, subrOffset);
cff.subrs = subrIndex.objects;
cff.subrsBias = calcCFFSubroutineBias(cff.subrs);
}
else {
cff.subrs = [];
cff.subrsBias = 0;
}
cff.privateDict = privateDict;
// 解析glyf数据和名字
const charStringsIndex = parseCFFIndex(reader, offset + topDict.charStrings);
const nGlyphs = charStringsIndex.objects.length;
if (topDict.charset < 3) {
// @author: fr33z00
// See end of chapter 13 (p22) of #5176.CFF.pdf :
// Still more optimization is possible by
// observing that many fonts adopt one of 3 common charsets. In
// these cases the operand to the charset operator in the Top DICT
// specifies a predefined charset id, in place of an offset, as shown in table 22
cff.charset = cffStandardStrings;
}
else {
cff.charset = parseCFFCharset(reader, offset + topDict.charset, nGlyphs, stringIndex.objects);
}
// Standard encoding
if (topDict.encoding === 0) {
cff.encoding = encoding.standardEncoding;
}
// Expert encoding
else if (topDict.encoding === 1) {
cff.encoding = encoding.expertEncoding;
}
else {
cff.encoding = parseCFFEncoding(reader, offset + topDict.encoding);
}
cff.glyf = [];
// only parse subset glyphs
const subset = font.readOptions.subset;
if (subset && subset.length > 0) {
// subset map
const subsetMap = {
0: true // 设置.notdef
};
const codes = font.cmap;
// unicode to index
Object.keys(codes).forEach((c) => {
if (subset.indexOf(+c) > -1) {
const i = codes[c];
subsetMap[i] = true;
}
});
font.subsetMap = subsetMap;
Object.keys(subsetMap).forEach((i) => {
i = +i;
const glyf = parseCFFGlyph(charStringsIndex.objects[i], cff, i);
glyf.name = cff.charset[i];
cff.glyf[i] = glyf;
});
}
// parse all
else {
for (let i = 0, l = nGlyphs; i < l; i++) {
const glyf = parseCFFGlyph(charStringsIndex.objects[i], cff, i);
glyf.name = cff.charset[i];
cff.glyf.push(glyf);
}
}
return cff;
},
// eslint-disable-next-line no-unused-vars
write(writer, font) {
throw new Error('not support write cff table');
},
// eslint-disable-next-line no-unused-vars
size(font) {
throw new Error('not support get cff table size');
}
}
);
@@ -0,0 +1,749 @@
"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const utils = require("./utils.cjs");
const defaultKeyExtractor = (index) => index;
const defaultRangeExtractor = (range) => {
const start = Math.max(range.startIndex - range.overscan, 0);
const end = Math.min(range.endIndex + range.overscan, range.count - 1);
const arr = [];
for (let i = start; i <= end; i++) {
arr.push(i);
}
return arr;
};
const observeElementRect = (instance, cb) => {
const element = instance.scrollElement;
if (!element) {
return;
}
const targetWindow = instance.targetWindow;
if (!targetWindow) {
return;
}
const handler = (rect) => {
const { width, height } = rect;
cb({ width: Math.round(width), height: Math.round(height) });
};
handler(element.getBoundingClientRect());
if (!targetWindow.ResizeObserver) {
return () => {
};
}
const observer = new targetWindow.ResizeObserver((entries) => {
const entry = entries[0];
if (entry == null ? void 0 : entry.borderBoxSize) {
const box = entry.borderBoxSize[0];
if (box) {
handler({ width: box.inlineSize, height: box.blockSize });
return;
}
}
handler(element.getBoundingClientRect());
});
observer.observe(element, { box: "border-box" });
return () => {
observer.unobserve(element);
};
};
const addEventListenerOptions = {
passive: true
};
const observeWindowRect = (instance, cb) => {
const element = instance.scrollElement;
if (!element) {
return;
}
const handler = () => {
cb({ width: element.innerWidth, height: element.innerHeight });
};
handler();
element.addEventListener("resize", handler, addEventListenerOptions);
return () => {
element.removeEventListener("resize", handler);
};
};
const supportsScrollend = typeof window == "undefined" ? true : "onscrollend" in window;
const observeElementOffset = (instance, cb) => {
const element = instance.scrollElement;
if (!element) {
return;
}
const targetWindow = instance.targetWindow;
if (!targetWindow) {
return;
}
let offset = 0;
const fallback = instance.options.useScrollendEvent && supportsScrollend ? () => void 0 : utils.debounce(
targetWindow,
() => {
cb(offset, false);
},
instance.options.isScrollingResetDelay
);
const createHandler = (isScrolling) => () => {
const { horizontal, isRtl } = instance.options;
offset = horizontal ? element["scrollLeft"] * (isRtl && -1 || 1) : element["scrollTop"];
fallback();
cb(offset, isScrolling);
};
const handler = createHandler(true);
const endHandler = createHandler(false);
endHandler();
element.addEventListener("scroll", handler, addEventListenerOptions);
element.addEventListener("scrollend", endHandler, addEventListenerOptions);
return () => {
element.removeEventListener("scroll", handler);
element.removeEventListener("scrollend", endHandler);
};
};
const observeWindowOffset = (instance, cb) => {
const element = instance.scrollElement;
if (!element) {
return;
}
const targetWindow = instance.targetWindow;
if (!targetWindow) {
return;
}
let offset = 0;
const fallback = instance.options.useScrollendEvent && supportsScrollend ? () => void 0 : utils.debounce(
targetWindow,
() => {
cb(offset, false);
},
instance.options.isScrollingResetDelay
);
const createHandler = (isScrolling) => () => {
offset = element[instance.options.horizontal ? "scrollX" : "scrollY"];
fallback();
cb(offset, isScrolling);
};
const handler = createHandler(true);
const endHandler = createHandler(false);
endHandler();
element.addEventListener("scroll", handler, addEventListenerOptions);
element.addEventListener("scrollend", endHandler, addEventListenerOptions);
return () => {
element.removeEventListener("scroll", handler);
element.removeEventListener("scrollend", endHandler);
};
};
const measureElement = (element, entry, instance) => {
if (entry == null ? void 0 : entry.borderBoxSize) {
const box = entry.borderBoxSize[0];
if (box) {
const size = Math.round(
box[instance.options.horizontal ? "inlineSize" : "blockSize"]
);
return size;
}
}
return Math.round(
element.getBoundingClientRect()[instance.options.horizontal ? "width" : "height"]
);
};
const windowScroll = (offset, {
adjustments = 0,
behavior
}, instance) => {
var _a, _b;
const toOffset = offset + adjustments;
(_b = (_a = instance.scrollElement) == null ? void 0 : _a.scrollTo) == null ? void 0 : _b.call(_a, {
[instance.options.horizontal ? "left" : "top"]: toOffset,
behavior
});
};
const elementScroll = (offset, {
adjustments = 0,
behavior
}, instance) => {
var _a, _b;
const toOffset = offset + adjustments;
(_b = (_a = instance.scrollElement) == null ? void 0 : _a.scrollTo) == null ? void 0 : _b.call(_a, {
[instance.options.horizontal ? "left" : "top"]: toOffset,
behavior
});
};
class Virtualizer {
constructor(opts) {
this.unsubs = [];
this.scrollElement = null;
this.targetWindow = null;
this.isScrolling = false;
this.scrollToIndexTimeoutId = null;
this.measurementsCache = [];
this.itemSizeCache = /* @__PURE__ */ new Map();
this.pendingMeasuredCacheIndexes = [];
this.scrollRect = null;
this.scrollOffset = null;
this.scrollDirection = null;
this.scrollAdjustments = 0;
this.elementsCache = /* @__PURE__ */ new Map();
this.observer = /* @__PURE__ */ (() => {
let _ro = null;
const get = () => {
if (_ro) {
return _ro;
}
if (!this.targetWindow || !this.targetWindow.ResizeObserver) {
return null;
}
return _ro = new this.targetWindow.ResizeObserver((entries) => {
entries.forEach((entry) => {
this._measureElement(entry.target, entry);
});
});
};
return {
disconnect: () => {
var _a;
(_a = get()) == null ? void 0 : _a.disconnect();
_ro = null;
},
observe: (target) => {
var _a;
return (_a = get()) == null ? void 0 : _a.observe(target, { box: "border-box" });
},
unobserve: (target) => {
var _a;
return (_a = get()) == null ? void 0 : _a.unobserve(target);
}
};
})();
this.range = null;
this.setOptions = (opts2) => {
Object.entries(opts2).forEach(([key, value]) => {
if (typeof value === "undefined") delete opts2[key];
});
this.options = {
debug: false,
initialOffset: 0,
overscan: 1,
paddingStart: 0,
paddingEnd: 0,
scrollPaddingStart: 0,
scrollPaddingEnd: 0,
horizontal: false,
getItemKey: defaultKeyExtractor,
rangeExtractor: defaultRangeExtractor,
onChange: () => {
},
measureElement,
initialRect: { width: 0, height: 0 },
scrollMargin: 0,
gap: 0,
indexAttribute: "data-index",
initialMeasurementsCache: [],
lanes: 1,
isScrollingResetDelay: 150,
enabled: true,
isRtl: false,
useScrollendEvent: true,
...opts2
};
};
this.notify = (sync) => {
var _a, _b;
(_b = (_a = this.options).onChange) == null ? void 0 : _b.call(_a, this, sync);
};
this.maybeNotify = utils.memo(
() => {
this.calculateRange();
return [
this.isScrolling,
this.range ? this.range.startIndex : null,
this.range ? this.range.endIndex : null
];
},
(isScrolling) => {
this.notify(isScrolling);
},
{
key: process.env.NODE_ENV !== "production" && "maybeNotify",
debug: () => this.options.debug,
initialDeps: [
this.isScrolling,
this.range ? this.range.startIndex : null,
this.range ? this.range.endIndex : null
]
}
);
this.cleanup = () => {
this.unsubs.filter(Boolean).forEach((d) => d());
this.unsubs = [];
this.observer.disconnect();
this.scrollElement = null;
this.targetWindow = null;
};
this._didMount = () => {
return () => {
this.cleanup();
};
};
this._willUpdate = () => {
var _a;
const scrollElement = this.options.enabled ? this.options.getScrollElement() : null;
if (this.scrollElement !== scrollElement) {
this.cleanup();
if (!scrollElement) {
this.maybeNotify();
return;
}
this.scrollElement = scrollElement;
if (this.scrollElement && "ownerDocument" in this.scrollElement) {
this.targetWindow = this.scrollElement.ownerDocument.defaultView;
} else {
this.targetWindow = ((_a = this.scrollElement) == null ? void 0 : _a.window) ?? null;
}
this.elementsCache.forEach((cached) => {
this.observer.observe(cached);
});
this._scrollToOffset(this.getScrollOffset(), {
adjustments: void 0,
behavior: void 0
});
this.unsubs.push(
this.options.observeElementRect(this, (rect) => {
this.scrollRect = rect;
this.maybeNotify();
})
);
this.unsubs.push(
this.options.observeElementOffset(this, (offset, isScrolling) => {
this.scrollAdjustments = 0;
this.scrollDirection = isScrolling ? this.getScrollOffset() < offset ? "forward" : "backward" : null;
this.scrollOffset = offset;
this.isScrolling = isScrolling;
this.maybeNotify();
})
);
}
};
this.getSize = () => {
if (!this.options.enabled) {
this.scrollRect = null;
return 0;
}
this.scrollRect = this.scrollRect ?? this.options.initialRect;
return this.scrollRect[this.options.horizontal ? "width" : "height"];
};
this.getScrollOffset = () => {
if (!this.options.enabled) {
this.scrollOffset = null;
return 0;
}
this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset === "function" ? this.options.initialOffset() : this.options.initialOffset);
return this.scrollOffset;
};
this.getFurthestMeasurement = (measurements, index) => {
const furthestMeasurementsFound = /* @__PURE__ */ new Map();
const furthestMeasurements = /* @__PURE__ */ new Map();
for (let m = index - 1; m >= 0; m--) {
const measurement = measurements[m];
if (furthestMeasurementsFound.has(measurement.lane)) {
continue;
}
const previousFurthestMeasurement = furthestMeasurements.get(
measurement.lane
);
if (previousFurthestMeasurement == null || measurement.end > previousFurthestMeasurement.end) {
furthestMeasurements.set(measurement.lane, measurement);
} else if (measurement.end < previousFurthestMeasurement.end) {
furthestMeasurementsFound.set(measurement.lane, true);
}
if (furthestMeasurementsFound.size === this.options.lanes) {
break;
}
}
return furthestMeasurements.size === this.options.lanes ? Array.from(furthestMeasurements.values()).sort((a, b) => {
if (a.end === b.end) {
return a.index - b.index;
}
return a.end - b.end;
})[0] : void 0;
};
this.getMeasurementOptions = utils.memo(
() => [
this.options.count,
this.options.paddingStart,
this.options.scrollMargin,
this.options.getItemKey,
this.options.enabled
],
(count, paddingStart, scrollMargin, getItemKey, enabled) => {
this.pendingMeasuredCacheIndexes = [];
return {
count,
paddingStart,
scrollMargin,
getItemKey,
enabled
};
},
{
key: false
}
);
this.getMeasurements = utils.memo(
() => [this.getMeasurementOptions(), this.itemSizeCache],
({ count, paddingStart, scrollMargin, getItemKey, enabled }, itemSizeCache) => {
if (!enabled) {
this.measurementsCache = [];
this.itemSizeCache.clear();
return [];
}
if (this.measurementsCache.length === 0) {
this.measurementsCache = this.options.initialMeasurementsCache;
this.measurementsCache.forEach((item) => {
this.itemSizeCache.set(item.key, item.size);
});
}
const min = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
this.pendingMeasuredCacheIndexes = [];
const measurements = this.measurementsCache.slice(0, min);
for (let i = min; i < count; i++) {
const key = getItemKey(i);
const furthestMeasurement = this.options.lanes === 1 ? measurements[i - 1] : this.getFurthestMeasurement(measurements, i);
const start = furthestMeasurement ? furthestMeasurement.end + this.options.gap : paddingStart + scrollMargin;
const measuredSize = itemSizeCache.get(key);
const size = typeof measuredSize === "number" ? measuredSize : this.options.estimateSize(i);
const end = start + size;
const lane = furthestMeasurement ? furthestMeasurement.lane : i % this.options.lanes;
measurements[i] = {
index: i,
start,
size,
end,
key,
lane
};
}
this.measurementsCache = measurements;
return measurements;
},
{
key: process.env.NODE_ENV !== "production" && "getMeasurements",
debug: () => this.options.debug
}
);
this.calculateRange = utils.memo(
() => [this.getMeasurements(), this.getSize(), this.getScrollOffset()],
(measurements, outerSize, scrollOffset) => {
return this.range = measurements.length > 0 && outerSize > 0 ? calculateRange({
measurements,
outerSize,
scrollOffset
}) : null;
},
{
key: process.env.NODE_ENV !== "production" && "calculateRange",
debug: () => this.options.debug
}
);
this.getIndexes = utils.memo(
() => [
this.options.rangeExtractor,
this.calculateRange(),
this.options.overscan,
this.options.count
],
(rangeExtractor, range, overscan, count) => {
return range === null ? [] : rangeExtractor({
startIndex: range.startIndex,
endIndex: range.endIndex,
overscan,
count
});
},
{
key: process.env.NODE_ENV !== "production" && "getIndexes",
debug: () => this.options.debug
}
);
this.indexFromElement = (node) => {
const attributeName = this.options.indexAttribute;
const indexStr = node.getAttribute(attributeName);
if (!indexStr) {
console.warn(
`Missing attribute name '${attributeName}={index}' on measured element.`
);
return -1;
}
return parseInt(indexStr, 10);
};
this._measureElement = (node, entry) => {
const index = this.indexFromElement(node);
const item = this.measurementsCache[index];
if (!item) {
return;
}
const key = item.key;
const prevNode = this.elementsCache.get(key);
if (prevNode !== node) {
if (prevNode) {
this.observer.unobserve(prevNode);
}
this.observer.observe(node);
this.elementsCache.set(key, node);
}
if (node.isConnected) {
this.resizeItem(index, this.options.measureElement(node, entry, this));
}
};
this.resizeItem = (index, size) => {
const item = this.measurementsCache[index];
if (!item) {
return;
}
const itemSize = this.itemSizeCache.get(item.key) ?? item.size;
const delta = size - itemSize;
if (delta !== 0) {
if (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(item, delta, this) : item.start < this.getScrollOffset() + this.scrollAdjustments) {
if (process.env.NODE_ENV !== "production" && this.options.debug) {
console.info("correction", delta);
}
this._scrollToOffset(this.getScrollOffset(), {
adjustments: this.scrollAdjustments += delta,
behavior: void 0
});
}
this.pendingMeasuredCacheIndexes.push(item.index);
this.itemSizeCache = new Map(this.itemSizeCache.set(item.key, size));
this.notify(false);
}
};
this.measureElement = (node) => {
if (!node) {
this.elementsCache.forEach((cached, key) => {
if (!cached.isConnected) {
this.observer.unobserve(cached);
this.elementsCache.delete(key);
}
});
return;
}
this._measureElement(node, void 0);
};
this.getVirtualItems = utils.memo(
() => [this.getIndexes(), this.getMeasurements()],
(indexes, measurements) => {
const virtualItems = [];
for (let k = 0, len = indexes.length; k < len; k++) {
const i = indexes[k];
const measurement = measurements[i];
virtualItems.push(measurement);
}
return virtualItems;
},
{
key: process.env.NODE_ENV !== "production" && "getVirtualItems",
debug: () => this.options.debug
}
);
this.getVirtualItemForOffset = (offset) => {
const measurements = this.getMeasurements();
if (measurements.length === 0) {
return void 0;
}
return utils.notUndefined(
measurements[findNearestBinarySearch(
0,
measurements.length - 1,
(index) => utils.notUndefined(measurements[index]).start,
offset
)]
);
};
this.getOffsetForAlignment = (toOffset, align) => {
const size = this.getSize();
const scrollOffset = this.getScrollOffset();
if (align === "auto") {
if (toOffset >= scrollOffset + size) {
align = "end";
}
}
if (align === "end") {
toOffset -= size;
}
const scrollSizeProp = this.options.horizontal ? "scrollWidth" : "scrollHeight";
const scrollSize = this.scrollElement ? "document" in this.scrollElement ? this.scrollElement.document.documentElement[scrollSizeProp] : this.scrollElement[scrollSizeProp] : 0;
const maxOffset = scrollSize - size;
return Math.max(Math.min(maxOffset, toOffset), 0);
};
this.getOffsetForIndex = (index, align = "auto") => {
index = Math.max(0, Math.min(index, this.options.count - 1));
const item = this.measurementsCache[index];
if (!item) {
return void 0;
}
const size = this.getSize();
const scrollOffset = this.getScrollOffset();
if (align === "auto") {
if (item.end >= scrollOffset + size - this.options.scrollPaddingEnd) {
align = "end";
} else if (item.start <= scrollOffset + this.options.scrollPaddingStart) {
align = "start";
} else {
return [scrollOffset, align];
}
}
const centerOffset = item.start - this.options.scrollPaddingStart + (item.size - size) / 2;
switch (align) {
case "center":
return [this.getOffsetForAlignment(centerOffset, align), align];
case "end":
return [
this.getOffsetForAlignment(
item.end + this.options.scrollPaddingEnd,
align
),
align
];
default:
return [
this.getOffsetForAlignment(
item.start - this.options.scrollPaddingStart,
align
),
align
];
}
};
this.isDynamicMode = () => this.elementsCache.size > 0;
this.cancelScrollToIndex = () => {
if (this.scrollToIndexTimeoutId !== null && this.targetWindow) {
this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId);
this.scrollToIndexTimeoutId = null;
}
};
this.scrollToOffset = (toOffset, { align = "start", behavior } = {}) => {
this.cancelScrollToIndex();
if (behavior === "smooth" && this.isDynamicMode()) {
console.warn(
"The `smooth` scroll behavior is not fully supported with dynamic size."
);
}
this._scrollToOffset(this.getOffsetForAlignment(toOffset, align), {
adjustments: void 0,
behavior
});
};
this.scrollToIndex = (index, { align: initialAlign = "auto", behavior } = {}) => {
index = Math.max(0, Math.min(index, this.options.count - 1));
this.cancelScrollToIndex();
if (behavior === "smooth" && this.isDynamicMode()) {
console.warn(
"The `smooth` scroll behavior is not fully supported with dynamic size."
);
}
const offsetAndAlign = this.getOffsetForIndex(index, initialAlign);
if (!offsetAndAlign) return;
const [offset, align] = offsetAndAlign;
this._scrollToOffset(offset, { adjustments: void 0, behavior });
if (behavior !== "smooth" && this.isDynamicMode() && this.targetWindow) {
this.scrollToIndexTimeoutId = this.targetWindow.setTimeout(() => {
this.scrollToIndexTimeoutId = null;
const elementInDOM = this.elementsCache.has(
this.options.getItemKey(index)
);
if (elementInDOM) {
const [latestOffset] = utils.notUndefined(
this.getOffsetForIndex(index, align)
);
if (!utils.approxEqual(latestOffset, this.getScrollOffset())) {
this.scrollToIndex(index, { align, behavior });
}
} else {
this.scrollToIndex(index, { align, behavior });
}
});
}
};
this.scrollBy = (delta, { behavior } = {}) => {
this.cancelScrollToIndex();
if (behavior === "smooth" && this.isDynamicMode()) {
console.warn(
"The `smooth` scroll behavior is not fully supported with dynamic size."
);
}
this._scrollToOffset(this.getScrollOffset() + delta, {
adjustments: void 0,
behavior
});
};
this.getTotalSize = () => {
var _a;
const measurements = this.getMeasurements();
let end;
if (measurements.length === 0) {
end = this.options.paddingStart;
} else {
end = this.options.lanes === 1 ? ((_a = measurements[measurements.length - 1]) == null ? void 0 : _a.end) ?? 0 : Math.max(
...measurements.slice(-this.options.lanes).map((m) => m.end)
);
}
return Math.max(
end - this.options.scrollMargin + this.options.paddingEnd,
0
);
};
this._scrollToOffset = (offset, {
adjustments,
behavior
}) => {
this.options.scrollToFn(offset, { behavior, adjustments }, this);
};
this.measure = () => {
this.itemSizeCache = /* @__PURE__ */ new Map();
this.notify(false);
};
this.setOptions(opts);
}
}
const findNearestBinarySearch = (low, high, getCurrentValue, value) => {
while (low <= high) {
const middle = (low + high) / 2 | 0;
const currentValue = getCurrentValue(middle);
if (currentValue < value) {
low = middle + 1;
} else if (currentValue > value) {
high = middle - 1;
} else {
return middle;
}
}
if (low > 0) {
return low - 1;
} else {
return 0;
}
};
function calculateRange({
measurements,
outerSize,
scrollOffset
}) {
const count = measurements.length - 1;
const getOffset = (index) => measurements[index].start;
const startIndex = findNearestBinarySearch(0, count, getOffset, scrollOffset);
let endIndex = startIndex;
while (endIndex < count && measurements[endIndex].end < scrollOffset + outerSize) {
endIndex++;
}
return { startIndex, endIndex };
}
exports.approxEqual = utils.approxEqual;
exports.debounce = utils.debounce;
exports.memo = utils.memo;
exports.notUndefined = utils.notUndefined;
exports.Virtualizer = Virtualizer;
exports.defaultKeyExtractor = defaultKeyExtractor;
exports.defaultRangeExtractor = defaultRangeExtractor;
exports.elementScroll = elementScroll;
exports.measureElement = measureElement;
exports.observeElementOffset = observeElementOffset;
exports.observeElementRect = observeElementRect;
exports.observeWindowOffset = observeWindowOffset;
exports.observeWindowRect = observeWindowRect;
exports.windowScroll = windowScroll;
//# sourceMappingURL=index.cjs.map
@@ -0,0 +1,5 @@
function _identity(x) {
return x;
}
export { _identity as _ };
@@ -0,0 +1 @@
{"version":3,"names":["_gensync","data","require","_index","_index2","_rewriteStackTrace","transformFromAstRunner","gensync","ast","code","opts","config","loadConfig","Error","run","transformFromAst","exports","optsOrCallback","maybeCallback","callback","undefined","beginHiddenCallStack","sync","errback","transformFromAstSync","args","transformFromAstAsync","async"],"sources":["../src/transform-ast.ts"],"sourcesContent":["import gensync, { type Handler } from \"gensync\";\n\nimport loadConfig from \"./config/index.ts\";\nimport type { InputOptions, ResolvedConfig } from \"./config/index.ts\";\nimport { run } from \"./transformation/index.ts\";\nimport type * as t from \"@babel/types\";\n\nimport { beginHiddenCallStack } from \"./errors/rewrite-stack-trace.ts\";\n\nimport type { FileResult, FileResultCallback } from \"./transformation/index.ts\";\ntype AstRoot = t.File | t.Program;\n\ntype TransformFromAst = {\n (ast: AstRoot, code: string, callback: FileResultCallback): void;\n (\n ast: AstRoot,\n code: string,\n opts: InputOptions | undefined | null,\n callback: FileResultCallback,\n ): void;\n (ast: AstRoot, code: string, opts?: InputOptions | null): FileResult | null;\n};\n\nconst transformFromAstRunner = gensync(function* (\n ast: AstRoot,\n code: string,\n opts: InputOptions | undefined | null,\n): Handler<FileResult | null> {\n const config: ResolvedConfig | null = yield* loadConfig(opts);\n if (config === null) return null;\n\n if (!ast) throw new Error(\"No AST given\");\n\n return yield* run(config, code, ast);\n});\n\nexport const transformFromAst: TransformFromAst = function transformFromAst(\n ast,\n code,\n optsOrCallback?: InputOptions | null | undefined | FileResultCallback,\n maybeCallback?: FileResultCallback,\n) {\n let opts: InputOptions | undefined | null;\n let callback: FileResultCallback | undefined;\n if (typeof optsOrCallback === \"function\") {\n callback = optsOrCallback;\n opts = undefined;\n } else {\n opts = optsOrCallback;\n callback = maybeCallback;\n }\n\n if (callback === undefined) {\n if (process.env.BABEL_8_BREAKING) {\n throw new Error(\n \"Starting from Babel 8.0.0, the 'transformFromAst' function expects a callback. If you need to call it synchronously, please use 'transformFromAstSync'.\",\n );\n } else {\n // console.warn(\n // \"Starting from Babel 8.0.0, the 'transformFromAst' function will expect a callback. If you need to call it synchronously, please use 'transformFromAstSync'.\",\n // );\n return beginHiddenCallStack(transformFromAstRunner.sync)(ast, code, opts);\n }\n }\n\n beginHiddenCallStack(transformFromAstRunner.errback)(\n ast,\n code,\n opts,\n callback,\n );\n};\n\nexport function transformFromAstSync(\n ...args: Parameters<typeof transformFromAstRunner.sync>\n) {\n return beginHiddenCallStack(transformFromAstRunner.sync)(...args);\n}\n\nexport function transformFromAstAsync(\n ...args: Parameters<typeof transformFromAstRunner.async>\n) {\n return beginHiddenCallStack(transformFromAstRunner.async)(...args);\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,IAAAE,MAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAGA,IAAAG,kBAAA,GAAAH,OAAA;AAgBA,MAAMI,sBAAsB,GAAGC,SAAMA,CAAC,CAAC,WACrCC,GAAY,EACZC,IAAY,EACZC,IAAqC,EACT;EAC5B,MAAMC,MAA6B,GAAG,OAAO,IAAAC,cAAU,EAACF,IAAI,CAAC;EAC7D,IAAIC,MAAM,KAAK,IAAI,EAAE,OAAO,IAAI;EAEhC,IAAI,CAACH,GAAG,EAAE,MAAM,IAAIK,KAAK,CAAC,cAAc,CAAC;EAEzC,OAAO,OAAO,IAAAC,WAAG,EAACH,MAAM,EAAEF,IAAI,EAAED,GAAG,CAAC;AACtC,CAAC,CAAC;AAEK,MAAMO,gBAAkC,GAAAC,OAAA,CAAAD,gBAAA,GAAG,SAASA,gBAAgBA,CACzEP,GAAG,EACHC,IAAI,EACJQ,cAAqE,EACrEC,aAAkC,EAClC;EACA,IAAIR,IAAqC;EACzC,IAAIS,QAAwC;EAC5C,IAAI,OAAOF,cAAc,KAAK,UAAU,EAAE;IACxCE,QAAQ,GAAGF,cAAc;IACzBP,IAAI,GAAGU,SAAS;EAClB,CAAC,MAAM;IACLV,IAAI,GAAGO,cAAc;IACrBE,QAAQ,GAAGD,aAAa;EAC1B;EAEA,IAAIC,QAAQ,KAAKC,SAAS,EAAE;IAKnB;MAIL,OAAO,IAAAC,uCAAoB,EAACf,sBAAsB,CAACgB,IAAI,CAAC,CAACd,GAAG,EAAEC,IAAI,EAAEC,IAAI,CAAC;IAC3E;EACF;EAEA,IAAAW,uCAAoB,EAACf,sBAAsB,CAACiB,OAAO,CAAC,CAClDf,GAAG,EACHC,IAAI,EACJC,IAAI,EACJS,QACF,CAAC;AACH,CAAC;AAEM,SAASK,oBAAoBA,CAClC,GAAGC,IAAoD,EACvD;EACA,OAAO,IAAAJ,uCAAoB,EAACf,sBAAsB,CAACgB,IAAI,CAAC,CAAC,GAAGG,IAAI,CAAC;AACnE;AAEO,SAASC,qBAAqBA,CACnC,GAAGD,IAAqD,EACxD;EACA,OAAO,IAAAJ,uCAAoB,EAACf,sBAAsB,CAACqB,KAAK,CAAC,CAAC,GAAGF,IAAI,CAAC;AACpE;AAAC","ignoreList":[]}
@@ -0,0 +1,51 @@
'use strict';
// Note: adler32 takes 12% for level 0 and 2% for level 6.
// It isn't worth it to make additional optimizations as in original.
// Small size is preferable.
// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
const adler32 = (adler, buf, len, pos) => {
let s1 = (adler & 0xffff) |0,
s2 = ((adler >>> 16) & 0xffff) |0,
n = 0;
while (len !== 0) {
// Set limit ~ twice less than 5552, to keep
// s2 in 31-bits, because we force signed ints.
// in other case %= will fail.
n = len > 2000 ? 2000 : len;
len -= n;
do {
s1 = (s1 + buf[pos++]) |0;
s2 = (s2 + s1) |0;
} while (--n);
s1 %= 65521;
s2 %= 65521;
}
return (s1 | (s2 << 16)) |0;
};
module.exports = adler32;
@@ -0,0 +1,150 @@
const { InvalidArgumentError } = require('./error.js');
class Argument {
/**
* Initialize a new command argument with the given name and description.
* The default is that the argument is required, and you can explicitly
* indicate this with <> around the name. Put [] around the name for an optional argument.
*
* @param {string} name
* @param {string} [description]
*/
constructor(name, description) {
this.description = description || '';
this.variadic = false;
this.parseArg = undefined;
this.defaultValue = undefined;
this.defaultValueDescription = undefined;
this.argChoices = undefined;
switch (name[0]) {
case '<': // e.g. <required>
this.required = true;
this._name = name.slice(1, -1);
break;
case '[': // e.g. [optional]
this.required = false;
this._name = name.slice(1, -1);
break;
default:
this.required = true;
this._name = name;
break;
}
if (this._name.endsWith('...')) {
this.variadic = true;
this._name = this._name.slice(0, -3);
}
}
/**
* Return argument name.
*
* @return {string}
*/
name() {
return this._name;
}
/**
* @package
*/
_collectValue(value, previous) {
if (previous === this.defaultValue || !Array.isArray(previous)) {
return [value];
}
previous.push(value);
return previous;
}
/**
* Set the default value, and optionally supply the description to be displayed in the help.
*
* @param {*} value
* @param {string} [description]
* @return {Argument}
*/
default(value, description) {
this.defaultValue = value;
this.defaultValueDescription = description;
return this;
}
/**
* Set the custom handler for processing CLI command arguments into argument values.
*
* @param {Function} [fn]
* @return {Argument}
*/
argParser(fn) {
this.parseArg = fn;
return this;
}
/**
* Only allow argument value to be one of choices.
*
* @param {string[]} values
* @return {Argument}
*/
choices(values) {
this.argChoices = values.slice();
this.parseArg = (arg, previous) => {
if (!this.argChoices.includes(arg)) {
throw new InvalidArgumentError(
`Allowed choices are ${this.argChoices.join(', ')}.`,
);
}
if (this.variadic) {
return this._collectValue(arg, previous);
}
return arg;
};
return this;
}
/**
* Make argument required.
*
* @returns {Argument}
*/
argRequired() {
this.required = true;
return this;
}
/**
* Make argument optional.
*
* @returns {Argument}
*/
argOptional() {
this.required = false;
return this;
}
}
/**
* Takes an argument and returns its human readable equivalent for help usage.
*
* @param {Argument} arg
* @return {string}
* @private
*/
function humanReadableArgName(arg) {
const nameOutput = arg.name() + (arg.variadic === true ? '...' : '');
return arg.required ? '<' + nameOutput + '>' : '[' + nameOutput + ']';
}
exports.Argument = Argument;
exports.humanReadableArgName = humanReadableArgName;
@@ -0,0 +1,19 @@
Copyright (C) 2016 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@@ -0,0 +1,58 @@
By providing `maxFiles` prop you can limit how many files the dropzone accepts.
**Note** that this prop is enabled when the `multiple` prop is enabled.
The default value for this prop is 0, which means there's no limitation to how many files are accepted.
```jsx harmony
import React from 'react';
import {useDropzone} from 'react-dropzone';
function AcceptMaxFiles(props) {
const {
acceptedFiles,
fileRejections,
getRootProps,
getInputProps
} = useDropzone({
maxFiles:2
});
const acceptedFileItems = acceptedFiles.map(file => (
<li key={file.path}>
{file.path} - {file.size} bytes
</li>
));
const fileRejectionItems = fileRejections.map(({ file, errors }) => {
return (
<li key={file.path}>
{file.path} - {file.size} bytes
<ul>
{errors.map(e => <li key={e.code}>{e.message}</li>)}
</ul>
</li>
)
});
return (
<section className="container">
<div {...getRootProps({ className: 'dropzone' })}>
<input {...getInputProps()} />
<p>Drag 'n' drop some files here, or click to select files</p>
<em>(2 files are the maximum number of files you can drop here)</em>
</div>
<aside>
<h4>Accepted files</h4>
<ul>{acceptedFileItems}</ul>
<h4>Rejected files</h4>
<ul>{fileRejectionItems}</ul>
</aside>
</section>
);
}
<AcceptMaxFiles />
```
@@ -0,0 +1 @@
{"name":"path-parse","version":"1.0.7","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532090221,"integrity":"sha512-cQVm2ZHJQn8+rLUVRjRM3+S6Wt1iEWz7c/pejRLMf9mwbU0m42mZAq4o0XsaJam7E6wgIbUsPVMTpzPHU2DB1A==","mode":420,"size":1080},"index.js":{"checkedAt":1794532090222,"integrity":"sha512-wEnmeNtipZ2ypV56FKN/fDxF13E21I9eud2ZgUYjq3xZwSSZ1mauxvxwZVyeA2skfMIIm1szKLLuoIlSTB+Fnw==","mode":420,"size":1893},"package.json":{"checkedAt":1794532090222,"integrity":"sha512-v92v0vBr7XdKB6SJnFbzkFLn21GbH5Zyig2+a/o7R3R+7AD5nl4j3Mp6zhEcmuu41zY9o4fJRael4iaNKSeWBQ==","mode":420,"size":667},"README.md":{"checkedAt":1794532090222,"integrity":"sha512-4OXc8gEOiFjsAl2l/2I1Atl5CpyL2NhsDla5up1n1UytHZyo+1Ulvs+joMo6cTAvhk+qkTMYdrHCMUDf1ktG+g==","mode":420,"size":871}}}
@@ -0,0 +1,394 @@
'use strict';
var utils = require('../utils.js');
require('eslint-visitor-keys');
require('espree');
require('estraverse');
function isCallbackPropName(name) {
return /^on[A-Z]/.test(name);
}
function isMultilineProp(node) {
return node.loc.start.line !== node.loc.end.line;
}
const messages = {
noUnreservedProps: "A customized reserved first list must only contain a subset of React reserved props. Remove: {{unreservedWords}}",
listIsEmpty: "A customized reserved first list must not be empty",
listReservedPropsFirst: "Reserved props must be listed before all other props",
listCallbacksLast: "Callbacks must be listed after all other props",
listShorthandFirst: "Shorthand props must be listed before all other props",
listShorthandLast: "Shorthand props must be listed after all other props",
listMultilineFirst: "Multiline props must be listed before all other props",
listMultilineLast: "Multiline props must be listed after all other props",
sortPropsByAlpha: "Props should be sorted alphabetically"
};
const RESERVED_PROPS_LIST = [
"children",
"dangerouslySetInnerHTML",
"key",
"ref"
];
function isReservedPropName(name, list) {
return list.includes(name);
}
let attributeMap;
function shouldSortToEnd(node) {
const attr = attributeMap.get(node);
return !!attr && !!attr.hasComment;
}
function contextCompare(a, b, options) {
let aProp = utils.getPropName(a);
let bProp = utils.getPropName(b);
const aSortToEnd = shouldSortToEnd(a);
const bSortToEnd = shouldSortToEnd(b);
if (aSortToEnd && !bSortToEnd)
return 1;
if (!aSortToEnd && bSortToEnd)
return -1;
if (options.reservedFirst) {
const aIsReserved = isReservedPropName(aProp, options.reservedList);
const bIsReserved = isReservedPropName(bProp, options.reservedList);
if (aIsReserved && !bIsReserved)
return -1;
if (!aIsReserved && bIsReserved)
return 1;
}
if (options.callbacksLast) {
const aIsCallback = isCallbackPropName(aProp);
const bIsCallback = isCallbackPropName(bProp);
if (aIsCallback && !bIsCallback)
return 1;
if (!aIsCallback && bIsCallback)
return -1;
}
if (options.shorthandFirst || options.shorthandLast) {
const shorthandSign = options.shorthandFirst ? -1 : 1;
if (!a.value && b.value)
return shorthandSign;
if (a.value && !b.value)
return -shorthandSign;
}
if (options.multiline !== "ignore") {
const multilineSign = options.multiline === "first" ? -1 : 1;
const aIsMultiline = isMultilineProp(a);
const bIsMultiline = isMultilineProp(b);
if (aIsMultiline && !bIsMultiline)
return multilineSign;
if (!aIsMultiline && bIsMultiline)
return -multilineSign;
}
if (options.noSortAlphabetically)
return 0;
const actualLocale = options.locale === "auto" ? void 0 : options.locale;
if (options.ignoreCase) {
aProp = aProp.toLowerCase();
bProp = bProp.toLowerCase();
return aProp.localeCompare(bProp, actualLocale);
}
if (aProp === bProp)
return 0;
if (options.locale === "auto")
return aProp < bProp ? -1 : 1;
return aProp.localeCompare(bProp, actualLocale);
}
function getGroupsOfSortableAttributes(attributes, context) {
const sourceCode = context.sourceCode;
const sortableAttributeGroups = [];
let groupCount = 0;
function addtoSortableAttributeGroups(attribute) {
sortableAttributeGroups[groupCount - 1].push(attribute);
}
for (let i = 0; i < attributes.length; i++) {
const attribute = attributes[i];
const nextAttribute = attributes[i + 1];
const attributeline = attribute.loc.start.line;
let comment = [];
try {
comment = sourceCode.getCommentsAfter(attribute);
} catch {
}
const lastAttr = attributes[i - 1];
const attrIsSpread = attribute.type === "JSXSpreadAttribute";
if (!lastAttr || lastAttr.type === "JSXSpreadAttribute" && !attrIsSpread) {
groupCount += 1;
sortableAttributeGroups[groupCount - 1] = [];
}
if (!attrIsSpread) {
if (comment.length === 0) {
attributeMap.set(attribute, { end: attribute.range[1], hasComment: false });
addtoSortableAttributeGroups(attribute);
} else {
const firstComment = comment[0];
const commentline = firstComment.loc.start.line;
if (comment.length === 1) {
if (attributeline + 1 === commentline && nextAttribute) {
attributeMap.set(attribute, { end: nextAttribute.range[1], hasComment: true });
addtoSortableAttributeGroups(attribute);
i += 1;
} else if (attributeline === commentline) {
if (firstComment.type === "Block" && nextAttribute) {
attributeMap.set(attribute, { end: nextAttribute.range[1], hasComment: true });
i += 1;
} else if (firstComment.type === "Block") {
attributeMap.set(attribute, { end: firstComment.range[1], hasComment: true });
} else {
attributeMap.set(attribute, { end: firstComment.range[1], hasComment: false });
}
addtoSortableAttributeGroups(attribute);
}
} else if (comment.length > 1 && attributeline + 1 === comment[1].loc.start.line && nextAttribute) {
const commentNextAttribute = sourceCode.getCommentsAfter(nextAttribute);
attributeMap.set(attribute, { end: nextAttribute.range[1], hasComment: true });
if (commentNextAttribute.length === 1 && nextAttribute.loc.start.line === commentNextAttribute[0].loc.start.line) {
attributeMap.set(attribute, { end: commentNextAttribute[0].range[1], hasComment: true });
}
addtoSortableAttributeGroups(attribute);
i += 1;
}
}
}
}
return sortableAttributeGroups;
}
function generateFixerFunction(node, context, reservedList) {
const sourceCode = context.sourceCode;
const attributes = node.attributes.slice(0);
const configuration = context.options[0] || {};
const ignoreCase = configuration.ignoreCase || false;
const callbacksLast = configuration.callbacksLast || false;
const shorthandFirst = configuration.shorthandFirst || false;
const shorthandLast = configuration.shorthandLast || false;
const multiline = configuration.multiline || "ignore";
const noSortAlphabetically = configuration.noSortAlphabetically || false;
const reservedFirst = configuration.reservedFirst || false;
const locale = configuration.locale || "auto";
const options = {
ignoreCase,
callbacksLast,
shorthandFirst,
shorthandLast,
multiline,
noSortAlphabetically,
reservedFirst,
reservedList,
locale
};
const sortableAttributeGroups = getGroupsOfSortableAttributes(attributes, context);
const sortedAttributeGroups = sortableAttributeGroups.slice(0).map((group) => [...group].sort((a, b) => contextCompare(a, b, options)));
return function fixFunction(fixer) {
const fixers = [];
let source = sourceCode.getText();
sortableAttributeGroups.forEach((sortableGroup, ii) => {
sortableGroup.forEach((attr, jj) => {
const sortedAttr = sortedAttributeGroups[ii][jj];
const sortedAttrText = source.slice(sortedAttr.range[0], attributeMap.get(sortedAttr).end);
fixers.push({
range: [attr.range[0], attributeMap.get(attr).end],
text: sortedAttrText
});
});
});
fixers.sort((a, b) => b.range[0] - a.range[0]);
const firstFixer = fixers[0];
const lastFixer = fixers[fixers.length - 1];
const rangeStart = lastFixer ? lastFixer.range[0] : 0;
const rangeEnd = firstFixer ? firstFixer.range[1] : -0;
fixers.forEach((fix) => {
source = `${source.slice(0, fix.range[0])}${fix.text}${source.slice(fix.range[1])}`;
});
return fixer.replaceTextRange([rangeStart, rangeEnd], source.slice(rangeStart, rangeEnd));
};
}
function validateReservedFirstConfig(context, reservedFirst) {
if (reservedFirst) {
if (Array.isArray(reservedFirst)) {
const nonReservedWords = reservedFirst.filter((word) => !isReservedPropName(
word,
RESERVED_PROPS_LIST
));
if (reservedFirst.length === 0) {
return function Report(decl) {
context.report({
node: decl,
messageId: "listIsEmpty"
});
};
}
if (nonReservedWords.length > 0) {
return function Report(decl) {
context.report({
node: decl,
messageId: "noUnreservedProps",
data: {
unreservedWords: nonReservedWords.toString()
}
});
};
}
}
}
}
const reportedNodeAttributes = /* @__PURE__ */ new WeakMap();
function reportNodeAttribute(nodeAttribute, errorType, node, context, reservedList) {
const errors = reportedNodeAttributes.get(nodeAttribute) || [];
if (errors.includes(errorType))
return;
errors.push(errorType);
reportedNodeAttributes.set(nodeAttribute, errors);
context.report({
node: nodeAttribute.name ?? "",
messageId: errorType,
fix: generateFixerFunction(node, context, reservedList)
});
}
var jsxSortProps = utils.createRule({
name: "jsx-sort-props",
package: "jsx",
meta: {
type: "layout",
docs: {
description: "Enforce props alphabetical sorting"
},
fixable: "code",
messages,
schema: [{
type: "object",
properties: {
// Whether callbacks (prefixed with "on") should be listed at the very end,
// after all other props. Supersedes shorthandLast.
callbacksLast: {
type: "boolean"
},
// Whether shorthand properties (without a value) should be listed first
shorthandFirst: {
type: "boolean"
},
// Whether shorthand properties (without a value) should be listed last
shorthandLast: {
type: "boolean"
},
// Whether multiline properties should be listed first or last
multiline: {
type: "string",
enum: ["ignore", "first", "last"],
default: "ignore"
},
ignoreCase: {
type: "boolean"
},
// Whether alphabetical sorting should be enforced
noSortAlphabetically: {
type: "boolean"
},
reservedFirst: {
type: ["array", "boolean"]
},
locale: {
type: "string",
default: "auto"
}
},
additionalProperties: false
}]
},
create(context) {
const configuration = context.options[0] || {};
const ignoreCase = configuration.ignoreCase || false;
const callbacksLast = configuration.callbacksLast || false;
const shorthandFirst = configuration.shorthandFirst || false;
const shorthandLast = configuration.shorthandLast || false;
const multiline = configuration.multiline || "ignore";
const noSortAlphabetically = configuration.noSortAlphabetically || false;
const reservedFirst = configuration.reservedFirst || false;
const reservedFirstError = validateReservedFirstConfig(context, reservedFirst);
const reservedList = Array.isArray(reservedFirst) ? reservedFirst : RESERVED_PROPS_LIST;
const locale = configuration.locale || "auto";
return {
Program() {
attributeMap = /* @__PURE__ */ new WeakMap();
},
JSXOpeningElement(node) {
const nodeReservedList = reservedFirst && !utils.isDOMComponent(node) ? reservedList.filter((prop) => prop !== "dangerouslySetInnerHTML") : reservedList;
node.attributes.reduce((memo, decl, idx, attrs) => {
if (decl.type === "JSXSpreadAttribute")
return attrs[idx + 1];
let previousPropName = utils.getPropName(memo);
let currentPropName = utils.getPropName(decl);
const previousValue = memo.value;
const currentValue = decl.value;
const previousIsCallback = isCallbackPropName(previousPropName);
const currentIsCallback = isCallbackPropName(currentPropName);
if (ignoreCase) {
previousPropName = previousPropName.toLowerCase();
currentPropName = currentPropName.toLowerCase();
}
if (reservedFirst) {
if (reservedFirstError) {
reservedFirstError(decl);
return memo;
}
const previousIsReserved = isReservedPropName(previousPropName, nodeReservedList);
const currentIsReserved = isReservedPropName(currentPropName, nodeReservedList);
if (previousIsReserved && !currentIsReserved)
return decl;
if (!previousIsReserved && currentIsReserved) {
reportNodeAttribute(decl, "listReservedPropsFirst", node, context, nodeReservedList);
return memo;
}
}
if (callbacksLast) {
if (!previousIsCallback && currentIsCallback) {
return decl;
}
if (previousIsCallback && !currentIsCallback) {
reportNodeAttribute(memo, "listCallbacksLast", node, context, nodeReservedList);
return memo;
}
}
if (shorthandFirst) {
if (currentValue && !previousValue)
return decl;
if (!currentValue && previousValue) {
reportNodeAttribute(decl, "listShorthandFirst", node, context, nodeReservedList);
return memo;
}
}
if (shorthandLast) {
if (!currentValue && previousValue)
return decl;
if (currentValue && !previousValue) {
reportNodeAttribute(memo, "listShorthandLast", node, context, nodeReservedList);
return memo;
}
}
const previousIsMultiline = isMultilineProp(memo);
const currentIsMultiline = isMultilineProp(decl);
if (multiline === "first") {
if (previousIsMultiline && !currentIsMultiline) {
return decl;
}
if (!previousIsMultiline && currentIsMultiline) {
reportNodeAttribute(decl, "listMultilineFirst", node, context, nodeReservedList);
return memo;
}
} else if (multiline === "last") {
if (!previousIsMultiline && currentIsMultiline) {
return decl;
}
if (previousIsMultiline && !currentIsMultiline) {
reportNodeAttribute(memo, "listMultilineLast", node, context, nodeReservedList);
return memo;
}
}
if (!noSortAlphabetically && (ignoreCase || locale !== "auto" ? previousPropName.localeCompare(currentPropName, locale === "auto" ? void 0 : locale) > 0 : previousPropName > currentPropName)) {
reportNodeAttribute(decl, "sortPropsByAlpha", node, context, nodeReservedList);
return memo;
}
return decl;
}, node.attributes[0]);
}
};
}
});
module.exports = jsxSortProps;
@@ -0,0 +1 @@
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC,GAMD,SAAS,2BAAK,KAAgB;IAC5B,OAAO;AACT;AAEA,2BAAK,iBAAiB,GAAG,UAAU,kBAAqB,KAAgB;IACtE,IAAI,YAAC,QAAQ,EAAC,GAAG;IAEjB,IAAI,YAAY,MAAM,SAAS,IAAK,CAAA,OAAO,aAAa,WAAW,WAAW,EAAC,KAAM,KAAK,CAAC,aAAa,IAAI;IAC5G,MAAM;QACJ,MAAM;QACN,OAAO;QACP,UAAU;mBACV;QACA,cAAc,KAAK,CAAC,aAAa;QACjC,eAAe;IACjB;AACF;AAEA;;CAEC,GACD,oEAAoE;AACpE,IAAI,4CAAQ","sources":["packages/@react-stately/table/src/Cell.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {CellProps} from '@react-types/table';\nimport {JSX, ReactElement} from 'react';\nimport {PartialNode} from '@react-stately/collections';\n\nfunction Cell(props: CellProps): ReactElement | null { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nCell.getCollectionNode = function* getCollectionNode<T>(props: CellProps): Generator<PartialNode<T>> {\n let {children} = props;\n\n let textValue = props.textValue || (typeof children === 'string' ? children : '') || props['aria-label'] || '';\n yield {\n type: 'cell',\n props: props,\n rendered: children,\n textValue,\n 'aria-label': props['aria-label'],\n hasChildNodes: false\n };\n};\n\n/**\n * A Cell represents the value of a single Column within a Table Row.\n */\n// We don't want getCollectionNode to show up in the type definition\nlet _Cell = Cell as (props: CellProps) => JSX.Element;\nexport {_Cell as Cell};\n"],"names":[],"version":3,"file":"Cell.main.js.map"}
@@ -0,0 +1,51 @@
{
"name": "@react-aria/grid",
"version": "3.14.5",
"description": "Spectrum UI components in React",
"license": "Apache-2.0",
"main": "dist/main.js",
"module": "dist/module.js",
"exports": {
"source": "./src/index.ts",
"types": [
"./dist/types.d.ts",
"./src/index.ts"
],
"import": "./dist/import.mjs",
"require": "./dist/main.js"
},
"types": "dist/types.d.ts",
"source": "src/index.ts",
"files": [
"dist",
"src"
],
"sideEffects": false,
"repository": {
"type": "git",
"url": "https://github.com/adobe/react-spectrum"
},
"dependencies": {
"@react-aria/focus": "^3.21.2",
"@react-aria/i18n": "^3.12.13",
"@react-aria/interactions": "^3.25.6",
"@react-aria/live-announcer": "^3.4.4",
"@react-aria/selection": "^3.26.0",
"@react-aria/utils": "^3.31.0",
"@react-stately/collections": "^3.12.8",
"@react-stately/grid": "^3.11.6",
"@react-stately/selection": "^3.20.6",
"@react-types/checkbox": "^3.10.2",
"@react-types/grid": "^3.3.6",
"@react-types/shared": "^3.32.1",
"@swc/helpers": "^0.5.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1",
"react-dom": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1"
},
"publishConfig": {
"access": "public"
},
"gitHead": "0bda51183baa23306342af32a82012ea0fe0f2dc"
}
@@ -0,0 +1 @@
{"mappings":"AAAA,iBAAiB;IAAG,kBAAkB,CAAC,OAAS,CAAC,cAAQ,EAAE,KAAK,IAAI,CAAC,oBAAc,CAAC;IAClF,qBAAqB,CAAC,wEAA6C,CAAC;IACpE,UAAU,CAAC,MAAM,CAAC;IAClB,eAAe,CAAC,uCAAwB,CAAC;IACzC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,4CAAuB,CAAC;YAAE,KAAK,IAAM,CAAC,WAAQ,EAAE,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,cAAQ,CAAC;YAAE,OAAO,IAAM,CAAC,WAAQ,EAAE,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,cAAQ,CAAC;QAAA,GAAG,CAAC,CAAC;IACzO,gBAAgB,CAAC,OAAS,CAAC,yBAAgB,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;AAC3D","sources":["packages/@react-aria/grid/intl/cs-CZ.json"],"sourcesContent":["{\n \"deselectedItem\": \"Položka {item} není vybrána.\",\n \"longPressToSelect\": \"Dlouhým stisknutím přejdete do režimu výběru.\",\n \"select\": \"Vybrat\",\n \"selectedAll\": \"Vybrány všechny položky.\",\n \"selectedCount\": \"{count, plural, =0 {Nevybrány žádné položky} one {Vybrána # položka} other {Vybráno # položek}}.\",\n \"selectedItem\": \"Vybrána položka {item}.\"\n}\n"],"names":[],"version":3,"file":"cs-CZ.main.js.map"}
@@ -0,0 +1,29 @@
var baseClone = require('./_baseClone');
/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1,
CLONE_SYMBOLS_FLAG = 4;
/**
* This method is like `_.clone` except that it recursively clones `value`.
*
* @static
* @memberOf _
* @since 1.0.0
* @category Lang
* @param {*} value The value to recursively clone.
* @returns {*} Returns the deep cloned value.
* @see _.clone
* @example
*
* var objects = [{ 'a': 1 }, { 'b': 2 }];
*
* var deep = _.cloneDeep(objects);
* console.log(deep[0] === objects[0]);
* // => false
*/
function cloneDeep(value) {
return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
}
module.exports = cloneDeep;
@@ -0,0 +1 @@
{"version":3,"file":"InjectFromOptions.js","sourceRoot":"","sources":["../../../../src/metadata/models/InjectFromOptions.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
import getNative from './_getNative.js';
import root from './_root.js';
/* Built-in method references that are verified to be native. */
var Set = getNative(root, 'Set');
export default Set;
@@ -0,0 +1,132 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _tslib = require("tslib");
var _react = require("react");
var _screenfull = _interopRequireDefault(require("screenfull"));
var _useLatest = _interopRequireDefault(require("../useLatest"));
var _useMemoizedFn = _interopRequireDefault(require("../useMemoizedFn"));
var _domTarget = require("../utils/domTarget");
var _utils = require("../utils");
var useFullscreen = function useFullscreen(target, options) {
var _a = options || {},
onExit = _a.onExit,
onEnter = _a.onEnter,
_b = _a.pageFullscreen,
pageFullscreen = _b === void 0 ? false : _b;
var _c = (0, _utils.isBoolean)(pageFullscreen) || !pageFullscreen ? {} : pageFullscreen,
_d = _c.className,
className = _d === void 0 ? 'ahooks-page-fullscreen' : _d,
_e = _c.zIndex,
zIndex = _e === void 0 ? 999999 : _e;
var onExitRef = (0, _useLatest["default"])(onExit);
var onEnterRef = (0, _useLatest["default"])(onEnter);
// The state of full screen may be changed by other scripts/components,
// so the initial value needs to be computed dynamically.
var _f = (0, _tslib.__read)((0, _react.useState)(getIsFullscreen), 2),
state = _f[0],
setState = _f[1];
var stateRef = (0, _react.useRef)(getIsFullscreen());
function getIsFullscreen() {
return _screenfull["default"].isEnabled && !!_screenfull["default"].element && _screenfull["default"].element === (0, _domTarget.getTargetElement)(target);
}
var invokeCallback = function invokeCallback(fullscreen) {
var _a, _b;
if (fullscreen) {
(_a = onEnterRef.current) === null || _a === void 0 ? void 0 : _a.call(onEnterRef);
} else {
(_b = onExitRef.current) === null || _b === void 0 ? void 0 : _b.call(onExitRef);
}
};
var updateFullscreenState = function updateFullscreenState(fullscreen) {
// Prevent repeated calls when the state is not changed.
if (stateRef.current !== fullscreen) {
invokeCallback(fullscreen);
setState(fullscreen);
stateRef.current = fullscreen;
}
};
var onScreenfullChange = function onScreenfullChange() {
var fullscreen = getIsFullscreen();
updateFullscreenState(fullscreen);
};
var togglePageFullscreen = function togglePageFullscreen(fullscreen) {
var el = (0, _domTarget.getTargetElement)(target);
if (!el) {
return;
}
var styleElem = document.getElementById(className);
if (fullscreen) {
el.classList.add(className);
if (!styleElem) {
styleElem = document.createElement('style');
styleElem.setAttribute('id', className);
styleElem.textContent = "\n .".concat(className, " {\n position: fixed; left: 0; top: 0; right: 0; bottom: 0;\n width: 100% !important; height: 100% !important;\n z-index: ").concat(zIndex, ";\n }");
el.appendChild(styleElem);
}
} else {
el.classList.remove(className);
if (styleElem) {
styleElem.remove();
}
}
updateFullscreenState(fullscreen);
};
var enterFullscreen = function enterFullscreen() {
var el = (0, _domTarget.getTargetElement)(target);
if (!el) {
return;
}
if (pageFullscreen) {
togglePageFullscreen(true);
return;
}
if (_screenfull["default"].isEnabled) {
try {
_screenfull["default"].request(el);
} catch (error) {
console.error(error);
}
}
};
var exitFullscreen = function exitFullscreen() {
var el = (0, _domTarget.getTargetElement)(target);
if (!el) {
return;
}
if (pageFullscreen) {
togglePageFullscreen(false);
return;
}
if (_screenfull["default"].isEnabled && _screenfull["default"].element === el) {
_screenfull["default"].exit();
}
};
var toggleFullscreen = function toggleFullscreen() {
if (state) {
exitFullscreen();
} else {
enterFullscreen();
}
};
(0, _react.useEffect)(function () {
if (!_screenfull["default"].isEnabled || pageFullscreen) {
return;
}
_screenfull["default"].on('change', onScreenfullChange);
return function () {
_screenfull["default"].off('change', onScreenfullChange);
};
}, []);
return [state, {
enterFullscreen: (0, _useMemoizedFn["default"])(enterFullscreen),
exitFullscreen: (0, _useMemoizedFn["default"])(exitFullscreen),
toggleFullscreen: (0, _useMemoizedFn["default"])(toggleFullscreen),
isEnabled: _screenfull["default"].isEnabled
}];
};
var _default = exports["default"] = useFullscreen;
@@ -0,0 +1,44 @@
# globals
> Global identifiers from different JavaScript environments
It's just a [JSON file](globals.json), so use it in any environment.
This package is used by ESLint.
**This package [no longer accepts](https://github.com/sindresorhus/globals/issues/82) new environments. If you need it for ESLint, just [create a plugin](http://eslint.org/docs/developer-guide/working-with-plugins#environments-in-plugins).**
## Install
```sh
npm install globals
```
## Usage
```js
const globals = require('globals');
console.log(globals.browser);
/*
{
addEventListener: false,
applicationCache: false,
ArrayBuffer: false,
atob: false,
…
}
*/
```
Each global is given a value of `true` or `false`. A value of `true` indicates that the variable may be overwritten. A value of `false` indicates that the variable should be considered read-only. This information is used by static analysis tools to flag incorrect behavior. We assume all variables should be `false` unless we hear otherwise.
For Node.js this package provides two sets of globals:
- `globals.nodeBuiltin`: Globals available to all code running in Node.js.
These will usually be available as properties on the `global` object and include `process`, `Buffer`, but not CommonJS arguments like `require`.
See: https://nodejs.org/api/globals.html
- `globals.node`: A combination of the globals from `nodeBuiltin` plus all CommonJS arguments ("CommonJS module scope").
See: https://nodejs.org/api/modules.html#modules_the_module_scope
When analyzing code that is known to run outside of a CommonJS wrapper, for example, JavaScript modules, `nodeBuiltin` can find accidental CommonJS references.
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAwBM,SAAS,0CACd,KAAmB,EACnB,KAAsB,EACtB,GAAuC;IAEvC,IAAI,OAAC,GAAG,EAAE,YAAY,aAAa,yBAAE,qBAAqB,EAAC,GAAG;IAC9D,IAAI,EAAC,kBAAkB,OAAO,eAAE,WAAW,EAAC,GAAG;IAE/C,IAAI,aAAa,QAAQ;IAEzB,IAAI,aAAa,iBAAiB,MAAM,UAAU,IAAI,MAAM,gBAAgB,CAAC,UAAU,CAAC;IACxF,IAAI,aAAC,SAAS,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,2CAAgB,EAAE;QAC7C,kBAAkB;aAClB;aACA;oBACA;+BACA;QACA,cAAc;IAChB;IAEA,IAAI,QAAQ,CAAA,GAAA,oCAAS,EAAE,OAAO,KAAK;IACnC,IAAI,aAAa,CAAA,GAAA,oCAAS,EAAE,OAAO,KAAK;IACxC,IAAI,YAAC,QAAQ,EAAC,GAAG;IAEjB,IAAI,OAAO,MAAM,UAAU,CAAC,OAAO,CAAC;IACpC,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,iBAAA,2BAAA,KAAM,KAAK,EAAE;QAAC,WAAW;IAAI;IAC3D,OAAO,SAAS,EAAE;IAClB,IAAI,YAAY,CAAA,GAAA,kCAAW,EAAE,iBAAA,2BAAA,KAAM,KAAK;IAExC,OAAO;QACL,UAAU,CAAA,GAAA,gCAAS,EAAE,UAAU,WAAW,WAAW;YACnD,IAAI;YACJ,iBAAiB;YACjB,iBAAiB,cAAc;YAC/B,iBAAiB,aAAa,aAAa;YAC3C,UAAU,aAAa,YAAY;YACnC,MAAM;QACR;oBACA;oBACA;mBACA;IACF;AACF","sources":["packages/@react-aria/tabs/src/useTab.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaTabProps} from '@react-types/tabs';\nimport {DOMAttributes, FocusableElement, RefObject} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, useLinkProps} from '@react-aria/utils';\nimport {generateId} from './utils';\nimport {TabListState} from '@react-stately/tabs';\nimport {useSelectableItem} from '@react-aria/selection';\n\nexport interface TabAria {\n /** Props for the tab element. */\n tabProps: DOMAttributes,\n /** Whether the tab is currently selected. */\n isSelected: boolean,\n /** Whether the tab is disabled. */\n isDisabled: boolean,\n /** Whether the tab is currently in a pressed state. */\n isPressed: boolean\n}\n\n/**\n * Provides the behavior and accessibility implementation for a tab.\n * When selected, the associated tab panel is shown.\n */\nexport function useTab<T>(\n props: AriaTabProps,\n state: TabListState<T>,\n ref: RefObject<FocusableElement | null>\n): TabAria {\n let {key, isDisabled: propsDisabled, shouldSelectOnPressUp} = props;\n let {selectionManager: manager, selectedKey} = state;\n\n let isSelected = key === selectedKey;\n\n let isDisabled = propsDisabled || state.isDisabled || state.selectionManager.isDisabled(key);\n let {itemProps, isPressed} = useSelectableItem({\n selectionManager: manager,\n key,\n ref,\n isDisabled,\n shouldSelectOnPressUp,\n linkBehavior: 'selection'\n });\n\n let tabId = generateId(state, key, 'tab');\n let tabPanelId = generateId(state, key, 'tabpanel');\n let {tabIndex} = itemProps;\n\n let item = state.collection.getItem(key);\n let domProps = filterDOMProps(item?.props, {labelable: true});\n delete domProps.id;\n let linkProps = useLinkProps(item?.props);\n\n return {\n tabProps: mergeProps(domProps, linkProps, itemProps, {\n id: tabId,\n 'aria-selected': isSelected,\n 'aria-disabled': isDisabled || undefined,\n 'aria-controls': isSelected ? tabPanelId : undefined,\n tabIndex: isDisabled ? undefined : tabIndex,\n role: 'tab'\n }),\n isSelected,\n isDisabled,\n isPressed\n };\n}\n"],"names":[],"version":3,"file":"useTab.main.js.map"}
@@ -0,0 +1,82 @@
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
import {Collection, CollectionStateBase, Key, Node} from '@react-types/shared';
import {SingleSelectListState, useSingleSelectListState} from '@react-stately/list';
import {TabListProps} from '@react-types/tabs';
import {useEffect, useRef} from 'react';
export interface TabListStateOptions<T> extends Omit<TabListProps<T>, 'children'>, CollectionStateBase<T> {}
export interface TabListState<T> extends SingleSelectListState<T> {
/** Whether the tab list is disabled. */
isDisabled: boolean
}
/**
* Provides state management for a Tabs component. Tabs include a TabList which tracks
* which tab is currently selected and displays the content associated with that Tab in a TabPanel.
*/
export function useTabListState<T extends object>(props: TabListStateOptions<T>): TabListState<T> {
let state = useSingleSelectListState<T>({
...props,
suppressTextValueWarning: true,
defaultSelectedKey: props.defaultSelectedKey ?? findDefaultSelectedKey(props.collection, props.disabledKeys ? new Set(props.disabledKeys) : new Set()) ?? undefined
});
let {
selectionManager,
collection,
selectedKey: currentSelectedKey
} = state;
let lastSelectedKey = useRef(currentSelectedKey);
useEffect(() => {
// Ensure a tab is always selected (in case no selected key was specified or if selected item was deleted from collection)
let selectedKey = currentSelectedKey;
if (selectionManager.isEmpty || selectedKey == null || !collection.getItem(selectedKey)) {
selectedKey = findDefaultSelectedKey(collection, state.disabledKeys);
if (selectedKey != null) {
// directly set selection because replace/toggle selection won't consider disabled keys
selectionManager.setSelectedKeys([selectedKey]);
}
}
// If the tablist doesn't have focus and the selected key changes or if there isn't a focused key yet, change focused key to the selected key if it exists.
if (selectedKey != null && selectionManager.focusedKey == null || (!selectionManager.isFocused && selectedKey !== lastSelectedKey.current)) {
selectionManager.setFocusedKey(selectedKey);
}
lastSelectedKey.current = selectedKey;
});
return {
...state,
isDisabled: props.isDisabled || false
};
}
function findDefaultSelectedKey<T>(collection: Collection<Node<T>> | undefined, disabledKeys: Set<Key>) {
let selectedKey: Key | null = null;
if (collection) {
selectedKey = collection.getFirstKey();
// loop over tabs until we find one that isn't disabled and select that
while (selectedKey != null && (disabledKeys.has(selectedKey) || collection.getItem(selectedKey)?.props?.isDisabled) && selectedKey !== collection.getLastKey()) {
selectedKey = collection.getKeyAfter(selectedKey);
}
// if this check is true, then every item is disabled, it makes more sense to default to the first key than the last
if (selectedKey != null && (disabledKeys.has(selectedKey) || collection.getItem(selectedKey)?.props?.isDisabled) && selectedKey === collection.getLastKey()) {
selectedKey = collection.getFirstKey();
}
}
return selectedKey;
}
@@ -0,0 +1 @@
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAMD,SAAS,8BAAW,KAAsB;IACxC,OAAO;AACT;AAEA,8BAAQ,iBAAiB,GAAG,UAAU,kBAAqB,KAAsB;IAC/E,IAAI,YAAC,QAAQ,SAAE,KAAK,SAAE,KAAK,EAAC,GAAG;IAC/B,MAAM;QACJ,MAAM;QACN,OAAO;QACP,eAAe;QACf,UAAU;QACV,cAAc,KAAK,CAAC,aAAa;QACjC,CAAC;YACC,IAAI,OAAO,aAAa,YAAY;gBAClC,IAAI,CAAC,OACH,MAAM,IAAI,MAAM;gBAGlB,KAAK,IAAI,QAAQ,MACf,MAAM;oBACJ,MAAM;oBACN,OAAO;oBACP,UAAU;gBACZ;YAEJ,OAAO;gBACL,IAAI,QAA0B,EAAE;gBAChC,CAAA,GAAA,YAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAA;oBAC/B,MAAM,IAAI,CAAC;wBACT,MAAM;wBACN,SAAS;oBACX;gBACF;gBAEA,OAAO;YACT;QACF;IACF;AACF;AAEA,oEAAoE;AACpE,IAAI,4CAAW","sources":["packages/@react-stately/collections/src/Section.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {PartialNode} from './types';\nimport React, {JSX, ReactElement} from 'react';\nimport {SectionProps} from '@react-types/shared';\n\nfunction Section<T>(props: SectionProps<T>): ReactElement | null { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nSection.getCollectionNode = function* getCollectionNode<T>(props: SectionProps<T>): Generator<PartialNode<T>> {\n let {children, title, items} = props;\n yield {\n type: 'section',\n props: props,\n hasChildNodes: true,\n rendered: title,\n 'aria-label': props['aria-label'],\n *childNodes() {\n if (typeof children === 'function') {\n if (!items) {\n throw new Error('props.children was a function but props.items is missing');\n }\n\n for (let item of items) {\n yield {\n type: 'item',\n value: item,\n renderer: children\n };\n }\n } else {\n let items: PartialNode<T>[] = [];\n React.Children.forEach(children, child => {\n items.push({\n type: 'item',\n element: child\n });\n });\n\n yield* items;\n }\n }\n };\n};\n\n// We don't want getCollectionNode to show up in the type definition\nlet _Section = Section as <T>(props: SectionProps<T>) => JSX.Element;\nexport {_Section as Section};\n"],"names":[],"version":3,"file":"Section.module.js.map"}
@@ -0,0 +1,55 @@
/**
* @import {
* Construct,
* State,
* TokenizeContext,
* Tokenizer
* } from 'micromark-util-types'
*/
import { labelEnd } from './label-end.js';
/** @type {Construct} */
export const labelStartLink = {
name: 'labelStartLink',
resolveAll: labelEnd.resolveAll,
tokenize: tokenizeLabelStartLink
};
/**
* @this {TokenizeContext}
* Context.
* @type {Tokenizer}
*/
function tokenizeLabelStartLink(effects, ok, nok) {
const self = this;
return start;
/**
* Start of label (link) start.
*
* ```markdown
* > | a [b] c
* ^
* ```
*
* @type {State}
*/
function start(code) {
effects.enter("labelLink");
effects.enter("labelMarker");
effects.consume(code);
effects.exit("labelMarker");
effects.exit("labelLink");
return after;
}
/** @type {State} */
function after(code) {
// To do: this isn’t needed in `micromark-extension-gfm-footnote`,
// remove.
// Hidden footnotes hook.
/* c8 ignore next 3 */
return code === 94 && '_hiddenFootnoteSupport' in self.parser.constructs ? nok(code) : ok(code);
}
}
@@ -0,0 +1,93 @@
// Breton [br]
import dayjs from '../index';
function lastNumber(number) {
if (number > 9) {
return lastNumber(number % 10);
}
return number;
}
function softMutation(text) {
var mutationTable = {
m: 'v',
b: 'v',
d: 'z'
};
return mutationTable[text.charAt(0)] + text.substring(1);
}
function mutation(text, number) {
if (number === 2) {
return softMutation(text);
}
return text;
}
function relativeTimeWithMutation(number, withoutSuffix, key) {
var format = {
mm: 'munutenn',
MM: 'miz',
dd: 'devezh'
};
return number + " " + mutation(format[key], number);
}
function specialMutationForYears(number) {
/* istanbul ignore next line */
switch (lastNumber(number)) {
case 1:
case 3:
case 4:
case 5:
case 9:
return number + " bloaz";
default:
return number + " vloaz";
}
}
var locale = {
name: 'br',
weekdays: 'Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn'.split('_'),
months: 'Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split('_'),
weekStart: 1,
weekdaysShort: 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'),
monthsShort: 'Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'),
weekdaysMin: 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'),
ordinal: function ordinal(n) {
return n;
},
formats: {
LT: 'h[e]mm A',
LTS: 'h[e]mm:ss A',
L: 'DD/MM/YYYY',
LL: 'D [a viz] MMMM YYYY',
LLL: 'D [a viz] MMMM YYYY h[e]mm A',
LLLL: 'dddd, D [a viz] MMMM YYYY h[e]mm A'
},
relativeTime: {
future: 'a-benn %s',
past: '%s ʼzo',
s: 'un nebeud segondennoù',
m: 'ur vunutenn',
mm: relativeTimeWithMutation,
h: 'un eur',
hh: '%d eur',
d: 'un devezh',
dd: relativeTimeWithMutation,
M: 'ur miz',
MM: relativeTimeWithMutation,
y: 'ur bloaz',
yy: specialMutationForYears
},
meridiem: function meridiem(hour) {
return hour < 12 ? 'a.m.' : 'g.m.';
} // a-raok merenn | goude merenn
};
dayjs.locale(locale, null, true);
export default locale;
@@ -0,0 +1,91 @@
var queueLit = require('queue-lit');
/**
* pLimit creates a "limiter" function that can be used to enqueue
* promise returning functions with limited concurrency.
* @param {number} concurrency
*/
function pLimit(concurrency) {
if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
throw new TypeError('Expected `concurrency` to be a number greater than 1');
}
const queue = new queueLit.Queue();
let activeCount = 0;
/**
* next updates the activeCount and executes the next queued item.
*/
const next = () => {
activeCount--;
if (queue.size > 0) {
queue.pop()();
}
};
/**
* run executes a given `fn` passing `args`. Inside the `run` closure any
* thrown errors/rejections are swallowed, but by resolving the `fn` result
* immediatly we surface any rejections/errors to a parent function.
* @param {Function} fn
* @param {Promise.resolve} resolve
* @param {*} args
*/
const run = async (fn, resolve, args) => {
activeCount++;
const result = (async () => fn(...args))();
resolve(result);
try {
await result;
} catch {}
next();
};
/**
* enqueue enqueues a given `fn` to be executed while limiting concurrency.
* @param {Function} fn
* @param {Promise.resolve} resolve
* @param {*} args
*/
const enqueue = (fn, resolve, args) => {
queue.push(run.bind(null, fn, resolve, args));
(async () => {
// NOTE(joel): This function needs to wait until the next microtask
// before comparing `activeCount` to `concurrency` because `activeCount`
// is updated asynchronously when the run function is popped and
// called.
await Promise.resolve();
if (activeCount < concurrency && queue.size > 0) {
queue.pop()();
}
})();
};
/**
* generator defines the public api of `pLimit` and allows enqueueing promise
* returning functions while limiting their concurrency.
* @param {(...args: Arguments) => PromiseLike<RType> | RType} fn
* @param {Arguments} args
* @returns {Promise<RType>}
* @template {unknown[]} Arguments
* @template RType
*/
const generator = (fn, ...args) => new Promise(resolve => {
enqueue(fn, resolve, args);
});
Object.defineProperties(generator, {
activeCount: {
get: () => activeCount
},
pendingCount: {
get: () => queue.size
},
clearQueue: {
value: () => {
queue.clear();
}
}
});
return generator;
}
exports.pLimit = pLimit;
@@ -0,0 +1,3 @@
const isCSSVar = (name) => name.startsWith("--");
export { isCSSVar };
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('isWeakMap', require('../isWeakMap'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,37 @@
{
"name": "estree-walker",
"description": "Traverse an ESTree-compliant AST",
"version": "2.0.2",
"private": false,
"author": "Rich Harris",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/Rich-Harris/estree-walker"
},
"type": "commonjs",
"main": "./dist/umd/estree-walker.js",
"module": "./dist/esm/estree-walker.js",
"exports": {
"require": "./dist/umd/estree-walker.js",
"import": "./dist/esm/estree-walker.js"
},
"types": "types/index.d.ts",
"scripts": {
"prepublishOnly": "npm run build && npm test",
"build": "tsc && rollup -c",
"test": "uvu test"
},
"devDependencies": {
"@types/estree": "0.0.42",
"rollup": "^2.10.9",
"typescript": "^3.7.5",
"uvu": "^0.5.1"
},
"files": [
"src",
"dist",
"types",
"README.md"
]
}
@@ -0,0 +1,15 @@
export declare const falsyToString: <T>(value: T) => T | string;
export declare const isEmptyObject: (obj: unknown) => boolean;
export declare const flatArray: <T extends unknown[]>(array: T) => T;
export declare const flatMergeArrays: <T extends unknown[]>(...arrays: T[]) => T;
export declare const mergeObjects: (obj1: unknown, obj2: unknown) => unknown;
export declare const removeExtraSpaces: (str: string) => string;
export declare const isEqual: (obj1: object, obj2: object) => boolean;
export declare const isBoolean: (value: unknown) => boolean;
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;AAMD,SAAS,2BAAQ,KAAmB;IAClC,OAAO;AACT;AAEA,2BAAK,iBAAiB,GAAG,UAAU,kBAAqB,KAAmB,EAAE,OAAY;IACvF,IAAI,cAAC,UAAU,SAAE,KAAK,YAAE,QAAQ,EAAC,GAAG;IAEpC,IAAI,WAAW,MAAM,KAAK,IAAI,MAAM,QAAQ;IAC5C,IAAI,YAAY,MAAM,SAAS,IAAK,CAAA,OAAO,aAAa,WAAW,WAAW,EAAC,KAAM,KAAK,CAAC,aAAa,IAAI;IAE5G,qGAAqG;IACrG,IAAI,CAAC,aAAa,EAAC,oBAAA,8BAAA,QAAS,wBAAwB,KAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,cAC/E,QAAQ,IAAI,CAAC;IAGf,MAAM;QACJ,MAAM;QACN,OAAO;kBACP;mBACA;QACA,cAAc,KAAK,CAAC,aAAa;QACjC,eAAe,oCAAc;QAC7B,CAAC;YACC,IAAI,YACF,KAAK,IAAI,SAAS,WAChB,MAAM;gBACJ,MAAM;gBACN,OAAO;YACT;iBAEG,IAAI,OAAO;gBAChB,IAAI,QAA0B,EAAE;gBAChC,CAAA,GAAA,sCAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAA;oBAC/B,MAAM,IAAI,CAAC;wBACT,MAAM;wBACN,SAAS;oBACX;gBACF;gBAEA,OAAO;YACT;QACF;IACF;AACF;AAEA,SAAS,oCAAiB,KAAmB;IAC3C,IAAI,MAAM,aAAa,IAAI,MACzB,OAAO,MAAM,aAAa;IAG5B,IAAI,MAAM,UAAU,EAClB,OAAO;IAGT,IAAI,MAAM,KAAK,IAAI,CAAA,GAAA,sCAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,QAAQ,IAAI,GACxD,OAAO;IAGT,OAAO;AACT;AAEA,oEAAoE;AACpE,IAAI,4CAAQ","sources":["packages/@react-stately/collections/src/Item.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ItemElement, ItemProps} from '@react-types/shared';\nimport {PartialNode} from './types';\nimport React, {JSX, ReactElement} from 'react';\n\nfunction Item<T>(props: ItemProps<T>): ReactElement | null { // eslint-disable-line @typescript-eslint/no-unused-vars\n return null;\n}\n\nItem.getCollectionNode = function* getCollectionNode<T>(props: ItemProps<T>, context: any): Generator<PartialNode<T>> {\n let {childItems, title, children} = props;\n\n let rendered = props.title || props.children;\n let textValue = props.textValue || (typeof rendered === 'string' ? rendered : '') || props['aria-label'] || '';\n\n // suppressTextValueWarning is used in components like Tabs, which don't have type to select support.\n if (!textValue && !context?.suppressTextValueWarning && process.env.NODE_ENV !== 'production') {\n console.warn('<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop.');\n }\n\n yield {\n type: 'item',\n props: props,\n rendered,\n textValue,\n 'aria-label': props['aria-label'],\n hasChildNodes: hasChildItems(props),\n *childNodes() {\n if (childItems) {\n for (let child of childItems) {\n yield {\n type: 'item',\n value: child\n };\n }\n } else if (title) {\n let items: PartialNode<T>[] = [];\n React.Children.forEach(children, child => {\n items.push({\n type: 'item',\n element: child as ItemElement<T>\n });\n });\n\n yield* items;\n }\n }\n };\n};\n\nfunction hasChildItems<T>(props: ItemProps<T>) {\n if (props.hasChildItems != null) {\n return props.hasChildItems;\n }\n\n if (props.childItems) {\n return true;\n }\n\n if (props.title && React.Children.count(props.children) > 0) {\n return true;\n }\n\n return false;\n}\n\n// We don't want getCollectionNode to show up in the type definition\nlet _Item = Item as <T>(props: ItemProps<T>) => JSX.Element;\nexport {_Item as Item};\n"],"names":[],"version":3,"file":"Item.main.js.map"}
@@ -0,0 +1,16 @@
import type { TSchema, SchemaOptions } from '../schema/index.mjs';
import type { Static } from '../static/index.mjs';
import { type TUnion } from '../union/index.mjs';
import { TMappedKey, TMappedResult } from '../mapped/index.mjs';
import { UnionToTuple } from '../helpers/index.mjs';
import { type TExtendsFromMappedKey } from './extends-from-mapped-key.mjs';
import { type TExtendsFromMappedResult } from './extends-from-mapped-result.mjs';
type TExtendsResolve<L extends TSchema, R extends TSchema, T extends TSchema, U extends TSchema> = ((Static<L> extends Static<R> ? T : U) extends infer O extends TSchema ? UnionToTuple<O> extends [infer X extends TSchema, infer Y extends TSchema] ? TUnion<[X, Y]> : O : never);
export type TExtends<L extends TSchema, R extends TSchema, T extends TSchema, F extends TSchema> = TExtendsResolve<L, R, T, F>;
/** `[Json]` Creates a Conditional type */
export declare function Extends<L extends TMappedResult, R extends TSchema, T extends TSchema, F extends TSchema>(L: L, R: R, T: T, F: F, options?: SchemaOptions): TExtendsFromMappedResult<L, R, T, F>;
/** `[Json]` Creates a Conditional type */
export declare function Extends<L extends TMappedKey, R extends TSchema, T extends TSchema, F extends TSchema>(L: L, R: R, T: T, F: F, options?: SchemaOptions): TExtendsFromMappedKey<L, R, T, F>;
/** `[Json]` Creates a Conditional type */
export declare function Extends<L extends TSchema, R extends TSchema, T extends TSchema, F extends TSchema>(L: L, R: R, T: T, F: F, options?: SchemaOptions): TExtends<L, R, T, F>;
export {};
@@ -0,0 +1,16 @@
var baseGet = require('./_baseGet');
/**
* A specialized version of `baseProperty` which supports deep paths.
*
* @private
* @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new accessor function.
*/
function basePropertyDeep(path) {
return function(object) {
return baseGet(object, path);
};
}
module.exports = basePropertyDeep;
@@ -0,0 +1,263 @@
import type { Middleware } from 'redux'
import type { IgnorePaths } from './serializableStateInvariantMiddleware'
import { getTimeMeasureUtils } from './utils'
type EntryProcessor = (key: string, value: any) => any
/**
* The default `isImmutable` function.
*
* @public
*/
export function isImmutableDefault(value: unknown): boolean {
return typeof value !== 'object' || value == null || Object.isFrozen(value)
}
export function trackForMutations(
isImmutable: IsImmutableFunc,
ignorePaths: IgnorePaths | undefined,
obj: any,
) {
const trackedProperties = trackProperties(isImmutable, ignorePaths, obj)
return {
detectMutations() {
return detectMutations(isImmutable, ignorePaths, trackedProperties, obj)
},
}
}
interface TrackedProperty {
value: any
children: Record<string, any>
}
function trackProperties(
isImmutable: IsImmutableFunc,
ignorePaths: IgnorePaths = [],
obj: Record<string, any>,
path: string = '',
checkedObjects: Set<Record<string, any>> = new Set(),
) {
const tracked: Partial<TrackedProperty> = { value: obj }
if (!isImmutable(obj) && !checkedObjects.has(obj)) {
checkedObjects.add(obj)
tracked.children = {}
for (const key in obj) {
const childPath = path ? path + '.' + key : key
if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) {
continue
}
tracked.children[key] = trackProperties(
isImmutable,
ignorePaths,
obj[key],
childPath,
)
}
}
return tracked as TrackedProperty
}
function detectMutations(
isImmutable: IsImmutableFunc,
ignoredPaths: IgnorePaths = [],
trackedProperty: TrackedProperty,
obj: any,
sameParentRef: boolean = false,
path: string = '',
): { wasMutated: boolean; path?: string } {
const prevObj = trackedProperty ? trackedProperty.value : undefined
const sameRef = prevObj === obj
if (sameParentRef && !sameRef && !Number.isNaN(obj)) {
return { wasMutated: true, path }
}
if (isImmutable(prevObj) || isImmutable(obj)) {
return { wasMutated: false }
}
// Gather all keys from prev (tracked) and after objs
const keysToDetect: Record<string, boolean> = {}
for (let key in trackedProperty.children) {
keysToDetect[key] = true
}
for (let key in obj) {
keysToDetect[key] = true
}
const hasIgnoredPaths = ignoredPaths.length > 0
for (let key in keysToDetect) {
const nestedPath = path ? path + '.' + key : key
if (hasIgnoredPaths) {
const hasMatches = ignoredPaths.some((ignored) => {
if (ignored instanceof RegExp) {
return ignored.test(nestedPath)
}
return nestedPath === ignored
})
if (hasMatches) {
continue
}
}
const result = detectMutations(
isImmutable,
ignoredPaths,
trackedProperty.children[key],
obj[key],
sameRef,
nestedPath,
)
if (result.wasMutated) {
return result
}
}
return { wasMutated: false }
}
type IsImmutableFunc = (value: any) => boolean
/**
* Options for `createImmutableStateInvariantMiddleware()`.
*
* @public
*/
export interface ImmutableStateInvariantMiddlewareOptions {
/**
Callback function to check if a value is considered to be immutable.
This function is applied recursively to every value contained in the state.
The default implementation will return true for primitive types
(like numbers, strings, booleans, null and undefined).
*/
isImmutable?: IsImmutableFunc
/**
An array of dot-separated path strings that match named nodes from
the root state to ignore when checking for immutability.
Defaults to undefined
*/
ignoredPaths?: IgnorePaths
/** Print a warning if checks take longer than N ms. Default: 32ms */
warnAfter?: number
}
/**
* Creates a middleware that checks whether any state was mutated in between
* dispatches or during a dispatch. If any mutations are detected, an error is
* thrown.
*
* @param options Middleware options.
*
* @public
*/
export function createImmutableStateInvariantMiddleware(
options: ImmutableStateInvariantMiddlewareOptions = {},
): Middleware {
if (process.env.NODE_ENV === 'production') {
return () => (next) => (action) => next(action)
} else {
function stringify(
obj: any,
serializer?: EntryProcessor,
indent?: string | number,
decycler?: EntryProcessor,
): string {
return JSON.stringify(obj, getSerialize(serializer, decycler), indent)
}
function getSerialize(
serializer?: EntryProcessor,
decycler?: EntryProcessor,
): EntryProcessor {
let stack: any[] = [],
keys: any[] = []
if (!decycler)
decycler = function (_: string, value: any) {
if (stack[0] === value) return '[Circular ~]'
return (
'[Circular ~.' + keys.slice(0, stack.indexOf(value)).join('.') + ']'
)
}
return function (this: any, key: string, value: any) {
if (stack.length > 0) {
var thisPos = stack.indexOf(this)
~thisPos ? stack.splice(thisPos + 1) : stack.push(this)
~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key)
if (~stack.indexOf(value)) value = decycler!.call(this, key, value)
} else stack.push(value)
return serializer == null ? value : serializer.call(this, key, value)
}
}
let {
isImmutable = isImmutableDefault,
ignoredPaths,
warnAfter = 32,
} = options
const track = trackForMutations.bind(null, isImmutable, ignoredPaths)
return ({ getState }) => {
let state = getState()
let tracker = track(state)
let result
return (next) => (action) => {
const measureUtils = getTimeMeasureUtils(
warnAfter,
'ImmutableStateInvariantMiddleware',
)
measureUtils.measureTime(() => {
state = getState()
result = tracker.detectMutations()
// Track before potentially not meeting the invariant
tracker = track(state)
if (result.wasMutated) {
throw new Error(
`A state mutation was detected between dispatches, in the path '${
result.path || ''
}'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`,
)
}
})
const dispatchedAction = next(action)
measureUtils.measureTime(() => {
state = getState()
result = tracker.detectMutations()
// Track before potentially not meeting the invariant
tracker = track(state)
if (result.wasMutated) {
throw new Error(
`A state mutation was detected inside a dispatch, in the path: ${
result.path || ''
}. Take a look at the reducer(s) handling the action ${stringify(
action,
)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`,
)
}
})
measureUtils.warnIfExceeded()
return dispatchedAction
}
}
}
}
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2015-2017, Jon Schlinkert
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@@ -0,0 +1,35 @@
'use strict';
require('../auto');
var test = require('tape');
var defineProperties = require('define-properties');
var isEnumerable = Object.prototype.propertyIsEnumerable;
var functionsHaveNames = require('functions-have-names');
var runTests = require('./tests');
test('shimmed', function (t) {
t.equal(Object.entries.length, 1, 'Object.entries has a length of 1');
t.test('Function name', { skip: !functionsHaveNames }, function (st) {
st.equal(Object.entries.name, 'entries', 'Object.entries has name "entries"');
st.end();
});
t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
et.equal(false, isEnumerable.call(Object, 'entries'), 'Object.entries is not enumerable');
et.end();
});
var supportsStrictMode = (function () { return typeof this === 'undefined'; }());
t.test('bad object value', { skip: !supportsStrictMode }, function (st) {
st['throws'](function () { return Object.entries(undefined); }, TypeError, 'undefined is not an object');
st['throws'](function () { return Object.entries(null); }, TypeError, 'null is not an object');
st.end();
});
runTests(Object.entries, t);
t.end();
});
@@ -0,0 +1,46 @@
'use strict';
var $TypeError = require('es-errors/type');
var isNegativeZero = require('math-intrinsics/isNegativeZero');
var isObject = require('es-object-atoms/isObject');
var callBound = require('call-bound');
var $charAt = callBound('String.prototype.charAt');
var $stringToString = callBound('String.prototype.toString');
var CanonicalNumericIndexString = require('./CanonicalNumericIndexString');
var isPropertyKey = require('../helpers/isPropertyKey');
var isInteger = require('math-intrinsics/isInteger');
// https://262.ecma-international.org/12.0/#sec-stringgetownproperty
module.exports = function StringGetOwnProperty(S, P) {
var str;
if (isObject(S)) {
try {
str = $stringToString(S);
} catch (e) { /**/ }
}
if (typeof str !== 'string') {
throw new $TypeError('Assertion failed: `S` must be a boxed string object');
}
if (!isPropertyKey(P)) {
throw new $TypeError('Assertion failed: P is not a Property Key');
}
if (typeof P !== 'string') {
return void undefined;
}
var index = CanonicalNumericIndexString(P);
var len = str.length;
if (typeof index === 'undefined' || !isInteger(index) || isNegativeZero(index) || index < 0 || len <= index) {
return void undefined;
}
var resultStr = $charAt(S, index);
return {
'[[Configurable]]': false,
'[[Enumerable]]': true,
'[[Value]]': resultStr,
'[[Writable]]': false
};
};
@@ -0,0 +1,26 @@
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
var isArray = Array.isArray;
module.exports = isArray;
@@ -0,0 +1 @@
{"version":3,"sources":["../src/utils/env.ts","../src/utils/errors.ts","../src/utils/common.ts","../src/utils/plugins.ts","../src/core/scope.ts","../src/core/finalize.ts","../src/core/proxy.ts","../src/core/immerClass.ts","../src/core/current.ts","../src/plugins/patches.ts","../src/plugins/mapset.ts","../src/immer.ts"],"sourcesContent":["// Should be no imports here!\n\n/**\n * The sentinel value returned by producers to replace the draft with undefined.\n */\nexport const NOTHING: unique symbol = Symbol.for(\"immer-nothing\")\n\n/**\n * To let Immer treat your class instances as plain immutable objects\n * (albeit with a custom prototype), you must define either an instance property\n * or a static property on each of your custom classes.\n *\n * Otherwise, your class instance will never be drafted, which means it won't be\n * safe to mutate in a produce callback.\n */\nexport const DRAFTABLE: unique symbol = Symbol.for(\"immer-draftable\")\n\nexport const DRAFT_STATE: unique symbol = Symbol.for(\"immer-state\")\n","export const errors =\n\tprocess.env.NODE_ENV !== \"production\"\n\t\t? [\n\t\t\t\t// All error codes, starting by 0:\n\t\t\t\tfunction(plugin: string) {\n\t\t\t\t\treturn `The plugin for '${plugin}' has not been loaded into Immer. To enable the plugin, import and call \\`enable${plugin}()\\` when initializing your application.`\n\t\t\t\t},\n\t\t\t\tfunction(thing: string) {\n\t\t\t\t\treturn `produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${thing}'`\n\t\t\t\t},\n\t\t\t\t\"This object has been frozen and should not be mutated\",\n\t\t\t\tfunction(data: any) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t\"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? \" +\n\t\t\t\t\t\tdata\n\t\t\t\t\t)\n\t\t\t\t},\n\t\t\t\t\"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.\",\n\t\t\t\t\"Immer forbids circular references\",\n\t\t\t\t\"The first or second argument to `produce` must be a function\",\n\t\t\t\t\"The third argument to `produce` must be a function or undefined\",\n\t\t\t\t\"First argument to `createDraft` must be a plain object, an array, or an immerable object\",\n\t\t\t\t\"First argument to `finishDraft` must be a draft returned by `createDraft`\",\n\t\t\t\tfunction(thing: string) {\n\t\t\t\t\treturn `'current' expects a draft, got: ${thing}`\n\t\t\t\t},\n\t\t\t\t\"Object.defineProperty() cannot be used on an Immer draft\",\n\t\t\t\t\"Object.setPrototypeOf() cannot be used on an Immer draft\",\n\t\t\t\t\"Immer only supports deleting array indices\",\n\t\t\t\t\"Immer only supports setting array indices and the 'length' property\",\n\t\t\t\tfunction(thing: string) {\n\t\t\t\t\treturn `'original' expects a draft, got: ${thing}`\n\t\t\t\t}\n\t\t\t\t// Note: if more errors are added, the errorOffset in Patches.ts should be increased\n\t\t\t\t// See Patches.ts for additional errors\n\t\t ]\n\t\t: []\n\nexport function die(error: number, ...args: any[]): never {\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\tconst e = errors[error]\n\t\tconst msg = typeof e === \"function\" ? e.apply(null, args as any) : e\n\t\tthrow new Error(`[Immer] ${msg}`)\n\t}\n\tthrow new Error(\n\t\t`[Immer] minified error nr: ${error}. Full error at: https://bit.ly/3cXEKWf`\n\t)\n}\n","import {\n\tDRAFT_STATE,\n\tDRAFTABLE,\n\tObjectish,\n\tDrafted,\n\tAnyObject,\n\tAnyMap,\n\tAnySet,\n\tImmerState,\n\tArchType,\n\tdie,\n\tStrictMode\n} from \"../internal\"\n\nexport const getPrototypeOf = Object.getPrototypeOf\n\n/** Returns true if the given value is an Immer draft */\n/*#__PURE__*/\nexport function isDraft(value: any): boolean {\n\treturn !!value && !!value[DRAFT_STATE]\n}\n\n/** Returns true if the given value can be drafted by Immer */\n/*#__PURE__*/\nexport function isDraftable(value: any): boolean {\n\tif (!value) return false\n\treturn (\n\t\tisPlainObject(value) ||\n\t\tArray.isArray(value) ||\n\t\t!!value[DRAFTABLE] ||\n\t\t!!value.constructor?.[DRAFTABLE] ||\n\t\tisMap(value) ||\n\t\tisSet(value)\n\t)\n}\n\nconst objectCtorString = Object.prototype.constructor.toString()\nconst cachedCtorStrings = new WeakMap()\n/*#__PURE__*/\nexport function isPlainObject(value: any): boolean {\n\tif (!value || typeof value !== \"object\") return false\n\tconst proto = Object.getPrototypeOf(value)\n\tif (proto === null || proto === Object.prototype) return true\n\n\tconst Ctor =\n\t\tObject.hasOwnProperty.call(proto, \"constructor\") && proto.constructor\n\tif (Ctor === Object) return true\n\n\tif (typeof Ctor !== \"function\") return false\n\n\tlet ctorString = cachedCtorStrings.get(Ctor)\n\tif (ctorString === undefined) {\n\t\tctorString = Function.toString.call(Ctor)\n\t\tcachedCtorStrings.set(Ctor, ctorString)\n\t}\n\n\treturn ctorString === objectCtorString\n}\n\n/** Get the underlying object that is rLine truncated
@@ -0,0 +1,12 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.esnext_array = void 0;
const base_config_1 = require("./base-config");
exports.esnext_array = {
libs: [],
variables: [['ArrayConstructor', base_config_1.TYPE]],
};
@@ -0,0 +1 @@
{"name":"@xterm/addon-canvas","version":"0.7.0","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532110924,"integrity":"sha512-iVPiKUl7UcCTocOOG4pEnsYjAPNdFoCFz/lIYUdi9vIY8BO0v2DuP2FJoGsyWfNKzNF9cH54+P6TgAC4N2fS1w==","mode":420,"size":1103},"lib/addon-canvas.js":{"checkedAt":1794532110924,"integrity":"sha512-DAbBmXUxkBgSbSXNn5cLMNKRSnEdZCPLhVEB5ye9bT289Wn7rl/JVWsepONXW1Yv7eJho+sQCjdJx03ttP8bGw==","mode":420,"size":94607},"package.json":{"checkedAt":1794532110925,"integrity":"sha512-vG9gfPVEVy6fu7DGKAzsx39wQjdh6ZS6z1cZhK36Ki6PD7YhHX8TCwO3gaKw8D+t1TksOUOvdPHUDh0qRcScCg==","mode":420,"size":719},"lib/addon-canvas.js.map":{"checkedAt":1794532110926,"integrity":"sha512-i5XfzC7BwKKRRmG09ZKwbb8SYImeJczTFvExwJhg2gECXqj1FWWsP5FGpt9m2J0iV0ZnWMELx9GZsnj5qYnNfQ==","mode":420,"size":379537},"README.md":{"checkedAt":1794532110926,"integrity":"sha512-W9GWAyXrzN0cYqkm+lgsq00hnJvYoZWWEcIoligEyVL7Liu80ddfvFngx4h5QPDQMNKnGQ+3ft2Viow2aqhmWQ==","mode":420,"size":979},"typings/addon-canvas.d.ts":{"checkedAt":1794532110926,"integrity":"sha512-MmQho3IGaI/n+nfhqeMFLydfOutcTGGjnoYn2jZjoZcDFswd5gdLszHQafU/dMLjAVQx2Yj5mzoAVCxdrTMpbA==","mode":420,"size":1077},"src/BaseRenderLayer.ts":{"checkedAt":1794532110926,"integrity":"sha512-PhBM/6zSROHnhHdxVheDntskyjHpDt/3IXQpozl216B3Nf68qHapbN6k29bf4fl5axw72rXlUoJiaVitbh99oA==","mode":420,"size":19796},"src/CanvasAddon.ts":{"checkedAt":1794532110926,"integrity":"sha512-e/GvBtKPF7p6ajj7Ja8xd2T/3kUIVWKIhkM4zFfV15PddTHnN88GX2PI6JmrzMv+bZUKUKM6WuY9/J0jjLizTA==","mode":420,"size":3476},"src/CanvasRenderer.ts":{"checkedAt":1794532110927,"integrity":"sha512-qJ7Hl2uxfEq7CDcxC98etI+6yLCM4OH7O/xWV4tvgm+cyWE57Z4CEqNkvQB8VALX0O1kofgu2iZctMLCwCkHyA==","mode":420,"size":8725},"src/CursorRenderLayer.ts":{"checkedAt":1794532110927,"integrity":"sha512-HZbxFuj8wlKtgJlnBEEurwY2RUfms2ifLg1XP9RuGA/mA0ZU1OZhemoqFFNZuAt7WNq8hgzlpEJsjpZ/fgvdMA==","mode":420,"size":8352},"src/GridCache.ts":{"checkedAt":1794532110927,"integrity":"sha512-IeYHXw+NDxlOn71oXQ6Rp4P24v93NhQLI+Wwk28/HTuzmReVg+14Fy9FKP2UJQGKNqQFjETtgUkxoSTd13nqWA==","mode":420,"size":747},"src/LinkRenderLayer.ts":{"checkedAt":1794532110927,"integrity":"sha512-JqeiHKS16XTsHb7Edx6GwB0PgfMpEQ0n7FR3QHVH8e/uq4Qi4QjgCrRhuFmnj7MnovJDlTfioVx3A+rN9U+V0w==","mode":420,"size":2970},"src/SelectionRenderLayer.ts":{"checkedAt":1794532110927,"integrity":"sha512-6qEn5gOuwnAOaszMp/ybfROdnKUe14hhtldF/urf+AbaR9ZFoI7b8xNyzlkUhnvyoaCr0hkvtGgeSGuxs9f3RA==","mode":420,"size":5701},"src/TextRenderLayer.ts":{"checkedAt":1794532110927,"integrity":"sha512-+cvRxEyWM8P91LofcqBrO3K2iADDl+raUBaC4Tb4kd1iaSH5LfF0KrZSu2/zitcE6ZrL4JXuz9PTz77Cf5xu8A==","mode":420,"size":10683},"src/Types.d.ts":{"checkedAt":1794532110928,"integrity":"sha512-1kFM9eoxwFL/d+P/h+DFjMLZtKH904/lp4PRYpiAEO9F2X8bmkhh7EARUUww/AUo5EHwuQ+q/dQHlmU5p5ySug==","mode":420,"size":2220}}}
@@ -0,0 +1,90 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.forwardAsync = forwardAsync;
exports.isAsync = void 0;
exports.isThenable = isThenable;
exports.maybeAsync = maybeAsync;
exports.waitFor = exports.onFirstPause = void 0;
function _gensync() {
const data = require("gensync");
_gensync = function () {
return data;
};
return data;
}
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
const runGenerator = _gensync()(function* (item) {
return yield* item;
});
const isAsync = exports.isAsync = _gensync()({
sync: () => false,
errback: cb => cb(null, true)
});
function maybeAsync(fn, message) {
return _gensync()({
sync(...args) {
const result = fn.apply(this, args);
if (isThenable(result)) throw new Error(message);
return result;
},
async(...args) {
return Promise.resolve(fn.apply(this, args));
}
});
}
const withKind = _gensync()({
sync: cb => cb("sync"),
async: function () {
var _ref = _asyncToGenerator(function* (cb) {
return cb("async");
});
return function async(_x) {
return _ref.apply(this, arguments);
};
}()
});
function forwardAsync(action, cb) {
const g = _gensync()(action);
return withKind(kind => {
const adapted = g[kind];
return cb(adapted);
});
}
const onFirstPause = exports.onFirstPause = _gensync()({
name: "onFirstPause",
arity: 2,
sync: function (item) {
return runGenerator.sync(item);
},
errback: function (item, firstPause, cb) {
let completed = false;
runGenerator.errback(item, (err, value) => {
completed = true;
cb(err, value);
});
if (!completed) {
firstPause();
}
}
});
const waitFor = exports.waitFor = _gensync()({
sync: x => x,
async: function () {
var _ref2 = _asyncToGenerator(function* (x) {
return x;
});
return function async(_x2) {
return _ref2.apply(this, arguments);
};
}()
});
function isThenable(val) {
return !!val && (typeof val === "object" || typeof val === "function") && !!val.then && typeof val.then === "function";
}
0 && 0;
//# sourceMappingURL=async.js.map
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B wC"},B:{"1":"0 1 2 3 4 5 M G N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I","2":"C L"},C:{"1":"0 1 2 3 4 5 vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC yC zC","2":"6 7 8 9 xC TC J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB 0C 1C"},D:{"1":"0 1 2 3 4 5 bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I XC MC YC","2":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB"},E:{"1":"C L M G NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED","2":"J ZB K D E F A B 2C ZC 3C 4C 5C 6C aC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R WC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C G N FD GD HD ID NC uC JD OC"},G:{"1":"qC rC sC tC","2":"E ZC KD vC LD MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC"},H:{"2":"hD"},I:{"1":"I","2":"TC J iD jD kD lD vC mD nD"},J:{"2":"D A"},K:{"2":"A B C H NC uC OC"},L:{"1":"I"},M:{"1":"MC"},N:{"2":"A B"},O:{"2":"PC"},P:{"2":"6 7 8 9 J AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"1":"zD"},R:{"2":"0D"},S:{"2":"1D 2D"}},B:7,C:"Directory selection from file input",D:true};
@@ -0,0 +1,29 @@
"use strict";
const PATTERN_REGEX = /%(-)?(\d+)?(?:\.(\d+))?([a-zA-Z%])(?:\{([^}]+)\})?/g;
function compilePattern(pattern, createConverter, literalConverter) {
const converters = [];
let lastIndex = 0;
let match;
while ((match = PATTERN_REGEX.exec(pattern)) !== null) {
const [full, align, minWidth, precision, specifier, format] = match;
if (match.index > lastIndex) {
converters.push(literalConverter(pattern.substring(lastIndex, match.index)));
}
const converter = createConverter(
specifier,
align === "-",
parseInt(minWidth || "0", 10),
parseInt(precision || "0", 10),
format
);
if (converter) {
converters.push(converter);
}
lastIndex = match.index + full.length;
}
if (lastIndex < pattern.length) {
converters.push(literalConverter(pattern.substring(lastIndex)));
}
return converters;
}
module.exports = compilePattern;
@@ -0,0 +1,56 @@
{
"name": "@heroui/shared-icons",
"version": "2.1.2",
"description": "Internal icons set, commonly used in the components stories",
"keywords": [
"icons-utils"
],
"author": "Junior Garcia <jrgarciadev@gmail.com>",
"homepage": "https://heroui.com",
"license": "MIT",
"main": "dist/index.js",
"sideEffects": false,
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/heroui-inc/heroui.git",
"directory": "packages/utilities/icons-utils"
},
"bugs": {
"url": "https://github.com/heroui-inc/heroui/issues"
},
"peerDependencies": {
"react": ">=18 || >=19.0.0-rc.0"
},
"clean-package": "../../../clean-package.config.json",
"tsup": {
"clean": true,
"target": "es2019",
"format": [
"cjs",
"esm"
]
},
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./package.json": "./package.json"
},
"scripts": {
"build": "tsup src --dts",
"dev": "pnpm build:fast --watch",
"clean": "rimraf dist .turbo",
"typecheck": "tsc --noEmit",
"build:fast": "tsup src"
}
}
@@ -0,0 +1 @@
{"0.20.0":"39.0.2171.65","0.20.1":"39.0.2171.65","0.20.2":"39.0.2171.65","0.20.3":"39.0.2171.65","0.20.4":"39.0.2171.65","0.20.5":"39.0.2171.65","0.20.6":"39.0.2171.65","0.20.7":"39.0.2171.65","0.20.8":"39.0.2171.65","0.21.0":"40.0.2214.91","0.21.1":"40.0.2214.91","0.21.2":"40.0.2214.91","0.21.3":"41.0.2272.76","0.22.1":"41.0.2272.76","0.22.2":"41.0.2272.76","0.22.3":"41.0.2272.76","0.23.0":"41.0.2272.76","0.24.0":"41.0.2272.76","0.25.0":"42.0.2311.107","0.25.1":"42.0.2311.107","0.25.2":"42.0.2311.107","0.25.3":"42.0.2311.107","0.26.0":"42.0.2311.107","0.26.1":"42.0.2311.107","0.27.0":"42.0.2311.107","0.27.1":"42.0.2311.107","0.27.2":"43.0.2357.65","0.27.3":"43.0.2357.65","0.28.0":"43.0.2357.65","0.28.1":"43.0.2357.65","0.28.2":"43.0.2357.65","0.28.3":"43.0.2357.65","0.29.1":"43.0.2357.65","0.29.2":"43.0.2357.65","0.30.4":"44.0.2403.125","0.31.0":"44.0.2403.125","0.31.2":"45.0.2454.85","0.32.2":"45.0.2454.85","0.32.3":"45.0.2454.85","0.33.0":"45.0.2454.85","0.33.1":"45.0.2454.85","0.33.2":"45.0.2454.85","0.33.3":"45.0.2454.85","0.33.4":"45.0.2454.85","0.33.6":"45.0.2454.85","0.33.7":"45.0.2454.85","0.33.8":"45.0.2454.85","0.33.9":"45.0.2454.85","0.34.0":"45.0.2454.85","0.34.1":"45.0.2454.85","0.34.2":"45.0.2454.85","0.34.3":"45.0.2454.85","0.34.4":"45.0.2454.85","0.35.1":"45.0.2454.85","0.35.2":"45.0.2454.85","0.35.3":"45.0.2454.85","0.35.4":"45.0.2454.85","0.35.5":"45.0.2454.85","0.36.0":"47.0.2526.73","0.36.2":"47.0.2526.73","0.36.3":"47.0.2526.73","0.36.4":"47.0.2526.73","0.36.5":"47.0.2526.110","0.36.6":"47.0.2526.110","0.36.7":"47.0.2526.110","0.36.8":"47.0.2526.110","0.36.9":"47.0.2526.110","0.36.10":"47.0.2526.110","0.36.11":"47.0.2526.110","0.36.12":"47.0.2526.110","0.37.0":"49.0.2623.75","0.37.1":"49.0.2623.75","0.37.3":"49.0.2623.75","0.37.4":"49.0.2623.75","0.37.5":"49.0.2623.75","0.37.6":"49.0.2623.75","0.37.7":"49.0.2623.75","0.37.8":"49.0.2623.75","1.0.0":"49.0.2623.75","1.0.1":"49.0.2623.75","1.0.2":"49.0.2623.75","1.1.0":"50.0.2661.102","1.1.1":"50.0.2661.102","1.1.2":"50.0.2661.102","1.1.3":"50.0.2661.102","1.2.0":"51.0.2704.63","1.2.1":"51.0.2704.63","1.2.2":"51.0.2704.84","1.2.3":"51.0.2704.84","1.2.4":"51.0.2704.103","1.2.5":"51.0.2704.103","1.2.6":"51.0.2704.106","1.2.7":"51.0.2704.106","1.2.8":"51.0.2704.106","1.3.0":"52.0.2743.82","1.3.1":"52.0.2743.82","1.3.2":"52.0.2743.82","1.3.3":"52.0.2743.82","1.3.4":"52.0.2743.82","1.3.5":"52.0.2743.82","1.3.6":"52.0.2743.82","1.3.7":"52.0.2743.82","1.3.9":"52.0.2743.82","1.3.10":"52.0.2743.82","1.3.13":"52.0.2743.82","1.3.14":"52.0.2743.82","1.3.15":"52.0.2743.82","1.4.0":"53.0.2785.113","1.4.1":"53.0.2785.113","1.4.2":"53.0.2785.113","1.4.3":"53.0.2785.113","1.4.4":"53.0.2785.113","1.4.5":"53.0.2785.113","1.4.6":"53.0.2785.143","1.4.7":"53.0.2785.143","1.4.8":"53.0.2785.143","1.4.10":"53.0.2785.143","1.4.11":"53.0.2785.143","1.4.12":"54.0.2840.51","1.4.13":"53.0.2785.143","1.4.14":"53.0.2785.143","1.4.15":"53.0.2785.143","1.4.16":"53.0.2785.143","1.5.0":"54.0.2840.101","1.5.1":"54.0.2840.101","1.6.0":"56.0.2924.87","1.6.1":"56.0.2924.87","1.6.2":"56.0.2924.87","1.6.3":"56.0.2924.87","1.6.4":"56.0.2924.87","1.6.5":"56.0.2924.87","1.6.6":"56.0.2924.87","1.6.7":"56.0.2924.87","1.6.8":"56.0.2924.87","1.6.9":"56.0.2924.87","1.6.10":"56.0.2924.87","1.6.11":"56.0.2924.87","1.6.12":"56.0.2924.87","1.6.13":"56.0.2924.87","1.6.14":"56.0.2924.87","1.6.15":"56.0.2924.87","1.6.16":"56.0.2924.87","1.6.17":"56.0.2924.87","1.6.18":"56.0.2924.87","1.7.0":"58.0.3029.110","1.7.1":"58.0.3029.110","1.7.2":"58.0.3029.110","1.7.3":"58.0.3029.110","1.7.4":"58.0.3029.110","1.7.5":"58.0.3029.110","1.7.6":"58.0.3029.110","1.7.7":"58.0.3029.110","1.7.8":"58.0.3029.110","1.7.9":"58.0.3029.110","1.7.10":"58.0.3029.110","1.7.11":"58.0.3029.110","1.7.12":"58.0.3029.110","1.7.13":"58.0.3029.110","1.7.14":"58.0.3029.110","1.7.15":"58.0.3029.110","1.7.16":"58.0.3029.110","1.8.0":"59.0.3071.115","1.8.1":"59.0.3071.115","1.8.2-beta.1":"59.0.3071.115","1.8.2-beta.2":"59.0.3071.115","1.8.2-beta.3":"59.0.3071.115","1.8.2-beta.4":"59.0.3071.115","1.8.2-beta.5":"59.0.3071.115","1.8.2":"59.0.3071.115","1.8.3":"59.0.3071.115","1.8.4":"59.0.3071.115","1.8.5":"59.0.3071.115","1.8.6":"59.0.3071.115","1.8.7":"59.0.3071.115","1.8.8":"59.0.3071.115","2.0.0-beta.1":"61.0.3163.100","2.0.0-beta.2":"61.0.3163.100","2.0.0-beta.3":"61.0.3163.100","2.0.0-beta.4":"61.0.3163.100","2.0.0-beta.5":"61.0.3163.100","2.0.0-beta.6":"61.0.3163.100","2.0.0-beta.7":"61.0.3163.100","2.0.0-beta.8":"61.0.3163.100","2.0.0":"61.0.3163.100","2.0.1":"61.0.3163.100","2.0.2":"61.0.3163.100","2.0.3":"61.0.3163.100","2.0.4":"61.0.3163.100","2.0.5":"61.0.3163.100","2.0.6":"61.0.3163.100","2.0.7":"61.0.3163.100","2.0.8":"61.0.3163.100","2.0.9":"61.0.3163.100","2.0.10":"61.0.3163.100","2.0.11":"61.0.3163.100","2.0.12":"61.0.3163.100","2.0.13":"61.0.3163.100","2.0.14":"61.0.3163.100","2.0.15":"61.0.3163.100","2.0.16":"61.0.3163.100","2.0.17":"61.0.3163.100","2.0.18":"61.0.3163.100","2.1.0-unsupported.20180809":"61.0.3163.10Line truncated
@@ -0,0 +1,886 @@
export default `flf2a$ 5 4 15 0 8
This font is (c) Michel Eftimakis 1995 -- Version 1.0 -- 27 jan 1995
____________________________________________________________ /\`____
| Michel Eftimakis | "Ascii-Artist" '\\/ |
| Michel.Eftimakis@ustc.vlsi.com | Boo)- (00) ||
| Tel : (33) 92 96 27 19 | (_\`'_) ||
|__ Fax : (33) 92 96 27 01 _________|____ FRANCE ___________ _!!_ ____||
|_____________________________________________________________________|
$@
$ @
$ @
$ @
$ @@
/7@
// @
@
() @
@@
@
/7/7@
$ @
$ @
@@
@
_/7_/7_@
// // @
-//-//- @
@@
_/7@
,' _/@
_\\ \`. @
/___,' @
// @@
@
()/7@
// @
//()@
@@
_ @
(o) @
,'oV7@
|_n| @
@@
_@
//@
$ @
$ @
@@
_@
,;'@
//$ @
//$ @
|| @@
_ @
||@
$// @
$// @
,;' @@
. ,@
x @
' \`@
$ @
@@
@
_/7 @
/_ _7@
// @
@@
@
@
@
()@
/' @@
@
@
___@
/__/@
@@
@
@
@
()$@
@@
_@
//@
// @
// @
@@
_ @
,' \\@
/ 0 /@
\\_,' @
@@
_@
,'/@
$// @
$// @
@@
___ @
/_ )@
,'c' @
(___7 @
@@
____@
/_ ,'@
__/< @
|__,' @
@@
.@
,'/@
,'o/ @
(___7 @
@@
___@
/ _/@
|_ \\@
/__,'@
@@
@
,'7@
/o \\@
|_,'@
@@
___@
/_ /@
// @
// @
@@
__ @
/o )@
,'o | @
|__,' @
@@
__ @
,'o |@
|_ / @
// @
@@
@
@
()@
() @
@@
@
@
()@
() @
V @@
_@
//@
<<$@
\\\\@
@@
@
____@
/___/@
/___/ @
@@
_ @
\\\\ @
$>>@
// @
@@
___ @
/ o )@
7,' @
$ @
() @@
__ @
,'_ \\@
|(o_,'@
$|___7$@
@@
_ @
.' \\@
/ o /@
/_n_/ @
@@
___ @
/ o.)@
/ o \\ @
/___,' @
@@
__@
,'_/@
/ /_ @
|__/ @
@@
__ @
/ \\@
/ o |@
/__,' @
@@
___@
/ _/@
/ _/ @
/___/ @
@@
____@
/ __/@
/ _/ @
/_/ @
@@
__@
,'_/@
/ /_n@
|__,'@
@@
_ __@
/// /@
/ \` / @
/_n_/ @
@@
__@
/ /@
/ / @
/_/ @
@@
__@
/ /@
n_/ / @
\\_,' @
@@
_ @
/ //7@
/ ,' @
/_/\\\\ @
@@
__@
/ /@
/ /_@
/___/@
@@
_ __@
/ \\,' /@
/ \\,' / @
/_/ /_/ @
@@
_ __@
/ |/ /@
/ || / @
/_/|_/ @
@@
_ @
,' \\@
/ o |@
|_,' @
@@
___ @
/ o |@
/ _,' @
/_/ @
@@
_ @
,' \\@
/ o |@
|_,\\\\@
@@
___ @
/ o |@
/ ,' @
/_/\`_\\ @
@@
___@
,' _/@
_\\ \`. @
/___,' @
@@
_____@
/_ _/@
/ / @
/_/ @
@@
_ __@
/// /@
/ U / @
\\_,' @
@@
_ __@
/// /@
| V / @
|_,' @
@@
_ __@
///7/ /@
| V V / @
|_n_,' @
@@
_ __@
| |/,'@
/ / @
,'_n_\\ @
@@
_ __@
| |/,'@
| ,' @
/_/ @
@@
____ @
/_ ,'@
,',' @
,'___/ @
@@
__ @
/ _/@
/ /$ @
/ /$ @
/__/ @@
_ @
\\\\ @
\\\\ @
\\\\@
@@
___@
/_ /@
$/ / @
$/ / @
/__/ @@
_ @
/.\\@
$ @
$ @
@@
@
@
@
____@
/___/@@
_ @
\\\\@
$ @
$ @
@@
@
_ @
,'o|@
|_,7@
@@
@
/7@
/o\\@
/_,'@
@@
@
__@
,','@
\\_\\ @
@@
@
_//@
,'o/ @
|__/ @
@@
@
__@
,'o/@
|_( @
@@
_ @
,'_7@
/_7 @
// @
@@
@
_ @
,'o|@
|_,'@
_// @@
@
/7@
/ \\@
/n_/@
@@
@
()@
/7 @
// @
@@
@
()@
/7 @
// @
// @@
@
/7 @
//_7@
//\\\\ @
@@
@
/7@
// @
// @
@@
@
_ @
/ \\'\\@
/_nn_/@
@@
@
_ @
/ \\/7@
/_n_/ @
@@
@
_ @
,'o|@
|_,'@
@@
@
_ @
/o|@
/_,'@
// @@
@
_ @
,'o|@
|_,'@
// @@
@
_ @
//7@
//$ @
@@
@
__@
(c'@
/__)@
@@
@
/7@
/_7@
// @
@@
@
@
/7/7@
/__/ @
@@
@
@
/7/7@
|,' @
@@
@
@
/7/7/7@
|,^,' @
@@
@
_ __@
\\V,'@
,'n\\ @
@@
@
_ __@
\\V /@
)/ @
// @@
@
____@
/_ ,'@
,'__/@
@@
_@
//@
/|$@
\\|$@
\\\\@@
__@
/ /@
/ / @
/ / @
/_/ @@
_ @
\\\\ @
$|\\@
$|/@
// @@
_ _@
//\\//@
$ @
$ @
@@
()_()@
.' \\ @
/ o / @
/_n_/ @
@@
()_()@
,' \\ @
/ o | @
|_,' @
@@
()_()@
/// / @
/ U / @
\\_,' @
@@
@
OO@
,'o|@
|_,7@
@@
@
OO@
,'o|@
|_,'@
@@
@
O O@
/7/7@
/__/ @
@@
__ @
/o )@
/o | @
//_,' @
// @@
160
$@
$ @
$ @
$ @
$ @@
161
()@
@
/7 @
// @
// @@
165
_ __@
| |/,'@
/_ _7 @
/_/ @
@@
166
/7@
// @
@
/7 @
// @@
168
@
()()@
$$ @
$$ @
@@
183
_ @
(_)@
$ @
$ @
@@
192
\\\\@
.' \\@
/ o /@
/_n_/ @
@@
193
//@
.' \\@
/ o /@
/_n_/ @
@@
194
/^\\@
.' \\@
/ o /@
/_n_/ @
@@
195
/\\/@
.' \\@
/ o /@
/_n_/ @
@@
196
()_()@
.' \\ @
/ o / @
/_n_/ @
@@
197
()@
.' \\@
/ o /@
/_n_/ @
@@
198
______@
.' \\ _/@
/ o _/ @
/_n_/___/ @
@@
199
__@
,'_/@
/ /_ @
|__/ @
// @@
200
_\\\\@
/ _/@
/ _/ @
/___/ @
@@
201
_//@
/ _/@
/ _/ @
/___/ @
@@
202
/^\\@
/ _/@
/ _/ @
/___/ @
@@
203
()_()@
/ _/ @
/ _/ @
/___/ @
@@
204
\\\\@
/ /@
/ / @
/_/ @
@@
205
//@
/ / @
/ / @
/_/ @
@@
206
/^\\@
/ /@
/ / @
/_/ @
@@
207
()()@
/ / @
/ / @
/_/ @
@@
209
_/\\/_@
/ |/ /@
/ || / @
/_/|_/ @
@@
210
\\\\@
,' \\@
/ o |@
|_,' @
@@
211
//@
,' \\@
/ o |@
|_,' @
@@
212
/^\\@
,' \\@
/ o |@
|_,' @
@@
213
/\\/@
,' \\@
/ o |@
|_,' @
@@
214
()_()@
,' \\ @
/ o | @
|_,' @
@@
217
_\\\\_@
/// /@
/ U / @
\\_,' @
@@
218
_//_@
/// /@
/ U / @
\\_,' @
@@
219
/^\\_@
/// /@
/ U / @
\\_,' @
@@
220
()_()@
/// / @
/ U / @
\\_,' @
@@
223
__ @
/o )@
/o | @
//_,' @
// @@
224
_ @
\`\`@
,'o|@
|_,7@
@@
225
_@
''@
,'o|@
|_,7@
@@
226
@
_^@
,'o|@
|_,7@
@@
227
@
_~@
,'o|@
|_,7@
@@
228
@
OO@
,'o|@
|_,7@
@@
229
@
_O@
,'o|@
|_,7@
@@
230
@
_ __@
,'o|'o/@
|_,7.( @
@@
231
@
__@
,','@
\\_\\ @
// @@
232
_ @
\`\`@
,'o/@
|_( @
@@
233
_@
''@
,'o/@
|_( @
@@
234
@
_^@
,'o/@
|_( @
@@
235
@
OO@
,'o/@
|_( @
@@
236
_ @
\`\`@
/7 @
// @
@@
237
_@
''@
/7 @
// @
@@
238
@
'\`@
/7 @
// @
@@
239
@
OO@
/7 @
// @
@@
241
@
_~ @
/ \\/7@
/_n_/ @
@@
242
_ @
\`\`@
,'o|@
|_,'@
@@
243
_@
''@
,'o|@
|_,'@
@@
244
@
_^@
,'o|@
|_,'@
@@
245
@
_~@
,'o|@
|_,'@
@@
246
@
OO@
,'o|@
|_,'@
@@
249
_ @
\`\`@
/7/7@
/__/ @
@@
250
_@
''@
/7/7@
/__/ @
@@
251
@
^ @
/7/7@
/__/ @
@@
252
@
O O@
/7/7@
/__/ @
@@
253
_ @
_''_@
\\V /@
)/ @
// @@
255
@
_OO_@
\\V /@
)/ @
// @@
`
@@ -0,0 +1,30 @@
;(function (root, factory, undef) {
if (typeof exports === "object") {
// CommonJS
module.exports = exports = factory(require("./core"), require("./cipher-core"));
}
else if (typeof define === "function" && define.amd) {
// AMD
define(["./core", "./cipher-core"], factory);
}
else {
// Global (browser)
factory(root.CryptoJS);
}
}(this, function (CryptoJS) {
/**
* A noop padding strategy.
*/
CryptoJS.pad.NoPadding = {
pad: function () {
},
unpad: function () {
}
};
return CryptoJS.pad.NoPadding;
}));
@@ -0,0 +1,253 @@
# Change Log
All notable changes to this module will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/).
This change log adheres to standards from [Keep a CHANGELOG](https://keepachangelog.com).
## Unreleased
## v2.12.1 - 2025-06-19
### Fixed
- `unambiguous`: detect modules exported from minified code ([#3124], thanks [@michaelfaith])
### Changed
- [refactor] `parse`: avoid using a regex here (thanks [@ljharb])
## v2.12.0 - 2024-09-26
### Added
- `hash`: add support for hashing functions ([#3072], thanks [@michaelfaith])
## v2.11.1 - 2024-09-23
### Fixed
- `parse`: remove unneeded extra backticks ([#3057], thanks [@G-Rath])
- `parse`: espree parser isn't working with flat config ([#3061], thanks [@michaelfaith])
- `parse`: add `ecmaVersion` and `sourceType` to `parserOptions` ([#3061], thanks [@michaelfaith])
## v2.11.0 - 2024-09-05
### New
- `declaredScope`: take a `node` for modern eslint versions (thanks [@michaelfaith])
## v2.10.0 - 2024-09-05
### New
- add context compatibility helpers ([#3049], thanks [@michaelfaith])
## v2.9.0 - 2024-09-02
### New
- add support for Flat Config ([#3018], thanks [@michaelfaith])
## v2.8.2 - 2024-08-25
### Fixed
- `parse`: also delete `parserOptions.projectService` ([#3039], thanks [@Mysak0CZ])
### Changed
- [types] use shared config (thanks [@ljharb])
- [meta] add `exports`, `main`
- [meta] add `repository.directory` field
- [refactor] avoid hoisting
## v2.8.1 - 2024-02-26
### Fixed
- `parse`: also delete `parserOptions.EXPERIMENTAL_useProjectService` ([#2963], thanks [@JoshuaKGoldberg])
### Changed
- add types (thanks [@ljharb])
## v2.8.0 - 2023-04-14
### New
- `parse`: support flat config ([#2714], thanks [@DMartens])
### Fixed
- Improve performance of `fullResolve` for large projects ([#2755], thanks [@leipert])
## v2.7.4 - 2022-08-11
### Fixed
- [Fix] Ignore hashbang and BOM while parsing ([#2431], thanks [@silverwind])
### Changed
- [patch] mark eslint as an optional peer dep ([#2523], thanks [@wmertens])
## v2.7.3 - 2022-01-26
### Fixed
- `parse`: restore compatibility by making the return value `ast` again ([#2350], thanks [@ljharb])
## v2.7.2 - 2022-01-01
### Fixed
- [patch] Fix `@babel/eslint-parser` 8 compatibility ([#2343], thanks [@nicolo-ribaudo])
### Changed
- [Refactor] inline `pkgDir` implementation; remove `pkg-dir`
## v2.7.1 - 2021-10-13
### Fixed
- fixed SyntaxError in node <= 6: Unexpected token ) in parse.js ([#2261], thanks [@VitusFW])
## v2.7.0 - 2021-10-11
### Added
- `fileExistsWithCaseSync`: add `strict` argument ([#1262], thanks [@sergei-startsev])
- add `visit`, to support dynamic imports ([#1660], [#2212], thanks [@maxkomarychev], [@aladdin-add], [@Hypnosphi])
- create internal replacement for `pkg-up` and `read-pkg-up` ([#2047], [@mgwalker])
## v2.6.2 - 2021-08-08
### Fixed
- Use `context.getPhysicalFilename()` when available (ESLint 7.28+) ([#2160], thanks [@pmcelhaney])
## v2.6.1 - 2021-05-13
### Fixed
- `no-unresolved`: check `import()` ([#2026], thanks [@aladdin-add])
- Add fix for Windows Subsystem for Linux ([#1786], thanks [@manuth])
### Changed
- [deps] update `debug`
- [Refactor] use `Array.isArray` instead of `instanceof Array`
## v2.6.0 - 2020-03-28
### Added
- Print more helpful info if parsing fails ([#1671], thanks [@kaiyoma])
## v2.5.2 - 2020-01-12
### Fixed
- Makes the loader resolution more tolerant ([#1606], thanks [@arcanis])
- Use `createRequire` instead of `createRequireFromPath` if available ([#1602], thanks [@iamnapo])
## v2.5.1 - 2020-01-11
### Fixed
- Uses createRequireFromPath to resolve loaders ([#1591], thanks [@arcanis])
- report the error stack on a resolution error ([#599], thanks [@sompylasar])
## v2.5.0 - 2019-12-07
### Added
- support `parseForESLint` from custom parser ([#1435], thanks [@JounQin])
### Changed
- Avoid superfluous calls and code ([#1551], thanks [@brettz9])
## v2.4.1 - 2019-07-19
### Fixed
- Improve parse perf when using `@typescript-eslint/parser` ([#1409], thanks [@bradzacher])
- Improve support for TypeScript declare structures ([#1356], thanks [@christophercurrie])
## v2.4.0 - 2019-04-13
### Added
- no-useless-path-segments: Add noUselessIndex option ([#1290], thanks [@timkraut])
### Fixed
- Fix overwriting of dynamic import() CallExpression ([`no-cycle`], [`no-relative-parent-import`], [`no-unresolved`], [`no-useless-path-segments`]) ([#1218], [#1166], [#1035], thanks [@vikr01])
## v2.3.0 - 2019-01-22
### Fixed
- use `process.hrtime()` for cache dates ([#1160], thanks [@hulkish])
## v2.2.0 - 2018-03-29
### Changed
- `parse`: attach node locations by default.
- `moduleVisitor`: visitor now gets the full `import` statement node as a second
argument, so rules may report against the full statement / `require` call instead
of only the string literal node.
## v2.1.1 - 2017-06-22
Re-releasing v2.1.0 after vetting (again) and unable to reproduce issue.
## v2.1.0 - 2017-06-02 [YANKED]
Yanked due to critical issue with cache key resulting from #839.
### Added
- `parse` now additionally passes `filePath` to `parser` in `parserOptions` like `eslint` core does
## v2.0.0 - 2016-11-07
### Changed
- `unambiguous` no longer exposes fast test regex
### Fixed
- `unambiguous.test()` regex is now properly in multiline mode
[#3124]: https://github.com/import-js/eslint-plugin-import/pull/3124
[#3072]: https://github.com/import-js/eslint-plugin-import/pull/3072
[#3061]: https://github.com/import-js/eslint-plugin-import/pull/3061
[#3057]: https://github.com/import-js/eslint-plugin-import/pull/3057
[#3049]: https://github.com/import-js/eslint-plugin-import/pull/3049
[#3039]: https://github.com/import-js/eslint-plugin-import/pull/3039
[#3018]: https://github.com/import-js/eslint-plugin-import/pull/3018
[#2963]: https://github.com/import-js/eslint-plugin-import/pull/2963
[#2755]: https://github.com/import-js/eslint-plugin-import/pull/2755
[#2714]: https://github.com/import-js/eslint-plugin-import/pull/2714
[#2523]: https://github.com/import-js/eslint-plugin-import/pull/2523
[#2431]: https://github.com/import-js/eslint-plugin-import/pull/2431
[#2350]: https://github.com/import-js/eslint-plugin-import/issues/2350
[#2343]: https://github.com/import-js/eslint-plugin-import/pull/2343
[#2261]: https://github.com/import-js/eslint-plugin-import/pull/2261
[#2212]: https://github.com/import-js/eslint-plugin-import/pull/2212
[#2160]: https://github.com/import-js/eslint-plugin-import/pull/2160
[#2047]: https://github.com/import-js/eslint-plugin-import/pull/2047
[#2026]: https://github.com/import-js/eslint-plugin-import/pull/2026
[#1786]: https://github.com/import-js/eslint-plugin-import/pull/1786
[#1671]: https://github.com/import-js/eslint-plugin-import/pull/1671
[#1660]: https://github.com/import-js/eslint-plugin-import/pull/1660
[#1606]: https://github.com/import-js/eslint-plugin-import/pull/1606
[#1602]: https://github.com/import-js/eslint-plugin-import/pull/1602
[#1591]: https://github.com/import-js/eslint-plugin-import/pull/1591
[#1551]: https://github.com/import-js/eslint-plugin-import/pull/1551
[#1435]: https://github.com/import-js/eslint-plugin-import/pull/1435
[#1409]: https://github.com/import-js/eslint-plugin-import/pull/1409
[#1356]: https://github.com/import-js/eslint-plugin-import/pull/1356
[#1290]: https://github.com/import-js/eslint-plugin-import/pull/1290
[#1262]: https://github.com/import-js/eslint-plugin-import/pull/1262
[#1218]: https://github.com/import-js/eslint-plugin-import/pull/1218
[#1166]: https://github.com/import-js/eslint-plugin-import/issues/1166
[#1160]: https://github.com/import-js/eslint-plugin-import/pull/1160
[#1035]: https://github.com/import-js/eslint-plugin-import/issues/1035
[#599]: https://github.com/import-js/eslint-plugin-import/pull/599
[@aladdin-add]: https://github.com/aladdin-add
[@arcanis]: https://github.com/arcanis
[@bradzacher]: https://github.com/bradzacher
[@brettz9]: https://github.com/brettz9
[@christophercurrie]: https://github.com/christophercurrie
[@DMartens]: https://github.com/DMartens
[@G-Rath]: https://github.com/G-Rath
[@hulkish]: https://github.com/hulkish
[@Hypnosphi]: https://github.com/Hypnosphi
[@iamnapo]: https://github.com/iamnapo
[@JoshuaKGoldberg]: https://github.com/JoshuaKGoldberg
[@JounQin]: https://github.com/JounQin
[@kaiyoma]: https://github.com/kaiyoma
[@leipert]: https://github.com/leipert
[@ljharb]: https://github.com/ljharb
[@manuth]: https://github.com/manuth
[@maxkomarychev]: https://github.com/maxkomarychev
[@mgwalker]: https://github.com/mgwalker
[@michaelfaith]: https://github.com/michaelfaith
[@Mysak0CZ]: https://github.com/Mysak0CZ
[@nicolo-ribaudo]: https://github.com/nicolo-ribaudo
[@pmcelhaney]: https://github.com/pmcelhaney
[@sergei-startsev]: https://github.com/sergei-startsev
[@silverwind]: https://github.com/silverwind
[@sompylasar]: https://github.com/sompylasar
[@timkraut]: https://github.com/timkraut
[@vikr01]: https://github.com/vikr01
[@VitusFW]: https://github.com/VitusFW
[@wmertens]: https://github.com/wmertens
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var searchRole = {
abstract: false,
accessibleNameRequired: false,
baseConcepts: [],
childrenPresentational: false,
nameFrom: ['author'],
prohibitedProps: [],
props: {},
relatedConcepts: [],
requireContextRole: [],
requiredContextRole: [],
requiredOwnedElements: [],
requiredProps: {},
superClass: [['roletype', 'structure', 'section', 'landmark']]
};
var _default = exports.default = searchRole;
@@ -0,0 +1 @@
{"version":3,"file":"parseCertInfo.d.ts","sourceRoot":"","sources":["../../../../src/registration/verifications/tpm/parseCertInfo.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,WAAW,GAAG,cAAc,CAkEnE;AAED,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,WAAW,CAAC;IAC7B,SAAS,EAAE,WAAW,CAAC;IACvB,SAAS,EAAE;QACT,KAAK,EAAE,WAAW,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;QACrB,IAAI,EAAE,OAAO,CAAC;KACf,CAAC;IACF,eAAe,EAAE,WAAW,CAAC;IAC7B,QAAQ,EAAE;QACR,OAAO,EAAE,MAAM,CAAC;QAChB,aAAa,EAAE,WAAW,CAAC;QAC3B,IAAI,EAAE,WAAW,CAAC;QAClB,aAAa,EAAE,WAAW,CAAC;KAC5B,CAAC;CACH,CAAC"}
@@ -0,0 +1,45 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/// <reference no-default-lib="true"/>
interface String {
/**
* Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.
* The padding is applied from the start (left) of the current string.
*
* @param maxLength The length of the resulting string once the current string has been padded.
* If this parameter is smaller than the current string's length, the current string will be returned as it is.
*
* @param fillString The string to pad the current string with.
* If this string is too long, it will be truncated and the left-most part will be applied.
* The default value for this parameter is " " (U+0020).
*/
padStart(maxLength: number, fillString?: string): string;
/**
* Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.
* The padding is applied from the end (right) of the current string.
*
* @param maxLength The length of the resulting string once the current string has been padded.
* If this parameter is smaller than the current string's length, the current string will be returned as it is.
*
* @param fillString The string to pad the current string with.
* If this string is too long, it will be truncated and the left-most part will be applied.
* The default value for this parameter is " " (U+0020).
*/
padEnd(maxLength: number, fillString?: string): string;
}
@@ -0,0 +1 @@
{"name":"array-buffer-byte-length","version":"1.0.2","requiresBuild":false,"files":{".eslintrc":{"checkedAt":1794532096468,"integrity":"sha512-65sGQaNVSNtfwNeKuco6m7Yb6f1cQALCGufke1qiInbq1AStVjYsa2/3/+ygoJSrmKQSYSxdmkF8aUyyWY1pvQ==","mode":420,"size":83},".nycrc":{"checkedAt":1794532089066,"integrity":"sha512-42sgwWzusJB1Dzhl78jX/Zg65Oi0HDDMOGXS/Uklv1kCYn4fHtRsD/JFPwdu+d40vome9XdUspzRWEQAcTGEeQ==","mode":420,"size":216},"LICENSE":{"checkedAt":1794532096468,"integrity":"sha512-NHFoVSGLgGbMEiVOo9qIXE1oZrVi3RO6KVB9XeEDen516TDX3VcytN7NubUc2qVrYB/KeYV+mqz6PbQYju2odg==","mode":420,"size":1067},"index.js":{"checkedAt":1794532096468,"integrity":"sha512-Ss4a3d2DQkhEeFnWbTmA8CNxe5wTFZhx0jyGV07oYzruQwePniGfebgUOmwPMcdmce7Z8C4iH10kCblFSeh+hA==","mode":420,"size":412},"test/index.js":{"checkedAt":1794532096468,"integrity":"sha512-XTCrW8qYddZ5Vxa4k6OrwZeZub0nGelqN7MnM2gc+r/qQCJ7mnAsRbHiu34v58r8GUZPPmTnJVUEt+W19eRXDg==","mode":420,"size":842},"package.json":{"checkedAt":1794532096468,"integrity":"sha512-/eu3GWbBq3Gbv1bhmWVTXMIyDlhUTNs66HC8JjpeU+EsMj+dOdpzMrXK4cHJHtJibYoRWYisQ+5V7LOcjOoMQg==","mode":420,"size":2530},"tsconfig.json":{"checkedAt":1794532096469,"integrity":"sha512-1lufEuoAIH39IDJsWr3hOBhkrerHgMjfg5Q6W0H7UalRhwrBKlDqC3Vgv4ncHUBPc2khrlqI60lZQKzaKRqbnQ==","mode":420,"size":125},"CHANGELOG.md":{"checkedAt":1794532096469,"integrity":"sha512-pPw9reqqyzIXz6JKER+vGcLz2vuaKN4t2UZrtbjs0QBVWUH24ptTCmRl5PwnoOfHoyv8+BzB8k4zRsASIyyjHQ==","mode":420,"size":3989},"README.md":{"checkedAt":1794532096469,"integrity":"sha512-ESTIpNdIMmSWkWCnHyksqqGqCvqA0kYzmg7yWlWqaIpXJzZVDoBodvMEDd+x1E9UVLpC2a6X28nu0KmZg09SEA==","mode":420,"size":1977},"index.d.ts":{"checkedAt":1794532096469,"integrity":"sha512-7OXc4Xh3GqFT1X73gA9cyKajeG564wtoEEumgeAWsso7yZHH1SBNYVrKeH4Rp9rLagYMHW2sIlELcC9QofdxSQ==","mode":420,"size":171},".github/FUNDING.yml":{"checkedAt":1794532096469,"integrity":"sha512-cfg22BwuXqYcWfS6geIX0JX6paiz4nv8GAe6717DtAY6alextJPHltKPfMhLBzoYWi9OvDrXlvMEqXGNNkIthQ==","mode":420,"size":595}}}
@@ -0,0 +1 @@
module.exports={C:{"4":0.02075,"103":0.04841,"115":0.02075,"120":0.02766,"128":0.00692,"136":0.01383,"139":0.03458,"140":0.02075,"141":0.00692,"142":0.03458,"143":1.1688,"144":0.29047,_:"2 3 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 121 122 123 124 125 126 127 129 130 131 132 133 134 135 137 138 145 146 147 3.5 3.6"},D:{"39":0.00692,"40":0.00692,"41":0.00692,"42":0.00692,"43":0.00692,"44":0.00692,"45":0.00692,"46":0.00692,"47":0.00692,"48":0.00692,"49":0.00692,"50":0.00692,"51":0.00692,"52":0.00692,"53":0.00692,"54":0.00692,"55":0.00692,"56":0.00692,"57":0.00692,"58":0.00692,"59":0.00692,"60":0.00692,"79":0.01383,"83":0.00692,"87":0.05533,"88":0.01383,"91":0.00692,"93":0.00692,"97":0.00692,"101":0.00692,"103":0.02075,"104":0.00692,"108":0.02766,"109":0.27664,"110":0.00692,"111":0.02766,"112":2.5935,"114":0.01383,"116":0.05533,"119":0.03458,"120":0.01383,"121":0.00692,"122":0.08991,"123":0.00692,"124":0.01383,"125":31.01134,"126":0.26281,"127":0.00692,"128":0.02766,"129":0.01383,"130":0.01383,"131":0.04841,"132":0.04841,"133":0.02075,"134":0.08991,"135":0.07608,"136":0.05533,"137":0.08299,"138":0.22823,"139":0.40113,"140":5.3599,"141":12.6632,"142":0.1314,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 84 85 86 89 90 92 94 95 96 98 99 100 102 105 106 107 113 115 117 118 143 144 145"},F:{"89":0.00692,"92":0.01383,"95":0.02766,"118":0.00692,"119":0.01383,"120":0.08299,"121":0.23514,"122":1.28638,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 90 91 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.00692,"109":0.01383,"114":0.26972,"126":0.00692,"127":0.08991,"131":0.00692,"132":0.00692,"133":0.00692,"134":0.02766,"135":0.00692,"136":0.00692,"137":0.00692,"138":0.02075,"139":0.02766,"140":0.69852,"141":3.6724,"142":0.00692,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 115 116 117 118 119 120 121 122 123 124 125 128 129 130"},E:{_:"0 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 13.1 15.1 15.2-15.3 15.4 15.5 16.0 16.2 17.0 26.2","14.1":0.00692,"15.6":0.06916,"16.1":0.00692,"16.3":0.00692,"16.4":0.05533,"16.5":0.00692,"16.6":0.16598,"17.1":0.03458,"17.2":0.01383,"17.3":0.02075,"17.4":0.02075,"17.5":0.08299,"17.6":0.08299,"18.0":0.00692,"18.1":0.01383,"18.2":0.07608,"18.3":0.07608,"18.4":0.06916,"18.5-18.6":0.2144,"26.0":0.6916,"26.1":0.02766},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00068,"5.0-5.1":0,"6.0-6.1":0.00273,"7.0-7.1":0.00204,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00613,"10.0-10.2":0.00068,"10.3":0.01159,"11.0-11.2":0.17175,"11.3-11.4":0.00409,"12.0-12.1":0.00136,"12.2-12.5":0.0334,"13.0-13.1":0,"13.2":0.00341,"13.3":0.00136,"13.4-13.7":0.00545,"14.0-14.4":0.01159,"14.5-14.8":0.01227,"15.0-15.1":0.01159,"15.2-15.3":0.00886,"15.4":0.01022,"15.5":0.01159,"15.6-15.8":0.15131,"16.0":0.02045,"16.1":0.03817,"16.2":0.01977,"16.3":0.03544,"16.4":0.00886,"16.5":0.01568,"16.6-16.7":0.20242,"17.0":0.01431,"17.1":0.02181,"17.2":0.01568,"17.3":0.02317,"17.4":0.04089,"17.5":0.0702,"17.6-17.7":0.17721,"18.0":0.04021,"18.1":0.08315,"18.2":0.04498,"18.3":0.14449,"18.4":0.07429,"18.5-18.6":3.78813,"26.0":0.46823,"26.1":0.01704},P:{"4":0.01041,"20":0.01041,"21":0.02082,"22":0.07287,"24":0.02082,"25":0.02082,"26":0.02082,"27":0.03123,"28":1.67608,"29":0.12493,_:"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.04164},I:{"0":0.0154,"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.10794,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.00692,_:"6 7 8 9 10 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.18504},Q:{_:"14.9"},O:{"0":0.04009},H:{"0":0},L:{"0":24.39219}};
@@ -0,0 +1,527 @@
flf2a$ 5 4 11 0 16 0 8256 0
Author : LG Beard
Date : 2004/4/9 13:04:21
Version: 1.0
-------------------------------------------------
-------------------------------------------------
This font has been created using JavE's FIGlet font export assistant.
Have a look at: http://www.jave.de
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $#
$ $#
$ $#
$ $#
$ $##
.-. #
| | #
{ } #
`-' #
##
.-..-. #
{ }{ } #
`-'`-' #
#
##
_ .-..-.#
{_/ // /}#
{/ // /_}#
`-'`-' #
##
.--//. #
{ {//-` #
.-//} } #
`//--' #
##
_ .-. #
{_}/ / _ #
\ }{_}#
`-' #
##
&#
#
#
#
##
.-. #
{ } #
`-' #
#
##
.'} #
/.' #
{ `. #
`-.} #
##
{`. #
`.\ #
.' } #
{.-' #
##
*#
#
#
#
##
_ #
_{ }_ #
{_ _} #
{_} #
##
#
#
_ #
/_} #
##
#
___ #
{___} #
#
##
#
#
_ #
{_} #
##
.-. #
/ / #
/ / #
`-' #
##
.---. #
. .-. . #
' `-' ' #
`---' #
##
.-. #
{ | #
| } #
`-' #
##
.---. #
`-`} } #
{ {.-. #
`---' #
##
.---. #
`-`} } #
.-.} } #
`----` #
##
.-. .-. #
\ \| | #
`-\ } #
`-' #
##
.---. #
{ {`-' #
.-.} } #
`---' #
##
.-. #
/ /. #
{ {} } #
`--' #
##
.---. #
`-`} } #
/ / #
`-' #
##
.--. #
{ {} } #
{ {} } #
`--' #
##
.--. #
{ {} } #
`/ / #
`-' #
##
_ #
{_} #
_ #
{_} #
##
_ #
{_} #
_ #
/_} #
##
.-. #
/ { #
\ { #
`-` #
##
___ #
{___} #
___ #
{___} #
##
.-. #
} \ #
} / #
'-' #
##
.---. #
`-`} } #
{ } #
`-' #
##
.----. #
/ .--. \#
|/ {} \|#
\`-'`-'/#
`----' ##
.--. #
/ {} \ #
/ /\ \ #
`-' `-' #
##
.----. #
| {_} } #
| {_} } #
`----' #
##
.----. #
| }`-' #
| },-. #
`----' #
##
.----. #
} {-. \ #
} '-} / #
`----' #
##
.----. #
} |__} #
} '__} #
`----' #
##
.----. #
} |__} #
} '_} #
`--' #
##
.----. #
| |--' #
| }-`} #
`----' #
##
.-. .-. #
{ {_} | #
| { } } #
`-' `-' #
##
.-. #
{ | #
| } #
`-' #
##
.-. #
| | #
{`-' } #
`---' #
##
.-..-. #
| ' / #
| . \ #
`-'`-` #
##
.-. #
} | #
} '--. #
`----' #
##
.-. .-. #
} \/ { #
| { } | #
`-' `-' #
##
.-. .-. #
| \{ | #
| }\ { #
`-' `-' #
##
.---. #
/ {-. \ #
\ '-} / #
`---' #
##
.-.-. #
| } }} #
| |-' #
`-' #
##
.---. #
/ {-. \ #
\ '-} { #
`--`-' #
##
.---. #
} }}_} #
| } \ #
`-'-' #
##
.----. #
{ {__-` #
.-._} } #
`----' #
##
.-----. #
`-' '-' #
} { #
`-' #
##
.-. .-. #
| } { | #
\ `-' / #
`---' #
##
.-. .-.#
\ \_/ / #
\ / #
`-' #
##
.-. .-. #
| { } | #
{ /\ } #
`-' `-' #
##
.-..-. #
\ {} / #
/ {} \ #
`-'`-' #
##
.-. .-. #
\ \/ / #
`-\ } #
`-' #
##
.---. #
`-`} } #
{ /.-. #
`---' #
##
.---, #
{ .-' #
{ `-. #
`---` #
##
.-. #
\ \ #
\ \ #
`-' #
##
.---. #
`-. } #
.-' } #
`---` #
##
.--. #
/ {} \ #
`-' `-' #
#
##
#
$ $ #
$ $ #
_______ #
{_______}##
.-. #
\ \ #
`-' #
$$ #
##
.--. #
/ {} \ #
/ /\ \ #
`-' `-' #
##
.----. #
| {_} } #
| {_} } #
`----' #
##
.----. #
| }`-' #
| },-. #
`----' #
##
.----. #
} {-. \ #
} '-} / #
`----' #
##
.----. #
} |__} #
} '__} #
`----' #
##
.----. #
} |__} #
} '_} #
`--' #
##
.----. #
| |--' #
| }-`} #
`----' #
##
.-. .-. #
{ {_} | #
| { } } #
`-' `-' #
##
.-. #
{ | #
| } #
`-' #
##
.-. #
| | #
{`-' } #
`---' #
##
.-..-. #
| ' / #
| . \ #
`-'`-` #
##
.-. #
} | #
} '--. #
`----' #
##
.-. .-. #
} \/ { #
| { } | #
`-' `-' #
##
.-. .-. #
| \{ | #
| }\ { #
`-' `-' #
##
.---. #
/ {-. \ #
\ '-} / #
`---' #
##
.-.-. #
| } }} #
| |-' #
`-' #
##
.---. #
/ {-. \ #
\ '-} { #
`--`-' #
##
.---. #
} }}_} #
| } \ #
`-'-' #
##
.----. #
{ {__-` #
.-._} } #
`----' #
##
.-----. #
`-' '-' #
} { #
`-' #
##
.-. .-. #
| } { | #
\ `-' / #
`---' #
##
.-. .-.#
\ \_/ / #
\ / #
`-' #
##
.-. .-. #
| { } | #
{ /\ } #
`-' `-' #
##
.-..-. #
\ {} / #
/ {} \ #
`-'`-' #
##
.-. .-. #
\ \/ / #
`-\ } #
`-' #
##
.---. #
`-`} } #
{ /.-. #
`---' #
##
.'} #
.'.' #
{ `. #
`-._} #
##
.-. #
{ } #
{ } #
`-' #
##
{`. #
`.`. #
.' } #
{_.-' #
##
#
{`-._ #
`-._} #
#
##
{}--{} #
/ {} \ #
/ /\ \ #
`-' `-' #
##
{_}-{_} #
/ {-. \ #
\ '-} / #
`---' #
##
{_} {_} #
| } { | #
\ `-' / #
`---' #
##
{}--{} #
/ {} \ #
/ /\ \ #
`-' `-' #
##
{_}-{_} #
/ {-. \ #
\ '-} / #
`---' #
##
{_} {_} #
| } { | #
\ `-' / #
`---' #
##
.----. #
| {_} } #
| {_} } #
| |--' #
`-' ##
@@ -0,0 +1,52 @@
{
"name": "@heroui/react-utils",
"version": "2.1.14",
"description": "A set of utilities for react on client side",
"keywords": [
"react-utils"
],
"author": "HeroUI <support@heroui.com>",
"homepage": "https://heroui.com",
"license": "MIT",
"main": "dist/index.js",
"sideEffects": false,
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/heroui-inc/heroui.git",
"directory": "packages/utilities/react-utils"
},
"bugs": {
"url": "https://github.com/heroui-inc/heroui/issues"
},
"peerDependencies": {
"react": ">=18 || >=19.0.0-rc.0"
},
"dependencies": {
"@heroui/shared-utils": "2.1.12",
"@heroui/react-rsc-utils": "2.1.9"
},
"clean-package": "../../../clean-package.config.json",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./package.json": "./package.json"
},
"scripts": {
"build": "tsup src --dts",
"build:fast": "tsup src",
"dev": "pnpm build:fast --watch",
"clean": "rimraf dist .turbo",
"typecheck": "tsc --noEmit"
}
}
@@ -0,0 +1,27 @@
'use strict';
const {deserialize} = require('./deserialize.js');
const {serialize} = require('./serialize.js');
/**
* @typedef {Array<string,any>} Record a type representation
*/
/**
* Returns an array of serialized Records.
* @param {any} any a serializable value.
* @param {{transfer?: any[], json?: boolean, lossy?: boolean}?} options an object with
* a transfer option (ignored when polyfilled) and/or non standard fields that
* fallback to the polyfill if present.
* @returns {Record[]}
*/
Object.defineProperty(exports, '__esModule', {value: true}).default = typeof structuredClone === "function" ?
/* c8 ignore start */
(any, options) => (
options && ('json' in options || 'lossy' in options) ?
deserialize(serialize(any, options)) : structuredClone(any)
) :
(any, options) => deserialize(serialize(any, options));
/* c8 ignore stop */
exports.deserialize = deserialize;
exports.serialize = serialize;
@@ -0,0 +1 @@
{"version":3,"file":"resolveSingletonScopedBinding.js","sourceRoot":"","sources":["../../../../src/resolution/actions/resolveSingletonScopedBinding.ts"],"names":[],"mappings":";;AAQA,sEA8BC;AAjCD,6DAA0D;AAC1D,2EAAwE;AAExE,SAAgB,6BAA6B,CAS3C,OAGyB;IAEzB,OAAO,CACL,MAAwB,EACxB,OAAiB,EACK,EAAE;QACxB,IAAI,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YAC1B,OAAO,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;QAC7B,CAAC;QAED,MAAM,aAAa,GAAyB,IAAA,qDAAyB,EACnE,MAAM,EACN,OAAO,EACP,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CACzB,CAAC;QAEF,OAAO,IAAA,uCAAkB,EAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IACpD,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1 @@
{"name":"@react-stately/checkbox","version":"3.6.10","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532107818,"integrity":"sha512-cil7stSp3ik41Hdv2Dj+GMcbvUfs1q+MZ2Yte0804py9i6oJJN/diCiIr/brcQOZ5ZqwAI6dgaHA7l8FZheQBw==","mode":420,"size":11335},"dist/main.js":{"checkedAt":1794532107818,"integrity":"sha512-Ee3ROvpLBWp3l0iNOLa2Za0C1X1zMMNxQ/VhjGharrdQK5dE/34NTr9nVreLNvUMqtOcIFaaMIVqis/3ccxMjQ==","mode":420,"size":974},"dist/module.js":{"checkedAt":1794532107818,"integrity":"sha512-K69TA3M0ICA/pvPaCHo/oxfyATaNvC1iPu3AT0gl7Jof8ql+f/+DDDHcnu18286jhrS2KwrVvHMMZfWVqeIeaw==","mode":420,"size":854},"dist/useCheckboxGroupState.main.js":{"checkedAt":1794532107819,"integrity":"sha512-Qscjr0stCrCvksmq/XfzmK6sKohFKlZpzvwcirRxKPrw9hFlJXr4O9Fg7XwHmNIiQG05/zRZc8YxhImXSQoxkA==","mode":420,"size":3309},"dist/useCheckboxGroupState.module.js":{"checkedAt":1794532107819,"integrity":"sha512-ODrl7hu1hLsQNog9QDDcXeHjP5nV4uSc3Ec3cMTV1+ucBc4Fa7bVSeSDxxxg3NuXE3qQngnIaCsx/V6luuZSbQ==","mode":420,"size":3201},"package.json":{"checkedAt":1794532107819,"integrity":"sha512-uej8L8eUMVnv7YKmjsTuLa9bazTrxmQefEczWD8hBm3biHXvBuuTECHO5Vd68LZOGc8k2pr+XoPv137fplYjwg==","mode":420,"size":944},"dist/main.js.map":{"checkedAt":1794532107819,"integrity":"sha512-35RA9ZDTNK+7Mi8mbLzGmHIblWYr3RIc6dcPIZa1OGNy+llruhg4Bvx3e7r7osTnwodVVGS3Ru1Hmii1LDTC5g==","mode":420,"size":1000},"dist/module.js.map":{"checkedAt":1794532107819,"integrity":"sha512-x7Wm5WQlDhecZTA5tH4EYYqf99AptbyDdgv6LAUVtGBpZgN6E4mafDPZp12iuTFNthK+8XiDDesPZwyRUGAn1g==","mode":420,"size":996},"dist/types.d.ts.map":{"checkedAt":1794532107819,"integrity":"sha512-OhYadqADhzTaX2UkHqHuIosM9aiYOWw67i+e3Evedn5pLJvPyVTPQW+gSRUGZnYjgFvlOcHyV8GTj6wK+5XFxQ==","mode":420,"size":2004},"dist/useCheckboxGroupState.main.js.map":{"checkedAt":1794532107820,"integrity":"sha512-E598Me0EPAutr5JWVZ2k/wPoC6rSQYs/LYhQeO+hqEfGje6sEVDvRINrBdj5mlYz3LIaLjafem2pRJ7e6WUN/g==","mode":420,"size":5998},"dist/useCheckboxGroupState.module.js.map":{"checkedAt":1794532107820,"integrity":"sha512-tkdEB8hQ0Mj9CidWAGq6FRdPNqwGviuRHl1LDtu+hKEoL9dPCMO8FAFCxq3udH82tFeDGCvnBtT2BPvYLcUI0Q==","mode":420,"size":5993},"README.md":{"checkedAt":1794532107820,"integrity":"sha512-/LBn/8l5vcddBGTShGLbO/X0HoizjUmNORY+Wt1GzJ+fk0QLGCTZHrUCmiadAe2kyPjc3LlzJynmDMh2oEjkXQ==","mode":420,"size":141},"dist/import.mjs":{"checkedAt":1794532107820,"integrity":"sha512-IMIin0/TZsHk/PZ4zO5Xip2q+sZQBTK9zKin6Iox2+VO7JpbBOo7J2WLPJThekpD7HbaFwuzDZxiPo4IBAv+Yw==","mode":420,"size":848},"dist/useCheckboxGroupState.mjs":{"checkedAt":1794532107819,"integrity":"sha512-ODrl7hu1hLsQNog9QDDcXeHjP5nV4uSc3Ec3cMTV1+ucBc4Fa7bVSeSDxxxg3NuXE3qQngnIaCsx/V6luuZSbQ==","mode":420,"size":3201},"src/index.ts":{"checkedAt":1794532107820,"integrity":"sha512-CY4kR5bfbpGWs+b7mC1361FVYMjQP5aSFSPB0DDE45xTDNO4AnN3NVAQkxEZB2yBW2DqBXjIB+adxp0vJRYHdg==","mode":420,"size":813},"dist/types.d.ts":{"checkedAt":1794532107820,"integrity":"sha512-GWbNSVjswh/MC+5U9PgSVbhimwz+ARahufx+FELWdcKi8IhC/W72SrHK2dOhGREuxPvAIn20ofmUnNTWABSOXw==","mode":420,"size":1844},"src/useCheckboxGroupState.ts":{"checkedAt":1794532107821,"integrity":"sha512-hIkXjDR+quTgx7jqTubMNrkJoipipa/abMMIyM0AYarjZpebltZgWyRbOQC/XwMaE09ZwrZDSJmBhV7LrL+dUQ==","mode":420,"size":4372}}}
@@ -0,0 +1,41 @@
// src/utils/object.ts
import flatten from "flat";
function swapColorValues(colors) {
const swappedColors = {};
const keys = Object.keys(colors);
const length = keys.length;
for (let i = 0; i < length / 2; i++) {
const key1 = keys[i];
const key2 = keys[length - 1 - i];
swappedColors[key1] = colors[key2];
swappedColors[key2] = colors[key1];
}
if (length % 2 !== 0) {
const middleKey = keys[Math.floor(length / 2)];
swappedColors[middleKey] = colors[middleKey];
}
return swappedColors;
}
function removeDefaultKeys(obj) {
const newObj = {};
for (const key in obj) {
if (key.endsWith("-DEFAULT")) {
newObj[key.replace("-DEFAULT", "")] = obj[key];
continue;
}
newObj[key] = obj[key];
}
return newObj;
}
var flattenThemeObject = (obj) => removeDefaultKeys(
flatten(obj, {
safe: true,
delimiter: "-"
})
);
export {
swapColorValues,
removeDefaultKeys,
flattenThemeObject
};
@@ -0,0 +1 @@
{"name":"vinyl","version":"2.2.1","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532123762,"integrity":"sha512-ojA5DRFerHztVRQUHPsmxbRxmc+Qi4TPK/Ld4qwVvvhVKd33l7c8ul/oDrwfdTfvO4R+ZNzDL6Fce8IQG+cnpg==","mode":420,"size":1164},"index.js":{"checkedAt":1794532123762,"integrity":"sha512-D3/FMLX2HjxXI9A1gbsTi2mLJPbm75zvoxIAfd/SX8OlaZg3LLztRgXpGbcTw/BYORFssP2frQYYJsQ/3WsSuw==","mode":420,"size":8056},"lib/inspect-stream.js":{"checkedAt":1794532123762,"integrity":"sha512-qzuT3bPIpCZgn5yaS3lAP91+n+3hJTC8COFTHKA0kS05kTGP/IYM2oIksDdTWELdhzuVnhTRVqQ5AS85x+JVEA==","mode":420,"size":249},"lib/is-stream.js":{"checkedAt":1794532123762,"integrity":"sha512-qsExKtUh+72slNJsh6MRdJVKB8eLBjg1KjafAfwTBAvoZNhwfHqxdaM4hTwffpq4aywe+Swq3THpex8czz6e8w==","mode":420,"size":194},"lib/normalize.js":{"checkedAt":1794532123762,"integrity":"sha512-qeS2axmh2cZzS/dByA+RNKrEJHYhWyaGx9rDcqJ0fJegP7kllm7L+4F07Qlm0z2ur+zyqWIRZ86WXEeqEtpnSA==","mode":420,"size":150},"package.json":{"checkedAt":1794532123762,"integrity":"sha512-JUlRo8ZCnLcBkFyRfJHU2hsh5zTlToTSYWxo//NHY/hD3dl9uqNaeq+fhaUIUw7m5CRs4zI0YHetWfYkUY2GdA==","mode":420,"size":1290},"README.md":{"checkedAt":1794532123762,"integrity":"sha512-K/Te6qJfs/ZVxI8IfhIKIx8eRrTLJIZ6V+8cJ4TJdwLmmDuYlEXWKVZDI9mUlDMjg266tum3dWYTo84s3iEpeA==","mode":420,"size":13420}}}
@@ -0,0 +1,374 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BindInWhenOnFluentSyntaxImplementation = exports.BindWhenOnFluentSyntaxImplementation = exports.BindWhenFluentSyntaxImplementation = exports.BindOnFluentSyntaxImplementation = exports.BindToFluentSyntaxImplementation = exports.BindInFluentSyntaxImplementation = void 0;
const common_1 = require("@inversifyjs/common");
const core_1 = require("@inversifyjs/core");
const core_2 = require("@inversifyjs/core");
const BindingConstraintUtils_1 = require("../../container/binding/utils/BindingConstraintUtils");
const InversifyContainerError_1 = require("../../error/models/InversifyContainerError");
const InversifyContainerErrorKind_1 = require("../../error/models/InversifyContainerErrorKind");
const buildBindingIdentifier_1 = require("../calculations/buildBindingIdentifier");
const isAnyAncestorBindingConstraints_1 = require("../calculations/isAnyAncestorBindingConstraints");
const isAnyAncestorBindingConstraintsWithName_1 = require("../calculations/isAnyAncestorBindingConstraintsWithName");
const isAnyAncestorBindingConstraintsWithServiceId_1 = require("../calculations/isAnyAncestorBindingConstraintsWithServiceId");
const isAnyAncestorBindingConstraintsWithTag_1 = require("../calculations/isAnyAncestorBindingConstraintsWithTag");
const isBindingConstraintsWithName_1 = require("../calculations/isBindingConstraintsWithName");
const isBindingConstraintsWithNoNameNorTags_1 = require("../calculations/isBindingConstraintsWithNoNameNorTags");
const isBindingConstraintsWithTag_1 = require("../calculations/isBindingConstraintsWithTag");
const isMultipleResolvedValueMetadataInjectOptions_1 = require("../calculations/isMultipleResolvedValueMetadataInjectOptions");
const isNoAncestorBindingConstraints_1 = require("../calculations/isNoAncestorBindingConstraints");
const isNoAncestorBindingConstraintsWithName_1 = require("../calculations/isNoAncestorBindingConstraintsWithName");
const isNoAncestorBindingConstraintsWithServiceId_1 = require("../calculations/isNoAncestorBindingConstraintsWithServiceId");
const isNoAncestorBindingConstraintsWithTag_1 = require("../calculations/isNoAncestorBindingConstraintsWithTag");
const isNotParentBindingConstraints_1 = require("../calculations/isNotParentBindingConstraints");
const isNotParentBindingConstraintsWithName_1 = require("../calculations/isNotParentBindingConstraintsWithName");
const isNotParentBindingConstraintsWithServiceId_1 = require("../calculations/isNotParentBindingConstraintsWithServiceId");
const isNotParentBindingConstraintsWithTag_1 = require("../calculations/isNotParentBindingConstraintsWithTag");
const isParentBindingConstraints_1 = require("../calculations/isParentBindingConstraints");
const isParentBindingConstraintsWithName_1 = require("../calculations/isParentBindingConstraintsWithName");
const isParentBindingConstraintsWithServiceId_1 = require("../calculations/isParentBindingConstraintsWithServiceId");
const isParentBindingConstraintsWithTag_1 = require("../calculations/isParentBindingConstraintsWithTag");
const isResolvedValueMetadataInjectOptions_1 = require("../calculations/isResolvedValueMetadataInjectOptions");
class BindInFluentSyntaxImplementation {
#binding;
constructor(binding) {
this.#binding = binding;
}
getIdentifier() {
return (0, buildBindingIdentifier_1.buildBindingIdentifier)(this.#binding);
}
inRequestScope() {
this.#binding.scope = core_1.bindingScopeValues.Request;
return new BindWhenOnFluentSyntaxImplementation(this.#binding);
}
inSingletonScope() {
this.#binding.scope = core_1.bindingScopeValues.Singleton;
return new BindWhenOnFluentSyntaxImplementation(this.#binding);
}
inTransientScope() {
this.#binding.scope = core_1.bindingScopeValues.Transient;
return new BindWhenOnFluentSyntaxImplementation(this.#binding);
}
}
exports.BindInFluentSyntaxImplementation = BindInFluentSyntaxImplementation;
class BindToFluentSyntaxImplementation {
#callback;
#containerModuleId;
#defaultScope;
#serviceIdentifier;
constructor(callback, containerModuleId, defaultScope, serviceIdentifier) {
this.#callback = callback;
this.#containerModuleId = containerModuleId;
this.#defaultScope = defaultScope;
this.#serviceIdentifier = serviceIdentifier;
}
to(type) {
const classMetadata = (0, core_1.getClassMetadata)(type);
const binding = {
cache: {
isRight: false,
value: undefined,
},
id: (0, core_2.getBindingId)(),
implementationType: type,
isSatisfiedBy: BindingConstraintUtils_1.BindingConstraintUtils.always,
moduleId: this.#containerModuleId,
onActivation: undefined,
onDeactivation: undefined,
scope: classMetadata.scope ?? this.#defaultScope,
serviceIdentifier: this.#serviceIdentifier,
type: core_1.bindingTypeValues.Instance,
};
this.#callback(binding);
return new BindInWhenOnFluentSyntaxImplementation(binding);
}
toSelf() {
if (typeof this.#serviceIdentifier !== 'function') {
throw new Error('"toSelf" function can only be applied when a newable function is used as service identifier');
}
return this.to(this.#serviceIdentifier);
}
toConstantValue(value) {
const binding = {
cache: {
isRight: false,
value: undefined,
},
id: (0, core_2.getBindingId)(),
isSatisfiedBy: BindingConstraintUtils_1.BindingConstraintUtils.always,
moduleId: this.#containerModuleId,
onActivation: undefined,
onDeactivation: undefined,
scope: core_1.bindingScopeValues.Singleton,
serviceIdentifier: this.#serviceIdentifier,
type: core_1.bindingTypeValues.ConstantValue,
value: value,
};
this.#callback(binding);
return new BindWhenOnFluentSyntaxImplementation(binding);
}
toDynamicValue(builder) {
const binding = {
cache: {
isRight: false,
value: undefined,
},
id: (0, core_2.getBindingId)(),
isSatisfiedBy: BindingConstraintUtils_1.BindingConstraintUtils.always,
moduleId: this.#containerModuleId,
onActivation: undefined,
onDeactivation: undefined,
scope: this.#defaultScope,
serviceIdentifier: this.#serviceIdentifier,
type: core_1.bindingTypeValues.DynamicValue,
value: builder,
};
this.#callback(binding);
return new BindInWhenOnFluentSyntaxImplementation(binding);
}
toResolvedValue(factory, injectOptions) {
const binding = {
cache: {
isRight: false,
value: undefined,
},
factory,
id: (0, core_2.getBindingId)(),
isSatisfiedBy: BindingConstraintUtils_1.BindingConstraintUtils.always,
metadata: this.#buildResolvedValueMetadata(injectOptions),
moduleId: this.#containerModuleId,
onActivation: undefined,
onDeactivation: undefined,
scope: this.#defaultScope,
serviceIdentifier: this.#serviceIdentifier,
type: core_1.bindingTypeValues.ResolvedValue,
};
this.#callback(binding);
return new BindInWhenOnFluentSyntaxImplementation(binding);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
toFactory(builder) {
const binding = {
cache: {
isRight: false,
value: undefined,
},
factory: builder,
id: (0, core_2.getBindingId)(),
isSatisfiedBy: BindingConstraintUtils_1.BindingConstraintUtils.always,
moduleId: this.#containerModuleId,
onActivation: undefined,
onDeactivation: undefined,
scope: core_1.bindingScopeValues.Singleton,
serviceIdentifier: this.#serviceIdentifier,
type: core_1.bindingTypeValues.Factory,
};
this.#callback(binding);
return new BindWhenOnFluentSyntaxImplementation(binding);
}
/**
* @deprecated Use `toFactory()` instead. Providers will be removed in v8.
* Providers exist for historical reasons from v5 when async dependencies weren't supported.
* Factories are more flexible and can handle both sync and async operations.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-deprecated
toProvider(provider) {
// eslint-disable-next-line @typescript-eslint/no-deprecated
const binding = {
cache: {
isRight: false,
value: undefined,
},
id: (0, core_2.getBindingId)(),
isSatisfiedBy: BindingConstraintUtils_1.BindingConstraintUtils.always,
moduleId: this.#containerModuleId,
onActivation: undefined,
onDeactivation: undefined,
provider,
scope: core_1.bindingScopeValues.Singleton,
serviceIdentifier: this.#serviceIdentifier,
type: core_1.bindingTypeValues.Provider,
};
this.#callback(binding);
return new BindWhenOnFluentSyntaxImplementation(binding);
}
toService(service) {
const binding = {
id: (0, core_2.getBindingId)(),
isSatisfiedBy: BindingConstraintUtils_1.BindingConstraintUtils.always,
moduleId: this.#containerModuleId,
serviceIdentifier: this.#serviceIdentifier,
targetServiceIdentifier: service,
type: core_1.bindingTypeValues.ServiceRedirection,
};
this.#callback(binding);
}
#buildResolvedValueMetadata(options) {
const resolvedValueMetadata = {
arguments: (options ?? []).map((injectOption) => {
if ((0, isResolvedValueMetadataInjectOptions_1.isResolvedValueMetadataInjectOptions)(injectOption)) {
if ((0, isMultipleResolvedValueMetadataInjectOptions_1.isMultipleResolvedValueMetadataInjectOptions)(injectOption)) {
return {
chained: injectOption.chained ?? false,
kind: core_1.ResolvedValueElementMetadataKind.multipleInjection,
name: injectOption.name,
optional: injectOption.optional ?? false,
tags: new Map((injectOption.tags ?? []).map((tag) => [
tag.key,
tag.value,
])),
value: injectOption.serviceIdentifier,
};
}
else {
return {
kind: core_1.ResolvedValueElementMetadataKind.singleInjection,
name: injectOption.name,
optional: injectOption.optional ?? false,
tags: new Map((injectOption.tags ?? []).map((tag) => [
tag.key,
tag.value,
])),
value: injectOption.serviceIdentifier,
};
}
}
else {
return {
kind: core_1.ResolvedValueElementMetadataKind.singleInjection,
name: undefined,
optional: false,
tags: new Map(),
value: injectOption,
};
}
}),
};
return resolvedValueMetadata;
}
}
exports.BindToFluentSyntaxImplementation = BindToFluentSyntaxImplementation;
class BindOnFluentSyntaxImplementation {
#binding;
constructor(binding) {
this.#binding = binding;
}
getIdentifier() {
return (0, buildBindingIdentifier_1.buildBindingIdentifier)(this.#binding);
}
onActivation(activation) {
this.#binding.onActivation = activation;
return new BindWhenFluentSyntaxImplementation(this.#binding);
}
onDeactivation(deactivation) {
this.#binding.onDeactivation = deactivation;
if (this.#binding.scope !== core_1.bindingScopeValues.Singleton) {
throw new InversifyContainerError_1.InversifyContainerError(InversifyContainerErrorKind_1.InversifyContainerErrorKind.invalidOperation, `Binding for service "${(0, common_1.stringifyServiceIdentifier)(this.#binding.serviceIdentifier)}" has a deactivation function, but its scope is not singleton. Deactivation functions can only be used with singleton bindings.`);
}
return new BindWhenFluentSyntaxImplementation(this.#binding);
}
}
exports.BindOnFluentSyntaxImplementation = BindOnFluentSyntaxImplementation;
class BindWhenFluentSyntaxImplementation {
#binding;
constructor(binding) {
this.#binding = binding;
}
getIdentifier() {
return (0, buildBindingIdentifier_1.buildBindingIdentifier)(this.#binding);
}
when(constraint) {
this.#binding.isSatisfiedBy = constraint;
return new BindOnFluentSyntaxImplementation(this.#binding);
}
whenAnyAncestor(constraint) {
return this.when((0, isAnyAncestorBindingConstraints_1.isAnyAncestorBindingConstraints)(constraint));
}
whenAnyAncestorIs(serviceIdentifier) {
return this.when((0, isAnyAncestorBindingConstraintsWithServiceId_1.isAnyAncestorBindingConstraintsWithServiceId)(serviceIdentifier));
}
whenAnyAncestorNamed(name) {
return this.when((0, isAnyAncestorBindingConstraintsWithName_1.isAnyAncestorBindingConstraintsWithName)(name));
}
whenAnyAncestorTagged(tag, tagValue) {
return this.when((0, isAnyAncestorBindingConstraintsWithTag_1.isAnyAncestorBindingConstraintsWithTag)(tag, tagValue));
}
whenDefault() {
return this.when(isBindingConstraintsWithNoNameNorTags_1.isBindingConstraintsWithNoNameNorTags);
}
whenNamed(name) {
return this.when((0, isBindingConstraintsWithName_1.isBindingConstraintsWithName)(name));
}
whenNoParent(constraint) {
return this.when((0, isNotParentBindingConstraints_1.isNotParentBindingConstraints)(constraint));
}
whenNoParentIs(serviceIdentifier) {
return this.when((0, isNotParentBindingConstraintsWithServiceId_1.isNotParentBindingConstraintsWithServiceId)(serviceIdentifier));
}
whenNoParentNamed(name) {
return this.when((0, isNotParentBindingConstraintsWithName_1.isNotParentBindingConstraintsWithName)(name));
}
whenNoParentTagged(tag, tagValue) {
return this.when((0, isNotParentBindingConstraintsWithTag_1.isNotParentBindingConstraintsWithTag)(tag, tagValue));
}
whenParent(constraint) {
return this.when((0, isParentBindingConstraints_1.isParentBindingConstraints)(constraint));
}
whenParentIs(serviceIdentifier) {
return this.when((0, isParentBindingConstraintsWithServiceId_1.isParentBindingConstraintsWithServiceId)(serviceIdentifier));
}
whenParentNamed(name) {
return this.when((0, isParentBindingConstraintsWithName_1.isParentBindingConstraintsWithName)(name));
}
whenParentTagged(tag, tagValue) {
return this.when((0, isParentBindingConstraintsWithTag_1.isParentBindingConstraintsWithTag)(tag, tagValue));
}
whenTagged(tag, tagValue) {
return this.when((0, isBindingConstraintsWithTag_1.isBindingConstraintsWithTag)(tag, tagValue));
}
whenNoAncestor(constraint) {
return this.when((0, isNoAncestorBindingConstraints_1.isNoAncestorBindingConstraints)(constraint));
}
whenNoAncestorIs(serviceIdentifier) {
return this.when((0, isNoAncestorBindingConstraintsWithServiceId_1.isNoAncestorBindingConstraintsWithServiceId)(serviceIdentifier));
}
whenNoAncestorNamed(name) {
return this.when((0, isNoAncestorBindingConstraintsWithName_1.isNoAncestorBindingConstraintsWithName)(name));
}
whenNoAncestorTagged(tag, tagValue) {
return this.when((0, isNoAncestorBindingConstraintsWithTag_1.isNoAncestorBindingConstraintsWithTag)(tag, tagValue));
}
}
exports.BindWhenFluentSyntaxImplementation = BindWhenFluentSyntaxImplementation;
class BindWhenOnFluentSyntaxImplementation extends BindWhenFluentSyntaxImplementation {
#bindOnFluentSyntax;
constructor(binding) {
super(binding);
this.#bindOnFluentSyntax = new BindOnFluentSyntaxImplementation(binding);
}
onActivation(activation) {
return this.#bindOnFluentSyntax.onActivation(activation);
}
onDeactivation(deactivation) {
return this.#bindOnFluentSyntax.onDeactivation(deactivation);
}
}
exports.BindWhenOnFluentSyntaxImplementation = BindWhenOnFluentSyntaxImplementation;
class BindInWhenOnFluentSyntaxImplementation extends BindWhenOnFluentSyntaxImplementation {
#bindInFluentSyntax;
constructor(binding) {
super(binding);
this.#bindInFluentSyntax = new BindInFluentSyntaxImplementation(binding);
}
inRequestScope() {
return this.#bindInFluentSyntax.inRequestScope();
}
inSingletonScope() {
return this.#bindInFluentSyntax.inSingletonScope();
}
inTransientScope() {
return this.#bindInFluentSyntax.inTransientScope();
}
}
exports.BindInWhenOnFluentSyntaxImplementation = BindInWhenOnFluentSyntaxImplementation;
//# sourceMappingURL=BindingFluentSyntaxImplementation.js.map
@@ -0,0 +1,40 @@
'use strict';
var $TypeError = require('es-errors/type');
var isNaN = require('../../helpers/isNaN');
// https://262.ecma-international.org/11.0/#sec-numeric-types-number-add
module.exports = function NumberAdd(x, y) {
if (typeof x !== 'number' || typeof y !== 'number') {
throw new $TypeError('Assertion failed: `x` and `y` arguments must be Numbers');
}
if (isNaN(x) || isNaN(y) || (x === Infinity && y === -Infinity) || (x === -Infinity && y === Infinity)) {
return NaN;
}
if ((x === Infinity && y === Infinity) || (x === -Infinity && y === -Infinity)) {
return x;
}
if (x === Infinity) {
return x;
}
if (y === Infinity) {
return y;
}
if (x === y && x === 0) {
return Infinity / x === -Infinity && Infinity / y === -Infinity ? -0 : +0;
}
if (x === -y || -x === y) {
return +0;
}
// shortcut for the actual spec mechanics
return x + y;
};
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = eot2base64;
var _bytes2base = _interopRequireDefault(require("./util/bytes2base64"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* @file eot数组转base64编码
* @author mengke01(kekee000@gmail.com)
*/
/**
* eot数组转base64编码
*
* @param {Array} arrayBuffer ArrayBuffer对象
* @return {string} base64编码
*/
function eot2base64(arrayBuffer) {
return 'data:font/eot;charset=utf-8;base64,' + (0, _bytes2base.default)(arrayBuffer);
}
@@ -0,0 +1,80 @@
/**
* Copyright (c) 2021 The xterm.js authors. All rights reserved.
* @license MIT
*/
// 'rgb:' rule - matching: r/g/b | rr/gg/bb | rrr/ggg/bbb | rrrr/gggg/bbbb (hex digits)
const RGB_REX = /^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/;
// '#...' rule - matching any hex digits
const HASH_REX = /^[\da-f]+$/;
/**
* Parse color spec to RGB values (8 bit per channel).
* See `man xparsecolor` for details about certain format specifications.
*
* Supported formats:
* - rgb:<red>/<green>/<blue> with <red>, <green>, <blue> in h | hh | hhh | hhhh
* - #RGB, #RRGGBB, #RRRGGGBBB, #RRRRGGGGBBBB
*
* All other formats like rgbi: or device-independent string specifications
* with float numbering are not supported.
*/
export function parseColor(data: string): [number, number, number] | undefined {
if (!data) return;
// also handle uppercases
let low = data.toLowerCase();
if (low.indexOf('rgb:') === 0) {
// 'rgb:' specifier
low = low.slice(4);
const m = RGB_REX.exec(low);
if (m) {
const base = m[1] ? 15 : m[4] ? 255 : m[7] ? 4095 : 65535;
return [
Math.round(parseInt(m[1] || m[4] || m[7] || m[10], 16) / base * 255),
Math.round(parseInt(m[2] || m[5] || m[8] || m[11], 16) / base * 255),
Math.round(parseInt(m[3] || m[6] || m[9] || m[12], 16) / base * 255)
];
}
} else if (low.indexOf('#') === 0) {
// '#' specifier
low = low.slice(1);
if (HASH_REX.exec(low) && [3, 6, 9, 12].includes(low.length)) {
const adv = low.length / 3;
const result: [number, number, number] = [0, 0, 0];
for (let i = 0; i < 3; ++i) {
const c = parseInt(low.slice(adv * i, adv * i + adv), 16);
result[i] = adv === 1 ? c << 4 : adv === 2 ? c : adv === 3 ? c >> 4 : c >> 8;
}
return result;
}
}
// Named colors are currently not supported due to the large addition to the xterm.js bundle size
// they would add. In order to support named colors, we would need some way of optionally loading
// additional payloads so startup/download time is not bloated (see #3530).
}
// pad hex output to requested bit width
function pad(n: number, bits: number): string {
const s = n.toString(16);
const s2 = s.length < 2 ? '0' + s : s;
switch (bits) {
case 4:
return s[0];
case 8:
return s2;
case 12:
return (s2 + s2).slice(0, 3);
default:
return s2 + s2;
}
}
/**
* Convert a given color to rgb:../../.. string of `bits` depth.
*/
export function toRgbString(color: [number, number, number], bits: number = 16): string {
const [r, g, b] = color;
return `rgb:${pad(r, bits)}/${pad(g, bits)}/${pad(b, bits)}`;
}
@@ -0,0 +1,46 @@
import * as react from 'react';
import { MouseEventHandler } from 'react';
import * as _heroui_system from '@heroui/system';
import { PropGetter, HTMLHeroUIProps } from '@heroui/system';
import { AriaLinkProps } from '@react-types/link';
import { LinkVariantProps } from '@heroui/theme';
import { ReactRef } from '@heroui/react-utils';
interface Props extends HTMLHeroUIProps<"a">, LinkVariantProps {
/**
* Ref to the DOM node.
*/
ref?: ReactRef<HTMLAnchorElement | null>;
/**
* Whether the link is external.
* @default false
*/
isExternal?: boolean;
/**
* Whether to show the icon when the link is external.
* @default false
*/
showAnchorIcon?: boolean;
/**
* The icon to display right after the link.
* @default <LinkIcon />
*/
anchorIcon?: React.ReactNode;
/**
* The native link click event handler.
* use `onPress` instead.
* @deprecated
*/
onClick?: MouseEventHandler<HTMLAnchorElement>;
}
type UseLinkProps = Props & AriaLinkProps;
declare function useLink(originalProps: UseLinkProps): {
Component: _heroui_system.As<any>;
children: react.ReactNode;
anchorIcon: react.ReactNode;
showAnchorIcon: boolean;
getLinkProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
};
type UseLinkReturn = ReturnType<typeof useLink>;
export { UseLinkProps, UseLinkReturn, useLink };
@@ -0,0 +1 @@
{"version":3,"file":"Binding.d.ts","sourceRoot":"","sources":["../../../../src/binding/models/Binding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAGxE,MAAM,MAAM,OAAO,CAAC,UAAU,GAAG,GAAG,IAChC,oBAAoB,CAAC,UAAU,CAAC,GAChC,mBAAmB,CAAC,UAAU,CAAC,GAC/B,CAAC,UAAU,SAAS,OAAO,CAAC,OAAO,CAAC,GAAG,cAAc,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,GAC1E,eAAe,CAAC,UAAU,CAAC,GAC3B,CAAC,UAAU,SAAS,QAAQ,CAAC,OAAO,CAAC,GAAG,eAAe,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,GAC5E,oBAAoB,CAAC,UAAU,CAAC,GAChC,yBAAyB,CAAC,UAAU,CAAC,CAAC"}
@@ -0,0 +1,38 @@
'use strict';
var $TypeError = require('es-errors/type');
var callBound = require('call-bound');
var $charCodeAt = callBound('String.prototype.charCodeAt');
var $toUpperCase = callBound('String.prototype.toUpperCase');
// https://262.ecma-international.org/5.1/#sec-15.10.2.8
module.exports = function Canonicalize(ch, IgnoreCase) {
if (typeof ch !== 'string' || ch.length !== 1) {
throw new $TypeError('Assertion failed: `ch` must be a character');
}
if (typeof IgnoreCase !== 'boolean') {
throw new $TypeError('Assertion failed: `IgnoreCase` must be a Boolean');
}
if (!IgnoreCase) {
return ch; // step 1
}
var u = $toUpperCase(ch); // step 2
if (u.length !== 1) {
return ch; // step 3
}
var cu = u; // step 4
if ($charCodeAt(ch, 0) >= 128 && $charCodeAt(cu, 0) < 128) {
return ch; // step 5
}
return cu;
};
@@ -0,0 +1,49 @@
arrowWidth = 6px
.ql-bubble
.ql-tooltip
background-color: backgroundColor
border-radius: 25px
color: textColor
.ql-tooltip-arrow
border-left: arrowWidth solid transparent
border-right: arrowWidth solid transparent
content: " "
display: block
left: 50%
margin-left: -1 * arrowWidth
position: absolute
.ql-tooltip:not(.ql-flip) .ql-tooltip-arrow
border-bottom: arrowWidth solid backgroundColor
top: -1 * arrowWidth
.ql-tooltip.ql-flip .ql-tooltip-arrow
border-top: arrowWidth solid backgroundColor
bottom: -1 * arrowWidth
.ql-tooltip.ql-editing
.ql-tooltip-editor
display: block
.ql-formats
visibility: hidden
.ql-tooltip-editor
display: none
input[type=text]
background: transparent
border: none
color: textColor
font-size: 13px
height: 100%
outline: none
padding: 10px 20px
position: absolute
width: 100%
a
&:before
color: inactiveColor
content: "\00D7"
font-size: 16px
font-weight: bold
top: 10px
position: absolute
right: 20px
@@ -0,0 +1,5 @@
import { Attributor, ClassAttributor, StyleAttributor } from 'parchment';
declare const DirectionAttribute: Attributor;
declare const DirectionClass: ClassAttributor;
declare const DirectionStyle: StyleAttributor;
export { DirectionAttribute, DirectionClass, DirectionStyle };
@@ -0,0 +1 @@
{"name":"@jridgewell/remapping","version":"2.3.5","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532117442,"integrity":"sha512-saakd7FVlV7sB0lJxPAaywkJ8R69jC/1QO2e2TcVLl8ZDaccoi9woo8schL6tVJhKyT8pyy4mSRgiae248P97g==","mode":420,"size":1080},"types/build-source-map-tree.d.cts":{"checkedAt":1794532117442,"integrity":"sha512-FobM9Di0ZX784U2h7VyXN3x3+J79IvG1+TGzV7xGb6V8jH88kODaCGOHnDr9kFG4Fh7mToTsAcHe22B8rX2yzA==","mode":420,"size":858},"types/remapping.d.cts":{"checkedAt":1794532117442,"integrity":"sha512-fxgcF5TGx5RHAk52rbOBl3Mm+poNedPw0nyz9plpzCse6NyhPqub9nGzx32hP9+xk2snhq6heqc/4tt9Ac0E6Q==","mode":420,"size":1145},"types/source-map-tree.d.cts":{"checkedAt":1794532117443,"integrity":"sha512-79zxRHSbZuVeAad5W9bBFlR3B4sovVUHl2MX4gHcp1glS+DEvwFM6mNR7186mt51D9KB9UZHwLRKP7vkU+4V1w==","mode":420,"size":1688},"types/source-map.d.cts":{"checkedAt":1794532117443,"integrity":"sha512-1SdFj7rkyd9MNDRbgDf0s/0Td/LKDe84NgN2APrgaD/8nO35AQYhoPHDmmKsUU/rXwjOfvKmR8b57szKHsLczQ==","mode":420,"size":667},"types/types.d.cts":{"checkedAt":1794532117443,"integrity":"sha512-jcF93nhB2J7gO0b4UsSo9xscnofxUivt1QT2/vbmT2KMV118TPiKZsFURkKgP+X132YyYjDWNOQ/HDBcGB0pXg==","mode":420,"size":619},"dist/remapping.umd.js":{"checkedAt":1794532117443,"integrity":"sha512-dJooZfK1gLiIEikP44+kKzdI4+4ETFWemU9PW7wVyNTmaBnjYnjUi9zqmwyNhsqpKMGqZH1heVysSgER4ctf8g==","mode":420,"size":7880},"package.json":{"checkedAt":1794532117444,"integrity":"sha512-FAgMn0xTHvD+/IOtsn3EZxsRfrEatt3rIMzGiLpBqSt7HSKrNeSkj4E4TqVFq9wRiB+JQSgZd1iF/yjBO12pqw==","mode":420,"size":2307},"types/build-source-map-tree.d.cts.map":{"checkedAt":1794532117444,"integrity":"sha512-g1/TDiGSCq90R/L/Yh2q4uAzUJ0I442J9+z5VSm8VBt+cQbqU2BTcChnaa8SCtR0+q412P0a2F10G0dJeSQwKQ==","mode":420,"size":375},"types/build-source-map-tree.d.mts.map":{"checkedAt":1794532117444,"integrity":"sha512-g1/TDiGSCq90R/L/Yh2q4uAzUJ0I442J9+z5VSm8VBt+cQbqU2BTcChnaa8SCtR0+q412P0a2F10G0dJeSQwKQ==","mode":420,"size":375},"types/remapping.d.cts.map":{"checkedAt":1794532117445,"integrity":"sha512-il8w2zuhxxI0fNvLKNfpxb81HbMz0wV1hXLE46PIXqkqspz1LQHnXhKw7luW1H9xy3MNWx/3SMK5aBZKHGRz8g==","mode":420,"size":534},"types/remapping.d.mts.map":{"checkedAt":1794532117445,"integrity":"sha512-il8w2zuhxxI0fNvLKNfpxb81HbMz0wV1hXLE46PIXqkqspz1LQHnXhKw7luW1H9xy3MNWx/3SMK5aBZKHGRz8g==","mode":420,"size":534},"dist/remapping.mjs.map":{"checkedAt":1794532117445,"integrity":"sha512-BNLUu67aGdiVRF9IbrCe71Q4MXm94d3HAkTCGx07GyCvJOvhR+TSW8zkkynDIh7cRZyYgNX5E4SYdNXdzCdHMw==","mode":420,"size":3558},"dist/remapping.umd.js.map":{"checkedAt":1794532117446,"integrity":"sha512-c3ftZfm/8Fd2HRFym9kvx+qZxq5X55Hj78MCPHMF+2vCNL/DBadN/GuqmXgLgbqbPFOA71Xfm0drzz68P2h3DA==","mode":420,"size":3849},"types/source-map-tree.d.cts.map":{"checkedAt":1794532117446,"integrity":"sha512-Q5Wbljq0ABjwY1df3Po8DmLkqdX8iOb85Qo5znFIAzCEjWj6Ehl9pTN+qi/Nf4nvcrakqjjAwMmgLuoOctGsJQ==","mode":420,"size":1222},"types/source-map-tree.d.mts.map":{"checkedAt":1794532117446,"integrity":"sha512-Q5Wbljq0ABjwY1df3Po8DmLkqdX8iOb85Qo5znFIAzCEjWj6Ehl9pTN+qi/Nf4nvcrakqjjAwMmgLuoOctGsJQ==","mode":420,"size":1222},"types/source-map.d.cts.map":{"checkedAt":1794532117446,"integrity":"sha512-wMjCOjINtFAnwJimCho3dynp8koqjbyLJLYKpiGaJ79xRsDwdkwqoM66w2lScsKBBz4q1oRaaanK/LUxINkthQ==","mode":420,"size":688},"types/source-map.d.mts.map":{"checkedAt":1794532117446,"integrity":"sha512-wMjCOjINtFAnwJimCho3dynp8koqjbyLJLYKpiGaJ79xRsDwdkwqoM66w2lScsKBBz4q1oRaaanK/LUxINkthQ==","mode":420,"size":688},"types/types.d.cts.map":{"checkedAt":1794532117446,"integrity":"sha512-SPQY77F99bz7503AsHUSEqKUZG7ybHSHX5sr92lOpo1PWaNRxi0kQoAOioVvNuY+PZjj7uSmE/1FoErPsI3v6w==","mode":420,"size":679},"types/types.d.mts.map":{"checkedAt":1794532117446,"integrity":"sha512-SPQY77F99bz7503AsHUSEqKUZG7ybHSHX5sr92lOpo1PWaNRxi0kQoAOioVvNuY+PZjj7uSmE/1FoErPsI3v6w==","mode":420,"size":679},"README.md":{"checkedAt":1794532117446,"integrity":"sha512-3ztBZaIQq6Jz0PwGOUqetiX55yzq2ExcCMF5CpjUSuOCdPm2ezWtM+ZgX5OPq6rNKPUi3Td5oYES9MhnRIEEBQ==","mode":420,"size":7304},"dist/remapping.mjs":{"checkedAt":1794532117446,"integrity":"sha512-ZeEECFA8uP8o66FiLURZ6wXEDwNmnVojwPssgr8IdS1CfDGiySaeapcX0Fom0Bmn2MLmqfrs2BLQC6+BIywvxw==","mode":420,"size":4829},"types/build-source-map-tree.d.mts":{"checkedAt":1794532117447,"integrity":"sha512-qj+G42EwftF4x/0aCWrYcfKJNdCJxsP6hJtkOuz+hL99A5eb1sV9U5lPHDFMwlEPOhXHzw/NseIQ8WD+AY8XVQ==","mode":420,"size":858},"types/remapping.d.mts":{"checkedAt":1794532117447,"integrity":"sha512-4uXbr2myAorGx3AXhFlNNc79TMXcWvx7KoWHHjg8ImaRvANMLSGibEq7wIm4iqjCJJnwhbbBT5bT0IP2NBgZpQ==","mode":420,"size":1145},"types/source-map-tree.d.mts":{"checkedAt":1794532117443,"integrity":"sha512-79zxRHSbZuVeAad5W9bBFlR3B4sovVUHl2MX4gHcp1glS+DEvwFM6mNR7186mt51D9KB9UZHwLRKP7vkU+4V1w==","mode":420,"size":1688},"types/source-map.d.mts":{"checkedAt":1794532117447,"integrity":"sha512-oTUSqRBcCPbkTA0ZyDhiMegok56bfsrjpm7NyyD2zW8sg2wCNd2p6YBwG7rzKDqMji9ATBOsAH2rkvyAM/MNQw==","mode":420,"size":667},"types/types.d.mts":{"checkedAt":1794532117443,"inLine truncated
@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('isTypedArray', require('../isTypedArray'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;
@@ -0,0 +1,182 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PART_TYPE = void 0;
exports.isFormatXMLElementFn = isFormatXMLElementFn;
exports.formatToParts = formatToParts;
var icu_messageformat_parser_1 = require("@formatjs/icu-messageformat-parser");
var error_1 = require("./error");
var PART_TYPE;
(function (PART_TYPE) {
PART_TYPE[PART_TYPE["literal"] = 0] = "literal";
PART_TYPE[PART_TYPE["object"] = 1] = "object";
})(PART_TYPE || (exports.PART_TYPE = PART_TYPE = {}));
function mergeLiteral(parts) {
if (parts.length < 2) {
return parts;
}
return parts.reduce(function (all, part) {
var lastPart = all[all.length - 1];
if (!lastPart ||
lastPart.type !== PART_TYPE.literal ||
part.type !== PART_TYPE.literal) {
all.push(part);
}
else {
lastPart.value += part.value;
}
return all;
}, []);
}
function isFormatXMLElementFn(el) {
return typeof el === 'function';
}
// TODO(skeleton): add skeleton support
function formatToParts(els, locales, formatters, formats, values, currentPluralValue,
// For debugging
originalMessage) {
// Hot path for straight simple msg translations
if (els.length === 1 && (0, icu_messageformat_parser_1.isLiteralElement)(els[0])) {
return [
{
type: PART_TYPE.literal,
value: els[0].value,
},
];
}
var result = [];
for (var _i = 0, els_1 = els; _i < els_1.length; _i++) {
var el = els_1[_i];
// Exit early for string parts.
if ((0, icu_messageformat_parser_1.isLiteralElement)(el)) {
result.push({
type: PART_TYPE.literal,
value: el.value,
});
continue;
}
// TODO: should this part be literal type?
// Replace `#` in plural rules with the actual numeric value.
if ((0, icu_messageformat_parser_1.isPoundElement)(el)) {
if (typeof currentPluralValue === 'number') {
result.push({
type: PART_TYPE.literal,
value: formatters.getNumberFormat(locales).format(currentPluralValue),
});
}
continue;
}
var varName = el.value;
// Enforce that all required values are provided by the caller.
if (!(values && varName in values)) {
throw new error_1.MissingValueError(varName, originalMessage);
}
var value = values[varName];
if ((0, icu_messageformat_parser_1.isArgumentElement)(el)) {
if (!value || typeof value === 'string' || typeof value === 'number') {
value =
typeof value === 'string' || typeof value === 'number'
? String(value)
: '';
}
result.push({
type: typeof value === 'string' ? PART_TYPE.literal : PART_TYPE.object,
value: value,
});
continue;
}
// Recursively format plural and select parts' option — which can be a
// nested pattern structure. The choosing of the option to use is
// abstracted-by and delegated-to the part helper object.
if ((0, icu_messageformat_parser_1.isDateElement)(el)) {
var style = typeof el.style === 'string'
? formats.date[el.style]
: (0, icu_messageformat_parser_1.isDateTimeSkeleton)(el.style)
? el.style.parsedOptions
: undefined;
result.push({
type: PART_TYPE.literal,
value: formatters
.getDateTimeFormat(locales, style)
.format(value),
});
continue;
}
if ((0, icu_messageformat_parser_1.isTimeElement)(el)) {
var style = typeof el.style === 'string'
? formats.time[el.style]
: (0, icu_messageformat_parser_1.isDateTimeSkeleton)(el.style)
? el.style.parsedOptions
: formats.time.medium;
result.push({
type: PART_TYPE.literal,
value: formatters
.getDateTimeFormat(locales, style)
.format(value),
});
continue;
}
if ((0, icu_messageformat_parser_1.isNumberElement)(el)) {
var style = typeof el.style === 'string'
? formats.number[el.style]
: (0, icu_messageformat_parser_1.isNumberSkeleton)(el.style)
? el.style.parsedOptions
: undefined;
if (style && style.scale) {
value =
value *
(style.scale || 1);
}
result.push({
type: PART_TYPE.literal,
value: formatters
.getNumberFormat(locales, style)
.format(value),
});
continue;
}
if ((0, icu_messageformat_parser_1.isTagElement)(el)) {
var children = el.children, value_1 = el.value;
var formatFn = values[value_1];
if (!isFormatXMLElementFn(formatFn)) {
throw new error_1.InvalidValueTypeError(value_1, 'function', originalMessage);
}
var parts = formatToParts(children, locales, formatters, formats, values, currentPluralValue);
var chunks = formatFn(parts.map(function (p) { return p.value; }));
if (!Array.isArray(chunks)) {
chunks = [chunks];
}
result.push.apply(result, chunks.map(function (c) {
return {
type: typeof c === 'string' ? PART_TYPE.literal : PART_TYPE.object,
value: c,
};
}));
}
if ((0, icu_messageformat_parser_1.isSelectElement)(el)) {
var opt = el.options[value] || el.options.other;
if (!opt) {
throw new error_1.InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);
}
result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values));
continue;
}
if ((0, icu_messageformat_parser_1.isPluralElement)(el)) {
var opt = el.options["=".concat(value)];
if (!opt) {
if (!Intl.PluralRules) {
throw new error_1.FormatError("Intl.PluralRules is not available in this environment.\nTry polyfilling it using \"@formatjs/intl-pluralrules\"\n", error_1.ErrorCode.MISSING_INTL_API, originalMessage);
}
var rule = formatters
.getPluralRules(locales, { type: el.pluralType })
.select(value - (el.offset || 0));
opt = el.options[rule] || el.options.other;
}
if (!opt) {
throw new error_1.InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);
}
result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values, value - (el.offset || 0)));
continue;
}
}
return mergeLiteral(result);
}
@@ -0,0 +1,25 @@
import './types.d-B8CCKmHt.js';
type Key = string | symbol;
type CreateMockInstanceProcedure = (options?: {
prototypeMembers?: (string | symbol)[];
name?: string | symbol;
originalImplementation?: (...args: any[]) => any;
keepMembersImplementation?: boolean;
}) => any;
interface MockObjectOptions {
type: "automock" | "autospy";
globalConstructors: GlobalConstructors;
createMockInstance: CreateMockInstanceProcedure;
}
declare function mockObject(options: MockObjectOptions, object: Record<Key, any>, mockExports?: Record<Key, any>): Record<Key, any>;
interface GlobalConstructors {
Object: ObjectConstructor;
Function: FunctionConstructor;
RegExp: RegExpConstructor;
Array: ArrayConstructor;
Map: MapConstructor;
}
export { mockObject as m };
export type { CreateMockInstanceProcedure as C, GlobalConstructors as G, MockObjectOptions as M };
@@ -0,0 +1,109 @@
import { ZodIssueCode } from "../ZodError.js";
import { util, ZodParsedType } from "../helpers/util.js";
const errorMap = (issue, _ctx) => {
let message;
switch (issue.code) {
case ZodIssueCode.invalid_type:
if (issue.received === ZodParsedType.undefined) {
message = "Required";
}
else {
message = `Expected ${issue.expected}, received ${issue.received}`;
}
break;
case ZodIssueCode.invalid_literal:
message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;
break;
case ZodIssueCode.unrecognized_keys:
message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`;
break;
case ZodIssueCode.invalid_union:
message = `Invalid input`;
break;
case ZodIssueCode.invalid_union_discriminator:
message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;
break;
case ZodIssueCode.invalid_enum_value:
message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;
break;
case ZodIssueCode.invalid_arguments:
message = `Invalid function arguments`;
break;
case ZodIssueCode.invalid_return_type:
message = `Invalid function return type`;
break;
case ZodIssueCode.invalid_date:
message = `Invalid date`;
break;
case ZodIssueCode.invalid_string:
if (typeof issue.validation === "object") {
if ("includes" in issue.validation) {
message = `Invalid input: must include "${issue.validation.includes}"`;
if (typeof issue.validation.position === "number") {
message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
}
}
else if ("startsWith" in issue.validation) {
message = `Invalid input: must start with "${issue.validation.startsWith}"`;
}
else if ("endsWith" in issue.validation) {
message = `Invalid input: must end with "${issue.validation.endsWith}"`;
}
else {
util.assertNever(issue.validation);
}
}
else if (issue.validation !== "regex") {
message = `Invalid ${issue.validation}`;
}
else {
message = "Invalid";
}
break;
case ZodIssueCode.too_small:
if (issue.type === "array")
message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
else if (issue.type === "string")
message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
else if (issue.type === "number")
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
else if (issue.type === "bigint")
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
else if (issue.type === "date")
message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
else
message = "Invalid input";
break;
case ZodIssueCode.too_big:
if (issue.type === "array")
message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
else if (issue.type === "string")
message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
else if (issue.type === "number")
message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
else if (issue.type === "bigint")
message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
else if (issue.type === "date")
message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
else
message = "Invalid input";
break;
case ZodIssueCode.custom:
message = `Invalid input`;
break;
case ZodIssueCode.invalid_intersection_types:
message = `Intersection results could not be merged`;
break;
case ZodIssueCode.not_multiple_of:
message = `Number must be a multiple of ${issue.multipleOf}`;
break;
case ZodIssueCode.not_finite:
message = "Number must be finite";
break;
default:
message = _ctx.defaultError;
util.assertNever(issue);
}
return { message };
};
export default errorMap;
@@ -0,0 +1,3 @@
# @react-types/accordion
This package is part of [react-spectrum](https://github.com/adobe/react-spectrum). See the repo for more details.
@@ -0,0 +1 @@
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["content.js"],"names":[],"mappings":"AAeA,+BAA+B;AAC/B,sBADW,gBAAgB,CACyB;sCAT1C,sBAAsB"}
@@ -0,0 +1,11 @@
var util = require('util')
module.exports = function () {
var args = Array.prototype.slice.call(arguments, 0)
args.forEach(function (arg) {
if (!arg) {
throw new TypeError('Bad arguments.')
}
})
return util.format.apply(null, arguments)
}
@@ -0,0 +1,75 @@
name: ci
on: [push, pull_request]
jobs:
legacy:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['0.10', '0.12', 4.x, 6.x, 8.x, 10.x, 12.x, 13.x, 14.x, 15.x, 16.x]
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: |
npm install --production && npm install tape
- name: Run tests
run: |
npm run legacy
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: |
npm install
- name: Run tests
run: |
npm run test
types:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install
run: |
npm install
- name: Run types tests
run: |
npm run typescript
@@ -0,0 +1 @@
{"name":"xtend","version":"4.0.2","requiresBuild":false,"files":{"package.json":{"checkedAt":1794532100302,"integrity":"sha512-uzaVuneHLru1+mmShIWPo9/vpohT4gW6mSXorJR9b9vHcA1OYdIopX1RuBXdesnaDIXvE7NRAeFg9WIuudajOw==","mode":436,"size":1056},".jshintrc":{"checkedAt":1794532100302,"integrity":"sha512-xDAGiM96KKFNKmTQgW675dU84sBIuBatKLAS4nTXMwhiKB2Fd9XaoDlVmsqzE0t5LQCbXgYgVQ4ekj2U35xFaw==","mode":436,"size":545},"immutable.js":{"checkedAt":1794532100302,"integrity":"sha512-HjqCdkmzLUpD/7fIlOejdMEhFtrcnB9T3I0vz6kY6DgTc32tAigPtsCegAGL4PCThAq92liZRRmpRiroqv5U3w==","mode":436,"size":384},"LICENSE":{"checkedAt":1794532100302,"integrity":"sha512-NGMeLG5GAXCi6QssRQmGk8h0Z7KjdsCwgFnaDNmgkBFcwQr2ADSmRK4UV9cgrENP0DHJpE5Dlm7nXGSu3n+K5g==","mode":436,"size":1078},"mutable.js":{"checkedAt":1794532100302,"integrity":"sha512-iCpqDNydyAI9x+wKBiYXoOEg3RotYgrIygErutsdFyhDIRYK/i9ElEAsi0EjI0Ui1asYqeT+1UL+gMGl6o7rZw==","mode":436,"size":369},"README.md":{"checkedAt":1794532100302,"integrity":"sha512-y7q36h7gkX3HW4LC/nSLzqU6hgqjLtoVWfGpji6zoWxqz1u1GyZ9tRLGM4jYKlzTRgOzxNbhmyx21olWv4AIyw==","mode":436,"size":726},"test.js":{"checkedAt":1794532100302,"integrity":"sha512-IBSFg1gIxmc3Y61f3iKNvynOqAUlULTA7X98mxSckbgwIFBvzd+FHkWiGA2F4U/yNIpbNK7L/68IFR+/AESSFw==","mode":436,"size":2307}}}
@@ -0,0 +1,97 @@
'use strict';
var common = require('../common');
var Type = require('../type');
var YAML_FLOAT_PATTERN = new RegExp(
// 2.5e4, 2.5 and integers
'^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' +
// .2e4, .2
// special case, seems not from spec
'|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' +
// .inf
'|[-+]?\\.(?:inf|Inf|INF)' +
// .nan
'|\\.(?:nan|NaN|NAN))$');
function resolveYamlFloat(data) {
if (data === null) return false;
if (!YAML_FLOAT_PATTERN.test(data) ||
// Quick hack to not allow integers end with `_`
// Probably should update regexp & check speed
data[data.length - 1] === '_') {
return false;
}
return true;
}
function constructYamlFloat(data) {
var value, sign;
value = data.replace(/_/g, '').toLowerCase();
sign = value[0] === '-' ? -1 : 1;
if ('+-'.indexOf(value[0]) >= 0) {
value = value.slice(1);
}
if (value === '.inf') {
return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
} else if (value === '.nan') {
return NaN;
}
return sign * parseFloat(value, 10);
}
var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
function representYamlFloat(object, style) {
var res;
if (isNaN(object)) {
switch (style) {
case 'lowercase': return '.nan';
case 'uppercase': return '.NAN';
case 'camelcase': return '.NaN';
}
} else if (Number.POSITIVE_INFINITY === object) {
switch (style) {
case 'lowercase': return '.inf';
case 'uppercase': return '.INF';
case 'camelcase': return '.Inf';
}
} else if (Number.NEGATIVE_INFINITY === object) {
switch (style) {
case 'lowercase': return '-.inf';
case 'uppercase': return '-.INF';
case 'camelcase': return '-.Inf';
}
} else if (common.isNegativeZero(object)) {
return '-0.0';
}
res = object.toString(10);
// JS stringifier can build scientific format without dots: 5e-100,
// while YAML requres dot: 5.e-100. Fix it with simple hack
return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;
}
function isFloat(object) {
return (Object.prototype.toString.call(object) === '[object Number]') &&
(object % 1 !== 0 || common.isNegativeZero(object));
}
module.exports = new Type('tag:yaml.org,2002:float', {
kind: 'scalar',
resolve: resolveYamlFloat,
construct: constructYamlFloat,
predicate: isFloat,
represent: representYamlFloat,
defaultStyle: 'lowercase'
});
@@ -0,0 +1,808 @@
# Copyright (c) 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This script is intended for use as a GYP_GENERATOR. It takes as input (by way of
the generator flag config_path) the path of a json file that dictates the files
and targets to search for. The following keys are supported:
files: list of paths (relative) of the files to search for.
test_targets: unqualified target names to search for. Any target in this list
that depends upon a file in |files| is output regardless of the type of target
or chain of dependencies.
additional_compile_targets: Unqualified targets to search for in addition to
test_targets. Targets in the combined list that depend upon a file in |files|
are not necessarily output. For example, if the target is of type none then the
target is not output (but one of the descendants of the target will be).
The following is output:
error: only supplied if there is an error.
compile_targets: minimal set of targets that directly or indirectly (for
targets of type none) depend on the files in |files| and is one of the
supplied targets or a target that one of the supplied targets depends on.
The expectation is this set of targets is passed into a build step. This list
always contains the output of test_targets as well.
test_targets: set of targets from the supplied |test_targets| that either
directly or indirectly depend upon a file in |files|. This list if useful
if additional processing needs to be done for certain targets after the
build, such as running tests.
status: outputs one of three values: none of the supplied files were found,
one of the include files changed so that it should be assumed everything
changed (in this case test_targets and compile_targets are not output) or at
least one file was found.
invalid_targets: list of supplied targets that were not found.
Example:
Consider a graph like the following:
A D
/ \
B C
A depends upon both B and C, A is of type none and B and C are executables.
D is an executable, has no dependencies and nothing depends on it.
If |additional_compile_targets| = ["A"], |test_targets| = ["B", "C"] and
files = ["b.cc", "d.cc"] (B depends upon b.cc and D depends upon d.cc), then
the following is output:
|compile_targets| = ["B"] B must built as it depends upon the changed file b.cc
and the supplied target A depends upon it. A is not output as a build_target
as it is of type none with no rules and actions.
|test_targets| = ["B"] B directly depends upon the change file b.cc.
Even though the file d.cc, which D depends upon, has changed D is not output
as it was not supplied by way of |additional_compile_targets| or |test_targets|.
If the generator flag analyzer_output_path is specified, output is written
there. Otherwise output is written to stdout.
In Gyp the "all" target is shorthand for the root targets in the files passed
to gyp. For example, if file "a.gyp" contains targets "a1" and
"a2", and file "b.gyp" contains targets "b1" and "b2" and "a2" has a dependency
on "b2" and gyp is supplied "a.gyp" then "all" consists of "a1" and "a2".
Notice that "b1" and "b2" are not in the "all" target as "b.gyp" was not
directly supplied to gyp. OTOH if both "a.gyp" and "b.gyp" are supplied to gyp
then the "all" target includes "b1" and "b2".
"""
import gyp.common
import json
import os
import posixpath
debug = False
found_dependency_string = "Found dependency"
no_dependency_string = "No dependencies"
# Status when it should be assumed that everything has changed.
all_changed_string = "Found dependency (all)"
# MatchStatus is used indicate if and how a target depends upon the supplied
# sources.
# The target's sources contain one of the supplied paths.
MATCH_STATUS_MATCHES = 1
# The target has a dependency on another target that contains one of the
# supplied paths.
MATCH_STATUS_MATCHES_BY_DEPENDENCY = 2
# The target's sources weren't in the supplied paths and none of the target's
# dependencies depend upon a target that matched.
MATCH_STATUS_DOESNT_MATCH = 3
# The target doesn't contain the source, but the dependent targets have not yet
# been visited to determine a more specific status yet.
MATCH_STATUS_TBD = 4
generator_supports_multiple_toolsets = gyp.common.CrossCompileRequested()
generator_wants_static_library_dependencies_adjusted = False
generator_default_variables = {}
for dirname in [
"INTERMEDIATE_DIR",
"SHARED_INTERMEDIATE_DIR",
"PRODUCT_DIR",
"LIB_DIR",
"SHARED_LIB_DIR",
]:
generator_default_variables[dirname] = "!!!"
for unused in [
"RULE_INPUT_PATH",
"RULE_INPUT_ROOT",
"RULE_INPUT_NAME",
"RULE_INPUT_DIRNAME",
"RULE_INPUT_EXT",
"EXECUTABLE_PREFIX",
"EXECUTABLE_SUFFIX",
"STATIC_LIB_PREFIX",
"STATIC_LIB_SUFFIX",
"SHARED_LIB_PREFIX",
"SHARED_LIB_SUFFIX",
"CONFIGURATION_NAME",
]:
generator_default_variables[unused] = ""
def _ToGypPath(path):
"""Converts a path to the format used by gyp."""
if os.sep == "\\" and os.altsep == "/":
return path.replace("\\", "/")
return path
def _ResolveParent(path, base_path_components):
"""Resolves |path|, which starts with at least one '../'. Returns an empty
string if the path shouldn't be considered. See _AddSources() for a
description of |base_path_components|."""
depth = 0
while path.startswith("../"):
depth += 1
path = path[3:]
# Relative includes may go outside the source tree. For example, an action may
# have inputs in /usr/include, which are not in the source tree.
if depth > len(base_path_components):
return ""
if depth == len(base_path_components):
return path
return (
"/".join(base_path_components[0 : len(base_path_components) - depth])
+ "/"
+ path
)
def _AddSources(sources, base_path, base_path_components, result):
"""Extracts valid sources from |sources| and adds them to |result|. Each
source file is relative to |base_path|, but may contain '..'. To make
resolving '..' easier |base_path_components| contains each of the
directories in |base_path|. Additionally each source may contain variables.
Such sources are ignored as it is assumed dependencies on them are expressed
and tracked in some other means."""
# NOTE: gyp paths are always posix style.
for source in sources:
if not len(source) or source.startswith("!!!") or source.startswith("$"):
continue
# variable expansion may lead to //.
org_source = source
source = source[0] + source[1:].replace("//", "/")
if source.startswith("../"):
source = _ResolveParent(source, base_path_components)
if len(source):
result.append(source)
continue
result.append(base_path + source)
if debug:
print("AddSource", org_source, result[len(result) - 1])
def _ExtractSourcesFromAction(action, base_path, base_path_components, results):
if "inputs" in action:
_AddSources(action["inputs"], base_path, base_path_components, results)
def _ToLocalPath(toplevel_dir, path):
"""Converts |path| to a path relative to |toplevel_dir|."""
if path == toplevel_dir:
return ""
if path.startswith(toplevel_dir + "/"):
return path[len(toplevel_dir) + len("/") :]
return path
def _ExtractSources(target, target_dict, toplevel_dir):
# |target| is either absolute or relative and in the format of the OS. Gyp
# source paths are always posix. Convert |target| to a posix path relative to
# |toplevel_dir_|. This is done to make it easy to build source paths.
base_path = posixpath.dirname(_ToLocalPath(toplevel_dir, _ToGypPath(target)))
base_path_components = base_path.split("/")
# Add a trailing '/' so that _AddSources() can easily build paths.
if len(base_path):
base_path += "/"
if debug:
print("ExtractSources", target, base_path)
results = []
if "sources" in target_dict:
_AddSources(target_dict["sources"], base_path, base_path_components, results)
# Include the inputs from any actions. Any changes to these affect the
# resulting output.
if "actions" in target_dict:
for action in target_dict["actions"]:
_ExtractSourcesFromAction(action, base_path, base_path_components, results)
if "rules" in target_dict:
for rule in target_dict["rules"]:
_ExtractSourcesFromAction(rule, base_path, base_path_components, results)
return results
class Target:
"""Holds information about a particular target:
deps: set of Targets this Target depends upon. This is not recursive, only the
direct dependent Targets.
match_status: one of the MatchStatus values.
back_deps: set of Targets that have a dependency on this Target.
visited: used during iteration to indicate whether we've visited this target.
This is used for two iterations, once in building the set of Targets and
again in _GetBuildTargets().
name: fully qualified name of the target.
requires_build: True if the target type is such that it needs to be built.
See _DoesTargetTypeRequireBuild for details.
added_to_compile_targets: used when determining if the target was added to the
set of targets that needs to be built.
in_roots: true if this target is a descendant of one of the root nodes.
is_executable: true if the type of target is executable.
is_static_library: true if the type of target is static_library.
is_or_has_linked_ancestor: true if the target does a link (eg executable), or
if there is a target in back_deps that does a link."""
def __init__(self, name):
self.deps = set()
self.match_status = MATCH_STATUS_TBD
self.back_deps = set()
self.name = name
# TODO(sky): I don't like hanging this off Target. This state is specific
# to certain functions and should be isolated there.
self.visited = False
self.requires_build = False
self.added_to_compile_targets = False
self.in_roots = False
self.is_executable = False
self.is_static_library = False
self.is_or_has_linked_ancestor = False
class Config:
"""Details what we're looking for
files: set of files to search for
targets: see file description for details."""
def __init__(self):
self.files = []
self.targets = set()
self.additional_compile_target_names = set()
self.test_target_names = set()
def Init(self, params):
"""Initializes Config. This is a separate method as it raises an exception
if there is a parse error."""
generator_flags = params.get("generator_flags", {})
config_path = generator_flags.get("config_path", None)
if not config_path:
return
try:
f = open(config_path)
config = json.load(f)
f.close()
except OSError:
raise Exception("Unable to open file " + config_path)
except ValueError as e:
raise Exception("Unable to parse config file " + config_path + str(e))
if not isinstance(config, dict):
raise Exception("config_path must be a JSON file containing a dictionary")
self.files = config.get("files", [])
self.additional_compile_target_names = set(
config.get("additional_compile_targets", [])
)
self.test_target_names = set(config.get("test_targets", []))
def _WasBuildFileModified(build_file, data, files, toplevel_dir):
"""Returns true if the build file |build_file| is either in |files| or
one of the files included by |build_file| is in |files|. |toplevel_dir| is
the root of the source tree."""
if _ToLocalPath(toplevel_dir, _ToGypPath(build_file)) in files:
if debug:
print("gyp file modified", build_file)
return True
# First element of included_files is the file itself.
if len(data[build_file]["included_files"]) <= 1:
return False
for include_file in data[build_file]["included_files"][1:]:
# |included_files| are relative to the directory of the |build_file|.
rel_include_file = _ToGypPath(
gyp.common.UnrelativePath(include_file, build_file)
)
if _ToLocalPath(toplevel_dir, rel_include_file) in files:
if debug:
print(
"included gyp file modified, gyp_file=",
build_file,
"included file=",
rel_include_file,
)
return True
return False
def _GetOrCreateTargetByName(targets, target_name):
"""Creates or returns the Target at targets[target_name]. If there is no
Target for |target_name| one is created. Returns a tuple of whether a new
Target was created and the Target."""
if target_name in targets:
return False, targets[target_name]
target = Target(target_name)
targets[target_name] = target
return True, target
def _DoesTargetTypeRequireBuild(target_dict):
"""Returns true if the target type is such that it needs to be built."""
# If a 'none' target has rules or actions we assume it requires a build.
return bool(
target_dict["type"] != "none"
or target_dict.get("actions")
or target_dict.get("rules")
)
def _GenerateTargets(data, target_list, target_dicts, toplevel_dir, files, build_files):
"""Returns a tuple of the following:
. A dictionary mapping from fully qualified name to Target.
. A list of the targets that have a source file in |files|.
. Targets that constitute the 'all' target. See description at top of file
for details on the 'all' target.
This sets the |match_status| of the targets that contain any of the source
files in |files| to MATCH_STATUS_MATCHES.
|toplevel_dir| is the root of the source tree."""
# Maps from target name to Target.
name_to_target = {}
# Targets that matched.
matching_targets = []
# Queue of targets to visit.
targets_to_visit = target_list[:]
# Maps from build file to a boolean indicating whether the build file is in
# |files|.
build_file_in_files = {}
# Root targets across all files.
roots = set()
# Set of Targets in |build_files|.
build_file_targets = set()
while len(targets_to_visit) > 0:
target_name = targets_to_visit.pop()
created_target, target = _GetOrCreateTargetByName(name_to_target, target_name)
if created_target:
roots.add(target)
elif target.visited:
continue
target.visited = True
target.requires_build = _DoesTargetTypeRequireBuild(target_dicts[target_name])
target_type = target_dicts[target_name]["type"]
target.is_executable = target_type == "executable"
target.is_static_library = target_type == "static_library"
target.is_or_has_linked_ancestor = (
target_type == "executable" or target_type == "shared_library"
)
build_file = gyp.common.ParseQualifiedTarget(target_name)[0]
if build_file not in build_file_in_files:
build_file_in_files[build_file] = _WasBuildFileModified(
build_file, data, files, toplevel_dir
)
if build_file in build_files:
build_file_targets.add(target)
# If a build file (or any of its included files) is modified we assume all
# targets in the file are modified.
if build_file_in_files[build_file]:
print("matching target from modified build file", target_name)
target.match_status = MATCH_STATUS_MATCHES
matching_targets.append(target)
else:
sources = _ExtractSources(
target_name, target_dicts[target_name], toplevel_dir
)
for source in sources:
if _ToGypPath(os.path.normpath(source)) in files:
print("target", target_name, "matches", source)
target.match_status = MATCH_STATUS_MATCHES
matching_targets.append(target)
break
# Add dependencies to visit as well as updating back pointers for deps.
for dep in target_dicts[target_name].get("dependencies", []):
targets_to_visit.append(dep)
created_dep_target, dep_target = _GetOrCreateTargetByName(
name_to_target, dep
)
if not created_dep_target:
roots.discard(dep_target)
target.deps.add(dep_target)
dep_target.back_deps.add(target)
return name_to_target, matching_targets, roots & build_file_targets
def _GetUnqualifiedToTargetMapping(all_targets, to_find):
"""Returns a tuple of the following:
. mapping (dictionary) from unqualified name to Target for all the
Targets in |to_find|.
. any target names not found. If this is empty all targets were found."""
result = {}
if not to_find:
return {}, []
to_find = set(to_find)
for target_name in all_targets.keys():
extracted = gyp.common.ParseQualifiedTarget(target_name)
if len(extracted) > 1 and extracted[1] in to_find:
to_find.remove(extracted[1])
result[extracted[1]] = all_targets[target_name]
if not to_find:
return result, []
return result, [x for x in to_find]
def _DoesTargetDependOnMatchingTargets(target):
"""Returns true if |target| or any of its dependencies is one of the
targets containing the files supplied as input to analyzer. This updates
|matches| of the Targets as it recurses.
target: the Target to look for."""
if target.match_status == MATCH_STATUS_DOESNT_MATCH:
return False
if (
target.match_status == MATCH_STATUS_MATCHES
or target.match_status == MATCH_STATUS_MATCHES_BY_DEPENDENCY
):
return True
for dep in target.deps:
if _DoesTargetDependOnMatchingTargets(dep):
target.match_status = MATCH_STATUS_MATCHES_BY_DEPENDENCY
print("\t", target.name, "matches by dep", dep.name)
return True
target.match_status = MATCH_STATUS_DOESNT_MATCH
return False
def _GetTargetsDependingOnMatchingTargets(possible_targets):
"""Returns the list of Targets in |possible_targets| that depend (either
directly on indirectly) on at least one of the targets containing the files
supplied as input to analyzer.
possible_targets: targets to search from."""
found = []
print("Targets that matched by dependency:")
for target in possible_targets:
if _DoesTargetDependOnMatchingTargets(target):
found.append(target)
return found
def _AddCompileTargets(target, roots, add_if_no_ancestor, result):
"""Recurses through all targets that depend on |target|, adding all targets
that need to be built (and are in |roots|) to |result|.
roots: set of root targets.
add_if_no_ancestor: If true and there are no ancestors of |target| then add
|target| to |result|. |target| must still be in |roots|.
result: targets that need to be built are added here."""
if target.visited:
return
target.visited = True
target.in_roots = target in roots
for back_dep_target in target.back_deps:
_AddCompileTargets(back_dep_target, roots, False, result)
target.added_to_compile_targets |= back_dep_target.added_to_compile_targets
target.in_roots |= back_dep_target.in_roots
target.is_or_has_linked_ancestor |= back_dep_target.is_or_has_linked_ancestor
# Always add 'executable' targets. Even though they may be built by other
# targets that depend upon them it makes detection of what is going to be
# built easier.
# And always add static_libraries that have no dependencies on them from
# linkables. This is necessary as the other dependencies on them may be
# static libraries themselves, which are not compile time dependencies.
if target.in_roots and (
target.is_executable
or (
not target.added_to_compile_targets
and (add_if_no_ancestor or target.requires_build)
)
or (
target.is_static_library
and add_if_no_ancestor
and not target.is_or_has_linked_ancestor
)
):
print(
"\t\tadding to compile targets",
target.name,
"executable",
target.is_executable,
"added_to_compile_targets",
target.added_to_compile_targets,
"add_if_no_ancestor",
add_if_no_ancestor,
"requires_build",
target.requires_build,
"is_static_library",
target.is_static_library,
"is_or_has_linked_ancestor",
target.is_or_has_linked_ancestor,
)
result.add(target)
target.added_to_compile_targets = True
def _GetCompileTargets(matching_targets, supplied_targets):
"""Returns the set of Targets that require a build.
matching_targets: targets that changed and need to be built.
supplied_targets: set of targets supplied to analyzer to search from."""
result = set()
for target in matching_targets:
print("finding compile targets for match", target.name)
_AddCompileTargets(target, supplied_targets, True, result)
return result
def _WriteOutput(params, **values):
"""Writes the output, either to stdout or a file is specified."""
if "error" in values:
print("Error:", values["error"])
if "status" in values:
print(values["status"])
if "targets" in values:
values["targets"].sort()
print("Supplied targets that depend on changed files:")
for target in values["targets"]:
print("\t", target)
if "invalid_targets" in values:
values["invalid_targets"].sort()
print("The following targets were not found:")
for target in values["invalid_targets"]:
print("\t", target)
if "build_targets" in values:
values["build_targets"].sort()
print("Targets that require a build:")
for target in values["build_targets"]:
print("\t", target)
if "compile_targets" in values:
values["compile_targets"].sort()
print("Targets that need to be built:")
for target in values["compile_targets"]:
print("\t", target)
if "test_targets" in values:
values["test_targets"].sort()
print("Test targets:")
for target in values["test_targets"]:
print("\t", target)
output_path = params.get("generator_flags", {}).get("analyzer_output_path", None)
if not output_path:
print(json.dumps(values))
return
try:
f = open(output_path, "w")
f.write(json.dumps(values) + "\n")
f.close()
except OSError as e:
print("Error writing to output file", output_path, str(e))
def _WasGypIncludeFileModified(params, files):
"""Returns true if one of the files in |files| is in the set of included
files."""
if params["options"].includes:
for include in params["options"].includes:
if _ToGypPath(os.path.normpath(include)) in files:
print("Include file modified, assuming all changed", include)
return True
return False
def _NamesNotIn(names, mapping):
"""Returns a list of the values in |names| that are not in |mapping|."""
return [name for name in names if name not in mapping]
def _LookupTargets(names, mapping):
"""Returns a list of the mapping[name] for each value in |names| that is in
|mapping|."""
return [mapping[name] for name in names if name in mapping]
def CalculateVariables(default_variables, params):
"""Calculate additional variables for use in the build (called by gyp)."""
flavor = gyp.common.GetFlavor(params)
if flavor == "mac":
default_variables.setdefault("OS", "mac")
elif flavor == "win":
default_variables.setdefault("OS", "win")
gyp.msvs_emulation.CalculateCommonVariables(default_variables, params)
else:
operating_system = flavor
if flavor == "android":
operating_system = "linux" # Keep this legacy behavior for now.
default_variables.setdefault("OS", operating_system)
class TargetCalculator:
"""Calculates the matching test_targets and matching compile_targets."""
def __init__(
self,
files,
additional_compile_target_names,
test_target_names,
data,
target_list,
target_dicts,
toplevel_dir,
build_files,
):
self._additional_compile_target_names = set(additional_compile_target_names)
self._test_target_names = set(test_target_names)
(
self._name_to_target,
self._changed_targets,
self._root_targets,
) = _GenerateTargets(
data, target_list, target_dicts, toplevel_dir, frozenset(files), build_files
)
(
self._unqualified_mapping,
self.invalid_targets,
) = _GetUnqualifiedToTargetMapping(
self._name_to_target, self._supplied_target_names_no_all()
)
def _supplied_target_names(self):
return self._additional_compile_target_names | self._test_target_names
def _supplied_target_names_no_all(self):
"""Returns the supplied test targets without 'all'."""
result = self._supplied_target_names()
result.discard("all")
return result
def is_build_impacted(self):
"""Returns true if the supplied files impact the build at all."""
return self._changed_targets
def find_matching_test_target_names(self):
"""Returns the set of output test targets."""
assert self.is_build_impacted()
# Find the test targets first. 'all' is special cased to mean all the
# root targets. To deal with all the supplied |test_targets| are expanded
# to include the root targets during lookup. If any of the root targets
# match, we remove it and replace it with 'all'.
test_target_names_no_all = set(self._test_target_names)
test_target_names_no_all.discard("all")
test_targets_no_all = _LookupTargets(
test_target_names_no_all, self._unqualified_mapping
)
test_target_names_contains_all = "all" in self._test_target_names
if test_target_names_contains_all:
test_targets = [
x for x in (set(test_targets_no_all) | set(self._root_targets))
]
else:
test_targets = [x for x in test_targets_no_all]
print("supplied test_targets")
for target_name in self._test_target_names:
print("\t", target_name)
print("found test_targets")
for target in test_targets:
print("\t", target.name)
print("searching for matching test targets")
matching_test_targets = _GetTargetsDependingOnMatchingTargets(test_targets)
matching_test_targets_contains_all = test_target_names_contains_all and set(
matching_test_targets
) & set(self._root_targets)
if matching_test_targets_contains_all:
# Remove any of the targets for all that were not explicitly supplied,
# 'all' is subsequentely added to the matching names below.
matching_test_targets = [
x for x in (set(matching_test_targets) & set(test_targets_no_all))
]
print("matched test_targets")
for target in matching_test_targets:
print("\t", target.name)
matching_target_names = [
gyp.common.ParseQualifiedTarget(target.name)[1]
for target in matching_test_targets
]
if matching_test_targets_contains_all:
matching_target_names.append("all")
print("\tall")
return matching_target_names
def find_matching_compile_target_names(self):
"""Returns the set of output compile targets."""
assert self.is_build_impacted()
# Compile targets are found by searching up from changed targets.
# Reset the visited status for _GetBuildTargets.
for target in self._name_to_target.values():
target.visited = False
supplied_targets = _LookupTargets(
self._supplied_target_names_no_all(), self._unqualified_mapping
)
if "all" in self._supplied_target_names():
supplied_targets = [
x for x in (set(supplied_targets) | set(self._root_targets))
]
print("Supplied test_targets & compile_targets")
for target in supplied_targets:
print("\t", target.name)
print("Finding compile targets")
compile_targets = _GetCompileTargets(self._changed_targets, supplied_targets)
return [
gyp.common.ParseQualifiedTarget(target.name)[1]
for target in compile_targets
]
def GenerateOutput(target_list, target_dicts, data, params):
"""Called by gyp as the final stage. Outputs results."""
config = Config()
try:
config.Init(params)
if not config.files:
raise Exception(
"Must specify files to analyze via config_path generator " "flag"
)
toplevel_dir = _ToGypPath(os.path.abspath(params["options"].toplevel_dir))
if debug:
print("toplevel_dir", toplevel_dir)
if _WasGypIncludeFileModified(params, config.files):
result_dict = {
"status": all_changed_string,
"test_targets": list(config.test_target_names),
"compile_targets": list(
config.additional_compile_target_names | config.test_target_names
),
}
_WriteOutput(params, **result_dict)
return
calculator = TargetCalculator(
config.files,
config.additional_compile_target_names,
config.test_target_names,
data,
target_list,
target_dicts,
toplevel_dir,
params["build_files"],
)
if not calculator.is_build_impacted():
result_dict = {
"status": no_dependency_string,
"test_targets": [],
"compile_targets": [],
}
if calculator.invalid_targets:
result_dict["invalid_targets"] = calculator.invalid_targets
_WriteOutput(params, **result_dict)
return
test_target_names = calculator.find_matching_test_target_names()
compile_target_names = calculator.find_matching_compile_target_names()
found_at_least_one_target = compile_target_names or test_target_names
result_dict = {
"test_targets": test_target_names,
"status": found_dependency_string
if found_at_least_one_target
else no_dependency_string,
"compile_targets": list(set(compile_target_names) | set(test_target_names)),
}
if calculator.invalid_targets:
result_dict["invalid_targets"] = calculator.invalid_targets
_WriteOutput(params, **result_dict)
except Exception as e:
_WriteOutput(params, error=str(e))
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more