docs: 仓库链接指向本镜像仓库
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s

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,18 @@
import * as minimist from "minimist";
const argv = minimist(process.argv.slice(2), {
string: ["project"],
alias: {
project: ["P"],
},
});
const project = argv && argv.project;
export interface Options {
cwd: string;
}
export const options: Options = {
cwd: project || process.cwd(),
};
@@ -0,0 +1,75 @@
'use strict';
module.exports = function generate_pattern(it, $keyword, $ruleType) {
var out = ' ';
var $lvl = it.level;
var $dataLvl = it.dataLevel;
var $schema = it.schema[$keyword];
var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
var $breakOnError = !it.opts.allErrors;
var $data = 'data' + ($dataLvl || '');
var $isData = it.opts.$data && $schema && $schema.$data,
$schemaValue;
if ($isData) {
out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
$schemaValue = 'schema' + $lvl;
} else {
$schemaValue = $schema;
}
var $regexp = $isData ? '(new RegExp(' + $schemaValue + '))' : it.usePattern($schema);
out += 'if ( ';
if ($isData) {
out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || ';
}
out += ' !' + ($regexp) + '.test(' + ($data) + ') ) { ';
var $$outStack = $$outStack || [];
$$outStack.push(out);
out = ''; /* istanbul ignore else */
if (it.createErrors !== false) {
out += ' { keyword: \'' + ('pattern') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern: ';
if ($isData) {
out += '' + ($schemaValue);
} else {
out += '' + (it.util.toQuotedString($schema));
}
out += ' } ';
if (it.opts.messages !== false) {
out += ' , message: \'should match pattern "';
if ($isData) {
out += '\' + ' + ($schemaValue) + ' + \'';
} else {
out += '' + (it.util.escapeQuotes($schema));
}
out += '"\' ';
}
if (it.opts.verbose) {
out += ' , schema: ';
if ($isData) {
out += 'validate.schema' + ($schemaPath);
} else {
out += '' + (it.util.toQuotedString($schema));
}
out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
}
out += ' } ';
} else {
out += ' {} ';
}
var __err = out;
out = $$outStack.pop();
if (!it.compositeRule && $breakOnError) {
/* istanbul ignore if */
if (it.async) {
out += ' throw new ValidationError([' + (__err) + ']); ';
} else {
out += ' validate.errors = [' + (__err) + ']; return false; ';
}
} else {
out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
}
out += '} ';
if ($breakOnError) {
out += ' else { ';
}
return out;
}
@@ -0,0 +1,23 @@
MIT License
Copyright (c) 2012-2018 Aseem Kishore, 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.
[others]: https://github.com/json5/json5/contributors
@@ -0,0 +1 @@
{"version":3,"file":"ResolvedValueElementMetadataKind.js","sourceRoot":"","sources":["../../../../src/metadata/models/ResolvedValueElementMetadataKind.ts"],"names":[],"mappings":";;;AAAA,IAAY,gCAGX;AAHD,WAAY,gCAAgC;IAC1C,iHAAqB,CAAA;IACrB,6GAAmB,CAAA;AACrB,CAAC,EAHW,gCAAgC,gDAAhC,gCAAgC,QAG3C"}
@@ -0,0 +1,26 @@
export * from './action/action';
export * from './action/miniAppAdaptShareInfo';
export * from './highway/highway';
export * from './message/action';
export * from './message/c2c';
export * from './message/component';
export * from './message/element';
export * from './message/group';
export * from './message/message';
export * from './message/notify';
export * from './message/routing';
export * from './oidb/common/Ntv2.RichMediaReq';
export * from './oidb/common/Ntv2.RichMediaResp';
export * from './oidb/Oidb.0x6D6';
export * from './oidb/Oidb.0x8FC_2';
export * from './oidb/Oidb.0x9067_202';
export * from './oidb/Oidb.0x929';
export * from './oidb/Oidb.0xE37_1200';
export * from './oidb/Oidb.0xE37_1700';
export * from './oidb/Oidb.0XE37_800';
export * from './oidb/Oidb.0xEB7';
export * from './oidb/Oidb.0xED3_1';
export * from './oidb/Oidb.0XFE1_2';
export * from './oidb/OidbBase';
export * from './oidb/Oidb.0xE07';
export * from './oidb/Oidb.0xf90_1';
@@ -0,0 +1,6 @@
module.exports = {
"longPressMessage": `Ponuku otvor\xedte dlh\xfdm stla\u{10D}en\xedm alebo stla\u{10D}en\xedm kl\xe1vesu Alt + kl\xe1vesu so \u{161}\xedpkou nadol`
};
//# sourceMappingURL=sk-SK.main.js.map
@@ -0,0 +1,4 @@
import { ContainerBlot } from 'parchment';
declare class Container extends ContainerBlot {
}
export default Container;
@@ -0,0 +1 @@
{"name":"domhandler","version":"5.0.3","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532100338,"integrity":"sha512-6jZ515oacWH/aN1CZdfom57iv/9PMtjaSAJpLW/cXBcG/57dXc42rU6I96pfdgYc9MyHlKAQ7785tbyx7wilUA==","mode":420,"size":1260},"lib/esm/index.js":{"checkedAt":1794532100338,"integrity":"sha512-W4JQPCjkwcxlFJw1jGBVPUzqFx1ai0vMKL0I22+qy5GnuqFtKl5g/r9kwzhCAxw2MEKIROwS2IP1s81TdwzgUg==","mode":420,"size":4678},"lib/index.js":{"checkedAt":1794532100338,"integrity":"sha512-fW7t+Flzy1t9y0vEfrvBTh/CbtFtY4U4CqdNQz9mANR0572PkxT+2Wz/zQIqqr5+Uu//gCxrLlXiakV4lgfSWg==","mode":420,"size":6110},"lib/esm/node.js":{"checkedAt":1794532100338,"integrity":"sha512-vlg5M9Pl3n+ogupMMJfoIsF9OnWi6neQtRmuxFfZCr+V5dnI6uQITU0by+PP6Y4SG5MBznuG/nbcF3tm/nA2vw==","mode":420,"size":9213},"lib/node.js":{"checkedAt":1794532100338,"integrity":"sha512-8haBeWOZ4ogXZtp1JAcz27T+cWfkii/hxRlMfbAgSrPPmNsV+pdBbTviAY6gud8cnnVPdz/jcc9+9IDgr/kW+w==","mode":420,"size":15382},"lib/esm/package.json":{"checkedAt":1794532100338,"integrity":"sha512-yJaw9MUXdELVmz7z3SYVp2blYklya3nL3pU6DnmPcM5rDXeD26fLnxMcB3WmvAQ/Uq9woAMNLTYvYRv/3m6T8Q==","mode":420,"size":18},"package.json":{"checkedAt":1794532100339,"integrity":"sha512-6TP+JQWFn8PjXqKzEjEIp8Z7AGcPTUTARRk+9mAqyfWuVfBCUxPMWYDHEd+5FzGO4FonHXwawZ5DI/31ug0GMw==","mode":420,"size":2241},"lib/esm/index.d.ts.map":{"checkedAt":1794532100339,"integrity":"sha512-8Cldc3ba68UhYeXkJapWtuojlDU2o402xHpdnvuyHVGk3tR7ofPryCNgKAmtynYIgmnfVymVklAEPoJbnZWJZg==","mode":420,"size":1752},"lib/index.d.ts.map":{"checkedAt":1794532100339,"integrity":"sha512-cMzDKXp9uAOT9QiOegFen3orVUaLHzMyFoKivbGz6NM+mGhQYWPAeH0P9ZQO2WVXuyl5TDT/uegFBYXjkJMB0g==","mode":420,"size":1749},"lib/esm/node.d.ts.map":{"checkedAt":1794532100339,"integrity":"sha512-Fgmu+L1/Loesx25XUzZt0B6E3kZt8OzefgaS+dIKlX+4e5gBB9TD9XlrP+C4ZhUcDfLfJgm7YU9zQaxzAMdY9Q==","mode":420,"size":4406},"lib/node.d.ts.map":{"checkedAt":1794532100339,"integrity":"sha512-bgOGUf7gRgG9FiYc6IGAJx6IEPlZ2dGg4FbImRtXC7FRIaruuVXQnnsPYF20SoO7AMT1a/Tdx/ln4YL6/NQgzw==","mode":420,"size":4403},"readme.md":{"checkedAt":1794532100339,"integrity":"sha512-qci0o0D8DRG1Hkc9o5Wh3AfIxZrEi0JPri6ZhpmwoUmuDJj9mHi1Wn2OQEftdTmhuKXqpYLWFTW6uiMPH1BYlw==","mode":420,"size":2779},"lib/esm/index.d.ts":{"checkedAt":1794532100340,"integrity":"sha512-i6BGb+zgt7/0w++OpkIMqaJZ2vGlvLH3M2BcSXP9jUBiLqjYwAC3LiFDlhzGFQGHgFWaZ2vihZM27zBelKnbJQ==","mode":420,"size":2626},"lib/index.d.ts":{"checkedAt":1794532100340,"integrity":"sha512-i6BGb+zgt7/0w++OpkIMqaJZ2vGlvLH3M2BcSXP9jUBiLqjYwAC3LiFDlhzGFQGHgFWaZ2vihZM27zBelKnbJQ==","mode":420,"size":2626},"lib/esm/node.d.ts":{"checkedAt":1794532100340,"integrity":"sha512-uh0ea16YzQLZ0/kBneD1lbXipj/97Xb5mX7Bu/9Qtm54gQr/bNOcm4I/wF77o4kZTmCfiGCSVbwjatOSRQievA==","mode":420,"size":8048},"lib/node.d.ts":{"checkedAt":1794532100340,"integrity":"sha512-uh0ea16YzQLZ0/kBneD1lbXipj/97Xb5mX7Bu/9Qtm54gQr/bNOcm4I/wF77o4kZTmCfiGCSVbwjatOSRQievA==","mode":420,"size":8048}}}
@@ -0,0 +1 @@
{"version":3,"file":"stringify.js","sourceRoot":"https://raw.githubusercontent.com/fb55/domutils/0ab8bcf1ecfc70dfc93291a4cb2496578ac25e9c/src/","sources":["stringify.ts"],"names":[],"mappings":";;;;;AAkBA,oCAKC;AASD,oCAOC;AAUD,0BAMC;AAUD,kCAOC;AAUD,8BAOC;AAzFD,yCAOoB;AACpB,kEAAkE;AAClE,iDAA6C;AAE7C;;;;;;GAMG;AACH,SAAgB,YAAY,CACxB,IAAkC,EAClC,OAA8B;IAE9B,OAAO,IAAA,wBAAU,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACrC,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,YAAY,CACxB,IAAa,EACb,OAA8B;IAE9B,OAAO,IAAA,wBAAW,EAAC,IAAI,CAAC;QACpB,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAC,IAAI,IAAK,OAAA,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,EAA3B,CAA2B,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;QACnE,CAAC,CAAC,EAAE,CAAC;AACb,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,OAAO,CAAC,IAAyB;IAC7C,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC3D,IAAI,IAAA,kBAAK,EAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3E,IAAI,IAAA,oBAAO,EAAC,IAAI,CAAC;QAAE,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjD,IAAI,IAAA,mBAAM,EAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC;IACnC,OAAO,EAAE,CAAC;AACd,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,WAAW,CAAC,IAAyB;IACjD,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/D,IAAI,IAAA,wBAAW,EAAC,IAAI,CAAC,IAAI,CAAC,IAAA,sBAAS,EAAC,IAAI,CAAC,EAAE,CAAC;QACxC,OAAO,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;IACD,IAAI,IAAA,mBAAM,EAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC;IACnC,OAAO,EAAE,CAAC;AACd,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,SAAS,CAAC,IAAyB;IAC/C,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC7D,IAAI,IAAA,wBAAW,EAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,4BAAW,CAAC,GAAG,IAAI,IAAA,oBAAO,EAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QACxE,OAAO,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IACD,IAAI,IAAA,mBAAM,EAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC;IACnC,OAAO,EAAE,CAAC;AACd,CAAC"}
@@ -0,0 +1,39 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
const {
definePrototypeMethodHandler,
} = require("../util/define-prototype-method-handler")
module.exports = {
meta: {
docs: {
description: "disallow the `Array.prototype.map` method.",
category: "ES5",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-array-prototype-map.html",
},
fixable: null,
messages: {
forbidden: "ES5 '{{name}}' method is forbidden.",
},
schema: [
{
type: "object",
properties: {
aggressive: { type: "boolean" },
},
additionalProperties: false,
},
],
type: "problem",
},
create(context) {
return definePrototypeMethodHandler(context, {
Array: ["map"],
})
},
}
@@ -0,0 +1 @@
{"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAaD,MAAM,kDAAc,CAAA,GAAA,sCAAI,EAAE,aAAa,CAAgB;AAKhD,SAAS,0CAAa,KAAwB;IACnD,IAAI,UAAC,MAAM,YAAE,QAAQ,EAAC,GAAG;IACzB,IAAI,gBAAgB,CAAA,GAAA,0CAAe;IAEnC,IAAI,QAAgB,CAAA,GAAA,sCAAI,EAAE,OAAO,CAAC;QAChC,IAAI,CAAC,QACH,OAAO;QAGT,OAAO;oBACL;YACA,WAAW,CAAA,GAAA,+BAAI,EAAE,UAAU,QAAQ;QACrC;IACF,GAAG;QAAC;QAAe;KAAO;IAE1B,qBACE,0DAAC,kCAAY,QAAQ;QAAC,OAAO;OAC1B;AAGP;AAKO,SAAS;IACd,IAAI,gBAAgB,CAAA,GAAA,0CAAe;IACnC,IAAI,UAAU,CAAA,GAAA,uBAAS,EAAE;IACzB,OAAO,WAAW;AACpB","sources":["packages/@react-aria/i18n/src/context.tsx"],"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 {isRTL} from './utils';\nimport {Locale, useDefaultLocale} from './useDefaultLocale';\nimport React, {ReactNode, useContext} from 'react';\n\nexport interface I18nProviderProps {\n /** Contents that should have the locale applied. */\n children: ReactNode,\n /** The locale to apply to the children. */\n locale?: string\n}\n\nconst I18nContext = React.createContext<Locale | null>(null);\n\n/**\n * Provides the locale for the application to all child components.\n */\nexport function I18nProvider(props: I18nProviderProps) {\n let {locale, children} = props;\n let defaultLocale = useDefaultLocale();\n\n let value: Locale = React.useMemo(() => {\n if (!locale) {\n return defaultLocale;\n }\n\n return {\n locale,\n direction: isRTL(locale) ? 'rtl' : 'ltr'\n };\n }, [defaultLocale, locale]);\n\n return (\n <I18nContext.Provider value={value}>\n {children}\n </I18nContext.Provider>\n );\n}\n\n/**\n * Returns the current locale and layout direction.\n */\nexport function useLocale(): Locale {\n let defaultLocale = useDefaultLocale();\n let context = useContext(I18nContext);\n return context || defaultLocale;\n}\n"],"names":[],"version":3,"file":"context.main.js.map"}
@@ -0,0 +1,44 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
const { READ, ReferenceTracker } = require("@eslint-community/eslint-utils")
const { getSourceCode } = require("eslint-compat-utils")
module.exports = {
meta: {
docs: {
description: "disallow the `WeakSet` class.",
category: "ES2015",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-weak-set.html",
},
fixable: null,
messages: {
forbidden: "ES2015 '{{name}}' class is forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
"Program:exit"(program) {
const sourceCode = getSourceCode(context)
const tracker = new ReferenceTracker(
sourceCode.getScope(program),
)
for (const { node, path } of tracker.iterateGlobalReferences({
WeakSet: { [READ]: true },
})) {
context.report({
node,
messageId: "forbidden",
data: { name: path.join(".") },
})
}
},
}
},
}
@@ -0,0 +1,21 @@
"use strict";
exports.__esModule = true;
exports["default"] = void 0;
var _node = _interopRequireDefault(require("./node"));
var _types = require("./types");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
var Comment = /*#__PURE__*/function (_Node) {
_inheritsLoose(Comment, _Node);
function Comment(opts) {
var _this;
_this = _Node.call(this, opts) || this;
_this.type = _types.COMMENT;
return _this;
}
return Comment;
}(_node["default"]);
exports["default"] = Comment;
module.exports = exports.default;
@@ -0,0 +1,39 @@
// Cambodian [km]
import dayjs from '../index';
var locale = {
name: 'km',
weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
months: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),
weekStart: 1,
weekdaysShort: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'),
monthsShort: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'),
weekdaysMin: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'),
ordinal: function ordinal(n) {
return n;
},
formats: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
relativeTime: {
future: '%sទៀត',
past: '%sមុន',
s: 'ប៉ុន្មានវិនាទី',
m: 'មួយនាទី',
mm: '%d នាទី',
h: 'មួយម៉ោង',
hh: '%d ម៉ោង',
d: 'មួយថ្ងៃ',
dd: '%d ថ្ងៃ',
M: 'មួយខែ',
MM: '%d ខែ',
y: 'មួយឆ្នាំ',
yy: '%d ឆ្នាំ'
}
};
dayjs.locale(locale, null, true);
export default locale;
@@ -0,0 +1,230 @@
var $8ee34951196858d0$exports = require("./utils.main.js");
var $9yLAi$reactariainteractions = require("@react-aria/interactions");
var $9yLAi$reactariafocus = require("@react-aria/focus");
var $9yLAi$reactariautils = require("@react-aria/utils");
var $9yLAi$react = require("react");
var $9yLAi$reactariai18n = require("@react-aria/i18n");
var $9yLAi$reactariaselection = require("@react-aria/selection");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useGridCell", () => $cf2021be63b01ef4$export$c7e10bfc0c59f67c);
/*
* 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.
*/
function $cf2021be63b01ef4$export$c7e10bfc0c59f67c(props, state, ref) {
let { node: node, isVirtualized: isVirtualized, focusMode: focusMode = 'child', shouldSelectOnPressUp: shouldSelectOnPressUp, onAction: onAction } = props;
let { direction: direction } = (0, $9yLAi$reactariai18n.useLocale)();
let { keyboardDelegate: keyboardDelegate, actions: { onCellAction: onCellAction } } = (0, $8ee34951196858d0$exports.gridMap).get(state);
// We need to track the key of the item at the time it was last focused so that we force
// focus to go to the item when the DOM node is reused for a different item in a virtualizer.
let keyWhenFocused = (0, $9yLAi$react.useRef)(null);
// Handles focusing the cell. If there is a focusable child,
// it is focused, otherwise the cell itself is focused.
let focus = ()=>{
if (ref.current) {
let treeWalker = (0, $9yLAi$reactariafocus.getFocusableTreeWalker)(ref.current);
if (focusMode === 'child') {
// If focus is already on a focusable child within the cell, early return so we don't shift focus
if (ref.current.contains(document.activeElement) && ref.current !== document.activeElement) return;
let focusable = state.selectionManager.childFocusStrategy === 'last' ? $cf2021be63b01ef4$var$last(treeWalker) : treeWalker.firstChild();
if (focusable) {
(0, $9yLAi$reactariainteractions.focusSafely)(focusable);
return;
}
}
if (keyWhenFocused.current != null && node.key !== keyWhenFocused.current || !ref.current.contains(document.activeElement)) (0, $9yLAi$reactariainteractions.focusSafely)(ref.current);
}
};
let { itemProps: itemProps, isPressed: isPressed } = (0, $9yLAi$reactariaselection.useSelectableItem)({
selectionManager: state.selectionManager,
key: node.key,
ref: ref,
isVirtualized: isVirtualized,
focus: focus,
shouldSelectOnPressUp: shouldSelectOnPressUp,
onAction: onCellAction ? ()=>onCellAction(node.key) : onAction,
isDisabled: state.collection.size === 0
});
let onKeyDownCapture = (e)=>{
if (!e.currentTarget.contains(e.target) || state.isKeyboardNavigationDisabled || !ref.current || !document.activeElement) return;
let walker = (0, $9yLAi$reactariafocus.getFocusableTreeWalker)(ref.current);
walker.currentNode = document.activeElement;
switch(e.key){
case 'ArrowLeft':
{
// Find the next focusable element within the cell.
let focusable = direction === 'rtl' ? walker.nextNode() : walker.previousNode();
// Don't focus the cell itself if focusMode is "child"
if (focusMode === 'child' && focusable === ref.current) focusable = null;
e.preventDefault();
e.stopPropagation();
if (focusable) {
(0, $9yLAi$reactariainteractions.focusSafely)(focusable);
(0, $9yLAi$reactariautils.scrollIntoViewport)(focusable, {
containingElement: (0, $9yLAi$reactariautils.getScrollParent)(ref.current)
});
} else {
var _keyboardDelegate_getKeyLeftOf;
// If there is no next focusable child, then move to the next cell to the left of this one.
// This will be handled by useSelectableCollection. However, if there is no cell to the left
// of this one, only one column, and the grid doesn't focus rows, then the next key will be the
// same as this one. In that case we need to handle focusing either the cell or the first/last
// child, depending on the focus mode.
let prev = (_keyboardDelegate_getKeyLeftOf = keyboardDelegate.getKeyLeftOf) === null || _keyboardDelegate_getKeyLeftOf === void 0 ? void 0 : _keyboardDelegate_getKeyLeftOf.call(keyboardDelegate, node.key);
if (prev !== node.key) {
var // We prevent the capturing event from reaching children of the cell, e.g. pickers.
// We want arrow keys to navigate to the next cell instead. We need to re-dispatch
// the event from a higher parent so it still bubbles and gets handled by useSelectableCollection.
_ref_current_parentElement;
(_ref_current_parentElement = ref.current.parentElement) === null || _ref_current_parentElement === void 0 ? void 0 : _ref_current_parentElement.dispatchEvent(new KeyboardEvent(e.nativeEvent.type, e.nativeEvent));
break;
}
if (focusMode === 'cell' && direction === 'rtl') {
(0, $9yLAi$reactariainteractions.focusSafely)(ref.current);
(0, $9yLAi$reactariautils.scrollIntoViewport)(ref.current, {
containingElement: (0, $9yLAi$reactariautils.getScrollParent)(ref.current)
});
} else {
walker.currentNode = ref.current;
focusable = direction === 'rtl' ? walker.firstChild() : $cf2021be63b01ef4$var$last(walker);
if (focusable) {
(0, $9yLAi$reactariainteractions.focusSafely)(focusable);
(0, $9yLAi$reactariautils.scrollIntoViewport)(focusable, {
containingElement: (0, $9yLAi$reactariautils.getScrollParent)(ref.current)
});
}
}
}
break;
}
case 'ArrowRight':
{
let focusable = direction === 'rtl' ? walker.previousNode() : walker.nextNode();
if (focusMode === 'child' && focusable === ref.current) focusable = null;
e.preventDefault();
e.stopPropagation();
if (focusable) {
(0, $9yLAi$reactariainteractions.focusSafely)(focusable);
(0, $9yLAi$reactariautils.scrollIntoViewport)(focusable, {
containingElement: (0, $9yLAi$reactariautils.getScrollParent)(ref.current)
});
} else {
var _keyboardDelegate_getKeyRightOf;
let next = (_keyboardDelegate_getKeyRightOf = keyboardDelegate.getKeyRightOf) === null || _keyboardDelegate_getKeyRightOf === void 0 ? void 0 : _keyboardDelegate_getKeyRightOf.call(keyboardDelegate, node.key);
if (next !== node.key) {
var // We prevent the capturing event from reaching children of the cell, e.g. pickers.
// We want arrow keys to navigate to the next cell instead. We need to re-dispatch
// the event from a higher parent so it still bubbles and gets handled by useSelectableCollection.
_ref_current_parentElement1;
(_ref_current_parentElement1 = ref.current.parentElement) === null || _ref_current_parentElement1 === void 0 ? void 0 : _ref_current_parentElement1.dispatchEvent(new KeyboardEvent(e.nativeEvent.type, e.nativeEvent));
break;
}
if (focusMode === 'cell' && direction === 'ltr') {
(0, $9yLAi$reactariainteractions.focusSafely)(ref.current);
(0, $9yLAi$reactariautils.scrollIntoViewport)(ref.current, {
containingElement: (0, $9yLAi$reactariautils.getScrollParent)(ref.current)
});
} else {
walker.currentNode = ref.current;
focusable = direction === 'rtl' ? $cf2021be63b01ef4$var$last(walker) : walker.firstChild();
if (focusable) {
(0, $9yLAi$reactariainteractions.focusSafely)(focusable);
(0, $9yLAi$reactariautils.scrollIntoViewport)(focusable, {
containingElement: (0, $9yLAi$reactariautils.getScrollParent)(ref.current)
});
}
}
}
break;
}
case 'ArrowUp':
case 'ArrowDown':
// Prevent this event from reaching cell children, e.g. menu buttons. We want arrow keys to navigate
// to the cell above/below instead. We need to re-dispatch the event from a higher parent so it still
// bubbles and gets handled by useSelectableCollection.
if (!e.altKey && ref.current.contains(e.target)) {
var _ref_current_parentElement2;
e.stopPropagation();
e.preventDefault();
(_ref_current_parentElement2 = ref.current.parentElement) === null || _ref_current_parentElement2 === void 0 ? void 0 : _ref_current_parentElement2.dispatchEvent(new KeyboardEvent(e.nativeEvent.type, e.nativeEvent));
}
break;
}
};
// Grid cells can have focusable elements inside them. In this case, focus should
// be marshalled to that element rather than focusing the cell itself.
let onFocus = (e)=>{
keyWhenFocused.current = node.key;
if (e.target !== ref.current) {
// useSelectableItem only handles setting the focused key when
// the focused element is the gridcell itself. We also want to
// set the focused key when a child element receives focus.
// If focus is currently visible (e.g. the user is navigating with the keyboard),
// then skip this. We want to restore focus to the previously focused row/cell
// in that case since the table should act like a single tab stop.
if (!(0, $9yLAi$reactariainteractions.isFocusVisible)()) state.selectionManager.setFocusedKey(node.key);
return;
}
// If the cell itself is focused, wait a frame so that focus finishes propagatating
// up to the tree, and move focus to a focusable child if possible.
requestAnimationFrame(()=>{
if (focusMode === 'child' && document.activeElement === ref.current) focus();
});
};
let gridCellProps = (0, $9yLAi$reactariautils.mergeProps)(itemProps, {
role: 'gridcell',
onKeyDownCapture: onKeyDownCapture,
'aria-colspan': node.colSpan,
'aria-colindex': node.colIndex != null ? node.colIndex + 1 : undefined,
colSpan: isVirtualized ? undefined : node.colSpan,
onFocus: onFocus
});
var _node_colIndex;
if (isVirtualized) gridCellProps['aria-colindex'] = ((_node_colIndex = node.colIndex) !== null && _node_colIndex !== void 0 ? _node_colIndex : node.index) + 1; // aria-colindex is 1-based
// When pressing with a pointer and cell selection is not enabled, usePress will be applied to the
// row rather than the cell. However, when the row is draggable, usePress cannot preventDefault
// on pointer down, so the browser will try to focus the cell which has a tabIndex applied.
// To avoid this, remove the tabIndex from the cell briefly on pointer down.
if (shouldSelectOnPressUp && gridCellProps.tabIndex != null && gridCellProps.onPointerDown == null) gridCellProps.onPointerDown = (e)=>{
let el = e.currentTarget;
let tabindex = el.getAttribute('tabindex');
el.removeAttribute('tabindex');
requestAnimationFrame(()=>{
if (tabindex != null) el.setAttribute('tabindex', tabindex);
});
};
return {
gridCellProps: gridCellProps,
isPressed: isPressed
};
}
function $cf2021be63b01ef4$var$last(walker) {
let next = null;
let last = null;
do {
last = walker.lastChild();
if (last) next = last;
}while (last);
return next;
}
//# sourceMappingURL=useGridCell.main.js.map
@@ -0,0 +1 @@
module.exports={A:{D:{"1":"0 1 2 3 4 5 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","33":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B UC 4B VC 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC Q H R S T U V W X"},L:{"1":"I"},B:{"1":"0 1 2 3 4 5 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","33":"C L M G N O P Q H R S T U V W X"},C:{"1":"0 1 2 3 4 5 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 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 0C 1C"},M:{"1":"MC"},A:{"2":"K D E F wC","33":"A B"},F:{"1":"0 1 2 3 4 5 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 FD GD HD ID NC uC JD OC","33":"6 7 8 9 G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC"},K:{"1":"H","2":"A B C NC uC OC"},E:{"1":"G 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","2":"ED","33":"J ZB K D E F A B C L M 2C ZC 3C 4C 5C 6C aC NC OC 7C"},G:{"1":"cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC","33":"E ZC KD vC LD MD ND OD PD QD RD SD TD UD VD WD XD YD ZD aD bD"},P:{"1":"6 7 8 9 AB BB CB DB EB FB xD QC RC SC yD","33":"J oD pD qD rD sD aC tD uD vD wD"},I:{"1":"I","2":"TC J iD jD kD lD vC","33":"mD nD"}},B:6,C:"::file-selector-button CSS pseudo-element",D:undefined};
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,iBAGY,CACT,CAAK,CAAC,SAAS,SAAS,aAAa,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,IAAI,IAAI,GAAG;IAAC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAA;CAAC,CAAC,GACrN,CAAK,CAAC,SAAS,SAAS,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,IAAI,IAAI,GAAG;IAAC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAA;CAAC,CAAC,GAC7M,CAAK,CAAC,SAAS,SAAS,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,IAAI,IAAI,GAAG;IAAC,IAAI,EAAE,SAAS,CAAA;CAAC,CAAC,GAC9L,CAAK,CAAC,SAAS,SAAS,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,IAAI,IAAI,GAAG,SAAS,CAAC,GACrL,CAAK,CAAC,SAAS,SAAS,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,IAAI,IAAI,GAAG,SAAS,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,GAC7M,CAAK,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,KAAK,KAAK,CAAC,GACxC,CAAK,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,IAAI,IAAI,CAAC,GACxJ,CAAK,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,CACpI,CA4CH;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,sBAGY,CACT,CAAK,CAAC,SAAS,SAAS,MAAM,EAAE,IAAI,EAAE,SAAS,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,IAAI,IAAI,GAAG;IAAC,IAAI,EAAE,SAAS,CAAA;CAAC,CAAC,GAClM,CAAK,CAAC,SAAS,SAAS,KAAK,EAAE,IAAI,EAAE,SAAS,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,IAAI,IAAI,GAAG,SAAS,CAAC,GACzL,CAAK,CAAC,SAAS,SAAS,YAAY,EAAE,IAAI,EAAE,SAAS,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,IAAI,IAAI,GAAG,SAAS,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,GACjN,CAAK,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,IAAI,IAAI,CAAC,GAC7J,CAAK,CAAC,IAAI,CAAC,EAAE,IAAI,KAAK,KAAK,CAAC,CACzB,CA8BH;sBA9KU,EAAE,EACF,QAAQ,IACR,EAAE,SAAS,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,IAAI,MAAM,KAAK,GAAG,KAAK,GAAG,QAAQ;;;;2BAMpE,OAAO,SAEP,OAAO,UAEP,MAAM,GAAG,IAAI,GAAG,SAAS,WAEzB,MAAM,GAAG,IAAI,GAAG,SAAS,KAEvB,OAAO;;;;;;oBAGP,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;;;;mBAK9B,KAAK,CAAC,KAAK,GAAG,YAAY,GAAG,MAAM,CAAC,GAAG,aAAa,CAAC,KAAK,GAAG,YAAY,GAAG,MAAM,CAAC,GAAG,KAAK,GAAG,YAAY,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS;;;;kCAKxI,OAAO,QAEP,IAAI,UAEJ,MAAM,GAAG,SAAS,WAElB,MAAM,GAAG,SAAS,KAEhB,OAAO,GAAG,SAAS,GAAG,IAAI;4BAzCR,OAAO;0BAAP,OAAO"}
@@ -0,0 +1,244 @@
# postcss-import
[![Build](https://img.shields.io/travis/postcss/postcss-import/master)](https://travis-ci.org/postcss/postcss-import)
[![Version](https://img.shields.io/npm/v/postcss-import)](https://github.com/postcss/postcss-import/blob/master/CHANGELOG.md)
[![postcss compatibility](https://img.shields.io/npm/dependency-version/postcss-import/peer/postcss)](https://postcss.org/)
> [PostCSS](https://github.com/postcss/postcss) plugin to transform `@import`
rules by inlining content.
This plugin can consume local files, node modules or web_modules.
To resolve path of an `@import` rule, it can look into root directory
(by default `process.cwd()`), `web_modules`, `node_modules`
or local modules.
_When importing a module, it will look for `index.css` or file referenced in
`package.json` in the `style` or `main` fields._
You can also provide manually multiples paths where to look at.
**Notes:**
- **This plugin should probably be used as the first plugin of your list.
This way, other plugins will work on the AST as if there were only a single file
to process, and will probably work as you can expect**.
- This plugin works great with
[postcss-url](https://github.com/postcss/postcss-url) plugin,
which will allow you to adjust assets `url()` (or even inline them) after
inlining imported files.
- In order to optimize output, **this plugin will only import a file once** on
a given scope (root, media query...).
Tests are made from the path & the content of imported files (using a hash
table).
If this behavior is not what you want, look at `skipDuplicates` option
- If you are looking for **Glob Imports**, you can use [postcss-import-ext-glob](https://github.com/dimitrinicolas/postcss-import-ext-glob) to extend postcss-import.
- Imports which are not modified (by `options.filter` or because they are remote
imports) are moved to the top of the output.
- **This plugin attempts to follow the CSS `@import` spec**; `@import`
statements must precede all other statements (besides `@charset`).
## Installation
```console
$ npm install -D postcss-import
```
## Usage
Unless your stylesheet is in the same place where you run postcss
(`process.cwd()`), you will need to use `from` option to make relative imports
work.
```js
// dependencies
const fs = require("fs")
const postcss = require("postcss")
const atImport = require("postcss-import")
// css to be processed
const css = fs.readFileSync("css/input.css", "utf8")
// process css
postcss()
.use(atImport())
.process(css, {
// `from` option is needed here
from: "css/input.css"
})
.then((result) => {
const output = result.css
console.log(output)
})
```
`css/input.css`:
```css
/* can consume `node_modules`, `web_modules` or local modules */
@import "cssrecipes-defaults"; /* == @import "../node_modules/cssrecipes-defaults/index.css"; */
@import "normalize.css"; /* == @import "../node_modules/normalize.css/normalize.css"; */
@import "foo.css"; /* relative to css/ according to `from` option above */
@import "bar.css" (min-width: 25em);
@import 'baz.css' layer(baz-layer);
body {
background: black;
}
```
will give you:
```css
/* ... content of ../node_modules/cssrecipes-defaults/index.css */
/* ... content of ../node_modules/normalize.css/normalize.css */
/* ... content of css/foo.css */
@media (min-width: 25em) {
/* ... content of css/bar.css */
}
@layer baz-layer {
/* ... content of css/baz.css */
}
body {
background: black;
}
```
Checkout the [tests](test) for more examples.
### Options
### `filter`
Type: `Function`
Default: `() => true`
Only transform imports for which the test function returns `true`. Imports for
which the test function returns `false` will be left as is. The function gets
the path to import as an argument and should return a boolean.
#### `root`
Type: `String`
Default: `process.cwd()` or _dirname of
[the postcss `from`](https://github.com/postcss/postcss#node-source)_
Define the root where to resolve path (eg: place where `node_modules` are).
Should not be used that much.
_Note: nested `@import` will additionally benefit of the relative dirname of
imported files._
#### `path`
Type: `String|Array`
Default: `[]`
A string or an array of paths in where to look for files.
#### `plugins`
Type: `Array`
Default: `undefined`
An array of plugins to be applied on each imported files.
#### `resolve`
Type: `Function`
Default: `null`
You can provide a custom path resolver with this option. This function gets
`(id, basedir, importOptions)` arguments and should return a path, an array of
paths or a promise resolving to the path(s). If you do not return an absolute
path, your path will be resolved to an absolute path using the default
resolver.
You can use [resolve](https://github.com/substack/node-resolve) for this.
#### `load`
Type: `Function`
Default: null
You can overwrite the default loading way by setting this option.
This function gets `(filename, importOptions)` arguments and returns content or
promised content.
#### `skipDuplicates`
Type: `Boolean`
Default: `true`
By default, similar files (based on the same content) are being skipped.
It's to optimize output and skip similar files like `normalize.css` for example.
If this behavior is not what you want, just set this option to `false` to
disable it.
#### `addModulesDirectories`
Type: `Array`
Default: `[]`
An array of folder names to add to [Node's resolver](https://github.com/substack/node-resolve).
Values will be appended to the default resolve directories:
`["node_modules", "web_modules"]`.
This option is only for adding additional directories to default resolver. If
you provide your own resolver via the `resolve` configuration option above, then
this value will be ignored.
#### `nameLayer`
Type: `Function`
Default: `null`
You can provide a custom naming function for anonymous layers (`@import 'baz.css' layer;`).
This function gets `(index, rootFilename)` arguments and should return a unique string.
This option only influences imports without a layer name.
Without this option the plugin will warn on anonymous layers.
#### Example with some options
```js
const postcss = require("postcss")
const atImport = require("postcss-import")
postcss()
.use(atImport({
path: ["src/css"],
}))
.process(cssString)
.then((result) => {
const { css } = result
})
```
## `dependency` Message Support
`postcss-import` adds a message to `result.messages` for each `@import`. Messages are in the following format:
```
{
type: 'dependency',
file: absoluteFilePath,
parent: fileContainingTheImport
}
```
This is mainly for use by postcss runners that implement file watching.
---
## CONTRIBUTING
* ⇄ Pull requests and ★ Stars are always welcome.
* For bugs and feature requests, please create an issue.
* Pull requests must be accompanied by passing automated tests (`$ npm test`).
## [Changelog](CHANGELOG.md)
## [License](LICENSE)
@@ -0,0 +1,135 @@
import type { IToken, IGetToken } from '@tokenizer/token';
export declare const UINT8: IToken<number>;
/**
* 16-bit unsigned integer, Little Endian byte order
*/
export declare const UINT16_LE: IToken<number>;
/**
* 16-bit unsigned integer, Big Endian byte order
*/
export declare const UINT16_BE: IToken<number>;
/**
* 24-bit unsigned integer, Little Endian byte order
*/
export declare const UINT24_LE: IToken<number>;
/**
* 24-bit unsigned integer, Big Endian byte order
*/
export declare const UINT24_BE: IToken<number>;
/**
* 32-bit unsigned integer, Little Endian byte order
*/
export declare const UINT32_LE: IToken<number>;
/**
* 32-bit unsigned integer, Big Endian byte order
*/
export declare const UINT32_BE: IToken<number>;
/**
* 8-bit signed integer
*/
export declare const INT8: IToken<number>;
/**
* 16-bit signed integer, Big Endian byte order
*/
export declare const INT16_BE: IToken<number>;
/**
* 16-bit signed integer, Little Endian byte order
*/
export declare const INT16_LE: IToken<number>;
/**
* 24-bit signed integer, Little Endian byte order
*/
export declare const INT24_LE: IToken<number>;
/**
* 24-bit signed integer, Big Endian byte order
*/
export declare const INT24_BE: IToken<number>;
/**
* 32-bit signed integer, Big Endian byte order
*/
export declare const INT32_BE: IToken<number>;
/**
* 32-bit signed integer, Big Endian byte order
*/
export declare const INT32_LE: IToken<number>;
/**
* 64-bit unsigned integer, Little Endian byte order
*/
export declare const UINT64_LE: IToken<bigint>;
/**
* 64-bit signed integer, Little Endian byte order
*/
export declare const INT64_LE: IToken<bigint>;
/**
* 64-bit unsigned integer, Big Endian byte order
*/
export declare const UINT64_BE: IToken<bigint>;
/**
* 64-bit signed integer, Big Endian byte order
*/
export declare const INT64_BE: IToken<bigint>;
/**
* IEEE 754 16-bit (half precision) float, big endian
*/
export declare const Float16_BE: IToken<number>;
/**
* IEEE 754 16-bit (half precision) float, little endian
*/
export declare const Float16_LE: IToken<number>;
/**
* IEEE 754 32-bit (single precision) float, big endian
*/
export declare const Float32_BE: IToken<number>;
/**
* IEEE 754 32-bit (single precision) float, little endian
*/
export declare const Float32_LE: IToken<number>;
/**
* IEEE 754 64-bit (double precision) float, big endian
*/
export declare const Float64_BE: IToken<number>;
/**
* IEEE 754 64-bit (double precision) float, little endian
*/
export declare const Float64_LE: IToken<number>;
/**
* IEEE 754 80-bit (extended precision) float, big endian
*/
export declare const Float80_BE: IToken<number>;
/**
* IEEE 754 80-bit (extended precision) float, little endian
*/
export declare const Float80_LE: IToken<number>;
/**
* Ignore a given number of bytes
*/
export declare class IgnoreType implements IGetToken<void> {
len: number;
/**
* @param len number of bytes to ignore
*/
constructor(len: number);
get(_array: Uint8Array, _off: number): void;
}
export declare class Uint8ArrayType implements IGetToken<Uint8Array> {
len: number;
constructor(len: number);
get(array: Uint8Array, offset: number): Uint8Array;
}
/**
* Consume a fixed number of bytes from the stream and return a string with a specified encoding.
* Supports all encodings supported by TextDecoder, plus 'windows-1252'.
*/
export declare class StringType implements IGetToken<string> {
len: number;
private encoding?;
constructor(len: number, encoding?: string);
get(data: Uint8Array, offset?: number): string;
}
/**
* ANSI Latin 1 String using Windows-1252 (Code Page 1252)
* Windows-1252 is a superset of ISO 8859-1 / Latin-1.
*/
export declare class AnsiStringType extends StringType {
constructor(len: number);
}
@@ -0,0 +1,125 @@
{
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
"bugs": "https://github.com/remarkjs/remark-gfm/issues",
"contributors": [
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
],
"dependencies": {
"@types/mdast": "^4.0.0",
"mdast-util-gfm": "^3.0.0",
"micromark-extension-gfm": "^3.0.0",
"remark-parse": "^11.0.0",
"remark-stringify": "^11.0.0",
"unified": "^11.0.0"
},
"description": "remark plugin to support GFM (autolink literals, footnotes, strikethrough, tables, tasklists)",
"devDependencies": {
"@types/node": "^22.0.0",
"c8": "^10.0.0",
"is-hidden": "^2.0.0",
"prettier": "^3.0.0",
"remark": "^15.0.0",
"remark-cli": "^12.0.0",
"remark-preset-wooorm": "^11.0.0",
"string-width": "^6.0.0",
"to-vfile": "^8.0.0",
"type-coverage": "^2.0.0",
"typescript": "^5.0.0",
"xo": "^0.60.0"
},
"exports": "./index.js",
"files": [
"index.d.ts",
"index.js",
"lib/"
],
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/unified"
},
"keywords": [
"autolink",
"footnote",
"gfm",
"github",
"markdown",
"mdast",
"plugin",
"remark",
"remark-plugin",
"strikethrough",
"table",
"tasklist",
"unified"
],
"license": "MIT",
"name": "remark-gfm",
"prettier": {
"bracketSpacing": false,
"singleQuote": true,
"semi": false,
"tabWidth": 2,
"trailingComma": "none",
"useTabs": false
},
"remarkConfig": {
"plugins": [
"remark-preset-wooorm"
]
},
"repository": "remarkjs/remark-gfm",
"scripts": {
"build": "tsc --build --clean && tsc --build && type-coverage",
"format": "remark . --frail --output --quiet && prettier . --log-level warn --write && xo --fix",
"prepack": "npm run build && npm run format",
"test": "npm run build && npm run format && npm run test-coverage",
"test-api": "node --conditions development test/index.js",
"test-coverage": "c8 --100 --reporter lcov npm run test-api"
},
"sideEffects": false,
"typeCoverage": {
"atLeast": 100,
"strict": true
},
"type": "module",
"version": "4.0.1",
"xo": {
"overrides": [
{
"files": [
"**/*.d.ts"
],
"rules": {
"@typescript-eslint/array-type": [
"error",
{
"default": "generic"
}
],
"@typescript-eslint/ban-types": [
"error",
{
"extendDefaults": true
}
],
"@typescript-eslint/consistent-type-definitions": [
"error",
"interface"
]
}
},
{
"files": [
"test/**/*.js"
],
"rules": {
"no-await-in-loop": "off"
}
}
],
"prettier": true,
"rules": {
"logical-assignment-operators": "off"
}
}
}
@@ -0,0 +1,64 @@
var $625cf83917e112ad$exports = require("./utils.main.js");
var $hrHul$react = require("react");
var $hrHul$reactariautils = require("@react-aria/utils");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$export(module.exports, "useFocus", () => $5cb73d0ce355b0dc$export$f8168d8dd8fd66e6);
/*
* 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.
*/ // Portions of the code in this file are based on code from react.
// Original licensing for the following can be found in the
// NOTICE file in the root directory of this source tree.
// See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions
function $5cb73d0ce355b0dc$export$f8168d8dd8fd66e6(props) {
let { isDisabled: isDisabled, onFocus: onFocusProp, onBlur: onBlurProp, onFocusChange: onFocusChange } = props;
const onBlur = (0, $hrHul$react.useCallback)((e)=>{
if (e.target === e.currentTarget) {
if (onBlurProp) onBlurProp(e);
if (onFocusChange) onFocusChange(false);
return true;
}
}, [
onBlurProp,
onFocusChange
]);
const onSyntheticFocus = (0, $625cf83917e112ad$exports.useSyntheticBlurEvent)(onBlur);
const onFocus = (0, $hrHul$react.useCallback)((e)=>{
// Double check that document.activeElement actually matches e.target in case a previously chained
// focus handler already moved focus somewhere else.
const ownerDocument = (0, $hrHul$reactariautils.getOwnerDocument)(e.target);
if (e.target === e.currentTarget && ownerDocument.activeElement === e.target) {
if (onFocusProp) onFocusProp(e);
if (onFocusChange) onFocusChange(true);
onSyntheticFocus(e);
}
}, [
onFocusChange,
onFocusProp,
onSyntheticFocus
]);
return {
focusProps: {
onFocus: !isDisabled && (onFocusProp || onFocusChange || onBlurProp) ? onFocus : undefined,
onBlur: !isDisabled && (onBlurProp || onFocusChange) ? onBlur : undefined
}
};
}
//# sourceMappingURL=useFocus.main.js.map
@@ -0,0 +1,285 @@
/**
* @fileoverview Standardize the way function component get defined
* @author Stefan Wullems
*/
'use strict';
const arrayIncludes = require('array-includes');
const Components = require('../util/Components');
const docsUrl = require('../util/docsUrl');
const reportC = require('../util/report');
const getText = require('../util/eslint').getText;
const propsUtil = require('../util/props');
// ------------------------------------------------------------------------------
// Rule Definition
// ------------------------------------------------------------------------------
function buildFunction(template, parts) {
return Object.keys(parts).reduce(
(acc, key) => acc.replace(`{${key}}`, () => parts[key] || ''),
template
);
}
const NAMED_FUNCTION_TEMPLATES = {
'function-declaration': 'function {name}{typeParams}({params}){returnType} {body}',
'arrow-function': '{varType} {name}{typeAnnotation} = {typeParams}({params}){returnType} => {body}',
'function-expression': '{varType} {name}{typeAnnotation} = function{typeParams}({params}){returnType} {body}',
};
const UNNAMED_FUNCTION_TEMPLATES = {
'function-expression': 'function{typeParams}({params}){returnType} {body}',
'arrow-function': '{typeParams}({params}){returnType} => {body}',
};
function hasOneUnconstrainedTypeParam(node) {
const nodeTypeArguments = propsUtil.getTypeArguments(node);
return nodeTypeArguments
&& nodeTypeArguments.params
&& nodeTypeArguments.params.length === 1
&& !nodeTypeArguments.params[0].constraint;
}
function hasName(node) {
return (
node.type === 'FunctionDeclaration'
|| node.parent.type === 'VariableDeclarator'
);
}
function getNodeText(prop, source) {
if (!prop) return null;
return source.slice(prop.range[0], prop.range[1]);
}
function getName(node) {
if (node.type === 'FunctionDeclaration') {
return node.id.name;
}
if (
node.type === 'ArrowFunctionExpression'
|| node.type === 'FunctionExpression'
) {
return hasName(node) && node.parent.id.name;
}
}
function getParams(node, source) {
if (node.params.length === 0) return null;
return source.slice(
node.params[0].range[0],
node.params[node.params.length - 1].range[1]
);
}
function getBody(node, source) {
const range = node.body.range;
if (node.body.type !== 'BlockStatement') {
return ['{', ` return ${source.slice(range[0], range[1])}`, '}'].join('\n');
}
return source.slice(range[0], range[1]);
}
function getTypeAnnotation(node, source) {
if (!hasName(node) || node.type === 'FunctionDeclaration') return;
if (
node.type === 'ArrowFunctionExpression'
|| node.type === 'FunctionExpression'
) {
return getNodeText(node.parent.id.typeAnnotation, source);
}
}
function isUnfixableBecauseOfExport(node) {
return (
node.type === 'FunctionDeclaration'
&& node.parent
&& node.parent.type === 'ExportDefaultDeclaration'
);
}
function isFunctionExpressionWithName(node) {
return node.type === 'FunctionExpression' && node.id && node.id.name;
}
const messages = {
'function-declaration': 'Function component is not a function declaration',
'function-expression': 'Function component is not a function expression',
'arrow-function': 'Function component is not an arrow function',
};
/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
docs: {
description: 'Enforce a specific function type for function components',
category: 'Stylistic Issues',
recommended: false,
url: docsUrl('function-component-definition'),
},
fixable: 'code',
messages,
schema: [
{
type: 'object',
properties: {
namedComponents: {
anyOf: [
{
enum: [
'function-declaration',
'arrow-function',
'function-expression',
],
},
{
type: 'array',
items: {
type: 'string',
enum: [
'function-declaration',
'arrow-function',
'function-expression',
],
},
},
],
},
unnamedComponents: {
anyOf: [
{ enum: ['arrow-function', 'function-expression'] },
{
type: 'array',
items: {
type: 'string',
enum: ['arrow-function', 'function-expression'],
},
},
],
},
},
},
],
},
create: Components.detect((context, components) => {
const configuration = context.options[0] || {};
let fileVarType = 'var';
const namedConfig = [].concat(
configuration.namedComponents || 'function-declaration'
);
const unnamedConfig = [].concat(
configuration.unnamedComponents || 'function-expression'
);
function getFixer(node, options) {
const source = getText(context);
const typeAnnotation = getTypeAnnotation(node, source);
if (options.type === 'function-declaration' && typeAnnotation) {
return;
}
if (options.type === 'arrow-function' && hasOneUnconstrainedTypeParam(node)) {
return;
}
if (isUnfixableBecauseOfExport(node)) return;
if (isFunctionExpressionWithName(node)) return;
let varType = fileVarType;
if (
(node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression')
&& node.parent.type === 'VariableDeclarator'
) {
varType = node.parent.parent.kind;
}
const nodeTypeArguments = propsUtil.getTypeArguments(node);
return (fixer) => fixer.replaceTextRange(
options.range,
buildFunction(options.template, {
typeAnnotation,
typeParams: getNodeText(nodeTypeArguments, source),
params: getParams(node, source),
returnType: getNodeText(node.returnType, source),
body: getBody(node, source),
name: getName(node),
varType,
})
);
}
function report(node, options) {
reportC(context, messages[options.messageId], options.messageId, {
node,
fix: getFixer(node, options.fixerOptions),
});
}
function validate(node, functionType) {
if (!components.get(node)) return;
if (node.parent && node.parent.type === 'Property') return;
if (hasName(node) && !arrayIncludes(namedConfig, functionType)) {
report(node, {
messageId: namedConfig[0],
fixerOptions: {
type: namedConfig[0],
template: NAMED_FUNCTION_TEMPLATES[namedConfig[0]],
range:
node.type === 'FunctionDeclaration'
? node.range
: node.parent.parent.range,
},
});
}
if (!hasName(node) && !arrayIncludes(unnamedConfig, functionType)) {
report(node, {
messageId: unnamedConfig[0],
fixerOptions: {
type: unnamedConfig[0],
template: UNNAMED_FUNCTION_TEMPLATES[unnamedConfig[0]],
range: node.range,
},
});
}
}
// --------------------------------------------------------------------------
// Public
// --------------------------------------------------------------------------
const validatePairs = [];
let hasES6OrJsx = false;
return {
FunctionDeclaration(node) {
validatePairs.push([node, 'function-declaration']);
},
ArrowFunctionExpression(node) {
validatePairs.push([node, 'arrow-function']);
},
FunctionExpression(node) {
validatePairs.push([node, 'function-expression']);
},
VariableDeclaration(node) {
hasES6OrJsx = hasES6OrJsx || node.kind === 'const' || node.kind === 'let';
},
'Program:exit'() {
if (hasES6OrJsx) fileVarType = 'const';
validatePairs.forEach((pair) => validate(pair[0], pair[1]));
},
'ImportDeclaration, ExportNamedDeclaration, ExportDefaultDeclaration, ExportAllDeclaration, ExportSpecifier, ExportDefaultSpecifier, JSXElement, TSExportAssignment, TSImportEqualsDeclaration'() {
hasES6OrJsx = true;
},
};
}),
};
@@ -0,0 +1 @@
{"version":3,"file":"package-path.js","sourceRoot":"","sources":["../../src/utils/package-path.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAA;AAI5B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAE5C,MAAM,UAAU,qBAAqB,CAAC,OAAoB;IACxD,OAAO,kBAAkB,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;AACrD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IACjD,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAE,CAAC,CAAA;AAChD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IACjD,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAA;IAC3D,IAAI,GAAG,EAAE,CAAC;QAER,OAAO,GAAG,CAAC,IAAI,IAAI,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAA;IACvE,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
@@ -0,0 +1,55 @@
/**
* Type of jitter to apply to the delay.
* - `"none"`: no jitter is applied
* - `"full"`: full jitter is applied (random value between `0` and `delay`)
*/
export declare type JitterType = "none" | "full";
export declare type BackoffOptions = Partial<IBackOffOptions>;
export interface IBackOffOptions {
/**
* Decides whether the `startingDelay` should be applied before the first call.
* If `false`, the first call will occur without a delay.
* @defaultValue `false`
*/
delayFirstAttempt: boolean;
/**
* Decides whether a [jitter](https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/)
* should be applied to the delay. Possible values are `"full"` and `"none"`.
* @defaultValue `"none"`
*/
jitter: JitterType;
/**
* The maximum delay, in milliseconds, between two consecutive attempts.
* @defaultValue `Infinity`
*/
maxDelay: number;
/**
* The maximum number of times to attempt the function.
* Must be at least `1`.
* @defaultValue `10`
*/
numOfAttempts: number;
/**
* The `retry` function can be used to run logic after every failed attempt (e.g. logging a message,
* assessing the last error, etc.).
* It is called with the last error and the upcoming attempt number.
* Returning `true` will retry the function as long as the `numOfAttempts` has not been exceeded.
* Returning `false` will end the execution.
* @defaultValue a function that always returns `true`.
* @param e The last error thrown by the function.
* @param attemptNumber The upcoming attempt number.
* @returns `true` to retry the function, `false` to end the execution
*/
retry: (e: any, attemptNumber: number) => boolean | Promise<boolean>;
/**
* The delay, in milliseconds, before executing the function for the first time.
* @defaultValue `100`
*/
startingDelay: number;
/**
* The `startingDelay` is multiplied by the `timeMultiple` to increase the delay between reattempts.
* @defaultValue `2`
*/
timeMultiple: number;
}
export declare function getSanitizedOptions(options: BackoffOptions): IBackOffOptions;
@@ -0,0 +1 @@
!function(_,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("dayjs")):"function"==typeof define&&define.amd?define(["dayjs"],e):(_="undefined"!=typeof globalThis?globalThis:_||self).dayjs_locale_kn=e(_.dayjs)}(this,(function(_){"use strict";function e(_){return _&&"object"==typeof _&&"default"in _?_:{default:_}}var t=e(_),d={name:"kn",weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),ordinal:function(_){return _},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"}};return t.default.locale(d,null,!0),d}));
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2019 Adobe
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
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 CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
@@ -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.es2021_intl = void 0;
const base_config_1 = require("./base-config");
exports.es2021_intl = {
libs: [],
variables: [['Intl', base_config_1.TYPE_VALUE]],
};
@@ -0,0 +1 @@
module.exports={C:{"93":0.00845,"115":0.01691,"127":0.00845,"128":0.00423,"136":0.00845,"140":0.00845,"142":0.02536,"143":0.51147,"144":0.23249,"145":0.03382,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 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 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 125 126 129 130 131 132 133 134 135 137 138 139 141 146 147 3.5 3.6"},D:{"39":0.00845,"40":0.00423,"41":0.00845,"42":0.00423,"43":0.00423,"44":0.00423,"45":0.00845,"46":0.00845,"47":0.00423,"48":0.00845,"49":0.00845,"50":0.00845,"51":0.00423,"52":0.00423,"53":0.01268,"54":0.00423,"55":0.00423,"56":0.01268,"57":0.00423,"58":0.00845,"59":0.00845,"60":0.00845,"62":0.00423,"75":0.00423,"79":0.00423,"93":0.01691,"98":0.00423,"103":0.08454,"105":0.00845,"108":0.04227,"109":0.57065,"111":0.03804,"116":0.05495,"121":0.03804,"122":0.02114,"124":0.00423,"125":4.76383,"126":0.03804,"128":0.01691,"129":0.07186,"130":0.00845,"131":0.02959,"132":0.01268,"133":0.01691,"134":0.05495,"135":0.01268,"136":0.00845,"137":0.3762,"138":0.36352,"139":0.27053,"140":5.51201,"141":11.36218,"142":0.17753,"143":0.01691,_:"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 63 64 65 66 67 68 69 70 71 72 73 74 76 77 78 80 81 83 84 85 86 87 88 89 90 91 92 94 95 96 97 99 100 101 102 104 106 107 110 112 113 114 115 117 118 119 120 123 127 144 145"},F:{"91":0.00423,"92":0.00845,"120":0.06341,"121":0.00423,"122":0.36775,_:"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 89 90 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"14":0.00845,"17":0.00423,"90":0.00423,"105":0.00423,"109":0.00845,"114":0.02114,"131":0.00423,"136":0.01268,"138":0.00845,"139":0.13526,"140":1.54286,"141":5.60078,"142":0.01268,_:"12 13 15 16 18 79 80 81 83 84 85 86 87 88 89 91 92 93 94 95 96 97 98 99 100 101 102 103 104 106 107 108 110 111 112 113 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 132 133 134 135 137"},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 15.1 15.2-15.3 15.4 16.0 16.1 16.4 17.0 26.2","13.1":0.01691,"14.1":0.02114,"15.5":0.00423,"15.6":0.05072,"16.2":0.00423,"16.3":0.00845,"16.5":0.00845,"16.6":0.1099,"17.1":0.02536,"17.2":0.00845,"17.3":0.02536,"17.4":0.02114,"17.5":0.04227,"17.6":0.38043,"18.0":0.01691,"18.1":0.02114,"18.2":0.06763,"18.3":0.06763,"18.4":0.32125,"18.5-18.6":0.29589,"26.0":0.49879,"26.1":0.00423},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00179,"5.0-5.1":0,"6.0-6.1":0.00715,"7.0-7.1":0.00536,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.01609,"10.0-10.2":0.00179,"10.3":0.03038,"11.0-11.2":0.4504,"11.3-11.4":0.01072,"12.0-12.1":0.00357,"12.2-12.5":0.08758,"13.0-13.1":0,"13.2":0.00894,"13.3":0.00357,"13.4-13.7":0.0143,"14.0-14.4":0.03038,"14.5-14.8":0.03217,"15.0-15.1":0.03038,"15.2-15.3":0.02324,"15.4":0.02681,"15.5":0.03038,"15.6-15.8":0.39679,"16.0":0.05362,"16.1":0.10009,"16.2":0.05183,"16.3":0.09294,"16.4":0.02324,"16.5":0.04111,"16.6-16.7":0.53083,"17.0":0.03753,"17.1":0.05719,"17.2":0.04111,"17.3":0.06077,"17.4":0.10724,"17.5":0.18409,"17.6-17.7":0.4647,"18.0":0.10545,"18.1":0.21805,"18.2":0.11796,"18.3":0.37891,"18.4":0.19482,"18.5-18.6":9.93393,"26.0":1.22789,"26.1":0.04468},P:{"21":0.11398,"24":0.01036,"25":0.03108,"26":0.01036,"27":0.04145,"28":4.51761,"29":0.41446,_:"4 20 22 23 5.0-5.4 6.2-6.4 8.2 9.2 10.1 12.0 13.0 14.0 15.0 16.0 17.0 18.0","7.2-7.4":0.04145,"11.1-11.2":0.01036,"19.0":0.01036},I:{"0":0.00576,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},K:{"0":0.08082,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.11546},Q:{_:"14.9"},O:{_:"0"},H:{"0":0},L:{"0":40.47459}};
@@ -0,0 +1,16 @@
/**
* Check if the given character code, or the character code at the first
* character, is alphabetical.
*
* @param {string|number} character
* @returns {boolean} Whether `character` is alphabetical.
*/
export function isAlphabetical(character) {
const code =
typeof character === 'string' ? character.charCodeAt(0) : character
return (
(code >= 97 && code <= 122) /* a-z */ ||
(code >= 65 && code <= 90) /* A-Z */
)
}
@@ -0,0 +1,197 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SocksProxyAgent = void 0;
const socks_1 = require("socks");
const agent_base_1 = require("agent-base");
const debug_1 = __importDefault(require("debug"));
const dns_1 = __importDefault(require("dns"));
const tls_1 = __importDefault(require("tls"));
const debug = (0, debug_1.default)('socks-proxy-agent');
function parseSocksProxy(opts) {
var _a;
let port = 0;
let lookup = false;
let type = 5;
const host = opts.hostname;
if (host == null) {
throw new TypeError('No "host"');
}
if (typeof opts.port === 'number') {
port = opts.port;
}
else if (typeof opts.port === 'string') {
port = parseInt(opts.port, 10);
}
// From RFC 1928, Section 3: https://tools.ietf.org/html/rfc1928#section-3
// "The SOCKS service is conventionally located on TCP port 1080"
if (port == null) {
port = 1080;
}
// figure out if we want socks v4 or v5, based on the "protocol" used.
// Defaults to 5.
if (opts.protocol != null) {
switch (opts.protocol.replace(':', '')) {
case 'socks4':
lookup = true;
// pass through
case 'socks4a':
type = 4;
break;
case 'socks5':
lookup = true;
// pass through
case 'socks': // no version specified, default to 5h
case 'socks5h':
type = 5;
break;
default:
throw new TypeError(`A "socks" protocol must be specified! Got: ${String(opts.protocol)}`);
}
}
if (typeof opts.type !== 'undefined') {
if (opts.type === 4 || opts.type === 5) {
type = opts.type;
}
else {
throw new TypeError(`"type" must be 4 or 5, got: ${String(opts.type)}`);
}
}
const proxy = {
host,
port,
type
};
let userId = (_a = opts.userId) !== null && _a !== void 0 ? _a : opts.username;
let password = opts.password;
if (opts.auth != null) {
const auth = opts.auth.split(':');
userId = auth[0];
password = auth[1];
}
if (userId != null) {
Object.defineProperty(proxy, 'userId', {
value: userId,
enumerable: false
});
}
if (password != null) {
Object.defineProperty(proxy, 'password', {
value: password,
enumerable: false
});
}
return { lookup, proxy };
}
const normalizeProxyOptions = (input) => {
let proxyOptions;
if (typeof input === 'string') {
proxyOptions = new URL(input);
}
else {
proxyOptions = input;
}
if (proxyOptions == null) {
throw new TypeError('a SOCKS proxy server `host` and `port` must be specified!');
}
return proxyOptions;
};
class SocksProxyAgent extends agent_base_1.Agent {
constructor(input, options) {
var _a;
const proxyOptions = normalizeProxyOptions(input);
super(proxyOptions);
const parsedProxy = parseSocksProxy(proxyOptions);
this.shouldLookup = parsedProxy.lookup;
this.proxy = parsedProxy.proxy;
this.tlsConnectionOptions = proxyOptions.tls != null ? proxyOptions.tls : {};
this.timeout = (_a = options === null || options === void 0 ? void 0 : options.timeout) !== null && _a !== void 0 ? _a : null;
}
/**
* Initiates a SOCKS connection to the specified SOCKS proxy server,
* which in turn connects to the specified remote host and port.
*
* @api protected
*/
callback(req, opts) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
const { shouldLookup, proxy, timeout } = this;
let { host, port, lookup: lookupCallback } = opts;
if (host == null) {
throw new Error('No `host` defined!');
}
if (shouldLookup) {
// Client-side DNS resolution for "4" and "5" socks proxy versions.
host = yield new Promise((resolve, reject) => {
// Use the request's custom lookup, if one was configured:
const lookupFn = lookupCallback !== null && lookupCallback !== void 0 ? lookupCallback : dns_1.default.lookup;
lookupFn(host, {}, (err, res) => {
if (err) {
reject(err);
}
else {
resolve(res);
}
});
});
}
const socksOpts = {
proxy,
destination: { host, port },
command: 'connect',
timeout: timeout !== null && timeout !== void 0 ? timeout : undefined
};
const cleanup = (tlsSocket) => {
req.destroy();
socket.destroy();
if (tlsSocket)
tlsSocket.destroy();
};
debug('Creating socks proxy connection: %o', socksOpts);
const { socket } = yield socks_1.SocksClient.createConnection(socksOpts);
debug('Successfully created socks proxy connection');
if (timeout !== null) {
socket.setTimeout(timeout);
socket.on('timeout', () => cleanup());
}
if (opts.secureEndpoint) {
// The proxy is connecting to a TLS server, so upgrade
// this socket connection to a TLS connection.
debug('Upgrading socket connection to TLS');
const servername = (_a = opts.servername) !== null && _a !== void 0 ? _a : opts.host;
const tlsSocket = tls_1.default.connect(Object.assign(Object.assign(Object.assign({}, omit(opts, 'host', 'hostname', 'path', 'port')), { socket,
servername }), this.tlsConnectionOptions));
tlsSocket.once('error', (error) => {
debug('socket TLS error', error.message);
cleanup(tlsSocket);
});
return tlsSocket;
}
return socket;
});
}
}
exports.SocksProxyAgent = SocksProxyAgent;
function omit(obj, ...keys) {
const ret = {};
let key;
for (key in obj) {
if (!keys.includes(key)) {
ret[key] = obj[key];
}
}
return ret;
}
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"name":"@babel/code-frame","version":"7.27.1","requiresBuild":false,"files":{"LICENSE":{"checkedAt":1794532116556,"integrity":"sha512-KYRMN3MVTuiy5XkFDHd5PnQmHaQnt3z16nsBDePxZ9YNmq7IFlslpBBlR3UI+zvlbEemzowOYeKil9a0ZkOYxQ==","mode":420,"size":1106},"README.md":{"checkedAt":1794532116556,"integrity":"sha512-7S0Ux5upB47lNoYM42Y6XY2YXX76IJGOd9GVJ0NjbCAGLVd0+Z4LtaEZpQOBPGmHxmoGmRLgrBIT4DlelSfoaw==","mode":420,"size":334},"lib/index.js":{"checkedAt":1794532116556,"integrity":"sha512-RVEPkxNHmzlmR+9pWrVnlhnB2EigTkivje20tEN7zzbRqSZO0TFr1dBz6SbuD0z0frCBucXQuGx5/ahpg/0hkw==","mode":420,"size":6993},"lib/index.js.map":{"checkedAt":1794532116556,"integrity":"sha512-kiFi/DoCVDfMm3NMrZlH00RyAhi0U2R1nXY5CHNyG50wbpeIICud31fW34+jsOu2rW6Ucy4rNMifCwDt2LzRqg==","mode":420,"size":23847},"package.json":{"checkedAt":1794532116557,"integrity":"sha512-OehNTHLukL7KbGOK2FdZEIbR9j6hlJdUkPYtmyPWmwdWt/1KPm77MpFRKKc1LwfiYtZmEcPPVzv43LocxDQ8dg==","mode":420,"size":880}}}
@@ -0,0 +1,72 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
exports.default = (0, util_1.createRule)({
name: 'prefer-as-const',
meta: {
type: 'suggestion',
docs: {
description: 'Enforce the use of `as const` over literal type',
recommended: 'recommended',
},
fixable: 'code',
hasSuggestions: true,
messages: {
preferConstAssertion: 'Expected a `const` instead of a literal type assertion.',
variableConstAssertion: 'Expected a `const` assertion instead of a literal type annotation.',
variableSuggest: 'You should use `as const` instead of type annotation.',
},
schema: [],
},
defaultOptions: [],
create(context) {
function compareTypes(valueNode, typeNode, canFix) {
if (valueNode.type === utils_1.AST_NODE_TYPES.Literal &&
typeNode.type === utils_1.AST_NODE_TYPES.TSLiteralType &&
typeNode.literal.type === utils_1.AST_NODE_TYPES.Literal &&
valueNode.raw === typeNode.literal.raw) {
if (canFix) {
context.report({
node: typeNode,
messageId: 'preferConstAssertion',
fix: fixer => fixer.replaceText(typeNode, 'const'),
});
}
else {
context.report({
node: typeNode,
messageId: 'variableConstAssertion',
suggest: [
{
messageId: 'variableSuggest',
fix: (fixer) => [
fixer.remove(typeNode.parent),
fixer.insertTextAfter(valueNode, ' as const'),
],
},
],
});
}
}
}
return {
PropertyDefinition(node) {
if (node.value && node.typeAnnotation) {
compareTypes(node.value, node.typeAnnotation.typeAnnotation, false);
}
},
TSAsExpression(node) {
compareTypes(node.expression, node.typeAnnotation, true);
},
TSTypeAssertion(node) {
compareTypes(node.expression, node.typeAnnotation, true);
},
VariableDeclarator(node) {
if (node.init && node.id.typeAnnotation) {
compareTypes(node.init, node.id.typeAnnotation.typeAnnotation, false);
}
},
};
},
});
@@ -0,0 +1,289 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
updateAllClasses: function() {
return updateAllClasses;
},
asValue: function() {
return asValue;
},
parseColorFormat: function() {
return parseColorFormat;
},
asColor: function() {
return asColor;
},
asLookupValue: function() {
return asLookupValue;
},
typeMap: function() {
return typeMap;
},
coerceValue: function() {
return coerceValue;
},
getMatchingTypes: function() {
return getMatchingTypes;
}
});
const _escapeCommas = /*#__PURE__*/ _interop_require_default(require("./escapeCommas"));
const _withAlphaVariable = require("./withAlphaVariable");
const _dataTypes = require("./dataTypes");
const _negateValue = /*#__PURE__*/ _interop_require_default(require("./negateValue"));
const _validateFormalSyntax = require("./validateFormalSyntax");
const _featureFlags = require("../featureFlags.js");
function _interop_require_default(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
function updateAllClasses(selectors, updateClass) {
selectors.walkClasses((sel)=>{
sel.value = updateClass(sel.value);
if (sel.raws && sel.raws.value) {
sel.raws.value = (0, _escapeCommas.default)(sel.raws.value);
}
});
}
function resolveArbitraryValue(modifier, validate) {
if (!isArbitraryValue(modifier)) {
return undefined;
}
let value = modifier.slice(1, -1);
if (!validate(value)) {
return undefined;
}
return (0, _dataTypes.normalize)(value);
}
function asNegativeValue(modifier, lookup = {}, validate) {
let positiveValue = lookup[modifier];
if (positiveValue !== undefined) {
return (0, _negateValue.default)(positiveValue);
}
if (isArbitraryValue(modifier)) {
let resolved = resolveArbitraryValue(modifier, validate);
if (resolved === undefined) {
return undefined;
}
return (0, _negateValue.default)(resolved);
}
}
function asValue(modifier, options = {}, { validate =()=>true } = {}) {
var _options_values;
let value = (_options_values = options.values) === null || _options_values === void 0 ? void 0 : _options_values[modifier];
if (value !== undefined) {
return value;
}
if (options.supportsNegativeValues && modifier.startsWith("-")) {
return asNegativeValue(modifier.slice(1), options.values, validate);
}
return resolveArbitraryValue(modifier, validate);
}
function isArbitraryValue(input) {
return input.startsWith("[") && input.endsWith("]");
}
function splitUtilityModifier(modifier) {
let slashIdx = modifier.lastIndexOf("/");
// If the `/` is inside an arbitrary, we want to find the previous one if any
// This logic probably isn't perfect but it should work for most cases
let arbitraryStartIdx = modifier.lastIndexOf("[", slashIdx);
let arbitraryEndIdx = modifier.indexOf("]", slashIdx);
let isNextToArbitrary = modifier[slashIdx - 1] === "]" || modifier[slashIdx + 1] === "[";
// Backtrack to the previous `/` if the one we found was inside an arbitrary
if (!isNextToArbitrary) {
if (arbitraryStartIdx !== -1 && arbitraryEndIdx !== -1) {
if (arbitraryStartIdx < slashIdx && slashIdx < arbitraryEndIdx) {
slashIdx = modifier.lastIndexOf("/", arbitraryStartIdx);
}
}
}
if (slashIdx === -1 || slashIdx === modifier.length - 1) {
return [
modifier,
undefined
];
}
let arbitrary = isArbitraryValue(modifier);
// The modifier could be of the form `[foo]/[bar]`
// We want to handle this case properly
// without affecting `[foo/bar]`
if (arbitrary && !modifier.includes("]/[")) {
return [
modifier,
undefined
];
}
return [
modifier.slice(0, slashIdx),
modifier.slice(slashIdx + 1)
];
}
function parseColorFormat(value) {
if (typeof value === "string" && value.includes("<alpha-value>")) {
let oldValue = value;
return ({ opacityValue =1 })=>oldValue.replace(/<alpha-value>/g, opacityValue);
}
return value;
}
function unwrapArbitraryModifier(modifier) {
return (0, _dataTypes.normalize)(modifier.slice(1, -1));
}
function asColor(modifier, options = {}, { tailwindConfig ={} } = {}) {
var _options_values;
if (((_options_values = options.values) === null || _options_values === void 0 ? void 0 : _options_values[modifier]) !== undefined) {
var _options_values1;
return parseColorFormat((_options_values1 = options.values) === null || _options_values1 === void 0 ? void 0 : _options_values1[modifier]);
}
// TODO: Hoist this up to getMatchingTypes or something
// We do this here because we need the alpha value (if any)
let [color, alpha] = splitUtilityModifier(modifier);
if (alpha !== undefined) {
var _options_values2, _tailwindConfig_theme, _tailwindConfig_theme_opacity;
var _options_values_color;
let normalizedColor = (_options_values_color = (_options_values2 = options.values) === null || _options_values2 === void 0 ? void 0 : _options_values2[color]) !== null && _options_values_color !== void 0 ? _options_values_color : isArbitraryValue(color) ? color.slice(1, -1) : undefined;
if (normalizedColor === undefined) {
return undefined;
}
normalizedColor = parseColorFormat(normalizedColor);
if (isArbitraryValue(alpha)) {
return (0, _withAlphaVariable.withAlphaValue)(normalizedColor, unwrapArbitraryModifier(alpha));
}
if (((_tailwindConfig_theme = tailwindConfig.theme) === null || _tailwindConfig_theme === void 0 ? void 0 : (_tailwindConfig_theme_opacity = _tailwindConfig_theme.opacity) === null || _tailwindConfig_theme_opacity === void 0 ? void 0 : _tailwindConfig_theme_opacity[alpha]) === undefined) {
return undefined;
}
return (0, _withAlphaVariable.withAlphaValue)(normalizedColor, tailwindConfig.theme.opacity[alpha]);
}
return asValue(modifier, options, {
validate: _dataTypes.color
});
}
function asLookupValue(modifier, options = {}) {
var _options_values;
return (_options_values = options.values) === null || _options_values === void 0 ? void 0 : _options_values[modifier];
}
function guess(validate) {
return (modifier, options)=>{
return asValue(modifier, options, {
validate
});
};
}
let typeMap = {
any: asValue,
color: asColor,
url: guess(_dataTypes.url),
image: guess(_dataTypes.image),
length: guess(_dataTypes.length),
percentage: guess(_dataTypes.percentage),
position: guess(_dataTypes.position),
lookup: asLookupValue,
"generic-name": guess(_dataTypes.genericName),
"family-name": guess(_dataTypes.familyName),
number: guess(_dataTypes.number),
"line-width": guess(_dataTypes.lineWidth),
"absolute-size": guess(_dataTypes.absoluteSize),
"relative-size": guess(_dataTypes.relativeSize),
shadow: guess(_dataTypes.shadow),
size: guess(_validateFormalSyntax.backgroundSize)
};
let supportedTypes = Object.keys(typeMap);
function splitAtFirst(input, delim) {
let idx = input.indexOf(delim);
if (idx === -1) return [
undefined,
input
];
return [
input.slice(0, idx),
input.slice(idx + 1)
];
}
function coerceValue(types, modifier, options, tailwindConfig) {
if (options.values && modifier in options.values) {
for (let { type } of types !== null && types !== void 0 ? types : []){
let result = typeMap[type](modifier, options, {
tailwindConfig
});
if (result === undefined) {
continue;
}
return [
result,
type,
null
];
}
}
if (isArbitraryValue(modifier)) {
let arbitraryValue = modifier.slice(1, -1);
let [explicitType, value] = splitAtFirst(arbitraryValue, ":");
// It could be that this resolves to `url(https` which is not a valid
// identifier. We currently only support "simple" words with dashes or
// underscores. E.g.: family-name
if (!/^[\w-_]+$/g.test(explicitType)) {
value = arbitraryValue;
} else if (explicitType !== undefined && !supportedTypes.includes(explicitType)) {
return [];
}
if (value.length > 0 && supportedTypes.includes(explicitType)) {
return [
asValue(`[${value}]`, options),
explicitType,
null
];
}
}
let matches = getMatchingTypes(types, modifier, options, tailwindConfig);
// Find first matching type
for (let match of matches){
return match;
}
return [];
}
function* getMatchingTypes(types, rawModifier, options, tailwindConfig) {
let modifiersEnabled = (0, _featureFlags.flagEnabled)(tailwindConfig, "generalizedModifiers");
let [modifier, utilityModifier] = splitUtilityModifier(rawModifier);
let canUseUtilityModifier = modifiersEnabled && options.modifiers != null && (options.modifiers === "any" || typeof options.modifiers === "object" && (utilityModifier && isArbitraryValue(utilityModifier) || utilityModifier in options.modifiers));
if (!canUseUtilityModifier) {
modifier = rawModifier;
utilityModifier = undefined;
}
if (utilityModifier !== undefined && modifier === "") {
modifier = "DEFAULT";
}
// Check the full value first
// TODO: Move to asValue… somehow
if (utilityModifier !== undefined) {
if (typeof options.modifiers === "object") {
var _options_modifiers;
var _options_modifiers_utilityModifier;
let configValue = (_options_modifiers_utilityModifier = (_options_modifiers = options.modifiers) === null || _options_modifiers === void 0 ? void 0 : _options_modifiers[utilityModifier]) !== null && _options_modifiers_utilityModifier !== void 0 ? _options_modifiers_utilityModifier : null;
if (configValue !== null) {
utilityModifier = configValue;
} else if (isArbitraryValue(utilityModifier)) {
utilityModifier = unwrapArbitraryModifier(utilityModifier);
}
}
}
for (let { type } of types !== null && types !== void 0 ? types : []){
let result = typeMap[type](modifier, options, {
tailwindConfig
});
if (result === undefined) {
continue;
}
yield [
result,
type,
utilityModifier !== null && utilityModifier !== void 0 ? utilityModifier : null
];
}
}
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014-present, 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,21 @@
The MIT License (MIT)
Copyright (c) 2014-present, 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 @@
module.exports={A:{A:{"1":"F A B","2":"wC","8":"K D E"},B:{"1":"C L M G N O P","129":"0 1 2 3 4 5 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB I"},C:{"1":"6 7 8 9 J ZB K D E F A B C L M G N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0C 1C","8":"xC TC","129":"0 1 2 3 4 5 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"},D:{"1":"6 7 8 9 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","4":"J","129":"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 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"},E:{"1":"ZB K D E F B C L M G 3C 4C 5C 6C aC NC OC 7C 8C 9C bC cC PC AD QC dC eC fC gC hC BD RC iC jC kC lC mC CD SC nC oC pC qC rC sC tC DD ED","8":"J 2C ZC","129":"A"},F:{"1":"6 7 8 9 B C N O P aB AB BB CB DB EB FB bB cB dB eB fB gB hB iB jB ID NC uC JD OC","2":"F G FD","8":"GD HD","129":"0 1 2 3 4 5 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"},G:{"1":"E ZC KD vC LD MD ND OD PD QD","129":"RD SD TD UD VD WD XD YD ZD aD bD cD dD bC cC PC eD QC dC eC fC gC hC fD RC iC jC kC lC mC gD SC nC oC pC qC rC sC tC"},H:{"2":"hD"},I:{"1":"TC J iD jD kD lD vC mD nD","129":"I"},J:{"1":"D A"},K:{"1":"B C NC uC OC","8":"A","129":"H"},L:{"129":"I"},M:{"129":"MC"},N:{"1":"A B"},O:{"129":"PC"},P:{"1":"J","129":"6 7 8 9 AB BB CB DB EB FB oD pD qD rD sD aC tD uD vD wD xD QC RC SC yD"},Q:{"129":"zD"},R:{"129":"0D"},S:{"1":"1D","129":"2D"}},B:2,C:"Geolocation",D:true};
@@ -0,0 +1,77 @@
import {listData as $b1f0cad8af73213b$export$3585ede4d035bf14} from "./utils.module.js";
import {filterDOMProps as $by1yQ$filterDOMProps, useId as $by1yQ$useId, mergeProps as $by1yQ$mergeProps} from "@react-aria/utils";
import {useFocusWithin as $by1yQ$useFocusWithin} from "@react-aria/interactions";
import {useLabel as $by1yQ$useLabel} from "@react-aria/label";
import {useSelectableList as $by1yQ$useSelectableList} from "@react-aria/selection";
/*
* 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.
*/
function $c132121280ec012d$export$50eacbbf140a3141(props, state, ref) {
let domProps = (0, $by1yQ$filterDOMProps)(props, {
labelable: true
});
// Use props instead of state here. We don't want this to change due to long press.
let selectionBehavior = props.selectionBehavior || 'toggle';
let linkBehavior = props.linkBehavior || (selectionBehavior === 'replace' ? 'action' : 'override');
if (selectionBehavior === 'toggle' && linkBehavior === 'action') // linkBehavior="action" does not work with selectionBehavior="toggle" because there is no way
// to initiate selection (checkboxes are not allowed inside a listbox). Link items will not be
// selectable in this configuration.
linkBehavior = 'override';
let { listProps: listProps } = (0, $by1yQ$useSelectableList)({
...props,
ref: ref,
selectionManager: state.selectionManager,
collection: state.collection,
disabledKeys: state.disabledKeys,
linkBehavior: linkBehavior
});
let { focusWithinProps: focusWithinProps } = (0, $by1yQ$useFocusWithin)({
onFocusWithin: props.onFocus,
onBlurWithin: props.onBlur,
onFocusWithinChange: props.onFocusChange
});
// Share list id and some props with child options.
let id = (0, $by1yQ$useId)(props.id);
(0, $b1f0cad8af73213b$export$3585ede4d035bf14).set(state, {
id: id,
shouldUseVirtualFocus: props.shouldUseVirtualFocus,
shouldSelectOnPressUp: props.shouldSelectOnPressUp,
shouldFocusOnHover: props.shouldFocusOnHover,
isVirtualized: props.isVirtualized,
onAction: props.onAction,
linkBehavior: linkBehavior
});
let { labelProps: labelProps, fieldProps: fieldProps } = (0, $by1yQ$useLabel)({
...props,
id: id,
// listbox is not an HTML input element so it
// shouldn't be labeled by a <label> element.
labelElementType: 'span'
});
return {
labelProps: labelProps,
listBoxProps: (0, $by1yQ$mergeProps)(domProps, focusWithinProps, state.selectionManager.selectionMode === 'multiple' ? {
'aria-multiselectable': 'true'
} : {}, {
role: 'listbox',
...(0, $by1yQ$mergeProps)(fieldProps, listProps)
})
};
}
export {$c132121280ec012d$export$50eacbbf140a3141 as useListBox};
//# sourceMappingURL=useListBox.module.js.map
@@ -0,0 +1 @@
export { prerender, resumeAndPrerender, version } from "./static";
@@ -0,0 +1,13 @@
sudo: false
language: node_js
node_js:
- '6'
- '8'
- '10'
- '12'
- '14'
- lts/*
notifications:
email:
- rod@vagg.org
- matteo.collina@gmail.com
@@ -0,0 +1,2 @@
let createPlugin = require('./lib/public/create-plugin')
module.exports = (createPlugin.__esModule ? createPlugin : { default: createPlugin }).default
@@ -0,0 +1,71 @@
'use strict';
var path = require('path');
var fs = require('graceful-fs');
var MASK_MODE = parseInt('7777', 8);
var DEFAULT_DIR_MODE = parseInt('0777', 8);
function mkdirp(dirpath, customMode, callback) {
if (typeof customMode === 'function') {
callback = customMode;
customMode = undefined;
}
var mode = customMode || (DEFAULT_DIR_MODE & ~process.umask());
dirpath = path.resolve(dirpath);
fs.mkdir(dirpath, mode, onMkdir);
function onMkdir(mkdirErr) {
if (!mkdirErr) {
return fs.stat(dirpath, onStat);
}
switch (mkdirErr.code) {
case 'ENOENT': {
return mkdirp(path.dirname(dirpath), onRecurse);
}
case 'EEXIST': {
return fs.stat(dirpath, onStat);
}
default: {
return callback(mkdirErr);
}
}
function onStat(statErr, stats) {
if (statErr) {
return callback(statErr);
}
if (!stats.isDirectory()) {
return callback(mkdirErr);
}
// TODO: Is it proper to mask like this?
if ((stats.mode & MASK_MODE) === mode) {
return callback();
}
if (!customMode) {
return callback();
}
fs.chmod(dirpath, mode, callback);
}
}
function onRecurse(recurseErr) {
if (recurseErr) {
return callback(recurseErr);
}
mkdirp(dirpath, mode, callback);
}
}
module.exports = mkdirp;
@@ -0,0 +1,54 @@
{
"name": "strip-ansi",
"version": "6.0.1",
"description": "Strip ANSI escape codes from a string",
"license": "MIT",
"repository": "chalk/strip-ansi",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"strip",
"trim",
"remove",
"ansi",
"styles",
"color",
"colour",
"colors",
"terminal",
"console",
"string",
"tty",
"escape",
"formatting",
"rgb",
"256",
"shell",
"xterm",
"log",
"logging",
"command-line",
"text"
],
"dependencies": {
"ansi-regex": "^5.0.1"
},
"devDependencies": {
"ava": "^2.4.0",
"tsd": "^0.10.0",
"xo": "^0.25.3"
}
}
@@ -0,0 +1,26 @@
var createFlow = require('./_createFlow');
/**
* This method is like `_.flow` except that it creates a function that
* invokes the given functions from right to left.
*
* @static
* @since 3.0.0
* @memberOf _
* @category Util
* @param {...(Function|Function[])} [funcs] The functions to invoke.
* @returns {Function} Returns the new composite function.
* @see _.flow
* @example
*
* function square(n) {
* return n * n;
* }
*
* var addSquare = _.flowRight([square, _.add]);
* addSquare(1, 2);
* // => 9
*/
var flowRight = createFlow(true);
module.exports = flowRight;
@@ -0,0 +1,12 @@
/**
* Converts an ASCII `string` to an array.
*
* @private
* @param {string} string The string to convert.
* @returns {Array} Returns the converted array.
*/
function asciiToArray(string) {
return string.split('');
}
module.exports = asciiToArray;
@@ -0,0 +1,82 @@
{
"name": "react-router-dom",
"version": "7.9.5",
"description": "Declarative routing for React web applications",
"keywords": [
"react",
"router",
"route",
"routing",
"history",
"link"
],
"repository": {
"type": "git",
"url": "https://github.com/remix-run/react-router",
"directory": "packages/react-router-dom"
},
"license": "MIT",
"author": "Remix Software <hello@remix.run>",
"sideEffects": false,
"main": "./dist/main.js",
"unpkg": "./dist/umd/react-router-dom.production.min.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
".": {
"node": {
"types": "./dist/index.d.ts",
"module-sync": "./dist/index.mjs",
"default": "./dist/index.js"
},
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"default": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"./package.json": "./package.json"
},
"wireit": {
"build": {
"command": "tsup",
"files": [
"*.ts",
"tsconfig.json",
"package.json"
],
"output": [
"dist/**"
]
}
},
"dependencies": {
"react-router": "7.9.5"
},
"devDependencies": {
"react": "^19.1.0",
"react-dom": "^19.1.0",
"tsup": "^8.3.0",
"typescript": "^5.1.6",
"wireit": "0.14.9"
},
"peerDependencies": {
"react": ">=18",
"react-dom": ">=18"
},
"files": [
"dist/",
"LICENSE.md",
"README.md"
],
"engines": {
"node": ">=20.0.0"
},
"scripts": {
"build": "wireit",
"typecheck": "tsc"
}
}
@@ -0,0 +1,304 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.ts
var index_exports = {};
__export(index_exports, {
DOMEventNames: () => DOMEventNames,
DOMPropNames: () => DOMPropNames,
filterDOMProps: () => filterDOMProps,
getValidChildren: () => getValidChildren,
pickChildren: () => pickChildren,
renderFn: () => renderFn
});
module.exports = __toCommonJS(index_exports);
// src/children.ts
var import_react = require("react");
function getValidChildren(children) {
return import_react.Children.toArray(children).filter(
(child) => (0, import_react.isValidElement)(child)
);
}
var pickChildren = (children, targetChild) => {
var _a;
let target = [];
const withoutTargetChildren = (_a = import_react.Children.map(children, (item) => {
if (!(0, import_react.isValidElement)(item)) return item;
if (item.type === targetChild) {
target.push(item);
return null;
}
return item;
})) == null ? void 0 : _a.filter(Boolean);
const targetChildren = target.length >= 0 ? target : void 0;
return [withoutTargetChildren, targetChildren];
};
// src/dom-props.ts
var DOMPropNames = /* @__PURE__ */ new Set([
"id",
"type",
"style",
"title",
"role",
"tabIndex",
"htmlFor",
"width",
"height",
"abbr",
"accept",
"acceptCharset",
"accessKey",
"action",
"allowFullScreen",
"allowTransparency",
"alt",
"async",
"autoComplete",
"autoFocus",
"autoPlay",
"cellPadding",
"cellSpacing",
"challenge",
"charset",
"checked",
"cite",
"class",
"className",
"cols",
"colSpan",
"command",
"content",
"contentEditable",
"contextMenu",
"controls",
"coords",
"crossOrigin",
"data",
"dateTime",
"default",
"defer",
"dir",
"disabled",
"download",
"draggable",
"dropzone",
"encType",
"enterKeyHint",
"for",
"form",
"formAction",
"formEncType",
"formMethod",
"formNoValidate",
"formTarget",
"frameBorder",
"headers",
"hidden",
"high",
"href",
"hrefLang",
"httpEquiv",
"icon",
"inputMode",
"isMap",
"itemId",
"itemProp",
"itemRef",
"itemScope",
"itemType",
"kind",
"label",
"lang",
"list",
"loop",
"manifest",
"max",
"maxLength",
"media",
"mediaGroup",
"method",
"min",
"minLength",
"multiple",
"muted",
"name",
"noValidate",
"open",
"optimum",
"pattern",
"ping",
"placeholder",
"poster",
"preload",
"radioGroup",
"referrerPolicy",
"readOnly",
"rel",
"required",
"rows",
"rowSpan",
"sandbox",
"scope",
"scoped",
"scrolling",
"seamless",
"selected",
"shape",
"size",
"sizes",
"slot",
"sortable",
"span",
"spellCheck",
"src",
"srcDoc",
"srcSet",
"start",
"step",
"target",
"translate",
"typeMustMatch",
"useMap",
"value",
"wmode",
"wrap"
]);
var DOMEventNames = /* @__PURE__ */ new Set([
"onCopy",
"onCut",
"onPaste",
"onLoad",
"onError",
"onWheel",
"onScroll",
"onCompositionEnd",
"onCompositionStart",
"onCompositionUpdate",
"onKeyDown",
"onKeyPress",
"onKeyUp",
"onFocus",
"onBlur",
"onChange",
"onInput",
"onSubmit",
"onClick",
"onContextMenu",
"onDoubleClick",
"onDrag",
"onDragEnd",
"onDragEnter",
"onDragExit",
"onDragLeave",
"onDragOver",
"onDragStart",
"onDrop",
"onMouseDown",
"onMouseEnter",
"onMouseLeave",
"onMouseMove",
"onMouseOut",
"onMouseOver",
"onMouseUp",
"onPointerDown",
"onPointerEnter",
"onPointerLeave",
"onPointerUp",
"onSelect",
"onTouchCancel",
"onTouchEnd",
"onTouchMove",
"onTouchStart",
"onAnimationStart",
"onAnimationEnd",
"onAnimationIteration",
"onTransitionEnd"
]);
// src/filter-dom-props.ts
var propRe = /^(data-.*)$/;
var ariaRe = /^(aria-.*)$/;
var funcRe = /^(on[A-Z].*)$/;
function filterDOMProps(props, opts = {}) {
let {
labelable = true,
enabled = true,
propNames,
omitPropNames,
omitEventNames,
omitDataProps,
omitEventProps
} = opts;
let filteredProps = {};
if (!enabled) {
return props;
}
for (const prop in props) {
if (omitPropNames == null ? void 0 : omitPropNames.has(prop)) {
continue;
}
if ((omitEventNames == null ? void 0 : omitEventNames.has(prop)) && funcRe.test(prop)) {
continue;
}
if (funcRe.test(prop) && !DOMEventNames.has(prop)) {
continue;
}
if (omitDataProps && propRe.test(prop)) {
continue;
}
if (omitEventProps && funcRe.test(prop)) {
continue;
}
if (Object.prototype.hasOwnProperty.call(props, prop) && (DOMPropNames.has(prop) || labelable && ariaRe.test(prop) || (propNames == null ? void 0 : propNames.has(prop)) || propRe.test(prop)) || funcRe.test(prop)) {
filteredProps[prop] = props[prop];
}
}
return filteredProps;
}
// src/functions.ts
var React = __toESM(require("react"));
function renderFn({ Component, props, renderCustom }) {
if (renderCustom && typeof renderCustom === "function") {
return renderCustom(props);
} else {
return React.createElement(Component, props);
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
DOMEventNames,
DOMPropNames,
filterDOMProps,
getValidChildren,
pickChildren,
renderFn
});
@@ -0,0 +1,179 @@
/**
* @fileoverview Disallow use of multiple spaces.
* @author Nicholas C. Zakas
* @deprecated in ESLint v8.53.0
*/
"use strict";
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "8.53.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "no-multi-spaces",
url: "https://eslint.style/rules/no-multi-spaces",
},
},
],
},
type: "layout",
docs: {
description: "Disallow multiple spaces",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-multi-spaces",
},
fixable: "whitespace",
schema: [
{
type: "object",
properties: {
exceptions: {
type: "object",
patternProperties: {
"^([A-Z][a-z]*)+$": {
type: "boolean",
},
},
additionalProperties: false,
},
ignoreEOLComments: {
type: "boolean",
default: false,
},
},
additionalProperties: false,
},
],
messages: {
multipleSpaces: "Multiple spaces found before '{{displayValue}}'.",
},
},
create(context) {
const sourceCode = context.sourceCode;
const options = context.options[0] || {};
const ignoreEOLComments = options.ignoreEOLComments;
const exceptions = Object.assign(
{ Property: true },
options.exceptions,
);
const hasExceptions = Object.keys(exceptions).some(
key => exceptions[key],
);
/**
* Formats value of given comment token for error message by truncating its length.
* @param {Token} token comment token
* @returns {string} formatted value
* @private
*/
function formatReportedCommentValue(token) {
const valueLines = token.value.split("\n");
const value = valueLines[0];
const formattedValue = `${value.slice(0, 12)}...`;
return valueLines.length === 1 && value.length <= 12
? value
: formattedValue;
}
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
return {
Program() {
sourceCode.tokensAndComments.forEach(
(leftToken, leftIndex, tokensAndComments) => {
if (leftIndex === tokensAndComments.length - 1) {
return;
}
const rightToken = tokensAndComments[leftIndex + 1];
// Ignore tokens that don't have 2 spaces between them or are on different lines
if (
!sourceCode.text
.slice(leftToken.range[1], rightToken.range[0])
.includes(" ") ||
leftToken.loc.end.line < rightToken.loc.start.line
) {
return;
}
// Ignore comments that are the last token on their line if `ignoreEOLComments` is active.
if (
ignoreEOLComments &&
astUtils.isCommentToken(rightToken) &&
(leftIndex === tokensAndComments.length - 2 ||
rightToken.loc.end.line <
tokensAndComments[leftIndex + 2].loc.start
.line)
) {
return;
}
// Ignore tokens that are in a node in the "exceptions" object
if (hasExceptions) {
const parentNode = sourceCode.getNodeByRangeIndex(
rightToken.range[0] - 1,
);
if (parentNode && exceptions[parentNode.type]) {
return;
}
}
let displayValue;
if (rightToken.type === "Block") {
displayValue = `/*${formatReportedCommentValue(rightToken)}*/`;
} else if (rightToken.type === "Line") {
displayValue = `//${formatReportedCommentValue(rightToken)}`;
} else {
displayValue = rightToken.value;
}
context.report({
node: rightToken,
loc: {
start: leftToken.loc.end,
end: rightToken.loc.start,
},
messageId: "multipleSpaces",
data: { displayValue },
fix: fixer =>
fixer.replaceTextRange(
[leftToken.range[1], rightToken.range[0]],
" ",
),
});
},
);
},
};
},
};
@@ -0,0 +1,42 @@
/**
* @fileoverview Rule to flag when deleting variables
* @author Ilya Volodin
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Disallow deleting variables",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-delete-var",
},
schema: [],
messages: {
unexpected: "Variables should not be deleted.",
},
},
create(context) {
return {
UnaryExpression(node) {
if (
node.operator === "delete" &&
node.argument.type === "Identifier"
) {
context.report({ node, messageId: "unexpected" });
}
},
};
},
};
@@ -0,0 +1,119 @@
'use strict';
const util = require('util');
const { LEVEL } = require('triple-beam');
const TransportStream = require('./modern');
/**
* Constructor function for the LegacyTransportStream. This is an internal
* wrapper `winston >= 3` uses to wrap older transports implementing
* log(level, message, meta).
* @param {Object} options - Options for this TransportStream instance.
* @param {Transpot} options.transport - winston@2 or older Transport to wrap.
*/
const LegacyTransportStream = module.exports = function LegacyTransportStream(options = {}) {
TransportStream.call(this, options);
if (!options.transport || typeof options.transport.log !== 'function') {
throw new Error('Invalid transport, must be an object with a log method.');
}
this.transport = options.transport;
this.level = this.level || options.transport.level;
this.handleExceptions = this.handleExceptions || options.transport.handleExceptions;
// Display our deprecation notice.
this._deprecated();
// Properly bubble up errors from the transport to the
// LegacyTransportStream instance, but only once no matter how many times
// this transport is shared.
function transportError(err) {
this.emit('error', err, this.transport);
}
if (!this.transport.__winstonError) {
this.transport.__winstonError = transportError.bind(this);
this.transport.on('error', this.transport.__winstonError);
}
};
/*
* Inherit from TransportStream using Node.js built-ins
*/
util.inherits(LegacyTransportStream, TransportStream);
/**
* Writes the info object to our transport instance.
* @param {mixed} info - TODO: add param description.
* @param {mixed} enc - TODO: add param description.
* @param {function} callback - TODO: add param description.
* @returns {undefined}
* @private
*/
LegacyTransportStream.prototype._write = function _write(info, enc, callback) {
if (this.silent || (info.exception === true && !this.handleExceptions)) {
return callback(null);
}
// Remark: This has to be handled in the base transport now because we
// cannot conditionally write to our pipe targets as stream.
if (!this.level || this.levels[this.level] >= this.levels[info[LEVEL]]) {
this.transport.log(info[LEVEL], info.message, info, this._nop);
}
callback(null);
};
/**
* Writes the batch of info objects (i.e. "object chunks") to our transport
* instance after performing any necessary filtering.
* @param {mixed} chunks - TODO: add params description.
* @param {function} callback - TODO: add params description.
* @returns {mixed} - TODO: add returns description.
* @private
*/
LegacyTransportStream.prototype._writev = function _writev(chunks, callback) {
for (let i = 0; i < chunks.length; i++) {
if (this._accept(chunks[i])) {
this.transport.log(
chunks[i].chunk[LEVEL],
chunks[i].chunk.message,
chunks[i].chunk,
this._nop
);
chunks[i].callback();
}
}
return callback(null);
};
/**
* Displays a deprecation notice. Defined as a function so it can be
* overriden in tests.
* @returns {undefined}
*/
LegacyTransportStream.prototype._deprecated = function _deprecated() {
// eslint-disable-next-line no-console
console.error([
`${this.transport.name} is a legacy winston transport. Consider upgrading: `,
'- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md'
].join('\n'));
};
/**
* Clean up error handling state on the legacy transport associated
* with this instance.
* @returns {undefined}
*/
LegacyTransportStream.prototype.close = function close() {
if (this.transport.close) {
this.transport.close();
}
if (this.transport.__winstonError) {
this.transport.removeListener('error', this.transport.__winstonError);
this.transport.__winstonError = null;
}
};
@@ -0,0 +1,206 @@
"use client";
// src/use-switch.ts
import { useCallback, useId, useRef } from "react";
import { mapPropsVariants, useProviderContext } from "@heroui/system";
import { mergeRefs } from "@heroui/react-utils";
import { useSafeLayoutEffect } from "@heroui/use-safe-layout-effect";
import { useHover } from "@react-aria/interactions";
import { toggle } from "@heroui/theme";
import { chain, mergeProps } from "@react-aria/utils";
import { clsx, dataAttr, objectToDeps } from "@heroui/shared-utils";
import { useSwitch as useReactAriaSwitch } from "@react-aria/switch";
import { useMemo } from "react";
import { useToggleState } from "@react-stately/toggle";
import { useFocusRing } from "@react-aria/focus";
function useSwitch(originalProps = {}) {
var _a, _b;
const globalContext = useProviderContext();
const [props, variantProps] = mapPropsVariants(originalProps, toggle.variantKeys);
const {
ref,
as,
name,
value = "",
isReadOnly: isReadOnlyProp = false,
autoFocus = false,
startContent,
endContent,
defaultSelected,
isSelected: isSelectedProp,
children,
thumbIcon,
className,
classNames,
onChange,
onValueChange,
...otherProps
} = props;
const Component = as || "label";
const domRef = useRef(null);
const inputRef = useRef(null);
const disableAnimation = (_b = (_a = originalProps.disableAnimation) != null ? _a : globalContext == null ? void 0 : globalContext.disableAnimation) != null ? _b : false;
const labelId = useId();
const ariaSwitchProps = useMemo(() => {
const ariaLabel = otherProps["aria-label"] || typeof children === "string" ? children : void 0;
return {
name,
value,
children,
autoFocus,
defaultSelected,
isSelected: isSelectedProp,
isDisabled: !!originalProps.isDisabled,
isReadOnly: isReadOnlyProp,
"aria-label": ariaLabel,
"aria-labelledby": otherProps["aria-labelledby"] || labelId,
onChange: onValueChange
};
}, [
value,
name,
labelId,
children,
autoFocus,
isReadOnlyProp,
isSelectedProp,
defaultSelected,
originalProps.isDisabled,
otherProps["aria-label"],
otherProps["aria-labelledby"],
onValueChange
]);
const state = useToggleState(ariaSwitchProps);
useSafeLayoutEffect(() => {
if (!inputRef.current)
return;
const isInputRefChecked = !!inputRef.current.checked;
state.setSelected(isInputRefChecked);
}, [inputRef.current]);
const { inputProps, isPressed, isReadOnly } = useReactAriaSwitch(ariaSwitchProps, state, inputRef);
const { focusProps, isFocused, isFocusVisible } = useFocusRing({ autoFocus: inputProps.autoFocus });
const { hoverProps, isHovered } = useHover({
isDisabled: inputProps.disabled
});
const isInteractionDisabled = ariaSwitchProps.isDisabled || isReadOnly;
const pressed = isInteractionDisabled ? false : isPressed;
const isSelected = inputProps.checked;
const isDisabled = inputProps.disabled;
const slots = useMemo(
() => toggle({
...variantProps,
disableAnimation
}),
[objectToDeps(variantProps), disableAnimation]
);
const baseStyles = clsx(classNames == null ? void 0 : classNames.base, className);
const getBaseProps = (props2) => {
return {
...mergeProps(hoverProps, otherProps, props2),
ref: domRef,
className: slots.base({ class: clsx(baseStyles, props2 == null ? void 0 : props2.className) }),
"data-disabled": dataAttr(isDisabled),
"data-selected": dataAttr(isSelected),
"data-readonly": dataAttr(isReadOnly),
"data-focus": dataAttr(isFocused),
"data-focus-visible": dataAttr(isFocusVisible),
"data-hover": dataAttr(isHovered),
"data-pressed": dataAttr(pressed)
};
};
const getWrapperProps = useCallback(
(props2 = {}) => {
return {
...props2,
"aria-hidden": true,
className: clsx(slots.wrapper({ class: clsx(classNames == null ? void 0 : classNames.wrapper, props2 == null ? void 0 : props2.className) }))
};
},
[slots, classNames == null ? void 0 : classNames.wrapper]
);
const getInputProps = (props2 = {}) => {
return {
...mergeProps(inputProps, focusProps, props2),
ref: mergeRefs(inputRef, ref),
id: inputProps.id,
className: slots.hiddenInput({ class: classNames == null ? void 0 : classNames.hiddenInput }),
onChange: chain(onChange, inputProps.onChange)
};
};
const getThumbProps = useCallback(
(props2 = {}) => ({
...props2,
className: slots.thumb({ class: clsx(classNames == null ? void 0 : classNames.thumb, props2 == null ? void 0 : props2.className) })
}),
[slots, classNames == null ? void 0 : classNames.thumb]
);
const getLabelProps = useCallback(
(props2 = {}) => ({
...props2,
id: labelId,
className: slots.label({ class: clsx(classNames == null ? void 0 : classNames.label, props2 == null ? void 0 : props2.className) })
}),
[slots, classNames == null ? void 0 : classNames.label, isDisabled, isSelected]
);
const getThumbIconProps = useCallback(
(props2 = {
includeStateProps: false
}) => mergeProps(
{
width: "1em",
height: "1em",
className: slots.thumbIcon({ class: clsx(classNames == null ? void 0 : classNames.thumbIcon) })
},
props2.includeStateProps ? {
isSelected
} : {}
),
[slots, classNames == null ? void 0 : classNames.thumbIcon, isSelected]
);
const getStartContentProps = useCallback(
(props2 = {}) => ({
width: "1em",
height: "1em",
...props2,
className: slots.startContent({ class: clsx(classNames == null ? void 0 : classNames.startContent, props2 == null ? void 0 : props2.className) })
}),
[slots, classNames == null ? void 0 : classNames.startContent, isSelected]
);
const getEndContentProps = useCallback(
(props2 = {}) => ({
width: "1em",
height: "1em",
...props2,
className: slots.endContent({ class: clsx(classNames == null ? void 0 : classNames.endContent, props2 == null ? void 0 : props2.className) })
}),
[slots, classNames == null ? void 0 : classNames.endContent, isSelected]
);
return {
Component,
slots,
classNames,
domRef,
children,
thumbIcon,
startContent,
endContent,
isHovered,
isSelected,
isPressed: pressed,
isFocused,
isFocusVisible,
isDisabled,
getBaseProps,
getWrapperProps,
getInputProps,
getLabelProps,
getThumbProps,
getThumbIconProps,
getStartContentProps,
getEndContentProps
};
}
export {
useSwitch
};
@@ -0,0 +1,80 @@
// src/index.ts
import { capitalize } from "@heroui/shared-utils";
import { useEffect, useRef } from "react";
function useDataScrollOverflow(props = {}) {
const {
domRef,
isEnabled = true,
overflowCheck = "vertical",
visibility = "auto",
offset = 0,
onVisibilityChange,
updateDeps = []
} = props;
const visibleRef = useRef(visibility);
useEffect(() => {
const el = domRef == null ? void 0 : domRef.current;
if (!el || !isEnabled)
return;
const setAttributes = (direction, hasBefore, hasAfter, prefix, suffix) => {
if (visibility === "auto") {
const both = `${prefix}${capitalize(suffix)}Scroll`;
if (hasBefore && hasAfter) {
el.dataset[both] = "true";
el.removeAttribute(`data-${prefix}-scroll`);
el.removeAttribute(`data-${suffix}-scroll`);
} else {
el.dataset[`${prefix}Scroll`] = hasBefore.toString();
el.dataset[`${suffix}Scroll`] = hasAfter.toString();
el.removeAttribute(`data-${prefix}-${suffix}-scroll`);
}
} else {
const next = hasBefore && hasAfter ? "both" : hasBefore ? prefix : hasAfter ? suffix : "none";
if (next !== visibleRef.current) {
onVisibilityChange == null ? void 0 : onVisibilityChange(next);
visibleRef.current = next;
}
}
};
const checkOverflow = () => {
const directions = [
{ type: "vertical", prefix: "top", suffix: "bottom" },
{ type: "horizontal", prefix: "left", suffix: "right" }
];
for (const { type, prefix, suffix } of directions) {
if (overflowCheck === type || overflowCheck === "both") {
const hasBefore = type === "vertical" ? el.scrollTop > offset : el.scrollLeft > offset;
const hasAfter = type === "vertical" ? el.scrollTop + el.clientHeight + offset < el.scrollHeight : el.scrollLeft + el.clientWidth + offset < el.scrollWidth;
setAttributes(type, hasBefore, hasAfter, prefix, suffix);
}
}
};
const clearOverflow = () => {
["top", "bottom", "top-bottom", "left", "right", "left-right"].forEach((attr) => {
el.removeAttribute(`data-${attr}-scroll`);
});
};
checkOverflow();
el.addEventListener("scroll", checkOverflow);
if (visibility !== "auto") {
clearOverflow();
if (visibility === "both") {
el.dataset.topBottomScroll = String(overflowCheck === "vertical");
el.dataset.leftRightScroll = String(overflowCheck === "horizontal");
} else {
el.dataset.topBottomScroll = "false";
el.dataset.leftRightScroll = "false";
["top", "bottom", "left", "right"].forEach((attr) => {
el.dataset[`${attr}Scroll`] = String(visibility === attr);
});
}
}
return () => {
el.removeEventListener("scroll", checkOverflow);
clearOverflow();
};
}, [...updateDeps, isEnabled, visibility, overflowCheck, onVisibilityChange, domRef]);
}
export {
useDataScrollOverflow
};
@@ -0,0 +1 @@
module.exports={C:{"2":0.00397,"52":0.00397,"79":0.00397,"95":0.00397,"103":0.03174,"112":0.00397,"115":0.21819,"119":0.10314,"124":0.00397,"127":0.00793,"128":0.13091,"129":0.00793,"130":0.00397,"131":0.00397,"132":0.00397,"134":0.00397,"140":0.10314,"141":0.02777,"142":0.0119,"143":1.63837,"144":0.99175,_:"3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 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 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 96 97 98 99 100 101 102 104 105 106 107 108 109 110 111 113 114 116 117 118 120 121 122 123 125 126 133 135 136 137 138 139 145 146 147 3.5 3.6"},D:{"39":0.00793,"40":0.00397,"41":0.00397,"42":0.01587,"43":0.00793,"44":0.0119,"45":0.0119,"46":0.00397,"47":0.01587,"48":0.00793,"49":0.00793,"50":0.00397,"51":0.00793,"52":0.00793,"53":0.00793,"54":0.00793,"55":0.00793,"56":0.0119,"57":0.00793,"58":0.00793,"59":0.00793,"60":0.00793,"69":0.00397,"70":0.00793,"79":0.01587,"83":0.00397,"88":0.0476,"90":0.07537,"91":0.00397,"97":0.01587,"98":0.00397,"99":0.00397,"100":0.01587,"102":0.00397,"103":0.03967,"104":0.36893,"106":0.00793,"108":0.00793,"109":0.15075,"110":0.0238,"111":0.00397,"114":0.00793,"115":0.00397,"116":0.0238,"119":0.01984,"120":0.00397,"121":0.00397,"122":0.0119,"123":0.00793,"124":0.02777,"125":5.08966,"126":0.0357,"127":0.00793,"128":0.01984,"130":0.03967,"131":0.00793,"132":0.01984,"133":0.01984,"134":0.0119,"135":0.00793,"136":0.00793,"137":0.01587,"138":0.13091,"139":0.54348,"140":2.99905,"141":9.96907,"142":0.19835,_:"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 71 72 73 74 75 76 77 78 80 81 84 85 86 87 89 92 93 94 95 96 101 105 107 112 113 117 118 129 143 144 145"},F:{"46":0.00397,"91":0.00397,"92":0.0119,"120":0.08331,"121":0.62679,"122":1.13853,_:"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 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 89 90 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"17":0.00397,"92":0.00397,"100":0.00793,"102":0.0119,"111":0.00793,"114":0.07934,"125":0.00397,"127":0.00397,"128":0.06744,"131":0.00793,"133":0.0476,"134":0.07934,"135":0.01984,"136":0.00793,"138":0.01587,"139":0.02777,"140":1.03142,"141":4.36767,"142":0.00397,_:"12 13 14 15 16 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 101 103 104 105 106 107 108 109 110 112 113 115 116 117 118 119 120 121 122 123 124 126 129 130 132 137"},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 12.1 15.2-15.3 15.5 16.1 16.2 17.0 26.2","11.1":0.00793,"13.1":0.22215,"14.1":1.52333,"15.1":0.00397,"15.4":0.00397,"15.6":0.14281,"16.0":0.01587,"16.3":0.00397,"16.4":0.04364,"16.5":0.00397,"16.6":0.11108,"17.1":0.00793,"17.2":0.05157,"17.3":0.02777,"17.4":0.0238,"17.5":0.0119,"17.6":0.09124,"18.0":0.01984,"18.1":0.00397,"18.2":0.01984,"18.3":0.11504,"18.4":0.0119,"18.5-18.6":0.19438,"26.0":0.55141,"26.1":0.06347},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00149,"5.0-5.1":0,"6.0-6.1":0.00595,"7.0-7.1":0.00446,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.01339,"10.0-10.2":0.00149,"10.3":0.02529,"11.0-11.2":0.37485,"11.3-11.4":0.00892,"12.0-12.1":0.00297,"12.2-12.5":0.07289,"13.0-13.1":0,"13.2":0.00744,"13.3":0.00297,"13.4-13.7":0.0119,"14.0-14.4":0.02529,"14.5-14.8":0.02677,"15.0-15.1":0.02529,"15.2-15.3":0.01934,"15.4":0.02231,"15.5":0.02529,"15.6-15.8":0.33022,"16.0":0.04462,"16.1":0.0833,"16.2":0.04314,"16.3":0.07735,"16.4":0.01934,"16.5":0.03421,"16.6-16.7":0.44178,"17.0":0.03124,"17.1":0.0476,"17.2":0.03421,"17.3":0.05057,"17.4":0.08925,"17.5":0.15321,"17.6-17.7":0.38675,"18.0":0.08776,"18.1":0.18147,"18.2":0.09817,"18.3":0.31535,"18.4":0.16214,"18.5-18.6":8.26748,"26.0":1.02191,"26.1":0.03719},P:{"22":0.0106,"24":0.06359,"25":0.0424,"26":0.11659,"27":0.24378,"28":2.3,"29":0.14839,_:"4 20 21 23 5.0-5.4 6.2-6.4 9.2 10.1 11.1-11.2 12.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.0212,"8.2":0.0106,"13.0":0.0106},I:{"0":0.00602,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},K:{"0":0.38605,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.56098},Q:{"14.9":0.13874},O:{_:"0"},H:{"0":0},L:{"0":44.37238}};
@@ -0,0 +1,57 @@
# Autoprefixer [![Cult Of Martians][cult-img]][cult]
<img align="right" width="94" height="71"
src="https://postcss.github.io/autoprefixer/logo.svg"
title="Autoprefixer logo by Anton Lovchikov">
[PostCSS] plugin to parse CSS and add vendor prefixes to CSS rules using values
from [Can I Use]. It is recommended by Google and used in Twitter and Alibaba.
Write your CSS rules without vendor prefixes (in fact, forget about them
entirely):
```css
::placeholder {
color: gray;
}
.image {
width: stretch;
}
```
Autoprefixer will use the data based on current browser popularity and property
support to apply prefixes for you. You can try the [interactive demo]
of Autoprefixer.
```css
::-moz-placeholder {
color: gray;
}
::placeholder {
color: gray;
}
.image {
width: -webkit-fill-available;
width: -moz-available;
width: stretch;
}
```
Twitter account for news and releases: [@autoprefixer].
<a href="https://evilmartians.com/?utm_source=autoprefixer">
<img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg" alt="Sponsored by Evil Martians" width="236" height="54">
</a>
[interactive demo]: https://autoprefixer.github.io/
[@autoprefixer]: https://twitter.com/autoprefixer
[Can I Use]: https://caniuse.com/
[cult-img]: https://cultofmartians.com/assets/badges/badge.svg
[PostCSS]: https://github.com/postcss/postcss
[cult]: https://cultofmartians.com/tasks/autoprefixer-grid.html
## Docs
Read full docs **[here](https://github.com/postcss/autoprefixer#readme)**.
@@ -0,0 +1,28 @@
const handler = {
scheme: "http",
domainHost: true,
parse: function (components, options) {
//report missing host
if (!components.host) {
components.error = components.error || "HTTP URIs must have a host.";
}
return components;
},
serialize: function (components, options) {
const secure = String(components.scheme).toLowerCase() === "https";
//normalize the default port
if (components.port === (secure ? 443 : 80) || components.port === "") {
components.port = undefined;
}
//normalize the empty path
if (!components.path) {
components.path = "/";
}
//NOTE: We do not parse query strings for HTTP URIs
//as WWW Form Url Encoded query strings are part of the HTML4+ spec,
//and not the HTTP spec.
return components;
}
};
export default handler;
//# sourceMappingURL=http.js.map
@@ -0,0 +1,31 @@
var baseFunctions = require('./_baseFunctions'),
keys = require('./keys');
/**
* Creates an array of function property names from own enumerable properties
* of `object`.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Object
* @param {Object} object The object to inspect.
* @returns {Array} Returns the function names.
* @see _.functionsIn
* @example
*
* function Foo() {
* this.a = _.constant('a');
* this.b = _.constant('b');
* }
*
* Foo.prototype.c = _.constant('c');
*
* _.functions(new Foo);
* // => ['a', 'b']
*/
function functions(object) {
return object == null ? [] : baseFunctions(object, keys(object));
}
module.exports = functions;
@@ -0,0 +1,7 @@
import * as ts from 'typescript';
/**
* Returns the contextual type of a given node.
* Contextual type is the type of the target the node is going into.
* i.e. the type of a called function's parameter, or the defined type of a variable declaration
*/
export declare function getContextualType(checker: ts.TypeChecker, node: ts.Expression): ts.Type | undefined;
@@ -0,0 +1,4 @@
/** @type {Construct} */
export const labelEnd: Construct;
import type { Construct } from 'micromark-util-types';
//# sourceMappingURL=label-end.d.ts.map
@@ -0,0 +1,193 @@
/**
* @author Sosuke Suzuki <https://github.com/sosukesuzuki>
* See LICENSE file in root directory for full license.
*/
"use strict"
const {
CONSTRUCT,
READ,
ReferenceTracker,
getPropertyName,
} = require("@eslint-community/eslint-utils")
const { getSourceCode } = require("eslint-compat-utils")
/**
* @typedef {import("estree").Node} Node
* @typedef {import("estree").ClassExpression | import("estree").ClassDeclaration} ClassNode
* @typedef {import("estree").CallExpression} CallExpression
*/
const errorConstructorNames = [
"Error",
"EvalError",
"RangeError",
"ReferenceError",
"SyntaxError",
"TypeError",
"URIError",
"AggregateError",
]
const errorsTraceMap = {}
for (const errorConstructorName of errorConstructorNames) {
errorsTraceMap[errorConstructorName] = { [CONSTRUCT]: true, [READ]: true }
}
/**
* @param {Node} node
* @returns {boolean}
*/
function isSuperCall(node) {
return node.type === "CallExpression" && node.callee.type === "Super"
}
/**
* @param {Node|undefined} node
* @returns {boolean}
*/
function isSpreadElement(node) {
return node && node.type === "SpreadElement"
}
/**
* @param {Node} node
* @returns {ClassNode | null}
*/
function findClassFromAncestors(node) {
if (node.type !== "ClassExpression" && node.type !== "ClassDeclaration") {
return findClassFromAncestors(node.parent)
}
if (!node) {
return null
}
return node
}
module.exports = {
meta: {
docs: {
description: "disallow Error Cause.",
category: "ES2022",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-error-cause.html",
},
fixable: null,
messages: {
forbidden: "ES2022 Error Cause is forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
const sourceCode = getSourceCode(context)
/** @type {Array<{ classNode: ClassNode, superCallNode: CallExpression }>} */
const maybeErrorSubclasses = []
/** @type {Array<{ classNode: ClassNode, superCallNode: CallExpression }>} */
const maybeAggregateErrorSubclasses = []
/**
* Checks if the received node is a constructor call with cause option.
* e.g. `new Error("message", { cause: foo })`, `super("message", { cause: foo })`
*
* @param {Node} node
* @param {boolean} isAggregateError
* @returns {boolean}
*/
function isConstructCallWithCauseOption(node, isAggregateError) {
if (node.type !== "NewExpression" && !isSuperCall(node)) {
return false
}
const optionsArgIndex = isAggregateError ? 2 : 1
for (let index = 0; index < optionsArgIndex; index++) {
if (isSpreadElement(node.arguments[index])) {
return false
}
}
const optionsArg = node.arguments[optionsArgIndex]
if (!optionsArg || optionsArg.type !== "ObjectExpression") {
return false
}
return optionsArg.properties.some((property) => {
if (property.type !== "Property") {
return false
}
// new Error("msg", { cause: foo })
return (
getPropertyName(property, sourceCode.getScope(node)) ===
"cause"
)
})
}
/**
* @param {Node} node
* @param {isAggregateError} boolean
* @return {Node | null}
*/
function getReportedNode(node, isAggregateError) {
const errorSubclasses = isAggregateError
? maybeAggregateErrorSubclasses
: maybeErrorSubclasses
if (errorSubclasses.length > 0) {
for (const { classNode, superCallNode } of errorSubclasses) {
if (classNode.superClass === node) {
return superCallNode
}
}
}
if (isConstructCallWithCauseOption(node, isAggregateError)) {
return node
}
return null
}
return {
Super(node) {
const superCallNode = node.parent
function findErrorSubclasses(isAggregateError) {
const errorSubclasses = isAggregateError
? maybeAggregateErrorSubclasses
: maybeErrorSubclasses
if (
isConstructCallWithCauseOption(
superCallNode,
isAggregateError,
)
) {
const classNode = findClassFromAncestors(superCallNode)
if (classNode && classNode.superClass) {
errorSubclasses.push({ classNode, superCallNode })
}
}
}
findErrorSubclasses(/* isAggregateError */ false)
findErrorSubclasses(/* isAggregateError */ true)
},
"Program:exit"(program) {
const tracker = new ReferenceTracker(
sourceCode.getScope(program),
)
for (const { node, path } of tracker.iterateGlobalReferences(
errorsTraceMap,
)) {
const reportedNode = getReportedNode(
node,
path.join(",") === "AggregateError",
)
if (reportedNode) {
context.report({
node: reportedNode,
messageId: "forbidden",
})
}
}
},
}
},
}
@@ -0,0 +1,17 @@
/**
* Extractor function for a ConditionalExpression type value node.
*
* @param - value - AST Value object with type `ConditionalExpression`
* @returns - The extracted value converted to correct type.
*/
export default function extractValueFromConditionalExpression(value) {
// eslint-disable-next-line global-require
const getValue = require('.').default;
const {
test,
alternate,
consequent,
} = value;
return getValue(test) ? getValue(consequent) : getValue(alternate);
}
@@ -0,0 +1,197 @@
// @ts-ignore TS6133
import { test } from "vitest";
import { z } from "zod/v3";
interface Category {
name: string;
subcategories: Category[];
}
const testCategory: Category = {
name: "I",
subcategories: [
{
name: "A",
subcategories: [
{
name: "1",
subcategories: [
{
name: "a",
subcategories: [],
},
],
},
],
},
],
};
test("recursion with z.late.object", () => {
const Category: z.ZodType<Category> = z.late.object(() => ({
name: z.string(),
subcategories: z.array(Category),
}));
Category.parse(testCategory);
});
test("recursion with z.lazy", () => {
const Category: z.ZodType<Category> = z.lazy(() =>
z.object({
name: z.string(),
subcategories: z.array(Category),
})
);
Category.parse(testCategory);
});
test("schema getter", () => {
z.lazy(() => z.string()).schema.parse("asdf");
});
type LinkedList = null | { value: number; next: LinkedList };
const linkedListExample = {
value: 1,
next: {
value: 2,
next: {
value: 3,
next: {
value: 4,
next: null,
},
},
},
};
test("recursion involving union type", () => {
const LinkedListSchema: z.ZodType<LinkedList> = z.lazy(() =>
z.union([
z.null(),
z.object({
value: z.number(),
next: LinkedListSchema,
}),
])
);
LinkedListSchema.parse(linkedListExample);
});
// interface A {
// val: number;
// b: B;
// }
// interface B {
// val: number;
// a: A;
// }
// const A: z.ZodType<A> = z.late.object(() => ({
// val: z.number(),
// b: B,
// }));
// const B: z.ZodType<B> = z.late.object(() => ({
// val: z.number(),
// a: A,
// }));
// const Alazy: z.ZodType<A> = z.lazy(() => z.object({
// val: z.number(),
// b: B,
// }));
// const Blazy: z.ZodType<B> = z.lazy(() => z.object({
// val: z.number(),
// a: A,
// }));
// const a: any = { val: 1 };
// const b: any = { val: 2 };
// a.b = b;
// b.a = a;
// test('valid check', () => {
// A.parse(a);
// B.parse(b);
// });
// test("valid check lazy", () => {
// A.parse({val:1, b:});
// B.parse(b);
// });
// test('masking check', () => {
// const FragmentOnA = z
// .object({
// val: z.number(),
// b: z
// .object({
// val: z.number(),
// a: z
// .object({
// val: z.number(),
// })
// .nonstrict(),
// })
// .nonstrict(),
// })
// .nonstrict();
// const fragment = FragmentOnA.parse(a);
// fragment;
// });
// test('invalid check', () => {
// expect(() => A.parse({} as any)).toThrow();
// });
// test('schema getter', () => {
// (A as z.ZodLazy<any>).schema;
// });
// test("self recursion with cyclical data", () => {
// interface Category {
// name: string;
// subcategories: Category[];
// }
// const Category: z.ZodType<Category> = z.late.object(() => ({
// name: z.string(),
// subcategories: z.array(Category),
// }));
// const untypedCategory: any = {
// name: "Category A",
// };
// // creating a cycle
// untypedCategory.subcategories = [untypedCategory];
// Category.parse(untypedCategory);
// });
// test("self recursion with base type", () => {
// const BaseCategory = z.object({
// name: z.string(),
// });
// type BaseCategory = z.infer<typeof BaseCategory>;
// type Category = BaseCategory & { subcategories: Category[] };
// const Category: z.ZodType<Category> = z.late
// .object(() => ({
// subcategories: z.array(Category),
// }))
// .extend({
// name: z.string(),
// });
// const untypedCategory: any = {
// name: "Category A",
// };
// // creating a cycle
// untypedCategory.subcategories = [untypedCategory];
// Category.parse(untypedCategory); // parses successfully
// });
@@ -0,0 +1,6 @@
export { OverlayOptions, OverlayPlacement } from './types.js';
export { getArrowPlacement, getShouldUseAxisPlacement, getTransformOrigins, toOverlayPlacement, toReactAriaPlacement } from './utils.js';
export { ariaHideOutside } from './ariaHideOutside.js';
export { ariaShouldCloseOnInteractOutside } from './ariaShouldCloseOnInteractOutside.js';
import '@react-types/overlays';
import 'react';
@@ -0,0 +1,6 @@
module.exports = {
"breadcrumbs": `Drobtine`
};
//# sourceMappingURL=sl-SI.main.js.map
@@ -0,0 +1,89 @@
'use strict';
var os = require('os');
var path = require('path');
var through = require('through2');
var fo = require('../file-operations');
var isWindows = (os.platform() === 'win32');
function linkStream(optResolver) {
function linkFile(file, enc, callback) {
var isRelative = optResolver.resolve('relativeSymlinks', file);
var flags = fo.getFlags({
overwrite: optResolver.resolve('overwrite', file),
append: false,
});
if (!isWindows) {
// On non-Windows, just use 'file'
return createLinkWithType('file');
}
fo.reflectStat(file.symlink, file, onReflectTarget);
function onReflectTarget(statErr) {
if (statErr && statErr.code !== 'ENOENT') {
return callback(statErr);
}
// If target doesn't exist, the vinyl will still carry the target stats.
// Let's use those to determine which kind of dangling link to create.
// This option provides a way to create a Junction instead of a
// Directory symlink on Windows. This comes with the following caveats:
// * NTFS Junctions cannot be relative.
// * NTFS Junctions MUST be directories.
// * NTFS Junctions must be on the same file system.
// * Most products CANNOT detect a directory is a Junction:
// This has the side effect of possibly having a whole directory
// deleted when a product is deleting the Junction directory.
// For example, JetBrains product lines will delete the entire contents
// of the TARGET directory because the product does not realize it's
// a symlink as the JVM and Node return false for isSymlink.
// This function is Windows only, so we don't need to check again
var useJunctions = optResolver.resolve('useJunctions', file);
var dirType = useJunctions ? 'junction' : 'dir';
var type = !statErr && file.isDirectory() ? dirType : 'file';
createLinkWithType(type);
}
function createLinkWithType(type) {
// This is done after prepare() to use the adjusted file.base property
if (isRelative && type !== 'junction') {
file.symlink = path.relative(file.base, file.symlink);
}
var opts = {
flags: flags,
type: type,
};
fo.symlink(file.symlink, file.path, opts, onSymlink);
}
function onSymlink(symlinkErr) {
if (symlinkErr) {
return callback(symlinkErr);
}
fo.reflectLinkStat(file.path, file, onReflectLink);
}
function onReflectLink(reflectErr) {
if (reflectErr) {
return callback(reflectErr);
}
callback(null, file);
}
}
return through.obj(linkFile);
}
module.exports = linkStream;
@@ -0,0 +1,14 @@
import baseRest from './_baseRest.js';
/**
* A `baseRest` alias which can be replaced with `identity` by module
* replacement plugins.
*
* @private
* @type {Function}
* @param {Function} func The function to apply a rest parameter to.
* @returns {Function} Returns the new function.
*/
var castRest = baseRest;
export default castRest;
@@ -0,0 +1,6 @@
import { CreateType } from '../create/type.mjs';
import { Kind } from '../symbols/index.mjs';
/** `[JavaScript]` Creates an Iterator type */
export function Iterator(items, options) {
return CreateType({ [Kind]: 'Iterator', type: 'Iterator', items }, options);
}
@@ -0,0 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var ColorWellRole = {
relatedConcepts: [{
module: 'HTML',
concept: {
name: 'input',
attributes: [{
name: 'type',
value: 'color'
}]
}
}],
type: 'widget'
};
var _default = ColorWellRole;
exports.default = _default;
@@ -0,0 +1,147 @@
## New
NAN provides a `Nan::New()` helper for the creation of new JavaScript objects in a way that's compatible across the supported versions of V8.
- <a href="#api_nan_new"><b><code>Nan::New()</code></b></a>
- <a href="#api_nan_undefined"><b><code>Nan::Undefined()</code></b></a>
- <a href="#api_nan_null"><b><code>Nan::Null()</code></b></a>
- <a href="#api_nan_true"><b><code>Nan::True()</code></b></a>
- <a href="#api_nan_false"><b><code>Nan::False()</code></b></a>
- <a href="#api_nan_empty_string"><b><code>Nan::EmptyString()</code></b></a>
<a name="api_nan_new"></a>
### Nan::New()
`Nan::New()` should be used to instantiate new JavaScript objects.
Refer to the specific V8 type in the [V8 documentation](https://v8docs.nodesource.com/node-8.16/d1/d83/classv8_1_1_data.html) for information on the types of arguments required for instantiation.
Signatures:
Return types are mostly omitted from the signatures for simplicity. In most cases the type will be contained within a `v8::Local<T>`. The following types will be contained within a `Nan::MaybeLocal<T>`: `v8::String`, `v8::Date`, `v8::RegExp`, `v8::Script`, `v8::UnboundScript`.
Empty objects:
```c++
Nan::New<T>();
```
Generic single and multiple-argument:
```c++
Nan::New<T>(A0 arg0);
Nan::New<T>(A0 arg0, A1 arg1);
Nan::New<T>(A0 arg0, A1 arg1, A2 arg2);
Nan::New<T>(A0 arg0, A1 arg1, A2 arg2, A3 arg3);
```
For creating `v8::FunctionTemplate` and `v8::Function` objects:
_The definition of `Nan::FunctionCallback` can be found in the [Method declaration](./methods.md#api_nan_method) documentation._
```c++
Nan::New<T>(Nan::FunctionCallback callback,
v8::Local<v8::Value> data = v8::Local<v8::Value>());
Nan::New<T>(Nan::FunctionCallback callback,
v8::Local<v8::Value> data = v8::Local<v8::Value>(),
A2 a2 = A2());
```
Native number types:
```c++
v8::Local<v8::Boolean> Nan::New<T>(bool value);
v8::Local<v8::Int32> Nan::New<T>(int32_t value);
v8::Local<v8::Uint32> Nan::New<T>(uint32_t value);
v8::Local<v8::Number> Nan::New<T>(double value);
```
String types:
```c++
Nan::MaybeLocal<v8::String> Nan::New<T>(std::string const& value);
Nan::MaybeLocal<v8::String> Nan::New<T>(const char * value, int length);
Nan::MaybeLocal<v8::String> Nan::New<T>(const char * value);
Nan::MaybeLocal<v8::String> Nan::New<T>(const uint16_t * value);
Nan::MaybeLocal<v8::String> Nan::New<T>(const uint16_t * value, int length);
```
Specialized types:
```c++
v8::Local<v8::String> Nan::New<T>(v8::String::ExternalStringResource * value);
v8::Local<v8::String> Nan::New<T>(Nan::ExternalOneByteStringResource * value);
v8::Local<v8::RegExp> Nan::New<T>(v8::Local<v8::String> pattern, v8::RegExp::Flags flags);
```
Note that `Nan::ExternalOneByteStringResource` maps to [`v8::String::ExternalOneByteStringResource`](https://v8docs.nodesource.com/node-8.16/d9/db3/classv8_1_1_string_1_1_external_one_byte_string_resource.html), and `v8::String::ExternalAsciiStringResource` in older versions of V8.
<a name="api_nan_undefined"></a>
### Nan::Undefined()
A helper method to reference the `v8::Undefined` object in a way that is compatible across all supported versions of V8.
Signature:
```c++
v8::Local<v8::Primitive> Nan::Undefined()
```
<a name="api_nan_null"></a>
### Nan::Null()
A helper method to reference the `v8::Null` object in a way that is compatible across all supported versions of V8.
Signature:
```c++
v8::Local<v8::Primitive> Nan::Null()
```
<a name="api_nan_true"></a>
### Nan::True()
A helper method to reference the `v8::Boolean` object representing the `true` value in a way that is compatible across all supported versions of V8.
Signature:
```c++
v8::Local<v8::Boolean> Nan::True()
```
<a name="api_nan_false"></a>
### Nan::False()
A helper method to reference the `v8::Boolean` object representing the `false` value in a way that is compatible across all supported versions of V8.
Signature:
```c++
v8::Local<v8::Boolean> Nan::False()
```
<a name="api_nan_empty_string"></a>
### Nan::EmptyString()
Call [`v8::String::Empty`](https://v8docs.nodesource.com/node-8.16/d2/db3/classv8_1_1_string.html#a7c1bc8886115d7ee46f1d571dd6ebc6d) to reference the empty string in a way that is compatible across all supported versions of V8.
Signature:
```c++
v8::Local<v8::String> Nan::EmptyString()
```
<a name="api_nan_new_one_byte_string"></a>
### Nan::NewOneByteString()
An implementation of [`v8::String::NewFromOneByte()`](https://v8docs.nodesource.com/node-8.16/d2/db3/classv8_1_1_string.html#a5264d50b96d2c896ce525a734dc10f09) provided for consistent availability and API across supported versions of V8. Allocates a new string from Latin-1 data.
Signature:
```c++
Nan::MaybeLocal<v8::String> Nan::NewOneByteString(const uint8_t * value,
int length = -1)
```
@@ -0,0 +1,6 @@
import {
ArrowLeftIcon
} from "./chunk-TWGNUALX.mjs";
export {
ArrowLeftIcon
};
@@ -0,0 +1,28 @@
// https://babeljs.io/docs/en/configuration
const presets = ['@babel/preset-react']
if (process.env['BABEL_ENV'] === 'es') {
presets.unshift(['@babel/preset-env', { modules: false }])
} else {
presets.unshift('@babel/preset-env')
}
const plugins = [
'@babel/plugin-proposal-export-default-from',
'@babel/plugin-proposal-logical-assignment-operators',
['@babel/plugin-proposal-optional-chaining', { loose: false }],
['@babel/plugin-proposal-pipeline-operator', { proposal: 'minimal' }],
['@babel/plugin-proposal-nullish-coalescing-operator', { loose: false }],
'@babel/plugin-proposal-do-expressions',
'add-module-exports'
]
module.exports = {
presets,
plugins,
env: {
test: {
presets,
plugins: [...plugins, '@babel/plugin-transform-runtime', 'dynamic-import-node']
}
}
}
@@ -0,0 +1,7 @@
"use strict";
/*
* This file contains types that are intentionally wide/inaccurate, that exist
* for the purpose of satisfying both `defineConfig()` and `tseslint.config()`.
* See https://github.com/typescript-eslint/typescript-eslint/issues/10899
*/
Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,155 @@
type BaseOptions = {
/**
Number of concurrently pending promises returned by `mapper`.
Must be an integer from 1 and up or `Infinity`.
@default Infinity
*/
readonly concurrency?: number;
};
export type Options = BaseOptions & {
/**
When `true`, the first mapper rejection will be rejected back to the consumer.
When `false`, instead of stopping when a promise rejects, it will wait for all the promises to settle and then reject with an [`AggregateError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError) containing all the errors from the rejected promises.
Caveat: When `true`, any already-started async mappers will continue to run until they resolve or reject. In the case of infinite concurrency with sync iterables, *all* mappers are invoked on startup and will continue after the first rejection. [Issue #51](https://github.com/sindresorhus/p-map/issues/51) can be implemented for abort control.
@default true
*/
readonly stopOnError?: boolean;
/**
You can abort the promises using [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController).
@example
```
import pMap from 'p-map';
import delay from 'delay';
const abortController = new AbortController();
setTimeout(() => {
abortController.abort();
}, 500);
const mapper = async value => value;
await pMap([delay(1000), delay(1000)], mapper, {signal: abortController.signal});
// Throws AbortError (DOMException) after 500 ms.
```
*/
readonly signal?: AbortSignal;
};
export type IterableOptions = BaseOptions & {
/**
Maximum number of promises returned by `mapper` that have resolved but not yet collected by the consumer of the async iterable. Calls to `mapper` will be limited so that there is never too much backpressure.
Useful whenever you are consuming the iterable slower than what the mapper function can produce concurrently. For example, to avoid making an overwhelming number of HTTP requests if you are saving each of the results to a database.
Default: `options.concurrency`
*/
readonly backpressure?: number;
};
type MaybePromise<T> = T | Promise<T>;
/**
Function which is called for every item in `input`. Expected to return a `Promise` or value.
@param element - Iterated element.
@param index - Index of the element in the source array.
*/
export type Mapper<Element = any, NewElement = unknown> = (
element: Element,
index: number
) => MaybePromise<NewElement | typeof pMapSkip>;
/**
@param input - Synchronous or asynchronous iterable that is iterated over concurrently, calling the `mapper` function for each element. Each iterated item is `await`'d before the `mapper` is invoked so the iterable may return a `Promise` that resolves to an item. Asynchronous iterables (different from synchronous iterables that return `Promise` that resolves to an item) can be used when the next item may not be ready without waiting for an asynchronous process to complete and/or the end of the iterable may be reached after the asynchronous process completes. For example, reading from a remote queue when the queue has reached empty, or reading lines from a stream.
@param mapper - Function which is called for every item in `input`. Expected to return a `Promise` or value.
@returns A `Promise` that is fulfilled when all promises in `input` and ones returned from `mapper` are fulfilled, or rejects if any of the promises reject. The fulfilled value is an `Array` of the fulfilled values returned from `mapper` in `input` order.
@example
```
import pMap from 'p-map';
import got from 'got';
const sites = [
getWebsiteFromUsername('sindresorhus'), //=> Promise
'https://avajs.dev',
'https://github.com'
];
const mapper = async site => {
const {requestUrl} = await got.head(site);
return requestUrl;
};
const result = await pMap(sites, mapper, {concurrency: 2});
console.log(result);
//=> ['https://sindresorhus.com/', 'https://avajs.dev/', 'https://github.com/']
```
*/
export default function pMap<Element, NewElement>(
input: AsyncIterable<Element | Promise<Element>> | Iterable<Element | Promise<Element>>,
mapper: Mapper<Element, NewElement>,
options?: Options
): Promise<Array<Exclude<NewElement, typeof pMapSkip>>>;
/**
@param input - Synchronous or asynchronous iterable that is iterated over concurrently, calling the `mapper` function for each element. Each iterated item is `await`'d before the `mapper` is invoked so the iterable may return a `Promise` that resolves to an item. Asynchronous iterables (different from synchronous iterables that return `Promise` that resolves to an item) can be used when the next item may not be ready without waiting for an asynchronous process to complete and/or the end of the iterable may be reached after the asynchronous process completes. For example, reading from a remote queue when the queue has reached empty, or reading lines from a stream.
@param mapper - Function which is called for every item in `input`. Expected to return a `Promise` or value.
@returns An async iterable that streams each return value from `mapper` in order.
@example
```
import {pMapIterable} from 'p-map';
// Multiple posts are fetched concurrently, with limited concurrency and backpressure
for await (const post of pMapIterable(postIds, getPostMetadata, {concurrency: 8})) {
console.log(post);
};
```
*/
export function pMapIterable<Element, NewElement>(
input: AsyncIterable<Element | Promise<Element>> | Iterable<Element | Promise<Element>>,
mapper: Mapper<Element, NewElement>,
options?: IterableOptions
): AsyncIterable<Exclude<NewElement, typeof pMapSkip>>;
/**
Return this value from a `mapper` function to skip including the value in the returned array.
@example
```
import pMap, {pMapSkip} from 'p-map';
import got from 'got';
const sites = [
getWebsiteFromUsername('sindresorhus'), //=> Promise
'https://avajs.dev',
'https://example.invalid',
'https://github.com'
];
const mapper = async site => {
try {
const {requestUrl} = await got.head(site);
return requestUrl;
} catch {
return pMapSkip;
}
};
const result = await pMap(sites, mapper, {concurrency: 2});
console.log(result);
//=> ['https://sindresorhus.com/', 'https://avajs.dev/', 'https://github.com/']
```
*/
export const pMapSkip: unique symbol;
@@ -0,0 +1,397 @@
/**
* Copyright (c) 2014 The xterm.js authors. All rights reserved.
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
* @license MIT
*/
import { IKeyboardEvent, IKeyboardResult, KeyboardResultType } from 'common/Types';
import { C0 } from 'common/data/EscapeSequences';
// reg + shift key mappings for digits and special chars
const KEYCODE_KEY_MAPPINGS: { [key: number]: [string, string]} = {
// digits 0-9
48: ['0', ')'],
49: ['1', '!'],
50: ['2', '@'],
51: ['3', '#'],
52: ['4', '$'],
53: ['5', '%'],
54: ['6', '^'],
55: ['7', '&'],
56: ['8', '*'],
57: ['9', '('],
// special chars
186: [';', ':'],
187: ['=', '+'],
188: [',', '<'],
189: ['-', '_'],
190: ['.', '>'],
191: ['/', '?'],
192: ['`', '~'],
219: ['[', '{'],
220: ['\\', '|'],
221: [']', '}'],
222: ['\'', '"']
};
export function evaluateKeyboardEvent(
ev: IKeyboardEvent,
applicationCursorMode: boolean,
isMac: boolean,
macOptionIsMeta: boolean
): IKeyboardResult {
const result: IKeyboardResult = {
type: KeyboardResultType.SEND_KEY,
// Whether to cancel event propagation (NOTE: this may not be needed since the event is
// canceled at the end of keyDown
cancel: false,
// The new key even to emit
key: undefined
};
const modifiers = (ev.shiftKey ? 1 : 0) | (ev.altKey ? 2 : 0) | (ev.ctrlKey ? 4 : 0) | (ev.metaKey ? 8 : 0);
switch (ev.keyCode) {
case 0:
if (ev.key === 'UIKeyInputUpArrow') {
if (applicationCursorMode) {
result.key = C0.ESC + 'OA';
} else {
result.key = C0.ESC + '[A';
}
}
else if (ev.key === 'UIKeyInputLeftArrow') {
if (applicationCursorMode) {
result.key = C0.ESC + 'OD';
} else {
result.key = C0.ESC + '[D';
}
}
else if (ev.key === 'UIKeyInputRightArrow') {
if (applicationCursorMode) {
result.key = C0.ESC + 'OC';
} else {
result.key = C0.ESC + '[C';
}
}
else if (ev.key === 'UIKeyInputDownArrow') {
if (applicationCursorMode) {
result.key = C0.ESC + 'OB';
} else {
result.key = C0.ESC + '[B';
}
}
break;
case 8:
// backspace
result.key = ev.ctrlKey ? '\b' : C0.DEL; // ^H or ^?
if (ev.altKey) {
result.key = C0.ESC + result.key;
}
break;
case 9:
// tab
if (ev.shiftKey) {
result.key = C0.ESC + '[Z';
break;
}
result.key = C0.HT;
result.cancel = true;
break;
case 13:
// return/enter
result.key = ev.altKey ? C0.ESC + C0.CR : C0.CR;
result.cancel = true;
break;
case 27:
// escape
result.key = C0.ESC;
if (ev.altKey) {
result.key = C0.ESC + C0.ESC;
}
result.cancel = true;
break;
case 37:
// left-arrow
if (ev.metaKey) {
break;
}
if (modifiers) {
result.key = C0.ESC + '[1;' + (modifiers + 1) + 'D';
// HACK: Make Alt + left-arrow behave like Ctrl + left-arrow: move one word backwards
// http://unix.stackexchange.com/a/108106
// macOS uses different escape sequences than linux
if (result.key === C0.ESC + '[1;3D') {
result.key = C0.ESC + (isMac ? 'b' : '[1;5D');
}
} else if (applicationCursorMode) {
result.key = C0.ESC + 'OD';
} else {
result.key = C0.ESC + '[D';
}
break;
case 39:
// right-arrow
if (ev.metaKey) {
break;
}
if (modifiers) {
result.key = C0.ESC + '[1;' + (modifiers + 1) + 'C';
// HACK: Make Alt + right-arrow behave like Ctrl + right-arrow: move one word forward
// http://unix.stackexchange.com/a/108106
// macOS uses different escape sequences than linux
if (result.key === C0.ESC + '[1;3C') {
result.key = C0.ESC + (isMac ? 'f' : '[1;5C');
}
} else if (applicationCursorMode) {
result.key = C0.ESC + 'OC';
} else {
result.key = C0.ESC + '[C';
}
break;
case 38:
// up-arrow
if (ev.metaKey) {
break;
}
if (modifiers) {
result.key = C0.ESC + '[1;' + (modifiers + 1) + 'A';
// HACK: Make Alt + up-arrow behave like Ctrl + up-arrow
// http://unix.stackexchange.com/a/108106
// macOS uses different escape sequences than linux
if (!isMac && result.key === C0.ESC + '[1;3A') {
result.key = C0.ESC + '[1;5A';
}
} else if (applicationCursorMode) {
result.key = C0.ESC + 'OA';
} else {
result.key = C0.ESC + '[A';
}
break;
case 40:
// down-arrow
if (ev.metaKey) {
break;
}
if (modifiers) {
result.key = C0.ESC + '[1;' + (modifiers + 1) + 'B';
// HACK: Make Alt + down-arrow behave like Ctrl + down-arrow
// http://unix.stackexchange.com/a/108106
// macOS uses different escape sequences than linux
if (!isMac && result.key === C0.ESC + '[1;3B') {
result.key = C0.ESC + '[1;5B';
}
} else if (applicationCursorMode) {
result.key = C0.ESC + 'OB';
} else {
result.key = C0.ESC + '[B';
}
break;
case 45:
// insert
if (!ev.shiftKey && !ev.ctrlKey) {
// <Ctrl> or <Shift> + <Insert> are used to
// copy-paste on some systems.
result.key = C0.ESC + '[2~';
}
break;
case 46:
// delete
if (modifiers) {
result.key = C0.ESC + '[3;' + (modifiers + 1) + '~';
} else {
result.key = C0.ESC + '[3~';
}
break;
case 36:
// home
if (modifiers) {
result.key = C0.ESC + '[1;' + (modifiers + 1) + 'H';
} else if (applicationCursorMode) {
result.key = C0.ESC + 'OH';
} else {
result.key = C0.ESC + '[H';
}
break;
case 35:
// end
if (modifiers) {
result.key = C0.ESC + '[1;' + (modifiers + 1) + 'F';
} else if (applicationCursorMode) {
result.key = C0.ESC + 'OF';
} else {
result.key = C0.ESC + '[F';
}
break;
case 33:
// page up
if (ev.shiftKey) {
result.type = KeyboardResultType.PAGE_UP;
} else if (ev.ctrlKey) {
result.key = C0.ESC + '[5;' + (modifiers + 1) + '~';
} else {
result.key = C0.ESC + '[5~';
}
break;
case 34:
// page down
if (ev.shiftKey) {
result.type = KeyboardResultType.PAGE_DOWN;
} else if (ev.ctrlKey) {
result.key = C0.ESC + '[6;' + (modifiers + 1) + '~';
} else {
result.key = C0.ESC + '[6~';
}
break;
case 112:
// F1-F12
if (modifiers) {
result.key = C0.ESC + '[1;' + (modifiers + 1) + 'P';
} else {
result.key = C0.ESC + 'OP';
}
break;
case 113:
if (modifiers) {
result.key = C0.ESC + '[1;' + (modifiers + 1) + 'Q';
} else {
result.key = C0.ESC + 'OQ';
}
break;
case 114:
if (modifiers) {
result.key = C0.ESC + '[1;' + (modifiers + 1) + 'R';
} else {
result.key = C0.ESC + 'OR';
}
break;
case 115:
if (modifiers) {
result.key = C0.ESC + '[1;' + (modifiers + 1) + 'S';
} else {
result.key = C0.ESC + 'OS';
}
break;
case 116:
if (modifiers) {
result.key = C0.ESC + '[15;' + (modifiers + 1) + '~';
} else {
result.key = C0.ESC + '[15~';
}
break;
case 117:
if (modifiers) {
result.key = C0.ESC + '[17;' + (modifiers + 1) + '~';
} else {
result.key = C0.ESC + '[17~';
}
break;
case 118:
if (modifiers) {
result.key = C0.ESC + '[18;' + (modifiers + 1) + '~';
} else {
result.key = C0.ESC + '[18~';
}
break;
case 119:
if (modifiers) {
result.key = C0.ESC + '[19;' + (modifiers + 1) + '~';
} else {
result.key = C0.ESC + '[19~';
}
break;
case 120:
if (modifiers) {
result.key = C0.ESC + '[20;' + (modifiers + 1) + '~';
} else {
result.key = C0.ESC + '[20~';
}
break;
case 121:
if (modifiers) {
result.key = C0.ESC + '[21;' + (modifiers + 1) + '~';
} else {
result.key = C0.ESC + '[21~';
}
break;
case 122:
if (modifiers) {
result.key = C0.ESC + '[23;' + (modifiers + 1) + '~';
} else {
result.key = C0.ESC + '[23~';
}
break;
case 123:
if (modifiers) {
result.key = C0.ESC + '[24;' + (modifiers + 1) + '~';
} else {
result.key = C0.ESC + '[24~';
}
break;
default:
// a-z and space
if (ev.ctrlKey && !ev.shiftKey && !ev.altKey && !ev.metaKey) {
if (ev.keyCode >= 65 && ev.keyCode <= 90) {
result.key = String.fromCharCode(ev.keyCode - 64);
} else if (ev.keyCode === 32) {
result.key = C0.NUL;
} else if (ev.keyCode >= 51 && ev.keyCode <= 55) {
// escape, file sep, group sep, record sep, unit sep
result.key = String.fromCharCode(ev.keyCode - 51 + 27);
} else if (ev.keyCode === 56) {
result.key = C0.DEL;
} else if (ev.keyCode === 219) {
result.key = C0.ESC;
} else if (ev.keyCode === 220) {
result.key = C0.FS;
} else if (ev.keyCode === 221) {
result.key = C0.GS;
}
} else if ((!isMac || macOptionIsMeta) && ev.altKey && !ev.metaKey) {
// On macOS this is a third level shift when !macOptionIsMeta. Use <Esc> instead.
const keyMapping = KEYCODE_KEY_MAPPINGS[ev.keyCode];
const key = keyMapping?.[!ev.shiftKey ? 0 : 1];
if (key) {
result.key = C0.ESC + key;
} else if (ev.keyCode >= 65 && ev.keyCode <= 90) {
const keyCode = ev.ctrlKey ? ev.keyCode - 64 : ev.keyCode + 32;
let keyString = String.fromCharCode(keyCode);
if (ev.shiftKey) {
keyString = keyString.toUpperCase();
}
result.key = C0.ESC + keyString;
} else if (ev.keyCode === 32) {
result.key = C0.ESC + (ev.ctrlKey ? C0.NUL : ' ');
} else if (ev.key === 'Dead' && ev.code.startsWith('Key')) {
// Reference: https://github.com/xtermjs/xterm.js/issues/3725
// Alt will produce a "dead key" (initate composition) with some
// of the letters in US layout (e.g. N/E/U).
// It's safe to match against Key* since no other `code` values begin with "Key".
// https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values#code_values_on_mac
let keyString = ev.code.slice(3, 4);
if (!ev.shiftKey) {
keyString = keyString.toLowerCase();
}
result.key = C0.ESC + keyString;
result.cancel = true;
}
} else if (isMac && !ev.altKey && !ev.ctrlKey && !ev.shiftKey && ev.metaKey) {
if (ev.keyCode === 65) { // cmd + a
result.type = KeyboardResultType.SELECT_ALL;
}
} else if (ev.key && !ev.ctrlKey && !ev.altKey && !ev.metaKey && ev.keyCode >= 48 && ev.key.length === 1) {
// Include only keys that that result in a _single_ character; don't include num lock,
// volume up, etc.
result.key = ev.key;
} else if (ev.key && ev.ctrlKey) {
if (ev.key === '_') { // ^_
result.key = C0.US;
}
if (ev.key === '@') { // ^ + shift + 2 = ^ + @
result.key = C0.NUL;
}
}
break;
}
return result;
}
@@ -0,0 +1,21 @@
/**
* Gets the number of `placeholder` occurrences in `array`.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} placeholder The placeholder to search for.
* @returns {number} Returns the placeholder count.
*/
function countHolders(array, placeholder) {
var length = array.length,
result = 0;
while (length--) {
if (array[length] === placeholder) {
++result;
}
}
return result;
}
export default countHolders;
@@ -0,0 +1,28 @@
{
"name": "@babel/helper-module-imports",
"version": "7.27.1",
"description": "Babel helper functions for inserting module loads",
"author": "The Babel Team (https://babel.dev/team)",
"homepage": "https://babel.dev/docs/en/next/babel-helper-module-imports",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-helper-module-imports"
},
"main": "./lib/index.js",
"dependencies": {
"@babel/traverse": "^7.27.1",
"@babel/types": "^7.27.1"
},
"devDependencies": {
"@babel/core": "^7.27.1"
},
"engines": {
"node": ">=6.9.0"
},
"type": "commonjs"
}
@@ -0,0 +1,14 @@
import defineProperty from "./defineProperty.js";
function _objectSpread(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? Object(arguments[r]) : {},
o = Object.keys(t);
"function" == typeof Object.getOwnPropertySymbols && o.push.apply(o, Object.getOwnPropertySymbols(t).filter(function (e) {
return Object.getOwnPropertyDescriptor(t, e).enumerable;
})), o.forEach(function (r) {
defineProperty(e, r, t[r]);
});
}
return e;
}
export { _objectSpread as default };
@@ -0,0 +1,38 @@
"use client";
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/collections/index.ts
var collections_exports = {};
__export(collections_exports, {
BaseItem: () => import_collections.Item,
BaseSection: () => import_collections2.Section
});
module.exports = __toCommonJS(collections_exports);
// src/collections/item.ts
var import_collections = require("@react-stately/collections");
// src/collections/section.ts
var import_collections2 = require("@react-stately/collections");
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
BaseItem,
BaseSection
});
@@ -0,0 +1,67 @@
'use strict';
var utils = require('../utils.js');
require('eslint-visitor-keys');
require('espree');
require('estraverse');
var newParens = utils.createRule({
name: "new-parens",
package: "js",
meta: {
type: "layout",
docs: {
description: "Enforce or disallow parentheses when invoking a constructor with no arguments"
},
fixable: "code",
schema: [
{
type: "string",
enum: ["always", "never"]
}
],
messages: {
missing: "Missing '()' invoking a constructor.",
unnecessary: "Unnecessary '()' invoking a constructor with no arguments."
}
},
create(context) {
const options = context.options;
const always = options[0] !== "never";
const sourceCode = context.sourceCode;
return {
NewExpression(node) {
if (node.arguments.length !== 0)
return;
const lastToken = sourceCode.getLastToken(node);
const hasLastParen = lastToken && utils.isClosingParenToken(lastToken);
const tokenBeforeLastToken = sourceCode.getTokenBefore(lastToken);
const hasParens = hasLastParen && utils.isOpeningParenToken(tokenBeforeLastToken) && node.callee.range[1] < node.range[1];
if (always) {
if (!hasParens) {
context.report({
node,
messageId: "missing",
fix: (fixer) => fixer.insertTextAfter(node, "()")
});
}
} else {
if (hasParens) {
context.report({
node,
messageId: "unnecessary",
fix: (fixer) => [
fixer.remove(tokenBeforeLastToken),
fixer.remove(lastToken),
fixer.insertTextBefore(node, "("),
fixer.insertTextAfter(node, ")")
]
});
}
}
}
};
}
});
module.exports = newParens;
@@ -0,0 +1,27 @@
# react-photo-view
**An exquisite React photo preview component**
[![NPM version][npm-image]][npm-url]
[![Downloads][downloads-image]][downloads-url]
[![Minified size][min-size-image]][bundlephobia-url]
[![Gzip size][gzip-size-image]][bundlephobia-url]
## Quick start
- [Documentation](https://react-photo-view.vercel.app)
- [Getting started](https://react-photo-view.vercel.app/docs/getting-started)
- [API](https://react-photo-view.vercel.app/docs/api)
- [Change log](https://react-photo-view.vercel.app/docs/change-log)
## License
Apache-2.0 © [MinJieLiu](https://github.com/MinJieLiu)
[npm-image]: https://img.shields.io/npm/v/react-photo-view.svg?style=flat-square
[npm-url]: https://npmjs.org/package/react-photo-view
[downloads-image]: http://img.shields.io/npm/dm/react-photo-view.svg?style=flat-square
[downloads-url]: https://npmjs.org/package/react-photo-view
[min-size-image]: https://badgen.net/bundlephobia/min/react-photo-view?label=minified
[gzip-size-image]: https://badgen.net/bundlephobia/minzip/react-photo-view?label=gzip
[bundlephobia-url]: https://bundlephobia.com/result?p=react-photo-view
@@ -0,0 +1,111 @@
function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
import {TokenType as tt} from "../parser/tokenizer/types";
import Transformer from "./Transformer";
const JEST_GLOBAL_NAME = "jest";
const HOISTED_METHODS = ["mock", "unmock", "enableAutomock", "disableAutomock"];
/**
* Implementation of babel-plugin-jest-hoist, which hoists up some jest method
* calls above the imports to allow them to override other imports.
*
* To preserve line numbers, rather than directly moving the jest.mock code, we
* wrap each invocation in a function statement and then call the function from
* the top of the file.
*/
export default class JestHoistTransformer extends Transformer {
__init() {this.hoistedFunctionNames = []}
constructor(
rootTransformer,
tokens,
nameManager,
importProcessor,
) {
super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.nameManager = nameManager;this.importProcessor = importProcessor;JestHoistTransformer.prototype.__init.call(this);;
}
process() {
if (
this.tokens.currentToken().scopeDepth === 0 &&
this.tokens.matches4(tt.name, tt.dot, tt.name, tt.parenL) &&
this.tokens.identifierName() === JEST_GLOBAL_NAME
) {
// TODO: This only works if imports transform is active, which it will be for jest.
// But if jest adds module support and we no longer need the import transform, this needs fixing.
if (_optionalChain([this, 'access', _ => _.importProcessor, 'optionalAccess', _2 => _2.getGlobalNames, 'call', _3 => _3(), 'optionalAccess', _4 => _4.has, 'call', _5 => _5(JEST_GLOBAL_NAME)])) {
return false;
}
return this.extractHoistedCalls();
}
return false;
}
getHoistedCode() {
if (this.hoistedFunctionNames.length > 0) {
// This will be placed before module interop code, but that's fine since
// imports aren't allowed in module mock factories.
return this.hoistedFunctionNames.map((name) => `${name}();`).join("");
}
return "";
}
/**
* Extracts any methods calls on the jest-object that should be hoisted.
*
* According to the jest docs, https://jestjs.io/docs/en/jest-object#jestmockmodulename-factory-options,
* mock, unmock, enableAutomock, disableAutomock, are the methods that should be hoisted.
*
* We do not apply the same checks of the arguments as babel-plugin-jest-hoist does.
*/
extractHoistedCalls() {
// We're handling a chain of calls where `jest` may or may not need to be inserted for each call
// in the chain, so remove the initial `jest` to make the loop implementation cleaner.
this.tokens.removeToken();
// Track some state so that multiple non-hoisted chained calls in a row keep their chaining
// syntax.
let followsNonHoistedJestCall = false;
// Iterate through all chained calls on the jest object.
while (this.tokens.matches3(tt.dot, tt.name, tt.parenL)) {
const methodName = this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 1);
const shouldHoist = HOISTED_METHODS.includes(methodName);
if (shouldHoist) {
// We've matched e.g. `.mock(...)` or similar call.
// Replace the initial `.` with `function __jestHoist(){jest.`
const hoistedFunctionName = this.nameManager.claimFreeName("__jestHoist");
this.hoistedFunctionNames.push(hoistedFunctionName);
this.tokens.replaceToken(`function ${hoistedFunctionName}(){${JEST_GLOBAL_NAME}.`);
this.tokens.copyToken();
this.tokens.copyToken();
this.rootTransformer.processBalancedCode();
this.tokens.copyExpectedToken(tt.parenR);
this.tokens.appendCode(";}");
followsNonHoistedJestCall = false;
} else {
// This is a non-hoisted method, so just transform the code as usual.
if (followsNonHoistedJestCall) {
// If we didn't hoist the previous call, we can leave the code as-is to chain off of the
// previous method call. It's important to preserve the code here because we don't know
// for sure that the method actually returned the jest object for chaining.
this.tokens.copyToken();
} else {
// If we hoisted the previous call, we know it returns the jest object back, so we insert
// the identifier `jest` to continue the chain.
this.tokens.replaceToken(`${JEST_GLOBAL_NAME}.`);
}
this.tokens.copyToken();
this.tokens.copyToken();
this.rootTransformer.processBalancedCode();
this.tokens.copyExpectedToken(tt.parenR);
followsNonHoistedJestCall = true;
}
}
return true;
}
}
@@ -0,0 +1 @@
module.exports={C:{"3":0.00476,"48":0.00951,"50":0.00476,"52":0.02854,"53":0.00476,"54":0.00951,"55":0.00476,"56":0.00476,"57":0.00476,"59":0.03329,"75":0.00951,"78":0.02378,"88":0.00476,"91":0.00476,"102":0.00476,"113":0.00951,"115":0.43755,"121":0.00476,"124":0.00476,"125":0.00951,"127":0.00476,"128":0.13317,"130":0.00476,"131":0.00476,"132":0.00476,"133":0.01427,"134":0.01902,"135":0.01902,"136":0.03805,"137":0.1189,"138":0.01427,"139":0.02378,"140":0.20926,"141":0.08085,"142":0.08085,"143":1.99752,"144":1.88338,"145":0.00476,_:"2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 49 51 58 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 76 77 79 80 81 82 83 84 85 86 87 89 90 92 93 94 95 96 97 98 99 100 101 103 104 105 106 107 108 109 110 111 112 114 116 117 118 119 120 122 123 126 129 146 147 3.5 3.6"},D:{"29":0.00476,"39":0.00951,"40":0.00476,"41":0.00951,"42":0.00476,"43":0.00951,"44":0.00476,"45":0.00476,"46":0.00476,"47":0.00951,"48":0.01902,"49":0.03805,"50":0.00951,"51":0.00951,"52":0.02378,"53":0.00951,"54":0.00476,"55":0.00951,"56":0.02854,"57":0.00951,"58":0.00951,"59":0.00951,"60":0.00476,"66":0.14268,"67":0.00476,"70":0.00476,"73":0.02854,"74":0.00476,"76":0.00476,"78":0.00476,"79":0.01902,"80":0.00476,"81":0.00476,"83":0.00476,"84":0.00476,"85":0.00951,"86":0.00476,"87":0.02854,"88":0.00476,"90":0.00476,"91":0.00476,"92":0.00476,"93":0.03805,"95":0.00476,"97":0.00476,"98":0.00476,"100":0.00476,"102":0.13792,"103":0.04756,"104":0.01427,"105":0.00476,"106":0.00476,"107":0.00476,"108":0.00951,"109":0.7895,"110":0.00476,"111":0.00951,"112":0.01902,"113":0.00951,"114":0.04756,"115":0.01902,"116":0.14744,"117":0.00476,"118":0.10463,"119":0.02378,"120":0.02854,"121":0.01427,"122":0.09512,"123":0.02854,"124":0.03329,"125":1.32217,"126":0.08085,"127":0.03805,"128":0.08085,"129":0.02854,"130":0.27109,"131":0.14744,"132":0.51365,"133":0.09988,"134":0.09988,"135":0.12841,"136":0.29012,"137":0.13317,"138":0.3995,"139":0.81328,"140":6.00207,"141":12.66998,"142":0.16646,"143":0.00476,_:"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 30 31 32 33 34 35 36 37 38 61 62 63 64 65 68 69 71 72 75 77 89 94 96 99 101 144 145"},F:{"46":0.00476,"91":0.01902,"92":0.02854,"95":0.03805,"102":0.00476,"114":0.01427,"115":0.00476,"116":0.00476,"117":0.00476,"119":0.00476,"120":0.12841,"121":0.16646,"122":1.31741,_:"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 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 89 90 93 94 96 97 98 99 100 101 103 104 105 106 107 108 109 110 111 112 113 118 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"12":0.00476,"14":0.00476,"17":0.01902,"18":0.00476,"92":0.00476,"96":0.00951,"101":0.01902,"109":0.08085,"114":0.00476,"120":0.00476,"122":0.37572,"126":0.03329,"127":0.00476,"128":0.00476,"129":0.00476,"130":0.00951,"131":0.03805,"132":0.01427,"133":0.01427,"134":0.0428,"135":0.01902,"136":0.02378,"137":0.01902,"138":0.03805,"139":0.05707,"140":0.96071,"141":4.58003,"142":0.01427,_:"13 15 16 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 97 98 99 100 102 103 104 105 106 107 108 110 111 112 113 115 116 117 118 119 121 123 124 125"},E:{"4":0.00476,"9":0.00476,"14":0.00951,_:"0 5 6 7 8 10 11 12 13 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 26.2","11.1":0.03805,"12.1":0.00476,"13.1":0.08085,"14.1":0.13317,"15.1":0.00951,"15.2-15.3":0.00476,"15.4":0.00951,"15.5":0.00951,"15.6":0.18548,"16.0":0.02378,"16.1":0.01902,"16.2":0.01427,"16.3":0.01902,"16.4":0.01427,"16.5":0.01902,"16.6":0.22353,"17.0":0.01427,"17.1":0.1189,"17.2":0.02378,"17.3":0.01902,"17.4":0.03805,"17.5":0.07134,"17.6":0.25682,"18.0":0.02378,"18.1":0.03805,"18.2":0.02378,"18.3":0.08561,"18.4":0.04756,"18.5-18.6":0.18548,"26.0":0.5517,"26.1":0.01902},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00134,"5.0-5.1":0,"6.0-6.1":0.00534,"7.0-7.1":0.00401,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.01202,"10.0-10.2":0.00134,"10.3":0.02271,"11.0-11.2":0.33658,"11.3-11.4":0.00801,"12.0-12.1":0.00267,"12.2-12.5":0.06545,"13.0-13.1":0,"13.2":0.00668,"13.3":0.00267,"13.4-13.7":0.01069,"14.0-14.4":0.02271,"14.5-14.8":0.02404,"15.0-15.1":0.02271,"15.2-15.3":0.01736,"15.4":0.02003,"15.5":0.02271,"15.6-15.8":0.29651,"16.0":0.04007,"16.1":0.0748,"16.2":0.03873,"16.3":0.06945,"16.4":0.01736,"16.5":0.03072,"16.6-16.7":0.39669,"17.0":0.02805,"17.1":0.04274,"17.2":0.03072,"17.3":0.04541,"17.4":0.08014,"17.5":0.13757,"17.6-17.7":0.34727,"18.0":0.0788,"18.1":0.16295,"18.2":0.08815,"18.3":0.28316,"18.4":0.14559,"18.5-18.6":7.42352,"26.0":0.91759,"26.1":0.03339},P:{"4":0.02113,"20":0.01057,"21":0.02113,"22":0.0317,"23":0.02113,"24":0.02113,"25":0.0317,"26":0.0634,"27":0.07397,"28":2.28251,"29":0.16907,_:"5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 14.0 15.0 16.0 18.0","7.2-7.4":0.02113,"13.0":0.01057,"17.0":0.01057,"19.0":0.01057},I:{"0":0.06808,"3":0,"4":0,"2.1":0,"2.Line truncated
@@ -0,0 +1,37 @@
import {DelimiterCase} from './delimiter-case';
/**
Convert a string literal to snake-case.
This can be useful when, for example, converting a camel-cased object property to a snake-cased SQL column name.
@example
```
import {SnakeCase} from 'type-fest';
// Simple
const someVariable: SnakeCase<'fooBar'> = 'foo_bar';
// Advanced
type SnakeCasedProperties<T> = {
[K in keyof T as SnakeCase<K>]: T[K]
};
interface ModelProps {
isHappy: boolean;
fullFamilyName: string;
foo: number;
}
const dbResult: SnakeCasedProperties<ModelProps> = {
'is_happy': true,
'full_family_name': 'Carla Smith',
foo: 123
};
```
@category Template Literals
*/
export type SnakeCase<Value> = DelimiterCase<Value, '_'>;
@@ -0,0 +1,36 @@
"use strict"
const {
definePrototypeMethodHandler,
} = require("../util/define-prototype-method-handler")
module.exports = {
meta: {
docs: {
description: "disallow the `Set.prototype.difference` method.",
category: "ES2025",
proposal: "set-methods",
recommended: false,
url: "http://eslint-community.github.io/eslint-plugin-es-x/rules/no-set-prototype-difference.html",
},
fixable: null,
messages: {
forbidden: "ES2025 '{{name}}' method is forbidden.",
},
schema: [
{
type: "object",
properties: {
aggressive: { type: "boolean" },
},
additionalProperties: false,
},
],
type: "problem",
},
create(context) {
return definePrototypeMethodHandler(context, {
Set: ["difference"],
})
},
}
@@ -0,0 +1,60 @@
{
"name": "micromark-factory-label",
"version": "2.0.1",
"description": "micromark factory to parse labels (found in media, definitions)",
"license": "MIT",
"keywords": [
"micromark",
"factory",
"label"
],
"repository": "https://github.com/micromark/micromark/tree/main/packages/micromark-factory-label",
"bugs": "https://github.com/micromark/micromark/issues",
"funding": [
{
"type": "GitHub Sponsors",
"url": "https://github.com/sponsors/unifiedjs"
},
{
"type": "OpenCollective",
"url": "https://opencollective.com/unified"
}
],
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
"contributors": [
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
],
"sideEffects": false,
"type": "module",
"files": [
"dev/",
"index.d.ts.map",
"index.d.ts",
"index.js"
],
"exports": {
"development": "./dev/index.js",
"default": "./index.js"
},
"dependencies": {
"devlop": "^1.0.0",
"micromark-util-character": "^2.0.0",
"micromark-util-symbol": "^2.0.0",
"micromark-util-types": "^2.0.0"
},
"scripts": {
"build": "micromark-build"
},
"xo": {
"envs": [
"shared-node-browser"
],
"prettier": true,
"rules": {
"logical-assignment-operators": "off",
"max-params": "off",
"unicorn/no-this-assignment": "off",
"unicorn/prefer-code-point": "off"
}
}
}
@@ -0,0 +1,44 @@
;(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) {
/**
* ISO 10126 padding strategy.
*/
CryptoJS.pad.Iso10126 = {
pad: function (data, blockSize) {
// Shortcut
var blockSizeBytes = blockSize * 4;
// Count padding bytes
var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
// Pad
data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)).
concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1));
},
unpad: function (data) {
// Get number of padding bytes from last byte
var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
// Remove padding
data.sigBytes -= nPaddingBytes;
}
};
return CryptoJS.pad.Iso10126;
}));
@@ -0,0 +1 @@
{"mappings":";AAAA,4BAAiB;IAAG,oBAAoB,CAAC,gFAAgF,CAAC;AAC1H","sources":["packages/@react-aria/menu/intl/hr-HR.json"],"sourcesContent":["{\n \"longPressMessage\": \"Dugo pritisnite ili pritisnite Alt + strelicu prema dolje za otvaranje izbornika\"\n}\n"],"names":[],"version":3,"file":"hr-HR.module.js.map"}
@@ -0,0 +1,21 @@
/**
* DON'T EDIT THIS FILE.
* This file was generated by "scripts/update-lib-configs.js" script.
*/
"use strict"
module.exports = {
plugins: ["es-x"],
rules: {
"es-x/no-arbitrary-module-namespace-names": "error",
"es-x/no-array-string-prototype-at": "error",
"es-x/no-class-fields": "error",
"es-x/no-class-static-block": "error",
"es-x/no-error-cause": "error",
"es-x/no-object-hasown": "error",
"es-x/no-private-in": "error",
"es-x/no-regexp-d-flag": "error",
"es-x/no-regexp-unicode-property-escapes-2022": "error",
"es-x/no-top-level-await": "error",
},
}
@@ -0,0 +1,16 @@
'use strict';
var $TypeError = require('es-errors/type');
var isObject = require('es-object-atoms/isObject');
var isSharedArrayBuffer = require('is-shared-array-buffer');
// https://262.ecma-international.org/8.0/#sec-issharedarraybuffer
module.exports = function IsSharedArrayBuffer(obj) {
if (!isObject(obj)) {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
return isSharedArrayBuffer(obj);
};
@@ -0,0 +1,49 @@
var _excluded = ["attr", "size", "title"];
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
import React from "react";
import { IconContext, DefaultContext } from "./iconContext.mjs";
function Tree2Element(tree) {
return tree && tree.map((node, i) => /*#__PURE__*/React.createElement(node.tag, _objectSpread({
key: i
}, node.attr), Tree2Element(node.child)));
}
export function GenIcon(data) {
return props => /*#__PURE__*/React.createElement(IconBase, _extends({
attr: _objectSpread({}, data.attr)
}, props), Tree2Element(data.child));
}
export function IconBase(props) {
var elem = conf => {
var {
attr,
size,
title
} = props,
svgProps = _objectWithoutProperties(props, _excluded);
var computedSize = size || conf.size || "1em";
var className;
if (conf.className) className = conf.className;
if (props.className) className = (className ? className + " " : "") + props.className;
return /*#__PURE__*/React.createElement("svg", _extends({
stroke: "currentColor",
fill: "currentColor",
strokeWidth: "0"
}, conf.attr, attr, svgProps, {
className: className,
style: _objectSpread(_objectSpread({
color: props.color || conf.color
}, conf.style), props.style),
height: computedSize,
width: computedSize,
xmlns: "http://www.w3.org/2000/svg"
}), title && /*#__PURE__*/React.createElement("title", null, title), props.children);
};
return IconContext !== undefined ? /*#__PURE__*/React.createElement(IconContext.Consumer, null, conf => elem(conf)) : elem(DefaultContext);
}
@@ -0,0 +1 @@
{"version":3,"names":["_utils","require","_core","_is","defineType","defineAliasedType","bool","assertValueType","tSFunctionTypeAnnotationCommon","returnType","validate","assertNodeType","optional","typeParameters","aliases","visitor","fields","accessibility","assertOneOf","readonly","parameter","override","decorators","arrayOfType","Object","assign","functionDeclarationCommon","classMethodOrPropertyUnionShapeCommon","classMethodOrDeclareMethodCommon","left","validateType","right","signatureDeclarationCommon","validateOptionalType","validateArrayOfType","callConstructSignatureDeclaration","namedTypeElementCommon","key","computed","default","validateOptional","typeAnnotation","kind","static","parameters","tsKeywordTypes","type","fnOrCtrBase","abstract","typeName","builder","parameterName","asserts","exprName","members","elementType","elementTypes","label","unionOrIntersection","types","checkType","extendsType","trueType","falseType","typeParameter","operator","objectType","indexType","nameType","quasis","chain","assertEach","node","val","length","TypeError","literal","unaryExpression","unaryOperator","validator","parent","is","argument","oneOfNodeTypes","expression","declare","id","extends","body","TSTypeExpression","const","initializer","global","qualifier","options","isExport","moduleReference","importKind","params","name","in","out","constraint"],"sources":["../../src/definitions/typescript.ts"],"sourcesContent":["import type * as t from \"../index.ts\";\nimport {\n defineAliasedType,\n arrayOfType,\n assertEach,\n assertNodeType,\n assertOneOf,\n assertValueType,\n chain,\n validate,\n validateArrayOfType,\n validateOptional,\n validateOptionalType,\n validateType,\n type ValidatorImpl,\n type ValidatorOneOfNodeTypes,\n} from \"./utils.ts\";\nimport {\n functionDeclarationCommon,\n classMethodOrDeclareMethodCommon,\n classMethodOrPropertyUnionShapeCommon,\n} from \"./core.ts\";\nimport is from \"../validators/is.ts\";\n\nconst defineType = defineAliasedType(\"TypeScript\");\n\nconst bool = assertValueType(\"boolean\");\n\nconst tSFunctionTypeAnnotationCommon = () => ({\n returnType: {\n validate: process.env.BABEL_8_BREAKING\n ? assertNodeType(\"TSTypeAnnotation\")\n : // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n assertNodeType(\"TSTypeAnnotation\", \"Noop\"),\n optional: true,\n },\n typeParameters: {\n validate: process.env.BABEL_8_BREAKING\n ? assertNodeType(\"TSTypeParameterDeclaration\")\n : // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n assertNodeType(\"TSTypeParameterDeclaration\", \"Noop\"),\n optional: true,\n },\n});\n\ndefineType(\"TSParameterProperty\", {\n aliases: process.env.BABEL_8_BREAKING ? [] : [\"LVal\"],\n visitor: [\"parameter\"],\n fields: {\n accessibility: {\n validate: assertOneOf(\"public\", \"private\", \"protected\"),\n optional: true,\n },\n readonly: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n parameter: {\n validate: assertNodeType(\"Identifier\", \"AssignmentPattern\"),\n },\n override: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n decorators: {\n validate: arrayOfType(\"Decorator\"),\n optional: true,\n },\n },\n});\n\ndefineType(\"TSDeclareFunction\", {\n aliases: [\"Statement\", \"Declaration\"],\n visitor: [\"id\", \"typeParameters\", \"params\", \"returnType\"],\n fields: {\n ...functionDeclarationCommon(),\n ...tSFunctionTypeAnnotationCommon(),\n },\n});\n\ndefineType(\"TSDeclareMethod\", {\n visitor: [\"decorators\", \"key\", \"typeParameters\", \"params\", \"returnType\"],\n ...classMethodOrPropertyUnionShapeCommon(),\n fields: {\n ...classMethodOrDeclareMethodCommon(),\n ...tSFunctionTypeAnnotationCommon(),\n },\n});\n\ndefineType(\"TSQualifiedName\", {\n aliases: [\"TSEntityName\"],\n visitor: [\"left\", \"right\"],\n fields: {\n left: validateType(\"TSEntityName\"),\n right: validateType(\"Identifier\"),\n },\n});\n\nconst signatureDeclarationCommon = () => ({\n typeParameters: validateOptionalType(\"TSTypeParameterDeclaration\"),\n [process.env.BABEL_8_BREAKING ? \"params\" : \"parameters\"]: validateArrayOfType(\n \"ArrayPattern\",\n \"Identifier\",\n \"ObjectPattern\",\n \"RestElement\",\n ),\n [process.env.BABEL_8_BREAKING ? \"returnType\" : \"typeAnnotation\"]:\n validateOptionalType(\"TSTypeAnnotation\"),\n});\n\nconst callConstructSignatureDeclaration = {\n aliases: [\"TSTypeElement\"],\n visitor: [\n \"typeParameters\",\n process.env.BABEL_8_BREAKING ? \"params\" : \"parameters\",\n process.env.BABEL_8_BREAKING ? \"returnType\" : \"typeAnnotation\",\n ],\n fields: signatureDeclarationCommon(),\n};\n\ndefineType(\"TSCallSignatureDeclaration\", callConstructSignatureDeclaration);\ndefineType(\n \"TSConstructSignatureDeclaration\",\n callConstructSignatureDeclaration,\n);\n\nconst namedTypeElementCLine truncated
@@ -0,0 +1,169 @@
# p-map
> Map over promises concurrently
Useful when you need to run promise-returning & async functions multiple times with different inputs concurrently.
This is different from `Promise.all()` in that you can control the concurrency and also decide whether or not to stop iterating when there's an error.
## Install
```sh
npm install p-map
```
## Usage
```js
import pMap from 'p-map';
import got from 'got';
const sites = [
getWebsiteFromUsername('sindresorhus'), //=> Promise
'https://avajs.dev',
'https://github.com'
];
const mapper = async site => {
const {requestUrl} = await got.head(site);
return requestUrl;
};
const result = await pMap(sites, mapper, {concurrency: 2});
console.log(result);
//=> ['https://sindresorhus.com/', 'https://avajs.dev/', 'https://github.com/']
```
## API
### pMap(input, mapper, options?)
Returns a `Promise` that is fulfilled when all promises in `input` and ones returned from `mapper` are fulfilled, or rejects if any of the promises reject. The fulfilled value is an `Array` of the fulfilled values returned from `mapper` in `input` order.
### pMapIterable(input, mapper, options?)
Returns an async iterable that streams each return value from `mapper` in order.
```js
import {pMapIterable} from 'p-map';
// Multiple posts are fetched concurrently, with limited concurrency and backpressure
for await (const post of pMapIterable(postIds, getPostMetadata, {concurrency: 8})) {
console.log(post);
};
```
#### input
Type: `AsyncIterable<Promise<unknown> | unknown> | Iterable<Promise<unknown> | unknown>`
Synchronous or asynchronous iterable that is iterated over concurrently, calling the `mapper` function for each element. Each iterated item is `await`'d before the `mapper` is invoked so the iterable may return a `Promise` that resolves to an item.
Asynchronous iterables (different from synchronous iterables that return `Promise` that resolves to an item) can be used when the next item may not be ready without waiting for an asynchronous process to complete and/or the end of the iterable may be reached after the asynchronous process completes. For example, reading from a remote queue when the queue has reached empty, or reading lines from a stream.
#### mapper(element, index)
Type: `Function`
Expected to return a `Promise` or value.
#### options
Type: `object`
##### concurrency
Type: `number` *(Integer)*\
Default: `Infinity`\
Minimum: `1`
Number of concurrently pending promises returned by `mapper`.
##### backpressure
**Only for `pMapIterable`**
Type: `number` *(Integer)*\
Default: `options.concurrency`\
Minimum: `options.concurrency`
Maximum number of promises returned by `mapper` that have resolved but not yet collected by the consumer of the async iterable. Calls to `mapper` will be limited so that there is never too much backpressure.
Useful whenever you are consuming the iterable slower than what the mapper function can produce concurrently. For example, to avoid making an overwhelming number of HTTP requests if you are saving each of the results to a database.
##### stopOnError
**Only for `pMap`**
Type: `boolean`\
Default: `true`
When `true`, the first mapper rejection will be rejected back to the consumer.
When `false`, instead of stopping when a promise rejects, it will wait for all the promises to settle and then reject with an [`AggregateError`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError) containing all the errors from the rejected promises.
Caveat: When `true`, any already-started async mappers will continue to run until they resolve or reject. In the case of infinite concurrency with sync iterables, *all* mappers are invoked on startup and will continue after the first rejection. [Issue #51](https://github.com/sindresorhus/p-map/issues/51) can be implemented for abort control.
##### signal
**Only for `pMap`**
Type: [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal)
You can abort the promises using [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController).
```js
import pMap from 'p-map';
import delay from 'delay';
const abortController = new AbortController();
setTimeout(() => {
abortController.abort();
}, 500);
const mapper = async value => value;
await pMap([delay(1000), delay(1000)], mapper, {signal: abortController.signal});
// Throws AbortError (DOMException) after 500 ms.
```
### pMapSkip
Return this value from a `mapper` function to skip including the value in the returned array.
```js
import pMap, {pMapSkip} from 'p-map';
import got from 'got';
const sites = [
getWebsiteFromUsername('sindresorhus'), //=> Promise
'https://avajs.dev',
'https://example.invalid',
'https://github.com'
];
const mapper = async site => {
try {
const {requestUrl} = await got.head(site);
return requestUrl;
} catch {
return pMapSkip;
}
};
const result = await pMap(sites, mapper, {concurrency: 2});
console.log(result);
//=> ['https://sindresorhus.com/', 'https://avajs.dev/', 'https://github.com/']
```
## Related
- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency
- [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently
- [p-times](https://github.com/sindresorhus/p-times) - Run promise-returning & async functions a specific number of times concurrently
- [p-props](https://github.com/sindresorhus/p-props) - Like `Promise.all()` but for `Map` and `Object`
- [p-map-series](https://github.com/sindresorhus/p-map-series) - Map over promises serially
- [More…](https://github.com/sindresorhus/promise-fun)
@@ -0,0 +1,21 @@
"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 _useLatest = _interopRequireDefault(require("../useLatest"));
function useGetState(initialState) {
var _a = (0, _tslib.__read)((0, _react.useState)(initialState), 2),
state = _a[0],
setState = _a[1];
var stateRef = (0, _useLatest["default"])(state);
var getState = (0, _react.useCallback)(function () {
return stateRef.current;
}, []);
return [state, setState, getState];
}
var _default = exports["default"] = useGetState;
@@ -0,0 +1,8 @@
'use strict';
var hasSymbols = require('has-symbols');
/** @type {import('.')} */
module.exports = function hasToStringTag() {
return hasSymbols() && typeof Symbol.toStringTag === 'symbol';
};
@@ -0,0 +1,64 @@
function valueType (value) {
if (value === undefined) return 'undefined'
if (Array.isArray(value)) return 'array'
if (typeof value === 'object') return 'object'
return 'scalar'
}
function setLastValue (context, step, currentValue, entryValue) {
switch (valueType(currentValue)) {
case 'undefined':
if (step.append) {
context[step.key] = [entryValue]
} else {
context[step.key] = entryValue
}
break
case 'array':
context[step.key].push(entryValue)
break
case 'object':
return setLastValue(currentValue, { type: 'object', key: '', last: true }, currentValue[''], entryValue)
case 'scalar':
context[step.key] = [context[step.key], entryValue]
break
}
return context
}
function setValue (context, step, currentValue, entryValue) {
if (step.last) return setLastValue(context, step, currentValue, entryValue)
var obj
switch (valueType(currentValue)) {
case 'undefined':
if (step.nextType === 'array') {
context[step.key] = []
} else {
context[step.key] = Object.create(null)
}
return context[step.key]
case 'object':
return context[step.key]
case 'array':
if (step.nextType === 'array') {
return currentValue
}
obj = Object.create(null)
context[step.key] = obj
currentValue.forEach(function (item, i) {
if (item !== undefined) obj['' + i] = item
})
return obj
case 'scalar':
obj = Object.create(null)
obj[''] = currentValue
context[step.key] = obj
return obj
}
}
module.exports = setValue
@@ -0,0 +1 @@
{"mappings":";;;AA6BA;;;GAGG;AACH,6BAA6B;KAC1B,CAAC,IAAI,MAAM,uBAAuB,GAAG,uBAAuB,CAAC,CAAC,CAAC,SAAS,eAAe,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK;CAC7G,CAAC;AAEF;;;GAGG;AACH,+BAA+B,IAAI,iBAAiB,CAAC;AAErD,0BAA0B,OAAO,CAAC;AAElC;;;GAGG;AACH,kCAAkC,MAAM,IAAI,CAAC,qBAAqB,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;AAE1F;;;;GAIG;AACH,gCAAgC,IAAI,CAAC,qBAAqB,EAAE,0BAA0B,CAAC,CAAC;AAExF;;;;GAIG;AACH,mCAAmC,IAAI,CAAC,uBAAuB,EAAE,0BAA0B,CAAC,CAAC;AAE7F;;;GAGG;AACH,yBAAyB,CAAC,SAAS,0BAA0B,IAAI,2BAA2B,CAAC,CAAC,CAAC,CAAC;AAEhG,sCAAsC,CAAC,SAAS,0BAA0B,CAAE,SAAQ,mBAAmB,wBAAwB,CAAC,CAAC,CAAC,CAAC;IACjI;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,CAAC,CAAC;IACrB;;;OAGG;IACH,cAAc,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,IAAI,GAAG,WAAW,GAAG,OAAO,GAAG,YAAY,CAAA;CAC9E;AAED;;;;GAIG;AACH,wBAAwB,CAAC,SAAS,0BAA0B,IAAI,UAAU,wBAAwB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;AAE9G,+BAA+B,CAAC,SAAS,0BAA0B,GAAG,kBAAkB,CAAE,SAAQ,gBAAgB;IAChH,mCAAmC;IACnC,UAAU,EAAE,oBAAoB,CAAC,CAAC,CAAC;IACnC,gEAAgE;IAChE,UAAU,EAAE,aAAa,GAAG,oBAAoB,gBAAgB,CAAC,CAAC;IAClE,8DAA8D;IAC9D,gBAAgB,EAAE,aAAa,CAAC;IAChC,gEAAgE;IAChE,iBAAiB,EAAE,aAAa,CAAA;CACjC;AAED;;;;GAIG;AACH,6BAA6B,CAAC,SAAS,0BAA0B,GAAG,kBAAkB,EACpF,KAAK,EAAE,qBAAqB,CAAC,CAAC,EAC9B,GAAG,EAAE,mBAAmB,CAAC,CAAC,GACzB,cAAc,CAAC,CAAC,CAoGlB;AClMD;IACE,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IACnC,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;CACrC;AASD,sCAAsC,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,uBAAuB,EAAE,QAAQ,EAAE,YAAU,gBAAgB,GAAG,IAAI,CAAC,GAAG,aAAa,CAoI5J;ACnJD,YAAY,EAAC,kBAAkB,EAAC,MAAM,wBAAwB,CAAC","sources":["packages/@react-aria/textfield/src/packages/@react-aria/textfield/src/useTextField.ts","packages/@react-aria/textfield/src/packages/@react-aria/textfield/src/useFormattedTextField.ts","packages/@react-aria/textfield/src/packages/@react-aria/textfield/src/index.ts","packages/@react-aria/textfield/src/index.ts"],"sourcesContent":[null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nexport type {TextFieldAria} from './useTextField';\nexport {useTextField} from './useTextField';\nexport {useFormattedTextField} from './useFormattedTextField';\nexport type {AriaTextFieldOptions} from './useTextField';\nexport type {AriaTextFieldProps} from '@react-types/textfield';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
@@ -0,0 +1,30 @@
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* See LICENSE file in root directory for full license.
*/
"use strict"
module.exports = {
meta: {
docs: {
description: "disallow generator function declarations.",
category: "ES2015",
recommended: false,
url:
"http://mysticatea.github.io/eslint-plugin-es/rules/no-generators.html",
},
fixable: null,
messages: {
forbidden: "ES2015 generator function declarations are forbidden.",
},
schema: [],
type: "problem",
},
create(context) {
return {
":function[generator=true]"(node) {
context.report({ node, messageId: "forbidden" })
},
}
},
}
@@ -0,0 +1,4 @@
import { cjsRequire } from './require.js';
export const { name, version } = cjsRequire('../package.json');
export const meta = { name, version };
//# sourceMappingURL=meta.js.map
@@ -0,0 +1,15 @@
/**
* @param {Html} node
* @returns {string}
*/
export function html(node: Html): string;
export namespace html {
export { htmlPeek as peek };
}
import type { Html } from 'mdast';
/**
* @returns {string}
*/
declare function htmlPeek(): string;
export {};
//# sourceMappingURL=html.d.ts.map
Loaded 100 of 35554 files, more files were not shown because too many files have changed in this diff. Show more